@takeshape/schema 11.133.4 → 11.134.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.
Files changed (42) hide show
  1. package/dist/agents.d.ts +2 -4
  2. package/dist/agents.js +99 -98
  3. package/dist/builtin-schema.js +66 -16
  4. package/dist/layers/refs.d.ts +1 -1
  5. package/dist/project-schema/latest.d.ts +6 -0
  6. package/dist/project-schema/v3.59.0.d.ts +6 -0
  7. package/dist/refs.d.ts +1 -1
  8. package/dist/resolvers/ai/abort-agent-message-response.d.ts +18 -5
  9. package/dist/resolvers/ai/abort-agent-message-response.js +4 -4
  10. package/dist/resolvers/ai/agent-chat-args.js +1 -2
  11. package/dist/resolvers/ai/agent-chat-payload.js +1 -2
  12. package/dist/resolvers/ai/agent-chat-response.d.ts +169 -37
  13. package/dist/resolvers/ai/agent-chat-response.js +11 -7
  14. package/dist/resolvers/ai/agent-generate-args.js +1 -2
  15. package/dist/resolvers/ai/agent-message-input.d.ts +73 -0
  16. package/dist/resolvers/ai/agent-message-input.js +39 -0
  17. package/dist/resolvers/ai/agent-message-output.d.ts +169 -0
  18. package/dist/resolvers/ai/agent-message-output.js +77 -0
  19. package/dist/resolvers/ai/agent-message-payload.d.ts +187 -73
  20. package/dist/resolvers/ai/agent-message-payload.js +20 -72
  21. package/dist/resolvers/ai/agent-run-mode.js +1 -2
  22. package/dist/resolvers/ai/agent-session-payload.d.ts +415 -5
  23. package/dist/resolvers/ai/agent-session-payload.js +83 -2
  24. package/dist/resolvers/ai/create-agent-session-response.d.ts +126 -23
  25. package/dist/resolvers/ai/create-agent-session-response.js +6 -11
  26. package/dist/resolvers/ai/get-agent-message-response.d.ts +592 -18
  27. package/dist/resolvers/ai/get-agent-message-response.js +43 -9
  28. package/dist/resolvers/ai/inspect-agent-response.d.ts +479 -70
  29. package/dist/resolvers/ai/inspect-agent-response.js +30 -19
  30. package/dist/resolvers/ai/send-agent-feedback-args.js +1 -2
  31. package/dist/resolvers/ai/send-agent-message-args.d.ts +8 -8
  32. package/dist/resolvers/ai/send-agent-message-args.js +2 -2
  33. package/dist/resolvers/ai/send-agent-message-response.d.ts +257 -4
  34. package/dist/resolvers/ai/send-agent-message-response.js +32 -2
  35. package/dist/resolvers/ai/types.d.ts +6 -0
  36. package/dist/resolvers/ai/types.js +1 -0
  37. package/dist/resolvers/takeshape/assets/asset.d.ts +1 -1
  38. package/dist/schemas/project-schema/latest.json +15 -0
  39. package/dist/schemas/project-schema/v3.59.0.json +15 -0
  40. package/package.json +6 -6
  41. package/dist/resolvers/ai/constants.d.ts +0 -9
  42. package/dist/resolvers/ai/constants.js +0 -9
package/dist/agents.d.ts CHANGED
@@ -19,14 +19,12 @@ export declare const EXECUTION_TYPE_CHAT = "chat";
19
19
  export declare const EXECUTION_TYPE_GENERATE = "generate";
20
20
  export declare const EXECUTION_TYPE_GRAPHQL = "graphql";
21
21
  export declare function getAgentEndStates(agent: AgentJSON, includeSuspend?: boolean): Set<string>;
22
- export declare const getSendAgentMessageShapeName: (agentName: string) => string;
23
- export declare const getAgentMessageShapeName: (inputName: string) => string;
24
22
  export declare const getCreateAgentSessionMutationName: (agentName: string) => string;
25
23
  export declare const getInspectAgentQueryName: (agentName: string) => string;
26
24
  export declare const getSendAgentFeedbackMutationName: (agentName: string) => string;
25
+ export declare const getGetAgentMessageQueryName: (agentName: string) => string;
26
+ export declare const getAbortAgentMessageMutationName: (agentName: string) => string;
27
27
  export declare const getSendAgentMessageMutationName: (inputName: string) => string;
