Skip to content

Commit 32be982

Browse files
committed
address comments
1 parent d635dee commit 32be982

7 files changed

Lines changed: 29 additions & 50 deletions

File tree

.agents/skills/ship/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
3-
## name: ship
2+
name: ship
43
description: Commit, push, and open a PR to staging in one shot
4+
---
55

66
# Ship Command
77

apps/sim/lib/api/contracts/tools/a2a.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { z } from 'zod'
2+
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
23
import { defineRouteContract } from '@/lib/api/contracts/types'
34

4-
const internalToolResponseSchema = z
5-
.object({
6-
success: z.boolean().optional(),
7-
output: z.unknown().optional(),
8-
error: z.string().optional(),
9-
details: z.array(z.unknown()).optional(),
10-
})
11-
.passthrough()
12-
135
const a2aBaseBodySchema = z.object({
146
agentUrl: z.string().min(1, 'Agent URL is required'),
157
apiKey: z.string().optional(),
@@ -61,7 +53,7 @@ export const a2aGetAgentCardContract = defineRouteContract({
6153
body: a2aGetAgentCardBodySchema,
6254
response: {
6355
mode: 'json',
64-
schema: internalToolResponseSchema,
56+
schema: genericToolResponseSchema,
6557
},
6658
})
6759

@@ -71,7 +63,7 @@ export const a2aSendMessageContract = defineRouteContract({
7163
body: a2aSendMessageBodySchema,
7264
response: {
7365
mode: 'json',
74-
schema: internalToolResponseSchema,
66+
schema: genericToolResponseSchema,
7567
},
7668
})
7769

@@ -81,7 +73,7 @@ export const a2aGetTaskContract = defineRouteContract({
8173
body: a2aGetTaskBodySchema,
8274
response: {
8375
mode: 'json',
84-
schema: internalToolResponseSchema,
76+
schema: genericToolResponseSchema,
8577
},
8678
})
8779

@@ -91,7 +83,7 @@ export const a2aCancelTaskContract = defineRouteContract({
9183
body: a2aCancelTaskBodySchema,
9284
response: {
9385
mode: 'json',
94-
schema: internalToolResponseSchema,
86+
schema: genericToolResponseSchema,
9587
},
9688
})
9789

@@ -101,7 +93,7 @@ export const a2aResubscribeContract = defineRouteContract({
10193
body: a2aResubscribeBodySchema,
10294
response: {
10395
mode: 'json',
104-
schema: internalToolResponseSchema,
96+
schema: genericToolResponseSchema,
10597
},
10698
})
10799

@@ -111,7 +103,7 @@ export const a2aSetPushNotificationContract = defineRouteContract({
111103
body: a2aSetPushNotificationBodySchema,
112104
response: {
113105
mode: 'json',
114-
schema: internalToolResponseSchema,
106+
schema: genericToolResponseSchema,
115107
},
116108
})
117109

@@ -121,7 +113,7 @@ export const a2aGetPushNotificationContract = defineRouteContract({
121113
body: a2aGetPushNotificationBodySchema,
122114
response: {
123115
mode: 'json',
124-
schema: internalToolResponseSchema,
116+
schema: genericToolResponseSchema,
125117
},
126118
})
127119

@@ -131,6 +123,6 @@ export const a2aDeletePushNotificationContract = defineRouteContract({
131123
body: a2aDeletePushNotificationBodySchema,
132124
response: {
133125
mode: 'json',
134-
schema: internalToolResponseSchema,
126+
schema: genericToolResponseSchema,
135127
},
136128
})
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { z } from 'zod'
2+
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
23
import { defineRouteContract } from '@/lib/api/contracts/types'
34

4-
const internalToolResponseSchema = z
5-
.object({
6-
success: z.boolean().optional(),
7-
output: z.unknown().optional(),
8-
error: z.string().optional(),
9-
details: z.array(z.unknown()).optional(),
10-
})
11-
.passthrough()
12-
135
export const cursorDownloadArtifactBodySchema = z.object({
146
apiKey: z.string().min(1, 'API key is required'),
157
agentId: z.string().min(1, 'Agent ID is required'),
@@ -22,6 +14,6 @@ export const cursorDownloadArtifactContract = defineRouteContract({
2214
body: cursorDownloadArtifactBodySchema,
2315
response: {
2416
mode: 'json',
25-
schema: internalToolResponseSchema,
17+
schema: genericToolResponseSchema,
2618
},
2719
})

apps/sim/lib/api/contracts/tools/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export * from './pipedrive'
2121
export * from './quiver'
2222
export * from './sap'
2323
export * from './search'
24+
export * from './shared'
2425
export * from './stagehand'
2526
export * from './thinking'
2627
export * from './workday'

apps/sim/lib/api/contracts/tools/quiver.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import { z } from 'zod'
2+
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
23
import { defineRouteContract } from '@/lib/api/contracts/types'
34
import { FileInputSchema } from '@/lib/uploads/utils/file-schemas'
45

5-
const internalToolResponseSchema = z
6-
.object({
7-
success: z.boolean().optional(),
8-
output: z.unknown().optional(),
9-
error: z.string().optional(),
10-
details: z.array(z.unknown()).optional(),
11-
})
12-
.passthrough()
13-
146
const quiverCommonBodySchema = z.object({
157
apiKey: z.string().min(1),
168
model: z.string().min(1),
@@ -42,7 +34,7 @@ export const quiverTextToSvgContract = defineRouteContract({
4234
body: quiverTextToSvgBodySchema,
4335
response: {
4436
mode: 'json',
45-
schema: internalToolResponseSchema,
37+
schema: genericToolResponseSchema,
4638
},
4739
})
4840

@@ -52,6 +44,6 @@ export const quiverImageToSvgContract = defineRouteContract({
5244
body: quiverImageToSvgBodySchema,
5345
response: {
5446
mode: 'json',
55-
schema: internalToolResponseSchema,
47+
schema: genericToolResponseSchema,
5648
},
5749
})

apps/sim/lib/api/contracts/tools/sap.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import { z } from 'zod'
2+
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
23
import { defineRouteContract } from '@/lib/api/contracts/types'
34

4-
const internalToolResponseSchema = z
5-
.object({
6-
success: z.boolean().optional(),
7-
output: z.unknown().optional(),
8-
error: z.string().optional(),
9-
details: z.array(z.unknown()).optional(),
10-
})
11-
.passthrough()
12-
135
const sapHttpMethodSchema = z.enum(['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'MERGE'])
146
const sapDeploymentTypeSchema = z.enum(['cloud_public', 'cloud_private', 'on_premise'])
157
const sapAuthTypeSchema = z.enum(['oauth_client_credentials', 'basic'])
@@ -278,6 +270,6 @@ export const sapS4HanaProxyContract = defineRouteContract({
278270
body: sapS4HanaProxyBodySchema,
279271
response: {
280272
mode: 'json',
281-
schema: internalToolResponseSchema,
273+
schema: genericToolResponseSchema,
282274
},
283275
})
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { z } from 'zod'
2+
3+
export const genericToolResponseSchema = z
4+
.object({
5+
success: z.boolean().optional(),
6+
output: z.unknown().optional(),
7+
error: z.string().optional(),
8+
details: z.array(z.unknown()).optional(),
9+
})
10+
.passthrough()

0 commit comments

Comments
 (0)