@rosetears/aili-pi 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/LICENSE +21 -0
- package/README.md +109 -0
- package/THIRD_PARTY_NOTICES.md +64 -0
- package/extensions/index.ts +6 -0
- package/install.sh +5 -0
- package/manifests/adapter-evidence.json +45 -0
- package/manifests/capabilities.json +124 -0
- package/manifests/live-verification.json +26 -0
- package/manifests/provenance.json +71 -0
- package/manifests/roles.json +474 -0
- package/manifests/sbom.json +7797 -0
- package/manifests/skill-compatibility.json +8100 -0
- package/manifests/subagent-provenance.json +37 -0
- package/package.json +91 -0
- package/prompts/build.md +8 -0
- package/prompts/define.md +8 -0
- package/prompts/ideate.md +8 -0
- package/prompts/local-review.md +8 -0
- package/prompts/ship.md +8 -0
- package/roles/agent-evaluator.md +47 -0
- package/roles/ai-regression-scout.md +47 -0
- package/roles/browser-qa-runner.md +47 -0
- package/roles/code-reviewer.md +47 -0
- package/roles/code-scout.md +47 -0
- package/roles/convergence-reviewer.md +55 -0
- package/roles/doc-researcher.md +47 -0
- package/roles/e2e-artifact-runner.md +47 -0
- package/roles/implementer.md +47 -0
- package/roles/opensource-sanitizer.md +47 -0
- package/roles/plan-auditor.md +47 -0
- package/roles/pr-test-analyzer.md +47 -0
- package/roles/security-auditor.md +47 -0
- package/roles/silent-failure-reviewer.md +47 -0
- package/roles/spec-miner.md +47 -0
- package/roles/test-coverage-reviewer.md +47 -0
- package/roles/test-engineer.md +48 -0
- package/roles/web-performance-auditor.md +47 -0
- package/roles/web-researcher.md +47 -0
- package/scripts/apply-adapter-evidence.ts +73 -0
- package/scripts/bootstrap.sh +180 -0
- package/scripts/generate-provenance.ts +143 -0
- package/scripts/local-package-e2e.ts +51 -0
- package/scripts/sync-roles.ts +213 -0
- package/scripts/sync-skills.ts +356 -0
- package/scripts/validate-runtime.ts +11 -0
- package/skills/academic-paper-review/SKILL.md +81 -0
- package/skills/agents-md-initialization/SKILL.md +121 -0
- package/skills/agents-md-initialization/references/agents-template.md +83 -0
- package/skills/agents-md-initialization/references/agents_md.py +215 -0
- package/skills/ai-regression-scout/SKILL.md +24 -0
- package/skills/aili-delivery-flow/SKILL.md +125 -0
- package/skills/aili-delivery-flow/references/artifact-contracts.md +138 -0
- package/skills/aili-delivery-flow/references/backend-routing.md +40 -0
- package/skills/aili-delivery-flow/references/build-execution-loop.md +113 -0
- package/skills/aili-delivery-flow/references/build-goal-mode.md +3 -0
- package/skills/aili-delivery-flow/references/direct-vs-delegated-work.md +38 -0
- package/skills/aili-delivery-flow/references/implementation-packages.md +54 -0
- package/skills/aili-delivery-flow/references/lifecycle.md +127 -0
- package/skills/aili-delivery-flow/references/protocols/acceptance-test-plan.md +18 -0
- package/skills/aili-delivery-flow/references/protocols/alignment-questionnaire.md +10 -0
- package/skills/aili-delivery-flow/references/protocols/closeout-report.md +101 -0
- package/skills/aili-delivery-flow/references/protocols/compact-evidence-pack.md +46 -0
- package/skills/aili-delivery-flow/references/protocols/idea-brief.md +10 -0
- package/skills/aili-delivery-flow/references/protocols/implementation-package.md +53 -0
- package/skills/aili-delivery-flow/references/protocols/research-evidence-pack.md +19 -0
- package/skills/aili-delivery-flow/references/protocols/review-report.md +7 -0
- package/skills/aili-delivery-flow/references/protocols/spec-draft.md +12 -0
- package/skills/aili-delivery-flow/references/protocols/subagent-result.md +60 -0
- package/skills/aili-delivery-flow/references/protocols/subagent-task-packet.md +29 -0
- package/skills/aili-delivery-flow/references/protocols/worktree-context.md +109 -0
- package/skills/aili-delivery-flow/references/questionnaire-policy.md +62 -0
- package/skills/aili-delivery-flow/references/review-repair-loop.md +16 -0
- package/skills/aili-delivery-flow/references/test-document-policy.md +35 -0
- package/skills/android-native-dev/SKILL.md +722 -0
- package/skills/android-native-dev/references/accessibility.md +209 -0
- package/skills/android-native-dev/references/adaptive-screens.md +231 -0
- package/skills/android-native-dev/references/design-style-guide.md +365 -0
- package/skills/android-native-dev/references/functional-requirements.md +229 -0
- package/skills/android-native-dev/references/motion-system.md +203 -0
- package/skills/android-native-dev/references/performance-stability.md +223 -0
- package/skills/android-native-dev/references/privacy-security.md +244 -0
- package/skills/android-native-dev/references/testing.md +554 -0
- package/skills/android-native-dev/references/visual-design.md +246 -0
- package/skills/api-and-interface-design/SKILL.md +318 -0
- package/skills/browser-qa/SKILL.md +32 -0
- package/skills/browser-testing-with-devtools/SKILL.md +323 -0
- package/skills/build-failure-repair/SKILL.md +49 -0
- package/skills/chart-visualization/SKILL.md +73 -0
- package/skills/ci-cd-and-automation/SKILL.md +353 -0
- package/skills/code-review-and-quality/SKILL.md +375 -0
- package/skills/code-review-quality-gates/SKILL.md +132 -0
- package/skills/code-simplification/SKILL.md +371 -0
- package/skills/comment-accuracy-review/SKILL.md +37 -0
- package/skills/consulting-analysis/SKILL.md +69 -0
- package/skills/context-engineering/SKILL.md +375 -0
- package/skills/coverage-review/SKILL.md +24 -0
- package/skills/data-analysis/SKILL.md +74 -0
- package/skills/deprecation-and-migration/SKILL.md +222 -0
- package/skills/documentation-and-adrs/SKILL.md +330 -0
- package/skills/e2e-artifact-handling/SKILL.md +30 -0
- package/skills/evidence-scoped-retrospective/SKILL.md +156 -0
- package/skills/explain-by-allegory/SKILL.md +99 -0
- package/skills/flutter-dev/SKILL.md +162 -0
- package/skills/flutter-dev/references/animations.md +497 -0
- package/skills/flutter-dev/references/bloc-state.md +281 -0
- package/skills/flutter-dev/references/forms.md +656 -0
- package/skills/flutter-dev/references/gorouter-navigation.md +257 -0
- package/skills/flutter-dev/references/localization.md +510 -0
- package/skills/flutter-dev/references/networking.md +566 -0
- package/skills/flutter-dev/references/performance.md +305 -0
- package/skills/flutter-dev/references/platform-specific.md +417 -0
- package/skills/flutter-dev/references/project-structure.md +273 -0
- package/skills/flutter-dev/references/riverpod-state.md +232 -0
- package/skills/flutter-dev/references/testing.md +364 -0
- package/skills/flutter-dev/references/widget-patterns.md +233 -0
- package/skills/frontend-dev/SKILL.md +468 -0
- package/skills/frontend-dev/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/frontend-dev/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/frontend-dev/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/frontend-dev/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/frontend-dev/references/asset-prompt-guide.md +43 -0
- package/skills/frontend-dev/references/env-setup.md +33 -0
- package/skills/frontend-dev/references/minimax-cli-reference.md +133 -0
- package/skills/frontend-dev/references/minimax-image-guide.md +65 -0
- package/skills/frontend-dev/references/minimax-music-guide.md +216 -0
- package/skills/frontend-dev/references/minimax-tts-guide.md +78 -0
- package/skills/frontend-dev/references/minimax-video-guide.md +82 -0
- package/skills/frontend-dev/references/minimax-voice-catalog.md +685 -0
- package/skills/frontend-dev/references/motion-recipes.md +407 -0
- package/skills/frontend-dev/references/troubleshooting.md +85 -0
- package/skills/frontend-dev/scripts/minimax_image.py +137 -0
- package/skills/frontend-dev/scripts/minimax_music.py +157 -0
- package/skills/frontend-dev/scripts/minimax_tts.py +127 -0
- package/skills/frontend-dev/scripts/minimax_video.py +187 -0
- package/skills/frontend-dev/templates/generator_template.js +223 -0
- package/skills/frontend-dev/templates/viewer.html +599 -0
- package/skills/frontend-ui-engineering/SKILL.md +367 -0
- package/skills/fullstack-dev/SKILL.md +819 -0
- package/skills/fullstack-dev/references/api-design.md +444 -0
- package/skills/fullstack-dev/references/auth-flow.md +165 -0
- package/skills/fullstack-dev/references/db-schema.md +706 -0
- package/skills/fullstack-dev/references/django-best-practices.md +466 -0
- package/skills/fullstack-dev/references/environment-management.md +78 -0
- package/skills/fullstack-dev/references/release-checklist.md +278 -0
- package/skills/fullstack-dev/references/technology-selection.md +254 -0
- package/skills/fullstack-dev/references/testing-strategy.md +404 -0
- package/skills/git-workflow-and-versioning/SKILL.md +446 -0
- package/skills/github-evidence-triage/SKILL.md +115 -0
- package/skills/harness-evolution/SKILL.md +59 -0
- package/skills/harness-evolution/references/activation-matrix.md +13 -0
- package/skills/harness-evolution/references/approval-policy.md +20 -0
- package/skills/harness-evolution/references/change-report-template.md +33 -0
- package/skills/harness-evolution/references/component-taxonomy.md +19 -0
- package/skills/harness-evolution/references/verdict-policy.md +13 -0
- package/skills/harness-issue-triage/SKILL.md +72 -0
- package/skills/harness-issue-triage/references/component-diagnosis.md +25 -0
- package/skills/harness-issue-triage/references/triage-report-template.md +34 -0
- package/skills/harness-optimization-audit/SKILL.md +125 -0
- package/skills/idea-refine/SKILL.md +191 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/LICENSE +21 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/NOTICE.md +9 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/idea-refine/SKILL.upstream.md +178 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/idea-refine/examples.md +238 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/idea-refine/frameworks.md +99 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/idea-refine/refinement-criteria.md +113 -0
- package/skills/idea-refine/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/idea-refine/scripts/idea-refine.upstream.sh +15 -0
- package/skills/incremental-implementation/SKILL.md +252 -0
- package/skills/ios-application-dev/SKILL.md +212 -0
- package/skills/ios-application-dev/references/accessibility.md +259 -0
- package/skills/ios-application-dev/references/graphics-animation.md +350 -0
- package/skills/ios-application-dev/references/layout-system.md +199 -0
- package/skills/ios-application-dev/references/metal-shader.md +178 -0
- package/skills/ios-application-dev/references/navigation-patterns.md +175 -0
- package/skills/ios-application-dev/references/swift-coding-standards.md +757 -0
- package/skills/ios-application-dev/references/swiftui-design-guidelines.md +1167 -0
- package/skills/ios-application-dev/references/system-integration.md +401 -0
- package/skills/ios-application-dev/references/uikit-components.md +297 -0
- package/skills/local-review-gate/SKILL.md +207 -0
- package/skills/local-review-gate/references/addyosmani-code-review-rubric.md +33 -0
- package/skills/local-review-gate/references/codex-github-compatibility.md +26 -0
- package/skills/local-review-gate/references/ecc-code-review-adaptation.md +40 -0
- package/skills/local-review-gate/references/graphify-local-review.md +33 -0
- package/skills/local-review-gate/references/orchestration-adaptation.md +51 -0
- package/skills/local-review-gate/references/review-repair-lane-adaptation.md +46 -0
- package/skills/local-review-gate/references/upstream-provenance.md +61 -0
- package/skills/mature-project-pattern-research/SKILL.md +155 -0
- package/skills/mature-project-pattern-research/references/research-rubric.md +45 -0
- package/skills/minimax-docx/LICENSE +21 -0
- package/skills/minimax-docx/SKILL.md +273 -0
- package/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
- package/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
- package/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
- package/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
- package/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
- package/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
- package/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
- package/skills/minimax-docx/references/cjk_typography.md +357 -0
- package/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
- package/skills/minimax-docx/references/comments_guide.md +191 -0
- package/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
- package/skills/minimax-docx/references/design_principles.md +819 -0
- package/skills/minimax-docx/references/openxml_element_order.md +308 -0
- package/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
- package/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
- package/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
- package/skills/minimax-docx/references/openxml_namespaces.md +82 -0
- package/skills/minimax-docx/references/openxml_units.md +72 -0
- package/skills/minimax-docx/references/scenario_a_create.md +284 -0
- package/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
- package/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
- package/skills/minimax-docx/references/track_changes_guide.md +200 -0
- package/skills/minimax-docx/references/troubleshooting.md +506 -0
- package/skills/minimax-docx/references/typography_guide.md +294 -0
- package/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
- package/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
- package/skills/minimax-docx/scripts/docx_preview.sh +37 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
- package/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
- package/skills/minimax-docx/scripts/env_check.sh +196 -0
- package/skills/minimax-docx/scripts/setup.ps1 +274 -0
- package/skills/minimax-docx/scripts/setup.sh +504 -0
- package/skills/minimax-pdf/README.md +222 -0
- package/skills/minimax-pdf/SKILL.md +218 -0
- package/skills/minimax-pdf/design/design.md +381 -0
- package/skills/minimax-pdf/scripts/cover.py +1579 -0
- package/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
- package/skills/minimax-pdf/scripts/fill_write.py +242 -0
- package/skills/minimax-pdf/scripts/make.sh +491 -0
- package/skills/minimax-pdf/scripts/merge.py +112 -0
- package/skills/minimax-pdf/scripts/palette.py +521 -0
- package/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
- package/skills/minimax-pdf/scripts/render_body.py +1052 -0
- package/skills/minimax-pdf/scripts/render_cover.js +111 -0
- package/skills/minimax-xlsx/SKILL.md +156 -0
- package/skills/minimax-xlsx/references/create.md +691 -0
- package/skills/minimax-xlsx/references/edit.md +684 -0
- package/skills/minimax-xlsx/references/fix.md +37 -0
- package/skills/minimax-xlsx/references/format.md +768 -0
- package/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
- package/skills/minimax-xlsx/references/read-analyze.md +97 -0
- package/skills/minimax-xlsx/references/validate.md +772 -0
- package/skills/minimax-xlsx/scripts/formula_check.py +422 -0
- package/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
- package/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
- package/skills/minimax-xlsx/scripts/style_audit.py +575 -0
- package/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
- package/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
- package/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
- package/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
- package/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
- package/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
- package/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
- package/skills/newsletter-generation/SKILL.md +71 -0
- package/skills/oss-release-readiness/SKILL.md +47 -0
- package/skills/parallel-subagent-dispatch/SKILL.md +58 -0
- package/skills/performance-optimization/SKILL.md +364 -0
- package/skills/planning-and-task-breakdown/SKILL.md +290 -0
- package/skills/pptx-generator/SKILL.md +275 -0
- package/skills/pptx-generator/references/design-system.md +392 -0
- package/skills/pptx-generator/references/editing.md +162 -0
- package/skills/pptx-generator/references/pitfalls.md +112 -0
- package/skills/pptx-generator/references/pptxgenjs.md +420 -0
- package/skills/pptx-generator/references/slide-types.md +413 -0
- package/skills/pr-test-analysis/SKILL.md +24 -0
- package/skills/react-native-dev/SKILL.md +180 -0
- package/skills/react-native-dev/references/animations.md +254 -0
- package/skills/react-native-dev/references/components.md +124 -0
- package/skills/react-native-dev/references/engineering.md +527 -0
- package/skills/react-native-dev/references/forms.md +300 -0
- package/skills/react-native-dev/references/native-capabilities.md +163 -0
- package/skills/react-native-dev/references/navigation.md +271 -0
- package/skills/react-native-dev/references/networking.md +346 -0
- package/skills/react-native-dev/references/performance.md +215 -0
- package/skills/react-native-dev/references/state-management.md +230 -0
- package/skills/react-native-dev/references/styling.md +117 -0
- package/skills/react-native-dev/references/testing.md +341 -0
- package/skills/requirements-grilling/SKILL.md +447 -0
- package/skills/requirements-grilling/references/ADR-FORMAT.md +46 -0
- package/skills/requirements-grilling/references/CONTEXT-FORMAT.md +41 -0
- package/skills/requirements-grilling/references/INTERVIEW-PACKET-FORMAT.md +62 -0
- package/skills/requirements-grilling/references/MIT-LICENSE-MATT-POCOCK.md +25 -0
- package/skills/requirements-grilling/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/LICENSE +21 -0
- package/skills/requirements-grilling/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/NOTICE.md +9 -0
- package/skills/requirements-grilling/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/interview-me/SKILL.upstream.md +225 -0
- package/skills/requirements-grilling/references/upstream/mattpocock-skills/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/LICENSE +21 -0
- package/skills/requirements-grilling/references/upstream/mattpocock-skills/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/NOTICE.md +12 -0
- package/skills/requirements-grilling/references/upstream/mattpocock-skills/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/batch-grill-me/SKILL.upstream.md +15 -0
- package/skills/requirements-grilling/references/upstream/mattpocock-skills/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/grill-me/SKILL.upstream.md +7 -0
- package/skills/requirements-grilling/references/upstream/mattpocock-skills/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/grilling/SKILL.upstream.md +12 -0
- package/skills/review-pipeline/SKILL.md +38 -0
- package/skills/rose-memory/SKILL.md +210 -0
- package/skills/rose-memory/references/README.md +48 -0
- package/skills/rose-memory/references/memory_cli.py +2384 -0
- package/skills/rose-memory/references/schema.sql +315 -0
- package/skills/security-and-hardening/SKILL.md +369 -0
- package/skills/session-handoff/SKILL.md +88 -0
- package/skills/session-handoff/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/LICENSE +21 -0
- package/skills/session-handoff/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/NOTICE.md +9 -0
- package/skills/session-handoff/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/productivity/handoff/SKILL.upstream.md +16 -0
- package/skills/session-handoff/scripts/session_handoff.py +764 -0
- package/skills/shader-dev/SKILL.md +316 -0
- package/skills/shader-dev/reference/ambient-occlusion.md +382 -0
- package/skills/shader-dev/reference/analytic-ray-tracing.md +651 -0
- package/skills/shader-dev/reference/anti-aliasing.md +71 -0
- package/skills/shader-dev/reference/atmospheric-scattering.md +571 -0
- package/skills/shader-dev/reference/camera-effects.md +80 -0
- package/skills/shader-dev/reference/cellular-automata.md +635 -0
- package/skills/shader-dev/reference/color-palette.md +481 -0
- package/skills/shader-dev/reference/csg-boolean-operations.md +466 -0
- package/skills/shader-dev/reference/domain-repetition.md +436 -0
- package/skills/shader-dev/reference/domain-warping.md +419 -0
- package/skills/shader-dev/reference/fluid-simulation.md +425 -0
- package/skills/shader-dev/reference/fractal-rendering.md +525 -0
- package/skills/shader-dev/reference/lighting-model.md +639 -0
- package/skills/shader-dev/reference/matrix-transform.md +535 -0
- package/skills/shader-dev/reference/multipass-buffer.md +571 -0
- package/skills/shader-dev/reference/normal-estimation.md +418 -0
- package/skills/shader-dev/reference/particle-system.md +589 -0
- package/skills/shader-dev/reference/path-tracing-gi.md +602 -0
- package/skills/shader-dev/reference/polar-uv-manipulation.md +521 -0
- package/skills/shader-dev/reference/post-processing.md +375 -0
- package/skills/shader-dev/reference/procedural-2d-pattern.md +439 -0
- package/skills/shader-dev/reference/procedural-noise.md +551 -0
- package/skills/shader-dev/reference/ray-marching.md +396 -0
- package/skills/shader-dev/reference/sdf-2d.md +724 -0
- package/skills/shader-dev/reference/sdf-3d.md +805 -0
- package/skills/shader-dev/reference/sdf-tricks.md +63 -0
- package/skills/shader-dev/reference/shadow-techniques.md +476 -0
- package/skills/shader-dev/reference/simulation-physics.md +644 -0
- package/skills/shader-dev/reference/sound-synthesis.md +578 -0
- package/skills/shader-dev/reference/terrain-rendering.md +839 -0
- package/skills/shader-dev/reference/texture-mapping-advanced.md +87 -0
- package/skills/shader-dev/reference/texture-sampling.md +553 -0
- package/skills/shader-dev/reference/volumetric-rendering.md +608 -0
- package/skills/shader-dev/reference/voronoi-cellular-noise.md +486 -0
- package/skills/shader-dev/reference/voxel-rendering.md +701 -0
- package/skills/shader-dev/reference/water-ocean.md +445 -0
- package/skills/shader-dev/reference/webgl-pitfalls.md +41 -0
- package/skills/shader-dev/techniques/ambient-occlusion.md +364 -0
- package/skills/shader-dev/techniques/analytic-ray-tracing.md +542 -0
- package/skills/shader-dev/techniques/anti-aliasing.md +124 -0
- package/skills/shader-dev/techniques/atmospheric-scattering.md +522 -0
- package/skills/shader-dev/techniques/camera-effects.md +115 -0
- package/skills/shader-dev/techniques/cellular-automata.md +531 -0
- package/skills/shader-dev/techniques/color-palette.md +380 -0
- package/skills/shader-dev/techniques/csg-boolean-operations.md +491 -0
- package/skills/shader-dev/techniques/domain-repetition.md +333 -0
- package/skills/shader-dev/techniques/domain-warping.md +414 -0
- package/skills/shader-dev/techniques/fluid-simulation.md +1175 -0
- package/skills/shader-dev/techniques/fractal-rendering.md +436 -0
- package/skills/shader-dev/techniques/lighting-model.md +527 -0
- package/skills/shader-dev/techniques/matrix-transform.md +455 -0
- package/skills/shader-dev/techniques/multipass-buffer.md +922 -0
- package/skills/shader-dev/techniques/normal-estimation.md +318 -0
- package/skills/shader-dev/techniques/particle-system.md +1203 -0
- package/skills/shader-dev/techniques/path-tracing-gi.md +623 -0
- package/skills/shader-dev/techniques/polar-uv-manipulation.md +373 -0
- package/skills/shader-dev/techniques/post-processing.md +788 -0
- package/skills/shader-dev/techniques/procedural-2d-pattern.md +346 -0
- package/skills/shader-dev/techniques/procedural-noise.md +554 -0
- package/skills/shader-dev/techniques/ray-marching.md +467 -0
- package/skills/shader-dev/techniques/sdf-2d.md +631 -0
- package/skills/shader-dev/techniques/sdf-3d.md +589 -0
- package/skills/shader-dev/techniques/sdf-tricks.md +100 -0
- package/skills/shader-dev/techniques/shadow-techniques.md +776 -0
- package/skills/shader-dev/techniques/simulation-physics.md +1542 -0
- package/skills/shader-dev/techniques/sound-synthesis.md +490 -0
- package/skills/shader-dev/techniques/terrain-rendering.md +408 -0
- package/skills/shader-dev/techniques/texture-mapping-advanced.md +121 -0
- package/skills/shader-dev/techniques/texture-sampling.md +382 -0
- package/skills/shader-dev/techniques/volumetric-rendering.md +375 -0
- package/skills/shader-dev/techniques/voronoi-cellular-noise.md +458 -0
- package/skills/shader-dev/techniques/voxel-rendering.md +985 -0
- package/skills/shader-dev/techniques/water-ocean.md +490 -0
- package/skills/shader-dev/techniques/webgl-pitfalls.md +170 -0
- package/skills/shipping-and-launch/SKILL.md +334 -0
- package/skills/silent-failure-hunting/SKILL.md +24 -0
- package/skills/source-driven-development/SKILL.md +223 -0
- package/skills/spec-driven-development/SKILL.md +235 -0
- package/skills/spec-driven-development/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/LICENSE +21 -0
- package/skills/spec-driven-development/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/NOTICE.md +9 -0
- package/skills/spec-driven-development/references/upstream/addyosmani-agent-skills/6bcfeb9dae52b11eaad23511acc165109746dbc3/spec-driven-development/SKILL.upstream.md +206 -0
- package/skills/strategy-stress-test/SKILL.md +185 -0
- package/skills/systematic-literature-review/SKILL.md +77 -0
- package/skills/test-document-generator/SKILL.md +152 -0
- package/skills/test-document-generator/references/test-document-template.md +45 -0
- package/skills/test-driven-development/SKILL.md +399 -0
- package/skills/write-skills/GLOSSARY.md +113 -0
- package/skills/write-skills/SKILL.md +133 -0
- package/skills/write-skills/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/LICENSE +21 -0
- package/skills/write-skills/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/NOTICE.md +9 -0
- package/skills/write-skills/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/productivity/writing-great-skills/GLOSSARY.md +201 -0
- package/skills/write-skills/references/upstream/mattpocock-skills/391a2701dd948f94f56a39f7533f8eea9a859c87/productivity/writing-great-skills/SKILL.upstream.md +83 -0
- package/src/runtime/child-guard.ts +70 -0
- package/src/runtime/conflicts.ts +25 -0
- package/src/runtime/contracts.ts +9 -0
- package/src/runtime/doctor.ts +134 -0
- package/src/runtime/global-resources.ts +152 -0
- package/src/runtime/index.ts +23 -0
- package/src/runtime/lifecycle.ts +19 -0
- package/src/runtime/native-integrations.ts +44 -0
- package/src/runtime/path-boundaries.ts +69 -0
- package/src/runtime/registry.ts +213 -0
- package/src/runtime/roles.ts +64 -0
- package/src/runtime/rose-context.ts +24 -0
- package/src/runtime/subagents.ts +426 -0
- package/templates/APPEND_SYSTEM.md +12 -0
- package/upstream/aili-workflows.lock.json +3226 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
PACKAGE_SOURCE='npm:@rosetears/aili-pi@latest'
|
|
5
|
+
PACKAGE_ID='npm:@rosetears/aili-pi'
|
|
6
|
+
MINIMUM_PI_VERSION='0.81.1'
|
|
7
|
+
OFFICIAL_INSTALLER_URL='https://pi.dev/install.sh'
|
|
8
|
+
UPDATE_PI=0
|
|
9
|
+
PI_STATE='existing'
|
|
10
|
+
AILI_PREEXISTING='unknown'
|
|
11
|
+
|
|
12
|
+
say() {
|
|
13
|
+
printf '%s\n' "$1"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
fail() {
|
|
17
|
+
say "AILI bootstrap: ERROR stage=$1"
|
|
18
|
+
say "pi_state=$PI_STATE"
|
|
19
|
+
say "aili_state=$AILI_PREEXISTING"
|
|
20
|
+
say 'repair=resolve-the-reported-stage-and-rerun-install.sh'
|
|
21
|
+
exit 1
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
usage() {
|
|
25
|
+
say 'Usage: install.sh [--update-pi]'
|
|
26
|
+
say ' --update-pi update official Pi before compatibility checks'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
while [ "$#" -gt 0 ]; do
|
|
30
|
+
case "$1" in
|
|
31
|
+
--update-pi) UPDATE_PI=1 ;;
|
|
32
|
+
-h|--help) usage; exit 0 ;;
|
|
33
|
+
*) say "AILI bootstrap: unsupported argument: $1"; usage; exit 2 ;;
|
|
34
|
+
esac
|
|
35
|
+
shift
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
case "$(uname -s 2>/dev/null || true)" in
|
|
39
|
+
Linux) PLATFORM='linux' ;;
|
|
40
|
+
Darwin)
|
|
41
|
+
say 'AILI bootstrap: ERROR stage=platform unsupported=macos'
|
|
42
|
+
say 'aili_state=unknown'
|
|
43
|
+
exit 1
|
|
44
|
+
;;
|
|
45
|
+
*)
|
|
46
|
+
say 'AILI bootstrap: ERROR stage=platform unsupported=native-windows-or-other'
|
|
47
|
+
say 'aili_state=unknown'
|
|
48
|
+
exit 1
|
|
49
|
+
;;
|
|
50
|
+
esac
|
|
51
|
+
ARCHITECTURE=$(uname -m 2>/dev/null || true)
|
|
52
|
+
case "$ARCHITECTURE" in
|
|
53
|
+
''|*[!A-Za-z0-9_.-]*) fail 'platform-architecture' ;;
|
|
54
|
+
esac
|
|
55
|
+
|
|
56
|
+
TEMP_DIR=''
|
|
57
|
+
cleanup() {
|
|
58
|
+
if [ -n "$TEMP_DIR" ] && [ -d "$TEMP_DIR" ]; then
|
|
59
|
+
rm -rf "$TEMP_DIR"
|
|
60
|
+
fi
|
|
61
|
+
}
|
|
62
|
+
trap cleanup EXIT HUP INT TERM
|
|
63
|
+
|
|
64
|
+
has_pi() {
|
|
65
|
+
command -v pi >/dev/null 2>&1
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
ensure_temp_dir() {
|
|
69
|
+
if [ -z "$TEMP_DIR" ]; then
|
|
70
|
+
TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/aili-pi-bootstrap.XXXXXX") || fail 'temporary-directory'
|
|
71
|
+
chmod 700 "$TEMP_DIR" || fail 'temporary-directory-permissions'
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
install_official_pi() {
|
|
76
|
+
PI_STATE='install-attempted'
|
|
77
|
+
ensure_temp_dir
|
|
78
|
+
installer="$TEMP_DIR/pi-install.sh"
|
|
79
|
+
|
|
80
|
+
command -v curl >/dev/null 2>&1 || fail 'official-installer-download-tool'
|
|
81
|
+
curl --fail --silent --show-error --location \
|
|
82
|
+
--proto '=https' --proto-redir '=https' \
|
|
83
|
+
--connect-timeout 15 --max-time 120 --max-filesize 1048576 \
|
|
84
|
+
"$OFFICIAL_INSTALLER_URL" -o "$installer" || fail 'official-installer-download'
|
|
85
|
+
chmod 600 "$installer" || fail 'official-installer-permissions'
|
|
86
|
+
sh "$installer" || fail 'official-pi-install'
|
|
87
|
+
hash -r 2>/dev/null || true
|
|
88
|
+
has_pi || fail 'official-pi-executable'
|
|
89
|
+
PI_STATE='installed'
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
version_compatible() {
|
|
93
|
+
version=$1
|
|
94
|
+
minimum=$2
|
|
95
|
+
old_ifs=$IFS
|
|
96
|
+
IFS=.
|
|
97
|
+
set -- $version
|
|
98
|
+
IFS=$old_ifs
|
|
99
|
+
[ "$#" -eq 3 ] || return 1
|
|
100
|
+
major=$1 minor=$2 patch=$3
|
|
101
|
+
case "$major$minor$patch" in *[!0-9]*) return 1 ;; esac
|
|
102
|
+
old_ifs=$IFS
|
|
103
|
+
IFS=.
|
|
104
|
+
set -- $minimum
|
|
105
|
+
IFS=$old_ifs
|
|
106
|
+
min_major=$1 min_minor=$2 min_patch=$3
|
|
107
|
+
[ "$major" -gt "$min_major" ] && return 0
|
|
108
|
+
[ "$major" -lt "$min_major" ] && return 1
|
|
109
|
+
[ "$minor" -gt "$min_minor" ] && return 0
|
|
110
|
+
[ "$minor" -lt "$min_minor" ] && return 1
|
|
111
|
+
[ "$patch" -ge "$min_patch" ]
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
preflight() {
|
|
115
|
+
raw_version=$(pi --version 2>/dev/null) || fail 'pi-version-probe'
|
|
116
|
+
case "$raw_version" in
|
|
117
|
+
*[!0-9.]*|*.*.*.*|'') fail 'pi-version-format' ;;
|
|
118
|
+
esac
|
|
119
|
+
version=$raw_version
|
|
120
|
+
version_compatible "$version" "$MINIMUM_PI_VERSION" || fail 'pi-version-incompatible'
|
|
121
|
+
|
|
122
|
+
help=$(pi --help 2>/dev/null) || fail 'pi-api-probe'
|
|
123
|
+
for required in '--extension' '--no-extensions' '--no-skills' '--no-prompt-templates' '--mode' '--no-session' '--print' '--offline' '--list-models'; do
|
|
124
|
+
printf '%s\n' "$help" | grep -E -- "^[[:space:]]*$required([,[:space:]]|$)" >/dev/null \
|
|
125
|
+
|| fail 'pi-api-incompatible'
|
|
126
|
+
done
|
|
127
|
+
|
|
128
|
+
list_output=$(pi list 2>/dev/null) || fail 'pi-package-resource-probe'
|
|
129
|
+
case "$list_output" in
|
|
130
|
+
*"$PACKAGE_ID"*|*'@rosetears/aili-pi'*) AILI_PREEXISTING='present-before-run' ;;
|
|
131
|
+
*) AILI_PREEXISTING='absent-before-run' ;;
|
|
132
|
+
esac
|
|
133
|
+
ensure_temp_dir
|
|
134
|
+
smoke_extension="$TEMP_DIR/extension-smoke.mjs"
|
|
135
|
+
cat > "$smoke_extension" <<'EOF'
|
|
136
|
+
export default function ailiBootstrapPreflight(pi) {
|
|
137
|
+
if (!pi || typeof pi.registerCommand !== "function") throw new Error("extension-api-unavailable");
|
|
138
|
+
pi.registerCommand("aili-bootstrap-preflight", {
|
|
139
|
+
description: "AILI bootstrap compatibility probe",
|
|
140
|
+
handler: async () => undefined,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
EOF
|
|
144
|
+
chmod 600 "$smoke_extension" || fail 'pi-headless-load-probe'
|
|
145
|
+
PI_OFFLINE=1 pi --offline --no-session --no-extensions --no-skills --no-prompt-templates \
|
|
146
|
+
--extension "$smoke_extension" --list-models '__aili_preflight_no_match__' >/dev/null 2>&1 \
|
|
147
|
+
|| fail 'pi-headless-load-probe'
|
|
148
|
+
OBSERVED_PI_VERSION=$version
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
say "AILI bootstrap: platform=$PLATFORM architecture=$ARCHITECTURE"
|
|
152
|
+
if ! has_pi; then
|
|
153
|
+
install_official_pi
|
|
154
|
+
elif [ "$UPDATE_PI" -eq 1 ]; then
|
|
155
|
+
PI_STATE='update-attempted-possibly-changed'
|
|
156
|
+
pi update --self >/dev/null 2>&1 || fail 'official-pi-update'
|
|
157
|
+
PI_STATE='updated'
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
preflight
|
|
161
|
+
say "AILI bootstrap: preflight=pass pi_version=$OBSERVED_PI_VERSION"
|
|
162
|
+
|
|
163
|
+
if ! pi install "$PACKAGE_SOURCE" >/dev/null 2>&1; then
|
|
164
|
+
say 'AILI bootstrap: ERROR stage=aili-package-install'
|
|
165
|
+
say "pi_state=$PI_STATE"
|
|
166
|
+
if [ "$AILI_PREEXISTING" = 'present-before-run' ]; then
|
|
167
|
+
say 'aili_state=previous-installation-may-remain'
|
|
168
|
+
else
|
|
169
|
+
say 'aili_state=possibly-partial'
|
|
170
|
+
fi
|
|
171
|
+
say "repair=pi install $PACKAGE_SOURCE"
|
|
172
|
+
say "optional_destructive_remove=pi remove $PACKAGE_ID"
|
|
173
|
+
exit 1
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
say "AILI bootstrap: success pi_state=$PI_STATE aili_state=installed"
|
|
177
|
+
say 'start=pi'
|
|
178
|
+
say "update=pi update $PACKAGE_ID"
|
|
179
|
+
say "list=pi list"
|
|
180
|
+
say "remove=pi remove $PACKAGE_ID"
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { access, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
|
|
5
|
+
const ROOT = resolve(import.meta.dirname, "..");
|
|
6
|
+
const readJson = async <T>(path: string): Promise<T> => JSON.parse(await readFile(resolve(ROOT, path), "utf8")) as T;
|
|
7
|
+
const hash = (value: string): string => createHash("sha256").update(value).digest("hex");
|
|
8
|
+
const spdxId = (value: string): string => `SPDXRef-${value.replace(/[^A-Za-z0-9.-]+/g, "-")}-${hash(value).slice(0, 10)}`;
|
|
9
|
+
|
|
10
|
+
interface ProvenanceSource {
|
|
11
|
+
name: string;
|
|
12
|
+
repository: string;
|
|
13
|
+
revision: string;
|
|
14
|
+
version: string;
|
|
15
|
+
license: string;
|
|
16
|
+
status: "adapted" | "reference-only" | "dependency";
|
|
17
|
+
sourceFiles: string[];
|
|
18
|
+
symbols: string[];
|
|
19
|
+
localChanges: string[];
|
|
20
|
+
verification: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface LockedPackage {
|
|
24
|
+
version?: string;
|
|
25
|
+
resolved?: string;
|
|
26
|
+
integrity?: string;
|
|
27
|
+
license?: string;
|
|
28
|
+
dev?: boolean;
|
|
29
|
+
optional?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function packageName(path: string): string {
|
|
33
|
+
const marker = "node_modules/";
|
|
34
|
+
const tail = path.slice(path.lastIndexOf(marker) + marker.length);
|
|
35
|
+
const parts = tail.split("/");
|
|
36
|
+
return parts[0]!.startsWith("@") ? `${parts[0]}/${parts[1]}` : parts[0]!;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function generate(): Promise<{ notices: string; sbom: object }> {
|
|
40
|
+
const provenance = await readJson<{ schemaVersion: number; sources: ProvenanceSource[] }>("manifests/provenance.json");
|
|
41
|
+
const lockText = await readFile(resolve(ROOT, "package-lock.json"), "utf8");
|
|
42
|
+
const lock = JSON.parse(lockText) as { lockfileVersion: number; packages: Record<string, LockedPackage> };
|
|
43
|
+
if (provenance.schemaVersion !== 1) throw new Error("provenance schemaVersion must be 1");
|
|
44
|
+
if (lock.lockfileVersion !== 3) throw new Error("package-lock must use lockfileVersion 3");
|
|
45
|
+
const seenSources = new Set<string>();
|
|
46
|
+
for (const source of provenance.sources) {
|
|
47
|
+
if (!source.name || seenSources.has(source.name)) throw new Error(`duplicate or missing provenance source: ${source.name}`);
|
|
48
|
+
seenSources.add(source.name);
|
|
49
|
+
if (!/^[0-9a-f]{40}$/.test(source.revision) && !/^npm:[0-9]+\.[0-9]+\.[0-9]+$/.test(source.revision)) throw new Error(`${source.name}: exact commit or npm version required`);
|
|
50
|
+
if (!source.repository.startsWith("https://") || !source.license || source.verification.length === 0) throw new Error(`${source.name}: incomplete source identity`);
|
|
51
|
+
if (source.status === "adapted" && (source.sourceFiles.length === 0 || source.symbols.length === 0 || source.localChanges.length === 0)) throw new Error(`${source.name}: adapted source detail is incomplete`);
|
|
52
|
+
if (source.status === "reference-only" && (source.sourceFiles.length > 0 || source.symbols.length > 0 || source.localChanges.length > 0)) throw new Error(`${source.name}: reference-only source must not claim reused code`);
|
|
53
|
+
if (source.status === "dependency" && (source.sourceFiles.length === 0 || source.symbols.length === 0 || source.localChanges.length === 0)) throw new Error(`${source.name}: dependency source detail is incomplete`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const packages = Object.entries(lock.packages)
|
|
57
|
+
.filter(([path, value]) => path !== "" && path.includes("node_modules/") && value.version)
|
|
58
|
+
.map(([path, value]) => ({
|
|
59
|
+
SPDXID: spdxId(path),
|
|
60
|
+
name: packageName(path),
|
|
61
|
+
versionInfo: value.version!,
|
|
62
|
+
downloadLocation: value.resolved ?? "NOASSERTION",
|
|
63
|
+
filesAnalyzed: false,
|
|
64
|
+
licenseConcluded: value.license ?? "NOASSERTION",
|
|
65
|
+
licenseDeclared: value.license ?? "NOASSERTION",
|
|
66
|
+
checksums: value.integrity ? [{ algorithm: "SHA512", checksumValue: value.integrity.replace(/^sha512-/, "") }] : [],
|
|
67
|
+
primaryPackagePurpose: "LIBRARY",
|
|
68
|
+
comment: `npm lock path=${path}; development=${Boolean(value.dev)}; optional=${Boolean(value.optional)}`,
|
|
69
|
+
}))
|
|
70
|
+
.sort((a, b) => a.SPDXID.localeCompare(b.SPDXID));
|
|
71
|
+
|
|
72
|
+
const sourcePackages = provenance.sources.filter((source) => source.status !== "reference-only").map((source) => ({
|
|
73
|
+
SPDXID: spdxId(`source:${source.name}`),
|
|
74
|
+
name: source.name,
|
|
75
|
+
versionInfo: source.version,
|
|
76
|
+
downloadLocation: /^[0-9a-f]{40}$/.test(source.revision) ? `${source.repository.replace(/\.git$/, "")}/commit/${source.revision}` : source.repository,
|
|
77
|
+
filesAnalyzed: false,
|
|
78
|
+
licenseConcluded: source.license,
|
|
79
|
+
licenseDeclared: source.license,
|
|
80
|
+
checksums: [],
|
|
81
|
+
primaryPackagePurpose: "SOURCE",
|
|
82
|
+
comment: `revision=${source.revision}; files=${source.sourceFiles.join(", ")}; symbols=${source.symbols.join(", ")}; local changes=${source.localChanges.join(" | ")}`,
|
|
83
|
+
}));
|
|
84
|
+
const rootId = "SPDXRef-Package-aili-pi";
|
|
85
|
+
const sbom = {
|
|
86
|
+
spdxVersion: "SPDX-2.3",
|
|
87
|
+
dataLicense: "CC0-1.0",
|
|
88
|
+
SPDXID: "SPDXRef-DOCUMENT",
|
|
89
|
+
name: "@rosetears/aili-pi-0.0.0-development",
|
|
90
|
+
documentNamespace: `https://github.com/Rosetears520/aili-pi/sbom/${hash(lockText).slice(0, 32)}`,
|
|
91
|
+
creationInfo: { creators: ["Tool: @rosetears/aili-pi scripts/generate-provenance.ts"] },
|
|
92
|
+
packages: [{ SPDXID: rootId, name: "@rosetears/aili-pi", versionInfo: "0.0.0-development", downloadLocation: "NOASSERTION", filesAnalyzed: false, licenseConcluded: "MIT", licenseDeclared: "MIT", checksums: [], primaryPackagePurpose: "APPLICATION" }, ...sourcePackages, ...packages],
|
|
93
|
+
relationships: [...sourcePackages, ...packages].map((item) => ({ spdxElementId: rootId, relationshipType: "DEPENDS_ON", relatedSpdxElement: item.SPDXID })),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const notices = [
|
|
97
|
+
"# Third-Party Notices",
|
|
98
|
+
"",
|
|
99
|
+
"This distribution is MIT-licensed. The following adapted sources and locked development/runtime dependencies retain their own license terms.",
|
|
100
|
+
"",
|
|
101
|
+
...provenance.sources.map((source) => [
|
|
102
|
+
`## ${source.name}`,
|
|
103
|
+
"",
|
|
104
|
+
`- Status: ${source.status}`,
|
|
105
|
+
`- Source: ${source.repository}`,
|
|
106
|
+
`- Revision: ${source.revision}`,
|
|
107
|
+
`- Version: ${source.version}`,
|
|
108
|
+
`- License: ${source.license}`,
|
|
109
|
+
`- Source files: ${source.sourceFiles.length ? source.sourceFiles.join(", ") : "none copied"}`,
|
|
110
|
+
`- Reused symbols/patterns: ${source.symbols.length ? source.symbols.join(", ") : "none"}`,
|
|
111
|
+
`- Local changes: ${source.localChanges.length ? source.localChanges.join("; ") : "none"}`,
|
|
112
|
+
"",
|
|
113
|
+
].join("\n")),
|
|
114
|
+
"## npm dependency inventory",
|
|
115
|
+
"",
|
|
116
|
+
`The exact ${packages.length}-entry package-lock inventory, versions, integrity values, dependency scope, and declared licenses is recorded in \`manifests/sbom.json\`.`,
|
|
117
|
+
"",
|
|
118
|
+
"Runtime dependencies are initialized through the single AILI Extension entry; no third-party source tree is copied into this package.",
|
|
119
|
+
"",
|
|
120
|
+
].join("\n");
|
|
121
|
+
return { notices, sbom };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function main(): Promise<void> {
|
|
125
|
+
const { notices, sbom } = await generate();
|
|
126
|
+
const expectedSbom = `${JSON.stringify(sbom, null, 2)}\n`;
|
|
127
|
+
if (process.argv.includes("--verify")) {
|
|
128
|
+
const [actualNotices, actualSbom] = await Promise.all([
|
|
129
|
+
readFile(resolve(ROOT, "THIRD_PARTY_NOTICES.md"), "utf8").catch(() => ""),
|
|
130
|
+
readFile(resolve(ROOT, "manifests/sbom.json"), "utf8").catch(() => ""),
|
|
131
|
+
]);
|
|
132
|
+
if (actualNotices !== notices || actualSbom !== expectedSbom) throw new Error("provenance artifacts are missing or drifted; run npm run generate:provenance");
|
|
133
|
+
} else {
|
|
134
|
+
await Promise.all([
|
|
135
|
+
writeFile(resolve(ROOT, "THIRD_PARTY_NOTICES.md"), notices, "utf8"),
|
|
136
|
+
writeFile(resolve(ROOT, "manifests/sbom.json"), expectedSbom, "utf8"),
|
|
137
|
+
]);
|
|
138
|
+
}
|
|
139
|
+
await Promise.all(["THIRD_PARTY_NOTICES.md", "manifests/sbom.json", "manifests/provenance.json"].map((path) => access(resolve(ROOT, path))));
|
|
140
|
+
console.log("Provenance verified: deterministic source records and SPDX SBOM");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
await main();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
2
|
+
import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
|
|
6
|
+
const execFile = promisify(execFileCallback);
|
|
7
|
+
const ROOT = resolve(import.meta.dirname, "..");
|
|
8
|
+
const requested = process.argv[2];
|
|
9
|
+
const expected = requested === "linux" ? "linux" : undefined;
|
|
10
|
+
if (!expected) throw new Error("Usage: local-package-e2e.ts linux");
|
|
11
|
+
if (process.platform !== expected) throw new Error(`native ${expected} evidence unavailable on ${process.platform}`);
|
|
12
|
+
|
|
13
|
+
const scratchParent = join(ROOT, ".tmp", "p8-local-e2e");
|
|
14
|
+
await mkdir(scratchParent, { recursive: true });
|
|
15
|
+
const scratch = await mkdtemp(join(scratchParent, `run-${expected}-`));
|
|
16
|
+
const home = join(scratch, "home");
|
|
17
|
+
const pack = join(scratch, "pack");
|
|
18
|
+
const extracted = join(scratch, "extracted");
|
|
19
|
+
await Promise.all([mkdir(home), mkdir(pack), mkdir(extracted)]);
|
|
20
|
+
const keep = join(home, "unrelated-state.txt");
|
|
21
|
+
await writeFile(keep, "preserve-me\n", { mode: 0o600 });
|
|
22
|
+
|
|
23
|
+
const run = async (command: string, args: string[], environment: NodeJS.ProcessEnv = process.env) => {
|
|
24
|
+
const result = await execFile(command, args, { cwd: ROOT, env: environment, encoding: "utf8", timeout: 60_000, maxBuffer: 1024 * 1024 });
|
|
25
|
+
return `${result.stdout}${result.stderr}`;
|
|
26
|
+
};
|
|
27
|
+
const packResult = JSON.parse(await run("npm", ["pack", "--pack-destination", pack, "--json"])) as Array<{ filename: string }>;
|
|
28
|
+
const tarball = join(pack, packResult[0]!.filename);
|
|
29
|
+
await run("tar", ["-xzf", tarball, "-C", extracted]);
|
|
30
|
+
const packageRoot = join(extracted, "package");
|
|
31
|
+
const nodeBin = dirname(process.execPath);
|
|
32
|
+
const environment: NodeJS.ProcessEnv = {
|
|
33
|
+
HOME: home,
|
|
34
|
+
PATH: `${join(ROOT, "node_modules", ".bin")}:${nodeBin}:/usr/bin:/bin`,
|
|
35
|
+
npm_config_offline: "true",
|
|
36
|
+
npm_config_cache: join(scratch, "npm-cache"),
|
|
37
|
+
};
|
|
38
|
+
const pi = join(ROOT, "node_modules", ".bin", "pi");
|
|
39
|
+
|
|
40
|
+
await run(pi, ["install", packageRoot], environment);
|
|
41
|
+
const installed = await run(pi, ["list"], environment);
|
|
42
|
+
if (!installed.includes(packageRoot)) throw new Error("Pi list did not report the installed local Package");
|
|
43
|
+
const smoke = await run(pi, ["--list-models"], environment);
|
|
44
|
+
if (smoke.includes("Failed to load extension")) throw new Error("installed Package failed Extension loading");
|
|
45
|
+
const packageJson = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf8")) as { pi?: { extensions?: string[]; prompts?: string[]; skills?: string[] } };
|
|
46
|
+
if (packageJson.pi?.extensions?.length !== 1 || packageJson.pi?.prompts?.length !== 5 || packageJson.pi?.skills?.length !== 2 || !packageJson.pi.skills.includes("./node_modules/pi-web-access/skills")) throw new Error("packed resource declarations are incomplete");
|
|
47
|
+
await run(pi, ["remove", packageRoot], environment);
|
|
48
|
+
const removed = await run(pi, ["list"], environment);
|
|
49
|
+
if (!removed.includes("No packages installed")) throw new Error("Pi Package removal did not reconcile settings");
|
|
50
|
+
if (await readFile(keep, "utf8") !== "preserve-me\n") throw new Error("unrelated disposable-home state changed");
|
|
51
|
+
console.log(`Native ${expected} local Package E2E passed; evidence retained at ${scratch}`);
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
3
|
+
import { promisify } from "node:util";
|
|
4
|
+
import { lstat, readdir, readFile, writeFile } from "node:fs/promises";
|
|
5
|
+
import { basename, join, resolve } from "node:path";
|
|
6
|
+
|
|
7
|
+
const ROOT = resolve(import.meta.dirname, "..");
|
|
8
|
+
const ROLES_DIR = join(ROOT, "roles");
|
|
9
|
+
const MANIFEST_PATH = join(ROOT, "manifests", "roles.json");
|
|
10
|
+
const SOURCE_COMMIT = "7eb35f357ad489f5841ee10dac1e44549c1bdb76";
|
|
11
|
+
const SOURCE_REPOSITORY = "https://github.com/Rosetears520/aili-workflows.git";
|
|
12
|
+
const execFile = promisify(execFileCallback);
|
|
13
|
+
|
|
14
|
+
const ROLE_NAMES = [
|
|
15
|
+
"agent-evaluator", "ai-regression-scout", "browser-qa-runner", "code-reviewer",
|
|
16
|
+
"code-scout", "convergence-reviewer", "doc-researcher", "e2e-artifact-runner",
|
|
17
|
+
"implementer", "opensource-sanitizer", "plan-auditor", "pr-test-analyzer",
|
|
18
|
+
"security-auditor", "silent-failure-reviewer", "spec-miner", "test-coverage-reviewer",
|
|
19
|
+
"test-engineer", "web-performance-auditor", "web-researcher",
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
const OPTIONAL: Record<string, string[]> = {
|
|
23
|
+
"browser-qa-runner": ["browser.qa"],
|
|
24
|
+
"e2e-artifact-runner": ["browser.qa", "artifact.store"],
|
|
25
|
+
"web-performance-auditor": ["browser.qa"],
|
|
26
|
+
"web-researcher": ["web.fetch"],
|
|
27
|
+
};
|
|
28
|
+
const KNOWN_SOURCE_PERMISSION_KEYS = new Set([
|
|
29
|
+
"apply_patch", "bash", "codegraph_codegraph_callees", "codegraph_codegraph_callers", "codegraph_codegraph_explore",
|
|
30
|
+
"codegraph_codegraph_files", "codegraph_codegraph_impact", "codegraph_codegraph_node", "codegraph_codegraph_search",
|
|
31
|
+
"codegraph_codegraph_status", "context7_query-docs", "context7_resolve-library-id", "doom_loop", "edit",
|
|
32
|
+
"external_directory", "glob", "grep", "list", "lsp", "multi_tool_use.parallel", "playwright_browser_click",
|
|
33
|
+
"playwright_browser_close", "playwright_browser_console_messages", "playwright_browser_drag", "playwright_browser_evaluate",
|
|
34
|
+
"playwright_browser_file_upload", "playwright_browser_fill_form", "playwright_browser_handle_dialog", "playwright_browser_hover",
|
|
35
|
+
"playwright_browser_navigate", "playwright_browser_navigate_back", "playwright_browser_network_requests",
|
|
36
|
+
"playwright_browser_press_key", "playwright_browser_resize", "playwright_browser_run_code", "playwright_browser_select_option",
|
|
37
|
+
"playwright_browser_snapshot", "playwright_browser_tabs", "playwright_browser_take_screenshot", "playwright_browser_type",
|
|
38
|
+
"playwright_browser_wait_for", "read", "skill", "task", "webfetch", "websearch",
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
interface RoleRecord {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
profilePath: string;
|
|
45
|
+
profileHash: string;
|
|
46
|
+
sourcePath: string;
|
|
47
|
+
sourceHash: string;
|
|
48
|
+
tools: string[];
|
|
49
|
+
capabilities: string[];
|
|
50
|
+
status: "adapted" | "optional" | "blocked";
|
|
51
|
+
compatibilityReason: string;
|
|
52
|
+
sourceFrontmatterDisposition: Record<string, string>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function hash(content: string): string {
|
|
56
|
+
return createHash("sha256").update(content).digest("hex");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function splitMarkdown(content: string): { description: string; body: string } {
|
|
60
|
+
const match = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
61
|
+
if (!match) throw new Error("source role lacks YAML frontmatter");
|
|
62
|
+
const description = match[1].match(/^description:\s*(.+)$/m)?.[1]?.trim();
|
|
63
|
+
if (!description) throw new Error("source role lacks description");
|
|
64
|
+
return { description, body: match[2].trim() };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function permissionDefault(frontmatter: string, tool: string): "allow" | "ask" | "deny" | "missing" {
|
|
68
|
+
const direct = frontmatter.match(new RegExp(`^ ${tool}:\\s*(allow|ask|deny)\\s*$`, "m"));
|
|
69
|
+
if (direct) return direct[1] as "allow" | "ask" | "deny";
|
|
70
|
+
const block = frontmatter.match(new RegExp(`^ ${tool}:\\s*\\n([\\s\\S]*?)(?=^ [a-zA-Z0-9_*.-]+:|^---$)`, "m"));
|
|
71
|
+
const wildcard = block?.[1].match(/^ ["']?\*["']?:\s*(allow|ask|deny)\s*$/m);
|
|
72
|
+
return wildcard ? wildcard[1] as "allow" | "ask" | "deny" : "missing";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function translatedPolicy(source: string): { tools: string[]; blocked: boolean; reason: string } {
|
|
76
|
+
const frontmatter = source.match(/^---\n([\s\S]*?)\n---/)?.[1];
|
|
77
|
+
if (!frontmatter) throw new Error("source role lacks frontmatter");
|
|
78
|
+
const permissionKeys = [...frontmatter.matchAll(/^ ([A-Za-z0-9_*.-]+):/gm)].map((match) => match[1]);
|
|
79
|
+
const unknown = permissionKeys.filter((key) => !KNOWN_SOURCE_PERMISSION_KEYS.has(key));
|
|
80
|
+
if (unknown.length > 0) throw new Error(`unknown source permission semantics: ${[...new Set(unknown)].join(",")}`);
|
|
81
|
+
const mappings = [["read", "read"], ["grep", "grep"], ["glob", "find"], ["list", "ls"]] as const;
|
|
82
|
+
const tools: string[] = mappings.filter(([sourceTool]) => permissionDefault(frontmatter, sourceTool) === "allow").map(([, piTool]) => piTool);
|
|
83
|
+
const edit = permissionDefault(frontmatter, "edit");
|
|
84
|
+
const bash = permissionDefault(frontmatter, "bash");
|
|
85
|
+
const editBlock = frontmatter.match(/^ edit:\s*\n([\s\S]*?)(?=^ [a-zA-Z0-9_*.-]+:|$)/m)?.[1] ?? "";
|
|
86
|
+
const bashBlock = frontmatter.match(/^ bash:\s*\n([\s\S]*?)(?=^ [a-zA-Z0-9_*.-]+:|$)/m)?.[1] ?? "";
|
|
87
|
+
const hasEditSemantics = edit === "allow" || edit === "ask" || /^(?: .+:\s*(?:allow|ask))$/m.test(editBlock);
|
|
88
|
+
const hasBashSemantics = bash === "allow" || bash === "ask" || /^(?: .+:\s*(?:allow|ask))$/m.test(bashBlock);
|
|
89
|
+
if (hasEditSemantics) tools.push("write", "edit");
|
|
90
|
+
return {
|
|
91
|
+
tools: [...new Set(tools)],
|
|
92
|
+
blocked: false,
|
|
93
|
+
reason: hasEditSemantics
|
|
94
|
+
? `Source edit semantics are mapped to Pi write/edit under parent, role, mode, canonical-root, explicit task-boundary, credential, and headless fail-closed guards; source bash semantics are ${hasBashSemantics ? "intentionally omitted" : "not granted"}.`
|
|
95
|
+
: "Source role is safely narrowed to Pi read-only tools with application-level credential/path guards.",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function profileContent(name: string, description: string, tools: string[], body: string): string {
|
|
100
|
+
const adaptedBody = body
|
|
101
|
+
.replaceAll("OpenCode subagent", "Pi child role")
|
|
102
|
+
.replaceAll("OpenCode", "Pi")
|
|
103
|
+
.replaceAll("Task tool", "AILI task capability")
|
|
104
|
+
.replace(/## Output\n[\s\S]*?(?=\n## Stop)/, "## Output\n\nReturn exactly one JSON object with keys `status`, `summary`, `evidence`, `changedFiles`, `verification`, `blockers`, `risks`, and `confidence`.");
|
|
105
|
+
return [
|
|
106
|
+
"---",
|
|
107
|
+
`name: ${name}`,
|
|
108
|
+
`description: ${description}`,
|
|
109
|
+
`tools: ${tools.join(",") || "[]"}`,
|
|
110
|
+
`aili-source-revision: ${SOURCE_COMMIT}`,
|
|
111
|
+
"---",
|
|
112
|
+
"",
|
|
113
|
+
adaptedBody,
|
|
114
|
+
"",
|
|
115
|
+
"## Pi adapter contract",
|
|
116
|
+
"",
|
|
117
|
+
"You run once in a fresh `pi --mode json --no-session` child. Recursive AILI task dispatch is unavailable.",
|
|
118
|
+
"Use only the tools exposed by the Pi process. The task packet and parent policy may narrow this profile and never broaden it.",
|
|
119
|
+
"Return exactly one JSON object with keys `status`, `summary`, `evidence`, `changedFiles`, `verification`, `blockers`, `risks`, and `confidence`.",
|
|
120
|
+
"Do not include credentials, raw environment variables, authentication-store content, or unbounded command output.",
|
|
121
|
+
"",
|
|
122
|
+
].join("\n");
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function generate(sourceRoot: string): Promise<void> {
|
|
126
|
+
const git = async (...args: string[]) => (await execFile("git", args, { cwd: sourceRoot, encoding: "utf8" })).stdout.trim();
|
|
127
|
+
const [commit, origin, status] = await Promise.all([
|
|
128
|
+
git("rev-parse", "HEAD"),
|
|
129
|
+
git("remote", "get-url", "origin"),
|
|
130
|
+
git("status", "--porcelain"),
|
|
131
|
+
]);
|
|
132
|
+
if (commit !== SOURCE_COMMIT) throw new Error(`source revision mismatch: ${commit}`);
|
|
133
|
+
if (origin !== SOURCE_REPOSITORY) throw new Error(`source origin mismatch: ${origin}`);
|
|
134
|
+
if (status !== "") throw new Error("source worktree must be clean");
|
|
135
|
+
const records: RoleRecord[] = [];
|
|
136
|
+
for (const name of ROLE_NAMES) {
|
|
137
|
+
const sourcePath = join(sourceRoot, "agents", `${name}.md`);
|
|
138
|
+
if ((await lstat(sourcePath)).isSymbolicLink()) throw new Error(`${name}: source role must not be a symlink`);
|
|
139
|
+
const source = await readFile(sourcePath, "utf8");
|
|
140
|
+
const { description, body } = splitMarkdown(source);
|
|
141
|
+
const policy = translatedPolicy(source);
|
|
142
|
+
const tools = [...policy.tools];
|
|
143
|
+
if (name === "web-researcher") tools.length = 0;
|
|
144
|
+
const capabilities = ["repo.read", ...(tools.some((tool) => tool === "write" || tool === "edit") ? ["repo.write"] : []), ...(OPTIONAL[name] ?? [])];
|
|
145
|
+
if (name === "web-researcher") capabilities.splice(0, 1);
|
|
146
|
+
const profile = profileContent(name, description, tools, body);
|
|
147
|
+
await writeFile(join(ROLES_DIR, `${name}.md`), profile, "utf8");
|
|
148
|
+
records.push({
|
|
149
|
+
name,
|
|
150
|
+
description,
|
|
151
|
+
profilePath: `roles/${name}.md`,
|
|
152
|
+
profileHash: hash(profile),
|
|
153
|
+
sourcePath: `agents/${name}.md`,
|
|
154
|
+
sourceHash: hash(source),
|
|
155
|
+
tools,
|
|
156
|
+
capabilities,
|
|
157
|
+
status: OPTIONAL[name] ? "optional" : policy.blocked ? "blocked" : "adapted",
|
|
158
|
+
compatibilityReason: OPTIONAL[name] ? `Optional capabilities are required: ${OPTIONAL[name].join(", ")}.` : policy.reason,
|
|
159
|
+
sourceFrontmatterDisposition: {
|
|
160
|
+
mode: "replaced by fresh Pi child-process execution",
|
|
161
|
+
hidden: "not interpreted by Pi",
|
|
162
|
+
permission: "translated into the explicit Pi tool/capability ceiling; source YAML is never executed",
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
await writeFile(MANIFEST_PATH, `${JSON.stringify({
|
|
167
|
+
schemaVersion: 1,
|
|
168
|
+
source: { repository: SOURCE_REPOSITORY, commit: SOURCE_COMMIT },
|
|
169
|
+
outputContract: ["status", "summary", "evidence", "changedFiles", "verification", "blockers", "risks", "confidence"],
|
|
170
|
+
records,
|
|
171
|
+
}, null, 2)}\n`, "utf8");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
async function verify(): Promise<void> {
|
|
175
|
+
const manifest = JSON.parse(await readFile(MANIFEST_PATH, "utf8")) as { schemaVersion: number; records: RoleRecord[] };
|
|
176
|
+
const errors: string[] = [];
|
|
177
|
+
if (manifest.schemaVersion !== 1) errors.push("roles manifest schemaVersion must be 1");
|
|
178
|
+
const expected = new Set(ROLE_NAMES);
|
|
179
|
+
const seen = new Set<string>();
|
|
180
|
+
for (const role of manifest.records ?? []) {
|
|
181
|
+
if (!expected.has(role.name as typeof ROLE_NAMES[number])) errors.push(`${role.name}: unexpected role`);
|
|
182
|
+
if (seen.has(role.name)) errors.push(`${role.name}: duplicate role`);
|
|
183
|
+
seen.add(role.name);
|
|
184
|
+
const content = await readFile(join(ROOT, role.profilePath), "utf8").catch(() => "");
|
|
185
|
+
if (!content) errors.push(`${role.name}: missing profile`);
|
|
186
|
+
else {
|
|
187
|
+
if (hash(content) !== role.profileHash) errors.push(`${role.name}: profile hash drift`);
|
|
188
|
+
if (content.includes("OpenCode subagent") || content.includes(".agents/skills/") || /^\s*permission:/m.test(content)) errors.push(`${role.name}: unsupported OpenCode semantics remain active`);
|
|
189
|
+
if (!content.includes("Return exactly one JSON object")) errors.push(`${role.name}: output contract missing`);
|
|
190
|
+
}
|
|
191
|
+
if (!Array.isArray(role.tools) || !Array.isArray(role.capabilities)) errors.push(`${role.name}: invalid policy arrays`);
|
|
192
|
+
if (!role.compatibilityReason) errors.push(`${role.name}: compatibility reason missing`);
|
|
193
|
+
if (role.status !== "adapted" && role.status !== "optional" && role.status !== "blocked") errors.push(`${role.name}: invalid compatibility status`);
|
|
194
|
+
}
|
|
195
|
+
for (const name of expected) if (!seen.has(name)) errors.push(`${name}: missing role`);
|
|
196
|
+
const files = (await readdir(ROLES_DIR)).filter((name) => name.endsWith(".md")).sort();
|
|
197
|
+
const expectedFiles = ROLE_NAMES.map((name) => `${name}.md`).sort();
|
|
198
|
+
if (JSON.stringify(files) !== JSON.stringify(expectedFiles)) errors.push(`role file inventory mismatch: ${files.length}/19`);
|
|
199
|
+
if (errors.length > 0) throw new Error(errors.join("\n"));
|
|
200
|
+
console.log(`Role profiles verified: ${manifest.records.length}`);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const args = process.argv.slice(2);
|
|
204
|
+
if (args.includes("--verify")) {
|
|
205
|
+
await verify();
|
|
206
|
+
} else {
|
|
207
|
+
const sourceFlag = args.indexOf("--source");
|
|
208
|
+
if (sourceFlag < 0 || !args[sourceFlag + 1]) throw new Error("Usage: sync-roles.ts --source <aili-workflows-root>");
|
|
209
|
+
const sourceRoot = resolve(args[sourceFlag + 1]);
|
|
210
|
+
if (basename(sourceRoot) === "") throw new Error("invalid source root");
|
|
211
|
+
await generate(sourceRoot);
|
|
212
|
+
await verify();
|
|
213
|
+
}
|