agentera 3.0.0-dev.7 → 3.0.0-dev.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +229 -22
- package/bundle/.agentera-build-source.json +8 -0
- package/bundle/CHANGELOG.md +1361 -0
- package/bundle/DESIGN.md +229 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +143 -0
- package/bundle/UPGRADE.md +252 -0
- package/bundle/extract-corpus-parity.json +2 -4
- package/bundle/fixtures/routing/hybrid-corpus.yaml +154 -0
- package/bundle/references/adapters/package-publication.json +484 -0
- package/bundle/references/adapters/package-registry.yaml +439 -188
- package/bundle/references/adapters/package-surface-characterization.md +68 -34
- package/bundle/references/adapters/runtime-lifecycle-adapters.yaml +74 -0
- package/bundle/references/adapters/runtime-lifecycle-authority.yaml +62 -0
- package/bundle/references/adapters/runtime-lifecycle-operation-contract.yaml +84 -0
- package/bundle/references/adapters/runtime-retired-resources.yaml +333 -0
- package/bundle/references/analysis/evidence-tier-authority.yaml +559 -0
- package/bundle/references/analysis/personal-glossary-evaluation-authority.yaml +175 -0
- package/bundle/references/analysis/personal-glossary-evaluation-corpus.yaml +291 -0
- package/bundle/references/analysis/personal-glossary-holdout.yaml +192 -0
- package/bundle/references/analysis/verification-policy.yaml +266 -0
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +17 -8
- package/bundle/references/artifacts/glossary-entry-contract.yaml +2752 -0
- package/bundle/references/artifacts/state-storage-authority.yaml +3061 -0
- package/bundle/references/artifacts/verbosity-budget-authority.yaml +42 -0
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +3 -4
- package/bundle/references/cli/capability-instruction-contract.yaml +11 -14
- package/bundle/references/cli/hybrid-route-contract.yaml +438 -0
- package/bundle/references/cli/routing-model.md +152 -93
- package/bundle/references/cli/trigger-schema-enrichment.md +57 -46
- package/bundle/references/cli/update-channels.yaml +6 -4
- package/bundle/references/cli/vocabulary-index.yaml +5 -7
- package/bundle/references/cli/vocabulary.md +52 -94
- package/bundle/references/meta/retained-reference-authority.yaml +166 -0
- package/bundle/skills/agentera/SKILL.md +183 -63
- package/bundle/skills/agentera/capabilities/audit/schemas/artifacts.yaml +27 -19
- package/bundle/skills/agentera/capabilities/audit/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/audit/schemas/triggers.yaml +13 -35
- package/bundle/skills/agentera/capabilities/audit/schemas/validation.yaml +30 -11
- package/bundle/skills/agentera/capabilities/build/schemas/artifacts.yaml +44 -21
- package/bundle/skills/agentera/capabilities/build/schemas/exit.yaml +8 -6
- package/bundle/skills/agentera/capabilities/build/schemas/triggers.yaml +14 -36
- package/bundle/skills/agentera/capabilities/build/schemas/validation.yaml +95 -21
- package/bundle/skills/agentera/capabilities/design/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/design/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/design/schemas/triggers.yaml +5 -34
- package/bundle/skills/agentera/capabilities/design/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +17 -13
- package/bundle/skills/agentera/capabilities/discuss/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/triggers.yaml +6 -40
- package/bundle/skills/agentera/capabilities/discuss/schemas/validation.yaml +72 -5
- package/bundle/skills/agentera/capabilities/document/schemas/artifacts.yaml +24 -17
- package/bundle/skills/agentera/capabilities/document/schemas/triggers.yaml +5 -35
- package/bundle/skills/agentera/capabilities/document/schemas/validation.yaml +13 -13
- package/bundle/skills/agentera/capabilities/optimize/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/optimize/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/optimize/schemas/triggers.yaml +4 -35
- package/bundle/skills/agentera/capabilities/optimize/schemas/validation.yaml +3 -3
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +34 -22
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/exit.yaml +9 -7
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/triggers.yaml +5 -37
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +38 -37
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +20 -16
- package/bundle/skills/agentera/capabilities/plan/schemas/triggers.yaml +8 -31
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +66 -6
- package/bundle/skills/agentera/capabilities/profile/schemas/artifacts.yaml +13 -4
- package/bundle/skills/agentera/capabilities/profile/schemas/exit.yaml +8 -5
- package/bundle/skills/agentera/capabilities/profile/schemas/triggers.yaml +8 -37
- package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +67 -3
- package/bundle/skills/agentera/capabilities/research/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/research/schemas/triggers.yaml +5 -29
- package/bundle/skills/agentera/capabilities/status/schemas/artifacts.yaml +13 -12
- package/bundle/skills/agentera/capabilities/status/schemas/triggers.yaml +7 -49
- package/bundle/skills/agentera/capabilities/vision/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/vision/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/vision/schemas/triggers.yaml +7 -39
- package/bundle/skills/agentera/capabilities/vision/schemas/validation.yaml +14 -16
- package/bundle/skills/agentera/capability_schema_contract.yaml +32 -32
- package/bundle/skills/agentera/protocol.yaml +4 -4
- package/bundle/skills/agentera/route-phrases.yaml +81 -0
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +1 -0
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +30 -12
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +1 -0
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +7 -12
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +140 -9
- package/bundle/skills/agentera/schemas/artifacts/glossary.yaml +87 -0
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +56 -19
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +18 -4
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +464 -32
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +131 -18
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +302 -7
- package/dist/.agentera-build-source.json +8 -0
- package/dist/analytics/extractCorpus/cli.js +52 -11
- package/dist/analytics/extractCorpus/copilotSessions.js +19 -8
- package/dist/analytics/extractCorpus/core.js +262 -14
- package/dist/analytics/extractCorpus/corpus.js +57 -18
- package/dist/analytics/extractCorpus/coverageAudit.js +44 -45
- package/dist/analytics/extractCorpus/cursorSessions.js +28 -8
- package/dist/analytics/extractCorpus/evidenceTiers.js +709 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +4 -4
- package/dist/analytics/extractCorpus/filesystemSources.js +5 -5
- package/dist/analytics/extractCorpus/index.js +4 -2
- package/dist/analytics/extractCorpus/jsonlSessions.js +76 -8
- package/dist/analytics/extractCorpus/sqliteCaps.js +0 -1
- package/dist/analytics/extractCorpus/sqliteSessions.js +12 -4
- package/dist/analytics/extractCorpus/tierReader.js +108 -0
- package/dist/analytics/extractCorpus.js +0 -1
- package/dist/analytics/glossaryAdviceResolution.js +166 -0
- package/dist/analytics/glossaryInputAcquisition.js +319 -0
- package/dist/analytics/personalGlossaryAdmission.js +113 -0
- package/dist/analytics/personalGlossaryCandidateProjection.js +692 -0
- package/dist/analytics/personalGlossaryCandidateProjectionExcerpts.js +144 -0
- package/dist/analytics/personalGlossaryCandidateReadView.js +23 -0
- package/dist/analytics/personalGlossaryCurrentGeneration.js +25 -0
- package/dist/analytics/personalGlossaryDecision.js +203 -0
- package/dist/analytics/personalGlossaryExplicit.js +788 -0
- package/dist/analytics/personalGlossaryExplicitMining.js +285 -0
- package/dist/analytics/personalGlossaryExplicitScope.js +41 -0
- package/dist/analytics/personalGlossaryExplicitSegments.js +418 -0
- package/dist/analytics/personalGlossaryExplicitTypes.js +26 -0
- package/dist/analytics/personalGlossaryLexicalClassifier.js +175 -0
- package/dist/analytics/personalGlossaryProfile.js +229 -0
- package/dist/analytics/personalGlossaryRecurrence.js +618 -0
- package/dist/analytics/personalGlossaryReviewRecordStorage.js +428 -0
- package/dist/analytics/personalGlossaryReviewRecords.js +332 -0
- package/dist/analytics/profileSignals.js +211 -0
- package/dist/analytics/usageStats.js +150 -23
- package/dist/audit/terminologyDrift.js +281 -0
- package/dist/bin/agentera.js +3 -2
- package/dist/capabilities/audit/instructions.js +16 -6
- package/dist/capabilities/build/instructions.js +59 -6
- package/dist/capabilities/design/instructions.js +3 -4
- package/dist/capabilities/discuss/instructions.js +29 -6
- package/dist/capabilities/document/instructions.js +11 -6
- package/dist/capabilities/index.js +20 -14
- package/dist/capabilities/optimize/instructions.js +14 -6
- package/dist/capabilities/orchestrate/instructions.js +42 -6
- package/dist/capabilities/plan/instructions.js +30 -3
- package/dist/capabilities/profile/instructions.js +104 -5
- package/dist/capabilities/research/instructions.js +4 -5
- package/dist/capabilities/status/instructions.js +15 -6
- package/dist/capabilities/status/startupInstructions.js +34 -0
- package/dist/capabilities/vision/instructions.js +3 -5
- package/dist/cli/appContext.js +14 -7
- package/dist/cli/argvalidate.js +0 -1
- package/dist/cli/capabilityContext/benchmark.js +5 -4
- package/dist/cli/capabilityContext/bespoke.js +14 -6
- package/dist/cli/capabilityContext/build.js +116 -42
- package/dist/cli/capabilityContext/closeout.js +30 -27
- package/dist/cli/capabilityContext/contract.js +18 -27
- package/dist/cli/capabilityContext/evidence.js +84 -77
- package/dist/cli/capabilityContext/index.js +0 -1
- package/dist/cli/capabilityContext/orchestration.js +42 -18
- package/dist/cli/capabilityContext/planState.js +89 -96
- package/dist/cli/capabilityContext/progress.js +51 -12
- package/dist/cli/capabilityContext/projectVerification.js +409 -0
- package/dist/cli/capabilityContext/shared.js +9 -20
- package/dist/cli/capabilityContext/slim.js +52 -8
- package/dist/cli/capabilityContext/startup.js +51 -114
- package/dist/cli/capabilityContext/startupAggregation.js +68 -0
- package/dist/cli/capabilityContext/types.js +26 -10
- package/dist/cli/capabilityContext.js +0 -1
- package/dist/cli/commands/appHome.js +0 -1
- package/dist/cli/commands/capability.js +2 -2
- package/dist/cli/commands/compact.js +163 -13
- package/dist/cli/commands/doctor.js +117 -11
- package/dist/cli/commands/durability.js +81 -0
- package/dist/cli/commands/glossaryAdvice.js +138 -0
- package/dist/cli/commands/lint.js +22 -8
- package/dist/cli/commands/personalGlossaryCandidateReads.js +744 -0
- package/dist/cli/commands/personalGlossaryDecision.js +349 -0
- package/dist/cli/commands/personalGlossaryPublish.js +484 -0
- package/dist/cli/commands/personalGlossaryReviewRecordReads.js +209 -0
- package/dist/cli/commands/personalGlossaryReviewRecords.js +623 -0
- package/dist/cli/commands/prime/briefOrientation.js +845 -0
- package/dist/cli/commands/prime/buildExecutionRequest.js +165 -0
- package/dist/cli/commands/prime/bundleStatus.js +54 -4
- package/dist/cli/commands/prime/collectEntityOrientation.js +326 -0
- package/dist/cli/commands/prime/collectOrientationState.js +126 -63
- package/dist/cli/commands/prime/orientationOutput.js +267 -56
- package/dist/cli/commands/prime/types.js +0 -1
- package/dist/cli/commands/prime/v1Migration.js +0 -1
- package/dist/cli/commands/prime.js +76 -11
- package/dist/cli/commands/profileGrounding.js +55 -0
- package/dist/cli/commands/query.js +74 -52
- package/dist/cli/commands/report.js +91 -21
- package/dist/cli/commands/route.js +142 -0
- package/dist/cli/commands/schema.js +436 -138
- package/dist/cli/commands/state/decisions.js +40 -56
- package/dist/cli/commands/state/docs.js +58 -85
- package/dist/cli/commands/state/experimentRecords.js +151 -0
- package/dist/cli/commands/state/experiments.js +11 -65
- package/dist/cli/commands/state/get.js +129 -0
- package/dist/cli/commands/state/health.js +11 -113
- package/dist/cli/commands/state/index.js +6 -41
- package/dist/cli/commands/state/list.js +194 -0
- package/dist/cli/commands/state/objective.js +21 -65
- package/dist/cli/commands/state/plan.js +11 -170
- package/dist/cli/commands/state/planTasks.js +154 -0
- package/dist/cli/commands/state/plans.js +154 -0
- package/dist/cli/commands/state/progress.js +11 -45
- package/dist/cli/commands/state/shared.js +0 -1
- package/dist/cli/commands/state/todo.js +28 -107
- package/dist/cli/commands/state/write.js +433 -0
- package/dist/cli/commands/upgrade.js +146 -5
- package/dist/cli/commands/upgradeVerify.js +118 -0
- package/dist/cli/commands/validate.js +235 -136
- package/dist/cli/commands/verify.js +73 -16
- package/dist/cli/contracts/bundleStatus.js +0 -1
- package/dist/cli/contracts/orientationState.js +0 -1
- package/dist/cli/dispatch/argvParser.js +0 -1
- package/dist/cli/dispatch/check.js +84 -40
- package/dist/cli/dispatch/commands.js +3 -3
- package/dist/cli/dispatch/index.js +77 -52
- package/dist/cli/dispatch/lifecycle.js +162 -62
- package/dist/cli/dispatch/prime.js +37 -2
- package/dist/cli/dispatch/projections.js +17 -0
- package/dist/cli/dispatch/shared.js +1 -2
- package/dist/cli/dispatch/state.js +62 -66
- package/dist/cli/dispatch.js +0 -1
- package/dist/cli/errors.js +16 -17
- package/dist/cli/help.js +404 -39
- package/dist/cli/migrationRequired.js +125 -0
- package/dist/cli/orientation/attention.js +19 -19
- package/dist/cli/orientation/corpusCoverage.js +32 -1
- package/dist/cli/orientation.js +346 -129
- package/dist/cli/planArtifacts.js +350 -0
- package/dist/cli/planEvidence.js +157 -0
- package/dist/cli/planLifecycleState.js +36 -0
- package/dist/cli/planTaskIndex.js +11 -0
- package/dist/cli/preCutoverCommand.js +32 -0
- package/dist/cli/prime-blob.js +71 -3
- package/dist/cli/profileAcquisition.js +167 -0
- package/dist/cli/startupCompletenessContract.js +11 -8
- package/dist/cli/stateQuery.js +47 -12
- package/dist/cli/structured.js +0 -1
- package/dist/cli/todoMarkdown.js +25 -12
- package/dist/cli/todoReadinessSelection.js +192 -0
- package/dist/cli/todoSeverity.js +0 -1
- package/dist/core/atomicWriter.js +23 -0
- package/dist/core/developmentChannel.js +1 -0
- package/dist/core/developmentInvocation.js +377 -0
- package/dist/core/difflib.js +0 -1
- package/dist/core/envPaths.js +0 -1
- package/dist/core/jsonValue.js +0 -1
- package/dist/core/paths.js +0 -1
- package/dist/core/pyjson.js +0 -1
- package/dist/core/shell.js +4 -0
- package/dist/core/skillIdentity.js +23 -0
- package/dist/core/sourceRoot.js +9 -12
- package/dist/core/text.js +10 -0
- package/dist/core/toml.js +0 -1
- package/dist/core/yaml.js +61 -2
- package/dist/eval/evalSkills.js +13 -14
- package/dist/eval/glossaryEvaluation.js +751 -0
- package/dist/eval/glossaryEvaluationProcess.js +29 -0
- package/dist/eval/glossaryEvaluationRunner.js +571 -0
- package/dist/eval/glossaryEvaluationSuccessReport.js +297 -0
- package/dist/eval/hybridRouteEvaluation.js +155 -0
- package/dist/eval/semanticEval.js +0 -1
- package/dist/eval/semanticFixtures.js +0 -1
- package/dist/hooks/common.js +3 -56
- package/dist/hooks/compaction/apply.js +224 -47
- package/dist/hooks/compaction/dryRun.js +2 -1
- package/dist/hooks/compaction/index.js +5 -6
- package/dist/hooks/compaction/parse.js +73 -6
- package/dist/hooks/compaction/retention.js +28 -25
- package/dist/hooks/compaction/status.js +145 -26
- package/dist/hooks/compaction/types.js +0 -1
- package/dist/hooks/validateArtifact/agentFacing.js +0 -1
- package/dist/hooks/validateArtifact/index.js +6 -65
- package/dist/hooks/validateArtifact/markdown.js +9 -10
- package/dist/hooks/validateArtifact/schema.js +96 -9
- package/dist/hooks/validateArtifact/traversal.js +12 -11
- package/dist/hooks/validateArtifact/violations.js +5 -3
- package/dist/migrate/v2HandoffManifest.js +8 -3
- package/dist/registries/activationContract.js +2 -0
- package/dist/registries/activationTuples.js +136 -0
- package/dist/registries/artifactProtocolIds.js +2 -1
- package/dist/registries/artifactRegistry.js +207 -60
- package/dist/registries/artifactSchemaProjection.js +45 -0
- package/dist/registries/capabilityContract.js +5 -21
- package/dist/registries/evaluatorHandoffContract.js +0 -1
- package/dist/registries/evidenceTierContract.js +375 -0
- package/dist/registries/explicitSegmentGrammarContract.js +619 -0
- package/dist/registries/glossaryAdviceContract.js +79 -0
- package/dist/registries/glossaryCandidateContractPaths.js +6 -0
- package/dist/registries/glossaryCandidateContracts.js +820 -0
- package/dist/registries/glossaryCandidateDecisionAuthority.js +119 -0
- package/dist/registries/glossaryCandidateDecisionContract.js +62 -0
- package/dist/registries/glossaryCandidateProjectionAuthority.js +197 -0
- package/dist/registries/glossaryCandidateProjectionContract.js +104 -0
- package/dist/registries/glossaryCaveatContract.js +67 -0
- package/dist/registries/glossaryConsumerContractValidation.js +787 -0
- package/dist/registries/glossaryEntryContract.js +759 -0
- package/dist/registries/glossaryEntryTemporal.js +12 -0
- package/dist/registries/glossaryMiningAuthority.js +764 -0
- package/dist/registries/glossaryProfileFullContract.js +24 -0
- package/dist/registries/glossaryReviewRecordsAuthority.js +426 -0
- package/dist/registries/glossaryReviewRecordsContract.js +129 -0
- package/dist/registries/glossaryTermIdentity.js +139 -0
- package/dist/registries/glossaryTermOccurrence.js +20 -0
- package/dist/registries/hybridRoute.js +274 -0
- package/dist/registries/hybridRouteReceipt.js +221 -0
- package/dist/registries/packagePublication.js +273 -0
- package/dist/registries/packageRegistry.js +184 -209
- package/dist/registries/personalGlossaryContracts.js +1 -0
- package/dist/registries/todoReadinessContract.js +448 -0
- package/dist/registries/triggerLoader.js +7 -44
- package/dist/registries/verbosityBudgetContract.js +205 -0
- package/dist/release/releaseMetadata.js +167 -10
- package/dist/runtime/lifecycleAdapterContract.js +457 -0
- package/dist/runtime/lifecycleAdapters.js +777 -0
- package/dist/runtime/lifecycleAuthority.js +453 -0
- package/dist/runtime/lifecycleOperationContract.js +123 -0
- package/dist/runtime/lifecycleOperations.js +634 -0
- package/dist/runtime/lifecycleOwnershipJournal.js +622 -0
- package/dist/runtime/lifecyclePublication.js +415 -0
- package/dist/runtime/lifecycleSnapshot.js +438 -0
- package/dist/runtime/nativeResourceCleanup.js +502 -0
- package/dist/setup/opencode.js +20 -13
- package/dist/setup/opencodeConstants.js +1 -0
- package/dist/setup/sharedSkill.js +45 -0
- package/dist/setup/smokeChecks.js +14 -75
- package/dist/state/archiveDiscovery.js +580 -0
- package/dist/state/archivePublication.js +225 -0
- package/dist/state/archiveRecovery.js +237 -0
- package/dist/state/archiveReplay.js +53 -0
- package/dist/state/canonicalMigrationRecord.js +36 -0
- package/dist/state/changelog.js +221 -0
- package/dist/state/decisionEntities.js +367 -0
- package/dist/state/decisionLegacyValidation.js +215 -0
- package/dist/state/decisionMigrationProvenance.js +199 -0
- package/dist/state/decisionOverlay.js +254 -0
- package/dist/state/decisionRevision.js +256 -0
- package/dist/state/decisionRevisionMigration.js +89 -0
- package/dist/state/directRetrieval.js +323 -0
- package/dist/state/durability.js +324 -0
- package/dist/state/entityCutover.js +459 -0
- package/dist/state/entityCutoverGit.js +127 -0
- package/dist/state/entityGlossaryAuthority.js +13 -0
- package/dist/state/entityListProjection.js +187 -0
- package/dist/state/entityListRuntimeRegistry.js +85 -0
- package/dist/state/entityMigrationCausality.js +97 -0
- package/dist/state/entityMigrationIdentity.js +5 -0
- package/dist/state/entityMigrationPreview.js +840 -0
- package/dist/state/entityMigrationTodo.js +133 -0
- package/dist/state/entityPublicationContext.js +859 -0
- package/dist/state/entityRetrievalHelp.js +506 -0
- package/dist/state/entityStorage.js +899 -0
- package/dist/state/exactReplacementRecovery.js +18 -0
- package/dist/state/experimentArchive.js +63 -0
- package/dist/state/experimentIdentity.js +202 -0
- package/dist/state/healthEntities.js +262 -0
- package/dist/state/healthEntityValidation.js +18 -0
- package/dist/state/healthRepair.js +69 -0
- package/dist/state/installRoot.js +15 -7
- package/dist/state/legacyEntityCutoverEvidence.js +65 -0
- package/dist/state/legacyIdentity.js +47 -0
- package/dist/state/legacySummaryRecord.js +6 -0
- package/dist/state/listAccounting.js +54 -0
- package/dist/state/listClassification.js +17 -0
- package/dist/state/listCursor.js +42 -0
- package/dist/state/listRetrieval.js +781 -0
- package/dist/state/migrationSourceBinding.js +30 -0
- package/dist/state/objectiveExperimentEntities.js +322 -0
- package/dist/state/planEntities.js +1027 -0
- package/dist/state/planIdentity.js +47 -0
- package/dist/state/planLineageValidation.js +52 -0
- package/dist/state/planReplacementTransaction.js +475 -0
- package/dist/state/planRetrieval.js +313 -0
- package/dist/state/planTaskRetrieval.js +294 -0
- package/dist/state/progressEntities.js +512 -0
- package/dist/state/progressGlossaryCaveat.js +168 -0
- package/dist/state/progressPublicationOrder.js +19 -0
- package/dist/state/progressWritePolicy.js +33 -0
- package/dist/state/projectRoot.js +62 -0
- package/dist/state/projectionPolicy.js +190 -0
- package/dist/state/retrievalAuthority.js +156 -0
- package/dist/state/safeProjectFile.js +155 -0
- package/dist/state/startupAnalysis/benchmark.js +70 -9
- package/dist/state/startupAnalysis/contract.js +44 -10
- package/dist/state/startupAnalysis/helpers.js +1 -2
- package/dist/state/startupAnalysis/index.js +0 -1
- package/dist/state/startupAnalysis/metrics.js +0 -1
- package/dist/state/startupAnalysis/records.js +0 -1
- package/dist/state/startupAnalysis/report.js +0 -1
- package/dist/state/startupAnalysis/threshold.js +13 -1
- package/dist/state/startupAnalysis.js +0 -1
- package/dist/state/startupProjection.js +499 -0
- package/dist/state/stateMode.js +222 -0
- package/dist/state/stateStorageAuthority.js +47 -0
- package/dist/state/summaryEntityRead.js +25 -0
- package/dist/state/summaryMigrationProvenance.js +66 -0
- package/dist/state/summarySourceRowAuthority.js +36 -0
- package/dist/state/todoActivationSafety.js +58 -0
- package/dist/state/todoDocsEntities.js +1124 -0
- package/dist/state/todoDocsEntityValidation.js +158 -0
- package/dist/state/todoMarkdownProjection.js +51 -0
- package/dist/state/todoReconciliationActivation.js +182 -0
- package/dist/state/todoReconciliationInspection.js +171 -0
- package/dist/state/todoReconciliationRepair.js +318 -0
- package/dist/state/todoReconciliationTransaction.js +595 -0
- package/dist/state/write/assign.js +20 -0
- package/dist/state/write/candidateMutation.js +269 -0
- package/dist/state/write/errors.js +11 -0
- package/dist/state/write/experimentPublication.js +192 -0
- package/dist/state/write/explain.js +377 -0
- package/dist/state/write/fields.js +61 -0
- package/dist/state/write/glossaryPublication.js +263 -0
- package/dist/state/write/grammar.js +285 -0
- package/dist/state/write/helpers.js +29 -0
- package/dist/state/write/index.js +12 -0
- package/dist/state/write/input.js +391 -0
- package/dist/state/write/lock.js +837 -0
- package/dist/state/write/mutation.js +234 -0
- package/dist/state/write/operations.js +170 -0
- package/dist/state/write/planEvaluation.js +128 -0
- package/dist/state/write/planPublication.js +179 -0
- package/dist/state/write/runtimeOperations.js +146 -0
- package/dist/state/write/serialize.js +1 -0
- package/dist/state/write/transaction.js +57 -0
- package/dist/state/write/validate.js +7 -0
- package/dist/upgrade/appContentRefresh.js +77 -36
- package/dist/upgrade/appModel.js +0 -1
- package/dist/upgrade/atomicWriter.js +1 -0
- package/dist/upgrade/bundleEvidence.js +0 -1
- package/dist/upgrade/channels.js +6 -9
- package/dist/upgrade/compatibility.js +43 -17
- package/dist/upgrade/doctor.js +55 -32
- package/dist/upgrade/doctorClassifier.js +11 -1
- package/dist/upgrade/installedHooksRetirement.js +46 -40
- package/dist/upgrade/legacyAgentCleanup.js +187 -21
- package/dist/upgrade/lifecycleUpgrade.js +113 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +334 -64
- package/dist/upgrade/migrationPublication.js +122 -0
- package/dist/upgrade/nextMajorDoctor.js +0 -1
- package/dist/upgrade/npxPlatformStatus.js +2 -2
- package/dist/upgrade/projectIntegration.js +128 -160
- package/dist/upgrade/projectIntegrationDecision.js +42 -85
- package/dist/upgrade/retiredResourceDiagnostics.js +117 -0
- package/dist/upgrade/runtimeMigration.js +262 -453
- package/dist/upgrade/upgradeCommands.js +14 -1
- package/dist/upgrade/upgradeLock.js +85 -0
- package/dist/upgrade/upgradeOrchestrator.js +263 -59
- package/dist/upgrade/v3CapabilitySurface.js +2 -3
- package/dist/upgrade/versionResolution.js +0 -1
- package/dist/validate/activationArtifactEvidence.js +866 -0
- package/dist/validate/activationArtifactEvidenceTypes.js +12 -0
- package/dist/validate/activationConjunction.js +816 -0
- package/dist/validate/activationEvidenceManifest.js +610 -0
- package/dist/validate/activationPackageSemantics.js +29 -0
- package/dist/validate/appHomeContract.js +1 -7
- package/dist/validate/bootstrapAuthority.js +44 -0
- package/dist/validate/capability.js +11 -3
- package/dist/validate/crossCapability.js +14 -9
- package/dist/validate/retainedReferenceAuthority.js +879 -0
- package/dist/validate/selfAudit.js +39 -45
- package/dist/validate/v1LegacyCruft.js +131 -0
- package/dist/validate/vocabularyAuthority.js +8 -8
- package/package.json +39 -13
- package/bundle/references/adapters/cursor.md +0 -214
- package/bundle/references/adapters/opencode.md +0 -530
- package/bundle/references/adapters/package-manifest-interface-model.yaml +0 -337
- package/bundle/references/adapters/runtime-adapter-characterization.md +0 -79
- package/bundle/references/adapters/runtime-adapter-interface-model.yaml +0 -200
- package/bundle/references/adapters/runtime-adapter-registry.yaml +0 -554
- package/bundle/references/adapters/runtime-feature-parity.md +0 -189
- package/bundle/references/analysis/benchmark.md +0 -267
- package/bundle/references/analysis/startup-measurement-contract.yaml +0 -424
- package/bundle/references/cli/agent-ready-state-contract.yaml +0 -953
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +0 -369
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +0 -250
- package/bundle/references/cli/capability-tool-classification.yaml +0 -53
- package/bundle/references/cli/coexistence-probe.yaml +0 -13
- package/bundle/references/cli/parity-expected-actual-template.md +0 -30
- package/bundle/references/cli/routing-execution-vocabulary.yaml +0 -281
- package/bundle/references/cli/single-name-protocol.yaml +0 -42
- package/bundle/references/cli/upgrade-repair-wording.md +0 -45
- package/bundle/references/cli/v3-handoff-manifest.schema.yaml +0 -98
- package/bundle/references/meta/documentation-inventory.md +0 -49
- package/bundle/skills/agentera/.claude-plugin/plugin.json +0 -27
- package/bundle/skills/agentera/agents/audit.toml +0 -6
- package/bundle/skills/agentera/agents/build.toml +0 -6
- package/bundle/skills/agentera/agents/design.toml +0 -6
- package/bundle/skills/agentera/agents/discuss.toml +0 -6
- package/bundle/skills/agentera/agents/document.toml +0 -6
- package/bundle/skills/agentera/agents/optimize.toml +0 -6
- package/bundle/skills/agentera/agents/orchestrate.toml +0 -6
- package/bundle/skills/agentera/agents/plan.toml +0 -6
- package/bundle/skills/agentera/agents/profile.toml +0 -6
- package/bundle/skills/agentera/agents/research.toml +0 -6
- package/bundle/skills/agentera/agents/status.toml +0 -6
- package/bundle/skills/agentera/agents/vision.toml +0 -6
- package/bundle/skills/agentera/references/contract.md +0 -1048
- package/dist/analytics/extractCorpus/cli.js.map +0 -1
- package/dist/analytics/extractCorpus/copilotSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/core.js.map +0 -1
- package/dist/analytics/extractCorpus/corpus.js.map +0 -1
- package/dist/analytics/extractCorpus/coverageAudit.js.map +0 -1
- package/dist/analytics/extractCorpus/cursorSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/extractCorpusParity.js.map +0 -1
- package/dist/analytics/extractCorpus/filesystemSources.js.map +0 -1
- package/dist/analytics/extractCorpus/index.js.map +0 -1
- package/dist/analytics/extractCorpus/jsonlSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/sqliteCaps.js.map +0 -1
- package/dist/analytics/extractCorpus/sqliteSessions.js.map +0 -1
- package/dist/analytics/extractCorpus.js.map +0 -1
- package/dist/analytics/usageStats.js.map +0 -1
- package/dist/bin/agentera.js.map +0 -1
- package/dist/capabilities/audit/instructions.js.map +0 -1
- package/dist/capabilities/build/instructions.js.map +0 -1
- package/dist/capabilities/design/instructions.js.map +0 -1
- package/dist/capabilities/discuss/instructions.js.map +0 -1
- package/dist/capabilities/document/instructions.js.map +0 -1
- package/dist/capabilities/dokumentera/instructions.js +0 -6
- package/dist/capabilities/dokumentera/instructions.js.map +0 -1
- package/dist/capabilities/hej/instructions.js +0 -6
- package/dist/capabilities/hej/instructions.js.map +0 -1
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/inspektera/instructions.js +0 -6
- package/dist/capabilities/inspektera/instructions.js.map +0 -1
- package/dist/capabilities/inspirera/instructions.js +0 -6
- package/dist/capabilities/inspirera/instructions.js.map +0 -1
- package/dist/capabilities/optimera/instructions.js +0 -6
- package/dist/capabilities/optimera/instructions.js.map +0 -1
- package/dist/capabilities/optimize/instructions.js.map +0 -1
- package/dist/capabilities/orchestrate/instructions.js.map +0 -1
- package/dist/capabilities/orkestrera/instructions.js +0 -6
- package/dist/capabilities/orkestrera/instructions.js.map +0 -1
- package/dist/capabilities/plan/instructions.js.map +0 -1
- package/dist/capabilities/planera/instructions.js +0 -6
- package/dist/capabilities/planera/instructions.js.map +0 -1
- package/dist/capabilities/profile/instructions.js.map +0 -1
- package/dist/capabilities/profilera/instructions.js +0 -6
- package/dist/capabilities/profilera/instructions.js.map +0 -1
- package/dist/capabilities/realisera/instructions.js +0 -6
- package/dist/capabilities/realisera/instructions.js.map +0 -1
- package/dist/capabilities/research/instructions.js.map +0 -1
- package/dist/capabilities/resonera/instructions.js +0 -6
- package/dist/capabilities/resonera/instructions.js.map +0 -1
- package/dist/capabilities/status/instructions.js.map +0 -1
- package/dist/capabilities/vision/instructions.js.map +0 -1
- package/dist/capabilities/visionera/instructions.js +0 -6
- package/dist/capabilities/visionera/instructions.js.map +0 -1
- package/dist/capabilities/visualisera/instructions.js +0 -5
- package/dist/capabilities/visualisera/instructions.js.map +0 -1
- package/dist/cli/appContext.js.map +0 -1
- package/dist/cli/argvalidate.js.map +0 -1
- package/dist/cli/capabilityContext/benchmark.js.map +0 -1
- package/dist/cli/capabilityContext/bespoke.js.map +0 -1
- package/dist/cli/capabilityContext/build.js.map +0 -1
- package/dist/cli/capabilityContext/closeout.js.map +0 -1
- package/dist/cli/capabilityContext/contract.js.map +0 -1
- package/dist/cli/capabilityContext/evidence.js.map +0 -1
- package/dist/cli/capabilityContext/index.js.map +0 -1
- package/dist/cli/capabilityContext/orchestration.js.map +0 -1
- package/dist/cli/capabilityContext/planState.js.map +0 -1
- package/dist/cli/capabilityContext/progress.js.map +0 -1
- package/dist/cli/capabilityContext/realisera.js +0 -174
- package/dist/cli/capabilityContext/realisera.js.map +0 -1
- package/dist/cli/capabilityContext/shared.js.map +0 -1
- package/dist/cli/capabilityContext/slim.js.map +0 -1
- package/dist/cli/capabilityContext/startup.js.map +0 -1
- package/dist/cli/capabilityContext/types.js.map +0 -1
- package/dist/cli/capabilityContext.js.map +0 -1
- package/dist/cli/commands/appHome.js.map +0 -1
- package/dist/cli/commands/backfill.js +0 -84
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/capability.js.map +0 -1
- package/dist/cli/commands/compact.js.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/lint.js.map +0 -1
- package/dist/cli/commands/prime/bundleStatus.js.map +0 -1
- package/dist/cli/commands/prime/collectOrientationState.js.map +0 -1
- package/dist/cli/commands/prime/orientationOutput.js.map +0 -1
- package/dist/cli/commands/prime/routeOutput.js +0 -50
- package/dist/cli/commands/prime/routeOutput.js.map +0 -1
- package/dist/cli/commands/prime/types.js.map +0 -1
- package/dist/cli/commands/prime/v1Migration.js.map +0 -1
- package/dist/cli/commands/prime.js.map +0 -1
- package/dist/cli/commands/query.js.map +0 -1
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/schema.js.map +0 -1
- package/dist/cli/commands/state/decisions.js.map +0 -1
- package/dist/cli/commands/state/docs.js.map +0 -1
- package/dist/cli/commands/state/experiments.js.map +0 -1
- package/dist/cli/commands/state/health.js.map +0 -1
- package/dist/cli/commands/state/index.js.map +0 -1
- package/dist/cli/commands/state/objective.js.map +0 -1
- package/dist/cli/commands/state/plan.js.map +0 -1
- package/dist/cli/commands/state/progress.js.map +0 -1
- package/dist/cli/commands/state/shared.js.map +0 -1
- package/dist/cli/commands/state/todo.js.map +0 -1
- package/dist/cli/commands/state.js +0 -1023
- package/dist/cli/commands/state.js.map +0 -1
- package/dist/cli/commands/upgrade.js.map +0 -1
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/commands/verify.js.map +0 -1
- package/dist/cli/contracts/bundleStatus.js.map +0 -1
- package/dist/cli/contracts/orientationState.js.map +0 -1
- package/dist/cli/dispatch/argvParser.js.map +0 -1
- package/dist/cli/dispatch/check.js.map +0 -1
- package/dist/cli/dispatch/commands.js.map +0 -1
- package/dist/cli/dispatch/index.js.map +0 -1
- package/dist/cli/dispatch/lifecycle.js.map +0 -1
- package/dist/cli/dispatch/prime.js.map +0 -1
- package/dist/cli/dispatch/shared.js.map +0 -1
- package/dist/cli/dispatch/state.js.map +0 -1
- package/dist/cli/dispatch.js.map +0 -1
- package/dist/cli/errors.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/orientation/attention.js.map +0 -1
- package/dist/cli/orientation/corpusCoverage.js.map +0 -1
- package/dist/cli/orientation.js.map +0 -1
- package/dist/cli/prime-blob.js.map +0 -1
- package/dist/cli/startupCompletenessContract.js.map +0 -1
- package/dist/cli/stateQuery.js.map +0 -1
- package/dist/cli/structured.js.map +0 -1
- package/dist/cli/todoMarkdown.js.map +0 -1
- package/dist/cli/todoSeverity.js.map +0 -1
- package/dist/core/difflib.js.map +0 -1
- package/dist/core/envPaths.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.js.map +0 -1
- package/dist/core/jsonValue.js.map +0 -1
- package/dist/core/paths.js.map +0 -1
- package/dist/core/pyjson.js.map +0 -1
- package/dist/core/sourceRoot.js.map +0 -1
- package/dist/core/toml.js.map +0 -1
- package/dist/core/yaml.js.map +0 -1
- package/dist/eval/evalSkills.js.map +0 -1
- package/dist/eval/semanticEval.js.map +0 -1
- package/dist/eval/semanticFixtures.js.map +0 -1
- package/dist/hooks/common.js.map +0 -1
- package/dist/hooks/compaction/apply.js.map +0 -1
- package/dist/hooks/compaction/dryRun.js.map +0 -1
- package/dist/hooks/compaction/index.js.map +0 -1
- package/dist/hooks/compaction/parse.js.map +0 -1
- package/dist/hooks/compaction/retention.js.map +0 -1
- package/dist/hooks/compaction/status.js.map +0 -1
- package/dist/hooks/compaction/todoResolved.js +0 -137
- package/dist/hooks/compaction/todoResolved.js.map +0 -1
- package/dist/hooks/compaction/types.js.map +0 -1
- package/dist/hooks/compaction.js +0 -935
- package/dist/hooks/compaction.js.map +0 -1
- package/dist/hooks/cursorPreToolUse.js +0 -19
- package/dist/hooks/cursorPreToolUse.js.map +0 -1
- package/dist/hooks/cursorSessionStart.js +0 -79
- package/dist/hooks/cursorSessionStart.js.map +0 -1
- package/dist/hooks/sessionStart.js +0 -216
- package/dist/hooks/sessionStart.js.map +0 -1
- package/dist/hooks/sessionStop.js +0 -206
- package/dist/hooks/sessionStop.js.map +0 -1
- package/dist/hooks/todoLayout.js +0 -177
- package/dist/hooks/todoLayout.js.map +0 -1
- package/dist/hooks/validateArtifact/agentFacing.js.map +0 -1
- package/dist/hooks/validateArtifact/index.js.map +0 -1
- package/dist/hooks/validateArtifact/markdown.js.map +0 -1
- package/dist/hooks/validateArtifact/runtime.js +0 -86
- package/dist/hooks/validateArtifact/runtime.js.map +0 -1
- package/dist/hooks/validateArtifact/schema.js.map +0 -1
- package/dist/hooks/validateArtifact/traversal.js.map +0 -1
- package/dist/hooks/validateArtifact/violations.js.map +0 -1
- package/dist/hooks/validateArtifact.js +0 -924
- package/dist/hooks/validateArtifact.js.map +0 -1
- package/dist/migrate/v2HandoffManifest.js.map +0 -1
- package/dist/registries/artifactProtocolIds.js.map +0 -1
- package/dist/registries/artifactRegistry.js.map +0 -1
- package/dist/registries/capabilityContract.js.map +0 -1
- package/dist/registries/evaluatorHandoffContract.js.map +0 -1
- package/dist/registries/packageRegistry.js.map +0 -1
- package/dist/registries/runtimeAdapterRegistry.js +0 -316
- package/dist/registries/runtimeAdapterRegistry.js.map +0 -1
- package/dist/registries/triggerLoader.js.map +0 -1
- package/dist/release/releaseMetadata.js.map +0 -1
- package/dist/routing/index.js +0 -2
- package/dist/routing/index.js.map +0 -1
- package/dist/routing/routeEngine.js +0 -189
- package/dist/routing/routeEngine.js.map +0 -1
- package/dist/setup/codex/agents.js +0 -96
- package/dist/setup/codex/agents.js.map +0 -1
- package/dist/setup/codex/cli.js +0 -161
- package/dist/setup/codex/cli.js.map +0 -1
- package/dist/setup/codex/configToml.js +0 -639
- package/dist/setup/codex/configToml.js.map +0 -1
- package/dist/setup/codex/constants.js +0 -29
- package/dist/setup/codex/constants.js.map +0 -1
- package/dist/setup/codex/installRoot.js +0 -64
- package/dist/setup/codex/installRoot.js.map +0 -1
- package/dist/setup/codex/state.js +0 -270
- package/dist/setup/codex/state.js.map +0 -1
- package/dist/setup/codex.js +0 -12
- package/dist/setup/codex.js.map +0 -1
- package/dist/setup/copilot.js +0 -227
- package/dist/setup/copilot.js.map +0 -1
- package/dist/setup/cursor.js +0 -129
- package/dist/setup/cursor.js.map +0 -1
- package/dist/setup/cursorSurfaces.js +0 -67
- package/dist/setup/cursorSurfaces.js.map +0 -1
- package/dist/setup/doctor/core.js +0 -300
- package/dist/setup/doctor/core.js.map +0 -1
- package/dist/setup/doctor/diagnostics.js +0 -240
- package/dist/setup/doctor/diagnostics.js.map +0 -1
- package/dist/setup/doctor/opencode.js +0 -313
- package/dist/setup/doctor/opencode.js.map +0 -1
- package/dist/setup/doctor/report.js +0 -425
- package/dist/setup/doctor/report.js.map +0 -1
- package/dist/setup/doctor.js +0 -10
- package/dist/setup/doctor.js.map +0 -1
- package/dist/setup/opencode.js.map +0 -1
- package/dist/setup/smokeChecks.js.map +0 -1
- package/dist/state/installRoot.js.map +0 -1
- package/dist/state/progressCommit.js +0 -289
- package/dist/state/progressCommit.js.map +0 -1
- package/dist/state/startupAnalysis/benchmark.js.map +0 -1
- package/dist/state/startupAnalysis/contract.js.map +0 -1
- package/dist/state/startupAnalysis/helpers.js.map +0 -1
- package/dist/state/startupAnalysis/index.js.map +0 -1
- package/dist/state/startupAnalysis/metrics.js.map +0 -1
- package/dist/state/startupAnalysis/records.js.map +0 -1
- package/dist/state/startupAnalysis/report.js.map +0 -1
- package/dist/state/startupAnalysis/threshold.js.map +0 -1
- package/dist/state/startupAnalysis.js.map +0 -1
- package/dist/upgrade/appContentRefresh.js.map +0 -1
- package/dist/upgrade/appModel.js.map +0 -1
- package/dist/upgrade/bundleEvidence.js.map +0 -1
- package/dist/upgrade/channels.js.map +0 -1
- package/dist/upgrade/cliProbe.js +0 -22
- package/dist/upgrade/cliProbe.js.map +0 -1
- package/dist/upgrade/coexistenceProbe.js +0 -107
- package/dist/upgrade/coexistenceProbe.js.map +0 -1
- package/dist/upgrade/compatibility.js.map +0 -1
- package/dist/upgrade/doctor.js.map +0 -1
- package/dist/upgrade/doctorClassifier.js.map +0 -1
- package/dist/upgrade/installedHooksRetirement.js.map +0 -1
- package/dist/upgrade/legacyAgentCleanup.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV1ToV2.js +0 -570
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +0 -1
- package/dist/upgrade/nextMajorDoctor.js.map +0 -1
- package/dist/upgrade/npxPlatformStatus.js.map +0 -1
- package/dist/upgrade/projectIntegration.js.map +0 -1
- package/dist/upgrade/projectIntegrationDecision.js.map +0 -1
- package/dist/upgrade/runtimeMigration.js.map +0 -1
- package/dist/upgrade/upgradeCommands.js.map +0 -1
- package/dist/upgrade/upgradeOrchestrator.js.map +0 -1
- package/dist/upgrade/v3CapabilitySurface.js.map +0 -1
- package/dist/upgrade/versionResolution.js.map +0 -1
- package/dist/validate/appHomeContract.js.map +0 -1
- package/dist/validate/capability.js.map +0 -1
- package/dist/validate/crossCapability.js.map +0 -1
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js +0 -93
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js.map +0 -1
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js +0 -488
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js.map +0 -1
- package/dist/validate/lifecycleAdapters/shared.js +0 -198
- package/dist/validate/lifecycleAdapters/shared.js.map +0 -1
- package/dist/validate/lifecycleAdapters.js +0 -62
- package/dist/validate/lifecycleAdapters.js.map +0 -1
- package/dist/validate/selfAudit.js.map +0 -1
- package/dist/validate/vocabularyAuthority.js.map +0 -1
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { publicDoctorStatus } from "../../../upgrade/doctor.js";
|
|
2
2
|
import { projectInstallTrack } from "../../../upgrade/compatibility.js";
|
|
3
|
-
import { formatNextAction } from "../../orientation.js";
|
|
4
|
-
import { requestedFields, REQUIRED_SPARSE_CONTEXT_FIELDS } from "../../stateQuery.js";
|
|
3
|
+
import { formatNextAction, startupPlanSummary } from "../../orientation.js";
|
|
4
|
+
import { requestedFields, REQUIRED_SPARSE_CONTEXT_FIELDS, PRIME_STRUCTURED_FIELDS, RETIRED_PRIME_FIELD_CORRECTIONS, availablePrimeFields, } from "../../stateQuery.js";
|
|
5
5
|
import { emitStructured } from "../../structured.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { emitInvalidInput } from "../../errors.js";
|
|
7
|
+
import { preCutoverCommand } from "../../preCutoverCommand.js";
|
|
8
|
+
import { truncateCodePoints } from "../../../core/text.js";
|
|
9
|
+
import { briefOrientationPayload, briefUtf8Bytes } from "./briefOrientation.js";
|
|
10
|
+
import { capabilityContext } from "../../capabilityContext/contract.js";
|
|
11
|
+
import { startupAggregation } from "../../capabilityContext/startupAggregation.js";
|
|
12
|
+
export { briefOrientationPayload, PRIME_BRIEF_MAX_UTF8_BYTES } from "./briefOrientation.js";
|
|
13
|
+
/** Authority for the complete status startup capsule, including instructions. */
|
|
14
|
+
export const PRIME_STATUS_CONTEXT_MAX_UTF8_BYTES = 22500;
|
|
8
15
|
/** Project a single {@link NextAction} to its JSON record shape. */
|
|
9
16
|
function nextActionEntry(action) {
|
|
10
|
-
return {
|
|
17
|
+
return {
|
|
18
|
+
object: action.object,
|
|
19
|
+
capability: action.capability,
|
|
20
|
+
reason: action.reason,
|
|
21
|
+
phase: action.phase,
|
|
22
|
+
...(action.id ? { id: action.id } : {}),
|
|
23
|
+
...(action.artifact ? { artifact: action.artifact } : {}),
|
|
24
|
+
...(action.outcome ? { outcome: action.outcome } : {}),
|
|
25
|
+
...(typeof action.eligible === "boolean" ? { eligible: action.eligible } : {}),
|
|
26
|
+
...(action.retrieval ? { retrieval: action.retrieval } : {}),
|
|
27
|
+
};
|
|
11
28
|
}
|
|
12
29
|
/** Ranked state-readiness hint for the prime JSON `next_action` field (D76).
|
|
13
30
|
* The recommended entry is flattened to top-level `object`/`capability`/
|
|
@@ -15,33 +32,75 @@ function nextActionEntry(action) {
|
|
|
15
32
|
* and `alternatives` carries the cascade branches the early-return model
|
|
16
33
|
* would have skipped, each with the same `{object, capability, reason, phase}`
|
|
17
34
|
* shape. */
|
|
18
|
-
function nextActionPayload(
|
|
19
|
-
const { recommended, alternatives } = state.next_action;
|
|
35
|
+
function nextActionPayload({ recommended, alternatives }) {
|
|
20
36
|
return {
|
|
21
37
|
...nextActionEntry(recommended),
|
|
22
38
|
alternatives: alternatives.map(nextActionEntry),
|
|
23
39
|
};
|
|
24
40
|
}
|
|
25
|
-
const STATUS_STRUCTURED_FIELDS =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
const STATUS_STRUCTURED_FIELDS = PRIME_STRUCTURED_FIELDS;
|
|
42
|
+
const DEFAULT_PUBLIC_ATTENTION_LIMIT = 6;
|
|
43
|
+
export function projectPublicOrientationAttention(state) {
|
|
44
|
+
const glossary = state.glossary_caveat_attention;
|
|
45
|
+
const policy = state.glossary_caveat_attention_policy;
|
|
46
|
+
if (!glossary || !policy)
|
|
47
|
+
return state.attention.slice(0, DEFAULT_PUBLIC_ATTENTION_LIMIT);
|
|
48
|
+
const unrelated = state.attention.filter((item) => item !== glossary);
|
|
49
|
+
const unrelatedLimit = Math.max(0, policy.public_limit - policy.reserved_slots);
|
|
50
|
+
return [...unrelated.slice(0, unrelatedLimit), glossary].slice(0, policy.public_limit);
|
|
51
|
+
}
|
|
52
|
+
/** Top-level conditional fields whose default/inactive payload is omitted from
|
|
53
|
+
* the default bare briefing so startup does not carry default-only adjective
|
|
54
|
+
* noise. They remain declared in PRIME_STRUCTURED_FIELDS (selectable via
|
|
55
|
+
* `--fields` and advertised in `source_contract.fields`) and are recovered
|
|
56
|
+
* through `state_presence` (missing-vs-empty semantics) plus a named
|
|
57
|
+
* authoritative command. The full payload kept by `buildOrientationJsonPayload`
|
|
58
|
+
* still populates them, so explicit `--fields <name>` selection, the text
|
|
59
|
+
* briefing, and downstream state consumers are unaffected. */
|
|
60
|
+
const OMITTABLE_DEFAULT_CONDITIONAL_TOP_FIELDS = [
|
|
61
|
+
"v1_migration",
|
|
62
|
+
"docs",
|
|
63
|
+
"objective",
|
|
30
64
|
];
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
65
|
+
/** Whether a conditional top-level field carries present/active payload (not the
|
|
66
|
+
* default-only state that should be omitted from the default briefing). The
|
|
67
|
+
* activity predicate mirrors each summary's "default" branch so absence stays
|
|
68
|
+
* non-ambiguous: a survivor key is present exactly when the field is active. */
|
|
69
|
+
function isConditionalFieldPresent(field, payload) {
|
|
70
|
+
const value = payload[field];
|
|
71
|
+
if (value === null || value === undefined)
|
|
36
72
|
return false;
|
|
37
|
-
if (
|
|
73
|
+
if (typeof value !== "object" || Array.isArray(value))
|
|
38
74
|
return true;
|
|
39
|
-
|
|
75
|
+
const obj = value;
|
|
76
|
+
// v1_migration: present when v1 artifacts are detected (detected !== true is
|
|
77
|
+
// the default state; recover via `agentera upgrade --dry-run`).
|
|
78
|
+
if (field === "v1_migration")
|
|
79
|
+
return obj.detected === true;
|
|
80
|
+
// docs: present when a docs mapping artifact exists (exists !== true is the
|
|
81
|
+
// absent state; recover via the canonical docs list command).
|
|
82
|
+
if (field === "docs")
|
|
83
|
+
return obj.exists === true;
|
|
84
|
+
// objective: present when an objective is active (active !== true is the
|
|
85
|
+
// none-active state; state_presence.active.objective disambiguates).
|
|
86
|
+
if (field === "objective")
|
|
87
|
+
return obj.active === true;
|
|
88
|
+
return true;
|
|
40
89
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
90
|
+
/** Return a default-briefing copy of `payload` with inactive conditional
|
|
91
|
+
* top-level fields removed. Required fields and `state_presence` (the
|
|
92
|
+
* missing-vs-empty authority) are always retained. Used only by the default
|
|
93
|
+
* bare emission path; explicit `--fields` selection keeps the full payload. */
|
|
94
|
+
function omitInactiveConditionalDefaults(payload) {
|
|
95
|
+
const out = {};
|
|
96
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
97
|
+
if (OMITTABLE_DEFAULT_CONDITIONAL_TOP_FIELDS.includes(key) &&
|
|
98
|
+
!isConditionalFieldPresent(key, payload)) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
out[key] = value;
|
|
44
102
|
}
|
|
103
|
+
return out;
|
|
45
104
|
}
|
|
46
105
|
function orientationAppHome(bundle) {
|
|
47
106
|
return {
|
|
@@ -53,11 +112,23 @@ function orientationAppHome(bundle) {
|
|
|
53
112
|
user_data_root: bundle.userDataRoot,
|
|
54
113
|
};
|
|
55
114
|
}
|
|
56
|
-
|
|
115
|
+
function capabilityContextPointer(requiredBeforeRendering = true) {
|
|
116
|
+
return {
|
|
117
|
+
capability: "status",
|
|
118
|
+
fetch_command: preCutoverCommand("prime --context status --format json"),
|
|
119
|
+
required_before_rendering: requiredBeforeRendering,
|
|
120
|
+
note: requiredBeforeRendering
|
|
121
|
+
? "Dashboard rendering instructions (template, field rules, exit marker) are owned by the status capability. Run the fetch_command before rendering."
|
|
122
|
+
: "Includes dashboard instructions and bounded state; no second prime call.",
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function buildOrientationJsonPayload(state, command, options = {}) {
|
|
57
126
|
const bundle = state.app;
|
|
58
127
|
const schemasDir = state.schemas_dir;
|
|
59
128
|
const bundlePublic = publicDoctorStatus(bundle);
|
|
60
129
|
const appHome = orientationAppHome(bundle);
|
|
130
|
+
const todoReconciliation = state.todo_reconciliation ?? null;
|
|
131
|
+
const startup = startupAggregation(capabilityContext("status") ?? {}, state.health, state.state_cutover, todoReconciliation);
|
|
61
132
|
const bespoke = {
|
|
62
133
|
orchestration_context: null,
|
|
63
134
|
closeout_context: null,
|
|
@@ -73,24 +144,26 @@ export function buildOrientationJsonPayload(state, command) {
|
|
|
73
144
|
: "single installed CLI call; app/v1/profile safety included; no preflight glob/read/import/doctor calls during normal prime";
|
|
74
145
|
return {
|
|
75
146
|
command,
|
|
76
|
-
|
|
147
|
+
outcome: startup.outcome,
|
|
77
148
|
app_home: appHome,
|
|
78
149
|
app: bundlePublic,
|
|
79
150
|
mode: state.mode,
|
|
80
|
-
profile: state.profile_dict,
|
|
81
151
|
v1_migration: state.v1_migration,
|
|
152
|
+
shared_skill: state.shared_skill,
|
|
82
153
|
project_integration: state.project_integration,
|
|
154
|
+
...(state.todo_reconciliation?.status === "action_required" ? { todo_reconciliation: state.todo_reconciliation } : {}),
|
|
83
155
|
health: state.health,
|
|
84
|
-
todo: state.counts,
|
|
85
|
-
|
|
86
|
-
plan: state.plan,
|
|
156
|
+
todo: { ...state.counts, detail: state.todo_detail },
|
|
157
|
+
plan: startupPlanSummary(state.plan),
|
|
87
158
|
docs: state.docs,
|
|
88
159
|
progress: state.progress,
|
|
89
160
|
objective: state.objective,
|
|
90
161
|
state_presence: state.state_presence,
|
|
91
|
-
attention: state.
|
|
162
|
+
attention: projectPublicOrientationAttention(state).map((item) => truncateCodePoints(item, 200, "…")),
|
|
92
163
|
decision_attention: state.decision_attention,
|
|
93
|
-
|
|
164
|
+
history: state.history,
|
|
165
|
+
next_action: nextActionPayload(state.next_action),
|
|
166
|
+
startup,
|
|
94
167
|
orchestration_context: bespoke.orchestration_context,
|
|
95
168
|
closeout_context: bespoke.closeout_context,
|
|
96
169
|
evidence_context: bespoke.evidence_context,
|
|
@@ -102,24 +175,113 @@ export function buildOrientationJsonPayload(state, command) {
|
|
|
102
175
|
artifacts_present: state.mode === "returning",
|
|
103
176
|
},
|
|
104
177
|
source_contract: {
|
|
105
|
-
fields: STATUS_STRUCTURED_FIELDS,
|
|
178
|
+
fields: state.todo_reconciliation?.status === "action_required" ? [...STATUS_STRUCTURED_FIELDS, "todo_reconciliation"] : STATUS_STRUCTURED_FIELDS,
|
|
106
179
|
render,
|
|
107
180
|
access,
|
|
108
|
-
empty_state: "fresh
|
|
109
|
-
|
|
110
|
-
capability_context: null,
|
|
181
|
+
empty_state: "fresh: summaries absent; zero TODO items",
|
|
182
|
+
capability_context: capabilityContextPointer(options.capabilityContextRequiredBeforeRendering ?? true),
|
|
111
183
|
},
|
|
112
184
|
};
|
|
113
185
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
186
|
+
/** The status dashboard consumes a compact view of the one startup aggregation. */
|
|
187
|
+
export function buildStatusContextState(state, _command = "prime", _options = {}) {
|
|
188
|
+
const todoReconciliation = state.todo_reconciliation ?? null;
|
|
189
|
+
const startup = startupAggregation(capabilityContext("status") ?? {}, state.health, state.state_cutover, todoReconciliation);
|
|
190
|
+
const plan = state.plan;
|
|
191
|
+
const firstPending = plan.first_pending && typeof plan.first_pending === "object" && !Array.isArray(plan.first_pending)
|
|
192
|
+
? plan.first_pending
|
|
193
|
+
: null;
|
|
194
|
+
const risks = todoReconciliation?.risks;
|
|
195
|
+
const unsafeDetailOmitted = todoReconciliation?.state === "unsafe_inactive"
|
|
196
|
+
&& Boolean(risks && typeof risks === "object" && !Array.isArray(risks) && Number(risks.omitted_count) > 0);
|
|
197
|
+
const recovery = unsafeDetailOmitted && typeof todoReconciliation.recovery_command === "string"
|
|
198
|
+
? todoReconciliation.recovery_command
|
|
199
|
+
: null;
|
|
200
|
+
const todoAttention = unsafeDetailOmitted
|
|
201
|
+
? new Set(state.todo_items.map((item) => `${String(item.severity)}: TODO: ${String(item.text)}`))
|
|
202
|
+
: new Set();
|
|
203
|
+
const attention = projectPublicOrientationAttention(state)
|
|
204
|
+
.flatMap((item) => item === `action-required: TODO reconciliation is unsafe inactive; ${recovery}`
|
|
205
|
+
? ["action-required: TODO reconciliation is unsafe inactive; see capability_context.startup.todo_reconciliation"]
|
|
206
|
+
: todoAttention.has(item) ? [] : [item])
|
|
207
|
+
.map((item) => truncateCodePoints(item, 200, "…"));
|
|
208
|
+
const redactRecovery = (action) => recovery !== null && action.reason === recovery
|
|
209
|
+
? { ...action, reason: "See capability_context.startup.todo_reconciliation for recovery." }
|
|
210
|
+
: action;
|
|
211
|
+
const nextAction = {
|
|
212
|
+
recommended: redactRecovery(state.next_action.recommended),
|
|
213
|
+
alternatives: state.next_action.alternatives
|
|
214
|
+
.filter((action) => !unsafeDetailOmitted || action.artifact !== "todo")
|
|
215
|
+
.map(redactRecovery),
|
|
216
|
+
};
|
|
217
|
+
return {
|
|
218
|
+
outcome: startup.outcome,
|
|
219
|
+
mode: state.mode,
|
|
220
|
+
project_integration: {
|
|
221
|
+
recommendation: state.project_integration.recommendation,
|
|
222
|
+
...(state.project_integration.message ? { message: state.project_integration.message } : {}),
|
|
223
|
+
...(state.project_integration.dry_run_command ? { dry_run_command: state.project_integration.dry_run_command } : {}),
|
|
224
|
+
...(state.project_integration.apply_command ? { apply_command: state.project_integration.apply_command } : {}),
|
|
225
|
+
},
|
|
226
|
+
health: {
|
|
227
|
+
exists: state.health.exists,
|
|
228
|
+
status: state.health.status ?? null,
|
|
229
|
+
id: state.health.id ?? null,
|
|
230
|
+
grade: state.health.grade ?? null,
|
|
231
|
+
worst: state.health.worst ?? null,
|
|
232
|
+
trajectory: state.health.trajectory ?? null,
|
|
233
|
+
degrading: Boolean(state.health.degrading),
|
|
234
|
+
},
|
|
235
|
+
todo: { ...state.counts, detail: state.todo_detail },
|
|
236
|
+
plan: {
|
|
237
|
+
exists: plan.exists,
|
|
238
|
+
active: plan.active ?? false,
|
|
239
|
+
id: plan.id ?? null,
|
|
240
|
+
artifact: plan.exists ? plan.artifact ?? "plan" : null,
|
|
241
|
+
status: plan.status,
|
|
242
|
+
title: plan.title ?? null,
|
|
243
|
+
complete: plan.complete ?? 0,
|
|
244
|
+
total: plan.total ?? 0,
|
|
245
|
+
complete_plan: plan.complete_plan ?? false,
|
|
246
|
+
first_pending: firstPending ? {
|
|
247
|
+
id: firstPending.id ?? null,
|
|
248
|
+
artifact: firstPending.artifact ?? "plan",
|
|
249
|
+
name: firstPending.name ?? firstPending.title ?? null,
|
|
250
|
+
status: firstPending.status ?? null,
|
|
251
|
+
} : null,
|
|
252
|
+
},
|
|
253
|
+
progress: { exists: state.progress.exists, status: state.progress.status ?? null, latest: state.progress.latest ?? null },
|
|
254
|
+
objective: { exists: state.objective.exists, active: state.objective.active ?? false, title: state.objective.title ?? null },
|
|
255
|
+
state_presence: state.state_presence,
|
|
256
|
+
attention,
|
|
257
|
+
next_action: nextActionPayload(nextAction),
|
|
258
|
+
};
|
|
117
259
|
}
|
|
118
|
-
export function emitPrime(command, payload, format, fieldsArg, out, err) {
|
|
260
|
+
export function emitPrime(command, payload, format, fieldsArg, out, err, options = {}) {
|
|
261
|
+
const retiredRejection = rejectRetiredPrimeFields(command, format, fieldsArg, out, err);
|
|
262
|
+
if (retiredRejection !== null)
|
|
263
|
+
return retiredRejection;
|
|
119
264
|
const requested = requestedFields(fieldsArg);
|
|
120
|
-
|
|
265
|
+
// The default bare briefing first omits inactive conditional top-level fields
|
|
266
|
+
// (v1_migration/docs/objective when default) so startup does not carry
|
|
267
|
+
// default-only payload, then — for the bare default only — projects the full
|
|
268
|
+
// payload to a bounded decision brief (Plan Task 3). Explicit `--fields`
|
|
269
|
+
// selection and `--context` use their governed payloads. Dashboard history is
|
|
270
|
+
// already projected at collection time so ordinary list detail is not copied
|
|
271
|
+
// into startup (see default_emission_omission_contract + brief_omission_contract).
|
|
272
|
+
const conditional = requested.length === 0 && options.bareBrief ? omitInactiveConditionalDefaults(payload) : payload;
|
|
273
|
+
const effectivePayload = requested.length === 0 && options.bareBrief
|
|
274
|
+
? briefOrientationPayload(conditional, { budgetBytes: options.briefBudgetBytes })
|
|
275
|
+
: conditional;
|
|
121
276
|
if (requested.length === 0) {
|
|
122
|
-
|
|
277
|
+
if (format === "json" && options.maxUtf8Bytes !== undefined) {
|
|
278
|
+
const bytes = briefUtf8Bytes(effectivePayload);
|
|
279
|
+
if (bytes > options.maxUtf8Bytes) {
|
|
280
|
+
err(`Error: ${command} JSON output is ${bytes} UTF-8 bytes, over the ${options.maxUtf8Bytes}-byte startup budget; use the named recovery commands in the projected output contract.\n`);
|
|
281
|
+
return 1;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
emitStructured(effectivePayload, format, out);
|
|
123
285
|
return 0;
|
|
124
286
|
}
|
|
125
287
|
const available = availablePrimeFields(command);
|
|
@@ -133,14 +295,40 @@ export function emitPrime(command, payload, format, fieldsArg, out, err) {
|
|
|
133
295
|
if (field in payload && !(field in selected))
|
|
134
296
|
selected[field] = payload[field];
|
|
135
297
|
}
|
|
298
|
+
if (format === "json" && options.maxUtf8Bytes !== undefined) {
|
|
299
|
+
const bytes = briefUtf8Bytes(selected);
|
|
300
|
+
if (bytes > options.maxUtf8Bytes) {
|
|
301
|
+
err(`Error: ${command} JSON output is ${bytes} UTF-8 bytes, over the ${options.maxUtf8Bytes}-byte startup budget; use the named recovery commands in the projected output contract.\n`);
|
|
302
|
+
return 1;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
136
305
|
emitStructured(selected, format, out);
|
|
137
306
|
return 0;
|
|
138
307
|
}
|
|
308
|
+
/** Reject a retired selector before state collection or output projection. Text
|
|
309
|
+
* mode uses JSON because a retired-field request is an automation-shaped
|
|
310
|
+
* selector and must return one machine-readable correction, not a briefing. */
|
|
311
|
+
export function rejectRetiredPrimeFields(command, format, fieldsArg, out, err) {
|
|
312
|
+
const requested = requestedFields(fieldsArg);
|
|
313
|
+
const retired = requested.find((field) => field in RETIRED_PRIME_FIELD_CORRECTIONS);
|
|
314
|
+
if (retired === undefined)
|
|
315
|
+
return null;
|
|
316
|
+
const replacement = RETIRED_PRIME_FIELD_CORRECTIONS[retired];
|
|
317
|
+
return emitInvalidInput({ out, err }, {
|
|
318
|
+
format: format === "yaml" ? "yaml" : "json",
|
|
319
|
+
body: {
|
|
320
|
+
class: "invalid_choice",
|
|
321
|
+
message: `prime field '${retired}' is retired; use '${replacement}'`,
|
|
322
|
+
valid_values: [replacement],
|
|
323
|
+
syntax: preCutoverCommand(`${command} --fields ${replacement} --format json`),
|
|
324
|
+
example: preCutoverCommand(`${command} --fields ${replacement} --format json`),
|
|
325
|
+
recovery: `Replace '${retired}' with '${replacement}' and retry; no state was changed.`,
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
}
|
|
139
329
|
export function printOrientationTextBriefing(state, command, out) {
|
|
140
330
|
const bundle = state.app;
|
|
141
331
|
const mode = state.mode;
|
|
142
|
-
const profileStatus = state.profile_status;
|
|
143
|
-
const profile = state.profile;
|
|
144
332
|
const health = state.health;
|
|
145
333
|
const counts = state.counts;
|
|
146
334
|
const plan = state.plan;
|
|
@@ -149,24 +337,47 @@ export function printOrientationTextBriefing(state, command, out) {
|
|
|
149
337
|
const attention = state.attention;
|
|
150
338
|
const nextAction = state.next_action;
|
|
151
339
|
const dashboardLabel = command === "prime" ? "prime orientation dashboard" : "prime orientation dashboard";
|
|
152
|
-
out(
|
|
340
|
+
out(`${preCutoverCommand(command)}\n`);
|
|
153
341
|
out(`app_home: install_track=${projectInstallTrack(bundle.installKind)} | status=${bundle.status} | home=${bundle.appHome} | ` +
|
|
154
342
|
`source=${bundle.appHomeSource} | managed_app=${bundle.managedAppRoot} | user_data=${bundle.userDataRoot} | expected=${bundle.expectedVersion} | ` +
|
|
155
343
|
`expected_source=${bundle.expectedVersionSource ?? "-"} | current=${bundle.markerVersion || "-"}\n`);
|
|
156
344
|
out(`mode: ${mode}\n`);
|
|
157
345
|
const projectIntegration = state.project_integration;
|
|
158
346
|
out(`project_integration: recommendation=${projectIntegration.recommendation} | ` +
|
|
159
|
-
`channel=${projectIntegration.update_channel} |
|
|
347
|
+
`channel=${projectIntegration.update_channel} | pending_artifacts=${projectIntegration.pending_artifacts}\n`);
|
|
160
348
|
if (projectIntegration.recommendation === "upgrade" && projectIntegration.message) {
|
|
161
349
|
out(`project_integration_message: ${projectIntegration.message}\n`);
|
|
162
350
|
}
|
|
163
|
-
out(`
|
|
164
|
-
|
|
351
|
+
out(`shared_skill: status=${String(state.shared_skill.status)} | path=${String(state.shared_skill.path)}\n`);
|
|
352
|
+
const todoReconciliation = state.todo_reconciliation ?? null;
|
|
353
|
+
const startup = startupAggregation(capabilityContext("status") ?? {}, state.health, state.state_cutover, todoReconciliation);
|
|
354
|
+
out(`outcome: ${String(startup.outcome)}\n`);
|
|
355
|
+
if (health.exists && health.id) {
|
|
165
356
|
const worst = health.worst;
|
|
166
357
|
const worstText = worst ? `${worst[0]}:${worst[1]}` : "none";
|
|
167
|
-
out(`health:
|
|
358
|
+
out(`health: id=${health.id} | artifact=${health.artifact ?? "health"} | grade=${health.grade || "unknown"} | ` +
|
|
168
359
|
`trajectory=${health.trajectory || "unknown"} | worst=${worstText}\n`);
|
|
169
360
|
}
|
|
361
|
+
if (health.degraded_history) {
|
|
362
|
+
const degraded = health.degraded_history;
|
|
363
|
+
out(`health: degraded_history | summaries=${String(degraded.summary_count ?? 0)} | returned=${String(degraded.returned_count ?? 0)} | omitted=${String(degraded.omitted_count ?? 0)} | ` +
|
|
364
|
+
`detail=summary-only | recovery=${preCutoverCommand("state health list --limit 20 --format json")}\n`);
|
|
365
|
+
}
|
|
366
|
+
const latestProgress = state.progress.latest;
|
|
367
|
+
if (latestProgress) {
|
|
368
|
+
out(`progress: id=${String(latestProgress.id ?? "unknown")} | artifact=${String(latestProgress.artifact ?? "progress")} | ` +
|
|
369
|
+
`what=${String(latestProgress.what ?? "unknown")}\n`);
|
|
370
|
+
}
|
|
371
|
+
if (state.progress.degraded_history) {
|
|
372
|
+
const degraded = state.progress.degraded_history;
|
|
373
|
+
out(`progress: degraded_history | summaries=${String(degraded.summary_count ?? 0)} | returned=${String(degraded.returned_count ?? 0)} | omitted=${String(degraded.omitted_count ?? 0)} | ` +
|
|
374
|
+
`detail=summary-only | recovery=${preCutoverCommand("state progress list --limit 20 --format json")}\n`);
|
|
375
|
+
}
|
|
376
|
+
const decisionHistory = state.history.decisions?.degraded_history;
|
|
377
|
+
if (decisionHistory) {
|
|
378
|
+
out(`decisions: degraded_history | summaries=${String(decisionHistory.summary_count ?? 0)} | returned=${String(decisionHistory.returned_count ?? 0)} | omitted=${String(decisionHistory.omitted_count ?? 0)} | ` +
|
|
379
|
+
`detail=summary-only | recovery=${preCutoverCommand("state decisions list --limit 20 --format json")}\n`);
|
|
380
|
+
}
|
|
170
381
|
out(`todo: critical=${counts.critical} | degraded=${counts.degraded} | normal=${counts.normal} | annoying=${counts.annoying}\n`);
|
|
171
382
|
if (!presence.any_active) {
|
|
172
383
|
const missing = Object.keys(presence.absence).sort().join(", ") || "none";
|
|
@@ -187,7 +398,7 @@ export function printOrientationTextBriefing(state, command, out) {
|
|
|
187
398
|
}
|
|
188
399
|
if (attention.length > 0) {
|
|
189
400
|
out("attention:\n");
|
|
190
|
-
for (const item of
|
|
401
|
+
for (const item of projectPublicOrientationAttention(state))
|
|
191
402
|
out(`- ${item}\n`);
|
|
192
403
|
}
|
|
193
404
|
out("next_action:\n");
|
|
@@ -196,15 +407,15 @@ export function printOrientationTextBriefing(state, command, out) {
|
|
|
196
407
|
out(`- alt: ${formatNextAction(alt)}\n`);
|
|
197
408
|
}
|
|
198
409
|
out("source_contract:\n");
|
|
199
|
-
out(
|
|
410
|
+
out(`- fields=${PRIME_STRUCTURED_FIELDS.join(", ")}\n`);
|
|
200
411
|
out(`- render=caller-owned README-style ${dashboardLabel}\n`);
|
|
201
412
|
out("- access=single installed CLI call; app/v1/profile safety included; no preflight glob/read/import/doctor calls\n");
|
|
202
|
-
|
|
203
|
-
out(`-
|
|
413
|
+
out(`- startup_outcome=${String(startup.outcome)}\n`);
|
|
414
|
+
out(`- capability_context: fetch rendering instructions via \`${preCutoverCommand("prime --context status --format json")}\`\n`);
|
|
415
|
+
out(`- detail_discovery=${String(startup.detail_discovery.schema)}\n`);
|
|
204
416
|
out(`- raw_artifact_reads_required=${String(startup.raw_artifact_reads_required).toLowerCase()}; policy=${startup.raw_artifact_read_policy}\n`);
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
out(`-
|
|
417
|
+
const deferred = startup.availability
|
|
418
|
+
.filter((entry) => entry.availability === "deferred")
|
|
419
|
+
.map((entry) => String(entry.family));
|
|
420
|
+
out(`- deferred_detail=${deferred.join(", ") || "none"}\n`);
|
|
209
421
|
}
|
|
210
|
-
//# sourceMappingURL=orientationOutput.js.map
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import { PRIME_BLOB } from "../prime-blob.js";
|
|
2
2
|
import { buildPrimeCapabilityContextPayload, validatePrimeCapability } from "../capabilityContext.js";
|
|
3
3
|
import { collectOrientationState } from "./prime/collectOrientationState.js";
|
|
4
|
-
import { buildOrientationJsonPayload, emitPrime, printOrientationTextBriefing } from "./prime/orientationOutput.js";
|
|
4
|
+
import { buildOrientationJsonPayload, buildStatusContextState, emitPrime, rejectRetiredPrimeFields, PRIME_BRIEF_MAX_UTF8_BYTES, PRIME_STATUS_CONTEXT_MAX_UTF8_BYTES, printOrientationTextBriefing, } from "./prime/orientationOutput.js";
|
|
5
|
+
import { emitInvalidInput } from "../errors.js";
|
|
6
|
+
import { BuildExecutionRequestError, loadBuildExecutionRequest, } from "./prime/buildExecutionRequest.js";
|
|
7
|
+
import { preCutoverCommand } from "../preCutoverCommand.js";
|
|
5
8
|
export { collectOrientationState } from "./prime/collectOrientationState.js";
|
|
9
|
+
export function buildStatusCapabilityContextPayload(state, command = "prime") {
|
|
10
|
+
const payload = buildPrimeCapabilityContextPayload(state, "status", command);
|
|
11
|
+
return finalizeStatusCapabilityContextPayload(payload, state, command);
|
|
12
|
+
}
|
|
13
|
+
export function finalizeStatusCapabilityContextPayload(payload, state, command = "prime") {
|
|
14
|
+
const capabilityContext = payload.capability_context;
|
|
15
|
+
const context = capabilityContext.context;
|
|
16
|
+
// status_context carries the dashboard state. Startup availability remains
|
|
17
|
+
// singular on capability_context.startup.
|
|
18
|
+
delete capabilityContext.app;
|
|
19
|
+
// status_context already carries the canonical bounded plan projection.
|
|
20
|
+
delete context.plan;
|
|
21
|
+
context.status_context = buildStatusContextState(state, command, {
|
|
22
|
+
budgetBytes: PRIME_BRIEF_MAX_UTF8_BYTES,
|
|
23
|
+
degradedMode: "status_routing",
|
|
24
|
+
});
|
|
25
|
+
return payload;
|
|
26
|
+
}
|
|
6
27
|
/**
|
|
7
28
|
* prime orientation command. Port of scripts/agentera cmd_prime / cmd_status.
|
|
8
|
-
* The text briefing (default), --guidance, --dashboard, --context,
|
|
9
|
-
* --format json paths are all wired.
|
|
29
|
+
* The text briefing (default), --guidance, deprecated --dashboard, --context,
|
|
30
|
+
* and --format json paths are all wired.
|
|
10
31
|
*/
|
|
11
32
|
export function cmdPrime(args, io = {}) {
|
|
12
33
|
const out = io.out ?? ((t) => process.stdout.write(t));
|
|
@@ -15,6 +36,17 @@ export function cmdPrime(args, io = {}) {
|
|
|
15
36
|
const capability = args.context ?? null;
|
|
16
37
|
const dashboard = Boolean(args.dashboard || args.orientation);
|
|
17
38
|
const guidance = Boolean(args.guidance);
|
|
39
|
+
const input = args.input ?? null;
|
|
40
|
+
const format = args.format ?? "text";
|
|
41
|
+
const inputErrorFormat = args.format === "json" || args.format === "yaml" ? args.format : "text";
|
|
42
|
+
const rejectInput = (body) => emitInvalidInput(io, { format: inputErrorFormat, body });
|
|
43
|
+
if (input !== null && (capability !== "build" || dashboard || guidance)) {
|
|
44
|
+
return rejectInput({
|
|
45
|
+
class: "unsupported_target",
|
|
46
|
+
message: "--input is valid only with prime --context build",
|
|
47
|
+
syntax: preCutoverCommand("prime --context build --input <file|-> --format json"),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
18
50
|
if (capability !== null && dashboard) {
|
|
19
51
|
err("Error: prime --context and prime --dashboard/--orientation are mutually exclusive\n");
|
|
20
52
|
return 2;
|
|
@@ -27,12 +59,19 @@ export function cmdPrime(args, io = {}) {
|
|
|
27
59
|
err("Error: prime --dashboard/--orientation and prime --guidance are mutually exclusive\n");
|
|
28
60
|
return 2;
|
|
29
61
|
}
|
|
62
|
+
const retiredFieldRejection = rejectRetiredPrimeFields(command, format, args.fields, out, err);
|
|
63
|
+
if (retiredFieldRejection !== null)
|
|
64
|
+
return retiredFieldRejection;
|
|
30
65
|
if (guidance) {
|
|
31
66
|
out(PRIME_BLOB);
|
|
32
67
|
return 0;
|
|
33
68
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
69
|
+
const collectOpts = {
|
|
70
|
+
projectRoot: args.projectRoot,
|
|
71
|
+
home: args.home,
|
|
72
|
+
installRoot: args.installRoot,
|
|
73
|
+
expectedVersion: args.expectedVersion,
|
|
74
|
+
};
|
|
36
75
|
if (capability !== null) {
|
|
37
76
|
try {
|
|
38
77
|
validatePrimeCapability(capability);
|
|
@@ -45,25 +84,51 @@ export function cmdPrime(args, io = {}) {
|
|
|
45
84
|
err("Error: prime --context requires --format json\n");
|
|
46
85
|
return 2;
|
|
47
86
|
}
|
|
87
|
+
let buildRequest = null;
|
|
88
|
+
if (input !== null) {
|
|
89
|
+
try {
|
|
90
|
+
buildRequest = loadBuildExecutionRequest(input, io.stdin);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (error instanceof BuildExecutionRequestError)
|
|
94
|
+
return rejectInput(error.body);
|
|
95
|
+
return rejectInput({ class: "invalid_format", message: "Build execution request input could not be read" });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
48
98
|
const state = collectOrientationState(collectOpts);
|
|
49
|
-
|
|
50
|
-
|
|
99
|
+
if (buildRequest !== null && state.plan.active === true) {
|
|
100
|
+
return rejectInput({
|
|
101
|
+
class: "conflict",
|
|
102
|
+
message: "Transient no-plan Build input conflicts with the current plan-owned execution context",
|
|
103
|
+
recovery: "Run Build without --input for the current plan, or close/archive that plan before retrying; no state was changed.",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const payload = capability === "status"
|
|
107
|
+
? buildStatusCapabilityContextPayload(state, command)
|
|
108
|
+
: buildPrimeCapabilityContextPayload(state, capability, command, buildRequest);
|
|
109
|
+
return emitPrime(command, payload, format, args.fields, out, err, {
|
|
110
|
+
maxUtf8Bytes: capability === "status" ? PRIME_STATUS_CONTEXT_MAX_UTF8_BYTES : undefined,
|
|
111
|
+
});
|
|
51
112
|
}
|
|
52
113
|
if (dashboard) {
|
|
53
114
|
if (format === "text") {
|
|
54
115
|
err("Error: prime --dashboard requires --format json\n");
|
|
55
116
|
return 2;
|
|
56
117
|
}
|
|
118
|
+
err("Deprecation: prime --dashboard is retained as an alias for `prime --context status --format json`; use the status startup capsule directly.\n");
|
|
57
119
|
const state = collectOrientationState(collectOpts);
|
|
58
|
-
const payload =
|
|
59
|
-
return emitPrime(command, payload, format, args.fields, out, err
|
|
120
|
+
const payload = buildStatusCapabilityContextPayload(state, command);
|
|
121
|
+
return emitPrime(command, payload, format, args.fields, out, err, {
|
|
122
|
+
maxUtf8Bytes: PRIME_STATUS_CONTEXT_MAX_UTF8_BYTES,
|
|
123
|
+
});
|
|
60
124
|
}
|
|
61
125
|
const state = collectOrientationState(collectOpts);
|
|
62
126
|
if (format !== "text") {
|
|
63
127
|
const payload = buildOrientationJsonPayload(state, command);
|
|
64
|
-
|
|
128
|
+
// Bare default: project to the bounded decision brief (prime-briefing,
|
|
129
|
+
// 12000-byte budget). Explicit `--fields` selection keeps full payload.
|
|
130
|
+
return emitPrime(command, payload, format, args.fields, out, err, { bareBrief: true });
|
|
65
131
|
}
|
|
66
132
|
printOrientationTextBriefing(state, command, out);
|
|
67
133
|
return 0;
|
|
68
134
|
}
|
|
69
|
-
//# sourceMappingURL=prime.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { personalProfileGroundingContract } from "../../registries/glossaryEntryContract.js";
|
|
2
|
+
import { emitInvalidInput } from "../errors.js";
|
|
3
|
+
import { acquireProfile } from "../profileAcquisition.js";
|
|
4
|
+
import { emitStructured } from "../structured.js";
|
|
5
|
+
const COMMAND = "agentera report profile-grounding --format json";
|
|
6
|
+
const REQUEST_RECOVERY = `Run ${COMMAND}; no profile bytes were changed.`;
|
|
7
|
+
const INVALID_PROFILE_MESSAGE = "PROFILE.md is unavailable for bounded profile grounding.";
|
|
8
|
+
function invalid(io, body, recovery) {
|
|
9
|
+
return emitInvalidInput(io, { format: "json", body: { ...body, recovery } });
|
|
10
|
+
}
|
|
11
|
+
export function runProfileGroundingCommand(argv, io) {
|
|
12
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
13
|
+
const argument = argv[index];
|
|
14
|
+
const [name, inline] = argument.split("=", 2);
|
|
15
|
+
if (name !== "--format") {
|
|
16
|
+
return invalid(io, { class: "unrecognized_argument", message: "profile-grounding accepts only --format json", syntax: COMMAND }, REQUEST_RECOVERY);
|
|
17
|
+
}
|
|
18
|
+
const value = inline ?? argv[++index];
|
|
19
|
+
if (value !== "json") {
|
|
20
|
+
return invalid(io, { class: "invalid_choice", message: "profile-grounding requires --format json", valid_values: ["json"] }, REQUEST_RECOVERY);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const contract = personalProfileGroundingContract();
|
|
24
|
+
const acquired = acquireProfile();
|
|
25
|
+
const output = io.out ?? ((text) => process.stdout.write(text));
|
|
26
|
+
if (acquired.validity.status !== "valid" || acquired.groundingContent === null) {
|
|
27
|
+
emitStructured({
|
|
28
|
+
schemaVersion: contract.schemaVersion,
|
|
29
|
+
command: "report profile-grounding",
|
|
30
|
+
status: acquired.validity.status,
|
|
31
|
+
validity: acquired.validity,
|
|
32
|
+
freshness: acquired.freshness,
|
|
33
|
+
content: null,
|
|
34
|
+
recovery: acquired.validity.recovery,
|
|
35
|
+
error: {
|
|
36
|
+
class: "profile_unavailable",
|
|
37
|
+
message: INVALID_PROFILE_MESSAGE,
|
|
38
|
+
recovery: acquired.validity.recovery,
|
|
39
|
+
},
|
|
40
|
+
}, "json", output);
|
|
41
|
+
return 2;
|
|
42
|
+
}
|
|
43
|
+
emitStructured({
|
|
44
|
+
schemaVersion: contract.schemaVersion,
|
|
45
|
+
command: "report profile-grounding",
|
|
46
|
+
status: "ok",
|
|
47
|
+
validity: acquired.validity,
|
|
48
|
+
freshness: acquired.freshness,
|
|
49
|
+
content: acquired.groundingContent,
|
|
50
|
+
content_utf8_bytes: Buffer.byteLength(acquired.groundingContent),
|
|
51
|
+
excluded: "owned_personal_glossary_section",
|
|
52
|
+
recovery: null,
|
|
53
|
+
}, "json", output);
|
|
54
|
+
return 0;
|
|
55
|
+
}
|