44reports-mcp 1.4.0 → 1.5.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.
@@ -262,6 +262,34 @@ export declare class ApiClient {
262
262
  }): Promise<{
263
263
  files: PulledFile[];
264
264
  }>;
265
+ findAssets(slug: string, options?: {
266
+ query?: string;
267
+ asset_type?: string;
268
+ surfaces?: string[];
269
+ orientation?: string | null;
270
+ background?: string | null;
271
+ color_mode?: string | null;
272
+ platform?: string | null;
273
+ locale?: string | null;
274
+ include_drafts?: boolean;
275
+ limit?: number;
276
+ ttl?: number;
277
+ }): Promise<{
278
+ query: string | null;
279
+ filters: Record<string, unknown>;
280
+ total_inventory: number;
281
+ matched: number;
282
+ results: Array<{
283
+ path: string;
284
+ score: number;
285
+ matched_terms: string[];
286
+ content_type: string;
287
+ size: number;
288
+ entry: Record<string, unknown>;
289
+ url: string;
290
+ expires_at: string;
291
+ }>;
292
+ }>;
265
293
  addBacklogEntry(data: {
266
294
  content: string;
267
295
  product_slug?: string;
@@ -172,6 +172,30 @@ export class ApiClient {
172
172
  body: JSON.stringify(options ?? {}),
173
173
  });
174
174
  }
175
+ async findAssets(slug, options = {}) {
176
+ const params = new URLSearchParams();
177
+ if (options.query)
178
+ params.set('q', options.query);
179
+ if (options.asset_type)
180
+ params.set('asset_type', options.asset_type);
181
+ if (options.surfaces?.length)
182
+ params.set('surfaces', options.surfaces.join(','));
183
+ // For variant fields, undefined = no filter; null = require null on the entry; string = exact match.
184
+ for (const k of ['orientation', 'background', 'color_mode', 'platform', 'locale']) {
185
+ const v = options[k];
186
+ if (v === null)
187
+ params.set(k, '');
188
+ else if (typeof v === 'string')
189
+ params.set(k, v);
190
+ }
191
+ if (options.include_drafts === false)
192
+ params.set('include_drafts', 'false');
193
+ if (options.limit !== undefined)
194
+ params.set('limit', String(options.limit));
195
+ if (options.ttl !== undefined)
196
+ params.set('ttl', String(options.ttl));
197
+ return this.request(withQuery(`/api/products/${slug}/find-assets`, params));
198
+ }
175
199
  // --- Agent Backlog ---
