@d0nj/dsh-narration 0.0.0-stage → 0.2.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/README.md +80 -2
- package/cordis.patch.yml +7 -0
- package/dist/ansi.d.ts +13 -0
- package/dist/ansi.js +83 -0
- package/dist/client/assistant.d.ts +25 -0
- package/dist/client/assistant.js +208 -0
- package/dist/client/client.js +1609 -0
- package/dist/client/index.d.ts +16 -0
- package/dist/client/index.js +78 -0
- package/dist/client/rail.d.ts +20 -0
- package/dist/client/rail.js +182 -0
- package/dist/client/style.d.ts +4 -0
- package/dist/client/style.js +373 -0
- package/dist/client/tool.d.ts +37 -0
- package/dist/client/tool.js +384 -0
- package/dist/diff.d.ts +31 -0
- package/dist/diff.js +181 -0
- package/dist/envelope.d.ts +7 -0
- package/dist/envelope.js +29 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +39 -0
- package/dist/live.d.ts +48 -0
- package/dist/live.js +124 -0
- package/dist/narration.d.ts +9 -0
- package/dist/narration.js +27 -0
- package/dist/pacing.d.ts +17 -0
- package/dist/pacing.js +92 -0
- package/icon.svg +16 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +70 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactApi } from './assistant.js';
|
|
3
|
+
export declare const inject: readonly ["slots", "configForms"];
|
|
4
|
+
export declare const CHAT_SLOT = "conversation.chat.node";
|
|
5
|
+
export declare const ASSISTANT_KEY = "assistant-step";
|
|
6
|
+
export declare const TOOL_KEY = "tool-call";
|
|
7
|
+
export declare const SHADOW_PRIORITY = -1;
|
|
8
|
+
export declare function useReact(react: ReactApi): void;
|
|
9
|
+
export interface NarrationFlags {
|
|
10
|
+
readonly liveReasoning: boolean;
|
|
11
|
+
readonly verboseTools: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function flagsOf(value: unknown): NarrationFlags;
|
|
14
|
+
export declare function installStyles(doc: Document): () => void;
|
|
15
|
+
export declare function apply(ctx: Context): void;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createAssistantNarration } from './assistant.js';
|
|
2
|
+
import { createToolNarration } from './tool.js';
|
|
3
|
+
import { CSS, STYLE_ELEMENT_ID } from './style.js';
|
|
4
|
+
export const inject = ['slots', 'configForms'];
|
|
5
|
+
export const CHAT_SLOT = 'conversation.chat.node';
|
|
6
|
+
export const ASSISTANT_KEY = 'assistant-step';
|
|
7
|
+
export const TOOL_KEY = 'tool-call';
|
|
8
|
+
export const SHADOW_PRIORITY = -1;
|
|
9
|
+
let ReactImpl;
|
|
10
|
+
export function useReact(react) {
|
|
11
|
+
ReactImpl = react;
|
|
12
|
+
}
|
|
13
|
+
export function flagsOf(value) {
|
|
14
|
+
if (value === null || typeof value !== 'object')
|
|
15
|
+
return { liveReasoning: true, verboseTools: true };
|
|
16
|
+
const record = value;
|
|
17
|
+
return {
|
|
18
|
+
liveReasoning: record.liveReasoning !== false,
|
|
19
|
+
verboseTools: record.verboseTools !== false,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function installStyles(doc) {
|
|
23
|
+
const existing = doc.getElementById(STYLE_ELEMENT_ID);
|
|
24
|
+
if (existing !== null)
|
|
25
|
+
existing.remove();
|
|
26
|
+
const element = doc.createElement('style');
|
|
27
|
+
element.id = STYLE_ELEMENT_ID;
|
|
28
|
+
element.textContent = CSS;
|
|
29
|
+
doc.head.appendChild(element);
|
|
30
|
+
return () => {
|
|
31
|
+
element.remove();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function apply(ctx) {
|
|
35
|
+
if (ReactImpl === undefined)
|
|
36
|
+
return;
|
|
37
|
+
const slots = ctx.slots;
|
|
38
|
+
if (slots === undefined)
|
|
39
|
+
return;
|
|
40
|
+
const forms = ctx.configForms;
|
|
41
|
+
const Assistant = createAssistantNarration(ReactImpl);
|
|
42
|
+
const Tool = createToolNarration(ReactImpl);
|
|
43
|
+
ctx.effect(() => installStyles(document));
|
|
44
|
+
let assistantMount;
|
|
45
|
+
let toolMount;
|
|
46
|
+
const mount = (key, component) => slots.inject(CHAT_SLOT, () => slots.register({ name: CHAT_SLOT, key, priority: SHADOW_PRIORITY }, component));
|
|
47
|
+
const sync = (value) => {
|
|
48
|
+
const flags = flagsOf(value);
|
|
49
|
+
if (flags.liveReasoning && assistantMount === undefined) {
|
|
50
|
+
assistantMount = mount(ASSISTANT_KEY, Assistant);
|
|
51
|
+
}
|
|
52
|
+
else if (!flags.liveReasoning && assistantMount !== undefined) {
|
|
53
|
+
assistantMount();
|
|
54
|
+
assistantMount = undefined;
|
|
55
|
+
}
|
|
56
|
+
if (flags.verboseTools && toolMount === undefined) {
|
|
57
|
+
toolMount = mount(TOOL_KEY, Tool);
|
|
58
|
+
}
|
|
59
|
+
else if (!flags.verboseTools && toolMount !== undefined) {
|
|
60
|
+
toolMount();
|
|
61
|
+
toolMount = undefined;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
ctx.effect(() => () => {
|
|
65
|
+
assistantMount?.();
|
|
66
|
+
toolMount?.();
|
|
67
|
+
assistantMount = undefined;
|
|
68
|
+
toolMount = undefined;
|
|
69
|
+
});
|
|
70
|
+
if (forms === undefined) {
|
|
71
|
+
sync(undefined);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const form = forms.get('narration');
|
|
75
|
+
ctx.effect(() => form.subscribe(() => sync(form.getSnapshot().value)));
|
|
76
|
+
sync(form.getSnapshot().value);
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LiveCall } from '../live.js';
|
|
2
|
+
export interface ReactApi {
|
|
3
|
+
createElement(type: unknown, props?: Record<string, unknown> | null, ...children: unknown[]): unknown;
|
|
4
|
+
useState<T>(initial: T | (() => T)): [T, (next: T | ((prev: T) => T)) => void];
|
|
5
|
+
useEffect(effect: () => void | (() => void), deps?: readonly unknown[]): void;
|
|
6
|
+
useRef<T>(initial: T): {
|
|
7
|
+
current: T;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
type Selector = (snapshot: unknown) => unknown;
|
|
11
|
+
export interface RailProps {
|
|
12
|
+
readonly sessionId?: string | undefined;
|
|
13
|
+
readonly useSession?: ((select: Selector) => unknown) | undefined;
|
|
14
|
+
readonly useSessionStatus?: ((select: Selector) => unknown) | undefined;
|
|
15
|
+
readonly useChat?: ((select: Selector) => unknown) | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function toLiveCalls(raw: unknown): LiveCall[];
|
|
18
|
+
export declare function createNarrationRail(React: ReactApi): (props: RailProps) => unknown;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=rail.d.ts.map
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { PacedText, RateMeter } from '../pacing.js';
|
|
2
|
+
import { formatElapsed, formatRate, narrateCall, phaseLabel, summarize, } from '../live.js';
|
|
3
|
+
import { PHASE_COLOUR } from './style.js';
|
|
4
|
+
const NO_SELECT = () => undefined;
|
|
5
|
+
const MISSING_ARGS = { text: () => undefined };
|
|
6
|
+
function legacyOf(snapshot) {
|
|
7
|
+
if (snapshot === null || typeof snapshot !== 'object')
|
|
8
|
+
return undefined;
|
|
9
|
+
const legacy = snapshot.legacy;
|
|
10
|
+
return legacy !== null && typeof legacy === 'object' ? legacy : undefined;
|
|
11
|
+
}
|
|
12
|
+
function sessionRunning(snapshot) {
|
|
13
|
+
return snapshot !== null && typeof snapshot === 'object' && snapshot.running === true;
|
|
14
|
+
}
|
|
15
|
+
function statusRunning(statuses, sessionId) {
|
|
16
|
+
if (sessionId.length === 0 || statuses === null || typeof statuses !== 'object')
|
|
17
|
+
return false;
|
|
18
|
+
const read = statuses.get;
|
|
19
|
+
if (typeof read !== 'function')
|
|
20
|
+
return false;
|
|
21
|
+
const status = read.call(statuses, sessionId);
|
|
22
|
+
return status !== null && typeof status === 'object' && status.running === true;
|
|
23
|
+
}
|
|
24
|
+
export function toLiveCalls(raw) {
|
|
25
|
+
if (!Array.isArray(raw))
|
|
26
|
+
return [];
|
|
27
|
+
const calls = [];
|
|
28
|
+
for (const entry of raw) {
|
|
29
|
+
if (entry === null || typeof entry !== 'object')
|
|
30
|
+
continue;
|
|
31
|
+
const record = entry;
|
|
32
|
+
if (typeof record.callId !== 'string' || typeof record.name !== 'string')
|
|
33
|
+
continue;
|
|
34
|
+
const source = record.args;
|
|
35
|
+
const usable = source !== null && typeof source === 'object' && typeof source.text === 'function';
|
|
36
|
+
calls.push({
|
|
37
|
+
callId: record.callId,
|
|
38
|
+
name: record.name,
|
|
39
|
+
phase: record.phase === 'start' ? 'start' : 'preparing',
|
|
40
|
+
time: typeof record.time === 'number' ? record.time : 0,
|
|
41
|
+
args: usable ? source : MISSING_ARGS,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return calls;
|
|
45
|
+
}
|
|
46
|
+
function joinedBlocks(partial, kind) {
|
|
47
|
+
if (partial === null || typeof partial !== 'object')
|
|
48
|
+
return '';
|
|
49
|
+
const blocks = partial.blocks;
|
|
50
|
+
if (!Array.isArray(blocks))
|
|
51
|
+
return '';
|
|
52
|
+
let text = '';
|
|
53
|
+
for (const block of blocks) {
|
|
54
|
+
if (block === null || typeof block !== 'object')
|
|
55
|
+
continue;
|
|
56
|
+
const entry = block;
|
|
57
|
+
if (entry.kind !== kind || typeof entry.text !== 'string')
|
|
58
|
+
continue;
|
|
59
|
+
text += entry.text;
|
|
60
|
+
}
|
|
61
|
+
return text;
|
|
62
|
+
}
|
|
63
|
+
function usePacedText(React, target, animating) {
|
|
64
|
+
const [shown, setShown] = React.useState(target);
|
|
65
|
+
const stream = React.useRef({ seen: target, queue: new PacedText() });
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
const state = stream.current;
|
|
68
|
+
const previouslySeen = state.seen;
|
|
69
|
+
state.seen = target;
|
|
70
|
+
if (!target.startsWith(previouslySeen)) {
|
|
71
|
+
state.queue.reset();
|
|
72
|
+
setShown(target);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const delta = target.slice(previouslySeen.length);
|
|
76
|
+
if (delta.length === 0)
|
|
77
|
+
return;
|
|
78
|
+
if (!animating) {
|
|
79
|
+
state.queue.reset();
|
|
80
|
+
setShown(target);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
state.queue.push(delta);
|
|
84
|
+
let frame = 0;
|
|
85
|
+
const step = () => {
|
|
86
|
+
const chunk = state.queue.take();
|
|
87
|
+
if (chunk.length > 0)
|
|
88
|
+
setShown((previous) => previous + chunk);
|
|
89
|
+
frame = state.queue.pending > 0 ? requestAnimationFrame(step) : 0;
|
|
90
|
+
};
|
|
91
|
+
frame = requestAnimationFrame(step);
|
|
92
|
+
return () => {
|
|
93
|
+
if (frame !== 0)
|
|
94
|
+
cancelAnimationFrame(frame);
|
|
95
|
+
};
|
|
96
|
+
}, [target, animating]);
|
|
97
|
+
return shown;
|
|
98
|
+
}
|
|
99
|
+
function useClock(React, running, meter, charsOf) {
|
|
100
|
+
const [now, setNow] = React.useState(() => Date.now());
|
|
101
|
+
const [rate, setRate] = React.useState(0);
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
if (!running) {
|
|
104
|
+
meter.current.reset();
|
|
105
|
+
setRate(0);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const tick = setInterval(() => {
|
|
109
|
+
const at = Date.now();
|
|
110
|
+
setNow(at);
|
|
111
|
+
setRate(meter.current.sample(at, charsOf()));
|
|
112
|
+
}, 100);
|
|
113
|
+
return () => clearInterval(tick);
|
|
114
|
+
}, [running]);
|
|
115
|
+
return { now, rate };
|
|
116
|
+
}
|
|
117
|
+
function callRow(React, call, now) {
|
|
118
|
+
const narration = narrateCall(call, 220);
|
|
119
|
+
const spent = call.time > 0 ? formatElapsed(Math.max(0, now - call.time)) : '';
|
|
120
|
+
return React.createElement('div', { key: call.callId, className: 'd0nj-nar-call', 'data-preparing': String(narration.preparing) }, React.createElement('span', { className: 'd0nj-nar-verb' }, narration.verb), React.createElement('span', { className: 'd0nj-nar-arg' }, narration.argument, React.createElement('span', { className: 'd0nj-nar-caret' })), spent.length > 0 ? React.createElement('span', { className: 'd0nj-nar-spent' }, spent) : null);
|
|
121
|
+
}
|
|
122
|
+
export function createNarrationRail(React) {
|
|
123
|
+
const h = React.createElement;
|
|
124
|
+
return function NarrationRail(props) {
|
|
125
|
+
const useChat = props.useChat ?? NO_SELECT;
|
|
126
|
+
const useSession = props.useSession ?? NO_SELECT;
|
|
127
|
+
const useSessionStatus = props.useSessionStatus ?? NO_SELECT;
|
|
128
|
+
const sessionId = props.sessionId ?? '';
|
|
129
|
+
const rawCalls = useChat((snapshot) => legacyOf(snapshot)?.runningCalls);
|
|
130
|
+
const rawPartial = useChat((snapshot) => legacyOf(snapshot)?.partial);
|
|
131
|
+
const runningFromSession = useSession(sessionRunning) === true;
|
|
132
|
+
const runningFromStatus = useSessionStatus((statuses) => statusRunning(statuses, sessionId)) === true;
|
|
133
|
+
const running = runningFromSession || runningFromStatus;
|
|
134
|
+
const calls = toLiveCalls(rawCalls);
|
|
135
|
+
const reasoningTarget = joinedBlocks(rawPartial, 'reasoning');
|
|
136
|
+
const answer = joinedBlocks(rawPartial, 'text');
|
|
137
|
+
const reasoning = usePacedText(React, reasoningTarget, running);
|
|
138
|
+
const start = React.useRef(0);
|
|
139
|
+
React.useEffect(() => {
|
|
140
|
+
start.current = running ? Date.now() : 0;
|
|
141
|
+
}, [running]);
|
|
142
|
+
const meter = React.useRef(new RateMeter());
|
|
143
|
+
const charsRef = React.useRef(0);
|
|
144
|
+
charsRef.current = reasoningTarget.length + answer.length;
|
|
145
|
+
const { now, rate } = useClock(React, running, meter, () => charsRef.current);
|
|
146
|
+
const [open, setOpen] = React.useState(false);
|
|
147
|
+
const pinned = React.useRef(true);
|
|
148
|
+
const summary = summarize({ calls, reasoning, answer, running, limit: 140 });
|
|
149
|
+
const phase = summary.phase;
|
|
150
|
+
const working = running || calls.length > 0;
|
|
151
|
+
if (!working && reasoning.length === 0 && answer.length === 0)
|
|
152
|
+
return null;
|
|
153
|
+
const elapsed = start.current === 0 ? 0 : Math.max(0, now - start.current);
|
|
154
|
+
const reasoningBlock = open && reasoning.length > 0
|
|
155
|
+
? h('pre', {
|
|
156
|
+
className: 'd0nj-nar-reason',
|
|
157
|
+
onScroll: (event) => {
|
|
158
|
+
const node = event.currentTarget;
|
|
159
|
+
pinned.current = node.scrollHeight - node.scrollTop - node.clientHeight < 12;
|
|
160
|
+
},
|
|
161
|
+
ref: (node) => {
|
|
162
|
+
if (node !== null && pinned.current)
|
|
163
|
+
node.scrollTop = node.scrollHeight;
|
|
164
|
+
},
|
|
165
|
+
}, reasoning)
|
|
166
|
+
: null;
|
|
167
|
+
const rows = calls.length > 0
|
|
168
|
+
? h('div', { className: 'd0nj-nar-calls' }, calls.map((call) => callRow(React, call, now)))
|
|
169
|
+
: null;
|
|
170
|
+
const body = reasoningBlock === null && rows === null
|
|
171
|
+
? null
|
|
172
|
+
: h('div', { className: 'd0nj-nar-body' }, reasoningBlock, rows);
|
|
173
|
+
return h('div', { className: working ? 'd0nj-nar d0nj-nar-working' : 'd0nj-nar' }, h('button', {
|
|
174
|
+
type: 'button',
|
|
175
|
+
className: 'd0nj-nar-head',
|
|
176
|
+
'aria-expanded': open,
|
|
177
|
+
onClick: () => setOpen((previous) => !previous),
|
|
178
|
+
style: { '--d0nj-nar-phase': PHASE_COLOUR[phase] ?? PHASE_COLOUR.idle },
|
|
179
|
+
}, h('span', { className: 'd0nj-nar-dot' }), h('span', { className: 'd0nj-nar-phase' }, phaseLabel(phase)), h('span', { className: 'd0nj-nar-lead' }, summary.lead), h('span', { className: 'd0nj-nar-metrics' }, h('span', null, formatElapsed(elapsed)), working ? h('span', null, formatRate(rate)) : null)), body);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=rail.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const STYLE_ELEMENT_ID = "d0nj-narration-style";
|
|
2
|
+
export declare const CSS = "\n.d0nj-narr {\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 100%;\n min-width: 0;\n font-family: var(--dsw-font-family, inherit);\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-narr-live {\n display: flex;\n align-items: baseline;\n gap: 8px;\n width: 100%;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-secondary);\n text-align: left;\n cursor: pointer;\n}\n.d0nj-narr-live:focus-visible {\n outline: 2px solid var(--dsw-alias-label-primary);\n outline-offset: 2px;\n}\n.d0nj-narr-dot {\n flex: none;\n align-self: center;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--d0nj-narr-phase, var(--dsw-alias-state-idle-primary));\n}\n.d0nj-narr-live[data-working=\"true\"] .d0nj-narr-dot { animation: d0nj-narr-pulse 1.6s ease-in-out infinite; }\n.d0nj-narr-phase {\n flex: none;\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n font-weight: 600;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n.d0nj-narr-metrics {\n flex: none;\n display: flex;\n gap: 10px;\n margin-left: auto;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-narr-calls {\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n.d0nj-narr-call {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n}\n.d0nj-narr-verb {\n flex: none;\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-narr-arg {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: baseline;\n overflow: hidden;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-narr-dir {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n direction: rtl;\n text-align: left;\n opacity: 0.7;\n}\n.d0nj-narr-base {\n flex: none;\n white-space: pre;\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-narr-caret {\n flex: none;\n width: 5px;\n height: 11px;\n margin-left: 2px;\n background: var(--dsw-alias-label-primary);\n animation: d0nj-narr-blink 1s steps(1) infinite;\n}\n.d0nj-narr-call[data-preparing=\"false\"] .d0nj-narr-caret { display: none; }\n.d0nj-narr-spent {\n flex: none;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-narr-think {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding-left: 12px;\n border-left: 1px solid var(--dsw-alias-border-l1);\n}\n.d0nj-narr-think-head {\n display: flex;\n align-items: center;\n align-self: flex-start;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n cursor: pointer;\n}\n.d0nj-narr-think-head:hover { color: var(--dsw-alias-label-primary); }\n.d0nj-narr-think-head:focus-visible {\n outline: 2px solid var(--dsw-alias-label-primary);\n outline-offset: 2px;\n}\n.d0nj-narr-think-body {\n margin: 0;\n max-height: none;\n overflow: visible;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n line-height: 1.7;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-narr-answer {\n min-width: 0;\n}\n.d0nj-narr-plain {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font-family: var(--dsw-font-family, inherit);\n font-size: var(--dsw-font-s-14-font-size, 14px);\n line-height: 1.65;\n}\n.d0nj-tool {\n display: flex;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n border: 1px solid var(--dsw-alias-border-l1);\n border-radius: var(--dsw-radius-m, 8px);\n background: var(--dsw-alias-bg-layer-1);\n overflow: hidden;\n font-family: var(--dsw-font-family, inherit);\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-tool > * + * { border-top: 1px solid var(--dsw-alias-border-l1); }\n.d0nj-tool-head {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n padding: 7px 12px;\n font-size: var(--dsw-font-xs-13-font-size, 13px);\n}\n.d0nj-tool-icon {\n flex: none;\n align-self: center;\n width: 1em;\n font-size: 10px;\n line-height: 1;\n text-align: center;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool-icon[data-state=\"start\"] { color: var(--dsw-alias-label-primary); }\n.d0nj-tool-icon[data-state=\"done\"] { color: var(--dsw-alias-state-success-primary); }\n.d0nj-tool-icon[data-state=\"failed\"] { color: var(--dsw-alias-state-error-primary); }\n.d0nj-tool-verb { flex: none; color: var(--dsw-alias-label-primary); }\n.d0nj-tool-target {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool-state {\n flex: none;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool[data-error=\"true\"] .d0nj-tool-state { color: var(--dsw-alias-state-error-primary); }\n.d0nj-tool-meta {\n padding: 6px 12px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool-args {\n margin: 0;\n padding: 8px 12px;\n overflow-x: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font: var(--dsw-font-markdown-code-block, var(--dsw-font-markdown-code));\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool-command {\n margin: 0;\n padding: 8px 12px;\n overflow-x: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font: var(--dsw-font-markdown-code-block, var(--dsw-font-markdown-code));\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-tool-prompt {\n color: var(--dsw-alias-label-secondary);\n user-select: none;\n}\n.d0nj-tool-output {\n margin: 0;\n padding: 8px 12px;\n max-height: 60vh;\n overflow: auto;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n font: var(--dsw-font-markdown-code-block, var(--dsw-font-markdown-code));\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-tool[data-error=\"true\"] .d0nj-tool-output { color: var(--dsw-alias-state-error-primary); }\n.d0nj-term[data-tone=\"error\"] { color: var(--dsw-alias-state-error-primary); }\n.d0nj-term[data-tone=\"success\"] { color: var(--dsw-alias-state-success-primary); }\n.d0nj-term[data-tone=\"warn\"] { color: var(--dsw-alias-state-warn-primary); }\n.d0nj-term[data-bold=\"true\"] { font-weight: 600; }\n.d0nj-term[data-dim=\"true\"] { opacity: 0.65; }\n.d0nj-term[data-underline=\"true\"] { text-decoration: underline; }\n.d0nj-tool-output:empty, .d0nj-tool-args:empty { display: none; }\n.d0nj-tool-sub {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px 12px;\n}\n.d0nj-tool-stat {\n flex: none;\n margin-left: 8px;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxs-12-font-size, 12px);\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-secondary);\n}\n.d0nj-diff {\n margin: 0;\n padding: 6px 0;\n max-height: 60vh;\n overflow: auto;\n font: var(--dsw-font-markdown-code-block, var(--dsw-font-markdown-code));\n line-height: 1.55;\n}\n.d0nj-diff-line {\n display: flex;\n align-items: baseline;\n padding: 0 10px;\n white-space: pre;\n color: var(--dsw-alias-label-primary);\n}\n.d0nj-diff-line[data-kind=\"hunk\"] {\n display: block;\n padding: 2px 10px;\n color: var(--dsw-alias-label-secondary);\n opacity: 0.75;\n}\n.d0nj-diff-line[data-kind=\"add\"] {\n color: var(--dsw-alias-state-success-primary);\n background: color-mix(in oklab, var(--dsw-alias-state-success-primary) 14%, transparent);\n}\n.d0nj-diff-line[data-kind=\"remove\"] {\n color: var(--dsw-alias-state-error-primary);\n background: color-mix(in oklab, var(--dsw-alias-state-error-primary) 14%, transparent);\n}\n.d0nj-diff-sign {\n flex: none;\n width: 1ch;\n}\n.d0nj-diff-no {\n flex: none;\n padding: 0 6px 0 2px;\n text-align: right;\n font-variant-numeric: tabular-nums;\n opacity: 0.5;\n}\n.d0nj-diff-bar {\n flex: none;\n margin-right: 8px;\n opacity: 0.25;\n}\n.d0nj-diff-text {\n flex: 1 1 auto;\n white-space: pre;\n}\n.d0nj-tool-out-wrap {\n display: flex;\n flex-direction: column;\n}\n.d0nj-tool-more {\n align-self: flex-start;\n margin: 8px 12px 0;\n padding: 0;\n border: 0;\n background: transparent;\n font-family: var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)));\n font-size: var(--dsw-font-xxxs-11-font-size, 11px);\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n.d0nj-tool-more:hover { color: var(--dsw-alias-label-primary); }\n.d0nj-tool-more:focus-visible {\n outline: 2px solid var(--dsw-alias-label-primary);\n outline-offset: 2px;\n}\n@keyframes d0nj-narr-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.3; }\n}\n@keyframes d0nj-narr-blink {\n 0%, 49% { opacity: 1; }\n 50%, 100% { opacity: 0; }\n}\n@media (prefers-reduced-motion: reduce) {\n .d0nj-narr-dot, .d0nj-narr-caret { animation: none; }\n}\n";
|
|
3
|
+
export declare const PHASE_COLOUR: Readonly<Record<string, string>>;
|
|
4
|
+
//# sourceMappingURL=style.d.ts.map
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
export const STYLE_ELEMENT_ID = 'd0nj-narration-style';
|
|
2
|
+
const TEXT_FAMILY = 'var(--dsw-font-family, inherit)';
|
|
3
|
+
const CODE_FAMILY = 'var(--dsw-font-markdown-code-block-font-family, var(--dsw-font-markdown-code-font-family, var(--dsw-font-family, ui-monospace)))';
|
|
4
|
+
const CODE = 'var(--dsw-font-markdown-code-block, var(--dsw-font-markdown-code))';
|
|
5
|
+
const LINE = 'var(--dsw-alias-border-l1)';
|
|
6
|
+
const DIM = 'var(--dsw-alias-label-secondary)';
|
|
7
|
+
const INK = 'var(--dsw-alias-label-primary)';
|
|
8
|
+
export const CSS = `
|
|
9
|
+
.d0nj-narr {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 10px;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
font-family: ${TEXT_FAMILY};
|
|
16
|
+
color: ${INK};
|
|
17
|
+
}
|
|
18
|
+
.d0nj-narr-live {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: baseline;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin: 0;
|
|
24
|
+
padding: 0;
|
|
25
|
+
border: 0;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
background: transparent;
|
|
28
|
+
font-family: ${TEXT_FAMILY};
|
|
29
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
30
|
+
color: ${DIM};
|
|
31
|
+
text-align: left;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
.d0nj-narr-live:focus-visible {
|
|
35
|
+
outline: 2px solid ${INK};
|
|
36
|
+
outline-offset: 2px;
|
|
37
|
+
}
|
|
38
|
+
.d0nj-narr-dot {
|
|
39
|
+
flex: none;
|
|
40
|
+
align-self: center;
|
|
41
|
+
width: 6px;
|
|
42
|
+
height: 6px;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
background: var(--d0nj-narr-phase, var(--dsw-alias-state-idle-primary));
|
|
45
|
+
}
|
|
46
|
+
.d0nj-narr-live[data-working="true"] .d0nj-narr-dot { animation: d0nj-narr-pulse 1.6s ease-in-out infinite; }
|
|
47
|
+
.d0nj-narr-phase {
|
|
48
|
+
flex: none;
|
|
49
|
+
font-family: ${TEXT_FAMILY};
|
|
50
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
letter-spacing: 0.08em;
|
|
53
|
+
text-transform: uppercase;
|
|
54
|
+
}
|
|
55
|
+
.d0nj-narr-metrics {
|
|
56
|
+
flex: none;
|
|
57
|
+
display: flex;
|
|
58
|
+
gap: 10px;
|
|
59
|
+
margin-left: auto;
|
|
60
|
+
font-family: ${CODE_FAMILY};
|
|
61
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
62
|
+
font-variant-numeric: tabular-nums;
|
|
63
|
+
color: ${DIM};
|
|
64
|
+
}
|
|
65
|
+
.d0nj-narr-calls {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: 2px;
|
|
69
|
+
}
|
|
70
|
+
.d0nj-narr-call {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: baseline;
|
|
73
|
+
gap: 8px;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
font-family: ${TEXT_FAMILY};
|
|
76
|
+
font-size: var(--dsw-font-xs-13-font-size, 13px);
|
|
77
|
+
}
|
|
78
|
+
.d0nj-narr-verb {
|
|
79
|
+
flex: none;
|
|
80
|
+
color: ${INK};
|
|
81
|
+
}
|
|
82
|
+
.d0nj-narr-arg {
|
|
83
|
+
flex: 1 1 auto;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
display: flex;
|
|
86
|
+
align-items: baseline;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
font-family: ${CODE_FAMILY};
|
|
89
|
+
font-size: var(--dsw-font-xxs-12-font-size, 12px);
|
|
90
|
+
color: ${DIM};
|
|
91
|
+
}
|
|
92
|
+
.d0nj-narr-dir {
|
|
93
|
+
flex: 0 1 auto;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
direction: rtl;
|
|
99
|
+
text-align: left;
|
|
100
|
+
opacity: 0.7;
|
|
101
|
+
}
|
|
102
|
+
.d0nj-narr-base {
|
|
103
|
+
flex: none;
|
|
104
|
+
white-space: pre;
|
|
105
|
+
color: ${INK};
|
|
106
|
+
}
|
|
107
|
+
.d0nj-narr-caret {
|
|
108
|
+
flex: none;
|
|
109
|
+
width: 5px;
|
|
110
|
+
height: 11px;
|
|
111
|
+
margin-left: 2px;
|
|
112
|
+
background: ${INK};
|
|
113
|
+
animation: d0nj-narr-blink 1s steps(1) infinite;
|
|
114
|
+
}
|
|
115
|
+
.d0nj-narr-call[data-preparing="false"] .d0nj-narr-caret { display: none; }
|
|
116
|
+
.d0nj-narr-spent {
|
|
117
|
+
flex: none;
|
|
118
|
+
font-family: ${CODE_FAMILY};
|
|
119
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
120
|
+
font-variant-numeric: tabular-nums;
|
|
121
|
+
color: ${DIM};
|
|
122
|
+
}
|
|
123
|
+
.d0nj-narr-think {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 6px;
|
|
127
|
+
padding-left: 12px;
|
|
128
|
+
border-left: 1px solid ${LINE};
|
|
129
|
+
}
|
|
130
|
+
.d0nj-narr-think-head {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
align-self: flex-start;
|
|
134
|
+
margin: 0;
|
|
135
|
+
padding: 0;
|
|
136
|
+
border: 0;
|
|
137
|
+
background: transparent;
|
|
138
|
+
color: ${DIM};
|
|
139
|
+
font-family: ${TEXT_FAMILY};
|
|
140
|
+
font-size: var(--dsw-font-xxs-12-font-size, 12px);
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
143
|
+
.d0nj-narr-think-head:hover { color: ${INK}; }
|
|
144
|
+
.d0nj-narr-think-head:focus-visible {
|
|
145
|
+
outline: 2px solid ${INK};
|
|
146
|
+
outline-offset: 2px;
|
|
147
|
+
}
|
|
148
|
+
.d0nj-narr-think-body {
|
|
149
|
+
margin: 0;
|
|
150
|
+
max-height: none;
|
|
151
|
+
overflow: visible;
|
|
152
|
+
white-space: pre-wrap;
|
|
153
|
+
overflow-wrap: anywhere;
|
|
154
|
+
font-family: ${TEXT_FAMILY};
|
|
155
|
+
font-size: var(--dsw-font-xs-13-font-size, 13px);
|
|
156
|
+
line-height: 1.7;
|
|
157
|
+
color: ${DIM};
|
|
158
|
+
}
|
|
159
|
+
.d0nj-narr-answer {
|
|
160
|
+
min-width: 0;
|
|
161
|
+
}
|
|
162
|
+
.d0nj-narr-plain {
|
|
163
|
+
white-space: pre-wrap;
|
|
164
|
+
overflow-wrap: anywhere;
|
|
165
|
+
font-family: ${TEXT_FAMILY};
|
|
166
|
+
font-size: var(--dsw-font-s-14-font-size, 14px);
|
|
167
|
+
line-height: 1.65;
|
|
168
|
+
}
|
|
169
|
+
.d0nj-tool {
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
width: 100%;
|
|
173
|
+
min-width: 0;
|
|
174
|
+
border: 1px solid ${LINE};
|
|
175
|
+
border-radius: var(--dsw-radius-m, 8px);
|
|
176
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
font-family: ${TEXT_FAMILY};
|
|
179
|
+
color: ${INK};
|
|
180
|
+
}
|
|
181
|
+
.d0nj-tool > * + * { border-top: 1px solid ${LINE}; }
|
|
182
|
+
.d0nj-tool-head {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: baseline;
|
|
185
|
+
gap: 8px;
|
|
186
|
+
min-width: 0;
|
|
187
|
+
padding: 7px 12px;
|
|
188
|
+
font-size: var(--dsw-font-xs-13-font-size, 13px);
|
|
189
|
+
}
|
|
190
|
+
.d0nj-tool-icon {
|
|
191
|
+
flex: none;
|
|
192
|
+
align-self: center;
|
|
193
|
+
width: 1em;
|
|
194
|
+
font-size: 10px;
|
|
195
|
+
line-height: 1;
|
|
196
|
+
text-align: center;
|
|
197
|
+
color: ${DIM};
|
|
198
|
+
}
|
|
199
|
+
.d0nj-tool-icon[data-state="start"] { color: ${INK}; }
|
|
200
|
+
.d0nj-tool-icon[data-state="done"] { color: var(--dsw-alias-state-success-primary); }
|
|
201
|
+
.d0nj-tool-icon[data-state="failed"] { color: var(--dsw-alias-state-error-primary); }
|
|
202
|
+
.d0nj-tool-verb { flex: none; color: ${INK}; }
|
|
203
|
+
.d0nj-tool-target {
|
|
204
|
+
flex: 1 1 auto;
|
|
205
|
+
min-width: 0;
|
|
206
|
+
overflow: hidden;
|
|
207
|
+
text-overflow: ellipsis;
|
|
208
|
+
white-space: nowrap;
|
|
209
|
+
font-family: ${CODE_FAMILY};
|
|
210
|
+
font-size: var(--dsw-font-xxs-12-font-size, 12px);
|
|
211
|
+
color: ${DIM};
|
|
212
|
+
}
|
|
213
|
+
.d0nj-tool-state {
|
|
214
|
+
flex: none;
|
|
215
|
+
font-family: ${CODE_FAMILY};
|
|
216
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
217
|
+
font-variant-numeric: tabular-nums;
|
|
218
|
+
color: ${DIM};
|
|
219
|
+
}
|
|
220
|
+
.d0nj-tool[data-error="true"] .d0nj-tool-state { color: var(--dsw-alias-state-error-primary); }
|
|
221
|
+
.d0nj-tool-meta {
|
|
222
|
+
padding: 6px 12px;
|
|
223
|
+
overflow: hidden;
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
text-overflow: ellipsis;
|
|
226
|
+
font-family: ${CODE_FAMILY};
|
|
227
|
+
font-size: var(--dsw-font-xxs-12-font-size, 12px);
|
|
228
|
+
color: ${DIM};
|
|
229
|
+
}
|
|
230
|
+
.d0nj-tool-args {
|
|
231
|
+
margin: 0;
|
|
232
|
+
padding: 8px 12px;
|
|
233
|
+
overflow-x: auto;
|
|
234
|
+
white-space: pre-wrap;
|
|
235
|
+
overflow-wrap: anywhere;
|
|
236
|
+
font: ${CODE};
|
|
237
|
+
color: ${DIM};
|
|
238
|
+
}
|
|
239
|
+
.d0nj-tool-command {
|
|
240
|
+
margin: 0;
|
|
241
|
+
padding: 8px 12px;
|
|
242
|
+
overflow-x: auto;
|
|
243
|
+
white-space: pre-wrap;
|
|
244
|
+
overflow-wrap: anywhere;
|
|
245
|
+
font: ${CODE};
|
|
246
|
+
color: ${INK};
|
|
247
|
+
}
|
|
248
|
+
.d0nj-tool-prompt {
|
|
249
|
+
color: ${DIM};
|
|
250
|
+
user-select: none;
|
|
251
|
+
}
|
|
252
|
+
.d0nj-tool-output {
|
|
253
|
+
margin: 0;
|
|
254
|
+
padding: 8px 12px;
|
|
255
|
+
max-height: 60vh;
|
|
256
|
+
overflow: auto;
|
|
257
|
+
white-space: pre-wrap;
|
|
258
|
+
overflow-wrap: anywhere;
|
|
259
|
+
font: ${CODE};
|
|
260
|
+
line-height: 1.5;
|
|
261
|
+
color: ${DIM};
|
|
262
|
+
}
|
|
263
|
+
.d0nj-tool[data-error="true"] .d0nj-tool-output { color: var(--dsw-alias-state-error-primary); }
|
|
264
|
+
.d0nj-term[data-tone="error"] { color: var(--dsw-alias-state-error-primary); }
|
|
265
|
+
.d0nj-term[data-tone="success"] { color: var(--dsw-alias-state-success-primary); }
|
|
266
|
+
.d0nj-term[data-tone="warn"] { color: var(--dsw-alias-state-warn-primary); }
|
|
267
|
+
.d0nj-term[data-bold="true"] { font-weight: 600; }
|
|
268
|
+
.d0nj-term[data-dim="true"] { opacity: 0.65; }
|
|
269
|
+
.d0nj-term[data-underline="true"] { text-decoration: underline; }
|
|
270
|
+
.d0nj-tool-output:empty, .d0nj-tool-args:empty { display: none; }
|
|
271
|
+
.d0nj-tool-sub {
|
|
272
|
+
display: flex;
|
|
273
|
+
flex-direction: column;
|
|
274
|
+
gap: 8px;
|
|
275
|
+
padding: 8px 12px;
|
|
276
|
+
}
|
|
277
|
+
.d0nj-tool-stat {
|
|
278
|
+
flex: none;
|
|
279
|
+
margin-left: 8px;
|
|
280
|
+
font-family: ${CODE_FAMILY};
|
|
281
|
+
font-size: var(--dsw-font-xxs-12-font-size, 12px);
|
|
282
|
+
font-variant-numeric: tabular-nums;
|
|
283
|
+
color: ${DIM};
|
|
284
|
+
}
|
|
285
|
+
.d0nj-diff {
|
|
286
|
+
margin: 0;
|
|
287
|
+
padding: 6px 0;
|
|
288
|
+
max-height: 60vh;
|
|
289
|
+
overflow: auto;
|
|
290
|
+
font: ${CODE};
|
|
291
|
+
line-height: 1.55;
|
|
292
|
+
}
|
|
293
|
+
.d0nj-diff-line {
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: baseline;
|
|
296
|
+
padding: 0 10px;
|
|
297
|
+
white-space: pre;
|
|
298
|
+
color: ${INK};
|
|
299
|
+
}
|
|
300
|
+
.d0nj-diff-line[data-kind="hunk"] {
|
|
301
|
+
display: block;
|
|
302
|
+
padding: 2px 10px;
|
|
303
|
+
color: ${DIM};
|
|
304
|
+
opacity: 0.75;
|
|
305
|
+
}
|
|
306
|
+
.d0nj-diff-line[data-kind="add"] {
|
|
307
|
+
color: var(--dsw-alias-state-success-primary);
|
|
308
|
+
background: color-mix(in oklab, var(--dsw-alias-state-success-primary) 14%, transparent);
|
|
309
|
+
}
|
|
310
|
+
.d0nj-diff-line[data-kind="remove"] {
|
|
311
|
+
color: var(--dsw-alias-state-error-primary);
|
|
312
|
+
background: color-mix(in oklab, var(--dsw-alias-state-error-primary) 14%, transparent);
|
|
313
|
+
}
|
|
314
|
+
.d0nj-diff-sign {
|
|
315
|
+
flex: none;
|
|
316
|
+
width: 1ch;
|
|
317
|
+
}
|
|
318
|
+
.d0nj-diff-no {
|
|
319
|
+
flex: none;
|
|
320
|
+
padding: 0 6px 0 2px;
|
|
321
|
+
text-align: right;
|
|
322
|
+
font-variant-numeric: tabular-nums;
|
|
323
|
+
opacity: 0.5;
|
|
324
|
+
}
|
|
325
|
+
.d0nj-diff-bar {
|
|
326
|
+
flex: none;
|
|
327
|
+
margin-right: 8px;
|
|
328
|
+
opacity: 0.25;
|
|
329
|
+
}
|
|
330
|
+
.d0nj-diff-text {
|
|
331
|
+
flex: 1 1 auto;
|
|
332
|
+
white-space: pre;
|
|
333
|
+
}
|
|
334
|
+
.d0nj-tool-out-wrap {
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-direction: column;
|
|
337
|
+
}
|
|
338
|
+
.d0nj-tool-more {
|
|
339
|
+
align-self: flex-start;
|
|
340
|
+
margin: 8px 12px 0;
|
|
341
|
+
padding: 0;
|
|
342
|
+
border: 0;
|
|
343
|
+
background: transparent;
|
|
344
|
+
font-family: ${CODE_FAMILY};
|
|
345
|
+
font-size: var(--dsw-font-xxxs-11-font-size, 11px);
|
|
346
|
+
color: ${DIM};
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
}
|
|
349
|
+
.d0nj-tool-more:hover { color: ${INK}; }
|
|
350
|
+
.d0nj-tool-more:focus-visible {
|
|
351
|
+
outline: 2px solid ${INK};
|
|
352
|
+
outline-offset: 2px;
|
|
353
|
+
}
|
|
354
|
+
@keyframes d0nj-narr-pulse {
|
|
355
|
+
0%, 100% { opacity: 1; }
|
|
356
|
+
50% { opacity: 0.3; }
|
|
357
|
+
}
|
|
358
|
+
@keyframes d0nj-narr-blink {
|
|
359
|
+
0%, 49% { opacity: 1; }
|
|
360
|
+
50%, 100% { opacity: 0; }
|
|
361
|
+
}
|
|
362
|
+
@media (prefers-reduced-motion: reduce) {
|
|
363
|
+
.d0nj-narr-dot, .d0nj-narr-caret { animation: none; }
|
|
364
|
+
}
|
|
365
|
+
`;
|
|
366
|
+
export const PHASE_COLOUR = {
|
|
367
|
+
idle: 'var(--dsw-alias-state-idle-primary)',
|
|
368
|
+
thinking: 'var(--dsw-alias-label-secondary)',
|
|
369
|
+
writing: 'var(--dsw-alias-label-primary)',
|
|
370
|
+
calling: 'var(--dsw-alias-label-primary)',
|
|
371
|
+
holding: 'var(--dsw-alias-state-warn-primary)',
|
|
372
|
+
};
|
|
373
|
+
//# sourceMappingURL=style.js.map
|