agentera 3.0.0-dev.1 → 3.0.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -6
- package/bundle/.agentera-npx-bundle.json +1 -1
- package/bundle/extract-corpus-parity.json +23 -0
- package/bundle/references/adapters/cursor.md +10 -9
- package/bundle/references/adapters/opencode.md +26 -26
- package/bundle/references/adapters/package-registry.yaml +0 -1
- package/bundle/references/adapters/package-surface-characterization.md +1 -2
- package/bundle/references/adapters/runtime-adapter-characterization.md +1 -1
- package/bundle/references/adapters/runtime-adapter-registry.yaml +15 -14
- package/bundle/references/adapters/runtime-feature-parity.md +2 -2
- package/bundle/references/analysis/benchmark.md +1 -1
- package/bundle/references/analysis/startup-measurement-contract.yaml +18 -18
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +4 -3
- package/bundle/references/cli/agent-ready-state-contract.yaml +26 -23
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +4 -4
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +40 -26
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +2 -30
- package/bundle/references/cli/capability-instruction-contract.yaml +98 -57
- package/bundle/references/cli/capability-instruction-structure.md +144 -0
- package/bundle/references/cli/capability-tool-classification.yaml +12 -12
- package/bundle/references/cli/coexistence-probe.yaml +13 -0
- package/bundle/references/cli/parity-expected-actual-template.md +30 -0
- package/bundle/references/cli/routing-execution-vocabulary.yaml +12 -12
- package/bundle/references/cli/routing-model.md +94 -0
- package/bundle/references/cli/single-name-protocol.yaml +42 -0
- package/bundle/references/cli/trigger-schema-enrichment.md +136 -0
- package/bundle/references/cli/update-channels.yaml +43 -7
- package/bundle/references/cli/upgrade-repair-wording.md +45 -0
- package/bundle/references/cli/v3-handoff-manifest.schema.yaml +98 -0
- package/bundle/references/cli/vocabulary-index.yaml +20 -15
- package/bundle/references/cli/vocabulary.md +339 -323
- package/bundle/references/meta/documentation-inventory.md +9 -3
- package/bundle/registry.json +14 -14
- package/bundle/skills/agentera/.claude-plugin/plugin.json +13 -13
- package/bundle/skills/agentera/SKILL.md +99 -413
- package/bundle/skills/agentera/agents/audit.toml +6 -0
- package/bundle/skills/agentera/agents/build.toml +6 -0
- package/bundle/skills/agentera/agents/design.toml +6 -0
- package/bundle/skills/agentera/agents/discuss.toml +6 -0
- package/bundle/skills/agentera/agents/document.toml +6 -0
- package/bundle/skills/agentera/agents/optimize.toml +6 -0
- package/bundle/skills/agentera/agents/orchestrate.toml +6 -0
- package/bundle/skills/agentera/agents/plan.toml +6 -0
- package/bundle/skills/agentera/agents/profile.toml +6 -0
- package/bundle/skills/agentera/agents/research.toml +6 -0
- package/bundle/skills/agentera/agents/status.toml +6 -0
- package/bundle/skills/agentera/agents/vision.toml +6 -0
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/triggers.yaml +15 -6
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/artifacts.yaml +11 -11
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/triggers.yaml +13 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/validation.yaml +4 -4
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/triggers.yaml +14 -3
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/triggers.yaml +16 -3
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/validation.yaml +36 -23
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/validation.yaml +3 -3
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/artifacts.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +2 -1
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/triggers.yaml +7 -3
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/artifacts.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/triggers.yaml +9 -3
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/artifacts.yaml +14 -11
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/triggers.yaml +12 -8
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/triggers.yaml +17 -3
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +14 -16
- package/bundle/skills/agentera/capability_schema_contract.yaml +201 -38
- package/bundle/skills/agentera/protocol.yaml +29 -29
- package/bundle/skills/agentera/references/contract.md +329 -320
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +10 -10
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +8 -7
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +20 -41
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +43 -24
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +149 -0
- package/dist/analytics/extractCorpus/cli.js.map +1 -0
- package/dist/analytics/extractCorpus/copilotSessions.js +273 -0
- package/dist/analytics/extractCorpus/copilotSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/core.js +364 -0
- package/dist/analytics/extractCorpus/core.js.map +1 -0
- package/dist/analytics/extractCorpus/corpus.js +145 -0
- package/dist/analytics/extractCorpus/corpus.js.map +1 -0
- package/dist/analytics/extractCorpus/coverageAudit.js +261 -0
- package/dist/analytics/extractCorpus/coverageAudit.js.map +1 -0
- package/dist/analytics/extractCorpus/cursorSessions.js +423 -0
- package/dist/analytics/extractCorpus/cursorSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +105 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js.map +1 -0
- package/dist/analytics/extractCorpus/filesystemSources.js +122 -0
- package/dist/analytics/extractCorpus/filesystemSources.js.map +1 -0
- package/dist/analytics/extractCorpus/index.js +12 -0
- package/dist/analytics/extractCorpus/index.js.map +1 -0
- package/dist/analytics/extractCorpus/jsonlSessions.js +185 -0
- package/dist/analytics/extractCorpus/jsonlSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/sqliteCaps.js +44 -0
- package/dist/analytics/extractCorpus/sqliteCaps.js.map +1 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js +368 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js.map +1 -0
- package/dist/analytics/extractCorpus.js +2 -1790
- package/dist/analytics/extractCorpus.js.map +1 -1
- package/dist/analytics/usageStats.js +42 -20
- package/dist/analytics/usageStats.js.map +1 -1
- package/dist/capabilities/audit/instructions.js +6 -0
- package/dist/capabilities/audit/instructions.js.map +1 -0
- package/dist/capabilities/build/instructions.js +6 -0
- package/dist/capabilities/build/instructions.js.map +1 -0
- package/dist/capabilities/design/instructions.js +5 -0
- package/dist/capabilities/design/instructions.js.map +1 -0
- package/dist/capabilities/discuss/instructions.js +6 -0
- package/dist/capabilities/discuss/instructions.js.map +1 -0
- package/dist/capabilities/document/instructions.js +6 -0
- package/dist/capabilities/document/instructions.js.map +1 -0
- package/dist/capabilities/index.js +38 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/optimize/instructions.js +6 -0
- package/dist/capabilities/optimize/instructions.js.map +1 -0
- package/dist/capabilities/orchestrate/instructions.js +6 -0
- package/dist/capabilities/orchestrate/instructions.js.map +1 -0
- package/dist/capabilities/plan/instructions.js +6 -0
- package/dist/capabilities/plan/instructions.js.map +1 -0
- package/dist/capabilities/profile/instructions.js +6 -0
- package/dist/capabilities/profile/instructions.js.map +1 -0
- package/dist/capabilities/research/instructions.js +6 -0
- package/dist/capabilities/research/instructions.js.map +1 -0
- package/dist/capabilities/status/instructions.js +5 -0
- package/dist/capabilities/status/instructions.js.map +1 -0
- package/dist/capabilities/vision/instructions.js +9 -0
- package/dist/capabilities/vision/instructions.js.map +1 -0
- package/dist/cli/appContext.js +16 -17
- package/dist/cli/appContext.js.map +1 -1
- package/dist/cli/capabilityContext/benchmark.js +564 -0
- package/dist/cli/capabilityContext/benchmark.js.map +1 -0
- package/dist/cli/capabilityContext/bespoke.js +36 -0
- package/dist/cli/capabilityContext/bespoke.js.map +1 -0
- package/dist/cli/capabilityContext/build.js +177 -0
- package/dist/cli/capabilityContext/build.js.map +1 -0
- package/dist/cli/capabilityContext/closeout.js +230 -0
- package/dist/cli/capabilityContext/closeout.js.map +1 -0
- package/dist/cli/capabilityContext/contract.js +188 -0
- package/dist/cli/capabilityContext/contract.js.map +1 -0
- package/dist/cli/capabilityContext/evidence.js +456 -0
- package/dist/cli/capabilityContext/evidence.js.map +1 -0
- package/dist/cli/capabilityContext/index.js +4 -0
- package/dist/cli/capabilityContext/index.js.map +1 -0
- package/dist/cli/capabilityContext/orchestration.js +107 -0
- package/dist/cli/capabilityContext/orchestration.js.map +1 -0
- package/dist/cli/capabilityContext/planState.js +271 -0
- package/dist/cli/capabilityContext/planState.js.map +1 -0
- package/dist/cli/capabilityContext/progress.js +103 -0
- package/dist/cli/capabilityContext/progress.js.map +1 -0
- package/dist/cli/capabilityContext/shared.js +94 -0
- package/dist/cli/capabilityContext/shared.js.map +1 -0
- package/dist/cli/capabilityContext/slim.js +108 -0
- package/dist/cli/capabilityContext/slim.js.map +1 -0
- package/dist/cli/capabilityContext/startup.js +213 -0
- package/dist/cli/capabilityContext/startup.js.map +1 -0
- package/dist/cli/capabilityContext/types.js +40 -0
- package/dist/cli/capabilityContext/types.js.map +1 -0
- package/dist/cli/capabilityContext.js +1 -2420
- package/dist/cli/capabilityContext.js.map +1 -1
- package/dist/cli/commands/appHome.js +23 -0
- package/dist/cli/commands/appHome.js.map +1 -0
- package/dist/cli/commands/capability.js +3 -10
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/compact.js +1 -1
- package/dist/cli/commands/compact.js.map +1 -1
- package/dist/cli/commands/doctor.js +53 -95
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/lint.js +4 -36
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/prime/bundleStatus.js +185 -0
- package/dist/cli/commands/prime/bundleStatus.js.map +1 -0
- package/dist/cli/commands/prime/collectOrientationState.js +156 -0
- package/dist/cli/commands/prime/collectOrientationState.js.map +1 -0
- package/dist/cli/commands/prime/orientationOutput.js +210 -0
- package/dist/cli/commands/prime/orientationOutput.js.map +1 -0
- package/dist/cli/commands/prime/types.js +2 -0
- package/dist/cli/commands/prime/types.js.map +1 -0
- package/dist/cli/commands/prime/v1Migration.js +39 -0
- package/dist/cli/commands/prime/v1Migration.js.map +1 -0
- package/dist/cli/commands/prime.js +11 -486
- package/dist/cli/commands/prime.js.map +1 -1
- package/dist/cli/commands/query.js +5 -2
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/commands/report.js +32 -11
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/schema.js +24 -20
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/state/decisions.js +403 -0
- package/dist/cli/commands/state/decisions.js.map +1 -0
- package/dist/cli/commands/state/docs.js +97 -0
- package/dist/cli/commands/state/docs.js.map +1 -0
- package/dist/cli/commands/state/experiments.js +68 -0
- package/dist/cli/commands/state/experiments.js.map +1 -0
- package/dist/cli/commands/state/health.js +116 -0
- package/dist/cli/commands/state/health.js.map +1 -0
- package/dist/cli/commands/state/index.js +51 -0
- package/dist/cli/commands/state/index.js.map +1 -0
- package/dist/cli/commands/state/objective.js +69 -0
- package/dist/cli/commands/state/objective.js.map +1 -0
- package/dist/cli/commands/state/plan.js +173 -0
- package/dist/cli/commands/state/plan.js.map +1 -0
- package/dist/cli/commands/state/progress.js +47 -0
- package/dist/cli/commands/state/progress.js.map +1 -0
- package/dist/cli/commands/state/shared.js +15 -0
- package/dist/cli/commands/state/shared.js.map +1 -0
- package/dist/cli/commands/state/todo.js +121 -0
- package/dist/cli/commands/state/todo.js.map +1 -0
- package/dist/cli/commands/upgrade.js +63 -1
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/upgradeVerify.js +81 -0
- package/dist/cli/commands/upgradeVerify.js.map +1 -0
- package/dist/cli/commands/validate.js +56 -96
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/verify.js +7 -1
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/contracts/bundleStatus.js +2 -0
- package/dist/cli/contracts/bundleStatus.js.map +1 -0
- package/dist/cli/contracts/orientationState.js +2 -0
- package/dist/cli/contracts/orientationState.js.map +1 -0
- package/dist/cli/dispatch/argvParser.js +33 -0
- package/dist/cli/dispatch/argvParser.js.map +1 -0
- package/dist/cli/dispatch/check.js +328 -0
- package/dist/cli/dispatch/check.js.map +1 -0
- package/dist/cli/dispatch/commands.js +27 -0
- package/dist/cli/dispatch/commands.js.map +1 -0
- package/dist/cli/dispatch/index.js +182 -0
- package/dist/cli/dispatch/index.js.map +1 -0
- package/dist/cli/dispatch/lifecycle.js +603 -0
- package/dist/cli/dispatch/lifecycle.js.map +1 -0
- package/dist/cli/dispatch/prime.js +104 -0
- package/dist/cli/dispatch/prime.js.map +1 -0
- package/dist/cli/dispatch/shared.js +64 -0
- package/dist/cli/dispatch/shared.js.map +1 -0
- package/dist/cli/dispatch/state.js +144 -0
- package/dist/cli/dispatch/state.js.map +1 -0
- package/dist/cli/dispatch.js +1 -957
- package/dist/cli/dispatch.js.map +1 -1
- package/dist/cli/errors.js +53 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/help.js +236 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/orientation/attention.js +65 -0
- package/dist/cli/orientation/attention.js.map +1 -0
- package/dist/cli/orientation/corpusCoverage.js +71 -0
- package/dist/cli/orientation/corpusCoverage.js.map +1 -0
- package/dist/cli/orientation.js +138 -84
- package/dist/cli/orientation.js.map +1 -1
- package/dist/cli/prime-blob.js +1 -1
- package/dist/cli/startupCompletenessContract.js +56 -0
- package/dist/cli/startupCompletenessContract.js.map +1 -0
- package/dist/cli/stateQuery.js +16 -2
- package/dist/cli/stateQuery.js.map +1 -1
- package/dist/cli/todoMarkdown.js +33 -0
- package/dist/cli/todoMarkdown.js.map +1 -0
- package/dist/cli/todoSeverity.js +19 -0
- package/dist/cli/todoSeverity.js.map +1 -0
- package/dist/core/envPaths.js +21 -0
- package/dist/core/envPaths.js.map +1 -0
- package/dist/core/jsonValue.js +6 -0
- package/dist/core/jsonValue.js.map +1 -0
- package/dist/core/pyjson.js +67 -2
- package/dist/core/pyjson.js.map +1 -1
- package/dist/eval/evalSkills.js +17 -12
- package/dist/eval/evalSkills.js.map +1 -1
- package/dist/eval/semanticEval.js +43 -19
- package/dist/eval/semanticEval.js.map +1 -1
- package/dist/eval/semanticFixtures.js +16 -4
- package/dist/eval/semanticFixtures.js.map +1 -1
- package/dist/hooks/common.js +8 -25
- package/dist/hooks/common.js.map +1 -1
- package/dist/hooks/compaction/apply.js +269 -0
- package/dist/hooks/compaction/apply.js.map +1 -0
- package/dist/hooks/compaction/dryRun.js +183 -0
- package/dist/hooks/compaction/dryRun.js.map +1 -0
- package/dist/hooks/compaction/index.js +23 -0
- package/dist/hooks/compaction/index.js.map +1 -0
- package/dist/hooks/compaction/parse.js +258 -0
- package/dist/hooks/compaction/parse.js.map +1 -0
- package/dist/hooks/compaction/retention.js +199 -0
- package/dist/hooks/compaction/retention.js.map +1 -0
- package/dist/hooks/compaction/status.js +241 -0
- package/dist/hooks/compaction/status.js.map +1 -0
- package/dist/hooks/compaction/types.js +6 -0
- package/dist/hooks/compaction/types.js.map +1 -0
- package/dist/hooks/cursorPreToolUse.js +1 -1
- package/dist/hooks/cursorPreToolUse.js.map +1 -1
- package/dist/hooks/cursorSessionStart.js +10 -2
- package/dist/hooks/cursorSessionStart.js.map +1 -1
- package/dist/hooks/sessionStart.js +18 -11
- package/dist/hooks/sessionStart.js.map +1 -1
- package/dist/hooks/sessionStop.js +6 -12
- package/dist/hooks/sessionStop.js.map +1 -1
- package/dist/hooks/validateArtifact/agentFacing.js +10 -0
- package/dist/hooks/validateArtifact/agentFacing.js.map +1 -0
- package/dist/hooks/validateArtifact/index.js +151 -0
- package/dist/hooks/validateArtifact/index.js.map +1 -0
- package/dist/hooks/validateArtifact/markdown.js +146 -0
- package/dist/hooks/validateArtifact/markdown.js.map +1 -0
- package/dist/hooks/validateArtifact/runtime.js +86 -0
- package/dist/hooks/validateArtifact/runtime.js.map +1 -0
- package/dist/hooks/validateArtifact/schema.js +459 -0
- package/dist/hooks/validateArtifact/schema.js.map +1 -0
- package/dist/hooks/validateArtifact/traversal.js +106 -0
- package/dist/hooks/validateArtifact/traversal.js.map +1 -0
- package/dist/hooks/validateArtifact/violations.js +105 -0
- package/dist/hooks/validateArtifact/violations.js.map +1 -0
- package/dist/migrate/v2HandoffManifest.js +451 -0
- package/dist/migrate/v2HandoffManifest.js.map +1 -0
- package/dist/registries/artifactProtocolIds.js +77 -0
- package/dist/registries/artifactProtocolIds.js.map +1 -0
- package/dist/registries/artifactRegistry.js +23 -9
- package/dist/registries/artifactRegistry.js.map +1 -1
- package/dist/registries/capabilityContract.js +156 -12
- package/dist/registries/capabilityContract.js.map +1 -1
- package/dist/registries/evaluatorHandoffContract.js +171 -0
- package/dist/registries/evaluatorHandoffContract.js.map +1 -0
- package/dist/registries/packageRegistry.js +4 -3
- package/dist/registries/packageRegistry.js.map +1 -1
- package/dist/registries/runtimeAdapterRegistry.js +5 -5
- package/dist/registries/runtimeAdapterRegistry.js.map +1 -1
- package/dist/registries/triggerLoader.js +211 -0
- package/dist/registries/triggerLoader.js.map +1 -0
- package/dist/release/releaseMetadata.js +235 -0
- package/dist/release/releaseMetadata.js.map +1 -0
- package/dist/setup/codex/agents.js +96 -0
- package/dist/setup/codex/agents.js.map +1 -0
- package/dist/setup/codex/cli.js +161 -0
- package/dist/setup/codex/cli.js.map +1 -0
- package/dist/setup/codex/configToml.js +639 -0
- package/dist/setup/codex/configToml.js.map +1 -0
- package/dist/setup/codex/constants.js +29 -0
- package/dist/setup/codex/constants.js.map +1 -0
- package/dist/setup/codex/installRoot.js +64 -0
- package/dist/setup/codex/installRoot.js.map +1 -0
- package/dist/setup/codex/state.js +270 -0
- package/dist/setup/codex/state.js.map +1 -0
- package/dist/setup/codex.js +11 -1055
- package/dist/setup/codex.js.map +1 -1
- package/dist/setup/cursor.js +6 -4
- package/dist/setup/cursor.js.map +1 -1
- package/dist/setup/cursorSurfaces.js +67 -0
- package/dist/setup/cursorSurfaces.js.map +1 -0
- package/dist/setup/doctor/core.js +296 -0
- package/dist/setup/doctor/core.js.map +1 -0
- package/dist/setup/doctor/diagnostics.js +240 -0
- package/dist/setup/doctor/diagnostics.js.map +1 -0
- package/dist/setup/doctor/opencode.js +301 -0
- package/dist/setup/doctor/opencode.js.map +1 -0
- package/dist/setup/doctor/report.js +425 -0
- package/dist/setup/doctor/report.js.map +1 -0
- package/dist/setup/doctor.js +9 -1275
- package/dist/setup/doctor.js.map +1 -1
- package/dist/setup/opencode.js +13 -0
- package/dist/setup/opencode.js.map +1 -0
- package/dist/setup/opencodeConstants.js +2 -0
- package/dist/setup/opencodeConstants.js.map +1 -0
- package/dist/setup/smokeChecks.js +111 -0
- package/dist/setup/smokeChecks.js.map +1 -0
- package/dist/state/installRoot.js +64 -24
- package/dist/state/installRoot.js.map +1 -1
- package/dist/state/startupAnalysis/benchmark.js +371 -0
- package/dist/state/startupAnalysis/benchmark.js.map +1 -0
- package/dist/state/startupAnalysis/contract.js +126 -0
- package/dist/state/startupAnalysis/contract.js.map +1 -0
- package/dist/state/startupAnalysis/helpers.js +287 -0
- package/dist/state/startupAnalysis/helpers.js.map +1 -0
- package/dist/state/startupAnalysis/index.js +7 -0
- package/dist/state/startupAnalysis/index.js.map +1 -0
- package/dist/state/startupAnalysis/metrics.js +341 -0
- package/dist/state/startupAnalysis/metrics.js.map +1 -0
- package/dist/state/startupAnalysis/records.js +199 -0
- package/dist/state/startupAnalysis/records.js.map +1 -0
- package/dist/state/startupAnalysis/report.js +112 -0
- package/dist/state/startupAnalysis/report.js.map +1 -0
- package/dist/state/startupAnalysis/threshold.js +500 -0
- package/dist/state/startupAnalysis/threshold.js.map +1 -0
- package/dist/state/startupAnalysis.js +2 -1952
- package/dist/state/startupAnalysis.js.map +1 -1
- package/dist/upgrade/appContentRefresh.js +367 -0
- package/dist/upgrade/appContentRefresh.js.map +1 -0
- package/dist/upgrade/appModel.js +11 -6
- package/dist/upgrade/appModel.js.map +1 -1
- package/dist/upgrade/atomicWriter.js +23 -0
- package/dist/upgrade/atomicWriter.js.map +1 -0
- package/dist/upgrade/bundleEvidence.js +34 -0
- package/dist/upgrade/bundleEvidence.js.map +1 -0
- package/dist/upgrade/channels.js +30 -8
- package/dist/upgrade/channels.js.map +1 -1
- package/dist/upgrade/coexistenceProbe.js +105 -0
- package/dist/upgrade/coexistenceProbe.js.map +1 -0
- package/dist/upgrade/compatibility.js +14 -16
- package/dist/upgrade/compatibility.js.map +1 -1
- package/dist/upgrade/doctor.js +187 -189
- package/dist/upgrade/doctor.js.map +1 -1
- package/dist/upgrade/doctorClassifier.js +188 -0
- package/dist/upgrade/doctorClassifier.js.map +1 -0
- package/dist/upgrade/installedHooksRetirement.js +190 -0
- package/dist/upgrade/installedHooksRetirement.js.map +1 -0
- package/dist/upgrade/legacyAgentCleanup.js +183 -0
- package/dist/upgrade/legacyAgentCleanup.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js +568 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +103 -134
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +1 -1
- package/dist/upgrade/nextMajorDoctor.js +156 -0
- package/dist/upgrade/nextMajorDoctor.js.map +1 -0
- package/dist/upgrade/npxPlatformStatus.js +23 -0
- package/dist/upgrade/npxPlatformStatus.js.map +1 -0
- package/dist/upgrade/projectIntegration.js +233 -0
- package/dist/upgrade/projectIntegration.js.map +1 -0
- package/dist/upgrade/projectIntegrationDecision.js +42 -0
- package/dist/upgrade/projectIntegrationDecision.js.map +1 -0
- package/dist/upgrade/runtimeMigration.js +340 -80
- package/dist/upgrade/runtimeMigration.js.map +1 -1
- package/dist/upgrade/upgradeCommands.js +6 -2
- package/dist/upgrade/upgradeCommands.js.map +1 -1
- package/dist/upgrade/upgradeLock.js +54 -0
- package/dist/upgrade/upgradeLock.js.map +1 -0
- package/dist/upgrade/upgradeOrchestrator.js +24 -41
- package/dist/upgrade/upgradeOrchestrator.js.map +1 -1
- package/dist/upgrade/upgradeSnapshot.js +93 -0
- package/dist/upgrade/upgradeSnapshot.js.map +1 -0
- package/dist/upgrade/v3CapabilitySurface.js +15 -0
- package/dist/upgrade/v3CapabilitySurface.js.map +1 -0
- package/dist/upgrade/versionResolution.js +12 -4
- package/dist/upgrade/versionResolution.js.map +1 -1
- package/dist/validate/appHomeContract.js +4 -4
- package/dist/validate/appHomeContract.js.map +1 -1
- package/dist/validate/capability.js +135 -14
- package/dist/validate/capability.js.map +1 -1
- package/dist/validate/crossCapability.js +1 -1
- package/dist/validate/crossCapability.js.map +1 -1
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js +93 -0
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js.map +1 -0
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js +488 -0
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js.map +1 -0
- package/dist/validate/lifecycleAdapters/shared.js +198 -0
- package/dist/validate/lifecycleAdapters/shared.js.map +1 -0
- package/dist/validate/lifecycleAdapters.js +13 -723
- package/dist/validate/lifecycleAdapters.js.map +1 -1
- package/dist/validate/selfAudit.js +62 -20
- package/dist/validate/selfAudit.js.map +1 -1
- package/dist/validate/vocabularyAuthority.js +303 -0
- package/dist/validate/vocabularyAuthority.js.map +1 -0
- package/package.json +30 -27
- package/bundle/references/v1-section-mapping.md +0 -47
- package/bundle/skills/agentera/agents/dokumentera.toml +0 -6
- package/bundle/skills/agentera/agents/hej.toml +0 -6
- package/bundle/skills/agentera/agents/inspektera.toml +0 -6
- package/bundle/skills/agentera/agents/inspirera.toml +0 -6
- package/bundle/skills/agentera/agents/optimera.toml +0 -6
- package/bundle/skills/agentera/agents/orkestrera.toml +0 -6
- package/bundle/skills/agentera/agents/planera.toml +0 -6
- package/bundle/skills/agentera/agents/profilera.toml +0 -6
- package/bundle/skills/agentera/agents/realisera.toml +0 -6
- package/bundle/skills/agentera/agents/resonera.toml +0 -6
- package/bundle/skills/agentera/agents/visionera.toml +0 -6
- package/bundle/skills/agentera/agents/visualisera.toml +0 -6
- package/bundle/skills/agentera/capabilities/dokumentera/instructions.md +0 -428
- package/bundle/skills/agentera/capabilities/hej/instructions.md +0 -331
- package/bundle/skills/agentera/capabilities/inspektera/instructions.md +0 -514
- package/bundle/skills/agentera/capabilities/inspirera/instructions.md +0 -280
- package/bundle/skills/agentera/capabilities/optimera/instructions.md +0 -437
- package/bundle/skills/agentera/capabilities/orkestrera/instructions.md +0 -433
- package/bundle/skills/agentera/capabilities/planera/instructions.md +0 -368
- package/bundle/skills/agentera/capabilities/profilera/instructions.md +0 -419
- package/bundle/skills/agentera/capabilities/realisera/instructions.md +0 -403
- package/bundle/skills/agentera/capabilities/resonera/instructions.md +0 -329
- package/bundle/skills/agentera/capabilities/visionera/instructions.md +0 -309
- package/bundle/skills/agentera/capabilities/visualisera/instructions.md +0 -400
- package/bundle/skills/hej/.claude-plugin/plugin.json +0 -6
- package/bundle/skills/hej/SKILL.md +0 -69
- package/bundle/skills/hej/agents/hej.toml +0 -11
- package/bundle/skills/hej/agents/openai.yaml +0 -8
- package/dist/cli/commands/backfill.js +0 -84
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/state.js +0 -1012
- package/dist/cli/commands/state.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.js.map +0 -1
- package/dist/hooks/compaction.js +0 -935
- package/dist/hooks/compaction.js.map +0 -1
- package/dist/hooks/validateArtifact.js +0 -933
- package/dist/hooks/validateArtifact.js.map +0 -1
- package/dist/state/progressCommit.js +0 -289
- package/dist/state/progressCommit.js.map +0 -1
- /package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{hej → status}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/exit.yaml +0 -0
|
@@ -5,10 +5,19 @@ import { isFile, pathExists, resolvePath } from "../core/paths.js";
|
|
|
5
5
|
import { resolveSourceRoot } from "../core/sourceRoot.js";
|
|
6
6
|
import { loadRegistry } from "../registries/runtimeAdapterRegistry.js";
|
|
7
7
|
import { codexCopiedHooksAreAgenteraOnly, codexPluginHooksEnabled, retireCodexCopiedHookTrust, } from "../setup/codex.js";
|
|
8
|
-
import { hasManagedMarker,
|
|
8
|
+
import { hasManagedMarker, opencodeConfigDir, } from "../setup/opencode.js";
|
|
9
|
+
import { OPENCODE_SKILL_NAMES } from "../setup/opencodeConstants.js";
|
|
9
10
|
import { resolveUpdateChannel } from "./channels.js";
|
|
11
|
+
import { writeFileAtomic } from "./atomicWriter.js";
|
|
12
|
+
import { applyInstalledHooksRetirementItems, planInstalledHooksRetirementItems, textReferencesV2InstalledHooks, } from "./installedHooksRetirement.js";
|
|
13
|
+
import { projectUsesV3CapabilityInstructionModules } from "./v3CapabilitySurface.js";
|
|
10
14
|
const PYTHON_MANAGED_PATTERNS = [
|
|
11
15
|
/hooks\/validate_artifact\.py/,
|
|
16
|
+
/hooks\/cursor_session_start\.py/,
|
|
17
|
+
/hooks\/cursor_pre_tool_use\.py/,
|
|
18
|
+
/hooks\/cursor_session_stop\.py/,
|
|
19
|
+
/hooks\/session_start\.py/,
|
|
20
|
+
/hooks\/session_stop\.py/,
|
|
12
21
|
/\buv run\b/,
|
|
13
22
|
/\buvx\b/,
|
|
14
23
|
/scripts\/agentera/,
|
|
@@ -17,8 +26,17 @@ const PYTHON_MANAGED_PATTERNS = [
|
|
|
17
26
|
/cursor_pre_tool_use\.py/,
|
|
18
27
|
/cursor_session_stop\.py/,
|
|
19
28
|
];
|
|
29
|
+
export function projectHasProjectLevelRuntimeHooks(project) {
|
|
30
|
+
const root = resolvePath(project);
|
|
31
|
+
const candidates = [
|
|
32
|
+
path.join(root, ".cursor", "hooks.json"),
|
|
33
|
+
path.join(root, ".codex", "config.toml"),
|
|
34
|
+
path.join(root, ".codex", "hooks", "codex-hooks.json"),
|
|
35
|
+
path.join(root, ".github", "hooks"),
|
|
36
|
+
];
|
|
37
|
+
return candidates.some((candidate) => isFile(candidate) || pathExists(candidate));
|
|
38
|
+
}
|
|
20
39
|
const OPENCODE_COMMAND_NAMES = ["agentera"];
|
|
21
|
-
const OPENCODE_SKILL_NAMES = ["agentera", "hej"];
|
|
22
40
|
const CURSOR_AGENT_MARKER = "<!-- agentera: managed -->";
|
|
23
41
|
export function resolveNpxHookCommands(ctx) {
|
|
24
42
|
const env = ctx.env ?? process.env;
|
|
@@ -39,16 +57,22 @@ export function resolveNpxHookCommands(ctx) {
|
|
|
39
57
|
cursorPreTool: `${cliEntrypoint} hook cursor-pre-tool-use`,
|
|
40
58
|
};
|
|
41
59
|
}
|
|
42
|
-
function textUsesPythonManagedEntrypoint(text) {
|
|
60
|
+
export function textUsesPythonManagedEntrypoint(text) {
|
|
43
61
|
if (/AGENTERA_HOME\s*=/.test(text)) {
|
|
44
62
|
return true;
|
|
45
63
|
}
|
|
46
64
|
return PYTHON_MANAGED_PATTERNS.some((pattern) => pattern.test(text));
|
|
47
65
|
}
|
|
66
|
+
const V3_NPX_ENTRYPOINT = /\bnpx\s+-y\s+agentera\b/;
|
|
67
|
+
export function textUsesV3NpmEntrypoint(text) {
|
|
68
|
+
return V3_NPX_ENTRYPOINT.test(text);
|
|
69
|
+
}
|
|
48
70
|
export function rewireRuntimeText(text, runtime, commands) {
|
|
49
71
|
let next = text;
|
|
50
72
|
next = next.replace(/uv run\s+\\?"?\$\{AGENTERA_HOME\}\/hooks\/validate_artifact\.py\\?"?/g, commands.validate);
|
|
73
|
+
next = next.replace(/uv run\s+\\?"?\$\{AGENTERA_HOME\}\/app\/hooks\/validate_artifact\.py\\?"?/g, commands.validate);
|
|
51
74
|
next = next.replace(/uv run\s+\\?"?\$\{PLUGIN_ROOT\}\/hooks\/validate_artifact\.py\\?"?/g, commands.validate);
|
|
75
|
+
next = next.replace(/uv run\s+hooks\/validate_artifact\.py/g, commands.validate);
|
|
52
76
|
if (next.includes("validate_artifact.py")) {
|
|
53
77
|
next = next.replace(/["']?[^"'\n]*hooks\/validate_artifact\.py[^"'\n]*["']?/g, `"${commands.validate}"`);
|
|
54
78
|
}
|
|
@@ -81,8 +105,8 @@ function needsChannelNpxRewire(text, cliEntrypoint) {
|
|
|
81
105
|
function pushRewireItem(items, runtime, filePath, commands) {
|
|
82
106
|
const text = fs.readFileSync(filePath, "utf8");
|
|
83
107
|
const needsBare = needsChannelNpxRewire(text, commands.cliEntrypoint);
|
|
84
|
-
if (!textUsesPythonManagedEntrypoint(text) && !needsBare) {
|
|
85
|
-
if (text
|
|
108
|
+
if (!textUsesPythonManagedEntrypoint(text) && !textReferencesV2InstalledHooks(text) && !needsBare) {
|
|
109
|
+
if (textUsesV3NpmEntrypoint(text)) {
|
|
86
110
|
items.push({
|
|
87
111
|
status: "noop",
|
|
88
112
|
action: "rewire-runtime",
|
|
@@ -91,6 +115,8 @@ function pushRewireItem(items, runtime, filePath, commands) {
|
|
|
91
115
|
message: "runtime config already references npm self-contained entrypoint",
|
|
92
116
|
});
|
|
93
117
|
}
|
|
118
|
+
// If the file has no Agentera content at all (no v2 Python, no v3 npm),
|
|
119
|
+
// it is not Agentera-managed. Do not push a blocked item — just return.
|
|
94
120
|
return;
|
|
95
121
|
}
|
|
96
122
|
const newText = rewireRuntimeText(text, runtime, commands);
|
|
@@ -122,49 +148,49 @@ function copyIfChanged(source, target) {
|
|
|
122
148
|
}
|
|
123
149
|
}
|
|
124
150
|
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
125
|
-
fs.
|
|
151
|
+
const sourceBytes = fs.readFileSync(source);
|
|
152
|
+
writeFileAtomic(target, sourceBytes);
|
|
126
153
|
return true;
|
|
127
154
|
}
|
|
128
|
-
function planCodexItems(items, home, commands, force) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
pushRewireItem(items, "codex", hooksPath, commands);
|
|
133
|
-
}
|
|
134
|
-
if (isFile(configPath)) {
|
|
135
|
-
pushRewireItem(items, "codex", configPath, commands);
|
|
136
|
-
let configText = fs.readFileSync(configPath, "utf8");
|
|
155
|
+
function planCodexItems(items, home, project, commands, force) {
|
|
156
|
+
for (const root of [project, home]) {
|
|
157
|
+
const hooksPath = path.join(root, ".codex", "hooks", "codex-hooks.json");
|
|
158
|
+
const configPath = path.join(root, ".codex", "config.toml");
|
|
137
159
|
if (isFile(hooksPath)) {
|
|
138
|
-
|
|
160
|
+
pushRewireItem(items, "codex", hooksPath, commands);
|
|
139
161
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
if (isFile(configPath)) {
|
|
163
|
+
pushRewireItem(items, "codex", configPath, commands);
|
|
164
|
+
const configText = fs.readFileSync(configPath, "utf8");
|
|
165
|
+
const pluginHooks = codexPluginHooksEnabled(configText);
|
|
166
|
+
if (pluginHooks && isFile(hooksPath)) {
|
|
167
|
+
let hooksText;
|
|
168
|
+
try {
|
|
169
|
+
hooksText = fs.readFileSync(hooksPath, "utf8");
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
hooksText = "";
|
|
173
|
+
}
|
|
174
|
+
if (codexCopiedHooksAreAgenteraOnly(hooksText)) {
|
|
175
|
+
items.push({
|
|
176
|
+
status: "pending",
|
|
177
|
+
action: "retire-hooks",
|
|
178
|
+
runtime: "codex",
|
|
179
|
+
source: hooksPath,
|
|
180
|
+
target: configPath,
|
|
181
|
+
message: "will remove Agentera-owned copied Codex hooks because plugin hooks are enabled",
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
else if (hooksText.includes("validate_artifact") || hooksText.includes("hook validate-artifact")) {
|
|
185
|
+
items.push({
|
|
186
|
+
status: force ? "pending" : "blocked",
|
|
187
|
+
action: "retire-hooks",
|
|
188
|
+
runtime: "codex",
|
|
189
|
+
source: hooksPath,
|
|
190
|
+
target: configPath,
|
|
191
|
+
message: "plugin hooks are enabled, but copied hook target needs manual review before retirement",
|
|
192
|
+
});
|
|
193
|
+
}
|
|
168
194
|
}
|
|
169
195
|
}
|
|
170
196
|
}
|
|
@@ -205,12 +231,21 @@ function planCursorItems(items, home, project, sourceRoot, commands) {
|
|
|
205
231
|
});
|
|
206
232
|
}
|
|
207
233
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
234
|
+
const skipInTreeCursorAgents = root === project && projectUsesV3CapabilityInstructionModules(project);
|
|
235
|
+
if (skipInTreeCursorAgents) {
|
|
236
|
+
items.push({
|
|
237
|
+
status: "noop",
|
|
238
|
+
action: "copy-agent",
|
|
239
|
+
runtime: "cursor",
|
|
240
|
+
target: agentsDir,
|
|
241
|
+
message: "v3 capability instruction modules present; in-tree .cursor/agents/ uses prime --context and is not overwritten",
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
else if (pathExists(agentsSource)) {
|
|
245
|
+
const CURSOR_MANAGED_AGENT = "agentera.md";
|
|
246
|
+
const src = path.join(agentsSource, CURSOR_MANAGED_AGENT);
|
|
247
|
+
if (isFile(src)) {
|
|
248
|
+
const dst = path.join(agentsDir, CURSOR_MANAGED_AGENT);
|
|
214
249
|
if (!isFile(dst)) {
|
|
215
250
|
items.push({
|
|
216
251
|
status: "pending",
|
|
@@ -218,21 +253,22 @@ function planCursorItems(items, home, project, sourceRoot, commands) {
|
|
|
218
253
|
runtime: "cursor",
|
|
219
254
|
source: src,
|
|
220
255
|
target: dst,
|
|
221
|
-
message: "will copy managed Cursor
|
|
256
|
+
message: "will copy managed Cursor Agentera agent",
|
|
222
257
|
});
|
|
223
|
-
continue;
|
|
224
258
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
259
|
+
else {
|
|
260
|
+
const dstText = fs.readFileSync(dst, "utf8");
|
|
261
|
+
const srcText = fs.readFileSync(src, "utf8");
|
|
262
|
+
if (hasCursorManagedAgentMarker(dstText) && dstText !== srcText) {
|
|
263
|
+
items.push({
|
|
264
|
+
status: "pending",
|
|
265
|
+
action: "copy-agent",
|
|
266
|
+
runtime: "cursor",
|
|
267
|
+
source: src,
|
|
268
|
+
target: dst,
|
|
269
|
+
message: "will refresh stale managed Cursor Agentera agent",
|
|
270
|
+
});
|
|
271
|
+
}
|
|
236
272
|
}
|
|
237
273
|
}
|
|
238
274
|
}
|
|
@@ -243,9 +279,12 @@ function planOpencodeItems(items, home, sourceRoot, env, commands) {
|
|
|
243
279
|
const pluginSource = path.join(sourceRoot, ".opencode", "plugins", "agentera.js");
|
|
244
280
|
const pluginTarget = path.join(configDir, "plugins", "agentera.js");
|
|
245
281
|
if (isFile(pluginSource)) {
|
|
282
|
+
const targetContent = isFile(pluginTarget) ? fs.readFileSync(pluginTarget, "utf8") : "";
|
|
283
|
+
const sourceContent = fs.readFileSync(pluginSource, "utf8");
|
|
246
284
|
const needsCopy = !isFile(pluginTarget) ||
|
|
247
|
-
|
|
248
|
-
|
|
285
|
+
(targetContent !== sourceContent &&
|
|
286
|
+
(textUsesPythonManagedEntrypoint(targetContent) ||
|
|
287
|
+
needsChannelNpxRewire(targetContent, commands.cliEntrypoint)));
|
|
249
288
|
items.push({
|
|
250
289
|
status: needsCopy ? "pending" : "noop",
|
|
251
290
|
action: "copy-plugin",
|
|
@@ -261,10 +300,9 @@ function planOpencodeItems(items, home, sourceRoot, env, commands) {
|
|
|
261
300
|
const commandsTargetDir = path.join(configDir, "commands");
|
|
262
301
|
for (const name of OPENCODE_COMMAND_NAMES) {
|
|
263
302
|
const src = path.join(commandsSourceDir, `${name}.md`);
|
|
264
|
-
const expected = opencodeCommandTemplate(name);
|
|
265
303
|
const dst = path.join(commandsTargetDir, `${name}.md`);
|
|
266
304
|
if (isFile(src)) {
|
|
267
|
-
const needsCopy = !isFile(dst) || (hasManagedMarker(fs.readFileSync(dst, "utf8")) && fs.readFileSync(dst
|
|
305
|
+
const needsCopy = !isFile(dst) || (hasManagedMarker(fs.readFileSync(dst, "utf8")) && !fs.readFileSync(src).equals(fs.readFileSync(dst)));
|
|
268
306
|
items.push({
|
|
269
307
|
status: needsCopy ? "pending" : "noop",
|
|
270
308
|
action: "copy-command",
|
|
@@ -277,12 +315,11 @@ function planOpencodeItems(items, home, sourceRoot, env, commands) {
|
|
|
277
315
|
}
|
|
278
316
|
const agentsSourceDir = path.join(sourceRoot, ".opencode", "agents");
|
|
279
317
|
const agentsTargetDir = path.join(configDir, "agents");
|
|
318
|
+
const OPENCODE_MANAGED_AGENT = "agentera.md";
|
|
280
319
|
if (pathExists(agentsSourceDir)) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const src = path.join(agentsSourceDir, entry);
|
|
285
|
-
const dst = path.join(agentsTargetDir, entry);
|
|
320
|
+
const src = path.join(agentsSourceDir, OPENCODE_MANAGED_AGENT);
|
|
321
|
+
if (isFile(src)) {
|
|
322
|
+
const dst = path.join(agentsTargetDir, OPENCODE_MANAGED_AGENT);
|
|
286
323
|
const needsCopy = !isFile(dst) || !fs.readFileSync(src).equals(fs.readFileSync(dst));
|
|
287
324
|
items.push({
|
|
288
325
|
status: needsCopy ? "pending" : "noop",
|
|
@@ -290,12 +327,16 @@ function planOpencodeItems(items, home, sourceRoot, env, commands) {
|
|
|
290
327
|
runtime: "opencode",
|
|
291
328
|
source: src,
|
|
292
329
|
target: dst,
|
|
293
|
-
message: needsCopy ? "will copy managed OpenCode
|
|
330
|
+
message: needsCopy ? "will copy managed OpenCode Agentera agent" : "OpenCode Agentera agent already current",
|
|
294
331
|
});
|
|
295
332
|
}
|
|
296
333
|
}
|
|
297
334
|
const skillsSourceRoot = path.join(sourceRoot, "skills");
|
|
298
|
-
|
|
335
|
+
// D78: ~/.agents/skills is the canonical agent-compatible root (opencode loads
|
|
336
|
+
// from both ~/.config/opencode/skills and ~/.agents/skills and requires skill
|
|
337
|
+
// names unique across locations — opencode.ai/docs/skills). Maintain the link
|
|
338
|
+
// here; the legacy ~/.config/opencode/skills entry is retired below.
|
|
339
|
+
const skillsTargetDir = path.join(home, ".agents", "skills");
|
|
299
340
|
for (const name of OPENCODE_SKILL_NAMES) {
|
|
300
341
|
const src = path.join(skillsSourceRoot, name);
|
|
301
342
|
const dst = path.join(skillsTargetDir, name);
|
|
@@ -347,6 +388,144 @@ function planOpencodeItems(items, home, sourceRoot, env, commands) {
|
|
|
347
388
|
});
|
|
348
389
|
}
|
|
349
390
|
}
|
|
391
|
+
// D78: retire the legacy opencode-specific skill symlinks now that
|
|
392
|
+
// ~/.agents/skills is canonical. The opencode doc requires skill names
|
|
393
|
+
// unique across its discovery locations; a skill present in both
|
|
394
|
+
// ~/.config/opencode/skills and ~/.agents/skills is the duplicate-name error
|
|
395
|
+
// that let a stale copy load.
|
|
396
|
+
const legacySkillsDir = path.join(configDir, "skills");
|
|
397
|
+
if (pathExists(legacySkillsDir) && fs.statSync(legacySkillsDir).isDirectory()) {
|
|
398
|
+
for (const name of OPENCODE_SKILL_NAMES) {
|
|
399
|
+
const legacy = path.join(legacySkillsDir, name);
|
|
400
|
+
let linkTarget = null;
|
|
401
|
+
try {
|
|
402
|
+
linkTarget = fs.readlinkSync(legacy);
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
linkTarget = null;
|
|
406
|
+
}
|
|
407
|
+
if (linkTarget !== null) {
|
|
408
|
+
if (linkTarget.toLowerCase().includes("agentera") || path.basename(linkTarget) === name) {
|
|
409
|
+
items.push({
|
|
410
|
+
status: "pending",
|
|
411
|
+
action: "remove-stale-skill",
|
|
412
|
+
runtime: "opencode",
|
|
413
|
+
source: legacy,
|
|
414
|
+
message: `will retire duplicate OpenCode skill symlink ${name} (agent-compatible root ~/.agents/skills is canonical; D78)`,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
items.push({
|
|
419
|
+
status: "blocked",
|
|
420
|
+
action: "remove-stale-skill",
|
|
421
|
+
runtime: "opencode",
|
|
422
|
+
source: legacy,
|
|
423
|
+
message: `legacy OpenCode skill symlink ${name} targets a non-agentera path; manual review required`,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
else if (pathExists(legacy)) {
|
|
428
|
+
try {
|
|
429
|
+
const dirEntries = fs.readdirSync(legacy);
|
|
430
|
+
if (dirEntries.length === 0) {
|
|
431
|
+
items.push({
|
|
432
|
+
status: "pending",
|
|
433
|
+
action: "remove-stale-skill",
|
|
434
|
+
runtime: "opencode",
|
|
435
|
+
source: legacy,
|
|
436
|
+
message: `will retire empty legacy OpenCode skill directory ${name} (agent-compatible root ~/.agents/skills is canonical; D78)`,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
items.push({
|
|
441
|
+
status: "blocked",
|
|
442
|
+
action: "remove-stale-skill",
|
|
443
|
+
runtime: "opencode",
|
|
444
|
+
source: legacy,
|
|
445
|
+
message: `legacy OpenCode skill path ${name} is a non-empty real directory (entries: ${dirEntries.length}); manual review required (D78 retires agentera-managed symlinks and empty dirs only)`,
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
catch {
|
|
450
|
+
items.push({
|
|
451
|
+
status: "blocked",
|
|
452
|
+
action: "remove-stale-skill",
|
|
453
|
+
runtime: "opencode",
|
|
454
|
+
source: legacy,
|
|
455
|
+
message: `legacy OpenCode skill path ${name} could not be inspected; manual review required`,
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
export function planStaleCommandCleanupItems(ctx, items) {
|
|
463
|
+
const env = ctx.env ?? process.env;
|
|
464
|
+
const home = resolvePath(ctx.home);
|
|
465
|
+
const commandsDir = path.join(opencodeConfigDir(home, env), "commands");
|
|
466
|
+
if (!pathExists(commandsDir) || !fs.statSync(commandsDir).isDirectory()) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const currentNames = new Set(OPENCODE_COMMAND_NAMES);
|
|
470
|
+
for (const entry of fs.readdirSync(commandsDir)) {
|
|
471
|
+
if (!entry.endsWith(".md")) {
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
const filePath = path.join(commandsDir, entry);
|
|
475
|
+
if (!isFile(filePath)) {
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
const body = fs.readFileSync(filePath, "utf8");
|
|
479
|
+
if (!hasManagedMarker(body)) {
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
482
|
+
const name = entry.slice(0, -3);
|
|
483
|
+
if (currentNames.has(name)) {
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
items.push({
|
|
487
|
+
status: "pending",
|
|
488
|
+
action: "remove-stale-command",
|
|
489
|
+
runtime: "opencode",
|
|
490
|
+
source: filePath,
|
|
491
|
+
message: `will remove stale managed command ${path.basename(filePath)}`,
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
export function planStaleSkillCleanupItems(ctx, items) {
|
|
496
|
+
const env = ctx.env ?? process.env;
|
|
497
|
+
const home = resolvePath(ctx.home);
|
|
498
|
+
const skillsDir = path.join(opencodeConfigDir(home, env), "skills");
|
|
499
|
+
if (!pathExists(skillsDir) || !fs.statSync(skillsDir).isDirectory()) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
const requiredNames = new Set(OPENCODE_SKILL_NAMES);
|
|
503
|
+
for (const entry of fs.readdirSync(skillsDir, { withFileTypes: true })) {
|
|
504
|
+
if (!entry.isSymbolicLink()) {
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
const linkPath = path.join(skillsDir, entry.name);
|
|
508
|
+
let linkTarget;
|
|
509
|
+
try {
|
|
510
|
+
linkTarget = fs.readlinkSync(linkPath);
|
|
511
|
+
}
|
|
512
|
+
catch {
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
if (!linkTarget.toLowerCase().includes("agentera")) {
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
if (requiredNames.has(entry.name)) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
items.push({
|
|
522
|
+
status: "pending",
|
|
523
|
+
action: "remove-stale-skill",
|
|
524
|
+
runtime: "opencode",
|
|
525
|
+
source: linkPath,
|
|
526
|
+
message: `will remove stale Agentera skill symlink ${entry.name}`,
|
|
527
|
+
});
|
|
528
|
+
}
|
|
350
529
|
}
|
|
351
530
|
function walkJsonHookFiles(dir) {
|
|
352
531
|
if (!pathExists(dir)) {
|
|
@@ -388,16 +567,25 @@ function planEnvRuntimeNoops(items, runtime, message) {
|
|
|
388
567
|
}
|
|
389
568
|
}
|
|
390
569
|
export function planRuntimeMigrationItems(ctx) {
|
|
570
|
+
if (!ctx.env) {
|
|
571
|
+
throw new Error("MigrationContext.env is required for runtime migration planning; pass sandboxMigrationEnv(home, sourceRoot) in tests or an explicit env in callers.");
|
|
572
|
+
}
|
|
391
573
|
const home = resolvePath(ctx.home);
|
|
392
574
|
const project = resolvePath(ctx.project);
|
|
393
|
-
const env = ctx.env
|
|
575
|
+
const env = ctx.env;
|
|
394
576
|
const sourceRoot = resolvePath(ctx.sourceRoot ?? resolveSourceRoot(env));
|
|
395
577
|
const commands = resolveNpxHookCommands({ ...ctx, home, env, sourceRoot });
|
|
396
578
|
const items = [];
|
|
397
|
-
planCodexItems(items, home, commands, ctx.force);
|
|
579
|
+
planCodexItems(items, home, project, commands, ctx.force);
|
|
398
580
|
planCursorItems(items, home, project, sourceRoot, commands);
|
|
399
581
|
planOpencodeItems(items, home, sourceRoot, env, commands);
|
|
582
|
+
planStaleCommandCleanupItems(ctx, items);
|
|
583
|
+
planStaleSkillCleanupItems(ctx, items);
|
|
400
584
|
planCopilotItems(items, project, commands);
|
|
585
|
+
const hookRetirement = planInstalledHooksRetirementItems(ctx).filter((item) => item.status === "pending");
|
|
586
|
+
if (hookRetirement.length > 0 && items.some((item) => item.action === "rewire-runtime" && item.status === "pending")) {
|
|
587
|
+
items.push(...hookRetirement);
|
|
588
|
+
}
|
|
401
589
|
planEnvRuntimeNoops(items, "claude", "Claude Code plugin installs expose the app home without local config writes; use --update-packages to refresh marketplace surfaces");
|
|
402
590
|
planEnvRuntimeNoops(items, "cursor-agent", "Cursor Agent CLI inherits workspace Cursor hooks; no separate managed install surface");
|
|
403
591
|
void loadRegistry();
|
|
@@ -415,7 +603,7 @@ export function applyRuntimeMigrationItem(item, commands) {
|
|
|
415
603
|
item.message = "rewire-runtime missing target or newText";
|
|
416
604
|
return;
|
|
417
605
|
}
|
|
418
|
-
|
|
606
|
+
writeFileAtomic(item.target, item.newText, "utf8");
|
|
419
607
|
item.status = "applied";
|
|
420
608
|
item.message = "runtime config rewired to npm self-contained entrypoint";
|
|
421
609
|
break;
|
|
@@ -439,9 +627,27 @@ export function applyRuntimeMigrationItem(item, commands) {
|
|
|
439
627
|
item.message = "link-skill missing source or target";
|
|
440
628
|
return;
|
|
441
629
|
}
|
|
630
|
+
if (!pathExists(item.source)) {
|
|
631
|
+
item.status = "failed";
|
|
632
|
+
item.message = `link-skill source disappeared between plan and apply: ${item.source}`;
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
442
635
|
fs.mkdirSync(path.dirname(item.target), { recursive: true });
|
|
443
|
-
|
|
444
|
-
|
|
636
|
+
// lstat (not stat): stat follows symlinks and ENOENTs on dangling links; rmSync then fails.
|
|
637
|
+
let targetStat = null;
|
|
638
|
+
try {
|
|
639
|
+
targetStat = fs.lstatSync(item.target);
|
|
640
|
+
}
|
|
641
|
+
catch {
|
|
642
|
+
/* target absent */
|
|
643
|
+
}
|
|
644
|
+
if (targetStat) {
|
|
645
|
+
if (targetStat.isSymbolicLink()) {
|
|
646
|
+
fs.unlinkSync(item.target);
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
fs.rmSync(item.target, { recursive: true, force: true });
|
|
650
|
+
}
|
|
445
651
|
}
|
|
446
652
|
fs.symlinkSync(item.source, item.target);
|
|
447
653
|
item.status = "applied";
|
|
@@ -460,12 +666,65 @@ export function applyRuntimeMigrationItem(item, commands) {
|
|
|
460
666
|
if (item.target && isFile(item.target)) {
|
|
461
667
|
const configText = fs.readFileSync(item.target, "utf8");
|
|
462
668
|
const next = retireCodexCopiedHookTrust(configText, item.source);
|
|
463
|
-
|
|
669
|
+
writeFileAtomic(item.target, next, "utf8");
|
|
464
670
|
}
|
|
465
671
|
item.status = "applied";
|
|
466
672
|
item.message = "retired Agentera-owned copied Codex hooks";
|
|
467
673
|
break;
|
|
468
674
|
}
|
|
675
|
+
case "remove-stale-command": {
|
|
676
|
+
if (!item.source) {
|
|
677
|
+
item.status = "failed";
|
|
678
|
+
item.message = "remove-stale-command missing source";
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (isFile(item.source)) {
|
|
682
|
+
fs.rmSync(item.source, { force: true });
|
|
683
|
+
item.status = "applied";
|
|
684
|
+
item.message = `removed stale managed command ${path.basename(item.source)}`;
|
|
685
|
+
}
|
|
686
|
+
else {
|
|
687
|
+
item.status = "noop";
|
|
688
|
+
item.message = `stale command already absent at ${item.source}`;
|
|
689
|
+
}
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
case "remove-stale-skill": {
|
|
693
|
+
if (!item.source) {
|
|
694
|
+
item.status = "failed";
|
|
695
|
+
item.message = "remove-stale-skill missing source";
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
try {
|
|
699
|
+
const stat = fs.lstatSync(item.source);
|
|
700
|
+
if (stat.isSymbolicLink()) {
|
|
701
|
+
fs.unlinkSync(item.source);
|
|
702
|
+
item.status = "applied";
|
|
703
|
+
item.message = `removed stale skill symlink ${path.basename(item.source)}`;
|
|
704
|
+
}
|
|
705
|
+
else if (stat.isDirectory()) {
|
|
706
|
+
const entries = fs.readdirSync(item.source);
|
|
707
|
+
if (entries.length === 0) {
|
|
708
|
+
fs.rmdirSync(item.source);
|
|
709
|
+
item.status = "applied";
|
|
710
|
+
item.message = `removed empty skill directory ${path.basename(item.source)}`;
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
item.status = "blocked";
|
|
714
|
+
item.message = `skill directory ${path.basename(item.source)} is non-empty (entries: ${entries.length}); manual review required`;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
item.status = "noop";
|
|
719
|
+
item.message = "skill path is not a symlink or directory; skipped";
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
catch {
|
|
723
|
+
item.status = "noop";
|
|
724
|
+
item.message = "stale skill already absent";
|
|
725
|
+
}
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
469
728
|
default:
|
|
470
729
|
break;
|
|
471
730
|
}
|
|
@@ -480,5 +739,6 @@ export function applyRuntimeMigrationItems(items, ctx) {
|
|
|
480
739
|
for (const item of items) {
|
|
481
740
|
applyRuntimeMigrationItem(item, commands);
|
|
482
741
|
}
|
|
742
|
+
applyInstalledHooksRetirementItems(items, ctx);
|
|
483
743
|
}
|
|
484
744
|
//# sourceMappingURL=runtimeMigration.js.map
|