experimental-ash 0.62.0 → 0.64.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 (85) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/docs/public/advanced/auth-and-route-protection.mdx +26 -20
  3. package/dist/docs/public/advanced/hooks.mdx +8 -2
  4. package/dist/docs/public/advanced/runs-and-streaming.md +6 -3
  5. package/dist/docs/public/advanced/typescript-api.md +32 -0
  6. package/dist/docs/public/channels/ash.mdx +5 -1
  7. package/dist/docs/public/channels/custom.mdx +23 -0
  8. package/dist/docs/public/frontend/README.md +8 -4
  9. package/dist/docs/public/frontend/meta.json +9 -1
  10. package/dist/docs/public/frontend/nextjs.md +4 -4
  11. package/dist/docs/public/frontend/nuxt.md +168 -0
  12. package/dist/docs/public/frontend/sveltekit.md +177 -0
  13. package/dist/docs/public/frontend/use-ash-agent-svelte.md +185 -0
  14. package/dist/docs/public/frontend/use-ash-agent-vue.md +236 -0
  15. package/dist/docs/public/frontend/use-ash-agent.md +14 -14
  16. package/dist/docs/public/getting-started.mdx +2 -0
  17. package/dist/src/channel/websocket-upgrade-server.d.ts +26 -0
  18. package/dist/src/channel/websocket-upgrade-server.js +1 -0
  19. package/dist/src/chunks/use-ash-agent-DzoSHUCb.js +1197 -0
  20. package/dist/src/chunks/use-ash-agent-KtjpWd5l.js +1229 -0
  21. package/dist/src/client/ash-agent-store.d.ts +61 -0
  22. package/dist/src/client/ash-agent-store.js +2 -0
  23. package/dist/src/client/client-error.js +1 -1
  24. package/dist/src/client/index.d.ts +2 -0
  25. package/dist/src/client/index.js +1 -1
  26. package/dist/src/compiled/.vendor-stamp.json +3 -3
  27. package/dist/src/compiled/@chat-adapter/slack/index.js +25 -25
  28. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +8 -0
  29. package/dist/src/compiled/@workflow/core/index.js +2 -2
  30. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -0
  31. package/dist/src/compiled/@workflow/core/runtime.js +29 -29
  32. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  33. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  34. package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
  35. package/dist/src/compiled/@workflow/errors/index.d.ts +14 -0
  36. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  37. package/dist/src/compiled/@workflow/world/queue.d.ts +8 -0
  38. package/dist/src/compiled/_chunks/workflow/dist-zpK2YVVA.js +3 -0
  39. package/dist/src/compiled/_chunks/workflow/resume-hook-BFK9mgsb.js +12 -0
  40. package/dist/src/compiled/_chunks/workflow/{sleep-Bg0t23kF.js → sleep-CeJckNg2.js} +1 -1
  41. package/dist/src/compiled/_chunks/workflow/{symbols-u476uwyR.js → symbols-BWCAoPHE.js} +1 -1
  42. package/dist/src/internal/application/package.d.ts +1 -0
  43. package/dist/src/internal/application/package.js +1 -1
  44. package/dist/src/internal/nitro/host/build-application.js +1 -1
  45. package/dist/src/internal/nitro/host/channel-routes.js +2 -2
  46. package/dist/src/internal/workflow-bundle/ash-service-route-output.js +11 -1
  47. package/dist/src/packages/ash-scaffold/src/channels.js +1 -1
  48. package/dist/src/packages/ash-scaffold/src/web-template.js +5 -16
  49. package/dist/src/public/channels/auth.d.ts +45 -3
  50. package/dist/src/public/channels/auth.js +1 -1
  51. package/dist/src/public/channels/index.d.ts +1 -0
  52. package/dist/src/public/channels/index.js +1 -1
  53. package/dist/src/public/channels/slack/inbound.d.ts +3 -1
  54. package/dist/src/public/channels/slack/inbound.js +1 -1
  55. package/dist/src/public/nuxt/dev-server.d.ts +24 -0
  56. package/dist/src/public/nuxt/dev-server.js +1 -0
  57. package/dist/src/public/nuxt/index.d.ts +1 -0
  58. package/dist/src/public/nuxt/index.js +1 -0
  59. package/dist/src/public/nuxt/module.d.ts +31 -0
  60. package/dist/src/public/nuxt/module.js +1 -0
  61. package/dist/src/public/nuxt/routing.d.ts +55 -0
  62. package/dist/src/public/nuxt/routing.js +1 -0
  63. package/dist/src/public/nuxt/vercel-json.d.ts +17 -0
  64. package/dist/src/public/nuxt/vercel-json.js +1 -0
  65. package/dist/src/public/sveltekit/dev-server.d.ts +24 -0
  66. package/dist/src/public/sveltekit/dev-server.js +1 -0
  67. package/dist/src/public/sveltekit/index.d.ts +39 -0
  68. package/dist/src/public/sveltekit/index.js +1 -0
  69. package/dist/src/public/sveltekit/routing.d.ts +32 -0
  70. package/dist/src/public/sveltekit/routing.js +1 -0
  71. package/dist/src/public/sveltekit/vercel-json.d.ts +17 -0
  72. package/dist/src/public/sveltekit/vercel-json.js +1 -0
  73. package/dist/src/react/use-ash-agent.d.ts +5 -27
  74. package/dist/src/react/use-ash-agent.js +1 -2
  75. package/dist/src/svelte/index.d.ts +3 -0
  76. package/dist/src/svelte/index.js +3 -0
  77. package/dist/src/svelte/use-ash-agent.d.ts +80 -0
  78. package/dist/src/svelte/use-ash-agent.js +3 -0
  79. package/dist/src/vue/index.d.ts +3 -0
  80. package/dist/src/vue/index.js +3 -0
  81. package/dist/src/vue/use-ash-agent.d.ts +78 -0
  82. package/dist/src/vue/use-ash-agent.js +3 -0
  83. package/package.json +51 -6
  84. package/dist/src/compiled/_chunks/workflow/dist-C4EHshZE.js +0 -3
  85. package/dist/src/compiled/_chunks/workflow/resume-hook-BlALLgSA.js +0 -12
