@eigenhq/kern 0.1.0 → 0.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/dist/index.d.ts +35 -17
- package/dist/index.js +204 -194
- package/dist/index.js.map +1 -1
- package/dist-artifact/kern-artifact.css +9471 -0
- package/dist-artifact/kern-artifact.js +170 -0
- package/package.json +11 -4
- package/skills/kern/SKILL.md +119 -0
- package/skills/kern/recipes/app-shell.tsx +111 -0
- package/skills/kern/recipes/dashboard.tsx +125 -0
- package/skills/kern/recipes/document.tsx +50 -0
- package/skills/kern/recipes/run-review.tsx +324 -0
- package/skills/kern/recipes/settings-page.tsx +53 -0
- package/skills/kern/references/agent-runs.md +67 -0
- package/skills/kern/references/artifacts.md +106 -0
- package/skills/kern/references/choosing-parts.md +109 -0
- package/skills/kern/references/props.md +61 -0
- package/skills/kern/references/rules.md +96 -0
- package/src/code/code.css +90 -0
- package/src/styles/kern.css +374 -355
- package/themes/eigen.css +190 -190
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# The props of the parts you reach for most
|
|
2
|
+
|
|
3
|
+
The full reference is Kern's types: `dist/index.d.ts` in the package, `components/index.d.ts` in the Kern design
|
|
4
|
+
system. These are the parts agents use most, with the props that matter. In an artifact write them with `Kern.h`:
|
|
5
|
+
`h(StatusPill, { label: "missed", tone: "red" })`.
|
|
6
|
+
|
|
7
|
+
## Panes
|
|
8
|
+
|
|
9
|
+
- `Panes` — `children`: the panes side by side at full height. Wrap it in a container with a height (`h-dvh`).
|
|
10
|
+
- `ListPane` — `label` (its name for screen readers), `header?` (usually a search field), `footer?`, `children`, `widthPx?`
|
|
11
|
+
(320 by default).
|
|
12
|
+
- `ContentPane` — `label?`, `children`. Takes the width the other panes leave.
|
|
13
|
+
- `InspectorPane` — `label?` ("Inspector"), `widthPx?` (400 by default), `children`. It keeps its width; the content pane
|
|
14
|
+
gives way.
|
|
15
|
+
- `PaneBar` — `placement` (`"over"` floats over the content), `leading?`, `center?`, `trailing?`. A comparison switch goes
|
|
16
|
+
in `center`.
|
|
17
|
+
|
|
18
|
+
## Lists and rows
|
|
19
|
+
|
|
20
|
+
- `ListRows` — `label`, `children`: the list of `ListRow`s in a list pane.
|
|
21
|
+
- `ListRow` — `title`, `subtitle?` (one line: "what changed · score"), `avatar?` (a node: an `Avatar` or an `IconTile`),
|
|
22
|
+
`trailing?`, `selected?`, `onSelect?`, `href?` (makes it a link), `marker?`, `contextMenu?`, `separator?`.
|
|
23
|
+
- `PageSection` — `variant` (`"card"` for controls and rows, `"plain"` for prose and facts), `title`, `trailing?` (a
|
|
24
|
+
count: "1 of 3 met"), `footnote?` (card only), `children`.
|
|
25
|
+
- `InsetRow` — `leading` (a 28px `IconTile`, or `null`), `title`, `detail?` (one line), `trailing?` (a `StatusPill`, a
|
|
26
|
+
value, a `Switch`). Rows in one `PageSection variant="card"` per group.
|
|
27
|
+
- `HairlineList` + `FactRow` — `label`, the value as `children`; an id is a `CopyableValue` (`value`, `label`).
|
|
28
|
+
- `StatusPill` — `label` (a lowercase state word), `tone`: `"blue"` (met, done, current), `"red"` (missed, failed —
|
|
29
|
+
drawn with its border so it reads as a pill on a white card), `"amber"` (needs a look), `"muted"` (not reachable,
|
|
30
|
+
skipped), `"cloud"` (a category).
|
|
31
|
+
|
|
32
|
+
## Conversation
|
|
33
|
+
|
|
34
|
+
- `ConversationView` — `header?`, `composer?`, `scrollKey?`, and a FUNCTION child:
|
|
35
|
+
`(threadViewContainer) => h(ThreadedTranscript, { …, threadViewContainer })`.
|
|
36
|
+
- `ThreadedTranscript` — `messages` (`TranscriptMessage[]`: `id`, `outgoing`, `senderName`, `createdAt` ISO,
|
|
37
|
+
`replyToMessageId` or `null`, `quoteText`, `isAttachment`), `isGroupChat`, `outgoingName`,
|
|
38
|
+
`renderMessage(message, position)` (return the bubble or card for one message), `renderBefore?(message)` (what goes
|
|
39
|
+
above a message: event lines, tool calls, a date).
|
|
40
|
+
- `ChatBubble` — `speaker` (`"outgoing"` the viewer's side, `"incoming"` the others), `tail?` (last of a run),
|
|
41
|
+
`children` (the text).
|
|
42
|
+
- `LinkPreviewCard` — `url`, `domain`, `title?`, `imageUrl?`, `tail?` (`"left"` or `"right"`). Never a raw URL in a
|
|
43
|
+
bubble; show a short domain, not `localhost`.
|
|
44
|
+
- `TranscriptEventDivider` — `messageType` (a stable kind, such as `"recommendation"`), `label` ("Recommendation"),
|
|
45
|
+
`text` ("run finished · four tracks"), `timestamp?`, `onSelect?` (opens it in the inspector).
|
|
46
|
+
- `ToolCallGroup` — `calls`: `{ id, name, doneName?, kind, status ("running" | "done" | "failed"), durationMs?,
|
|
47
|
+
summary?, error? }[]` (each call's fields are `ToolCallCard`'s props), `layout?` (`"rows"`, or `"squaring"` to fold
|
|
48
|
+
finished calls into one line), `squaredSummary?`.
|
|
49
|
+
|
|
50
|
+
## Inspector
|
|
51
|
+
|
|
52
|
+
- `PageTabBar` — `children`: a `SegmentedControl` (`label`, `value`, `onValueChange`, `options: { value, label }[]`) of
|
|
53
|
+
the tabs.
|
|
54
|
+
- `Page` — `children`: a tab's content with its insets and 32px sections.
|
|
55
|
+
- `InspectorHeader` — `variant: "title"` with `title`, `detail?`, `actions?`; or `variant: "identity"` with `leading` (an
|
|
56
|
+
avatar), `title`, `detail?`, `actions?`.
|
|
57
|
+
- `RunTimeline` — `spans` (`{ id, name, shortName?, kind, status, startMs, durationMs?, detail? }[]`),
|
|
58
|
+
`totalDurationMs`, `variant` (`"stroke"` under a reply, `"waterfall"` in an inspector, `"list"`), `placement?`,
|
|
59
|
+
`summary?`.
|
|
60
|
+
- `LogStream` — `lines` (`{ id, text, level?, timestampLabel? }[]`), `state` (`"streaming"`, `"done"` or `"failed"`),
|
|
61
|
+
`title?`, `maxHeightPx?`.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Kern's rules, with the tokens behind them
|
|
2
|
+
|
|
3
|
+
Each rule names the class or part that keeps it, so you never need a raw value.
|
|
4
|
+
|
|
5
|
+
## Spacing and insets
|
|
6
|
+
|
|
7
|
+
| What | Value | Class or part |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| A pane's top row from the pane's top | 12px | `pt-pane-top` / `mt-pane-top`; `PaneBar`, `ListPane`'s header and `PageTabBar` already do it |
|
|
10
|
+
| Height of a control in a pane's top row | 36px | `h-control` |
|
|
11
|
+
| Between sections | 32px | `gap-section`; `Page` already does it |
|
|
12
|
+
| Start of a row's hairline in a card (after its 28px tile) | 52px | `ml-row-inset`; `InsetRow` already does it |
|
|
13
|
+
| Content pane sides | 16px | `px-4` |
|
|
14
|
+
| Inspector content | 12px sides, 8px top, 20px bottom | `Page` |
|
|
15
|
+
| Cards in a grid | 12px gap | `gap-3` |
|
|
16
|
+
| Inside a card | 16px | `p-4` for free content; rows bring their own padding |
|
|
17
|
+
|
|
18
|
+
**Do** let the parts place things: `Page`, `PageSection`, `InsetRow`, `ListPane`, `PaneBar` all carry their insets.
|
|
19
|
+
**Don't** wrap parts in extra padded `div`s, set margins between siblings, or put content flush against a pane edge.
|
|
20
|
+
|
|
21
|
+
## Widths
|
|
22
|
+
|
|
23
|
+
- Body text: `max-w-[62ch]` (`BodyText measure`, `Lead` and `Heading` pages already cap it).
|
|
24
|
+
- A page of settings or a form: one column, `max-w-[640px] mx-auto`.
|
|
25
|
+
- A document: `max-w-[720px] mx-auto`.
|
|
26
|
+
- Bubbles: `ThreadedTranscript` sizes them. A bubble on its own: wrap it in `max-w-[70%]`, aligned to its side.
|
|
27
|
+
- Tool call groups in a transcript: about `max-w-[420px]`, on the agent's side.
|
|
28
|
+
- Panes: list 320px, inspector 400px (the defaults); the content pane takes the rest.
|
|
29
|
+
|
|
30
|
+
## Type
|
|
31
|
+
|
|
32
|
+
| Role | Class | Use |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| micro | `text-micro` (10) | badges and counts only |
|
|
35
|
+
| caption | `text-caption` (11) | section labels (`SectionLabel`), pills, timestamps |
|
|
36
|
+
| footnote | `text-footnote` (12) | secondary lines, details under a row's title |
|
|
37
|
+
| body | `text-body` (13) | rows, paragraphs, most text |
|
|
38
|
+
| callout | `text-callout` (15) | a lead paragraph |
|
|
39
|
+
| headline | `text-headline` (17) | a card or page header (`PageHeader`) |
|
|
40
|
+
| title | `text-title` (22) | a pane's title (`PaneTitle`) |
|
|
41
|
+
| large title | `text-large-title` (26) | a page's title (`LargeTitle`) |
|
|
42
|
+
|
|
43
|
+
- The interface is the system font (the `kern` class). The story face (`font-story`, Optima) is only for a sign-in title,
|
|
44
|
+
the wordmark, a title card or a story page.
|
|
45
|
+
- Hierarchy comes from size, weight and colour: secondary text is grey and smaller (`text-label-secondary`), not the
|
|
46
|
+
main text bolder.
|
|
47
|
+
- Sentence case. No eyebrow (a small label over a heading). No `uppercase` with `tracking-*`.
|
|
48
|
+
- Numbers that line up use `tabular-nums`.
|
|
49
|
+
|
|
50
|
+
## Colour
|
|
51
|
+
|
|
52
|
+
- **Surfaces:** `bg-surface-base` (the page and content pane), `bg-surface-grouped` (an inspector, a grouped page),
|
|
53
|
+
`bg-surface-sidebar` (a list pane), `bg-surface-raised` (a lifted surface).
|
|
54
|
+
- **Text:** `text-label-primary`, `text-label-secondary` (details), `text-label-tertiary` (placeholders, quiet marks),
|
|
55
|
+
`text-label-on-tint` (on the accent or a palette fill).
|
|
56
|
+
- **Fills:** `bg-fill-base` (a quiet button or chip), `bg-fill-hover`.
|
|
57
|
+
- **Lines:** `border-separator-hairline`.
|
|
58
|
+
- **The accent:** `tint-base` (selection, the current item, a link that acts). One accent, used sparingly.
|
|
59
|
+
- **State:** `StatusPill` tones `blue`, `amber`, `red`, `muted`, `cloud`; `Badge` adds `green`; `Alert` tones `neutral`,
|
|
60
|
+
`warning`, `error`, `success`. State is always a word or glyph too, never colour alone.
|
|
61
|
+
- **The palette:** seven ramps, `meadow`, `air`, `cloud`, `poplar`, `path`, `dusk`, `roof`, steps 50–900
|
|
62
|
+
(`bg-meadow-500`, `text-poplar-700`), the same in both themes. Use them for tiles, avatars, chart series and
|
|
63
|
+
categories, not for text on surfaces. `path-500` is the neutral grey tile.
|
|
64
|
+
- **Never** a hex value, `rgb()`, or a default Tailwind colour (`bg-gray-100`, `text-blue-600`). Kern's checks reject
|
|
65
|
+
them in its own source; hold your screens to the same.
|
|
66
|
+
|
|
67
|
+
## Surfaces and glass
|
|
68
|
+
|
|
69
|
+
- A **card** is glass (`Card`, `PageSection variant="card"`, `StatusCard`): for controls and groups of tappable rows.
|
|
70
|
+
Prose and plain lists sit on the page (`PageSection variant="plain"`, `HairlineList`).
|
|
71
|
+
- **Never a card inside a card.** Inside a card, group with space and a `SectionLabel`.
|
|
72
|
+
- **Glass capsules** (`GlassCapsule`, `GlassButton`, glass `IconButton`s) hold controls that float over content.
|
|
73
|
+
- **Panes** draw as glass when they sit in `Panes` (and in `AppWindow`), over the wash.
|
|
74
|
+
- Nothing has a coloured background except tiles, avatars, pills and the accent.
|
|
75
|
+
|
|
76
|
+
## Icons
|
|
77
|
+
|
|
78
|
+
- From Kern's exports (Zeichen's glyphs): Outline at rest, `…BoldIcon` for the current item and anything 12px or smaller.
|
|
79
|
+
- Plain, human glyphs; never sparkles, several stars, wands or robots.
|
|
80
|
+
- An icon beside a label is decorative; an icon on its own gets a label on its button (`IconButton label="…"`).
|
|
81
|
+
|
|
82
|
+
## Words
|
|
83
|
+
|
|
84
|
+
- Sentence case, plain and short. A title names the thing.
|
|
85
|
+
- Details are joined with " · ": "Proactive · 2 hours ago".
|
|
86
|
+
- Pills are lowercase state words: `met`, `missed`, `not reachable`, `review`.
|
|
87
|
+
- An empty state is one sentence with a full stop (`EmptyPane`, `Empty`).
|
|
88
|
+
- A failure is one grey line with a retry; the technical message goes in a tooltip.
|
|
89
|
+
- A button says what happens ("Save", "Retry", "Forget…" when it asks first).
|
|
90
|
+
- A tooltip explains something not obvious, such as why a button is disabled.
|
|
91
|
+
|
|
92
|
+
## Motion
|
|
93
|
+
|
|
94
|
+
- Use the parts' own transitions; don't add CSS animations of your own.
|
|
95
|
+
- Durations come from `MOTION` (fade 240ms, slide and disclosure 320ms, reveal 520ms) on the sheet curve (`ease-sheet`).
|
|
96
|
+
- Every part honours reduced motion; anything you add must too (`motion-reduce:` variants).
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code, diffs and truncated names (src/code). Imported by tokens.css, so an app that imports Kern's tokens has them.
|
|
3
|
+
*
|
|
4
|
+
* The colours are the theme's `--theme-code-*` tokens. Pierre's Diffs and Shiki draw every token as `var(--kern-code-token-*)`
|
|
5
|
+
* through the `kern` theme (pierre-loader.ts), so these aliases keep that prefix and follow the theme's `.dark` and `.light` scopes.
|
|
6
|
+
*/
|
|
7
|
+
:root,
|
|
8
|
+
.light {
|
|
9
|
+
--kern-code-scheme: light;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dark {
|
|
13
|
+
--kern-code-scheme: dark;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:root,
|
|
17
|
+
.light,
|
|
18
|
+
.dark {
|
|
19
|
+
--kern-code-foreground: var(--theme-code-foreground);
|
|
20
|
+
--kern-code-background: var(--theme-code-background);
|
|
21
|
+
--kern-code-border: var(--theme-code-border);
|
|
22
|
+
--kern-code-line-number: var(--theme-code-line-number);
|
|
23
|
+
--kern-code-highlight: var(--theme-code-highlight);
|
|
24
|
+
--kern-code-highlight-edge: var(--theme-code-highlight-edge);
|
|
25
|
+
--kern-code-added: var(--theme-code-added);
|
|
26
|
+
--kern-code-added-text: var(--theme-code-added-text);
|
|
27
|
+
--kern-code-added-tint: var(--theme-code-added-tint);
|
|
28
|
+
--kern-code-removed: var(--theme-code-removed);
|
|
29
|
+
--kern-code-removed-text: var(--theme-code-removed-text);
|
|
30
|
+
--kern-code-removed-tint: var(--theme-code-removed-tint);
|
|
31
|
+
--kern-code-modified: var(--theme-code-modified);
|
|
32
|
+
--kern-code-token-comment: var(--theme-code-token-comment);
|
|
33
|
+
--kern-code-token-keyword: var(--theme-code-token-keyword);
|
|
34
|
+
--kern-code-token-string: var(--theme-code-token-string);
|
|
35
|
+
--kern-code-token-string-expression: var(--theme-code-token-string-expression);
|
|
36
|
+
--kern-code-token-constant: var(--theme-code-token-constant);
|
|
37
|
+
--kern-code-token-function: var(--theme-code-token-function);
|
|
38
|
+
--kern-code-token-parameter: var(--theme-code-token-parameter);
|
|
39
|
+
--kern-code-token-punctuation: var(--theme-code-token-punctuation);
|
|
40
|
+
--kern-code-token-link: var(--theme-code-token-link);
|
|
41
|
+
--kern-code-token-inserted: var(--theme-code-token-inserted);
|
|
42
|
+
--kern-code-token-deleted: var(--theme-code-token-deleted);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* Pierre draws into a shadow root (`diffs-container`). Custom properties inherit into it, and these rules on the host
|
|
47
|
+
* win over its own `:host` rules, so its colour scheme follows Kern's scope rather than the operating system's.
|
|
48
|
+
*/
|
|
49
|
+
diffs-container {
|
|
50
|
+
color-scheme: var(--kern-code-scheme);
|
|
51
|
+
--diffs-font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
|
|
52
|
+
--diffs-header-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
|
|
53
|
+
--diffs-font-size: 12px;
|
|
54
|
+
--diffs-line-height: 19px;
|
|
55
|
+
--diffs-light: var(--kern-code-foreground);
|
|
56
|
+
--diffs-dark: var(--kern-code-foreground);
|
|
57
|
+
--diffs-light-bg: var(--kern-code-background);
|
|
58
|
+
--diffs-dark-bg: var(--kern-code-background);
|
|
59
|
+
--diffs-fg-number-override: var(--kern-code-line-number);
|
|
60
|
+
--diffs-addition-color-override: var(--kern-code-added);
|
|
61
|
+
--diffs-deletion-color-override: var(--kern-code-removed);
|
|
62
|
+
--diffs-modified-color-override: var(--kern-code-modified);
|
|
63
|
+
--diffs-bg-addition-override: var(--kern-code-added-tint);
|
|
64
|
+
--diffs-bg-deletion-override: var(--kern-code-removed-tint);
|
|
65
|
+
--diffs-bg-separator-override: color-mix(in oklab, var(--kern-code-background) 94%, var(--kern-code-foreground));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* TruncatedText draws its `…` on this colour; a surface other than the page sets the variable to its own. The gap hides the sliver of a clipped letter. */
|
|
69
|
+
.kern-truncate {
|
|
70
|
+
--truncate-marker-background-color: var(--kern-truncate-marker-background, var(--theme-surface-base));
|
|
71
|
+
--truncate-marker-gap: 4px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* TruncatedText on a translucent surface: the `…` has no background, and the clipped edge of each container whose
|
|
76
|
+
* text overflows (marked data-kern-clipped by the component) fades out under it. These selectors outrank Pierre's own.
|
|
77
|
+
*/
|
|
78
|
+
.kern-truncate-translucent [data-truncate-variant] [data-truncate-marker] {
|
|
79
|
+
background: transparent;
|
|
80
|
+
}
|
|
81
|
+
.kern-truncate-translucent [data-truncate-variant] [data-truncate-marker]::before,
|
|
82
|
+
.kern-truncate-translucent [data-truncate-variant] [data-truncate-marker]::after {
|
|
83
|
+
content: none;
|
|
84
|
+
}
|
|
85
|
+
.kern-truncate-translucent [data-truncate-container="truncate"][data-kern-clipped] [data-truncate-content="visible"] {
|
|
86
|
+
mask-image: linear-gradient(to right, black calc(100% - 1.6em), transparent calc(100% - 0.95em));
|
|
87
|
+
}
|
|
88
|
+
.kern-truncate-translucent [data-truncate-container="fruncate"][data-kern-clipped] [data-truncate-content="visible"] {
|
|
89
|
+
mask-image: linear-gradient(to left, black calc(100% - 1.6em), transparent calc(100% - 0.95em));
|
|
90
|
+
}
|