28
- export declare const getGetAgentMessageQueryName: (inputName: string) => string;
29
- export declare const getAbortAgentMessageMutationName: (inputName: string) => string;
30
28
  export declare function getAgentFeatures(agents: AgentMap): Pick<ProjectSchemaJSON, 'queries' | 'mutations' | 'shapes'>;
31
29
  export declare function isValidAgentMutation(projectSchema: ProjectSchemaJSON, name: string): boolean;
32
30
  export declare function addAiQueries(projectSchema: ProjectSchemaJSON): ProjectSchemaJSON;
package/dist/agents.js CHANGED
@@ -5,7 +5,7 @@ import uniq from 'lodash/uniq.js';
5
5
  import upperFirst from 'lodash/upperFirst.js';
6
6
  import * as abortAgentMessageResponse from "./resolvers/ai/abort-agent-message-response.js";
7
7
  import * as agentChatPayload from "./resolvers/ai/agent-chat-payload.js";
8
- import * as createAgentSessionResponse from "./resolvers/ai/create-agent-session-response.js";
8
+ import * as agentSessionPayload from "./resolvers/ai/agent-session-payload.js";
9
9
  import * as getAgentMessageArgs from "./resolvers/ai/get-agent-message-args.js";
10
10
  import * as getAgentMessageResponse from "./resolvers/ai/get-agent-message-response.js";
11
11
  import * as inspectAgentArgs from "./resolvers/ai/inspect-agent-args.js";
@@ -60,12 +60,7 @@ export function getAgentEndStates(agent, includeSuspend = false) {
60
60
  }
61
61
  return endStates;
62
62
  }
63
- export const getSendAgentMessageShapeName = (agentName) => {
64
- return `${upperFirst(agentName)}SendAgentMessageResponse`;
65
- };
66
- export const getAgentMessageShapeName = (inputName) => {
67
- return `${upperFirst(inputName)}AgentMessage`;
68
- };
63
+ // Agent Scoped Names
69
64
  export const getCreateAgentSessionMutationName = (agentName) => {
70
65
  return `create${upperFirst(agentName)}Session`;
71
66
  };
