@leitwerk-dev/ui 0.1.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/dist/LICENSE +13 -0
- package/dist/assets/ChronicleMarkdown-BLgtHeEE.js +16 -0
- package/dist/assets/ChronicleMarkdown-D6hFzERy.css +1 -0
- package/dist/assets/FutureLaunchDetailPage-KrXSGzHM.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-VPMBtpYc.css +1 -0
- package/dist/assets/GenericLauncher-Cv38FByt.js +1 -0
- package/dist/assets/GenericLauncher-D_GMtsQ5.css +1 -0
- package/dist/assets/HomePage-Cd3lEtwZ.js +1 -0
- package/dist/assets/HomePage-DYh_QHXv.css +1 -0
- package/dist/assets/PageHeader-6PdvYODN.css +1 -0
- package/dist/assets/PageHeader-D6pP4hIh.js +1 -0
- package/dist/assets/ProcessActionsMenu-1QySGNy9.js +1 -0
- package/dist/assets/ProcessActionsMenu-BT2r9vO8.css +1 -0
- package/dist/assets/ProcessDetailPage-BLuc7sjV.js +12 -0
- package/dist/assets/ProcessDetailPage-CSrjzajF.css +1 -0
- package/dist/assets/ProcessFlowDiagram-BAh_M_rb.js +2 -0
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +1 -0
- package/dist/assets/ProcessesPage-BcM38HMs.css +1 -0
- package/dist/assets/ProcessesPage-DtPweRU-.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CQGvY-Rc.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-CadXN9z7.css +1 -0
- package/dist/assets/SkillsPage-B30FAFia.css +1 -0
- package/dist/assets/SkillsPage-bXuv0kEE.js +2 -0
- package/dist/assets/WatchersPage-DNyUsU1y.js +1 -0
- package/dist/assets/WatchersPage-Dnfi1zUK.css +1 -0
- package/dist/assets/api-CqECFdii.js +1 -0
- package/dist/assets/browser-storage-LbKCyf_w.js +1 -0
- package/dist/assets/dist-B7WNbObw.js +2 -0
- package/dist/assets/index-66T4Gmbl.css +1 -0
- package/dist/assets/index-C8qCggeq.js +7 -0
- package/dist/assets/index-client-BqF3_t3P.js +2 -0
- package/dist/assets/mermaid-render.worker-DAVgiVRG.js +6393 -0
- package/dist/assets/retry-config.svelte-DFKCJtCe.js +1 -0
- package/dist/assets/router.svelte-COr45o9R.js +1 -0
- package/dist/fonts/OFL-Public-Sans.txt +115 -0
- package/dist/fonts/OFL-Spectral.txt +93 -0
- package/dist/fonts/README.md +38 -0
- package/dist/fonts/fonts.css +85 -0
- package/dist/fonts/public-sans-latin-cd00287f.woff2 +0 -0
- package/dist/fonts/public-sans-latin-ext-d025d4ba.woff2 +0 -0
- package/dist/fonts/spectral-latin-89d48951.woff2 +0 -0
- package/dist/fonts/spectral-latin-b7578f14.woff2 +0 -0
- package/dist/fonts/spectral-latin-c4e0a00d.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-260738f4.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-ab18ac17.woff2 +0 -0
- package/dist/fonts/spectral-latin-ext-f58c1db3.woff2 +0 -0
- package/dist/index.html +32 -0
- package/package.json +47 -0
- package/src/App.svelte +257 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +1035 -0
- package/src/chronicle/components/ChronicleExpandButton.svelte +70 -0
- package/src/chronicle/components/ChronicleFlow.svelte +289 -0
- package/src/chronicle/components/ChronicleLeafOutcomePlaceholder.svelte +44 -0
- package/src/chronicle/components/ChronicleLeafOutcomeRendererHost.svelte +408 -0
- package/src/chronicle/components/ChronicleLeafOutcomeSection.svelte +253 -0
- package/src/chronicle/components/ChronicleLiveChip.svelte +96 -0
- package/src/chronicle/components/ChronicleLiveTail.svelte +376 -0
- package/src/chronicle/components/ChronicleMarkdown.svelte +168 -0
- package/src/chronicle/components/ChronicleOperatorInputSection.svelte +41 -0
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +131 -0
- package/src/chronicle/components/ChroniclePromptSection.svelte +54 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +167 -0
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +893 -0
- package/src/chronicle/components/ChronicleRecoverySection.svelte +338 -0
- package/src/chronicle/components/ChronicleScheduledActionSection.svelte +192 -0
- package/src/chronicle/components/ChronicleSectionHeader.svelte +135 -0
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +138 -0
- package/src/chronicle/components/ChronicleTerminalSummary.svelte +127 -0
- package/src/chronicle/components/ChronicleThinkingSection.svelte +191 -0
- package/src/chronicle/components/ChronicleThinkingText.svelte +46 -0
- package/src/chronicle/components/ChronicleToolCallItem.svelte +477 -0
- package/src/chronicle/components/ChronicleTurnCluster.svelte +325 -0
- package/src/chronicle/components/ChronicleTurnRail.svelte +584 -0
- package/src/chronicle/components/ChronicleUsageStats.svelte +107 -0
- package/src/chronicle/components/CompactActionComposer.svelte +417 -0
- package/src/chronicle/components/ModelProfileOptions.svelte +20 -0
- package/src/chronicle/components/ProviderOptionsEditor.svelte +171 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +95 -0
- package/src/chronicle/lib/action-bindings.ts +90 -0
- package/src/chronicle/lib/action-model-display.ts +133 -0
- package/src/chronicle/lib/action-preview.ts +16 -0
- package/src/chronicle/lib/chronicle-projection.ts +1342 -0
- package/src/chronicle/lib/chronicle-selectable-items.ts +352 -0
- package/src/chronicle/lib/chronicle-view-model.ts +121 -0
- package/src/chronicle/lib/formatting.ts +18 -0
- package/src/chronicle/lib/leaf-outcome-loader.ts +214 -0
- package/src/chronicle/lib/leaf-outcome-runtime.ts +37 -0
- package/src/chronicle/lib/prompt-highlighting.ts +78 -0
- package/src/chronicle/lib/scroll-sync.ts +88 -0
- package/src/chronicle/lib/tool-call-summary.ts +64 -0
- package/src/components/BrowserUiExtensionIndicatorHost.svelte +34 -0
- package/src/components/ConversationTreeDiagram.svelte +393 -0
- package/src/components/FormFieldRenderer.svelte +359 -0
- package/src/components/GenericLauncher.svelte +1970 -0
- package/src/components/KeyboardShortcutsModal.svelte +52 -0
- package/src/components/ModalShell.svelte +105 -0
- package/src/components/PageHeader.svelte +146 -0
- package/src/components/ProcessActionsMenu.svelte +514 -0
- package/src/components/ProcessInfoOverlay.svelte +1229 -0
- package/src/components/ScheduleDateTimePicker.svelte +155 -0
- package/src/components/SkillSelector.svelte +45 -0
- package/src/components/ToastContainer.svelte +192 -0
- package/src/components/launcher-form-copy.ts +172 -0
- package/src/components/launcher-model-config.ts +263 -0
- package/src/components/launcher-schedule.ts +127 -0
- package/src/extension-ui-dev-server.ts +98 -0
- package/src/lib/api.ts +970 -0
- package/src/lib/beautiful-mermaid-elk-instance.ts +54 -0
- package/src/lib/browser-storage.ts +11 -0
- package/src/lib/cost-estimates.ts +41 -0
- package/src/lib/elk-bundled-worker.ts +41 -0
- package/src/lib/flow-layout.ts +326 -0
- package/src/lib/format.ts +96 -0
- package/src/lib/future-executions-logic.ts +12 -0
- package/src/lib/future-launch-detail.ts +145 -0
- package/src/lib/instance-tree-layout.ts +158 -0
- package/src/lib/keyboard-shortcuts-help.ts +20 -0
- package/src/lib/keyboard.ts +40 -0
- package/src/lib/launcher-recent-values.ts +68 -0
- package/src/lib/markdown.ts +94 -0
- package/src/lib/mermaid-render.worker.ts +36 -0
- package/src/lib/pi-stream.ts +3 -0
- package/src/lib/primary-path-detail.ts +337 -0
- package/src/lib/primary-path-replay.ts +27 -0
- package/src/lib/process-browser.ts +179 -0
- package/src/lib/process-initial-prompt.ts +7 -0
- package/src/lib/process-launch-notices.svelte.ts +25 -0
- package/src/lib/process-row-view.ts +60 -0
- package/src/lib/process-terminal-display.ts +17 -0
- package/src/lib/process-toast-focus.svelte.ts +18 -0
- package/src/lib/processes-logic.ts +2 -0
- package/src/lib/processes.svelte.ts +334 -0
- package/src/lib/request-guard.ts +20 -0
- package/src/lib/retry-config.svelte.ts +19 -0
- package/src/lib/rich-markdown-elements.ts +173 -0
- package/src/lib/router-logic.ts +190 -0
- package/src/lib/router.svelte.ts +56 -0
- package/src/lib/runtime-config.ts +96 -0
- package/src/lib/test-fixtures.ts +13 -0
- package/src/lib/toasts.svelte.ts +104 -0
- package/src/lib/tool-call-rendering.ts +66 -0
- package/src/lib/ui-extensions.svelte.ts +381 -0
- package/src/lib/usage-snapshot.ts +9 -0
- package/src/lib/ws-classifier.ts +80 -0
- package/src/lib/ws.svelte.ts +281 -0
- package/src/main.ts +8 -0
- package/src/pages/FutureLaunchDetailPage.svelte +479 -0
- package/src/pages/HomePage.svelte +306 -0
- package/src/pages/ProcessCard.svelte +99 -0
- package/src/pages/ProcessDetailPage.svelte +599 -0
- package/src/pages/ProcessFlowDiagram.svelte +696 -0
- package/src/pages/ProcessGallery.svelte +252 -0
- package/src/pages/ProcessesPage.svelte +994 -0
- package/src/pages/SkillsPage.svelte +665 -0
- package/src/pages/WatchersPage.svelte +330 -0
- package/src/pages/process-detail/OverlayFrame.svelte +58 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +460 -0
- package/src/pages/process-detail/ProcessDetailHeader.svelte +167 -0
- package/src/pages/process-detail/process-detail-action-drafts.svelte.ts +211 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +548 -0
- package/src/pages/process-detail/process-detail-chronicle-dom.ts +102 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +711 -0
- package/src/pages/process-detail/process-detail-mutations.svelte.ts +91 -0
- package/src/pages/process-detail/process-detail-view-model.ts +149 -0
- package/src/shell/AppShell.svelte +249 -0
- package/src/shell/RouteLoadBoundary.svelte +43 -0
- package/src/shell/Sidebar.svelte +1358 -0
- package/src/shell/test-fixtures/RouteLoadTestComponent.svelte +5 -0
- package/src/vite-env.d.ts +2 -0
- package/src/vite-server-config.ts +27 -0
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ProcessExternalTriggerSignal } from "@leitwerk-dev/protocol";
|
|
3
|
+
import { tick } from "svelte";
|
|
4
|
+
import FormFieldRenderer from "../../components/FormFieldRenderer.svelte";
|
|
5
|
+
import ScheduleDateTimePicker from "../../components/ScheduleDateTimePicker.svelte";
|
|
6
|
+
import type {
|
|
7
|
+
ProcessActionFieldDefinition,
|
|
8
|
+
ProcessActionSummary,
|
|
9
|
+
ProcessExternalTriggerSummary,
|
|
10
|
+
ProcessModelConfigurationView,
|
|
11
|
+
ProcessSelectedTurnSummary,
|
|
12
|
+
} from "../../lib/api";
|
|
13
|
+
import { formatRelativeTime } from "../../lib/format.js";
|
|
14
|
+
import type { ActionSectionController } from "../lib/action-bindings.js";
|
|
15
|
+
import { buildActionModelDisplay } from "../lib/action-model-display.js";
|
|
16
|
+
import { describeActionPreview as describeSharedActionPreview } from "../lib/action-preview.js";
|
|
17
|
+
import ModelProfileOptions from "./ModelProfileOptions.svelte";
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
anchorId: string;
|
|
21
|
+
isFocused: boolean;
|
|
22
|
+
actionSectionController: ActionSectionController;
|
|
23
|
+
externalTriggers: readonly ProcessExternalTriggerSummary[];
|
|
24
|
+
externalTriggerSignals: readonly ProcessExternalTriggerSignal[];
|
|
25
|
+
selectedTurn?: ProcessSelectedTurnSummary | null;
|
|
26
|
+
modelConfiguration: ProcessModelConfigurationView;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
let {
|
|
30
|
+
anchorId,
|
|
31
|
+
isFocused,
|
|
32
|
+
actionSectionController: actionBindings,
|
|
33
|
+
externalTriggers = [],
|
|
34
|
+
externalTriggerSignals = [],
|
|
35
|
+
selectedTurn = null,
|
|
36
|
+
modelConfiguration,
|
|
37
|
+
}: Props = $props();
|
|
38
|
+
|
|
39
|
+
let sectionElement: HTMLElement | null = null;
|
|
40
|
+
let fieldErrors = $state<Record<string, string[]>>({});
|
|
41
|
+
let promptCacheClock = $state(Date.now());
|
|
42
|
+
|
|
43
|
+
const actions = $derived(actionBindings.actionSectionActions);
|
|
44
|
+
const openAction = $derived(
|
|
45
|
+
actions.find((action) => action.id === actionBindings.openActionFormId) ?? null,
|
|
46
|
+
);
|
|
47
|
+
const showOpenActionPanel = $derived(Boolean(openAction));
|
|
48
|
+
const sectionTitle = $derived.by(() => {
|
|
49
|
+
if (openAction) {
|
|
50
|
+
return openAction.label;
|
|
51
|
+
}
|
|
52
|
+
if (actions.length > 0) {
|
|
53
|
+
return "Decide what happens next";
|
|
54
|
+
}
|
|
55
|
+
return selectedTurn?.description ?? "Waiting for external trigger";
|
|
56
|
+
});
|
|
57
|
+
const sectionDescription = $derived.by(() => {
|
|
58
|
+
if (openAction?.description) {
|
|
59
|
+
return openAction.description;
|
|
60
|
+
}
|
|
61
|
+
if (selectedTurn?.commentary) {
|
|
62
|
+
return selectedTurn.commentary;
|
|
63
|
+
}
|
|
64
|
+
if (actions.length > 0) {
|
|
65
|
+
return "Review the latest process result, then choose the next move.";
|
|
66
|
+
}
|
|
67
|
+
return "This process is waiting for an external trigger. The status below shows whether the listener is armed and the latest recorded trigger activity.";
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
$effect(() => {
|
|
71
|
+
const expiresAt = actionBindings.openActionModelPreview?.warmPromptCache?.expiresAt;
|
|
72
|
+
if (!expiresAt) return;
|
|
73
|
+
const expiresAtMs = Date.parse(expiresAt);
|
|
74
|
+
if (!Number.isFinite(expiresAtMs)) return;
|
|
75
|
+
const timeout = setTimeout(
|
|
76
|
+
() => {
|
|
77
|
+
promptCacheClock = Date.now();
|
|
78
|
+
},
|
|
79
|
+
Math.min(2_147_483_647, Math.max(0, expiresAtMs - Date.now() + 1)),
|
|
80
|
+
);
|
|
81
|
+
return () => clearTimeout(timeout);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
$effect(() => {
|
|
85
|
+
const currentActionId = openAction?.id ?? null;
|
|
86
|
+
fieldErrors = {};
|
|
87
|
+
if (!currentActionId || !sectionElement) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
void tick().then(() => {
|
|
91
|
+
sectionElement?.scrollIntoView?.({ behavior: "smooth", block: "nearest" });
|
|
92
|
+
const firstField = sectionElement?.querySelector<HTMLElement>("[data-action-form-field]");
|
|
93
|
+
firstField?.focus?.();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
function actionFieldDescriptionId(actionId: string, fieldId: string): string {
|
|
98
|
+
return `${actionBindings.actionFieldDomId(actionId, fieldId)}-description`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function actionFieldErrorId(actionId: string, fieldId: string): string {
|
|
102
|
+
return `${actionBindings.actionFieldDomId(actionId, fieldId)}-errors`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function fieldErrorKey(actionId: string, fieldId: string): string {
|
|
106
|
+
return `${actionId}:${fieldId}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getFieldErrors(actionId: string, fieldId: string): string[] {
|
|
110
|
+
return fieldErrors[fieldErrorKey(actionId, fieldId)] ?? [];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function clearFieldError(actionId: string, fieldId: string) {
|
|
114
|
+
const errorKey = fieldErrorKey(actionId, fieldId);
|
|
115
|
+
if (!fieldErrors[errorKey]) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const nextErrors = { ...fieldErrors };
|
|
119
|
+
delete nextErrors[errorKey];
|
|
120
|
+
fieldErrors = nextErrors;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function setValidatedFieldValue(
|
|
124
|
+
actionId: string,
|
|
125
|
+
field: ProcessActionFieldDefinition,
|
|
126
|
+
value: string | number | boolean,
|
|
127
|
+
) {
|
|
128
|
+
clearFieldError(actionId, field.id);
|
|
129
|
+
actionBindings.setActionFieldValue(actionId, field, value);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getFieldDescribedBy(
|
|
133
|
+
actionId: string,
|
|
134
|
+
field: ProcessActionFieldDefinition,
|
|
135
|
+
): string | undefined {
|
|
136
|
+
const ids: string[] = [];
|
|
137
|
+
if (field.description) {
|
|
138
|
+
ids.push(actionFieldDescriptionId(actionId, field.id));
|
|
139
|
+
}
|
|
140
|
+
if (getFieldErrors(actionId, field.id).length > 0) {
|
|
141
|
+
ids.push(actionFieldErrorId(actionId, field.id));
|
|
142
|
+
}
|
|
143
|
+
return ids.length > 0 ? ids.join(" ") : undefined;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isMissingRequiredValue(actionId: string, field: ProcessActionFieldDefinition): boolean {
|
|
147
|
+
if (!field.required) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
const value = actionBindings.getActionFieldValue(actionId, field);
|
|
151
|
+
if (field.kind === "boolean") {
|
|
152
|
+
return value !== true;
|
|
153
|
+
}
|
|
154
|
+
return String(value).trim() === "";
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function validateOpenActionForm(action: ProcessActionSummary): boolean {
|
|
158
|
+
if (!action.form) {
|
|
159
|
+
fieldErrors = {};
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const nextFieldErrors: Record<string, string[]> = {};
|
|
164
|
+
for (const field of action.form.fields) {
|
|
165
|
+
if (!isMissingRequiredValue(action.id, field)) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
nextFieldErrors[fieldErrorKey(action.id, field.id)] = [
|
|
169
|
+
field.kind === "boolean"
|
|
170
|
+
? `Select "${field.label}" to continue.`
|
|
171
|
+
: `${field.label} is required.`,
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
fieldErrors = nextFieldErrors;
|
|
175
|
+
return Object.keys(nextFieldErrors).length === 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
async function focusFirstInvalidField() {
|
|
179
|
+
await tick();
|
|
180
|
+
const invalidField = sectionElement?.querySelector<HTMLElement>(
|
|
181
|
+
`[data-action-form-field][aria-invalid="true"]`,
|
|
182
|
+
);
|
|
183
|
+
invalidField?.focus?.();
|
|
184
|
+
if (invalidField instanceof HTMLElement) {
|
|
185
|
+
invalidField.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function shouldRunActionImmediately(action: ProcessActionSummary): boolean {
|
|
190
|
+
return (
|
|
191
|
+
action.form !== undefined &&
|
|
192
|
+
action.form.fields.length === 0 &&
|
|
193
|
+
!action.supportsScheduling &&
|
|
194
|
+
!action.supportsNextTurnModelOverride
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async function handleActionFormSubmit(event: SubmitEvent) {
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
if (!openAction) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (!validateOpenActionForm(openAction)) {
|
|
204
|
+
await focusFirstInvalidField();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
await actionBindings.submitActionDecision(openAction);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async function handleActionClick(action: ProcessActionSummary) {
|
|
211
|
+
fieldErrors = {};
|
|
212
|
+
if (shouldRunActionImmediately(action)) {
|
|
213
|
+
await actionBindings.submitActionDecision(action);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
actionBindings.expandActionForm(action.id);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function modelOverrideFieldId(actionId: string): string {
|
|
220
|
+
return actionBindings.actionFieldDomId(actionId, "__next-turn-model-profile");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function getActionModelDisplay(action: ProcessActionSummary) {
|
|
224
|
+
return buildActionModelDisplay({
|
|
225
|
+
modelPreview: actionBindings.openActionModelPreview,
|
|
226
|
+
availableProfiles: modelConfiguration.availableProfiles,
|
|
227
|
+
selectedModelOverrideValue: actionBindings.getActionModelOverrideValue(action.id),
|
|
228
|
+
now: promptCacheClock,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function shouldShowActionModelOverride(action: ProcessActionSummary): boolean {
|
|
233
|
+
return (
|
|
234
|
+
action.supportsNextTurnModelOverride &&
|
|
235
|
+
actionBindings.openActionModelPreview?.kind !== "not_applicable"
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function isPrimaryActionChoice(actionIndex: number): boolean {
|
|
240
|
+
return actions.length > 1 && actionIndex === 0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function scheduleRunAtFieldId(actionId: string): string {
|
|
244
|
+
return actionBindings.actionFieldDomId(actionId, "__schedule-run-at");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function scheduleRunAtHourFieldId(actionId: string): string {
|
|
248
|
+
return `${scheduleRunAtFieldId(actionId)}-hour`;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function scheduleRunAtMinuteFieldId(actionId: string): string {
|
|
252
|
+
return `${scheduleRunAtFieldId(actionId)}-minute`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function describeActionPreview(action: ProcessActionSummary): string | null {
|
|
256
|
+
return describeSharedActionPreview(action, { includeTurnKindPrefix: true });
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function describeActionForm(action: ProcessActionSummary): string {
|
|
260
|
+
if (action.description) {
|
|
261
|
+
return action.description;
|
|
262
|
+
}
|
|
263
|
+
if (action.form) {
|
|
264
|
+
return action.supportsScheduling
|
|
265
|
+
? "Fill in any details this action needs, then choose whether it should run now or later."
|
|
266
|
+
: "Fill in any details this action needs, then run it now.";
|
|
267
|
+
}
|
|
268
|
+
if (action.supportsScheduling) {
|
|
269
|
+
return "Review the action settings, then choose whether it should run now or later.";
|
|
270
|
+
}
|
|
271
|
+
return "Review the action settings, then run it now.";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function externalTriggerSignalFor(
|
|
275
|
+
trigger: ProcessExternalTriggerSummary,
|
|
276
|
+
): ProcessExternalTriggerSignal | null {
|
|
277
|
+
return externalTriggerSignals.find((signal) => signal.triggerId === trigger.id) ?? null;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function presentExternalTriggerSignal(signal: ProcessExternalTriggerSignal) {
|
|
281
|
+
const relativeTime = signal.occurredAt ? formatRelativeTime(signal.occurredAt) : null;
|
|
282
|
+
switch (signal.state) {
|
|
283
|
+
case "error":
|
|
284
|
+
return {
|
|
285
|
+
tone: "attention",
|
|
286
|
+
label: "Error",
|
|
287
|
+
detail: `Last trigger attempt failed ${relativeTime}.`,
|
|
288
|
+
};
|
|
289
|
+
case "armed":
|
|
290
|
+
return {
|
|
291
|
+
tone: "ready",
|
|
292
|
+
label: "Armed",
|
|
293
|
+
detail: relativeTime
|
|
294
|
+
? `Listening for this trigger since ${relativeTime}.`
|
|
295
|
+
: "Listening for this trigger now.",
|
|
296
|
+
};
|
|
297
|
+
case "triggered":
|
|
298
|
+
return { tone: "neutral", label: "Triggered", detail: `Last trigger fired ${relativeTime}.` };
|
|
299
|
+
case "waiting":
|
|
300
|
+
return {
|
|
301
|
+
tone: "neutral",
|
|
302
|
+
label: "Waiting",
|
|
303
|
+
detail: "Waiting for this trigger to become active again.",
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
</script>
|
|
308
|
+
|
|
309
|
+
<section
|
|
310
|
+
id={anchorId}
|
|
311
|
+
class="action-section"
|
|
312
|
+
class:is-focused={isFocused}
|
|
313
|
+
class:has-open-form={showOpenActionPanel}
|
|
314
|
+
bind:this={sectionElement}
|
|
315
|
+
data-anchor-id={anchorId}
|
|
316
|
+
data-focused={isFocused ? "true" : "false"}
|
|
317
|
+
data-section="leaf-outcome-actions"
|
|
318
|
+
data-action-state={actions.length > 0 ? "required" : "external-trigger"}
|
|
319
|
+
data-action-shortcut-target="true"
|
|
320
|
+
aria-label={actions.length > 0 ? "Action required" : "External trigger status"}
|
|
321
|
+
tabindex="-1"
|
|
322
|
+
>
|
|
323
|
+
<div class="action-header">
|
|
324
|
+
<div class="action-header-copy">
|
|
325
|
+
<div class="action-status-row" aria-label={actions.length > 0 ? "Action required" : "External trigger"}>
|
|
326
|
+
<span class="action-status-dot" aria-hidden="true"></span>
|
|
327
|
+
<span>{actions.length > 0 ? "Action required" : "External trigger"}</span>
|
|
328
|
+
</div>
|
|
329
|
+
<h3>{sectionTitle}</h3>
|
|
330
|
+
<p class="action-description">{sectionDescription}</p>
|
|
331
|
+
</div>
|
|
332
|
+
{#if showOpenActionPanel && openAction}
|
|
333
|
+
<div class="action-header-controls">
|
|
334
|
+
<button
|
|
335
|
+
type="button"
|
|
336
|
+
class="secondary-button"
|
|
337
|
+
data-pressable="true"
|
|
338
|
+
disabled={actionBindings.actionBusyId !== null}
|
|
339
|
+
onclick={() => actionBindings.collapseActionForm()}
|
|
340
|
+
>
|
|
341
|
+
Hide form
|
|
342
|
+
</button>
|
|
343
|
+
</div>
|
|
344
|
+
{/if}
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
{#if actions.length > 0}
|
|
348
|
+
<div class="action-row" role="group" aria-label="Available actions">
|
|
349
|
+
{#each actions as action, actionIndex (action.id)}
|
|
350
|
+
<button
|
|
351
|
+
type="button"
|
|
352
|
+
class:is-primary-choice={isPrimaryActionChoice(actionIndex)}
|
|
353
|
+
class:active={actionBindings.selectedActionId === action.id}
|
|
354
|
+
class:busy={actionBindings.actionBusyId === action.id}
|
|
355
|
+
disabled={actionBindings.actionBusyId !== null}
|
|
356
|
+
data-action-id={action.id}
|
|
357
|
+
data-action-priority={isPrimaryActionChoice(actionIndex) ? "primary" : "secondary"}
|
|
358
|
+
data-supports-scheduling={action.supportsScheduling ? "true" : undefined}
|
|
359
|
+
data-supports-next-turn-model={
|
|
360
|
+
action.supportsNextTurnModelOverride ? "true" : undefined
|
|
361
|
+
}
|
|
362
|
+
data-pressable="true"
|
|
363
|
+
onclick={() => handleActionClick(action)}
|
|
364
|
+
>
|
|
365
|
+
<span class="action-button-copy">
|
|
366
|
+
<span>{action.label}</span>
|
|
367
|
+
{#if action.supportsScheduling || action.supportsNextTurnModelOverride}
|
|
368
|
+
<span class="action-capability-badges" aria-hidden="true">
|
|
369
|
+
{#if action.supportsScheduling}
|
|
370
|
+
<span class="action-capability-badge" data-action-capability="schedule">
|
|
371
|
+
Later
|
|
372
|
+
</span>
|
|
373
|
+
{/if}
|
|
374
|
+
{#if action.supportsNextTurnModelOverride}
|
|
375
|
+
<span class="action-capability-badge" data-action-capability="model">
|
|
376
|
+
Model
|
|
377
|
+
</span>
|
|
378
|
+
{/if}
|
|
379
|
+
</span>
|
|
380
|
+
{/if}
|
|
381
|
+
</span>
|
|
382
|
+
</button>
|
|
383
|
+
{/each}
|
|
384
|
+
</div>
|
|
385
|
+
{/if}
|
|
386
|
+
|
|
387
|
+
{#if externalTriggers.length > 0}
|
|
388
|
+
<section class="external-trigger-card" data-section="external-triggers">
|
|
389
|
+
<p class="external-trigger-eyebrow">
|
|
390
|
+
{externalTriggers.length === 1 ? "Available external trigger" : "Available external triggers"}
|
|
391
|
+
</p>
|
|
392
|
+
<ul class="external-trigger-list">
|
|
393
|
+
{#each externalTriggers as trigger (trigger.id)}
|
|
394
|
+
{@const signal = externalTriggerSignalFor(trigger)}
|
|
395
|
+
{@const presentation = signal ? presentExternalTriggerSignal(signal) : null}
|
|
396
|
+
<li class="external-trigger-item" data-external-trigger-id={trigger.id}>
|
|
397
|
+
<div class="external-trigger-header-row">
|
|
398
|
+
<p class="external-trigger-label">{trigger.label}</p>
|
|
399
|
+
{#if presentation}
|
|
400
|
+
<span class={`external-trigger-status ${presentation.tone}`}>{presentation.label}</span>
|
|
401
|
+
{/if}
|
|
402
|
+
</div>
|
|
403
|
+
<p class="external-trigger-description">{trigger.description}</p>
|
|
404
|
+
{#if signal && presentation}
|
|
405
|
+
<p class="external-trigger-signal-detail">{presentation.detail}</p>
|
|
406
|
+
{#if signal.secondaryDetail}
|
|
407
|
+
<p class="external-trigger-signal-secondary">{signal.secondaryDetail}</p>
|
|
408
|
+
{/if}
|
|
409
|
+
{/if}
|
|
410
|
+
</li>
|
|
411
|
+
{/each}
|
|
412
|
+
</ul>
|
|
413
|
+
</section>
|
|
414
|
+
{/if}
|
|
415
|
+
|
|
416
|
+
{#if actionBindings.actionError}
|
|
417
|
+
<p class="action-error" role="alert">{actionBindings.actionError}</p>
|
|
418
|
+
{/if}
|
|
419
|
+
|
|
420
|
+
{#if showOpenActionPanel && openAction}
|
|
421
|
+
<form
|
|
422
|
+
class="action-form"
|
|
423
|
+
data-action-form-id={openAction.id}
|
|
424
|
+
novalidate
|
|
425
|
+
aria-busy={actionBindings.actionBusyId === openAction.id}
|
|
426
|
+
onsubmit={handleActionFormSubmit}
|
|
427
|
+
>
|
|
428
|
+
<div class="action-form-header">
|
|
429
|
+
<div>
|
|
430
|
+
<h4>{openAction.form?.title ?? openAction.label}</h4>
|
|
431
|
+
<p>{describeActionForm(openAction)}</p>
|
|
432
|
+
{#if describeActionPreview(openAction)}
|
|
433
|
+
<p class="action-form-preview" data-section="action-preview-detail">
|
|
434
|
+
{describeActionPreview(openAction)}
|
|
435
|
+
</p>
|
|
436
|
+
{/if}
|
|
437
|
+
</div>
|
|
438
|
+
</div>
|
|
439
|
+
|
|
440
|
+
{#if modelConfiguration.availableProfiles.length > 0 && shouldShowActionModelOverride(openAction)}
|
|
441
|
+
{@const actionModelDisplay = getActionModelDisplay(openAction)}
|
|
442
|
+
<div class="action-field-list model-override-list">
|
|
443
|
+
<div class="action-field-group">
|
|
444
|
+
<label class="field-label" for={modelOverrideFieldId(openAction.id)}>
|
|
445
|
+
Next-turn model
|
|
446
|
+
</label>
|
|
447
|
+
<p class="field-description">
|
|
448
|
+
Applies to the next LLM turn this action selects.
|
|
449
|
+
</p>
|
|
450
|
+
<select
|
|
451
|
+
id={modelOverrideFieldId(openAction.id)}
|
|
452
|
+
data-action-form-field
|
|
453
|
+
value={actionBindings.getActionModelOverrideValue(openAction.id)}
|
|
454
|
+
onchange={(event) =>
|
|
455
|
+
actionBindings.setActionModelOverrideValue(
|
|
456
|
+
openAction.id,
|
|
457
|
+
(event.currentTarget as HTMLSelectElement).value,
|
|
458
|
+
)}
|
|
459
|
+
>
|
|
460
|
+
<option value="">
|
|
461
|
+
{actionModelDisplay?.blankOptionLabel ?? "Use selected/default model"}
|
|
462
|
+
</option>
|
|
463
|
+
<ModelProfileOptions profiles={modelConfiguration.availableProfiles} />
|
|
464
|
+
</select>
|
|
465
|
+
{#if actionBindings.openActionModelPreviewLoading && !actionModelDisplay?.helperText}
|
|
466
|
+
<p class="field-note" data-section="action-model-loading">
|
|
467
|
+
Loading the resolved model preview…
|
|
468
|
+
</p>
|
|
469
|
+
{/if}
|
|
470
|
+
{#if actionModelDisplay?.helperText}
|
|
471
|
+
<p
|
|
472
|
+
class:field-error-note={actionModelDisplay.helperTone === "error"}
|
|
473
|
+
class="field-note"
|
|
474
|
+
data-section="action-model-helper"
|
|
475
|
+
data-tone={actionModelDisplay.helperTone}
|
|
476
|
+
>
|
|
477
|
+
{actionModelDisplay.helperText}
|
|
478
|
+
</p>
|
|
479
|
+
{/if}
|
|
480
|
+
{#if actionModelDisplay?.switchCostWarningText}
|
|
481
|
+
<div
|
|
482
|
+
class="field-warning"
|
|
483
|
+
data-section="action-model-switch-warning"
|
|
484
|
+
role="status"
|
|
485
|
+
>
|
|
486
|
+
{actionModelDisplay.switchCostWarningText}
|
|
487
|
+
</div>
|
|
488
|
+
{/if}
|
|
489
|
+
</div>
|
|
490
|
+
</div>
|
|
491
|
+
{/if}
|
|
492
|
+
|
|
493
|
+
{#if openAction.supportsScheduling}
|
|
494
|
+
<div class="action-field-list model-override-list">
|
|
495
|
+
<div class="action-field-group">
|
|
496
|
+
<p class="field-label">When to run</p>
|
|
497
|
+
<div class="schedule-choice-row" role="radiogroup" aria-label="When to run">
|
|
498
|
+
<label class="schedule-choice" data-selected={actionBindings.getActionScheduleMode(openAction.id) === "now"}>
|
|
499
|
+
<input
|
|
500
|
+
type="radio"
|
|
501
|
+
name={`schedule-${openAction.id}`}
|
|
502
|
+
checked={actionBindings.getActionScheduleMode(openAction.id) === "now"}
|
|
503
|
+
onchange={() => actionBindings.setActionScheduleMode(openAction.id, "now")}
|
|
504
|
+
/>
|
|
505
|
+
<span>Run now</span>
|
|
506
|
+
</label>
|
|
507
|
+
<label class="schedule-choice" data-selected={actionBindings.getActionScheduleMode(openAction.id) === "once"}>
|
|
508
|
+
<input
|
|
509
|
+
type="radio"
|
|
510
|
+
name={`schedule-${openAction.id}`}
|
|
511
|
+
checked={actionBindings.getActionScheduleMode(openAction.id) === "once"}
|
|
512
|
+
onchange={() => actionBindings.setActionScheduleMode(openAction.id, "once")}
|
|
513
|
+
/>
|
|
514
|
+
<span>Run later</span>
|
|
515
|
+
</label>
|
|
516
|
+
</div>
|
|
517
|
+
</div>
|
|
518
|
+
{#if actionBindings.getActionScheduleMode(openAction.id) === "once"}
|
|
519
|
+
{@const scheduledAtParts = actionBindings.getActionScheduledAtLocalParts(openAction.id)}
|
|
520
|
+
<div class="action-field-group">
|
|
521
|
+
<label class="field-label" for={scheduleRunAtFieldId(openAction.id)}>
|
|
522
|
+
Run at
|
|
523
|
+
</label>
|
|
524
|
+
<ScheduleDateTimePicker
|
|
525
|
+
dateId={scheduleRunAtFieldId(openAction.id)}
|
|
526
|
+
hourId={scheduleRunAtHourFieldId(openAction.id)}
|
|
527
|
+
minuteId={scheduleRunAtMinuteFieldId(openAction.id)}
|
|
528
|
+
dateValue={scheduledAtParts.date}
|
|
529
|
+
hourValue={scheduledAtParts.hour}
|
|
530
|
+
minuteValue={scheduledAtParts.minute}
|
|
531
|
+
dataSection="action-schedule-once-picker"
|
|
532
|
+
marker="action"
|
|
533
|
+
onDateChange={(value) =>
|
|
534
|
+
actionBindings.setActionScheduledAtLocalParts(openAction.id, { date: value })}
|
|
535
|
+
onHourChange={(value) =>
|
|
536
|
+
actionBindings.setActionScheduledAtLocalParts(openAction.id, { hour: value })}
|
|
537
|
+
onMinuteChange={(value) =>
|
|
538
|
+
actionBindings.setActionScheduledAtLocalParts(openAction.id, { minute: value })}
|
|
539
|
+
/>
|
|
540
|
+
<p class="field-description">
|
|
541
|
+
The server stores this in UTC and catches it up after a restart.
|
|
542
|
+
</p>
|
|
543
|
+
</div>
|
|
544
|
+
{/if}
|
|
545
|
+
</div>
|
|
546
|
+
{/if}
|
|
547
|
+
|
|
548
|
+
{#if openAction.form}
|
|
549
|
+
<div class="action-field-list">
|
|
550
|
+
{#each openAction.form.fields as field (field.id)}
|
|
551
|
+
<FormFieldRenderer
|
|
552
|
+
{field}
|
|
553
|
+
id={actionBindings.actionFieldDomId(openAction.id, field.id)}
|
|
554
|
+
value={actionBindings.getActionFieldValue(openAction.id, field)}
|
|
555
|
+
errors={getFieldErrors(openAction.id, field.id)}
|
|
556
|
+
descriptionId={actionFieldDescriptionId(openAction.id, field.id)}
|
|
557
|
+
errorId={actionFieldErrorId(openAction.id, field.id)}
|
|
558
|
+
describedBy={getFieldDescribedBy(openAction.id, field)}
|
|
559
|
+
marker="action"
|
|
560
|
+
textareaRows={4}
|
|
561
|
+
onValueChange={(_, value) => setValidatedFieldValue(openAction.id, field, value)}
|
|
562
|
+
onTextBlur={() => actionBindings.commitActionPreview(openAction.id)}
|
|
563
|
+
/>
|
|
564
|
+
{/each}
|
|
565
|
+
</div>
|
|
566
|
+
{/if}
|
|
567
|
+
|
|
568
|
+
<div class="action-form-footer">
|
|
569
|
+
<button type="submit" class="primary-button" data-pressable="true" disabled={actionBindings.actionBusyId !== null}>
|
|
570
|
+
{actionBindings.actionBusyId === openAction.id
|
|
571
|
+
? openAction.supportsScheduling && actionBindings.getActionScheduleMode(openAction.id) === "once"
|
|
572
|
+
? "Saving schedule…"
|
|
573
|
+
: "Running action…"
|
|
574
|
+
: openAction.supportsScheduling && actionBindings.getActionScheduleMode(openAction.id) === "once"
|
|
575
|
+
? "Schedule action"
|
|
576
|
+
: openAction.form?.submitLabel ?? openAction.label}
|
|
577
|
+
</button>
|
|
578
|
+
</div>
|
|
579
|
+
</form>
|
|
580
|
+
{/if}
|
|
581
|
+
</section>
|
|
582
|
+
|
|
583
|
+
<style>
|
|
584
|
+
.action-section {
|
|
585
|
+
display: grid;
|
|
586
|
+
gap: var(--space-md);
|
|
587
|
+
padding: var(--space-lg) var(--space-xl);
|
|
588
|
+
margin-inline-start: 0;
|
|
589
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-accent) 30%, var(--chronicle-border) 70%);
|
|
590
|
+
border-radius: var(--radius-lg);
|
|
591
|
+
background: color-mix(in srgb, white 94%, var(--chronicle-accent-soft) 6%);
|
|
592
|
+
scroll-margin-top: var(--space-xl);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.action-section[data-action-state="required"] {
|
|
596
|
+
border-color: color-mix(in srgb, var(--chronicle-accent) 40%, var(--chronicle-border) 60%);
|
|
597
|
+
background: color-mix(in srgb, white 91%, var(--chronicle-accent-soft) 9%);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.action-section.is-focused,
|
|
601
|
+
.action-section.has-open-form {
|
|
602
|
+
border-color: color-mix(in srgb, var(--chronicle-accent) 50%, var(--chronicle-border) 50%);
|
|
603
|
+
background: color-mix(in srgb, white 90%, var(--chronicle-accent-soft) 10%);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.action-section.is-focused {
|
|
607
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chronicle-accent) 14%, transparent 86%);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.action-header {
|
|
611
|
+
display: flex;
|
|
612
|
+
justify-content: space-between;
|
|
613
|
+
gap: var(--space-lg);
|
|
614
|
+
align-items: start;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.action-header-copy {
|
|
618
|
+
display: grid;
|
|
619
|
+
gap: 6px;
|
|
620
|
+
max-width: 54ch;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.action-header-controls {
|
|
624
|
+
display: flex;
|
|
625
|
+
gap: var(--space-xs);
|
|
626
|
+
flex-wrap: wrap;
|
|
627
|
+
justify-content: flex-end;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.action-status-row {
|
|
631
|
+
display: inline-flex;
|
|
632
|
+
align-items: center;
|
|
633
|
+
gap: 6px;
|
|
634
|
+
width: fit-content;
|
|
635
|
+
min-height: 28px;
|
|
636
|
+
padding: 0 10px;
|
|
637
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-accent) 34%, var(--chronicle-border) 66%);
|
|
638
|
+
border-radius: 999px;
|
|
639
|
+
background: color-mix(in srgb, white 86%, var(--chronicle-accent-soft) 14%);
|
|
640
|
+
color: color-mix(in srgb, var(--chronicle-accent) 76%, var(--chronicle-text) 24%);
|
|
641
|
+
font-size: 12px;
|
|
642
|
+
font-weight: 780;
|
|
643
|
+
line-height: 1;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.action-status-dot {
|
|
647
|
+
width: 8px;
|
|
648
|
+
height: 8px;
|
|
649
|
+
border-radius: 999px;
|
|
650
|
+
background: var(--chronicle-accent);
|
|
651
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--chronicle-accent) 14%, transparent 86%);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.action-section[data-action-state="external-trigger"] .action-status-row {
|
|
655
|
+
border-color: color-mix(in srgb, var(--chronicle-attention) 32%, var(--chronicle-border) 68%);
|
|
656
|
+
background: color-mix(in srgb, white 88%, var(--chronicle-attention) 12%);
|
|
657
|
+
color: color-mix(in srgb, var(--chronicle-attention) 78%, var(--chronicle-text) 22%);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.action-section[data-action-state="external-trigger"] .action-status-dot {
|
|
661
|
+
background: var(--chronicle-attention);
|
|
662
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--chronicle-attention) 14%, transparent 86%);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.action-header h3,
|
|
666
|
+
.action-form-header h4 {
|
|
667
|
+
margin: 0;
|
|
668
|
+
font-family: var(--font-display);
|
|
669
|
+
font-size: 19px;
|
|
670
|
+
line-height: 1.22;
|
|
671
|
+
font-weight: 720;
|
|
672
|
+
color: var(--chronicle-text);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
.action-description,
|
|
676
|
+
.action-form-header p,
|
|
677
|
+
.field-description,
|
|
678
|
+
.field-note,
|
|
679
|
+
.action-error {
|
|
680
|
+
margin: 0;
|
|
681
|
+
font-size: 14px;
|
|
682
|
+
line-height: 1.55;
|
|
683
|
+
color: var(--chronicle-text-muted);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.action-form-preview {
|
|
687
|
+
margin-top: var(--space-xs);
|
|
688
|
+
font-size: var(--type-body-sm);
|
|
689
|
+
line-height: 1.5;
|
|
690
|
+
color: var(--chronicle-text);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.action-row {
|
|
694
|
+
display: grid;
|
|
695
|
+
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
696
|
+
align-items: stretch;
|
|
697
|
+
gap: var(--space-sm);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.external-trigger-card {
|
|
701
|
+
display: grid;
|
|
702
|
+
gap: var(--space-sm);
|
|
703
|
+
padding-top: var(--space-md);
|
|
704
|
+
border-top: 1px solid color-mix(in srgb, var(--chronicle-accent) 18%, var(--chronicle-border) 82%);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.external-trigger-eyebrow,
|
|
708
|
+
.external-trigger-label {
|
|
709
|
+
margin: 0;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.external-trigger-eyebrow {
|
|
713
|
+
font-size: 11px;
|
|
714
|
+
font-weight: 700;
|
|
715
|
+
letter-spacing: 0.08em;
|
|
716
|
+
text-transform: uppercase;
|
|
717
|
+
color: var(--chronicle-text-faint);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.external-trigger-list {
|
|
721
|
+
margin: 0;
|
|
722
|
+
padding: 0;
|
|
723
|
+
list-style: none;
|
|
724
|
+
display: grid;
|
|
725
|
+
gap: var(--space-sm);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.external-trigger-item {
|
|
729
|
+
display: grid;
|
|
730
|
+
gap: var(--space-xs);
|
|
731
|
+
padding: var(--space-sm) 0;
|
|
732
|
+
border-top: 1px solid color-mix(in srgb, var(--chronicle-border) 74%, white 26%);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.external-trigger-item:first-child {
|
|
736
|
+
padding-top: 0;
|
|
737
|
+
border-top: 0;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.external-trigger-header-row {
|
|
741
|
+
display: flex;
|
|
742
|
+
align-items: center;
|
|
743
|
+
justify-content: space-between;
|
|
744
|
+
gap: var(--space-sm);
|
|
745
|
+
flex-wrap: wrap;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.external-trigger-label {
|
|
749
|
+
font-size: 14px;
|
|
750
|
+
font-weight: 620;
|
|
751
|
+
color: var(--chronicle-text);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.external-trigger-status {
|
|
755
|
+
display: inline-flex;
|
|
756
|
+
align-items: center;
|
|
757
|
+
min-height: 28px;
|
|
758
|
+
padding: 0 10px;
|
|
759
|
+
border-radius: 999px;
|
|
760
|
+
font-size: 12px;
|
|
761
|
+
font-weight: 700;
|
|
762
|
+
letter-spacing: 0.02em;
|
|
763
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-border-strong) 76%, white 24%);
|
|
764
|
+
background: color-mix(in srgb, var(--chronicle-card-surface) 94%, white 6%);
|
|
765
|
+
color: var(--chronicle-text);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.external-trigger-status.ready {
|
|
769
|
+
border-color: color-mix(in srgb, var(--chronicle-success) 26%, var(--chronicle-border) 74%);
|
|
770
|
+
background: color-mix(in srgb, white 90%, var(--chronicle-success) 10%);
|
|
771
|
+
color: color-mix(in srgb, var(--chronicle-success) 72%, var(--chronicle-text) 28%);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.external-trigger-status.attention {
|
|
775
|
+
border-color: color-mix(in srgb, var(--chronicle-danger) 28%, var(--chronicle-border) 72%);
|
|
776
|
+
background: color-mix(in srgb, white 92%, var(--chronicle-danger) 8%);
|
|
777
|
+
color: var(--chronicle-danger-text);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.external-trigger-description,
|
|
781
|
+
.external-trigger-signal-detail,
|
|
782
|
+
.external-trigger-signal-secondary {
|
|
783
|
+
margin: 0;
|
|
784
|
+
font-size: 14px;
|
|
785
|
+
line-height: 1.55;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.external-trigger-description {
|
|
789
|
+
color: var(--chronicle-text-muted);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.external-trigger-signal-detail {
|
|
793
|
+
color: var(--chronicle-text);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.external-trigger-signal-secondary {
|
|
797
|
+
color: var(--chronicle-text-muted);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.action-row button,
|
|
801
|
+
.primary-button,
|
|
802
|
+
.secondary-button,
|
|
803
|
+
.action-field-group input,
|
|
804
|
+
.action-field-group select {
|
|
805
|
+
font: inherit;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.action-row button,
|
|
809
|
+
.primary-button,
|
|
810
|
+
.secondary-button {
|
|
811
|
+
border-radius: 999px;
|
|
812
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-border-strong) 84%, white 16%);
|
|
813
|
+
background: color-mix(in srgb, var(--chronicle-card-surface) 94%, white 6%);
|
|
814
|
+
color: var(--chronicle-text);
|
|
815
|
+
cursor: pointer;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.action-row button {
|
|
819
|
+
display: inline-flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
justify-content: center;
|
|
822
|
+
gap: var(--space-2xs);
|
|
823
|
+
min-height: 44px;
|
|
824
|
+
padding: 8px var(--space-md);
|
|
825
|
+
font-size: var(--type-body);
|
|
826
|
+
font-weight: 640;
|
|
827
|
+
line-height: 1.2;
|
|
828
|
+
text-align: center;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.action-button-copy {
|
|
832
|
+
display: inline-flex;
|
|
833
|
+
flex-direction: column;
|
|
834
|
+
align-items: center;
|
|
835
|
+
gap: var(--space-2xs);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/* Capability hints describe what an action supports (scheduling, model
|
|
839
|
+
override). They are annotations, not separate controls, so they are
|
|
840
|
+
styled as faint micro-labels rather than interactive pills. */
|
|
841
|
+
.action-capability-badges {
|
|
842
|
+
display: none;
|
|
843
|
+
align-items: center;
|
|
844
|
+
gap: var(--space-xs);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.action-capability-badge {
|
|
848
|
+
display: inline-flex;
|
|
849
|
+
align-items: center;
|
|
850
|
+
font-size: 10px;
|
|
851
|
+
font-weight: 700;
|
|
852
|
+
letter-spacing: 0.07em;
|
|
853
|
+
text-transform: uppercase;
|
|
854
|
+
color: var(--chronicle-text-faint);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.action-capability-badge + .action-capability-badge {
|
|
858
|
+
position: relative;
|
|
859
|
+
padding-inline-start: calc(var(--space-xs) + 1px);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.action-capability-badge + .action-capability-badge::before {
|
|
863
|
+
content: "";
|
|
864
|
+
position: absolute;
|
|
865
|
+
inset-inline-start: 0;
|
|
866
|
+
top: 50%;
|
|
867
|
+
width: 1px;
|
|
868
|
+
height: 9px;
|
|
869
|
+
transform: translateY(-50%);
|
|
870
|
+
background: color-mix(in srgb, var(--chronicle-text-faint) 50%, transparent 50%);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.action-row button.active {
|
|
874
|
+
border-color: color-mix(in srgb, var(--chronicle-accent) 26%, var(--chronicle-border-strong) 74%);
|
|
875
|
+
background: color-mix(in srgb, white 92%, var(--chronicle-accent-soft) 8%);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.action-row button.is-primary-choice {
|
|
879
|
+
border-color: color-mix(in srgb, var(--chronicle-accent) 36%, var(--chronicle-text) 64%);
|
|
880
|
+
background: color-mix(in srgb, var(--chronicle-text) 88%, var(--chronicle-accent) 12%);
|
|
881
|
+
color: var(--chronicle-text-on-accent);
|
|
882
|
+
box-shadow: 0 6px 14px color-mix(in srgb, var(--chronicle-accent) 8%, transparent 92%);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.action-row button.is-primary-choice.active {
|
|
886
|
+
background: color-mix(in srgb, var(--chronicle-text) 82%, var(--chronicle-accent) 18%);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.action-row button.is-primary-choice .action-capability-badge {
|
|
890
|
+
color: color-mix(in srgb, var(--chronicle-text-on-accent) 68%, transparent 32%);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
.action-row button.is-primary-choice .action-capability-badge + .action-capability-badge::before {
|
|
894
|
+
background: color-mix(in srgb, var(--chronicle-text-on-accent) 34%, transparent 66%);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
.action-row button:hover,
|
|
898
|
+
.secondary-button:hover,
|
|
899
|
+
.primary-button:hover {
|
|
900
|
+
transform: translateY(-1px);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.action-row button:disabled,
|
|
904
|
+
.primary-button:disabled,
|
|
905
|
+
.secondary-button:disabled {
|
|
906
|
+
opacity: 0.62;
|
|
907
|
+
cursor: default;
|
|
908
|
+
transform: none;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.action-error {
|
|
912
|
+
padding: var(--space-sm) var(--space-md);
|
|
913
|
+
border-radius: var(--radius-md);
|
|
914
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-danger) 26%, var(--chronicle-border) 74%);
|
|
915
|
+
background: color-mix(in srgb, white 92%, var(--chronicle-danger) 8%);
|
|
916
|
+
color: var(--chronicle-danger-text);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.action-form {
|
|
920
|
+
display: grid;
|
|
921
|
+
gap: var(--space-md);
|
|
922
|
+
padding: var(--space-md);
|
|
923
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-accent) 26%, var(--chronicle-border) 74%);
|
|
924
|
+
border-radius: var(--radius-lg);
|
|
925
|
+
background: color-mix(in srgb, white 94%, var(--chronicle-accent-soft) 6%);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.action-form-header {
|
|
929
|
+
display: flex;
|
|
930
|
+
justify-content: space-between;
|
|
931
|
+
gap: var(--space-md);
|
|
932
|
+
align-items: start;
|
|
933
|
+
padding-bottom: var(--space-sm);
|
|
934
|
+
border-bottom: 1px solid color-mix(in srgb, var(--chronicle-accent) 16%, var(--chronicle-border) 84%);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.secondary-button,
|
|
938
|
+
.primary-button {
|
|
939
|
+
min-height: 44px;
|
|
940
|
+
padding: 0 16px;
|
|
941
|
+
font-size: 14px;
|
|
942
|
+
font-weight: 620;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.action-form .primary-button {
|
|
946
|
+
min-height: 48px;
|
|
947
|
+
padding-inline: 22px;
|
|
948
|
+
font-weight: 700;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.primary-button {
|
|
952
|
+
border-color: color-mix(in srgb, var(--chronicle-accent) 28%, var(--chronicle-text) 72%);
|
|
953
|
+
background: color-mix(in srgb, var(--chronicle-text) 86%, white 14%);
|
|
954
|
+
color: var(--chronicle-card-surface);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.action-field-list {
|
|
958
|
+
display: grid;
|
|
959
|
+
gap: var(--space-sm);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.model-override-list {
|
|
963
|
+
margin-bottom: var(--space-sm);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.schedule-choice-row {
|
|
967
|
+
display: grid;
|
|
968
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
969
|
+
gap: var(--space-xs);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.action-field-group {
|
|
973
|
+
display: grid;
|
|
974
|
+
gap: 6px;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.field-note {
|
|
978
|
+
color: var(--chronicle-text-muted);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.field-error-note {
|
|
982
|
+
color: var(--chronicle-danger, #b91c1c);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.field-warning {
|
|
986
|
+
padding: 12px 14px;
|
|
987
|
+
border-radius: 14px;
|
|
988
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-warning, #d97706) 24%, var(--chronicle-border) 76%);
|
|
989
|
+
background: color-mix(in srgb, white 92%, var(--chronicle-warning, #d97706) 8%);
|
|
990
|
+
font-size: 14px;
|
|
991
|
+
line-height: 1.55;
|
|
992
|
+
color: var(--chronicle-text);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.field-label {
|
|
996
|
+
margin: 0;
|
|
997
|
+
font-size: 14px;
|
|
998
|
+
font-weight: 620;
|
|
999
|
+
color: var(--chronicle-text);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
.action-field-group input,
|
|
1003
|
+
.action-field-group select {
|
|
1004
|
+
padding: 12px 14px;
|
|
1005
|
+
border-radius: 14px;
|
|
1006
|
+
border: 1px solid color-mix(in srgb, var(--chronicle-border) 84%, white 16%);
|
|
1007
|
+
background: color-mix(in srgb, var(--chronicle-card-surface) 96%, white 4%);
|
|
1008
|
+
color: var(--chronicle-text);
|
|
1009
|
+
outline: none;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
.action-form-footer {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
justify-content: flex-end;
|
|
1015
|
+
padding-top: var(--space-sm);
|
|
1016
|
+
border-top: 1px solid color-mix(in srgb, var(--chronicle-accent) 14%, var(--chronicle-border) 86%);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
@media (max-width: 720px) {
|
|
1020
|
+
.action-section {
|
|
1021
|
+
padding: var(--space-lg);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.action-header {
|
|
1025
|
+
flex-direction: column;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.action-header-controls,
|
|
1029
|
+
.action-form-footer,
|
|
1030
|
+
.primary-button,
|
|
1031
|
+
.secondary-button {
|
|
1032
|
+
width: 100%;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
</style>
|