Skip to content

Commit ea99f7b

Browse files
committed
fix: resolve pre-existing TypeScript errors in worker and backend
Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
1 parent 308a05e commit ea99f7b

4 files changed

Lines changed: 9 additions & 27 deletions

File tree

backend/src/mcp-groups/mcp-groups.repository.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ export class McpGroupsRepository {
183183

184184
const result = await this.db.execute(query);
185185
const grouped = new Map<string, McpGroupServerRow[]>();
186-
for (const row of result.rows as McpGroupServerRow[]) {
186+
for (const row of result.rows as unknown as McpGroupServerRow[]) {
187187
const groupId = row.group_id;
188+
if (!groupId) continue;
188189
if (!grouped.has(groupId)) {
189190
grouped.set(groupId, []);
190191
}
@@ -229,7 +230,7 @@ export class McpGroupsRepository {
229230
`;
230231

231232
const result = await this.db.execute(query);
232-
return result.rows as McpGroupServerRow[];
233+
return result.rows as unknown as McpGroupServerRow[];
233234
}
234235

235236
async addServerToGroup(

worker/src/temporal/activities/error-handler.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,14 @@
88

99
import { ApplicationFailure } from '@temporalio/common';
1010
import { ValidationError } from '@shipsec/component-sdk';
11-
import type { INodeIOService } from '@shipsec/component-sdk';
11+
import type { INodeIOService, IScopedTraceService } from '@shipsec/component-sdk';
1212
import {
1313
truncateText,
1414
getErrorMessage,
1515
truncateDetails,
1616
ERROR_LOG_LIMIT,
1717
} from '../utils/string-helpers';
1818

19-
interface TraceRecorder {
20-
record(event: {
21-
type: string;
22-
timestamp: string;
23-
message?: string;
24-
error?: unknown;
25-
level: string;
26-
}): void;
27-
}
28-
2919
interface ErrorHandlerContext {
3020
actionRef: string;
3121
componentId: string;
@@ -36,7 +26,7 @@ interface ErrorHandlerContext {
3626
joinStrategy?: unknown;
3727
triggeredBy?: string;
3828
failure?: unknown;
39-
trace: TraceRecorder | undefined;
29+
trace: IScopedTraceService | undefined;
4030
nodeIO: INodeIOService | undefined;
4131
}
4232

worker/src/temporal/activities/input-validator.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,10 @@ import {
1010
ValidationError,
1111
type ComponentDefinition,
1212
type ComponentPortMetadata,
13+
type IScopedTraceService,
1314
} from '@shipsec/component-sdk';
1415
import type { InputWarning } from './spill-resolver';
1516

16-
interface TraceRecorder {
17-
record(event: {
18-
type: string;
19-
timestamp: string;
20-
message?: string;
21-
level: string;
22-
data?: unknown;
23-
}): void;
24-
}
25-
2617
/**
2718
* Validate that all required inputs are present and log trace warnings.
2819
*
@@ -32,7 +23,7 @@ export function validateRequiredInputs(
3223
warnings: InputWarning[],
3324
component: ComponentDefinition,
3425
resolvedParams: Record<string, unknown>,
35-
trace: TraceRecorder | undefined,
26+
trace: IScopedTraceService | undefined,
3627
actionRef: string,
3728
): void {
3829
// Get input port metadata to check which inputs are truly required
@@ -69,7 +60,7 @@ export function validateRequiredInputs(
6960
timestamp: new Date().toISOString(),
7061
message: `Input '${warning.target}' mapped from ${warning.sourceRef}.${warning.sourceHandle} was undefined`,
7162
level: isRequired ? 'error' : 'warn',
72-
data: warning,
63+
data: warning as unknown as Record<string, unknown>,
7364
});
7465
}
7566

worker/src/temporal/activities/run-component.activity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export async function runComponentActivity(
314314

315315
return { output, activeOutputPorts };
316316
} catch (error: unknown) {
317-
await handleComponentError(error, {
317+
return await handleComponentError(error, {
318318
actionRef: action.ref,
319319
componentId: action.componentId,
320320
activityId: activityInfo.activityId,

0 commit comments

Comments
 (0)