@@ -75,21 +70,31 @@ export const getInspectAgentQueryName = (agentName) => {
75
70
  export const getSendAgentFeedbackMutationName = (agentName) => {
76
71
  return `send${upperFirst(agentName)}Feedback`;
77
72
  };
78
- export const getSendAgentMessageMutationName = (inputName) => {
79
- return `send${upperFirst(inputName)}Message`;
73
+ export const getGetAgentMessageQueryName = (agentName) => {
74
+ return `get${upperFirst(agentName)}Message`;
80
75
  };
81
- export const getGetAgentMessageQueryName = (inputName) => {
82
- return `get${upperFirst(inputName)}Message`;
76
+ export const getAbortAgentMessageMutationName = (agentName) => {
77
+ return `abort${upperFirst(agentName)}Message`;
83
78
  };
84
- export const getAbortAgentMessageMutationName = (inputName) => {
85
- return `abort${upperFirst(inputName)}Message`;
79
+ // Agent Input Scopes Names
80
+ export const getSendAgentMessageMutationName = (inputName) => {
81
+ return `send${upperFirst(inputName)}Message`;
86
82
  };
83
+ function createAssertValidName(key, result) {
84
+ const singular = key === 'shapes' ? 'shape' : key === 'mutations' ? 'mutation' : 'query';
85
+ return (name) => {
86
+ assert(result[key][name] === undefined, `Schema already has a ${singular} with the name "${name}"`);
87
+ };
88
+ }
87
89
  export function getAgentFeatures(agents) {
88
90
  const result = {
89
91
  queries: {},
90
92
  mutations: {},
91
93
  shapes: {}
92
94
  };
95
+ const assertValidShapeName = createAssertValidName('shapes', result);
96
+ const assertValidQueryName = createAssertValidName('queries', result);
97
+ const assertValidMutationName = createAssertValidName('mutations', result);
93
98
  for (const [agentName, agent] of Object.entries(agents)) {
94
99
  // Get valid return types based on states that could possibly be the end state
95
100
  // TODO In the future the agent will have a return type defined and we will instead validate
@@ -105,50 +110,113 @@ export function getAgentFeatures(agents) {
105
110
  }
106
111
  return JSON_SHAPE_NAME;
107
112
  }));
108
- const shape = returnTypes.length === 0 ? 'string' : returnTypes.length === 1 ? returnTypes[0] : JSON_SHAPE_NAME;
109
- const sendAgentMessageResponseShapeName = getSendAgentMessageShapeName(agentName);
110
- assert(result.shapes[sendAgentMessageResponseShapeName] === undefined, `Schema already has a shape with the name "${sendAgentMessageResponseShapeName}"`);
113
+ const agentOutput = returnTypes.length === 0 ? 'string' : returnTypes.length === 1 ? returnTypes[0] : JSON_SHAPE_NAME;
114
+ const agentOutputSchema = agentOutput === 'string' ? { type: 'string' } : { '@ref': agentOutput };
115
+ const agentSessionShapeName = agentSessionPayload.shapeName;
116
+ const agentMessageShapeName = getAgentMessageResponse.createUserShapeName(agentName);
117
+ assertValidShapeName(agentMessageShapeName);
118
+ result.shapes[agentMessageShapeName] = {
119
+ id: agentMessageShapeName,
120
+ name: agentMessageShapeName,
121
+ title: agentMessageShapeName,
122
+ schema: getAgentMessageResponse.createUserShapeSchema({
123
+ properties: {
124
+ output: agentOutputSchema
125
+ }
126
+ })
127
+ };
128
+ const sendAgentMessageResponseShapeName = sendAgentMessageResponse.createUserShapeName(agentName);
129
+ assertValidShapeName(sendAgentMessageResponseShapeName);
111
130
  result.shapes[sendAgentMessageResponseShapeName] = {
112
131
  id: sendAgentMessageResponseShapeName,
113
132
  name: sendAgentMessageResponseShapeName,
114
133
  title: sendAgentMessageResponseShapeName,
115
- schema: {
116
- type: 'object',
134
+ schema: sendAgentMessageResponse.createUserShapeSchema({
117
135
  properties: {
118
- ...sendAgentMessageResponse.schema.properties,
119
- output: {
120
- '@ref': shape
121
- }
122
- },
123
- required: [...sendAgentMessageResponse.schema.required],
124
- additionalProperties: false
136
+ output: agentOutputSchema
137
+ }
138
+ })
139
+ };
140
+ const inspectAgentResponseShapeName = inspectAgentResponse.createUserShapeName(agentName);
141
+ assertValidShapeName(inspectAgentResponseShapeName);
142
+ result.shapes[inspectAgentResponseShapeName] = {
143
+ id: inspectAgentResponseShapeName,
144
+ name: inspectAgentResponseShapeName,
145
+ title: inspectAgentResponseShapeName,
146
+ schema: inspectAgentResponse.createUserShapeSchema()
147
+ };
148
+ const getAgentMessageQueryName = getGetAgentMessageQueryName(agentName);
149
+ assertValidQueryName(getAgentMessageQueryName);
150
+ result.queries[getAgentMessageQueryName] = {
151
+ description: `Get a message for the ${agentName} agent`,
152
+ shape: agentMessageShapeName,
153
+ resolver: {
154
+ name: 'ai:getAgentMessage',
155
+ agentName
156
+ },
157
+ args: {
158
+ ...getAgentMessageArgs.schema
159
+ }
160
+ };
161
+ const abortAgentMessageMutationName = getAbortAgentMessageMutationName(agentName);
162
+ assertValidMutationName(abortAgentMessageMutationName);
163
+ result.mutations[abortAgentMessageMutationName] = {
164
+ description: `Abort a message for the ${agentName} agent`,
165
+ shape: abortAgentMessageResponse.shapeName,
166
+ resolver: {
167
+ name: 'ai:abortAgentMessage',
168
+ agentName
169
+ },
170
+ args: {
171
+ ...getAgentMessageArgs.schema
125
172
  }
126
173
  };
127
174
  const createAgentSessionMutationName = getCreateAgentSessionMutationName(agentName);
128
- assert(result.mutations[createAgentSessionMutationName] === undefined, `Schema already has a mutation with the name "${createAgentSessionMutationName}"`);
175
+ assertValidMutationName(createAgentSessionMutationName);
129
176
  result.mutations[createAgentSessionMutationName] = {
130
177
  description: `Create a session for the ${agentName} agent`,
131
- shape: createAgentSessionResponse.shapeName,
178
+ shape: agentSessionShapeName,
132
179
  resolver: {
133
180
  name: 'ai:createAgentSession',
134
181
  agentName
135
182
  }
136
183
  };
184
+ const inspectAgentQueryName = getInspectAgentQueryName(agentName);
185
+ assertValidQueryName(inspectAgentQueryName);
186
+ result.queries[inspectAgentQueryName] = {
187
+ description: `Inspect the ${agentName} agent`,
188
+ args: inspectAgentArgs.schema,
189
+ shape: inspectAgentResponseShapeName,
190
+ resolver: {
191
+ name: 'ai:inspectAgent',
192
+ agentName
193
+ }
194
+ };
195
+ result.mutations[getSendAgentFeedbackMutationName(agentName)] ||= {
196
+ description: `Send feedback for the ${agentName} agent`,
197
+ args: sendAgentFeedbackArgs.shapeName,
198
+ shape: 'boolean',
199
+ resolver: {
200
+ name: 'ai:sendAgentFeedback',
201
+ agentName
202
+ }
203
+ };
204
+ // This mutation can vary depending on the inputs defined, everything else is stable for the whole agent (for now)
137
205
  for (const inputConfig of agent.api.inputs) {
138
206
  if (inputConfig.type === 'mutation') {
139
207
  const inputName = inputConfig.name;
140
208
  const sendAgentMessageMutationName = getSendAgentMessageMutationName(inputName);
141
- assert(result.mutations[sendAgentMessageMutationName] === undefined, `Schema already has a mutation with the name "${sendAgentMessageMutationName}"`);
209
+ assertValidMutationName(sendAgentMessageMutationName);
142
210
  result.mutations[sendAgentMessageMutationName] = {
143
211
  description: agent.description,
144
212
  args: {
145
213
  type: 'object',
146
214
  extends: [
147
215
  {
148
- ...sendAgentMessageArgs.propertySchema,
216
+ ...sendAgentMessageArgs.shapeSchema,
149
217
  required: agent.protection?.enabled
150
- ? [...sendAgentMessageArgs.propertySchema.required, 'token']
151
- : sendAgentMessageArgs.propertySchema.required
218
+ ? [...sendAgentMessageArgs.shapeSchema.required, 'token']
219
+ : sendAgentMessageArgs.shapeSchema.required
152
220
  },
153
221
  {
154
222
  '@ref': inputConfig.args
@@ -162,75 +230,8 @@ export function getAgentFeatures(agents) {
162
230
  inputName
163
231
  }
164
232
  };
165
- const agentMessageShapeName = getAgentMessageShapeName(inputName);
166
- assert(result.shapes[agentMessageShapeName] === undefined, `Schema already has a shape with the name "${agentMessageShapeName}"`);
167
- result.shapes[agentMessageShapeName] = {
168
- id: agentMessageShapeName,
169
- name: agentMessageShapeName,
170
- title: agentMessageShapeName,
171
- schema: {
172
- type: 'object',
173
- properties: {
174
- ...getAgentMessageResponse.schema.properties,
175
- output: {
176
- '@ref': shape
177
- },
178
- input: {
179
- '@ref': inputConfig.args
180
- }
181
- },
182
- required: [...getAgentMessageResponse.schema.required],
183
- additionalProperties: false
184
- }
185
- };
186
- const getAgentMessageQueryName = getGetAgentMessageQueryName(inputName);
187
- assert(result.queries[getAgentMessageQueryName] === undefined, `Schema already has a query with the name ${getAgentMessageQueryName}`);
188
- result.queries[getAgentMessageQueryName] = {
189
- description: `Get a message for the ${agentName} agent`,
190
- shape: agentMessageShapeName,
191
- resolver: {
192
- name: 'ai:getAgentMessage',
193
- agentName
194
- },
195
- args: {
196
- ...getAgentMessageArgs.schema
197
- }
198
- };
199
- const abortAgentMessageMutationName = getAbortAgentMessageMutationName(inputName);
200
- assert(result.mutations[abortAgentMessageMutationName] === undefined, `Schema already has a mutation with the name ${abortAgentMessageMutationName}`);
201
- result.mutations[abortAgentMessageMutationName] = {
202
- description: `Abort a message for the ${agentName} agent`,
203
- shape: abortAgentMessageResponse.shapeName,
204
- resolver: {
205
- name: 'ai:abortAgentMessage',
206
- agentName
207
- },
208
- args: {
209
- ...getAgentMessageArgs.schema
210
- }
211
- };
212
233
  }
213
234
  }
214
- result.queries[getInspectAgentQueryName(agentName)] ||= {
215
- description: `Inspect the ${agentName} agent`,
216
- args: {
217
- ...inspectAgentArgs.schema
218
- },
219
- shape: inspectAgentResponse.shapeName,
220
- resolver: {
221
- name: 'ai:inspectAgent',
222
- agentName
223
- }
224
- };
225
- result.mutations[getSendAgentFeedbackMutationName(agentName)] ||= {
226
- description: `Send feedback for the ${agentName} agent`,
227
- args: sendAgentFeedbackArgs.shapeName,
228
- shape: 'boolean',
229
- resolver: {
230
- name: 'ai:sendAgentFeedback',
231
- agentName
232
- }
233
- };
234
235
  }
235
236
  return result;
236
237
  }
@@ -3,10 +3,12 @@ import * as agentChatArgs from "./resolvers/ai/agent-chat-args.js";
3
3
  import * as agentChatPayload from "./resolvers/ai/agent-chat-payload.js";
4
4
  import * as agentChatResponse from "./resolvers/ai/agent-chat-response.js";
5
5
  import * as agentGenerateArgs from "./resolvers/ai/agent-generate-args.js";
6
+ import * as agentMessageInput from "./resolvers/ai/agent-message-input.js";
7
+ import * as agentMessageOutput from "./resolvers/ai/agent-message-output.js";
8
+ import * as agentMessagePayload from "./resolvers/ai/agent-message-payload.js";
6
9
  import * as agentRunMode from "./resolvers/ai/agent-run-mode.js";
7
- import * as createAgentSessionResponse from "./resolvers/ai/create-agent-session-response.js";
10
+ import * as agentSessionPayload from "./resolvers/ai/agent-session-payload.js";
8
11
  import * as embeddingSearchArgs from "./resolvers/ai/embedding-search.js";
9
- import * as inspectAgentResponse from "./resolvers/ai/inspect-agent-response.js";
10
12
  import * as sendAgentFeedbackArgs from "./resolvers/ai/send-agent-feedback-args.js";
11
13
  import * as asset from "./resolvers/takeshape/assets/asset.js";
12
14
  import * as assetImage from "./resolvers/takeshape/assets/asset-image.js";
@@ -222,7 +224,7 @@ const builtInShapes = {
222
224
  title: 'Chat Agent Response',
223
225
  id: agentChatResponse.shapeName,
224
226
  name: agentChatResponse.shapeName,
225
- schema: agentChatResponse.schema
227
+ schema: agentChatResponse.createUserShapeSchema()
226
228
  },
227
229
  [agentChatPayload.shapeName]: {
228
230
  title: 'Chat Agent Payload',
@@ -230,29 +232,77 @@ const builtInShapes = {
230
232
  name: agentChatPayload.shapeName,
231
233
  schema: agentChatPayload.schema
232
234
  },
233
- [inspectAgentResponse.shapeName]: {
234
- title: 'Inspect Agent Response',
235
- id: inspectAgentResponse.shapeName,
236
- name: inspectAgentResponse.shapeName,
237
- schema: inspectAgentResponse.schema
238
- },
239
- [createAgentSessionResponse.shapeName]: {
240
- title: 'Create Agent Session Response',
241
- id: createAgentSessionResponse.shapeName,
242
- name: createAgentSessionResponse.shapeName,
243
- schema: createAgentSessionResponse.schema
244
- },
245
235
  [abortAgentMessageResponse.shapeName]: {
246
236
  title: 'Abort Agent Message Response',
247
237
  id: abortAgentMessageResponse.shapeName,
248
238
  name: abortAgentMessageResponse.shapeName,
249
- schema: abortAgentMessageResponse.schema
239
+ schema: abortAgentMessageResponse.shapeSchema
250
240
  },
251
241
  [sendAgentFeedbackArgs.shapeName]: {
252
242
  title: 'Send Agent Feedback Args',
253
243
  id: sendAgentFeedbackArgs.shapeName,
254
244
  name: sendAgentFeedbackArgs.shapeName,
255
245
  schema: sendAgentFeedbackArgs.schema
246
+ },
247
+ [agentMessageInput.stringInputSchema.title]: {
248
+ title: agentMessageInput.stringInputSchema.title,
249
+ id: agentMessageInput.stringInputSchema.title,
250
+ name: agentMessageInput.stringInputSchema.title,
251
+ schema: agentMessageInput.stringInputSchema
252
+ },
253
+ [agentMessageInput.unknownInputSchema.title]: {
254
+ title: agentMessageInput.unknownInputSchema.title,
255
+ id: agentMessageInput.unknownInputSchema.title,
256
+ name: agentMessageInput.unknownInputSchema.title,
257
+ schema: agentMessageInput.unknownInputSchema
258
+ },
259
+ [agentMessageInput.shapeName]: {
260
+ title: agentMessageInput.shapeSchema.title,
261
+ id: agentMessageInput.shapeSchema.title,
262
+ name: agentMessageInput.shapeSchema.title,
263
+ schema: agentMessageInput.shapeSchema
264
+ },
265
+ [agentMessageOutput.generateStateOutputSchema.title]: {
266
+ title: agentMessageOutput.generateStateOutputSchema.title,
267
+ id: agentMessageOutput.generateStateOutputSchema.title,
268
+ name: agentMessageOutput.generateStateOutputSchema.title,
269
+ schema: agentMessageOutput.generateStateOutputSchema
270
+ },
271
+ [agentMessageOutput.graphQLStateOutputSchema.title]: {
272
+ title: agentMessageOutput.graphQLStateOutputSchema.title,
273
+ id: agentMessageOutput.graphQLStateOutputSchema.title,
274
+ name: agentMessageOutput.graphQLStateOutputSchema.title,
275
+ schema: agentMessageOutput.graphQLStateOutputSchema
276
+ },
277
+ [agentMessageOutput.chatStateOutputSchema.title]: {
278
+ title: agentMessageOutput.chatStateOutputSchema.title,
279
+ id: agentMessageOutput.chatStateOutputSchema.title,
280
+ name: agentMessageOutput.chatStateOutputSchema.title,
281
+ schema: agentMessageOutput.chatStateOutputSchema
282
+ },
283
+ [agentMessageOutput.unknownStateOutputSchema.title]: {
284
+ title: agentMessageOutput.unknownStateOutputSchema.title,
285
+ id: agentMessageOutput.unknownStateOutputSchema.title,
286
+ name: agentMessageOutput.unknownStateOutputSchema.title,
287
+ schema: agentMessageOutput.unknownStateOutputSchema
288
+ },
289
+ [agentMessageOutput.shapeName]: {
290
+ title: agentMessageOutput.shapeSchema.title,
291
+ id: agentMessageOutput.shapeSchema.title,
292
+ name: agentMessageOutput.shapeSchema.title,
293
+ schema: agentMessageOutput.shapeSchema
294
+ },
295
+ [agentSessionPayload.shapeName]: {
296
+ title: agentSessionPayload.shapeSchema.title,
297
+ id: agentSessionPayload.shapeSchema.title,
298
+ name: agentSessionPayload.shapeSchema.title,
299
+ schema: agentSessionPayload.shapeSchema
300
+ },
301
+ [agentMessagePayload.shapeName]: {
302
+ title: agentMessagePayload.shapeSchema.title,
303
+ id: agentMessagePayload.shapeSchema.title,
304
+ name: agentMessagePayload.shapeSchema.title,
305
+ schema: agentMessagePayload.shapeSchema
256
306
  }
257
307
  };
258
308
  const staticSiteShapes = {
@@ -77,7 +77,7 @@ export declare function refItemToShape(shapes: ShapeMapV4_0_0, refItem: RefItem)
77
77
  /**
78
78
  * Helper fn to omit `ref` props from the target schema, and then extend it with the source schema.
79
79
  */
80
- export declare const omitRefAndExtend: (targetSchema: PropertySchemaV4_0_0, sourceSchema: PropertySchemaV4_0_0) => import("lodash").Omit<PropertySchemaV4_0_0, "$ref" | "@ref"> & PropertySchemaV4_0_0;
80
+ export declare const omitRefAndExtend: (targetSchema: PropertySchemaV4_0_0, sourceSchema: PropertySchemaV4_0_0) => import("lodash").Omit<PropertySchemaV4_0_0, "@ref" | "$ref"> & PropertySchemaV4_0_0;
81
81
  /**
82
82
  * If there is a $ref, this will insert a content schema from the top level
83
83
  * in place of the reference.
@@ -1843,6 +1843,12 @@ export interface ShapeSchemaExtends {
1843
1843
  * via the `definition` "shapeSchemaOneOf".
1844
1844
  */
1845
1845
  export interface ShapeSchemaOneOf {
1846
+ title?: string;
1847
+ description?: string;
1848
+ discriminator?: {
1849
+ propertyName: string;
1850
+ [k: string]: any;
1851
+ };
1846
1852
  oneOf: ObjectOrRefArray;
1847
1853
  }
1848
1854
  /**
@@ -1843,6 +1843,12 @@ export interface ShapeSchemaExtendsV3_59_0 {
1843
1843
  * via the `definition` "shapeSchemaOneOf".
1844
1844
  */
1845
1845
  export interface ShapeSchemaOneOfV3_59_0 {
1846
+ title?: string;
1847
+ description?: string;
1848
+ discriminator?: {
1849
+ propertyName: string;
1850
+ [k: string]: any;
1851
+ };
1846
1852
  oneOf: ObjectOrRefArrayV3_59_0;
1847
1853
  }
1848
1854
  /**
package/dist/refs.d.ts CHANGED
@@ -153,7 +153,7 @@ export declare function refSchemaToShapeSchemaPath(context: ServicesContext, ref
153
153
  /**
154
154
  * Helper fn to omit `ref` props from the target schema, and then extend it with the source schema.
155
155
  */
156
- export declare const omitRefAndExtend: (targetSchema: PropertySchema, sourceSchema: PropertySchema) => import("lodash").Omit<PropertySchema, "$ref" | "@ref"> & PropertySchema;
156
+ export declare const omitRefAndExtend: (targetSchema: PropertySchema, sourceSchema: PropertySchema) => import("lodash").Omit<PropertySchema, "@ref" | "$ref"> & PropertySchema;
157
157
  /**
158
158
  * If there is a $ref, this will insert a property schema from the top level
159
159
  * in place of the reference.
@@ -19,8 +19,21 @@ export declare const schema: {
19
19
  readonly additionalProperties: false;
20
20
  };
21
21
  export type AbortAgentMessageResponse = FromSchema<typeof schema>;
22
- export declare const validate: import("ajv").ValidateFunction<{
23
- aborted?: {
24
- messageId: string;
25
- } | undefined;
26
- }>;
22
+ export declare const shapeSchema: {
23
+ readonly type: "object";
24
+ readonly properties: {
25
+ readonly aborted: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly messageId: {
29
+ readonly type: "string";
30
+ readonly description: "The ID of the aborted deferred message";
31
+ };
32
+ };
33
+ readonly required: ["messageId"];
34
+ readonly additionalProperties: false;
35
+ };
36
+ };
37
+ readonly required: [];
38
+ readonly additionalProperties: false;
39
+ };
@@ -1,6 +1,4 @@
1
- import { createTypedValidator } from '@takeshape/json-schema';
2
- import { AI_AGENT_ABORT_AGENT_MESSAGE_RESPONSE_SHAPE_NAME } from "./constants.js";
3
- export const shapeName = AI_AGENT_ABORT_AGENT_MESSAGE_RESPONSE_SHAPE_NAME;
1
+ export const shapeName = 'TSAbortAgentMessageResponse';
4
2
  export const schema = {
5
3
  type: 'object',
6
4
  properties: {
@@ -16,4 +14,6 @@ export const schema = {
16
14
  required: [],
17
15
  additionalProperties: false
18
16
  };
19
- export const validate = createTypedValidator(schema);
17
+ export const shapeSchema = {
18
+ ...schema
19
+ };
@@ -1,6 +1,5 @@
1
1
  import { createTypedValidator } from '@takeshape/json-schema';
2
- import { AI_AGENT_CHAT_ARGS_SHAPE_NAME } from "./constants.js";
3
- export const shapeName = AI_AGENT_CHAT_ARGS_SHAPE_NAME;
2
+ export const shapeName = 'TSChatArgs';
4
3
  export const schema = {
5
4
  type: 'object',
6
5
  properties: {
@@ -1,6 +1,5 @@
1
1
  import { createTypedValidator } from '@takeshape/json-schema';
2
- import { AI_AGENT_CHAT_PAYLOAD_SHAPE_NAME } from "./constants.js";
3
- export const shapeName = AI_AGENT_CHAT_PAYLOAD_SHAPE_NAME;
2
+ export const shapeName = 'TSChatPayload';
4
3
  export const schema = {
5
4
  type: 'object',
6
5
  properties: {