@decaf-ts/integrations 0.6.2 → 0.8.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.
- package/dist/integrations.cjs +1 -1
- package/jest.config.cjs +10 -0
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +23 -2
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +76 -0
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +29 -4
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/index.cjs +1 -0
- package/lib/cjs/graph/index.cjs.map +1 -1
- package/lib/cjs/graph/log/GraphRunLogger.cjs +142 -0
- package/lib/cjs/graph/log/GraphRunLogger.cjs.map +1 -0
- package/lib/cjs/graph/log/LogParameters.cjs +73 -0
- package/lib/cjs/graph/log/LogParameters.cjs.map +1 -0
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs +97 -0
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs.map +1 -0
- package/lib/cjs/graph/shared/constants.cjs +56 -1
- package/lib/cjs/graph/shared/constants.cjs.map +1 -1
- package/lib/cjs/graph/shared/index.cjs +9 -1
- package/lib/cjs/graph/shared/index.cjs.map +1 -1
- package/lib/cjs/graph/shared/nodes/flow-control.cjs +50 -6
- package/lib/cjs/graph/shared/nodes/flow-control.cjs.map +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs +1 -1
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +4 -3
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs +1 -5
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs.map +1 -1
- package/lib/cjs/sftp/aws/AwsSftpService.cjs +120 -0
- package/lib/cjs/sftp/aws/AwsSftpService.cjs.map +1 -0
- package/lib/cjs/sftp/core/SftpSource.cjs +29 -0
- package/lib/cjs/sftp/core/SftpSource.cjs.map +1 -0
- package/lib/cjs/sftp/core/index.cjs +19 -0
- package/lib/cjs/sftp/core/index.cjs.map +1 -0
- package/lib/cjs/sftp/index.cjs +21 -0
- package/lib/cjs/sftp/index.cjs.map +1 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs +172 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs.map +1 -0
- package/lib/cjs/user-requests/index.cjs +27 -0
- package/lib/cjs/user-requests/index.cjs.map +1 -0
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js +23 -2
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +77 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +29 -4
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/index.js +1 -0
- package/lib/esm/graph/index.js.map +1 -1
- package/lib/esm/graph/log/GraphRunLogger.js +137 -0
- package/lib/esm/graph/log/GraphRunLogger.js.map +1 -0
- package/lib/esm/graph/log/LogParameters.js +69 -0
- package/lib/esm/graph/log/LogParameters.js.map +1 -0
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js +91 -0
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js.map +1 -0
- package/lib/esm/graph/shared/constants.js +82 -3
- package/lib/esm/graph/shared/constants.js.map +1 -1
- package/lib/esm/graph/shared/index.js +6 -0
- package/lib/esm/graph/shared/index.js.map +1 -1
- package/lib/esm/graph/shared/nodes/flow-control.js +49 -5
- package/lib/esm/graph/shared/nodes/flow-control.js.map +1 -1
- package/lib/esm/index.js +3 -3
- package/lib/esm/nest/graph/GraphExecutionResultModel.js +3 -3
- package/lib/esm/nest/graph/GraphExecutionResultModel.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +4 -3
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowModel.js +3 -7
- package/lib/esm/nest/graph/GraphWorkflowModel.js.map +1 -1
- package/lib/esm/sftp/aws/AwsSftpService.js +82 -0
- package/lib/esm/sftp/aws/AwsSftpService.js.map +1 -0
- package/lib/esm/sftp/core/SftpSource.js +23 -0
- package/lib/esm/sftp/core/SftpSource.js.map +1 -0
- package/lib/esm/sftp/core/index.js +2 -0
- package/lib/esm/sftp/core/index.js.map +1 -0
- package/lib/esm/sftp/index.js +4 -0
- package/lib/esm/sftp/index.js.map +1 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js +135 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js.map +1 -0
- package/lib/esm/user-requests/index.js +10 -0
- package/lib/esm/user-requests/index.js.map +1 -0
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +12 -2
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +12 -2
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +34 -1
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +34 -1
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +16 -10
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +16 -10
- package/lib/types/graph/index.d.cts +1 -0
- package/lib/types/graph/index.d.mts +1 -0
- package/lib/types/graph/log/GraphRunLogger.d.cts +72 -0
- package/lib/types/graph/log/GraphRunLogger.d.mts +72 -0
- package/lib/types/graph/log/LogParameters.d.cts +7 -0
- package/lib/types/graph/log/LogParameters.d.mts +7 -0
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.cts +66 -0
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.mts +66 -0
- package/lib/types/graph/shared/constants.d.cts +70 -3
- package/lib/types/graph/shared/constants.d.mts +70 -3
- package/lib/types/graph/shared/index.d.cts +3 -0
- package/lib/types/graph/shared/index.d.mts +3 -0
- package/lib/types/graph/shared/nodes/flow-control.d.cts +20 -7
- package/lib/types/graph/shared/nodes/flow-control.d.mts +20 -7
- package/lib/types/graph/shared/types.d.cts +94 -5
- package/lib/types/graph/shared/types.d.mts +94 -5
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/nest/graph/GraphExecutionResultModel.d.cts +3 -3
- package/lib/types/nest/graph/GraphExecutionResultModel.d.mts +3 -3
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +3 -3
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +3 -3
- package/lib/types/nest/graph/GraphWorkflowModel.d.cts +3 -4
- package/lib/types/nest/graph/GraphWorkflowModel.d.mts +3 -4
- package/lib/types/sftp/aws/AwsSftpService.d.cts +37 -0
- package/lib/types/sftp/aws/AwsSftpService.d.mts +37 -0
- package/lib/types/sftp/core/SftpSource.d.cts +40 -0
- package/lib/types/sftp/core/SftpSource.d.mts +40 -0
- package/lib/types/sftp/core/index.d.cts +1 -0
- package/lib/types/sftp/core/index.d.mts +1 -0
- package/lib/types/sftp/index.d.cts +3 -0
- package/lib/types/sftp/index.d.mts +3 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.cts +47 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.mts +47 -0
- package/lib/types/user-requests/index.d.cts +9 -0
- package/lib/types/user-requests/index.d.mts +9 -0
- package/package.json +26 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphExecutorRegistryFactory.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphExecutorRegistryFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,yBAA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,oBAAoB;QACpB,eAAe,EAAE,CAAC,MAA4B,EAAE,EAAE;YAChD,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;YAC7E,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;YACvE,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,oBAAoB,EAAE,CAAC,CAAC;YAC/D,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,oBAAoB,EAAE,CAAC,CAAC;YAClE,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3E,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,EAAE,CAAC,CAAC;QACrE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { column, pk, table } from "@decaf-ts/core";
|
|
12
|
-
let GraphWorkflowModel = class GraphWorkflowModel extends
|
|
10
|
+
import { model } from "@decaf-ts/decorator-validation";
|
|
11
|
+
import { BaseModel, column, pk, table } from "@decaf-ts/core";
|
|
12
|
+
let GraphWorkflowModel = class GraphWorkflowModel extends BaseModel {
|
|
13
13
|
constructor(arg) {
|
|
14
14
|
super(arg);
|
|
15
15
|
}
|
|
@@ -22,10 +22,6 @@ __decorate([
|
|
|
22
22
|
column(),
|
|
23
23
|
__metadata("design:type", Object)
|
|
24
24
|
], GraphWorkflowModel.prototype, "snapshot", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
column(),
|
|
27
|
-
__metadata("design:type", Date)
|
|
28
|
-
], GraphWorkflowModel.prototype, "updatedAt", void 0);
|
|
29
25
|
GraphWorkflowModel = __decorate([
|
|
30
26
|
table("graph_workflow_snapshot"),
|
|
31
27
|
model(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphWorkflowModel.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphWorkflowModel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"GraphWorkflowModel.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphWorkflowModel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,SAAS;IAO/C,YAAY,GAAiC;QAC3C,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF,CAAA;AARC;IADC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sDACnB;AAGpB;IADC,MAAM,EAAE;;oDAC0B;AALxB,kBAAkB;IAF9B,KAAK,CAAC,yBAAyB,CAAC;IAChC,KAAK,EAAE;;GACK,kBAAkB,CAU9B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Context, } from "@decaf-ts/core";
|
|
2
|
+
import { InternalError } from "@decaf-ts/db-decorators";
|
|
3
|
+
import { SftpSource, assertSftpConfig, } from "./../core/SftpSource.js";
|
|
4
|
+
export class AwsSftpService extends SftpSource {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
async initialize(...args) {
|
|
9
|
+
const config = args[0];
|
|
10
|
+
if (!config || config instanceof Context)
|
|
11
|
+
throw new InternalError(`No configuration provided`);
|
|
12
|
+
assertSftpConfig(config);
|
|
13
|
+
if (!config.region)
|
|
14
|
+
throw new InternalError("AwsTransferSftpConfig.region is required");
|
|
15
|
+
if (!config.bucket)
|
|
16
|
+
throw new InternalError("AwsTransferSftpConfig.bucket is required");
|
|
17
|
+
const { S3Client } = await import("@aws-sdk/client-s3").catch(() => {
|
|
18
|
+
throw new InternalError("@aws-sdk/client-s3 not installed; run npm install @aws-sdk/client-s3");
|
|
19
|
+
});
|
|
20
|
+
const client = new S3Client({
|
|
21
|
+
region: config.region,
|
|
22
|
+
});
|
|
23
|
+
return { config, client };
|
|
24
|
+
}
|
|
25
|
+
s3Prefix() {
|
|
26
|
+
return this.config.s3Prefix ?? this.config.remotePath ?? "";
|
|
27
|
+
}
|
|
28
|
+
async list(remoteDir,
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
...args) {
|
|
31
|
+
const prefix = remoteDir ?? this.s3Prefix();
|
|
32
|
+
const entries = [];
|
|
33
|
+
let cursor;
|
|
34
|
+
do {
|
|
35
|
+
const page = await this.client.listObjectsV2({
|
|
36
|
+
Bucket: this.config.bucket,
|
|
37
|
+
Prefix: prefix,
|
|
38
|
+
ContinuationToken: cursor,
|
|
39
|
+
});
|
|
40
|
+
for (const obj of page.Contents ?? []) {
|
|
41
|
+
if (!obj.Key)
|
|
42
|
+
continue;
|
|
43
|
+
const name = obj.Key.split("/").pop() ?? obj.Key;
|
|
44
|
+
entries.push({
|
|
45
|
+
path: obj.Key,
|
|
46
|
+
name,
|
|
47
|
+
size: obj.Size ?? 0,
|
|
48
|
+
modifyTime: obj.LastModified?.getTime() ?? 0,
|
|
49
|
+
isDirectory: obj.Key.endsWith("/"),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
cursor = page.NextContinuationToken;
|
|
53
|
+
} while (cursor);
|
|
54
|
+
return entries;
|
|
55
|
+
}
|
|
56
|
+
async fetch(remotePath,
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
58
|
+
...args) {
|
|
59
|
+
const name = remotePath.split("/").pop() ?? remotePath;
|
|
60
|
+
const response = await this.client.getObject({
|
|
61
|
+
Bucket: this.config.bucket,
|
|
62
|
+
Key: remotePath,
|
|
63
|
+
});
|
|
64
|
+
const chunks = [];
|
|
65
|
+
for await (const chunk of response.body) {
|
|
66
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
67
|
+
}
|
|
68
|
+
const content = Buffer.concat(chunks);
|
|
69
|
+
return { path: remotePath, name, content, size: content.length };
|
|
70
|
+
}
|
|
71
|
+
async delete(remotePath,
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
...args) {
|
|
74
|
+
await this.client.deleteObject({
|
|
75
|
+
Bucket: this.config.bucket,
|
|
76
|
+
Key: remotePath,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
80
|
+
async close(...args) { }
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=AwsSftpService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AwsSftpService.js","sourceRoot":"","sources":["../../../../src/sftp/aws/AwsSftpService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAGR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,UAAU,EAIV,gBAAgB,GACjB,gCAA2B;AAqB5B,MAAM,OAAO,cAAe,SAAQ,UAGnC;IACC;QACE,KAAK,E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AAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;IAEQ,KAAK,CAAC,MAAM,CACnB,UAAkB;IAClB,6DAA6D;IAC7D,GAAG,IAA6B;QAEhC,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,GAAG,EAAE,UAAU;SAChB,CAAC,CAAC;IACL,CAAC;IAED,6DAA6D;IACpD,KAAK,CAAC,KAAK,CAAC,GAAG,IAA6B,IAAkB,CAAC;CACzE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClientBasedService, } from "@decaf-ts/core";
|
|
2
|
+
import { InternalError } from "@decaf-ts/db-decorators";
|
|
3
|
+
export class SftpSource extends ClientBasedService {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
}
|
|
7
|
+
get provider() {
|
|
8
|
+
return this.config.provider;
|
|
9
|
+
}
|
|
10
|
+
get sourceId() {
|
|
11
|
+
return this.config.sourceId;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function assertSftpConfig(config) {
|
|
15
|
+
if (!config.host)
|
|
16
|
+
throw new InternalError("SftpSourceConfig.host is required");
|
|
17
|
+
if (!config.username)
|
|
18
|
+
throw new InternalError("SftpSourceConfig.username is required");
|
|
19
|
+
if (!config.password && !config.privateKey) {
|
|
20
|
+
throw new InternalError("SftpSourceConfig requires either password or privateKey");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SftpSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SftpSource.js","sourceRoot":"","sources":["../../../../src/sftp/core/SftpSource.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA+BxD,MAAM,OAAgB,UAGpB,SAAQ,kBAAoC;IAC5C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC9B,CAAC;CAsBF;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,MAAM,IAAI,aAAa,CAAC,mCAAmC,CAAC,CAAC;IAC/E,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,MAAM,IAAI,aAAa,CAAC,uCAAuC,CAAC,CAAC;IACvF,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC3C,MAAM,IAAI,aAAa,CAAC,yDAAyD,CAAC,CAAC;IACrF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sftp/core/index.ts"],"names":[],"mappings":"AAAA,gCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sftp/index.ts"],"names":[],"mappings":"AAAA,0CAAuC;AACvC,wCAAqC;AACrC,qCAAkC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Context, } from "@decaf-ts/core";
|
|
2
|
+
import { InternalError } from "@decaf-ts/db-decorators";
|
|
3
|
+
import { SftpSource, assertSftpConfig, } from "./../core/SftpSource.js";
|
|
4
|
+
export class Ssh2SftpService extends SftpSource {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
async initialize(...args) {
|
|
9
|
+
const config = args[0];
|
|
10
|
+
if (!config || config instanceof Context)
|
|
11
|
+
throw new InternalError(`No configuration provided`);
|
|
12
|
+
assertSftpConfig(config);
|
|
13
|
+
const Client = await import("ssh2")
|
|
14
|
+
.then((m) => m.Client)
|
|
15
|
+
.catch(() => {
|
|
16
|
+
throw new InternalError("ssh2 package not installed; run npm install ssh2");
|
|
17
|
+
});
|
|
18
|
+
const client = new Client();
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
client.on("error", (err) => reject(new InternalError(`SFTP connection error: ${err.message}`)));
|
|
21
|
+
client.on("ready", () => {
|
|
22
|
+
client.sftp((err, sftp) => {
|
|
23
|
+
if (err)
|
|
24
|
+
return reject(new InternalError(`SFTP subsystem error: ${err.message}`));
|
|
25
|
+
this.sftp = sftp;
|
|
26
|
+
resolve({ config, client });
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
client.connect({
|
|
30
|
+
host: config.host,
|
|
31
|
+
port: config.port ?? 22,
|
|
32
|
+
username: config.username,
|
|
33
|
+
password: config.password,
|
|
34
|
+
privateKey: config.privateKey
|
|
35
|
+
? Buffer.from(config.privateKey)
|
|
36
|
+
: undefined,
|
|
37
|
+
passphrase: config.passphrase,
|
|
38
|
+
readyTimeout: config.readyTimeout ?? 30_000,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async list(remoteDir,
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
|
+
...args) {
|
|
45
|
+
const dir = remoteDir ?? this.config.remotePath ?? ".";
|
|
46
|
+
const sftp = this.requireSftp();
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
sftp.readdir(dir, (err, list) => {
|
|
49
|
+
if (err)
|
|
50
|
+
return reject(new InternalError(`SFTP readdir error: ${err.message}`));
|
|
51
|
+
resolve(list.map((entry) => ({
|
|
52
|
+
path: `${dir}/${entry.filename}`,
|
|
53
|
+
name: entry.filename,
|
|
54
|
+
size: entry.attrs.size,
|
|
55
|
+
modifyTime: entry.attrs.mtime * 1000,
|
|
56
|
+
isDirectory: (entry.attrs.mode & 0o170000) === 0o040000,
|
|
57
|
+
})));
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async fetch(remotePath,
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
...args) {
|
|
64
|
+
const sftp = this.requireSftp();
|
|
65
|
+
const name = remotePath.split("/").pop() ?? remotePath;
|
|
66
|
+
const stat = await new Promise((resolve, reject) => {
|
|
67
|
+
sftp.stat(remotePath, (err, st) => {
|
|
68
|
+
if (err)
|
|
69
|
+
return reject(new InternalError(`SFTP stat error: ${err.message}`));
|
|
70
|
+
resolve(st);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const handle = await new Promise((resolve, reject) => {
|
|
74
|
+
sftp.open(remotePath, "r", (err, h) => {
|
|
75
|
+
if (err)
|
|
76
|
+
return reject(new InternalError(`SFTP open error: ${err.message}`));
|
|
77
|
+
resolve(h);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
const chunkSize = 32_768;
|
|
81
|
+
const chunks = [];
|
|
82
|
+
let position = 0;
|
|
83
|
+
while (position < stat.size) {
|
|
84
|
+
const buf = Buffer.alloc(Math.min(chunkSize, stat.size - position));
|
|
85
|
+
const bytesRead = await new Promise((resolve, reject) => {
|
|
86
|
+
sftp.read(handle, buf, 0, buf.length, position, (err, n) => {
|
|
87
|
+
if (err)
|
|
88
|
+
return reject(new InternalError(`SFTP read error: ${err.message}`));
|
|
89
|
+
resolve(n);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
chunks.push(Buffer.from(buf.buffer, 0, bytesRead));
|
|
93
|
+
position += bytesRead;
|
|
94
|
+
if (bytesRead === 0)
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
await new Promise((resolve, reject) => {
|
|
98
|
+
sftp.close(handle, (err) => {
|
|
99
|
+
if (err)
|
|
100
|
+
return reject(new InternalError(`SFTP close error: ${err.message}`));
|
|
101
|
+
resolve();
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
path: remotePath,
|
|
106
|
+
name,
|
|
107
|
+
content: Buffer.concat(chunks),
|
|
108
|
+
size: stat.size,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async delete(remotePath,
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
113
|
+
...args) {
|
|
114
|
+
const sftp = this.requireSftp();
|
|
115
|
+
return new Promise((resolve, reject) => {
|
|
116
|
+
sftp.unlink(remotePath, (err) => {
|
|
117
|
+
if (err)
|
|
118
|
+
return reject(new InternalError(`SFTP unlink error: ${err.message}`));
|
|
119
|
+
resolve();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
124
|
+
async close(...args) {
|
|
125
|
+
this.sftp?.end();
|
|
126
|
+
this.client?.end();
|
|
127
|
+
this.sftp = undefined;
|
|
128
|
+
}
|
|
129
|
+
requireSftp() {
|
|
130
|
+
if (!this.sftp)
|
|
131
|
+
throw new InternalError("SftpSource not initialized; call initialize() first");
|
|
132
|
+
return this.sftp;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=Ssh2SftpService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ssh2SftpService.js","sourceRoot":"","sources":["../../../../src/sftp/ssh2/Ssh2SftpService.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAGR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAA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AM,CAAC,MAAM,CAAC,MAAM,CAAC;YAC9B,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,MAAM,CACnB,UAAkB;IAClB,6DAA6D;IAC7D,GAAG,IAA6B;QAEhC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC9B,IAAI,GAAG;oBACL,OAAO,MAAM,CAAC,IAAI,aAAa,CAAC,sBAAsB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBACxE,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6DAA6D;IACpD,KAAK,CAAC,KAAK,CAAC,GAAG,IAA6B;QACnD,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACxB,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI;YACZ,MAAM,IAAI,aAAa,CACrB,qDAAqD,CACtD,CAAC;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/user-requests
|
|
3
|
+
* @summary User Request Resolution Engine surface exported to integrations
|
|
4
|
+
* consumers.
|
|
5
|
+
* @description Re-exports the `@decaf-ts/ui-decorators/user-requests` barrel so
|
|
6
|
+
* integrations packages can hand user-request handling to app consumers
|
|
7
|
+
* through a flat entry point.
|
|
8
|
+
*/
|
|
9
|
+
export * from '@decaf-ts/ui-decorators/user-requests';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/user-requests/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionContext
|
|
3
3
|
* @summary Decaf Context for graph node execution.
|
|
4
|
-
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline.
|
|
4
|
+
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline. Each context also exposes a run-scoped `ctx.logger` (DECAF-48 §4.3) bound to the executing node's `runId` / `workflowId` / `nodeId` / `user`, so every log line streams over `graph.run.log` with the DECAF-9 custom attributes.
|
|
5
5
|
*/
|
|
6
6
|
import { Context } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphNodeDefinition, GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
8
|
+
import type { Logger } from "@decaf-ts/logging";
|
|
8
9
|
import type { GraphExecutionEvent, GraphRunId } from "../types.d.cts";
|
|
9
10
|
/**
|
|
10
11
|
* Context passed to every graph node executor.
|
|
@@ -12,7 +13,8 @@ import type { GraphExecutionEvent, GraphRunId } from "../types.d.cts";
|
|
|
12
13
|
* Mirrors the `TaskEngine` / `TaskContext` pattern: the engine creates a
|
|
13
14
|
* `GraphExecutionContext` per node execution and passes it to
|
|
14
15
|
* `executor.execute(inputs, context)`. The executor uses `context.progress(...)`
|
|
15
|
-
* and `context.log(...)` to report intermediate state.
|
|
16
|
+
* and `context.log(...)` to report intermediate state, and `context.logger`
|
|
17
|
+
* to emit structured run log lines (DECAF-48 §4.3).
|
|
16
18
|
*/
|
|
17
19
|
export declare class GraphExecutionContext extends Context {
|
|
18
20
|
readonly runId: GraphRunId;
|
|
@@ -22,6 +24,7 @@ export declare class GraphExecutionContext extends Context {
|
|
|
22
24
|
readonly path: string[];
|
|
23
25
|
private readonly emitFn;
|
|
24
26
|
readonly metadata: Record<string, unknown>;
|
|
27
|
+
private readonly runLogger?;
|
|
25
28
|
/**
|
|
26
29
|
* @param runId - Unique identifier for the current execution run.
|
|
27
30
|
* @param parentRunId - Run id of the parent execution (for nested loop bodies).
|
|
@@ -32,6 +35,13 @@ export declare class GraphExecutionContext extends Context {
|
|
|
32
35
|
* @param metadata - Free-form metadata attached to this context.
|
|
33
36
|
*/
|
|
34
37
|
constructor(runId: GraphRunId, parentRunId: GraphRunId | undefined, workflow: GraphWorkflowDefinition, node: GraphNodeDefinition, path: string[], emitFn: (event: Partial<GraphExecutionEvent>) => Promise<void>, metadata?: Record<string, unknown>);
|
|
38
|
+
/**
|
|
39
|
+
* The decaf-ts {@link Logger} bound to this node's run context. Every log
|
|
40
|
+
* line carries the DECAF-48 attributes (`nodeId` / `workflowId` / `runId` /
|
|
41
|
+
* `user`) and is forwarded onto the existing graph execution Observable as
|
|
42
|
+
* a `GRAPH_RUN_LOG` event (streamed over the `graph.run.log` SSE channel).
|
|
43
|
+
*/
|
|
44
|
+
get logger(): Logger;
|
|
35
45
|
/**
|
|
36
46
|
* Emits a partial graph execution event. The engine fills in runId,
|
|
37
47
|
* parentRunId, workflowId, nodeId, and path automatically.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionContext
|
|
3
3
|
* @summary Decaf Context for graph node execution.
|
|
4
|
-
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline.
|
|
4
|
+
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline. Each context also exposes a run-scoped `ctx.logger` (DECAF-48 §4.3) bound to the executing node's `runId` / `workflowId` / `nodeId` / `user`, so every log line streams over `graph.run.log` with the DECAF-9 custom attributes.
|
|
5
5
|
*/
|
|
6
6
|
import { Context } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphNodeDefinition, GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
8
|
+
import type { Logger } from "@decaf-ts/logging";
|
|
8
9
|
import type { GraphExecutionEvent, GraphRunId } from "../types.d.mts";
|
|
9
10
|
/**
|
|
10
11
|
* Context passed to every graph node executor.
|
|
@@ -12,7 +13,8 @@ import type { GraphExecutionEvent, GraphRunId } from "../types.d.mts";
|
|
|
12
13
|
* Mirrors the `TaskEngine` / `TaskContext` pattern: the engine creates a
|
|
13
14
|
* `GraphExecutionContext` per node execution and passes it to
|
|
14
15
|
* `executor.execute(inputs, context)`. The executor uses `context.progress(...)`
|
|
15
|
-
* and `context.log(...)` to report intermediate state.
|
|
16
|
+
* and `context.log(...)` to report intermediate state, and `context.logger`
|
|
17
|
+
* to emit structured run log lines (DECAF-48 §4.3).
|
|
16
18
|
*/
|
|
17
19
|
export declare class GraphExecutionContext extends Context {
|
|
18
20
|
readonly runId: GraphRunId;
|
|
@@ -22,6 +24,7 @@ export declare class GraphExecutionContext extends Context {
|
|
|
22
24
|
readonly path: string[];
|
|
23
25
|
private readonly emitFn;
|
|
24
26
|
readonly metadata: Record<string, unknown>;
|
|
27
|
+
private readonly runLogger?;
|
|
25
28
|
/**
|
|
26
29
|
* @param runId - Unique identifier for the current execution run.
|
|
27
30
|
* @param parentRunId - Run id of the parent execution (for nested loop bodies).
|
|
@@ -32,6 +35,13 @@ export declare class GraphExecutionContext extends Context {
|
|
|
32
35
|
* @param metadata - Free-form metadata attached to this context.
|
|
33
36
|
*/
|
|
34
37
|
constructor(runId: GraphRunId, parentRunId: GraphRunId | undefined, workflow: GraphWorkflowDefinition, node: GraphNodeDefinition, path: string[], emitFn: (event: Partial<GraphExecutionEvent>) => Promise<void>, metadata?: Record<string, unknown>);
|
|
38
|
+
/**
|
|
39
|
+
* The decaf-ts {@link Logger} bound to this node's run context. Every log
|
|
40
|
+
* line carries the DECAF-48 attributes (`nodeId` / `workflowId` / `runId` /
|
|
41
|
+
* `user`) and is forwarded onto the existing graph execution Observable as
|
|
42
|
+
* a `GRAPH_RUN_LOG` event (streamed over the `graph.run.log` SSE channel).
|
|
43
|
+
*/
|
|
44
|
+
get logger(): Logger;
|
|
35
45
|
/**
|
|
36
46
|
* Emits a partial graph execution event. The engine fills in runId,
|
|
37
47
|
* parentRunId, workflowId, nodeId, and path automatically.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionEngine
|
|
3
3
|
* @summary Reference graph execution engine.
|
|
4
|
-
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result.
|
|
4
|
+
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result. Per DECAF-48 §4.4 it also emits `NODE_STATE_CHANGED` / `EDGE_STATE_CHANGED` visual-state events on the same pipeline, and node executors log through the run-scoped `ctx.logger` (streamed over the `graph.run.log` SSE channel).
|
|
5
5
|
*/
|
|
6
6
|
import type { Observable } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
@@ -56,11 +56,33 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
56
56
|
readonly codeSandboxEvaluator?: CodeSandboxEvaluator;
|
|
57
57
|
constructor(config: GraphExecutionEngineConfig);
|
|
58
58
|
private readonly config;
|
|
59
|
+
/**
|
|
60
|
+
* Registers an observer on the engine's event pipeline.
|
|
61
|
+
*
|
|
62
|
+
* @param observer - The observer to register.
|
|
63
|
+
* @returns An unsubscribe function that removes the observer.
|
|
64
|
+
*/
|
|
59
65
|
observe(observer: GraphExecutionObserver): () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Unregisters an observer from the engine's event pipeline.
|
|
68
|
+
*
|
|
69
|
+
* @param observer - The observer to remove.
|
|
70
|
+
*/
|
|
60
71
|
unObserve(observer: GraphExecutionObserver): void;
|
|
72
|
+
/**
|
|
73
|
+
* Dispatches an event to all registered observers.
|
|
74
|
+
*
|
|
75
|
+
* @param event - The event to distribute.
|
|
76
|
+
*/
|
|
61
77
|
updateObservers(event: GraphExecutionEvent): Promise<void>;
|
|
62
78
|
/**
|
|
63
79
|
* Executes a workflow with the given inputs and options.
|
|
80
|
+
*
|
|
81
|
+
* @param workflow - The workflow definition to execute.
|
|
82
|
+
* @param inputs - Workflow input values keyed by input port name.
|
|
83
|
+
* @param options - Optional execution overrides (merged over the defaults).
|
|
84
|
+
* @returns The complete execution result, including a `runId`, per-node
|
|
85
|
+
* results, and workflow outputs (or the failure payload).
|
|
64
86
|
*/
|
|
65
87
|
execute(workflow: GraphWorkflowDefinition, inputs?: GraphExecutionValues, options?: GraphExecutionOptions): Promise<GraphExecutionResult>;
|
|
66
88
|
/**
|
|
@@ -120,6 +142,17 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
120
142
|
* Emits an event, records it in the frame, and dispatches to observers.
|
|
121
143
|
*/
|
|
122
144
|
private emitEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
147
|
+
* visual state for the node. Rides the existing Observable pipeline; no
|
|
148
|
+
* second out-of-band channel.
|
|
149
|
+
*/
|
|
150
|
+
private emitNodeStateChanged;
|
|
151
|
+
/**
|
|
152
|
+
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
153
|
+
* visual state for a routed edge.
|
|
154
|
+
*/
|
|
155
|
+
private emitEdgeStateChanged;
|
|
123
156
|
/**
|
|
124
157
|
* Merges default options with the given options.
|
|
125
158
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionEngine
|
|
3
3
|
* @summary Reference graph execution engine.
|
|
4
|
-
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result.
|
|
4
|
+
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result. Per DECAF-48 §4.4 it also emits `NODE_STATE_CHANGED` / `EDGE_STATE_CHANGED` visual-state events on the same pipeline, and node executors log through the run-scoped `ctx.logger` (streamed over the `graph.run.log` SSE channel).
|
|
5
5
|
*/
|
|
6
6
|
import type { Observable } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
@@ -56,11 +56,33 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
56
56
|
readonly codeSandboxEvaluator?: CodeSandboxEvaluator;
|
|
57
57
|
constructor(config: GraphExecutionEngineConfig);
|
|
58
58
|
private readonly config;
|
|
59
|
+
/**
|
|
60
|
+
* Registers an observer on the engine's event pipeline.
|
|
61
|
+
*
|
|
62
|
+
* @param observer - The observer to register.
|
|
63
|
+
* @returns An unsubscribe function that removes the observer.
|
|
64
|
+
*/
|
|
59
65
|
observe(observer: GraphExecutionObserver): () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Unregisters an observer from the engine's event pipeline.
|
|
68
|
+
*
|
|
69
|
+
* @param observer - The observer to remove.
|
|
70
|
+
*/
|
|
60
71
|
unObserve(observer: GraphExecutionObserver): void;
|
|
72
|
+
/**
|
|
73
|
+
* Dispatches an event to all registered observers.
|
|
74
|
+
*
|
|
75
|
+
* @param event - The event to distribute.
|
|
76
|
+
*/
|
|
61
77
|
updateObservers(event: GraphExecutionEvent): Promise<void>;
|
|
62
78
|
/**
|
|
63
79
|
* Executes a workflow with the given inputs and options.
|
|
80
|
+
*
|
|
81
|
+
* @param workflow - The workflow definition to execute.
|
|
82
|
+
* @param inputs - Workflow input values keyed by input port name.
|
|
83
|
+
* @param options - Optional execution overrides (merged over the defaults).
|
|
84
|
+
* @returns The complete execution result, including a `runId`, per-node
|
|
85
|
+
* results, and workflow outputs (or the failure payload).
|
|
64
86
|
*/
|
|
65
87
|
execute(workflow: GraphWorkflowDefinition, inputs?: GraphExecutionValues, options?: GraphExecutionOptions): Promise<GraphExecutionResult>;
|
|
66
88
|
/**
|
|
@@ -120,6 +142,17 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
120
142
|
* Emits an event, records it in the frame, and dispatches to observers.
|
|
121
143
|
*/
|
|
122
144
|
private emitEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
147
|
+
* visual state for the node. Rides the existing Observable pipeline; no
|
|
148
|
+
* second out-of-band channel.
|
|
149
|
+
*/
|
|
150
|
+
private emitNodeStateChanged;
|
|
151
|
+
/**
|
|
152
|
+
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
153
|
+
* visual state for a routed edge.
|
|
154
|
+
*/
|
|
155
|
+
private emitEdgeStateChanged;
|
|
123
156
|
/**
|
|
124
157
|
* Merges default options with the given options.
|
|
125
158
|
*/
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module integrations/graph/execution/LogGraphNodeExecutor
|
|
3
|
-
* @summary Executor for the Log flow-control node.
|
|
4
|
-
* @description Logs the input value via the execution context's logger and
|
|
5
|
-
* forwards it unchanged on the `logged` output port. Useful for debugging,
|
|
6
|
-
* audit trails, and discard/side-effect branches in a workflow.
|
|
7
|
-
*/
|
|
8
1
|
import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.cts";
|
|
9
2
|
import type { GraphExecutionContext } from "./GraphExecutionContext.d.cts";
|
|
10
3
|
import type { GraphExecutionValues } from "../types.d.cts";
|
|
11
4
|
/**
|
|
12
|
-
* Executor for `core.flow.log` nodes.
|
|
5
|
+
* Executor for `core.utility.log` / `core.flow.log` nodes.
|
|
13
6
|
*
|
|
14
|
-
* Reads the `value` input port, logs it through `context.
|
|
15
|
-
* it unchanged on the `logged` output port.
|
|
7
|
+
* Reads the `value` input port, logs it through `context.logger` at the
|
|
8
|
+
* configured level, and returns it unchanged on the `logged` output port.
|
|
16
9
|
*/
|
|
17
10
|
export declare class LogGraphNodeExecutor implements GraphNodeExecutor {
|
|
11
|
+
/**
|
|
12
|
+
* Logs the `value` input through the run's `ctx.logger` and forwards it
|
|
13
|
+
* unchanged on the `logged` output port.
|
|
14
|
+
*
|
|
15
|
+
* The level is read from the node's UI config (`node.props.level`, see
|
|
16
|
+
* {@link logLevelOf}) and defaults to `info`. The emitted log line carries
|
|
17
|
+
* the DECAF-48 run attributes and streams over `graph.run.log` through the
|
|
18
|
+
* shared `ctx.logger` path (DECAF-48 Req-1).
|
|
19
|
+
*
|
|
20
|
+
* @param input - Resolved input values keyed by port name (expects `value`).
|
|
21
|
+
* @param context - The run-scoped execution context exposing `ctx.logger`.
|
|
22
|
+
* @returns The node's output values keyed by port name (the `logged` port).
|
|
23
|
+
*/
|
|
18
24
|
execute(input: GraphExecutionValues, context: GraphExecutionContext): Promise<GraphExecutionValues>;
|
|
19
25
|
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module integrations/graph/execution/LogGraphNodeExecutor
|
|
3
|
-
* @summary Executor for the Log flow-control node.
|
|
4
|
-
* @description Logs the input value via the execution context's logger and
|
|
5
|
-
* forwards it unchanged on the `logged` output port. Useful for debugging,
|
|
6
|
-
* audit trails, and discard/side-effect branches in a workflow.
|
|
7
|
-
*/
|
|
8
1
|
import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.mts";
|
|
9
2
|
import type { GraphExecutionContext } from "./GraphExecutionContext.d.mts";
|
|
10
3
|
import type { GraphExecutionValues } from "../types.d.mts";
|
|
11
4
|
/**
|
|
12
|
-
* Executor for `core.flow.log` nodes.
|
|
5
|
+
* Executor for `core.utility.log` / `core.flow.log` nodes.
|
|
13
6
|
*
|
|
14
|
-
* Reads the `value` input port, logs it through `context.
|
|
15
|
-
* it unchanged on the `logged` output port.
|
|
7
|
+
* Reads the `value` input port, logs it through `context.logger` at the
|
|
8
|
+
* configured level, and returns it unchanged on the `logged` output port.
|
|
16
9
|
*/
|
|
17
10
|
export declare class LogGraphNodeExecutor implements GraphNodeExecutor {
|
|
11
|
+
/**
|
|
12
|
+
* Logs the `value` input through the run's `ctx.logger` and forwards it
|
|
13
|
+
* unchanged on the `logged` output port.
|
|
14
|
+
*
|
|
15
|
+
* The level is read from the node's UI config (`node.props.level`, see
|
|
16
|
+
* {@link logLevelOf}) and defaults to `info`. The emitted log line carries
|
|
17
|
+
* the DECAF-48 run attributes and streams over `graph.run.log` through the
|
|
18
|
+
* shared `ctx.logger` path (DECAF-48 Req-1).
|
|
19
|
+
*
|
|
20
|
+
* @param input - Resolved input values keyed by port name (expects `value`).
|
|
21
|
+
* @param context - The run-scoped execution context exposing `ctx.logger`.
|
|
22
|
+
* @returns The node's output values keyed by port name (the `logged` port).
|
|
23
|
+
*/
|
|
18
24
|
execute(input: GraphExecutionValues, context: GraphExecutionContext): Promise<GraphExecutionValues>;
|
|
19
25
|
}
|