feat(coding): add bundled plugin package selection

This commit is contained in:
2026-08-27 15:08:28 +08:00
parent 2ab1c51a24
commit 422150d4fa
14 changed files with 2188 additions and 15 deletions

View File

@@ -0,0 +1,74 @@
# Task: Implement ML-01 package selection and bundled plugin registry
## Identity
- Task ID: 20260827-plugin-ml01-package-selection-8d3c7a21
- Mode: Feature
- Branch: codex/20260827-plugin-ml01-package-selection-8d3c7a21-plugin-ml01-package-selection
- Worktree: D:\Datas\OthersProjects\makelore-plugin-ml01-package-selection-8d3c7a21
- Base commit: 2ab1c51a2404086cbd688ac80154765d7c5d4662
- Owner: plugin_ml01_package_selection
- Status: Ready for integration
## Scope
- Implement ML-01 in the isolated MakeLore client worktree only.
- Add immutable shared plugin/tool definitions for the bundled Data Service package.
- Add exact Agent Plugins root/capability manifest parsing, fixed bundled-root resolution,
allowlist/path/reference/uniqueness validation, and unsupported component rejection.
- Add atomic project plugin selection persistence and legacy `data-service` Skill projection,
including deterministic IDs, unknown-ID preservation, idempotent state changes, managed-input
revision callbacks, and adapter deactivation callbacks.
- Move the Data Service Skill and SDK assets into the bundled plugin package without changing
their content or Skill ID; project the package Skill through the existing Skill registry.
- Add ML-01-focused manifest, project selection, and Skill display tests.
## Intent And Constraints
- Base is the exact accepted ML-00 client frontier `2ab1c51a2404086cbd688ac80154765d7c5d4662`.
- Work is isolated at this task's linked worktree; do not alter the occupied client coordinator
or any other task's files.
- Preserve the frozen P0 scope: bundled Data Service only, no policy HTTP, capability invoke,
Pi runtime/CLI, Host/Renderer, generic execution, pricing, or P1 marketplace behavior.
- Keep `shared/coding-skills.ts` limited to core Skill IDs; package-owned Skills come from the
validated package projection.
- The SDK asset test is part of this correction because the ML-01 resource move owns its target
path; update assertions only to the new package location without changing SDK behavior.
## Outcome
- Added `shared/coding-plugins.ts` with deeply immutable Data Service definitions and all ten
stable parent-only tool declarations/input schemas.
- Added `electron/coding-plugins/manifest.ts` with exact root/capability parsing, fixed bundle
roots, code-owned allowlists, path containment, unique/reference checks, destructive confirmation
checks, and unsupported MCP/hooks/executables handling.
- Added `electron/coding-plugins/project-service.ts` with atomic `.niancode/plugins.json` state,
unknown-ID retention, legacy Skill projection, deterministic output, idempotent mutations, and
lifecycle callback seams.
- Moved `data-service/SKILL.md`, `makelore-data.ts`, and `makelore-data.js` under
`resources/coding-plugins/data-service/skills/data-service/` byte-for-byte, and added the root
and capability manifests.
- Updated `electron/coding-projects/skill-registry.ts` to merge core Skills with the fixed package
Skill projection while preserving existing display/command behavior.
## Verification
- `corepack pnpm exec vitest run tests/unit/data-service-sdk-assets.test.ts tests/unit/coding-plugin-manifest.test.ts tests/unit/project-plugin-service.test.ts tests/unit/skill-display.test.ts tests/unit/pi-product-tools.test.ts --maxWorkers=1` — passed, 5 files / 45 tests.
- `corepack pnpm run typecheck` — passed.
- `corepack pnpm run lint:check` — passed with five pre-existing warnings in `src/pages/Home/index.tsx` and `src/pages/Makelore/index.tsx`, zero errors.
- Scoped ESLint for all ML-01-owned source/tests — passed.
- Git blob comparison confirmed moved Skill/SDK assets retain the exact base contents.
- `tests/unit/data-service-sdk-assets.test.ts` now verifies the canonical package Skill/asset path
under `resources/coding-plugins/data-service/skills/data-service/`; its SDK behavior assertions
pass unchanged.
## Follow-ups
- ML-02/ML-03 must consume the exported definition and ProjectPluginService callback interfaces
when wiring registry, adapter, worker materialization, and lifecycle invalidation.
- Main composition remains intentionally unwired in ML-01.
## Promotion Candidates
- None. This feature task implements the already accepted package/selection design and introduces
no canonical project-memory or decision change.