agentera 3.0.0-dev.6 → 3.0.0-dev.69
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 +118 -22
- 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 +21 -0
- package/bundle/fixtures/routing/hybrid-corpus.yaml +154 -0
- package/bundle/references/adapters/package-publication.json +488 -0
- package/bundle/references/adapters/package-registry.yaml +435 -188
- package/bundle/references/adapters/package-surface-characterization.md +66 -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 +518 -0
- package/bundle/references/analysis/verification-policy.yaml +266 -0
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +20 -10
- package/bundle/references/artifacts/glossary-entry-contract.yaml +1254 -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 +7 -8
- 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 +155 -0
- package/bundle/references/cli/trigger-schema-enrichment.md +147 -0
- package/bundle/references/cli/update-channels.yaml +19 -2
- package/bundle/references/cli/vocabulary-index.yaml +20 -17
- package/bundle/references/cli/vocabulary.md +325 -362
- package/bundle/references/meta/retained-reference-authority.yaml +151 -0
- package/bundle/registry.json +13 -13
- package/bundle/skills/agentera/SKILL.md +226 -422
- 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/audit/schemas/triggers.yaml +25 -0
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +37 -18
- package/bundle/skills/agentera/capabilities/build/schemas/artifacts.yaml +103 -0
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +8 -6
- package/bundle/skills/agentera/capabilities/build/schemas/triggers.yaml +27 -0
- package/bundle/skills/agentera/capabilities/build/schemas/validation.yaml +184 -0
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +12 -12
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/design/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +51 -0
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/triggers.yaml +20 -0
- package/bundle/skills/agentera/capabilities/discuss/schemas/validation.yaml +144 -0
- package/bundle/skills/agentera/capabilities/document/schemas/artifacts.yaml +80 -0
- package/bundle/skills/agentera/capabilities/document/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +18 -18
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +18 -18
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/optimize/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +76 -0
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/exit.yaml +9 -7
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +121 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +66 -0
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/plan/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +121 -0
- package/bundle/skills/agentera/capabilities/profile/schemas/artifacts.yaml +23 -0
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +6 -5
- package/bundle/skills/agentera/capabilities/profile/schemas/triggers.yaml +20 -0
- package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +115 -0
- package/bundle/skills/agentera/capabilities/research/schemas/artifacts.yaml +24 -0
- package/bundle/skills/agentera/capabilities/research/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/status/schemas/artifacts.yaml +73 -0
- package/bundle/skills/agentera/capabilities/status/schemas/triggers.yaml +22 -0
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/artifacts.yaml +16 -16
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/vision/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +18 -20
- package/bundle/skills/agentera/capability_schema_contract.yaml +178 -34
- package/bundle/skills/agentera/protocol.yaml +31 -31
- package/bundle/skills/agentera/route-phrases.yaml +81 -0
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +5 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +39 -21
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +5 -4
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +15 -19
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +145 -14
- package/bundle/skills/agentera/schemas/artifacts/glossary.yaml +82 -0
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +58 -21
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +22 -8
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +461 -36
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +133 -20
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +342 -42
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +101 -12
- package/dist/analytics/extractCorpus/copilotSessions.js +53 -9
- package/dist/analytics/extractCorpus/core.js +59 -24
- package/dist/analytics/extractCorpus/corpus.js +58 -23
- package/dist/analytics/extractCorpus/coverageAudit.js +260 -0
- package/dist/analytics/extractCorpus/cursorSessions.js +12 -7
- package/dist/analytics/extractCorpus/evidenceTiers.js +603 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +105 -0
- package/dist/analytics/extractCorpus/filesystemSources.js +1 -5
- package/dist/analytics/extractCorpus/index.js +6 -1
- package/dist/analytics/extractCorpus/jsonlSessions.js +24 -5
- package/dist/analytics/extractCorpus/sqliteCaps.js +43 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js +98 -6
- 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 +133 -0
- package/dist/analytics/personalGlossaryProfile.js +219 -0
- package/dist/analytics/profileSignals.js +211 -0
- package/dist/analytics/usageStats.js +169 -42
- package/dist/audit/terminologyDrift.js +281 -0
- package/dist/bin/agentera.js +3 -2
- package/dist/capabilities/audit/instructions.js +16 -0
- package/dist/capabilities/build/instructions.js +59 -0
- package/dist/capabilities/design/instructions.js +4 -0
- package/dist/capabilities/discuss/instructions.js +29 -0
- package/dist/capabilities/document/instructions.js +11 -0
- package/dist/capabilities/index.js +29 -27
- package/dist/capabilities/optimize/instructions.js +14 -0
- package/dist/capabilities/orchestrate/instructions.js +42 -0
- package/dist/capabilities/plan/instructions.js +33 -0
- package/dist/capabilities/profile/instructions.js +70 -0
- package/dist/capabilities/research/instructions.js +5 -0
- package/dist/capabilities/status/instructions.js +15 -0
- package/dist/capabilities/status/startupInstructions.js +34 -0
- package/dist/capabilities/vision/instructions.js +4 -0
- package/dist/cli/appContext.js +30 -24
- package/dist/cli/argvalidate.js +0 -1
- package/dist/cli/capabilityContext/benchmark.js +25 -17
- package/dist/cli/capabilityContext/bespoke.js +31 -12
- package/dist/cli/capabilityContext/build.js +251 -0
- package/dist/cli/capabilityContext/closeout.js +33 -30
- package/dist/cli/capabilityContext/contract.js +39 -46
- package/dist/cli/capabilityContext/evidence.js +90 -73
- package/dist/cli/capabilityContext/index.js +1 -2
- package/dist/cli/capabilityContext/orchestration.js +45 -21
- package/dist/cli/capabilityContext/planState.js +93 -100
- package/dist/cli/capabilityContext/progress.js +60 -14
- package/dist/cli/capabilityContext/projectVerification.js +409 -0
- package/dist/cli/capabilityContext/shared.js +9 -20
- package/dist/cli/capabilityContext/slim.js +56 -10
- package/dist/cli/capabilityContext/startup.js +57 -115
- package/dist/cli/capabilityContext/startupAggregation.js +68 -0
- package/dist/cli/capabilityContext/types.js +37 -24
- package/dist/cli/capabilityContext.js +1 -2
- package/dist/cli/commands/appHome.js +22 -0
- package/dist/cli/commands/capability.js +4 -4
- package/dist/cli/commands/compact.js +163 -13
- package/dist/cli/commands/doctor.js +122 -114
- 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/personalGlossary.js +176 -0
- package/dist/cli/commands/prime/briefOrientation.js +746 -0
- package/dist/cli/commands/prime/buildExecutionRequest.js +165 -0
- package/dist/cli/commands/prime/bundleStatus.js +190 -0
- package/dist/cli/commands/prime/collectEntityOrientation.js +326 -0
- package/dist/cli/commands/prime/collectOrientationState.js +219 -0
- package/dist/cli/commands/prime/orientationOutput.js +421 -0
- package/dist/cli/commands/prime/types.js +1 -0
- package/dist/cli/commands/prime/v1Migration.js +38 -0
- package/dist/cli/commands/prime.js +80 -558
- package/dist/cli/commands/profileGrounding.js +55 -0
- package/dist/cli/commands/query.js +77 -52
- package/dist/cli/commands/report.js +88 -26
- package/dist/cli/commands/route.js +142 -0
- package/dist/cli/commands/schema.js +266 -142
- package/dist/cli/commands/state/decisions.js +51 -61
- package/dist/cli/commands/state/docs.js +63 -86
- package/dist/cli/commands/state/experimentRecords.js +151 -0
- package/dist/cli/commands/state/experiments.js +11 -64
- package/dist/cli/commands/state/get.js +129 -0
- package/dist/cli/commands/state/health.js +11 -111
- 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 -64
- package/dist/cli/commands/state/plan.js +11 -169
- 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 +29 -108
- 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 +246 -211
- package/dist/cli/commands/verify.js +24 -9
- package/dist/cli/contracts/bundleStatus.js +1 -0
- package/dist/cli/contracts/orientationState.js +1 -0
- package/dist/cli/dispatch/argvParser.js +32 -0
- package/dist/cli/dispatch/check.js +94 -50
- package/dist/cli/dispatch/commands.js +27 -0
- package/dist/cli/dispatch/index.js +82 -52
- package/dist/cli/dispatch/lifecycle.js +268 -108
- package/dist/cli/dispatch/prime.js +68 -29
- package/dist/cli/dispatch/projections.js +17 -0
- package/dist/cli/dispatch/shared.js +1 -2
- package/dist/cli/dispatch/state.js +68 -77
- package/dist/cli/dispatch.js +0 -1
- package/dist/cli/errors.js +16 -17
- package/dist/cli/help.js +395 -41
- package/dist/cli/migrationRequired.js +122 -0
- package/dist/cli/orientation/attention.js +61 -0
- package/dist/cli/orientation/corpusCoverage.js +102 -0
- package/dist/cli/orientation.js +438 -170
- 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 +59 -0
- package/dist/cli/stateQuery.js +56 -14
- 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 +18 -0
- package/dist/core/atomicWriter.js +20 -0
- package/dist/core/developmentChannel.js +1 -0
- package/dist/core/developmentInvocation.js +374 -0
- package/dist/core/difflib.js +0 -1
- package/dist/core/envPaths.js +20 -0
- package/dist/core/jsonValue.js +5 -0
- package/dist/core/paths.js +0 -1
- package/dist/core/pyjson.js +67 -3
- 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 +8 -1
- package/dist/eval/evalSkills.js +30 -26
- package/dist/eval/hybridRouteEvaluation.js +155 -0
- package/dist/eval/semanticEval.js +43 -20
- package/dist/eval/semanticFixtures.js +16 -5
- package/dist/hooks/common.js +3 -56
- package/dist/hooks/compaction/apply.js +252 -50
- package/dist/hooks/compaction/dryRun.js +7 -4
- package/dist/hooks/compaction/index.js +5 -6
- package/dist/hooks/compaction/parse.js +201 -5
- package/dist/hooks/compaction/retention.js +30 -25
- package/dist/hooks/compaction/status.js +149 -32
- package/dist/hooks/compaction/types.js +0 -1
- package/dist/hooks/validateArtifact/agentFacing.js +0 -1
- package/dist/hooks/validateArtifact/index.js +7 -64
- package/dist/hooks/validateArtifact/markdown.js +57 -7
- package/dist/hooks/validateArtifact/schema.js +110 -19
- package/dist/hooks/validateArtifact/traversal.js +13 -11
- package/dist/hooks/validateArtifact/violations.js +7 -5
- package/dist/migrate/v2HandoffManifest.js +127 -8
- package/dist/registries/activationContract.js +2 -0
- package/dist/registries/activationTuples.js +108 -0
- package/dist/registries/artifactProtocolIds.js +2 -1
- package/dist/registries/artifactRegistry.js +224 -63
- package/dist/registries/artifactSchemaProjection.js +45 -0
- package/dist/registries/capabilityContract.js +129 -2
- package/dist/registries/evaluatorHandoffContract.js +2 -3
- package/dist/registries/evidenceTierContract.js +371 -0
- package/dist/registries/glossaryAdviceContract.js +79 -0
- package/dist/registries/glossaryCaveatContract.js +67 -0
- package/dist/registries/glossaryConsumerContractValidation.js +787 -0
- package/dist/registries/glossaryEntryContract.js +757 -0
- package/dist/registries/glossaryTermIdentity.js +17 -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 +187 -211
- package/dist/registries/todoReadinessContract.js +448 -0
- package/dist/registries/triggerLoader.js +174 -0
- package/dist/registries/verbosityBudgetContract.js +205 -0
- package/dist/release/releaseMetadata.js +156 -6
- 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 +21 -82
- 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 +64 -25
- 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 +92 -27
- package/dist/state/startupAnalysis/contract.js +48 -10
- package/dist/state/startupAnalysis/helpers.js +27 -73
- package/dist/state/startupAnalysis/index.js +0 -1
- package/dist/state/startupAnalysis/metrics.js +25 -19
- package/dist/state/startupAnalysis/records.js +13 -10
- package/dist/state/startupAnalysis/report.js +26 -38
- package/dist/state/startupAnalysis/threshold.js +19 -7
- 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 +383 -0
- package/dist/upgrade/appModel.js +8 -7
- package/dist/upgrade/atomicWriter.js +1 -0
- package/dist/upgrade/bundleEvidence.js +33 -0
- package/dist/upgrade/channels.js +12 -8
- package/dist/upgrade/compatibility.js +56 -21
- package/dist/upgrade/doctor.js +165 -199
- package/dist/upgrade/doctorClassifier.js +187 -0
- package/dist/upgrade/installedHooksRetirement.js +196 -0
- package/dist/upgrade/legacyAgentCleanup.js +282 -0
- package/dist/upgrade/lifecycleUpgrade.js +113 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +375 -79
- package/dist/upgrade/migrationPublication.js +122 -0
- package/dist/upgrade/nextMajorDoctor.js +29 -10
- package/dist/upgrade/npxPlatformStatus.js +22 -0
- package/dist/upgrade/projectIntegration.js +145 -189
- package/dist/upgrade/projectIntegrationDecision.js +50 -0
- package/dist/upgrade/retiredResourceDiagnostics.js +117 -0
- package/dist/upgrade/runtimeMigration.js +272 -373
- 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 +2 -3
- package/dist/validate/activationArtifactEvidence.js +852 -0
- package/dist/validate/activationArtifactEvidenceTypes.js +12 -0
- package/dist/validate/activationConjunction.js +816 -0
- package/dist/validate/activationEvidenceManifest.js +531 -0
- package/dist/validate/activationPackageSemantics.js +29 -0
- package/dist/validate/appHomeContract.js +2 -8
- package/dist/validate/bootstrapAuthority.js +44 -0
- package/dist/validate/capability.js +133 -12
- package/dist/validate/crossCapability.js +15 -10
- 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 +18 -13
- package/package.json +60 -29
- package/bundle/references/adapters/cursor.md +0 -213
- 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 -548
- 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 -9
- 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 -31
- 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/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/schemas/artifacts.yaml +0 -73
- package/bundle/skills/agentera/capabilities/dokumentera/schemas/triggers.yaml +0 -35
- package/bundle/skills/agentera/capabilities/hej/schemas/artifacts.yaml +0 -69
- package/bundle/skills/agentera/capabilities/hej/schemas/triggers.yaml +0 -58
- package/bundle/skills/agentera/capabilities/inspektera/schemas/artifacts.yaml +0 -76
- package/bundle/skills/agentera/capabilities/inspektera/schemas/triggers.yaml +0 -38
- package/bundle/skills/agentera/capabilities/inspirera/schemas/artifacts.yaml +0 -24
- package/bundle/skills/agentera/capabilities/inspirera/schemas/triggers.yaml +0 -34
- package/bundle/skills/agentera/capabilities/optimera/schemas/triggers.yaml +0 -39
- package/bundle/skills/agentera/capabilities/orkestrera/schemas/artifacts.yaml +0 -64
- package/bundle/skills/agentera/capabilities/orkestrera/schemas/triggers.yaml +0 -42
- package/bundle/skills/agentera/capabilities/orkestrera/schemas/validation.yaml +0 -120
- package/bundle/skills/agentera/capabilities/planera/schemas/artifacts.yaml +0 -62
- package/bundle/skills/agentera/capabilities/planera/schemas/triggers.yaml +0 -34
- package/bundle/skills/agentera/capabilities/planera/schemas/validation.yaml +0 -61
- package/bundle/skills/agentera/capabilities/profilera/schemas/artifacts.yaml +0 -18
- package/bundle/skills/agentera/capabilities/profilera/schemas/triggers.yaml +0 -45
- package/bundle/skills/agentera/capabilities/profilera/schemas/validation.yaml +0 -57
- package/bundle/skills/agentera/capabilities/realisera/schemas/artifacts.yaml +0 -80
- package/bundle/skills/agentera/capabilities/realisera/schemas/triggers.yaml +0 -39
- package/bundle/skills/agentera/capabilities/realisera/schemas/validation.yaml +0 -110
- package/bundle/skills/agentera/capabilities/resonera/schemas/artifacts.yaml +0 -47
- package/bundle/skills/agentera/capabilities/resonera/schemas/triggers.yaml +0 -46
- package/bundle/skills/agentera/capabilities/resonera/schemas/validation.yaml +0 -77
- package/bundle/skills/agentera/capabilities/visionera/schemas/triggers.yaml +0 -41
- package/bundle/skills/agentera/capabilities/visualisera/schemas/triggers.yaml +0 -33
- package/bundle/skills/agentera/references/contract.md +0 -1039
- 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/cursorSessions.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/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/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/orkestrera/instructions.js +0 -6
- package/dist/capabilities/orkestrera/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/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/resonera/instructions.js +0 -6
- package/dist/capabilities/resonera/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 -6
- 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/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/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.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/dispatch/check.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.js.map +0 -1
- package/dist/cli/prime-blob.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/core/difflib.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.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/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 -71
- package/dist/hooks/cursorSessionStart.js.map +0 -1
- package/dist/hooks/sessionStart.js +0 -209
- package/dist/hooks/sessionStart.js.map +0 -1
- package/dist/hooks/sessionStop.js +0 -203
- package/dist/hooks/sessionStop.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 -83
- 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 -315
- package/dist/registries/runtimeAdapterRegistry.js.map +0 -1
- package/dist/release/releaseMetadata.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 -644
- 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 -127
- package/dist/setup/cursor.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 -247
- package/dist/setup/doctor/diagnostics.js.map +0 -1
- package/dist/setup/doctor/opencode.js +0 -281
- package/dist/setup/doctor/opencode.js.map +0 -1
- package/dist/setup/doctor/report.js +0 -474
- 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/appModel.js.map +0 -1
- package/dist/upgrade/channels.js.map +0 -1
- package/dist/upgrade/coexistenceProbe.js +0 -83
- 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/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/projectIntegration.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.js +0 -772
- package/dist/validate/lifecycleAdapters.js.map +0 -1
- package/dist/validate/selfAudit.js.map +0 -1
- package/dist/validate/vocabularyAuthority.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
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import os from "node:os";
|
|
3
2
|
import path from "node:path";
|
|
4
|
-
import { pyJsonIndent } from "../../core/pyjson.js";
|
|
5
3
|
import { defaultOutputPath, } from "./core.js";
|
|
4
|
+
import { defaultTiersDir, publishEvidenceTiers } from "./evidenceTiers.js";
|
|
6
5
|
import { buildCorpus } from "./corpus.js";
|
|
6
|
+
import { COVERAGE_EXIT_FLAGGED, corpusEnvelopeCoverage, formatCoverageSummaryText, runCoverageAudit, } from "./coverageAudit.js";
|
|
7
|
+
import { formatTruncationWarnings, resolveSqliteCaps } from "./sqliteCaps.js";
|
|
7
8
|
import { resolveCopilotStorePath, resolveCursorChatsPath, resolveCursorProjectsPath, resolveOpencodeDbPath, } from "./cursorSessions.js";
|
|
8
9
|
export function parseExtractArgs(argv, env = process.env, platform = process.platform) {
|
|
9
|
-
const home = os.homedir();
|
|
10
|
+
const home = env.HOME || (platform === "win32" ? env.USERPROFILE : undefined) || os.homedir();
|
|
10
11
|
const args = {
|
|
11
12
|
output: defaultOutputPath(env, platform),
|
|
13
|
+
tierOutput: null,
|
|
12
14
|
projectRoot: [],
|
|
13
15
|
codexSessionsDir: path.join(home, ".codex", "sessions"),
|
|
14
16
|
claudeProjectsDir: path.join(home, ".claude", "projects"),
|
|
@@ -17,11 +19,15 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
17
19
|
cursorProjectsDir: null,
|
|
18
20
|
cursorChatsDir: null,
|
|
19
21
|
noCodex: false,
|
|
20
|
-
|
|
22
|
+
importSources: [],
|
|
21
23
|
noOpencode: false,
|
|
22
24
|
noCopilot: false,
|
|
23
25
|
noCursor: false,
|
|
26
|
+
acceptCoverageGap: false,
|
|
27
|
+
coverageAuditOnly: false,
|
|
28
|
+
format: "text",
|
|
24
29
|
};
|
|
30
|
+
let claudeProjectsDirExplicit = false;
|
|
25
31
|
for (let i = 0; i < argv.length; i++) {
|
|
26
32
|
const a = argv[i];
|
|
27
33
|
const val = (name) => {
|
|
@@ -32,14 +38,28 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
32
38
|
return null;
|
|
33
39
|
};
|
|
34
40
|
let v;
|
|
41
|
+
// `--output` is a deprecated no-op for back-compat: it targeted the
|
|
42
|
+
// eliminated monolithic corpus.json write. Refresh now publishes bounded
|
|
43
|
+
// tiers via `--tier-output` (default: `defaultTiersDir`). `--output` is
|
|
44
|
+
// accepted to keep older callers from hard-crashing but has no effect.
|
|
35
45
|
if ((v = val("--output")) !== null)
|
|
36
46
|
args.output = v;
|
|
47
|
+
else if ((v = val("--tier-output")) !== null)
|
|
48
|
+
args.tierOutput = v;
|
|
37
49
|
else if ((v = val("--project-root")) !== null)
|
|
38
50
|
args.projectRoot.push(v);
|
|
39
51
|
else if ((v = val("--codex-sessions-dir")) !== null)
|
|
40
52
|
args.codexSessionsDir = v;
|
|
41
|
-
else if ((v = val("--claude-projects-dir")) !== null)
|
|
53
|
+
else if ((v = val("--claude-projects-dir")) !== null) {
|
|
42
54
|
args.claudeProjectsDir = v;
|
|
55
|
+
claudeProjectsDirExplicit = true;
|
|
56
|
+
}
|
|
57
|
+
else if ((v = val("--import-source")) !== null) {
|
|
58
|
+
if (v !== "claude")
|
|
59
|
+
throw new Error(`extract-corpus: unsupported historical import source '${v}'; valid source: claude`);
|
|
60
|
+
if (!args.importSources.includes(v))
|
|
61
|
+
args.importSources.push(v);
|
|
62
|
+
}
|
|
43
63
|
else if ((v = val("--opencode-conversations-dir")) !== null)
|
|
44
64
|
args.opencodeConversationsDir = v;
|
|
45
65
|
else if ((v = val("--copilot-conversations-dir")) !== null)
|
|
@@ -50,17 +70,39 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
50
70
|
args.cursorChatsDir = v;
|
|
51
71
|
else if (a === "--no-codex")
|
|
52
72
|
args.noCodex = true;
|
|
53
|
-
else if (a === "--no-claude")
|
|
54
|
-
args.noClaude = true;
|
|
55
73
|
else if (a === "--no-opencode")
|
|
56
74
|
args.noOpencode = true;
|
|
57
75
|
else if (a === "--no-copilot")
|
|
58
76
|
args.noCopilot = true;
|
|
59
77
|
else if (a === "--no-cursor")
|
|
60
78
|
args.noCursor = true;
|
|
79
|
+
else if (a === "--accept-coverage-gap")
|
|
80
|
+
args.acceptCoverageGap = true;
|
|
81
|
+
else if (a === "--coverage-audit-only")
|
|
82
|
+
args.coverageAuditOnly = true;
|
|
83
|
+
else if ((v = val("--max-sqlite-sessions")) !== null) {
|
|
84
|
+
args.maxSqliteSessions = Number.parseInt(v, 10);
|
|
85
|
+
if (!Number.isFinite(args.maxSqliteSessions) || args.maxSqliteSessions < 1) {
|
|
86
|
+
throw new Error(`extract-corpus: invalid --max-sqlite-sessions: ${v}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if ((v = val("--max-sqlite-rows")) !== null) {
|
|
90
|
+
args.maxSqliteRows = Number.parseInt(v, 10);
|
|
91
|
+
if (!Number.isFinite(args.maxSqliteRows) || args.maxSqliteRows < 1) {
|
|
92
|
+
throw new Error(`extract-corpus: invalid --max-sqlite-rows: ${v}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else if ((v = val("--format")) !== null) {
|
|
96
|
+
if (v !== "text" && v !== "json")
|
|
97
|
+
throw new Error(`extract-corpus: unsupported format '${v}'`);
|
|
98
|
+
args.format = v;
|
|
99
|
+
}
|
|
61
100
|
else
|
|
62
101
|
throw new Error(`extract-corpus: unrecognized argument: ${a}`);
|
|
63
102
|
}
|
|
103
|
+
if (claudeProjectsDirExplicit && !args.importSources.includes("claude")) {
|
|
104
|
+
throw new Error("extract-corpus: --claude-projects-dir requires explicit --import-source claude");
|
|
105
|
+
}
|
|
64
106
|
return args;
|
|
65
107
|
}
|
|
66
108
|
/** Engine entry point mirroring scripts/extract_corpus.py main(). */
|
|
@@ -79,23 +121,70 @@ export function extractCorpusMain(argv, io = {}) {
|
|
|
79
121
|
return 2;
|
|
80
122
|
}
|
|
81
123
|
const projectRoots = args.projectRoot.length > 0 ? args.projectRoot : [cwd];
|
|
124
|
+
if (args.importSources.includes("claude")) {
|
|
125
|
+
err("Historical import warning: Claude transcripts can contain secrets, file contents, and command output. " +
|
|
126
|
+
"Import is local and read-only; records are labeled historical_import and excluded from active-runtime analytics.");
|
|
127
|
+
}
|
|
128
|
+
const audit = runCoverageAudit(args, env, platform, args.acceptCoverageGap);
|
|
129
|
+
if (args.format === "json") {
|
|
130
|
+
out(JSON.stringify({ coverage_audit: audit }, null, 2));
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
out(formatCoverageSummaryText(audit));
|
|
134
|
+
}
|
|
135
|
+
if (audit.coverage_gap_flagged) {
|
|
136
|
+
err("coverage gap flagged (EX2): available runtime(s) skipped; pass --accept-coverage-gap to proceed");
|
|
137
|
+
return COVERAGE_EXIT_FLAGGED;
|
|
138
|
+
}
|
|
139
|
+
if (args.coverageAuditOnly)
|
|
140
|
+
return 0;
|
|
141
|
+
const sqliteCaps = resolveSqliteCaps(env, {
|
|
142
|
+
maxSessions: args.maxSqliteSessions,
|
|
143
|
+
maxRows: args.maxSqliteRows,
|
|
144
|
+
});
|
|
82
145
|
const skipCursor = args.noCursor;
|
|
83
146
|
const corpus = buildCorpus({
|
|
84
147
|
projectRoots,
|
|
85
148
|
codexSessionsDir: args.noCodex ? null : args.codexSessionsDir,
|
|
86
|
-
claudeProjectsDir: args.
|
|
149
|
+
claudeProjectsDir: args.importSources.includes("claude") ? args.claudeProjectsDir : null,
|
|
87
150
|
opencodeConversationsDir: args.noOpencode ? null : args.opencodeConversationsDir || resolveOpencodeDbPath(env),
|
|
88
151
|
copilotConversationsDir: args.noCopilot ? null : args.copilotConversationsDir || resolveCopilotStorePath(env),
|
|
89
152
|
cursorProjectsDir: skipCursor ? null : args.cursorProjectsDir || resolveCursorProjectsPath(env),
|
|
90
153
|
cursorChatsDir: skipCursor ? null : args.cursorChatsDir || resolveCursorChatsPath(env),
|
|
154
|
+
coverage: corpusEnvelopeCoverage(audit),
|
|
155
|
+
sqliteCaps,
|
|
91
156
|
});
|
|
92
|
-
|
|
93
|
-
|
|
157
|
+
const truncationWarning = formatTruncationWarnings(corpus.metadata.runtime_statuses);
|
|
158
|
+
if (truncationWarning)
|
|
159
|
+
err(truncationWarning);
|
|
94
160
|
const total = corpus.metadata.total_records;
|
|
95
161
|
const familyBits = Object.entries(corpus.metadata.families)
|
|
96
162
|
.map(([name, summary]) => `${name}=${summary.count}`)
|
|
97
163
|
.join(", ");
|
|
98
|
-
|
|
164
|
+
// Publish bounded evidence tiers as the canonical bounded publication output.
|
|
165
|
+
// The monolithic corpus envelope write is eliminated: all bounded consumers
|
|
166
|
+
// (usage, report, prime coverage, startup analysis, profile synthesis) read
|
|
167
|
+
// the signal tier and full-evidence shards directly. Legacy monolithic state
|
|
168
|
+
// receives deterministic refresh guidance rather than read compatibility.
|
|
169
|
+
const tiersDir = args.tierOutput ?? defaultTiersDir(env, platform);
|
|
170
|
+
const publication = publishEvidenceTiers(corpus.records, {
|
|
171
|
+
tiersDir,
|
|
172
|
+
adapterVersion: corpus.metadata.adapter_version,
|
|
173
|
+
runtimeStatuses: corpus.metadata.runtime_statuses,
|
|
174
|
+
env,
|
|
175
|
+
platform,
|
|
176
|
+
corpusMetadata: {
|
|
177
|
+
extracted_at: corpus.metadata.extracted_at,
|
|
178
|
+
runtime_statuses: corpus.metadata.runtime_statuses,
|
|
179
|
+
coverage_envelope: {
|
|
180
|
+
available_runtimes: corpus.metadata.available_runtimes,
|
|
181
|
+
selected_runtimes: corpus.metadata.selected_runtimes,
|
|
182
|
+
available_but_not_selected: corpus.metadata.available_but_not_selected,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
out(`published tiers: ${tiersDir} (generation ${publication.generation}; ` +
|
|
187
|
+
`${publication.shard_count} shards; ${publication.signal_count} signals; ` +
|
|
188
|
+
`${publication.signal_bytes} bytes${publication.signal_selection.capped ? "; selection applied" : ""}) [${total} records; ${familyBits}]`);
|
|
99
189
|
return 0;
|
|
100
190
|
}
|
|
101
|
-
//# sourceMappingURL=cli.js.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import { resolvePath } from "../../core/paths.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isoFromMtime, record, signalType, textFromContent, } from "./core.js";
|
|
4
4
|
import { isPlainObject, rglob, isFilePath } from "./core.js";
|
|
5
|
+
import { resolveSqliteCaps, } from "./sqliteCaps.js";
|
|
5
6
|
import { PermissionDeniedError, openSqlite, sqliteTimestamp, tableColumns, firstColumn, qualified, } from "./sqliteSessions.js";
|
|
6
7
|
function copilotDbCandidates(storePath) {
|
|
7
8
|
if (isFilePath(storePath))
|
|
8
9
|
return [storePath];
|
|
9
10
|
return rglob(storePath, "session-store.db");
|
|
10
11
|
}
|
|
11
|
-
function copilotRows(conn) {
|
|
12
|
+
function copilotRows(conn, caps) {
|
|
12
13
|
const tables = new Set(conn.prepare("SELECT name FROM sqlite_master WHERE type = 'table'").all().map((r) => String(r.name)));
|
|
13
14
|
for (const t of ["sessions", "turns"]) {
|
|
14
15
|
if (!tables.has(t)) {
|
|
@@ -61,7 +62,44 @@ function copilotRows(conn) {
|
|
|
61
62
|
${idExpr}
|
|
62
63
|
LIMIT ?
|
|
63
64
|
`;
|
|
64
|
-
return conn.prepare(query).all(
|
|
65
|
+
return conn.prepare(query).all(caps.maxRows);
|
|
66
|
+
}
|
|
67
|
+
export function probeCopilotTruncation(conn, caps, fallback) {
|
|
68
|
+
const tables = new Set(conn.prepare("SELECT name FROM sqlite_master WHERE type = 'table'").all().map((r) => String(r.name)));
|
|
69
|
+
if (!tables.has("sessions") || !tables.has("turns"))
|
|
70
|
+
return null;
|
|
71
|
+
const sessionCols = tableColumns(conn, "sessions");
|
|
72
|
+
const turnCols = tableColumns(conn, "turns");
|
|
73
|
+
const sessionId = firstColumn(sessionCols, ["id", "session_id", "sessionID"]);
|
|
74
|
+
const turnSession = firstColumn(turnCols, ["session_id", "sessionID", "session", "sessionId"]);
|
|
75
|
+
const roleCol = firstColumn(turnCols, ["role", "actor", "author"]);
|
|
76
|
+
if (!(sessionId && turnSession && roleCol))
|
|
77
|
+
return null;
|
|
78
|
+
const turnId = firstColumn(turnCols, ["id", "turn_id", "turnID"]);
|
|
79
|
+
const sessionTime = firstColumn(sessionCols, ["time", "timestamp", "created_at", "createdAt"]);
|
|
80
|
+
const turnTime = firstColumn(turnCols, ["time", "timestamp", "created_at", "createdAt"]);
|
|
81
|
+
const turnOrder = firstColumn(turnCols, ["turn_index", "turnIndex", "idx", "position", "sequence"]);
|
|
82
|
+
const orderExpr = turnOrder ? `t."${turnOrder}"` : `t."${turnTime || turnSession}"`;
|
|
83
|
+
const idExpr = turnId ? `t."${turnId}"` : "t.rowid";
|
|
84
|
+
const turnCount = Number(conn.prepare("SELECT COUNT(*) AS c FROM turns t JOIN sessions s ON t.\"" + turnSession + "\" = s.\"" + sessionId + "\"").get()?.c ?? 0);
|
|
85
|
+
if (turnCount <= caps.maxRows)
|
|
86
|
+
return null;
|
|
87
|
+
const timeExpr = `COALESCE(t."${turnTime || turnSession}", s."${sessionTime || sessionId}")`;
|
|
88
|
+
const query = `
|
|
89
|
+
SELECT MIN(turn_ts) AS truncated_at
|
|
90
|
+
FROM (
|
|
91
|
+
SELECT ${timeExpr} AS turn_ts
|
|
92
|
+
FROM turns t
|
|
93
|
+
JOIN sessions s ON t."${turnSession}" = s."${sessionId}"
|
|
94
|
+
ORDER BY COALESCE(${orderExpr}, t."${turnSession}"),
|
|
95
|
+
CASE LOWER(t."${roleCol}") WHEN 'user' THEN 0 WHEN 'assistant' THEN 1 ELSE 2 END,
|
|
96
|
+
${idExpr}
|
|
97
|
+
LIMIT -1 OFFSET ?
|
|
98
|
+
)
|
|
99
|
+
`;
|
|
100
|
+
const row = conn.prepare(query).get(caps.maxRows);
|
|
101
|
+
const truncatedAt = sqliteTimestamp(row?.truncated_at, fallback);
|
|
102
|
+
return { truncatedAt, cap: "rows", limit: caps.maxRows };
|
|
65
103
|
}
|
|
66
104
|
function copilotArgumentDict(value) {
|
|
67
105
|
if (isPlainObject(value)) {
|
|
@@ -135,9 +173,10 @@ function copilotRowTools(row, errors) {
|
|
|
135
173
|
}
|
|
136
174
|
return tools.filter((t) => typeof t.tool_name === "string" && t.tool_name);
|
|
137
175
|
}
|
|
138
|
-
export function extractCopilotSessions(storePath, errors) {
|
|
176
|
+
export function extractCopilotSessions(storePath, errors, ctx) {
|
|
139
177
|
if (storePath === null || !fs.existsSync(storePath))
|
|
140
178
|
return [];
|
|
179
|
+
const caps = ctx?.sqliteCaps ?? resolveSqliteCaps();
|
|
141
180
|
const records = [];
|
|
142
181
|
for (const dbPath of copilotDbCandidates(storePath).slice(0, 1)) {
|
|
143
182
|
const fallbackTimestamp = isoFromMtime(dbPath);
|
|
@@ -145,7 +184,10 @@ export function extractCopilotSessions(storePath, errors) {
|
|
|
145
184
|
let conn = null;
|
|
146
185
|
try {
|
|
147
186
|
conn = openSqlite(dbPath);
|
|
148
|
-
|
|
187
|
+
const truncation = probeCopilotTruncation(conn, caps, fallbackTimestamp);
|
|
188
|
+
if (truncation && ctx)
|
|
189
|
+
ctx.truncation = truncation;
|
|
190
|
+
rows = copilotRows(conn, caps);
|
|
149
191
|
}
|
|
150
192
|
catch (exc) {
|
|
151
193
|
const msg = exc.message || "";
|
|
@@ -191,7 +233,8 @@ export function extractCopilotSessions(storePath, errors) {
|
|
|
191
233
|
sourceKind: "conversation_turn",
|
|
192
234
|
timestamp,
|
|
193
235
|
projectPath,
|
|
194
|
-
runtime: "
|
|
236
|
+
runtime: "copilot",
|
|
237
|
+
sourceProduct: "github-copilot",
|
|
195
238
|
sourceParts: [resolvePath(dbPath), index, role, content.slice(0, 80)],
|
|
196
239
|
sessionId: String(row.session_id),
|
|
197
240
|
data,
|
|
@@ -204,7 +247,8 @@ export function extractCopilotSessions(storePath, errors) {
|
|
|
204
247
|
sourceKind: "tool_call",
|
|
205
248
|
timestamp,
|
|
206
249
|
projectPath,
|
|
207
|
-
runtime: "
|
|
250
|
+
runtime: "copilot",
|
|
251
|
+
sourceProduct: "github-copilot",
|
|
208
252
|
sourceParts: [resolvePath(dbPath), index, toolIndex, "tool", toolItem.tool_name, row.turn_id],
|
|
209
253
|
sessionId: String(row.session_id),
|
|
210
254
|
data: { tool_name: String(toolItem.tool_name), arguments: toolItem.arguments || {} },
|
|
@@ -217,7 +261,8 @@ export function extractCopilotSessions(storePath, errors) {
|
|
|
217
261
|
sourceKind: "history_prompt",
|
|
218
262
|
timestamp,
|
|
219
263
|
projectPath,
|
|
220
|
-
runtime: "
|
|
264
|
+
runtime: "copilot",
|
|
265
|
+
sourceProduct: "github-copilot",
|
|
221
266
|
sourceParts: [resolvePath(dbPath), index, "history", content.slice(0, 120)],
|
|
222
267
|
sessionId: String(row.session_id),
|
|
223
268
|
data: { prompt: content, signal_type: sig },
|
|
@@ -228,4 +273,3 @@ export function extractCopilotSessions(storePath, errors) {
|
|
|
228
273
|
}
|
|
229
274
|
return records;
|
|
230
275
|
}
|
|
231
|
-
//# sourceMappingURL=copilotSessions.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { resolveProfileDirOverride, resolveXdgDataHome } from "../../core/envPaths.js";
|
|
5
|
+
import { expanduser } from "../../core/paths.js";
|
|
4
6
|
import crypto from "node:crypto";
|
|
5
7
|
import { resolvePath } from "../../core/paths.js";
|
|
6
|
-
export const ADAPTER_VERSION = "agentera-
|
|
8
|
+
export const ADAPTER_VERSION = "agentera-v3-corpus-2";
|
|
7
9
|
export const FAMILIES = [
|
|
8
10
|
"instruction_document",
|
|
9
11
|
"history_prompt",
|
|
@@ -13,12 +15,14 @@ export const FAMILIES = [
|
|
|
13
15
|
];
|
|
14
16
|
export const RUNTIME_STORE_GLOBS = {
|
|
15
17
|
codex: "*.jsonl",
|
|
16
|
-
"claude-code": "*.jsonl",
|
|
17
18
|
cursor: "*.jsonl",
|
|
18
|
-
"cursor-agent": "store.db",
|
|
19
19
|
opencode: "opencode.db",
|
|
20
|
-
|
|
20
|
+
copilot: "session-store.db",
|
|
21
|
+
};
|
|
22
|
+
export const HISTORICAL_IMPORT_STORE_GLOBS = {
|
|
23
|
+
"claude-code": "*.jsonl",
|
|
21
24
|
};
|
|
25
|
+
const ACTIVE_ANALYTICS_RUNTIMES = new Set(["opencode", "codex", "cursor", "copilot"]);
|
|
22
26
|
export const MAX_TOOL_ARG_TEXT = 500;
|
|
23
27
|
export const MAX_SQLITE_ROWS = 100_000;
|
|
24
28
|
export const MAX_SQLITE_SESSIONS = 60;
|
|
@@ -64,37 +68,50 @@ export function projectIdFromPath(p) {
|
|
|
64
68
|
export function defaultAgenteraHome(env = process.env, platform = process.platform) {
|
|
65
69
|
const override = env.AGENTERA_HOME;
|
|
66
70
|
if (override)
|
|
67
|
-
return override;
|
|
71
|
+
return expanduser(override);
|
|
68
72
|
if (platform === "darwin")
|
|
69
73
|
return path.join(os.homedir(), "Library", "Application Support", "agentera");
|
|
70
74
|
if (platform === "win32") {
|
|
71
75
|
const appdata = env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
|
|
72
|
-
return path.join(appdata, "agentera");
|
|
76
|
+
return path.join(expanduser(appdata), "agentera");
|
|
73
77
|
}
|
|
74
|
-
|
|
75
|
-
return path.join(xdg, "agentera");
|
|
78
|
+
return path.join(resolveXdgDataHome(env), "agentera");
|
|
76
79
|
}
|
|
77
80
|
export function defaultProfileDir(env = process.env, platform = process.platform) {
|
|
78
|
-
const override = env
|
|
81
|
+
const override = resolveProfileDirOverride(env);
|
|
79
82
|
if (override)
|
|
80
|
-
return override;
|
|
83
|
+
return expanduser(override);
|
|
81
84
|
return defaultAgenteraHome(env, platform);
|
|
82
85
|
}
|
|
83
86
|
export function defaultOutputPath(env = process.env, platform = process.platform) {
|
|
84
87
|
return path.join(defaultProfileDir(env, platform), "intermediate", "corpus.json");
|
|
85
88
|
}
|
|
86
89
|
export function runtimeStatus(runtime, opts) {
|
|
87
|
-
const
|
|
90
|
+
const activeRuntime = opts.activeRuntime ?? (runtime !== null && ACTIVE_ANALYTICS_RUNTIMES.has(runtime));
|
|
91
|
+
const item = {
|
|
92
|
+
runtime,
|
|
93
|
+
source_class: opts.sourceClass ?? (activeRuntime ? "active_runtime" : "historical_import"),
|
|
94
|
+
source_product: opts.sourceProduct ?? runtime ?? "unknown",
|
|
95
|
+
active_runtime: activeRuntime,
|
|
96
|
+
status: opts.status,
|
|
97
|
+
reason: opts.reason,
|
|
98
|
+
};
|
|
88
99
|
if (opts.storePath !== null && opts.storePath !== undefined)
|
|
89
100
|
item.store_path = opts.storePath;
|
|
90
|
-
if (opts.
|
|
91
|
-
item.
|
|
101
|
+
if (opts.fileCount !== null && opts.fileCount !== undefined)
|
|
102
|
+
item.file_count = opts.fileCount;
|
|
92
103
|
if (opts.recordCount !== null && opts.recordCount !== undefined)
|
|
93
104
|
item.record_count = opts.recordCount;
|
|
94
105
|
if (opts.errorCount !== null && opts.errorCount !== undefined)
|
|
95
106
|
item.error_count = opts.errorCount;
|
|
96
107
|
if (opts.remediationLabels && opts.remediationLabels.length > 0)
|
|
97
108
|
item.remediation_labels = opts.remediationLabels;
|
|
109
|
+
if (opts.truncatedAt)
|
|
110
|
+
item.truncated_at = opts.truncatedAt;
|
|
111
|
+
if (opts.truncationCap)
|
|
112
|
+
item.truncation_cap = opts.truncationCap;
|
|
113
|
+
if (opts.truncationLimit !== null && opts.truncationLimit !== undefined)
|
|
114
|
+
item.truncation_limit = opts.truncationLimit;
|
|
98
115
|
return item;
|
|
99
116
|
}
|
|
100
117
|
function isDir(p) {
|
|
@@ -139,24 +156,31 @@ function rglob(root, pattern) {
|
|
|
139
156
|
walk(root);
|
|
140
157
|
return out.sort();
|
|
141
158
|
}
|
|
142
|
-
export function discoverRuntimeStore(runtime, storePath) {
|
|
159
|
+
export function discoverRuntimeStore(runtime, storePath, opts = {}) {
|
|
160
|
+
const statusOpts = {
|
|
161
|
+
sourceProduct: opts.sourceProduct,
|
|
162
|
+
sourceClass: opts.sourceClass,
|
|
163
|
+
activeRuntime: opts.activeRuntime,
|
|
164
|
+
};
|
|
143
165
|
if (storePath === null) {
|
|
144
|
-
return runtimeStatus(runtime, { status: "skipped", reason: "disabled", storePath: null });
|
|
166
|
+
return runtimeStatus(runtime, { status: "skipped", reason: "disabled", storePath: null, ...statusOpts });
|
|
145
167
|
}
|
|
146
168
|
if (!fs.existsSync(storePath)) {
|
|
147
169
|
return runtimeStatus(runtime, {
|
|
148
170
|
status: "missing",
|
|
149
171
|
reason: "store_absent",
|
|
150
172
|
storePath,
|
|
151
|
-
remediationLabels: runtime === "
|
|
173
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
174
|
+
...statusOpts,
|
|
152
175
|
});
|
|
153
176
|
}
|
|
154
|
-
if (
|
|
177
|
+
if (isFilePath(storePath)) {
|
|
155
178
|
return runtimeStatus(runtime, {
|
|
156
179
|
status: "available",
|
|
157
180
|
reason: "candidate_files_found",
|
|
158
181
|
storePath,
|
|
159
|
-
|
|
182
|
+
fileCount: 1,
|
|
183
|
+
...statusOpts,
|
|
160
184
|
});
|
|
161
185
|
}
|
|
162
186
|
if (!isDir(storePath)) {
|
|
@@ -164,7 +188,10 @@ export function discoverRuntimeStore(runtime, storePath) {
|
|
|
164
188
|
}
|
|
165
189
|
let candidates;
|
|
166
190
|
try {
|
|
167
|
-
|
|
191
|
+
const pattern = opts.pattern ?? (runtime === null ? undefined : RUNTIME_STORE_GLOBS[runtime]);
|
|
192
|
+
if (!pattern)
|
|
193
|
+
throw new Error("no declared store pattern");
|
|
194
|
+
candidates = rglob(storePath, pattern);
|
|
168
195
|
}
|
|
169
196
|
catch {
|
|
170
197
|
return runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath });
|
|
@@ -174,15 +201,17 @@ export function discoverRuntimeStore(runtime, storePath) {
|
|
|
174
201
|
status: "sparse",
|
|
175
202
|
reason: "no_candidate_files",
|
|
176
203
|
storePath,
|
|
177
|
-
|
|
178
|
-
remediationLabels: runtime === "
|
|
204
|
+
fileCount: 0,
|
|
205
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
206
|
+
...statusOpts,
|
|
179
207
|
});
|
|
180
208
|
}
|
|
181
209
|
return runtimeStatus(runtime, {
|
|
182
210
|
status: "available",
|
|
183
211
|
reason: "candidate_files_found",
|
|
184
212
|
storePath,
|
|
185
|
-
|
|
213
|
+
fileCount: candidates.length,
|
|
214
|
+
...statusOpts,
|
|
186
215
|
});
|
|
187
216
|
}
|
|
188
217
|
// ── record builders + content helpers ──────────────────────────────
|
|
@@ -193,12 +222,16 @@ export function splitLines(text) {
|
|
|
193
222
|
return parts;
|
|
194
223
|
}
|
|
195
224
|
export function record(opts) {
|
|
225
|
+
const activeRuntime = opts.activeRuntime ?? (opts.runtime !== null && ACTIVE_ANALYTICS_RUNTIMES.has(opts.runtime));
|
|
196
226
|
const item = {
|
|
197
227
|
source_id: stableId(opts.sourceKind, ...opts.sourceParts),
|
|
198
228
|
timestamp: opts.timestamp,
|
|
199
229
|
project_id: projectIdFromPath(opts.projectPath),
|
|
200
230
|
source_kind: opts.sourceKind,
|
|
201
231
|
runtime: opts.runtime,
|
|
232
|
+
source_class: opts.sourceClass ?? (activeRuntime ? "active_runtime" : "project"),
|
|
233
|
+
source_product: opts.sourceProduct ?? opts.runtime ?? "unknown",
|
|
234
|
+
active_runtime: activeRuntime,
|
|
202
235
|
adapter_version: ADAPTER_VERSION,
|
|
203
236
|
data: opts.data,
|
|
204
237
|
};
|
|
@@ -345,13 +378,15 @@ export function toolCallRecordFromItem(args) {
|
|
|
345
378
|
timestamp: eventTimestamp(event, args.fallbackTimestamp),
|
|
346
379
|
projectPath: args.projectPath,
|
|
347
380
|
runtime: args.runtime,
|
|
381
|
+
sourceClass: args.sourceClass,
|
|
382
|
+
sourceProduct: args.sourceProduct,
|
|
383
|
+
activeRuntime: args.activeRuntime,
|
|
348
384
|
sourceParts: [resolvePath(args.sourcePath), args.index, "tool", toolName],
|
|
349
385
|
sessionId: args.sessionId,
|
|
350
|
-
data: { tool_name: toolName, arguments: argumentsVal },
|
|
386
|
+
data: { tool_name: toolName, arguments: argumentsVal }, // cast: parsed JSON IO boundary
|
|
351
387
|
});
|
|
352
388
|
}
|
|
353
389
|
export function toolCallRecord(args) {
|
|
354
390
|
return toolCallRecordFromItem({ ...args, item: payloadItem(args.event) });
|
|
355
391
|
}
|
|
356
392
|
export { isPlainObject, rglob, isDir, isFilePath };
|
|
357
|
-
//# sourceMappingURL=core.js.map
|
|
@@ -7,43 +7,53 @@ import { extractOpencodeSessions, PermissionDeniedError } from "./sqliteSessions
|
|
|
7
7
|
import { extractCopilotSessions } from "./copilotSessions.js";
|
|
8
8
|
import { extractCursorSessions, extractCursorAgentSessions, } from "./cursorSessions.js";
|
|
9
9
|
import { resolvePath } from "../../core/paths.js";
|
|
10
|
+
import { applyTruncationToStatus } from "./sqliteCaps.js";
|
|
10
11
|
export class ExtractionNotImplementedError extends Error {
|
|
11
12
|
}
|
|
12
|
-
function extractRuntimeStore(runtime, storePath, errors, extractor
|
|
13
|
-
|
|
13
|
+
function extractRuntimeStore(runtime, storePath, errors, extractor, sqliteCaps, provenance = {
|
|
14
|
+
sourceProduct: runtime ?? "unknown",
|
|
15
|
+
sourceClass: "active_runtime",
|
|
16
|
+
activeRuntime: true,
|
|
17
|
+
}) {
|
|
18
|
+
const discovery = discoverRuntimeStore(runtime, storePath, provenance);
|
|
14
19
|
if (discovery.status !== "available")
|
|
15
20
|
return [[], discovery];
|
|
16
21
|
const errorStart = errors.length;
|
|
22
|
+
const ctx = { sqliteCaps };
|
|
17
23
|
let records;
|
|
18
24
|
try {
|
|
19
|
-
records = extractor(storePath, errors);
|
|
25
|
+
records = extractor(storePath, errors, ctx);
|
|
20
26
|
}
|
|
21
27
|
catch (exc) {
|
|
22
|
-
const
|
|
28
|
+
const fc = (discovery.file_count ?? null); // cast: discovery payload IO boundary
|
|
23
29
|
if (exc instanceof ExtractionNotImplementedError) {
|
|
24
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "extractor_unimplemented", storePath,
|
|
30
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "extractor_unimplemented", storePath, fileCount: fc, recordCount: 0, errorCount: 0, ...provenance })];
|
|
25
31
|
}
|
|
26
32
|
if (exc instanceof PermissionDeniedError) {
|
|
27
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_locked", storePath,
|
|
33
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_locked", storePath, fileCount: fc, ...provenance })];
|
|
28
34
|
}
|
|
29
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath,
|
|
35
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath, fileCount: fc, ...provenance })];
|
|
30
36
|
}
|
|
31
|
-
const
|
|
37
|
+
const fc = (discovery.file_count ?? null); // cast: discovery payload IO boundary
|
|
32
38
|
const errorCount = errors.length - errorStart;
|
|
33
39
|
if (errorCount) {
|
|
34
|
-
return [records, runtimeStatus(runtime, { status: "degraded", reason: "schema_divergent", storePath,
|
|
40
|
+
return [records, runtimeStatus(runtime, { status: "degraded", reason: "schema_divergent", storePath, fileCount: fc, recordCount: records.length, errorCount, ...provenance })];
|
|
35
41
|
}
|
|
36
42
|
if (records.length === 0) {
|
|
37
43
|
return [records, runtimeStatus(runtime, {
|
|
38
44
|
status: "sparse",
|
|
39
45
|
reason: "no_matching_records",
|
|
40
46
|
storePath,
|
|
41
|
-
|
|
47
|
+
fileCount: fc,
|
|
42
48
|
recordCount: 0,
|
|
43
|
-
remediationLabels: runtime === "
|
|
49
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
50
|
+
...provenance,
|
|
44
51
|
})];
|
|
45
52
|
}
|
|
46
|
-
return [
|
|
53
|
+
return [
|
|
54
|
+
records,
|
|
55
|
+
applyTruncationToStatus(runtimeStatus(runtime, { status: "ok", reason: "records_extracted", storePath, fileCount: fc, recordCount: records.length, errorCount: 0, ...provenance }), ctx.truncation),
|
|
56
|
+
];
|
|
47
57
|
}
|
|
48
58
|
export function dedupeRecords(records) {
|
|
49
59
|
const byId = new Map();
|
|
@@ -71,7 +81,7 @@ export function dedupeRecords(records) {
|
|
|
71
81
|
return ai < bi ? -1 : ai > bi ? 1 : 0;
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
|
-
export function buildMetadata(records, errors, runtimeStatuses) {
|
|
84
|
+
export function buildMetadata(records, errors, runtimeStatuses, coverage) {
|
|
75
85
|
const counts = new Map();
|
|
76
86
|
for (const item of records) {
|
|
77
87
|
const sk = item.source_kind;
|
|
@@ -85,15 +95,27 @@ export function buildMetadata(records, errors, runtimeStatuses) {
|
|
|
85
95
|
if (count === 0)
|
|
86
96
|
families[family].error = "no records extracted for this family";
|
|
87
97
|
}
|
|
88
|
-
const runtimes = Array.from(new Set(records.filter((
|
|
98
|
+
const runtimes = Array.from(new Set(records.filter((item) => item.active_runtime === true && item.runtime).map((item) => String(item.runtime)))).sort();
|
|
99
|
+
const sourceClasses = Array.from(new Set(records.map((item) => String(item.source_class)))).sort();
|
|
100
|
+
const sourceProducts = Array.from(new Set(records.map((item) => String(item.source_product)))).sort();
|
|
101
|
+
const coverageFields = coverage ?? {
|
|
102
|
+
available_runtimes: [],
|
|
103
|
+
selected_runtimes: [],
|
|
104
|
+
available_but_not_selected: [],
|
|
105
|
+
};
|
|
89
106
|
return {
|
|
90
107
|
extracted_at: isoNow(),
|
|
91
108
|
runtimes,
|
|
92
109
|
adapter_version: ADAPTER_VERSION,
|
|
93
110
|
families,
|
|
94
111
|
runtime_statuses: runtimeStatuses,
|
|
112
|
+
available_runtimes: coverageFields.available_runtimes,
|
|
113
|
+
selected_runtimes: coverageFields.selected_runtimes,
|
|
114
|
+
available_but_not_selected: coverageFields.available_but_not_selected,
|
|
95
115
|
total_records: records.length,
|
|
96
116
|
errors,
|
|
117
|
+
source_classes: sourceClasses,
|
|
118
|
+
source_products: sourceProducts,
|
|
97
119
|
};
|
|
98
120
|
}
|
|
99
121
|
export function buildCorpus(opts) {
|
|
@@ -110,23 +132,36 @@ export function buildCorpus(opts) {
|
|
|
110
132
|
records.push(...extractProjectConfigSignals(normalizedRoots, errors));
|
|
111
133
|
const runtimeStatuses = [];
|
|
112
134
|
const runtimes = [
|
|
113
|
-
["codex", opts.codexSessionsDir, extractCodexSessions],
|
|
114
|
-
["
|
|
115
|
-
["cursor", opts.cursorProjectsDir ?? null, (sp, err) => extractCursorSessions(sp, err, normalizedRoots)],
|
|
135
|
+
["codex", "codex", "active_runtime", true, opts.codexSessionsDir, extractCodexSessions, undefined],
|
|
136
|
+
["cursor", "cursor", "active_runtime", true, opts.cursorProjectsDir ?? null, (sp, err) => extractCursorSessions(sp, err, normalizedRoots), undefined],
|
|
116
137
|
[
|
|
138
|
+
"cursor",
|
|
117
139
|
"cursor-agent",
|
|
140
|
+
"active_runtime",
|
|
141
|
+
true,
|
|
118
142
|
opts.cursorChatsDir ?? null,
|
|
119
143
|
(sp, err) => extractCursorAgentSessions(sp, err, normalizedRoots, opts.cursorProjectsDir ?? null),
|
|
144
|
+
"store.db",
|
|
120
145
|
],
|
|
121
|
-
["opencode", opts.opencodeConversationsDir ?? null, extractOpencodeSessions],
|
|
122
|
-
["github-copilot", opts.copilotConversationsDir ?? null, extractCopilotSessions],
|
|
146
|
+
["opencode", "opencode", "active_runtime", true, opts.opencodeConversationsDir ?? null, extractOpencodeSessions, undefined],
|
|
147
|
+
["copilot", "github-copilot", "active_runtime", true, opts.copilotConversationsDir ?? null, extractCopilotSessions, undefined],
|
|
123
148
|
];
|
|
124
|
-
|
|
125
|
-
|
|
149
|
+
if (opts.claudeProjectsDir !== null) {
|
|
150
|
+
runtimes.push([
|
|
151
|
+
null,
|
|
152
|
+
"claude-code",
|
|
153
|
+
"historical_import",
|
|
154
|
+
false,
|
|
155
|
+
opts.claudeProjectsDir,
|
|
156
|
+
extractClaudeProjectSessions,
|
|
157
|
+
"*.jsonl",
|
|
158
|
+
]);
|
|
159
|
+
}
|
|
160
|
+
for (const [runtime, sourceProduct, sourceClass, activeRuntime, storePath, extractor, pattern] of runtimes) {
|
|
161
|
+
const [runtimeRecords, status] = extractRuntimeStore(runtime, storePath, errors, extractor, opts.sqliteCaps, { sourceProduct, sourceClass, activeRuntime, pattern });
|
|
126
162
|
records.push(...runtimeRecords);
|
|
127
163
|
runtimeStatuses.push(status);
|
|
128
164
|
}
|
|
129
165
|
const deduped = dedupeRecords(records);
|
|
130
|
-
return { metadata: buildMetadata(deduped, errors, runtimeStatuses), records: deduped };
|
|
166
|
+
return { metadata: buildMetadata(deduped, errors, runtimeStatuses, opts.coverage), records: deduped };
|
|
131
167
|
}
|
|
132
|
-
//# sourceMappingURL=corpus.js.map
|