@@ -0,0 +1,17 @@
1
+ export interface EnsureVercelJsonResult {
2
+ readonly servicePrefix: string;
3
+ }
4
+ /**
5
+ * Ensure `vercel.json` declares the SvelteKit web service and the Ash agent
6
+ * service so a Vercel deployment ships both from one project.
7
+ *
8
+ * Existing services are preserved untouched; an already-configured Ash
9
+ * service's `routePrefix` wins over {@link input.servicePrefix}. The file is
10
+ * only rewritten when the resulting config differs from what is on disk.
11
+ */
12
+ export declare function ensureAshVercelJson(input: {
13
+ readonly appRoot: string;
14
+ readonly ashBuildCommand: string;
15
+ readonly servicePrefix: string;
16
+ readonly svelteKitRoot: string;
17
+ }): Promise<EnsureVercelJsonResult>;
@@ -0,0 +1 @@
1
+ import{createAshVercelRewrite}from"./routing.js";import{join,relative}from"node:path";import{readFile,writeFile}from"node:fs/promises";const VERCEL_JSON_FILE_NAME=`vercel.json`;function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveRelativeEntrypoint(e,t){let r=relative(e,t);return r.length===0?`.`:r.replaceAll(`\\`,`/`)}function normalizeVercelJsonConfig(e){if(!isRecord(e))throw Error(`${VERCEL_JSON_FILE_NAME} must contain a JSON object.`);let t=e.experimentalServices;if(t!==void 0&&!isRecord(t))throw Error(`${VERCEL_JSON_FILE_NAME} experimentalServices must be a JSON object.`);let n=e.rewrites;if(n!==void 0&&!Array.isArray(n))throw Error(`${VERCEL_JSON_FILE_NAME} rewrites must be an array.`);return e}async function readVercelJsonConfig(e){try{return normalizeVercelJsonConfig(JSON.parse(await readFile(e,`utf8`)))}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return{};throw e}}function findServiceByFramework(e,t){return Object.values(e).find(e=>e.framework===t)}function hasRewrite(e,t){return e.some(e=>e.source===t.source&&e.destination===t.destination)}async function ensureAshVercelJson(n){let r=join(n.svelteKitRoot,VERCEL_JSON_FILE_NAME),i=await readVercelJsonConfig(r),a=resolveRelativeEntrypoint(n.svelteKitRoot,n.appRoot),o=i.experimentalServices??{},s=findServiceByFramework(o,`ash`),c=findServiceByFramework(o,`sveltekit`),l=s?.routePrefix??n.servicePrefix,u={...o};c===void 0&&(u.web={entrypoint:`.`,framework:`sveltekit`,routePrefix:`/`}),s===void 0&&(u.ash={buildCommand:n.ashBuildCommand,entrypoint:a,framework:`ash`,routePrefix:l});let d=createAshVercelRewrite(l),f=i.rewrites??[],p={...i,$schema:i.$schema??`https://openapi.vercel.sh/vercel.json`,experimentalServices:u,rewrites:hasRewrite(f,d)?f:[d,...f]};return JSON.stringify(i)!==JSON.stringify(p)&&await writeFile(r,`${JSON.stringify(p,null,2)}\n`),{servicePrefix:l}}export{ensureAshVercelJson};
@@ -1,36 +1,15 @@
1
+ import { type AshAgentStoreCallbacks, type AshAgentStoreSnapshot, type AshAgentStoreStatus, type PrepareSend } from "#client/ash-agent-store.js";
1
2
  import type { AshAgentReducer } from "#client/reducer.js";
2
3
  import type { ClientSession } from "#client/session.js";
3
4
  import { type AshMessageData } from "#client/message-reducer.js";
4
5
  import type { HandleMessageStreamEvent } from "#protocol/message.js";
5
6
  import type { ClientAuth, HeadersValue, SendMessageOptions, SendTurnInput, SessionState } from "#client/types.js";
6
- export type UseAshAgentStatus = "error" | "ready" | "streaming" | "submitted";
7
- /**
8
- * Prepares one outbound turn immediately before the client sends it.
9
- *
10
- * Use this to attach fresh, one-turn client state such as page context via
11
- * `clientContext`.
12
- */
13
- export type PrepareSend = (input: SendTurnInput) => SendTurnInput | Promise<SendTurnInput>;
7
+ export type { PrepareSend };
8
+ export type UseAshAgentStatus = AshAgentStoreStatus;
14
9
  /**
15
10
  * Current projected state for an Ash agent session.
16
11
  */
17
- export interface UseAshAgentSnapshot<TData> {
18
- readonly data: TData;
19
- readonly error: Error | undefined;
20
- readonly events: readonly HandleMessageStreamEvent[];
21
- readonly session: SessionState;
22
- readonly status: UseAshAgentStatus;
23
- }
24
- /**
25
- * Lifecycle callbacks invoked while `useAshAgent` processes a turn.
26
- */
27
- interface UseAshAgentCallbacks<TData> {
28
- readonly onError?: (error: Error) => void;
29
- readonly onEvent?: (event: HandleMessageStreamEvent) => void;
30
- readonly onFinish?: (snapshot: UseAshAgentSnapshot<TData>) => void;
31
- readonly onSessionChange?: (session: SessionState) => void;
32
- readonly prepareSend?: PrepareSend;
33
- }
12
+ export type UseAshAgentSnapshot<TData> = AshAgentStoreSnapshot<TData>;
34
13
  /**
35
14
  * Snapshot plus commands returned by `useAshAgent`.
36
15
  */
