experimental-ash 0.38.0 → 0.38.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/src/compiled/.vendor-stamp.json +2 -2
  3. package/dist/src/compiled/@workflow/core/_workflow-world.d.ts +1 -0
  4. package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +7 -0
  5. package/dist/src/compiled/@workflow/core/encryption.d.ts +15 -0
  6. package/dist/src/compiled/@workflow/core/index.d.ts +1 -0
  7. package/dist/src/compiled/@workflow/core/index.js +2 -2
  8. package/dist/src/compiled/@workflow/core/package.json +1 -1
  9. package/dist/src/compiled/@workflow/core/runtime.js +28 -28
  10. package/dist/src/compiled/@workflow/core/serialization/errors.d.ts +13 -0
  11. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +7 -0
  12. package/dist/src/compiled/@workflow/core/serialization.d.ts +6 -0
  13. package/dist/src/compiled/@workflow/core/set-attributes.d.ts +13 -0
  14. package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +14 -0
  15. package/dist/src/compiled/@workflow/core/types.d.ts +6 -0
  16. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  17. package/dist/src/compiled/@workflow/core/workflow/index.d.ts +1 -0
  18. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +74 -0
  19. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  20. package/dist/src/compiled/@workflow/errors/index.d.ts +46 -0
  21. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  22. package/dist/src/compiled/@workflow/errors/package.json +1 -1
  23. package/dist/src/compiled/_chunks/workflow/dist-C4EHshZE.js +3 -0
  24. package/dist/src/compiled/_chunks/workflow/resume-hook-D6dFbxMV.js +12 -0
  25. package/dist/src/compiled/_chunks/workflow/sleep-kQ0UwHn0.js +1 -0
  26. package/dist/src/compiled/_chunks/workflow/symbols-DygIC1sj.js +48 -0
  27. package/dist/src/internal/application/package.js +1 -1
  28. package/dist/src/packages/ash-scaffold/src/channels.js +1 -1
  29. package/dist/src/public/tool-result-narrowing.d.ts +5 -3
  30. package/dist/src/public/tool-result-narrowing.js +1 -1
  31. package/dist/src/runtime/resolve-connection.js +1 -1
  32. package/dist/src/runtime/resolve-tool.js +1 -1
  33. package/package.json +4 -4
  34. package/dist/src/compiled/_chunks/workflow/dist-DO14ZaQj.js +0 -3
  35. package/dist/src/compiled/_chunks/workflow/resume-hook-DOMbNs-S.js +0 -51
  36. package/dist/src/compiled/_chunks/workflow/sleep-CRjce49s.js +0 -1
  37. package/dist/src/compiled/_chunks/workflow/symbols-D8paKc8P.js +0 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # experimental-ash
2
2
 
