@shipfox/api-integration-core 6.0.0 → 7.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/api-integration-core",
3
3
  "license": "MIT",
4
- "version": "6.0.0",
4
+ "version": "7.1.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -28,47 +28,30 @@
28
28
  "drizzle-orm": "^0.45.2",
29
29
  "zod": "^4.4.3",
30
30
  "@shipfox/api-agent-dto": "6.0.0",
31
- "@shipfox/api-auth-context": "6.0.0",
31
+ "@shipfox/api-auth-context": "7.1.0",
32
32
  "@shipfox/api-workflows-dto": "6.0.0",
33
33
  "@shipfox/api-integration-core-dto": "6.0.0",
34
34
  "@shipfox/api-workspaces-dto": "6.0.0",
35
- "@shipfox/api-integration-gitea": "6.0.0",
36
- "@shipfox/api-integration-github": "6.0.0",
37
- "@shipfox/api-integration-jira": "6.0.0",
38
- "@shipfox/api-integration-linear": "6.0.0",
39
- "@shipfox/api-integration-sentry": "6.0.0",
40
- "@shipfox/api-integration-slack": "6.0.0",
41
- "@shipfox/api-integration-webhook": "6.0.0",
35
+ "@shipfox/api-integration-gitea": "7.1.0",
36
+ "@shipfox/api-integration-github": "7.1.0",
37
+ "@shipfox/api-integration-jira": "7.1.0",
38
+ "@shipfox/api-integration-linear": "7.1.0",
39
+ "@shipfox/api-integration-sentry": "7.1.0",
40
+ "@shipfox/api-integration-slack": "7.1.0",
41
+ "@shipfox/api-integration-webhook": "7.1.0",
42
42
  "@shipfox/config": "1.2.2",
43
43
  "@shipfox/inter-module": "0.2.0",
44
44
  "@shipfox/node-drizzle": "0.3.2",
45
- "@shipfox/node-fastify": "0.2.4",
46
- "@shipfox/node-module": "0.4.0",
47
- "@shipfox/node-opentelemetry": "0.5.2",
45
+ "@shipfox/node-fastify": "0.3.0",
46
+ "@shipfox/node-module": "0.5.0",
47
+ "@shipfox/node-opentelemetry": "0.6.0",
48
+ "@shipfox/node-error-monitoring": "0.2.0",
48
49
  "@shipfox/node-outbox": "0.2.4",
49
50
  "@shipfox/node-postgres": "0.4.2",
50
- "@shipfox/node-temporal": "0.3.2",
51
+ "@shipfox/node-temporal": "0.4.0",
51
52
  "@shipfox/regex": "0.2.2",
52
53
  "@shipfox/redact": "0.2.3"
53
54
  },
54
- "devDependencies": {
55
- "@temporalio/activity": "1.18.1",
56
- "@temporalio/client": "1.18.1",
57
- "@temporalio/common": "1.18.1",
58
- "@temporalio/testing": "1.18.1",
59
- "@temporalio/worker": "1.18.1",
60
- "@types/pg": "^8.15.5",
61
- "drizzle-kit": "^0.31.10",
62
- "fastify": "^5.3.3",
63
- "fastify-type-provider-zod": "^6.0.0",
64
- "fishery": "^2.4.0",
65
- "@shipfox/biome": "1.8.2",
66
- "@shipfox/depcruise": "1.0.2",
67
- "@shipfox/swc": "1.2.6",
68
- "@shipfox/ts-config": "1.3.8",
69
- "@shipfox/typescript": "1.1.7",
70
- "@shipfox/vitest": "1.2.3"
71
- },
72
55
  "scripts": {
73
56
  "build": "shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js",
74
57
  "check": "shipfox-biome-check",
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  } from '@shipfox/api-integration-core-dto';
10
10
  import type {WorkflowsModuleClient} from '@shipfox/api-workflows-dto/inter-module';
11
11
  import type {WorkspacesInterModuleClient} from '@shipfox/api-workspaces-dto/inter-module';
12
+ import {reportError} from '@shipfox/node-error-monitoring';
12
13
  import type {ModuleService, ShipfoxModule} from '@shipfox/node-module';
13
14
  import {logger} from '@shipfox/node-opentelemetry';
14
15
  import type {IntegrationProvider} from '#core/entities/provider.js';
@@ -225,6 +226,7 @@ export async function createIntegrationsContext(
225
226
  await task();
226
227
  } catch (error) {
227
228
  logger().error({err: error}, 'Integration startup task failed, continuing boot');
229
+ reportError(error, {boundary: 'integration.startup'});
228
230
  }
