unfazed 0.5.0 → 0.6.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 (92) hide show
  1. package/README.md +399 -6
  2. package/dist/cli/login.d.ts +129 -0
  3. package/dist/cli/login.js +596 -0
  4. package/dist/cli/login.js.map +1 -0
  5. package/dist/cli/workflow.d.ts +31 -0
  6. package/dist/cli/workflow.js +157 -0
  7. package/dist/cli/workflow.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +173 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/client.d.ts +26 -5
  12. package/dist/client.js +93 -48
  13. package/dist/client.js.map +1 -1
  14. package/dist/credentials.d.ts +123 -0
  15. package/dist/credentials.js +317 -0
  16. package/dist/credentials.js.map +1 -0
  17. package/dist/errors.d.ts +25 -0
  18. package/dist/errors.js +25 -0
  19. package/dist/errors.js.map +1 -1
  20. package/dist/index.d.ts +32 -1
  21. package/dist/index.js +32 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/remote/app.d.ts +18 -0
  24. package/dist/remote/app.js +77 -0
  25. package/dist/remote/app.js.map +1 -0
  26. package/dist/remote/documents.d.ts +175 -0
  27. package/dist/remote/documents.js +122 -0
  28. package/dist/remote/documents.js.map +1 -0
  29. package/dist/remote/values.d.ts +67 -0
  30. package/dist/remote/values.js +156 -0
  31. package/dist/remote/values.js.map +1 -0
  32. package/dist/remote/world.d.ts +50 -0
  33. package/dist/remote/world.js +628 -0
  34. package/dist/remote/world.js.map +1 -0
  35. package/dist/unfazed.d.ts +1 -1
  36. package/dist/unfazed.js +1 -1
  37. package/dist/unfazed.js.map +1 -1
  38. package/dist/workflow/config.d.ts +23 -0
  39. package/dist/workflow/config.js +48 -0
  40. package/dist/workflow/config.js.map +1 -0
  41. package/dist/workflow/errors.d.ts +33 -0
  42. package/dist/workflow/errors.js +16 -0
  43. package/dist/workflow/errors.js.map +1 -0
  44. package/dist/workflow/index.d.ts +30 -0
  45. package/dist/workflow/index.js +23 -0
  46. package/dist/workflow/index.js.map +1 -0
  47. package/dist/workflow/inspect-render.d.ts +93 -0
  48. package/dist/workflow/inspect-render.js +302 -0
  49. package/dist/workflow/inspect-render.js.map +1 -0
  50. package/dist/workflow/inspect.d.ts +52 -0
  51. package/dist/workflow/inspect.js +879 -0
  52. package/dist/workflow/inspect.js.map +1 -0
  53. package/dist/workflow/migration-files.d.ts +13 -0
  54. package/dist/workflow/migration-files.js +52 -0
  55. package/dist/workflow/migration-files.js.map +1 -0
  56. package/dist/workflow/migration-types.d.ts +19 -0
  57. package/dist/workflow/migration-types.js +8 -0
  58. package/dist/workflow/migration-types.js.map +1 -0
  59. package/dist/workflow/migrations.d.ts +12 -0
  60. package/dist/workflow/migrations.generated.d.ts +2 -0
  61. package/dist/workflow/migrations.generated.js +34 -0
  62. package/dist/workflow/migrations.generated.js.map +1 -0
  63. package/dist/workflow/migrations.js +94 -0
  64. package/dist/workflow/migrations.js.map +1 -0
  65. package/dist/workflow/nitro-flow-guard.d.ts +4 -0
  66. package/dist/workflow/nitro-flow-guard.js +19 -0
  67. package/dist/workflow/nitro-flow-guard.js.map +1 -0
  68. package/dist/workflow/nitro-inspect.d.ts +3 -0
  69. package/dist/workflow/nitro-inspect.js +19 -0
  70. package/dist/workflow/nitro-inspect.js.map +1 -0
  71. package/dist/workflow/nitro-plugin.d.ts +1 -0
  72. package/dist/workflow/nitro-plugin.js +13 -0
  73. package/dist/workflow/nitro-plugin.js.map +1 -0
  74. package/dist/workflow/nitro.d.ts +70 -0
  75. package/dist/workflow/nitro.js +213 -0
  76. package/dist/workflow/nitro.js.map +1 -0
  77. package/dist/workflow/public-url.d.ts +27 -0
  78. package/dist/workflow/public-url.js +45 -0
  79. package/dist/workflow/public-url.js.map +1 -0
  80. package/dist/workflow/queue.d.ts +128 -0
  81. package/dist/workflow/queue.js +375 -0
  82. package/dist/workflow/queue.js.map +1 -0
  83. package/dist/workflow/state.d.ts +25 -0
  84. package/dist/workflow/state.js +15 -0
  85. package/dist/workflow/state.js.map +1 -0
  86. package/dist/workflow/transport.d.ts +12 -0
  87. package/dist/workflow/transport.js +29 -0
  88. package/dist/workflow/transport.js.map +1 -0
  89. package/dist/workflow/world.d.ts +123 -0
  90. package/dist/workflow/world.js +375 -0
  91. package/dist/workflow/world.js.map +1 -0
  92. package/package.json +79 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/remote/values.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAE9C,wCAAwC;AACxC,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,CAAC,IAAa,EAAU,EAAE;QACpC,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,iBAAiB,CAAC;QACjD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;aAAM,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrD,MAAM,IAAI,GAA2B,EAAE,CAAC;YACxC,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAA+B,CAAC;gBAAE,IA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,yFAAyF;AACzF,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC;AAE5E,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,IAAgD;IACxE,MAAM,GAAG,GAA4B,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;IACzD,KAAK,MAAM,KAAK,IAAI,iBAAiB,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvF,IAAI,IAAI;YAAE,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAqC;IACpE,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,OAAO;IACrB,YAAY,EAAE,OAAO;IACrB,cAAc,EAAE,QAAQ;IACxB,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,OAAO;IACtB,YAAY,EAAE,UAAU;IACxB,aAAa,EAAE,SAAS;CACzB,CAAC","sourcesContent":["/**\n * How the `unfazed` CLI backend turns the inspection API's display data back\n * into what Workflow SDK's tooling reads from a World.\n *\n * The app's inspection route hydrates every payload inside the app and sends\n * it as display text (`JSON.stringify` of the hydrated value, cut at the\n * route's caps). The CLI and the web UI expect a World to hand them serialized\n * data, which they hydrate themselves: a `Uint8Array` with a 4-byte format\n * prefix, `devl` followed by devalue text. So each value is parsed back from\n * its display text and re-encoded as `devl` + devalue, which every Workflow\n * SDK reader hydrates to the same plain value. A value that was cut, or that\n * the app could not hydrate, becomes a string that says so.\n *\n * Pure functions, no dependencies.\n */\nimport type { WorkflowError, WorkflowStreamChunk, WorkflowValue } from \"./documents.js\";\n\nconst encoder = new TextEncoder();\nconst DEVALUE_PREFIX = encoder.encode(\"devl\");\n\n/** devalue's marker for `undefined`. */\nconst DEVALUE_UNDEFINED = -1;\n\n/**\n * devalue's `stringify` for the values JSON can hold (what `JSON.parse`\n * returns, plus `undefined`): a flat array whose first entry is the root,\n * where an object or array refers to its members by index. Strings,\n * numbers, booleans and `null` sit in the array as themselves, so the\n * encoding never produces devalue's typed tuples (`[\"Date\", …]`), and every\n * reviver set reads it the same way.\n */\nexport function devalueStringify(value: unknown): string {\n if (value === undefined) return String(DEVALUE_UNDEFINED);\n const values: unknown[] = [];\n const add = (item: unknown): number => {\n if (item === undefined) return DEVALUE_UNDEFINED;\n const index = values.length;\n values.push(null);\n if (Array.isArray(item)) {\n values[index] = item.map(add);\n } else if (item !== null && typeof item === \"object\") {\n const flat: Record<string, number> = {};\n for (const [key, member] of Object.entries(item as Record<string, unknown>)) flat[key] = add(member);\n values[index] = flat;\n } else if (typeof item === \"number\" && !Number.isFinite(item)) {\n values[index] = null;\n } else {\n values[index] = item;\n }\n return index;\n };\n add(value);\n return JSON.stringify(values);\n}\n\n/** `value` as Workflow SDK serialized data: `devl` + devalue text. */\nexport function serialize(value: unknown): Uint8Array {\n const body = encoder.encode(devalueStringify(value));\n const out = new Uint8Array(DEVALUE_PREFIX.length + body.length);\n out.set(DEVALUE_PREFIX, 0);\n out.set(body, DEVALUE_PREFIX.length);\n return out;\n}\n\n/**\n * One stream frame as Workflow SDK's stream writer writes it: a 4-byte\n * big-endian length, then the serialized value. `getDeserializeStream()`\n * (what `workflow inspect stream` and the web UI read streams with) turns\n * each frame back into the value.\n */\nexport function frame(value: unknown): Uint8Array {\n const payload = serialize(value);\n const out = new Uint8Array(4 + payload.length);\n new DataView(out.buffer).setUint32(0, payload.length, false);\n out.set(payload, 4);\n return out;\n}\n\n/** What a payload cut at the inspection route's cap ends with. */\nexport function truncationNote(bytes: number): string {\n return ` … [truncated by unfazed inspection: ${bytes} bytes in full]`;\n}\n\n/** What a payload the app could not hydrate reads as. */\nexport function unreadable(reason: string): string {\n return `[unreadable payload: ${reason}]`;\n}\n\n/**\n * The value behind a `WorkflowValue`: its display JSON parsed back, a string\n * marked as cut when the route cut it (the cut text is not valid JSON), or a\n * string with the reason when the app could not hydrate it.\n */\nexport function displayValue(value: WorkflowValue): unknown {\n if (value.error) return unreadable(value.text);\n if (value.truncated) return value.text + truncationNote(value.bytes);\n try {\n return JSON.parse(value.text);\n } catch {\n return value.text;\n }\n}\n\n/** A `WorkflowValue` as serialized data, or `undefined` for an absent payload. */\nexport function serializedValue(value: WorkflowValue | null | undefined): Uint8Array | undefined {\n return value ? serialize(displayValue(value)) : undefined;\n}\n\n/** A run or step error as Workflow SDK's `StructuredError`. */\nexport function structuredError(error: WorkflowError): { message: string; stack?: string; code?: string } {\n return {\n message: error.truncated ? `${error.message} … [truncated by unfazed inspection]` : error.message,\n ...(error.stack !== null ? { stack: error.stack } : {}),\n ...(error.code !== null ? { code: error.code } : {}),\n };\n}\n\n/**\n * The value of one stream chunk: `json` chunks (what `getWritable()` writes)\n * parsed back, `utf8` chunks as their text, `base64` chunks (bytes that are\n * not UTF-8) as `{ $bytes, base64 }`, the route's display form for bytes.\n */\nexport function chunkValue(chunk: WorkflowStreamChunk): unknown {\n const note = chunk.truncated ? ` … [truncated by unfazed inspection: chunk of ${chunk.bytes} bytes]` : \"\";\n if (chunk.encoding === \"base64\") {\n return { $bytes: chunk.bytes, base64: chunk.text, ...(chunk.truncated ? { truncated: true } : {}) };\n }\n if (chunk.encoding === \"json\" && !chunk.truncated) {\n try {\n return JSON.parse(chunk.text);\n } catch {\n return chunk.text;\n }\n }\n return chunk.text + note;\n}\n\n/** An RFC 3339 time as a `Date`, or `undefined`. */\nexport function toDate(value: string | null | undefined): Date | undefined {\n if (value === null || value === undefined || value === \"\") return undefined;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/** Event data fields the World types as dates; the route sends them as RFC 3339 text. */\nconst EVENT_DATE_FIELDS = [\"resumeAt\", \"retryAfter\", \"tokenRetentionUntil\"];\n\n/** An event's `info` as `eventData`, its date fields as `Date`s. */\nexport function eventData(info: Record<string, unknown> | null | undefined): Record<string, unknown> {\n const out: Record<string, unknown> = { ...(info ?? {}) };\n for (const field of EVENT_DATE_FIELDS) {\n const date = typeof out[field] === \"string\" ? toDate(out[field] as string) : undefined;\n if (date) out[field] = date;\n }\n return out;\n}\n\n/**\n * The payload field of each event type, as `getEventDataRefFields()` in\n * `@workflow/world` lists them: where `events.get` puts the event's data.\n */\nexport const EVENT_PAYLOAD_FIELDS: Readonly<Record<string, string>> = {\n run_created: \"input\",\n run_started: \"input\",\n run_completed: \"output\",\n run_failed: \"error\",\n step_created: \"input\",\n step_started: \"input\",\n step_completed: \"result\",\n step_failed: \"error\",\n step_retrying: \"error\",\n hook_created: \"metadata\",\n hook_received: \"payload\",\n};\n"]}
