@snackbit/opendil 0.0.0 → 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.
Files changed (130) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +137 -2
  3. package/THIRD_PARTY_NOTICES.md +9 -0
  4. package/bin/opendil.mjs +75 -0
  5. package/bin/publish-directory.d.mts +18 -0
  6. package/bin/publish-directory.mjs +188 -0
  7. package/dist/agent-spec.js +9 -0
  8. package/dist/chunk-RPZW4WVX.js +2 -0
  9. package/dist/chunk-ZSTXLIS6.js +2 -0
  10. package/dist/index.js +2 -0
  11. package/dist/mermaid-diagram-GFWD4Y2X.js +2 -0
  12. package/dist/runtime/frame.html +2435 -0
  13. package/dist/runtime/frame.js +4621 -0
  14. package/dist/spec/genui.agent.full.md +1927 -0
  15. package/dist/spec/genui.agent.md +479 -0
  16. package/dist/spec/genui.examples.md +836 -0
  17. package/dist/styled-renderer-PHI4MNPF.js +2441 -0
  18. package/dist/styles.css +2434 -0
  19. package/dist/types/agent-spec.d.ts +12 -0
  20. package/dist/types/components/ui/controls/button.d.ts +10 -0
  21. package/dist/types/components/ui/controls/checkbox.d.ts +4 -0
  22. package/dist/types/components/ui/controls/input.d.ts +3 -0
  23. package/dist/types/components/ui/controls/radio-group.d.ts +5 -0
  24. package/dist/types/components/ui/controls/select.d.ts +14 -0
  25. package/dist/types/components/ui/controls/slider.d.ts +4 -0
  26. package/dist/types/components/ui/controls/tabs.d.ts +7 -0
  27. package/dist/types/components/ui/controls/textarea.d.ts +3 -0
  28. package/dist/types/components/ui/controls/toggle-group.d.ts +10 -0
  29. package/dist/types/components/ui/controls/toggle.d.ts +9 -0
  30. package/dist/types/components/ui/display/badge.d.ts +9 -0
  31. package/dist/types/components/ui/display/card.d.ts +9 -0
  32. package/dist/types/components/ui/display/chart.d.ts +39 -0
  33. package/dist/types/components/ui/display/separator.d.ts +4 -0
  34. package/dist/types/components/ui/display/skeleton.d.ts +2 -0
  35. package/dist/types/components/ui/display/table.d.ts +10 -0
  36. package/dist/types/components/ui/media/carousel.d.ts +19 -0
  37. package/dist/types/components/ui/overlays/collapsible.d.ts +6 -0
  38. package/dist/types/components/ui/overlays/popover.d.ts +11 -0
  39. package/dist/types/components/ui/overlays/tooltip.d.ts +8 -0
  40. package/dist/types/components/ui/overlays/ui-scope.d.ts +27 -0
  41. package/dist/types/dil/custom-component.d.ts +14 -0
  42. package/dist/types/dil/customization.d.ts +21 -0
  43. package/dist/types/dil/dil-renderer.d.ts +90 -0
  44. package/dist/types/dil/isolation/frame-startup.d.ts +18 -0
  45. package/dist/types/dil/isolation/frame-theme.d.ts +14 -0
  46. package/dist/types/dil/isolation/frame-viewport.d.ts +30 -0
  47. package/dist/types/dil/isolation/frame.d.ts +1 -0
  48. package/dist/types/dil/isolation/isolated-renderer.d.ts +28 -0
  49. package/dist/types/dil/isolation/overlay-room.d.ts +29 -0
  50. package/dist/types/dil/isolation/shadow-renderer.d.ts +7 -0
  51. package/dist/types/dil/isolation/shadow-styles.d.ts +2 -0
  52. package/dist/types/dil/isolation/viewport-scroll.d.ts +7 -0
  53. package/dist/types/dil/isolation/vm-worker.d.ts +1 -0
  54. package/dist/types/dil/message-renderer.d.ts +17 -0
  55. package/dist/types/dil/parser/dil-parser.d.ts +74 -0
  56. package/dist/types/dil/parser/lexical.d.ts +27 -0
  57. package/dist/types/dil/parser/literal-tag.d.ts +16 -0
  58. package/dist/types/dil/parser/markdown-lexing.d.ts +41 -0
  59. package/dist/types/dil/parser/stream-worker.d.ts +1 -0
  60. package/dist/types/dil/parser/types.d.ts +53 -0
  61. package/dist/types/dil/parser/unfinished.d.ts +22 -0
  62. package/dist/types/dil/parser/vocabulary.d.ts +12 -0
  63. package/dist/types/dil/render-error.d.ts +47 -0
  64. package/dist/types/dil/renderer-environment.d.ts +33 -0
  65. package/dist/types/dil/renderer-handle.d.ts +4 -0
  66. package/dist/types/dil/runtime/action-receipt.d.ts +5 -0
  67. package/dist/types/dil/runtime/child-list.d.ts +8 -0
  68. package/dist/types/dil/runtime/document.d.ts +54 -0
  69. package/dist/types/dil/runtime/evaluation-cache.d.ts +24 -0
  70. package/dist/types/dil/runtime/execution-queue.d.ts +56 -0
  71. package/dist/types/dil/runtime/expressions.d.ts +62 -0
  72. package/dist/types/dil/runtime/inline-worker.d.ts +33 -0
  73. package/dist/types/dil/runtime/markdown-stream.d.ts +17 -0
  74. package/dist/types/dil/runtime/presentation-history.d.ts +14 -0
  75. package/dist/types/dil/runtime/presentation-scheduler.d.ts +16 -0
  76. package/dist/types/dil/runtime/render-budget.d.ts +10 -0
  77. package/dist/types/dil/runtime/view-cost.d.ts +10 -0
  78. package/dist/types/dil/styled-renderer.d.ts +39 -0
  79. package/dist/types/dil/view/conditional-view.d.ts +12 -0
  80. package/dist/types/dil/view/loading-block.d.ts +7 -0
  81. package/dist/types/dil/view/markdown-node.d.ts +12 -0
  82. package/dist/types/dil/view/node-children.d.ts +13 -0
  83. package/dist/types/dil/view/node-view.d.ts +11 -0
  84. package/dist/types/dil/view/progressive-reveal.d.ts +7 -0
  85. package/dist/types/dil/view/render-boundary.d.ts +35 -0
  86. package/dist/types/dil/view/render-limit.d.ts +14 -0
  87. package/dist/types/dil/view/repeated-nodes.d.ts +15 -0
  88. package/dist/types/dil/view/reveal/controller.d.ts +32 -0
  89. package/dist/types/dil/view/reveal/presentation.d.ts +13 -0
  90. package/dist/types/dil/view/reveal-options.d.ts +11 -0
  91. package/dist/types/dil/view/scroll/controller.d.ts +42 -0
  92. package/dist/types/dil/view/scroll/host-viewport.d.ts +24 -0
  93. package/dist/types/dil/view/scroll/root-tracker.d.ts +17 -0
  94. package/dist/types/dil/view/scroll/scroll-root.d.ts +36 -0
  95. package/dist/types/dil/view/scroll-options.d.ts +25 -0
  96. package/dist/types/dil/view/stream-follow.d.ts +15 -0
  97. package/dist/types/dil/view/table-context.d.ts +15 -0
  98. package/dist/types/dil/view/virtual-flow.d.ts +15 -0
  99. package/dist/types/dil/widgets/action-feedback.d.ts +11 -0
  100. package/dist/types/dil/widgets/async-image.d.ts +6 -0
  101. package/dist/types/dil/widgets/charts/chart-hover.d.ts +17 -0
  102. package/dist/types/dil/widgets/charts/chart-legend.d.ts +10 -0
  103. package/dist/types/dil/widgets/charts/chart-pie.d.ts +16 -0
  104. package/dist/types/dil/widgets/charts/chart-selection.d.ts +8 -0
  105. package/dist/types/dil/widgets/charts/chart-series.d.ts +19 -0
  106. package/dist/types/dil/widgets/charts/chart-snapping.d.ts +13 -0
  107. package/dist/types/dil/widgets/charts/dil-chart.d.ts +5 -0
  108. package/dist/types/dil/widgets/charts/snap-cursor.d.ts +12 -0
  109. package/dist/types/dil/widgets/charts/snap-tooltip.d.ts +12 -0
  110. package/dist/types/dil/widgets/code/code-editor.d.ts +9 -0
  111. package/dist/types/dil/widgets/code/highlighted-code.d.ts +25 -0
  112. package/dist/types/dil/widgets/code-block.d.ts +11 -0
  113. package/dist/types/dil/widgets/control-revision.d.ts +1 -0
  114. package/dist/types/dil/widgets/control-state.d.ts +8 -0
  115. package/dist/types/dil/widgets/controls.d.ts +25 -0
  116. package/dist/types/dil/widgets/graphs/graph-model.d.ts +13 -0
  117. package/dist/types/dil/widgets/graphs/node-graph.d.ts +6 -0
  118. package/dist/types/dil/widgets/graphs/service-node.d.ts +3 -0
  119. package/dist/types/dil/widgets/mermaid-diagram.d.ts +5 -0
  120. package/dist/types/dil/widgets/primitives/attribute-values.d.ts +12 -0
  121. package/dist/types/dil/widgets/primitives/primitive.d.ts +17 -0
  122. package/dist/types/dil/widgets/primitives/vocabulary.d.ts +5 -0
  123. package/dist/types/dil/widgets/use-control-value.d.ts +2 -0
  124. package/dist/types/index.d.ts +9 -0
  125. package/dist/types/lib/cn.d.ts +2 -0
  126. package/dist/types/ui.d.ts +11 -0
  127. package/dist/ui.js +2 -0
  128. package/package.json +85 -4
  129. package/styles/tailwind.css +443 -0
  130. package/styles/tokens.css +32 -0
