@pikku/kysely 0.12.6 → 0.12.8
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/CHANGELOG.md +24 -0
- package/dist/src/kysely-agent-run-service.js +59 -59
- package/dist/src/kysely-ai-storage-service.js +174 -174
- package/dist/src/kysely-channel-store.js +12 -12
- package/dist/src/kysely-credential-service.d.ts +2 -0
- package/dist/src/kysely-credential-service.js +47 -29
- package/dist/src/kysely-deployment-service.js +22 -22
- package/dist/src/kysely-eventhub-store.js +8 -8
- package/dist/src/kysely-secret-service.js +19 -19
- package/dist/src/kysely-tables.d.ts +91 -91
- package/dist/src/kysely-workflow-run-service.js +73 -73
- package/dist/src/kysely-workflow-service.js +127 -127
- package/package.json +2 -2
- package/src/kysely-agent-run-service.ts +59 -59
- package/src/kysely-ai-storage-service.ts +174 -174
- package/src/kysely-channel-store.ts +12 -12
- package/src/kysely-credential-service.ts +51 -29
- package/src/kysely-deployment-service.ts +24 -24
- package/src/kysely-eventhub-store.ts +8 -8
- package/src/kysely-secret-service.ts +19 -19
- package/src/kysely-services.test.ts +19 -18
- package/src/kysely-tables.ts +91 -91
- package/src/kysely-workflow-run-service.ts +76 -76
- package/src/kysely-workflow-service.ts +129 -129
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Generated } from 'kysely';
|
|
2
2
|
import type { WorkflowStatus, StepStatus, WorkflowVersionStatus } from '@pikku/core/workflow';
|
|
3
3
|
export interface ChannelsTable {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
channelId: string;
|
|
5
|
+
channelName: string;
|
|
6
|
+
createdAt: Generated<Date>;
|
|
7
|
+
openingData: string;
|
|
8
|
+
userSession: string | null;
|
|
9
|
+
lastWire: Generated<Date>;
|
|
10
10
|
}
|
|
11
11
|
export interface ChannelSubscriptionsTable {
|
|
12
|
-
|
|
12
|
+
channelId: string;
|
|
13
13
|
topic: string;
|
|
14
14
|
}
|
|
15
15
|
export interface WorkflowRunsTable {
|
|
16
|
-
|
|
16
|
+
workflowRunId: Generated<string>;
|
|
17
17
|
workflow: string;
|
|
18
18
|
status: WorkflowStatus;
|
|
19
19
|
input: string;
|
|
@@ -21,154 +21,154 @@ export interface WorkflowRunsTable {
|
|
|
21
21
|
error: string | null;
|
|
22
22
|
state: Generated<string>;
|
|
23
23
|
inline: Generated<boolean>;
|
|
24
|
-
|
|
24
|
+
graphHash: string | null;
|
|
25
25
|
wire: string | null;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
createdAt: Generated<Date>;
|
|
27
|
+
updatedAt: Generated<Date>;
|
|
28
28
|
}
|
|
29
29
|
export interface WorkflowStepTable {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
workflowStepId: Generated<string>;
|
|
31
|
+
workflowRunId: string;
|
|
32
|
+
stepName: string;
|
|
33
|
+
rpcName: string | null;
|
|
34
34
|
data: string | null;
|
|
35
35
|
status: Generated<StepStatus>;
|
|
36
36
|
result: string | null;
|
|
37
37
|
error: string | null;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
childRunId: string | null;
|
|
39
|
+
branchTaken: string | null;
|
|
40
40
|
retries: number | null;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
retryDelay: string | null;
|
|
42
|
+
createdAt: Generated<Date>;
|
|
43
|
+
updatedAt: Generated<Date>;
|
|
44
44
|
}
|
|
45
45
|
export interface WorkflowStepHistoryTable {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
historyId: Generated<string>;
|
|
47
|
+
workflowStepId: string;
|
|
48
48
|
status: StepStatus;
|
|
49
49
|
result: string | null;
|
|
50
50
|
error: string | null;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
createdAt: Generated<Date>;
|
|
52
|
+
runningAt: Date | null;
|
|
53
|
+
scheduledAt: Date | null;
|
|
54
|
+
succeededAt: Date | null;
|
|
55
|
+
failedAt: Date | null;
|
|
56
56
|
}
|
|
57
57
|
export interface WorkflowVersionsTable {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
workflowName: string;
|
|
59
|
+
graphHash: string;
|
|
60
60
|
graph: string;
|
|
61
61
|
source: string;
|
|
62
62
|
status: Generated<WorkflowVersionStatus>;
|
|
63
|
-
|
|
63
|
+
createdAt: Generated<Date>;
|
|
64
64
|
}
|
|
65
65
|
export interface AIThreadsTable {
|
|
66
66
|
id: string;
|
|
67
|
-
|
|
67
|
+
resourceId: string;
|
|
68
68
|
title: string | null;
|
|
69
69
|
metadata: string | null;
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
createdAt: Generated<Date>;
|
|
71
|
+
updatedAt: Generated<Date>;
|
|
72
72
|
}
|
|
73
73
|
export interface AIMessageTable {
|
|
74
74
|
id: string;
|
|
75
|
-
|
|
75
|
+
threadId: string;
|
|
76
76
|
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
77
77
|
content: string | null;
|
|
78
|
-
|
|
78
|
+
createdAt: Generated<Date>;
|
|
79
79
|
}
|
|
80
80
|
export interface AIToolCallTable {
|
|
81
81
|
id: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
threadId: string;
|
|
83
|
+
messageId: string;
|
|
84
|
+
runId: string | null;
|
|
85
|
+
toolName: string;
|
|
86
86
|
args: string;
|
|
87
87
|
result: string | null;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
approvalStatus: 'approved' | 'denied' | 'pending' | null;
|
|
89
|
+
approvalType: 'agent-call' | 'tool-call' | null;
|
|
90
|
+
agentRunId: string | null;
|
|
91
|
+
displayToolName: string | null;
|
|
92
|
+
displayArgs: string | null;
|
|
93
|
+
createdAt: Generated<Date>;
|
|
94
94
|
}
|
|
95
95
|
export interface AIWorkingMemoryTable {
|
|
96
96
|
id: string;
|
|
97
97
|
scope: string;
|
|
98
98
|
data: string;
|
|
99
|
-
|
|
99
|
+
updatedAt: Generated<Date>;
|
|
100
100
|
}
|
|
101
101
|
export interface AIRunTable {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
runId: Generated<string>;
|
|
103
|
+
agentName: string;
|
|
104
|
+
threadId: string;
|
|
105
|
+
resourceId: string;
|
|
106
106
|
status: Generated<'running' | 'suspended' | 'completed' | 'failed'>;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
errorMessage: string | null;
|
|
108
|
+
suspendReason: 'approval' | 'credential' | 'rpc-missing' | null;
|
|
109
|
+
missingRpcs: string | null;
|
|
110
|
+
usageInputTokens: Generated<number>;
|
|
111
|
+
usageOutputTokens: Generated<number>;
|
|
112
|
+
usageModel: Generated<string>;
|
|
113
|
+
createdAt: Generated<Date>;
|
|
114
|
+
updatedAt: Generated<Date>;
|
|
115
115
|
}
|
|
116
116
|
export interface PikkuDeploymentsTable {
|
|
117
|
-
|
|
117
|
+
deploymentId: string;
|
|
118
118
|
endpoint: string;
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
lastHeartbeat: Generated<Date>;
|
|
120
|
+
createdAt: Generated<Date>;
|
|
121
121
|
}
|
|
122
122
|
export interface PikkuDeploymentFunctionsTable {
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
deploymentId: string;
|
|
124
|
+
functionName: string;
|
|
125
125
|
}
|
|
126
126
|
export interface SecretsTable {
|
|
127
127
|
key: string;
|
|
128
128
|
ciphertext: string;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
wrappedDek: string;
|
|
130
|
+
keyVersion: number;
|
|
131
|
+
createdAt: Generated<Date>;
|
|
132
|
+
updatedAt: Generated<Date>;
|
|
133
133
|
}
|
|
134
134
|
export interface SecretsAuditTable {
|
|
135
135
|
id: string;
|
|
136
|
-
|
|
136
|
+
secretKey: string;
|
|
137
137
|
action: string;
|
|
138
|
-
|
|
138
|
+
performedAt: Generated<Date>;
|
|
139
139
|
}
|
|
140
140
|
export interface CredentialsTable {
|
|
141
141
|
name: string;
|
|
142
|
-
|
|
142
|
+
userId: string | null;
|
|
143
143
|
ciphertext: string;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
wrappedDek: string;
|
|
145
|
+
keyVersion: number;
|
|
146
|
+
createdAt: Generated<Date>;
|
|
147
|
+
updatedAt: Generated<Date>;
|
|
148
148
|
}
|
|
149
149
|
export interface CredentialsAuditTable {
|
|
150
150
|
id: string;
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
credentialName: string;
|
|
152
|
+
userId: string | null;
|
|
153
153
|
action: string;
|
|
154
|
-
|
|
154
|
+
performedAt: Generated<Date>;
|
|
155
155
|
}
|
|
156
156
|
export interface KyselyPikkuDB {
|
|
157
157
|
channels: ChannelsTable;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
channelSubscriptions: ChannelSubscriptionsTable;
|
|
159
|
+
workflowRuns: WorkflowRunsTable;
|
|
160
|
+
workflowStep: WorkflowStepTable;
|
|
161
|
+
workflowStepHistory: WorkflowStepHistoryTable;
|
|
162
|
+
workflowVersions: WorkflowVersionsTable;
|
|
163
|
+
aiThreads: AIThreadsTable;
|
|
164
|
+
aiMessage: AIMessageTable;
|
|
165
|
+
aiToolCall: AIToolCallTable;
|
|
166
|
+
aiWorkingMemory: AIWorkingMemoryTable;
|
|
167
|
+
aiRun: AIRunTable;
|
|
168
|
+
pikkuDeployments: PikkuDeploymentsTable;
|
|
169
|
+
pikkuDeploymentFunctions: PikkuDeploymentFunctionsTable;
|
|
170
170
|
secrets: SecretsTable;
|
|
171
|
-
|
|
171
|
+
secretsAudit: SecretsAuditTable;
|
|
172
172
|
credentials: CredentialsTable;
|
|
173
|
-
|
|
173
|
+
credentialsAudit: CredentialsAuditTable;
|
|
174
174
|
}
|
|
@@ -7,19 +7,19 @@ export class KyselyWorkflowRunService {
|
|
|
7
7
|
async listRuns(options) {
|
|
8
8
|
const { workflowName, status, limit = 50, offset = 0 } = options ?? {};
|
|
9
9
|
let query = this.db
|
|
10
|
-
.selectFrom('
|
|
10
|
+
.selectFrom('workflowRuns')
|
|
11
11
|
.select([
|
|
12
|
-
'
|
|
12
|
+
'workflowRunId',
|
|
13
13
|
'workflow',
|
|
14
14
|
'status',
|
|
15
15
|
'input',
|
|
16
16
|
'output',
|
|
17
17
|
'error',
|
|
18
18
|
'inline',
|
|
19
|
-
'
|
|
19
|
+
'graphHash',
|
|
20
20
|
'wire',
|
|
21
|
-
'
|
|
22
|
-
'
|
|
21
|
+
'createdAt',
|
|
22
|
+
'updatedAt',
|
|
23
23
|
]);
|
|
24
24
|
if (workflowName) {
|
|
25
25
|
query = query.where('workflow', '=', workflowName);
|
|
@@ -28,7 +28,7 @@ export class KyselyWorkflowRunService {
|
|
|
28
28
|
query = query.where('status', '=', status);
|
|
29
29
|
}
|
|
30
30
|
const result = await query
|
|
31
|
-
.orderBy('
|
|
31
|
+
.orderBy('createdAt', 'desc')
|
|
32
32
|
.limit(limit)
|
|
33
33
|
.offset(offset)
|
|
34
34
|
.execute();
|
|
@@ -36,21 +36,21 @@ export class KyselyWorkflowRunService {
|
|
|
36
36
|
}
|
|
37
37
|
async getRun(id) {
|
|
38
38
|
const row = await this.db
|
|
39
|
-
.selectFrom('
|
|
39
|
+
.selectFrom('workflowRuns')
|
|
40
40
|
.select([
|
|
41
|
-
'
|
|
41
|
+
'workflowRunId',
|
|
42
42
|
'workflow',
|
|
43
43
|
'status',
|
|
44
44
|
'input',
|
|
45
45
|
'output',
|
|
46
46
|
'error',
|
|
47
47
|
'inline',
|
|
48
|
-
'
|
|
48
|
+
'graphHash',
|
|
49
49
|
'wire',
|
|
50
|
-
'
|
|
51
|
-
'
|
|
50
|
+
'createdAt',
|
|
51
|
+
'updatedAt',
|
|
52
52
|
])
|
|
53
|
-
.where('
|
|
53
|
+
.where('workflowRunId', '=', id)
|
|
54
54
|
.executeTakeFirst();
|
|
55
55
|
if (!row)
|
|
56
56
|
return null;
|
|
@@ -58,99 +58,99 @@ export class KyselyWorkflowRunService {
|
|
|
58
58
|
}
|
|
59
59
|
async getRunSteps(runId) {
|
|
60
60
|
const result = await this.db
|
|
61
|
-
.selectFrom('
|
|
61
|
+
.selectFrom('workflowStep as s')
|
|
62
62
|
.select([
|
|
63
|
-
's.
|
|
64
|
-
's.
|
|
65
|
-
's.
|
|
63
|
+
's.workflowStepId',
|
|
64
|
+
's.stepName',
|
|
65
|
+
's.rpcName',
|
|
66
66
|
's.data',
|
|
67
67
|
's.status',
|
|
68
68
|
's.result',
|
|
69
69
|
's.error',
|
|
70
|
-
's.
|
|
70
|
+
's.childRunId',
|
|
71
71
|
's.retries',
|
|
72
|
-
's.
|
|
73
|
-
's.
|
|
74
|
-
's.
|
|
72
|
+
's.retryDelay',
|
|
73
|
+
's.createdAt',
|
|
74
|
+
's.updatedAt',
|
|
75
75
|
])
|
|
76
76
|
.select((eb) => eb
|
|
77
|
-
.selectFrom('
|
|
77
|
+
.selectFrom('workflowStepHistory')
|
|
78
78
|
.select(eb.fn.countAll().as('cnt'))
|
|
79
|
-
.whereRef('
|
|
80
|
-
.as('
|
|
81
|
-
.where('s.
|
|
82
|
-
.orderBy('s.
|
|
79
|
+
.whereRef('workflowStepHistory.workflowStepId', '=', 's.workflowStepId')
|
|
80
|
+
.as('attemptCount'))
|
|
81
|
+
.where('s.workflowRunId', '=', runId)
|
|
82
|
+
.orderBy('s.createdAt', 'asc')
|
|
83
83
|
.execute();
|
|
84
84
|
return result.map((row) => ({
|
|
85
|
-
stepId: row.
|
|
86
|
-
stepName: row.
|
|
87
|
-
rpcName: row.
|
|
85
|
+
stepId: row.workflowStepId,
|
|
86
|
+
stepName: row.stepName,
|
|
87
|
+
rpcName: row.rpcName ?? undefined,
|
|
88
88
|
data: parseJson(row.data),
|
|
89
89
|
status: row.status,
|
|
90
90
|
result: parseJson(row.result),
|
|
91
91
|
error: parseJson(row.error),
|
|
92
|
-
childRunId: row.
|
|
93
|
-
attemptCount: Number(row.
|
|
92
|
+
childRunId: row.childRunId ?? undefined,
|
|
93
|
+
attemptCount: Number(row.attemptCount || 1),
|
|
94
94
|
retries: row.retries != null ? Number(row.retries) : undefined,
|
|
95
|
-
retryDelay: row.
|
|
96
|
-
createdAt: new Date(row.
|
|
97
|
-
updatedAt: new Date(row.
|
|
95
|
+
retryDelay: row.retryDelay ?? undefined,
|
|
96
|
+
createdAt: new Date(row.createdAt),
|
|
97
|
+
updatedAt: new Date(row.updatedAt),
|
|
98
98
|
}));
|
|
99
99
|
}
|
|
100
100
|
async getRunHistory(runId) {
|
|
101
101
|
const result = await this.db
|
|
102
|
-
.selectFrom('
|
|
103
|
-
.innerJoin('
|
|
102
|
+
.selectFrom('workflowStep as s')
|
|
103
|
+
.innerJoin('workflowStepHistory as h', 'h.workflowStepId', 's.workflowStepId')
|
|
104
104
|
.select([
|
|
105
|
-
's.
|
|
106
|
-
's.
|
|
105
|
+
's.workflowStepId',
|
|
106
|
+
's.stepName',
|
|
107
107
|
's.retries',
|
|
108
|
-
's.
|
|
108
|
+
's.retryDelay',
|
|
109
109
|
'h.status',
|
|
110
110
|
'h.result',
|
|
111
111
|
'h.error',
|
|
112
|
-
'h.
|
|
113
|
-
'h.
|
|
114
|
-
'h.
|
|
115
|
-
'h.
|
|
116
|
-
'h.
|
|
112
|
+
'h.createdAt',
|
|
113
|
+
'h.runningAt',
|
|
114
|
+
'h.scheduledAt',
|
|
115
|
+
'h.succeededAt',
|
|
116
|
+
'h.failedAt',
|
|
117
117
|
])
|
|
118
|
-
.where('s.
|
|
119
|
-
.orderBy('h.
|
|
118
|
+
.where('s.workflowRunId', '=', runId)
|
|
119
|
+
.orderBy('h.createdAt', 'asc')
|
|
120
120
|
.execute();
|
|
121
121
|
let attemptCounters = {};
|
|
122
122
|
return result.map((row) => {
|
|
123
|
-
const stepId = row.
|
|
123
|
+
const stepId = row.workflowStepId;
|
|
124
124
|
attemptCounters[stepId] = (attemptCounters[stepId] ?? 0) + 1;
|
|
125
125
|
return {
|
|
126
126
|
stepId,
|
|
127
|
-
stepName: row.
|
|
127
|
+
stepName: row.stepName,
|
|
128
128
|
status: row.status,
|
|
129
129
|
result: parseJson(row.result),
|
|
130
130
|
error: parseJson(row.error),
|
|
131
131
|
attemptCount: attemptCounters[stepId],
|
|
132
132
|
retries: row.retries != null ? Number(row.retries) : undefined,
|
|
133
|
-
retryDelay: row.
|
|
134
|
-
createdAt: new Date(row.
|
|
135
|
-
updatedAt: new Date(row.
|
|
136
|
-
runningAt: row.
|
|
137
|
-
? new Date(row.
|
|
133
|
+
retryDelay: row.retryDelay ?? undefined,
|
|
134
|
+
createdAt: new Date(row.createdAt),
|
|
135
|
+
updatedAt: new Date(row.createdAt),
|
|
136
|
+
runningAt: row.runningAt
|
|
137
|
+
? new Date(row.runningAt)
|
|
138
138
|
: undefined,
|
|
139
|
-
scheduledAt: row.
|
|
140
|
-
? new Date(row.
|
|
139
|
+
scheduledAt: row.scheduledAt
|
|
140
|
+
? new Date(row.scheduledAt)
|
|
141
141
|
: undefined,
|
|
142
|
-
succeededAt: row.
|
|
143
|
-
? new Date(row.
|
|
142
|
+
succeededAt: row.succeededAt
|
|
143
|
+
? new Date(row.succeededAt)
|
|
144
144
|
: undefined,
|
|
145
|
-
failedAt: row.
|
|
146
|
-
? new Date(row.
|
|
145
|
+
failedAt: row.failedAt
|
|
146
|
+
? new Date(row.failedAt)
|
|
147
147
|
: undefined,
|
|
148
148
|
};
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
async getDistinctWorkflowNames() {
|
|
152
152
|
const result = await this.db
|
|
153
|
-
.selectFrom('
|
|
153
|
+
.selectFrom('workflowRuns')
|
|
154
154
|
.select('workflow')
|
|
155
155
|
.distinct()
|
|
156
156
|
.orderBy('workflow')
|
|
@@ -159,10 +159,10 @@ export class KyselyWorkflowRunService {
|
|
|
159
159
|
}
|
|
160
160
|
async getWorkflowVersion(name, graphHash) {
|
|
161
161
|
const row = await this.db
|
|
162
|
-
.selectFrom('
|
|
162
|
+
.selectFrom('workflowVersions')
|
|
163
163
|
.select(['graph', 'source'])
|
|
164
|
-
.where('
|
|
165
|
-
.where('
|
|
164
|
+
.where('workflowName', '=', name)
|
|
165
|
+
.where('graphHash', '=', graphHash)
|
|
166
166
|
.executeTakeFirst();
|
|
167
167
|
if (!row)
|
|
168
168
|
return null;
|
|
@@ -173,40 +173,40 @@ export class KyselyWorkflowRunService {
|
|
|
173
173
|
}
|
|
174
174
|
async getAIGeneratedWorkflows(agentName) {
|
|
175
175
|
let query = this.db
|
|
176
|
-
.selectFrom('
|
|
177
|
-
.select(['
|
|
176
|
+
.selectFrom('workflowVersions')
|
|
177
|
+
.select(['workflowName', 'graphHash', 'graph'])
|
|
178
178
|
.where('source', '=', 'ai-agent')
|
|
179
179
|
.where('status', '=', 'active');
|
|
180
180
|
if (agentName) {
|
|
181
|
-
query = query.where('
|
|
181
|
+
query = query.where('workflowName', 'like', `ai:${agentName}:%`);
|
|
182
182
|
}
|
|
183
183
|
const rows = await query.execute();
|
|
184
184
|
return rows.map((row) => ({
|
|
185
|
-
workflowName: row.
|
|
186
|
-
graphHash: row.
|
|
185
|
+
workflowName: row.workflowName,
|
|
186
|
+
graphHash: row.graphHash,
|
|
187
187
|
graph: parseJson(row.graph),
|
|
188
188
|
}));
|
|
189
189
|
}
|
|
190
190
|
async deleteRun(id) {
|
|
191
191
|
const result = await this.db
|
|
192
|
-
.deleteFrom('
|
|
193
|
-
.where('
|
|
192
|
+
.deleteFrom('workflowRuns')
|
|
193
|
+
.where('workflowRunId', '=', id)
|
|
194
194
|
.executeTakeFirst();
|
|
195
195
|
return BigInt(result.numDeletedRows) > 0n;
|
|
196
196
|
}
|
|
197
197
|
mapRunRow(row) {
|
|
198
198
|
return {
|
|
199
|
-
id: row.
|
|
199
|
+
id: row.workflowRunId,
|
|
200
200
|
workflow: row.workflow,
|
|
201
201
|
status: row.status,
|
|
202
202
|
input: parseJson(row.input),
|
|
203
203
|
output: parseJson(row.output),
|
|
204
204
|
error: parseJson(row.error),
|
|
205
205
|
inline: row.inline,
|
|
206
|
-
graphHash: row.
|
|
206
|
+
graphHash: row.graphHash,
|
|
207
207
|
wire: parseJson(row.wire) ?? { type: 'unknown' },
|
|
208
|
-
createdAt: new Date(row.
|
|
209
|
-
updatedAt: new Date(row.
|
|
208
|
+
createdAt: new Date(row.createdAt),
|
|
209
|
+
updatedAt: new Date(row.updatedAt),
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|