@@ -0,0 +1,50 @@
1
+ import { type FetchLike } from "../client.js";
2
+ export interface RemoteWorldOptions {
3
+ /** The app's alias. Default: `UNFZ_APP`, else the `alias` (or single `apps[]` entry) of `unfazed.json` in `cwd`. */
4
+ alias?: string;
5
+ /** Bearer token. Default: `UNFZ_API_TOKEN`, else the stored login of `npx unfazed login`. */
6
+ token?: string;
7
+ /** Full GraphQL endpoint. Default: `UNFZ_API_URL`, else https://unfazed.dev/query. */
8
+ endpoint?: string;
9
+ /** Where the defaults above (and the stored login's location) are read from. Default: `process.env`. */
10
+ env?: Record<string, string | undefined>;
11
+ /** Directory whose `unfazed.json` names the app. Default: the current directory. */
12
+ cwd?: string;
13
+ /** Per-request timeout in ms. Default 60 000 (a relay may include the app's cold start). */
14
+ timeoutMs?: number;
15
+ /**
16
+ * How long `streams.get` waits between reads of a stream still being
17
+ * written, at most: it starts at 1 s and doubles up to this. Default 5 000.
18
+ */
19
+ streamPollMs?: number;
20
+ /** Injection point for tests. */
21
+ fetch?: FetchLike;
22
+ }
23
+ /**
24
+ * The World `createWorld()` from `unfazed` returns: Workflow SDK's `World`
25
+ * interface over the inspection API. Typed loosely here so the root entry's
26
+ * declarations need no `@workflow/world`; cast to its `World` when you call
27
+ * it from code.
28
+ */
29
+ export interface RemoteWorld {
30
+ /** The app it reads. */
31
+ readonly alias: string;
32
+ readonly specVersion: number;
33
+ readonly runs: object;
34
+ readonly steps: object;
35
+ readonly events: object;
36
+ readonly hooks: object;
37
+ readonly streams: object;
38
+ close(): Promise<void>;
39
+ }
40
+ /**
41
+ * `SPEC_VERSION_CURRENT` of the `@workflow/world` this backend was written
42
+ * against (a test keeps the two equal). Informational: this World creates
43
+ * and replays nothing.
44
+ */
45
+ export declare const REMOTE_SPEC_VERSION = 8;
46
+ /**
47
+ * Creates the CLI backend's World for one app. Throws when there is no token
48
+ * or no app to read, saying what to set.
49
+ */
50
+ export declare function createRemoteWorld(options?: RemoteWorldOptions): RemoteWorld;