agentera 3.0.0-dev.2 → 3.0.0-dev.21
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 +84 -6
- package/bundle/.agentera-npx-bundle.json +1 -1
- package/bundle/.codex-plugin/plugin.json +92 -0
- package/bundle/.cursor/agents/agentera.md +7 -0
- package/bundle/.cursor/hooks.json +32 -0
- package/bundle/.cursor-plugin/plugin.json +34 -0
- package/bundle/.github/hooks/postToolUse.json +9 -0
- package/bundle/.github/hooks/preToolUse.json +8 -0
- package/bundle/.github/hooks/sessionEnd.json +8 -0
- package/bundle/.github/hooks/sessionStart.json +8 -0
- package/bundle/.github/plugin/plugin.json +7 -0
- package/bundle/.opencode/agents/agentera.md +12 -0
- package/bundle/.opencode/commands/agentera.md +5 -0
- package/bundle/.opencode/package.json +31 -0
- package/bundle/.opencode/plugins/agentera.js +820 -0
- package/bundle/CHANGELOG.md +1101 -0
- package/bundle/DESIGN.md +233 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +158 -0
- package/bundle/UPGRADE.md +265 -0
- package/bundle/agents/openai.yaml +87 -0
- package/bundle/extract-corpus-parity.json +21 -0
- package/bundle/hooks/codex-hooks.json +31 -0
- package/bundle/hooks/codex-plugin-hooks.json +31 -0
- package/bundle/plugin.json +13 -0
- package/bundle/references/adapters/cursor.md +53 -42
- package/bundle/references/adapters/opencode.md +46 -47
- package/bundle/references/adapters/package-manifest-interface-model.yaml +32 -43
- package/bundle/references/adapters/package-registry.yaml +19 -53
- package/bundle/references/adapters/package-surface-characterization.md +55 -35
- package/bundle/references/adapters/runtime-adapter-characterization.md +44 -79
- package/bundle/references/adapters/runtime-adapter-registry.yaml +21 -182
- package/bundle/references/adapters/runtime-feature-parity.md +114 -174
- package/bundle/references/adapters/runtime-lifecycle-adapters.yaml +288 -0
- package/bundle/references/adapters/runtime-lifecycle-authority.yaml +90 -0
- package/bundle/references/adapters/runtime-lifecycle-operation-contract.yaml +84 -0
- package/bundle/references/adapters/runtime-retired-resources.yaml +33 -0
- package/bundle/references/analysis/benchmark.md +6 -6
- package/bundle/references/analysis/startup-measurement-contract.yaml +37 -26
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +9 -8
- package/bundle/references/artifacts/state-storage-authority.yaml +1446 -0
- package/bundle/references/cli/agent-ready-state-contract.yaml +37 -62
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +4 -4
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +57 -28
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +4 -32
- 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 +342 -326
- package/bundle/references/meta/documentation-inventory.md +10 -3
- package/bundle/registry.json +14 -14
- package/bundle/skills/agentera/SKILL.md +136 -408
- 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/audit/schemas/artifacts.yaml +84 -0
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/triggers.yaml +15 -6
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +20 -19
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/artifacts.yaml +22 -17
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +3 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/triggers.yaml +13 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/validation.yaml +11 -11
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +49 -0
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/validation.yaml +9 -8
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/artifacts.yaml +23 -16
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/triggers.yaml +14 -4
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +18 -18
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +9 -9
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +71 -0
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/triggers.yaml +16 -3
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +120 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +63 -0
- 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/plan/schemas/validation.yaml +89 -0
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/artifacts.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +3 -3
- 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/research/schemas/artifacts.yaml +24 -0
- 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/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/triggers.yaml +19 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +18 -20
- 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 +387 -329
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +25 -20
- 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 +139 -8
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +21 -15
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +22 -8
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +285 -11
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +36 -51
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +77 -24
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +163 -0
- package/dist/analytics/extractCorpus/cli.js.map +1 -0
- package/dist/analytics/extractCorpus/copilotSessions.js +276 -0
- package/dist/analytics/extractCorpus/copilotSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/core.js +393 -0
- package/dist/analytics/extractCorpus/core.js.map +1 -0
- package/dist/analytics/extractCorpus/corpus.js +168 -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 +426 -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 +119 -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 +205 -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 +93 -27
- package/dist/analytics/usageStats.js.map +1 -1
- package/dist/bin/agentera.js +3 -1
- package/dist/bin/agentera.js.map +1 -1
- package/dist/capabilities/audit/instructions.js +4 -0
- package/dist/capabilities/audit/instructions.js.map +1 -0
- package/dist/capabilities/build/instructions.js +5 -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 +4 -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 +5 -0
- package/dist/capabilities/optimize/instructions.js.map +1 -0
- package/dist/capabilities/orchestrate/instructions.js +10 -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 +5 -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 +5 -0
- package/dist/capabilities/vision/instructions.js.map +1 -0
- package/dist/cli/appContext.js +30 -23
- 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 +38 -0
- package/dist/cli/capabilityContext/bespoke.js.map +1 -0
- package/dist/cli/capabilityContext/build.js +191 -0
- package/dist/cli/capabilityContext/build.js.map +1 -0
- package/dist/cli/capabilityContext/closeout.js +231 -0
- package/dist/cli/capabilityContext/closeout.js.map +1 -0
- package/dist/cli/capabilityContext/contract.js +219 -0
- package/dist/cli/capabilityContext/contract.js.map +1 -0
- package/dist/cli/capabilityContext/evidence.js +457 -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 +118 -0
- package/dist/cli/capabilityContext/orchestration.js.map +1 -0
- package/dist/cli/capabilityContext/planState.js +279 -0
- package/dist/cli/capabilityContext/planState.js.map +1 -0
- package/dist/cli/capabilityContext/progress.js +143 -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 +139 -0
- package/dist/cli/capabilityContext/slim.js.map +1 -0
- package/dist/cli/capabilityContext/startup.js +241 -0
- package/dist/cli/capabilityContext/startup.js.map +1 -0
- package/dist/cli/capabilityContext/types.js +51 -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/backfill.js +186 -76
- package/dist/cli/commands/backfill.js.map +1 -1
- package/dist/cli/commands/capability.js +3 -10
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/compact.js +41 -12
- package/dist/cli/commands/compact.js.map +1 -1
- package/dist/cli/commands/doctor.js +116 -96
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/durability.js +85 -0
- package/dist/cli/commands/durability.js.map +1 -0
- package/dist/cli/commands/lint.js +16 -41
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/migrate.js +677 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- 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 +202 -0
- package/dist/cli/commands/prime/collectOrientationState.js.map +1 -0
- package/dist/cli/commands/prime/orientationOutput.js +235 -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 -519
- package/dist/cli/commands/prime.js.map +1 -1
- package/dist/cli/commands/query.js +25 -4
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/commands/report.js +50 -14
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/schema.js +343 -76
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/state/decisions.js +421 -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/experimentRecords.js +156 -0
- package/dist/cli/commands/state/experimentRecords.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/get.js +141 -0
- package/dist/cli/commands/state/get.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/list.js +159 -0
- package/dist/cli/commands/state/list.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 +379 -0
- package/dist/cli/commands/state/plan.js.map +1 -0
- package/dist/cli/commands/state/planTasks.js +164 -0
- package/dist/cli/commands/state/planTasks.js.map +1 -0
- package/dist/cli/commands/state/plans.js +154 -0
- package/dist/cli/commands/state/plans.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/state/write.js +346 -0
- package/dist/cli/commands/state/write.js.map +1 -0
- package/dist/cli/commands/upgrade.js +79 -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 +13 -7
- 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 +395 -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 +201 -0
- package/dist/cli/dispatch/index.js.map +1 -0
- package/dist/cli/dispatch/lifecycle.js +671 -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 +168 -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 +421 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/orientation/attention.js +163 -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 +336 -144
- package/dist/cli/orientation.js.map +1 -1
- package/dist/cli/planArtifacts.js +201 -0
- package/dist/cli/planArtifacts.js.map +1 -0
- package/dist/cli/planEvidence.js +158 -0
- package/dist/cli/planEvidence.js.map +1 -0
- package/dist/cli/planLifecycleState.js +34 -0
- package/dist/cli/planLifecycleState.js.map +1 -0
- package/dist/cli/prime-blob.js +69 -2
- package/dist/cli/prime-blob.js.map +1 -1
- package/dist/cli/startupCompletenessContract.js +57 -0
- package/dist/cli/startupCompletenessContract.js.map +1 -0
- package/dist/cli/stateQuery.js +22 -5
- 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/atomicWriter.js +21 -0
- package/dist/core/atomicWriter.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/core/text.js +11 -0
- package/dist/core/text.js.map +1 -0
- package/dist/core/yaml.js +8 -0
- package/dist/core/yaml.js.map +1 -1
- package/dist/eval/evalSkills.js +30 -25
- 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 +9 -26
- package/dist/hooks/common.js.map +1 -1
- package/dist/hooks/compaction/apply.js +447 -0
- package/dist/hooks/compaction/apply.js.map +1 -0
- package/dist/hooks/compaction/dryRun.js +185 -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 +326 -0
- package/dist/hooks/compaction/parse.js.map +1 -0
- package/dist/hooks/compaction/retention.js +203 -0
- package/dist/hooks/compaction/retention.js.map +1 -0
- package/dist/hooks/compaction/status.js +336 -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 +57 -18
- package/dist/hooks/sessionStart.js.map +1 -1
- package/dist/hooks/sessionStop.js +8 -14
- 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 +541 -0
- package/dist/hooks/validateArtifact/schema.js.map +1 -0
- package/dist/hooks/validateArtifact/traversal.js +108 -0
- package/dist/hooks/validateArtifact/traversal.js.map +1 -0
- package/dist/hooks/validateArtifact/violations.js +108 -0
- package/dist/hooks/validateArtifact/violations.js.map +1 -0
- package/dist/migrate/v2HandoffManifest.js +455 -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 +203 -53
- 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 +40 -6
- package/dist/registries/packageRegistry.js.map +1 -1
- package/dist/registries/runtimeAdapterRegistry.js +30 -21
- 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 +329 -0
- package/dist/release/releaseMetadata.js.map +1 -0
- package/dist/runtime/lifecycleAdapterContract.js +458 -0
- package/dist/runtime/lifecycleAdapterContract.js.map +1 -0
- package/dist/runtime/lifecycleAdapters.js +766 -0
- package/dist/runtime/lifecycleAdapters.js.map +1 -0
- package/dist/runtime/lifecycleAuthority.js +493 -0
- package/dist/runtime/lifecycleAuthority.js.map +1 -0
- package/dist/runtime/lifecycleOperationContract.js +113 -0
- package/dist/runtime/lifecycleOperationContract.js.map +1 -0
- package/dist/runtime/lifecycleOperations.js +635 -0
- package/dist/runtime/lifecycleOperations.js.map +1 -0
- package/dist/runtime/lifecycleOwnershipJournal.js +623 -0
- package/dist/runtime/lifecycleOwnershipJournal.js.map +1 -0
- package/dist/runtime/lifecyclePublication.js +395 -0
- package/dist/runtime/lifecyclePublication.js.map +1 -0
- package/dist/runtime/lifecycleSnapshot.js +439 -0
- package/dist/runtime/lifecycleSnapshot.js.map +1 -0
- package/dist/runtime/retiredRuntimeCleanup.js +238 -0
- package/dist/runtime/retiredRuntimeCleanup.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/copilot.js +1 -1
- package/dist/setup/copilot.js.map +1 -1
- package/dist/setup/cursor.js +7 -5
- 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 +201 -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 +109 -0
- package/dist/setup/smokeChecks.js.map +1 -0
- package/dist/state/archiveDiscovery.js +589 -0
- package/dist/state/archiveDiscovery.js.map +1 -0
- package/dist/state/archivePublication.js +225 -0
- package/dist/state/archivePublication.js.map +1 -0
- package/dist/state/archiveRecovery.js +238 -0
- package/dist/state/archiveRecovery.js.map +1 -0
- package/dist/state/archiveReplay.js +54 -0
- package/dist/state/archiveReplay.js.map +1 -0
- package/dist/state/decisionOverlay.js +255 -0
- package/dist/state/decisionOverlay.js.map +1 -0
- package/dist/state/directRetrieval.js +322 -0
- package/dist/state/directRetrieval.js.map +1 -0
- package/dist/state/durability.js +451 -0
- package/dist/state/durability.js.map +1 -0
- package/dist/state/experimentArchive.js +64 -0
- package/dist/state/experimentArchive.js.map +1 -0
- package/dist/state/experimentIdentity.js +191 -0
- package/dist/state/experimentIdentity.js.map +1 -0
- package/dist/state/experimentRetrieval.js +447 -0
- package/dist/state/experimentRetrieval.js.map +1 -0
- package/dist/state/gitBackfill.js +561 -0
- package/dist/state/gitBackfill.js.map +1 -0
- package/dist/state/gitBackfillAuthority.js +141 -0
- package/dist/state/gitBackfillAuthority.js.map +1 -0
- package/dist/state/gitBackfillHistory.js +278 -0
- package/dist/state/gitBackfillHistory.js.map +1 -0
- package/dist/state/gitBackfillOutput.js +209 -0
- package/dist/state/gitBackfillOutput.js.map +1 -0
- package/dist/state/healthRepair.js +70 -0
- package/dist/state/healthRepair.js.map +1 -0
- package/dist/state/installRoot.js +64 -24
- package/dist/state/installRoot.js.map +1 -1
- package/dist/state/legacyIdentity.js +48 -0
- package/dist/state/legacyIdentity.js.map +1 -0
- package/dist/state/legacyMigration.js +516 -0
- package/dist/state/legacyMigration.js.map +1 -0
- package/dist/state/legacyMigrationParser.js +489 -0
- package/dist/state/legacyMigrationParser.js.map +1 -0
- package/dist/state/listAccounting.js +55 -0
- package/dist/state/listAccounting.js.map +1 -0
- package/dist/state/listClassification.js +18 -0
- package/dist/state/listClassification.js.map +1 -0
- package/dist/state/listRetrieval.js +782 -0
- package/dist/state/listRetrieval.js.map +1 -0
- package/dist/state/migrationAuthority.js +413 -0
- package/dist/state/migrationAuthority.js.map +1 -0
- package/dist/state/migrationEnrichment.js +35 -0
- package/dist/state/migrationEnrichment.js.map +1 -0
- package/dist/state/planIdentity.js +45 -0
- package/dist/state/planIdentity.js.map +1 -0
- package/dist/state/planRetrieval.js +314 -0
- package/dist/state/planRetrieval.js.map +1 -0
- package/dist/state/planTaskRetrieval.js +285 -0
- package/dist/state/planTaskRetrieval.js.map +1 -0
- package/dist/state/projectionPolicy.js +184 -0
- package/dist/state/projectionPolicy.js.map +1 -0
- package/dist/state/retrievalAuthority.js +326 -0
- package/dist/state/retrievalAuthority.js.map +1 -0
- 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/state/startupProjection.js +498 -0
- package/dist/state/startupProjection.js.map +1 -0
- package/dist/state/write/assign.js +21 -0
- package/dist/state/write/assign.js.map +1 -0
- package/dist/state/write/errors.js +12 -0
- package/dist/state/write/errors.js.map +1 -0
- package/dist/state/write/experimentPublication.js +193 -0
- package/dist/state/write/experimentPublication.js.map +1 -0
- package/dist/state/write/explain.js +169 -0
- package/dist/state/write/explain.js.map +1 -0
- package/dist/state/write/fields.js +62 -0
- package/dist/state/write/fields.js.map +1 -0
- package/dist/state/write/helpers.js +8 -0
- package/dist/state/write/helpers.js.map +1 -0
- package/dist/state/write/index.js +12 -0
- package/dist/state/write/index.js.map +1 -0
- package/dist/state/write/input.js +22 -0
- package/dist/state/write/input.js.map +1 -0
- package/dist/state/write/lock.js +131 -0
- package/dist/state/write/lock.js.map +1 -0
- package/dist/state/write/mutation.js +190 -0
- package/dist/state/write/mutation.js.map +1 -0
- package/dist/state/write/operations.js +254 -0
- package/dist/state/write/operations.js.map +1 -0
- package/dist/state/write/planPublication.js +172 -0
- package/dist/state/write/planPublication.js.map +1 -0
- package/dist/state/write/serialize.js +2 -0
- package/dist/state/write/serialize.js.map +1 -0
- package/dist/state/write/transaction.js +800 -0
- package/dist/state/write/transaction.js.map +1 -0
- package/dist/state/write/validate.js +8 -0
- package/dist/state/write/validate.js.map +1 -0
- package/dist/upgrade/appContentRefresh.js +374 -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 +2 -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 +27 -7
- 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 +52 -16
- package/dist/upgrade/compatibility.js.map +1 -1
- package/dist/upgrade/doctor.js +195 -193
- 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/lifecycleUpgrade.js +427 -0
- package/dist/upgrade/lifecycleUpgrade.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js +568 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +273 -144
- 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 +259 -104
- package/dist/upgrade/projectIntegration.js.map +1 -1
- package/dist/upgrade/projectIntegrationDecision.js +141 -0
- package/dist/upgrade/projectIntegrationDecision.js.map +1 -0
- package/dist/upgrade/runtimeMigration.js +342 -89
- package/dist/upgrade/runtimeMigration.js.map +1 -1
- package/dist/upgrade/upgradeCommands.js +8 -0
- 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 +170 -46
- 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 +5 -5
- 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 +10 -7
- 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 +481 -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 +91 -702
- package/dist/validate/lifecycleAdapters.js.map +1 -1
- package/dist/validate/selfAudit.js +63 -21
- 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/.claude-plugin/plugin.json +0 -27
- 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/inspektera/schemas/artifacts.yaml +0 -76
- package/bundle/skills/agentera/capabilities/inspirera/instructions.md +0 -280
- package/bundle/skills/agentera/capabilities/inspirera/schemas/artifacts.yaml +0 -24
- 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/orkestrera/schemas/artifacts.yaml +0 -64
- package/bundle/skills/agentera/capabilities/orkestrera/schemas/validation.yaml +0 -107
- package/bundle/skills/agentera/capabilities/planera/instructions.md +0 -368
- package/bundle/skills/agentera/capabilities/planera/schemas/artifacts.yaml +0 -62
- package/bundle/skills/agentera/capabilities/planera/schemas/validation.yaml +0 -61
- 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/resonera/schemas/artifacts.yaml +0 -47
- 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/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/{dokumentera → document}/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/dist/cli/dispatch.js
CHANGED
|
@@ -1,958 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { cmdLint } from "./commands/lint.js";
|
|
3
|
-
import { cmdBackfill } from "./commands/backfill.js";
|
|
4
|
-
import { cmdState, isPortedStateCommand } from "./commands/state.js";
|
|
5
|
-
import { COMMAND_FILTERS } from "./stateQuery.js";
|
|
6
|
-
import { cmdQuery } from "./commands/query.js";
|
|
7
|
-
import { cmdCompact, cmdGate } from "./commands/compact.js";
|
|
8
|
-
import { cmdSchema } from "./commands/schema.js";
|
|
9
|
-
import { cmdDoctor } from "./commands/doctor.js";
|
|
10
|
-
import { cmdUpgrade } from "./commands/upgrade.js";
|
|
11
|
-
import { cmdVerify } from "./commands/verify.js";
|
|
12
|
-
import { cmdReport } from "./commands/report.js";
|
|
13
|
-
import { runSessionStart } from "../hooks/sessionStart.js";
|
|
14
|
-
import { runSessionStop } from "../hooks/sessionStop.js";
|
|
15
|
-
import { runCursorSessionStart } from "../hooks/cursorSessionStart.js";
|
|
16
|
-
import { runCursorPreToolUse } from "../hooks/cursorPreToolUse.js";
|
|
17
|
-
import { HookCliAdapter } from "../hooks/validateArtifact.js";
|
|
18
|
-
import fsForHooks from "node:fs";
|
|
19
|
-
import { usageMain } from "../analytics/usageStats.js";
|
|
20
|
-
import { validatePathValue } from "./argvalidate.js";
|
|
21
|
-
import { cmdCapability, CAPABILITY_ROUTING_NAMES } from "./commands/capability.js";
|
|
22
|
-
import { cmdValidate, cmdValidateCapability, cmdValidateCapabilityContract, cmdValidateArtifact, cmdValidateDescriptors, isDelegatedValidateFamily, } from "./commands/validate.js";
|
|
23
|
-
function emitDeprecationAlias(legacy, canonical, err) {
|
|
24
|
-
err(`Deprecation: agentera ${legacy} is deprecated; use agentera ${canonical}\n`);
|
|
25
|
-
}
|
|
26
|
-
/** Minimal flag parser for the `lint` command surface. */
|
|
27
|
-
function parseLintArgs(argv) {
|
|
28
|
-
const args = { artifact: "", file: null, text: null, strict: false, format: "text" };
|
|
29
|
-
let sawArtifact = false;
|
|
30
|
-
for (let i = 0; i < argv.length; i++) {
|
|
31
|
-
const a = argv[i];
|
|
32
|
-
const value = (name) => {
|
|
33
|
-
if (a === name)
|
|
34
|
-
return argv[++i];
|
|
35
|
-
if (a.startsWith(name + "="))
|
|
36
|
-
return a.slice(name.length + 1);
|
|
37
|
-
return null;
|
|
38
|
-
};
|
|
39
|
-
let v;
|
|
40
|
-
if ((v = value("--artifact")) !== null) {
|
|
41
|
-
args.artifact = v;
|
|
42
|
-
sawArtifact = true;
|
|
43
|
-
}
|
|
44
|
-
else if ((v = value("--file")) !== null) {
|
|
45
|
-
args.file = v;
|
|
46
|
-
}
|
|
47
|
-
else if ((v = value("--text")) !== null) {
|
|
48
|
-
args.text = v;
|
|
49
|
-
}
|
|
50
|
-
else if (a === "--strict") {
|
|
51
|
-
args.strict = true;
|
|
52
|
-
}
|
|
53
|
-
else if ((v = value("--format")) !== null) {
|
|
54
|
-
if (v !== "text" && v !== "json") {
|
|
55
|
-
return { error: `argument --format: invalid choice: '${v}' (choose from 'text', 'json')` };
|
|
56
|
-
}
|
|
57
|
-
args.format = v;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (!sawArtifact)
|
|
64
|
-
return { error: "the following arguments are required: --artifact" };
|
|
65
|
-
if (args.file !== null && args.text !== null) {
|
|
66
|
-
return { error: "argument --text: not allowed with argument --file" };
|
|
67
|
-
}
|
|
68
|
-
return args;
|
|
69
|
-
}
|
|
70
|
-
function runLint(argv, io, prog = "agentera lint") {
|
|
71
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
72
|
-
const parsed = parseLintArgs(argv);
|
|
73
|
-
if ("error" in parsed) {
|
|
74
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
75
|
-
return 2;
|
|
76
|
-
}
|
|
77
|
-
try {
|
|
78
|
-
return cmdLint(parsed, io);
|
|
79
|
-
}
|
|
80
|
-
catch (exc) {
|
|
81
|
-
err(`Error: ${exc.message}\n`);
|
|
82
|
-
return 2;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function parseBackfillArgs(argv) {
|
|
86
|
-
const args = { project: null, mode: "check", commit: null, cycle: null, format: "text" };
|
|
87
|
-
for (let i = 0; i < argv.length; i++) {
|
|
88
|
-
const a = argv[i];
|
|
89
|
-
const value = (name) => {
|
|
90
|
-
if (a === name)
|
|
91
|
-
return argv[++i];
|
|
92
|
-
if (a.startsWith(name + "="))
|
|
93
|
-
return a.slice(name.length + 1);
|
|
94
|
-
return null;
|
|
95
|
-
};
|
|
96
|
-
let v;
|
|
97
|
-
if ((v = value("--project")) !== null)
|
|
98
|
-
args.project = v;
|
|
99
|
-
else if ((v = value("--mode")) !== null) {
|
|
100
|
-
if (v !== "check" && v !== "fix") {
|
|
101
|
-
return { error: `argument --mode: invalid choice: '${v}' (choose from 'check', 'fix')` };
|
|
102
|
-
}
|
|
103
|
-
args.mode = v;
|
|
104
|
-
}
|
|
105
|
-
else if ((v = value("--commit")) !== null)
|
|
106
|
-
args.commit = v;
|
|
107
|
-
else if ((v = value("--cycle")) !== null) {
|
|
108
|
-
const n = Number(v);
|
|
109
|
-
if (!Number.isInteger(n))
|
|
110
|
-
return { error: `argument --cycle: invalid int value: '${v}'` };
|
|
111
|
-
args.cycle = n;
|
|
112
|
-
}
|
|
113
|
-
else if ((v = value("--format")) !== null) {
|
|
114
|
-
if (v !== "text" && v !== "json") {
|
|
115
|
-
return { error: `argument --format: invalid choice: '${v}' (choose from 'text', 'json')` };
|
|
116
|
-
}
|
|
117
|
-
args.format = v;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return args;
|
|
124
|
-
}
|
|
125
|
-
function runBackfill(argv, io, prog = "agentera backfill") {
|
|
126
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
127
|
-
const parsed = parseBackfillArgs(argv);
|
|
128
|
-
if ("error" in parsed) {
|
|
129
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
130
|
-
return 2;
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
return cmdBackfill(parsed, io);
|
|
134
|
-
}
|
|
135
|
-
catch (exc) {
|
|
136
|
-
err(`Error: ${exc.message}\n`);
|
|
137
|
-
return 2;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function parseStateArgs(command, argv) {
|
|
141
|
-
const args = {
|
|
142
|
-
command,
|
|
143
|
-
topic: null,
|
|
144
|
-
status: null,
|
|
145
|
-
dimension: null,
|
|
146
|
-
severity: null,
|
|
147
|
-
limit: 5,
|
|
148
|
-
format: "text",
|
|
149
|
-
fields: null,
|
|
150
|
-
};
|
|
151
|
-
const allowed = new Set([...(COMMAND_FILTERS[command] ?? []), "format", "fields"]);
|
|
152
|
-
for (let i = 0; i < argv.length; i++) {
|
|
153
|
-
const a = argv[i];
|
|
154
|
-
const value = (name) => {
|
|
155
|
-
if (a === name)
|
|
156
|
-
return argv[++i];
|
|
157
|
-
if (a.startsWith(name + "="))
|
|
158
|
-
return a.slice(name.length + 1);
|
|
159
|
-
return null;
|
|
160
|
-
};
|
|
161
|
-
const named = (flag, key) => allowed.has(key) && (a === flag || a.startsWith(flag + "="));
|
|
162
|
-
let v;
|
|
163
|
-
if (named("--topic", "topic"))
|
|
164
|
-
args.topic = value("--topic");
|
|
165
|
-
else if (named("--status", "status"))
|
|
166
|
-
args.status = value("--status");
|
|
167
|
-
else if (named("--dimension", "dimension"))
|
|
168
|
-
args.dimension = value("--dimension");
|
|
169
|
-
else if (named("--severity", "severity"))
|
|
170
|
-
args.severity = value("--severity");
|
|
171
|
-
else if (named("--limit", "limit")) {
|
|
172
|
-
v = value("--limit");
|
|
173
|
-
const n = Number(v);
|
|
174
|
-
if (!Number.isInteger(n))
|
|
175
|
-
return { error: `argument --limit: invalid int value: '${v}'` };
|
|
176
|
-
args.limit = n;
|
|
177
|
-
}
|
|
178
|
-
else if (a === "--format" || a.startsWith("--format=")) {
|
|
179
|
-
v = value("--format");
|
|
180
|
-
if (v !== "text" && v !== "json" && v !== "yaml") {
|
|
181
|
-
return { error: `argument --format: invalid choice: '${v}' (choose from 'text', 'json', 'yaml')` };
|
|
182
|
-
}
|
|
183
|
-
args.format = v;
|
|
184
|
-
}
|
|
185
|
-
else if (a === "--fields" || a.startsWith("--fields="))
|
|
186
|
-
args.fields = value("--fields");
|
|
187
|
-
else
|
|
188
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
189
|
-
}
|
|
190
|
-
return args;
|
|
191
|
-
}
|
|
192
|
-
function runState(command, argv, io, prog) {
|
|
193
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
194
|
-
const parsed = parseStateArgs(command, argv);
|
|
195
|
-
if ("error" in parsed) {
|
|
196
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
197
|
-
return 2;
|
|
198
|
-
}
|
|
199
|
-
return cmdState(parsed, io);
|
|
200
|
-
}
|
|
201
|
-
function parseQueryArgs(argv) {
|
|
202
|
-
const args = {
|
|
203
|
-
query: null,
|
|
204
|
-
list_artifacts: false,
|
|
205
|
-
topic: null,
|
|
206
|
-
severity: null,
|
|
207
|
-
dimension: null,
|
|
208
|
-
status: null,
|
|
209
|
-
limit: null,
|
|
210
|
-
format: "text",
|
|
211
|
-
fields: null,
|
|
212
|
-
};
|
|
213
|
-
for (let i = 0; i < argv.length; i++) {
|
|
214
|
-
const a = argv[i];
|
|
215
|
-
const value = (name) => {
|
|
216
|
-
if (a === name)
|
|
217
|
-
return argv[++i];
|
|
218
|
-
if (a.startsWith(name + "="))
|
|
219
|
-
return a.slice(name.length + 1);
|
|
220
|
-
return null;
|
|
221
|
-
};
|
|
222
|
-
let v;
|
|
223
|
-
if (a === "--list-artifacts")
|
|
224
|
-
args.list_artifacts = true;
|
|
225
|
-
else if ((v = value("--topic")) !== null)
|
|
226
|
-
args.topic = v;
|
|
227
|
-
else if ((v = value("--severity")) !== null)
|
|
228
|
-
args.severity = v;
|
|
229
|
-
else if ((v = value("--dimension")) !== null)
|
|
230
|
-
args.dimension = v;
|
|
231
|
-
else if ((v = value("--status")) !== null)
|
|
232
|
-
args.status = v;
|
|
233
|
-
else if ((v = value("--limit")) !== null) {
|
|
234
|
-
const n = Number(v);
|
|
235
|
-
if (!Number.isInteger(n))
|
|
236
|
-
return { error: `argument --limit: invalid int value: '${v}'` };
|
|
237
|
-
args.limit = n;
|
|
238
|
-
}
|
|
239
|
-
else if ((v = value("--format")) !== null) {
|
|
240
|
-
if (v !== "text" && v !== "json" && v !== "yaml") {
|
|
241
|
-
return { error: `argument --format: invalid choice: '${v}' (choose from 'text', 'json', 'yaml')` };
|
|
242
|
-
}
|
|
243
|
-
args.format = v;
|
|
244
|
-
}
|
|
245
|
-
else if ((v = value("--fields")) !== null)
|
|
246
|
-
args.fields = v;
|
|
247
|
-
else if (a.startsWith("--"))
|
|
248
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
249
|
-
else if (args.query === null)
|
|
250
|
-
args.query = a;
|
|
251
|
-
else
|
|
252
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
253
|
-
}
|
|
254
|
-
return args;
|
|
255
|
-
}
|
|
256
|
-
function runQuery(argv, io, prog) {
|
|
257
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
258
|
-
const parsed = parseQueryArgs(argv);
|
|
259
|
-
if ("error" in parsed) {
|
|
260
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
261
|
-
return 2;
|
|
262
|
-
}
|
|
263
|
-
try {
|
|
264
|
-
return cmdQuery(parsed, io);
|
|
265
|
-
}
|
|
266
|
-
catch (exc) {
|
|
267
|
-
err(`Error: ${exc.message}\n`);
|
|
268
|
-
return 2;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function compactModeOf(argv) {
|
|
272
|
-
for (let i = 0; i < argv.length; i++) {
|
|
273
|
-
if (argv[i] === "--mode")
|
|
274
|
-
return argv[i + 1] ?? "check";
|
|
275
|
-
if (argv[i].startsWith("--mode="))
|
|
276
|
-
return argv[i].slice("--mode=".length);
|
|
277
|
-
}
|
|
278
|
-
return "check";
|
|
279
|
-
}
|
|
280
|
-
function parseCompactArgs(argv) {
|
|
281
|
-
const args = { project: null, mode: "check", format: "text" };
|
|
282
|
-
for (let i = 0; i < argv.length; i++) {
|
|
283
|
-
const a = argv[i];
|
|
284
|
-
const value = (name) => {
|
|
285
|
-
if (a === name)
|
|
286
|
-
return argv[++i];
|
|
287
|
-
if (a.startsWith(name + "="))
|
|
288
|
-
return a.slice(name.length + 1);
|
|
289
|
-
return null;
|
|
290
|
-
};
|
|
291
|
-
let v;
|
|
292
|
-
if ((v = value("--project")) !== null)
|
|
293
|
-
args.project = v;
|
|
294
|
-
else if ((v = value("--mode")) !== null) {
|
|
295
|
-
if (v !== "check" && v !== "fix") {
|
|
296
|
-
return { error: `argument --mode: invalid choice: '${v}' (choose from 'check', 'fix')` };
|
|
297
|
-
}
|
|
298
|
-
args.mode = v;
|
|
299
|
-
}
|
|
300
|
-
else if ((v = value("--format")) !== null) {
|
|
301
|
-
if (v !== "text" && v !== "json") {
|
|
302
|
-
return { error: `argument --format: invalid choice: '${v}' (choose from 'text', 'json')` };
|
|
303
|
-
}
|
|
304
|
-
args.format = v;
|
|
305
|
-
}
|
|
306
|
-
else
|
|
307
|
-
return { error: `unrecognized arguments: ${a}` };
|
|
308
|
-
}
|
|
309
|
-
return args;
|
|
310
|
-
}
|
|
311
|
-
function runCompact(argv, io, prog) {
|
|
312
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
313
|
-
const parsed = parseCompactArgs(argv);
|
|
314
|
-
if ("error" in parsed) {
|
|
315
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
316
|
-
return 2;
|
|
317
|
-
}
|
|
318
|
-
try {
|
|
319
|
-
return cmdCompact(parsed, io);
|
|
320
|
-
}
|
|
321
|
-
catch (exc) {
|
|
322
|
-
err(`Error: ${exc.message}\n`);
|
|
323
|
-
return 2;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
function runValidate(argv, io, prog) {
|
|
327
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
328
|
-
let family = null;
|
|
329
|
-
let capabilityTarget = null;
|
|
330
|
-
let artifactFlag = null;
|
|
331
|
-
let fileFlag = null;
|
|
332
|
-
let cwdFlag = null;
|
|
333
|
-
let format = "text";
|
|
334
|
-
for (let i = 0; i < argv.length; i++) {
|
|
335
|
-
const a = argv[i];
|
|
336
|
-
if (a === "--format") {
|
|
337
|
-
const v = argv[++i];
|
|
338
|
-
if (v !== "text" && v !== "json") {
|
|
339
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json')\n`);
|
|
340
|
-
return 2;
|
|
341
|
-
}
|
|
342
|
-
format = v;
|
|
343
|
-
}
|
|
344
|
-
else if (a.startsWith("--format=")) {
|
|
345
|
-
const v = a.slice("--format=".length);
|
|
346
|
-
if (v !== "text" && v !== "json") {
|
|
347
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json')\n`);
|
|
348
|
-
return 2;
|
|
349
|
-
}
|
|
350
|
-
format = v;
|
|
351
|
-
}
|
|
352
|
-
else if (a === "--artifact" || a.startsWith("--artifact=")) {
|
|
353
|
-
artifactFlag = a === "--artifact" ? argv[++i] : a.slice("--artifact=".length);
|
|
354
|
-
}
|
|
355
|
-
else if (a === "--file" || a.startsWith("--file=")) {
|
|
356
|
-
fileFlag = a === "--file" ? argv[++i] : a.slice("--file=".length);
|
|
357
|
-
}
|
|
358
|
-
else if (a === "--cwd" || a.startsWith("--cwd=")) {
|
|
359
|
-
cwdFlag = a === "--cwd" ? argv[++i] : a.slice("--cwd=".length);
|
|
360
|
-
}
|
|
361
|
-
else if (a.startsWith("--")) {
|
|
362
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
363
|
-
return 2;
|
|
364
|
-
}
|
|
365
|
-
else if (family === null) {
|
|
366
|
-
family = a;
|
|
367
|
-
}
|
|
368
|
-
else if (capabilityTarget === null) {
|
|
369
|
-
capabilityTarget = a;
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
373
|
-
return 2;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
if (family === null) {
|
|
377
|
-
err(`${prog}: error: the following arguments are required: validate_family\n`);
|
|
378
|
-
return 2;
|
|
379
|
-
}
|
|
380
|
-
try {
|
|
381
|
-
if (family === "capability") {
|
|
382
|
-
if (capabilityTarget === null) {
|
|
383
|
-
err(`${prog} capability: error: the following arguments are required: target\n`);
|
|
384
|
-
return 2;
|
|
385
|
-
}
|
|
386
|
-
return cmdValidateCapability(capabilityTarget, { format }, io);
|
|
387
|
-
}
|
|
388
|
-
if (family === "capability-contract") {
|
|
389
|
-
return cmdValidateCapabilityContract({ format }, io);
|
|
390
|
-
}
|
|
391
|
-
if (family === "descriptors") {
|
|
392
|
-
return cmdValidateDescriptors({ format }, io);
|
|
393
|
-
}
|
|
394
|
-
if (family === "artifact") {
|
|
395
|
-
if (artifactFlag === null) {
|
|
396
|
-
err(`${prog} artifact: error: the following arguments are required: --artifact\n`);
|
|
397
|
-
return 2;
|
|
398
|
-
}
|
|
399
|
-
return cmdValidateArtifact({ artifact: artifactFlag, file: fileFlag, cwd: cwdFlag, format }, io);
|
|
400
|
-
}
|
|
401
|
-
if (isDelegatedValidateFamily(family)) {
|
|
402
|
-
return cmdValidate(family, { format }, io);
|
|
403
|
-
}
|
|
404
|
-
err(`agentera: validate family not yet ported: ${family}\n`);
|
|
405
|
-
return 1;
|
|
406
|
-
}
|
|
407
|
-
catch (exc) {
|
|
408
|
-
err(`Error: ${exc.message}\n`);
|
|
409
|
-
return 2;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
function runSchema(argv, io, prog) {
|
|
413
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
414
|
-
let format = "json";
|
|
415
|
-
for (let i = 0; i < argv.length; i++) {
|
|
416
|
-
const a = argv[i];
|
|
417
|
-
let v = null;
|
|
418
|
-
if (a === "--format")
|
|
419
|
-
v = argv[++i];
|
|
420
|
-
else if (a.startsWith("--format="))
|
|
421
|
-
v = a.slice("--format=".length);
|
|
422
|
-
else {
|
|
423
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
424
|
-
return 2;
|
|
425
|
-
}
|
|
426
|
-
if (v !== "json" && v !== "yaml") {
|
|
427
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'json', 'yaml')\n`);
|
|
428
|
-
return 2;
|
|
429
|
-
}
|
|
430
|
-
format = v;
|
|
431
|
-
}
|
|
432
|
-
try {
|
|
433
|
-
return cmdSchema({ format }, io);
|
|
434
|
-
}
|
|
435
|
-
catch (exc) {
|
|
436
|
-
err(`Error: ${exc.message}\n`);
|
|
437
|
-
return 2;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
function runCapability(command, argv, io, prog) {
|
|
441
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
442
|
-
let format = "text";
|
|
443
|
-
for (let i = 0; i < argv.length; i++) {
|
|
444
|
-
const a = argv[i];
|
|
445
|
-
let v = null;
|
|
446
|
-
if (a === "--format")
|
|
447
|
-
v = argv[++i];
|
|
448
|
-
else if (a.startsWith("--format="))
|
|
449
|
-
v = a.slice("--format=".length);
|
|
450
|
-
else if (a === "--fields" || a.startsWith("--fields=")) {
|
|
451
|
-
// accepted by the parser but unused by capability routing
|
|
452
|
-
if (a === "--fields")
|
|
453
|
-
i++;
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
458
|
-
return 2;
|
|
459
|
-
}
|
|
460
|
-
if (v !== "text" && v !== "json" && v !== "yaml") {
|
|
461
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json', 'yaml')\n`);
|
|
462
|
-
return 2;
|
|
463
|
-
}
|
|
464
|
-
format = v;
|
|
465
|
-
}
|
|
466
|
-
return cmdCapability(command, { format }, io);
|
|
467
|
-
}
|
|
468
|
-
function runPrime(command, argv, io, prog) {
|
|
469
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
470
|
-
const args = { command, guidance: false, context: null, dashboard: false, orientation: false, format: "text" };
|
|
471
|
-
for (let i = 0; i < argv.length; i++) {
|
|
472
|
-
const a = argv[i];
|
|
473
|
-
let v = null;
|
|
474
|
-
if (a === "--guidance")
|
|
475
|
-
args.guidance = true;
|
|
476
|
-
else if (a === "--dashboard")
|
|
477
|
-
args.dashboard = true;
|
|
478
|
-
else if (a === "--orientation")
|
|
479
|
-
args.orientation = true;
|
|
480
|
-
else if (a === "--context")
|
|
481
|
-
args.context = argv[++i];
|
|
482
|
-
else if (a.startsWith("--context="))
|
|
483
|
-
args.context = a.slice("--context=".length);
|
|
484
|
-
else if (a === "--format" || a.startsWith("--format=")) {
|
|
485
|
-
v = a === "--format" ? argv[++i] : a.slice("--format=".length);
|
|
486
|
-
if (v !== "text" && v !== "json" && v !== "yaml") {
|
|
487
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json', 'yaml')\n`);
|
|
488
|
-
return 2;
|
|
489
|
-
}
|
|
490
|
-
args.format = v;
|
|
491
|
-
}
|
|
492
|
-
else if (a === "--fields") {
|
|
493
|
-
args.fields = argv[++i];
|
|
494
|
-
}
|
|
495
|
-
else if (a.startsWith("--fields=")) {
|
|
496
|
-
args.fields = a.slice("--fields=".length);
|
|
497
|
-
}
|
|
498
|
-
else {
|
|
499
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
500
|
-
return 2;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
return cmdPrime(args, io);
|
|
504
|
-
}
|
|
505
|
-
function runGate(argv, io, prog) {
|
|
506
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
507
|
-
const parsed = parseCompactArgs(argv);
|
|
508
|
-
if ("error" in parsed) {
|
|
509
|
-
err(`${prog}: error: ${parsed.error}\n`);
|
|
510
|
-
return 2;
|
|
511
|
-
}
|
|
512
|
-
try {
|
|
513
|
-
return cmdGate(parsed, io);
|
|
514
|
-
}
|
|
515
|
-
catch (exc) {
|
|
516
|
-
err(`Error: ${exc.message}\n`);
|
|
517
|
-
return 2;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
function runDoctor(argv, io, prog) {
|
|
521
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
522
|
-
const args = { installRoot: null, home: null, project: null, expectedVersion: null, expectCommand: [], format: "text" };
|
|
523
|
-
let jsonFlag = false;
|
|
524
|
-
for (let i = 0; i < argv.length; i++) {
|
|
525
|
-
const a = argv[i];
|
|
526
|
-
const value = (name) => {
|
|
527
|
-
if (a === name)
|
|
528
|
-
return argv[++i];
|
|
529
|
-
if (a.startsWith(name + "="))
|
|
530
|
-
return a.slice(name.length + 1);
|
|
531
|
-
return null;
|
|
532
|
-
};
|
|
533
|
-
let v;
|
|
534
|
-
if ((v = value("--install-root")) !== null)
|
|
535
|
-
args.installRoot = v;
|
|
536
|
-
else if ((v = value("--home")) !== null)
|
|
537
|
-
args.home = v;
|
|
538
|
-
else if ((v = value("--project")) !== null)
|
|
539
|
-
args.project = v;
|
|
540
|
-
else if ((v = value("--expected-version")) !== null)
|
|
541
|
-
args.expectedVersion = v;
|
|
542
|
-
else if ((v = value("--expect-command")) !== null)
|
|
543
|
-
args.expectCommand.push(v);
|
|
544
|
-
else if ((v = value("--format")) !== null) {
|
|
545
|
-
if (v !== "text" && v !== "json") {
|
|
546
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json')\n`);
|
|
547
|
-
return 2;
|
|
548
|
-
}
|
|
549
|
-
args.format = v;
|
|
550
|
-
}
|
|
551
|
-
else if (a === "--json")
|
|
552
|
-
jsonFlag = true;
|
|
553
|
-
else {
|
|
554
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
555
|
-
return 2;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
if (jsonFlag) {
|
|
559
|
-
emitDeprecationAlias("doctor --json", "doctor --format json", err);
|
|
560
|
-
args.format = "json";
|
|
561
|
-
}
|
|
562
|
-
return cmdDoctor(args, io);
|
|
563
|
-
}
|
|
564
|
-
function readStdin() {
|
|
565
|
-
try {
|
|
566
|
-
return fsForHooks.readFileSync(0, "utf8");
|
|
567
|
-
}
|
|
568
|
-
catch {
|
|
569
|
-
return "";
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
function runHook(name, argv, io) {
|
|
573
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
574
|
-
const raw = io.stdin ? io.stdin() : readStdin();
|
|
575
|
-
// Each hook owns its own stdout newline convention; do not wrap stdout here.
|
|
576
|
-
switch (name) {
|
|
577
|
-
case "session-start":
|
|
578
|
-
return runSessionStart(raw);
|
|
579
|
-
case "session-stop":
|
|
580
|
-
return runSessionStop(raw);
|
|
581
|
-
case "cursor-session-start":
|
|
582
|
-
return runCursorSessionStart(raw);
|
|
583
|
-
case "cursor-pre-tool-use":
|
|
584
|
-
return runCursorPreToolUse(raw);
|
|
585
|
-
case "validate-artifact": {
|
|
586
|
-
const [rc, violations] = new HookCliAdapter().run(raw, null);
|
|
587
|
-
for (const v of violations)
|
|
588
|
-
err(`${v}\n`);
|
|
589
|
-
return rc;
|
|
590
|
-
}
|
|
591
|
-
default:
|
|
592
|
-
err(`agentera hook: unknown hook '${name}'\n`);
|
|
593
|
-
return 2;
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
function runUsage(argv, io, prog) {
|
|
597
|
-
const realOut = io.out ?? ((t) => process.stdout.write(t));
|
|
598
|
-
const realErr = io.err ?? ((t) => process.stderr.write(t));
|
|
599
|
-
let format = "text";
|
|
600
|
-
let corpus = null;
|
|
601
|
-
let project = null;
|
|
602
|
-
for (let i = 0; i < argv.length; i++) {
|
|
603
|
-
const a = argv[i];
|
|
604
|
-
const value = (name) => {
|
|
605
|
-
if (a === name)
|
|
606
|
-
return argv[++i] ?? null;
|
|
607
|
-
if (a.startsWith(name + "="))
|
|
608
|
-
return a.slice(name.length + 1);
|
|
609
|
-
return null;
|
|
610
|
-
};
|
|
611
|
-
let v;
|
|
612
|
-
if ((v = value("--format")) !== null)
|
|
613
|
-
format = v;
|
|
614
|
-
else if ((v = value("--corpus")) !== null)
|
|
615
|
-
corpus = v;
|
|
616
|
-
else if ((v = value("--project")) !== null)
|
|
617
|
-
project = v;
|
|
618
|
-
else {
|
|
619
|
-
realErr(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
620
|
-
return 2;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
if (corpus !== null) {
|
|
624
|
-
try {
|
|
625
|
-
validatePathValue(corpus, "path");
|
|
626
|
-
}
|
|
627
|
-
catch (e) {
|
|
628
|
-
realErr(`${prog}: error: argument --corpus: ${e.message}\n`);
|
|
629
|
-
return 2;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (format !== "text" && format !== "json") {
|
|
633
|
-
const syntax = "agentera usage [--format text|json] [--corpus PATH] [--project VALUE]";
|
|
634
|
-
const example = "agentera usage --format json --project agentera";
|
|
635
|
-
realErr(`Error: unsupported usage format '${format}'; valid formats: text, json. ` +
|
|
636
|
-
`Syntax: ${syntax}. Example: ${example}\n`);
|
|
637
|
-
return 2;
|
|
638
|
-
}
|
|
639
|
-
const engineArgv = [];
|
|
640
|
-
if (corpus !== null)
|
|
641
|
-
engineArgv.push("--corpus", corpus);
|
|
642
|
-
if (project !== null)
|
|
643
|
-
engineArgv.push("--project", project);
|
|
644
|
-
if (format === "json")
|
|
645
|
-
engineArgv.push("--json");
|
|
646
|
-
return usageMain(engineArgv, {
|
|
647
|
-
out: (t) => realOut(t + "\n"),
|
|
648
|
-
err: (t) => realErr(t + "\n"),
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
function runUpgrade(argv, io, prog) {
|
|
652
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
653
|
-
const args = {
|
|
654
|
-
installRoot: null,
|
|
655
|
-
home: null,
|
|
656
|
-
project: null,
|
|
657
|
-
expectedVersion: null,
|
|
658
|
-
channel: null,
|
|
659
|
-
yes: false,
|
|
660
|
-
dryRun: false,
|
|
661
|
-
only: [],
|
|
662
|
-
force: false,
|
|
663
|
-
format: "text",
|
|
664
|
-
};
|
|
665
|
-
let jsonFlag = false;
|
|
666
|
-
for (let i = 0; i < argv.length; i++) {
|
|
667
|
-
const a = argv[i];
|
|
668
|
-
const value = (name) => {
|
|
669
|
-
if (a === name)
|
|
670
|
-
return argv[++i] ?? null;
|
|
671
|
-
if (a.startsWith(name + "="))
|
|
672
|
-
return a.slice(name.length + 1);
|
|
673
|
-
return null;
|
|
674
|
-
};
|
|
675
|
-
let v;
|
|
676
|
-
if ((v = value("--install-root")) !== null)
|
|
677
|
-
args.installRoot = v;
|
|
678
|
-
else if ((v = value("--home")) !== null)
|
|
679
|
-
args.home = v;
|
|
680
|
-
else if ((v = value("--project")) !== null)
|
|
681
|
-
args.project = v;
|
|
682
|
-
else if ((v = value("--expected-version")) !== null)
|
|
683
|
-
args.expectedVersion = v;
|
|
684
|
-
else if ((v = value("--channel")) !== null)
|
|
685
|
-
args.channel = v;
|
|
686
|
-
else if ((v = value("--target-major")) !== null) {
|
|
687
|
-
void v;
|
|
688
|
-
err(`${prog}: error: --target-major was removed; use --channel with dry-run preview then --yes\n`);
|
|
689
|
-
return 2;
|
|
690
|
-
}
|
|
691
|
-
else if ((v = value("--runtime")) !== null)
|
|
692
|
-
void v; // accepted; orchestrator uses fixture runtimes
|
|
693
|
-
else if ((v = value("--only")) !== null) {
|
|
694
|
-
if (v !== "artifacts" && v !== "runtime" && v !== "cleanup") {
|
|
695
|
-
err(`${prog}: error: argument --only: invalid choice: '${v}' (choose from 'artifacts', 'runtime', 'cleanup')\n`);
|
|
696
|
-
return 2;
|
|
697
|
-
}
|
|
698
|
-
args.only.push(v);
|
|
699
|
-
}
|
|
700
|
-
else if ((v = value("--opencode-config-dir")) !== null)
|
|
701
|
-
void v; // accepted; ignored
|
|
702
|
-
else if (a === "--yes")
|
|
703
|
-
args.yes = true;
|
|
704
|
-
else if (a === "--dry-run")
|
|
705
|
-
args.dryRun = true;
|
|
706
|
-
else if (a === "--force")
|
|
707
|
-
args.force = true;
|
|
708
|
-
else if (a === "--update-packages")
|
|
709
|
-
void 0; // deferred for 3.x channel model
|
|
710
|
-
else if (a === "--json")
|
|
711
|
-
jsonFlag = true;
|
|
712
|
-
else if ((v = value("--format")) !== null) {
|
|
713
|
-
if (v !== "text" && v !== "json") {
|
|
714
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json')\n`);
|
|
715
|
-
return 2;
|
|
716
|
-
}
|
|
717
|
-
args.format = v;
|
|
718
|
-
}
|
|
719
|
-
else {
|
|
720
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
721
|
-
return 2;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
if (jsonFlag)
|
|
725
|
-
args.format = "json";
|
|
726
|
-
return cmdUpgrade(args, io);
|
|
727
|
-
}
|
|
728
|
-
function runVerify(argv, io, prog) {
|
|
729
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
730
|
-
const args = {
|
|
731
|
-
family: null,
|
|
732
|
-
target: null,
|
|
733
|
-
format: "text",
|
|
734
|
-
run: false,
|
|
735
|
-
dryRun: false,
|
|
736
|
-
skill: null,
|
|
737
|
-
timeout: 120,
|
|
738
|
-
parallel: 1,
|
|
739
|
-
runtime: "auto",
|
|
740
|
-
fixtures: [],
|
|
741
|
-
};
|
|
742
|
-
const positionals = [];
|
|
743
|
-
for (let i = 0; i < argv.length; i++) {
|
|
744
|
-
const a = argv[i];
|
|
745
|
-
const value = (name) => {
|
|
746
|
-
if (a === name)
|
|
747
|
-
return argv[++i] ?? null;
|
|
748
|
-
if (a.startsWith(name + "="))
|
|
749
|
-
return a.slice(name.length + 1);
|
|
750
|
-
return null;
|
|
751
|
-
};
|
|
752
|
-
let v;
|
|
753
|
-
if ((v = value("--format")) !== null) {
|
|
754
|
-
if (v !== "text" && v !== "json") {
|
|
755
|
-
err(`${prog}: error: argument --format: invalid choice: '${v}' (choose from 'text', 'json')\n`);
|
|
756
|
-
return 2;
|
|
757
|
-
}
|
|
758
|
-
args.format = v;
|
|
759
|
-
}
|
|
760
|
-
else if ((v = value("--skill")) !== null)
|
|
761
|
-
args.skill = v;
|
|
762
|
-
else if ((v = value("--runtime")) !== null)
|
|
763
|
-
args.runtime = v;
|
|
764
|
-
else if ((v = value("--timeout")) !== null)
|
|
765
|
-
args.timeout = Number(v);
|
|
766
|
-
else if ((v = value("--parallel")) !== null)
|
|
767
|
-
args.parallel = Number(v);
|
|
768
|
-
else if (a === "--run")
|
|
769
|
-
args.run = true;
|
|
770
|
-
else if (a === "--dry-run")
|
|
771
|
-
args.dryRun = true;
|
|
772
|
-
else if (a.startsWith("--")) {
|
|
773
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
774
|
-
return 2;
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
positionals.push(a);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
args.family = positionals[0] ?? null;
|
|
781
|
-
args.target = positionals[1] ?? null;
|
|
782
|
-
args.fixtures = positionals.slice(2);
|
|
783
|
-
return cmdVerify(args, io);
|
|
784
|
-
}
|
|
785
|
-
function runReport(argv, io, prog) {
|
|
786
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
787
|
-
const args = {
|
|
788
|
-
action: null,
|
|
789
|
-
format: "text",
|
|
790
|
-
project: null,
|
|
791
|
-
dryRun: false,
|
|
792
|
-
consent: null,
|
|
793
|
-
projectRoot: [],
|
|
794
|
-
};
|
|
795
|
-
const positionals = [];
|
|
796
|
-
for (let i = 0; i < argv.length; i++) {
|
|
797
|
-
const a = argv[i];
|
|
798
|
-
const value = (name) => {
|
|
799
|
-
if (a === name)
|
|
800
|
-
return argv[++i] ?? null;
|
|
801
|
-
if (a.startsWith(name + "="))
|
|
802
|
-
return a.slice(name.length + 1);
|
|
803
|
-
return null;
|
|
804
|
-
};
|
|
805
|
-
let v;
|
|
806
|
-
if ((v = value("--format")) !== null)
|
|
807
|
-
args.format = v;
|
|
808
|
-
else if ((v = value("--project")) !== null)
|
|
809
|
-
args.project = v;
|
|
810
|
-
else if ((v = value("--consent")) !== null) {
|
|
811
|
-
if (v !== "local-history") {
|
|
812
|
-
err(`${prog}: error: argument --consent: invalid choice: '${v}' (choose from 'local-history')\n`);
|
|
813
|
-
return 2;
|
|
814
|
-
}
|
|
815
|
-
args.consent = v;
|
|
816
|
-
}
|
|
817
|
-
else if ((v = value("--project-root")) !== null)
|
|
818
|
-
args.projectRoot.push(v);
|
|
819
|
-
else if ((v = value("--output")) !== null)
|
|
820
|
-
args.output = v;
|
|
821
|
-
else if ((v = value("--codex-sessions-dir")) !== null)
|
|
822
|
-
args.codexSessionsDir = v;
|
|
823
|
-
else if ((v = value("--claude-projects-dir")) !== null)
|
|
824
|
-
args.claudeProjectsDir = v;
|
|
825
|
-
else if ((v = value("--opencode-conversations-dir")) !== null)
|
|
826
|
-
args.opencodeConversationsDir = v;
|
|
827
|
-
else if ((v = value("--copilot-conversations-dir")) !== null)
|
|
828
|
-
args.copilotConversationsDir = v;
|
|
829
|
-
else if ((v = value("--cursor-projects-dir")) !== null)
|
|
830
|
-
args.cursorProjectsDir = v;
|
|
831
|
-
else if ((v = value("--cursor-chats-dir")) !== null)
|
|
832
|
-
args.cursorChatsDir = v;
|
|
833
|
-
else if (a === "--no-codex")
|
|
834
|
-
args.noCodex = true;
|
|
835
|
-
else if (a === "--no-claude")
|
|
836
|
-
args.noClaude = true;
|
|
837
|
-
else if (a === "--no-opencode")
|
|
838
|
-
args.noOpencode = true;
|
|
839
|
-
else if (a === "--no-copilot")
|
|
840
|
-
args.noCopilot = true;
|
|
841
|
-
else if (a === "--no-cursor")
|
|
842
|
-
args.noCursor = true;
|
|
843
|
-
else if (a === "--dry-run")
|
|
844
|
-
args.dryRun = true;
|
|
845
|
-
else if (a.startsWith("--")) {
|
|
846
|
-
err(`${prog}: error: unrecognized arguments: ${a}\n`);
|
|
847
|
-
return 2;
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
positionals.push(a);
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
args.action = positionals[0] ?? null;
|
|
854
|
-
return cmdReport(args, io);
|
|
855
|
-
}
|
|
856
|
-
export function main(argv, io = {}) {
|
|
857
|
-
const err = io.err ?? ((t) => process.stderr.write(t));
|
|
858
|
-
const args = argv.slice(2);
|
|
859
|
-
const command = args[0];
|
|
860
|
-
const rest = args.slice(1);
|
|
861
|
-
switch (command) {
|
|
862
|
-
case "prime":
|
|
863
|
-
return runPrime("prime", rest, io, "agentera prime");
|
|
864
|
-
case "doctor":
|
|
865
|
-
return runDoctor(rest, io, "agentera doctor");
|
|
866
|
-
case "usage":
|
|
867
|
-
return runUsage(rest, io, "agentera usage");
|
|
868
|
-
case "upgrade":
|
|
869
|
-
return runUpgrade(rest, io, "agentera upgrade");
|
|
870
|
-
case "verify":
|
|
871
|
-
emitDeprecationAlias("verify", "check verify", err);
|
|
872
|
-
return runVerify(rest, io, "agentera verify");
|
|
873
|
-
case "report":
|
|
874
|
-
return runReport(rest, io, "agentera report");
|
|
875
|
-
case "stats":
|
|
876
|
-
emitDeprecationAlias("stats", "report", err);
|
|
877
|
-
return runReport(rest, io, "agentera stats");
|
|
878
|
-
case "hook": {
|
|
879
|
-
const name = rest[0];
|
|
880
|
-
if (!name) {
|
|
881
|
-
err("agentera hook: error: the following arguments are required: hook_name\n");
|
|
882
|
-
return 2;
|
|
883
|
-
}
|
|
884
|
-
return runHook(name, rest.slice(1), io);
|
|
885
|
-
}
|
|
886
|
-
case "hej":
|
|
887
|
-
emitDeprecationAlias("hej", "prime", err);
|
|
888
|
-
return runPrime("hej", rest, io, "agentera hej");
|
|
889
|
-
case "schema":
|
|
890
|
-
return runSchema(rest, io, "agentera schema");
|
|
891
|
-
case "describe":
|
|
892
|
-
emitDeprecationAlias("describe", "schema", err);
|
|
893
|
-
return runSchema(rest, io, "agentera describe");
|
|
894
|
-
case "lint":
|
|
895
|
-
emitDeprecationAlias("lint", "check lint", err);
|
|
896
|
-
return runLint(rest, io);
|
|
897
|
-
case "check": {
|
|
898
|
-
const sub = rest[0];
|
|
899
|
-
if (!sub) {
|
|
900
|
-
err("agentera check: error: the following arguments are required: check_command\n");
|
|
901
|
-
return 2;
|
|
902
|
-
}
|
|
903
|
-
if (sub === "validate")
|
|
904
|
-
return runValidate(rest.slice(1), io, "agentera check validate");
|
|
905
|
-
if (sub === "verify")
|
|
906
|
-
return runVerify(rest.slice(1), io, "agentera check verify");
|
|
907
|
-
if (sub === "lint")
|
|
908
|
-
return runLint(rest.slice(1), io, "agentera check lint");
|
|
909
|
-
if (sub === "backfill")
|
|
910
|
-
return runBackfill(rest.slice(1), io, "agentera check backfill");
|
|
911
|
-
if (sub === "compact") {
|
|
912
|
-
const subArgs = rest.slice(1);
|
|
913
|
-
const mode = compactModeOf(subArgs);
|
|
914
|
-
if (mode === "fix")
|
|
915
|
-
return runCompact(subArgs, io, "agentera check compact");
|
|
916
|
-
return runGate(subArgs, io, "agentera check compact");
|
|
917
|
-
}
|
|
918
|
-
err(`agentera: unknown or not-yet-ported check subcommand: ${sub}\n`);
|
|
919
|
-
return 1;
|
|
920
|
-
}
|
|
921
|
-
case "state": {
|
|
922
|
-
const sub = rest[0];
|
|
923
|
-
if (!sub) {
|
|
924
|
-
err("agentera state: error: the following arguments are required: state_command\n");
|
|
925
|
-
return 2;
|
|
926
|
-
}
|
|
927
|
-
if (sub === "query")
|
|
928
|
-
return runQuery(rest.slice(1), io, "agentera state query");
|
|
929
|
-
if (isPortedStateCommand(sub))
|
|
930
|
-
return runState(sub, rest.slice(1), io, `agentera state ${sub}`);
|
|
931
|
-
err(`agentera: unknown or not-yet-ported state subcommand: ${sub}\n`);
|
|
932
|
-
return 1;
|
|
933
|
-
}
|
|
934
|
-
case "query":
|
|
935
|
-
emitDeprecationAlias("query", "state query", err);
|
|
936
|
-
return runQuery(rest, io, "agentera query");
|
|
937
|
-
case "compact":
|
|
938
|
-
emitDeprecationAlias("compact", "check compact", err);
|
|
939
|
-
return runCompact(rest, io, "agentera compact");
|
|
940
|
-
case "gate":
|
|
941
|
-
emitDeprecationAlias("gate", "check compact", err);
|
|
942
|
-
return runGate(rest, io, "agentera gate");
|
|
943
|
-
case "validate":
|
|
944
|
-
emitDeprecationAlias("validate", "check validate", err);
|
|
945
|
-
return runValidate(rest, io, "agentera validate");
|
|
946
|
-
default:
|
|
947
|
-
if (command && CAPABILITY_ROUTING_NAMES.includes(command)) {
|
|
948
|
-
return runCapability(command, rest, io, `agentera ${command}`);
|
|
949
|
-
}
|
|
950
|
-
if (command && isPortedStateCommand(command)) {
|
|
951
|
-
emitDeprecationAlias(command, `state ${command}`, err);
|
|
952
|
-
return runState(command, rest, io, `agentera ${command}`);
|
|
953
|
-
}
|
|
954
|
-
err(`agentera: unknown or not-yet-ported command: ${command ?? "(none)"}\n`);
|
|
955
|
-
return 1;
|
|
956
|
-
}
|
|
957
|
-
}
|
|
1
|
+
export { main } from "./dispatch/index.js";
|
|
958
2
|
//# sourceMappingURL=dispatch.js.map
|