229
231
  }
230
232
  }
@@ -1,4 +1,6 @@
1
1
  import type {CallToolResult} from '@modelcontextprotocol/sdk/types.js';
2
+ import {reportError} from '@shipfox/node-error-monitoring';
3
+ import {logger} from '@shipfox/node-opentelemetry';
2
4
  import {IntegrationProviderError} from '#core/errors.js';
3
5
  import type {
4
6
  AgentToolCatalogEntry,
@@ -48,7 +50,15 @@ async function dispatchIntegrationToolCall(
48
50
  arguments: input.arguments,
49
51
  });
50
52
  } catch (error) {
51
- return toolError(errorResult(error));
53
+ const result = errorResult(error);
54
+ if (result.code === 'provider-unavailable') {
55
+ logger().error(
56
+ {err: error, provider: input.authorizedTool.integration.provider},
57
+ 'Integration agent tool provider was unavailable',
58
+ );
59
+ reportError(error, {boundary: 'integration.agent-tool'});
60
+ }
61
+ return toolError(result);
52
62
  } finally {
53
63
  await closeSession(session);
54
64
  }
@@ -83,8 +93,10 @@ function agentToolCatalogEntry(input: IntegrationToolDispatchInput): AgentToolCa
83
93
  async function closeSession(session: {close?(): Promise<void>} | undefined): Promise<void> {
84
94
  try {
85
95
  await session?.close?.();
86
- } catch {
96
+ } catch (error) {
87
97
  // Cleanup must not mask the tool result returned to the runner.
98
+ logger().error({err: error}, 'Failed to close integration agent tool session');
99
+ reportError(error, {boundary: 'integration.agent-tool', operation: 'close-session'});
88
100
  }
89
101
  }
90
102
 
@@ -1,7 +1,9 @@
1
1
  import {StreamableHTTPServerTransport} from '@modelcontextprotocol/sdk/server/streamableHttp.js';
2
2
  import type {Transport} from '@modelcontextprotocol/sdk/shared/transport.js';
3
3
  import {AUTH_LEASED_JOB, requireLeasedJobContext} from '@shipfox/api-auth-context';
4
+ import {reportError} from '@shipfox/node-error-monitoring';
4
5
  import {defineRoute, type RouteGroup} from '@shipfox/node-fastify';
6
+ import {logger} from '@shipfox/node-opentelemetry';
5
7
  import type {IntegrationProviderRegistry} from '#core/providers/registry.js';
6
8
  import type {GetIntegrationConnectionByIdFn} from '#db/connections.js';
7
9
  import {createIntegrationToolCallRecorder} from './audit.js';
@@ -50,8 +52,20 @@ export function createAgentToolsGatewayRoutes(
50
52
 
51
53
  await server.connect(transport as unknown as Transport);
52
54
  reply.raw.on('close', () => {
53
- void transport.close();
54
- void server.close();
55
+ void transport.close().catch((error) => {
56
+ logger().error({err: error}, 'Failed to close integration agent tool transport');
57
+ reportError(error, {
58
+ boundary: 'integration.agent-tool',
59
+ operation: 'close-transport',
60
+ });
61
+ });
62
+ void server.close().catch((error) => {
63
+ logger().error({err: error}, 'Failed to close integration agent tool server');
64
+ reportError(error, {
65
+ boundary: 'integration.agent-tool',
66
+ operation: 'close-server',
67
+ });
68
+ });
55
69
  });
56
70
 
57
71
  reply.hijack();
@@ -4,6 +4,8 @@ import {
4
4
  type CallToolResult,
5
5
  ListToolsRequestSchema,
6
6
  } from '@modelcontextprotocol/sdk/types.js';
7
+ import {reportError} from '@shipfox/node-error-monitoring';
8
+ import {logger} from '@shipfox/node-opentelemetry';
7
9
  import {INVALID_METHOD_LABEL, type IntegrationToolCallRecorder, NO_METHOD_LABEL} from './audit.js';
8
10
  import type {
9
11
  AuthorizedIntegrationTool,
@@ -119,8 +121,10 @@ function recordToolCall(
119
121
  ): void {
120
122
  try {
121
123
  recordCall?.(record);
122
- } catch {
124
+ } catch (error) {
123
125
  // Audit and metrics must not affect MCP responses.
126
+ logger().error({err: error}, 'Failed to record integration agent tool audit event');
127
+ reportError(error, {boundary: 'integration.agent-tool', operation: 'audit'});
124
128
  }
125
129
  }
126
130