176
200
  async addBacklogEntry(data) {
177
201
  return this.request('/api/backlog', {
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { deployReportSchema, updateReportSchema, createDeployTool, createUpdateT
8
8
  import { listReportsSchema, getReportSchema, deleteReportSchema, createListTool, createGetTool, createDeleteTool, } from './tools/reports.js';
9
9
  import { pullContextSchema, createPullTool, } from './tools/pull.js';
10
10
  import { manageFoldersSchema, createManageFoldersTool, } from './tools/folders.js';
11
- import { listProductsSchema, getProductSchema, readProductFileSchema, updateProductKnowledgeSchema, uploadProductFilesSchema, pullProductFilesSchema, createProductSchema, deleteProductSchema, deleteProductFileSchema, getProductHealthSchema, getProductIndexSchema, createListProductsTool, createGetProductTool, createReadProductFileTool, createUpdateProductKnowledgeTool, createUploadProductFilesTool, createPullProductFilesTool, createGetProductHealthTool, createGetProductIndexTool, createCreateProductTool, createDeleteProductTool, createDeleteProductFileTool, } from './tools/products.js';
11
+ import { listProductsSchema, getProductSchema, readProductFileSchema, updateProductKnowledgeSchema, uploadProductFilesSchema, pullProductFilesSchema, createProductSchema, deleteProductSchema, deleteProductFileSchema, getProductHealthSchema, getProductIndexSchema, createListProductsTool, createGetProductTool, createReadProductFileTool, createUpdateProductKnowledgeTool, createUploadProductFilesTool, createPullProductFilesTool, createGetProductHealthTool, createGetProductIndexTool, createCreateProductTool, createDeleteProductTool, createDeleteProductFileTool, createFindAssetsTool, findAssetsSchema, } from './tools/products.js';
12
12
  import { createUploadProductDirectoryTool, uploadProductDirectorySchema, UPLOAD_DIRECTORY_DESCRIPTION, } from './tools/upload-directory.js';
13
13
  import { addToBacklogSchema, listBacklogSchema, processBacklogSchema, createAddToBacklogTool, createListBacklogTool, createProcessBacklogTool, } from './tools/backlog.js';
14
14
  import { DOMAIN_VALUES } from './tools/domains.js';
@@ -342,6 +342,40 @@ const toolDefinitions = [
342
342
  schema: deleteProductFileSchema,
343
343
  handler: createDeleteProductFileTool(client),
344
344
  },
345
+ {
346
+ name: 'find_assets',
347
+ description: 'Search a product\'s asset inventory by free-text query and structured filters. Returns ranked entries with descriptions, taxonomy fields, and short-lived signed download URLs.\n\n' +
348
+ 'Prefer this over scanning binary_files from get_product when you know what kind of asset you want — agents reading 30+ paths and guessing from filenames is the failure mode this tool exists to fix.\n\n' +
349
+ 'Examples:\n' +
350
+ ' • { slug: "clara", query: "horizontal logo for landing page", asset_type: "logo", surfaces: ["landing"], background: "transparent" }\n' +
351
+ ' • { slug: "clara", asset_type: "app-icon", platform: "ios" } — pure filter query, no text\n' +
352
+ ' • { slug: "clara", query: "device mockup with hand holding phone" } — semantic, no filters\n\n' +
353
+ 'Empty string for orientation/background/color_mode/platform/locale means "the entry has this variant set to null". Drafts (auto-described, unverified) are included by default; pass include_drafts=false to exclude them.',
354
+ inputSchema: {
355
+ type: 'object',
356
+ properties: {
357
+ slug: prop('string', 'Product slug'),
358
+ query: prop('string', 'Free-text query against description, usage, file path, asset_type, and surfaces.'),
359
+ asset_type: prop('string', 'Restrict to one asset_type.', {
360
+ enum: ['logo', 'app-icon', 'screenshot-ui', 'screenshot-marketing', 'mockup', 'photo-lifestyle', 'photo-product', 'illustration', 'color-swatch', 'typography-sample', 'brand-guide-page', 'video', 'animation', 'document', 'other'],
361
+ }),
362
+ surfaces: prop('array', 'ANY-of match against the entry\'s surfaces array.', {
363
+ items: { type: 'string', enum: ['ad-creative', 'app-store', 'landing', 'email', 'social-organic', 'brand-guide', 'internal-doc'] },
364
+ }),
365
+ orientation: prop('string', 'Variant filter.', { enum: ['horizontal', 'vertical', 'square'] }),
366
+ background: prop('string', 'Variant filter.', { enum: ['transparent', 'solid-light', 'solid-dark', 'photographic'] }),
367
+ color_mode: prop('string', 'Variant filter.', { enum: ['light', 'dark', 'neutral'] }),
368
+ platform: prop('string', 'Variant filter.', { enum: ['ios', 'android', 'web'] }),
369
+ locale: prop('string', 'Filter by exact locale string (BCP-47, e.g. "en-US").'),
370
+ include_drafts: prop('boolean', 'Include auto-described draft entries (default true).'),
371
+ limit: prop('number', 'Maximum number of results. Default 20, max 100.'),
372
+ ttl: prop('number', 'Lifetime in seconds for the signed download URLs (default 600, max 3600).'),
373
+ },
374
+ required: ['slug'],
375
+ },
376
+ schema: findAssetsSchema,
377
+ handler: createFindAssetsTool(client),
378
+ },
345
379
  {
346
380
  name: 'add_to_backlog',
347
381
  description: 'Add an unstructured observation to the agent backlog for later processing. Low-friction way for any agent to contribute signals — competitor insights, user feedback, research findings, or any data that should eventually enrich product knowledge. Only content is required; everything else is optional.\n\nIf you know which product this relates to, pass product_slug. Otherwise, omit it — the backlog processor will auto-route it to the right product (or reject it as noise).',
@@ -142,6 +142,46 @@ export declare const deleteProductFileSchema: z.ZodObject<{
142
142
  slug: string;
143
143
  filepath: string;
144
144
  }>;
145
+ export declare const findAssetsSchema: z.ZodObject<{
146
+ slug: z.ZodString;
147
+ query: z.ZodOptional<z.ZodString>;
148
+ asset_type: z.ZodOptional<z.ZodEnum<["logo", "app-icon", "screenshot-ui", "screenshot-marketing", "mockup", "photo-lifestyle", "photo-product", "illustration", "color-swatch", "typography-sample", "brand-guide-page", "video", "animation", "document", "other"]>>;
149
+ surfaces: z.ZodOptional<z.ZodArray<z.ZodEnum<["ad-creative", "app-store", "landing", "email", "social-organic", "brand-guide", "internal-doc"]>, "many">>;
150
+ orientation: z.ZodOptional<z.ZodEnum<["horizontal", "vertical", "square"]>>;
151
+ background: z.ZodOptional<z.ZodEnum<["transparent", "solid-light", "solid-dark", "photographic"]>>;
152
+ color_mode: z.ZodOptional<z.ZodEnum<["light", "dark", "neutral"]>>;
153
+ platform: z.ZodOptional<z.ZodEnum<["ios", "android", "web"]>>;
154
+ locale: z.ZodOptional<z.ZodString>;
155
+ include_drafts: z.ZodOptional<z.ZodBoolean>;
156
+ limit: z.ZodOptional<z.ZodNumber>;
157
+ ttl: z.ZodOptional<z.ZodNumber>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ slug: string;
160
+ limit?: number | undefined;
161
+ ttl?: number | undefined;
162
+ asset_type?: "logo" | "app-icon" | "screenshot-ui" | "screenshot-marketing" | "mockup" | "photo-lifestyle" | "photo-product" | "illustration" | "color-swatch" | "typography-sample" | "brand-guide-page" | "video" | "animation" | "document" | "other" | undefined;
163
+ surfaces?: ("app-store" | "ad-creative" | "landing" | "email" | "social-organic" | "brand-guide" | "internal-doc")[] | undefined;
164
+ orientation?: "horizontal" | "vertical" | "square" | undefined;
165
+ background?: "transparent" | "solid-light" | "solid-dark" | "photographic" | undefined;
166
+ color_mode?: "light" | "dark" | "neutral" | undefined;
167
+ platform?: "ios" | "android" | "web" | undefined;
168
+ locale?: string | undefined;
169
+ include_drafts?: boolean | undefined;
170
+ query?: string | undefined;
171
+ }, {
172
+ slug: string;
173
+ limit?: number | undefined;
174
+ ttl?: number | undefined;
175
+ asset_type?: "logo" | "app-icon" | "screenshot-ui" | "screenshot-marketing" | "mockup" | "photo-lifestyle" | "photo-product" | "illustration" | "color-swatch" | "typography-sample" | "brand-guide-page" | "video" | "animation" | "document" | "other" | undefined;
176
+ surfaces?: ("app-store" | "ad-creative" | "landing" | "email" | "social-organic" | "brand-guide" | "internal-doc")[] | undefined;
177
+ orientation?: "horizontal" | "vertical" | "square" | undefined;
178
+ background?: "transparent" | "solid-light" | "solid-dark" | "photographic" | undefined;
179
+ color_mode?: "light" | "dark" | "neutral" | undefined;
180
+ platform?: "ios" | "android" | "web" | undefined;
181
+ locale?: string | undefined;
182
+ include_drafts?: boolean | undefined;
183
+ query?: string | undefined;
184
+ }>;
145
185
  export declare function createListProductsTool(client: ApiClient): (input: z.infer<typeof listProductsSchema>) => Promise<{
146
186
  products: Array<{
147
187
  id: string;
@@ -251,3 +291,19 @@ export declare function createDeleteProductTool(client: ApiClient): (input: z.in
251
291
  export declare function createDeleteProductFileTool(client: ApiClient): (input: z.infer<typeof deleteProductFileSchema>) => Promise<{
252
292
  success: boolean;
253
293
  }>;
294
+ export declare function createFindAssetsTool(client: ApiClient): (input: z.infer<typeof findAssetsSchema>) => Promise<{
295
+ query: string | null;
296
+ filters: Record<string, unknown>;
297
+ total_inventory: number;
298
+ matched: number;
299
+ results: Array<{
300
+ path: string;
301
+ score: number;
302
+ matched_terms: string[];
303
+ content_type: string;
304
+ size: number;
305
+ entry: Record<string, unknown>;
306
+ url: string;
307
+ expires_at: string;
308
+ }>;
309
+ }>;
@@ -77,6 +77,31 @@ export const deleteProductFileSchema = z.object({
77
77
  slug: z.string().describe('Product slug'),
78
78
  filepath: z.string().describe('File path within the product to delete (e.g., "docs/copy/old-brief.md", "brand-assets/old-logo.png")'),
79
79
  });
80
+ const ASSET_TYPE_VALUES = [
81
+ 'logo', 'app-icon', 'screenshot-ui', 'screenshot-marketing', 'mockup',
82
+ 'photo-lifestyle', 'photo-product', 'illustration', 'color-swatch',
83
+ 'typography-sample', 'brand-guide-page', 'video', 'animation', 'document', 'other',
84
+ ];
85
+ const SURFACE_VALUES = [
86
+ 'ad-creative', 'app-store', 'landing', 'email', 'social-organic', 'brand-guide', 'internal-doc',
87
+ ];
88
+ export const findAssetsSchema = z.object({
89
+ slug: z.string().describe('Product slug'),
90
+ query: z
91
+ .string()
92
+ .optional()
93
+ .describe('Free-text query — matched against asset description, usage notes, file path, asset_type, and surfaces. Use this for "what" you want ("phone illustration", "horizontal wordmark", "iOS launch icon"). Combine with structured filters for "where" the asset belongs.'),
94
+ asset_type: z.enum(ASSET_TYPE_VALUES).optional().describe('Restrict to one asset_type.'),
95
+ surfaces: z.array(z.enum(SURFACE_VALUES)).optional().describe('ANY-of match against the entry\'s surfaces array. e.g. ["ad-creative","landing"] returns assets used on either.'),
96
+ orientation: z.enum(['horizontal', 'vertical', 'square']).optional().describe('Filter by orientation variant.'),
97
+ background: z.enum(['transparent', 'solid-light', 'solid-dark', 'photographic']).optional().describe('Filter by background variant.'),
98
+ color_mode: z.enum(['light', 'dark', 'neutral']).optional().describe('Filter by color_mode variant.'),
99
+ platform: z.enum(['ios', 'android', 'web']).optional().describe('Filter by platform variant.'),
100
+ locale: z.string().optional().describe('Filter by exact locale string (BCP-47, e.g. "en-US").'),
101
+ include_drafts: z.boolean().optional().describe('Include auto-described draft entries (unverified by a curator). Default true. Drafts are real entries with descriptions; the flag is a confidence marker.'),
102
+ limit: z.number().int().positive().max(100).optional().describe('Maximum number of results. Default 20, max 100.'),
103
+ ttl: z.number().int().positive().max(3600).optional().describe('Lifetime in seconds for the signed download URLs returned with each result. Default 600, max 3600.'),
104
+ });
80
105
  // --- Tool factories ---
81
106
  export function createListProductsTool(client) {
82
107
  return async (input) => {
@@ -193,3 +218,20 @@ export function createDeleteProductFileTool(client) {
193
218
  return client.deleteProductFile(input.slug, input.filepath);
194
219
  };
195
220
  }
221
+ export function createFindAssetsTool(client) {
222
+ return async (input) => {
223
+ return client.findAssets(input.slug, {
224
+ query: input.query,
225
+ asset_type: input.asset_type,
226
+ surfaces: input.surfaces,
227
+ orientation: input.orientation,
228
+ background: input.background,
229
+ color_mode: input.color_mode,
230
+ platform: input.platform,
231
+ locale: input.locale,
232
+ include_drafts: input.include_drafts,
233
+ limit: input.limit,
234
+ ttl: input.ttl,
235
+ });
236
+ };
237
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "44reports-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "description": "MCP server for deploying and pulling context files (code, docs, data) to/from 44reports",
6
6
  "main": "dist/index.js",