Skip to content

feat: introduce standalone execute() and executionTrace() functions and @trace() decorator#54

Merged
tabkram merged 7 commits into
mainfrom
feature/trace
Feb 24, 2025
Merged

feat: introduce standalone execute() and executionTrace() functions and @trace() decorator#54
tabkram merged 7 commits into
mainfrom
feature/trace

Conversation

@tabkram
Copy link
Copy Markdown
Owner

@tabkram tabkram commented Feb 22, 2025

  • create a generic execute() function that handles async , async and hidden promises function

  • create standalone executionTrace() function usage without requiring engine instantiation.

  • introduce the @trace() decorator to manage ExecutionTrace, append function metadata, and enrich the bound context with custom info.

  • refactor trace and engine models.

  • rename TraceableExecution to TraceableEngine to separate engine scope from standalone scope

  • refactor TraceableEngine to use the common executionTrace() function and the execute() behind

  • doc and generate examples to ensure deprecated engin still work and supported

⚠️ Deprecation Notice:

  • NodeExecutionTrace is deprecated, Use ExecutionTrace instead.
  • NodeExecutionTraceExtractor is deprecated. Use ExecutionTraceExtractor instead.
  • isNodeExecutionTrace is deprecated. Use isExecutionTrace instead.
  • TraceableExecution is deprecated and will be removed in a future release. Use TraceableEngine instead.
  • EdgeData is deprecated, use EngineEdgeData instead.
  • NodeTrace is deprecated, use EngineNodeTrace instead.
  • NodeData is deprecated, use EngineNodeData instead.
  • Node is deprecated, use EngineNode instead.
  • Edge is deprecated, use EngineEdge instead.
  • Trace is deprecated, use EngineTrace instead.
  • isNodeTrace is deprecated, use isEngineNodeTrace instead.

✅ Compatibility Notice:

This PR introduces NO BREAKING CHANGES and maintains full backward compatibility.
Users can continue using deprecated models until they're ready to migrate.

- create a generic `execute()` function that handles async , async and hidden promises function

- create standalone `trace()` function usage without requiring engine instantiation.

- refactor models

⚠️ Deprecation Notice:

- `NodeExecutionTrace` is deprecated,  Use `ExecutionTrace` instead.

- `NodeExecutionTraceExtractor` is deprecated. Use `ExecutionTraceExtractor` instead.

- `isNodeExecutionTrace` is deprecated. Use `isExecutionTrace` instead.
@tabkram tabkram added the deploy deploy a canary version to NPM label Feb 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 22, 2025

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
96.01% (+3.37% 🔼)
313/326
🟢 Branches
88.7% (+1.75% 🔼)
212/239
🟢 Functions
94.38% (+2.38% 🔼)
84/89
🟢 Lines
96.77% (+3.41% 🔼)
300/310
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢 trace/trace.ts 100% 100% 100% 100%
🟢
... / functionMetadata.ts
100% 75% 100% 100%
🟢
... / isAsync.ts
100% 100% 100% 100%
🟢
... / safeError.ts
100% 100% 100% 100%
🟢
... / execute.ts
100% 86.96% 100% 100%
🟢
... / traceableEngine.ts
95.5% 86.67% 96.55% 96%
🟢
... / engineNodeData.model.ts
100% 100% 100% 100%
🟢
... / engineTraceOptions.model.ts
100% 100% 100% 100%
🟢
... / executionTrace.model.ts
100% 100% 100% 100%
🟢
... / jsonQuery.ts
83.33% 80% 76.92% 85.19%
🟢
... / traceDecorator.ts
100% 100% 100% 100%

Test suite run success

73 tests passing in 9 suites.

Report generated by 🧪jest coverage report action from 2e4d89d

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: ∅
Created Version: 2.2.3-canary.54.ef121e4
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.ef121e4
Created Version: 2.2.3-canary.54.d4e19ad
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram changed the title feat: create standalone execute() and trace() functions feat: create standalone execute() and trace() functions and adapt TraceableExecution to use them Feb 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.d4e19ad
Created Version: 2.2.3-canary.54.6005c17
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram changed the title feat: create standalone execute() and trace() functions and adapt TraceableExecution to use them feat: introduce standalone execute() and trace() functions, refactor TraceableExecution to utilize them Feb 22, 2025
… functions

features:

- rename `TraceableExecution` to `TraceableEngine` to separate engine scope from standalone scope
- refactor `TraceableEngine` to use the common `trace()` function and the `execute()` behind
- doc and generate examples to ensure deprecated engin still work and supported

⚠️ Deprecation Notice:

- `TraceableExecution` is deprecated and will be removed in a future release. Use `TraceableEngine` instead.
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.6005c17
Created Version: 2.2.3-canary.54.0b86dcc
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.0b86dcc
Created Version: 2.2.3-canary.54.a12b259
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram changed the title feat: introduce standalone execute() and trace() functions, refactor TraceableExecution to utilize them feat: introduce standalone execute() and executionTrace() functions and @trace() decorator Feb 22, 2025
@tabkram tabkram changed the title feat: introduce standalone execute() and executionTrace() functions and @trace() decorator feat: introduce standalone execute() and executionTrace() functions and @trace() decorator Feb 22, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.a12b259
Created Version: 2.2.3-canary.54.31d3db9
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.31d3db9
Created Version: 2.2.3-canary.54.da35727
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.ee32e18
Created Version: 2.2.3-canary.54.2a362e5
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.2a362e5
Created Version: 2.2.3-canary.54.b776d29
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.b776d29
Created Version: 2.2.3-canary.54.a3b581c
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.a3b581c
Created Version: 2.2.3-canary.54.9d8d2a9
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.9d8d2a9
Created Version: 2.2.3-canary.54.252a612
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.252a612
Created Version: 2.2.3-canary.54.21d10ef
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram self-assigned this Feb 24, 2025
- add a unique execution uuid to  the executionTrace
- add the possibility to update executionTrace with a custom data
- add the possibility to update the context of the instantiated class with the trace (if the contextKey is specified)
- update tabkram.github.io/execution-engine documentation

✅ Compatibility Notice:

-  `metadata` are not handled in the engine ExecutionTrace for now, to avoid modifying the engine.
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.21d10ef
Created Version: 2.2.3-canary.54.392127b
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

⚠️ Deprecation Notice:

- `EdgeData` is deprecated, use `EngineEdgeData` instead.
- `NodeTrace` is deprecated, use `EngineNodeTrace` instead.
- `NodeData` is deprecated, use `EngineNodeData` instead.
- `Node` is deprecated, use `EngineNode` instead.
- `Edge` is deprecated, use `EngineEdge` instead.
- `Trace` is deprecated, use `EngineTrace` instead.
- `isNodeTrace` is deprecated, use `isEngineNodeTrace` instead.
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.392127b
Created Version: 2.2.3-canary.54.4a1344b
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

…ial` transformer to maintain compatibility after adding mandatory `id: string` in `ExecutionTrace` model.

This prevents the TS2769: No overload matches this call error when executing `.run()` with a `narratives` transformer in `options?: TraceOptions<Array<any>, O>`
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.4a1344b
Created Version: 2.2.3-canary.54.f4c1c63
📦 Published on NPM: View on NPM

⚠️ Note: This version is temporary and will be unpublished on the next PR update or merge.

@tabkram tabkram merged commit 4425f7a into main Feb 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Unpublished versions: 2.2.3-canary.54.f4c1c63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy deploy a canary version to NPM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant