@axiom-lattice/pg-stores 1.0.73 → 1.0.75
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +66 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -50
- package/dist/index.mjs.map +1 -1
- package/jest.config.js +19 -0
- package/package.json +3 -2
- package/src/__tests__/PostgreSQLWorkflowTrackingStore.test.ts +233 -0
- package/src/stores/PostgreSQLWorkflowTrackingStore.ts +59 -48
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@1.0.
|
|
2
|
+
> @axiom-lattice/pg-stores@1.0.75 build /home/runner/work/agentic/agentic/packages/pg-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m231.21 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m427.90 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 497ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m225.59 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m427.71 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 498ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m53.
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m53.
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 15121ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m53.28 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m53.28 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @axiom-lattice/pg-stores
|
|
2
2
|
|
|
3
|
+
## 1.0.75
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f5eea72: enhance wf
|
|
8
|
+
- Updated dependencies [f5eea72]
|
|
9
|
+
- @axiom-lattice/core@2.1.84
|
|
10
|
+
|
|
11
|
+
## 1.0.74
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [0edb54f]
|
|
16
|
+
- @axiom-lattice/core@2.1.83
|
|
17
|
+
|
|
3
18
|
## 1.0.73
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -708,9 +708,10 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
708
708
|
getRunSteps(runId: string): Promise<RunStep[]>;
|
|
709
709
|
getRunStepsByType(runId: string, stepType: StepType): Promise<RunStep[]>;
|
|
710
710
|
getInterruptedSteps(runId: string): Promise<RunStep[]>;
|
|
711
|
-
private mapRowToWorkflowRun;
|
|
712
|
-
private mapRowToRunStep;
|
|
713
711
|
}
|
|
712
|
+
declare function safeParse<T>(value: unknown, fallback: T): T;
|
|
713
|
+
declare function mapRowToWorkflowRun(row: any): WorkflowRun;
|
|
714
|
+
declare function mapRowToRunStep(row: any): RunStep;
|
|
714
715
|
|
|
715
716
|
/**
|
|
716
717
|
* PostgreSQL implementation of EvalStore
|
|
@@ -1605,4 +1606,4 @@ declare const evalMigrations: Migration[];
|
|
|
1605
1606
|
|
|
1606
1607
|
declare const createMenuItemsTable: Migration;
|
|
1607
1608
|
|
|
1608
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations };
|
|
1609
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.d.ts
CHANGED
|
@@ -708,9 +708,10 @@ declare class PostgreSQLWorkflowTrackingStore implements WorkflowTrackingStore {
|
|
|
708
708
|
getRunSteps(runId: string): Promise<RunStep[]>;
|
|
709
709
|
getRunStepsByType(runId: string, stepType: StepType): Promise<RunStep[]>;
|
|
710
710
|
getInterruptedSteps(runId: string): Promise<RunStep[]>;
|
|
711
|
-
private mapRowToWorkflowRun;
|
|
712
|
-
private mapRowToRunStep;
|
|
713
711
|
}
|
|
712
|
+
declare function safeParse<T>(value: unknown, fallback: T): T;
|
|
713
|
+
declare function mapRowToWorkflowRun(row: any): WorkflowRun;
|
|
714
|
+
declare function mapRowToRunStep(row: any): RunStep;
|
|
714
715
|
|
|
715
716
|
/**
|
|
716
717
|
* PostgreSQL implementation of EvalStore
|
|
@@ -1605,4 +1606,4 @@ declare const evalMigrations: Migration[];
|
|
|
1605
1606
|
|
|
1606
1607
|
declare const createMenuItemsTable: Migration;
|
|
1607
1608
|
|
|
1608
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations };
|
|
1609
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addThreadTenantId, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAssistantsTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPgStoreConfig, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,10 @@ __export(index_exports, {
|
|
|
86
86
|
createUsersTable: () => createUsersTable,
|
|
87
87
|
createWorkflowTrackingTables: () => createWorkflowTrackingTables,
|
|
88
88
|
createWorkspacesTable: () => createWorkspacesTable,
|
|
89
|
-
evalMigrations: () => evalMigrations
|
|
89
|
+
evalMigrations: () => evalMigrations,
|
|
90
|
+
mapRowToRunStep: () => mapRowToRunStep,
|
|
91
|
+
mapRowToWorkflowRun: () => mapRowToWorkflowRun,
|
|
92
|
+
safeParse: () => safeParse
|
|
90
93
|
});
|
|
91
94
|
module.exports = __toCommonJS(index_exports);
|
|
92
95
|
var import_pg22 = require("pg");
|
|
@@ -3246,7 +3249,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3246
3249
|
[runId]
|
|
3247
3250
|
);
|
|
3248
3251
|
if (result.rows.length === 0) return null;
|
|
3249
|
-
return
|
|
3252
|
+
return mapRowToWorkflowRun(result.rows[0]);
|
|
3250
3253
|
}
|
|
3251
3254
|
async updateWorkflowRun(runId, updates) {
|
|
3252
3255
|
await this.ensureInitialized();
|
|
@@ -3288,7 +3291,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3288
3291
|
`SELECT * FROM lattice_workflow_runs WHERE tenant_id = $1 AND thread_id = $2 ORDER BY created_at DESC`,
|
|
3289
3292
|
[tenantId, threadId]
|
|
3290
3293
|
);
|
|
3291
|
-
return result.rows.map(
|
|
3294
|
+
return result.rows.map(mapRowToWorkflowRun);
|
|
3292
3295
|
}
|
|
3293
3296
|
async getWorkflowRunsByAssistantId(tenantId, assistantId) {
|
|
3294
3297
|
await this.ensureInitialized();
|
|
@@ -3296,7 +3299,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3296
3299
|
`SELECT * FROM lattice_workflow_runs WHERE tenant_id = $1 AND assistant_id = $2 ORDER BY created_at DESC`,
|
|
3297
3300
|
[tenantId, assistantId]
|
|
3298
3301
|
);
|
|
3299
|
-
return result.rows.map(
|
|
3302
|
+
return result.rows.map(mapRowToWorkflowRun);
|
|
3300
3303
|
}
|
|
3301
3304
|
async getWorkflowRunsByTenantId(tenantId) {
|
|
3302
3305
|
await this.ensureInitialized();
|
|
@@ -3304,7 +3307,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3304
3307
|
`SELECT * FROM lattice_workflow_runs WHERE tenant_id = $1 ORDER BY created_at DESC`,
|
|
3305
3308
|
[tenantId]
|
|
3306
3309
|
);
|
|
3307
|
-
return result.rows.map(
|
|
3310
|
+
return result.rows.map(mapRowToWorkflowRun);
|
|
3308
3311
|
}
|
|
3309
3312
|
async createRunStep(request) {
|
|
3310
3313
|
await this.ensureInitialized();
|
|
@@ -3354,7 +3357,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3354
3357
|
[request.runId, request.stepType, request.stepName]
|
|
3355
3358
|
);
|
|
3356
3359
|
if (result.rows.length > 0) {
|
|
3357
|
-
const existing =
|
|
3360
|
+
const existing = mapRowToRunStep(result.rows[0]);
|
|
3358
3361
|
if (!existing.threadId && request.threadId) {
|
|
3359
3362
|
await this.pool.query(
|
|
3360
3363
|
`UPDATE lattice_workflow_steps SET thread_id = $1, updated_at = $2 WHERE run_id = $3 AND id = $4`,
|
|
@@ -3399,7 +3402,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3399
3402
|
`SELECT * FROM lattice_workflow_steps WHERE run_id = $1 AND id = $2`,
|
|
3400
3403
|
[runId, stepId]
|
|
3401
3404
|
);
|
|
3402
|
-
return row.rows.length > 0 ?
|
|
3405
|
+
return row.rows.length > 0 ? mapRowToRunStep(row.rows[0]) : null;
|
|
3403
3406
|
}
|
|
3404
3407
|
async getRunSteps(runId) {
|
|
3405
3408
|
await this.ensureInitialized();
|
|
@@ -3407,7 +3410,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3407
3410
|
`SELECT * FROM lattice_workflow_steps WHERE run_id = $1 ORDER BY created_at ASC`,
|
|
3408
3411
|
[runId]
|
|
3409
3412
|
);
|
|
3410
|
-
return result.rows.map(
|
|
3413
|
+
return result.rows.map(mapRowToRunStep);
|
|
3411
3414
|
}
|
|
3412
3415
|
async getRunStepsByType(runId, stepType) {
|
|
3413
3416
|
await this.ensureInitialized();
|
|
@@ -3415,7 +3418,7 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3415
3418
|
`SELECT * FROM lattice_workflow_steps WHERE run_id = $1 AND step_type = $2 ORDER BY created_at ASC`,
|
|
3416
3419
|
[runId, stepType]
|
|
3417
3420
|
);
|
|
3418
|
-
return result.rows.map(
|
|
3421
|
+
return result.rows.map(mapRowToRunStep);
|
|
3419
3422
|
}
|
|
3420
3423
|
async getInterruptedSteps(runId) {
|
|
3421
3424
|
await this.ensureInitialized();
|
|
@@ -3423,49 +3426,58 @@ var PostgreSQLWorkflowTrackingStore = class {
|
|
|
3423
3426
|
`SELECT * FROM lattice_workflow_steps WHERE run_id = $1 AND status = 'interrupted' ORDER BY created_at ASC`,
|
|
3424
3427
|
[runId]
|
|
3425
3428
|
);
|
|
3426
|
-
return result.rows.map(
|
|
3427
|
-
}
|
|
3428
|
-
mapRowToWorkflowRun(row) {
|
|
3429
|
-
return {
|
|
3430
|
-
id: row.id,
|
|
3431
|
-
tenantId: row.tenant_id,
|
|
3432
|
-
assistantId: row.assistant_id,
|
|
3433
|
-
threadId: row.thread_id,
|
|
3434
|
-
status: row.status,
|
|
3435
|
-
topologyEdges: typeof row.topology_edges === "string" ? JSON.parse(row.topology_edges) : row.topology_edges || [],
|
|
3436
|
-
totalEdges: row.total_edges,
|
|
3437
|
-
completedEdges: row.completed_edges,
|
|
3438
|
-
errorMessage: row.error_message,
|
|
3439
|
-
metadata: typeof row.metadata === "string" ? JSON.parse(row.metadata) : row.metadata || {},
|
|
3440
|
-
startedAt: row.started_at,
|
|
3441
|
-
completedAt: row.completed_at,
|
|
3442
|
-
createdAt: row.created_at,
|
|
3443
|
-
updatedAt: row.updated_at
|
|
3444
|
-
};
|
|
3445
|
-
}
|
|
3446
|
-
mapRowToRunStep(row) {
|
|
3447
|
-
return {
|
|
3448
|
-
id: row.id,
|
|
3449
|
-
runId: row.run_id,
|
|
3450
|
-
tenantId: row.tenant_id,
|
|
3451
|
-
stepType: row.step_type,
|
|
3452
|
-
stepName: row.step_name,
|
|
3453
|
-
threadId: row.thread_id,
|
|
3454
|
-
edgeFrom: row.edge_from,
|
|
3455
|
-
edgeTo: row.edge_to,
|
|
3456
|
-
edgePurpose: row.edge_purpose,
|
|
3457
|
-
input: typeof row.input === "string" ? JSON.parse(row.input) : row.input,
|
|
3458
|
-
output: typeof row.output === "string" ? JSON.parse(row.output) : row.output,
|
|
3459
|
-
status: row.status,
|
|
3460
|
-
errorMessage: row.error_message,
|
|
3461
|
-
startedAt: row.started_at,
|
|
3462
|
-
completedAt: row.completed_at,
|
|
3463
|
-
durationMs: row.duration_ms,
|
|
3464
|
-
createdAt: row.created_at,
|
|
3465
|
-
updatedAt: row.updated_at
|
|
3466
|
-
};
|
|
3429
|
+
return result.rows.map(mapRowToRunStep);
|
|
3467
3430
|
}
|
|
3468
3431
|
};
|
|
3432
|
+
function safeParse(value, fallback) {
|
|
3433
|
+
if (value === null || value === void 0) return fallback;
|
|
3434
|
+
if (typeof value !== "string") return value;
|
|
3435
|
+
try {
|
|
3436
|
+
return JSON.parse(value);
|
|
3437
|
+
} catch {
|
|
3438
|
+
return fallback;
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
function mapRowToWorkflowRun(row) {
|
|
3442
|
+
return {
|
|
3443
|
+
id: row.id,
|
|
3444
|
+
tenantId: row.tenant_id,
|
|
3445
|
+
assistantId: row.assistant_id,
|
|
3446
|
+
threadId: row.thread_id,
|
|
3447
|
+
status: row.status,
|
|
3448
|
+
topologyEdges: safeParse(row.topology_edges, []),
|
|
3449
|
+
totalEdges: row.total_edges,
|
|
3450
|
+
completedEdges: row.completed_edges,
|
|
3451
|
+
errorMessage: row.error_message,
|
|
3452
|
+
metadata: safeParse(row.metadata, {}),
|
|
3453
|
+
startedAt: row.started_at,
|
|
3454
|
+
completedAt: row.completed_at,
|
|
3455
|
+
createdAt: row.created_at,
|
|
3456
|
+
updatedAt: row.updated_at
|
|
3457
|
+
};
|
|
3458
|
+
}
|
|
3459
|
+
function mapRowToRunStep(row) {
|
|
3460
|
+
return {
|
|
3461
|
+
id: row.id,
|
|
3462
|
+
runId: row.run_id,
|
|
3463
|
+
tenantId: row.tenant_id,
|
|
3464
|
+
stepType: row.step_type,
|
|
3465
|
+
stepName: row.step_name,
|
|
3466
|
+
threadId: row.thread_id,
|
|
3467
|
+
edgeFrom: row.edge_from,
|
|
3468
|
+
edgeTo: row.edge_to,
|
|
3469
|
+
edgePurpose: row.edge_purpose,
|
|
3470
|
+
input: safeParse(row.input, void 0),
|
|
3471
|
+
output: safeParse(row.output, void 0),
|
|
3472
|
+
status: row.status,
|
|
3473
|
+
errorMessage: row.error_message,
|
|
3474
|
+
startedAt: row.started_at,
|
|
3475
|
+
completedAt: row.completed_at,
|
|
3476
|
+
durationMs: row.duration_ms,
|
|
3477
|
+
createdAt: row.created_at,
|
|
3478
|
+
updatedAt: row.updated_at
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3469
3481
|
|
|
3470
3482
|
// src/stores/PostgreSQLEvalStore.ts
|
|
3471
3483
|
var import_pg12 = require("pg");
|
|
@@ -7309,6 +7321,9 @@ function mapRowToChannelIdentityMapping(row) {
|
|
|
7309
7321
|
createUsersTable,
|
|
7310
7322
|
createWorkflowTrackingTables,
|
|
7311
7323
|
createWorkspacesTable,
|
|
7312
|
-
evalMigrations
|
|
7324
|
+
evalMigrations,
|
|
7325
|
+
mapRowToRunStep,
|
|
7326
|
+
mapRowToWorkflowRun,
|
|
7327
|
+
safeParse
|
|
7313
7328
|
});
|
|
7314
7329
|
//# sourceMappingURL=index.js.map
|