@nadicodeai/ui 0.7.0 → 0.9.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/AGENTS.md +13 -0
- package/README.md +1 -0
- package/dist/components/action-status.d.ts +11 -0
- package/dist/components/action-status.d.ts.map +1 -0
- package/dist/components/action-status.js +6 -0
- package/dist/components/agent-avatar.d.ts +7 -0
- package/dist/components/agent-avatar.d.ts.map +1 -0
- package/dist/components/agent-avatar.js +6 -0
- package/dist/components/agent-message.d.ts.map +1 -1
- package/dist/components/agent-message.js +10 -6
- package/dist/components/agent-thread.js +1 -1
- package/dist/components/agent-tool-approval.d.ts +5 -10
- package/dist/components/agent-tool-approval.d.ts.map +1 -1
- package/dist/components/agent-tool-approval.js +9 -30
- package/dist/components/artifact-panel.d.ts +1 -2
- package/dist/components/artifact-panel.d.ts.map +1 -1
- package/dist/components/artifact-panel.js +12 -13
- package/dist/components/attachment.d.ts +24 -0
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +68 -0
- package/dist/components/bubble.d.ts +17 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +59 -0
- package/dist/components/confirm-dialog.d.ts +16 -0
- package/dist/components/confirm-dialog.d.ts.map +1 -0
- package/dist/components/confirm-dialog.js +18 -0
- package/dist/components/diff-count.d.ts +7 -0
- package/dist/components/diff-count.d.ts.map +1 -0
- package/dist/components/diff-count.js +18 -0
- package/dist/components/disclosure-row.d.ts +12 -0
- package/dist/components/disclosure-row.d.ts.map +1 -0
- package/dist/components/disclosure-row.js +11 -0
- package/dist/components/expandable-block.d.ts +10 -0
- package/dist/components/expandable-block.d.ts.map +1 -0
- package/dist/components/expandable-block.js +22 -0
- package/dist/components/file-type-icon.d.ts +8 -0
- package/dist/components/file-type-icon.d.ts.map +1 -0
- package/dist/components/file-type-icon.js +90 -0
- package/dist/components/glyph-spinner.d.ts +10 -0
- package/dist/components/glyph-spinner.d.ts.map +1 -0
- package/dist/components/glyph-spinner.js +101 -0
- package/dist/components/handoff-banner.d.ts +9 -0
- package/dist/components/handoff-banner.d.ts.map +1 -0
- package/dist/components/handoff-banner.js +6 -0
- package/dist/components/marker.d.ts +11 -0
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +34 -0
- package/dist/components/memory-item.d.ts +9 -0
- package/dist/components/memory-item.d.ts.map +1 -0
- package/dist/components/memory-item.js +6 -0
- package/dist/components/message-scroller.d.ts +17 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +29 -0
- package/dist/components/message.d.ts +11 -0
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +21 -0
- package/dist/components/run-timeline.d.ts +16 -0
- package/dist/components/run-timeline.d.ts.map +1 -0
- package/dist/components/run-timeline.js +9 -0
- package/dist/components/status-dot.d.ts +9 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +12 -0
- package/dist/components/status-row.d.ts +18 -0
- package/dist/components/status-row.d.ts.map +1 -0
- package/dist/components/status-row.js +21 -0
- package/dist/components/toast.d.ts +3 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +4 -0
- package/dist/components/tool-icon.d.ts +8 -0
- package/dist/components/tool-icon.d.ts.map +1 -0
- package/dist/components/tool-icon.js +23 -0
- package/dist/components/usage-meter.d.ts +9 -0
- package/dist/components/usage-meter.d.ts.map +1 -0
- package/dist/components/usage-meter.js +10 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/use-below-breakpoint.d.ts +3 -0
- package/dist/hooks/use-below-breakpoint.d.ts.map +1 -0
- package/dist/hooks/use-below-breakpoint.js +20 -0
- package/dist/hooks/use-confirm-action.d.ts +17 -0
- package/dist/hooks/use-confirm-action.d.ts.map +1 -0
- package/dist/hooks/use-confirm-action.js +59 -0
- package/dist/index.d.ts +27 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -7
- package/dist/lib/agent-contracts.d.ts +132 -0
- package/dist/lib/agent-contracts.d.ts.map +1 -0
- package/dist/lib/agent-contracts.js +6 -0
- package/dist/lib/agent-state.d.ts +22 -0
- package/dist/lib/agent-state.d.ts.map +1 -0
- package/dist/lib/agent-state.js +96 -0
- package/dist/lib/message-scroller-primitive/components.d.ts +17 -0
- package/dist/lib/message-scroller-primitive/components.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/components.js +204 -0
- package/dist/lib/message-scroller-primitive/geometry.d.ts +55 -0
- package/dist/lib/message-scroller-primitive/geometry.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/geometry.js +199 -0
- package/dist/lib/message-scroller-primitive/index.d.ts +12 -0
- package/dist/lib/message-scroller-primitive/index.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/index.js +12 -0
- package/dist/lib/message-scroller-primitive/stores.d.ts +7 -0
- package/dist/lib/message-scroller-primitive/stores.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/stores.js +53 -0
- package/dist/lib/message-scroller-primitive/types.d.ts +89 -0
- package/dist/lib/message-scroller-primitive/types.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/types.js +40 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-commands.d.ts +19 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-commands.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-commands.js +188 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-controller.d.ts +7 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-controller.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-controller.js +506 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-refs.d.ts +49 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-refs.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/use-message-scroller-refs.js +90 -0
- package/dist/lib/message-scroller-primitive/use-render.d.ts +22 -0
- package/dist/lib/message-scroller-primitive/use-render.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/use-render.js +113 -0
- package/dist/lib/message-scroller-primitive/utils.d.ts +4 -0
- package/dist/lib/message-scroller-primitive/utils.d.ts.map +1 -0
- package/dist/lib/message-scroller-primitive/utils.js +9 -0
- package/dist/styles/globals.css +29 -17
- package/docs/agent-work-surfaces.md +36 -3
- package/docs/agents/nadicodeai-ui.md +1 -0
- package/docs/consuming-cross-repo.md +72 -0
- package/docs/migration/ai-elements-vendoring.md +29 -0
- package/docs/migration/nadia-consumer-readiness.md +100 -0
- package/llms.txt +1 -0
- package/package.json +14 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { ChevronRightIcon } from "lucide-react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
function StatusRow({ children, className, leading, onActivate, trailing, trailingVisible = false, ...props }) {
|
|
7
|
+
return (_jsxs("div", { className: cn("group/status-row flex min-h-6 items-center gap-2 rounded-md px-1.5 py-1", onActivate && "cursor-pointer hover:bg-muted", className), "data-slot": "status-row", onClick: onActivate, onKeyDown: onActivate
|
|
8
|
+
? (event) => {
|
|
9
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
onActivate(event);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
: undefined, role: onActivate ? "button" : undefined, tabIndex: onActivate ? 0 : undefined, ...props, children: [leading !== undefined ? (_jsx("span", { className: "flex size-3.5 shrink-0 items-center justify-center", children: leading })) : null, _jsx("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: children }), trailing ? (_jsx("div", { className: cn("flex shrink-0 items-center gap-0.5", !trailingVisible &&
|
|
15
|
+
"opacity-0 group-hover/status-row:opacity-100 group-focus-within/status-row:opacity-100"), children: trailing })) : null] }));
|
|
16
|
+
}
|
|
17
|
+
function StatusSection({ accessory, children, defaultCollapsed = true, icon, label, }) {
|
|
18
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
19
|
+
return (_jsxs("div", { "data-slot": "status-section", children: [_jsxs("div", { className: "flex items-center gap-1 pr-1", children: [_jsxs("button", { "aria-expanded": !collapsed, className: "flex min-w-0 flex-1 items-center gap-1.5 px-2 py-1 text-left text-xs font-normal text-muted-foreground transition-colors hover:text-foreground", onClick: () => setCollapsed((value) => !value), type: "button", children: [_jsx(ChevronRightIcon, { "aria-hidden": "true", className: cn("size-3 shrink-0 transition-transform duration-150", !collapsed && "rotate-90"), "data-icon": "inline-start" }), icon ? _jsx("span", { className: "flex shrink-0 items-center", children: icon }) : null, _jsx("span", { className: "truncate", children: label })] }), accessory ? _jsx("div", { className: "flex shrink-0 items-center gap-1", children: accessory }) : null] }), !collapsed ? _jsx("div", { className: "px-1 pb-0.5", children: children }) : null] }));
|
|
20
|
+
}
|
|
21
|
+
export { StatusRow, StatusSection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export interface ToolIconProps extends Omit<React.ComponentProps<"svg">, "name"> {
|
|
3
|
+
name: string;
|
|
4
|
+
size?: number | string;
|
|
5
|
+
}
|
|
6
|
+
declare function ToolIcon({ className, name, size, style, ...props }: ToolIconProps): React.JSX.Element;
|
|
7
|
+
export { ToolIcon };
|
|
8
|
+
//# sourceMappingURL=tool-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-icon.d.ts","sourceRoot":"","sources":["../../src/components/tool-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA6BpC,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AACD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAiB,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,qBAevF;AACD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
const FILE_PATH = "M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z";
|
|
4
|
+
const QUESTION_PATH = "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z";
|
|
5
|
+
const TOOL_ICON_PATHS = {
|
|
6
|
+
diff: "M118.18,213.08A8,8,0,0,1,112,216H64a8,8,0,0,1,0-16H92.69L55,162.34a23.85,23.85,0,0,1-7-17V95a32,32,0,1,1,16,0v50.38A8,8,0,0,0,66.34,151L104,188.69V160a8,8,0,0,1,16,0v48a8,8,0,0,1-1.82,5.08ZM208,161V110.63a23.85,23.85,0,0,0-7-17L163.31,56H192a8,8,0,0,0,0-16H144a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31L189.66,105a8,8,0,0,1,2.34,5.66V161a32,32,0,1,0,16,0Z",
|
|
7
|
+
edit: "M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z",
|
|
8
|
+
eye: "M247.31,124.76C246.96,123.97,213,48,128,48S9,123.97,8.69,124.76a8,8,0,0,0,0,6.5C9,132.05,43,208,128,208s119-75.95,119.31-76.74a8,8,0,0,0,0-6.5ZM128,168a40,40,0,1,1,40-40A40,40,0,0,1,128,168Z",
|
|
9
|
+
file: FILE_PATH,
|
|
10
|
+
"file-media": FILE_PATH,
|
|
11
|
+
files: FILE_PATH,
|
|
12
|
+
globe: "M128,24a104,104,0,1,0,104,104A104.12,104.12,0,0,0,128,24Zm0,19c10,11,19,27,26,45h-52c7-18,16-34,26-45Zm0,170c-10-11-19-27-26-45h52c-7,18-16,34-26,45Zm-30-61a141,141,0,0,1,0-48h60a141,141,0,0,1,0,48Z",
|
|
13
|
+
question: QUESTION_PATH,
|
|
14
|
+
search: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z",
|
|
15
|
+
terminal: "M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-91,94.25-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32a8,8,0,0,1,0,12.5ZM176,168H136a8,8,0,0,1,0-16h40a8,8,0,0,1,0,16Z",
|
|
16
|
+
tools: "M232,96a72,72,0,0,1-100.94,66L79,222.22a32,32,0,0,1-45.65-44.84L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z",
|
|
17
|
+
watch: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z",
|
|
18
|
+
};
|
|
19
|
+
function ToolIcon({ className, name, size = "0.875rem", style, ...props }) {
|
|
20
|
+
const path = TOOL_ICON_PATHS[name] ?? QUESTION_PATH;
|
|
21
|
+
return (_jsx("svg", { "aria-hidden": "true", className: cn("shrink-0", className), "data-slot": "tool-icon", fill: "currentColor", style: { height: size, width: size, ...style }, viewBox: "0 0 256 256", ...props, children: _jsx("path", { d: path }) }));
|
|
22
|
+
}
|
|
23
|
+
export { ToolIcon };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function UsageMeter({ className, fields, trailing, usage, children, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
3
|
+
fields?: string[];
|
|
4
|
+
trailing?: string;
|
|
5
|
+
usage?: number | string;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
export { UsageMeter };
|
|
9
|
+
//# sourceMappingURL=usage-meter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-meter.d.ts","sourceRoot":"","sources":["../../src/components/usage-meter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,MAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,qBAmCA;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
function UsageMeter({ className, fields = [], trailing, usage, children, ...props }) {
|
|
5
|
+
const hasMeta = fields.length > 0 || trailing != null || children != null;
|
|
6
|
+
return (_jsxs("div", { "data-slot": "usage-meter", className: cn("nc-usage-meter", className), ...props, children: [hasMeta && (_jsxs("div", { className: "nc-usage-meter-meta", children: [fields.map((field, index) => (
|
|
7
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: meta fields are a fixed positional list
|
|
8
|
+
_jsxs(React.Fragment, { children: [index > 0 && _jsx("span", { className: "nc-usage-meter-sep", children: "/" }), _jsx("span", { children: field })] }, index))), trailing != null && (_jsxs(_Fragment, { children: [_jsx("span", { className: "nc-usage-meter-spacer" }), _jsx("span", { children: trailing })] })), children != null && _jsx("span", { "data-slot": "usage-meter-slot", children: children })] })), usage != null && (_jsx("div", { className: "nc-usage-meter-track", children: _jsx("div", { className: "nc-usage-meter-fill", style: { "--nc-usage": typeof usage === "number" ? `${usage}%` : usage } }) }))] }));
|
|
9
|
+
}
|
|
10
|
+
export { UsageMeter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-below-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-below-breakpoint.ts"],"names":[],"mappings":"AAMA,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CActD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
// Strictly-below max-width query for a pixel breakpoint, mirroring
|
|
4
|
+
// use-mobile's `${breakpoint - 1}px` convention: true only under `px`, never at.
|
|
5
|
+
export function belowBreakpointQuery(px) {
|
|
6
|
+
return `(max-width: ${px - 1}px)`;
|
|
7
|
+
}
|
|
8
|
+
export function useBelowBreakpoint(px) {
|
|
9
|
+
const [isBelow, setIsBelow] = React.useState(undefined);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const mql = window.matchMedia(belowBreakpointQuery(px));
|
|
12
|
+
const onChange = () => {
|
|
13
|
+
setIsBelow(mql.matches);
|
|
14
|
+
};
|
|
15
|
+
mql.addEventListener("change", onChange);
|
|
16
|
+
setIsBelow(mql.matches);
|
|
17
|
+
return () => mql.removeEventListener("change", onChange);
|
|
18
|
+
}, [px]);
|
|
19
|
+
return !!isBelow;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ConfirmActionGate {
|
|
2
|
+
busy: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function requestConfirmAction<T>(gate: ConfirmActionGate, value: T, setPending: (value: T | null) => void): void;
|
|
5
|
+
export declare function cancelConfirmAction<T>(gate: ConfirmActionGate, setPending: (value: T | null) => void): void;
|
|
6
|
+
export declare function runConfirmAction<T>(gate: ConfirmActionGate, pending: T | null, onConfirm: (value: T) => void | Promise<void>, setPending: (value: T | null) => void, setBusy: (busy: boolean) => void): Promise<void>;
|
|
7
|
+
export declare function useConfirmAction<T>({ onConfirm, }: {
|
|
8
|
+
onConfirm: (value: T) => void | Promise<void>;
|
|
9
|
+
}): {
|
|
10
|
+
readonly request: (value: T) => void;
|
|
11
|
+
readonly cancel: () => void;
|
|
12
|
+
readonly confirm: () => Promise<void>;
|
|
13
|
+
readonly isBusy: boolean;
|
|
14
|
+
readonly isOpen: boolean;
|
|
15
|
+
readonly pending: T | null;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=use-confirm-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-confirm-action.d.ts","sourceRoot":"","sources":["../../src/hooks/use-confirm-action.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;CACf;AAID,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,GACpC,IAAI,CAKN;AAID,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,IAAI,EAAE,iBAAiB,EACvB,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,GACpC,IAAI,CAKN;AAKD,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,CAAC,GAAG,IAAI,EACjB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC7C,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,EACrC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAC/B,OAAO,CAAC,IAAI,CAAC,CAef;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,EAClC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;8BAK2C,CAAC;;;;;;EAqB5C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
// Request stages a value for confirmation; ignored while a confirm is in
|
|
4
|
+
// flight so the pending value cannot change under a running action.
|
|
5
|
+
export function requestConfirmAction(gate, value, setPending) {
|
|
6
|
+
if (gate.busy) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
setPending(value);
|
|
10
|
+
}
|
|
11
|
+
// Cancel clears the pending value, but is a no-op while a confirm is in flight
|
|
12
|
+
// so the dialog cannot be dismissed mid-action.
|
|
13
|
+
export function cancelConfirmAction(gate, setPending) {
|
|
14
|
+
if (gate.busy) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setPending(null);
|
|
18
|
+
}
|
|
19
|
+
// Confirm marks busy, awaits `onConfirm`, and clears the pending value on
|
|
20
|
+
// success. A thrown error is swallowed so the dialog stays open (the caller
|
|
21
|
+
// surfaces the error inside `onConfirm`); busy always resets in `finally`.
|
|
22
|
+
export async function runConfirmAction(gate, pending, onConfirm, setPending, setBusy) {
|
|
23
|
+
if (gate.busy || pending === null) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
gate.busy = true;
|
|
27
|
+
setBusy(true);
|
|
28
|
+
try {
|
|
29
|
+
await onConfirm(pending);
|
|
30
|
+
setPending(null);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// Keep the pending value so the dialog stays open.
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
gate.busy = false;
|
|
37
|
+
setBusy(false);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function useConfirmAction({ onConfirm, }) {
|
|
41
|
+
const [pending, setPending] = React.useState(null);
|
|
42
|
+
const [isBusy, setIsBusy] = React.useState(false);
|
|
43
|
+
const gateRef = React.useRef({ busy: false });
|
|
44
|
+
const request = React.useCallback((value) => {
|
|
45
|
+
requestConfirmAction(gateRef.current, value, setPending);
|
|
46
|
+
}, []);
|
|
47
|
+
const cancel = React.useCallback(() => {
|
|
48
|
+
cancelConfirmAction(gateRef.current, setPending);
|
|
49
|
+
}, []);
|
|
50
|
+
const confirm = React.useCallback(() => runConfirmAction(gateRef.current, pending, onConfirm, setPending, setIsBusy), [pending, onConfirm]);
|
|
51
|
+
return {
|
|
52
|
+
request,
|
|
53
|
+
cancel,
|
|
54
|
+
confirm,
|
|
55
|
+
isBusy,
|
|
56
|
+
isOpen: pending !== null,
|
|
57
|
+
pending,
|
|
58
|
+
};
|
|
59
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
export * from "./components/accordion";
|
|
2
2
|
export * from "./components/action-band";
|
|
3
|
-
export * from "./components/
|
|
4
|
-
export * from "./components/
|
|
3
|
+
export * from "./components/action-status";
|
|
4
|
+
export * from "./components/agent-avatar";
|
|
5
5
|
export * from "./components/agent-chat";
|
|
6
6
|
export * from "./components/agent-composer";
|
|
7
7
|
export * from "./components/agent-message";
|
|
8
8
|
export * from "./components/agent-thread";
|
|
9
9
|
export * from "./components/agent-tool-approval";
|
|
10
|
-
export * from "./components/
|
|
10
|
+
export * from "./components/alert";
|
|
11
|
+
export * from "./components/alert-dialog";
|
|
11
12
|
export * from "./components/artifact-panel";
|
|
12
|
-
export * from "./components/
|
|
13
|
+
export * from "./components/aspect-ratio";
|
|
14
|
+
export * from "./components/attachment";
|
|
13
15
|
export * from "./components/automation-section";
|
|
16
|
+
export * from "./components/avatar";
|
|
14
17
|
export * from "./components/badge";
|
|
15
18
|
export * from "./components/benefits-bento";
|
|
16
19
|
export * from "./components/bento";
|
|
17
20
|
export * from "./components/brand";
|
|
18
21
|
export * from "./components/breadcrumb";
|
|
22
|
+
export * from "./components/bubble";
|
|
19
23
|
export * from "./components/button";
|
|
20
24
|
export * from "./components/button-group";
|
|
21
25
|
export * from "./components/calendar";
|
|
@@ -37,24 +41,31 @@ export * from "./components/code-editor-mockup";
|
|
|
37
41
|
export * from "./components/collapsible";
|
|
38
42
|
export * from "./components/combobox";
|
|
39
43
|
export * from "./components/command";
|
|
44
|
+
export * from "./components/confirm-dialog";
|
|
40
45
|
export * from "./components/contact";
|
|
41
46
|
export * from "./components/context-menu";
|
|
47
|
+
export * from "./components/dashboard-shell";
|
|
42
48
|
export * from "./components/demo-surface";
|
|
49
|
+
export * from "./components/desktop-shell";
|
|
43
50
|
export * from "./components/dialog";
|
|
51
|
+
export * from "./components/diff-count";
|
|
44
52
|
export * from "./components/direction";
|
|
45
|
-
export * from "./components/
|
|
46
|
-
export * from "./components/desktop-shell";
|
|
53
|
+
export * from "./components/disclosure-row";
|
|
47
54
|
export * from "./components/drawer";
|
|
48
55
|
export * from "./components/dropdown-menu";
|
|
49
56
|
export * from "./components/empty";
|
|
57
|
+
export * from "./components/expandable-block";
|
|
50
58
|
export * from "./components/fact-cell";
|
|
51
59
|
export * from "./components/faq";
|
|
52
60
|
export * from "./components/faq-item";
|
|
53
61
|
export * from "./components/feedback-state";
|
|
54
62
|
export * from "./components/field";
|
|
63
|
+
export * from "./components/file-type-icon";
|
|
55
64
|
export * from "./components/files-preview";
|
|
56
65
|
export * from "./components/footer";
|
|
57
66
|
export * from "./components/form";
|
|
67
|
+
export * from "./components/glyph-spinner";
|
|
68
|
+
export * from "./components/handoff-banner";
|
|
58
69
|
export * from "./components/hero-split";
|
|
59
70
|
export * from "./components/hover-card";
|
|
60
71
|
export * from "./components/input";
|
|
@@ -67,8 +78,12 @@ export * from "./components/label";
|
|
|
67
78
|
export * from "./components/label-system";
|
|
68
79
|
export * from "./components/logo-band";
|
|
69
80
|
export * from "./components/logo-tile";
|
|
81
|
+
export * from "./components/marker";
|
|
70
82
|
export * from "./components/media-mount";
|
|
83
|
+
export * from "./components/memory-item";
|
|
71
84
|
export * from "./components/menubar";
|
|
85
|
+
export * from "./components/message";
|
|
86
|
+
export * from "./components/message-scroller";
|
|
72
87
|
export * from "./components/native-select";
|
|
73
88
|
export * from "./components/nav-bar";
|
|
74
89
|
export * from "./components/navigation-menu";
|
|
@@ -84,14 +99,15 @@ export * from "./components/proof-slot";
|
|
|
84
99
|
export * from "./components/quote-card";
|
|
85
100
|
export * from "./components/radio-group";
|
|
86
101
|
export * from "./components/resizable";
|
|
102
|
+
export * from "./components/run-timeline";
|
|
87
103
|
export * from "./components/scroll-area";
|
|
88
104
|
export * from "./components/seam-grid";
|
|
89
105
|
export * from "./components/section-intro";
|
|
90
106
|
export * from "./components/select";
|
|
91
107
|
export * from "./components/separator";
|
|
92
108
|
export * from "./components/settings-section";
|
|
93
|
-
export * from "./components/shift-band";
|
|
94
109
|
export * from "./components/sheet";
|
|
110
|
+
export * from "./components/shift-band";
|
|
95
111
|
export * from "./components/sidebar";
|
|
96
112
|
export * from "./components/skeleton";
|
|
97
113
|
export * from "./components/slider";
|
|
@@ -100,6 +116,8 @@ export * from "./components/spinner";
|
|
|
100
116
|
export * from "./components/stat-block";
|
|
101
117
|
export * from "./components/state-notice";
|
|
102
118
|
export * from "./components/stats-band";
|
|
119
|
+
export * from "./components/status-dot";
|
|
120
|
+
export * from "./components/status-row";
|
|
103
121
|
export * from "./components/switch";
|
|
104
122
|
export * from "./components/table";
|
|
105
123
|
export * from "./components/tabs";
|
|
@@ -108,7 +126,9 @@ export * from "./components/textarea";
|
|
|
108
126
|
export * from "./components/theme-mode-switcher";
|
|
109
127
|
export * from "./components/toggle";
|
|
110
128
|
export * from "./components/toggle-group";
|
|
129
|
+
export * from "./components/tool-icon";
|
|
111
130
|
export * from "./components/tooltip";
|
|
131
|
+
export * from "./components/usage-meter";
|
|
112
132
|
export * from "./components/use-case-bento";
|
|
113
133
|
export * from "./components/watch-it-work-band";
|
|
114
134
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,C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B,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
export * from "./components/accordion.js";
|
|
2
2
|
export * from "./components/action-band.js";
|
|
3
|
-
export * from "./components/
|
|
4
|
-
export * from "./components/
|
|
3
|
+
export * from "./components/action-status.js";
|
|
4
|
+
export * from "./components/agent-avatar.js";
|
|
5
5
|
export * from "./components/agent-chat.js";
|
|
6
6
|
export * from "./components/agent-composer.js";
|
|
7
7
|
export * from "./components/agent-message.js";
|
|
8
8
|
export * from "./components/agent-thread.js";
|
|
9
9
|
export * from "./components/agent-tool-approval.js";
|
|
10
|
-
export * from "./components/
|
|
10
|
+
export * from "./components/alert.js";
|
|
11
|
+
export * from "./components/alert-dialog.js";
|
|
11
12
|
export * from "./components/artifact-panel.js";
|
|
12
|
-
export * from "./components/
|
|
13
|
+
export * from "./components/aspect-ratio.js";
|
|
14
|
+
export * from "./components/attachment.js";
|
|
13
15
|
export * from "./components/automation-section.js";
|
|
16
|
+
export * from "./components/avatar.js";
|
|
14
17
|
export * from "./components/badge.js";
|
|
15
18
|
export * from "./components/benefits-bento.js";
|
|
16
19
|
export * from "./components/bento.js";
|
|
17
20
|
export * from "./components/brand.js";
|
|
18
21
|
export * from "./components/breadcrumb.js";
|
|
22
|
+
export * from "./components/bubble.js";
|
|
19
23
|
export * from "./components/button.js";
|
|
20
24
|
export * from "./components/button-group.js";
|
|
21
25
|
export * from "./components/calendar.js";
|
|
@@ -37,24 +41,31 @@ export * from "./components/code-editor-mockup.js";
|
|
|
37
41
|
export * from "./components/collapsible.js";
|
|
38
42
|
export * from "./components/combobox.js";
|
|
39
43
|
export * from "./components/command.js";
|
|
44
|
+
export * from "./components/confirm-dialog.js";
|
|
40
45
|
export * from "./components/contact.js";
|
|
41
46
|
export * from "./components/context-menu.js";
|
|
47
|
+
export * from "./components/dashboard-shell.js";
|
|
42
48
|
export * from "./components/demo-surface.js";
|
|
49
|
+
export * from "./components/desktop-shell.js";
|
|
43
50
|
export * from "./components/dialog.js";
|
|
51
|
+
export * from "./components/diff-count.js";
|
|
44
52
|
export * from "./components/direction.js";
|
|
45
|
-
export * from "./components/
|
|
46
|
-
export * from "./components/desktop-shell.js";
|
|
53
|
+
export * from "./components/disclosure-row.js";
|
|
47
54
|
export * from "./components/drawer.js";
|
|
48
55
|
export * from "./components/dropdown-menu.js";
|
|
49
56
|
export * from "./components/empty.js";
|
|
57
|
+
export * from "./components/expandable-block.js";
|
|
50
58
|
export * from "./components/fact-cell.js";
|
|
51
59
|
export * from "./components/faq.js";
|
|
52
60
|
export * from "./components/faq-item.js";
|
|
53
61
|
export * from "./components/feedback-state.js";
|
|
54
62
|
export * from "./components/field.js";
|
|
63
|
+
export * from "./components/file-type-icon.js";
|
|
55
64
|
export * from "./components/files-preview.js";
|
|
56
65
|
export * from "./components/footer.js";
|
|
57
66
|
export * from "./components/form.js";
|
|
67
|
+
export * from "./components/glyph-spinner.js";
|
|
68
|
+
export * from "./components/handoff-banner.js";
|
|
58
69
|
export * from "./components/hero-split.js";
|
|
59
70
|
export * from "./components/hover-card.js";
|
|
60
71
|
export * from "./components/input.js";
|
|
@@ -67,8 +78,12 @@ export * from "./components/label.js";
|
|
|
67
78
|
export * from "./components/label-system.js";
|
|
68
79
|
export * from "./components/logo-band.js";
|
|
69
80
|
export * from "./components/logo-tile.js";
|
|
81
|
+
export * from "./components/marker.js";
|
|
70
82
|
export * from "./components/media-mount.js";
|
|
83
|
+
export * from "./components/memory-item.js";
|
|
71
84
|
export * from "./components/menubar.js";
|
|
85
|
+
export * from "./components/message.js";
|
|
86
|
+
export * from "./components/message-scroller.js";
|
|
72
87
|
export * from "./components/native-select.js";
|
|
73
88
|
export * from "./components/nav-bar.js";
|
|
74
89
|
export * from "./components/navigation-menu.js";
|
|
@@ -84,14 +99,15 @@ export * from "./components/proof-slot.js";
|
|
|
84
99
|
export * from "./components/quote-card.js";
|
|
85
100
|
export * from "./components/radio-group.js";
|
|
86
101
|
export * from "./components/resizable.js";
|
|
102
|
+
export * from "./components/run-timeline.js";
|
|
87
103
|
export * from "./components/scroll-area.js";
|
|
88
104
|
export * from "./components/seam-grid.js";
|
|
89
105
|
export * from "./components/section-intro.js";
|
|
90
106
|
export * from "./components/select.js";
|
|
91
107
|
export * from "./components/separator.js";
|
|
92
108
|
export * from "./components/settings-section.js";
|
|
93
|
-
export * from "./components/shift-band.js";
|
|
94
109
|
export * from "./components/sheet.js";
|
|
110
|
+
export * from "./components/shift-band.js";
|
|
95
111
|
export * from "./components/sidebar.js";
|
|
96
112
|
export * from "./components/skeleton.js";
|
|
97
113
|
export * from "./components/slider.js";
|
|
@@ -100,6 +116,8 @@ export * from "./components/spinner.js";
|
|
|
100
116
|
export * from "./components/stat-block.js";
|
|
101
117
|
export * from "./components/state-notice.js";
|
|
102
118
|
export * from "./components/stats-band.js";
|
|
119
|
+
export * from "./components/status-dot.js";
|
|
120
|
+
export * from "./components/status-row.js";
|
|
103
121
|
export * from "./components/switch.js";
|
|
104
122
|
export * from "./components/table.js";
|
|
105
123
|
export * from "./components/tabs.js";
|
|
@@ -108,6 +126,8 @@ export * from "./components/textarea.js";
|
|
|
108
126
|
export * from "./components/theme-mode-switcher.js";
|
|
109
127
|
export * from "./components/toggle.js";
|
|
110
128
|
export * from "./components/toggle-group.js";
|
|
129
|
+
export * from "./components/tool-icon.js";
|
|
111
130
|
export * from "./components/tooltip.js";
|
|
131
|
+
export * from "./components/usage-meter.js";
|
|
112
132
|
export * from "./components/use-case-bento.js";
|
|
113
133
|
export * from "./components/watch-it-work-band.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export type AgentApprovalChoice = "run" | "deny" | "session" | "always";
|
|
2
|
+
export type AgentApprovalAlias = "approve-once" | "reject" | "approve-session" | "approve-always";
|
|
3
|
+
export declare const agentApprovalAliases: {
|
|
4
|
+
readonly always: "approve-always";
|
|
5
|
+
readonly deny: "reject";
|
|
6
|
+
readonly run: "approve-once";
|
|
7
|
+
readonly session: "approve-session";
|
|
8
|
+
};
|
|
9
|
+
export interface AgentApprovalRequest {
|
|
10
|
+
/** False when the backend cannot honor a permanent approval. */
|
|
11
|
+
allowPermanent?: boolean;
|
|
12
|
+
command: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AgentClarifyRequest {
|
|
16
|
+
choices: string[] | null;
|
|
17
|
+
/** Whether the user may provide an answer outside the listed choices. */
|
|
18
|
+
otherAllowed: boolean;
|
|
19
|
+
question: string;
|
|
20
|
+
}
|
|
21
|
+
export type AgentTodoStatus = "pending" | "in_progress" | "completed" | "cancelled";
|
|
22
|
+
export interface AgentTodoItem {
|
|
23
|
+
content: string;
|
|
24
|
+
id: string;
|
|
25
|
+
status: AgentTodoStatus;
|
|
26
|
+
}
|
|
27
|
+
export interface AgentModelPricing {
|
|
28
|
+
/** Formatted cached-input price, or null when unavailable. */
|
|
29
|
+
cache: string | null;
|
|
30
|
+
free: boolean;
|
|
31
|
+
/** Formatted input price per million tokens. */
|
|
32
|
+
input: string;
|
|
33
|
+
/** Formatted output price per million tokens. */
|
|
34
|
+
output: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AgentModelOptionProvider {
|
|
37
|
+
authenticated?: boolean;
|
|
38
|
+
auth_type?: string;
|
|
39
|
+
free_tier?: boolean;
|
|
40
|
+
is_current?: boolean;
|
|
41
|
+
is_user_defined?: boolean;
|
|
42
|
+
key_env?: string;
|
|
43
|
+
models?: string[];
|
|
44
|
+
name: string;
|
|
45
|
+
pricing?: Record<string, AgentModelPricing>;
|
|
46
|
+
slug: string;
|
|
47
|
+
total_models?: number;
|
|
48
|
+
/** Model ids locked for the current free-tier account. */
|
|
49
|
+
unavailable_models?: string[];
|
|
50
|
+
warning?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentModelOptions {
|
|
53
|
+
model?: string;
|
|
54
|
+
provider?: string;
|
|
55
|
+
providers?: AgentModelOptionProvider[];
|
|
56
|
+
}
|
|
57
|
+
export interface AgentSessionListItem {
|
|
58
|
+
active: boolean;
|
|
59
|
+
id: string;
|
|
60
|
+
preview: string | null;
|
|
61
|
+
title: string | null;
|
|
62
|
+
}
|
|
63
|
+
export type AgentSubagentStatus = "completed" | "error" | "failed" | "interrupted" | "queued" | "running" | "timeout";
|
|
64
|
+
export interface AgentSubagentOutputEntry {
|
|
65
|
+
isError: boolean;
|
|
66
|
+
preview: string;
|
|
67
|
+
tool: string;
|
|
68
|
+
}
|
|
69
|
+
export interface AgentSubagentProgress {
|
|
70
|
+
apiCalls?: number;
|
|
71
|
+
costUsd?: number;
|
|
72
|
+
depth: number;
|
|
73
|
+
durationSeconds?: number;
|
|
74
|
+
filesRead?: string[];
|
|
75
|
+
filesWritten?: string[];
|
|
76
|
+
goal: string;
|
|
77
|
+
id: string;
|
|
78
|
+
index: number;
|
|
79
|
+
inputTokens?: number;
|
|
80
|
+
iteration?: number;
|
|
81
|
+
model?: string;
|
|
82
|
+
notes: string[];
|
|
83
|
+
outputTail?: AgentSubagentOutputEntry[];
|
|
84
|
+
outputTokens?: number;
|
|
85
|
+
parentId: null | string;
|
|
86
|
+
reasoningTokens?: number;
|
|
87
|
+
startedAt?: number;
|
|
88
|
+
status: AgentSubagentStatus;
|
|
89
|
+
summary?: string;
|
|
90
|
+
taskCount: number;
|
|
91
|
+
thinking: string[];
|
|
92
|
+
toolCount: number;
|
|
93
|
+
tools: string[];
|
|
94
|
+
toolsets?: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface AgentSubagentAggregate {
|
|
97
|
+
activeCount: number;
|
|
98
|
+
costUsd: number;
|
|
99
|
+
descendantCount: number;
|
|
100
|
+
filesTouched: number;
|
|
101
|
+
hotness: number;
|
|
102
|
+
inputTokens: number;
|
|
103
|
+
maxDepthFromHere: number;
|
|
104
|
+
outputTokens: number;
|
|
105
|
+
totalDuration: number;
|
|
106
|
+
totalTools: number;
|
|
107
|
+
}
|
|
108
|
+
export interface AgentSubagentNode {
|
|
109
|
+
aggregate: AgentSubagentAggregate;
|
|
110
|
+
children: AgentSubagentNode[];
|
|
111
|
+
item: AgentSubagentProgress;
|
|
112
|
+
}
|
|
113
|
+
export type AgentDiffLineKind = "add" | "remove" | "context";
|
|
114
|
+
export interface AgentDiffLine {
|
|
115
|
+
kind: AgentDiffLineKind;
|
|
116
|
+
newNo?: number;
|
|
117
|
+
oldNo?: number;
|
|
118
|
+
text: string;
|
|
119
|
+
}
|
|
120
|
+
export interface AgentDiffFile {
|
|
121
|
+
lines: AgentDiffLine[];
|
|
122
|
+
path: string;
|
|
123
|
+
}
|
|
124
|
+
export type AgentQueuedMessage = string;
|
|
125
|
+
export type AgentQueue = AgentQueuedMessage[];
|
|
126
|
+
export interface AgentUsage {
|
|
127
|
+
cap: number;
|
|
128
|
+
currency: string;
|
|
129
|
+
period: string;
|
|
130
|
+
spent: number;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=agent-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-contracts.d.ts","sourceRoot":"","sources":["../../src/lib/agent-contracts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,QAAQ,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAElG,eAAO,MAAM,oBAAoB;;;;;CAK6C,CAAC;AAE/E,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAA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