create-yss-spec 3.5.2 → 3.5.3
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/package.json +1 -1
- package/src/template/asset-runtime.js +3 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
- package/template/.agents/skills/codebase-design/SKILL.md +4 -0
- package/template/{.codex/skills/improve-codebase-architecture/SKILL.md → .agents/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.agents/skills/frontend-commit/SKILL.md +4 -93
- package/template/.agents/skills/git-commit-core/SKILL.md +18 -0
- package/template/.agents/skills/java-backend-commit/SKILL.md +4 -96
- package/template/.agents/skills/llm-wiki/SKILL.md +12 -13
- package/template/.agents/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.agents/skills/llm-wiki/references/compile.md +21 -114
- package/template/.agents/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.agents/skills/llm-wiki/references/lint.md +9 -46
- package/template/.agents/skills/llm-wiki/references/query.md +9 -18
- package/template/.agents/skills/llm-wiki/references/schema.md +56 -29
- package/template/.agents/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.agents/skills/llm-wiki/references/writing.md +4 -4
- package/template/.agents/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.agents/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.agents/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.agents/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.agents/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.agents/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.agents/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.agents/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.agents/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.agents/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.agents/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.agents/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.agents/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.agents/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.agents/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.agents/skills/prototype/LOGIC.md +1 -1
- package/template/.agents/skills/prototype/SKILL.md +5 -19
- package/template/.agents/skills/setup-matt-pocock-skills/SKILL.md +3 -3
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
- package/template/.agents/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +8 -8
- package/template/.agents/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.agents/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.agents/skills/yss-research/SKILL.md +4 -0
- package/template/.codex/skills/codebase-design/SKILL.md +4 -0
- package/template/{.pi/skills/improve-codebase-architecture/SKILL.md → .codex/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.codex/skills/frontend-commit/SKILL.md +4 -93
- package/template/.codex/skills/git-commit-core/SKILL.md +18 -0
- package/template/.codex/skills/java-backend-commit/SKILL.md +4 -96
- package/template/.codex/skills/llm-wiki/SKILL.md +12 -13
- package/template/.codex/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.codex/skills/llm-wiki/references/compile.md +21 -114
- package/template/.codex/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.codex/skills/llm-wiki/references/lint.md +9 -46
- package/template/.codex/skills/llm-wiki/references/query.md +9 -18
- package/template/.codex/skills/llm-wiki/references/schema.md +56 -29
- package/template/.codex/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.codex/skills/llm-wiki/references/writing.md +4 -4
- package/template/.codex/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.codex/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.codex/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.codex/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.codex/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.codex/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.codex/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.codex/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.codex/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.codex/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.codex/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.codex/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.codex/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.codex/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.codex/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.codex/skills/prototype/LOGIC.md +1 -1
- package/template/.codex/skills/prototype/SKILL.md +5 -19
- package/template/.codex/skills/setup-matt-pocock-skills/SKILL.md +3 -3
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
- package/template/.codex/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +8 -8
- package/template/.codex/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.codex/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.codex/skills/yss-research/SKILL.md +4 -0
- package/template/.cursor/skills/codebase-design/SKILL.md +4 -0
- package/template/.cursor/skills/{improve-codebase-architecture/SKILL.md → codebase-design/references/architecture-audit.md} +3 -9
- package/template/.cursor/skills/frontend-commit/SKILL.md +4 -93
- package/template/.cursor/skills/git-commit-core/SKILL.md +18 -0
- package/template/.cursor/skills/java-backend-commit/SKILL.md +4 -96
- package/template/.cursor/skills/llm-wiki/SKILL.md +12 -13
- package/template/.cursor/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.cursor/skills/llm-wiki/references/compile.md +21 -114
- package/template/.cursor/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.cursor/skills/llm-wiki/references/lint.md +9 -46
- package/template/.cursor/skills/llm-wiki/references/query.md +9 -18
- package/template/.cursor/skills/llm-wiki/references/schema.md +56 -29
- package/template/.cursor/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.cursor/skills/llm-wiki/references/writing.md +4 -4
- package/template/.cursor/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.cursor/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.cursor/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.cursor/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.cursor/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.cursor/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.cursor/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.cursor/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.cursor/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.cursor/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.cursor/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.cursor/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.cursor/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.cursor/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.cursor/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.cursor/skills/prototype/LOGIC.md +1 -1
- package/template/.cursor/skills/prototype/SKILL.md +5 -19
- package/template/.cursor/skills/setup-matt-pocock-skills/SKILL.md +3 -3
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +8 -8
- package/template/.cursor/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.cursor/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.cursor/skills/yss-research/SKILL.md +4 -0
- package/template/.pi/skills/codebase-design/SKILL.md +4 -0
- package/template/{.agents/skills/improve-codebase-architecture/SKILL.md → .pi/skills/codebase-design/references/architecture-audit.md} +3 -9
- package/template/.pi/skills/frontend-commit/SKILL.md +4 -93
- package/template/.pi/skills/git-commit-core/SKILL.md +18 -0
- package/template/.pi/skills/java-backend-commit/SKILL.md +4 -96
- package/template/.pi/skills/llm-wiki/SKILL.md +12 -13
- package/template/.pi/skills/llm-wiki/assets/CLAUDE.md.template +7 -1
- package/template/.pi/skills/llm-wiki/references/compile.md +21 -114
- package/template/.pi/skills/llm-wiki/references/ingest.md +8 -33
- package/template/.pi/skills/llm-wiki/references/lint.md +9 -46
- package/template/.pi/skills/llm-wiki/references/query.md +9 -18
- package/template/.pi/skills/llm-wiki/references/schema.md +56 -29
- package/template/.pi/skills/llm-wiki/references/transactions.md +48 -0
- package/template/.pi/skills/llm-wiki/references/writing.md +4 -4
- package/template/.pi/skills/llm-wiki/scripts/advise.mjs +46 -58
- package/template/.pi/skills/llm-wiki/scripts/advise.test.mjs +11 -16
- package/template/.pi/skills/llm-wiki/scripts/core.mjs +262 -0
- package/template/.pi/skills/llm-wiki/scripts/extract.mjs +35 -18
- package/template/.pi/skills/llm-wiki/scripts/extract.test.mjs +5 -8
- package/template/.pi/skills/llm-wiki/scripts/feedback.mjs +51 -0
- package/template/.pi/skills/llm-wiki/scripts/inventory.mjs +43 -171
- package/template/.pi/skills/llm-wiki/scripts/inventory.test.mjs +25 -18
- package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.mjs +69 -92
- package/template/.pi/skills/llm-wiki/scripts/lint-wikilinks.test.mjs +25 -37
- package/template/.pi/skills/llm-wiki/scripts/migrate.mjs +51 -0
- package/template/.pi/skills/llm-wiki/scripts/query.mjs +149 -0
- package/template/.pi/skills/llm-wiki/scripts/regressions.test.mjs +101 -0
- package/template/.pi/skills/llm-wiki/scripts/sources.mjs +166 -0
- package/template/.pi/skills/llm-wiki/scripts/transaction.mjs +384 -0
- package/template/.pi/skills/llm-wiki/scripts/v2.test.mjs +354 -0
- package/template/.pi/skills/prototype/LOGIC.md +1 -1
- package/template/.pi/skills/prototype/SKILL.md +5 -19
- package/template/.pi/skills/setup-matt-pocock-skills/SKILL.md +3 -3
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +2 -3
- package/template/.pi/skills/yss-implementation-contract-compiler/references/yss-skill-execution-result.md +14 -0
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +8 -8
- package/template/.pi/skills/yss-product-lifecycle/references/external-input-questionnaire.md +19 -0
- package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +5 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +20 -4
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.pi/skills/yss-product-lifecycle/references/plan-requirements.md +10 -0
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.pi/skills/yss-research/SKILL.md +4 -0
- package/template/.template-spec/agents/README.md +1 -1
- package/template/.template-spec/agents/digital-human-roles.yaml +1 -1
- package/template/.template-spec/agents/skill-migrations.md +15 -0
- package/template/.template-spec/agents/yss-skill-registry.yaml +10 -29
- package/template/.template-spec/architecture/README.md +3 -34
- package/template/.template-spec/plan/templates/competitive-analysis-template.md +2 -2
- package/template/.template-spec/process/contract-reading.md +24 -0
- package/template/.template-spec/process/lifecycle-registry-baseline.json +3 -1
- package/template/.template-spec/process/lifecycle-registry.yaml +6 -0
- package/template/.template-spec/process/research-completion.md +23 -0
- package/template/.template-spec/process/schemas/digital-human-task-package.schema.json +202 -12
- package/template/.template-spec/process/schemas/frontend-implementation-evidence.schema.json +7 -15
- package/template/.template-spec/process/subagent-collaboration.md +8 -0
- package/template/.template-spec/process/templates/frontend-implementation-verification-template.yaml +15 -1
- package/template/AGENTS.md +1 -1
- package/template/CONTEXT.md +5 -1
- package/template/README.md +12 -24
- package/template/scripts/contract +5 -5
- package/template/scripts/lib/contract-views.mjs +57 -2
- package/template/scripts/lib/execution-evidence.mjs +51 -0
- package/template/scripts/lib/harness-execution-scope.mjs +1 -1
- package/template/scripts/lib/implementation-contract-compiler.mjs +2 -0
- package/template/scripts/lib/lifecycle-context-query.mjs +15 -3
- package/template/scripts/lib/lifecycle-status.mjs +32 -6
- package/template/scripts/lib/lifecycle-transition.mjs +19 -1
- package/template/scripts/lib/maintenance-research.mjs +63 -0
- package/template/scripts/lib/read-only-intake.mjs +132 -0
- package/template/scripts/lib/skill-registry.mjs +2 -1
- package/template/scripts/lib/skill-supply-chain.mjs +4 -0
- package/template/scripts/lib/slice-task-package.mjs +1 -1
- package/template/scripts/lib/task-package.mjs +9 -2
- package/template/scripts/lifecycle-status +2 -2
- package/template/scripts/prepare-read-only-intake +16 -0
- package/template/scripts/run-read-only-intake +14 -0
- package/template/scripts/verify-digital-human-task-package +2 -2
- package/template/scripts/verify-frontend-implementation-evidence +24 -1
- package/template/scripts/verify-maintenance-research +13 -0
- package/template/skills-lock.json +19 -76
- package/template.manifest.json +118 -29
- package/template.snapshot.json +5 -6
- package/template/.agents/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.agents/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.agents/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.agents/skills/prototype/UI.md +0 -112
- package/template/.agents/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.agents/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.agents/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.agents/skills/wait-what/SKILL.md +0 -7
- package/template/.agents/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.codex/skills/data-analytics/.app.json +0 -84
- package/template/.codex/skills/data-analytics/.codex-plugin/plugin.json +0 -66
- package/template/.codex/skills/data-analytics/.mcp.json +0 -30
- package/template/.codex/skills/data-analytics/AGENTS.md +0 -20
- package/template/.codex/skills/data-analytics/DEPENDENCIES.MD +0 -27
- package/template/.codex/skills/data-analytics/README.md +0 -60
- package/template/.codex/skills/data-analytics/__yss_dotfile__.gitignore +0 -2
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part005 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-artifact-widget.html.gz.b64.part006 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part005 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part006 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-chart-widget.html.gz.b64.part007 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-small.svg +0 -5
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html +0 -16
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part001 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part002 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part003 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience-table-widget.html.gz.b64.part004 +0 -1
- package/template/.codex/skills/data-analytics/assets/datascience.png +0 -0
- package/template/.codex/skills/data-analytics/assets/datascience.svg +0 -10
- package/template/.codex/skills/data-analytics/mcp/server.cjs +0 -2964
- package/template/.codex/skills/data-analytics/package-lock.json +0 -3048
- package/template/.codex/skills/data-analytics/package.json +0 -43
- package/template/.codex/skills/data-analytics/scripts/normalize-widget-assets.mjs +0 -75
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/SKILL.md +0 -137
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/analyze-data-quality/references/quality-checks.md +0 -29
- package/template/.codex/skills/data-analytics/skills/build-dashboard/SKILL.md +0 -148
- package/template/.codex/skills/data-analytics/skills/build-dashboard/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/bi-platform-dashboard.md +0 -18
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/html-dashboard.md +0 -24
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/mcp-artifact-dashboard.md +0 -71
- package/template/.codex/skills/data-analytics/skills/build-dashboard/specifications/streamlit-dashboard.md +0 -85
- package/template/.codex/skills/data-analytics/skills/build-report/SKILL.md +0 -207
- package/template/.codex/skills/data-analytics/skills/build-report/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/assets/executive-report-shell.html +0 -70
- package/template/.codex/skills/data-analytics/skills/build-report/assets/technical-report-shell.html +0 -66
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/SKILL.md +0 -108
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/__init__.py +0 -1
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/cli.py +0 -52
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/constants.py +0 -61
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/docx_writer.py +0 -362
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/html_parser.py +0 -829
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/model.py +0 -30
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/plan.py +0 -127
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/quality.py +0 -374
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/rendering.py +0 -613
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/table_utils.py +0 -54
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc/utils.py +0 -16
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/scripts/report_to_google_doc_plan.py +0 -9
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-doc/tests/test_delivery_plan.py +0 -45
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/SKILL.md +0 -77
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-google-slides/scripts/report_to_google_slides.py +0 -2379
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/SKILL.md +0 -88
- package/template/.codex/skills/data-analytics/skills/build-report/report-to-pdf/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/executive-report.md +0 -97
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/mcp-app-report.md +0 -59
- package/template/.codex/skills/data-analytics/skills/build-report/specifications/technical-report.md +0 -75
- package/template/.codex/skills/data-analytics/skills/design-kpis/SKILL.md +0 -103
- package/template/.codex/skills/data-analytics/skills/design-kpis/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/gather-business-context/SKILL.md +0 -68
- package/template/.codex/skills/data-analytics/skills/gather-business-context/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/index/SKILL.md +0 -251
- package/template/.codex/skills/data-analytics/skills/index/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/SKILL.md +0 -131
- package/template/.codex/skills/data-analytics/skills/jupyter-notebooks/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/SKILL.md +0 -141
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/kpi-reporting/references/report-templates.md +0 -32
- package/template/.codex/skills/data-analytics/skills/market-sizing/SKILL.md +0 -106
- package/template/.codex/skills/data-analytics/skills/market-sizing/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/metric-diagnostics/SKILL.md +0 -130
- package/template/.codex/skills/data-analytics/skills/metric-diagnostics/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/product-business-analysis/SKILL.md +0 -141
- package/template/.codex/skills/data-analytics/skills/product-business-analysis/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/spreadsheets/SKILL.md +0 -178
- package/template/.codex/skills/data-analytics/skills/spreadsheets/agents/openai.yaml +0 -9
- package/template/.codex/skills/data-analytics/skills/spreadsheets/assets/file-spreadsheet.png +0 -0
- package/template/.codex/skills/data-analytics/skills/spreadsheets/charts.md +0 -31
- package/template/.codex/skills/data-analytics/skills/spreadsheets/references/artifact_tool_api.md +0 -466
- package/template/.codex/skills/data-analytics/skills/spreadsheets/style_guidelines.md +0 -99
- package/template/.codex/skills/data-analytics/skills/user-context/SKILL.md +0 -197
- package/template/.codex/skills/data-analytics/skills/user-context/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/automation-config.md +0 -26
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/source-category-config.json +0 -51
- package/template/.codex/skills/data-analytics/skills/user-context/plugin-author-config/user-context-config.md +0 -66
- package/template/.codex/skills/data-analytics/skills/user-context/references/automation.md +0 -69
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-examples.md +0 -204
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding-state-template.json +0 -87
- package/template/.codex/skills/data-analytics/skills/user-context/references/onboarding.md +0 -497
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/connector-playbook.md +0 -74
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/setup.md +0 -65
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/skill-template.md +0 -160
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/source-intake.md +0 -75
- package/template/.codex/skills/data-analytics/skills/user-context/references/semantic-layer/weekly-polling-automation.md +0 -96
- package/template/.codex/skills/data-analytics/skills/user-context/references/source-category-runtime.md +0 -263
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/data_analytics_preflight.py +0 -1462
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/init_user_context_state.py +0 -128
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/reset_user_context_state.py +0 -101
- package/template/.codex/skills/data-analytics/skills/user-context/scripts/validate_user_context_preflight.py +0 -499
- package/template/.codex/skills/data-analytics/skills/user-context/tests/test_state_helpers.py +0 -978
- package/template/.codex/skills/data-analytics/skills/validate-data/SKILL.md +0 -126
- package/template/.codex/skills/data-analytics/skills/validate-data/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/validate-data/references/validation-methods.md +0 -70
- package/template/.codex/skills/data-analytics/skills/visualize-data/SKILL.md +0 -157
- package/template/.codex/skills/data-analytics/skills/visualize-data/agents/openai.yaml +0 -6
- package/template/.codex/skills/data-analytics/skills/visualize-data/references/seaborn-templates.md +0 -774
- package/template/.codex/skills/data-analytics/src/DESIGN.md +0 -222
- package/template/.codex/skills/data-analytics/src/analytics-app/App.tsx +0 -3666
- package/template/.codex/skills/data-analytics/src/analytics-app/analytics-layout.test.mjs +0 -136
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartFrame.tsx +0 -54
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartLegend.tsx +0 -96
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartRenderer.tsx +0 -1647
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/ChartTooltip.tsx +0 -245
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-app-helpers.tsx +0 -462
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-capabilities.ts +0 -107
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-compatibility.ts +0 -164
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-contract.ts +0 -192
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-theme.ts +0 -203
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-tokens.css +0 -619
- package/template/.codex/skills/data-analytics/src/analytics-app/charting/chart-transforms.ts +0 -402
- package/template/.codex/skills/data-analytics/src/analytics-app/fonts/SystemSansVariableVF.woff2 +0 -0
- package/template/.codex/skills/data-analytics/src/analytics-app/imageExport.ts +0 -370
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/AnalyticsLayoutCanvas.tsx +0 -536
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/RichMarkdown.tsx +0 -681
- package/template/.codex/skills/data-analytics/src/analytics-app/layout/analyticsLayoutCore.ts +0 -164
- package/template/.codex/skills/data-analytics/src/analytics-app/main.tsx +0 -21
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/chart_contract.py +0 -472
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/check_analytics_app_runtime_links.py +0 -75
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/design_contract.py +0 -142
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/package_utils.py +0 -142
- package/template/.codex/skills/data-analytics/src/analytics-app/scripts/tests/test_package_utils.py +0 -377
- package/template/.codex/skills/data-analytics/src/analytics-app/styles.css +0 -3468
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.d.ts +0 -44
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/DataTable.jsx +0 -639
- package/template/.codex/skills/data-analytics/src/analytics-app/tables/data-table.css +0 -327
- package/template/.codex/skills/data-analytics/src/analytics-app/tokens.css +0 -225
- package/template/.codex/skills/data-analytics/src/analytics-app/types.ts +0 -204
- package/template/.codex/skills/data-analytics/src/analytics-app-core.md +0 -85
- package/template/.codex/skills/data-analytics/src/codex-style-contract.md +0 -30
- package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.html +0 -12
- package/template/.codex/skills/data-analytics/src/datascience-artifact-widget.jsx +0 -1008
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.css +0 -2117
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.html +0 -122
- package/template/.codex/skills/data-analytics/src/datascience-chart-widget.js +0 -3588
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.css +0 -483
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.html +0 -32
- package/template/.codex/skills/data-analytics/src/datascience-table-widget.js +0 -333
- package/template/.codex/skills/data-analytics/src/mcp-host.js +0 -153
- package/template/.codex/skills/data-analytics/src/recharts-config.js +0 -315
- package/template/.codex/skills/data-analytics/src/recharts-renderer.jsx +0 -294
- package/template/.codex/skills/data-analytics/src/sql-source-view.css +0 -33
- package/template/.codex/skills/data-analytics/src/sql-source-view.js +0 -157
- package/template/.codex/skills/data-analytics/src/styles/codex-theme.css +0 -121
- package/template/.codex/skills/data-analytics/src/table-renderer.jsx +0 -28
- package/template/.codex/skills/data-analytics/tests/chart-transforms.test.mjs +0 -87
- package/template/.codex/skills/data-analytics/tests/funnel-smoke.html +0 -105
- package/template/.codex/skills/data-analytics/tests/inline-widget-compare.html +0 -233
- package/template/.codex/skills/data-analytics/tests/mcp-server.test.mjs +0 -1500
- package/template/.codex/skills/data-analytics/tests/native-style-contract.test.mjs +0 -219
- package/template/.codex/skills/data-analytics/tests/recharts-config.test.mjs +0 -144
- package/template/.codex/skills/data-analytics/tests/recharts-renderer.test.mjs +0 -11
- package/template/.codex/skills/data-analytics/tests/rich-markdown.test.mjs +0 -54
- package/template/.codex/skills/data-analytics/tests/widget-render-harness.html +0 -321
- package/template/.codex/skills/data-analytics/tsconfig.json +0 -19
- package/template/.codex/skills/data-analytics/vite.config.ts +0 -46
- package/template/.codex/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.codex/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.codex/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.codex/skills/prototype/UI.md +0 -112
- package/template/.codex/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.codex/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.codex/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.codex/skills/wait-what/SKILL.md +0 -7
- package/template/.codex/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.cursor/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.cursor/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.cursor/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.cursor/skills/prototype/UI.md +0 -112
- package/template/.cursor/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.cursor/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.cursor/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.cursor/skills/wait-what/SKILL.md +0 -7
- package/template/.cursor/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.pi/skills/grill-with-docs/SKILL.md +0 -20
- package/template/.pi/skills/grill-with-docs/agents/openai.yaml +0 -5
- package/template/.pi/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
- package/template/.pi/skills/prototype/UI.md +0 -112
- package/template/.pi/skills/setup-matt-pocock-skills/domain.md +0 -37
- package/template/.pi/skills/to-questionnaire/SKILL.md +0 -55
- package/template/.pi/skills/to-questionnaire/agents/openai.yaml +0 -5
- package/template/.pi/skills/wait-what/SKILL.md +0 -7
- package/template/.pi/skills/wait-what/agents/openai.yaml +0 -5
- package/template/.template-spec/agents/domain.md +0 -31
- /package/template/.agents/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.codex/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.cursor/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
- /package/template/.pi/skills/{improve-codebase-architecture → codebase-design/references}/HTML-REPORT.md +0 -0
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import { useRef, useState } from "react";
|
|
2
|
-
|
|
3
|
-
type PreparedImageExportStatus = "idle" | "pending" | "ready" | "error";
|
|
4
|
-
|
|
5
|
-
type PreparedImageExport = {
|
|
6
|
-
blob?: Blob;
|
|
7
|
-
element: HTMLElement;
|
|
8
|
-
error?: Error;
|
|
9
|
-
promise: Promise<Blob>;
|
|
10
|
-
startedAt: number;
|
|
11
|
-
status: Exclude<PreparedImageExportStatus, "idle">;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type ImageClipboardWriteResult = "native" | "html-fallback";
|
|
15
|
-
|
|
16
|
-
const IMAGE_EXPORT_PREPARE_TTL_MS = 30_000;
|
|
17
|
-
|
|
18
|
-
function shouldIncludeNodeInImageExport(node: unknown): boolean {
|
|
19
|
-
const closest = (node as { closest?: unknown } | null)?.closest;
|
|
20
|
-
if (typeof closest !== "function") return true;
|
|
21
|
-
return closest.call(node, "[data-image-export-exclude='true']") === null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function isVisibleColor(value: string): boolean {
|
|
25
|
-
const color = value.trim().toLowerCase();
|
|
26
|
-
if (!color || color === "transparent") return false;
|
|
27
|
-
if (color.startsWith("rgba(") && /,\s*0(?:\.0+)?\s*\)$/.test(color)) return false;
|
|
28
|
-
return color !== "rgba(0, 0, 0, 0)";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function resolvedImageExportBackground(element: HTMLElement): string {
|
|
32
|
-
let current: HTMLElement | null = element;
|
|
33
|
-
while (current) {
|
|
34
|
-
const backgroundColor = getComputedStyle(current).backgroundColor;
|
|
35
|
-
if (isVisibleColor(backgroundColor)) return backgroundColor;
|
|
36
|
-
current = current.parentElement;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const bodyBackground = getComputedStyle(document.body).backgroundColor;
|
|
40
|
-
return isVisibleColor(bodyBackground) ? bodyBackground : "#ffffff";
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function scrubImageExportClone(clone: HTMLElement) {
|
|
44
|
-
clone
|
|
45
|
-
.querySelectorAll<HTMLElement>(
|
|
46
|
-
[
|
|
47
|
-
"[data-image-export-exclude='true']",
|
|
48
|
-
".analytics-layout-drop-indicator",
|
|
49
|
-
".analytics-layout-grab-handle",
|
|
50
|
-
".copy-toast",
|
|
51
|
-
".menu-surface",
|
|
52
|
-
".viz-card-menu",
|
|
53
|
-
".viz-card-menu-button",
|
|
54
|
-
".viz-card-submenu-list"
|
|
55
|
-
].join(", ")
|
|
56
|
-
)
|
|
57
|
-
.forEach((node) => node.remove());
|
|
58
|
-
|
|
59
|
-
clone
|
|
60
|
-
.querySelectorAll<HTMLElement>("[aria-expanded='true']")
|
|
61
|
-
.forEach((node) => node.setAttribute("aria-expanded", "false"));
|
|
62
|
-
|
|
63
|
-
clone.classList.remove(
|
|
64
|
-
"intent-zone-after",
|
|
65
|
-
"intent-zone-before",
|
|
66
|
-
"intent-zone-end",
|
|
67
|
-
"intent-zone-pair-after",
|
|
68
|
-
"intent-zone-pair-before",
|
|
69
|
-
"is-dragging",
|
|
70
|
-
"is-drop-target"
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function createImageExportTarget(element: HTMLElement) {
|
|
75
|
-
const rect = element.getBoundingClientRect();
|
|
76
|
-
const width = Math.max(1, Math.ceil(rect.width || element.offsetWidth || element.scrollWidth));
|
|
77
|
-
const backgroundColor = resolvedImageExportBackground(element);
|
|
78
|
-
const sandbox = document.createElement("div");
|
|
79
|
-
sandbox.setAttribute("data-image-export-sandbox", "true");
|
|
80
|
-
sandbox.style.position = "fixed";
|
|
81
|
-
sandbox.style.top = "0";
|
|
82
|
-
sandbox.style.left = "-100000px";
|
|
83
|
-
sandbox.style.width = `${width}px`;
|
|
84
|
-
sandbox.style.pointerEvents = "none";
|
|
85
|
-
sandbox.style.backgroundColor = backgroundColor;
|
|
86
|
-
sandbox.style.colorScheme = getComputedStyle(document.documentElement).colorScheme;
|
|
87
|
-
|
|
88
|
-
const clone = element.cloneNode(true) as HTMLElement;
|
|
89
|
-
clone.setAttribute("data-image-export-root", "true");
|
|
90
|
-
clone.style.width = `${width}px`;
|
|
91
|
-
clone.style.maxWidth = `${width}px`;
|
|
92
|
-
clone.style.margin = "0";
|
|
93
|
-
clone.style.transform = "none";
|
|
94
|
-
clone.style.pointerEvents = "none";
|
|
95
|
-
scrubImageExportClone(clone);
|
|
96
|
-
|
|
97
|
-
sandbox.appendChild(clone);
|
|
98
|
-
document.body.appendChild(sandbox);
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
backgroundColor,
|
|
102
|
-
cleanup: () => sandbox.remove(),
|
|
103
|
-
node: clone,
|
|
104
|
-
width
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function nextAnimationFrame(): Promise<void> {
|
|
109
|
-
return new Promise((resolve) => {
|
|
110
|
-
window.requestAnimationFrame(() => resolve());
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function normalizePngBlob(blob: Blob): Blob {
|
|
115
|
-
if (blob.type === "image/png") return blob;
|
|
116
|
-
return new Blob([blob], { type: "image/png" });
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async function renderElementAsImageBlob(element: HTMLElement): Promise<Blob> {
|
|
120
|
-
const exportTarget = createImageExportTarget(element);
|
|
121
|
-
try {
|
|
122
|
-
await document.fonts?.ready;
|
|
123
|
-
await nextAnimationFrame();
|
|
124
|
-
const { getFontEmbedCSS, toBlob } = await import("html-to-image");
|
|
125
|
-
const fontEmbedCSS = await getFontEmbedCSS(document.documentElement, {
|
|
126
|
-
cacheBust: true,
|
|
127
|
-
preferredFontFormat: "woff2"
|
|
128
|
-
}).catch(() => "");
|
|
129
|
-
const height = Math.max(
|
|
130
|
-
1,
|
|
131
|
-
Math.ceil(exportTarget.node.getBoundingClientRect().height || exportTarget.node.scrollHeight)
|
|
132
|
-
);
|
|
133
|
-
const blob = await toBlob(exportTarget.node, {
|
|
134
|
-
backgroundColor: exportTarget.backgroundColor,
|
|
135
|
-
cacheBust: true,
|
|
136
|
-
filter: shouldIncludeNodeInImageExport,
|
|
137
|
-
fontEmbedCSS: fontEmbedCSS || undefined,
|
|
138
|
-
height,
|
|
139
|
-
pixelRatio: Math.min(2, window.devicePixelRatio || 1),
|
|
140
|
-
preferredFontFormat: "woff2",
|
|
141
|
-
width: exportTarget.width
|
|
142
|
-
});
|
|
143
|
-
if (!blob) throw new Error("Failed to create image.");
|
|
144
|
-
return normalizePngBlob(blob);
|
|
145
|
-
} finally {
|
|
146
|
-
exportTarget.cleanup();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function blobToDataUrl(blob: Blob): Promise<string> {
|
|
151
|
-
return new Promise((resolve, reject) => {
|
|
152
|
-
const reader = new FileReader();
|
|
153
|
-
reader.addEventListener("load", () => resolve(String(reader.result)));
|
|
154
|
-
reader.addEventListener("error", () => reject(reader.error ?? new Error("Failed to encode image.")));
|
|
155
|
-
reader.readAsDataURL(blob);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function copyRichImageToClipboard(dataUrl: string): boolean {
|
|
160
|
-
const container = document.createElement("div");
|
|
161
|
-
container.contentEditable = "true";
|
|
162
|
-
container.style.position = "fixed";
|
|
163
|
-
container.style.left = "-10000px";
|
|
164
|
-
container.style.top = "0";
|
|
165
|
-
container.innerHTML = `<img src="${dataUrl}" alt="Analytics app card" style="display:block;border:0;outline:0;box-shadow:none;max-width:100%;" />`;
|
|
166
|
-
document.body.appendChild(container);
|
|
167
|
-
|
|
168
|
-
const range = document.createRange();
|
|
169
|
-
range.selectNodeContents(container);
|
|
170
|
-
const selection = window.getSelection();
|
|
171
|
-
selection?.removeAllRanges();
|
|
172
|
-
selection?.addRange(range);
|
|
173
|
-
const copied = document.execCommand("copy");
|
|
174
|
-
selection?.removeAllRanges();
|
|
175
|
-
document.body.removeChild(container);
|
|
176
|
-
return copied;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function imageClipboardFallbackBlockedMessage(): string {
|
|
180
|
-
return "Native image copy is blocked in this MCP app surface, and the browser fallback cannot reliably paste into apps like Slack or Codex.";
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
function canUseRichImageClipboardFallback(): boolean {
|
|
185
|
-
return typeof window === "undefined" || !window.openai;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function shouldOfferImageClipboardCopy(): boolean {
|
|
189
|
-
// The MCP host bridge blocks image clipboard writes, so the HTML fallback is
|
|
190
|
-
// intentionally limited to standalone browser previews.
|
|
191
|
-
return canUseRichImageClipboardFallback();
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function copyImageWithFallback(dataUrl: string): ImageClipboardWriteResult {
|
|
195
|
-
if (!canUseRichImageClipboardFallback()) {
|
|
196
|
-
throw new Error(imageClipboardFallbackBlockedMessage());
|
|
197
|
-
}
|
|
198
|
-
if (copyRichImageToClipboard(dataUrl)) {
|
|
199
|
-
return "html-fallback";
|
|
200
|
-
}
|
|
201
|
-
throw new Error("Copy is blocked by this browser.");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async function writeNativeImageToClipboard(blob: Blob): Promise<void> {
|
|
205
|
-
if (typeof ClipboardItem === "undefined" || !navigator.clipboard?.write) {
|
|
206
|
-
throw new Error("Clipboard image write is unavailable.");
|
|
207
|
-
}
|
|
208
|
-
await navigator.clipboard.write([new ClipboardItem({ "image/png": normalizePngBlob(blob) })]);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
async function writeNativeImagePromiseToClipboard(blobPromise: Promise<Blob>): Promise<void> {
|
|
212
|
-
if (typeof ClipboardItem === "undefined" || !navigator.clipboard?.write) {
|
|
213
|
-
throw new Error("Clipboard image write is unavailable.");
|
|
214
|
-
}
|
|
215
|
-
await navigator.clipboard.write([
|
|
216
|
-
new ClipboardItem({
|
|
217
|
-
"image/png": blobPromise.then(normalizePngBlob)
|
|
218
|
-
})
|
|
219
|
-
]);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
async function copyImageBlob(blob: Blob, dataUrl: string): Promise<ImageClipboardWriteResult> {
|
|
223
|
-
try {
|
|
224
|
-
await writeNativeImageToClipboard(blob);
|
|
225
|
-
return "native";
|
|
226
|
-
} catch {
|
|
227
|
-
return copyImageWithFallback(dataUrl);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
async function copyPreparedImageBlob(blob: Blob): Promise<ImageClipboardWriteResult> {
|
|
232
|
-
try {
|
|
233
|
-
await writeNativeImageToClipboard(blob);
|
|
234
|
-
return "native";
|
|
235
|
-
} catch {
|
|
236
|
-
const dataUrl = await blobToDataUrl(blob);
|
|
237
|
-
return copyImageWithFallback(dataUrl);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export function usePreparedImageExport(elementRef: { current: HTMLElement | null }) {
|
|
242
|
-
const preparedRef = useRef<PreparedImageExport | null>(null);
|
|
243
|
-
const [preparedImageExportStatus, setPreparedImageExportStatus] = useState<PreparedImageExportStatus>("idle");
|
|
244
|
-
|
|
245
|
-
function resetPreparedImageExport() {
|
|
246
|
-
preparedRef.current = null;
|
|
247
|
-
setPreparedImageExportStatus("idle");
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function prepareImageExport(options: { force?: boolean } = {}): PreparedImageExport | null {
|
|
251
|
-
const element = elementRef.current;
|
|
252
|
-
if (!element) return null;
|
|
253
|
-
|
|
254
|
-
const current = preparedRef.current;
|
|
255
|
-
const now = Date.now();
|
|
256
|
-
const currentIsFresh =
|
|
257
|
-
current &&
|
|
258
|
-
current.element === element &&
|
|
259
|
-
current.status !== "error" &&
|
|
260
|
-
now - current.startedAt < IMAGE_EXPORT_PREPARE_TTL_MS;
|
|
261
|
-
if (current && currentIsFresh && (current.status === "pending" || !options.force)) {
|
|
262
|
-
setPreparedImageExportStatus(current.status);
|
|
263
|
-
return current;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const prepared: PreparedImageExport = {
|
|
267
|
-
element,
|
|
268
|
-
promise: Promise.resolve().then(() => renderElementAsImageBlob(element)),
|
|
269
|
-
startedAt: now,
|
|
270
|
-
status: "pending"
|
|
271
|
-
};
|
|
272
|
-
prepared.promise = prepared.promise
|
|
273
|
-
.then((blob) => {
|
|
274
|
-
prepared.blob = blob;
|
|
275
|
-
prepared.status = "ready";
|
|
276
|
-
if (preparedRef.current === prepared) setPreparedImageExportStatus("ready");
|
|
277
|
-
return blob;
|
|
278
|
-
})
|
|
279
|
-
.catch((error) => {
|
|
280
|
-
prepared.error = error instanceof Error ? error : new Error("Failed to prepare image.");
|
|
281
|
-
prepared.status = "error";
|
|
282
|
-
if (preparedRef.current === prepared) {
|
|
283
|
-
preparedRef.current = null;
|
|
284
|
-
setPreparedImageExportStatus("error");
|
|
285
|
-
}
|
|
286
|
-
throw prepared.error;
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
preparedRef.current = prepared;
|
|
290
|
-
setPreparedImageExportStatus("pending");
|
|
291
|
-
return prepared;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
function getPreparedImageBlob(): Blob | null {
|
|
295
|
-
const prepared = preparedRef.current;
|
|
296
|
-
if (
|
|
297
|
-
!prepared ||
|
|
298
|
-
prepared.element !== elementRef.current ||
|
|
299
|
-
prepared.status !== "ready" ||
|
|
300
|
-
!prepared.blob ||
|
|
301
|
-
Date.now() - prepared.startedAt >= IMAGE_EXPORT_PREPARE_TTL_MS
|
|
302
|
-
) {
|
|
303
|
-
return null;
|
|
304
|
-
}
|
|
305
|
-
return prepared.blob;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return {
|
|
309
|
-
getPreparedImageBlob,
|
|
310
|
-
preparedImageExportStatus,
|
|
311
|
-
prepareImageExport,
|
|
312
|
-
resetPreparedImageExport
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export async function copyElementAsImage(
|
|
317
|
-
element: HTMLElement,
|
|
318
|
-
preparedBlob?: Blob | null
|
|
319
|
-
): Promise<ImageClipboardWriteResult> {
|
|
320
|
-
if (preparedBlob) return copyPreparedImageBlob(preparedBlob);
|
|
321
|
-
const blobPromise = renderElementAsImageBlob(element);
|
|
322
|
-
try {
|
|
323
|
-
await writeNativeImagePromiseToClipboard(blobPromise);
|
|
324
|
-
return "native";
|
|
325
|
-
} catch {
|
|
326
|
-
const blob = await blobPromise;
|
|
327
|
-
const dataUrl = await blobToDataUrl(blob);
|
|
328
|
-
return copyImageBlob(blob, dataUrl);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export function imageCopySuccessMessage(nativeMessage: string, result: ImageClipboardWriteResult): string {
|
|
333
|
-
if (result === "native") return nativeMessage;
|
|
334
|
-
return `${nativeMessage} Native image copy was blocked, so this browser fallback may not paste into apps like Slack or Codex.`;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function copyTextWithSelection(text: string): boolean {
|
|
338
|
-
const textarea = document.createElement("textarea");
|
|
339
|
-
textarea.value = text;
|
|
340
|
-
textarea.setAttribute("readonly", "true");
|
|
341
|
-
textarea.style.position = "fixed";
|
|
342
|
-
textarea.style.left = "-10000px";
|
|
343
|
-
textarea.style.top = "0";
|
|
344
|
-
textarea.style.opacity = "0";
|
|
345
|
-
document.body.appendChild(textarea);
|
|
346
|
-
textarea.focus({ preventScroll: true });
|
|
347
|
-
textarea.select();
|
|
348
|
-
textarea.setSelectionRange(0, text.length);
|
|
349
|
-
let copied = false;
|
|
350
|
-
try {
|
|
351
|
-
copied = document.execCommand("copy");
|
|
352
|
-
} catch {
|
|
353
|
-
copied = false;
|
|
354
|
-
}
|
|
355
|
-
document.body.removeChild(textarea);
|
|
356
|
-
return copied;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export async function copyTextToClipboard(text: string): Promise<void> {
|
|
360
|
-
try {
|
|
361
|
-
if (navigator.clipboard?.writeText) {
|
|
362
|
-
await navigator.clipboard.writeText(text);
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
} catch {
|
|
366
|
-
// Fall through to the selection-based fallback.
|
|
367
|
-
}
|
|
368
|
-
if (copyTextWithSelection(text)) return;
|
|
369
|
-
throw new Error("Copy is blocked by this browser.");
|
|
370
|
-
}
|