terse-cli 0.4.6 → 0.5.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 (73) hide show
  1. package/dist/commands/deploy.d.ts.map +1 -1
  2. package/dist/commands/deploy.js +3 -2
  3. package/dist/commands/deploy.js.map +1 -1
  4. package/dist/commands/run.d.ts.map +1 -1
  5. package/dist/commands/run.js +43 -21
  6. package/dist/commands/run.js.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/providers/LanguageProvider.d.ts +2 -0
  10. package/dist/providers/LanguageProvider.d.ts.map +1 -1
  11. package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -0
  12. package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
  13. package/dist/providers/typescript/TypeScriptProvider.js +29 -5
  14. package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
  15. package/dist/providers/typescript/jobMacro.d.ts +1 -2
  16. package/dist/providers/typescript/jobMacro.d.ts.map +1 -1
  17. package/dist/providers/typescript/jobMacro.js +69 -111
  18. package/dist/providers/typescript/jobMacro.js.map +1 -1
  19. package/dist/providers/typescript/jobSources.d.ts +7 -0
  20. package/dist/providers/typescript/jobSources.d.ts.map +1 -0
  21. package/dist/providers/typescript/jobSources.js +46 -0
  22. package/dist/providers/typescript/jobSources.js.map +1 -0
  23. package/dist/providers/typescript/runtimes/JobRuntime.d.ts +3 -0
  24. package/dist/providers/typescript/runtimes/JobRuntime.d.ts.map +1 -1
  25. package/dist/providers/typescript/runtimes/JobRuntime.js.map +1 -1
  26. package/dist/providers/typescript/runtimes/directJobRuntime.d.ts.map +1 -1
  27. package/dist/providers/typescript/runtimes/directJobRuntime.js +1 -1
  28. package/dist/providers/typescript/runtimes/directJobRuntime.js.map +1 -1
  29. package/dist/providers/typescript/runtimes/durableJobRuntime.d.ts.map +1 -1
  30. package/dist/providers/typescript/runtimes/durableJobRuntime.js +99 -55
  31. package/dist/providers/typescript/runtimes/durableJobRuntime.js.map +1 -1
  32. package/dist/providers/typescript/runtimes/session.d.ts +3 -1
  33. package/dist/providers/typescript/runtimes/session.d.ts.map +1 -1
  34. package/dist/providers/typescript/runtimes/session.js +14 -9
  35. package/dist/providers/typescript/runtimes/session.js.map +1 -1
  36. package/dist/providers/typescript/stepMacro.d.ts +2 -29
  37. package/dist/providers/typescript/stepMacro.d.ts.map +1 -1
  38. package/dist/providers/typescript/stepMacro.js +29 -120
  39. package/dist/providers/typescript/stepMacro.js.map +1 -1
  40. package/dist/providers/typescript/terseWorkflow.d.ts +8 -0
  41. package/dist/providers/typescript/terseWorkflow.d.ts.map +1 -0
  42. package/dist/providers/typescript/terseWorkflow.js +8 -0
  43. package/dist/providers/typescript/terseWorkflow.js.map +1 -0
  44. package/package.json +6 -8
  45. package/templates/typescript/init/gitignore.hbs +1 -0
  46. package/templates/typescript/init/package.json.hbs +0 -1
  47. package/dist/providers/typescript/durableRuntime.d.ts +0 -21
  48. package/dist/providers/typescript/durableRuntime.d.ts.map +0 -1
  49. package/dist/providers/typescript/durableRuntime.js +0 -207
  50. package/dist/providers/typescript/durableRuntime.js.map +0 -1
  51. package/dist/providers/typescript/rewindRun.d.ts +0 -9
  52. package/dist/providers/typescript/rewindRun.d.ts.map +0 -1
  53. package/dist/providers/typescript/rewindRun.js +0 -111
  54. package/dist/providers/typescript/rewindRun.js.map +0 -1
  55. package/dist/providers/typescript/terseWorkflowBuilder.d.ts +0 -8
  56. package/dist/providers/typescript/terseWorkflowBuilder.d.ts.map +0 -1
  57. package/dist/providers/typescript/terseWorkflowBuilder.js +0 -66
  58. package/dist/providers/typescript/terseWorkflowBuilder.js.map +0 -1
  59. package/dist/providers/typescript/workflowShim.d.ts +0 -2
  60. package/dist/providers/typescript/workflowShim.d.ts.map +0 -1
  61. package/dist/providers/typescript/workflowShim.js +0 -51
  62. package/dist/providers/typescript/workflowShim.js.map +0 -1
  63. package/dist/terseWorld.d.ts +0 -4
  64. package/dist/terseWorld.d.ts.map +0 -1
  65. package/dist/terseWorld.js +0 -46
  66. package/dist/terseWorld.js.map +0 -1
  67. package/templates/typescript/workflow-shim/api.js +0 -5
  68. package/templates/typescript/workflow-shim/index.js +0 -2
  69. package/templates/typescript/workflow-shim/internal/builtins.js +0 -83
  70. package/templates/typescript/workflow-shim/internal/class-serialization.js +0 -1
  71. package/templates/typescript/workflow-shim/runtime.js +0 -1
  72. package/templates/typescript/workflow-shim/stdlib.js +0 -18
  73. package/templates/typescript/workflow-shim/workflow.js +0 -2
