tmcp 1.20.0-next.0 → 1.20.0-next.1

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,6 +1,6 @@
1
1
  {
2
2
  "name": "tmcp",
3
- "version": "1.20.0-next.0",
3
+ "version": "1.20.0-next.1",
4
4
  "description": "The main tmcp library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -2321,7 +2321,7 @@ declare module 'tmcp' {
2321
2321
  description?: string;
2322
2322
  };
2323
2323
  type InitializeRequestParams = v.InferInput<typeof InitializeRequestParamsSchema>;
2324
- type CallToolResult_1<TStructuredContent> = Omit<v.InferInput<typeof CallToolResultSchema>, "structuredContent" | "isError"> & (undefined extends TStructuredContent ? {
2324
+ type CallToolResult_1<TStructuredContent> = v.InferInput<v.LooseObjectSchema<Omit<(typeof CallToolResultSchema)["entries"], "structuredContent" | "isError">, undefined>> & (undefined extends TStructuredContent ? {
2325
2325
  structuredContent?: undefined;
2326
2326
  isError?: boolean;
2327
2327
  } : ({
@@ -2688,7 +2688,7 @@ declare module 'tmcp/tool' {
2688
2688
  readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
2689
2689
  }, undefined>;
2690
2690
  type Icons = v.InferInput<typeof IconsSchema>;
2691
- type CallToolResult_1<TStructuredContent> = Omit<v.InferInput<typeof CallToolResultSchema>, "structuredContent" | "isError"> & (undefined extends TStructuredContent ? {
2691
+ type CallToolResult_1<TStructuredContent> = v.InferInput<v.LooseObjectSchema<Omit<(typeof CallToolResultSchema)["entries"], "structuredContent" | "isError">, undefined>> & (undefined extends TStructuredContent ? {
2692
2692
  structuredContent?: undefined;
2693
2693
  isError?: boolean;
2694
2694
  } : ({
@@ -3494,11 +3494,11 @@ declare module 'tmcp/utils' {
3494
3494
  };
3495
3495
 
3496
3496
  function structured<T extends Record<string, unknown>>(obj: T): {
3497
- readonly content: readonly [{
3498
- readonly type: "text";
3499
- readonly text: string;
3500
- }];
3501
- readonly structuredContent: T;
3497
+ content: {
3498
+ type: "text";
3499
+ text: string;
3500
+ }[];
3501
+ structuredContent: T;
3502
3502
  };
3503
3503
 
3504
3504
  function mix<T extends Record<string, unknown> | undefined = undefined>(results: Array<CallToolResult<undefined>>, obj?: T): CallToolResult<T>;
@@ -4274,7 +4274,7 @@ declare module 'tmcp/utils' {
4274
4274
  */
4275
4275
  readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
4276
4276
  }, undefined>;
4277
- type CallToolResult<TStructuredContent> = Omit<v.InferInput<typeof CallToolResultSchema>, "structuredContent" | "isError"> & (undefined extends TStructuredContent ? {
4277
+ type CallToolResult<TStructuredContent> = v.InferInput<v.LooseObjectSchema<Omit<(typeof CallToolResultSchema)["entries"], "structuredContent" | "isError">, undefined>> & (undefined extends TStructuredContent ? {
4278
4278
  structuredContent?: undefined;
4279
4279
  isError?: boolean;
4280
4280
  } : ({
@@ -81,15 +81,15 @@ export const tool = {
81
81
  * @param {T} obj
82
82
  */
83
83
  structured(obj) {
84
- return /** @type {const} */ ({
84
+ return {
85
85
  content: [
86
86
  {
87
- type: 'text',
87
+ type: /** @type {const} */ ('text'),
88
88
  text: JSON.stringify(obj),
89
89
  },
90
90
  ],
91
91
  structuredContent: obj,
92
- });
92
+ };
93
93
  },
94
94
  /**
95
95
  * @template {Record<string, unknown> | undefined} [T=undefined]
@@ -1839,7 +1839,7 @@ export const ServerResultSchema = v.pipe(
1839
1839
  */
1840
1840
  /**
1841
1841
  * @template TStructuredContent
1842
- * @typedef {Omit<v.InferInput<typeof CallToolResultSchema>, "structuredContent" | "isError"> & (undefined extends TStructuredContent ? { structuredContent?: undefined, isError?: boolean } : ({ structuredContent: TStructuredContent, isError?: false } | { isError: true, structuredContent?: TStructuredContent }))} CallToolResult
1842
+ * @typedef {v.InferInput<v.LooseObjectSchema<Omit<typeof CallToolResultSchema["entries"], "structuredContent" | "isError">, undefined>> & (undefined extends TStructuredContent ? { structuredContent?: undefined, isError?: boolean } : ({ structuredContent: TStructuredContent, isError?: false } | { isError: true, structuredContent?: TStructuredContent }))} CallToolResult
1843
1843
  */
1844
1844
  /**
1845
1845
  * @typedef {v.InferInput<typeof ReadResourceResultSchema>} ReadResourceResult