@decocms/runtime 0.28.0 → 0.28.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/dist/bindings/deconfig/index.d.ts +3 -3
- package/dist/bindings/index.d.ts +193 -190
- package/dist/bindings/index.js +22 -1
- package/dist/bindings/index.js.map +1 -1
- package/dist/drizzle.d.ts +2 -2
- package/dist/{index-uCMd27hU.d.ts → index-LOfgE9a_.d.ts} +1 -1
- package/dist/{index-B7U9jXW4.d.ts → index-xKtm7A7B.d.ts} +8 -8
- package/dist/index.d.ts +2 -2
- package/dist/mastra.d.ts +2 -2
- package/dist/{mcp-DYmQ2RQf.d.ts → mcp-87iLaW9V.d.ts} +4 -4
- package/dist/proxy.d.ts +1 -1
- package/dist/resources.d.ts +22 -22
- package/dist/views.d.ts +6 -6
- package/package.json +1 -1
- package/src/bindings/index.ts +2 -0
package/dist/bindings/index.js
CHANGED
|
@@ -121,6 +121,27 @@ var deconfigTools = [
|
|
|
121
121
|
}
|
|
122
122
|
];
|
|
123
123
|
|
|
124
|
+
// src/bindings/language-model/utils.ts
|
|
125
|
+
function streamToResponse(stream, headers) {
|
|
126
|
+
const encodedStream = stream.pipeThrough(
|
|
127
|
+
new TransformStream({
|
|
128
|
+
transform(chunk, controller) {
|
|
129
|
+
const line = JSON.stringify(chunk) + "\n";
|
|
130
|
+
controller.enqueue(new TextEncoder().encode(line));
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
return new Response(encodedStream, {
|
|
135
|
+
headers: {
|
|
136
|
+
"Content-Type": "application/x-ndjson",
|
|
137
|
+
// newline-delimited JSON
|
|
138
|
+
"Cache-Control": "no-cache",
|
|
139
|
+
Connection: "keep-alive",
|
|
140
|
+
...headers
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
124
145
|
// src/bindings/index.ts
|
|
125
146
|
var WellKnownBindings = {
|
|
126
147
|
Channel: CHANNEL_BINDING,
|
|
@@ -130,6 +151,6 @@ var WellKnownBindings = {
|
|
|
130
151
|
// Use createResourceBindings(dataSchema) directly for Resources 2.0
|
|
131
152
|
};
|
|
132
153
|
|
|
133
|
-
export { Binding, WellKnownBindings, constructResourceUri, deconfigTools, parseResourceUri, validateResourceUri };
|
|
154
|
+
export { Binding, WellKnownBindings, constructResourceUri, deconfigTools, parseResourceUri, streamToResponse, validateResourceUri };
|
|
134
155
|
//# sourceMappingURL=index.js.map
|
|
135
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bindings/utils.ts","../../src/bindings/resources/helpers.ts","../../src/bindings/deconfig/types.ts","../../src/bindings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEO,IAAM,OAAA,GAAU,CACrB,WAAA,KACG;AACH,EAAA,OAAO;AAAA,IACL,eAAA,EAAiB,CAAC,KAAA,KAAsC;AACtD,MAAA,MAAM,aAAA,GAAgB,YACnB,MAAA,CAAO,CAAC,SAAS,CAAC,IAAA,CAAK,GAAG,CAAA,CAC1B,GAAA;AAAA,QACC,CAAC,IAAA,KACC,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,GACjB,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAA,CAAA,CAAG,IAC1B,IAAA,CAAK;AAAA;AAAA,OACd;AAEF,MAAA,OAAO,aAAA,CAAc,KAAA;AAAA,QAAM,CAAC,MAAA,KAC1B,KAAA,CAAM,IAAA,CAAK,CAAC,MAAM,MAAA,CAAO,IAAA,CAAK,CAAA,CAAE,IAAI,CAAC;AAAA,OACvC;AAAA,IACF;AAAA,GACF;AACF;;;ACSO,SAAS,oBAAoB,GAAA,EAAsB;AACxD,EAAA,IAAI;AACF,IAAA,iBAAA,CAAkB,MAAM,GAAG,CAAA;AAC3B,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,K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MAAA,EAAO;AAAA,QACT,EAAE,MAAA,CAAO,EAAE,QAAQ,CAAA,CAAE,MAAA,IAAU,CAAA;AAAA,QAC/B,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,MAAA,EAAQ;AAAA,OACnB,CAAA;AAAA,MACD,UAAU,CAAA,CAAE,MAAA,CAAO,EAAE,GAAA,EAAK,EAAE,QAAA,EAAS;AAAA,MACrC,aAAA,EAAe,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,KACpC,CAAA;AAAA,IACD,YAAA,EAAc,EAAE,MAAA,CAAO;AAAA,MACrB,QAAA,EAAU,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AAAS,KAChC;AAAA,GACH;AAAA,EACA;AAAA,IACE,IAAA,EAAM,aAAA;AAAA,IACN,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,MAC5B,IAAA,EAAM,EAAE,MAAA;AAAO,KAChB,CAAA;AAAA,IACD,YAAA,EAAc,EAAE,MAAA,CAAO;AAAA,MACrB,OAAA,EAAS,EAAE,OAAA;AAAQ,KACpB;AAAA;AAEL;;;ACrCO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,OAAA,EAAS,eAAA;AAAA,EACT,IAAA,EAAM,YAAA;AAAA,EACN,aAAA,EAAe;AAAA;AAAA;AAGjB","file":"index.js","sourcesContent":["import type { ToolBinder } from \"../mcp.ts\";\n\nexport const Binding = <TDefinition extends readonly ToolBinder[]>(\n binderTools: TDefinition,\n) => {\n return {\n isImplementedBy: (tools: Pick<ToolBinder, \"name\">[]) => {\n const requiredTools = binderTools\n .filter((tool) => !tool.opt)\n .map(\n (tool) =>\n typeof tool.name === \"string\"\n ? new RegExp(`^${tool.name}$`) // exact match\n : (tool.name as RegExp), // regex match\n );\n\n return requiredTools.every((regexp) =>\n tools.some((t) => regexp.test(t.name)),\n );\n },\n };\n};\n","import {\n ResourceUriSchema,\n type CreateInput,\n type CreateOutput,\n type DeleteInput,\n type DeleteOutput,\n type ReadInput,\n type ReadOutput,\n type SearchInput,\n type SearchOutput,\n} from \"./schemas.ts\";\n\n/**\n * Resources 2.0 Helper Functions\n *\n * This module provides helper functions for working with Resources 2.0\n * URI format and validation.\n *\n * Key Features:\n * - URI validation and parsing utilities\n * - URI construction helpers\n * - Type-safe resource URI handling\n */\n\n/**\n * Utility function to validate a resource URI format\n *\n * @param uri - The URI to validate\n * @returns True if the URI is valid, false otherwise\n */\nexport function validateResourceUri(uri: string): boolean {\n try {\n ResourceUriSchema.parse(uri);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Utility function to parse a resource URI into its components\n *\n * @param uri - The URI to parse\n * @returns Object containing the parsed components or null if invalid\n */\nexport function parseResourceUri(uri: string): {\n workspace: string;\n project: string;\n resourceId: string;\n} | null {\n try {\n const validated = ResourceUriSchema.parse(uri);\n const match = validated.match(/^rsc:\\/\\/([^/]+)\\/([^/]+)\\/(.+)$/);\n\n if (!match) {\n return null;\n }\n\n return {\n workspace: match[1],\n project: match[2],\n resourceId: match[3],\n };\n } catch {\n return null;\n }\n}\n\n/**\n * Utility function to construct a resource URI from components\n *\n * @param workspace - The workspace identifier\n * @param project - The project identifier\n * @param resourceId - The resource identifier\n * @returns The constructed resource URI\n */\nexport function constructResourceUri(\n workspace: string,\n project: string,\n resourceId: string,\n): string {\n return `rsc://${workspace}/${project}/${resourceId}`;\n}\n\n// Re-export types for convenience\nexport type {\n CreateInput,\n CreateOutput,\n DeleteInput,\n DeleteOutput,\n ReadInput,\n ReadOutput,\n SearchInput,\n SearchOutput,\n};\n","// Types for DeconfigResource\nimport { z } from \"zod/v3\";\nimport type { DefaultEnv } from \"../../index.ts\";\nimport type { MCPClientFetchStub, ToolBinder } from \"../../mcp.ts\";\nimport type { BaseResourceDataSchema } from \"../resources/bindings.ts\";\n\nexport type ResourcesBinding<TDataSchema extends BaseResourceDataSchema> =\n ReturnType<\n typeof import(\"../resources/bindings.ts\").createResourceBindings<TDataSchema>\n >;\n\nexport type ResourcesTools<TDataSchema extends BaseResourceDataSchema> =\n ResourcesBinding<TDataSchema>[number][\"name\"];\n\nexport type EnhancedResourcesTools<TDataSchema extends BaseResourceDataSchema> =\n Partial<\n Record<\n ResourcesTools<TDataSchema>,\n {\n description: string;\n }\n >\n >;\n\n// Define deconfig tools as ToolBinder array (same pattern as workspaceTools in mcp.ts)\nexport const deconfigTools = [\n {\n name: \"LIST_FILES\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n prefix: z.string().optional(),\n select: z.array(z.string()).optional(),\n includeContent: z.boolean().optional(),\n }),\n outputSchema: z.object({\n files: z.record(\n z.string(),\n z.object({\n address: z.string(),\n metadata: z.record(z.string(), z.any()),\n sizeInBytes: z.number(),\n mtime: z.number(),\n ctime: z.number(),\n content: z.string().optional(),\n }),\n ),\n count: z.number(),\n }),\n },\n {\n name: \"READ_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n format: z.enum([\"base64\", \"byteArray\", \"plainString\", \"json\"]).optional(),\n }),\n outputSchema: z.object({\n content: z.any(),\n address: z.string(),\n metadata: z.record(z.any()),\n mtime: z.number(),\n ctime: z.number(),\n }),\n },\n {\n name: \"PUT_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n content: z.union([\n z.string(),\n z.object({ base64: z.string() }),\n z.array(z.number()),\n ]),\n metadata: z.record(z.any()).optional(),\n expectedCtime: z.number().optional(),\n }),\n outputSchema: z.object({\n conflict: z.boolean().optional(),\n }),\n },\n {\n name: \"DELETE_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n }),\n outputSchema: z.object({\n deleted: z.boolean(),\n }),\n },\n] as const satisfies readonly ToolBinder[];\n\n// DeconfigClient is now a typed MCP client stub (same pattern as workspaceTools)\nexport type DeconfigClient = MCPClientFetchStub<typeof deconfigTools>;\n\nexport interface DeconfigResourceOptions<\n TDataSchema extends BaseResourceDataSchema,\n> {\n directory?: string; // defaults to /resources/$resourceName\n resourceName: string;\n env: DefaultEnv & { DECONFIG: DeconfigClient };\n dataSchema: TDataSchema;\n enhancements?: EnhancedResourcesTools<TDataSchema>;\n validate?: (data: z.infer<TDataSchema>) => Promise<void>;\n}\n","import { CHANNEL_BINDING } from \"./channels.ts\";\nimport { VIEW_BINDING as VIEWS_BINDING } from \"./views.ts\";\n\n// Import new Resources 2.0 bindings function\nimport { LANGUAGE_MODEL_BINDING } from \"@decocms/bindings/llm\";\nimport { createResourceBindings } from \"./resources/bindings.ts\";\n\n// Export types and utilities from binder\nexport {\n bindingClient,\n ChannelBinding,\n impl,\n ViewBinding,\n type Binder,\n type BinderImplementation,\n type MCPBindingClient,\n type ToolLike,\n} from \"./binder.ts\";\n\n// Export all channel types and schemas\nexport * from \"./channels.ts\";\n\n// Export binding utilities\nexport * from \"./utils.ts\";\n\n// Export views schemas\nexport * from \"./views.ts\";\n\n// Re-export Resources bindings function for convenience\nexport { createResourceBindings };\n\n// Export resources types and schemas\nexport * from \"./resources/bindings.ts\";\nexport * from \"./resources/helpers.ts\";\nexport * from \"./resources/schemas.ts\";\n\n// Export deconfig helpers and types\nexport {\n getMetadataString as deconfigGetMetadataString,\n getMetadataValue as deconfigGetMetadataValue,\n normalizeDirectory as deconfigNormalizeDirectory,\n ResourcePath,\n ResourceUri,\n} from \"./deconfig/helpers.ts\";\nexport { createDeconfigResource } from \"./deconfig/index.ts\";\nexport type {\n DeconfigClient,\n DeconfigResourceOptions,\n EnhancedResourcesTools,\n ResourcesBinding,\n ResourcesTools,\n} from \"./deconfig/index.ts\";\nexport { deconfigTools } from \"./deconfig/types.ts\";\n\nexport const WellKnownBindings = {\n Channel: CHANNEL_BINDING,\n View: VIEWS_BINDING,\n LanguageModel: LANGUAGE_MODEL_BINDING,\n // Note: Resources is not included here since it's a generic function\n // Use createResourceBindings(dataSchema) directly for Resources 2.0\n} as const;\n\nexport type WellKnownBindingsName = keyof typeof WellKnownBindings;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/bindings/utils.ts","../../src/bindings/resources/helpers.ts","../../src/bindings/deconfig/types.ts","../../src/bindings/language-model/utils.ts","../../src/bindings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEO,IAAM,OAAA,GAAU,CACrB,WAAA,KACG;AACH,EAAA,OAAO;AAAA,IACL,eAAA,EAAiB,CAAC,KAAA,KAAsC;AACtD,MAAA,MAAM,aAAA,GAAgB,YACnB,MAAA,CAAO,CAAC,SAAS,CAAC,IAAA,CAAK,GAAG,CAAA,CAC1B,GAAA;AAAA,QACC,CAAC,IAAA,KACC,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,GACjB,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAA,CAAA,CAAG,IAC1B,IAAA,CAAK;AAAA;AAAA,OACd;AAEF,MAAA,OAAO,aAAA,CAAc,KAAA;AAAA,QAAM,CAAC,MAAA,KAC1B,KAAA,CAAM,IAAA,CAAK,CAAC,MAAM,MAAA,CAAO,IAAA,CAAK,CAAA,CAAE,IAAI,CAAC;AAAA,OACvC;AAAA,IACF;AAAA,GACF;AACF;;;ACSO,SAAS,oBAAoB,GAAA,EAAsB;AACxD,EAAA,IAAI;AACF,IAAA,iBAAA,CAAkB,MAAM,GAAG,CAAA;AAC3B,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAQO,SAAS,iBAAiB,GAAA,EAIxB;AACP,EAAA,IAAI;AACF,IAAA,MAAM,SAAA,GAAY,iBAAA,CAAkB,KAAA,CAAM,GAAG,CAAA;AAC7C,IAAA,MAAM,KAAA,GAAQ,SAAA,CAAU,KAAA,CAAM,kCAAkC,CAAA;AAEhE,IAAA,IAAI,CAAC,KAAA,EAAO;AACV,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,OAAO;AAA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AAAS,KACpC,CAAA;AAAA,IACD,YAAA,EAAc,EAAE,MAAA,CAAO;AAAA,MACrB,QAAA,EAAU,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AAAS,KAChC;AAAA,GACH;AAAA,EACA;AAAA,IACE,IAAA,EAAM,aAAA;AAAA,IACN,WAAA,EAAa,EAAE,MAAA,CAAO;AAAA,MACpB,MAAA,EAAQ,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,MAC5B,IAAA,EAAM,EAAE,MAAA;AAAO,KAChB,CAAA;AAAA,IACD,YAAA,EAAc,EAAE,MAAA,CAAO;AAAA,MACrB,OAAA,EAAS,EAAE,OAAA;AAAQ,KACpB;AAAA;AAEL;;;ACxFO,SAAS,gBAAA,CACd,QACA,OAAA,EACU;AAEV,EAAA,MAAM,gBAAgB,MAAA,CAAO,WAAA;AAAA,IAC3B,IAAI,eAAA,CAAuD;AAAA,MACzD,SAAA,CAAU,OAAO,UAAA,EAAY;AAE3B,QAAA,MAAM,IAAA,GAAO,IAAA,CAAK,SAAA,CAAU,KAAK,CAAA,GAAI,IAAA;AACrC,QAAA,UAAA,CAAW,QAAQ,IAAI,WAAA,EAAY,CAAE,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,MACnD;AAAA,KACD;AAAA,GACH;AAEA,EAAA,OAAO,IAAI,SAAS,aAAA,EAAe;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,cAAA,EAAgB,sBAAA;AAAA;AAAA,MAChB,eAAA,EAAiB,UAAA;AAAA,MACjB,UAAA,EAAY,YAAA;AAAA,MACZ,GAAG;AAAA;AACL,GACD,CAAA;AACH;;;AC8BO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,OAAA,EAAS,eAAA;AAAA,EACT,IAAA,EAAM,YAAA;AAAA,EACN,aAAA,EAAe;AAAA;AAAA;AAGjB","file":"index.js","sourcesContent":["import type { ToolBinder } from \"../mcp.ts\";\n\nexport const Binding = <TDefinition extends readonly ToolBinder[]>(\n binderTools: TDefinition,\n) => {\n return {\n isImplementedBy: (tools: Pick<ToolBinder, \"name\">[]) => {\n const requiredTools = binderTools\n .filter((tool) => !tool.opt)\n .map(\n (tool) =>\n typeof tool.name === \"string\"\n ? new RegExp(`^${tool.name}$`) // exact match\n : (tool.name as RegExp), // regex match\n );\n\n return requiredTools.every((regexp) =>\n tools.some((t) => regexp.test(t.name)),\n );\n },\n };\n};\n","import {\n ResourceUriSchema,\n type CreateInput,\n type CreateOutput,\n type DeleteInput,\n type DeleteOutput,\n type ReadInput,\n type ReadOutput,\n type SearchInput,\n type SearchOutput,\n} from \"./schemas.ts\";\n\n/**\n * Resources 2.0 Helper Functions\n *\n * This module provides helper functions for working with Resources 2.0\n * URI format and validation.\n *\n * Key Features:\n * - URI validation and parsing utilities\n * - URI construction helpers\n * - Type-safe resource URI handling\n */\n\n/**\n * Utility function to validate a resource URI format\n *\n * @param uri - The URI to validate\n * @returns True if the URI is valid, false otherwise\n */\nexport function validateResourceUri(uri: string): boolean {\n try {\n ResourceUriSchema.parse(uri);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Utility function to parse a resource URI into its components\n *\n * @param uri - The URI to parse\n * @returns Object containing the parsed components or null if invalid\n */\nexport function parseResourceUri(uri: string): {\n workspace: string;\n project: string;\n resourceId: string;\n} | null {\n try {\n const validated = ResourceUriSchema.parse(uri);\n const match = validated.match(/^rsc:\\/\\/([^/]+)\\/([^/]+)\\/(.+)$/);\n\n if (!match) {\n return null;\n }\n\n return {\n workspace: match[1],\n project: match[2],\n resourceId: match[3],\n };\n } catch {\n return null;\n }\n}\n\n/**\n * Utility function to construct a resource URI from components\n *\n * @param workspace - The workspace identifier\n * @param project - The project identifier\n * @param resourceId - The resource identifier\n * @returns The constructed resource URI\n */\nexport function constructResourceUri(\n workspace: string,\n project: string,\n resourceId: string,\n): string {\n return `rsc://${workspace}/${project}/${resourceId}`;\n}\n\n// Re-export types for convenience\nexport type {\n CreateInput,\n CreateOutput,\n DeleteInput,\n DeleteOutput,\n ReadInput,\n ReadOutput,\n SearchInput,\n SearchOutput,\n};\n","// Types for DeconfigResource\nimport { z } from \"zod/v3\";\nimport type { DefaultEnv } from \"../../index.ts\";\nimport type { MCPClientFetchStub, ToolBinder } from \"../../mcp.ts\";\nimport type { BaseResourceDataSchema } from \"../resources/bindings.ts\";\n\nexport type ResourcesBinding<TDataSchema extends BaseResourceDataSchema> =\n ReturnType<\n typeof import(\"../resources/bindings.ts\").createResourceBindings<TDataSchema>\n >;\n\nexport type ResourcesTools<TDataSchema extends BaseResourceDataSchema> =\n ResourcesBinding<TDataSchema>[number][\"name\"];\n\nexport type EnhancedResourcesTools<TDataSchema extends BaseResourceDataSchema> =\n Partial<\n Record<\n ResourcesTools<TDataSchema>,\n {\n description: string;\n }\n >\n >;\n\n// Define deconfig tools as ToolBinder array (same pattern as workspaceTools in mcp.ts)\nexport const deconfigTools = [\n {\n name: \"LIST_FILES\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n prefix: z.string().optional(),\n select: z.array(z.string()).optional(),\n includeContent: z.boolean().optional(),\n }),\n outputSchema: z.object({\n files: z.record(\n z.string(),\n z.object({\n address: z.string(),\n metadata: z.record(z.string(), z.any()),\n sizeInBytes: z.number(),\n mtime: z.number(),\n ctime: z.number(),\n content: z.string().optional(),\n }),\n ),\n count: z.number(),\n }),\n },\n {\n name: \"READ_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n format: z.enum([\"base64\", \"byteArray\", \"plainString\", \"json\"]).optional(),\n }),\n outputSchema: z.object({\n content: z.any(),\n address: z.string(),\n metadata: z.record(z.any()),\n mtime: z.number(),\n ctime: z.number(),\n }),\n },\n {\n name: \"PUT_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n content: z.union([\n z.string(),\n z.object({ base64: z.string() }),\n z.array(z.number()),\n ]),\n metadata: z.record(z.any()).optional(),\n expectedCtime: z.number().optional(),\n }),\n outputSchema: z.object({\n conflict: z.boolean().optional(),\n }),\n },\n {\n name: \"DELETE_FILE\" as const,\n inputSchema: z.object({\n branch: z.string().optional(),\n path: z.string(),\n }),\n outputSchema: z.object({\n deleted: z.boolean(),\n }),\n },\n] as const satisfies readonly ToolBinder[];\n\n// DeconfigClient is now a typed MCP client stub (same pattern as workspaceTools)\nexport type DeconfigClient = MCPClientFetchStub<typeof deconfigTools>;\n\nexport interface DeconfigResourceOptions<\n TDataSchema extends BaseResourceDataSchema,\n> {\n directory?: string; // defaults to /resources/$resourceName\n resourceName: string;\n env: DefaultEnv & { DECONFIG: DeconfigClient };\n dataSchema: TDataSchema;\n enhancements?: EnhancedResourcesTools<TDataSchema>;\n validate?: (data: z.infer<TDataSchema>) => Promise<void>;\n}\n","import type { LanguageModelV2StreamPart } from \"@ai-sdk/provider\";\n\n// Helper to convert the AI SDK stream to a Response\nexport function streamToResponse(\n stream: ReadableStream<LanguageModelV2StreamPart>,\n headers?: Record<string, string>,\n): Response {\n // Transform LanguageModelV2StreamPart objects to newline-delimited JSON\n const encodedStream = stream.pipeThrough(\n new TransformStream<LanguageModelV2StreamPart, Uint8Array>({\n transform(chunk, controller) {\n // Serialize each chunk as JSON with newline delimiter\n const line = JSON.stringify(chunk) + \"\\n\";\n controller.enqueue(new TextEncoder().encode(line));\n },\n }),\n );\n\n return new Response(encodedStream, {\n headers: {\n \"Content-Type\": \"application/x-ndjson\", // newline-delimited JSON\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n ...headers,\n },\n });\n}\n\nexport function responseToStream(\n response: Response,\n): ReadableStream<LanguageModelV2StreamPart> {\n if (!response.body) {\n throw new Error(\"Response body is null\");\n }\n\n return response.body.pipeThrough(new TextDecoderStream()).pipeThrough(\n new TransformStream<string, LanguageModelV2StreamPart>({\n transform(chunk, controller) {\n // Split by newlines and parse each line\n const lines = chunk.split(\"\\n\");\n\n for (const line of lines) {\n if (line.trim()) {\n try {\n const parsed = JSON.parse(line) as LanguageModelV2StreamPart;\n controller.enqueue(parsed);\n } catch (error) {\n console.error(\"Failed to parse stream chunk:\", error);\n }\n }\n }\n },\n }),\n );\n}\n\n/**\n * Lazy promise wrapper that defers execution until the promise is awaited.\n * The factory function is only called when .then() is invoked for the first time.\n */\nclass Lazy<T> implements PromiseLike<T> {\n private promise: Promise<T> | null = null;\n\n constructor(private factory: () => Promise<T>) {}\n\n private getOrCreatePromise(): Promise<T> {\n if (!this.promise) {\n this.promise = this.factory();\n }\n return this.promise;\n }\n\n // eslint-disable-next-line no-thenable\n then<TResult1 = T, TResult2 = never>(\n onfulfilled?:\n | ((value: T) => TResult1 | PromiseLike<TResult1>)\n | null\n | undefined,\n onrejected?:\n | ((reason: unknown) => TResult2 | PromiseLike<TResult2>)\n | null\n | undefined,\n ): PromiseLike<TResult1 | TResult2> {\n return this.getOrCreatePromise().then(onfulfilled, onrejected);\n }\n\n catch<TResult = never>(\n onrejected?:\n | ((reason: unknown) => TResult | PromiseLike<TResult>)\n | null\n | undefined,\n ): Promise<T | TResult> {\n return this.getOrCreatePromise().catch(onrejected);\n }\n\n finally(onfinally?: (() => void) | null | undefined): Promise<T> {\n return this.getOrCreatePromise().finally(onfinally);\n }\n}\n\n/**\n * Creates a lazy promise that only executes when awaited.\n *\n * @param factory - A function that returns a Promise<T>\n * @returns A Promise-like object that defers execution until .then() is called\n *\n * @example\n * ```ts\n * const lazyData = lazy(() => fetchExpensiveData());\n * // fetchExpensiveData() is NOT called yet\n *\n * const result = await lazyData;\n * // fetchExpensiveData() is called NOW\n * ```\n */\nexport function lazy<T>(factory: () => Promise<T>): Promise<T> {\n return new Lazy(factory) as unknown as Promise<T>;\n}\n","import { CHANNEL_BINDING } from \"./channels.ts\";\nimport { VIEW_BINDING as VIEWS_BINDING } from \"./views.ts\";\n\n// Import new Resources 2.0 bindings function\nimport { LANGUAGE_MODEL_BINDING } from \"@decocms/bindings/llm\";\nimport { createResourceBindings } from \"./resources/bindings.ts\";\n\n// Export types and utilities from binder\nexport {\n bindingClient,\n ChannelBinding,\n impl,\n ViewBinding,\n type Binder,\n type BinderImplementation,\n type MCPBindingClient,\n type ToolLike,\n} from \"./binder.ts\";\n\n// Export all channel types and schemas\nexport * from \"./channels.ts\";\n\n// Export binding utilities\nexport * from \"./utils.ts\";\n\n// Export views schemas\nexport * from \"./views.ts\";\n\n// Re-export Resources bindings function for convenience\nexport { createResourceBindings };\n\n// Export resources types and schemas\nexport * from \"./resources/bindings.ts\";\nexport * from \"./resources/helpers.ts\";\nexport * from \"./resources/schemas.ts\";\n\n// Export deconfig helpers and types\nexport {\n getMetadataString as deconfigGetMetadataString,\n getMetadataValue as deconfigGetMetadataValue,\n normalizeDirectory as deconfigNormalizeDirectory,\n ResourcePath,\n ResourceUri,\n} from \"./deconfig/helpers.ts\";\nexport { createDeconfigResource } from \"./deconfig/index.ts\";\nexport type {\n DeconfigClient,\n DeconfigResourceOptions,\n EnhancedResourcesTools,\n ResourcesBinding,\n ResourcesTools,\n} from \"./deconfig/index.ts\";\nexport { deconfigTools } from \"./deconfig/types.ts\";\n\nexport { streamToResponse } from \"./language-model/utils.ts\";\n\nexport const WellKnownBindings = {\n Channel: CHANNEL_BINDING,\n View: VIEWS_BINDING,\n LanguageModel: LANGUAGE_MODEL_BINDING,\n // Note: Resources is not included here since it's a generic function\n // Use createResourceBindings(dataSchema) directly for Resources 2.0\n} as const;\n\nexport type WellKnownBindingsName = keyof typeof WellKnownBindings;\n"]}
|
package/dist/drizzle.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import * as drizzleOrm from 'drizzle-orm';
|
|
|
3
3
|
export { drizzleOrm as orm };
|
|
4
4
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
5
5
|
export * from 'drizzle-orm/sqlite-core';
|
|
6
|
-
import { D as DefaultEnv } from './index-
|
|
6
|
+
import { D as DefaultEnv } from './index-LOfgE9a_.js';
|
|
7
7
|
import '@cloudflare/workers-types';
|
|
8
8
|
import 'zod/v3';
|
|
9
9
|
import '@mastra/core';
|
|
10
10
|
import '@mastra/core/di';
|
|
11
11
|
import '@mastra/core/workflows';
|
|
12
12
|
import './resources.js';
|
|
13
|
-
import './mcp-
|
|
13
|
+
import './mcp-87iLaW9V.js';
|
|
14
14
|
import '@decocms/bindings/connection';
|
|
15
15
|
import '@decocms/bindings';
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@ import { ToolExecutionContext, ToolAction, Tool, Workflow as Workflow$1 } from '
|
|
|
4
4
|
import { RuntimeContext } from '@mastra/core/di';
|
|
5
5
|
import { createWorkflow, Step as Step$1, ExecuteFunction, DefaultEngineType } from '@mastra/core/workflows';
|
|
6
6
|
import { ResourceCreateInputSchema, ResourceUpdateInputSchema, ResourceDeleteInputSchema } from './resources.js';
|
|
7
|
-
import { Q as QueryResult } from './mcp-
|
|
7
|
+
import { Q as QueryResult } from './mcp-87iLaW9V.js';
|
|
8
8
|
import { MCPConnection } from '@decocms/bindings/connection';
|
|
9
9
|
import '@decocms/bindings';
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _mastra_core from '@mastra/core';
|
|
2
|
-
import { D as DefaultEnv, S as StreamableTool } from './index-
|
|
2
|
+
import { D as DefaultEnv, S as StreamableTool } from './index-LOfgE9a_.js';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import { z } from 'zod/v3';
|
|
5
|
-
import { M as MCPClientFetchStub } from './mcp-
|
|
5
|
+
import { M as MCPClientFetchStub } from './mcp-87iLaW9V.js';
|
|
6
6
|
|
|
7
7
|
type BaseResourceDataSchema = z.ZodObject<{
|
|
8
8
|
name: z.ZodString;
|
|
@@ -277,11 +277,11 @@ declare function createResourceBindings<TDataSchema extends BaseResourceDataSche
|
|
|
277
277
|
success: z.ZodBoolean;
|
|
278
278
|
uri: z.ZodString;
|
|
279
279
|
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
uri: string;
|
|
281
280
|
success: boolean;
|
|
282
|
-
}, {
|
|
283
281
|
uri: string;
|
|
282
|
+
}, {
|
|
284
283
|
success: boolean;
|
|
284
|
+
uri: string;
|
|
285
285
|
}>;
|
|
286
286
|
readonly opt: true;
|
|
287
287
|
}, {
|
|
@@ -402,12 +402,12 @@ declare const deconfigTools: readonly [{
|
|
|
402
402
|
format: z.ZodOptional<z.ZodEnum<["base64", "byteArray", "plainString", "json"]>>;
|
|
403
403
|
}, "strip", z.ZodTypeAny, {
|
|
404
404
|
path: string;
|
|
405
|
-
format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
|
|
406
405
|
branch?: string | undefined;
|
|
406
|
+
format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
|
|
407
407
|
}, {
|
|
408
408
|
path: string;
|
|
409
|
-
format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
|
|
410
409
|
branch?: string | undefined;
|
|
410
|
+
format?: "json" | "base64" | "byteArray" | "plainString" | undefined;
|
|
411
411
|
}>;
|
|
412
412
|
readonly outputSchema: z.ZodObject<{
|
|
413
413
|
content: z.ZodAny;
|
|
@@ -447,16 +447,16 @@ declare const deconfigTools: readonly [{
|
|
|
447
447
|
content: string | number[] | {
|
|
448
448
|
base64: string;
|
|
449
449
|
};
|
|
450
|
-
metadata?: Record<string, any> | undefined;
|
|
451
450
|
branch?: string | undefined;
|
|
451
|
+
metadata?: Record<string, any> | undefined;
|
|
452
452
|
expectedCtime?: number | undefined;
|
|
453
453
|
}, {
|
|
454
454
|
path: string;
|
|
455
455
|
content: string | number[] | {
|
|
456
456
|
base64: string;
|
|
457
457
|
};
|
|
458
|
-
metadata?: Record<string, any> | undefined;
|
|
459
458
|
branch?: string | undefined;
|
|
459
|
+
metadata?: Record<string, any> | undefined;
|
|
460
460
|
expectedCtime?: number | undefined;
|
|
461
461
|
}>;
|
|
462
462
|
readonly outputSchema: z.ZodObject<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@cloudflare/workers-types';
|
|
2
2
|
import 'zod/v3';
|
|
3
|
-
export { B as BindingsObject, r as Contract, D as DefaultEnv, s as Migration, n as RequestContext, o as UnauthorizedError, m as User, U as UserDefaultExport, l as WorkersMCPBindings, W as WorkspaceDB, t as WranglerConfig, q as proxyConnectionForId, w as withBindings, p as withRuntime } from './index-
|
|
4
|
-
export { C as CreateStubAPIOptions, c as createMCPFetchStub } from './mcp-
|
|
3
|
+
export { B as BindingsObject, r as Contract, D as DefaultEnv, s as Migration, n as RequestContext, o as UnauthorizedError, m as User, U as UserDefaultExport, l as WorkersMCPBindings, W as WorkspaceDB, t as WranglerConfig, q as proxyConnectionForId, w as withBindings, p as withRuntime } from './index-LOfgE9a_.js';
|
|
4
|
+
export { C as CreateStubAPIOptions, c as createMCPFetchStub } from './mcp-87iLaW9V.js';
|
|
5
5
|
export { ToolBinder } from '@decocms/bindings';
|
|
6
6
|
import '@mastra/core';
|
|
7
7
|
import '@mastra/core/di';
|
package/dist/mastra.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import '@mastra/core';
|
|
|
2
2
|
import '@mastra/core/di';
|
|
3
3
|
export { cloneStep, cloneWorkflow, createWorkflow } from '@mastra/core/workflows';
|
|
4
4
|
import 'zod/v3';
|
|
5
|
-
export { A as AppContext, h as CreateMCPServerOptions, C as CreatedTool, E as ExecWithContext, F as Fetch, I as Integration, M as MCPServer, R as Resources, e as Step, S as StreamableTool, V as ViewExport, k as createMCPServer, c as createPrivateTool, b as createRuntimeContext, g as createStep, f as createStepFromTool, a as createStreamableTool, d as createTool, i as isStreamableTool, j as isWorkflow } from './index-
|
|
5
|
+
export { A as AppContext, h as CreateMCPServerOptions, C as CreatedTool, E as ExecWithContext, F as Fetch, I as Integration, M as MCPServer, R as Resources, e as Step, S as StreamableTool, V as ViewExport, k as createMCPServer, c as createPrivateTool, b as createRuntimeContext, g as createStep, f as createStepFromTool, a as createStreamableTool, d as createTool, i as isStreamableTool, j as isWorkflow } from './index-LOfgE9a_.js';
|
|
6
6
|
import './resources.js';
|
|
7
7
|
import '@cloudflare/workers-types';
|
|
8
|
-
import './mcp-
|
|
8
|
+
import './mcp-87iLaW9V.js';
|
|
9
9
|
import '@decocms/bindings/connection';
|
|
10
10
|
import '@decocms/bindings';
|
|
@@ -28,7 +28,7 @@ declare const QueryResult: z.ZodObject<{
|
|
|
28
28
|
rows_read?: number | undefined;
|
|
29
29
|
rows_written?: number | undefined;
|
|
30
30
|
served_by_primary?: boolean | undefined;
|
|
31
|
-
served_by_region?: "
|
|
31
|
+
served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
|
|
32
32
|
size_after?: number | undefined;
|
|
33
33
|
timings?: {
|
|
34
34
|
sql_duration_ms?: number | undefined;
|
|
@@ -41,7 +41,7 @@ declare const QueryResult: z.ZodObject<{
|
|
|
41
41
|
rows_read?: number | undefined;
|
|
42
42
|
rows_written?: number | undefined;
|
|
43
43
|
served_by_primary?: boolean | undefined;
|
|
44
|
-
served_by_region?: "
|
|
44
|
+
served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
|
|
45
45
|
size_after?: number | undefined;
|
|
46
46
|
timings?: {
|
|
47
47
|
sql_duration_ms?: number | undefined;
|
|
@@ -58,7 +58,7 @@ declare const QueryResult: z.ZodObject<{
|
|
|
58
58
|
rows_read?: number | undefined;
|
|
59
59
|
rows_written?: number | undefined;
|
|
60
60
|
served_by_primary?: boolean | undefined;
|
|
61
|
-
served_by_region?: "
|
|
61
|
+
served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
|
|
62
62
|
size_after?: number | undefined;
|
|
63
63
|
timings?: {
|
|
64
64
|
sql_duration_ms?: number | undefined;
|
|
@@ -75,7 +75,7 @@ declare const QueryResult: z.ZodObject<{
|
|
|
75
75
|
rows_read?: number | undefined;
|
|
76
76
|
rows_written?: number | undefined;
|
|
77
77
|
served_by_primary?: boolean | undefined;
|
|
78
|
-
served_by_region?: "
|
|
78
|
+
served_by_region?: "WNAM" | "ENAM" | "WEUR" | "EEUR" | "APAC" | "OC" | undefined;
|
|
79
79
|
size_after?: number | undefined;
|
|
80
80
|
timings?: {
|
|
81
81
|
sql_duration_ms?: number | undefined;
|
package/dist/proxy.d.ts
CHANGED
package/dist/resources.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ declare const ResourcesReadOutputSchema: z.ZodObject<{
|
|
|
28
28
|
name: string;
|
|
29
29
|
data: string;
|
|
30
30
|
uri: string;
|
|
31
|
+
description?: string | undefined;
|
|
31
32
|
mimeType?: string | undefined;
|
|
32
33
|
title?: string | undefined;
|
|
33
|
-
description?: string | undefined;
|
|
34
34
|
annotations?: Record<string, string> | undefined;
|
|
35
35
|
thumbnail?: string | undefined;
|
|
36
36
|
timestamp?: string | undefined;
|
|
@@ -40,9 +40,9 @@ declare const ResourcesReadOutputSchema: z.ZodObject<{
|
|
|
40
40
|
name: string;
|
|
41
41
|
data: string;
|
|
42
42
|
uri: string;
|
|
43
|
+
description?: string | undefined;
|
|
43
44
|
mimeType?: string | undefined;
|
|
44
45
|
title?: string | undefined;
|
|
45
|
-
description?: string | undefined;
|
|
46
46
|
annotations?: Record<string, string> | undefined;
|
|
47
47
|
thumbnail?: string | undefined;
|
|
48
48
|
timestamp?: string | undefined;
|
|
@@ -78,9 +78,9 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
|
|
|
78
78
|
}, "strip", z.ZodTypeAny, {
|
|
79
79
|
name: string;
|
|
80
80
|
uri: string;
|
|
81
|
+
description?: string | undefined;
|
|
81
82
|
mimeType?: string | undefined;
|
|
82
83
|
title?: string | undefined;
|
|
83
|
-
description?: string | undefined;
|
|
84
84
|
annotations?: Record<string, string> | undefined;
|
|
85
85
|
thumbnail?: string | undefined;
|
|
86
86
|
timestamp?: string | undefined;
|
|
@@ -88,9 +88,9 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
|
|
|
88
88
|
}, {
|
|
89
89
|
name: string;
|
|
90
90
|
uri: string;
|
|
91
|
+
description?: string | undefined;
|
|
91
92
|
mimeType?: string | undefined;
|
|
92
93
|
title?: string | undefined;
|
|
93
|
-
description?: string | undefined;
|
|
94
94
|
annotations?: Record<string, string> | undefined;
|
|
95
95
|
thumbnail?: string | undefined;
|
|
96
96
|
timestamp?: string | undefined;
|
|
@@ -102,9 +102,9 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
|
|
|
102
102
|
items: {
|
|
103
103
|
name: string;
|
|
104
104
|
uri: string;
|
|
105
|
+
description?: string | undefined;
|
|
105
106
|
mimeType?: string | undefined;
|
|
106
107
|
title?: string | undefined;
|
|
107
|
-
description?: string | undefined;
|
|
108
108
|
annotations?: Record<string, string> | undefined;
|
|
109
109
|
thumbnail?: string | undefined;
|
|
110
110
|
timestamp?: string | undefined;
|
|
@@ -116,9 +116,9 @@ declare const ResourceSearchOutputSchema: z.ZodObject<{
|
|
|
116
116
|
items: {
|
|
117
117
|
name: string;
|
|
118
118
|
uri: string;
|
|
119
|
+
description?: string | undefined;
|
|
119
120
|
mimeType?: string | undefined;
|
|
120
121
|
title?: string | undefined;
|
|
121
|
-
description?: string | undefined;
|
|
122
122
|
annotations?: Record<string, string> | undefined;
|
|
123
123
|
thumbnail?: string | undefined;
|
|
124
124
|
timestamp?: string | undefined;
|
|
@@ -148,26 +148,26 @@ declare const ResourceCreateInputSchema: z.ZodObject<{
|
|
|
148
148
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
150
150
|
name: string;
|
|
151
|
+
resourceName: string;
|
|
151
152
|
content: {
|
|
152
153
|
type: "text" | "blob";
|
|
153
154
|
data: string;
|
|
154
155
|
mimeType?: string | undefined;
|
|
155
156
|
};
|
|
156
|
-
|
|
157
|
+
description?: string | undefined;
|
|
157
158
|
metadata?: Record<string, any> | undefined;
|
|
158
159
|
title?: string | undefined;
|
|
159
|
-
description?: string | undefined;
|
|
160
160
|
}, {
|
|
161
161
|
name: string;
|
|
162
|
+
resourceName: string;
|
|
162
163
|
content: {
|
|
163
164
|
type: "text" | "blob";
|
|
164
165
|
data: string;
|
|
165
166
|
mimeType?: string | undefined;
|
|
166
167
|
};
|
|
167
|
-
|
|
168
|
+
description?: string | undefined;
|
|
168
169
|
metadata?: Record<string, any> | undefined;
|
|
169
170
|
title?: string | undefined;
|
|
170
|
-
description?: string | undefined;
|
|
171
171
|
}>;
|
|
172
172
|
declare const ResourceCreateOutputSchema: z.ZodObject<{
|
|
173
173
|
name: z.ZodString;
|
|
@@ -182,9 +182,9 @@ declare const ResourceCreateOutputSchema: z.ZodObject<{
|
|
|
182
182
|
}, "strip", z.ZodTypeAny, {
|
|
183
183
|
name: string;
|
|
184
184
|
uri: string;
|
|
185
|
+
description?: string | undefined;
|
|
185
186
|
mimeType?: string | undefined;
|
|
186
187
|
title?: string | undefined;
|
|
187
|
-
description?: string | undefined;
|
|
188
188
|
annotations?: Record<string, string> | undefined;
|
|
189
189
|
thumbnail?: string | undefined;
|
|
190
190
|
timestamp?: string | undefined;
|
|
@@ -192,9 +192,9 @@ declare const ResourceCreateOutputSchema: z.ZodObject<{
|
|
|
192
192
|
}, {
|
|
193
193
|
name: string;
|
|
194
194
|
uri: string;
|
|
195
|
+
description?: string | undefined;
|
|
195
196
|
mimeType?: string | undefined;
|
|
196
197
|
title?: string | undefined;
|
|
197
|
-
description?: string | undefined;
|
|
198
198
|
annotations?: Record<string, string> | undefined;
|
|
199
199
|
thumbnail?: string | undefined;
|
|
200
200
|
timestamp?: string | undefined;
|
|
@@ -223,6 +223,8 @@ declare const ResourceUpdateInputSchema: z.ZodObject<{
|
|
|
223
223
|
}, "strip", z.ZodTypeAny, {
|
|
224
224
|
name: string;
|
|
225
225
|
uri: string;
|
|
226
|
+
description?: string | undefined;
|
|
227
|
+
resourceName?: string | undefined;
|
|
226
228
|
metadata?: Record<string, any> | undefined;
|
|
227
229
|
content?: {
|
|
228
230
|
type: "text" | "blob";
|
|
@@ -230,11 +232,11 @@ declare const ResourceUpdateInputSchema: z.ZodObject<{
|
|
|
230
232
|
mimeType?: string | undefined;
|
|
231
233
|
} | undefined;
|
|
232
234
|
title?: string | undefined;
|
|
233
|
-
description?: string | undefined;
|
|
234
|
-
resourceName?: string | undefined;
|
|
235
235
|
}, {
|
|
236
236
|
name: string;
|
|
237
237
|
uri: string;
|
|
238
|
+
description?: string | undefined;
|
|
239
|
+
resourceName?: string | undefined;
|
|
238
240
|
metadata?: Record<string, any> | undefined;
|
|
239
241
|
content?: {
|
|
240
242
|
type: "text" | "blob";
|
|
@@ -242,8 +244,6 @@ declare const ResourceUpdateInputSchema: z.ZodObject<{
|
|
|
242
244
|
mimeType?: string | undefined;
|
|
243
245
|
} | undefined;
|
|
244
246
|
title?: string | undefined;
|
|
245
|
-
description?: string | undefined;
|
|
246
|
-
resourceName?: string | undefined;
|
|
247
247
|
}>;
|
|
248
248
|
declare const ResourceUpdateOutputSchema: z.ZodObject<{
|
|
249
249
|
name: z.ZodString;
|
|
@@ -258,9 +258,9 @@ declare const ResourceUpdateOutputSchema: z.ZodObject<{
|
|
|
258
258
|
}, "strip", z.ZodTypeAny, {
|
|
259
259
|
name: string;
|
|
260
260
|
uri: string;
|
|
261
|
+
description?: string | undefined;
|
|
261
262
|
mimeType?: string | undefined;
|
|
262
263
|
title?: string | undefined;
|
|
263
|
-
description?: string | undefined;
|
|
264
264
|
annotations?: Record<string, string> | undefined;
|
|
265
265
|
thumbnail?: string | undefined;
|
|
266
266
|
timestamp?: string | undefined;
|
|
@@ -268,9 +268,9 @@ declare const ResourceUpdateOutputSchema: z.ZodObject<{
|
|
|
268
268
|
}, {
|
|
269
269
|
name: string;
|
|
270
270
|
uri: string;
|
|
271
|
+
description?: string | undefined;
|
|
271
272
|
mimeType?: string | undefined;
|
|
272
273
|
title?: string | undefined;
|
|
273
|
-
description?: string | undefined;
|
|
274
274
|
annotations?: Record<string, string> | undefined;
|
|
275
275
|
thumbnail?: string | undefined;
|
|
276
276
|
timestamp?: string | undefined;
|
|
@@ -308,16 +308,16 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
|
|
|
308
308
|
hasDelete: z.ZodOptional<z.ZodBoolean>;
|
|
309
309
|
}, "strip", z.ZodTypeAny, {
|
|
310
310
|
name: string;
|
|
311
|
-
title: string;
|
|
312
311
|
description: string;
|
|
312
|
+
title: string;
|
|
313
313
|
icon: string;
|
|
314
314
|
hasCreate?: boolean | undefined;
|
|
315
315
|
hasUpdate?: boolean | undefined;
|
|
316
316
|
hasDelete?: boolean | undefined;
|
|
317
317
|
}, {
|
|
318
318
|
name: string;
|
|
319
|
-
title: string;
|
|
320
319
|
description: string;
|
|
320
|
+
title: string;
|
|
321
321
|
icon: string;
|
|
322
322
|
hasCreate?: boolean | undefined;
|
|
323
323
|
hasUpdate?: boolean | undefined;
|
|
@@ -326,8 +326,8 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
|
|
|
326
326
|
}, "strip", z.ZodTypeAny, {
|
|
327
327
|
resources: {
|
|
328
328
|
name: string;
|
|
329
|
-
title: string;
|
|
330
329
|
description: string;
|
|
330
|
+
title: string;
|
|
331
331
|
icon: string;
|
|
332
332
|
hasCreate?: boolean | undefined;
|
|
333
333
|
hasUpdate?: boolean | undefined;
|
|
@@ -336,8 +336,8 @@ declare const ResourcesListOutputSchema: z.ZodObject<{
|
|
|
336
336
|
}, {
|
|
337
337
|
resources: {
|
|
338
338
|
name: string;
|
|
339
|
-
title: string;
|
|
340
339
|
description: string;
|
|
340
|
+
title: string;
|
|
341
341
|
icon: string;
|
|
342
342
|
hasCreate?: boolean | undefined;
|
|
343
343
|
hasUpdate?: boolean | undefined;
|
package/dist/views.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ declare const ViewsListOutputSchema: z.ZodObject<{
|
|
|
18
18
|
title: string;
|
|
19
19
|
icon: string;
|
|
20
20
|
id?: string | undefined;
|
|
21
|
-
url?: string | undefined;
|
|
22
21
|
name?: string | undefined;
|
|
22
|
+
url?: string | undefined;
|
|
23
23
|
description?: string | undefined;
|
|
24
24
|
resourceName?: string | undefined;
|
|
25
25
|
mimeTypePattern?: string | undefined;
|
|
@@ -29,11 +29,11 @@ declare const ViewsListOutputSchema: z.ZodObject<{
|
|
|
29
29
|
title: string;
|
|
30
30
|
icon: string;
|
|
31
31
|
id?: string | undefined;
|
|
32
|
-
url?: string | undefined;
|
|
33
32
|
name?: string | undefined;
|
|
34
|
-
|
|
33
|
+
url?: string | undefined;
|
|
35
34
|
description?: string | undefined;
|
|
36
35
|
resourceName?: string | undefined;
|
|
36
|
+
tools?: string[] | undefined;
|
|
37
37
|
mimeTypePattern?: string | undefined;
|
|
38
38
|
prompt?: string | undefined;
|
|
39
39
|
installBehavior?: "open" | "none" | "autoPin" | undefined;
|
|
@@ -44,8 +44,8 @@ declare const ViewsListOutputSchema: z.ZodObject<{
|
|
|
44
44
|
title: string;
|
|
45
45
|
icon: string;
|
|
46
46
|
id?: string | undefined;
|
|
47
|
-
url?: string | undefined;
|
|
48
47
|
name?: string | undefined;
|
|
48
|
+
url?: string | undefined;
|
|
49
49
|
description?: string | undefined;
|
|
50
50
|
resourceName?: string | undefined;
|
|
51
51
|
mimeTypePattern?: string | undefined;
|
|
@@ -57,11 +57,11 @@ declare const ViewsListOutputSchema: z.ZodObject<{
|
|
|
57
57
|
title: string;
|
|
58
58
|
icon: string;
|
|
59
59
|
id?: string | undefined;
|
|
60
|
-
url?: string | undefined;
|
|
61
60
|
name?: string | undefined;
|
|
62
|
-
|
|
61
|
+
url?: string | undefined;
|
|
63
62
|
description?: string | undefined;
|
|
64
63
|
resourceName?: string | undefined;
|
|
64
|
+
tools?: string[] | undefined;
|
|
65
65
|
mimeTypePattern?: string | undefined;
|
|
66
66
|
prompt?: string | undefined;
|
|
67
67
|
installBehavior?: "open" | "none" | "autoPin" | undefined;
|
package/package.json
CHANGED
package/src/bindings/index.ts
CHANGED
|
@@ -52,6 +52,8 @@ export type {
|
|
|
52
52
|
} from "./deconfig/index.ts";
|
|
53
53
|
export { deconfigTools } from "./deconfig/types.ts";
|
|
54
54
|
|
|
55
|
+
export { streamToResponse } from "./language-model/utils.ts";
|
|
56
|
+
|
|
55
57
|
export const WellKnownBindings = {
|
|
56
58
|
Channel: CHANNEL_BINDING,
|
|
57
59
|
View: VIEWS_BINDING,
|