@cadenza.io/core 3.0.4 → 3.0.6
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/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -969,6 +969,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
emitWithMetadata(signal, ctx) {
|
|
972
|
+
var _a, _b;
|
|
972
973
|
const data = { ...ctx };
|
|
973
974
|
if (!this.task.isHidden) {
|
|
974
975
|
data.__signalEmission = {
|
|
@@ -976,13 +977,16 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
976
977
|
taskVersion: this.task.version,
|
|
977
978
|
taskExecutionId: this.id
|
|
978
979
|
};
|
|
980
|
+
const context = this.context.getMetadata();
|
|
979
981
|
data.__metadata = {
|
|
980
|
-
__routineExecId: this.routineExecId
|
|
982
|
+
__routineExecId: this.routineExecId,
|
|
983
|
+
__executionTraceId: (_b = (_a = context.__metadata) == null ? void 0 : _a.__executionTraceId) != null ? _b : context.__executionTraceId
|
|
981
984
|
};
|
|
982
985
|
}
|
|
983
986
|
this.emit(signal, data);
|
|
984
987
|
}
|
|
985
988
|
emitMetricsWithMetadata(signal, ctx) {
|
|
989
|
+
var _a, _b;
|
|
986
990
|
const data = { ...ctx };
|
|
987
991
|
if (!this.task.isHidden) {
|
|
988
992
|
data.__signalEmission = {
|
|
@@ -991,8 +995,10 @@ var GraphNode = class _GraphNode extends SignalEmitter {
|
|
|
991
995
|
taskExecutionId: this.id,
|
|
992
996
|
isMetric: true
|
|
993
997
|
};
|
|
998
|
+
const context = this.context.getMetadata();
|
|
994
999
|
data.__metadata = {
|
|
995
|
-
__routineExecId: this.routineExecId
|
|
1000
|
+
__routineExecId: this.routineExecId,
|
|
1001
|
+
__executionTraceId: (_b = (_a = context.__metadata) == null ? void 0 : _a.__executionTraceId) != null ? _b : context.__executionTraceId
|
|
996
1002
|
};
|
|
997
1003
|
}
|
|
998
1004
|
this.emitMetrics(signal, data);
|
|
@@ -1573,9 +1579,9 @@ var Task = class extends SignalEmitter {
|
|
|
1573
1579
|
isEphemeral: this.isEphemeral,
|
|
1574
1580
|
isMeta: this.isMeta,
|
|
1575
1581
|
validateInputContext: this.validateInputContext,
|
|
1576
|
-
validateOutputContext: this.validateOutputContext
|
|
1577
|
-
|
|
1578
|
-
|
|
1582
|
+
validateOutputContext: this.validateOutputContext
|
|
1583
|
+
// inputContextSchemaId: this.inputContextSchema,
|
|
1584
|
+
// outputContextSchemaId: this.outputContextSchema,
|
|
1579
1585
|
},
|
|
1580
1586
|
__taskInstance: this
|
|
1581
1587
|
});
|
|
@@ -2157,7 +2163,7 @@ var GraphRegistry = class _GraphRegistry {
|
|
|
2157
2163
|
true,
|
|
2158
2164
|
false,
|
|
2159
2165
|
true
|
|
2160
|
-
).doOn("meta.task.created")
|
|
2166
|
+
).doOn("meta.task.created");
|
|
2161
2167
|
this.tasks.set(this.registerTask.name, this.registerTask);
|
|
2162
2168
|
this.updateTaskInputSchema = Cadenza.createMetaTask(
|
|
2163
2169
|
"Update task input schema",
|
|
@@ -2370,6 +2376,9 @@ var GraphRunner = class extends SignalEmitter {
|
|
|
2370
2376
|
intent: (_j = (_i = (_h = context.__metadata) == null ? void 0 : _h.__intent) != null ? _i : context.__intent) != null ? _j : null,
|
|
2371
2377
|
context: contextData,
|
|
2372
2378
|
is_meta: isMeta
|
|
2379
|
+
},
|
|
2380
|
+
__metadata: {
|
|
2381
|
+
__executionTraceId: executionTraceId
|
|
2373
2382
|
}
|
|
2374
2383
|
});
|
|
2375
2384
|
}
|
|
@@ -2384,6 +2393,9 @@ var GraphRunner = class extends SignalEmitter {
|
|
|
2384
2393
|
previousRoutineExecution: (_l = (_k = context.__metadata) == null ? void 0 : _k.__routineExecId) != null ? _l : null,
|
|
2385
2394
|
// TODO: There is a chance this is not added to the database yet...
|
|
2386
2395
|
created: formatTimestamp(Date.now())
|
|
2396
|
+
},
|
|
2397
|
+
__metadata: {
|
|
2398
|
+
__executionTraceId: executionTraceId
|
|
2387
2399
|
}
|
|
2388
2400
|
});
|
|
2389
2401
|
}
|