experimental-ash 0.39.0 → 0.40.1

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # experimental-ash
2
2
 
3
+ ## 0.40.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 35ca14b: Fix cross-deployment turn workflows so forwarded parent streams resolve the parent run's encryption key instead of the latest deployment's key.
8
+
9
+ ## 0.40.0
10
+
11
+ ### Minor Changes
12
+
13
+ - a4ef54e: Channel event handlers now receive a guaranteed `SessionContext` on all events except `session.failed`. The `authorization.completed` emission moved inside the `runStep` ALS scope, and the subagent HITL proxy path (`input.requested`, `turn.completed`, `session.waiting`, `session.completed`) now runs inside `withContextScope` with full provider lifecycle (session, connection, sandbox). `session.failed` drops the `ctx` parameter entirely since it fires outside any recoverable session scope.
14
+
15
+ ### Patch Changes
16
+
17
+ - ccca562: Fix race condition where fast clients could POST `inputResponses` before the park hook was registered. The park hook is now created before the first turn dispatches, eliminating the window between `session.waiting` emission and hook availability.
18
+
3
19
  ## 0.39.0
4
20
 
5
21
  ### Minor Changes
@@ -27,5 +27,5 @@
27
27
  "zod": "4.4.3",
28
28
  "zod-validation-error": "5.0.0"
29
29
  },
30
- "scriptHash": "6a2fa642d99a77617cbfb4e0dc7bbbd774c22d880ea5726a09069c812896bfdd"
30
+ "scriptHash": "27a236d633a4d9d7191418c0c9eb03158389a9de5ca9a6b54bd35b754147c7f6"
31
31
  }
@@ -1,2 +1,2 @@
1
- import{i as e,s as t}from"../../_chunks/workflow/dist-C4EHshZE.js";import{c as n,et as r,nt as i,s as a,tt as o}from"../../_chunks/workflow/symbols-DygIC1sj.js";import{Bt as s,C as c,I as l,R as u,Rt as d,Vt as f,m as p,n as m,x as h,zt as g}from"../../_chunks/workflow/resume-hook-D6dFbxMV.js";import{n as _,t as v}from"../../_chunks/workflow/sleep-kQ0UwHn0.js";function y(e){o(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,y)}function b(e){o(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,b)}function x({schema:e}={}){function t(e){o(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await m(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
1
+ import{i as e,s as t}from"../../_chunks/workflow/dist-C4EHshZE.js";import{c as n,et as r,nt as i,s as a,tt as o}from"../../_chunks/workflow/symbols-DygIC1sj.js";import{Bt as s,C as c,I as l,R as u,Rt as d,Vt as f,m as p,n as m,x as h,zt as g}from"../../_chunks/workflow/resume-hook-B2kqAsX6.js";import{n as _,t as v}from"../../_chunks/workflow/sleep-kQ0UwHn0.js";function y(e){o(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,y)}function b(e){o(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,b)}function x({schema:e}={}){function t(e){o(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await m(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
2
2
  `)}`)}return await m(t,r.value)}}}const S=Symbol.for(`@workflow/setAttributes//unsupportedWorldWarned`);async function C(t,n={}){let r=u.getStore()?.workflowMetadata?.workflowRunId;if(!r)throw new e(`experimental_setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let i=_(t,n);if(i.length===0)return;let a=await d();if(typeof a.runs.experimentalSetAttributes!=`function`){let e=globalThis;if(!e[S]){e[S]=!0;let t=`name`in a&&typeof a.name==`string`?a.name:``,n=t?` (${t})`:``;console.warn(`[workflow] setAttributes: the current world implementation${n} does not implement experimentalSetAttributes; this call (and any subsequent setAttributes calls in this process) is a no-op. Attributes will become available once the world adapter adds support.`)}return}await a.runs.experimentalSetAttributes(r,i,n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{})}function w(){let e=u.getStore();return e||r(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,w),e.stepMetadata}function T(){let e=u.getStore();return e||i(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,T),e.workflowMetadata}function E(e={}){let t=u.getStore();t||i(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,E);let{namespace:r}=e,o=t.workflowMetadata.workflowRunId,d=l(o,r),m=t.writables??=new Map,_=m.get(d);if(_)return _.writable;let v=c(h(globalThis,t.ops,o,t.encryptionKey),t.encryptionKey),y=new p(o,d),b=g();return t.ops.push(b.promise),s(v.readable,y,b).catch(()=>{}),f(v.writable,b),Object.defineProperty(v.writable,a,{value:d,writable:!1}),Object.defineProperty(v.writable,n,{value:o,writable:!1}),m.set(d,{writable:v.writable,state:b}),v.writable}export{e as FatalError,t as RetryableError,y as createHook,b as createWebhook,x as defineHook,C as experimental_setAttributes,w as getStepMetadata,T as getWorkflowMetadata,E as getWritable,v as sleep};