@collage-dam/mcp-server 0.1.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/.env.example +56 -0
- package/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +512 -0
- package/dist/client.d.ts +497 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1162 -0
- package/dist/client.js.map +1 -0
- package/dist/conventions/confirmation.d.ts +89 -0
- package/dist/conventions/confirmation.d.ts.map +1 -0
- package/dist/conventions/confirmation.js +132 -0
- package/dist/conventions/confirmation.js.map +1 -0
- package/dist/conventions/dry-run/batch-executor.d.ts +36 -0
- package/dist/conventions/dry-run/batch-executor.d.ts.map +1 -0
- package/dist/conventions/dry-run/batch-executor.js +89 -0
- package/dist/conventions/dry-run/batch-executor.js.map +1 -0
- package/dist/conventions/dry-run/diff-renderer.d.ts +34 -0
- package/dist/conventions/dry-run/diff-renderer.d.ts.map +1 -0
- package/dist/conventions/dry-run/diff-renderer.js +158 -0
- package/dist/conventions/dry-run/diff-renderer.js.map +1 -0
- package/dist/conventions/dry-run/index.d.ts +13 -0
- package/dist/conventions/dry-run/index.d.ts.map +1 -0
- package/dist/conventions/dry-run/index.js +10 -0
- package/dist/conventions/dry-run/index.js.map +1 -0
- package/dist/conventions/dry-run/mutating-tool.d.ts +64 -0
- package/dist/conventions/dry-run/mutating-tool.d.ts.map +1 -0
- package/dist/conventions/dry-run/mutating-tool.js +88 -0
- package/dist/conventions/dry-run/mutating-tool.js.map +1 -0
- package/dist/conventions/dry-run/summary.d.ts +66 -0
- package/dist/conventions/dry-run/summary.d.ts.map +1 -0
- package/dist/conventions/dry-run/summary.js +185 -0
- package/dist/conventions/dry-run/summary.js.map +1 -0
- package/dist/conventions/dry-run/types.d.ts +597 -0
- package/dist/conventions/dry-run/types.d.ts.map +1 -0
- package/dist/conventions/dry-run/types.js +108 -0
- package/dist/conventions/dry-run/types.js.map +1 -0
- package/dist/conventions/dry-run/with-dry-run.d.ts +66 -0
- package/dist/conventions/dry-run/with-dry-run.d.ts.map +1 -0
- package/dist/conventions/dry-run/with-dry-run.js +219 -0
- package/dist/conventions/dry-run/with-dry-run.js.map +1 -0
- package/dist/conventions/env.d.ts +49 -0
- package/dist/conventions/env.d.ts.map +1 -0
- package/dist/conventions/env.js +84 -0
- package/dist/conventions/env.js.map +1 -0
- package/dist/conventions/errors.d.ts +68 -0
- package/dist/conventions/errors.d.ts.map +1 -0
- package/dist/conventions/errors.js +81 -0
- package/dist/conventions/errors.js.map +1 -0
- package/dist/conventions/logger.d.ts +28 -0
- package/dist/conventions/logger.d.ts.map +1 -0
- package/dist/conventions/logger.js +105 -0
- package/dist/conventions/logger.js.map +1 -0
- package/dist/conventions/pagination.d.ts +37 -0
- package/dist/conventions/pagination.d.ts.map +1 -0
- package/dist/conventions/pagination.js +53 -0
- package/dist/conventions/pagination.js.map +1 -0
- package/dist/conventions/rate-limiter.d.ts +54 -0
- package/dist/conventions/rate-limiter.d.ts.map +1 -0
- package/dist/conventions/rate-limiter.js +143 -0
- package/dist/conventions/rate-limiter.js.map +1 -0
- package/dist/conventions/response-budget.d.ts +66 -0
- package/dist/conventions/response-budget.d.ts.map +1 -0
- package/dist/conventions/response-budget.js +89 -0
- package/dist/conventions/response-budget.js.map +1 -0
- package/dist/conventions/schema-version.d.ts +27 -0
- package/dist/conventions/schema-version.d.ts.map +1 -0
- package/dist/conventions/schema-version.js +29 -0
- package/dist/conventions/schema-version.js.map +1 -0
- package/dist/conventions/state-store-redis.d.ts +32 -0
- package/dist/conventions/state-store-redis.d.ts.map +1 -0
- package/dist/conventions/state-store-redis.js +77 -0
- package/dist/conventions/state-store-redis.js.map +1 -0
- package/dist/conventions/state-store.d.ts +46 -0
- package/dist/conventions/state-store.d.ts.map +1 -0
- package/dist/conventions/state-store.js +105 -0
- package/dist/conventions/state-store.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +421 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/collection-audit.d.ts +13 -0
- package/dist/prompts/collection-audit.d.ts.map +1 -0
- package/dist/prompts/collection-audit.js +168 -0
- package/dist/prompts/collection-audit.js.map +1 -0
- package/dist/prompts/create-distribution.d.ts +15 -0
- package/dist/prompts/create-distribution.d.ts.map +1 -0
- package/dist/prompts/create-distribution.js +111 -0
- package/dist/prompts/create-distribution.js.map +1 -0
- package/dist/prompts/helpers.d.ts +20 -0
- package/dist/prompts/helpers.d.ts.map +1 -0
- package/dist/prompts/helpers.js +53 -0
- package/dist/prompts/helpers.js.map +1 -0
- package/dist/prompts/library-health-audit.d.ts +13 -0
- package/dist/prompts/library-health-audit.d.ts.map +1 -0
- package/dist/prompts/library-health-audit.js +131 -0
- package/dist/prompts/library-health-audit.js.map +1 -0
- package/dist/prompts/usage-insights.d.ts +13 -0
- package/dist/prompts/usage-insights.d.ts.map +1 -0
- package/dist/prompts/usage-insights.js +98 -0
- package/dist/prompts/usage-insights.js.map +1 -0
- package/dist/prompts/wrap-prompt-as-tool.d.ts +48 -0
- package/dist/prompts/wrap-prompt-as-tool.d.ts.map +1 -0
- package/dist/prompts/wrap-prompt-as-tool.js +61 -0
- package/dist/prompts/wrap-prompt-as-tool.js.map +1 -0
- package/dist/resources/asset-by-id.d.ts +4 -0
- package/dist/resources/asset-by-id.d.ts.map +1 -0
- package/dist/resources/asset-by-id.js +27 -0
- package/dist/resources/asset-by-id.js.map +1 -0
- package/dist/resources/collections.d.ts +5 -0
- package/dist/resources/collections.d.ts.map +1 -0
- package/dist/resources/collections.js +48 -0
- package/dist/resources/collections.js.map +1 -0
- package/dist/resources/custom-fields.d.ts +4 -0
- package/dist/resources/custom-fields.d.ts.map +1 -0
- package/dist/resources/custom-fields.js +30 -0
- package/dist/resources/custom-fields.js.map +1 -0
- package/dist/resources/folders.d.ts +5 -0
- package/dist/resources/folders.d.ts.map +1 -0
- package/dist/resources/folders.js +73 -0
- package/dist/resources/folders.js.map +1 -0
- package/dist/resources/helpers.d.ts +17 -0
- package/dist/resources/helpers.d.ts.map +1 -0
- package/dist/resources/helpers.js +59 -0
- package/dist/resources/helpers.js.map +1 -0
- package/dist/resources/portals.d.ts +5 -0
- package/dist/resources/portals.d.ts.map +1 -0
- package/dist/resources/portals.js +81 -0
- package/dist/resources/portals.js.map +1 -0
- package/dist/resources/recent-and-dashboard.d.ts +5 -0
- package/dist/resources/recent-and-dashboard.d.ts.map +1 -0
- package/dist/resources/recent-and-dashboard.js +42 -0
- package/dist/resources/recent-and-dashboard.js.map +1 -0
- package/dist/tools/asset-selection.d.ts +102 -0
- package/dist/tools/asset-selection.d.ts.map +1 -0
- package/dist/tools/asset-selection.js +133 -0
- package/dist/tools/asset-selection.js.map +1 -0
- package/dist/tools/audit/audit-folder-structure.d.ts +108 -0
- package/dist/tools/audit/audit-folder-structure.d.ts.map +1 -0
- package/dist/tools/audit/audit-folder-structure.js +260 -0
- package/dist/tools/audit/audit-folder-structure.js.map +1 -0
- package/dist/tools/audit/audit-naming-conventions.d.ts +83 -0
- package/dist/tools/audit/audit-naming-conventions.d.ts.map +1 -0
- package/dist/tools/audit/audit-naming-conventions.js +238 -0
- package/dist/tools/audit/audit-naming-conventions.js.map +1 -0
- package/dist/tools/audit/audit-tagging-hygiene.d.ts +77 -0
- package/dist/tools/audit/audit-tagging-hygiene.d.ts.map +1 -0
- package/dist/tools/audit/audit-tagging-hygiene.js +402 -0
- package/dist/tools/audit/audit-tagging-hygiene.js.map +1 -0
- package/dist/tools/audit/detect-duplicates.d.ts +62 -0
- package/dist/tools/audit/detect-duplicates.d.ts.map +1 -0
- package/dist/tools/audit/detect-duplicates.js +0 -0
- package/dist/tools/audit/detect-duplicates.js.map +1 -0
- package/dist/tools/audit/types.d.ts +526 -0
- package/dist/tools/audit/types.d.ts.map +1 -0
- package/dist/tools/audit/types.js +188 -0
- package/dist/tools/audit/types.js.map +1 -0
- package/dist/tools/bulk-move-assets.d.ts +78 -0
- package/dist/tools/bulk-move-assets.d.ts.map +1 -0
- package/dist/tools/bulk-move-assets.js +122 -0
- package/dist/tools/bulk-move-assets.js.map +1 -0
- package/dist/tools/bulk-normalize-filenames.d.ts +62 -0
- package/dist/tools/bulk-normalize-filenames.d.ts.map +1 -0
- package/dist/tools/bulk-normalize-filenames.js +237 -0
- package/dist/tools/bulk-normalize-filenames.js.map +1 -0
- package/dist/tools/bulk-rename-assets.d.ts +79 -0
- package/dist/tools/bulk-rename-assets.d.ts.map +1 -0
- package/dist/tools/bulk-rename-assets.js +139 -0
- package/dist/tools/bulk-rename-assets.js.map +1 -0
- package/dist/tools/bulk-tags.d.ts +107 -0
- package/dist/tools/bulk-tags.d.ts.map +1 -0
- package/dist/tools/bulk-tags.js +220 -0
- package/dist/tools/bulk-tags.js.map +1 -0
- package/dist/tools/client-adapters.d.ts +76 -0
- package/dist/tools/client-adapters.d.ts.map +1 -0
- package/dist/tools/client-adapters.js +648 -0
- package/dist/tools/client-adapters.js.map +1 -0
- package/dist/tools/collection-membership.d.ts +90 -0
- package/dist/tools/collection-membership.d.ts.map +1 -0
- package/dist/tools/collection-membership.js +195 -0
- package/dist/tools/collection-membership.js.map +1 -0
- package/dist/tools/create-collection.d.ts +63 -0
- package/dist/tools/create-collection.d.ts.map +1 -0
- package/dist/tools/create-collection.js +151 -0
- package/dist/tools/create-collection.js.map +1 -0
- package/dist/tools/create-folder.d.ts +46 -0
- package/dist/tools/create-folder.d.ts.map +1 -0
- package/dist/tools/create-folder.js +83 -0
- package/dist/tools/create-folder.js.map +1 -0
- package/dist/tools/create-share-link.d.ts +107 -0
- package/dist/tools/create-share-link.d.ts.map +1 -0
- package/dist/tools/create-share-link.js +239 -0
- package/dist/tools/create-share-link.js.map +1 -0
- package/dist/tools/get-asset-details.d.ts +401 -0
- package/dist/tools/get-asset-details.d.ts.map +1 -0
- package/dist/tools/get-asset-details.js +56 -0
- package/dist/tools/get-asset-details.js.map +1 -0
- package/dist/tools/get-collection.d.ts +126 -0
- package/dist/tools/get-collection.d.ts.map +1 -0
- package/dist/tools/get-collection.js +52 -0
- package/dist/tools/get-collection.js.map +1 -0
- package/dist/tools/get-embed-code.d.ts +195 -0
- package/dist/tools/get-embed-code.d.ts.map +1 -0
- package/dist/tools/get-embed-code.js +214 -0
- package/dist/tools/get-embed-code.js.map +1 -0
- package/dist/tools/insights/analyze-share-links.d.ts +159 -0
- package/dist/tools/insights/analyze-share-links.d.ts.map +1 -0
- package/dist/tools/insights/analyze-share-links.js +314 -0
- package/dist/tools/insights/analyze-share-links.js.map +1 -0
- package/dist/tools/insights/insight-cache.d.ts +36 -0
- package/dist/tools/insights/insight-cache.d.ts.map +1 -0
- package/dist/tools/insights/insight-cache.js +98 -0
- package/dist/tools/insights/insight-cache.js.map +1 -0
- package/dist/tools/insights/report-asset-activation.d.ts +149 -0
- package/dist/tools/insights/report-asset-activation.d.ts.map +1 -0
- package/dist/tools/insights/report-asset-activation.js +380 -0
- package/dist/tools/insights/report-asset-activation.js.map +1 -0
- package/dist/tools/insights/report-stale-assets.d.ts +120 -0
- package/dist/tools/insights/report-stale-assets.d.ts.map +1 -0
- package/dist/tools/insights/report-stale-assets.js +281 -0
- package/dist/tools/insights/report-stale-assets.js.map +1 -0
- package/dist/tools/insights/report-top-assets.d.ts +139 -0
- package/dist/tools/insights/report-top-assets.d.ts.map +1 -0
- package/dist/tools/insights/report-top-assets.js +407 -0
- package/dist/tools/insights/report-top-assets.js.map +1 -0
- package/dist/tools/list-categories.d.ts +127 -0
- package/dist/tools/list-categories.d.ts.map +1 -0
- package/dist/tools/list-categories.js +68 -0
- package/dist/tools/list-categories.js.map +1 -0
- package/dist/tools/list-collections.d.ts +127 -0
- package/dist/tools/list-collections.d.ts.map +1 -0
- package/dist/tools/list-collections.js +53 -0
- package/dist/tools/list-collections.js.map +1 -0
- package/dist/tools/list-custom-fields.d.ts +125 -0
- package/dist/tools/list-custom-fields.d.ts.map +1 -0
- package/dist/tools/list-custom-fields.js +51 -0
- package/dist/tools/list-custom-fields.js.map +1 -0
- package/dist/tools/list-share-links.d.ts +192 -0
- package/dist/tools/list-share-links.d.ts.map +1 -0
- package/dist/tools/list-share-links.js +92 -0
- package/dist/tools/list-share-links.js.map +1 -0
- package/dist/tools/list-workspaces.d.ts +88 -0
- package/dist/tools/list-workspaces.d.ts.map +1 -0
- package/dist/tools/list-workspaces.js +71 -0
- package/dist/tools/list-workspaces.js.map +1 -0
- package/dist/tools/move-asset.d.ts +48 -0
- package/dist/tools/move-asset.d.ts.map +1 -0
- package/dist/tools/move-asset.js +85 -0
- package/dist/tools/move-asset.js.map +1 -0
- package/dist/tools/rename-asset.d.ts +88 -0
- package/dist/tools/rename-asset.d.ts.map +1 -0
- package/dist/tools/rename-asset.js +100 -0
- package/dist/tools/rename-asset.js.map +1 -0
- package/dist/tools/rename-folder.d.ts +55 -0
- package/dist/tools/rename-folder.d.ts.map +1 -0
- package/dist/tools/rename-folder.js +101 -0
- package/dist/tools/rename-folder.js.map +1 -0
- package/dist/tools/revoke-share-link.d.ts +55 -0
- package/dist/tools/revoke-share-link.d.ts.map +1 -0
- package/dist/tools/revoke-share-link.js +77 -0
- package/dist/tools/revoke-share-link.js.map +1 -0
- package/dist/tools/search/facets.d.ts +34 -0
- package/dist/tools/search/facets.d.ts.map +1 -0
- package/dist/tools/search/facets.js +147 -0
- package/dist/tools/search/facets.js.map +1 -0
- package/dist/tools/search/filter-builder.d.ts +33 -0
- package/dist/tools/search/filter-builder.d.ts.map +1 -0
- package/dist/tools/search/filter-builder.js +111 -0
- package/dist/tools/search/filter-builder.js.map +1 -0
- package/dist/tools/search/search-assets.d.ts +41 -0
- package/dist/tools/search/search-assets.d.ts.map +1 -0
- package/dist/tools/search/search-assets.js +162 -0
- package/dist/tools/search/search-assets.js.map +1 -0
- package/dist/tools/search/search-collections.d.ts +35 -0
- package/dist/tools/search/search-collections.d.ts.map +1 -0
- package/dist/tools/search/search-collections.js +103 -0
- package/dist/tools/search/search-collections.js.map +1 -0
- package/dist/tools/search/types.d.ts +1047 -0
- package/dist/tools/search/types.d.ts.map +1 -0
- package/dist/tools/search/types.js +216 -0
- package/dist/tools/search/types.js.map +1 -0
- package/dist/tools/update-asset-metadata.d.ts +78 -0
- package/dist/tools/update-asset-metadata.d.ts.map +1 -0
- package/dist/tools/update-asset-metadata.js +203 -0
- package/dist/tools/update-asset-metadata.js.map +1 -0
- package/dist/tools/update-collection.d.ts +69 -0
- package/dist/tools/update-collection.d.ts.map +1 -0
- package/dist/tools/update-collection.js +142 -0
- package/dist/tools/update-collection.js.map +1 -0
- package/dist/tools/view-category-contents.d.ts +231 -0
- package/dist/tools/view-category-contents.d.ts.map +1 -0
- package/dist/tools/view-category-contents.js +97 -0
- package/dist/tools/view-category-contents.js.map +1 -0
- package/dist/types.d.ts +1326 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +288 -0
- package/dist/types.js.map +1 -0
- package/dist/typesense.d.ts +84 -0
- package/dist/typesense.d.ts.map +1 -0
- package/dist/typesense.js +243 -0
- package/dist/typesense.js.map +1 -0
- package/docs/api-field-verification.md +244 -0
- package/docs/deployment-runbook.md +446 -0
- package/docs/security-review.md +195 -0
- package/docs/typesense-filter-schema.md +262 -0
- package/docs/verified-endpoints.md +38 -0
- package/package.json +72 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CollageClient } from '../client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Narrow surface used by the handler — kept minimal so tests can stub
|
|
5
|
+
* without instantiating the full CollageClient.
|
|
6
|
+
*/
|
|
7
|
+
export type GetEmbedCodeClient = Pick<CollageClient, 'generateEmbedCode'>;
|
|
8
|
+
export declare const EmbedSizePresetSchema: z.ZodEnum<["small", "medium", "large", "responsive"]>;
|
|
9
|
+
export type EmbedSizePreset = z.infer<typeof EmbedSizePresetSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Inner object schema — exported for the MCP server registration which
|
|
12
|
+
* needs the raw `.shape` (refined schemas don't expose it directly).
|
|
13
|
+
*/
|
|
14
|
+
export declare const GetEmbedCodeInputObjectSchema: z.ZodObject<{
|
|
15
|
+
/** Target a single asset for the embed. */
|
|
16
|
+
asset_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
17
|
+
/**
|
|
18
|
+
* Phase-1 limitation: Collage does not expose a collection-level
|
|
19
|
+
* embed endpoint. Accepted at the schema level so the error
|
|
20
|
+
* surfaces at runtime as VALIDATION rather than a confusing 404.
|
|
21
|
+
*/
|
|
22
|
+
collection_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
23
|
+
size: z.ZodOptional<z.ZodEnum<["small", "medium", "large", "responsive"]>>;
|
|
24
|
+
/** Only meaningful for video assets. Ignored otherwise. */
|
|
25
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
asset_id?: string | number | undefined;
|
|
28
|
+
collection_id?: string | number | undefined;
|
|
29
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
30
|
+
autoplay?: boolean | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
asset_id?: string | number | undefined;
|
|
33
|
+
collection_id?: string | number | undefined;
|
|
34
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
35
|
+
autoplay?: boolean | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const GetEmbedCodeInputSchema: z.ZodEffects<z.ZodObject<{
|
|
38
|
+
/** Target a single asset for the embed. */
|
|
39
|
+
asset_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
40
|
+
/**
|
|
41
|
+
* Phase-1 limitation: Collage does not expose a collection-level
|
|
42
|
+
* embed endpoint. Accepted at the schema level so the error
|
|
43
|
+
* surfaces at runtime as VALIDATION rather than a confusing 404.
|
|
44
|
+
*/
|
|
45
|
+
collection_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
46
|
+
size: z.ZodOptional<z.ZodEnum<["small", "medium", "large", "responsive"]>>;
|
|
47
|
+
/** Only meaningful for video assets. Ignored otherwise. */
|
|
48
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
asset_id?: string | number | undefined;
|
|
51
|
+
collection_id?: string | number | undefined;
|
|
52
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
53
|
+
autoplay?: boolean | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
asset_id?: string | number | undefined;
|
|
56
|
+
collection_id?: string | number | undefined;
|
|
57
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
58
|
+
autoplay?: boolean | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
asset_id?: string | number | undefined;
|
|
61
|
+
collection_id?: string | number | undefined;
|
|
62
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
63
|
+
autoplay?: boolean | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
asset_id?: string | number | undefined;
|
|
66
|
+
collection_id?: string | number | undefined;
|
|
67
|
+
size?: "small" | "medium" | "large" | "responsive" | undefined;
|
|
68
|
+
autoplay?: boolean | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export type GetEmbedCodeInput = z.infer<typeof GetEmbedCodeInputSchema>;
|
|
71
|
+
export declare const GetEmbedCodeOutputSchema: z.ZodObject<{
|
|
72
|
+
asset_id: z.ZodString;
|
|
73
|
+
size: z.ZodEnum<["small", "medium", "large", "responsive"]>;
|
|
74
|
+
autoplay: z.ZodBoolean;
|
|
75
|
+
embed_code: z.ZodString;
|
|
76
|
+
embed_code_raw: z.ZodString;
|
|
77
|
+
preview: z.ZodObject<{
|
|
78
|
+
width: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
79
|
+
height: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
80
|
+
autoplay_applied: z.ZodBoolean;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
height: string | number;
|
|
83
|
+
width: string | number;
|
|
84
|
+
autoplay_applied: boolean;
|
|
85
|
+
}, {
|
|
86
|
+
height: string | number;
|
|
87
|
+
width: string | number;
|
|
88
|
+
autoplay_applied: boolean;
|
|
89
|
+
}>;
|
|
90
|
+
request_id: z.ZodString;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
request_id: string;
|
|
93
|
+
embed_code: string;
|
|
94
|
+
asset_id: string;
|
|
95
|
+
preview: {
|
|
96
|
+
height: string | number;
|
|
97
|
+
width: string | number;
|
|
98
|
+
autoplay_applied: boolean;
|
|
99
|
+
};
|
|
100
|
+
size: "small" | "medium" | "large" | "responsive";
|
|
101
|
+
autoplay: boolean;
|
|
102
|
+
embed_code_raw: string;
|
|
103
|
+
}, {
|
|
104
|
+
request_id: string;
|
|
105
|
+
embed_code: string;
|
|
106
|
+
asset_id: string;
|
|
107
|
+
preview: {
|
|
108
|
+
height: string | number;
|
|
109
|
+
width: string | number;
|
|
110
|
+
autoplay_applied: boolean;
|
|
111
|
+
};
|
|
112
|
+
size: "small" | "medium" | "large" | "responsive";
|
|
113
|
+
autoplay: boolean;
|
|
114
|
+
embed_code_raw: string;
|
|
115
|
+
}>;
|
|
116
|
+
export type GetEmbedCodeOutput = z.infer<typeof GetEmbedCodeOutputSchema>;
|
|
117
|
+
export declare const GET_EMBED_CODE_DESCRIPTION: string;
|
|
118
|
+
interface SizeDimensions {
|
|
119
|
+
width: number | string;
|
|
120
|
+
height: number | string;
|
|
121
|
+
}
|
|
122
|
+
export declare function buildGetEmbedCodeHandler(client: GetEmbedCodeClient): (args: GetEmbedCodeInput) => Promise<{
|
|
123
|
+
isError: boolean;
|
|
124
|
+
content: {
|
|
125
|
+
type: "text";
|
|
126
|
+
text: string;
|
|
127
|
+
}[];
|
|
128
|
+
structuredContent: {
|
|
129
|
+
error: {
|
|
130
|
+
code: "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION" | "RATE_LIMITED" | "UPSTREAM" | "CONFIRMATION_STALE" | "CONFIRMATION_MISSING" | "CONFIRMATION_STATE_DIVERGED" | "ENTITLEMENT" | "INTERNAL";
|
|
131
|
+
message: string;
|
|
132
|
+
retriable: boolean;
|
|
133
|
+
cause?: z.objectOutputType<{
|
|
134
|
+
upstream_status: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
request_id: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
137
|
+
};
|
|
138
|
+
request_id?: undefined;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
isError: boolean;
|
|
142
|
+
content: {
|
|
143
|
+
type: "text";
|
|
144
|
+
text: string;
|
|
145
|
+
}[];
|
|
146
|
+
structuredContent: {
|
|
147
|
+
error: {
|
|
148
|
+
code: "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION" | "RATE_LIMITED" | "UPSTREAM" | "CONFIRMATION_STALE" | "CONFIRMATION_MISSING" | "CONFIRMATION_STATE_DIVERGED" | "ENTITLEMENT" | "INTERNAL";
|
|
149
|
+
message: string;
|
|
150
|
+
retriable: boolean;
|
|
151
|
+
cause?: z.objectOutputType<{
|
|
152
|
+
upstream_status: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
request_id: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
155
|
+
};
|
|
156
|
+
request_id: string;
|
|
157
|
+
};
|
|
158
|
+
} | {
|
|
159
|
+
content: {
|
|
160
|
+
type: "text";
|
|
161
|
+
text: string;
|
|
162
|
+
}[];
|
|
163
|
+
structuredContent: {
|
|
164
|
+
request_id: string;
|
|
165
|
+
embed_code: string;
|
|
166
|
+
asset_id: string;
|
|
167
|
+
preview: {
|
|
168
|
+
height: string | number;
|
|
169
|
+
width: string | number;
|
|
170
|
+
autoplay_applied: boolean;
|
|
171
|
+
};
|
|
172
|
+
size: "small" | "medium" | "large" | "responsive";
|
|
173
|
+
autoplay: boolean;
|
|
174
|
+
embed_code_raw: string;
|
|
175
|
+
};
|
|
176
|
+
isError?: undefined;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* Rewrite the iframe `width`/`height` attributes (case-insensitive) to the
|
|
180
|
+
* chosen size preset. If the snippet doesn't contain an `<iframe ...>`
|
|
181
|
+
* opening tag, returns the input unchanged — callers always also receive
|
|
182
|
+
* the raw markup under `embed_code_raw`.
|
|
183
|
+
*/
|
|
184
|
+
export declare function applySizePreset(html: string, dims: SizeDimensions): string;
|
|
185
|
+
/**
|
|
186
|
+
* Append `autoplay=1` to the iframe's `src` querystring. If no `src`
|
|
187
|
+
* attribute is present (or the snippet has no iframe), returns the input
|
|
188
|
+
* unchanged with `applied: false`.
|
|
189
|
+
*/
|
|
190
|
+
export declare function applyAutoplay(html: string): {
|
|
191
|
+
html: string;
|
|
192
|
+
applied: boolean;
|
|
193
|
+
};
|
|
194
|
+
export {};
|
|
195
|
+
//# sourceMappingURL=get-embed-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-embed-code.d.ts","sourceRoot":"","sources":["../../src/tools/get-embed-code.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;AAM1E,eAAO,MAAM,qBAAqB,uDAKhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,6BAA6B;IACxC,2CAA2C;;IAE3C;;;;OAIG;;;IAGH,2DAA2D;;;;;;;;;;;;EAE3D,CAAC;AAEH,eAAO,MAAM,uBAAuB;IAblC,2CAA2C;;IAE3C;;;;OAIG;;;IAGH,2DAA2D;;;;;;;;;;;;;;;;;;;;;;EAa1D,CAAC;AACJ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,0BAA0B,QAMT,CAAC;AAI/B,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAWD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,IACnD,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFtC;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAa1E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAmB9E"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// ── get_embed_code (read-only) ───────────────────────────────────────
|
|
2
|
+
// Generates an embeddable HTML snippet for a single Collage asset.
|
|
3
|
+
// Read-only — no dry-run wrapping (the upstream computes the snippet from
|
|
4
|
+
// existing state and idempotently caches it; calling this does not create
|
|
5
|
+
// or modify resources from the caller's perspective).
|
|
6
|
+
//
|
|
7
|
+
// Upstream surface (verified via Admin-Frontend
|
|
8
|
+
// `components/dam/Dialogs/ShareAssetDialog/index.vue:476`):
|
|
9
|
+
// GET digital-assets/{asset_id}/generate-embed-code
|
|
10
|
+
// response: { data: { embed_code: '<iframe ...>' } }
|
|
11
|
+
//
|
|
12
|
+
// Collection-level embed: NOT supported by Collage's REST API today. The
|
|
13
|
+
// Admin-Frontend's own `ShareAssetDialog` only renders the embed tab when
|
|
14
|
+
// a single asset is selected (`getEmbedLink` reads `this.files[0].id`).
|
|
15
|
+
// We surface a typed VALIDATION error if the caller passes a collection
|
|
16
|
+
// target — recorded as a Phase 1 limitation.
|
|
17
|
+
//
|
|
18
|
+
// `size` and `autoplay` are *client-side wrappers* — the upstream returns a
|
|
19
|
+
// fixed iframe markup, and the Admin-Frontend does not expose either knob.
|
|
20
|
+
// We accept them at the tool surface so prompt-language stays natural,
|
|
21
|
+
// then post-process the snippet: rewrite the iframe `width`/`height` to
|
|
22
|
+
// match the chosen size preset and append `autoplay=1` to the iframe's
|
|
23
|
+
// `src` querystring when `autoplay=true` and the asset is a video. The
|
|
24
|
+
// raw upstream markup is also returned under `embed_code_raw` so callers
|
|
25
|
+
// can compare or fall back.
|
|
26
|
+
import { z } from 'zod';
|
|
27
|
+
import { createToolError } from '../conventions/errors.js';
|
|
28
|
+
import { IdSchema } from '../types.js';
|
|
29
|
+
// ── Tool I/O Schema ──────────────────────────────────────────────────
|
|
30
|
+
export const EmbedSizePresetSchema = z.enum([
|
|
31
|
+
'small',
|
|
32
|
+
'medium',
|
|
33
|
+
'large',
|
|
34
|
+
'responsive',
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
* Inner object schema — exported for the MCP server registration which
|
|
38
|
+
* needs the raw `.shape` (refined schemas don't expose it directly).
|
|
39
|
+
*/
|
|
40
|
+
export const GetEmbedCodeInputObjectSchema = z.object({
|
|
41
|
+
/** Target a single asset for the embed. */
|
|
42
|
+
asset_id: IdSchema.optional(),
|
|
43
|
+
/**
|
|
44
|
+
* Phase-1 limitation: Collage does not expose a collection-level
|
|
45
|
+
* embed endpoint. Accepted at the schema level so the error
|
|
46
|
+
* surfaces at runtime as VALIDATION rather than a confusing 404.
|
|
47
|
+
*/
|
|
48
|
+
collection_id: IdSchema.optional(),
|
|
49
|
+
size: EmbedSizePresetSchema.optional(),
|
|
50
|
+
/** Only meaningful for video assets. Ignored otherwise. */
|
|
51
|
+
autoplay: z.boolean().optional(),
|
|
52
|
+
});
|
|
53
|
+
export const GetEmbedCodeInputSchema = GetEmbedCodeInputObjectSchema
|
|
54
|
+
.refine((input) => [input.asset_id !== undefined, input.collection_id !== undefined].filter(Boolean).length === 1, {
|
|
55
|
+
message: 'Provide exactly one of `asset_id` or `collection_id`.',
|
|
56
|
+
});
|
|
57
|
+
export const GetEmbedCodeOutputSchema = z.object({
|
|
58
|
+
asset_id: z.string(),
|
|
59
|
+
size: EmbedSizePresetSchema,
|
|
60
|
+
autoplay: z.boolean(),
|
|
61
|
+
embed_code: z.string(),
|
|
62
|
+
embed_code_raw: z.string(),
|
|
63
|
+
preview: z.object({
|
|
64
|
+
width: z.union([z.number(), z.string()]),
|
|
65
|
+
height: z.union([z.number(), z.string()]),
|
|
66
|
+
autoplay_applied: z.boolean(),
|
|
67
|
+
}),
|
|
68
|
+
request_id: z.string(),
|
|
69
|
+
});
|
|
70
|
+
export const GET_EMBED_CODE_DESCRIPTION = 'Generate an embeddable HTML snippet for a single Collage asset. ' +
|
|
71
|
+
'Optional `size` preset (`small`, `medium`, `large`, `responsive`) and ' +
|
|
72
|
+
'`autoplay` flag (only meaningful for video assets). Returns the ' +
|
|
73
|
+
'snippet plus a preview of how it will render. Read-only — no ' +
|
|
74
|
+
'confirmation token needed. Collection-level embeds are not supported ' +
|
|
75
|
+
'by the upstream API today.';
|
|
76
|
+
const SIZE_PRESETS = {
|
|
77
|
+
small: { width: 320, height: 240 },
|
|
78
|
+
medium: { width: 640, height: 480 },
|
|
79
|
+
large: { width: 1280, height: 720 },
|
|
80
|
+
responsive: { width: '100%', height: '100%' },
|
|
81
|
+
};
|
|
82
|
+
// ── Handler ──────────────────────────────────────────────────────────
|
|
83
|
+
export function buildGetEmbedCodeHandler(client) {
|
|
84
|
+
return async (args) => {
|
|
85
|
+
if (args.collection_id !== undefined && args.asset_id === undefined) {
|
|
86
|
+
const error = createToolError('VALIDATION', 'Collection-level embed codes are not supported by the Collage API today. ' +
|
|
87
|
+
'Pass `asset_id` instead. Track Phase-2 enhancement under the ' +
|
|
88
|
+
'Share Link, Embed & Distribution Tools spec.');
|
|
89
|
+
return {
|
|
90
|
+
isError: true,
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: 'text',
|
|
94
|
+
text: `get_embed_code failed: ${error.code} — ${error.message}`,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
structuredContent: { error },
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (args.asset_id === undefined) {
|
|
101
|
+
const error = createToolError('VALIDATION', '`asset_id` is required to generate an embed code.');
|
|
102
|
+
return {
|
|
103
|
+
isError: true,
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: 'text',
|
|
107
|
+
text: `get_embed_code failed: ${error.code} — ${error.message}`,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
structuredContent: { error },
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const assetId = String(args.asset_id);
|
|
114
|
+
const size = args.size ?? 'medium';
|
|
115
|
+
const autoplay = args.autoplay === true;
|
|
116
|
+
const result = await client.generateEmbedCode(assetId);
|
|
117
|
+
if (!result.ok) {
|
|
118
|
+
return {
|
|
119
|
+
isError: true,
|
|
120
|
+
content: [
|
|
121
|
+
{
|
|
122
|
+
type: 'text',
|
|
123
|
+
text: `get_embed_code failed: ${result.error.code} — ${result.error.message}`,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
structuredContent: {
|
|
127
|
+
error: result.error,
|
|
128
|
+
request_id: result.request_id,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const raw = result.data.embed_code;
|
|
133
|
+
const dims = SIZE_PRESETS[size];
|
|
134
|
+
const sized = applySizePreset(raw, dims);
|
|
135
|
+
const { html: finalHtml, applied: autoplayApplied } = autoplay
|
|
136
|
+
? applyAutoplay(sized)
|
|
137
|
+
: { html: sized, applied: false };
|
|
138
|
+
const output = {
|
|
139
|
+
asset_id: assetId,
|
|
140
|
+
size,
|
|
141
|
+
autoplay,
|
|
142
|
+
embed_code: finalHtml,
|
|
143
|
+
embed_code_raw: raw,
|
|
144
|
+
preview: {
|
|
145
|
+
width: dims.width,
|
|
146
|
+
height: dims.height,
|
|
147
|
+
autoplay_applied: autoplayApplied,
|
|
148
|
+
},
|
|
149
|
+
request_id: result.request_id,
|
|
150
|
+
};
|
|
151
|
+
return {
|
|
152
|
+
content: [
|
|
153
|
+
{
|
|
154
|
+
type: 'text',
|
|
155
|
+
text: JSON.stringify(output, null, 2),
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
structuredContent: output,
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// ── Snippet Post-Processors ──────────────────────────────────────────
|
|
163
|
+
/**
|
|
164
|
+
* Rewrite the iframe `width`/`height` attributes (case-insensitive) to the
|
|
165
|
+
* chosen size preset. If the snippet doesn't contain an `<iframe ...>`
|
|
166
|
+
* opening tag, returns the input unchanged — callers always also receive
|
|
167
|
+
* the raw markup under `embed_code_raw`.
|
|
168
|
+
*/
|
|
169
|
+
export function applySizePreset(html, dims) {
|
|
170
|
+
const iframeMatch = html.match(/<iframe\b[^>]*>/i);
|
|
171
|
+
if (iframeMatch === null || iframeMatch.index === undefined)
|
|
172
|
+
return html;
|
|
173
|
+
const tag = iframeMatch[0];
|
|
174
|
+
let updated = tag;
|
|
175
|
+
updated = setOrInsertAttr(updated, 'width', String(dims.width));
|
|
176
|
+
updated = setOrInsertAttr(updated, 'height', String(dims.height));
|
|
177
|
+
return (html.slice(0, iframeMatch.index) +
|
|
178
|
+
updated +
|
|
179
|
+
html.slice(iframeMatch.index + tag.length));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Append `autoplay=1` to the iframe's `src` querystring. If no `src`
|
|
183
|
+
* attribute is present (or the snippet has no iframe), returns the input
|
|
184
|
+
* unchanged with `applied: false`.
|
|
185
|
+
*/
|
|
186
|
+
export function applyAutoplay(html) {
|
|
187
|
+
const iframeMatch = html.match(/<iframe\b[^>]*>/i);
|
|
188
|
+
if (iframeMatch === null || iframeMatch.index === undefined) {
|
|
189
|
+
return { html, applied: false };
|
|
190
|
+
}
|
|
191
|
+
const tag = iframeMatch[0];
|
|
192
|
+
const srcMatch = tag.match(/\bsrc\s*=\s*"([^"]*)"/i);
|
|
193
|
+
if (srcMatch === null)
|
|
194
|
+
return { html, applied: false };
|
|
195
|
+
const src = srcMatch[1] ?? '';
|
|
196
|
+
if (/\bautoplay\s*=\s*1\b/i.test(src)) {
|
|
197
|
+
return { html, applied: true };
|
|
198
|
+
}
|
|
199
|
+
const newSrc = src.includes('?') ? `${src}&autoplay=1` : `${src}?autoplay=1`;
|
|
200
|
+
const newTag = tag.replace(srcMatch[0], `src="${newSrc}"`);
|
|
201
|
+
const newHtml = html.slice(0, iframeMatch.index) +
|
|
202
|
+
newTag +
|
|
203
|
+
html.slice(iframeMatch.index + tag.length);
|
|
204
|
+
return { html: newHtml, applied: true };
|
|
205
|
+
}
|
|
206
|
+
function setOrInsertAttr(tag, attr, value) {
|
|
207
|
+
const re = new RegExp(`\\b${attr}\\s*=\\s*"[^"]*"`, 'i');
|
|
208
|
+
if (re.test(tag)) {
|
|
209
|
+
return tag.replace(re, `${attr}="${value}"`);
|
|
210
|
+
}
|
|
211
|
+
// Insert before the closing `>` (or `/>`).
|
|
212
|
+
return tag.replace(/\s*\/?>$/, (close) => ` ${attr}="${value}"${close}`);
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=get-embed-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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PTION: string;
|
|
4
|
+
export declare const DEFAULT_TOP_N = 10;
|
|
5
|
+
export declare const MAX_TOP_N = 50;
|
|
6
|
+
export declare const ENUMERATOR_HARD_CAP = 5000;
|
|
7
|
+
/**
|
|
8
|
+
* `date_from` / `date_to` are inclusive ISO-8601 date or datetime strings.
|
|
9
|
+
* If only a date is supplied (e.g. `2026-04-14`), it is interpreted as
|
|
10
|
+
* the start (00:00:00Z) for `date_from` or the end (23:59:59.999Z) for
|
|
11
|
+
* `date_to`. Both bounds are optional — omit to leave that side
|
|
12
|
+
* unbounded.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AnalyzeShareLinksInputSchema: z.ZodObject<{
|
|
15
|
+
date_from: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
16
|
+
date_to: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
17
|
+
collection_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
created_by_user_id: z.ZodOptional<z.ZodString>;
|
|
19
|
+
top_n: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, "strict", z.ZodTypeAny, {
|
|
21
|
+
top_n: number;
|
|
22
|
+
collection_id?: string | undefined;
|
|
23
|
+
date_from?: string | undefined;
|
|
24
|
+
date_to?: string | undefined;
|
|
25
|
+
created_by_user_id?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
collection_id?: string | undefined;
|
|
28
|
+
date_from?: string | undefined;
|
|
29
|
+
date_to?: string | undefined;
|
|
30
|
+
created_by_user_id?: string | undefined;
|
|
31
|
+
top_n?: number | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export type AnalyzeShareLinksInput = z.input<typeof AnalyzeShareLinksInputSchema>;
|
|
34
|
+
export type AnalyzeShareLinksInputResolved = z.output<typeof AnalyzeShareLinksInputSchema>;
|
|
35
|
+
export type ShareLinkStatus = 'active' | 'expired' | 'revoked';
|
|
36
|
+
export interface ShareLinkRow {
|
|
37
|
+
id: string;
|
|
38
|
+
title: string | null;
|
|
39
|
+
share_url: string | null;
|
|
40
|
+
view_count: number;
|
|
41
|
+
created_at: string | null;
|
|
42
|
+
expires_at: string | null;
|
|
43
|
+
status: ShareLinkStatus;
|
|
44
|
+
/** Numeric/string id of the creating user, if upstream returned it. */
|
|
45
|
+
created_by_user_id: string | null;
|
|
46
|
+
/** Asset IDs covered by this share link (for collection-scope filtering). */
|
|
47
|
+
asset_ids: string[];
|
|
48
|
+
/** Collection id when the row is a collection-share, else null. */
|
|
49
|
+
collection_id: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The analyzer pulls the entire workspace share-link list through this
|
|
53
|
+
* narrow surface. Implementations may paginate internally and SHOULD cap
|
|
54
|
+
* at {@link ENUMERATOR_HARD_CAP} items, surfacing `truncated: true` so
|
|
55
|
+
* the report can flag that the dataset was clipped.
|
|
56
|
+
*
|
|
57
|
+
* Errors are returned as typed `McpToolError` rather than thrown — the
|
|
58
|
+
* analyzer surfaces them through the canonical error taxonomy.
|
|
59
|
+
*/
|
|
60
|
+
export interface ShareLinkEnumerator {
|
|
61
|
+
enumerate(): Promise<{
|
|
62
|
+
ok: true;
|
|
63
|
+
rows: ShareLinkRow[];
|
|
64
|
+
truncated: boolean;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
error: McpToolError;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
export interface ShareLinkTopEntry {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string | null;
|
|
73
|
+
share_url: string | null;
|
|
74
|
+
view_count: number;
|
|
75
|
+
status: ShareLinkStatus;
|
|
76
|
+
created_at: string | null;
|
|
77
|
+
expires_at: string | null;
|
|
78
|
+
}
|
|
79
|
+
export interface ShareLinkTimeSeriesPoint {
|
|
80
|
+
/** ISO date (YYYY-MM-DD) bucket. */
|
|
81
|
+
date: string;
|
|
82
|
+
/** Number of share links created on this date. */
|
|
83
|
+
links_created: number;
|
|
84
|
+
}
|
|
85
|
+
export interface ShareLinkCohortEntry {
|
|
86
|
+
/** Cohort key (user id, collection id, etc.). */
|
|
87
|
+
key: string;
|
|
88
|
+
/** Number of share links attributed to this cohort. */
|
|
89
|
+
link_count: number;
|
|
90
|
+
/** Sum of view counts across links in this cohort. */
|
|
91
|
+
view_count: number;
|
|
92
|
+
}
|
|
93
|
+
export interface ShareLinkAnalyticsReport {
|
|
94
|
+
/** Inputs as resolved (after defaults / filters applied). */
|
|
95
|
+
filters: {
|
|
96
|
+
date_from: string | null;
|
|
97
|
+
date_to: string | null;
|
|
98
|
+
collection_id: string | null;
|
|
99
|
+
created_by_user_id: string | null;
|
|
100
|
+
top_n: number;
|
|
101
|
+
};
|
|
102
|
+
totals: {
|
|
103
|
+
/** Number of share links matching the filters. */
|
|
104
|
+
link_count: number;
|
|
105
|
+
/** Total views across all matching links. */
|
|
106
|
+
total_views: number;
|
|
107
|
+
/** Mean views per link (null when link_count === 0). */
|
|
108
|
+
mean_views: number | null;
|
|
109
|
+
/** Median views per link (null when link_count === 0). */
|
|
110
|
+
median_views: number | null;
|
|
111
|
+
};
|
|
112
|
+
status_distribution: {
|
|
113
|
+
active: number;
|
|
114
|
+
expired: number;
|
|
115
|
+
revoked: number;
|
|
116
|
+
};
|
|
117
|
+
top_links: ShareLinkTopEntry[];
|
|
118
|
+
/**
|
|
119
|
+
* Daily creation cadence over the matching range. Sorted ascending by
|
|
120
|
+
* `date`. Per-day view counts are not modeled — see file header.
|
|
121
|
+
*/
|
|
122
|
+
time_series: {
|
|
123
|
+
links_created_per_day: ShareLinkTimeSeriesPoint[];
|
|
124
|
+
/** Daily views are not exposed by upstream; null is intentional. */
|
|
125
|
+
views_per_day: null;
|
|
126
|
+
};
|
|
127
|
+
cohorts: {
|
|
128
|
+
by_creator: ShareLinkCohortEntry[];
|
|
129
|
+
/** Only populated when `collection_id` filter is set; else empty array. */
|
|
130
|
+
by_collection: ShareLinkCohortEntry[];
|
|
131
|
+
};
|
|
132
|
+
/** True when the enumerator clipped at {@link ENUMERATOR_HARD_CAP}. */
|
|
133
|
+
truncated: boolean;
|
|
134
|
+
truncation_reason?: string;
|
|
135
|
+
}
|
|
136
|
+
export interface AnalyzeShareLinksDeps {
|
|
137
|
+
enumerator: ShareLinkEnumerator;
|
|
138
|
+
}
|
|
139
|
+
export type AnalyzeShareLinksOutcome = {
|
|
140
|
+
ok: true;
|
|
141
|
+
report: ShareLinkAnalyticsReport;
|
|
142
|
+
} | {
|
|
143
|
+
ok: false;
|
|
144
|
+
error: McpToolError;
|
|
145
|
+
};
|
|
146
|
+
export declare class AnalyzeShareLinksTool {
|
|
147
|
+
private readonly deps;
|
|
148
|
+
readonly name = "analyze_share_links";
|
|
149
|
+
readonly description: string;
|
|
150
|
+
constructor(deps: AnalyzeShareLinksDeps);
|
|
151
|
+
run(rawInput?: AnalyzeShareLinksInput): Promise<AnalyzeShareLinksOutcome>;
|
|
152
|
+
}
|
|
153
|
+
export declare function buildAnalyzeShareLinksTool(deps: AnalyzeShareLinksDeps): AnalyzeShareLinksTool;
|
|
154
|
+
/**
|
|
155
|
+
* Build the analytics report from a flat list of rows. Pure function,
|
|
156
|
+
* exported for direct test access.
|
|
157
|
+
*/
|
|
158
|
+
export declare function buildReport(rows: ReadonlyArray<ShareLinkRow>, enumeratorTruncated: boolean, input: AnalyzeShareLinksInputResolved): ShareLinkAnalyticsReport;
|
|
159
|
+
//# sourceMappingURL=analyze-share-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-share-links.d.ts","sourceRoot":"","sources":["../../../src/tools/insights/analyze-share-links.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKjF,eAAO,MAAM,+BAA+B,QAQY,CAAC;AAIzD,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eA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