@takuma-hirai/hirai-method 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/.stale-harness-state/last-check +0 -0
- package/.claude/CommonRules.md +121 -0
- package/.claude/agents/01-core-development/api-designer.md +237 -0
- package/.claude/agents/01-core-development/backend-developer.md +222 -0
- package/.claude/agents/01-core-development/design-bridge.md +127 -0
- package/.claude/agents/01-core-development/electron-pro.md +240 -0
- package/.claude/agents/01-core-development/frontend-developer.md +133 -0
- package/.claude/agents/01-core-development/fullstack-developer.md +235 -0
- package/.claude/agents/01-core-development/graphql-architect.md +238 -0
- package/.claude/agents/01-core-development/microservices-architect.md +239 -0
- package/.claude/agents/01-core-development/mobile-developer.md +283 -0
- package/.claude/agents/01-core-development/ui-designer.md +174 -0
- package/.claude/agents/01-core-development/websocket-engineer.md +150 -0
- package/.claude/agents/03-infrastructure/azure-infra-engineer.md +53 -0
- package/.claude/agents/03-infrastructure/cloud-architect.md +277 -0
- package/.claude/agents/03-infrastructure/database-administrator.md +287 -0
- package/.claude/agents/03-infrastructure/deployment-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/devops-incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/docker-expert.md +278 -0
- package/.claude/agents/03-infrastructure/incident-responder.md +287 -0
- package/.claude/agents/03-infrastructure/kubernetes-specialist.md +287 -0
- package/.claude/agents/03-infrastructure/network-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/platform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/security-engineer.md +277 -0
- package/.claude/agents/03-infrastructure/sre-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terraform-engineer.md +287 -0
- package/.claude/agents/03-infrastructure/terragrunt-expert.md +307 -0
- package/.claude/agents/03-infrastructure/windows-infra-admin.md +52 -0
- package/.claude/agents/04-quality-security/accessibility-tester.md +277 -0
- package/.claude/agents/04-quality-security/ad-security-reviewer.md +56 -0
- package/.claude/agents/04-quality-security/ai-writing-auditor.md +77 -0
- package/.claude/agents/04-quality-security/architect-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/chaos-engineer.md +277 -0
- package/.claude/agents/04-quality-security/code-reviewer.md +287 -0
- package/.claude/agents/04-quality-security/compliance-auditor.md +277 -0
- package/.claude/agents/04-quality-security/debugger.md +287 -0
- package/.claude/agents/04-quality-security/error-detective.md +287 -0
- package/.claude/agents/04-quality-security/penetration-tester.md +287 -0
- package/.claude/agents/04-quality-security/performance-engineer.md +287 -0
- package/.claude/agents/04-quality-security/powershell-security-hardening.md +54 -0
- package/.claude/agents/04-quality-security/qa-expert.md +287 -0
- package/.claude/agents/04-quality-security/security-auditor.md +287 -0
- package/.claude/agents/04-quality-security/test-automator.md +287 -0
- package/.claude/agents/04-quality-security/ui-ux-tester.md +234 -0
- package/.claude/agents/06-developer-experience/build-engineer.md +286 -0
- package/.claude/agents/06-developer-experience/cli-developer.md +286 -0
- package/.claude/agents/06-developer-experience/dependency-manager.md +286 -0
- package/.claude/agents/06-developer-experience/documentation-engineer.md +276 -0
- package/.claude/agents/06-developer-experience/dx-optimizer.md +286 -0
- package/.claude/agents/06-developer-experience/git-workflow-manager.md +286 -0
- package/.claude/agents/06-developer-experience/legacy-modernizer.md +286 -0
- package/.claude/agents/06-developer-experience/mcp-developer.md +275 -0
- package/.claude/agents/06-developer-experience/powershell-module-architect.md +58 -0
- package/.claude/agents/06-developer-experience/powershell-ui-architect.md +135 -0
- package/.claude/agents/06-developer-experience/readme-generator.md +238 -0
- package/.claude/agents/06-developer-experience/refactoring-specialist.md +286 -0
- package/.claude/agents/06-developer-experience/slack-expert.md +232 -0
- package/.claude/agents/06-developer-experience/tooling-engineer.md +286 -0
- package/.claude/agents/09-meta-orchestration/agent-installer.md +97 -0
- package/.claude/agents/09-meta-orchestration/agent-organizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/codebase-orchestrator.md +249 -0
- package/.claude/agents/09-meta-orchestration/context-manager.md +287 -0
- package/.claude/agents/09-meta-orchestration/error-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/it-ops-orchestrator.md +60 -0
- package/.claude/agents/09-meta-orchestration/knowledge-synthesizer.md +287 -0
- package/.claude/agents/09-meta-orchestration/multi-agent-coordinator.md +287 -0
- package/.claude/agents/09-meta-orchestration/performance-monitor.md +287 -0
- package/.claude/agents/09-meta-orchestration/task-distributor.md +287 -0
- package/.claude/agents/09-meta-orchestration/workflow-orchestrator.md +287 -0
- package/.claude/agents/10-research-analysis/competitive-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/data-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/market-researcher.md +287 -0
- package/.claude/agents/10-research-analysis/project-idea-validator.md +269 -0
- package/.claude/agents/10-research-analysis/research-analyst.md +287 -0
- package/.claude/agents/10-research-analysis/scientific-literature-researcher.md +151 -0
- package/.claude/agents/10-research-analysis/search-specialist.md +287 -0
- package/.claude/agents/10-research-analysis/trend-analyst.md +287 -0
- package/.claude/archive/README.md +47 -0
- package/.claude/archive/agents/02-language-specialists/angular-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/cpp-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/csharp-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/django-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-core-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/dotnet-framework-4.8-expert.md +306 -0
- package/.claude/archive/agents/02-language-specialists/elixir-expert.md +311 -0
- package/.claude/archive/agents/02-language-specialists/expo-react-native-expert.md +268 -0
- package/.claude/archive/agents/02-language-specialists/fastapi-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/flutter-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/golang-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/java-architect.md +287 -0
- package/.claude/archive/agents/02-language-specialists/javascript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/kotlin-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/laravel-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/nextjs-developer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/node-specialist.md +124 -0
- package/.claude/archive/agents/02-language-specialists/php-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/powershell-5.1-expert.md +59 -0
- package/.claude/archive/agents/02-language-specialists/powershell-7-expert.md +57 -0
- package/.claude/archive/agents/02-language-specialists/python-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/rails-expert.md +358 -0
- package/.claude/archive/agents/02-language-specialists/react-specialist.md +287 -0
- package/.claude/archive/agents/02-language-specialists/rust-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/spring-boot-engineer.md +287 -0
- package/.claude/archive/agents/02-language-specialists/sql-pro.md +287 -0
- package/.claude/archive/agents/02-language-specialists/swift-expert.md +287 -0
- package/.claude/archive/agents/02-language-specialists/symfony-specialist.md +354 -0
- package/.claude/archive/agents/02-language-specialists/typescript-pro.md +277 -0
- package/.claude/archive/agents/02-language-specialists/vue-expert.md +287 -0
- package/.claude/archive/agents/05-data-ai/ai-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-analyst.md +277 -0
- package/.claude/archive/agents/05-data-ai/data-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/data-scientist.md +287 -0
- package/.claude/archive/agents/05-data-ai/database-optimizer.md +287 -0
- package/.claude/archive/agents/05-data-ai/llm-architect.md +287 -0
- package/.claude/archive/agents/05-data-ai/machine-learning-engineer.md +277 -0
- package/.claude/archive/agents/05-data-ai/ml-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/mlops-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/nlp-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/postgres-pro.md +287 -0
- package/.claude/archive/agents/05-data-ai/prompt-engineer.md +287 -0
- package/.claude/archive/agents/05-data-ai/reinforcement-learning-engineer.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/api-documenter.md +277 -0
- package/.claude/archive/agents/07-specialized-domains/blockchain-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/embedded-systems.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/fintech-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/game-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/healthcare-admin.md +199 -0
- package/.claude/archive/agents/07-specialized-domains/iot-engineer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/m365-admin.md +48 -0
- package/.claude/archive/agents/07-specialized-domains/mobile-app-developer.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/payment-integration.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/quant-analyst.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/risk-manager.md +287 -0
- package/.claude/archive/agents/07-specialized-domains/seo-specialist.md +184 -0
- package/.claude/archive/agents/08-business-product/business-analyst.md +287 -0
- package/.claude/archive/agents/08-business-product/content-marketer.md +287 -0
- package/.claude/archive/agents/08-business-product/customer-success-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/legal-advisor.md +287 -0
- package/.claude/archive/agents/08-business-product/license-engineer.md +295 -0
- package/.claude/archive/agents/08-business-product/product-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/project-manager.md +287 -0
- package/.claude/archive/agents/08-business-product/sales-engineer.md +287 -0
- package/.claude/archive/agents/08-business-product/scrum-master.md +287 -0
- package/.claude/archive/agents/08-business-product/technical-writer.md +287 -0
- package/.claude/archive/agents/08-business-product/ux-researcher.md +287 -0
- package/.claude/archive/agents/08-business-product/wordpress-master.md +316 -0
- package/.claude/archive/skills/competitive-ads-extractor/SKILL.md +293 -0
- package/.claude/archive/skills/developer-growth-analysis/SKILL.md +322 -0
- package/.claude/archive/skills/document-docx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-docx/SKILL.md +197 -0
- package/.claude/archive/skills/document-docx/docx-js.md +350 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-docx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-docx/ooxml.md +610 -0
- package/.claude/archive/skills/document-docx/scripts/__init__.py +1 -0
- package/.claude/archive/skills/document-docx/scripts/document.py +1276 -0
- package/.claude/archive/skills/document-docx/scripts/templates/comments.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtended.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsExtensible.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/commentsIds.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/templates/people.xml +3 -0
- package/.claude/archive/skills/document-docx/scripts/utilities.py +374 -0
- package/.claude/archive/skills/document-pdf/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pdf/SKILL.md +294 -0
- package/.claude/archive/skills/document-pdf/forms.md +205 -0
- package/.claude/archive/skills/document-pdf/reference.md +612 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes.py +70 -0
- package/.claude/archive/skills/document-pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/.claude/archive/skills/document-pdf/scripts/check_fillable_fields.py +12 -0
- package/.claude/archive/skills/document-pdf/scripts/convert_pdf_to_images.py +35 -0
- package/.claude/archive/skills/document-pdf/scripts/create_validation_image.py +41 -0
- package/.claude/archive/skills/document-pdf/scripts/extract_form_field_info.py +152 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_fillable_fields.py +114 -0
- package/.claude/archive/skills/document-pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/.claude/archive/skills/document-pptx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-pptx/SKILL.md +484 -0
- package/.claude/archive/skills/document-pptx/html2pptx.md +625 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.claude/archive/skills/document-pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/pack.py +159 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/unpack.py +29 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validate.py +69 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/base.py +951 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/docx.py +274 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/.claude/archive/skills/document-pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/.claude/archive/skills/document-pptx/ooxml.md +427 -0
- package/.claude/archive/skills/document-pptx/scripts/html2pptx.js +979 -0
- package/.claude/archive/skills/document-pptx/scripts/inventory.py +1020 -0
- package/.claude/archive/skills/document-pptx/scripts/rearrange.py +231 -0
- package/.claude/archive/skills/document-pptx/scripts/replace.py +385 -0
- package/.claude/archive/skills/document-pptx/scripts/thumbnail.py +450 -0
- package/.claude/archive/skills/document-xlsx/LICENSE.txt +30 -0
- package/.claude/archive/skills/document-xlsx/SKILL.md +289 -0
- package/.claude/archive/skills/document-xlsx/recalc.py +178 -0
- package/.claude/archive/skills/image-enhancer/SKILL.md +99 -0
- package/.claude/archive/skills/meeting-insights-analyzer/SKILL.md +327 -0
- package/.claude/archive/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/.claude/archive/skills/slack-gif-creator/SKILL.md +646 -0
- package/.claude/archive/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/.claude/archive/skills/slack-gif-creator/core/easing.py +230 -0
- package/.claude/archive/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/.claude/archive/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/.claude/archive/skills/slack-gif-creator/core/typography.py +357 -0
- package/.claude/archive/skills/slack-gif-creator/core/validators.py +264 -0
- package/.claude/archive/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/.claude/archive/skills/slack-gif-creator/requirements.txt +4 -0
- package/.claude/archive/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/.claude/archive/skills/slack-gif-creator/templates/explode.py +331 -0
- package/.claude/archive/skills/slack-gif-creator/templates/fade.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/flip.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/.claude/archive/skills/slack-gif-creator/templates/morph.py +329 -0
- package/.claude/archive/skills/slack-gif-creator/templates/move.py +293 -0
- package/.claude/archive/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/.claude/archive/skills/slack-gif-creator/templates/shake.py +127 -0
- package/.claude/archive/skills/slack-gif-creator/templates/slide.py +291 -0
- package/.claude/archive/skills/slack-gif-creator/templates/spin.py +269 -0
- package/.claude/archive/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/.claude/archive/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/.claude/archive/skills/twitter-algorithm-optimizer/SKILL.md +327 -0
- package/.claude/archive/skills/video-downloader/SKILL.md +99 -0
- package/.claude/archive/skills/video-downloader/scripts/download_video.py +145 -0
- package/.claude/bash-whitelist-requests/2026-05-28-grep-find-rg.md +68 -0
- package/.claude/bash-whitelist-requests/2026-06-01-readonly-filters.md +76 -0
- package/.claude/bash-whitelist.txt +124 -0
- package/.claude/commands/agent-introspect.md +89 -0
- package/.claude/commands/apply-rules.md +363 -0
- package/.claude/commands/approve-design.md +219 -0
- package/.claude/commands/approve-org-money.md +267 -0
- package/.claude/commands/build.md +234 -0
- package/.claude/commands/commit.md +97 -0
- package/.claude/commands/context-fetch.md +113 -0
- package/.claude/commands/create-tool.md +496 -0
- package/.claude/commands/design-review.md +138 -0
- package/.claude/commands/design.md +807 -0
- package/.claude/commands/discharge-byproduct.md +208 -0
- package/.claude/commands/doc-review.md +165 -0
- package/.claude/commands/document-pair.md +76 -0
- package/.claude/commands/error-triage.md +435 -0
- package/.claude/commands/eval.md +70 -0
- package/.claude/commands/evolve.md +49 -0
- package/.claude/commands/finish-task.md +105 -0
- package/.claude/commands/gan-build.md +91 -0
- package/.claude/commands/gan-design.md +82 -0
- package/.claude/commands/gate-bypass.md +77 -0
- package/.claude/commands/gate-clear.md +45 -0
- package/.claude/commands/gate-status.md +46 -0
- package/.claude/commands/harness-audit.md +151 -0
- package/.claude/commands/hearing.md +138 -0
- package/.claude/commands/impact-check.md +486 -0
- package/.claude/commands/init-tasks.md +49 -0
- package/.claude/commands/instinct-export.md +47 -0
- package/.claude/commands/instinct-import.md +41 -0
- package/.claude/commands/instinct-status.md +43 -0
- package/.claude/commands/investigate.md +547 -0
- package/.claude/commands/learn.md +55 -0
- package/.claude/commands/lint-rules.md +400 -0
- package/.claude/commands/mode.md +58 -0
- package/.claude/commands/modify-feature.md +209 -0
- package/.claude/commands/module-review.md +149 -0
- package/.claude/commands/move-section.md +67 -0
- package/.claude/commands/new-draft.md +67 -0
- package/.claude/commands/new-feature.md +286 -0
- package/.claude/commands/new-task.md +156 -0
- package/.claude/commands/notification.md +107 -0
- package/.claude/commands/pm-start.md +119 -0
- package/.claude/commands/projects.md +32 -0
- package/.claude/commands/promote.md +43 -0
- package/.claude/commands/rasis-report.md +1323 -0
- package/.claude/commands/release-note.md +130 -0
- package/.claude/commands/reply-watch.md +149 -0
- package/.claude/commands/requirement.md +352 -0
- package/.claude/commands/resume-state.md +187 -0
- package/.claude/commands/reviewpr.md +118 -0
- package/.claude/commands/save-state.md +100 -0
- package/.claude/commands/sentry-pr.md +157 -0
- package/.claude/commands/start-task.md +87 -0
- package/.claude/commands/system-review.md +147 -0
- package/.claude/commands/task-bypass.md +70 -0
- package/.claude/commands/task-estimate.md +100 -0
- package/.claude/commands/template-apply.md +89 -0
- package/.claude/commands/test-design.md +116 -0
- package/.claude/commands/transfer-mismatch.md +317 -0
- package/.claude/commands/verify.md +51 -0
- package/.claude/evals/grader-loop-mode-autonomy.sh +165 -0
- package/.claude/evals/grader-system-reminder-attention.sh +99 -0
- package/.claude/evals/loop-mode-autonomy.md +121 -0
- package/.claude/evals/loop-mode-autonomy.results.template.md +133 -0
- package/.claude/evals/system-reminder-attention.md +123 -0
- package/.claude/evals/system-reminder-attention.results.template.md +93 -0
- package/.claude/evals/system-reminder-attention.runner.md +353 -0
- package/.claude/harness-config.local.yml +48 -0
- package/.claude/harness-config.yml +534 -0
- package/.claude/hooks/agent-marker-clear.sh +43 -0
- package/.claude/hooks/agent-marker-set.sh +40 -0
- package/.claude/hooks/agent-router-suggest.sh +123 -0
- package/.claude/hooks/autonomous-action-guard.sh +242 -0
- package/.claude/hooks/byproduct-discharge-guard.sh +128 -0
- package/.claude/hooks/check-md-mermaid.sh +144 -0
- package/.claude/hooks/check-required-env.sh +95 -0
- package/.claude/hooks/check-serena-mcp.sh +123 -0
- package/.claude/hooks/confidence-gate.sh +139 -0
- package/.claude/hooks/context-budget.sh +233 -0
- package/.claude/hooks/delegation-guard.sh +99 -0
- package/.claude/hooks/dispatcher-manifest.tsv +38 -0
- package/.claude/hooks/draft-flow-guard.sh +304 -0
- package/.claude/hooks/failure-loop-detect.sh +139 -0
- package/.claude/hooks/gateguard.sh +209 -0
- package/.claude/hooks/improvement-proposal.sh +112 -0
- package/.claude/hooks/init-tasks-on-start.sh +34 -0
- package/.claude/hooks/lib/bypass-logger.sh +82 -0
- package/.claude/hooks/lib/confidence-gate/bypass.sh +48 -0
- package/.claude/hooks/lib/confidence-gate/extract.sh +99 -0
- package/.claude/hooks/lib/confidence-gate/major-agent-filter.sh +59 -0
- package/.claude/hooks/lib/confidence-gate/messages.sh +53 -0
- package/.claude/hooks/lib/config-loader.sh +784 -0
- package/.claude/hooks/lib/delegation-guard/bash-whitelist.sh +323 -0
- package/.claude/hooks/lib/delegation-guard/git-deny.sh +188 -0
- package/.claude/hooks/lib/delegation-guard/protected-paths.sh +105 -0
- package/.claude/hooks/lib/delegation-guard/subagent-detect.sh +40 -0
- package/.claude/hooks/lib/dispatcher-core.sh +454 -0
- package/.claude/hooks/lib/improvement-proposal/aggregate.py +466 -0
- package/.claude/hooks/lib/improvement-proposal/cache.sh +78 -0
- package/.claude/hooks/lib/mode-loader.sh +80 -0
- package/.claude/hooks/lib/next-actions-parser.sh +153 -0
- package/.claude/hooks/lib/project-root.sh +60 -0
- package/.claude/hooks/list-md-plan-first-reminder.sh +143 -0
- package/.claude/hooks/loop-auto-progress-reminder.sh +108 -0
- package/.claude/hooks/loop-confirmation-detector.sh +241 -0
- package/.claude/hooks/mode-asana-prompt.sh +61 -0
- package/.claude/hooks/mode-enforce.sh +57 -0
- package/.claude/hooks/mode-session-start.sh +93 -0
- package/.claude/hooks/next-actions-surface.sh +136 -0
- package/.claude/hooks/notification-dispatcher.sh +9 -0
- package/.claude/hooks/notify.sh +27 -0
- package/.claude/hooks/parallel-subagent-reminder.sh +469 -0
- package/.claude/hooks/post-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/pre-tool-use-dispatcher.sh +9 -0
- package/.claude/hooks/reviewer-count-guard.sh +313 -0
- package/.claude/hooks/session-help-surface.sh +192 -0
- package/.claude/hooks/session-start-dispatcher.sh +9 -0
- package/.claude/hooks/session-start-wrapper.sh +156 -0
- package/.claude/hooks/stale-harness-detect.sh +422 -0
- package/.claude/hooks/stop-dispatcher.sh +9 -0
- package/.claude/hooks/stop.sh +25 -0
- package/.claude/hooks/subagent-stop-dispatcher.sh +9 -0
- package/.claude/hooks/task-rule-guard.sh +317 -0
- package/.claude/hooks/tests/run-tests.sh +23 -0
- package/.claude/hooks/tests/test-agent-marker-warn.sh +86 -0
- package/.claude/hooks/tests/test-check-required-env.sh +138 -0
- package/.claude/hooks/tests/test-confidence-gate.sh +170 -0
- package/.claude/hooks/tests/test-config-env-override.sh +220 -0
- package/.claude/hooks/tests/test-gate-disable.sh +118 -0
- package/.claude/hooks/tests/test-improvement-proposal.sh +284 -0
- package/.claude/hooks/tool-call-slip-detector.sh +188 -0
- package/.claude/hooks/user-prompt-submit-dispatcher.sh +9 -0
- package/.claude/hooks/why-x5-reminder.sh +45 -0
- package/.claude/hooks/why-x5-violation-detect.sh +152 -0
- package/.claude/hooks/workflow-guard.sh +263 -0
- package/.claude/mode.yml +28 -0
- package/.claude/project-rules/development-process.md +8 -0
- package/.claude/project-rules/git-workflow.md +8 -0
- package/.claude/project-rules/modes.md +8 -0
- package/.claude/project-rules/self-improvement.md +8 -0
- package/.claude/project-rules/task-management.md +8 -0
- package/.claude/project-rules/why-x5-output.md +8 -0
- package/.claude/project-rules/workflow.md +8 -0
- package/.claude/rules/development-process.md +293 -0
- package/.claude/rules/git-workflow.md +71 -0
- package/.claude/rules/modes.md +189 -0
- package/.claude/rules/self-improvement.md +76 -0
- package/.claude/rules/task-management.md +261 -0
- package/.claude/rules/why-x5-output.md +97 -0
- package/.claude/rules/workflow.md +157 -0
- package/.claude/rules-details/README.md +67 -0
- package/.claude/rules-details/development-process/confidence-gate.md +22 -0
- package/.claude/rules-details/development-process/cross-repo-write.md +35 -0
- package/.claude/rules-details/development-process/delegation-requirements.md +158 -0
- package/.claude/rules-details/development-process/harness-sync.md +21 -0
- package/.claude/rules-details/development-process/origin.md +13 -0
- package/.claude/rules-details/development-process/parallelization-origin.md +22 -0
- package/.claude/rules-details/development-process/research-reuse.md +22 -0
- package/.claude/rules-details/development-process/staging-strategy.md +47 -0
- package/.claude/rules-details/modes/artifacts.md +34 -0
- package/.claude/rules-details/modes/compliance-items.md +120 -0
- package/.claude/rules-details/modes/five-layer-enforcement.md +46 -0
- package/.claude/rules-details/modes/mode-hooks.md +51 -0
- package/.claude/rules-details/modes/origin.md +17 -0
- package/.claude/rules-details/self-improvement/l4-mechanics.md +36 -0
- package/.claude/rules-details/self-improvement/origin.md +8 -0
- package/.claude/rules-details/self-improvement/related-skills.md +35 -0
- package/.claude/rules-details/self-improvement/when-to-use-layers.md +39 -0
- package/.claude/rules-details/task-management/hook-enforcement.md +25 -0
- package/.claude/rules-details/task-management/mandatory-reading.md +20 -0
- package/.claude/rules-details/task-management/origin.md +12 -0
- package/.claude/rules-details/task-management/parking-lot.md +26 -0
- package/.claude/rules-details/task-management/plan-first.md +44 -0
- package/.claude/rules-details/task-management/six-articles.md +68 -0
- package/.claude/rules-details/task-management/task-migration.md +16 -0
- package/.claude/rules-details/task-management/ui-detection.md +11 -0
- package/.claude/rules-details/why-x5-output/examples.md +41 -0
- package/.claude/rules-details/why-x5-output/feedback-memory.md +14 -0
- package/.claude/rules-details/why-x5-output/origin.md +10 -0
- package/.claude/rules-details/why-x5-output/v1-v10-history.md +19 -0
- package/.claude/rules-details/workflow/10-stage.md +43 -0
- package/.claude/rules-details/workflow/14-stage.md +52 -0
- package/.claude/rules-details/workflow/byproduct-discharge.md +39 -0
- package/.claude/rules-details/workflow/draft-flow-guard.md +31 -0
- package/.claude/rules-details/workflow/fan-out.md +70 -0
- package/.claude/rules-details/workflow/mece-20.md +36 -0
- package/.claude/rules-details/workflow/origin.md +14 -0
- package/.claude/rules-details/workflow/refactoring.md +48 -0
- package/.claude/rules-details/workflow/related-skills.md +22 -0
- package/.claude/rules-details/workflow/reviewer-prompt.md +100 -0
- package/.claude/rules-details/workflow/session-persistence.md +46 -0
- package/.claude/rules-details/workflow/workflow-guard.md +36 -0
- package/.claude/scripts/__pycache__/harness-audit.cpython-313.pyc +0 -0
- package/.claude/scripts/agent-stocktake.py +421 -0
- package/.claude/scripts/check-md-mermaid.mjs +138 -0
- package/.claude/scripts/generate-settings.sh +0 -0
- package/.claude/scripts/harness-audit.py +1547 -0
- package/.claude/scripts/hc-config.sh +2265 -0
- package/.claude/scripts/init-tasks.sh +117 -0
- package/.claude/scripts/lib/enforcement-matrix-parse.sh +81 -0
- package/.claude/scripts/lib/hc-config-metadata.sh +190 -0
- package/.claude/scripts/lib/hc-config-web-server.js +1528 -0
- package/.claude/scripts/lib/hc-config-web-ui/app.js +1054 -0
- package/.claude/scripts/lib/hc-config-web-ui/index.html +130 -0
- package/.claude/scripts/lib/hc-config-web-ui/style.css +522 -0
- package/.claude/scripts/new-task-helper.sh +432 -0
- package/.claude/scripts/observe-repair.sh +437 -0
- package/.claude/scripts/observe-rotate.sh +311 -0
- package/.claude/scripts/statusline.sh +239 -0
- package/.claude/settings.generated.preview.json +211 -0
- package/.claude/settings.json +215 -0
- package/.claude/settings.local.example.json +20 -0
- package/.claude/settings.local.json +36 -0
- package/.claude/skills/agent-introspection-debugging/SKILL.md +123 -0
- package/.claude/skills/agent-router/README.md +137 -0
- package/.claude/skills/agent-router/SKILL.md +74 -0
- package/.claude/skills/agent-router/dispatch-table.yml +352 -0
- package/.claude/skills/agent-router/router.py +1086 -0
- package/.claude/skills/agent-router/samples/representative_prompts.txt +24 -0
- package/.claude/skills/agent-router/tests/__init__.py +0 -0
- package/.claude/skills/agent-router/tests/test_router.py +762 -0
- package/.claude/skills/artifacts-builder/LICENSE.txt +202 -0
- package/.claude/skills/artifacts-builder/SKILL.md +74 -0
- package/.claude/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/.claude/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/.claude/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/.claude/skills/brand-guidelines/LICENSE.txt +202 -0
- package/.claude/skills/brand-guidelines/SKILL.md +73 -0
- package/.claude/skills/canvas-design/LICENSE.txt +202 -0
- package/.claude/skills/canvas-design/SKILL.md +130 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/.claude/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/.claude/skills/changelog-generator/SKILL.md +104 -0
- package/.claude/skills/check-md-mermaid/SKILL.md +62 -0
- package/.claude/skills/connect/SKILL.md +156 -0
- package/.claude/skills/connect-apps/SKILL.md +80 -0
- package/.claude/skills/content-research-writer/SKILL.md +538 -0
- package/.claude/skills/continuous-agent-loop/SKILL.md +187 -0
- package/.claude/skills/continuous-learning-v2/SKILL.md +238 -0
- package/.claude/skills/continuous-learning-v2/config.json +35 -0
- package/.claude/skills/continuous-learning-v2/hooks/observe.sh +333 -0
- package/.claude/skills/continuous-learning-v2/instinct-cli.py +406 -0
- package/.claude/skills/domain-name-brainstormer/SKILL.md +212 -0
- package/.claude/skills/eval-harness/SKILL.md +100 -0
- package/.claude/skills/eval-harness/swe-bench/README.md +80 -0
- package/.claude/skills/eval-harness/swe-bench/config.yml +29 -0
- package/.claude/skills/eval-harness/swe-bench/docker/Dockerfile +25 -0
- package/.claude/skills/eval-harness/swe-bench/docker/docker-compose.yml +18 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-2026-05-04.json +137 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-comparison-2026-05-04.md +112 -0
- package/.claude/skills/eval-harness/swe-bench/results/dry-run-improved-2026-05-04.json +165 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.patch +12 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/results/raw/astropy__astropy-12907.whole-file.txt +322 -0
- package/.claude/skills/eval-harness/swe-bench/runner.py +845 -0
- package/.claude/skills/eval-harness/swe-bench/scoring.py +298 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/fetch_tasks.py +81 -0
- package/.claude/skills/eval-harness/swe-bench/tasks/lite-50.json +702 -0
- package/.claude/skills/file-organizer/SKILL.md +433 -0
- package/.claude/skills/gan-style-harness/SKILL.md +111 -0
- package/.claude/skills/gateguard/.gateguard.yml +47 -0
- package/.claude/skills/gateguard/SKILL.md +99 -0
- package/.claude/skills/internal-comms/LICENSE.txt +202 -0
- package/.claude/skills/internal-comms/SKILL.md +32 -0
- package/.claude/skills/internal-comms/examples/3p-updates.md +47 -0
- package/.claude/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/.claude/skills/internal-comms/examples/faq-answers.md +30 -0
- package/.claude/skills/internal-comms/examples/general-comms.md +16 -0
- package/.claude/skills/invoice-organizer/SKILL.md +446 -0
- package/.claude/skills/karpathy-guidelines/SKILL.md +67 -0
- package/.claude/skills/langsmith-fetch/SKILL.md +485 -0
- package/.claude/skills/lead-research-assistant/SKILL.md +199 -0
- package/.claude/skills/mcp-builder/LICENSE.txt +202 -0
- package/.claude/skills/mcp-builder/SKILL.md +328 -0
- package/.claude/skills/mcp-builder/reference/evaluation.md +602 -0
- package/.claude/skills/mcp-builder/reference/mcp_best_practices.md +915 -0
- package/.claude/skills/mcp-builder/reference/node_mcp_server.md +916 -0
- package/.claude/skills/mcp-builder/reference/python_mcp_server.md +752 -0
- package/.claude/skills/mcp-builder/scripts/connections.py +151 -0
- package/.claude/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/.claude/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/.claude/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/.claude/skills/raffle-winner-picker/SKILL.md +159 -0
- package/.claude/skills/repo-map/README.md +125 -0
- package/.claude/skills/repo-map/SKILL.md +128 -0
- package/.claude/skills/repo-map/examples/sample-output.md +1194 -0
- package/.claude/skills/repo-map/repo-map.py +715 -0
- package/.claude/skills/salesforce-e2e-testing/SKILL.md +116 -0
- package/.claude/skills/salesforce-e2e-testing/catalog-template.md +161 -0
- package/.claude/skills/salesforce-e2e-testing/methodology.md +179 -0
- package/.claude/skills/salesforce-e2e-testing/observation-rules.md +280 -0
- package/.claude/skills/salesforce-e2e-testing/pattern-taxonomy.md +392 -0
- package/.claude/skills/salesforce-e2e-testing/procedure-template.md +376 -0
- package/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/.claude/skills/skill-creator/SKILL.md +209 -0
- package/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/.claude/skills/skill-share/SKILL.md +80 -0
- package/.claude/skills/tailored-resume-generator/SKILL.md +345 -0
- package/.claude/skills/template-skill/SKILL.md +6 -0
- package/.claude/skills/theme-factory/LICENSE.txt +202 -0
- package/.claude/skills/theme-factory/SKILL.md +59 -0
- package/.claude/skills/theme-factory/theme-showcase.pdf +0 -0
- package/.claude/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/.claude/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/.claude/skills/theme-factory/themes/desert-rose.md +19 -0
- package/.claude/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/.claude/skills/theme-factory/themes/golden-hour.md +19 -0
- package/.claude/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/.claude/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/.claude/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/.claude/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/.claude/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/.claude/skills/verification-loop/SKILL.md +129 -0
- package/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/.claude/templates/docs/draft/_DRAFT_TEMPLATE.md +162 -0
- package/.claude/templates/docs/draft/_TEST_DESIGN_TEMPLATE.md +76 -0
- package/.claude/templates/docs/tasks/_TASK_TEMPLATE.md +276 -0
- package/.claude/templates/docs/tasks/list.md +80 -0
- package/.claude/templates/docs/tasks/parking-lot.md +82 -0
- package/.claude/templates/settings.user-level.json.template +306 -0
- package/.claude/tests/SMOKE-CLASSIFICATION.md +199 -0
- package/.claude/tests/action-space-count-smoke.sh +130 -0
- package/.claude/tests/agent-router-suggest-wiring-smoke.sh +188 -0
- package/.claude/tests/audit-followups-smoke.sh +158 -0
- package/.claude/tests/autonomous-action-guard-relaxation-smoke.sh +479 -0
- package/.claude/tests/autonomous-action-guard-smoke.sh +187 -0
- package/.claude/tests/check-serena-mcp-smoke.sh +156 -0
- package/.claude/tests/common-rules-import-smoke.sh +209 -0
- package/.claude/tests/confidence-gate-smoke.sh +220 -0
- package/.claude/tests/config-feature-toggles-smoke.sh +389 -0
- package/.claude/tests/context-budget-smoke.sh +222 -0
- package/.claude/tests/custom-pm-commands-smoke.sh +93 -0
- package/.claude/tests/delegation-guard-code-smoke.sh +244 -0
- package/.claude/tests/delegation-guard-deny-layers-smoke.sh +356 -0
- package/.claude/tests/delegation-guard-readonly-filter-smoke.sh +205 -0
- package/.claude/tests/delegation-guard-search-whitelist-smoke.sh +152 -0
- package/.claude/tests/delegation-guard-segment-smoke.sh +109 -0
- package/.claude/tests/dispatcher-blocker-invariance-smoke.sh +700 -0
- package/.claude/tests/dispatcher-core-smoke.sh +452 -0
- package/.claude/tests/dispatcher-merge-matrix-smoke.sh +825 -0
- package/.claude/tests/dispatcher-success-stdout-smoke.sh +290 -0
- package/.claude/tests/draft-flow-guard-approved-dir-smoke.sh +234 -0
- package/.claude/tests/draft-flow-guard-smoke.sh +194 -0
- package/.claude/tests/dual-mode-portability-smoke.sh +131 -0
- package/.claude/tests/effective-hook-matrix-smoke.sh +261 -0
- package/.claude/tests/enforcement-mismatch-smoke.sh +263 -0
- package/.claude/tests/fixtures/cascade-sample.jsonl +9 -0
- package/.claude/tests/fixtures/next-actions/case-clean.md +14 -0
- package/.claude/tests/fixtures/next-actions/case-with-red.md +16 -0
- package/.claude/tests/fixtures/next-actions/case-with-yellow-only.md +14 -0
- package/.claude/tests/fixtures/normal-broken-scatter.jsonl +5 -0
- package/.claude/tests/fixtures/task-71/blocker-baseline.tsv +24 -0
- package/.claude/tests/fixtures/task-71/settings-inventory.tsv +37 -0
- package/.claude/tests/fixtures/transcript-50pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-60pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-80pct.jsonl +2 -0
- package/.claude/tests/fixtures/transcript-95pct.jsonl +2 -0
- package/.claude/tests/fixtures/workflow-guard/case-2-mid.json +21 -0
- package/.claude/tests/fixtures/workflow-guard/case-3-blocked.json +33 -0
- package/.claude/tests/fixtures/workflow-guard/case-4-clean.json +27 -0
- package/.claude/tests/fixtures/workflow-guard/case-8-modify.json +23 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-1.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-2.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-3.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-4.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-5.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-6.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-7.json +1 -0
- package/.claude/tests/fixtures/workflow-guard/inputs/case-8.json +1 -0
- package/.claude/tests/gateguard-smoke.sh +213 -0
- package/.claude/tests/git-deny-mainline-policy-smoke.sh +222 -0
- package/.claude/tests/harness-audit-c-batch-smoke.sh +270 -0
- package/.claude/tests/harness-audit-compare-smoke.sh +186 -0
- package/.claude/tests/harness-audit-pipeline-health-smoke.sh +326 -0
- package/.claude/tests/harness-config-local-smoke.sh +232 -0
- package/.claude/tests/hc-config-git-policy-smoke.sh +241 -0
- package/.claude/tests/hc-config-key-parity-smoke.sh +149 -0
- package/.claude/tests/hc-config-migration-smoke.sh +251 -0
- package/.claude/tests/hc-config-script-smoke.sh +1106 -0
- package/.claude/tests/hc-config-tui-smoke.sh +801 -0
- package/.claude/tests/hc-config-web-ui-smoke.sh +3224 -0
- package/.claude/tests/hook-cwd-robustness-smoke.sh +206 -0
- package/.claude/tests/hook-frequency-tweaks-smoke.sh +312 -0
- package/.claude/tests/improvement-proposal-cache-smoke.sh +238 -0
- package/.claude/tests/install-sh-overwrite-all-smoke.sh +274 -0
- package/.claude/tests/install-sh-regen-settings-smoke.sh +301 -0
- package/.claude/tests/install-sh-sync-drift-smoke.sh +285 -0
- package/.claude/tests/layer-b-context-isolation-smoke.sh +392 -0
- package/.claude/tests/list-md-plan-first-reminder-smoke.sh +313 -0
- package/.claude/tests/loop-auto-progress-smoke.sh +372 -0
- package/.claude/tests/loop-confirmation-detector-smoke.sh +674 -0
- package/.claude/tests/new-task-batch-update-smoke.sh +664 -0
- package/.claude/tests/next-actions-hooks-smoke.sh +283 -0
- package/.claude/tests/npx-cli-smoke.sh +696 -0
- package/.claude/tests/observe-flock-smoke.sh +223 -0
- package/.claude/tests/observe-jq-parse-smoke.sh +250 -0
- package/.claude/tests/observe-repair-smoke.sh +475 -0
- package/.claude/tests/observe-rotate-smoke.sh +428 -0
- package/.claude/tests/observe-subagent-stop-smoke.sh +476 -0
- package/.claude/tests/parallel-subagent-reminder-smoke.sh +918 -0
- package/.claude/tests/project-root-smoke.sh +140 -0
- package/.claude/tests/project-rules-protection-smoke.sh +199 -0
- package/.claude/tests/review-required-min-count-smoke.sh +286 -0
- package/.claude/tests/reviewer-count-guard-smoke.sh +490 -0
- package/.claude/tests/rule-architecture-smoke.sh +418 -0
- package/.claude/tests/rule-change-draft-flow-guard-smoke.sh +343 -0
- package/.claude/tests/run-all-smokes.sh +340 -0
- package/.claude/tests/session-help-surface-smoke.sh +224 -0
- package/.claude/tests/session-start-parallel-smoke.sh +165 -0
- package/.claude/tests/sessionstart-budget-smoke.sh +185 -0
- package/.claude/tests/sessionstart-footprint-smoke.sh +258 -0
- package/.claude/tests/settings-dispatcher-baseline-smoke.sh +709 -0
- package/.claude/tests/settings-generation-feature-pruning-smoke.sh +196 -0
- package/.claude/tests/stale-harness-detect-smoke.sh +974 -0
- package/.claude/tests/statusline-smoke.sh +180 -0
- package/.claude/tests/task-rule-guard-smoke.sh +656 -0
- package/.claude/tests/tool-call-slip-detector-smoke.sh +101 -0
- package/.claude/tests/wave-precheck-template-smoke.sh +159 -0
- package/.claude/tests/why-x5-violation-detect-smoke.sh +157 -0
- package/.claude/tests/workflow-guard-smoke.sh +266 -0
- package/CLAUDE.md +75 -0
- package/LICENSE +21 -0
- package/README.md +790 -0
- package/bin/cli.js +395 -0
- package/docs/INVENTORY.md +163 -0
- package/install.sh +769 -0
- package/package.json +25 -0
|
@@ -0,0 +1,1054 @@
|
|
|
1
|
+
// hc-config Web UI — task-76 2 分割再設計 (左 preset / 右 category accordion + 上部タブ 設定/履歴)
|
|
2
|
+
// vanilla JS + Tailwind CDN, fetch API only, no external deps。
|
|
3
|
+
//
|
|
4
|
+
// 設計 SSoT: docs/draft/hc-config-web-2pane-redesign.md §3 (2 分割レイアウト / accordion 同時 1 開 /
|
|
5
|
+
// 編集→custom 遷移 / 履歴タブ分離 / no-scroll)。task-63 の top/edit 2-view は廃止。
|
|
6
|
+
//
|
|
7
|
+
// API contract (Step 2 確定):
|
|
8
|
+
// GET /api/presets → { presets:[{name, display_name_ja, use_case, affected_key_count, group}], axes_schema }
|
|
9
|
+
// group ∈ {POC, 社内ツール, 本番運用, その他}
|
|
10
|
+
// GET /api/current-preset → 一致: {name, display_name_ja, match_type:'preset', axes}
|
|
11
|
+
// 不一致: {name:'custom', display_name_ja:'未保存変更あり', match_type:'custom', axes:null}
|
|
12
|
+
// GET /api/categories → { categories:[{name, key_count}] } 実 7 種
|
|
13
|
+
// GET /api/keys?category= → { keys:[{key, category, description, effect, current_value}], total }
|
|
14
|
+
// GET /api/preset/:name/diff → { preset, axes, use_case, changes:[{key, current, new, changed, effect}] }
|
|
15
|
+
// POST /api/set {key,value} → { ok:true, key, value } (batch は client で loop)
|
|
16
|
+
// GET /api/preset/history → { history:[{timestamp, preset, preset_display_name_ja?, applied_at, applied_count, failed_count, rolled_back_count}] }
|
|
17
|
+
// POST /api/preset/rollback/:ts → rollback
|
|
18
|
+
//
|
|
19
|
+
// State machine (新):
|
|
20
|
+
// tab: 'config' | 'history'
|
|
21
|
+
// presets[] : 左ペイン source (group 付き)
|
|
22
|
+
// categories[] : 右ペイン accordion 見出し source (実 7 category)
|
|
23
|
+
// keysByCategory{} : category → keys[] cache (lazy load)
|
|
24
|
+
// keyMeta{} : key → {category, description, effect, type} (型推定込み)
|
|
25
|
+
// baseline{} : key → 保存済 (server) の現在値 (文字列)
|
|
26
|
+
// draft{} : key → ユーザ編集後の値 (文字列)。baseline と差分があるものだけ保存対象
|
|
27
|
+
// selectedPreset : 左で選択中の preset name (preview 中)。編集発生で null + custom 化
|
|
28
|
+
// isCustom : 手動編集が発生して custom 状態か (draft §3 「手動編集が発生したら custom」)
|
|
29
|
+
// openCategory : 現在開いている accordion category 名 (同時 1 つだけ)
|
|
30
|
+
// history[]
|
|
31
|
+
// saving / rollbackInProgress
|
|
32
|
+
//
|
|
33
|
+
// XSS: DOM 構築は el() builder (textContent / 属性のみ、innerHTML 不使用)。
|
|
34
|
+
// a11y: タブ role=tab/aria-selected、accordion は <details>/<summary> でキーボード操作可。
|
|
35
|
+
//
|
|
36
|
+
;(function () {
|
|
37
|
+
'use strict'
|
|
38
|
+
|
|
39
|
+
// ============================================================
|
|
40
|
+
// 定数
|
|
41
|
+
// ============================================================
|
|
42
|
+
// 左ペイン group の表示順 (server の group 値と一致)
|
|
43
|
+
const PRESET_GROUP_ORDER = ['POC', '社内ツール', '本番運用', 'その他']
|
|
44
|
+
|
|
45
|
+
// 既知 enum key (select で表示)。/api/keys に enum 情報が無いため client 側 SSoT。
|
|
46
|
+
// default_preset は 4 enforcement level (modes.md / CommonRules.md 由来)。
|
|
47
|
+
// mainline_integration_policy は git 統合 policy 3 値 (task-77 §3.5、git-deny.sh が enforcement)。
|
|
48
|
+
const ENUM_OPTIONS = {
|
|
49
|
+
default_preset: ['advisory', 'team-default', 'strict', 'harness-dev'],
|
|
50
|
+
mainline_integration_policy: ['pr-required', 'local-merge', 'local-merge-push'],
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ============================================================
|
|
54
|
+
// initial state
|
|
55
|
+
// ============================================================
|
|
56
|
+
const initialState = {
|
|
57
|
+
tab: 'config', // 'config' | 'history'
|
|
58
|
+
presets: [],
|
|
59
|
+
categories: [],
|
|
60
|
+
keysByCategory: {}, // category → keys[]
|
|
61
|
+
keyMeta: {}, // key → { category, description, effect, type }
|
|
62
|
+
baseline: {}, // key → server 現在値 (string)
|
|
63
|
+
draft: {}, // key → 編集後値 (string)
|
|
64
|
+
selectedPreset: null,
|
|
65
|
+
isCustom: false,
|
|
66
|
+
openCategory: null,
|
|
67
|
+
history: [],
|
|
68
|
+
saving: false,
|
|
69
|
+
rollbackInProgress: false,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let state = { ...initialState }
|
|
73
|
+
|
|
74
|
+
// ============================================================
|
|
75
|
+
// value type 推定 ('boolean' | 'enum' | 'text')
|
|
76
|
+
// /api/keys は型 field を持たないため current_value + 既知 enum から推定する。
|
|
77
|
+
// ============================================================
|
|
78
|
+
function inferType(key, value) {
|
|
79
|
+
if (Object.prototype.hasOwnProperty.call(ENUM_OPTIONS, key)) return 'enum'
|
|
80
|
+
const v = value === null || value === undefined ? '' : String(value).trim().toLowerCase()
|
|
81
|
+
if (v === 'true' || v === 'false') return 'boolean'
|
|
82
|
+
return 'text'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ============================================================
|
|
86
|
+
// API wrappers
|
|
87
|
+
// ============================================================
|
|
88
|
+
async function api(method, path, body) {
|
|
89
|
+
const opts = { method, headers: { 'Content-Type': 'application/json' } }
|
|
90
|
+
if (body !== undefined) opts.body = JSON.stringify(body)
|
|
91
|
+
const res = await fetch(path, opts)
|
|
92
|
+
const text = await res.text()
|
|
93
|
+
let data
|
|
94
|
+
try {
|
|
95
|
+
data = text.length ? JSON.parse(text) : {}
|
|
96
|
+
} catch (e) {
|
|
97
|
+
throw new Error(`Invalid JSON response from ${path}: ${text.slice(0, 200)}`)
|
|
98
|
+
}
|
|
99
|
+
if (!res.ok) {
|
|
100
|
+
const detail = data && data.error ? `${data.error}${data.stderr ? ' / ' + data.stderr : ''}` : `${res.status} ${res.statusText}`
|
|
101
|
+
const timeoutSuffix = data && data.timed_out === true ? ' (timeout 5s 超過)' : ''
|
|
102
|
+
throw new Error(`${method} ${path} failed: ${detail}${timeoutSuffix}`)
|
|
103
|
+
}
|
|
104
|
+
return data
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const loadPresets = async () => (await api('GET', '/api/presets')).presets || []
|
|
108
|
+
const loadCategories = async () => (await api('GET', '/api/categories')).categories || []
|
|
109
|
+
const loadKeys = async (category) => (await api('GET', `/api/keys?category=${encodeURIComponent(category)}`)).keys || []
|
|
110
|
+
const loadHistory = async () => (await api('GET', '/api/preset/history')).history || []
|
|
111
|
+
const loadPresetDiff = async (name) => await api('GET', `/api/preset/${encodeURIComponent(name)}/diff`)
|
|
112
|
+
const setKeyApi = async (key, value) => await api('POST', '/api/set', { key, value })
|
|
113
|
+
const rollbackApi = async (timestamp) => await api('POST', `/api/preset/rollback/${encodeURIComponent(timestamp)}`)
|
|
114
|
+
const loadCurrentPreset = async () => {
|
|
115
|
+
try {
|
|
116
|
+
const r = await api('GET', '/api/current-preset')
|
|
117
|
+
if (!r.match_type) r.match_type = r.name && r.name !== 'custom' ? 'preset' : 'custom'
|
|
118
|
+
return r
|
|
119
|
+
} catch (e) {
|
|
120
|
+
return { match_type: 'custom', name: 'custom', display_name_ja: '未保存変更あり', axes: null }
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ============================================================
|
|
125
|
+
// DOM utils (textContent only、innerHTML 禁止 XSS 防止)
|
|
126
|
+
// ============================================================
|
|
127
|
+
function el(tag, attrs, ...children) {
|
|
128
|
+
const e = document.createElement(tag)
|
|
129
|
+
if (attrs) {
|
|
130
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
131
|
+
if (k === 'class') e.className = v
|
|
132
|
+
else if (k === 'onclick') e.addEventListener('click', v)
|
|
133
|
+
else if (k === 'onchange') e.addEventListener('change', v)
|
|
134
|
+
else if (k === 'oninput') e.addEventListener('input', v)
|
|
135
|
+
else if (k === 'onkeydown') e.addEventListener('keydown', v)
|
|
136
|
+
else if (k === 'ontoggle') e.addEventListener('toggle', v)
|
|
137
|
+
else if (k === 'htmlFor') e.htmlFor = v
|
|
138
|
+
else if (v === true) e.setAttribute(k, '')
|
|
139
|
+
else if (v === false || v === undefined || v === null) {
|
|
140
|
+
// skip falsy attr
|
|
141
|
+
} else {
|
|
142
|
+
e.setAttribute(k, String(v))
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
for (const c of children) {
|
|
147
|
+
if (c === null || c === undefined || c === false) continue
|
|
148
|
+
if (typeof c === 'string' || typeof c === 'number') {
|
|
149
|
+
e.appendChild(document.createTextNode(String(c)))
|
|
150
|
+
} else {
|
|
151
|
+
e.appendChild(c)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return e
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function clear(node) {
|
|
158
|
+
while (node.firstChild) node.removeChild(node.firstChild)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function $(id) {
|
|
162
|
+
return document.getElementById(id)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// ============================================================
|
|
166
|
+
// toast (error / success / warning / info、絵文字なしテキストアイコン)
|
|
167
|
+
// ============================================================
|
|
168
|
+
function toast(message, type) {
|
|
169
|
+
let cls, icon
|
|
170
|
+
if (type === 'error') { cls = 'bg-red-700 text-white'; icon = '[!]' }
|
|
171
|
+
else if (type === 'success') { cls = 'bg-emerald-700 text-white'; icon = '[OK]' }
|
|
172
|
+
else if (type === 'warning') { cls = 'bg-amber-600 text-white'; icon = '[!]' }
|
|
173
|
+
else if (type === 'info') { cls = 'bg-blue-700 text-white'; icon = '[i]' }
|
|
174
|
+
else { cls = 'bg-slate-800 text-white'; icon = '' }
|
|
175
|
+
const t = el(
|
|
176
|
+
'div',
|
|
177
|
+
{
|
|
178
|
+
class: `pointer-events-auto px-4 py-2 rounded shadow-lg text-sm flex items-center gap-2 ${cls}`,
|
|
179
|
+
// L1: error / warning は role=alert (即時読み上げ)、それ以外は status
|
|
180
|
+
role: (type === 'error' || type === 'warning') ? 'alert' : 'status',
|
|
181
|
+
},
|
|
182
|
+
icon ? el('span', { 'aria-hidden': 'true', class: 'font-mono text-xs' }, icon) : null,
|
|
183
|
+
el('span', null, message)
|
|
184
|
+
)
|
|
185
|
+
const cont = $('toast-container')
|
|
186
|
+
if (cont) cont.appendChild(t)
|
|
187
|
+
setTimeout(() => t.remove(), 4000)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function setStatus(text) {
|
|
191
|
+
const sb = $('status-text')
|
|
192
|
+
if (sb) sb.textContent = text
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// ============================================================
|
|
196
|
+
// dialog helper (resolved flag で二重 resolve 防止、task-61 から継承)
|
|
197
|
+
// ============================================================
|
|
198
|
+
function showConfirmDialog(opts) {
|
|
199
|
+
return new Promise((resolve) => {
|
|
200
|
+
const dlg = $('confirm-dialog')
|
|
201
|
+
const titleEl = $('confirm-dialog-title')
|
|
202
|
+
const bodyEl = $('confirm-dialog-body')
|
|
203
|
+
const okBtn = $('confirm-dialog-ok')
|
|
204
|
+
const cancelBtn = $('confirm-dialog-cancel')
|
|
205
|
+
|
|
206
|
+
titleEl.textContent = opts.title || '確認'
|
|
207
|
+
clear(bodyEl)
|
|
208
|
+
for (const line of opts.bodyLines || []) bodyEl.appendChild(el('p', null, line))
|
|
209
|
+
okBtn.textContent = opts.okLabel || '実行'
|
|
210
|
+
cancelBtn.textContent = opts.cancelLabel || 'キャンセル'
|
|
211
|
+
okBtn.className = opts.danger
|
|
212
|
+
? 'px-4 py-2 text-sm bg-red-700 hover:bg-red-800 text-white font-semibold rounded min-h-[44px]'
|
|
213
|
+
: 'px-4 py-2 text-sm bg-emerald-600 hover:bg-emerald-700 text-white font-semibold rounded min-h-[44px]'
|
|
214
|
+
|
|
215
|
+
let resolved = false
|
|
216
|
+
const safeResolve = (value) => {
|
|
217
|
+
if (resolved) return
|
|
218
|
+
resolved = true
|
|
219
|
+
cleanup()
|
|
220
|
+
resolve(value)
|
|
221
|
+
}
|
|
222
|
+
const onClose = () => safeResolve(dlg.returnValue === 'ok')
|
|
223
|
+
function cleanup() {
|
|
224
|
+
okBtn.removeEventListener('click', okClickHandler)
|
|
225
|
+
cancelBtn.removeEventListener('click', cancelClickHandler)
|
|
226
|
+
dlg.removeEventListener('close', onClose)
|
|
227
|
+
if (dlg.open) {
|
|
228
|
+
try { dlg.close() } catch (e) { /* noop */ }
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const okClickHandler = () => { dlg.returnValue = 'ok'; safeResolve(true) }
|
|
232
|
+
const cancelClickHandler = () => { dlg.returnValue = 'cancel'; safeResolve(false) }
|
|
233
|
+
okBtn.addEventListener('click', okClickHandler)
|
|
234
|
+
cancelBtn.addEventListener('click', cancelClickHandler)
|
|
235
|
+
dlg.addEventListener('close', onClose)
|
|
236
|
+
if (typeof dlg.showModal === 'function') dlg.showModal()
|
|
237
|
+
else dlg.setAttribute('open', '')
|
|
238
|
+
setTimeout(() => cancelBtn.focus(), 10)
|
|
239
|
+
})
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function activateOnEnterOrSpace(action) {
|
|
243
|
+
return (ev) => {
|
|
244
|
+
if (ev.key === 'Enter' || ev.key === ' ' || ev.key === 'Spacebar') {
|
|
245
|
+
ev.preventDefault()
|
|
246
|
+
action(ev)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// ============================================================
|
|
252
|
+
// derived helpers
|
|
253
|
+
// ============================================================
|
|
254
|
+
// baseline と draft の差分 key (保存対象)
|
|
255
|
+
function changedKeys() {
|
|
256
|
+
const out = []
|
|
257
|
+
for (const key of Object.keys(state.draft)) {
|
|
258
|
+
if (String(state.draft[key]) !== String(state.baseline[key])) out.push(key)
|
|
259
|
+
}
|
|
260
|
+
return out
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function hasChanges() {
|
|
264
|
+
return changedKeys().length > 0
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// 現在の表示値 (draft 優先、無ければ baseline)
|
|
268
|
+
function currentValue(key) {
|
|
269
|
+
return Object.prototype.hasOwnProperty.call(state.draft, key) ? state.draft[key] : state.baseline[key]
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// /api/keys の key エントリから keyMeta エントリを生成する内部 helper。
|
|
273
|
+
// 4 箇所で同一パターンが出現していたのを集約 (task-78 Step 7 refactor)。
|
|
274
|
+
// フィールド追加は本関数 1 箇所のみ変更で済む。
|
|
275
|
+
function buildKeyMeta(k) {
|
|
276
|
+
return {
|
|
277
|
+
category: k.category,
|
|
278
|
+
description: k.description,
|
|
279
|
+
effect: k.effect,
|
|
280
|
+
label_ja: k.label_ja || '',
|
|
281
|
+
type: inferType(k.key, k.current_value),
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// key の表示ラベル (task-78 Step 2/3): `<key_name> (<label_ja>)`、label 空は key 名のみ。
|
|
286
|
+
// 返り値は textContent でのみ使用 (el() builder 経由) なので XSS 安全。
|
|
287
|
+
function labelJaOf(key) {
|
|
288
|
+
const meta = state.keyMeta[key]
|
|
289
|
+
return meta && meta.label_ja ? String(meta.label_ja) : ''
|
|
290
|
+
}
|
|
291
|
+
function keyDisplayLabel(key) {
|
|
292
|
+
const lj = labelJaOf(key)
|
|
293
|
+
return lj ? `${key} (${lj})` : key
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// ============================================================
|
|
297
|
+
// 左ペイン render (preset を group section 化 + ★ カスタム)
|
|
298
|
+
// render target: #preset-list
|
|
299
|
+
// ============================================================
|
|
300
|
+
function renderPresetList() {
|
|
301
|
+
const cont = $('preset-list')
|
|
302
|
+
if (!cont) return
|
|
303
|
+
clear(cont)
|
|
304
|
+
|
|
305
|
+
if (!state.presets.length) {
|
|
306
|
+
cont.appendChild(el('p', { class: 'text-sm text-slate-400 px-2 py-1' }, '読み込み中...'))
|
|
307
|
+
return
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// group ごとに分類
|
|
311
|
+
const groups = {}
|
|
312
|
+
for (const p of state.presets) {
|
|
313
|
+
const g = p.group || 'その他'
|
|
314
|
+
if (!groups[g]) groups[g] = []
|
|
315
|
+
groups[g].push(p)
|
|
316
|
+
}
|
|
317
|
+
const orderedGroupNames = PRESET_GROUP_ORDER.filter((g) => groups[g] && groups[g].length)
|
|
318
|
+
// 想定外 group も末尾に拾う
|
|
319
|
+
for (const g of Object.keys(groups)) {
|
|
320
|
+
if (!orderedGroupNames.includes(g)) orderedGroupNames.push(g)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
for (const g of orderedGroupNames) {
|
|
324
|
+
cont.appendChild(el('h3', { class: 'preset-group__heading', lang: 'ja' }, g))
|
|
325
|
+
const ul = el('ul', { class: 'preset-group__list', role: 'list', 'aria-label': `${g} のプリセット` })
|
|
326
|
+
for (const p of groups[g]) {
|
|
327
|
+
ul.appendChild(renderPresetItem(p))
|
|
328
|
+
}
|
|
329
|
+
cont.appendChild(ul)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// ★ カスタム (H3 fix: preset group 'その他' とは独立した「カスタム」見出しにし、
|
|
333
|
+
// server が 'その他' group の preset を返した場合の見出し重複を防ぐ)
|
|
334
|
+
cont.appendChild(el('h3', { class: 'preset-group__heading', lang: 'ja' }, 'カスタム'))
|
|
335
|
+
const customSel = state.isCustom
|
|
336
|
+
const onCustom = () => { /* custom は選択操作不可 (編集結果として自動遷移)。クリックは no-op */ }
|
|
337
|
+
cont.appendChild(
|
|
338
|
+
el(
|
|
339
|
+
'div',
|
|
340
|
+
{
|
|
341
|
+
class: `preset-item preset-item--custom ${customSel ? 'preset-item--selected' : ''}`,
|
|
342
|
+
role: 'listitem',
|
|
343
|
+
'aria-current': customSel ? 'true' : null,
|
|
344
|
+
lang: 'ja',
|
|
345
|
+
tabindex: '-1',
|
|
346
|
+
onclick: onCustom,
|
|
347
|
+
},
|
|
348
|
+
el('span', { class: 'preset-item__name' }, '★ カスタム'),
|
|
349
|
+
el('span', { class: 'preset-item__sub text-xs text-slate-500' }, '手動編集後の未保存状態')
|
|
350
|
+
)
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function renderPresetItem(p) {
|
|
355
|
+
const isSel = !state.isCustom && state.selectedPreset === p.name
|
|
356
|
+
const onSelect = () => onSelectPreset(p.name)
|
|
357
|
+
return el(
|
|
358
|
+
'li',
|
|
359
|
+
{
|
|
360
|
+
class: `preset-item ${isSel ? 'preset-item--selected' : ''}`,
|
|
361
|
+
role: 'listitem',
|
|
362
|
+
tabindex: '0',
|
|
363
|
+
'data-preset-key': p.name,
|
|
364
|
+
'aria-current': isSel ? 'true' : null,
|
|
365
|
+
'aria-label': `プリセット ${p.display_name_ja || p.name}${isSel ? ' (選択中)' : ''}`,
|
|
366
|
+
onclick: onSelect,
|
|
367
|
+
onkeydown: activateOnEnterOrSpace(onSelect),
|
|
368
|
+
lang: 'ja',
|
|
369
|
+
},
|
|
370
|
+
el('span', { class: 'preset-item__name' }, p.display_name_ja || p.name),
|
|
371
|
+
el('span', { class: 'preset-item__sub text-xs text-slate-400 font-mono' }, p.name),
|
|
372
|
+
p.use_case ? el('span', { class: 'preset-item__sub text-xs text-slate-500', lang: 'ja' }, p.use_case) : null
|
|
373
|
+
)
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// ============================================================
|
|
377
|
+
// 右ペイン render (実 7 category を accordion 化、同時 1 つ開く)
|
|
378
|
+
// render target: #category-accordion
|
|
379
|
+
// ============================================================
|
|
380
|
+
function renderCategoryAccordion() {
|
|
381
|
+
const cont = $('category-accordion')
|
|
382
|
+
if (!cont) return
|
|
383
|
+
clear(cont)
|
|
384
|
+
|
|
385
|
+
if (!state.categories.length) {
|
|
386
|
+
cont.appendChild(el('p', { class: 'text-sm text-slate-400 px-2 py-2' }, '読み込み中...'))
|
|
387
|
+
return
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
for (const c of state.categories) {
|
|
391
|
+
const catName = c.name || '(未分類)'
|
|
392
|
+
const isOpen = state.openCategory === catName
|
|
393
|
+
const detailsAttrs = {
|
|
394
|
+
class: 'category-accordion__item',
|
|
395
|
+
'data-category': catName,
|
|
396
|
+
ontoggle: (ev) => onToggleCategory(catName, ev.target.open),
|
|
397
|
+
}
|
|
398
|
+
if (isOpen) detailsAttrs.open = true
|
|
399
|
+
|
|
400
|
+
const summary = el(
|
|
401
|
+
'summary',
|
|
402
|
+
{ class: 'category-accordion__summary', lang: 'ja' },
|
|
403
|
+
el('span', { class: 'category-accordion__name' }, catName),
|
|
404
|
+
el('span', { class: 'category-accordion__count text-xs text-slate-400' }, `${c.key_count} keys`)
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
const bodyChildren = []
|
|
408
|
+
if (isOpen) {
|
|
409
|
+
const keys = state.keysByCategory[catName]
|
|
410
|
+
if (!keys) {
|
|
411
|
+
bodyChildren.push(el('p', { class: 'text-xs text-slate-400 px-3 py-2' }, '読み込み中...'))
|
|
412
|
+
} else if (!keys.length) {
|
|
413
|
+
bodyChildren.push(el('p', { class: 'text-xs text-slate-400 px-3 py-2' }, 'key がありません'))
|
|
414
|
+
} else {
|
|
415
|
+
for (const k of keys) bodyChildren.push(renderKeyRow(k))
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
const body = el('div', { class: 'category-accordion__body' }, ...bodyChildren)
|
|
419
|
+
cont.appendChild(el('details', detailsAttrs, summary, body))
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function renderKeyRow(keyObj) {
|
|
424
|
+
const key = keyObj.key
|
|
425
|
+
const meta = state.keyMeta[key] || { type: 'text', description: '', effect: '', label_ja: '' }
|
|
426
|
+
const val = currentValue(key)
|
|
427
|
+
// 変更扱い: draft に key があり baseline と値が異なる (C1/L1 fix: tautology を簡素化)
|
|
428
|
+
const isChanged = Object.prototype.hasOwnProperty.call(state.draft, key) &&
|
|
429
|
+
String(state.draft[key]) !== String(state.baseline[key])
|
|
430
|
+
|
|
431
|
+
// M3 fix: control に id を付与し .key-row__name を <label htmlFor=id> にして
|
|
432
|
+
// ラベルクリックで control に focus が移るようにする。
|
|
433
|
+
const controlId = `keyctl-${key}`
|
|
434
|
+
let control
|
|
435
|
+
if (meta.type === 'boolean') {
|
|
436
|
+
const checked = String(val).trim().toLowerCase() === 'true'
|
|
437
|
+
control = el('input', {
|
|
438
|
+
type: 'checkbox',
|
|
439
|
+
id: controlId,
|
|
440
|
+
class: 'key-row__toggle',
|
|
441
|
+
checked: checked ? true : false,
|
|
442
|
+
'aria-label': `${key} (${checked ? 'on' : 'off'})`,
|
|
443
|
+
onchange: (ev) => onEditKey(key, ev.target.checked ? 'true' : 'false'),
|
|
444
|
+
})
|
|
445
|
+
} else if (meta.type === 'enum') {
|
|
446
|
+
const opts = ENUM_OPTIONS[key] || []
|
|
447
|
+
const sel = el('select', {
|
|
448
|
+
id: controlId,
|
|
449
|
+
class: 'key-row__select',
|
|
450
|
+
'aria-label': key,
|
|
451
|
+
onchange: (ev) => onEditKey(key, ev.target.value),
|
|
452
|
+
})
|
|
453
|
+
const cur = String(val == null ? '' : val)
|
|
454
|
+
// 現在値が既知 option に無い場合も先頭に保持
|
|
455
|
+
const allOpts = opts.includes(cur) ? opts : [cur, ...opts]
|
|
456
|
+
for (const o of allOpts) {
|
|
457
|
+
const optEl = el('option', { value: o }, o)
|
|
458
|
+
if (o === cur) optEl.selected = true
|
|
459
|
+
sel.appendChild(optEl)
|
|
460
|
+
}
|
|
461
|
+
control = sel
|
|
462
|
+
} else {
|
|
463
|
+
control = el('input', {
|
|
464
|
+
type: 'text',
|
|
465
|
+
id: controlId,
|
|
466
|
+
class: 'key-row__text',
|
|
467
|
+
value: val == null ? '' : String(val),
|
|
468
|
+
'aria-label': key,
|
|
469
|
+
oninput: (ev) => onEditKey(key, ev.target.value),
|
|
470
|
+
})
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return el(
|
|
474
|
+
'div',
|
|
475
|
+
{ class: `key-row ${isChanged ? 'key-row--changed' : ''}`, 'data-key': key },
|
|
476
|
+
el(
|
|
477
|
+
'div',
|
|
478
|
+
{ class: 'key-row__head' },
|
|
479
|
+
el('label', { class: 'key-row__name font-mono', htmlFor: controlId, title: meta.description || '' }, keyDisplayLabel(key)),
|
|
480
|
+
control
|
|
481
|
+
),
|
|
482
|
+
meta.description ? el('p', { class: 'key-row__desc text-xs text-slate-500', lang: 'ja' }, meta.description) : null,
|
|
483
|
+
meta.effect ? el('p', { class: 'key-row__effect text-xs text-slate-400', lang: 'ja' }, meta.effect) : null
|
|
484
|
+
)
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// ============================================================
|
|
488
|
+
// 保存バー / 状態バッジ update (render の一部、再描画なしで text のみ)
|
|
489
|
+
// ============================================================
|
|
490
|
+
function updateSaveBar() {
|
|
491
|
+
const note = $('save-bar-note')
|
|
492
|
+
const saveBtn = $('btn-save')
|
|
493
|
+
const cancelBtn = $('btn-cancel')
|
|
494
|
+
const n = changedKeys().length
|
|
495
|
+
if (note) {
|
|
496
|
+
note.textContent = state.saving
|
|
497
|
+
? '保存中...'
|
|
498
|
+
: (n > 0 ? `${n} 件の変更があります` : '変更なし')
|
|
499
|
+
}
|
|
500
|
+
const disabled = state.saving || n === 0
|
|
501
|
+
if (saveBtn) {
|
|
502
|
+
saveBtn.disabled = disabled
|
|
503
|
+
saveBtn.textContent = state.saving ? '保存中...' : '保存'
|
|
504
|
+
}
|
|
505
|
+
if (cancelBtn) cancelBtn.disabled = disabled
|
|
506
|
+
// M5: 変更ありのとき保存バーを視覚強調
|
|
507
|
+
const bar = $('save-bar')
|
|
508
|
+
if (bar) bar.classList.toggle('save-bar--dirty', n > 0 && !state.saving)
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function updateStateBadge() {
|
|
512
|
+
const badge = $('header-state-badge')
|
|
513
|
+
if (!badge) return
|
|
514
|
+
badge.classList.remove('state-badge--preset', 'state-badge--custom')
|
|
515
|
+
if (state.isCustom) {
|
|
516
|
+
badge.textContent = 'カスタム'
|
|
517
|
+
badge.classList.add('state-badge--custom')
|
|
518
|
+
} else if (state.selectedPreset) {
|
|
519
|
+
const p = state.presets.find((x) => x.name === state.selectedPreset)
|
|
520
|
+
badge.textContent = p ? (p.display_name_ja || p.name) : state.selectedPreset
|
|
521
|
+
badge.classList.add('state-badge--preset')
|
|
522
|
+
} else {
|
|
523
|
+
badge.textContent = '—'
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// ============================================================
|
|
528
|
+
// 右サイドバー「変更内容」render (task-78 Step 3、render target: #changes-list)
|
|
529
|
+
// baseline↔draft 差分を `<label_ja> (<key>): <old> → <new>` で live 表示。
|
|
530
|
+
// label 空は key のみ。変更 0 件は「変更なし」。textContent のみで XSS 安全。
|
|
531
|
+
// ============================================================
|
|
532
|
+
function renderChangesSidebar() {
|
|
533
|
+
const cont = $('changes-list')
|
|
534
|
+
if (!cont) return
|
|
535
|
+
clear(cont)
|
|
536
|
+
|
|
537
|
+
const keys = changedKeys()
|
|
538
|
+
if (!keys.length) {
|
|
539
|
+
cont.appendChild(el('p', { class: 'changes-empty text-xs text-slate-400', lang: 'ja' }, '変更なし'))
|
|
540
|
+
return
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
for (const key of keys.slice().sort()) {
|
|
544
|
+
const lj = labelJaOf(key)
|
|
545
|
+
const oldVal = state.baseline[key]
|
|
546
|
+
const newVal = state.draft[key]
|
|
547
|
+
const oldStr = oldVal == null || oldVal === '' ? '(空)' : String(oldVal)
|
|
548
|
+
const newStr = newVal == null || newVal === '' ? '(空)' : String(newVal)
|
|
549
|
+
cont.appendChild(
|
|
550
|
+
el(
|
|
551
|
+
'div',
|
|
552
|
+
{ class: 'changes-item', 'data-key': key },
|
|
553
|
+
// 見出し: label (key)。label 空は key のみ。
|
|
554
|
+
lj
|
|
555
|
+
? el(
|
|
556
|
+
'div',
|
|
557
|
+
{ class: 'changes-item__name', lang: 'ja' },
|
|
558
|
+
el('span', { class: 'changes-item__label' }, lj),
|
|
559
|
+
el('span', { class: 'changes-item__key font-mono text-xs text-slate-400' }, ` (${key})`)
|
|
560
|
+
)
|
|
561
|
+
: el('div', { class: 'changes-item__name font-mono' }, key),
|
|
562
|
+
// old → new
|
|
563
|
+
el(
|
|
564
|
+
'div',
|
|
565
|
+
{ class: 'changes-item__diff text-xs' },
|
|
566
|
+
el('span', { class: 'changes-item__old' }, oldStr),
|
|
567
|
+
el('span', { class: 'changes-item__arrow', 'aria-hidden': 'true' }, ' → '),
|
|
568
|
+
el('span', { class: 'changes-item__new font-semibold' }, newStr)
|
|
569
|
+
)
|
|
570
|
+
)
|
|
571
|
+
)
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// ============================================================
|
|
576
|
+
// 履歴タブ render (render target: #history-tbody)
|
|
577
|
+
// ============================================================
|
|
578
|
+
function formatHistoryTime(h) {
|
|
579
|
+
if (h.applied_at) {
|
|
580
|
+
const d = new Date(h.applied_at)
|
|
581
|
+
if (!isNaN(d.getTime())) return d.toLocaleString('ja-JP', { timeZone: 'Asia/Tokyo', hour12: false })
|
|
582
|
+
}
|
|
583
|
+
return h.timestamp
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function renderHistory() {
|
|
587
|
+
const tbody = $('history-tbody')
|
|
588
|
+
if (!tbody) return
|
|
589
|
+
clear(tbody)
|
|
590
|
+
if (!state.history.length) {
|
|
591
|
+
tbody.appendChild(el('tr', null, el('td', { class: 'py-2 text-slate-400', colspan: 6 }, '履歴なし')))
|
|
592
|
+
return
|
|
593
|
+
}
|
|
594
|
+
for (const h of state.history) {
|
|
595
|
+
const failedCount = Number(h.failed_count || 0)
|
|
596
|
+
const failedCell = failedCount > 0
|
|
597
|
+
? el('span', { class: 'text-red-700 font-semibold' }, String(failedCount))
|
|
598
|
+
: el('span', { class: 'text-slate-500' }, '0')
|
|
599
|
+
const rolledBackCount = Number(h.rolled_back_count || 0)
|
|
600
|
+
const rolledBackCell = rolledBackCount > 0
|
|
601
|
+
? el('span', { class: 'text-amber-700 font-semibold' }, String(rolledBackCount))
|
|
602
|
+
: el('span', { class: 'text-slate-500' }, '0')
|
|
603
|
+
const presetDisplay = h.preset_display_name_ja || h.preset || '<unknown>'
|
|
604
|
+
const rollbackDisabled = state.rollbackInProgress
|
|
605
|
+
const tr = el(
|
|
606
|
+
'tr',
|
|
607
|
+
{ class: 'history-row border-t border-slate-100' },
|
|
608
|
+
el('td', { class: 'py-1 pr-3 font-mono text-xs' }, formatHistoryTime(h)),
|
|
609
|
+
el('td', { class: 'py-1 pr-3 text-xs', lang: 'ja' }, presetDisplay),
|
|
610
|
+
el('td', { class: 'py-1 pr-3' }, String(h.applied_count !== undefined ? h.applied_count : '?')),
|
|
611
|
+
el('td', { class: 'py-1 pr-3' }, failedCell),
|
|
612
|
+
el('td', { class: 'py-1 pr-3' }, rolledBackCell),
|
|
613
|
+
el(
|
|
614
|
+
'td',
|
|
615
|
+
{ class: 'py-1 pr-3' },
|
|
616
|
+
el(
|
|
617
|
+
'button',
|
|
618
|
+
{
|
|
619
|
+
type: 'button',
|
|
620
|
+
class: `text-xs px-3 py-1.5 bg-amber-100 hover:bg-amber-200 text-amber-900 rounded border border-amber-400 min-h-[32px] ${rollbackDisabled ? 'opacity-60 cursor-not-allowed' : ''}`,
|
|
621
|
+
onclick: () => onRollback(h.timestamp, presetDisplay, h.applied_count),
|
|
622
|
+
disabled: rollbackDisabled,
|
|
623
|
+
'aria-label': `${h.timestamp} (preset: ${presetDisplay}) をロールバック`,
|
|
624
|
+
},
|
|
625
|
+
'この時点へ戻す'
|
|
626
|
+
)
|
|
627
|
+
)
|
|
628
|
+
)
|
|
629
|
+
tbody.appendChild(tr)
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// ============================================================
|
|
634
|
+
// tab 切替 (DOM 属性 + panel hidden 切替)
|
|
635
|
+
// ============================================================
|
|
636
|
+
function applyTabUI() {
|
|
637
|
+
const isConfig = state.tab === 'config'
|
|
638
|
+
const tabConfig = $('tab-config')
|
|
639
|
+
const tabHistory = $('tab-history')
|
|
640
|
+
const panelConfig = $('panel-config')
|
|
641
|
+
const panelHistory = $('panel-history')
|
|
642
|
+
if (tabConfig) { tabConfig.setAttribute('aria-selected', isConfig ? 'true' : 'false'); tabConfig.tabIndex = isConfig ? 0 : -1 }
|
|
643
|
+
if (tabHistory) { tabHistory.setAttribute('aria-selected', isConfig ? 'false' : 'true'); tabHistory.tabIndex = isConfig ? -1 : 0 }
|
|
644
|
+
if (panelConfig) panelConfig.classList.toggle('hidden', !isConfig)
|
|
645
|
+
if (panelHistory) panelHistory.classList.toggle('hidden', isConfig)
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function switchTab(tab) {
|
|
649
|
+
state = { ...state, tab }
|
|
650
|
+
applyTabUI()
|
|
651
|
+
if (tab === 'history') renderHistory()
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// ============================================================
|
|
655
|
+
// master render (設定タブの再描画)
|
|
656
|
+
// ============================================================
|
|
657
|
+
function render() {
|
|
658
|
+
renderPresetList()
|
|
659
|
+
renderCategoryAccordion()
|
|
660
|
+
updateSaveBar()
|
|
661
|
+
updateStateBadge()
|
|
662
|
+
renderChangesSidebar()
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// ============================================================
|
|
666
|
+
// event: accordion 開閉 (同時 1 つだけ開く)
|
|
667
|
+
// ============================================================
|
|
668
|
+
async function onToggleCategory(catName, isOpen) {
|
|
669
|
+
if (isOpen) {
|
|
670
|
+
if (state.openCategory === catName) return
|
|
671
|
+
state = { ...state, openCategory: catName }
|
|
672
|
+
// 当該 category の keys を未取得なら lazy load
|
|
673
|
+
if (!state.keysByCategory[catName]) {
|
|
674
|
+
try {
|
|
675
|
+
const keys = await loadKeys(catName)
|
|
676
|
+
const byCat = { ...state.keysByCategory, [catName]: keys }
|
|
677
|
+
const meta = { ...state.keyMeta }
|
|
678
|
+
const baseline = { ...state.baseline }
|
|
679
|
+
for (const k of keys) {
|
|
680
|
+
meta[k.key] = buildKeyMeta(k)
|
|
681
|
+
// baseline は初回 load 時のみ (編集中 draft を壊さない)
|
|
682
|
+
if (!Object.prototype.hasOwnProperty.call(baseline, k.key)) {
|
|
683
|
+
baseline[k.key] = k.current_value == null ? '' : String(k.current_value)
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
state = { ...state, keysByCategory: byCat, keyMeta: meta, baseline }
|
|
687
|
+
} catch (e) {
|
|
688
|
+
toast(`設定値の取得に失敗: ${e.message}`, 'error')
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
// 他 category を閉じるため再描画
|
|
692
|
+
render()
|
|
693
|
+
} else {
|
|
694
|
+
// close: state も閉に同期 (再描画はしない、details の DOM 状態に追従)
|
|
695
|
+
if (state.openCategory === catName) state = { ...state, openCategory: null }
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// ============================================================
|
|
700
|
+
// event: key 編集 (draft 更新 → custom 化)
|
|
701
|
+
// ============================================================
|
|
702
|
+
function onEditKey(key, value) {
|
|
703
|
+
const draft = { ...state.draft, [key]: String(value) }
|
|
704
|
+
// baseline と一致に戻ったら draft から除去 (= 変更なし扱い)
|
|
705
|
+
if (String(value) === String(state.baseline[key])) {
|
|
706
|
+
delete draft[key]
|
|
707
|
+
}
|
|
708
|
+
// 手動編集が発生したら custom (draft §3「手動編集が発生したら custom」)。
|
|
709
|
+
// 全 draft を baseline に戻して stillHasChange===false なら custom 状態も解除する
|
|
710
|
+
// (H4 fix: isCustom を true 据え置きにすると「★ カスタム」が居座る)。
|
|
711
|
+
const stillHasChange = Object.keys(draft).some((k) => String(draft[k]) !== String(state.baseline[k]))
|
|
712
|
+
state = {
|
|
713
|
+
...state,
|
|
714
|
+
draft,
|
|
715
|
+
isCustom: stillHasChange,
|
|
716
|
+
selectedPreset: stillHasChange ? null : state.selectedPreset,
|
|
717
|
+
}
|
|
718
|
+
// text input は再描画で focus を失わないよう、保存バー / バッジのみ更新 + 左ペインのみ再描画。
|
|
719
|
+
// 中央 accordion は再描画しない (input の focus 維持)。右サイドバーは別 DOM のため live 再描画可。
|
|
720
|
+
renderPresetList()
|
|
721
|
+
updateSaveBar()
|
|
722
|
+
updateStateBadge()
|
|
723
|
+
renderChangesSidebar()
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// ============================================================
|
|
727
|
+
// event: preset 選択 (diff を draft に反映、preview)
|
|
728
|
+
// ============================================================
|
|
729
|
+
async function onSelectPreset(presetName) {
|
|
730
|
+
setStatus(`プリセット ${presetName} を読み込み中...`)
|
|
731
|
+
try {
|
|
732
|
+
const diff = await loadPresetDiff(presetName)
|
|
733
|
+
const draft = { ...state.draft }
|
|
734
|
+
const baseline = { ...state.baseline }
|
|
735
|
+
const meta = { ...state.keyMeta }
|
|
736
|
+
for (const c of (diff.changes || [])) {
|
|
737
|
+
// diff.current は server 現在値 = baseline。未取得 key の baseline を補完。
|
|
738
|
+
if (c.current !== '<unknown>' && !Object.prototype.hasOwnProperty.call(baseline, c.key)) {
|
|
739
|
+
baseline[c.key] = String(c.current)
|
|
740
|
+
}
|
|
741
|
+
// preset 値を draft に反映 (preview)
|
|
742
|
+
draft[c.key] = String(c.new)
|
|
743
|
+
if (c.current !== '<unknown>' && String(c.new) === String(baseline[c.key])) {
|
|
744
|
+
delete draft[c.key] // 値が同一なら draft 不要
|
|
745
|
+
}
|
|
746
|
+
if (!meta[c.key]) {
|
|
747
|
+
meta[c.key] = { category: '', description: '', effect: c.effect || '', label_ja: '', type: inferType(c.key, c.new) }
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
state = {
|
|
751
|
+
...state,
|
|
752
|
+
draft,
|
|
753
|
+
baseline,
|
|
754
|
+
keyMeta: meta,
|
|
755
|
+
selectedPreset: presetName,
|
|
756
|
+
isCustom: false,
|
|
757
|
+
}
|
|
758
|
+
render()
|
|
759
|
+
const p = state.presets.find((x) => x.name === presetName)
|
|
760
|
+
const dn = p ? (p.display_name_ja || p.name) : presetName
|
|
761
|
+
setStatus(`プリセット「${dn}」を選択 (未保存プレビュー)`)
|
|
762
|
+
} catch (e) {
|
|
763
|
+
toast(`差分取得失敗: ${e.message}`, 'error')
|
|
764
|
+
setStatus('エラー')
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// ============================================================
|
|
769
|
+
// event: 保存 (変更のあった key だけ /api/set で loop)
|
|
770
|
+
// ============================================================
|
|
771
|
+
async function onClickSave() {
|
|
772
|
+
if (state.saving) return
|
|
773
|
+
const keys = changedKeys()
|
|
774
|
+
if (!keys.length) {
|
|
775
|
+
toast('変更がありません', 'info')
|
|
776
|
+
return
|
|
777
|
+
}
|
|
778
|
+
const confirmed = await showConfirmDialog({
|
|
779
|
+
title: '保存の確認',
|
|
780
|
+
bodyLines: [
|
|
781
|
+
`${keys.length} 件の設定値を harness-config.yml に保存します。`,
|
|
782
|
+
'各 key は atomic backup 付きで個別に更新されます。',
|
|
783
|
+
],
|
|
784
|
+
okLabel: '保存する',
|
|
785
|
+
cancelLabel: 'キャンセル',
|
|
786
|
+
danger: false,
|
|
787
|
+
})
|
|
788
|
+
if (!confirmed) return
|
|
789
|
+
|
|
790
|
+
state = { ...state, saving: true }
|
|
791
|
+
updateSaveBar()
|
|
792
|
+
setStatus('保存中...')
|
|
793
|
+
let ok = 0
|
|
794
|
+
let failed = 0
|
|
795
|
+
const newBaseline = { ...state.baseline }
|
|
796
|
+
for (const key of keys) {
|
|
797
|
+
try {
|
|
798
|
+
await setKeyApi(key, state.draft[key])
|
|
799
|
+
newBaseline[key] = String(state.draft[key])
|
|
800
|
+
ok += 1
|
|
801
|
+
} catch (e) {
|
|
802
|
+
failed += 1
|
|
803
|
+
toast(`${key} の保存に失敗: ${e.message}`, 'error')
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
// baseline を保存済値で更新、draft から保存成功分を除去
|
|
807
|
+
const newDraft = { ...state.draft }
|
|
808
|
+
for (const key of keys) {
|
|
809
|
+
if (String(newDraft[key]) === String(newBaseline[key])) delete newDraft[key]
|
|
810
|
+
}
|
|
811
|
+
state = { ...state, saving: false, baseline: newBaseline, draft: newDraft }
|
|
812
|
+
|
|
813
|
+
if (failed === 0) toast(`保存成功: ${ok} 件`, 'success')
|
|
814
|
+
else toast(`部分保存: ${ok} 成功 / ${failed} 失敗`, 'warning')
|
|
815
|
+
|
|
816
|
+
// 保存後に現在 preset を再判定 (バッジ update)
|
|
817
|
+
try {
|
|
818
|
+
const cp = await loadCurrentPreset()
|
|
819
|
+
if (cp.match_type === 'preset') {
|
|
820
|
+
state = { ...state, isCustom: false, selectedPreset: cp.name }
|
|
821
|
+
} else {
|
|
822
|
+
state = { ...state, isCustom: hasChanges() ? state.isCustom : false }
|
|
823
|
+
if (!hasChanges()) state = { ...state, isCustom: true } // 保存済だが preset 不一致 = custom
|
|
824
|
+
}
|
|
825
|
+
const newHistory = await loadHistory()
|
|
826
|
+
state = { ...state, history: newHistory }
|
|
827
|
+
} catch (e) {
|
|
828
|
+
// バッジ再判定失敗は致命的でない
|
|
829
|
+
}
|
|
830
|
+
render()
|
|
831
|
+
renderHistory()
|
|
832
|
+
setStatus('保存完了')
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// ============================================================
|
|
836
|
+
// event: 取消 (編集破棄、server から再 load)
|
|
837
|
+
// ============================================================
|
|
838
|
+
async function onClickCancel() {
|
|
839
|
+
if (state.saving) return
|
|
840
|
+
state = { ...state, draft: {}, isCustom: false }
|
|
841
|
+
// 開いている category を再 load (baseline = server 値で表示が戻る)
|
|
842
|
+
const cat = state.openCategory
|
|
843
|
+
if (cat) {
|
|
844
|
+
try {
|
|
845
|
+
const keys = await loadKeys(cat)
|
|
846
|
+
const byCat = { ...state.keysByCategory, [cat]: keys }
|
|
847
|
+
const baseline = { ...state.baseline }
|
|
848
|
+
const meta = { ...state.keyMeta }
|
|
849
|
+
for (const k of keys) {
|
|
850
|
+
baseline[k.key] = k.current_value == null ? '' : String(k.current_value)
|
|
851
|
+
meta[k.key] = buildKeyMeta(k)
|
|
852
|
+
}
|
|
853
|
+
state = { ...state, keysByCategory: byCat, baseline, keyMeta: meta }
|
|
854
|
+
} catch (e) { /* noop */ }
|
|
855
|
+
}
|
|
856
|
+
// 現在 preset 再判定
|
|
857
|
+
try {
|
|
858
|
+
const cp = await loadCurrentPreset()
|
|
859
|
+
state = { ...state, selectedPreset: cp.match_type === 'preset' ? cp.name : null, isCustom: cp.match_type !== 'preset' }
|
|
860
|
+
} catch (e) { /* noop */ }
|
|
861
|
+
render()
|
|
862
|
+
setStatus('編集を破棄しました')
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// ============================================================
|
|
866
|
+
// event: rollback (履歴タブ)
|
|
867
|
+
// ============================================================
|
|
868
|
+
async function onRollback(timestamp, presetDisplayName, appliedCount) {
|
|
869
|
+
if (state.rollbackInProgress) return
|
|
870
|
+
const confirmed = await showConfirmDialog({
|
|
871
|
+
title: 'ロールバック確認',
|
|
872
|
+
bodyLines: [
|
|
873
|
+
`履歴: ${timestamp}`,
|
|
874
|
+
`元プリセット: ${presetDisplayName}`,
|
|
875
|
+
`復元 key 数: 約 ${appliedCount !== undefined ? appliedCount : '?'} 件`,
|
|
876
|
+
'当時の適用前の値に復元します。現在値は上書きされます。',
|
|
877
|
+
],
|
|
878
|
+
okLabel: 'ロールバック実行',
|
|
879
|
+
cancelLabel: 'キャンセル',
|
|
880
|
+
danger: true,
|
|
881
|
+
})
|
|
882
|
+
if (!confirmed) return
|
|
883
|
+
|
|
884
|
+
state = { ...state, rollbackInProgress: true }
|
|
885
|
+
renderHistory()
|
|
886
|
+
setStatus('ロールバック中...')
|
|
887
|
+
try {
|
|
888
|
+
const r = await rollbackApi(timestamp)
|
|
889
|
+
if (r.ok) toast(`ロールバック成功: ${r.restored} 件復元`, 'success')
|
|
890
|
+
else toast(`部分失敗: ${r.restored} 成功 / ${r.failed} 失敗`, 'warning')
|
|
891
|
+
// 設定値 / 現在 preset / 履歴を再取得
|
|
892
|
+
await reloadAfterMutation()
|
|
893
|
+
setStatus('ロールバック完了')
|
|
894
|
+
} catch (e) {
|
|
895
|
+
toast(`ロールバック失敗: ${e.message}`, 'error')
|
|
896
|
+
setStatus('エラー')
|
|
897
|
+
} finally {
|
|
898
|
+
state = { ...state, rollbackInProgress: false }
|
|
899
|
+
renderHistory()
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// server 値が変わった後の再 load (rollback 後など)
|
|
904
|
+
async function reloadAfterMutation() {
|
|
905
|
+
// 開いている category の keys を fresh load + baseline 更新 + draft クリア
|
|
906
|
+
const cat = state.openCategory
|
|
907
|
+
const byCat = { ...state.keysByCategory }
|
|
908
|
+
const baseline = { ...state.baseline }
|
|
909
|
+
const meta = { ...state.keyMeta }
|
|
910
|
+
if (cat) {
|
|
911
|
+
try {
|
|
912
|
+
const keys = await loadKeys(cat)
|
|
913
|
+
byCat[cat] = keys
|
|
914
|
+
for (const k of keys) {
|
|
915
|
+
baseline[k.key] = k.current_value == null ? '' : String(k.current_value)
|
|
916
|
+
meta[k.key] = buildKeyMeta(k)
|
|
917
|
+
}
|
|
918
|
+
} catch (e) { /* noop */ }
|
|
919
|
+
}
|
|
920
|
+
let cp
|
|
921
|
+
try { cp = await loadCurrentPreset() } catch (e) { cp = { match_type: 'custom', name: 'custom' } }
|
|
922
|
+
let history = state.history
|
|
923
|
+
try { history = await loadHistory() } catch (e) { /* noop */ }
|
|
924
|
+
state = {
|
|
925
|
+
...state,
|
|
926
|
+
keysByCategory: byCat,
|
|
927
|
+
baseline,
|
|
928
|
+
keyMeta: meta,
|
|
929
|
+
draft: {},
|
|
930
|
+
selectedPreset: cp.match_type === 'preset' ? cp.name : null,
|
|
931
|
+
isCustom: cp.match_type !== 'preset',
|
|
932
|
+
history,
|
|
933
|
+
}
|
|
934
|
+
render()
|
|
935
|
+
renderHistory()
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// ============================================================
|
|
939
|
+
// Tailwind CDN detection (task-61 から継承)
|
|
940
|
+
// ============================================================
|
|
941
|
+
function detectTailwind() {
|
|
942
|
+
const warningEl = $('cdn-warning')
|
|
943
|
+
if (!warningEl) return
|
|
944
|
+
const cdnLoaded = () => typeof window.tailwind !== 'undefined'
|
|
945
|
+
const hideWarning = () => warningEl.classList.add('hidden')
|
|
946
|
+
const showWarning = () => warningEl.classList.remove('hidden')
|
|
947
|
+
const scripts = document.querySelectorAll('script[src*="tailwindcss.com"]')
|
|
948
|
+
let scriptErrored = false
|
|
949
|
+
for (const s of scripts) {
|
|
950
|
+
s.addEventListener('error', () => { scriptErrored = true; showWarning() })
|
|
951
|
+
}
|
|
952
|
+
const start = Date.now()
|
|
953
|
+
const timeoutMs = 3000
|
|
954
|
+
const tick = () => {
|
|
955
|
+
if (cdnLoaded()) { hideWarning(); return }
|
|
956
|
+
if (scriptErrored) return
|
|
957
|
+
if (Date.now() - start > timeoutMs) { showWarning(); return }
|
|
958
|
+
requestAnimationFrame(tick)
|
|
959
|
+
}
|
|
960
|
+
requestAnimationFrame(tick)
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
// ============================================================
|
|
964
|
+
// 静的 DOM の event 配線 (タブ / 保存 / 取消)
|
|
965
|
+
// ============================================================
|
|
966
|
+
function wireStaticControls() {
|
|
967
|
+
const tabConfig = $('tab-config')
|
|
968
|
+
const tabHistory = $('tab-history')
|
|
969
|
+
if (tabConfig) {
|
|
970
|
+
tabConfig.addEventListener('click', () => switchTab('config'))
|
|
971
|
+
tabConfig.addEventListener('keydown', (ev) => {
|
|
972
|
+
if (ev.key === 'ArrowRight' || ev.key === 'ArrowLeft') { ev.preventDefault(); $('tab-history').focus(); switchTab('history') }
|
|
973
|
+
})
|
|
974
|
+
}
|
|
975
|
+
if (tabHistory) {
|
|
976
|
+
tabHistory.addEventListener('click', () => switchTab('history'))
|
|
977
|
+
tabHistory.addEventListener('keydown', (ev) => {
|
|
978
|
+
if (ev.key === 'ArrowRight' || ev.key === 'ArrowLeft') { ev.preventDefault(); $('tab-config').focus(); switchTab('config') }
|
|
979
|
+
})
|
|
980
|
+
}
|
|
981
|
+
const saveBtn = $('btn-save')
|
|
982
|
+
const cancelBtn = $('btn-cancel')
|
|
983
|
+
if (saveBtn) saveBtn.addEventListener('click', onClickSave)
|
|
984
|
+
if (cancelBtn) cancelBtn.addEventListener('click', onClickCancel)
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// ============================================================
|
|
988
|
+
// init
|
|
989
|
+
// ============================================================
|
|
990
|
+
async function init() {
|
|
991
|
+
setStatus('読み込み中...')
|
|
992
|
+
detectTailwind()
|
|
993
|
+
wireStaticControls()
|
|
994
|
+
applyTabUI()
|
|
995
|
+
try {
|
|
996
|
+
const [presets, categories, currentPreset, history] = await Promise.all([
|
|
997
|
+
loadPresets(),
|
|
998
|
+
loadCategories(),
|
|
999
|
+
loadCurrentPreset(),
|
|
1000
|
+
loadHistory(),
|
|
1001
|
+
])
|
|
1002
|
+
state = {
|
|
1003
|
+
...state,
|
|
1004
|
+
presets,
|
|
1005
|
+
categories,
|
|
1006
|
+
history,
|
|
1007
|
+
selectedPreset: currentPreset && currentPreset.match_type === 'preset' ? currentPreset.name : null,
|
|
1008
|
+
isCustom: !(currentPreset && currentPreset.match_type === 'preset'),
|
|
1009
|
+
// 初期は先頭 category を開く (右ペインが空白に見えないように)
|
|
1010
|
+
openCategory: categories.length ? (categories[0].name || null) : null,
|
|
1011
|
+
}
|
|
1012
|
+
// 先頭 category の keys を先読み
|
|
1013
|
+
if (state.openCategory) {
|
|
1014
|
+
try {
|
|
1015
|
+
const keys = await loadKeys(state.openCategory)
|
|
1016
|
+
const meta = {}
|
|
1017
|
+
const baseline = {}
|
|
1018
|
+
for (const k of keys) {
|
|
1019
|
+
meta[k.key] = buildKeyMeta(k)
|
|
1020
|
+
baseline[k.key] = k.current_value == null ? '' : String(k.current_value)
|
|
1021
|
+
}
|
|
1022
|
+
state = { ...state, keysByCategory: { [state.openCategory]: keys }, keyMeta: meta, baseline }
|
|
1023
|
+
} catch (e) { /* noop、accordion 開時に再試行 */ }
|
|
1024
|
+
}
|
|
1025
|
+
render()
|
|
1026
|
+
renderHistory()
|
|
1027
|
+
const cpName = currentPreset && currentPreset.match_type === 'preset'
|
|
1028
|
+
? (currentPreset.display_name_ja || currentPreset.name)
|
|
1029
|
+
: 'カスタム'
|
|
1030
|
+
setStatus(`Ready (${cpName} / ${presets.length} presets / ${categories.length} categories)`)
|
|
1031
|
+
} catch (e) {
|
|
1032
|
+
toast(`初期化失敗: ${e.message}`, 'error')
|
|
1033
|
+
setStatus('エラー (server 起動を確認してください)')
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
// expose for smoke / debugging (grep verify 用、task-76 Step 7 smoke が参照)
|
|
1038
|
+
window.__hcConfigUi = {
|
|
1039
|
+
inferType,
|
|
1040
|
+
changedKeys: () => changedKeys(),
|
|
1041
|
+
keyDisplayLabel,
|
|
1042
|
+
renderChangesSidebar,
|
|
1043
|
+
initialState,
|
|
1044
|
+
PRESET_GROUP_ORDER,
|
|
1045
|
+
ENUM_OPTIONS,
|
|
1046
|
+
getState: () => state,
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
if (document.readyState === 'loading') {
|
|
1050
|
+
document.addEventListener('DOMContentLoaded', init)
|
|
1051
|
+
} else {
|
|
1052
|
+
init()
|
|
1053
|
+
}
|
|
1054
|
+
})()
|