@5ss/ai-tools 3.5.1 → 3.7.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.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/vendors/shipstation/index.d.ts +994 -0
- package/dist/vendors/shipstation/index.d.ts.map +1 -0
- package/dist/vendors/shipstation/index.js +706 -0
- package/dist/vendors/shipstation/index.js.map +1 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@5ss/ai-tools` are documented here.
|
|
|
4
4
|
|
|
5
5
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Releases are cut by [semantic-release](https://semantic-release.gitbook.io/) from [conventional commits](https://www.conventionalcommits.org/).
|
|
6
6
|
|
|
7
|
+
## [3.7.0](https://github.com/five-star-solutions-co/ai-tools/compare/v3.6.0...v3.7.0) (2026-08-29)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **core:** reorganize core modules ([9dc11e4](https://github.com/five-star-solutions-co/ai-tools/commit/9dc11e4c7c37b1016a1a55af2be7f7e9db5e71e0))
|
|
12
|
+
|
|
13
|
+
## [3.6.0](https://github.com/five-star-solutions-co/ai-tools/compare/v3.5.1...v3.6.0) (2026-08-28)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **core:** add shipment functionality ([beb0d84](https://github.com/five-star-solutions-co/ai-tools/commit/beb0d84898c786380b56ac83c5f0d8d1d1d1178e))
|
|
18
|
+
|
|
7
19
|
## [3.5.1](https://github.com/five-star-solutions-co/ai-tools/compare/v3.5.0...v3.5.1) (2026-08-27)
|
|
8
20
|
|
|
9
21
|
## [3.5.0](https://github.com/five-star-solutions-co/ai-tools/compare/v3.4.0...v3.5.0) (2026-08-27)
|
|
@@ -135,6 +147,10 @@ Public surfaces removed or renamed since **v1.6.1** — next release **must** be
|
|
|
135
147
|
| `mergeToolContext` / adapter `createContext` | Explicit `undefined` fields **do not** erase base `signal` / `fetch` / `auth` / `now` |
|
|
136
148
|
| MCP `context` | Still accepts static `ToolContext` **or** factory `() => ToolContext \| Promise<…>` (and deprecated `contextFactory`) |
|
|
137
149
|
|
|
150
|
+
### Added
|
|
151
|
+
|
|
152
|
+
- ShipStation V2 vendor pack with API-key auth and paginated label and shipment read tools.
|
|
153
|
+
|
|
138
154
|
### Notes (compat preserved)
|
|
139
155
|
|
|
140
156
|
- Adapter `createContext` callbacks use the installed framework execution-context types.
|
package/README.md
CHANGED
|
@@ -161,6 +161,7 @@ defineTool / defineModule
|
|
|
161
161
|
| `@5ss/ai-tools/woocommerce` | orders, notes, refunds, products, variations, customers, coupons, categories | [woocommerce](./docs/vendors/woocommerce.md) |
|
|
162
162
|
| `@5ss/ai-tools/katana` | sales/purchase/manufacturing orders, products, materials, customers, suppliers, inventory | [katana](./docs/vendors/katana.md) |
|
|
163
163
|
| `@5ss/ai-tools/amazon-sp-api` | orders + items, FBA inventory, reports + documents, catalog search | [amazon-sp-api](./docs/vendors/amazon-sp-api.md) |
|
|
164
|
+
| `@5ss/ai-tools/shipstation` | paginated labels and shipments | [shipstation](./docs/vendors/shipstation.md) |
|
|
164
165
|
|
|
165
166
|
Auth fields are **snake_case** (`api_key`, `bot_token`, `access_key_id`, …).
|
|
166
167
|
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/core/bind.ts","../../src/generated/module-keys.ts","../../src/core/contracts.ts","../../src/core/catalog.ts"],"sourcesContent":["/**\n * Per-invocation auth/context bind for multi-tenant hosts.\n */\n\nimport { mergeToolContext } from './context'\nimport type { ToolSelection } from './filter-tools'\nimport { filterModuleTools } from './filter-tools'\nimport type { ToolHooks } from './hooks'\nimport { ToolError } from './errors'\nimport type { AuthDefinition, ModuleDefinition, ToolContext, ToolDefinition, ToolExecution } from './types'\n\nfunction assertAuth<TAuth>(auth: AuthDefinition<TAuth>, value: unknown): TAuth | undefined {\n\tif (auth.type === 'none') {\n\t\tif (value !== undefined) throw new ToolError('This tool does not accept auth', { code: 'bad_auth' })\n\t\treturn undefined\n\t}\n\tconst parsed = auth.schema.safeParse(value)\n\tif (!parsed.success) {\n\t\tthrow new ToolError('Invalid auth credentials', {\n\t\t\tcode: 'bad_auth',\n\t\t\tdetails: { issues: parsed.error.issues.map((i) => i.message) }\n\t\t})\n\t}\n\treturn parsed.data\n}\n\nexport type BindModuleOptions<TAuth = unknown> = {\n\tresolveAuth?: (ctx: ToolContext) => TAuth | Promise<TAuth>\n\tresolveContext?: (ctx: ToolContext) => ToolContext | Promise<ToolContext>\n\thooks?: ToolHooks\n\t/**\n\t * Restrict the tool surface after bind.\n\t * Prefer composable `onlyTools` / `exceptTools` when filtering outside bind.\n\t */\n\ttools?: ToolSelection\n}\n\nasync function resolveBoundContext<TAuth>(\n\tmoduleAuth: AuthDefinition<TAuth>,\n\tincoming: ToolContext,\n\toptions: BindModuleOptions<TAuth>\n): Promise<ToolContext> {\n\tconst base = options.resolveContext\n\t\t? mergeToolContext(incoming, await options.resolveContext(incoming))\n\t\t: { ...incoming }\n\tif (moduleAuth.type === 'none') return base\n\tif (!options.resolveAuth) {\n\t\tthrow new ToolError('resolveAuth is required for modules that declare auth', { code: 'bad_auth' })\n\t}\n\tconst auth = assertAuth(moduleAuth, await options.resolveAuth(base))\n\treturn {\n\t\t...base,\n\t\t...(auth !== undefined && { auth })\n\t}\n}\n\nexport function bindTool<TInput, TOutput, TAuth = unknown>(\n\ttool: ToolDefinition<TInput, TOutput>,\n\tmoduleAuth: AuthDefinition<TAuth>,\n\toptions: BindModuleOptions<TAuth>\n): ToolDefinition<TInput, TOutput> {\n\tconst previous = tool.execution ?? { run: tool.execute }\n\tconst bindContext = async (ctx: ToolContext): Promise<ToolContext> => {\n\t\tconst base = previous.bindContext ? await previous.bindContext(ctx) : ctx\n\t\treturn resolveBoundContext(moduleAuth, base, options)\n\t}\n\tconst execution: ToolExecution = {\n\t\t...previous,\n\t\tbindContext,\n\t\t...(options.hooks && { hooks: options.hooks })\n\t}\n\treturn {\n\t\t...tool,\n\t\texecution,\n\t\texecute: async (input, ctx) => execution.run(input, await bindContext(ctx))\n\t}\n}\n\nexport function bindModule<TAuth>(\n\tmodule: ModuleDefinition<TAuth>,\n\toptions: BindModuleOptions<TAuth>\n): ModuleDefinition<TAuth> {\n\tif (module.auth.type !== 'none' && !options.resolveAuth) {\n\t\tthrow new ToolError(`Module ${module.id} requires resolveAuth`, { code: 'bad_auth' })\n\t}\n\tconst scoped = options.tools !== undefined ? filterModuleTools(module, options.tools) : module\n\treturn {\n\t\t...scoped,\n\t\ttools: scoped.tools.map((tool) => bindTool(tool, scoped.auth, options))\n\t}\n}\n","// AUTO-GENERATED by `bun run codegen`. Do not edit by hand.\n/** Flat public export keys under src/{modules,vendors}. */\nexport const moduleKeys = [\n\t'amazon-sp-api',\n\t'artifacts',\n\t'bedrock-agentcore-browser',\n\t'bedrock-agentcore-code-interpreter',\n\t'browser',\n\t'calendar',\n\t'cloudflare-browser',\n\t'cloudflare-email',\n\t'cloudflare-sandbox',\n\t'code-sandbox',\n\t'content-type',\n\t'crypto',\n\t'document-extract',\n\t'document-render',\n\t'email',\n\t'email-message',\n\t'eventbridge-scheduler',\n\t'files',\n\t'image',\n\t'imessage',\n\t'katana',\n\t'mastra-vector',\n\t'messaging',\n\t'pinecone',\n\t'qdrant',\n\t'queue',\n\t'rag',\n\t'resend',\n\t's3',\n\t'scheduler',\n\t'skills',\n\t'slack',\n\t'sqs',\n\t'supabase-vector',\n\t'tasks',\n\t'teams',\n\t'telegram',\n\t'textract',\n\t'vector-store',\n\t'web-fetch',\n\t'woocommerce'\n] as const\n\nexport type ModuleKey = (typeof moduleKeys)[number]\n\n/** Capability seams under src/modules (brand-neutral model copy). */\nexport const moduleSeamKeys = [\n\t'artifacts',\n\t'browser',\n\t'calendar',\n\t'code-sandbox',\n\t'content-type',\n\t'crypto',\n\t'document-extract',\n\t'document-render',\n\t'email',\n\t'email-message',\n\t'files',\n\t'image',\n\t'messaging',\n\t'queue',\n\t'rag',\n\t'scheduler',\n\t'skills',\n\t'tasks',\n\t'vector-store',\n\t'web-fetch'\n] as const\n\nexport type ModuleSeamKey = (typeof moduleSeamKeys)[number]\n","import { flatMap, isPlainObject, isString } from 'es-toolkit'\nimport { isArray } from 'es-toolkit/compat'\nimport { toJSONSchema } from 'zod'\n\nimport { moduleSeamKeys } from '../generated/module-keys'\nimport type { ModuleDefinition, ToolDefinition } from './types'\nimport { duplicatesBy } from './unique'\n\nconst FORBIDDEN_MODEL_COPY =\n\t/\\b(api[_ ]?key|apiKey|bearer token|process\\.env|vault|secret key|authorization header|withAuth)\\b/i\n\n/**\n * Brand / vendor product names banned on **capability seam** model-facing copy\n * (module + tool description and input .describe()). Vendors may name their product.\n * Keep list brand-focused; avoid bare words like \"teams\" that appear in normal English.\n */\nconst FORBIDDEN_SEAM_BRAND_COPY =\n\t/\\b(Telegram|Slack|iMessage|Resend|Cloudflare|Textract|Pinecone|Qdrant|Supabase|WooCommerce|Katana|Amazon|Bot Framework|Microsoft Teams|Photon|Spectrum|Mastra|PgVector|OpenAI)\\b|\\bS3\\b|\\bR2\\b/\n\n/** Seam module ids from codegen (`src/modules/*` only — not hand-maintained). */\nconst SEAM_MODULE_IDS = new Set<string>(moduleSeamKeys)\n\nconst KEBAB_ID = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/\n\nexport type ContractIssue = {\n\tcode:\n\t\t| 'duplicate_tool_id'\n\t\t| 'empty_description'\n\t\t| 'empty_field_description'\n\t\t| 'forbidden_model_copy'\n\t\t| 'invalid_tool_id'\n\t\t| 'missing_name'\n\tmessage: string\n\tpath: string\n}\n\nexport type ContractResult = {\n\tok: boolean\n\tissues: ContractIssue[]\n}\n\nexport type CheckModelCopyOptions = {\n\t/** When true, also ban vendor brand names (capability seams). */\n\tseam?: boolean\n}\n\nfunction issue(path: string, code: ContractIssue['code'], message: string): ContractIssue {\n\treturn { path, code, message }\n}\n\nfunction checkModelCopy(\n\tpath: string,\n\ttext: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions = {}\n): void {\n\tconst trimmed = text.trim()\n\tif (!trimmed) {\n\t\tissues.push(issue(path, 'empty_description', 'Model-facing description is empty'))\n\t\treturn\n\t}\n\tif (FORBIDDEN_MODEL_COPY.test(trimmed)) {\n\t\tissues.push(\n\t\t\tissue(\n\t\t\t\tpath,\n\t\t\t\t'forbidden_model_copy',\n\t\t\t\t'Model-facing copy must not mention credentials, env vars, vaults, or host wiring'\n\t\t\t)\n\t\t)\n\t}\n\tif (options.seam && FORBIDDEN_SEAM_BRAND_COPY.test(trimmed)) {\n\t\tissues.push(\n\t\t\tissue(\n\t\t\t\tpath,\n\t\t\t\t'forbidden_model_copy',\n\t\t\t\t'Seam model-facing copy must not name vendors or products (use channel / bound store / provider-neutral language)'\n\t\t\t)\n\t\t)\n\t}\n}\n\nfunction fieldDescribes(\n\tschema: ToolDefinition['inputSchema'],\n\tpath: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions = {}\n): void {\n\tcheckFieldDescriptions(toJSONSchema(schema), `${path}.input`, issues, options)\n}\n\nfunction checkFieldDescriptions(\n\tschema: unknown,\n\tpath: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions\n): void {\n\tif (!isPlainObject(schema)) return\n\tconst properties = schema['properties']\n\tif (isPlainObject(properties)) {\n\t\tfor (const [key, value] of Object.entries(properties)) {\n\t\t\tif (!isPlainObject(value)) continue\n\t\t\tconst fieldPath = `${path}.${key}`\n\t\t\tconst description = value['description']\n\t\t\tif (!isString(description) || description.trim().length === 0) {\n\t\t\t\tissues.push(\n\t\t\t\t\tissue(fieldPath, 'empty_field_description', `Input field \"${key}\" is missing a .describe() for the model`)\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tcheckModelCopy(fieldPath, description, issues, options)\n\t\t\t}\n\t\t\tcheckFieldDescriptions(value, fieldPath, issues, options)\n\t\t}\n\t}\n\n\tfor (const [key, value] of Object.entries(schema)) {\n\t\tif (key === 'properties') continue\n\t\tif (isArray(value)) {\n\t\t\tfor (const [index, item] of value.entries()) {\n\t\t\t\tcheckFieldDescriptions(item, `${path}.${key}[${index}]`, issues, options)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tcheckFieldDescriptions(value, `${path}.${key}`, issues, options)\n\t}\n}\n\nexport function validateTool(\n\ttool: ToolDefinition,\n\tpathPrefix = tool.id,\n\toptions: CheckModelCopyOptions = {}\n): ContractResult {\n\tconst issues: ContractIssue[] = []\n\n\tif (!tool.id.trim() || !KEBAB_ID.test(tool.id)) {\n\t\tissues.push(issue(`${pathPrefix}.id`, 'invalid_tool_id', `Tool id must be kebab-case (got \"${tool.id}\")`))\n\t}\n\tif (!tool.name.trim()) {\n\t\tissues.push(issue(`${pathPrefix}.name`, 'missing_name', 'Tool name is required'))\n\t}\n\tcheckModelCopy(`${pathPrefix}.description`, tool.description, issues, options)\n\tfieldDescribes(tool.inputSchema, pathPrefix, issues, options)\n\n\treturn { ok: issues.length === 0, issues }\n}\n\nexport function validateModule(module: ModuleDefinition): ContractResult {\n\tconst issues: ContractIssue[] = []\n\tconst seam = SEAM_MODULE_IDS.has(module.id)\n\tconst copyOpts: CheckModelCopyOptions = seam ? { seam: true } : {}\n\n\tcheckModelCopy(`module.${module.id}.description`, module.description, issues, copyOpts)\n\n\tfor (const id of duplicatesBy(module.tools, (tool) => tool.id)) {\n\t\tissues.push(issue(`module.${module.id}.tools.${id}`, 'duplicate_tool_id', `Duplicate tool id \"${id}\"`))\n\t}\n\n\tissues.push(\n\t\t...flatMap(module.tools, (tool) => validateTool(tool, `module.${module.id}.tools.${tool.id}`, copyOpts).issues)\n\t)\n\n\treturn { ok: issues.length === 0, issues }\n}\n\nexport function assertContracts(result: ContractResult, label = 'contract'): void {\n\tif (result.ok) return\n\tconst detail = result.issues.map((i) => `${i.path}: ${i.message}`).join('\\n')\n\tthrow new Error(`${label} failed:\\n${detail}`)\n}\n","import { toJSONSchema } from 'zod'\n\nimport type { AuthDefinition, ModuleDefinition, ToolDefinition } from './types'\n\nexport type ToolCatalogEntry = {\n\tdescription: string\n\tid: string\n\tinputJsonSchema: Record<string, unknown>\n\tname: string\n\toutputJsonSchema: Record<string, unknown>\n\truntime: ToolDefinition['meta']['runtime']\n\tsideEffect: ToolDefinition['meta']['sideEffect']\n\ttags: readonly string[]\n\tidempotent?: boolean | undefined\n\tlongRunning?: boolean | undefined\n\trequiresConfirmation?: boolean | undefined\n\tsupportsCancel?: boolean | undefined\n\tsupportsProgress?: boolean | undefined\n\tnetwork?: boolean | undefined\n\tartifacts?: boolean | undefined\n}\n\nexport type ModuleCatalogEntry = {\n\tauthType: AuthDefinition<unknown>['type']\n\tdescription: string\n\tid: string\n\truntime: ModuleDefinition['runtime']\n\ttitle: string\n\ttools: ToolCatalogEntry[]\n\t/** Inline SVG when the pack has a logo. */\n\tlogo?: string | undefined\n\tcategories: readonly string[]\n\tclassification?: ModuleDefinition['classification']\n\ttags: readonly string[]\n}\n\nexport function toToolCatalogEntry(tool: ToolDefinition): ToolCatalogEntry {\n\treturn {\n\t\tid: tool.id,\n\t\tname: tool.name,\n\t\tdescription: tool.description,\n\t\truntime: tool.meta.runtime,\n\t\tsideEffect: tool.meta.sideEffect,\n\t\ttags: tool.meta.tags ?? [],\n\t\tidempotent: tool.meta.idempotent,\n\t\tlongRunning: tool.meta.longRunning,\n\t\trequiresConfirmation: tool.meta.requiresConfirmation,\n\t\tsupportsCancel: tool.meta.supportsCancel,\n\t\tsupportsProgress: tool.meta.supportsProgress,\n\t\tnetwork: tool.meta.network,\n\t\tartifacts: tool.meta.artifacts,\n\t\tinputJsonSchema: toJSONSchema(tool.inputSchema),\n\t\toutputJsonSchema: toJSONSchema(tool.outputSchema)\n\t}\n}\n\nexport function toModuleCatalogEntry(module: ModuleDefinition): ModuleCatalogEntry {\n\treturn {\n\t\tid: module.id,\n\t\ttitle: module.title,\n\t\tdescription: module.description,\n\t\truntime: module.runtime,\n\t\tauthType: module.auth.type,\n\t\ttools: module.tools.map(toToolCatalogEntry),\n\t\tcategories: module.categories,\n\t\ttags: module.tags ?? [],\n\t\t...(module.classification !== undefined && { classification: module.classification }),\n\t\t...(module.logo !== undefined && { logo: module.logo })\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,WAAkB,MAA6B,OAAmC;CAC1F,IAAI,KAAK,SAAS,QAAQ;EACzB,IAAI,UAAU,KAAA,GAAW,MAAM,IAAI,UAAU,kCAAkC,EAAE,MAAM,WAAW,CAAC;EACnG;CACD;CACA,MAAM,SAAS,KAAK,OAAO,UAAU,KAAK;CAC1C,IAAI,CAAC,OAAO,SACX,MAAM,IAAI,UAAU,4BAA4B;EAC/C,MAAM;EACN,SAAS,EAAE,QAAQ,OAAO,MAAM,OAAO,KAAK,MAAM,EAAE,OAAO,EAAE;CAC9D,CAAC;CAEF,OAAO,OAAO;AACf;AAaA,eAAe,oBACd,YACA,UACA,SACuB;CACvB,MAAM,OAAO,QAAQ,iBAClB,iBAAiB,UAAU,MAAM,QAAQ,eAAe,QAAQ,CAAC,IACjE,EAAE,GAAG,SAAS;CACjB,IAAI,WAAW,SAAS,QAAQ,OAAO;CACvC,IAAI,CAAC,QAAQ,aACZ,MAAM,IAAI,UAAU,yDAAyD,EAAE,MAAM,WAAW,CAAC;CAElG,MAAM,OAAO,WAAW,YAAY,MAAM,QAAQ,YAAY,IAAI,CAAC;CACnE,OAAO;EACN,GAAG;EACH,GAAI,SAAS,KAAA,KAAa,EAAE,KAAK;CAClC;AACD;AAEA,SAAgB,SACf,MACA,YACA,SACkC;CAClC,MAAM,WAAW,KAAK,aAAa,EAAE,KAAK,KAAK,QAAQ;CACvD,MAAM,cAAc,OAAO,QAA2C;EAErE,OAAO,oBAAoB,YADd,SAAS,cAAc,MAAM,SAAS,YAAY,GAAG,IAAI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AAgB,KAAK,KAAK;EAC1B,kBAAkB,KAAK,KAAK;EAC5B,SAAS,KAAK,KAAK;EACnB,WAAW,KAAK,KAAK;EACrB,iBAAiB,aAAa,KAAK,WAAW;EAC9C,kBAAkB,aAAa,KAAK,YAAY;CACjD;AACD;AAEA,SAAgB,qBAAqB,QAA8C;CAClF,OAAO;EACN,IAAI,OAAO;EACX,OAAO,OAAO;EACd,aAAa,OAAO;EACpB,SAAS,OAAO;EAChB,UAAU,OAAO,KAAK;EACtB,OAAO,OAAO,MAAM,IAAI,kBAAkB;EAC1C,YAAY,OAAO;EACnB,MAAM,OAAO,QAAQ,CAAC;EACtB,GAAI,OAAO,mBAAmB,KAAA,KAAa,EAAE,gBAAgB,OAAO,eAAe;EACnF,GAAI,OAAO,SAAS,KAAA,KAAa,EAAE,MAAM,OAAO,KAAK;CACtD;AACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/core/bind.ts","../../src/generated/module-keys.ts","../../src/core/contracts.ts","../../src/core/catalog.ts"],"sourcesContent":["/**\n * Per-invocation auth/context bind for multi-tenant hosts.\n */\n\nimport { mergeToolContext } from './context'\nimport type { ToolSelection } from './filter-tools'\nimport { filterModuleTools } from './filter-tools'\nimport type { ToolHooks } from './hooks'\nimport { ToolError } from './errors'\nimport type { AuthDefinition, ModuleDefinition, ToolContext, ToolDefinition, ToolExecution } from './types'\n\nfunction assertAuth<TAuth>(auth: AuthDefinition<TAuth>, value: unknown): TAuth | undefined {\n\tif (auth.type === 'none') {\n\t\tif (value !== undefined) throw new ToolError('This tool does not accept auth', { code: 'bad_auth' })\n\t\treturn undefined\n\t}\n\tconst parsed = auth.schema.safeParse(value)\n\tif (!parsed.success) {\n\t\tthrow new ToolError('Invalid auth credentials', {\n\t\t\tcode: 'bad_auth',\n\t\t\tdetails: { issues: parsed.error.issues.map((i) => i.message) }\n\t\t})\n\t}\n\treturn parsed.data\n}\n\nexport type BindModuleOptions<TAuth = unknown> = {\n\tresolveAuth?: (ctx: ToolContext) => TAuth | Promise<TAuth>\n\tresolveContext?: (ctx: ToolContext) => ToolContext | Promise<ToolContext>\n\thooks?: ToolHooks\n\t/**\n\t * Restrict the tool surface after bind.\n\t * Prefer composable `onlyTools` / `exceptTools` when filtering outside bind.\n\t */\n\ttools?: ToolSelection\n}\n\nasync function resolveBoundContext<TAuth>(\n\tmoduleAuth: AuthDefinition<TAuth>,\n\tincoming: ToolContext,\n\toptions: BindModuleOptions<TAuth>\n): Promise<ToolContext> {\n\tconst base = options.resolveContext\n\t\t? mergeToolContext(incoming, await options.resolveContext(incoming))\n\t\t: { ...incoming }\n\tif (moduleAuth.type === 'none') return base\n\tif (!options.resolveAuth) {\n\t\tthrow new ToolError('resolveAuth is required for modules that declare auth', { code: 'bad_auth' })\n\t}\n\tconst auth = assertAuth(moduleAuth, await options.resolveAuth(base))\n\treturn {\n\t\t...base,\n\t\t...(auth !== undefined && { auth })\n\t}\n}\n\nexport function bindTool<TInput, TOutput, TAuth = unknown>(\n\ttool: ToolDefinition<TInput, TOutput>,\n\tmoduleAuth: AuthDefinition<TAuth>,\n\toptions: BindModuleOptions<TAuth>\n): ToolDefinition<TInput, TOutput> {\n\tconst previous = tool.execution ?? { run: tool.execute }\n\tconst bindContext = async (ctx: ToolContext): Promise<ToolContext> => {\n\t\tconst base = previous.bindContext ? await previous.bindContext(ctx) : ctx\n\t\treturn resolveBoundContext(moduleAuth, base, options)\n\t}\n\tconst execution: ToolExecution = {\n\t\t...previous,\n\t\tbindContext,\n\t\t...(options.hooks && { hooks: options.hooks })\n\t}\n\treturn {\n\t\t...tool,\n\t\texecution,\n\t\texecute: async (input, ctx) => execution.run(input, await bindContext(ctx))\n\t}\n}\n\nexport function bindModule<TAuth>(\n\tmodule: ModuleDefinition<TAuth>,\n\toptions: BindModuleOptions<TAuth>\n): ModuleDefinition<TAuth> {\n\tif (module.auth.type !== 'none' && !options.resolveAuth) {\n\t\tthrow new ToolError(`Module ${module.id} requires resolveAuth`, { code: 'bad_auth' })\n\t}\n\tconst scoped = options.tools !== undefined ? filterModuleTools(module, options.tools) : module\n\treturn {\n\t\t...scoped,\n\t\ttools: scoped.tools.map((tool) => bindTool(tool, scoped.auth, options))\n\t}\n}\n","// AUTO-GENERATED by `bun run codegen`. Do not edit by hand.\n/** Flat public export keys under src/{modules,vendors}. */\nexport const moduleKeys = [\n\t'amazon-sp-api',\n\t'artifacts',\n\t'bedrock-agentcore-browser',\n\t'bedrock-agentcore-code-interpreter',\n\t'browser',\n\t'calendar',\n\t'cloudflare-browser',\n\t'cloudflare-email',\n\t'cloudflare-sandbox',\n\t'code-sandbox',\n\t'content-type',\n\t'crypto',\n\t'document-extract',\n\t'document-render',\n\t'email',\n\t'email-message',\n\t'eventbridge-scheduler',\n\t'files',\n\t'image',\n\t'imessage',\n\t'katana',\n\t'mastra-vector',\n\t'messaging',\n\t'pinecone',\n\t'qdrant',\n\t'queue',\n\t'rag',\n\t'resend',\n\t's3',\n\t'scheduler',\n\t'shipstation',\n\t'skills',\n\t'slack',\n\t'sqs',\n\t'supabase-vector',\n\t'tasks',\n\t'teams',\n\t'telegram',\n\t'textract',\n\t'vector-store',\n\t'web-fetch',\n\t'woocommerce'\n] as const\n\nexport type ModuleKey = (typeof moduleKeys)[number]\n\n/** Capability seams under src/modules (brand-neutral model copy). */\nexport const moduleSeamKeys = [\n\t'artifacts',\n\t'browser',\n\t'calendar',\n\t'code-sandbox',\n\t'content-type',\n\t'crypto',\n\t'document-extract',\n\t'document-render',\n\t'email',\n\t'email-message',\n\t'files',\n\t'image',\n\t'messaging',\n\t'queue',\n\t'rag',\n\t'scheduler',\n\t'skills',\n\t'tasks',\n\t'vector-store',\n\t'web-fetch'\n] as const\n\nexport type ModuleSeamKey = (typeof moduleSeamKeys)[number]\n","import { flatMap, isPlainObject, isString } from 'es-toolkit'\nimport { isArray } from 'es-toolkit/compat'\nimport { toJSONSchema } from 'zod'\n\nimport { moduleSeamKeys } from '../generated/module-keys'\nimport type { ModuleDefinition, ToolDefinition } from './types'\nimport { duplicatesBy } from './unique'\n\nconst FORBIDDEN_MODEL_COPY =\n\t/\\b(api[_ ]?key|apiKey|bearer token|process\\.env|vault|secret key|authorization header|withAuth)\\b/i\n\n/**\n * Brand / vendor product names banned on **capability seam** model-facing copy\n * (module + tool description and input .describe()). Vendors may name their product.\n * Keep list brand-focused; avoid bare words like \"teams\" that appear in normal English.\n */\nconst FORBIDDEN_SEAM_BRAND_COPY =\n\t/\\b(Telegram|Slack|iMessage|Resend|Cloudflare|Textract|Pinecone|Qdrant|Supabase|WooCommerce|Katana|Amazon|Bot Framework|Microsoft Teams|Photon|Spectrum|Mastra|PgVector|OpenAI)\\b|\\bS3\\b|\\bR2\\b/\n\n/** Seam module ids from codegen (`src/modules/*` only — not hand-maintained). */\nconst SEAM_MODULE_IDS = new Set<string>(moduleSeamKeys)\n\nconst KEBAB_ID = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/\n\nexport type ContractIssue = {\n\tcode:\n\t\t| 'duplicate_tool_id'\n\t\t| 'empty_description'\n\t\t| 'empty_field_description'\n\t\t| 'forbidden_model_copy'\n\t\t| 'invalid_tool_id'\n\t\t| 'missing_name'\n\tmessage: string\n\tpath: string\n}\n\nexport type ContractResult = {\n\tok: boolean\n\tissues: ContractIssue[]\n}\n\nexport type CheckModelCopyOptions = {\n\t/** When true, also ban vendor brand names (capability seams). */\n\tseam?: boolean\n}\n\nfunction issue(path: string, code: ContractIssue['code'], message: string): ContractIssue {\n\treturn { path, code, message }\n}\n\nfunction checkModelCopy(\n\tpath: string,\n\ttext: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions = {}\n): void {\n\tconst trimmed = text.trim()\n\tif (!trimmed) {\n\t\tissues.push(issue(path, 'empty_description', 'Model-facing description is empty'))\n\t\treturn\n\t}\n\tif (FORBIDDEN_MODEL_COPY.test(trimmed)) {\n\t\tissues.push(\n\t\t\tissue(\n\t\t\t\tpath,\n\t\t\t\t'forbidden_model_copy',\n\t\t\t\t'Model-facing copy must not mention credentials, env vars, vaults, or host wiring'\n\t\t\t)\n\t\t)\n\t}\n\tif (options.seam && FORBIDDEN_SEAM_BRAND_COPY.test(trimmed)) {\n\t\tissues.push(\n\t\t\tissue(\n\t\t\t\tpath,\n\t\t\t\t'forbidden_model_copy',\n\t\t\t\t'Seam model-facing copy must not name vendors or products (use channel / bound store / provider-neutral language)'\n\t\t\t)\n\t\t)\n\t}\n}\n\nfunction fieldDescribes(\n\tschema: ToolDefinition['inputSchema'],\n\tpath: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions = {}\n): void {\n\tcheckFieldDescriptions(toJSONSchema(schema), `${path}.input`, issues, options)\n}\n\nfunction checkFieldDescriptions(\n\tschema: unknown,\n\tpath: string,\n\tissues: ContractIssue[],\n\toptions: CheckModelCopyOptions\n): void {\n\tif (!isPlainObject(schema)) return\n\tconst properties = schema['properties']\n\tif (isPlainObject(properties)) {\n\t\tfor (const [key, value] of Object.entries(properties)) {\n\t\t\tif (!isPlainObject(value)) continue\n\t\t\tconst fieldPath = `${path}.${key}`\n\t\t\tconst description = value['description']\n\t\t\tif (!isString(description) || description.trim().length === 0) {\n\t\t\t\tissues.push(\n\t\t\t\t\tissue(fieldPath, 'empty_field_description', `Input field \"${key}\" is missing a .describe() for the model`)\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tcheckModelCopy(fieldPath, description, issues, options)\n\t\t\t}\n\t\t\tcheckFieldDescriptions(value, fieldPath, issues, options)\n\t\t}\n\t}\n\n\tfor (const [key, value] of Object.entries(schema)) {\n\t\tif (key === 'properties') continue\n\t\tif (isArray(value)) {\n\t\t\tfor (const [index, item] of value.entries()) {\n\t\t\t\tcheckFieldDescriptions(item, `${path}.${key}[${index}]`, issues, options)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tcheckFieldDescriptions(value, `${path}.${key}`, issues, options)\n\t}\n}\n\nexport function validateTool(\n\ttool: ToolDefinition,\n\tpathPrefix = tool.id,\n\toptions: CheckModelCopyOptions = {}\n): ContractResult {\n\tconst issues: ContractIssue[] = []\n\n\tif (!tool.id.trim() || !KEBAB_ID.test(tool.id)) {\n\t\tissues.push(issue(`${pathPrefix}.id`, 'invalid_tool_id', `Tool id must be kebab-case (got \"${tool.id}\")`))\n\t}\n\tif (!tool.name.trim()) {\n\t\tissues.push(issue(`${pathPrefix}.name`, 'missing_name', 'Tool name is required'))\n\t}\n\tcheckModelCopy(`${pathPrefix}.description`, tool.description, issues, options)\n\tfieldDescribes(tool.inputSchema, pathPrefix, issues, options)\n\n\treturn { ok: issues.length === 0, issues }\n}\n\nexport function validateModule(module: ModuleDefinition): ContractResult {\n\tconst issues: ContractIssue[] = []\n\tconst seam = SEAM_MODULE_IDS.has(module.id)\n\tconst copyOpts: CheckModelCopyOptions = seam ? { seam: true } : {}\n\n\tcheckModelCopy(`module.${module.id}.description`, module.description, issues, copyOpts)\n\n\tfor (const id of duplicatesBy(module.tools, (tool) => tool.id)) {\n\t\tissues.push(issue(`module.${module.id}.tools.${id}`, 'duplicate_tool_id', `Duplicate tool id \"${id}\"`))\n\t}\n\n\tissues.push(\n\t\t...flatMap(module.tools, (tool) => validateTool(tool, `module.${module.id}.tools.${tool.id}`, copyOpts).issues)\n\t)\n\n\treturn { ok: issues.length === 0, issues }\n}\n\nexport function assertContracts(result: ContractResult, label = 'contract'): void {\n\tif (result.ok) return\n\tconst detail = result.issues.map((i) => `${i.path}: ${i.message}`).join('\\n')\n\tthrow new Error(`${label} failed:\\n${detail}`)\n}\n","import { toJSONSchema } from 'zod'\n\nimport type { AuthDefinition, ModuleDefinition, ToolDefinition } from './types'\n\nexport type ToolCatalogEntry = {\n\tdescription: string\n\tid: string\n\tinputJsonSchema: Record<string, unknown>\n\tname: string\n\toutputJsonSchema: Record<string, unknown>\n\truntime: ToolDefinition['meta']['runtime']\n\tsideEffect: ToolDefinition['meta']['sideEffect']\n\ttags: readonly string[]\n\tidempotent?: boolean | undefined\n\tlongRunning?: boolean | undefined\n\trequiresConfirmation?: boolean | undefined\n\tsupportsCancel?: boolean | undefined\n\tsupportsProgress?: boolean | undefined\n\tnetwork?: boolean | undefined\n\tartifacts?: boolean | undefined\n}\n\nexport type ModuleCatalogEntry = {\n\tauthType: AuthDefinition<unknown>['type']\n\tdescription: string\n\tid: string\n\truntime: ModuleDefinition['runtime']\n\ttitle: string\n\ttools: ToolCatalogEntry[]\n\t/** Inline SVG when the pack has a logo. */\n\tlogo?: string | undefined\n\tcategories: readonly string[]\n\tclassification?: ModuleDefinition['classification']\n\ttags: readonly string[]\n}\n\nexport function toToolCatalogEntry(tool: ToolDefinition): ToolCatalogEntry {\n\treturn {\n\t\tid: tool.id,\n\t\tname: tool.name,\n\t\tdescription: tool.description,\n\t\truntime: tool.meta.runtime,\n\t\tsideEffect: tool.meta.sideEffect,\n\t\ttags: tool.meta.tags ?? [],\n\t\tidempotent: tool.meta.idempotent,\n\t\tlongRunning: tool.meta.longRunning,\n\t\trequiresConfirmation: tool.meta.requiresConfirmation,\n\t\tsupportsCancel: tool.meta.supportsCancel,\n\t\tsupportsProgress: tool.meta.supportsProgress,\n\t\tnetwork: tool.meta.network,\n\t\tartifacts: tool.meta.artifacts,\n\t\tinputJsonSchema: toJSONSchema(tool.inputSchema),\n\t\toutputJsonSchema: toJSONSchema(tool.outputSchema)\n\t}\n}\n\nexport function toModuleCatalogEntry(module: ModuleDefinition): ModuleCatalogEntry {\n\treturn {\n\t\tid: module.id,\n\t\ttitle: module.title,\n\t\tdescription: module.description,\n\t\truntime: module.runtime,\n\t\tauthType: module.auth.type,\n\t\ttools: module.tools.map(toToolCatalogEntry),\n\t\tcategories: module.categories,\n\t\ttags: module.tags ?? [],\n\t\t...(module.classification !== undefined && { classification: module.classification }),\n\t\t...(module.logo !== undefined && { logo: module.logo })\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAS,WAAkB,MAA6B,OAAmC;CAC1F,IAAI,KAAK,SAAS,QAAQ;EACzB,IAAI,UAAU,K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