@agent-native/creative-context 0.0.0-beta-20260820202238
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/README.md +154 -0
- package/agent-native.eject.json +41 -0
- package/agent-native.package.json +119 -0
- package/dist/actions/confirm-canonical-logo.d.ts +6 -0
- package/dist/actions/confirm-canonical-logo.d.ts.map +1 -0
- package/dist/actions/confirm-canonical-logo.js +19 -0
- package/dist/actions/confirm-canonical-logo.js.map +1 -0
- package/dist/actions/continue-context-import.d.ts +22 -0
- package/dist/actions/continue-context-import.d.ts.map +1 -0
- package/dist/actions/continue-context-import.js +13 -0
- package/dist/actions/continue-context-import.js.map +1 -0
- package/dist/actions/creative-context-a2a.d.ts +10 -0
- package/dist/actions/creative-context-a2a.d.ts.map +1 -0
- package/dist/actions/creative-context-a2a.js +66 -0
- package/dist/actions/creative-context-a2a.js.map +1 -0
- package/dist/actions/get-brand-profile.d.ts +33 -0
- package/dist/actions/get-brand-profile.d.ts.map +1 -0
- package/dist/actions/get-brand-profile.js +13 -0
- package/dist/actions/get-brand-profile.js.map +1 -0
- package/dist/actions/get-context-import-status.d.ts +22 -0
- package/dist/actions/get-context-import-status.d.ts.map +1 -0
- package/dist/actions/get-context-import-status.js +12 -0
- package/dist/actions/get-context-import-status.js.map +1 -0
- package/dist/actions/get-context-item.d.ts +2 -0
- package/dist/actions/get-context-item.d.ts.map +1 -0
- package/dist/actions/get-context-item.js +2 -0
- package/dist/actions/get-context-item.js.map +1 -0
- package/dist/actions/get-context-pack.d.ts +7 -0
- package/dist/actions/get-context-pack.d.ts.map +1 -0
- package/dist/actions/get-context-pack.js +12 -0
- package/dist/actions/get-context-pack.js.map +1 -0
- package/dist/actions/get-creative-context.d.ts +157 -0
- package/dist/actions/get-creative-context.d.ts.map +1 -0
- package/dist/actions/get-creative-context.js +148 -0
- package/dist/actions/get-creative-context.js.map +1 -0
- package/dist/actions/get-google-picker-session.d.ts +10 -0
- package/dist/actions/get-google-picker-session.d.ts.map +1 -0
- package/dist/actions/get-google-picker-session.js +38 -0
- package/dist/actions/get-google-picker-session.js.map +1 -0
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +73 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/infer-brand-dna.d.ts +52 -0
- package/dist/actions/infer-brand-dna.d.ts.map +1 -0
- package/dist/actions/infer-brand-dna.js +13 -0
- package/dist/actions/infer-brand-dna.js.map +1 -0
- package/dist/actions/list-canonical-logo-candidates.d.ts +9 -0
- package/dist/actions/list-canonical-logo-candidates.d.ts.map +1 -0
- package/dist/actions/list-canonical-logo-candidates.js +82 -0
- package/dist/actions/list-canonical-logo-candidates.js.map +1 -0
- package/dist/actions/list-context-connections.d.ts +22 -0
- package/dist/actions/list-context-connections.d.ts.map +1 -0
- package/dist/actions/list-context-connections.js +43 -0
- package/dist/actions/list-context-connections.js.map +1 -0
- package/dist/actions/list-context-memberships.d.ts +11 -0
- package/dist/actions/list-context-memberships.d.ts.map +1 -0
- package/dist/actions/list-context-memberships.js +47 -0
- package/dist/actions/list-context-memberships.js.map +1 -0
- package/dist/actions/list-context-packs.d.ts +10 -0
- package/dist/actions/list-context-packs.d.ts.map +1 -0
- package/dist/actions/list-context-packs.js +16 -0
- package/dist/actions/list-context-packs.js.map +1 -0
- package/dist/actions/list-context-sources.d.ts +12 -0
- package/dist/actions/list-context-sources.d.ts.map +1 -0
- package/dist/actions/list-context-sources.js +20 -0
- package/dist/actions/list-context-sources.js.map +1 -0
- package/dist/actions/list-context-suggestions.d.ts +13 -0
- package/dist/actions/list-context-suggestions.d.ts.map +1 -0
- package/dist/actions/list-context-suggestions.js +28 -0
- package/dist/actions/list-context-suggestions.js.map +1 -0
- package/dist/actions/list-creative-contexts.d.ts +12 -0
- package/dist/actions/list-creative-contexts.d.ts.map +1 -0
- package/dist/actions/list-creative-contexts.js +28 -0
- package/dist/actions/list-creative-contexts.js.map +1 -0
- package/dist/actions/manage-brand-profile.d.ts +28 -0
- package/dist/actions/manage-brand-profile.d.ts.map +1 -0
- package/dist/actions/manage-brand-profile.js +47 -0
- package/dist/actions/manage-brand-profile.js.map +1 -0
- package/dist/actions/manage-context-membership.d.ts +64 -0
- package/dist/actions/manage-context-membership.d.ts.map +1 -0
- package/dist/actions/manage-context-membership.js +70 -0
- package/dist/actions/manage-context-membership.js.map +1 -0
- package/dist/actions/manage-context-pack.d.ts +36 -0
- package/dist/actions/manage-context-pack.d.ts.map +1 -0
- package/dist/actions/manage-context-pack.js +71 -0
- package/dist/actions/manage-context-pack.js.map +1 -0
- package/dist/actions/manage-context-source.d.ts +51 -0
- package/dist/actions/manage-context-source.d.ts.map +1 -0
- package/dist/actions/manage-context-source.js +130 -0
- package/dist/actions/manage-context-source.js.map +1 -0
- package/dist/actions/manage-creative-context.d.ts +28 -0
- package/dist/actions/manage-creative-context.d.ts.map +1 -0
- package/dist/actions/manage-creative-context.js +65 -0
- package/dist/actions/manage-creative-context.js.map +1 -0
- package/dist/actions/manage-layout-template.d.ts +13 -0
- package/dist/actions/manage-layout-template.d.ts.map +1 -0
- package/dist/actions/manage-layout-template.js +43 -0
- package/dist/actions/manage-layout-template.js.map +1 -0
- package/dist/actions/preview-context-import.d.ts +23 -0
- package/dist/actions/preview-context-import.d.ts.map +1 -0
- package/dist/actions/preview-context-import.js +57 -0
- package/dist/actions/preview-context-import.js.map +1 -0
- package/dist/actions/process-context-purge.d.ts +37 -0
- package/dist/actions/process-context-purge.d.ts.map +1 -0
- package/dist/actions/process-context-purge.js +20 -0
- package/dist/actions/process-context-purge.js.map +1 -0
- package/dist/actions/propose-brand-dna.d.ts +15 -0
- package/dist/actions/propose-brand-dna.d.ts.map +1 -0
- package/dist/actions/propose-brand-dna.js +19 -0
- package/dist/actions/propose-brand-dna.js.map +1 -0
- package/dist/actions/propose-canonical-logo.d.ts +9 -0
- package/dist/actions/propose-canonical-logo.d.ts.map +1 -0
- package/dist/actions/propose-canonical-logo.js +16 -0
- package/dist/actions/propose-canonical-logo.js.map +1 -0
- package/dist/actions/publish-brand-dna.d.ts +13 -0
- package/dist/actions/publish-brand-dna.d.ts.map +1 -0
- package/dist/actions/publish-brand-dna.js +23 -0
- package/dist/actions/publish-brand-dna.js.map +1 -0
- package/dist/actions/recommend-context-roots.d.ts +14 -0
- package/dist/actions/recommend-context-roots.d.ts.map +1 -0
- package/dist/actions/recommend-context-roots.js +22 -0
- package/dist/actions/recommend-context-roots.js.map +1 -0
- package/dist/actions/record-context-feedback.d.ts +10 -0
- package/dist/actions/record-context-feedback.d.ts.map +1 -0
- package/dist/actions/record-context-feedback.js +14 -0
- package/dist/actions/record-context-feedback.js.map +1 -0
- package/dist/actions/review-context-items.d.ts +35 -0
- package/dist/actions/review-context-items.d.ts.map +1 -0
- package/dist/actions/review-context-items.js +65 -0
- package/dist/actions/review-context-items.js.map +1 -0
- package/dist/actions/run-embedding-bakeoff.d.ts +15 -0
- package/dist/actions/run-embedding-bakeoff.d.ts.map +1 -0
- package/dist/actions/run-embedding-bakeoff.js +72 -0
- package/dist/actions/run-embedding-bakeoff.js.map +1 -0
- package/dist/actions/search-creative-context.d.ts +80 -0
- package/dist/actions/search-creative-context.d.ts.map +1 -0
- package/dist/actions/search-creative-context.js +42 -0
- package/dist/actions/search-creative-context.js.map +1 -0
- package/dist/actions/set-brand-dna.d.ts +15 -0
- package/dist/actions/set-brand-dna.d.ts.map +1 -0
- package/dist/actions/set-brand-dna.js +19 -0
- package/dist/actions/set-brand-dna.js.map +1 -0
- package/dist/actions/start-context-enrichment.d.ts +25 -0
- package/dist/actions/start-context-enrichment.d.ts.map +1 -0
- package/dist/actions/start-context-enrichment.js +48 -0
- package/dist/actions/start-context-enrichment.js.map +1 -0
- package/dist/actions/start-context-import.d.ts +24 -0
- package/dist/actions/start-context-import.d.ts.map +1 -0
- package/dist/actions/start-context-import.js +37 -0
- package/dist/actions/start-context-import.js.map +1 -0
- package/dist/client/CreativeContextChip.d.ts +18 -0
- package/dist/client/CreativeContextChip.d.ts.map +1 -0
- package/dist/client/CreativeContextChip.js +80 -0
- package/dist/client/CreativeContextChip.js.map +1 -0
- package/dist/client/CreativeContextPanel.d.ts +73 -0
- package/dist/client/CreativeContextPanel.d.ts.map +1 -0
- package/dist/client/CreativeContextPanel.js +1171 -0
- package/dist/client/CreativeContextPanel.js.map +1 -0
- package/dist/client/CreativeContextSettingsLink.d.ts +4 -0
- package/dist/client/CreativeContextSettingsLink.d.ts.map +1 -0
- package/dist/client/CreativeContextSettingsLink.js +8 -0
- package/dist/client/CreativeContextSettingsLink.js.map +1 -0
- package/dist/client/CreativeContextShareTab.d.ts +56 -0
- package/dist/client/CreativeContextShareTab.d.ts.map +1 -0
- package/dist/client/CreativeContextShareTab.js +213 -0
- package/dist/client/CreativeContextShareTab.js.map +1 -0
- package/dist/client/actions.d.ts +474 -0
- package/dist/client/actions.d.ts.map +1 -0
- package/dist/client/actions.js +411 -0
- package/dist/client/actions.js.map +1 -0
- package/dist/client/agent-tab.d.ts +10 -0
- package/dist/client/agent-tab.d.ts.map +1 -0
- package/dist/client/agent-tab.js +32 -0
- package/dist/client/agent-tab.js.map +1 -0
- package/dist/client/application-state.d.ts +24 -0
- package/dist/client/application-state.d.ts.map +1 -0
- package/dist/client/application-state.js +111 -0
- package/dist/client/application-state.js.map +1 -0
- package/dist/client/google-slides-picker.d.ts +19 -0
- package/dist/client/google-slides-picker.d.ts.map +1 -0
- package/dist/client/google-slides-picker.js +106 -0
- package/dist/client/google-slides-picker.js.map +1 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/messages.d.ts +5 -0
- package/dist/client/messages.d.ts.map +1 -0
- package/dist/client/messages.js +1158 -0
- package/dist/client/messages.js.map +1 -0
- package/dist/connectors/context.d.ts +9 -0
- package/dist/connectors/context.d.ts.map +1 -0
- package/dist/connectors/context.js +59 -0
- package/dist/connectors/context.js.map +1 -0
- package/dist/connectors/document-parser.d.ts +2 -0
- package/dist/connectors/document-parser.d.ts.map +1 -0
- package/dist/connectors/document-parser.js +2 -0
- package/dist/connectors/document-parser.js.map +1 -0
- package/dist/connectors/figma-native.d.ts +18 -0
- package/dist/connectors/figma-native.d.ts.map +1 -0
- package/dist/connectors/figma-native.js +883 -0
- package/dist/connectors/figma-native.js.map +1 -0
- package/dist/connectors/figma.d.ts +10 -0
- package/dist/connectors/figma.d.ts.map +1 -0
- package/dist/connectors/figma.js +166 -0
- package/dist/connectors/figma.js.map +1 -0
- package/dist/connectors/google-slides-native.d.ts +58 -0
- package/dist/connectors/google-slides-native.d.ts.map +1 -0
- package/dist/connectors/google-slides-native.js +1118 -0
- package/dist/connectors/google-slides-native.js.map +1 -0
- package/dist/connectors/google-slides.d.ts +15 -0
- package/dist/connectors/google-slides.d.ts.map +1 -0
- package/dist/connectors/google-slides.js +895 -0
- package/dist/connectors/google-slides.js.map +1 -0
- package/dist/connectors/index.d.ts +21 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +45 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/manual.d.ts +9 -0
- package/dist/connectors/manual.d.ts.map +1 -0
- package/dist/connectors/manual.js +91 -0
- package/dist/connectors/manual.js.map +1 -0
- package/dist/connectors/normalize.d.ts +42 -0
- package/dist/connectors/normalize.d.ts.map +1 -0
- package/dist/connectors/normalize.js +335 -0
- package/dist/connectors/normalize.js.map +1 -0
- package/dist/connectors/notion.d.ts +10 -0
- package/dist/connectors/notion.d.ts.map +1 -0
- package/dist/connectors/notion.js +393 -0
- package/dist/connectors/notion.js.map +1 -0
- package/dist/connectors/private-artifacts.d.ts +39 -0
- package/dist/connectors/private-artifacts.d.ts.map +1 -0
- package/dist/connectors/private-artifacts.js +175 -0
- package/dist/connectors/private-artifacts.js.map +1 -0
- package/dist/connectors/provider-response.d.ts +20 -0
- package/dist/connectors/provider-response.d.ts.map +1 -0
- package/dist/connectors/provider-response.js +98 -0
- package/dist/connectors/provider-response.js.map +1 -0
- package/dist/connectors/recommendations.d.ts +25 -0
- package/dist/connectors/recommendations.d.ts.map +1 -0
- package/dist/connectors/recommendations.js +172 -0
- package/dist/connectors/recommendations.js.map +1 -0
- package/dist/connectors/registry.d.ts +10 -0
- package/dist/connectors/registry.d.ts.map +1 -0
- package/dist/connectors/registry.js +34 -0
- package/dist/connectors/registry.js.map +1 -0
- package/dist/connectors/rendered-design.d.ts +68 -0
- package/dist/connectors/rendered-design.d.ts.map +1 -0
- package/dist/connectors/rendered-design.js +362 -0
- package/dist/connectors/rendered-design.js.map +1 -0
- package/dist/connectors/rendered-page.d.ts +115 -0
- package/dist/connectors/rendered-page.d.ts.map +1 -0
- package/dist/connectors/rendered-page.js +1036 -0
- package/dist/connectors/rendered-page.js.map +1 -0
- package/dist/connectors/smart-defaults.d.ts +9 -0
- package/dist/connectors/smart-defaults.d.ts.map +1 -0
- package/dist/connectors/smart-defaults.js +72 -0
- package/dist/connectors/smart-defaults.js.map +1 -0
- package/dist/connectors/types.d.ts +79 -0
- package/dist/connectors/types.d.ts.map +1 -0
- package/dist/connectors/types.js +2 -0
- package/dist/connectors/types.js.map +1 -0
- package/dist/connectors/upload.d.ts +9 -0
- package/dist/connectors/upload.d.ts.map +1 -0
- package/dist/connectors/upload.js +440 -0
- package/dist/connectors/upload.js.map +1 -0
- package/dist/connectors/website.d.ts +20 -0
- package/dist/connectors/website.d.ts.map +1 -0
- package/dist/connectors/website.js +616 -0
- package/dist/connectors/website.js.map +1 -0
- package/dist/embeddings/index.d.ts +3 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +3 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/embeddings/providers.d.ts +2 -0
- package/dist/embeddings/providers.d.ts.map +1 -0
- package/dist/embeddings/providers.js +2 -0
- package/dist/embeddings/providers.js.map +1 -0
- package/dist/embeddings/types.d.ts +2 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/embeddings/types.js +2 -0
- package/dist/embeddings/types.js.map +1 -0
- package/dist/eval/acceptance-fixtures.d.ts +3 -0
- package/dist/eval/acceptance-fixtures.d.ts.map +1 -0
- package/dist/eval/acceptance-fixtures.js +84 -0
- package/dist/eval/acceptance-fixtures.js.map +1 -0
- package/dist/eval/acceptance.d.ts +114 -0
- package/dist/eval/acceptance.d.ts.map +1 -0
- package/dist/eval/acceptance.js +260 -0
- package/dist/eval/acceptance.js.map +1 -0
- package/dist/eval/fixtures.d.ts +16 -0
- package/dist/eval/fixtures.d.ts.map +1 -0
- package/dist/eval/fixtures.js +119 -0
- package/dist/eval/fixtures.js.map +1 -0
- package/dist/eval/index.d.ts +63 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +174 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/background-worker.d.ts +31 -0
- package/dist/jobs/background-worker.d.ts.map +1 -0
- package/dist/jobs/background-worker.js +315 -0
- package/dist/jobs/background-worker.js.map +1 -0
- package/dist/jobs/import-runner.d.ts +3 -0
- package/dist/jobs/import-runner.d.ts.map +1 -0
- package/dist/jobs/import-runner.js +613 -0
- package/dist/jobs/import-runner.js.map +1 -0
- package/dist/jobs/index.d.ts +9 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +8 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/progress.d.ts +3 -0
- package/dist/jobs/progress.d.ts.map +1 -0
- package/dist/jobs/progress.js +30 -0
- package/dist/jobs/progress.js.map +1 -0
- package/dist/jobs/rebuild.d.ts +13 -0
- package/dist/jobs/rebuild.d.ts.map +1 -0
- package/dist/jobs/rebuild.js +178 -0
- package/dist/jobs/rebuild.js.map +1 -0
- package/dist/jobs/server-worker.d.ts +16 -0
- package/dist/jobs/server-worker.d.ts.map +1 -0
- package/dist/jobs/server-worker.js +262 -0
- package/dist/jobs/server-worker.js.map +1 -0
- package/dist/jobs/store-adapter.d.ts +3 -0
- package/dist/jobs/store-adapter.d.ts.map +1 -0
- package/dist/jobs/store-adapter.js +37 -0
- package/dist/jobs/store-adapter.js.map +1 -0
- package/dist/jobs/types.d.ts +138 -0
- package/dist/jobs/types.d.ts.map +1 -0
- package/dist/jobs/types.js +2 -0
- package/dist/jobs/types.js.map +1 -0
- package/dist/jobs/worker.d.ts +27 -0
- package/dist/jobs/worker.d.ts.map +1 -0
- package/dist/jobs/worker.js +90 -0
- package/dist/jobs/worker.js.map +1 -0
- package/dist/media-url.d.ts +7 -0
- package/dist/media-url.d.ts.map +1 -0
- package/dist/media-url.js +15 -0
- package/dist/media-url.js.map +1 -0
- package/dist/native-artifact-reassembly.d.ts +25 -0
- package/dist/native-artifact-reassembly.d.ts.map +1 -0
- package/dist/native-artifact-reassembly.js +262 -0
- package/dist/native-artifact-reassembly.js.map +1 -0
- package/dist/native-artifact.d.ts +88 -0
- package/dist/native-artifact.d.ts.map +1 -0
- package/dist/native-artifact.js +86 -0
- package/dist/native-artifact.js.map +1 -0
- package/dist/schema/index.d.ts +7111 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +469 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/migrations.d.ts +10 -0
- package/dist/schema/migrations.d.ts.map +1 -0
- package/dist/schema/migrations.js +333 -0
- package/dist/schema/migrations.js.map +1 -0
- package/dist/search/fusion.d.ts +2 -0
- package/dist/search/fusion.d.ts.map +1 -0
- package/dist/search/fusion.js +2 -0
- package/dist/search/fusion.js.map +1 -0
- package/dist/search/mode.d.ts +4 -0
- package/dist/search/mode.d.ts.map +1 -0
- package/dist/search/mode.js +13 -0
- package/dist/search/mode.js.map +1 -0
- package/dist/search/postgres-fts.d.ts +2 -0
- package/dist/search/postgres-fts.d.ts.map +1 -0
- package/dist/search/postgres-fts.js +2 -0
- package/dist/search/postgres-fts.js.map +1 -0
- package/dist/server/brand-context.d.ts +15 -0
- package/dist/server/brand-context.d.ts.map +1 -0
- package/dist/server/brand-context.js +149 -0
- package/dist/server/brand-context.js.map +1 -0
- package/dist/server/context.d.ts +77 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +63 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/enrichment.d.ts +24 -0
- package/dist/server/enrichment.d.ts.map +1 -0
- package/dist/server/enrichment.js +138 -0
- package/dist/server/enrichment.js.map +1 -0
- package/dist/server/generation-artifact-access.d.ts +21 -0
- package/dist/server/generation-artifact-access.d.ts.map +1 -0
- package/dist/server/generation-artifact-access.js +113 -0
- package/dist/server/generation-artifact-access.js.map +1 -0
- package/dist/server/generation-context.d.ts +220 -0
- package/dist/server/generation-context.d.ts.map +1 -0
- package/dist/server/generation-context.js +432 -0
- package/dist/server/generation-context.js.map +1 -0
- package/dist/server/index.d.ts +27 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +115 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/isolated-a2a.d.ts +175 -0
- package/dist/server/isolated-a2a.d.ts.map +1 -0
- package/dist/server/isolated-a2a.js +312 -0
- package/dist/server/isolated-a2a.js.map +1 -0
- package/dist/server/media.d.ts +15 -0
- package/dist/server/media.d.ts.map +1 -0
- package/dist/server/media.js +108 -0
- package/dist/server/media.js.map +1 -0
- package/dist/server/native-resource-capture.d.ts +78 -0
- package/dist/server/native-resource-capture.d.ts.map +1 -0
- package/dist/server/native-resource-capture.js +94 -0
- package/dist/server/native-resource-capture.js.map +1 -0
- package/dist/server/prompt-provider.d.ts +5 -0
- package/dist/server/prompt-provider.d.ts.map +1 -0
- package/dist/server/prompt-provider.js +59 -0
- package/dist/server/prompt-provider.js.map +1 -0
- package/dist/server/public-serialization.d.ts +160 -0
- package/dist/server/public-serialization.d.ts.map +1 -0
- package/dist/server/public-serialization.js +108 -0
- package/dist/server/public-serialization.js.map +1 -0
- package/dist/server/resource-paths.d.ts +3 -0
- package/dist/server/resource-paths.d.ts.map +1 -0
- package/dist/server/resource-paths.js +5 -0
- package/dist/server/resource-paths.js.map +1 -0
- package/dist/server/retrieval.d.ts +83 -0
- package/dist/server/retrieval.d.ts.map +1 -0
- package/dist/server/retrieval.js +445 -0
- package/dist/server/retrieval.js.map +1 -0
- package/dist/server/safe-native-preview.d.ts +15 -0
- package/dist/server/safe-native-preview.d.ts.map +1 -0
- package/dist/server/safe-native-preview.js +148 -0
- package/dist/server/safe-native-preview.js.map +1 -0
- package/dist/store/brand.d.ts +47 -0
- package/dist/store/brand.d.ts.map +1 -0
- package/dist/store/brand.js +346 -0
- package/dist/store/brand.js.map +1 -0
- package/dist/store/content.d.ts +134 -0
- package/dist/store/content.d.ts.map +1 -0
- package/dist/store/content.js +1677 -0
- package/dist/store/content.js.map +1 -0
- package/dist/store/contexts.d.ts +216 -0
- package/dist/store/contexts.d.ts.map +1 -0
- package/dist/store/contexts.js +1346 -0
- package/dist/store/contexts.js.map +1 -0
- package/dist/store/generation.d.ts +28 -0
- package/dist/store/generation.d.ts.map +1 -0
- package/dist/store/generation.js +140 -0
- package/dist/store/generation.js.map +1 -0
- package/dist/store/helpers.d.ts +12 -0
- package/dist/store/helpers.d.ts.map +1 -0
- package/dist/store/helpers.js +41 -0
- package/dist/store/helpers.js.map +1 -0
- package/dist/store/index.d.ts +11 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +11 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/inference.d.ts +57 -0
- package/dist/store/inference.d.ts.map +1 -0
- package/dist/store/inference.js +279 -0
- package/dist/store/inference.js.map +1 -0
- package/dist/store/jobs.d.ts +80 -0
- package/dist/store/jobs.d.ts.map +1 -0
- package/dist/store/jobs.js +428 -0
- package/dist/store/jobs.js.map +1 -0
- package/dist/store/native-artifact-summary.d.ts +7 -0
- package/dist/store/native-artifact-summary.d.ts.map +1 -0
- package/dist/store/native-artifact-summary.js +10 -0
- package/dist/store/native-artifact-summary.js.map +1 -0
- package/dist/store/packs.d.ts +36 -0
- package/dist/store/packs.d.ts.map +1 -0
- package/dist/store/packs.js +438 -0
- package/dist/store/packs.js.map +1 -0
- package/dist/store/purge.d.ts +16 -0
- package/dist/store/purge.d.ts.map +1 -0
- package/dist/store/purge.js +354 -0
- package/dist/store/purge.js.map +1 -0
- package/dist/store/sources.d.ts +76 -0
- package/dist/store/sources.d.ts.map +1 -0
- package/dist/store/sources.js +525 -0
- package/dist/store/sources.js.map +1 -0
- package/dist/store/suggestions.d.ts +29 -0
- package/dist/store/suggestions.d.ts.map +1 -0
- package/dist/store/suggestions.js +270 -0
- package/dist/store/suggestions.js.map +1 -0
- package/dist/types.d.ts +578 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/untrusted-reference.d.ts +8 -0
- package/dist/untrusted-reference.d.ts.map +1 -0
- package/dist/untrusted-reference.js +19 -0
- package/dist/untrusted-reference.js.map +1 -0
- package/dist/vector/index.d.ts +2 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/index.js +2 -0
- package/dist/vector/index.js.map +1 -0
- package/dist/vector/pgvector.d.ts +2 -0
- package/dist/vector/pgvector.d.ts.map +1 -0
- package/dist/vector/pgvector.js +2 -0
- package/dist/vector/pgvector.js.map +1 -0
- package/docs/evaluation.md +92 -0
- package/docs/llms-full.txt +168 -0
- package/docs/llms.txt +76 -0
- package/docs/skills/creative-context/SKILL.md +90 -0
- package/package.json +100 -0
- package/src/actions/agent-input-schemas.spec.ts +46 -0
- package/src/actions/confirm-canonical-logo.ts +20 -0
- package/src/actions/continue-context-import.ts +15 -0
- package/src/actions/creative-context-a2a.spec.ts +162 -0
- package/src/actions/creative-context-a2a.ts +88 -0
- package/src/actions/get-brand-profile.ts +16 -0
- package/src/actions/get-context-import-status.ts +13 -0
- package/src/actions/get-context-item.ts +1 -0
- package/src/actions/get-context-pack.ts +14 -0
- package/src/actions/get-creative-context.spec.ts +435 -0
- package/src/actions/get-creative-context.ts +197 -0
- package/src/actions/get-google-picker-session.spec.ts +62 -0
- package/src/actions/get-google-picker-session.ts +45 -0
- package/src/actions/index.ts +75 -0
- package/src/actions/infer-brand-dna.ts +15 -0
- package/src/actions/job-public-serialization.spec.ts +143 -0
- package/src/actions/list-canonical-logo-candidates.ts +121 -0
- package/src/actions/list-context-connections.spec.ts +23 -0
- package/src/actions/list-context-connections.ts +51 -0
- package/src/actions/list-context-memberships.ts +56 -0
- package/src/actions/list-context-packs.ts +17 -0
- package/src/actions/list-context-sources.ts +21 -0
- package/src/actions/list-context-suggestions.ts +30 -0
- package/src/actions/list-creative-contexts.spec.ts +38 -0
- package/src/actions/list-creative-contexts.ts +32 -0
- package/src/actions/manage-brand-profile.ts +58 -0
- package/src/actions/manage-context-membership.ts +80 -0
- package/src/actions/manage-context-pack.ts +81 -0
- package/src/actions/manage-context-source.ts +151 -0
- package/src/actions/manage-creative-context.ts +73 -0
- package/src/actions/manage-layout-template.ts +51 -0
- package/src/actions/preview-context-import.spec.ts +64 -0
- package/src/actions/preview-context-import.ts +61 -0
- package/src/actions/process-context-purge.ts +28 -0
- package/src/actions/propose-brand-dna.ts +22 -0
- package/src/actions/propose-canonical-logo.ts +19 -0
- package/src/actions/publish-brand-dna.ts +25 -0
- package/src/actions/recommend-context-roots.ts +24 -0
- package/src/actions/record-context-feedback.ts +16 -0
- package/src/actions/review-context-items.ts +69 -0
- package/src/actions/run-embedding-bakeoff.ts +90 -0
- package/src/actions/search-creative-context.ts +48 -0
- package/src/actions/set-brand-dna.ts +22 -0
- package/src/actions/start-context-enrichment.ts +52 -0
- package/src/actions/start-context-import.ts +38 -0
- package/src/client/CreativeContextChip.spec.ts +59 -0
- package/src/client/CreativeContextChip.tsx +243 -0
- package/src/client/CreativeContextPanel.tsx +3600 -0
- package/src/client/CreativeContextSettingsLink.tsx +30 -0
- package/src/client/CreativeContextShareTab.spec.ts +70 -0
- package/src/client/CreativeContextShareTab.tsx +666 -0
- package/src/client/actions.spec.ts +177 -0
- package/src/client/actions.ts +1024 -0
- package/src/client/agent-tab.tsx +56 -0
- package/src/client/application-state.spec.ts +46 -0
- package/src/client/application-state.ts +158 -0
- package/src/client/google-slides-picker.spec.ts +36 -0
- package/src/client/google-slides-picker.ts +146 -0
- package/src/client/index.ts +102 -0
- package/src/client/messages.ts +1370 -0
- package/src/client/source-config.spec.ts +166 -0
- package/src/connectors/connectors.spec.ts +778 -0
- package/src/connectors/context.ts +83 -0
- package/src/connectors/document-parser.ts +5 -0
- package/src/connectors/figma-native.ts +1192 -0
- package/src/connectors/figma-native.visual.spec.ts +221 -0
- package/src/connectors/figma.spec.ts +812 -0
- package/src/connectors/figma.ts +257 -0
- package/src/connectors/fixtures/google-slides-native.json +353 -0
- package/src/connectors/google-slides-native.spec.ts +804 -0
- package/src/connectors/google-slides-native.ts +1656 -0
- package/src/connectors/google-slides-native.visual.spec.ts +119 -0
- package/src/connectors/google-slides.ts +1171 -0
- package/src/connectors/index.ts +112 -0
- package/src/connectors/manual.ts +132 -0
- package/src/connectors/normalize.spec.ts +144 -0
- package/src/connectors/normalize.ts +475 -0
- package/src/connectors/notion.ts +529 -0
- package/src/connectors/private-artifacts.spec.ts +95 -0
- package/src/connectors/private-artifacts.ts +248 -0
- package/src/connectors/provider-response.ts +144 -0
- package/src/connectors/recommendations.ts +237 -0
- package/src/connectors/registry.ts +48 -0
- package/src/connectors/rendered-design.spec.ts +171 -0
- package/src/connectors/rendered-design.ts +495 -0
- package/src/connectors/rendered-page.spec.ts +388 -0
- package/src/connectors/rendered-page.ts +1387 -0
- package/src/connectors/smart-defaults.spec.ts +135 -0
- package/src/connectors/smart-defaults.ts +87 -0
- package/src/connectors/types.ts +113 -0
- package/src/connectors/upload.spec.ts +175 -0
- package/src/connectors/upload.ts +548 -0
- package/src/connectors/website.spec.ts +465 -0
- package/src/connectors/website.ts +777 -0
- package/src/embeddings/index.ts +2 -0
- package/src/embeddings/providers.spec.ts +73 -0
- package/src/embeddings/providers.ts +1 -0
- package/src/embeddings/types.ts +6 -0
- package/src/eval/acceptance-fixtures.ts +97 -0
- package/src/eval/acceptance.spec.ts +92 -0
- package/src/eval/acceptance.ts +371 -0
- package/src/eval/connectors-golden.spec.ts +421 -0
- package/src/eval/eval.spec.ts +166 -0
- package/src/eval/fixtures/README.md +17 -0
- package/src/eval/fixtures/figma-brand-system-v1.json +140 -0
- package/src/eval/fixtures/figma-brand-system-v2.json +127 -0
- package/src/eval/fixtures/launch-hero.png +0 -0
- package/src/eval/fixtures/launch-system-v1.pptx +0 -0
- package/src/eval/fixtures/launch-system-v2.pptx +0 -0
- package/src/eval/fixtures/notion-brand-root.json +218 -0
- package/src/eval/fixtures/pricing-hero.png +0 -0
- package/src/eval/fixtures/rendered-brand-page.html +76 -0
- package/src/eval/fixtures.spec.ts +43 -0
- package/src/eval/fixtures.ts +136 -0
- package/src/eval/index.ts +291 -0
- package/src/eval/library-flow.acceptance.spec.tsx +145 -0
- package/src/index.ts +4 -0
- package/src/jobs/background-worker.ts +423 -0
- package/src/jobs/import-runner.spec.ts +582 -0
- package/src/jobs/import-runner.ts +791 -0
- package/src/jobs/index.ts +40 -0
- package/src/jobs/progress.ts +37 -0
- package/src/jobs/rebuild.ts +245 -0
- package/src/jobs/server-worker.spec.ts +181 -0
- package/src/jobs/server-worker.ts +354 -0
- package/src/jobs/store-adapter.ts +52 -0
- package/src/jobs/types.ts +147 -0
- package/src/jobs/worker.ts +152 -0
- package/src/manifest.spec.ts +26 -0
- package/src/media-url.ts +17 -0
- package/src/native-artifact-reassembly.spec.ts +386 -0
- package/src/native-artifact-reassembly.ts +406 -0
- package/src/native-artifact.ts +102 -0
- package/src/schema/index.ts +527 -0
- package/src/schema/migrations.spec.ts +41 -0
- package/src/schema/migrations.ts +338 -0
- package/src/search/fusion.spec.ts +21 -0
- package/src/search/fusion.ts +1 -0
- package/src/search/mode.spec.ts +28 -0
- package/src/search/mode.ts +21 -0
- package/src/search/postgres-fts.spec.ts +63 -0
- package/src/search/postgres-fts.ts +1 -0
- package/src/server/brand-context.spec.ts +43 -0
- package/src/server/brand-context.ts +160 -0
- package/src/server/context.ts +162 -0
- package/src/server/enrichment.spec.ts +94 -0
- package/src/server/enrichment.ts +166 -0
- package/src/server/generation-artifact-access.spec.ts +104 -0
- package/src/server/generation-artifact-access.ts +217 -0
- package/src/server/generation-context-a2a.spec.ts +282 -0
- package/src/server/generation-context-off.spec.ts +213 -0
- package/src/server/generation-context.spec.ts +124 -0
- package/src/server/generation-context.ts +639 -0
- package/src/server/index.spec.ts +30 -0
- package/src/server/index.ts +163 -0
- package/src/server/isolated-a2a.spec.ts +184 -0
- package/src/server/isolated-a2a.ts +416 -0
- package/src/server/media.spec.ts +120 -0
- package/src/server/media.ts +136 -0
- package/src/server/native-resource-capture.spec.ts +121 -0
- package/src/server/native-resource-capture.ts +198 -0
- package/src/server/prompt-provider.spec.ts +78 -0
- package/src/server/prompt-provider.ts +73 -0
- package/src/server/public-serialization.spec.ts +150 -0
- package/src/server/public-serialization.ts +130 -0
- package/src/server/resource-paths.spec.ts +9 -0
- package/src/server/resource-paths.ts +5 -0
- package/src/server/retrieval-vector.spec.ts +180 -0
- package/src/server/retrieval.ts +590 -0
- package/src/server/safe-native-preview.spec.ts +29 -0
- package/src/server/safe-native-preview.ts +199 -0
- package/src/store/access.integration.spec.ts +3523 -0
- package/src/store/brand.ts +458 -0
- package/src/store/content.ts +2317 -0
- package/src/store/contexts.ts +1840 -0
- package/src/store/generation.ts +226 -0
- package/src/store/helpers.ts +53 -0
- package/src/store/index.ts +10 -0
- package/src/store/inference.spec.ts +84 -0
- package/src/store/inference.ts +339 -0
- package/src/store/invariants.spec.ts +119 -0
- package/src/store/jobs.ts +674 -0
- package/src/store/native-artifact-summary.ts +13 -0
- package/src/store/packs.ts +721 -0
- package/src/store/purge.ts +463 -0
- package/src/store/sources.spec.ts +102 -0
- package/src/store/sources.ts +692 -0
- package/src/store/suggestions.ts +361 -0
- package/src/types.ts +671 -0
- package/src/untrusted-reference.spec.ts +22 -0
- package/src/untrusted-reference.ts +24 -0
- package/src/vector/index.ts +1 -0
- package/src/vector/pgvector.spec.ts +115 -0
- package/src/vector/pgvector.ts +1 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,1024 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useActionMutation,
|
|
3
|
+
useActionQuery,
|
|
4
|
+
} from "@agent-native/core/client/hooks";
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
BrandDnaVersion,
|
|
8
|
+
BrandProfile,
|
|
9
|
+
ContextImportMode,
|
|
10
|
+
ContextJob,
|
|
11
|
+
ContextPackDetail,
|
|
12
|
+
ContextPackSummary,
|
|
13
|
+
ContextReviewItem,
|
|
14
|
+
ContextSearchResult,
|
|
15
|
+
ContextSourceStatus,
|
|
16
|
+
ContextSourceSummary,
|
|
17
|
+
CreativeContextSuggestion,
|
|
18
|
+
ImportPreviewItem,
|
|
19
|
+
UpstreamAccess,
|
|
20
|
+
} from "../types.js";
|
|
21
|
+
|
|
22
|
+
export const CREATIVE_CONTEXT_ACTIONS = {
|
|
23
|
+
listContexts: "list-creative-contexts",
|
|
24
|
+
manageContext: "manage-creative-context",
|
|
25
|
+
listMemberships: "list-context-memberships",
|
|
26
|
+
manageMembership: "manage-context-membership",
|
|
27
|
+
listSources: "list-context-sources",
|
|
28
|
+
manageSource: "manage-context-source",
|
|
29
|
+
previewImport: "preview-context-import",
|
|
30
|
+
startImport: "start-context-import",
|
|
31
|
+
importStatus: "get-context-import-status",
|
|
32
|
+
listConnections: "list-context-connections",
|
|
33
|
+
recommendRoots: "recommend-context-roots",
|
|
34
|
+
search: "search-creative-context",
|
|
35
|
+
getBrandProfile: "get-brand-profile",
|
|
36
|
+
publishBrandDna: "publish-brand-dna",
|
|
37
|
+
listPacks: "list-context-packs",
|
|
38
|
+
managePack: "manage-context-pack",
|
|
39
|
+
recordFeedback: "record-context-feedback",
|
|
40
|
+
getPack: "get-context-pack",
|
|
41
|
+
googlePickerSession: "get-google-picker-session",
|
|
42
|
+
reviewItems: "review-context-items",
|
|
43
|
+
listLogoCandidates: "list-canonical-logo-candidates",
|
|
44
|
+
proposeLogo: "propose-canonical-logo",
|
|
45
|
+
confirmLogo: "confirm-canonical-logo",
|
|
46
|
+
listSuggestions: "list-context-suggestions",
|
|
47
|
+
manageLayoutTemplate: "manage-layout-template",
|
|
48
|
+
} as const;
|
|
49
|
+
|
|
50
|
+
export type CreativeContextPolicy = "open" | "review" | "admins-only";
|
|
51
|
+
export type CreativeContextMembershipRank = "canonical" | "exemplar" | "normal";
|
|
52
|
+
|
|
53
|
+
export type CreativeContextSafePreview =
|
|
54
|
+
| {
|
|
55
|
+
type: "slides";
|
|
56
|
+
slideCount: number;
|
|
57
|
+
slides: Array<{ index: number; title: string; excerpt: string }>;
|
|
58
|
+
}
|
|
59
|
+
| { type: "slide"; index: number; title: string; excerpt: string }
|
|
60
|
+
| {
|
|
61
|
+
type: "design";
|
|
62
|
+
fileCount: number;
|
|
63
|
+
frames: Array<{ title: string; fileType: string; excerpt: string }>;
|
|
64
|
+
}
|
|
65
|
+
| {
|
|
66
|
+
type: "design-frame";
|
|
67
|
+
title: string;
|
|
68
|
+
fileType: string;
|
|
69
|
+
excerpt: string;
|
|
70
|
+
}
|
|
71
|
+
| {
|
|
72
|
+
type: "document";
|
|
73
|
+
headings: string[];
|
|
74
|
+
excerpt: string;
|
|
75
|
+
blocks: Array<{
|
|
76
|
+
kind: "heading" | "paragraph" | "bullet" | "quote" | "code";
|
|
77
|
+
text: string;
|
|
78
|
+
level?: number;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
| {
|
|
82
|
+
type: "asset";
|
|
83
|
+
mediaType: "image" | "video";
|
|
84
|
+
width: number | null;
|
|
85
|
+
height: number | null;
|
|
86
|
+
durationSeconds: number | null;
|
|
87
|
+
}
|
|
88
|
+
| {
|
|
89
|
+
type: "dashboard";
|
|
90
|
+
data: "synthetic";
|
|
91
|
+
panels: Array<{ id: string; title: string; visualization: string }>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export interface CreativeContextSummary {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string | null;
|
|
98
|
+
kind: "default" | "specialty";
|
|
99
|
+
memberCount: number;
|
|
100
|
+
updatedAt?: string | null;
|
|
101
|
+
approvalPolicy: CreativeContextPolicy;
|
|
102
|
+
visibility: "private" | "org" | "public";
|
|
103
|
+
access: {
|
|
104
|
+
role: "viewer" | "editor" | "admin" | "owner";
|
|
105
|
+
canSubmit: boolean;
|
|
106
|
+
canReview: boolean;
|
|
107
|
+
canAdmin: boolean;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface CreativeContextPreviewItem {
|
|
112
|
+
id: string;
|
|
113
|
+
itemVersionId: string;
|
|
114
|
+
title: string;
|
|
115
|
+
kind: string;
|
|
116
|
+
status: string;
|
|
117
|
+
sourceModifiedAt: string | null;
|
|
118
|
+
preview: CreativeContextSafePreview | null;
|
|
119
|
+
media: Array<{
|
|
120
|
+
id: string;
|
|
121
|
+
kind: string;
|
|
122
|
+
mimeType: string | null;
|
|
123
|
+
url: string;
|
|
124
|
+
}>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface CreativeContextMembership {
|
|
128
|
+
id: string;
|
|
129
|
+
contextId: string;
|
|
130
|
+
publishedItemId: string | null;
|
|
131
|
+
publishedItemVersionId: string | null;
|
|
132
|
+
pendingSubmissionId: string | null;
|
|
133
|
+
rank: CreativeContextMembershipRank;
|
|
134
|
+
purpose: string | null;
|
|
135
|
+
status: "active" | "removed";
|
|
136
|
+
updatedAt?: string | null;
|
|
137
|
+
nativeUpdateStatus?: {
|
|
138
|
+
state: "current" | "update-available" | "unknown";
|
|
139
|
+
} | null;
|
|
140
|
+
publishedItem?: CreativeContextPreviewItem | null;
|
|
141
|
+
pendingSubmission?: {
|
|
142
|
+
id: string;
|
|
143
|
+
status: string;
|
|
144
|
+
note: string | null;
|
|
145
|
+
submittedBy: string;
|
|
146
|
+
proposedItem: CreativeContextPreviewItem | null;
|
|
147
|
+
} | null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ListCreativeContextsParams {
|
|
151
|
+
limit?: number;
|
|
152
|
+
cursor?: string;
|
|
153
|
+
includeArchived?: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface ListCreativeContextsResult {
|
|
157
|
+
contexts: CreativeContextSummary[];
|
|
158
|
+
appId?: string;
|
|
159
|
+
appDefaultContextId?: string | null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type ManageCreativeContextParams =
|
|
163
|
+
| {
|
|
164
|
+
operation: "create";
|
|
165
|
+
name: string;
|
|
166
|
+
description?: string | null;
|
|
167
|
+
kind: "default" | "specialty";
|
|
168
|
+
brandProfileId?: string | null;
|
|
169
|
+
approvalPolicy?: CreativeContextPolicy;
|
|
170
|
+
}
|
|
171
|
+
| {
|
|
172
|
+
operation: "update";
|
|
173
|
+
contextId: string;
|
|
174
|
+
patch: {
|
|
175
|
+
name?: string;
|
|
176
|
+
description?: string | null;
|
|
177
|
+
brandProfileId?: string | null;
|
|
178
|
+
approvalPolicy?: CreativeContextPolicy;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
| { operation: "archive"; contextId: string }
|
|
182
|
+
| { operation: "set-app-default"; contextId: string; appId: string };
|
|
183
|
+
|
|
184
|
+
export interface ManageCreativeContextResult {
|
|
185
|
+
context: CreativeContextSummary | null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface ListContextMembershipsParams {
|
|
189
|
+
contextId: string;
|
|
190
|
+
status?: "active" | "removed";
|
|
191
|
+
limit?: number;
|
|
192
|
+
cursor?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface ListContextMembershipsResult {
|
|
196
|
+
memberships: CreativeContextMembership[];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export type ManageContextMembershipParams =
|
|
200
|
+
| {
|
|
201
|
+
operation: "submit";
|
|
202
|
+
contextId: string;
|
|
203
|
+
itemId?: string;
|
|
204
|
+
itemVersionId?: string;
|
|
205
|
+
nativeResource?: {
|
|
206
|
+
appId: string;
|
|
207
|
+
resourceType: string;
|
|
208
|
+
resourceId: string;
|
|
209
|
+
expectedUpdatedAt?: string;
|
|
210
|
+
};
|
|
211
|
+
rank?: CreativeContextMembershipRank;
|
|
212
|
+
purpose?: string;
|
|
213
|
+
note?: string;
|
|
214
|
+
confirmBroaderPublication?: true;
|
|
215
|
+
}
|
|
216
|
+
| {
|
|
217
|
+
operation: "submit-latest";
|
|
218
|
+
contextId: string;
|
|
219
|
+
membershipId: string;
|
|
220
|
+
note?: string;
|
|
221
|
+
confirmBroaderPublication?: true;
|
|
222
|
+
}
|
|
223
|
+
| {
|
|
224
|
+
operation: "approve" | "request-changes" | "withdraw" | "remove";
|
|
225
|
+
contextId: string;
|
|
226
|
+
membershipId: string;
|
|
227
|
+
note?: string | null;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export interface ManageContextMembershipResult {
|
|
231
|
+
membership: CreativeContextMembership | null;
|
|
232
|
+
membershipId?: string;
|
|
233
|
+
submission?: { id: string; status: string };
|
|
234
|
+
withdrawn?: boolean;
|
|
235
|
+
approved?: boolean;
|
|
236
|
+
requestChanges?: boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function record(value: unknown): Record<string, unknown> | null {
|
|
240
|
+
return value && typeof value === "object"
|
|
241
|
+
? (value as Record<string, unknown>)
|
|
242
|
+
: null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function previewString(value: unknown, limit: number) {
|
|
246
|
+
return typeof value === "string" ? value.slice(0, limit) : "";
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function previewNumber(value: unknown) {
|
|
250
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Accept only the compact structured preview contract. Native payloads and
|
|
255
|
+
* arbitrary item metadata deliberately never cross into the shared client.
|
|
256
|
+
*/
|
|
257
|
+
export function parseCreativeContextSafePreview(
|
|
258
|
+
value: unknown,
|
|
259
|
+
): CreativeContextSafePreview | null {
|
|
260
|
+
const preview = record(value);
|
|
261
|
+
if (!preview || typeof preview.type !== "string") return null;
|
|
262
|
+
if (preview.type === "slides") {
|
|
263
|
+
const slides = Array.isArray(preview.slides)
|
|
264
|
+
? preview.slides.slice(0, 24).flatMap((entry, index) => {
|
|
265
|
+
const slide = record(entry);
|
|
266
|
+
if (!slide) return [];
|
|
267
|
+
return [
|
|
268
|
+
{
|
|
269
|
+
index:
|
|
270
|
+
typeof slide.index === "number" && slide.index > 0
|
|
271
|
+
? Math.floor(slide.index)
|
|
272
|
+
: index + 1,
|
|
273
|
+
title: previewString(slide.title, 160) || `Slide ${index + 1}`,
|
|
274
|
+
excerpt: previewString(slide.excerpt, 320),
|
|
275
|
+
},
|
|
276
|
+
];
|
|
277
|
+
})
|
|
278
|
+
: [];
|
|
279
|
+
return {
|
|
280
|
+
type: "slides",
|
|
281
|
+
slideCount:
|
|
282
|
+
typeof preview.slideCount === "number" && preview.slideCount >= 0
|
|
283
|
+
? Math.floor(preview.slideCount)
|
|
284
|
+
: slides.length,
|
|
285
|
+
slides,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
if (preview.type === "slide") {
|
|
289
|
+
return {
|
|
290
|
+
type: "slide",
|
|
291
|
+
index:
|
|
292
|
+
typeof preview.index === "number" && preview.index > 0
|
|
293
|
+
? Math.floor(preview.index)
|
|
294
|
+
: 1,
|
|
295
|
+
title: previewString(preview.title, 160) || "Slide",
|
|
296
|
+
excerpt: previewString(preview.excerpt, 500),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
if (preview.type === "design") {
|
|
300
|
+
const frames = Array.isArray(preview.frames)
|
|
301
|
+
? preview.frames.slice(0, 24).flatMap((entry) => {
|
|
302
|
+
const frame = record(entry);
|
|
303
|
+
if (!frame) return [];
|
|
304
|
+
return [
|
|
305
|
+
{
|
|
306
|
+
title: previewString(frame.title, 160) || "Untitled frame",
|
|
307
|
+
fileType: previewString(frame.fileType, 80) || "design",
|
|
308
|
+
excerpt: previewString(frame.excerpt, 320),
|
|
309
|
+
},
|
|
310
|
+
];
|
|
311
|
+
})
|
|
312
|
+
: [];
|
|
313
|
+
return {
|
|
314
|
+
type: "design",
|
|
315
|
+
fileCount:
|
|
316
|
+
typeof preview.fileCount === "number" && preview.fileCount >= 0
|
|
317
|
+
? Math.floor(preview.fileCount)
|
|
318
|
+
: frames.length,
|
|
319
|
+
frames,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
if (preview.type === "design-frame") {
|
|
323
|
+
return {
|
|
324
|
+
type: "design-frame",
|
|
325
|
+
title: previewString(preview.title, 160) || "Untitled frame",
|
|
326
|
+
fileType: previewString(preview.fileType, 80) || "design",
|
|
327
|
+
excerpt: previewString(preview.excerpt, 500),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
if (preview.type === "document" || preview.type === "markdown") {
|
|
331
|
+
const headings = Array.isArray(preview.headings)
|
|
332
|
+
? preview.headings
|
|
333
|
+
.slice(0, 8)
|
|
334
|
+
.map((heading) => previewString(heading, 160))
|
|
335
|
+
.filter(Boolean)
|
|
336
|
+
: [];
|
|
337
|
+
const blocks = Array.isArray(preview.blocks)
|
|
338
|
+
? preview.blocks.slice(0, 40).flatMap((entry) => {
|
|
339
|
+
const block = record(entry);
|
|
340
|
+
if (!block) return [];
|
|
341
|
+
const kind: "heading" | "paragraph" | "bullet" | "quote" | "code" =
|
|
342
|
+
block.kind === "heading" ||
|
|
343
|
+
block.kind === "bullet" ||
|
|
344
|
+
block.kind === "quote" ||
|
|
345
|
+
block.kind === "code"
|
|
346
|
+
? block.kind
|
|
347
|
+
: "paragraph";
|
|
348
|
+
const text = previewString(block.text, 600);
|
|
349
|
+
if (!text) return [];
|
|
350
|
+
const level =
|
|
351
|
+
kind === "heading" &&
|
|
352
|
+
typeof block.level === "number" &&
|
|
353
|
+
block.level >= 1 &&
|
|
354
|
+
block.level <= 6
|
|
355
|
+
? Math.floor(block.level)
|
|
356
|
+
: undefined;
|
|
357
|
+
return [{ kind, text, ...(level ? { level } : {}) }];
|
|
358
|
+
})
|
|
359
|
+
: [];
|
|
360
|
+
return {
|
|
361
|
+
type: "document",
|
|
362
|
+
headings,
|
|
363
|
+
excerpt: previewString(preview.excerpt, 1_500),
|
|
364
|
+
blocks,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
if (preview.type === "asset") {
|
|
368
|
+
return {
|
|
369
|
+
type: "asset",
|
|
370
|
+
mediaType: preview.mediaType === "video" ? "video" : "image",
|
|
371
|
+
width: previewNumber(preview.width),
|
|
372
|
+
height: previewNumber(preview.height),
|
|
373
|
+
durationSeconds: previewNumber(preview.durationSeconds),
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
if (preview.type === "dashboard") {
|
|
377
|
+
const panels = Array.isArray(preview.panels)
|
|
378
|
+
? preview.panels.slice(0, 24).flatMap((entry, index) => {
|
|
379
|
+
const panel = record(entry);
|
|
380
|
+
if (!panel) return [];
|
|
381
|
+
return [
|
|
382
|
+
{
|
|
383
|
+
id: previewString(panel.id, 120) || String(index + 1),
|
|
384
|
+
title: previewString(panel.title, 160) || `Panel ${index + 1}`,
|
|
385
|
+
visualization: previewString(panel.visualization, 80) || "chart",
|
|
386
|
+
},
|
|
387
|
+
];
|
|
388
|
+
})
|
|
389
|
+
: [];
|
|
390
|
+
return { type: "dashboard", data: "synthetic", panels };
|
|
391
|
+
}
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function contextSummary(value: unknown): CreativeContextSummary | null {
|
|
396
|
+
const source = record(value);
|
|
397
|
+
if (
|
|
398
|
+
!source ||
|
|
399
|
+
typeof source.id !== "string" ||
|
|
400
|
+
typeof source.name !== "string"
|
|
401
|
+
) {
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
const access = record(source.access);
|
|
405
|
+
const role =
|
|
406
|
+
access?.role === "owner" ||
|
|
407
|
+
access?.role === "admin" ||
|
|
408
|
+
access?.role === "editor"
|
|
409
|
+
? access.role
|
|
410
|
+
: "viewer";
|
|
411
|
+
return {
|
|
412
|
+
id: source.id,
|
|
413
|
+
name: source.name,
|
|
414
|
+
description:
|
|
415
|
+
typeof source.description === "string" ? source.description : null,
|
|
416
|
+
kind: source.kind === "specialty" ? "specialty" : "default",
|
|
417
|
+
memberCount:
|
|
418
|
+
typeof source.memberCount === "number" ? source.memberCount : 0,
|
|
419
|
+
updatedAt: typeof source.updatedAt === "string" ? source.updatedAt : null,
|
|
420
|
+
approvalPolicy:
|
|
421
|
+
source.approvalPolicy === "review" ||
|
|
422
|
+
source.approvalPolicy === "admins-only"
|
|
423
|
+
? source.approvalPolicy
|
|
424
|
+
: "open",
|
|
425
|
+
visibility:
|
|
426
|
+
source.visibility === "org" || source.visibility === "public"
|
|
427
|
+
? source.visibility
|
|
428
|
+
: "private",
|
|
429
|
+
access: {
|
|
430
|
+
role,
|
|
431
|
+
canSubmit: access?.canSubmit === true,
|
|
432
|
+
canReview: access?.canReview === true,
|
|
433
|
+
canAdmin: access?.canAdmin === true,
|
|
434
|
+
},
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export function parseCreativeContexts(
|
|
439
|
+
value: unknown,
|
|
440
|
+
): CreativeContextSummary[] {
|
|
441
|
+
const source = Array.isArray(value)
|
|
442
|
+
? value
|
|
443
|
+
: (record(value)?.contexts ?? record(value)?.items ?? []);
|
|
444
|
+
return Array.isArray(source)
|
|
445
|
+
? source
|
|
446
|
+
.map(contextSummary)
|
|
447
|
+
.filter((item): item is CreativeContextSummary => Boolean(item))
|
|
448
|
+
: [];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function parseContextPreviewItem(
|
|
452
|
+
value: unknown,
|
|
453
|
+
): CreativeContextPreviewItem | null {
|
|
454
|
+
const item = record(value);
|
|
455
|
+
if (
|
|
456
|
+
!item ||
|
|
457
|
+
typeof item.id !== "string" ||
|
|
458
|
+
typeof item.itemVersionId !== "string" ||
|
|
459
|
+
typeof item.title !== "string" ||
|
|
460
|
+
typeof item.kind !== "string"
|
|
461
|
+
)
|
|
462
|
+
return null;
|
|
463
|
+
const media = Array.isArray(item.media)
|
|
464
|
+
? item.media.flatMap((value) => {
|
|
465
|
+
const medium = record(value);
|
|
466
|
+
return medium &&
|
|
467
|
+
typeof medium.id === "string" &&
|
|
468
|
+
typeof medium.kind === "string" &&
|
|
469
|
+
typeof medium.url === "string"
|
|
470
|
+
? [
|
|
471
|
+
{
|
|
472
|
+
id: medium.id,
|
|
473
|
+
kind: medium.kind,
|
|
474
|
+
mimeType:
|
|
475
|
+
typeof medium.mimeType === "string" ? medium.mimeType : null,
|
|
476
|
+
url: medium.url,
|
|
477
|
+
},
|
|
478
|
+
]
|
|
479
|
+
: [];
|
|
480
|
+
})
|
|
481
|
+
: [];
|
|
482
|
+
return {
|
|
483
|
+
id: item.id,
|
|
484
|
+
itemVersionId: item.itemVersionId,
|
|
485
|
+
title: item.title,
|
|
486
|
+
kind: item.kind,
|
|
487
|
+
status: typeof item.status === "string" ? item.status : "active",
|
|
488
|
+
sourceModifiedAt:
|
|
489
|
+
typeof item.sourceModifiedAt === "string" ? item.sourceModifiedAt : null,
|
|
490
|
+
preview: parseCreativeContextSafePreview(item.preview),
|
|
491
|
+
media,
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export function parseContextMemberships(
|
|
496
|
+
value: unknown,
|
|
497
|
+
): CreativeContextMembership[] {
|
|
498
|
+
const source = Array.isArray(value)
|
|
499
|
+
? value
|
|
500
|
+
: (record(value)?.memberships ?? record(value)?.items ?? []);
|
|
501
|
+
if (!Array.isArray(source)) return [];
|
|
502
|
+
return source.flatMap((value) => {
|
|
503
|
+
const item = record(value);
|
|
504
|
+
if (
|
|
505
|
+
!item ||
|
|
506
|
+
typeof item.id !== "string" ||
|
|
507
|
+
typeof item.contextId !== "string"
|
|
508
|
+
) {
|
|
509
|
+
return [];
|
|
510
|
+
}
|
|
511
|
+
return [
|
|
512
|
+
{
|
|
513
|
+
id: item.id,
|
|
514
|
+
contextId: item.contextId,
|
|
515
|
+
publishedItemId:
|
|
516
|
+
typeof item.publishedItemId === "string"
|
|
517
|
+
? item.publishedItemId
|
|
518
|
+
: null,
|
|
519
|
+
publishedItemVersionId:
|
|
520
|
+
typeof item.publishedItemVersionId === "string"
|
|
521
|
+
? item.publishedItemVersionId
|
|
522
|
+
: null,
|
|
523
|
+
pendingSubmissionId:
|
|
524
|
+
typeof item.pendingSubmissionId === "string"
|
|
525
|
+
? item.pendingSubmissionId
|
|
526
|
+
: null,
|
|
527
|
+
rank:
|
|
528
|
+
item.rank === "canonical" || item.rank === "exemplar"
|
|
529
|
+
? item.rank
|
|
530
|
+
: "normal",
|
|
531
|
+
purpose: typeof item.purpose === "string" ? item.purpose : null,
|
|
532
|
+
status: item.status === "removed" ? "removed" : "active",
|
|
533
|
+
updatedAt: typeof item.updatedAt === "string" ? item.updatedAt : null,
|
|
534
|
+
nativeUpdateStatus: (() => {
|
|
535
|
+
const status = record(item.nativeUpdateStatus)?.state;
|
|
536
|
+
return status === "current" ||
|
|
537
|
+
status === "update-available" ||
|
|
538
|
+
status === "unknown"
|
|
539
|
+
? { state: status }
|
|
540
|
+
: null;
|
|
541
|
+
})(),
|
|
542
|
+
pendingSubmission: (() => {
|
|
543
|
+
const submission = record(item.pendingSubmission);
|
|
544
|
+
return submission &&
|
|
545
|
+
typeof submission.id === "string" &&
|
|
546
|
+
typeof submission.status === "string"
|
|
547
|
+
? {
|
|
548
|
+
id: submission.id,
|
|
549
|
+
status: submission.status,
|
|
550
|
+
note:
|
|
551
|
+
typeof submission.note === "string" ? submission.note : null,
|
|
552
|
+
submittedBy:
|
|
553
|
+
typeof submission.submittedBy === "string"
|
|
554
|
+
? submission.submittedBy
|
|
555
|
+
: "",
|
|
556
|
+
proposedItem: parseContextPreviewItem(submission.proposedItem),
|
|
557
|
+
}
|
|
558
|
+
: null;
|
|
559
|
+
})(),
|
|
560
|
+
publishedItem: parseContextPreviewItem(item.publishedItem),
|
|
561
|
+
},
|
|
562
|
+
];
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function parseContextMembershipsForResource(
|
|
567
|
+
value: unknown,
|
|
568
|
+
resource: { appId: string; resourceType: string; resourceId: string },
|
|
569
|
+
): CreativeContextMembership[] {
|
|
570
|
+
const source = record(value)?.memberships;
|
|
571
|
+
if (!Array.isArray(source)) return [];
|
|
572
|
+
const artifactKey = `${resource.appId}:${resource.resourceType}:${resource.resourceId}`;
|
|
573
|
+
return parseContextMemberships({
|
|
574
|
+
memberships: source.filter(
|
|
575
|
+
(value) => record(value)?.artifactKey === artifactKey,
|
|
576
|
+
),
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export interface CanonicalLogoCandidate {
|
|
581
|
+
mediaId: string;
|
|
582
|
+
itemId: string;
|
|
583
|
+
itemVersionId: string;
|
|
584
|
+
title: string;
|
|
585
|
+
mimeType: string | null;
|
|
586
|
+
thumbnailUrl: string;
|
|
587
|
+
score: number;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export interface ListCanonicalLogoCandidatesResult {
|
|
591
|
+
profileId: string | null;
|
|
592
|
+
candidates: CanonicalLogoCandidate[];
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export interface ListCreativeContextSuggestionsResult {
|
|
596
|
+
suggestions: CreativeContextSuggestion[];
|
|
597
|
+
capabilities: {
|
|
598
|
+
canonicalLogo: boolean;
|
|
599
|
+
layoutTemplate: boolean;
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export interface ListContextSourcesParams {
|
|
604
|
+
status?: ContextSourceStatus;
|
|
605
|
+
kind?: string;
|
|
606
|
+
limit?: number;
|
|
607
|
+
cursor?: string;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export interface ListContextSourcesResult {
|
|
611
|
+
sources: ContextSourceSummary[];
|
|
612
|
+
nextCursor?: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
export interface SearchCreativeContextParams {
|
|
616
|
+
query: string;
|
|
617
|
+
sourceIds?: string[];
|
|
618
|
+
packId?: string;
|
|
619
|
+
contextId?: string;
|
|
620
|
+
kinds?: string[];
|
|
621
|
+
limit?: number;
|
|
622
|
+
cursor?: string;
|
|
623
|
+
snapshot?: boolean;
|
|
624
|
+
contextPackName?: string;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export interface SearchCreativeContextResult {
|
|
628
|
+
query: string;
|
|
629
|
+
results: ContextSearchResult[];
|
|
630
|
+
nextCursor?: string;
|
|
631
|
+
coverage: {
|
|
632
|
+
mode: "none" | "lexical" | "fts" | "vector" | "fused";
|
|
633
|
+
lanes: {
|
|
634
|
+
lexical: { available: boolean; count: number };
|
|
635
|
+
fts: { available: boolean; count: number };
|
|
636
|
+
vector: { available: boolean; count: number };
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
contextPackId: string | null;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface ListContextPacksResult {
|
|
643
|
+
packs: ContextPackSummary[];
|
|
644
|
+
nextCursor?: string;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
export interface StartContextImportParams {
|
|
648
|
+
sourceId: string;
|
|
649
|
+
mode?: ContextImportMode;
|
|
650
|
+
itemExternalIds?: string[];
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export interface StartContextImportResult {
|
|
654
|
+
job: ContextJob;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export type ManageContextSourceParams =
|
|
658
|
+
| {
|
|
659
|
+
operation: "create";
|
|
660
|
+
name: string;
|
|
661
|
+
kind: string;
|
|
662
|
+
externalRef?: string;
|
|
663
|
+
connectionId?: string;
|
|
664
|
+
config?: Record<string, unknown>;
|
|
665
|
+
upstreamAccess?: UpstreamAccess;
|
|
666
|
+
}
|
|
667
|
+
| {
|
|
668
|
+
operation: "update";
|
|
669
|
+
sourceId: string;
|
|
670
|
+
patch: {
|
|
671
|
+
name?: string;
|
|
672
|
+
externalRef?: string | null;
|
|
673
|
+
connectionId?: string | null;
|
|
674
|
+
config?: Record<string, unknown>;
|
|
675
|
+
status?: ContextSourceStatus;
|
|
676
|
+
upstreamAccess?: UpstreamAccess;
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
| {
|
|
680
|
+
operation: "archive" | "restore" | "delete";
|
|
681
|
+
sourceId: string;
|
|
682
|
+
}
|
|
683
|
+
| {
|
|
684
|
+
operation: "preview-promotion";
|
|
685
|
+
sourceId: string;
|
|
686
|
+
}
|
|
687
|
+
| {
|
|
688
|
+
operation: "promote";
|
|
689
|
+
sourceId: string;
|
|
690
|
+
confirmation: {
|
|
691
|
+
containerRef: string;
|
|
692
|
+
boundaryHash: string;
|
|
693
|
+
itemCount: number;
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
export interface ManageContextSourceResult {
|
|
698
|
+
source: ContextSourceSummary | null;
|
|
699
|
+
deleted: boolean;
|
|
700
|
+
purgeJobId?: string;
|
|
701
|
+
promotionPreview?: {
|
|
702
|
+
sourceId: string;
|
|
703
|
+
containerRef: string;
|
|
704
|
+
boundaryHash: string;
|
|
705
|
+
itemCount: number;
|
|
706
|
+
restrictedItemCount: number;
|
|
707
|
+
targetOrgId: string;
|
|
708
|
+
callerAuthority: "org-admin" | "verified-container-owner";
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export interface PreviewContextImportResult {
|
|
713
|
+
sourceId: string;
|
|
714
|
+
items: ImportPreviewItem[];
|
|
715
|
+
smartDefaultExternalIds: string[];
|
|
716
|
+
nextCursor?: string;
|
|
717
|
+
total?: number;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
export interface GetContextImportStatusResult {
|
|
721
|
+
job: ContextJob | null;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export type CreativeContextConnectionProvider =
|
|
725
|
+
| "google_drive"
|
|
726
|
+
| "figma"
|
|
727
|
+
| "notion";
|
|
728
|
+
|
|
729
|
+
export interface CreativeContextConnection {
|
|
730
|
+
connectionId: string;
|
|
731
|
+
provider: CreativeContextConnectionProvider;
|
|
732
|
+
label: string;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export interface ListCreativeContextConnectionsResult {
|
|
736
|
+
appId: string;
|
|
737
|
+
provider: CreativeContextConnectionProvider;
|
|
738
|
+
connections: CreativeContextConnection[];
|
|
739
|
+
autoSelectedConnectionId: string | null;
|
|
740
|
+
needsPicker: boolean;
|
|
741
|
+
needsSetup: boolean;
|
|
742
|
+
connectionsPath: string;
|
|
743
|
+
connectPath: string;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
export interface GetGooglePickerSessionResult {
|
|
747
|
+
accessToken: string;
|
|
748
|
+
accountLabel: string | null;
|
|
749
|
+
apiKey: string;
|
|
750
|
+
appId: string;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export type CreativeContextRecommendationProvider =
|
|
754
|
+
| "google-slides"
|
|
755
|
+
| "figma"
|
|
756
|
+
| "notion";
|
|
757
|
+
|
|
758
|
+
export interface CreativeContextRootRecommendation {
|
|
759
|
+
externalId: string;
|
|
760
|
+
provider: CreativeContextRecommendationProvider;
|
|
761
|
+
kind: "page" | "presentation" | "file";
|
|
762
|
+
title: string;
|
|
763
|
+
canonicalUrl?: string;
|
|
764
|
+
sourceModifiedAt?: string;
|
|
765
|
+
containerRef?: string;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export interface RecommendCreativeContextRootsResult {
|
|
769
|
+
recommendations: CreativeContextRootRecommendation[];
|
|
770
|
+
persisted: false;
|
|
771
|
+
requiresExplicitBoundary: true;
|
|
772
|
+
unavailableReason?: string;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export interface GetBrandProfileResult {
|
|
776
|
+
profile: BrandProfile | null;
|
|
777
|
+
dna: BrandDnaVersion | null;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
export interface PublishBrandDnaParams {
|
|
781
|
+
profileId: string;
|
|
782
|
+
proposalVersionId: string;
|
|
783
|
+
confirmation: {
|
|
784
|
+
proposalVersionId: string;
|
|
785
|
+
contentHash: string;
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export interface PublishBrandDnaResult {
|
|
790
|
+
profile: BrandProfile;
|
|
791
|
+
dna: BrandDnaVersion;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
export interface GetContextPackResult {
|
|
795
|
+
pack: ContextPackDetail | null;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
export type ReviewContextItemsParams =
|
|
799
|
+
| {
|
|
800
|
+
sourceId: string;
|
|
801
|
+
operation: "list";
|
|
802
|
+
queue?: "restricted" | "all";
|
|
803
|
+
limit?: number;
|
|
804
|
+
}
|
|
805
|
+
| {
|
|
806
|
+
sourceId: string;
|
|
807
|
+
operation:
|
|
808
|
+
| "approve"
|
|
809
|
+
| "exclude"
|
|
810
|
+
| "exemplar"
|
|
811
|
+
| "normal"
|
|
812
|
+
| "ignore"
|
|
813
|
+
| "star"
|
|
814
|
+
| "unstar"
|
|
815
|
+
| "deprecate"
|
|
816
|
+
| "restore";
|
|
817
|
+
itemIds: string[];
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
export interface ReviewContextItemsResult {
|
|
821
|
+
items: ContextReviewItem[];
|
|
822
|
+
updated: number;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
export function useCreativeContextSources(
|
|
826
|
+
params: ListContextSourcesParams = {},
|
|
827
|
+
) {
|
|
828
|
+
return useActionQuery<ListContextSourcesResult>(
|
|
829
|
+
CREATIVE_CONTEXT_ACTIONS.listSources,
|
|
830
|
+
params,
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
export function useCreativeContexts(params: ListCreativeContextsParams = {}) {
|
|
835
|
+
return useActionQuery<ListCreativeContextsResult>(
|
|
836
|
+
CREATIVE_CONTEXT_ACTIONS.listContexts,
|
|
837
|
+
{ limit: 50, ...params },
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
export function useManageCreativeContext() {
|
|
842
|
+
return useActionMutation<
|
|
843
|
+
ManageCreativeContextResult,
|
|
844
|
+
ManageCreativeContextParams
|
|
845
|
+
>(CREATIVE_CONTEXT_ACTIONS.manageContext);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export function useContextMemberships(
|
|
849
|
+
params: ListContextMembershipsParams | null,
|
|
850
|
+
) {
|
|
851
|
+
return useActionQuery<ListContextMembershipsResult>(
|
|
852
|
+
CREATIVE_CONTEXT_ACTIONS.listMemberships,
|
|
853
|
+
params ? { limit: 50, ...params } : undefined,
|
|
854
|
+
{ enabled: Boolean(params) },
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export function useManageContextMembership() {
|
|
859
|
+
return useActionMutation<
|
|
860
|
+
ManageContextMembershipResult,
|
|
861
|
+
ManageContextMembershipParams
|
|
862
|
+
>(CREATIVE_CONTEXT_ACTIONS.manageMembership);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export function useCreativeContextSearch() {
|
|
866
|
+
return useActionMutation<
|
|
867
|
+
SearchCreativeContextResult,
|
|
868
|
+
SearchCreativeContextParams
|
|
869
|
+
>(CREATIVE_CONTEXT_ACTIONS.search);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export function useCreativeContextPacks() {
|
|
873
|
+
return useActionQuery<ListContextPacksResult>(
|
|
874
|
+
CREATIVE_CONTEXT_ACTIONS.listPacks,
|
|
875
|
+
{ limit: 50 },
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export function useRefreshCreativeContextSource() {
|
|
880
|
+
return useActionMutation<StartContextImportResult, StartContextImportParams>(
|
|
881
|
+
CREATIVE_CONTEXT_ACTIONS.startImport,
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export function useManageCreativeContextSource() {
|
|
886
|
+
return useActionMutation<
|
|
887
|
+
ManageContextSourceResult,
|
|
888
|
+
ManageContextSourceParams
|
|
889
|
+
>(CREATIVE_CONTEXT_ACTIONS.manageSource);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
export function usePreviewCreativeContextImport(sourceId: string | null) {
|
|
893
|
+
return useActionQuery<PreviewContextImportResult>(
|
|
894
|
+
CREATIVE_CONTEXT_ACTIONS.previewImport,
|
|
895
|
+
sourceId ? { sourceId, limit: 100 } : undefined,
|
|
896
|
+
{ enabled: Boolean(sourceId) },
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export function useStartCreativeContextImport() {
|
|
901
|
+
return useActionMutation<StartContextImportResult, StartContextImportParams>(
|
|
902
|
+
CREATIVE_CONTEXT_ACTIONS.startImport,
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export function useCreativeContextImportStatus(jobId: string | null) {
|
|
907
|
+
return useActionQuery<GetContextImportStatusResult>(
|
|
908
|
+
CREATIVE_CONTEXT_ACTIONS.importStatus,
|
|
909
|
+
jobId ? { jobId } : undefined,
|
|
910
|
+
{
|
|
911
|
+
enabled: Boolean(jobId),
|
|
912
|
+
refetchInterval: (query) => {
|
|
913
|
+
const status = query.state.data?.job?.status;
|
|
914
|
+
return status === "queued" || status === "running" ? 2_000 : false;
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export function useCreativeContextConnections(
|
|
921
|
+
provider: CreativeContextConnectionProvider | null,
|
|
922
|
+
) {
|
|
923
|
+
return useActionQuery<ListCreativeContextConnectionsResult>(
|
|
924
|
+
CREATIVE_CONTEXT_ACTIONS.listConnections,
|
|
925
|
+
provider ? { provider } : undefined,
|
|
926
|
+
{ enabled: Boolean(provider) },
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
export function useCreativeContextRootRecommendations(
|
|
931
|
+
provider: CreativeContextRecommendationProvider | null,
|
|
932
|
+
connectionId: string | null,
|
|
933
|
+
figmaBoundary: { figmaProjectId?: string; figmaTeamId?: string } = {},
|
|
934
|
+
) {
|
|
935
|
+
return useActionQuery<RecommendCreativeContextRootsResult>(
|
|
936
|
+
CREATIVE_CONTEXT_ACTIONS.recommendRoots,
|
|
937
|
+
provider && connectionId
|
|
938
|
+
? { provider, connectionId, limit: 15, ...figmaBoundary }
|
|
939
|
+
: undefined,
|
|
940
|
+
{ enabled: Boolean(provider && connectionId) },
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
export function useCreativeContextGooglePickerSession(
|
|
945
|
+
connectionId: string | null,
|
|
946
|
+
) {
|
|
947
|
+
return useActionQuery<GetGooglePickerSessionResult>(
|
|
948
|
+
CREATIVE_CONTEXT_ACTIONS.googlePickerSession,
|
|
949
|
+
connectionId ? { connectionId } : undefined,
|
|
950
|
+
{ enabled: false },
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export function useCreativeContextBrandProfile() {
|
|
955
|
+
return useActionQuery<GetBrandProfileResult>(
|
|
956
|
+
CREATIVE_CONTEXT_ACTIONS.getBrandProfile,
|
|
957
|
+
{},
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
export function usePublishCreativeContextBrandDna() {
|
|
962
|
+
return useActionMutation<PublishBrandDnaResult, PublishBrandDnaParams>(
|
|
963
|
+
CREATIVE_CONTEXT_ACTIONS.publishBrandDna,
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
export function useCreativeContextPack(packId: string | null) {
|
|
968
|
+
return useActionQuery<GetContextPackResult>(
|
|
969
|
+
CREATIVE_CONTEXT_ACTIONS.getPack,
|
|
970
|
+
packId ? { packId } : undefined,
|
|
971
|
+
{ enabled: Boolean(packId) },
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export function useReviewCreativeContextItems() {
|
|
976
|
+
return useActionMutation<ReviewContextItemsResult, ReviewContextItemsParams>(
|
|
977
|
+
CREATIVE_CONTEXT_ACTIONS.reviewItems,
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
export function useCanonicalLogoCandidates(profileId?: string, enabled = true) {
|
|
982
|
+
return useActionQuery<ListCanonicalLogoCandidatesResult>(
|
|
983
|
+
CREATIVE_CONTEXT_ACTIONS.listLogoCandidates,
|
|
984
|
+
{ profileId, limit: 6 },
|
|
985
|
+
{ enabled },
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export function useCreativeContextSuggestions() {
|
|
990
|
+
return useActionQuery<ListCreativeContextSuggestionsResult>(
|
|
991
|
+
CREATIVE_CONTEXT_ACTIONS.listSuggestions,
|
|
992
|
+
{ limit: 50 },
|
|
993
|
+
);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export function useProposeCanonicalLogo() {
|
|
997
|
+
return useActionMutation<
|
|
998
|
+
CreativeContextSuggestion,
|
|
999
|
+
{
|
|
1000
|
+
profileId?: string;
|
|
1001
|
+
itemId: string;
|
|
1002
|
+
itemVersionId?: string;
|
|
1003
|
+
reason?: string;
|
|
1004
|
+
payload?: Record<string, unknown>;
|
|
1005
|
+
}
|
|
1006
|
+
>(CREATIVE_CONTEXT_ACTIONS.proposeLogo);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
export function useConfirmCanonicalLogo() {
|
|
1010
|
+
return useActionMutation<
|
|
1011
|
+
CreativeContextSuggestion,
|
|
1012
|
+
{ suggestionId: string; decision: "confirm" | "reject" }
|
|
1013
|
+
>(CREATIVE_CONTEXT_ACTIONS.confirmLogo);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
export function useManageLayoutTemplate() {
|
|
1017
|
+
return useActionMutation<
|
|
1018
|
+
CreativeContextSuggestion,
|
|
1019
|
+
{
|
|
1020
|
+
operation: "promote" | "demote" | "reject";
|
|
1021
|
+
suggestionId: string;
|
|
1022
|
+
}
|
|
1023
|
+
>(CREATIVE_CONTEXT_ACTIONS.manageLayoutTemplate);
|
|
1024
|
+
}
|