@@ -1,83 +0,0 @@
1
- // Vendored verbatim from workflow@5.0.0-beta.19 dist/internal/builtins.js. Re-sync when the
2
- // pinned @workflow/core version changes: these are compiled step sources, not a re-export.
3
- /**
4
- * These are the built-in steps that are "automatically available" in the workflow scope. They are
5
- * similar to "stdlib" except that are not meant to be imported by users, but are instead "just available"
6
- * alongside user defined steps. They are used internally by the runtime
7
- */
8
- export async function __builtin_response_array_buffer() {
9
- 'use step';
10
- return this.arrayBuffer();
11
- }
12
- export async function __builtin_response_json() {
13
- 'use step';
14
- return this.json();
15
- }
16
- export async function __builtin_response_text() {
17
- 'use step';
18
- return this.text();
19
- }
20
- /**
21
- * Process-wide dedupe for the unsupported-world warning so high-volume
22
- * callers don't flood logs.
23
- */
24
- const UNSUPPORTED_WORLD_WARNED = Symbol.for('@workflow/setAttributes//unsupportedWorldWarned');
25
- const INTERNAL_ATTRIBUTES_MAX_ATTEMPTS = 3;
26
- function formatUnknownError(error) {
27
- if (error instanceof Error) {
28
- return error.stack ?? `${error.name}: ${error.message}`;
29
- }
30
- return String(error);
31
- }
32
- /**
33
- * Step bridge for workflow-body `setAttributes` calls. The VM-side
34
- * helper validates input and dispatches here via `useStep`. This step
35
- * runs in normal Node context with full world access.
36
- *
37
- * The dispatch reads the world and current run id directly from
38
- * `globalThis` symbols populated by the workflow/step runtime — this
39
- * intentionally avoids importing `@workflow/core` so the Next.js
40
- * deferred-entries discoverer can't walk a chain into world adapters
41
- * and `@vercel/queue` from this step file.
42
- */
43
- export async function __builtin_set_attributes(changes, options) {
44
- 'use step';
45
- if (changes.length === 0)
46
- return;
47
- const g = globalThis;
48
- const contextStorage = g[Symbol.for('WORKFLOW_STEP_CONTEXT_STORAGE')];
49
- const store = contextStorage?.getStore?.();
50
- const attempt = typeof store?.stepMetadata?.attempt === 'number'
51
- ? store.stepMetadata.attempt
52
- : INTERNAL_ATTRIBUTES_MAX_ATTEMPTS;
53
- const world = g[Symbol.for('@workflow/world//cache')];
54
- if (typeof world?.runs?.experimentalSetAttributes !== 'function') {
55
- // World adapter doesn't implement attributes yet — no-op the call,
56
- // but emit one process-wide warning so users know their writes are
57
- // being dropped. The VM-side validation already ran so the input
58
- // is well-formed.
59
- if (!g[UNSUPPORTED_WORLD_WARNED]) {
60
- g[UNSUPPORTED_WORLD_WARNED] = true;
61
- const worldName = world?.name ? ` (${world.name})` : '';
62
- console.warn(`[workflow] setAttributes: the current world implementation${worldName} 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.`);
63
- }
64
- return;
65
- }
66
- try {
67
- const runId = store?.workflowMetadata?.workflowRunId;
68
- if (!runId) {
69
- throw new Error('__builtin_set_attributes: no workflow run id available in step context');
70
- }
71
- await world.runs.experimentalSetAttributes(runId, changes, options);
72
- }
73
- catch (error) {
74
- if (attempt < INTERNAL_ATTRIBUTES_MAX_ATTEMPTS) {
75
- throw error;
76
- }
77
- // Failing to post tags should not fail a run during the experimental phase.
78
- // After three attempts, log and let the internal step complete so the
79
- // runtime does not convert retry exhaustion into a FatalError.
80
- console.error(`[workflow] setAttributes: failed to post tags after ${INTERNAL_ATTRIBUTES_MAX_ATTEMPTS} attempts; dropping the internal attribute write. ${formatUnknownError(error)}`);
81
- }
82
- }
83
- __builtin_set_attributes.maxRetries = INTERNAL_ATTRIBUTES_MAX_ATTEMPTS - 1;
@@ -1 +0,0 @@
1
- export * from "@workflow/core/class-serialization"
@@ -1 +0,0 @@
1
- export * from "@workflow/core/runtime"
@@ -1,18 +0,0 @@
1
- // Vendored verbatim from workflow@5.0.0-beta.19 dist/stdlib.js. Re-sync when the pinned
2
- // @workflow/core version changes: these are compiled step sources, not a re-export.
3
- /**
4
- * This is the "standard library" of steps that we make available to all workflow users.
5
- * The can be imported like so: `import { fetch } from 'workflow'`. and used in workflow.
6
- * The need to be exported directly in this package and cannot live in `core` to prevent
7
- * circular dependencies post-compilation.
8
- */
9
- /**
10
- * A hoisted `fetch()` function that is executed as a "step" function,
11
- * for use within workflow functions.
12
- *
13
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
14
- */
15
- export async function fetch(...args) {
16
- 'use step';
17
- return globalThis.fetch(...args);
18
- }
@@ -1,2 +0,0 @@
1
- export * from "@workflow/core/_workflow"
2
- export * from "./stdlib.js"