@@ -0,0 +1,8 @@
1
+ export interface ControlDraft<T> {
2
+ upstream: T;
3
+ value: T;
4
+ revision: number;
5
+ pending: number;
6
+ }
7
+ export declare function synchronizeDraft<T>(state: ControlDraft<T>, upstream: T, revision: number): ControlDraft<T>;
8
+ export declare function editDraft<T>(state: ControlDraft<T>, value: T, result: unknown, commit: boolean): ControlDraft<T>;
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StoreApi } from "zustand/vanilla";
3
+ import type { DocumentStatus } from "../runtime/document.js";
4
+ import { type Attributes } from "./primitives/attribute-values.js";
5
+ export declare const PopoverTriggerScope: import("react").Context<boolean>;
6
+ export interface ControlProps {
7
+ attributes: Attributes;
8
+ children?: ReactNode;
9
+ ready: boolean;
10
+ label: string;
11
+ className?: string | undefined;
12
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
13
+ }
14
+ /** Actions report clipboard outcomes from their own document. */
15
+ export interface ActionProps extends ControlProps {
16
+ status: StoreApi<DocumentStatus>;
17
+ }
18
+ export declare function ButtonControl({ attributes, children, ready, label, className, presentationRef, status, }: ActionProps): import("react").JSX.Element;
19
+ export declare function CheckboxControl({ attributes, children, ready, className, presentationRef, }: ControlProps): import("react").JSX.Element;
20
+ export declare function SliderControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
21
+ export declare function InputControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
22
+ export declare function SegmentedControl({ attributes, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
23
+ export declare function RadioGroupControl({ attributes, children, ready, label, className, presentationRef, }: ControlProps): import("react").JSX.Element;
24
+ export declare function RadioControl({ attributes, children, ready, className, presentationRef, }: ControlProps): import("react").JSX.Element;
25
+ export declare function PressableControl({ attributes, children, ready, className, presentationRef, status, }: ActionProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type Edge, type Node } from "@xyflow/react";
2
+ export declare const SERVICE_WIDTH = 160;
3
+ export declare const SERVICE_HEIGHT = 72;
4
+ export declare const COLUMN_GAP = 64;
5
+ export type ServiceData = {
6
+ label: string;
7
+ sub: string;
8
+ };
9
+ export type ServiceGraphNode = Node<ServiceData, "service">;
10
+ export declare function graphModel(content: unknown): {
11
+ nodes: ServiceGraphNode[];
12
+ edges: Edge[];
13
+ };
@@ -0,0 +1,6 @@
1
+ import { type Attributes } from "../primitives/attribute-values.js";
2
+ export interface NodeGraphProps {
3
+ attributes: Attributes;
4
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
5
+ }
6
+ export declare function NodeGraph({ attributes, presentationRef }: NodeGraphProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { type NodeProps } from "@xyflow/react";
2
+ import type { ServiceGraphNode } from "./graph-model.js";
3
+ export declare function ServiceNode({ data, selected }: NodeProps<ServiceGraphNode>): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface MermaidDiagramProps {
2
+ source: string;
3
+ presentationRef?: ((element: HTMLElement | null) => void) | undefined;
4
+ }
5
+ export declare function MermaidDiagram({ source, presentationRef, }: MermaidDiagramProps): import("react").JSX.Element | null;
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from "react";
2
+ export type Attributes = Readonly<Record<string, unknown>>;
3
+ export declare function text(value: unknown, fallback?: string): string;
4
+ export declare function number(value: unknown, fallback?: number): number;
5
+ export declare function record(value: unknown): Record<string, unknown>;
6
+ export declare function invoke(attributes: Attributes, key: string, value?: unknown): any;
7
+ /** Presentation-only SVG attributes; paint and marker references stay in the document. */
8
+ export declare function svgAttributes(attributes: Attributes): Record<string, unknown>;
9
+ export declare function color(value: unknown): string | undefined;
10
+ export declare function layoutStyle(attributes: Attributes): CSSProperties & {
11
+ "--dil-columns"?: number;
12
+ };
@@ -0,0 +1,17 @@
1
+ import { type ReactNode } from "react";
2
+ import type { DilNode } from "../../parser/types.js";
3
+ import type { DilDocument } from "../../runtime/document.js";
4
+ import type { Scope } from "../../runtime/expressions.js";
5
+ import { type Attributes } from "./attribute-values.js";
6
+ export interface PrimitiveProps {
7
+ node: DilNode;
8
+ attributes: Attributes;
9
+ children: ReactNode;
10
+ document: DilDocument;
11
+ scope: Scope;
12
+ instance: string;
13
+ svg: boolean;
14
+ inline: boolean;
15
+ interactive: boolean;
16
+ }
17
+ export declare function Primitive({ node, attributes: sourceAttributes, children, document, instance, svg, inline, interactive, }: PrimitiveProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Circle } from "lucide-react";
2
+ export declare const ICONS: Record<string, typeof Circle>;
3
+ export declare const LABELS: Record<string, string>;
4
+ export declare const SIZES: Record<string, string>;
5
+ export declare const SVG_ELEMENTS: Set<string>;
@@ -0,0 +1,2 @@
1
+ /** Retain immediate native feedback while the execution worker acknowledges updates. */
2
+ export declare function useControlValue<T extends string | number | boolean>(upstream: T, action: unknown): readonly [T, (value: T, commit?: boolean) => void];
@@ -0,0 +1,9 @@
1
+ export { DilRenderer, preloadHostRenderer } from "./dil/dil-renderer.js";
2
+ export type { DilRendererHandle } from "./dil/renderer-handle.js";
3
+ export type { AutoScroll, AutoScrollOptions, ScrollContainer, } from "./dil/view/scroll-options.js";
4
+ export type { UpdateInterval } from "./dil/runtime/presentation-scheduler.js";
5
+ export type { DilRendererProps, DilHostRendererProps, DilShadowRendererProps, DilIsolatedRendererProps, } from "./dil/dil-renderer.js";
6
+ export type { DilComponentProps, DilCustomization } from "./dil/customization.js";
7
+ export type { RendererMetrics } from "./dil/renderer-environment.js";
8
+ export type { DilRenderError, DilRenderErrorKind } from "./dil/render-error.js";
9
+ export type { ProgressiveRevealOptions, ProgressiveReveal, } from "./dil/view/reveal-options.js";
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,11 @@
1
+ export { Button, buttonVariants } from "./components/ui/controls/button.js";
2
+ export { ToggleGroup, ToggleGroupItem, } from "./components/ui/controls/toggle-group.js";
3
+ export { UiScope } from "./components/ui/overlays/ui-scope.js";
4
+ export { Popover, PopoverTrigger, PopoverContent, } from "./components/ui/overlays/popover.js";
5
+ export { Tooltip } from "./components/ui/overlays/tooltip.js";
6
+ export { Input } from "./components/ui/controls/input.js";
7
+ export { Checkbox } from "./components/ui/controls/checkbox.js";
8
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent, } from "./components/ui/overlays/collapsible.js";
9
+ export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./components/ui/controls/tabs.js";
10
+ export { Slider } from "./components/ui/controls/slider.js";
11
+ export { Select, SelectValue, SelectGroup, SelectPortal, SelectViewport, SelectItemIndicator, SelectItemText, SelectTrigger, SelectContent, SelectItem, SelectLabel, } from "./components/ui/controls/select.js";
package/dist/ui.js ADDED
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as r,b as p,c,d as m,e as f,f as d,h as u,i as b,j as g,k as C,l as P,m as T,n as x,o as S}from"./chunk-RPZW4WVX.js";import{Collapsible as s}from"radix-ui";import{jsx as a}from"react/jsx-runtime";function v(e){return a(s.Root,{"data-slot":"collapsible",...e})}function y(e){return a(s.Trigger,{"data-slot":"collapsible-trigger",...e})}function I(e){return a(s.Content,{"data-slot":"collapsible-content",...e})}import{Tabs as i}from"radix-ui";import{jsx as l}from"react/jsx-runtime";function w(e){return l(i.Root,{"data-slot":"tabs",...e})}function h({className:e,...t}){return l(i.List,{"data-slot":"tabs-list",className:r("inline-flex w-fit items-center rounded-lg bg-secondary p-1",e),...t})}function L({className:e,...t}){return l(i.Trigger,{"data-slot":"tabs-trigger",className:r("inline-flex h-8 items-center justify-center gap-2 rounded-md px-2 text-sm font-medium text-foreground whitespace-nowrap outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:shadow-sm",e),...t})}function V(e){return l(i.Content,{"data-slot":"tabs-content",...e})}import{Select as o}from"radix-ui";import{jsx as n}from"react/jsx-runtime";var N=o.Root,G=o.Value,R=o.Group,k=o.Viewport,z=o.ItemIndicator,B=o.ItemText;function U(e){let{container:t}=p();return n(o.Portal,{container:t,...e})}function q({className:e,...t}){return n(o.Trigger,{"data-slot":"select-trigger",className:r("inline-flex items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50",e),...t})}function A({className:e,...t}){return n(o.Content,{"data-slot":"select-content",className:r("z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",e),...t})}function D({className:e,...t}){return n(o.Item,{"data-slot":"select-item",className:r("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[highlighted]:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t})}function E({className:e,...t}){return n(o.Label,{"data-slot":"select-label",className:r("px-2 py-1.5 text-xs font-medium",e),...t})}export{b as Button,C as Checkbox,v as Collapsible,I as CollapsibleContent,y as CollapsibleTrigger,P as Input,m as Popover,d as PopoverContent,f as PopoverTrigger,N as Select,A as SelectContent,R as SelectGroup,D as SelectItem,z as SelectItemIndicator,B as SelectItemText,E as SelectLabel,U as SelectPortal,q as SelectTrigger,G as SelectValue,k as SelectViewport,T as Slider,w as Tabs,V as TabsContent,h as TabsList,L as TabsTrigger,x as ToggleGroup,S as ToggleGroupItem,g as Tooltip,c as UiScope,u as buttonVariants};
package/package.json CHANGED
@@ -1,12 +1,93 @@
1
1
  {
2
2
  "name": "@snackbit/opendil",
3
- "version": "0.0.0",
4
- "description": "Placeholder that reserves the package name for trusted publishing. Install 0.1.0 or later.",
3
+ "version": "0.2.0",
4
+ "description": "Streaming interactive documents for React using Dynamic Interface Language",
5
+ "type": "module",
6
+ "types": "./dist/types/index.d.ts",
5
7
  "license": "Apache-2.0",
6
8
  "repository": {
7
9
  "type": "git",
8
- "url": "git+https://github.com/snackbit/opendil.git"
10
+ "url": "git+https://github.com/snackbit/opendil.git",
11
+ "directory": "packages/opendil"
9
12
  },
10
13
  "homepage": "https://opendil.com",
11
- "files": []
14
+ "bugs": "https://github.com/snackbit/opendil/issues",
15
+ "keywords": [
16
+ "react",
17
+ "generative-ui",
18
+ "streaming",
19
+ "dil"
20
+ ],
21
+ "engines": {
22
+ "node": ">=22"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "!dist/test",
27
+ "!dist/.opendil-manifest.json",
28
+ "styles",
29
+ "bin",
30
+ "THIRD_PARTY_NOTICES.md"
31
+ ],
32
+ "sideEffects": [
33
+ "**/*.css"
34
+ ],
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/types/index.d.ts",
38
+ "import": "./dist/index.js"
39
+ },
40
+ "./styles.css": "./dist/styles.css",
41
+ "./tailwind.css": "./styles/tailwind.css",
42
+ "./package.json": "./package.json",
43
+ "./ui": {
44
+ "types": "./dist/types/ui.d.ts",
45
+ "import": "./dist/ui.js"
46
+ },
47
+ "./agent-spec": {
48
+ "types": "./dist/types/agent-spec.d.ts",
49
+ "default": "./dist/agent-spec.js"
50
+ },
51
+ "./spec/genui.agent.md": "./dist/spec/genui.agent.md",
52
+ "./spec/genui.agent.full.md": "./dist/spec/genui.agent.full.md",
53
+ "./spec/genui.examples.md": "./dist/spec/genui.examples.md"
54
+ },
55
+ "bin": {
56
+ "opendil": "./bin/opendil.mjs"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ },
61
+ "scripts": {
62
+ "build": "node scripts/build.mjs",
63
+ "prepack": "node scripts/prune-dist.mjs",
64
+ "typecheck": "tsc --noEmit -p tsconfig.json"
65
+ },
66
+ "peerDependencies": {
67
+ "react": "^19.0.0",
68
+ "react-dom": "^19.0.0"
69
+ },
70
+ "dependencies": {
71
+ "@tanstack/react-virtual": "^3.13.12",
72
+ "@xyflow/react": "^12.12.1",
73
+ "acorn": "^8.16.0",
74
+ "acorn-walk": "^8.3.4",
75
+ "class-variance-authority": "^0.7.1",
76
+ "clsx": "^2.1.1",
77
+ "dompurify": "^3.4.17",
78
+ "embla-carousel-react": "^8.6.0",
79
+ "lowlight": "3.3.0",
80
+ "lucide-react": "^0.468.0",
81
+ "mermaid": "^12.2.0",
82
+ "quickjs-emscripten": "^0.32.0",
83
+ "radix-ui": "^1.8.1",
84
+ "react-markdown": "^10.1.0",
85
+ "recharts": "^3.8.0",
86
+ "remark-gfm": "^4.0.1",
87
+ "remark-parse": "^11.0.0",
88
+ "remend": "^1.4.0",
89
+ "tailwind-merge": "^3.3.1",
90
+ "unified": "^11.0.5",
91
+ "zustand": "^5.0.8"
92
+ }
12
93
  }
@@ -0,0 +1,443 @@
1
+ @import "tailwindcss/theme.css";
2
+ @import "tailwindcss/utilities.css" source("../dist");
3
+ @import "@xyflow/react/dist/style.css";
4
+ @import "./tokens.css";
5
+
6
+ /* Follows the renderer's appearance instead of the operating system or a page-wide class. */
7
+ @custom-variant dil-dark (&:where(.dil-scope[data-theme="dark"], .dil-scope[data-theme="dark"] *));
8
+
9
+ .dil-scope {
10
+ --background: #ffffff;
11
+ --foreground: var(--dil-text-color);
12
+ --card: #ffffff;
13
+ --card-foreground: #171717;
14
+ --popover: #ffffff;
15
+ --popover-foreground: #171717;
16
+ --primary: #202020;
17
+ --primary-foreground: #ffffff;
18
+ --secondary: #f3f3f2;
19
+ --secondary-foreground: #242424;
20
+ --muted: #f6f6f5;
21
+ --muted-foreground: var(--dil-muted-text-color);
22
+ --accent: #eeeeec;
23
+ --accent-foreground: #171717;
24
+ --destructive: #cc4545;
25
+ --border: #e5e5e2;
26
+ --input: #dededb;
27
+ --ring: #8b8b87;
28
+ --radius: 0.75rem;
29
+ --chart-1: #6580d9;
30
+ --chart-2: #47a98a;
31
+ --chart-3: #d4a458;
32
+ --chart-4: #ac81cc;
33
+ --chart-5: #d78675;
34
+ }
35
+ @theme inline {
36
+ --color-background: var(--background);
37
+ --color-foreground: var(--foreground);
38
+ --color-card: var(--card);
39
+ --color-card-foreground: var(--card-foreground);
40
+ --color-popover: var(--popover);
41
+ --color-popover-foreground: var(--popover-foreground);
42
+ --color-primary: var(--primary);
43
+ --color-primary-foreground: var(--primary-foreground);
44
+ --color-secondary: var(--secondary);
45
+ --color-secondary-foreground: var(--secondary-foreground);
46
+ --color-muted: var(--muted);
47
+ --color-muted-foreground: var(--muted-foreground);
48
+ --color-accent: var(--accent);
49
+ --color-accent-foreground: var(--accent-foreground);
50
+ --color-destructive: var(--destructive);
51
+ --color-border: var(--border);
52
+ --color-input: var(--input);
53
+ --color-ring: var(--ring);
54
+ --color-chart-1: var(--chart-1);
55
+ --color-chart-2: var(--chart-2);
56
+ --color-chart-3: var(--chart-3);
57
+ --color-chart-4: var(--chart-4);
58
+ --color-chart-5: var(--chart-5);
59
+ --radius-sm: calc(var(--radius) - 4px);
60
+ --radius-md: calc(var(--radius) - 2px);
61
+ --radius-lg: var(--radius);
62
+ --radius-xl: calc(var(--radius) + 4px);
63
+ }
64
+ @layer base {
65
+ /* Contains absolutely positioned descendants, such as screen-reader status
66
+ regions, so they scroll with the renderer inside overflow containers. In the
67
+ base layer, position utilities passed through className still win. */
68
+ .dil-scope {
69
+ position: relative;
70
+ }
71
+ .dil-scope *,
72
+ .dil-scope *::before,
73
+ .dil-scope *::after {
74
+ box-sizing: border-box;
75
+ border: 0 solid var(--border);
76
+ }
77
+ .dil-scope h1,
78
+ .dil-scope h2,
79
+ .dil-scope h3,
80
+ .dil-scope p {
81
+ margin: 0;
82
+ }
83
+ /* User-agent form colors follow color-scheme, not the renderer tokens. */
84
+ .dil-scope :is(button, input, select, textarea) {
85
+ color: inherit;
86
+ background-color: transparent;
87
+ }
88
+ }
89
+ .dil-scope {
90
+ color-scheme: light;
91
+ background: var(--background);
92
+ color: var(--foreground);
93
+ font-family: var(--font-dil);
94
+ font-size: 15px;
95
+ line-height: 1.65;
96
+ }
97
+ .dil-scope button:not(:disabled),
98
+ .dil-scope [role="button"]:not([aria-disabled="true"]) {
99
+ cursor: pointer;
100
+ }
101
+ .dil-scope button,
102
+ .dil-scope input,
103
+ .dil-scope textarea {
104
+ font: inherit;
105
+ }
106
+ .dil-scope[data-theme="dark"] {
107
+ color-scheme: dark;
108
+ --background: #171717;
109
+ --foreground: #fafafa;
110
+ --dil-text-color: #fafafa;
111
+ --dil-muted-text-color: #b5b5b5;
112
+ --card: #202020;
113
+ --card-foreground: #fafafa;
114
+ --popover: #202020;
115
+ --popover-foreground: #fafafa;
116
+ --primary: #eeeeee;
117
+ --primary-foreground: #171717;
118
+ --secondary: #303030;
119
+ --secondary-foreground: #eeeeee;
120
+ --muted: #292929;
121
+ --muted-foreground: #b5b5b5;
122
+ --accent: #363636;
123
+ --accent-foreground: #fafafa;
124
+ --border: #454545;
125
+ --input: #505050;
126
+ --dil-success: #5cc59a;
127
+ --dil-warning: #e2ad55;
128
+ --dil-success-surface: #1d3a2f;
129
+ --dil-warning-surface: #3d3020;
130
+ --dil-danger-surface: #432526;
131
+ }
132
+ .dil-document {
133
+ overflow-wrap: anywhere;
134
+ }
135
+ .dil-markdown {
136
+ display: contents;
137
+ }
138
+ .dil-markdown p {
139
+ margin: 0;
140
+ }
141
+ .dil-markdown h1 {
142
+ font-size: 1.8rem;
143
+ font-weight: 650;
144
+ line-height: 1.25;
145
+ margin: 0 0 8px;
146
+ letter-spacing: -0.035em;
147
+ }
148
+ .dil-markdown h2 {
149
+ font-size: 1.25rem;
150
+ font-weight: 650;
151
+ line-height: 1.4;
152
+ margin: 24px 0 4px;
153
+ letter-spacing: -0.02em;
154
+ }
155
+ .dil-markdown strong {
156
+ font-weight: 600;
157
+ }
158
+ /* The browser's list and quote styles, restated so a host page's CSS reset,
159
+ such as Tailwind's preflight, does not remove bullets, numbers and indents. */
160
+ .dil-markdown :where(ul, ol) {
161
+ margin-block: 1em;
162
+ padding-inline-start: 40px;
163
+ }
164
+ .dil-markdown :where(ul, ol) :where(ul, ol) {
165
+ margin-block: 0;
166
+ }
167
+ .dil-markdown ul {
168
+ list-style-type: disc;
169
+ }
170
+ .dil-markdown :where(ul, ol) ul {
171
+ list-style-type: circle;
172
+ }
173
+ .dil-markdown :where(ul, ol) :where(ul, ol) ul {
174
+ list-style-type: square;
175
+ }
176
+ .dil-markdown ol {
177
+ list-style-type: decimal;
178
+ }
179
+ .dil-markdown blockquote {
180
+ margin: 1em 40px;
181
+ }
182
+ .dil-markdown table {
183
+ width: 100%;
184
+ border-collapse: collapse;
185
+ font-size: 14px;
186
+ }
187
+ .dil-markdown th,
188
+ .dil-markdown td {
189
+ padding: 10px 12px;
190
+ text-align: left;
191
+ border-bottom: 1px solid var(--border);
192
+ }
193
+ .dil-markdown pre {
194
+ overflow-x: auto;
195
+ padding: 16px;
196
+ background: var(--muted);
197
+ border-radius: 8px;
198
+ }
199
+ .dil-flow {
200
+ display: flex;
201
+ flex-direction: column;
202
+ gap: 12px;
203
+ min-width: 0;
204
+ }
205
+ .dil-layout {
206
+ display: flex;
207
+ flex-direction: column;
208
+ min-width: 0;
209
+ }
210
+ .dil-row {
211
+ flex-direction: row;
212
+ }
213
+ .dil-grid {
214
+ display: grid;
215
+ grid-template-columns: repeat(var(--dil-columns, 2), minmax(0, 1fr));
216
+ }
217
+ .dil-inline p {
218
+ display: inline;
219
+ }
220
+ .dil-input-wrap {
221
+ display: flex;
222
+ flex-direction: column;
223
+ gap: 6px;
224
+ min-width: 0;
225
+ }
226
+ .dil-virtual-item {
227
+ width: 100%;
228
+ position: absolute;
229
+ top: 0;
230
+ left: 0;
231
+ padding-bottom: var(--dil-item-gap, 12px);
232
+ }
233
+ .dil-virtual-item:focus-within {
234
+ z-index: 1;
235
+ }
236
+ .dil-skeleton {
237
+ min-height: 28px;
238
+ border-radius: 8px;
239
+ background: var(--muted);
240
+ animation: dil-pulse 1.5s ease-in-out infinite;
241
+ }
242
+ .dil-chart-legend {
243
+ display: flex;
244
+ justify-content: center;
245
+ flex-wrap: wrap;
246
+ min-height: 32px;
247
+ gap: 2px;
248
+ }
249
+ .dil-scope .dil-legend-item {
250
+ font-weight: 400;
251
+ display: inline-flex;
252
+ align-items: center;
253
+ gap: 4px;
254
+ padding: 3px 5px;
255
+ font-size: 12px;
256
+ background: transparent;
257
+ box-shadow: none;
258
+ transition: opacity 150ms ease;
259
+ }
260
+ .dil-legend-item:hover {
261
+ background: transparent;
262
+ }
263
+ .dil-legend-item:focus-visible {
264
+ outline: 2px solid var(--ring);
265
+ outline-offset: 2px;
266
+ }
267
+ .dil-legend-item[data-muted="true"] {
268
+ opacity: 0.625;
269
+ }
270
+ .dil-legend-item[data-hidden="true"] {
271
+ opacity: 0.45;
272
+ }
273
+ .dil-legend-swatch {
274
+ width: 11px;
275
+ height: 11px;
276
+ border-radius: 1px;
277
+ flex-shrink: 0;
278
+ }
279
+ .dil-chart-series {
280
+ transition: opacity 150ms ease;
281
+ }
282
+ /* Pie slice emphasis stays in CSS: re-rendering a Recharts Pie remounts its sectors. */
283
+ .dil-chart-pie:has(.dil-chart-series:hover, .dil-chart-series:focus-visible)
284
+ .dil-chart-series:not(:hover, :focus-visible) {
285
+ opacity: 0.625;
286
+ }
287
+ .dil-tooltip {
288
+ z-index: 60;
289
+ max-width: min(24rem, calc(100vw - 16px));
290
+ border-radius: 8px;
291
+ background: var(--foreground);
292
+ color: var(--background);
293
+ padding: 6px 10px;
294
+ font-size: 12px;
295
+ line-height: 1.4;
296
+ box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
297
+ }
298
+ .dil-snap-tooltip {
299
+ pointer-events: none;
300
+ }
301
+ .dil-snap-tooltip [data-emphasized="true"] span {
302
+ font-weight: 700;
303
+ }
304
+ .dil-code-block textarea {
305
+ font-family: var(--font-mono, monospace);
306
+ font-size: var(--text-xs, 0.75rem);
307
+ line-height: 1.6;
308
+ white-space: pre;
309
+ overflow-wrap: normal;
310
+ overflow-x: auto;
311
+ }
312
+ .dil-code-editor {
313
+ position: relative;
314
+ }
315
+ .dil-code-editor textarea,
316
+ .dil-code-editor .dil-code-highlight {
317
+ margin: 0;
318
+ padding: 12px;
319
+ font-family: var(--font-mono, monospace);
320
+ font-size: 12px;
321
+ line-height: 1.6;
322
+ letter-spacing: normal;
323
+ tab-size: 2;
324
+ white-space: pre;
325
+ overflow-wrap: normal;
326
+ word-break: normal;
327
+ }
328
+ .dil-code-editor .dil-code-highlight {
329
+ position: absolute;
330
+ inset: 0;
331
+ overflow: hidden;
332
+ pointer-events: none;
333
+ }
334
+ .dil-code-editor .dil-code-highlight code,
335
+ .dil-code-editor .dil-code-highlight span {
336
+ font: inherit;
337
+ letter-spacing: inherit;
338
+ tab-size: inherit;
339
+ }
340
+ .dil-code-editor textarea {
341
+ position: relative;
342
+ color: transparent;
343
+ caret-color: var(--foreground);
344
+ background: transparent;
345
+ }
346
+ .dil-code-editor textarea::selection {
347
+ color: transparent;
348
+ background: color-mix(in srgb, var(--primary) 24%, transparent);
349
+ }
350
+ .dil-code-block .hljs-keyword,
351
+ .dil-code-block .hljs-literal,
352
+ .dil-code-block .hljs-type {
353
+ color: var(--dil-code-keyword, #7044a6);
354
+ }
355
+ .dil-code-block .hljs-string,
356
+ .dil-code-block .hljs-attr,
357
+ .dil-code-block .hljs-addition {
358
+ color: var(--dil-code-string, #24734f);
359
+ }
360
+ .dil-code-block .hljs-number,
361
+ .dil-code-block .hljs-symbol {
362
+ color: var(--dil-code-number, #a15021);
363
+ }
364
+ .dil-code-block .hljs-title,
365
+ .dil-code-block .hljs-built_in,
366
+ .dil-code-block .hljs-tag {
367
+ color: var(--dil-code-title, #285ca3);
368
+ }
369
+ .dil-code-block .hljs-comment,
370
+ .dil-code-block .hljs-meta {
371
+ color: var(--muted-foreground);
372
+ }
373
+ .dil-scope[data-theme="dark"] {
374
+ --dil-code-keyword: #c7a7f8;
375
+ --dil-code-string: #8bd4ae;
376
+ --dil-code-number: #f2b685;
377
+ --dil-code-title: #97bdf4;
378
+ }
379
+ @media (forced-colors: active) {
380
+ .dil-code-editor .dil-code-highlight {
381
+ visibility: hidden;
382
+ }
383
+ .dil-code-editor textarea {
384
+ color: CanvasText;
385
+ caret-color: CanvasText;
386
+ }
387
+ .dil-code-editor textarea::selection {
388
+ color: HighlightText;
389
+ background: Highlight;
390
+ }
391
+ }
392
+ .dil-code-block[data-word-wrap="true"] :is(pre, textarea) {
393
+ white-space: pre-wrap;
394
+ overflow-wrap: anywhere;
395
+ }
396
+ .dil-service-node {
397
+ width: 160px;
398
+ height: 72px;
399
+ display: flex;
400
+ flex-direction: column;
401
+ justify-content: center;
402
+ gap: 4px;
403
+ padding: 10px 14px;
404
+ border: 1px solid var(--border);
405
+ border-radius: 12px;
406
+ background: var(--card);
407
+ color: var(--foreground);
408
+ }
409
+ .dil-service-node strong {
410
+ font-size: 14px;
411
+ line-height: 1.2;
412
+ }
413
+ .dil-service-node > span {
414
+ font-size: 12px;
415
+ color: var(--muted-foreground);
416
+ line-height: 1.2;
417
+ }
418
+ .dil-service-node[data-selected="true"] {
419
+ border-color: var(--ring);
420
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 35%, transparent);
421
+ }
422
+ @keyframes dil-pulse {
423
+ 50% {
424
+ opacity: 0.5;
425
+ }
426
+ }
427
+ @media (max-width: 520px) {
428
+ .dil-grid {
429
+ grid-template-columns: 1fr;
430
+ }
431
+ .dil-row[data-wrap="wrap"] {
432
+ flex-wrap: wrap;
433
+ }
434
+ }
435
+ @media (prefers-reduced-motion: reduce) {
436
+ *,
437
+ *::before,
438
+ *::after {
439
+ animation: none !important;
440
+ scroll-behavior: auto !important;
441
+ transition: none !important;
442
+ }
443
+ }