@sdk-it/typescript 0.36.0 → 0.36.2

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/dist/index.js CHANGED
@@ -56,18 +56,13 @@ function generateAISDKTools(ir) {
56
56
  }`;
57
57
  }
58
58
  );
59
- const handoffs = `export const triage = {
60
- name: 'Triage Agent',
61
- tools:{${Object.entries(groups).map(([, { name }]) => {
62
- return createTransferTool(name);
63
- })}}}`;
64
- return [...imports, ...agent, handoffs].join("\n\n");
59
+ return [...imports, ...agent].join("\n\n");
65
60
  }
66
61
  function createTool(entry, operation) {
67
62
  const schemaName = camelcase(`${operation.operationId} schema`);
68
63
  const toolInfo = operation["x-tool"];
69
- return `'${toolInfo.name}': tool({
70
- description: \`${toolInfo.description}\`,
64
+ return `'${toolInfo?.name || operation["x-fn-name"]}': tool({
65
+ description: \`${toolInfo?.description || operation.description || operation.summary}\`,
71
66
  inputSchema: schemas.${schemaName},
72
67
  execute: async (input, options) => {
73
68
  console.log('Executing ${operation.operationId} tool with input:', input);
@@ -80,14 +75,6 @@ function createTool(entry, operation) {
80
75
  },
81
76
  })`;
82
77
  }
83
- function createTransferTool(agentName) {
84
- return `transfer_to_${agentName}: tool({
85
- type: 'function',
86
- description: 'Transfer the conversation to the ${agentName}.',
87
- inputSchema: z.object({}),
88
- execute: async () => ({ agent: '${agentName}' }),
89
- })`;
90
- }
91
78
 
92
79
  // packages/typescript/src/lib/agent/openai-agents.ts
93
80
  import { camelcase as camelcase2, spinalcase } from "stringcase";
@@ -3244,8 +3231,9 @@ ${utils_default}`
3244
3231
  await settings.writer(settings.output, configFiles);
3245
3232
  }
3246
3233
  if (settings.readme) {
3247
- await settings.writer(settings.mode === "full" ? settings.output : output, {
3248
- "README.md": toReadme(spec, new TypeScriptSnippet(spec, settings))
3234
+ const path = typeof settings.readme === "string" ? settings.readme : "README.md";
3235
+ await settings.writer(settings.output, {
3236
+ [path]: toReadme(spec, new TypeScriptSnippet(spec, settings))
3249
3237
  });
3250
3238
  }
3251
3239
  await settings.formatCode?.({