3
+ ## 0.38.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0a88b75: Prevent `toolResultFrom` from matching the wrong definition when tools share a description or MCP connections share a URL. Runtime resolution now prefers source-derived identity keys and treats colliding fallback keys as non-matching.
8
+ - 8b0a7d8: Upgrade `@workflow/core` to `5.0.0-beta.10`, `@workflow/world-local` to
9
+ `5.0.0-beta.11`, and `@workflow/errors` to `5.0.0-beta.6`. Picks up
10
+ step-side `experimental_setAttributes` ([vercel/workflow#2157][1]) and
11
+ escapes the abandoned November 2025 `@workflow/world-local` slots that
12
+ broke `@workflow/core@5.0.0-beta.9`'s pin chain
13
+ ([vercel/workflow#2168][2], [vercel/workflow#2162][3]). No runtime or
14
+ public API changes — this is the dependency-bump prerequisite for the
15
+ `$ash.*` workflow attribute emission work (see
16
+ `research/active/workflow-run-attributes.md`).
17
+
18
+ [1]: https://github.com/vercel/workflow/pull/2157
19
+ [2]: https://github.com/vercel/workflow/pull/2168
20
+ [3]: https://github.com/vercel/workflow/pull/2162
21
+
3
22
  ## 0.38.0
4
23
 
5
24
  ### Minor Changes
@@ -22,8 +22,8 @@
22
22
  "turndown": "7.2.4",
23
23
  "@vercel/oidc": "3.4.1",
24
24
  "@vercel/sandbox": "2.0.1",
25
- "@workflow/core": "5.0.0-beta.7",
26
- "@workflow/errors": "5.0.0-beta.4",
25
+ "@workflow/core": "5.0.0-beta.10",
26
+ "@workflow/errors": "5.0.0-beta.6",
27
27
  "zod": "4.4.3",
28
28
  "zod-validation-error": "5.0.0"
29
29
  },
@@ -4,6 +4,7 @@
4
4
  type JsonishRecord = Record<string, any>;
5
5
  type PaginatedResponse<T> = { cursor?: string | null; data: T[]; hasMore?: boolean };
6
6
 
7
+ export type AttributeChange = JsonishRecord;
7
8
  export interface Event extends JsonishRecord {
8
9
  correlationId?: string | null;
9
10
  eventType?: string;
@@ -0,0 +1,7 @@
1
+ import { type AttributeChange } from './_workflow-world.js';
2
+ interface AttributeChangeOptions {
3
+ allowReservedAttributes?: boolean;
4
+ }
5
+ export declare function normalizeAttributeChanges(attrs: Record<string, string | undefined>, options?: AttributeChangeOptions): AttributeChange[];
6
+ export {};
7
+ //# sourceMappingURL=attribute-changes.d.ts.map
@@ -43,6 +43,21 @@ export declare function encrypt(key: CryptoKey, data: Uint8Array): Promise<Uint8
43
43
  /**
44
44
  * Decrypt data using AES-256-GCM.
45
45
  *
46
+ * Any failure inside the Web Crypto layer — most commonly an
47
+ * `OperationError: The operation failed for an operation-specific reason`
48
+ * raised by `AESCipherJob.onDone` when the GCM authentication tag does
49
+ * not verify — is rewrapped as {@link RuntimeDecryptionError}. The
50
+ * wrapped error carries the original DOMException as `cause`, plus a
51
+ * small diagnostic context (`operation`, input `byteLength`) to help
52
+ * disambiguate ciphertext corruption from key mismatch from truncated
53
+ * transport reads.
54
+ *
55
+ * Note: `data` is the raw AES payload (`[nonce][ciphertext + tag]`), not a
56
+ * format-prefixed envelope — callers strip the `encr` marker via
57
+ * `decodeFormatPrefix()` before reaching this function. The outer
58
+ * envelope's format prefix is therefore attached by the serialization
59
+ * layer (`serialization/encryption.ts`), which is the layer that has it.
60
+ *
46
61
  * @param key - CryptoKey from `importKey()`
47
62
  * @param data - `[nonce (12 bytes)][ciphertext + GCM auth tag]`
48
63
  * @returns Decrypted plaintext
@@ -12,6 +12,7 @@
12
12
  export { FatalError, RetryableError, type RetryableErrorOptions, } from '#compiled/@workflow/errors/index.js';
13
13
  export { createHook, createWebhook, type Hook, type HookOptions, type RequestWithResponse, type Webhook, type WebhookOptions, } from './create-hook.js';
14
14
  export { defineHook, type TypedHook } from './define-hook.js';
15
+ export { experimental_setAttributes } from './set-attributes.js';
15
16
  export { sleep } from './sleep.js';
16
17
  export { getStepMetadata, type StepMetadata, } from './step/get-step-metadata.js';
17
18
  export { getWorkflowMetadata, type WorkflowMetadata, } from './step/get-workflow-metadata.js';
@@ -1,2 +1,2 @@
1
- import{i as e,s as t}from"../../_chunks/workflow/dist-DO14ZaQj.js";import{_ as n,c as r,s as i,v as a,y as o}from"../../_chunks/workflow/symbols-D8paKc8P.js";import{Bt as s,C as c,I as l,R as u,Vt as d,m as f,n as p,x as m,zt as h}from"../../_chunks/workflow/resume-hook-DOMbNs-S.js";import{t as g}from"../../_chunks/workflow/sleep-CRjce49s.js";function _(e){a(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,_)}function v(e){a(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,v)}function y({schema:e}={}){function t(e){a(`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 p(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
- `)}`)}return await p(t,r.value)}}}function b(){let e=u.getStore();return e||n(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,b),e.stepMetadata}function x(){let e=u.getStore();return e||o(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,x),e.workflowMetadata}function S(e={}){let t=u.getStore();t||o(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,S);let{namespace:n}=e,a=t.workflowMetadata.workflowRunId,p=l(a,n),g=c(m(globalThis,t.ops,a,t.encryptionKey),t.encryptionKey),_=new f(a,p),v=h();return t.ops.push(v.promise),s(g.readable,_,v).catch(()=>{}),d(g.writable,v),Object.defineProperty(g.writable,i,{value:p,writable:!1}),Object.defineProperty(g.writable,r,{value:a,writable:!1}),g.writable}export{e as FatalError,t as RetryableError,_ as createHook,v as createWebhook,y as defineHook,b as getStepMetadata,x as getWorkflowMetadata,S as getWritable,g as sleep};
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(`
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};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "experimental-ash-compiled-workflow-core",
3
- "version": "5.0.0-beta.7",
3
+ "version": "5.0.0-beta.10",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0"