@@ -52,7 +31,7 @@ export interface UseAshAgentHelpers<TData> extends UseAshAgentSnapshot<TData> {
52
31
  * values to `auth` or `headers`; the underlying client resolves those before
53
32
  * each HTTP request.
54
33
  */
55
- export interface UseAshAgentOptions<TData> extends UseAshAgentCallbacks<TData> {
34
+ export interface UseAshAgentOptions<TData> extends AshAgentStoreCallbacks<TData> {
56
35
  readonly auth?: ClientAuth;
57
36
  readonly headers?: HeadersValue;
58
37
  /**
@@ -85,4 +64,3 @@ export declare function useAshAgent(options?: UseAshAgentOptions<AshMessageData>
85
64
  export declare function useAshAgent<TData>(options: UseAshAgentOptions<TData> & {
86
65
  readonly reducer: AshAgentReducer<TData>;
87
66
  }): UseAshAgentHelpers<TData>;
88
- export {};
@@ -1,2 +1 @@
1
- import{toError}from"#shared/errors.js";import{Client}from"#client/client.js";import{defaultMessageReducer}from"#client/message-reducer.js";import{useCallback,useMemo,useRef,useSyncExternalStore}from"react";function useAshAgent(e={}){let t=useRef(void 0);if(!t.current){let r=e.reducer??defaultMessageReducer();t.current=new UseAshAgentStore({auth:e.auth,headers:e.headers,host:e.host,initialEvents:e.initialEvents,initialSession:e.initialSession,maxReconnectAttempts:e.maxReconnectAttempts,optimistic:e.optimistic,reducer:r,session:e.session})}let s=t.current;s.setCallbacks({onError:e.onError,onEvent:e.onEvent,onFinish:e.onFinish,onSessionChange:e.onSessionChange,prepareSend:e.prepareSend});let c=useSyncExternalStore(useCallback(e=>s.subscribe(e),[s]),()=>s.snapshot,()=>s.snapshot),l=useCallback(()=>s.reset(),[s]),u=useCallback((e,t)=>s.send(e,t),[s]),d=useCallback((e,t)=>s.sendMessage(e,t),[s]),f=useCallback(()=>s.stop(),[s]);return useMemo(()=>({...c,reset:l,send:u,sendMessage:d,stop:f}),[l,u,d,c,f])}var UseAshAgentStore=class{#e;#t;#n;#r=new Set;#i;#a={};#o;#s;#c;#l=0;#u;#d;#f;#p;#m=`ready`;constructor(e){this.#e=e.session?void 0:()=>new Client({auth:e.auth,headers:e.headers,host:e.host??``,maxReconnectAttempts:e.maxReconnectAttempts}).session(e.initialSession),this.#c=[...e.initialEvents??[]],this.#d=[...this.#c],this.#t=e.optimistic??!0,this.#n=e.reducer,this.#f=e.session??this.#h(),this.#o=this.#E(this.#d),this.#p=this.#D()}get snapshot(){return this.#p}setCallbacks(e){this.#a=e}subscribe(e){return this.#r.add(e),()=>{this.#r.delete(e)}}async sendMessage(e,t){await this.send({message:e},t)}async send(t,n){if(this.#m===`streaming`||this.#m===`submitted`)throw Error(`Ash session is already processing a turn.`);let r=this.#g(),i=new AbortController;this.#i=i,this.#s=void 0,this.#m=`submitted`,this.#O();try{let e=await this.#a.prepareSend?.(t)??t;if(!this.#v(r))return;this.#y(e),this.#b(e),this.#O();let a=await this.#f.send(e,{...n,signal:createAbortSignal(n?.signal,i.signal)}),o=!1;for await(let e of a){if(!this.#v(r))return;o||(o=!0,this.#m=`streaming`),this.#c=[...this.#c,e],this.#x(e),this.#a.onEvent?.(e),this.#S(e),this.#O()}if(!this.#v(r))return;this.#m=this.#s===void 0?`ready`:`error`}catch(t){if(!this.#v(r))return;isAbortError(t)?(this.#m=`ready`,this.#C(toError(t))):(this.#s=toError(t),this.#m=`error`,this.#C(this.#s),this.#a.onError?.(this.#s))}finally{this.#v(r)&&(this.#i=void 0,this.#a.onSessionChange?.(this.#f.state),this.#O(),this.#a.onFinish?.(this.#p))}}stop(){this.#i?.abort()}reset(){this.#_(),this.stop(),this.#i=void 0,this.#f=this.#e?.()??this.#f,this.#c=[],this.#u=void 0,this.#d=[],this.#o=this.#n.initial(),this.#s=void 0,this.#m=`ready`,this.#a.onSessionChange?.(this.#f.state),this.#O()}#h(){if(!this.#e)throw Error(`Cannot create an owned Ash session from an external session.`);return this.#e()}#g(){return this.#l+=1,this.#l}#_(){this.#l+=1}#v(e){return this.#l===e}#y(e){if(!this.#t||e.message===void 0)return;let t=createSubmissionId(),n={createdAt:Date.now(),id:t,message:summarizeUserContent(e.message)};this.#u=n,this.#w({data:{createdAt:n.createdAt,message:n.message,submissionId:n.id},type:`client.message.submitted`})}#b(e){e.inputResponses===void 0||e.inputResponses.length===0||this.#w({data:{createdAt:Date.now(),responses:e.inputResponses},type:`client.input.responded`})}#x(e){if(e.type===`message.received`&&this.#u!==void 0){let t=this.#u.id;this.#u=void 0,this.#T(e=>e.type===`client.message.submitted`&&e.data.submissionId===t,e);return}this.#w(e)}#S(e){let t=toTerminalStreamFailureError(e);t!==void 0&&(this.#m=`error`,this.#C(t),this.#s===void 0&&(this.#s=t,this.#a.onError?.(t)))}#C(e){let t=this.#u;t!==void 0&&(this.#u=void 0,this.#T(e=>e.type===`client.message.submitted`&&e.data.submissionId===t.id,{data:{createdAt:t.createdAt,error:{message:e.message},message:t.message,submissionId:t.id},type:`client.message.failed`}))}#w(e){this.#d=[...this.#d,e],this.#o=this.#n.reduce(this.#o,e)}#T(e,t){let n=!1;this.#d=this.#d.map(r=>!n&&e(r)?(n=!0,t):r),n||(this.#d=[...this.#d,t]),this.#o=this.#E(this.#d)}#E(e){let t=this.#n.initial();for(let n of e)t=this.#n.reduce(t,n);return t}#D(){return{data:this.#o,error:this.#s,events:this.#c,session:this.#f.state,status:this.#m}}#O(){this.#p=this.#D();for(let e of this.#r)e()}};let submissionSequence=0;function createSubmissionId(){let e=globalThis.crypto?.randomUUID;return e===void 0?(submissionSequence+=1,`submission_${submissionSequence.toString()}`):e.call(globalThis.crypto)}function createAbortSignal(e,t){return e?AbortSignal.any([e,t]):t}function summarizeUserContent(e){if(typeof e==`string`)return e;let t=[];for(let n of e){if(n.type===`text`){t.push(n.text);continue}n.type===`file`&&t.push(n.filename?`[file: ${n.filename}]`:`[file]`)}return t.join(`
2
- `)}function isAbortError(e){return e instanceof Error&&e.name===`AbortError`}function toTerminalStreamFailureError(e){if(e.type!==`session.failed`)return;let t=Error(e.data.message);return t.name=e.data.code,t}export{useAshAgent};
1
+ import{AshAgentStore}from"#client/ash-agent-store.js";import{defaultMessageReducer}from"#client/message-reducer.js";import{useCallback,useMemo,useRef,useSyncExternalStore}from"react";function useAshAgent(r={}){let i=useRef(void 0);if(!i.current){let n=r.reducer??defaultMessageReducer();i.current=new AshAgentStore({auth:r.auth,headers:r.headers,host:r.host,initialEvents:r.initialEvents,initialSession:r.initialSession,maxReconnectAttempts:r.maxReconnectAttempts,optimistic:r.optimistic,reducer:n,session:r.session})}let a=i.current;a.setCallbacks({onError:r.onError,onEvent:r.onEvent,onFinish:r.onFinish,onSessionChange:r.onSessionChange,prepareSend:r.prepareSend});let o=useSyncExternalStore(useCallback(e=>a.subscribe(e),[a]),()=>a.snapshot,()=>a.snapshot),s=useCallback(()=>a.reset(),[a]),c=useCallback((e,t)=>a.send(e,t),[a]),l=useCallback((e,t)=>a.sendMessage(e,t),[a]),u=useCallback(()=>a.stop(),[a]);return useMemo(()=>({...o,reset:s,send:c,sendMessage:l,stop:u}),[s,c,l,o,u])}export{useAshAgent};
@@ -0,0 +1,3 @@
1
+ export { useAshAgent, type PrepareSend, type UseAshAgentOptions, type UseAshAgentReturn, type UseAshAgentSnapshot, type UseAshAgentStatus, } from "#svelte/use-ash-agent.js";
2
+ export { type AshAgentReducer, type AshAgentReducerEvent, type ClientInputRespondedEvent, type ClientMessageFailedEvent, type ClientMessageSubmittedEvent, } from "#client/reducer.js";
3
+ export { defaultMessageReducer, type AshMessageData, type AshDynamicToolPart, type AshMessageInputRequest, type AshMessage, type AshMessageMetadata, type AshMessagePart, type AshMessageToolMetadata, } from "#client/message-reducer.js";
@@ -0,0 +1,3 @@
1
+ import { n as defaultMessageReducer, t as useAshAgent } from "../chunks/use-ash-agent-KtjpWd5l.js";
2
+
3
+ export { defaultMessageReducer, useAshAgent };
@@ -0,0 +1,80 @@
1
+ import { type AshAgentStoreCallbacks, type AshAgentStoreSnapshot, type AshAgentStoreStatus, type PrepareSend } from "#client/ash-agent-store.js";
2
+ import { type AshMessageData } from "#client/message-reducer.js";
3
+ import type { AshAgentReducer } from "#client/reducer.js";
4
+ import type { ClientSession } from "#client/session.js";
5
+ import type { ClientAuth, HeadersValue, SendMessageOptions, SendTurnInput, SessionState } from "#client/types.js";
6
+ import type { HandleMessageStreamEvent } from "#protocol/message.js";
7
+ export type { PrepareSend };
8
+ export type UseAshAgentStatus = AshAgentStoreStatus;
9
+ export type UseAshAgentSnapshot<TData> = AshAgentStoreSnapshot<TData>;
10
+ /**
11
+ * Reactive return value from `useAshAgent`.
12
+ *
13
+ * The state properties are Svelte 5 rune-friendly getters. Read them from a
14
+ * template, `$derived`, or `$effect` and Svelte will update when Ash streams
15
+ * new events.
16
+ */
17
+ export interface UseAshAgentReturn<TData> {
18
+ /** Projected state built by reducing every stream event through the reducer. */
19
+ readonly data: TData;
20
+ /** Last transport-level error, or `undefined` when healthy. */
21
+ readonly error: Error | undefined;
22
+ /** Raw server events received during this session (authoritative stream). */
23
+ readonly events: readonly HandleMessageStreamEvent[];
24
+ /** Clear all state and start a new session. */
25
+ readonly reset: () => void;
26
+ /** Send a turn with full structured input (message, attachments, input responses). */
27
+ readonly send: (input: SendTurnInput, options?: SendMessageOptions) => Promise<void>;
28
+ /** Shorthand: send a plain text message. */
29
+ readonly sendMessage: (message: string, options?: SendMessageOptions) => Promise<void>;
30
+ /** Current session identity and stream cursor. */
31
+ readonly session: SessionState;
32
+ /** Lifecycle phase: `"ready"` (idle), `"submitted"` (request sent, awaiting first event), `"streaming"` (events arriving), or `"error"`. */
33
+ readonly status: UseAshAgentStatus;
34
+ /** Abort the in-flight request. */
35
+ readonly stop: () => void;
36
+ }
37
+ /**
38
+ * Configuration for creating or binding a Svelte Ash agent session.
39
+ *
40
+ * Session configuration is read once when `useAshAgent` creates its internal
41
+ * store. To point the binding at a different host, reducer, or session, create
42
+ * a new binding instance. Lifecycle callbacks are installed on creation.
43
+ *
44
+ * For credentials or headers that must change without recreating the binding,
45
+ * pass function values to `auth` or `headers`; the underlying client resolves
46
+ * those before each HTTP request.
47
+ */
48
+ export interface UseAshAgentOptions<TData> extends AshAgentStoreCallbacks<TData> {
49
+ readonly auth?: ClientAuth;
50
+ readonly headers?: HeadersValue;
51
+ /**
52
+ * Base URL used for Ash client requests.
53
+ *
54
+ * By default, requests target same-origin Ash routes such as `/ash/v1/...`.
55
+ * Pass a same-origin prefix such as `/api` to use an app-owned proxy, or an
56
+ * absolute origin to talk to an Ash server directly.
57
+ *
58
+ * @default ""
59
+ */
60
+ readonly host?: string;
61
+ readonly initialEvents?: readonly HandleMessageStreamEvent[];
62
+ readonly initialSession?: SessionState;
63
+ readonly maxReconnectAttempts?: number;
64
+ /**
65
+ * Project submitted user messages before Ash confirms them with a
66
+ * `message.received` stream event.
67
+ *
68
+ * Optimistic events are reducer-facing projection events only. They are not
69
+ * exposed through `events`, which remains the authoritative Ash stream.
70
+ *
71
+ * @default true
72
+ */
73
+ readonly optimistic?: boolean;
74
+ readonly reducer?: AshAgentReducer<TData>;
75
+ readonly session?: ClientSession;
76
+ }
77
+ export declare function useAshAgent(options?: UseAshAgentOptions<AshMessageData>): UseAshAgentReturn<AshMessageData>;
78
+ export declare function useAshAgent<TData>(options: UseAshAgentOptions<TData> & {
79
+ readonly reducer: AshAgentReducer<TData>;
80
+ }): UseAshAgentReturn<TData>;
@@ -0,0 +1,3 @@
1
+ import { t as useAshAgent } from "../chunks/use-ash-agent-KtjpWd5l.js";
2
+
3
+ export { useAshAgent };
@@ -0,0 +1,3 @@
1
+ export { useAshAgent, type PrepareSend, type UseAshAgentOptions, type UseAshAgentReturn, type UseAshAgentSnapshot, type UseAshAgentStatus, } from "#vue/use-ash-agent.js";
2
+ export { type AshAgentReducer, type AshAgentReducerEvent, type ClientInputRespondedEvent, type ClientMessageFailedEvent, type ClientMessageSubmittedEvent, } from "#client/reducer.js";
3
+ export { defaultMessageReducer, type AshMessageData, type AshDynamicToolPart, type AshMessageInputRequest, type AshMessage, type AshMessageMetadata, type AshMessagePart, type AshMessageToolMetadata, } from "#client/message-reducer.js";
@@ -0,0 +1,3 @@
1
+ import { n as defaultMessageReducer, t as useAshAgent } from "../chunks/use-ash-agent-DzoSHUCb.js";
2
+
3
+ export { defaultMessageReducer, useAshAgent };
@@ -0,0 +1,78 @@
1
+ import { type ComputedRef } from "vue";
2
+ import { type AshAgentStoreCallbacks, type AshAgentStoreSnapshot, type AshAgentStoreStatus, type PrepareSend } from "#client/ash-agent-store.js";
3
+ import type { AshAgentReducer } from "#client/reducer.js";
4
+ import type { ClientSession } from "#client/session.js";
5
+ import { type AshMessageData } from "#client/message-reducer.js";
6
+ import type { HandleMessageStreamEvent } from "#protocol/message.js";
7
+ import type { ClientAuth, HeadersValue, SendMessageOptions, SendTurnInput, SessionState } from "#client/types.js";
8
+ export type { PrepareSend };
9
+ export type UseAshAgentStatus = AshAgentStoreStatus;
10
+ export type UseAshAgentSnapshot<TData> = AshAgentStoreSnapshot<TData>;
11
+ /**
12
+ * Reactive return value from `useAshAgent`.
13
+ */
14
+ export interface UseAshAgentReturn<TData> {
15
+ /** Projected state built by reducing every stream event through the reducer. */
16
+ readonly data: ComputedRef<TData>;
17
+ /** Last transport-level error, or `undefined` when healthy. */
18
+ readonly error: ComputedRef<Error | undefined>;
19
+ /** Raw server events received during this session (authoritative stream). */
20
+ readonly events: ComputedRef<readonly HandleMessageStreamEvent[]>;
21
+ /** Clear all state and start a new session. */
22
+ readonly reset: () => void;
23
+ /** Send a turn with full structured input (message, attachments, input responses). */
24
+ readonly send: (input: SendTurnInput, options?: SendMessageOptions) => Promise<void>;
25
+ /** Shorthand: send a plain text message. */
26
+ readonly sendMessage: (message: string, options?: SendMessageOptions) => Promise<void>;
27
+ /** Current session identity and stream cursor. */
28
+ readonly session: ComputedRef<SessionState>;
29
+ /** Lifecycle phase: `"ready"` (idle), `"submitted"` (request sent, awaiting first event), `"streaming"` (events arriving), or `"error"`. */
30
+ readonly status: ComputedRef<UseAshAgentStatus>;
31
+ /** Abort the in-flight request. */
32
+ readonly stop: () => void;
33
+ }
34
+ /**
35
+ * Configuration for creating or binding a Vue Ash agent session.
36
+ *
37
+ * Session configuration is read once when the composable creates its internal
38
+ * store. To point the composable at a different host, reducer, or session,
39
+ * unmount and remount the component that calls it. Lifecycle callbacks are
40
+ * synced on every call to `setCallbacks`.
41
+ *
42
+ * For credentials or headers that must change without remounting, pass function
43
+ * values to `auth` or `headers`; the underlying client resolves those before
44
+ * each HTTP request.
45
+ */
46
+ export interface UseAshAgentOptions<TData> extends AshAgentStoreCallbacks<TData> {
47
+ readonly auth?: ClientAuth;
48
+ readonly headers?: HeadersValue;
49
+ /**
50
+ * Base URL used for Ash client requests.
51
+ *
52
+ * By default, requests target same-origin Ash routes such as `/ash/v1/...`.
53
+ * Pass a same-origin prefix such as `/api` to use an app-owned proxy, or an
54
+ * absolute origin to talk to an Ash server directly.
55
+ *
56
+ * @default ""
57
+ */
58
+ readonly host?: string;
59
+ readonly initialEvents?: readonly HandleMessageStreamEvent[];
60
+ readonly initialSession?: SessionState;
61
+ readonly maxReconnectAttempts?: number;
62
+ /**
63
+ * Project submitted user messages before Ash confirms them with a
64
+ * `message.received` stream event.
65
+ *
66
+ * Optimistic events are reducer-facing projection events only. They are not
67
+ * exposed through `events`, which remains the authoritative Ash stream.
68
+ *
69
+ * @default true
70
+ */
71
+ readonly optimistic?: boolean;
72
+ readonly reducer?: AshAgentReducer<TData>;
73
+ readonly session?: ClientSession;
74
+ }
75
+ export declare function useAshAgent(options?: UseAshAgentOptions<AshMessageData>): UseAshAgentReturn<AshMessageData>;
76
+ export declare function useAshAgent<TData>(options: UseAshAgentOptions<TData> & {
77
+ readonly reducer: AshAgentReducer<TData>;
78
+ }): UseAshAgentReturn<TData>;
@@ -0,0 +1,3 @@
1
+ import { t as useAshAgent } from "../chunks/use-ash-agent-DzoSHUCb.js";
2
+
3
+ export { useAshAgent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "experimental-ash",
3
- "version": "0.62.0",
3
+ "version": "0.64.0",
4
4
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
5
5
  "keywords": [
6
6
  "agent-framework",
@@ -60,11 +60,31 @@
60
60
  "import": "./dist/src/react/index.js",
61
61
  "default": "./dist/src/react/index.js"
62
62
  },
63
+ "./vue": {
64
+ "types": "./dist/src/vue/index.d.ts",
65
+ "import": "./dist/src/vue/index.js",
66
+ "default": "./dist/src/vue/index.js"
67
+ },
68
+ "./svelte": {
69
+ "types": "./dist/src/svelte/index.d.ts",
70
+ "import": "./dist/src/svelte/index.js",
71
+ "default": "./dist/src/svelte/index.js"
72
+ },
63
73
  "./next": {
64
74
  "types": "./dist/src/public/next/index.d.ts",
65
75
  "import": "./dist/src/public/next/index.js",
66
76
  "default": "./dist/src/public/next/index.js"
67
77
  },
78
+ "./nuxt": {
79
+ "types": "./dist/src/public/nuxt/index.d.ts",
80
+ "import": "./dist/src/public/nuxt/index.js",
81
+ "default": "./dist/src/public/nuxt/index.js"
82
+ },
83
+ "./sveltekit": {
84
+ "types": "./dist/src/public/sveltekit/index.d.ts",
85
+ "import": "./dist/src/public/sveltekit/index.js",
86
+ "default": "./dist/src/public/sveltekit/index.js"
87
+ },
68
88
  "./tools/approval": {
69
89
  "types": "./dist/src/public/tools/approval/index.d.ts",
70
90
  "import": "./dist/src/public/tools/approval/index.js",
@@ -212,16 +232,18 @@
212
232
  "@ai-sdk/provider": "4.0.0-canary.18",
213
233
  "@chat-adapter/slack": "4.29.0",
214
234
  "@chat-adapter/state-memory": "4.29.0",
235
+ "@nuxt/kit": "^4.0.0",
215
236
  "@standard-schema/spec": "1.1.0",
237
+ "@sveltejs/kit": "^2.0.0",
216
238
  "@types/json-schema": "7.0.15",
217
239
  "@types/react": "19.2.15",
218
240
  "@types/react-test-renderer": "19.1.0",
219
241
  "@vercel/oidc": "3.5.0",
220
242
  "@vercel/sandbox": "2.1.0",
221
- "@workflow/core": "5.0.0-beta.11",
222
- "@workflow/errors": "5.0.0-beta.6",
223
- "@workflow/world": "5.0.0-beta.6",
224
- "@workflow/world-local": "5.0.0-beta.12",
243
+ "@workflow/core": "5.0.0-beta.12",
244
+ "@workflow/errors": "5.0.0-beta.7",
245
+ "@workflow/world": "5.0.0-beta.7",
246
+ "@workflow/world-local": "5.0.0-beta.13",
225
247
  "ai": "7.0.0-canary.165",
226
248
  "autoevals": "0.0.132",
227
249
  "chat": "4.29.0",
@@ -236,30 +258,53 @@
236
258
  "picocolors": "1.1.1",
237
259
  "react": "19.2.6",
238
260
  "react-test-renderer": "19.2.6",
261
+ "svelte": "^5.0.0",
239
262
  "turndown": "7.2.4",
263
+ "vite": "^8.0.0",
264
+ "vue": "^3.5.0",
240
265
  "zod": "4.4.3",
241
266
  "zod-validation-error": "5.0.0",
242
267
  "@vercel/ash-scaffold": "0.0.0"
243
268
  },
244
269
  "peerDependencies": {
245
270
  "@opentelemetry/api": "^1.0.0",
271
+ "@sveltejs/kit": "^2.0.0",
246
272
  "ai": "7.0.0-canary.165",
247
273
  "braintrust": "^3.0.0",
248
274
  "next": "^16.0.0",
249
- "react": "^19.0.0"
275
+ "nuxt": "^4.0.0",
276
+ "react": "^19.0.0",
277
+ "svelte": "^5.0.0",
278
+ "vite": "^8.0.0",
279
+ "vue": "^3.5.0"
250
280
  },
251
281
  "peerDependenciesMeta": {
252
282
  "@opentelemetry/api": {
253
283
  "optional": true
254
284
  },
285
+ "@sveltejs/kit": {
286
+ "optional": true
287
+ },
255
288
  "braintrust": {
256
289
  "optional": true
257
290
  },
258
291
  "next": {
259
292
  "optional": true
260
293
  },
294
+ "nuxt": {
295
+ "optional": true
296
+ },
261
297
  "react": {
262
298
  "optional": true
299
+ },
300
+ "svelte": {
301
+ "optional": true
302
+ },
303
+ "vite": {
304
+ "optional": true
305
+ },
306
+ "vue": {
307
+ "optional": true
263
308
  }
264
309
  },
265
310
  "engines": {
@@ -1,3 +0,0 @@
1
- import{i as e,t}from"./chunk-DSjMdhoD.js";function n(e,t,n){return n===1?e:t}function r(e,t){if(typeof t!=`string`)return null;let[n,r,...i]=t.split(`//`);if(n!==e||!r||i.length===0)return null;let a=i.join(`//`),o=a.split(`/`).at(-1)??``,s=``;return s=r.startsWith(`./`)?r.split(`/`).at(-1)??``:(r.split(`@`).slice(0,-1).join(`@`)||r.split(`@`)[0])?.split(`/`).at(-1)??``,[`default`,`__default`].includes(o)&&s&&(o=s),{shortName:o,moduleSpecifier:r,functionName:a}}function i(e){return r(`workflow`,e)}function a(e){return r(`step`,e)}function o(e){return c(a(e),e)}function s(e){return c(i(e),e)}function c(e,t){return e?`${e.shortName} (${e.moduleSpecifier})`:t}function l(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function u(e){let t={get value(){let n=e();return Object.defineProperty(t,"value",{value:n}),n}};return t}var d=e(t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}))(),1);function f(e){if(typeof e==`string`){let t=(0,d.default)(e);if(typeof t!=`number`||t<0)throw Error(`Invalid duration: "${e}". Expected a valid duration string like "1s", "1m", "1h", etc.`);return new Date(Date.now()+t)}else if(typeof e==`number`){if(e<0||!Number.isFinite(e))throw Error(`Invalid duration: ${e}. Expected a non-negative finite number of milliseconds.`);return new Date(Date.now()+e)}else if(e instanceof Date||e&&typeof e==`object`&&typeof e.getTime==`function`)return e instanceof Date?e:new Date(e.getTime());else throw Error(`Invalid duration parameter. Expected a duration string, number (milliseconds), or Date object.`)}function p(e=process.env){return e.WORKFLOW_TARGET_WORLD||(e.VERCEL_DEPLOYMENT_ID?`vercel`:`local`)}function m(e){return e===`vercel`||e===`@workflow/world-vercel`}const h={USER_ERROR:`USER_ERROR`,RUNTIME_ERROR:`RUNTIME_ERROR`,CORRUPTED_EVENT_LOG:`CORRUPTED_EVENT_LOG`,MAX_DELIVERIES_EXCEEDED:`MAX_DELIVERIES_EXCEEDED`,REPLAY_TIMEOUT:`REPLAY_TIMEOUT`,WORLD_CONTRACT_ERROR:`WORLD_CONTRACT_ERROR`};function g(e){return typeof e==`object`&&!!e&&`name`in e&&`message`in e}function _(e,t){if(t.length===0)return e;let n=[e];return t.forEach((e,r)=>{let i=r===t.length-1,a=i?`╰▶ `:`├▶ `,o=i?` `:`│ `;`${e.label}: ${e.value}`.split(`
2
- `).forEach((e,t)=>n.push(`${t===0?a:o}${e}`))}),n.join(`
3
- `)}function v(e,t){let n=[];return e&&n.push({label:`hint`,value:e}),t&&n.push({label:`docs`,value:`https://workflow-sdk.dev/err/${t}`}),n}const y={NODE_JS_MODULE_IN_WORKFLOW:`node-js-module-in-workflow`,START_INVALID_WORKFLOW_FUNCTION:`start-invalid-workflow-function`,SERIALIZATION_FAILED:`serialization-failed`,WEBHOOK_INVALID_RESPOND_WITH_VALUE:`webhook-invalid-respond-with-value`,WEBHOOK_RESPONSE_NOT_SENT:`webhook-response-not-sent`,FETCH_IN_WORKFLOW_FUNCTION:`fetch-in-workflow`,TIMEOUT_FUNCTIONS_IN_WORKFLOW:`timeout-in-workflow`,HOOK_CONFLICT:`hook-conflict`,CORRUPTED_EVENT_LOG:`corrupted-event-log`,STEP_NOT_REGISTERED:`step-not-registered`,WORKFLOW_NOT_REGISTERED:`workflow-not-registered`,RUNTIME_DECRYPTION_FAILED:`runtime-decryption-failed`};var b=class extends Error{cause;constructor(e,t){let n=_(e,v(void 0,t?.slug));super(n,{cause:t?.cause}),t?.cause!==void 0&&(this.cause=t.cause),t?.cause instanceof Error&&(this.stack=`${this.stack}\nCaused by: ${t.cause.stack}`)}static is(e){return g(e)&&e.name===`WorkflowError`}},x=class extends b{status;code;url;retryAfter;constructor(e,t){super(e,{cause:t?.cause}),this.name=`WorkflowWorldError`,this.status=t?.status,this.code=t?.code,this.url=t?.url,this.retryAfter=t?.retryAfter}static is(e){return g(e)&&e.name===`WorkflowWorldError`}},S=class extends b{runId;errorCode;constructor(e,t,n={}){let r=t instanceof Error?t.message:typeof t==`string`?t:t&&typeof t==`object`&&`message`in t?String(t.message):`Unknown error`;super(`Workflow run "${e}" failed: ${r}`,{cause:t}),this.name=`WorkflowRunFailedError`,this.runId=e,n.errorCode!==void 0&&(this.errorCode=n.errorCode)}static is(e){return g(e)&&e.name===`WorkflowRunFailedError`}},C=class extends b{runId;status;constructor(e,t){super(`Workflow run "${e}" has not completed`,{}),this.name=`WorkflowRunNotCompletedError`,this.runId=e,this.status=t}static is(e){return g(e)&&e.name===`WorkflowRunNotCompletedError`}},w=class extends b{constructor(e,t){super(e,{...t}),this.name=`WorkflowRuntimeError`}static is(e){return g(e)&&e.name===`WorkflowRuntimeError`}},T=class extends w{constructor(e,t){super(e,{...t,slug:y.CORRUPTED_EVENT_LOG}),this.name=`CorruptedEventLogError`}static is(e){return g(e)&&e.name===`CorruptedEventLogError`}},E=class extends w{context;constructor(e,t){super(e,{cause:t?.cause,slug:y.RUNTIME_DECRYPTION_FAILED}),this.name=`RuntimeDecryptionError`,t?.context!==void 0&&(this.context=t.context)}static is(e){return g(e)&&e.name===`RuntimeDecryptionError`}},D=class extends b{hint;constructor(e,t){let n=_(e,v(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`WorkflowBuildError`,this.hint=t?.hint}static is(e){return g(e)&&e.name===`WorkflowBuildError`}},O=class extends b{hint;fatal=!0;constructor(e,t){let n=_(e,v(t?.hint,void 0));super(n,{cause:t?.cause}),this.name=`SerializationError`,this.hint=t?.hint}static is(e){return g(e)&&e.name===`SerializationError`}},k=class extends w{stepName;constructor(e){super(`Step "${e}" is not registered in the current deployment. This usually indicates a build or bundling issue that caused the step to not be included in the deployment.`,{slug:y.STEP_NOT_REGISTERED}),this.name=`StepNotRegisteredError`,this.stepName=e}static is(e){return g(e)&&e.name===`StepNotRegisteredError`}},A=class extends w{workflowName;constructor(e){super(`Workflow "${e}" is not registered in the current deployment. This usually means a run was started against a deployment that does not have this workflow, or there was a build/bundling issue.`,{slug:y.WORKFLOW_NOT_REGISTERED}),this.name=`WorkflowNotRegisteredError`,this.workflowName=e}static is(e){return g(e)&&e.name===`WorkflowNotRegisteredError`}},j=class extends b{runId;constructor(e){super(`Workflow run "${e}" not found`,{}),this.name=`WorkflowRunNotFoundError`,this.runId=e}static is(e){return g(e)&&e.name===`WorkflowRunNotFoundError`}},M=class extends b{token;conflictingRunId;constructor(e,t){super(`Hook token "${e}" is already in use by another workflow${t?` (run "${t}")`:``}`,{slug:y.HOOK_CONFLICT}),this.name=`HookConflictError`,this.token=e,t!==void 0&&(this.conflictingRunId=t)}static is(e){return g(e)&&e.name===`HookConflictError`}},N=class extends b{token;constructor(e){super(`Hook not found`,{}),this.name=`HookNotFoundError`,this.token=e}static is(e){return g(e)&&e.name===`HookNotFoundError`}},P=class extends x{constructor(e){super(e),this.name=`EntityConflictError`}static is(e){return g(e)&&e.name===`EntityConflictError`}},F=class extends x{constructor(e){super(e),this.name=`RunExpiredError`}static is(e){return g(e)&&e.name===`RunExpiredError`}},I=class extends x{constructor(e,t){super(e,{retryAfter:t?.retryAfter}),this.name=`TooEarlyError`}static is(e){return g(e)&&e.name===`TooEarlyError`}},L=class extends x{retryAfter;constructor(e,t){super(e),this.name=`ThrottleError`,this.retryAfter=t?.retryAfter}static is(e){return g(e)&&e.name===`ThrottleError`}},R=class extends b{runId;constructor(e){super(`Workflow run "${e}" cancelled`,{}),this.name=`WorkflowRunCancelledError`,this.runId=e}static is(e){return g(e)&&e.name===`WorkflowRunCancelledError`}},z=class extends b{runSpecVersion;worldSpecVersion;constructor(e,t){super(`Run requires spec version ${e}, but world supports version ${t}. Please upgrade 'workflow' package.`),this.name=`RunNotSupportedError`,this.runSpecVersion=e,this.worldSpecVersion=t}static is(e){return g(e)&&e.name===`RunNotSupportedError`}},B=class extends Error{fatal=!0;constructor(e){super(e),this.name=`FatalError`}static is(e){return g(e)?e.name===`FatalError`?!0:e.fatal===!0:!1}},V=class extends Error{retryAfter;constructor(e,t={}){super(e),this.name=`RetryableError`,t.retryAfter===void 0?this.retryAfter=new Date(Date.now()+1e3):this.retryAfter=f(t.retryAfter)}static is(e){return g(e)&&e.name===`RetryableError`}};const H="Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account.",U=Symbol.for(`@workflow/errors//FatalError`),W=Symbol.for(`@workflow/errors//RetryableError`),G=Symbol.for(`@workflow/errors//HookConflictError`),K=Symbol.for(`@workflow/errors//RuntimeDecryptionError`);typeof globalThis<`u`&&(Object.hasOwn(globalThis,U)||Object.defineProperty(globalThis,U,{value:B,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,W)||Object.defineProperty(globalThis,W,{value:V,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,G)||Object.defineProperty(globalThis,G,{value:M,writable:!1,enumerable:!1,configurable:!1}),Object.hasOwn(globalThis,K)||Object.defineProperty(globalThis,K,{value:E,writable:!1,enumerable:!1,configurable:!1}));export{l as A,w as C,p as D,m as E,n as F,s as M,a as N,f as O,i as P,j as S,h as T,b as _,M as a,S as b,F as c,O as d,k as f,D as g,H as h,B as i,o as j,u as k,z as l,I as m,y as n,N as o,L as p,P as r,V as s,T as t,E as u,A as v,x as w,C as x,R as y};