@heroui/agent 1.0.0-beta.3 → 1.0.0-beta.5
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/CHANGELOG.md +19 -0
- package/README.md +119 -68
- package/dist/chunk-6O4WPQKO.js +1 -0
- package/dist/chunk-7OTMWVOC.js +1 -0
- package/dist/chunk-KGJ6UDTY.js +1 -0
- package/dist/chunk-PKCBDTYR.js +1 -0
- package/dist/chunk-PX3X4VP2.js +1 -0
- package/dist/chunk-SWO2ABN5.js +1 -0
- package/dist/client-tools-manifest-62CRLCZY.js +1 -0
- package/dist/css/index.css +1 -2
- package/dist/index.d.ts +9 -712
- package/dist/index.js +1 -1
- package/dist/internal/host.d.ts +108 -0
- package/dist/internal/host.js +1 -0
- package/dist/internal/shared.d.ts +63 -0
- package/dist/internal/shared.js +1 -0
- package/dist/next.d.ts +3 -4
- package/dist/next.js +1 -1
- package/dist/persistence-YI6JSYCT.js +1 -0
- package/dist/server.d.ts +21 -2
- package/dist/server.js +1 -1
- package/dist/types-BdAn3HPv.d.ts +667 -0
- package/dist/version-CIfRqjWe.d.ts +5 -0
- package/package.json +18 -34
- package/dist/chart-content-YGW25P3Z.js +0 -1
- package/dist/chunk-4JEZZR5J.js +0 -1
- package/dist/chunk-6RWQT7JH.js +0 -2
- package/dist/chunk-6ZJJN322.js +0 -1
- package/dist/chunk-7CUSOLDM.js +0 -5
- package/dist/chunk-7KCGPNEN.js +0 -1
- package/dist/chunk-CLHBM3HQ.js +0 -1
- package/dist/chunk-CR3H7AVI.js +0 -1
- package/dist/chunk-E43KPTLS.js +0 -2
- package/dist/chunk-HCLXS4HQ.js +0 -1
- package/dist/chunk-JTZX5KVY.js +0 -1
- package/dist/chunk-KQTLIOZ3.js +0 -1
- package/dist/chunk-M22IGTLZ.js +0 -1
- package/dist/chunk-MXXCR5SR.js +0 -1
- package/dist/chunk-PZJ4NC3J.js +0 -1
- package/dist/chunk-RNNGE7KM.js +0 -1
- package/dist/chunk-T4VDCNDW.js +0 -1
- package/dist/chunk-UHHKMESI.js +0 -1
- package/dist/component-renderer-KWBZJPBV.js +0 -1
- package/dist/composer-draft-NSKK65F3.js +0 -1
- package/dist/composer-image-draft-KAGTNQR7.js +0 -1
- package/dist/contracts.d.ts +0 -1683
- package/dist/contracts.js +0 -2
- package/dist/embed-runtime-YK64GOPA.js +0 -5
- package/dist/identity-CAJPsGqJ.d.ts +0 -101
- package/dist/interactive-map-surface-WC2LPCR7.js +0 -1
- package/dist/internal/client-tools.js +0 -1
- package/dist/internal/models.js +0 -1
- package/dist/internal/runtime.js +0 -1
- package/dist/internal/theme.js +0 -1
- package/dist/model-picker-QTI5TDBG.js +0 -1
- package/dist/shell-permission-picker-KIC3VEYJ.js +0 -1
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const agentThemeSchema: z.ZodEnum<{
|
|
4
|
-
dark: "dark";
|
|
5
|
-
light: "light";
|
|
6
|
-
system: "system";
|
|
7
|
-
}>;
|
|
8
|
-
declare const agentSurfaceVariantSchema: z.ZodEnum<{
|
|
9
|
-
outline: "outline";
|
|
10
|
-
plain: "plain";
|
|
11
|
-
surface: "surface";
|
|
12
|
-
"surface-secondary": "surface-secondary";
|
|
13
|
-
}>;
|
|
14
|
-
declare const agentIdentityIdSchema: z.ZodString;
|
|
15
|
-
declare const agentAuthIdentitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
type: z.ZodLiteral<"anonymous">;
|
|
18
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
-
id: z.ZodString;
|
|
20
|
-
type: z.ZodLiteral<"user">;
|
|
21
|
-
}, z.core.$strip>], "type">;
|
|
22
|
-
declare const agentAuthProfileSchema: z.ZodObject<{
|
|
23
|
-
avatarUrl: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodURL>>;
|
|
24
|
-
email: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodEmail>>;
|
|
25
|
-
name: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
/** Server-to-server request for a short-lived browser credential. */
|
|
28
|
-
declare const createAgentAuthTokenRequestSchema: z.ZodObject<{
|
|
29
|
-
anonymousId: z.ZodOptional<z.ZodString>;
|
|
30
|
-
identity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
-
id: z.ZodString;
|
|
32
|
-
type: z.ZodLiteral<"anonymous">;
|
|
33
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
type: z.ZodLiteral<"user">;
|
|
36
|
-
}, z.core.$strip>], "type">;
|
|
37
|
-
profile: z.ZodOptional<z.ZodObject<{
|
|
38
|
-
avatarUrl: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodURL>>;
|
|
39
|
-
email: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodEmail>>;
|
|
40
|
-
name: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strip>>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
declare const agentAuthTokenSchema: z.ZodObject<{
|
|
44
|
-
expiresAt: z.ZodNumber;
|
|
45
|
-
token: z.ZodString;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
declare const agentTokenClaimsSchema: z.ZodObject<{
|
|
48
|
-
agentId: z.ZodString;
|
|
49
|
-
apiKeyId: z.ZodString;
|
|
50
|
-
aud: z.ZodLiteral<"heroui-agent">;
|
|
51
|
-
exp: z.ZodNumber;
|
|
52
|
-
iat: z.ZodNumber;
|
|
53
|
-
iss: z.ZodLiteral<"https://api.heroui.com">;
|
|
54
|
-
jti: z.ZodUUID;
|
|
55
|
-
protocolVersion: z.ZodLiteral<6>;
|
|
56
|
-
sub: z.ZodString;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
/**
|
|
59
|
-
* How a persisted conversation was started. Rows written before this existed
|
|
60
|
-
* carry no source and are treated as `embed`.
|
|
61
|
-
*/
|
|
62
|
-
declare const AGENT_CONVERSATION_SOURCE: {
|
|
63
|
-
readonly embed: "embed";
|
|
64
|
-
readonly preview: "preview";
|
|
65
|
-
};
|
|
66
|
-
type AgentConversationSource = (typeof AGENT_CONVERSATION_SOURCE)[keyof typeof AGENT_CONVERSATION_SOURCE];
|
|
67
|
-
declare const agentProjectConfigSchema: z.ZodObject<{
|
|
68
|
-
agentId: z.ZodString;
|
|
69
|
-
componentSurfaceVariant: z.ZodDefault<z.ZodEnum<{
|
|
70
|
-
outline: "outline";
|
|
71
|
-
plain: "plain";
|
|
72
|
-
surface: "surface";
|
|
73
|
-
"surface-secondary": "surface-secondary";
|
|
74
|
-
}>>;
|
|
75
|
-
minimumProtocolVersion: z.ZodLiteral<6>;
|
|
76
|
-
name: z.ZodString;
|
|
77
|
-
protocolVersion: z.ZodLiteral<6>;
|
|
78
|
-
sdkVersion: z.ZodDefault<z.ZodString>;
|
|
79
|
-
suggestedPrompts: z.ZodArray<z.ZodString>;
|
|
80
|
-
surfaceVariant: z.ZodDefault<z.ZodEnum<{
|
|
81
|
-
outline: "outline";
|
|
82
|
-
plain: "plain";
|
|
83
|
-
surface: "surface";
|
|
84
|
-
"surface-secondary": "surface-secondary";
|
|
85
|
-
}>>;
|
|
86
|
-
theme: z.ZodEnum<{
|
|
87
|
-
dark: "dark";
|
|
88
|
-
light: "light";
|
|
89
|
-
system: "system";
|
|
90
|
-
}>;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
type AgentAuthIdentity = z.infer<typeof agentAuthIdentitySchema>;
|
|
93
|
-
type AgentAuthProfile = z.infer<typeof agentAuthProfileSchema>;
|
|
94
|
-
type AgentAuthToken = z.infer<typeof agentAuthTokenSchema>;
|
|
95
|
-
type CreateAgentAuthTokenRequest = z.infer<typeof createAgentAuthTokenRequestSchema>;
|
|
96
|
-
type AgentTokenClaims = z.infer<typeof agentTokenClaimsSchema>;
|
|
97
|
-
type AgentTheme = z.infer<typeof agentThemeSchema>;
|
|
98
|
-
type AgentSurfaceVariant = z.infer<typeof agentSurfaceVariantSchema>;
|
|
99
|
-
type AgentProjectConfig = z.infer<typeof agentProjectConfigSchema>;
|
|
100
|
-
|
|
101
|
-
export { AGENT_CONVERSATION_SOURCE as A, type CreateAgentAuthTokenRequest as C, type AgentAuthIdentity as a, type AgentAuthProfile as b, type AgentAuthToken as c, type AgentConversationSource as d, type AgentProjectConfig as e, type AgentSurfaceVariant as f, type AgentTheme as g, type AgentTokenClaims as h, agentAuthIdentitySchema as i, agentAuthProfileSchema as j, agentAuthTokenSchema as k, agentIdentityIdSchema as l, agentProjectConfigSchema as m, agentSurfaceVariantSchema as n, agentThemeSchema as o, agentTokenClaimsSchema as p, createAgentAuthTokenRequestSchema as q };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as V,b as x}from"./chunk-HCLXS4HQ.js";import{a as G}from"./chunk-CR3H7AVI.js";import{StarFill as ee}from"@gravity-ui/icons";import Z from"maplibre-gl";import{createContext as D,useCallback as H,useContext as $,useEffect as h,useRef as g,useState as k}from"react";import{createPortal as A}from"react-dom";import{jsx as n,jsxs as y}from"react/jsx-runtime";var _=D(null);function O(){if(!(typeof document>"u")){if(document.documentElement.classList.contains("dark")||document.documentElement.dataset.theme==="dark")return"dark";if(document.documentElement.classList.contains("light")||document.documentElement.dataset.theme==="light")return"light"}}function j(e){let a=e?.closest("[data-theme]")?.dataset.theme;return a==="dark"||a==="light"?a:void 0}function B(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Q(e){let[r,a]=k(()=>O()??B());return h(()=>{let s=e.current?.closest("[data-theme]"),c=()=>a(j(e.current)??O()??B()),t=new MutationObserver(c),m=window.matchMedia("(prefers-color-scheme: dark)");return c(),t.observe(document.documentElement,{attributeFilter:["class","data-theme"],attributes:!0}),s&&s!==document.documentElement&&t.observe(s,{attributeFilter:["data-theme"],attributes:!0}),m.addEventListener("change",c),()=>{t.disconnect(),m.removeEventListener("change",c)}},[e]),r}function X({center:e,children:r,className:a,padding:s,styles:c,zoom:t,...m}){let[o,u]=e,p=g(null),W=g({...m,center:[o,u],zoom:t}),[i,R]=k(null),[L,M]=k("loading"),z=Q(p),b=c[z],w=g(b),I=g(s),P=g(t);return h(()=>{let d=p.current;if(!d)return;let l=new Z.Map({attributionControl:!1,container:d,renderWorldCopies:!1,style:w.current,...W.current}),f=window.setTimeout(()=>M("error"),12e3),E=()=>{window.clearTimeout(f),M("loaded")},N=new ResizeObserver(()=>l.resize());return l.touchZoomRotate.disableRotation(),I.current&&l.setPadding(I.current),l.on("load",E),N.observe(d),R(l),()=>{window.clearTimeout(f),N.disconnect(),l.off("load",E),l.remove(),R(null)}},[]),h(()=>{if(!i||w.current===b)return;let d=window.setTimeout(()=>M("error"),12e3),l=()=>{window.clearTimeout(d),M("loaded")},f=()=>M("loading");return w.current=b,i.once("styledataloading",f),i.setStyle(b,{diff:!1}),i.once("style.load",l),()=>{window.clearTimeout(d),i.off("style.load",l),i.off("styledataloading",f)}},[b,i]),h(()=>{if(!i)return;let d=i.getCenter(),l=d.lng!==o||d.lat!==u,f=P.current!==t;P.current=t,!(!l&&!f)&&i.easeTo({center:[o,u],duration:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:350,...f?{zoom:t}:{}})},[u,o,i,t]),n(_,{value:i,children:y("div",{ref:p,className:G("aui-interactive-map",a),"data-load-state":L,"data-slot":"agent-ui-interactive-map",children:[L==="loading"?n("div",{"aria-label":"Loading map",className:"aui-interactive-map__loader",role:"status",children:n("span",{})}):null,L==="error"?y("div",{className:"aui-interactive-map__error",role:"status",children:[n("strong",{children:"Map unavailable"}),n("span",{children:"Location results remain available."})]}):null,i?r:null]})})}function q({children:e,latitude:r,longitude:a}){let s=$(_),c=g({latitude:r,longitude:a}),[t,m]=k(null);return h(()=>{let o=document.createElement("div"),u=c.current,p=new Z.Marker({element:o}).setLngLat([u.longitude,u.latitude]);return o.className="aui-interactive-map__marker-host",m(p),()=>{p.remove()}},[]),h(()=>{if(!s||!t)return;t.addTo(s);let o=t.getElement();return o.removeAttribute("aria-label"),o.removeAttribute("role"),o.removeAttribute("tabindex"),()=>{t.remove()}},[s,t]),h(()=>{t?.setLngLat([a,r])},[r,a,t]),t?A(n("div",{className:"aui-interactive-map__marker-content",children:e}),t.getElement()):null}function T({children:e,label:r,...a}){return n("button",{"aria-label":r,className:"aui-interactive-map__control-button",type:"button",...a,children:e})}function J(e){return n("svg",{"aria-hidden":"true",fill:"none",viewBox:"0 0 16 16",...e,children:n("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})})}function K(e){return n("svg",{"aria-hidden":"true",fill:"none",viewBox:"0 0 16 16",...e,children:n("path",{d:"M3 8h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})})}function U(e){return y("svg",{"aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",...e,children:[n("path",{d:"M12 2 16 12h-4V2Z","data-needle":"north-right"}),n("path",{d:"m12 2-4 10h4V2Z","data-needle":"north-left"}),n("path",{d:"m12 22 4-10h-4v10Z","data-needle":"south-right"}),n("path",{d:"m12 22-4-10h4v10Z","data-needle":"south-left"})]})}function Y(){let e=$(_),r=g(null),a=H(()=>{!e||!r.current||(r.current.style.transform=`rotateX(${e.getPitch()}deg) rotateZ(${-e.getBearing()}deg)`)},[e]);return h(()=>{if(e)return e.on("pitch",a),e.on("rotate",a),a(),()=>{e.off("pitch",a),e.off("rotate",a)}},[e,a]),y("div",{className:"aui-interactive-map__controls","data-slot":"agent-ui-map-controls",children:[y("div",{className:"aui-interactive-map__control-group",children:[n(T,{label:"Zoom in",onClick:()=>e?.zoomTo(e.getZoom()+1,{duration:250}),children:n(J,{})}),n(T,{label:"Zoom out",onClick:()=>e?.zoomTo(e.getZoom()-1,{duration:250}),children:n(K,{})})]}),n("div",{className:"aui-interactive-map__control-group",children:n(T,{label:"Reset bearing to north",onClick:()=>e?.resetNorthPitch({duration:250}),children:n(U,{ref:r,className:"aui-interactive-map__compass"})})})]})}var C=Object.assign(X,{Controls:Y,Marker:q});import{jsx as v,jsxs as S}from"react/jsx-runtime";var te={dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",light:"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"},ae={bottom:132,left:0,right:0,top:0},F=new Intl.NumberFormat(void 0,{maximumFractionDigits:1,minimumFractionDigits:1});function me({component:e,onSelect:r,selectedLocationId:a}){let s=x(e),c=V(e.locations,a,s.center);return S("div",{"aria-label":`${e.title} map with ${e.locations.length} locations`,className:"aui-map__surface","data-renderer":"interactive","data-slot":"agent-ui-map-surface",role:"region",children:[S(C,{center:[c.longitude,c.latitude],className:"aui-map__interactive-map",dragRotate:!1,padding:ae,pitchWithRotate:!1,styles:te,zoom:s.zoom,children:[e.locations.map((t,m)=>{let o=t.id===a,u=t.rating!==void 0?F.format(t.rating):t.relevance!==void 0?`${Math.round(t.relevance*100)}%`:String(m+1),p=`Select ${t.title} on map${t.rating===void 0?"":`, rated ${F.format(t.rating)} out of 5`}`;return v(C.Marker,{latitude:t.latitude,longitude:t.longitude,children:S("button",{"aria-label":p,"aria-pressed":o,className:"aui-map__marker","data-renderer":"interactive","data-selected":o,"data-slot":"agent-ui-map-marker",title:t.title,type:"button",onClick:()=>r(t),children:[v(ee,{"aria-hidden":"true"}),v("span",{children:u})]})},t.id)}),v(C.Controls,{})]}),S("span",{className:"aui-map__attribution","data-slot":"agent-ui-map-attribution",children:[v("a",{href:"https://www.openstreetmap.org/copyright",rel:"noreferrer",target:"_blank",children:"\xA9 OpenStreetMap"}),v("span",{"aria-hidden":"true",children:" \xB7 "}),v("a",{href:"https://carto.com/attributions",rel:"noreferrer",target:"_blank",children:"\xA9 CARTO"})]})]})}export{me as InteractiveMapSurface};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-T4VDCNDW.js";export{a as createToolHelper,b as isZodSchema,c as parseClientToolArgs,d as resolveDirectToolAction};
|
package/dist/internal/models.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../chunk-UHHKMESI.js";export{a as AGENT_MODEL_IDS,e as AGENT_MODEL_OPTIONS,d as DEFAULT_AGENT_PICKER_MODEL_ID,b as LEGACY_AGENT_MODEL_IDS,g as getAgentModelTier,f as isAgentModelId,c as resolveAgentModelId};
|
package/dist/internal/runtime.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-7KCGPNEN.js";export{a as HEROUI_AGENT_RUNTIME_TIMING_EVENT,d as HEROUI_AGENT_TURN_ADMISSION_STATUS_MAX_IDS,c as HEROUI_AGENT_TURN_ADMISSION_STATUS_METHOD,b as HEROUI_AGENT_TURN_ADMITTED_FRAME_TYPE};
|
package/dist/internal/theme.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-4JEZZR5J.js";export{c as ACCENT_FOREGROUND_CSS,a as AGENT_DESIGN_THEMES,d as LAUNCHER_FOREGROUND_CSS,e as buildLauncherStyle,f as buildThemeStyle,b as resolveAgentDesignTheme};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-JTZX5KVY.js";import"./chunk-MXXCR5SR.js";import"./chunk-CR3H7AVI.js";export{a as ModelPicker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as i,b as o}from"./chunk-M22IGTLZ.js";import"./chunk-MXXCR5SR.js";import"./chunk-CR3H7AVI.js";import{useState as p}from"react";import{jsx as a}from"react/jsx-runtime";function g({agentId:s,defaultMode:n,defaultOpen:r,onIntent:t}){let[m,l]=p();return a(i,{"aria-label":"Tool permissions",className:"ha-permission-picker",defaultOpen:r,value:m??n,onChange:e=>{l(e),o(s,e),t()}})}export{g as ShellPermissionPicker};
|