productfoo 0.0.0-stage → 1.0.1
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 +338 -2
- package/bin/foo +3 -0
- package/bin/foo.mjs +42 -0
- package/commands/bug.md +31 -0
- package/commands/discovery.md +28 -0
- package/commands/ideate.md +27 -0
- package/commands/init.md +28 -0
- package/commands/pitch.md +27 -0
- package/commands/preview.md +25 -0
- package/commands/research.md +31 -0
- package/commands/roast.md +27 -0
- package/commands/spec.md +30 -0
- package/config/pricing.yaml +198 -0
- package/config/routing-policy.yaml +171 -0
- package/dist-public/src/activeModel.d.ts +83 -0
- package/dist-public/src/activeModel.js +331 -0
- package/dist-public/src/agentAdapters.d.ts +122 -0
- package/dist-public/src/agentAdapters.js +178 -0
- package/dist-public/src/agentState.d.ts +43 -0
- package/dist-public/src/agentState.js +177 -0
- package/dist-public/src/bugCapsule.d.ts +94 -0
- package/dist-public/src/bugCapsule.js +227 -0
- package/dist-public/src/bugCapture.d.ts +26 -0
- package/dist-public/src/bugCapture.js +251 -0
- package/dist-public/src/bugOwnerLog.d.ts +93 -0
- package/dist-public/src/bugOwnerLog.js +304 -0
- package/dist-public/src/bugReportStore.d.ts +48 -0
- package/dist-public/src/bugReportStore.js +860 -0
- package/dist-public/src/bugSpecContext.d.ts +7 -0
- package/dist-public/src/bugSpecContext.js +129 -0
- package/dist-public/src/channelFreshness.d.ts +25 -0
- package/dist-public/src/channelFreshness.js +194 -0
- package/dist-public/src/cli.d.ts +30 -0
- package/dist-public/src/cli.js +1667 -0
- package/dist-public/src/cliArgs.d.ts +7 -0
- package/dist-public/src/cliArgs.js +44 -0
- package/dist-public/src/codeCatalog.d.ts +41 -0
- package/dist-public/src/codeCatalog.js +197 -0
- package/dist-public/src/commandContract.d.ts +84 -0
- package/dist-public/src/commandContract.js +390 -0
- package/dist-public/src/commandUsage.d.ts +3 -0
- package/dist-public/src/commandUsage.js +30 -0
- package/dist-public/src/commands/agent.d.ts +60 -0
- package/dist-public/src/commands/agent.js +1353 -0
- package/dist-public/src/commands/asp.d.ts +8 -0
- package/dist-public/src/commands/asp.js +669 -0
- package/dist-public/src/commands/evalCmd.d.ts +4 -0
- package/dist-public/src/commands/evalCmd.js +405 -0
- package/dist-public/src/commands/login.d.ts +25 -0
- package/dist-public/src/commands/login.js +94 -0
- package/dist-public/src/commands/loop.d.ts +16 -0
- package/dist-public/src/commands/loop.js +619 -0
- package/dist-public/src/commands/reconcile.d.ts +41 -0
- package/dist-public/src/commands/reconcile.js +292 -0
- package/dist-public/src/commands/runtime.d.ts +1 -0
- package/dist-public/src/commands/runtime.js +36 -0
- package/dist-public/src/commands/scanRedact.d.ts +8 -0
- package/dist-public/src/commands/scanRedact.js +266 -0
- package/dist-public/src/commands/setup.d.ts +28 -0
- package/dist-public/src/commands/setup.js +398 -0
- package/dist-public/src/commands/shared.d.ts +17 -0
- package/dist-public/src/commands/shared.js +147 -0
- package/dist-public/src/commands/source.d.ts +1 -0
- package/dist-public/src/commands/source.js +134 -0
- package/dist-public/src/commands/specCmd.d.ts +24 -0
- package/dist-public/src/commands/specCmd.js +794 -0
- package/dist-public/src/commands/update.d.ts +61 -0
- package/dist-public/src/commands/update.js +244 -0
- package/dist-public/src/comprehensionSignal.d.ts +20 -0
- package/dist-public/src/comprehensionSignal.js +166 -0
- package/dist-public/src/conductor/diversity.d.ts +48 -0
- package/dist-public/src/conductor/diversity.js +423 -0
- package/dist-public/src/conductor/engine.d.ts +7 -0
- package/dist-public/src/conductor/engine.js +295 -0
- package/dist-public/src/conductor/families/ideate.d.ts +2 -0
- package/dist-public/src/conductor/families/ideate.js +255 -0
- package/dist-public/src/conductor/families/interview.d.ts +2 -0
- package/dist-public/src/conductor/families/interview.js +39 -0
- package/dist-public/src/conductor/families/specSwarm.d.ts +2 -0
- package/dist-public/src/conductor/families/specSwarm.js +146 -0
- package/dist-public/src/conductor/familyDelivery.d.ts +6 -0
- package/dist-public/src/conductor/familyDelivery.js +37 -0
- package/dist-public/src/conductor/familyPackArtifact.d.ts +4 -0
- package/dist-public/src/conductor/familyPackArtifact.js +260 -0
- package/dist-public/src/conductor/ideateDecision.d.ts +6 -0
- package/dist-public/src/conductor/ideateDecision.js +237 -0
- package/dist-public/src/conductor/pack.d.ts +26 -0
- package/dist-public/src/conductor/pack.js +75 -0
- package/dist-public/src/conductor/types.d.ts +111 -0
- package/dist-public/src/conductor/types.js +7 -0
- package/dist-public/src/configPath.d.ts +2 -0
- package/dist-public/src/configPath.js +7 -0
- package/dist-public/src/discoveryArtifacts.d.ts +54 -0
- package/dist-public/src/discoveryArtifacts.js +467 -0
- package/dist-public/src/discoveryCommand.d.ts +127 -0
- package/dist-public/src/discoveryCommand.js +2148 -0
- package/dist-public/src/discoveryConnections.d.ts +339 -0
- package/dist-public/src/discoveryConnections.js +613 -0
- package/dist-public/src/discoveryDocs.d.ts +129 -0
- package/dist-public/src/discoveryDocs.js +577 -0
- package/dist-public/src/discoveryEvidence.d.ts +59 -0
- package/dist-public/src/discoveryEvidence.js +198 -0
- package/dist-public/src/discoveryFireflies.d.ts +25 -0
- package/dist-public/src/discoveryFireflies.js +551 -0
- package/dist-public/src/discoveryGmail.d.ts +12 -0
- package/dist-public/src/discoveryGmail.js +466 -0
- package/dist-public/src/discoveryGong.d.ts +12 -0
- package/dist-public/src/discoveryGong.js +491 -0
- package/dist-public/src/discoveryLearningRouting.d.ts +90 -0
- package/dist-public/src/discoveryLearningRouting.js +405 -0
- package/dist-public/src/discoveryMatching.d.ts +26 -0
- package/dist-public/src/discoveryMatching.js +73 -0
- package/dist-public/src/discoveryOutlook.d.ts +12 -0
- package/dist-public/src/discoveryOutlook.js +492 -0
- package/dist-public/src/discoveryProcess.d.ts +221 -0
- package/dist-public/src/discoveryProcess.js +703 -0
- package/dist-public/src/discoveryProof.d.ts +143 -0
- package/dist-public/src/discoveryProof.js +529 -0
- package/dist-public/src/discoveryProviders.d.ts +152 -0
- package/dist-public/src/discoveryProviders.js +756 -0
- package/dist-public/src/discoveryReadiness.d.ts +219 -0
- package/dist-public/src/discoveryReadiness.js +672 -0
- package/dist-public/src/discoveryReconcile.d.ts +57 -0
- package/dist-public/src/discoveryReconcile.js +424 -0
- package/dist-public/src/discoverySlack.d.ts +12 -0
- package/dist-public/src/discoverySlack.js +452 -0
- package/dist-public/src/discoverySources.d.ts +56 -0
- package/dist-public/src/discoverySources.js +322 -0
- package/dist-public/src/discoverySync.d.ts +52 -0
- package/dist-public/src/discoverySync.js +151 -0
- package/dist-public/src/discoverySynthesis.d.ts +57 -0
- package/dist-public/src/discoverySynthesis.js +215 -0
- package/dist-public/src/discoveryTeams.d.ts +12 -0
- package/dist-public/src/discoveryTeams.js +516 -0
- package/dist-public/src/discoveryZoom.d.ts +12 -0
- package/dist-public/src/discoveryZoom.js +523 -0
- package/dist-public/src/elicitationSurface.d.ts +13 -0
- package/dist-public/src/elicitationSurface.js +77 -0
- package/dist-public/src/errorReport.d.ts +99 -0
- package/dist-public/src/errorReport.js +443 -0
- package/dist-public/src/errorTaxonomy.d.ts +84 -0
- package/dist-public/src/errorTaxonomy.js +189 -0
- package/dist-public/src/evalCalibration.d.ts +82 -0
- package/dist-public/src/evalCalibration.js +169 -0
- package/dist-public/src/evalChecks.d.ts +21 -0
- package/dist-public/src/evalChecks.js +295 -0
- package/dist-public/src/evalCompile.d.ts +56 -0
- package/dist-public/src/evalCompile.js +58 -0
- package/dist-public/src/evalImprove.d.ts +60 -0
- package/dist-public/src/evalImprove.js +175 -0
- package/dist-public/src/evalJudge.d.ts +47 -0
- package/dist-public/src/evalJudge.js +143 -0
- package/dist-public/src/evalLabels.d.ts +100 -0
- package/dist-public/src/evalLabels.js +287 -0
- package/dist-public/src/evalRecord.d.ts +68 -0
- package/dist-public/src/evalRecord.js +165 -0
- package/dist-public/src/evalRoast.d.ts +88 -0
- package/dist-public/src/evalRoast.js +249 -0
- package/dist-public/src/evidenceIntake.d.ts +66 -0
- package/dist-public/src/evidenceIntake.js +356 -0
- package/dist-public/src/feedback.d.ts +78 -0
- package/dist-public/src/feedback.js +294 -0
- package/dist-public/src/firefliesClient.d.ts +106 -0
- package/dist-public/src/firefliesClient.js +258 -0
- package/dist-public/src/firstMoveTensions.d.ts +10 -0
- package/dist-public/src/firstMoveTensions.js +93 -0
- package/dist-public/src/gitRun.d.ts +21 -0
- package/dist-public/src/gitRun.js +50 -0
- package/dist-public/src/githubReconcile.d.ts +94 -0
- package/dist-public/src/githubReconcile.js +205 -0
- package/dist-public/src/gmailNango.d.ts +131 -0
- package/dist-public/src/gmailNango.js +329 -0
- package/dist-public/src/gongNango.d.ts +118 -0
- package/dist-public/src/gongNango.js +308 -0
- package/dist-public/src/grammarGate.d.ts +13 -0
- package/dist-public/src/grammarGate.js +72 -0
- package/dist-public/src/harnessGates.d.ts +65 -0
- package/dist-public/src/harnessGates.js +168 -0
- package/dist-public/src/humanSurfaceEval.d.ts +19 -0
- package/dist-public/src/humanSurfaceEval.js +156 -0
- package/dist-public/src/ideate.d.ts +43 -0
- package/dist-public/src/ideate.js +255 -0
- package/dist-public/src/ideateContext.d.ts +11 -0
- package/dist-public/src/ideateContext.js +83 -0
- package/dist-public/src/index.d.ts +2 -0
- package/dist-public/src/index.js +4 -0
- package/dist-public/src/initCommand.d.ts +25 -0
- package/dist-public/src/initCommand.js +558 -0
- package/dist-public/src/interviewGate.d.ts +25 -0
- package/dist-public/src/interviewGate.js +126 -0
- package/dist-public/src/jsonFile.d.ts +2 -0
- package/dist-public/src/jsonFile.js +22 -0
- package/dist-public/src/loopBudget.d.ts +182 -0
- package/dist-public/src/loopBudget.js +494 -0
- package/dist-public/src/loopContracts.d.ts +35 -0
- package/dist-public/src/loopContracts.js +364 -0
- package/dist-public/src/machineState.d.ts +1 -0
- package/dist-public/src/machineState.js +9 -0
- package/dist-public/src/notionNango.d.ts +93 -0
- package/dist-public/src/notionNango.js +279 -0
- package/dist-public/src/orchestrationResult.d.ts +11 -0
- package/dist-public/src/orchestrationResult.js +73 -0
- package/dist-public/src/outlookNango.d.ts +124 -0
- package/dist-public/src/outlookNango.js +327 -0
- package/dist-public/src/packetCorrections.d.ts +40 -0
- package/dist-public/src/packetCorrections.js +172 -0
- package/dist-public/src/packetGlossary.d.ts +6 -0
- package/dist-public/src/packetGlossary.js +42 -0
- package/dist-public/src/packetIndex.d.ts +54 -0
- package/dist-public/src/packetIndex.js +744 -0
- package/dist-public/src/packetIndexEntry.d.ts +3 -0
- package/dist-public/src/packetIndexEntry.js +128 -0
- package/dist-public/src/packetIndexServe.d.ts +13 -0
- package/dist-public/src/packetIndexServe.js +113 -0
- package/dist-public/src/packetIndexWorker.d.ts +7 -0
- package/dist-public/src/packetIndexWorker.js +45 -0
- package/dist-public/src/packetLifecycle.d.ts +30 -0
- package/dist-public/src/packetLifecycle.js +127 -0
- package/dist-public/src/packetReconcile.d.ts +73 -0
- package/dist-public/src/packetReconcile.js +386 -0
- package/dist-public/src/packetStatus.d.ts +125 -0
- package/dist-public/src/packetStatus.js +770 -0
- package/dist-public/src/packetValidation.d.ts +17 -0
- package/dist-public/src/packetValidation.js +333 -0
- package/dist-public/src/packetVerify.d.ts +73 -0
- package/dist-public/src/packetVerify.js +303 -0
- package/dist-public/src/packetWrite.d.ts +52 -0
- package/dist-public/src/packetWrite.js +448 -0
- package/dist-public/src/pitch.d.ts +38 -0
- package/dist-public/src/pitch.js +154 -0
- package/dist-public/src/processMemo.d.ts +8 -0
- package/dist-public/src/processMemo.js +23 -0
- package/dist-public/src/productDetect.d.ts +30 -0
- package/dist-public/src/productDetect.js +376 -0
- package/dist-public/src/profile.d.ts +62 -0
- package/dist-public/src/profile.js +334 -0
- package/dist-public/src/questionModel.d.ts +46 -0
- package/dist-public/src/questionModel.js +74 -0
- package/dist-public/src/questionText.d.ts +7 -0
- package/dist-public/src/questionText.js +38 -0
- package/dist-public/src/redactConfig.d.ts +2 -0
- package/dist-public/src/redactConfig.js +11 -0
- package/dist-public/src/redactEngine.d.ts +59 -0
- package/dist-public/src/redactEngine.js +509 -0
- package/dist-public/src/redactGate.d.ts +63 -0
- package/dist-public/src/redactGate.js +209 -0
- package/dist-public/src/repoRead.d.ts +29 -0
- package/dist-public/src/repoRead.js +160 -0
- package/dist-public/src/research.d.ts +242 -0
- package/dist-public/src/research.js +1314 -0
- package/dist-public/src/researchCompletion.d.ts +34 -0
- package/dist-public/src/researchCompletion.js +123 -0
- package/dist-public/src/researchExecution.d.ts +47 -0
- package/dist-public/src/researchExecution.js +309 -0
- package/dist-public/src/researchFormat.d.ts +21 -0
- package/dist-public/src/researchFormat.js +77 -0
- package/dist-public/src/researchGate.d.ts +86 -0
- package/dist-public/src/researchGate.js +1036 -0
- package/dist-public/src/researchReceipt.d.ts +76 -0
- package/dist-public/src/researchReceipt.js +148 -0
- package/dist-public/src/researchRender.d.ts +2 -0
- package/dist-public/src/researchRender.js +267 -0
- package/dist-public/src/researchSigningKey.d.ts +19 -0
- package/dist-public/src/researchSigningKey.js +95 -0
- package/dist-public/src/riskClassify.d.ts +42 -0
- package/dist-public/src/riskClassify.js +149 -0
- package/dist-public/src/routines.d.ts +42 -0
- package/dist-public/src/routines.js +269 -0
- package/dist-public/src/routingPolicy.d.ts +172 -0
- package/dist-public/src/routingPolicy.js +646 -0
- package/dist-public/src/secretInput.d.ts +8 -0
- package/dist-public/src/secretInput.js +89 -0
- package/dist-public/src/selfCheck.d.ts +7 -0
- package/dist-public/src/selfCheck.js +473 -0
- package/dist-public/src/selfCheckCache.d.ts +29 -0
- package/dist-public/src/selfCheckCache.js +147 -0
- package/dist-public/src/severityClass.d.ts +15 -0
- package/dist-public/src/severityClass.js +22 -0
- package/dist-public/src/skillClientPolicy.d.ts +8 -0
- package/dist-public/src/skillClientPolicy.js +16 -0
- package/dist-public/src/skillLocal.d.ts +98 -0
- package/dist-public/src/skillLocal.js +463 -0
- package/dist-public/src/skillTreeDigest.d.ts +9 -0
- package/dist-public/src/skillTreeDigest.js +64 -0
- package/dist-public/src/slackNango.d.ts +62 -0
- package/dist-public/src/slackNango.js +208 -0
- package/dist-public/src/social/arxiv.d.ts +19 -0
- package/dist-public/src/social/arxiv.js +96 -0
- package/dist-public/src/social/github.d.ts +2 -0
- package/dist-public/src/social/github.js +78 -0
- package/dist-public/src/social/hackernews.d.ts +2 -0
- package/dist-public/src/social/hackernews.js +67 -0
- package/dist-public/src/social/index.d.ts +10 -0
- package/dist-public/src/social/index.js +79 -0
- package/dist-public/src/social/reddit.d.ts +2 -0
- package/dist-public/src/social/reddit.js +125 -0
- package/dist-public/src/social/types.d.ts +73 -0
- package/dist-public/src/social/types.js +61 -0
- package/dist-public/src/social/xml.d.ts +10 -0
- package/dist-public/src/social/xml.js +49 -0
- package/dist-public/src/social/youtube.d.ts +7 -0
- package/dist-public/src/social/youtube.js +217 -0
- package/dist-public/src/sourceIngress.d.ts +488 -0
- package/dist-public/src/sourceIngress.js +1651 -0
- package/dist-public/src/specAfter.d.ts +187 -0
- package/dist-public/src/specAfter.js +814 -0
- package/dist-public/src/specBudget.d.ts +124 -0
- package/dist-public/src/specBudget.js +424 -0
- package/dist-public/src/specDecisionSignals.d.ts +38 -0
- package/dist-public/src/specDecisionSignals.js +121 -0
- package/dist-public/src/specLinkedCommits.d.ts +7 -0
- package/dist-public/src/specLinkedCommits.js +107 -0
- package/dist-public/src/specSections.d.ts +105 -0
- package/dist-public/src/specSections.js +718 -0
- package/dist-public/src/statusGlyphs.d.ts +18 -0
- package/dist-public/src/statusGlyphs.js +75 -0
- package/dist-public/src/swarmCommand.d.ts +10 -0
- package/dist-public/src/swarmCommand.js +96 -0
- package/dist-public/src/teamsNango.d.ts +114 -0
- package/dist-public/src/teamsNango.js +301 -0
- package/dist-public/src/tokenStore.d.ts +10 -0
- package/dist-public/src/tokenStore.js +77 -0
- package/dist-public/src/trustEnvelope.d.ts +78 -0
- package/dist-public/src/trustEnvelope.js +392 -0
- package/dist-public/src/untrustedText.d.ts +6 -0
- package/dist-public/src/untrustedText.js +20 -0
- package/dist-public/src/updateNotice.d.ts +41 -0
- package/dist-public/src/updateNotice.js +290 -0
- package/dist-public/src/vendorYaml.d.ts +1 -0
- package/dist-public/src/vendorYaml.js +7374 -0
- package/dist-public/src/workflowRunActuals.d.ts +67 -0
- package/dist-public/src/workflowRunActuals.js +184 -0
- package/dist-public/src/zendeskDiscovery.d.ts +12 -0
- package/dist-public/src/zendeskDiscovery.js +513 -0
- package/dist-public/src/zendeskNango.d.ts +131 -0
- package/dist-public/src/zendeskNango.js +344 -0
- package/dist-public/src/zoomNango.d.ts +106 -0
- package/dist-public/src/zoomNango.js +351 -0
- package/docs/CHANGELOG.md +32 -0
- package/docs/THIRD_PARTY_NOTICES.md +36 -0
- package/package.json +71 -4
- package/schemas/bug-capsule-receipt.schema.json +54 -0
- package/schemas/bug-capsule.schema.json +189 -0
- package/schemas/discovery-evidence-envelope.schema.json +79 -0
- package/schemas/discovery-processing-receipt.schema.json +71 -0
- package/schemas/discovery-service-contract.schema.json +189 -0
- package/skills/AGENTS.md +32 -0
- package/skills/README.md +287 -0
- package/skills/bug/SKILL.md +49 -0
- package/skills/build-preview-spec/SKILL.md +103 -0
- package/skills/capture-external-artifact/SKILL.md +23 -0
- package/skills/capture-external-artifact/agents/openai.yaml +4 -0
- package/skills/capture-external-artifact/references/extractor-libraries.md +27 -0
- package/skills/check-spec-health/SKILL.md +45 -0
- package/skills/check-spec-health/agents/openai.yaml +4 -0
- package/skills/competitive-positioning/SKILL.md +86 -0
- package/skills/competitive-positioning/agents/openai.yaml +4 -0
- package/skills/cpo-lens/SKILL.md +398 -0
- package/skills/cpo-lens/agents/openai.yaml +4 -0
- package/skills/create-prd/SKILL.md +26 -0
- package/skills/create-prd/agents/openai.yaml +4 -0
- package/skills/customer-discovery/SKILL.md +192 -0
- package/skills/design-system/SKILL.md +49 -0
- package/skills/design-system/agents/openai.yaml +4 -0
- package/skills/discussion-guide/SKILL.md +75 -0
- package/skills/discussion-guide/agents/openai.yaml +4 -0
- package/skills/firecrawl-research-papers/SKILL.md +96 -0
- package/skills/firecrawl-research-papers/agents/openai.yaml +4 -0
- package/skills/foo-roast/SKILL.md +325 -0
- package/skills/generate-gtm-brief/SKILL.md +41 -0
- package/skills/generate-gtm-brief/agents/openai.yaml +4 -0
- package/skills/generate-gtm-brief/references/gtm-brief-template.md +56 -0
- package/skills/gong-quotes/SKILL.md +43 -0
- package/skills/gong-quotes/agents/openai.yaml +4 -0
- package/skills/grill-me/SKILL.md +27 -0
- package/skills/grill-me/agents/openai.yaml +4 -0
- package/skills/ideate/SKILL.md +180 -0
- package/skills/ideate/references/family-packs.md +5 -0
- package/skills/initiative-tracker/SKILL.md +23 -0
- package/skills/initiative-tracker/agents/openai.yaml +4 -0
- package/skills/interop-review/SKILL.md +25 -0
- package/skills/interop-review/agents/openai.yaml +4 -0
- package/skills/interview-me/SKILL.md +404 -0
- package/skills/interview-me/agents/openai.yaml +4 -0
- package/skills/loop-library-audit/SKILL.md +123 -0
- package/skills/pitch/SKILL.md +110 -0
- package/skills/pitch/references/opportunity-assessment.md +136 -0
- package/skills/pitch/references/prfaq-template.md +54 -0
- package/skills/pmm-release-briefing/SKILL.md +27 -0
- package/skills/pmm-release-briefing/agents/openai.yaml +4 -0
- package/skills/pmm-release-briefing/references/variant-generalized.md +16 -0
- package/skills/positioning-messaging/SKILL.md +70 -0
- package/skills/positioning-messaging/agents/openai.yaml +4 -0
- package/skills/positioning-messaging/references/guest-insights.md +1400 -0
- package/skills/preview-swarm/SKILL.md +418 -0
- package/skills/preview-swarm/agents/openai.yaml +4 -0
- package/skills/preview-swarm/references/html-effectiveness-build-previews.md +168 -0
- package/skills/product-copywriting/SKILL.md +127 -0
- package/skills/product-copywriting/agents/openai.yaml +4 -0
- package/skills/product-copywriting/references/foo-voice.md +26 -0
- package/skills/product-shape-interview/SKILL.md +219 -0
- package/skills/product-shape-interview/agents/openai.yaml +4 -0
- package/skills/ready-for-release/SKILL.md +39 -0
- package/skills/ready-for-release/agents/openai.yaml +4 -0
- package/skills/redact-transcripts/SKILL.md +23 -0
- package/skills/redact-transcripts/agents/openai.yaml +4 -0
- package/skills/research-brief/SKILL.md +48 -0
- package/skills/research-brief/agents/openai.yaml +4 -0
- package/skills/research-refresh/SKILL.md +63 -0
- package/skills/research-refresh/references/worked-cases.md +44 -0
- package/skills/review-loop/SKILL.md +200 -0
- package/skills/review-spec/SKILL.md +32 -0
- package/skills/review-spec/agents/openai.yaml +4 -0
- package/skills/rfc-from-research/SKILL.md +42 -0
- package/skills/rfc-from-research/agents/openai.yaml +4 -0
- package/skills/rfc-from-research/references/rfc-pattern.md +69 -0
- package/skills/skill-registry.yaml +810 -0
- package/skills/spec-cleanup/SKILL.md +103 -0
- package/skills/spec-cleanup/agents/openai.yaml +4 -0
- package/skills/spec-swarm/SKILL.md +87 -0
- package/skills/spec-swarm/agents/openai.yaml +4 -0
- package/skills/spec-swarm/template/SKILL.template.md +94 -0
- package/skills/spec-swarm/template/personas/accessibility-inclusion.md +40 -0
- package/skills/spec-swarm/template/personas/ai-technical-pm.md +69 -0
- package/skills/spec-swarm/template/personas/analytics-engineering.md +39 -0
- package/skills/spec-swarm/template/personas/applied-ai-eval.md +64 -0
- package/skills/spec-swarm/template/personas/business-gm-pm.md +67 -0
- package/skills/spec-swarm/template/personas/consumer-craft-pm.md +68 -0
- package/skills/spec-swarm/template/personas/content-design.md +40 -0
- package/skills/spec-swarm/template/personas/cpo.md +42 -0
- package/skills/spec-swarm/template/personas/data-science.md +42 -0
- package/skills/spec-swarm/template/personas/developer-experience.md +65 -0
- package/skills/spec-swarm/template/personas/dx-product.md +70 -0
- package/skills/spec-swarm/template/personas/field.md +43 -0
- package/skills/spec-swarm/template/personas/finance-cfo.md +40 -0
- package/skills/spec-swarm/template/personas/growth-pm.md +67 -0
- package/skills/spec-swarm/template/personas/platform-pm.md +67 -0
- package/skills/spec-swarm/template/personas/pmm.md +43 -0
- package/skills/spec-swarm/template/personas/principal-product-designer.md +42 -0
- package/skills/spec-swarm/template/personas/product-ops-program.md +41 -0
- package/skills/spec-swarm/template/personas/qa-release.md +41 -0
- package/skills/spec-swarm/template/personas/responsible-ai-safety.md +64 -0
- package/skills/spec-swarm/template/personas/security-privacy-legal.md +40 -0
- package/skills/spec-swarm/template/personas/strategy-competitive.md +41 -0
- package/skills/spec-swarm/template/personas/technical-architect.md +42 -0
- package/skills/spec-swarm/template/personas/technical-lead.md +43 -0
- package/skills/spec-swarm/template/personas/user-research.md +41 -0
- package/skills/spec-swarm-accessibility-inclusion/SKILL.md +95 -0
- package/skills/spec-swarm-accessibility-inclusion/agents/openai.yaml +4 -0
- package/skills/spec-swarm-ai-technical-pm/SKILL.md +124 -0
- package/skills/spec-swarm-analytics-engineering/SKILL.md +94 -0
- package/skills/spec-swarm-analytics-engineering/agents/openai.yaml +4 -0
- package/skills/spec-swarm-applied-ai-eval/SKILL.md +120 -0
- package/skills/spec-swarm-business-gm-pm/SKILL.md +122 -0
- package/skills/spec-swarm-consumer-craft-pm/SKILL.md +122 -0
- package/skills/spec-swarm-content-design/SKILL.md +95 -0
- package/skills/spec-swarm-content-design/agents/openai.yaml +4 -0
- package/skills/spec-swarm-cpo/SKILL.md +94 -0
- package/skills/spec-swarm-cpo/agents/openai.yaml +4 -0
- package/skills/spec-swarm-data-science/SKILL.md +95 -0
- package/skills/spec-swarm-data-science/agents/openai.yaml +4 -0
- package/skills/spec-swarm-developer-experience/SKILL.md +121 -0
- package/skills/spec-swarm-dx-product/SKILL.md +126 -0
- package/skills/spec-swarm-field/SKILL.md +96 -0
- package/skills/spec-swarm-field/agents/openai.yaml +4 -0
- package/skills/spec-swarm-finance-cfo/SKILL.md +95 -0
- package/skills/spec-swarm-finance-cfo/agents/openai.yaml +4 -0
- package/skills/spec-swarm-growth-pm/SKILL.md +122 -0
- package/skills/spec-swarm-platform-pm/SKILL.md +122 -0
- package/skills/spec-swarm-pmm/SKILL.md +96 -0
- package/skills/spec-swarm-pmm/agents/openai.yaml +4 -0
- package/skills/spec-swarm-principal-product-designer/SKILL.md +95 -0
- package/skills/spec-swarm-principal-product-designer/agents/openai.yaml +4 -0
- package/skills/spec-swarm-product-ops-program/SKILL.md +96 -0
- package/skills/spec-swarm-product-ops-program/agents/openai.yaml +4 -0
- package/skills/spec-swarm-qa-release/SKILL.md +96 -0
- package/skills/spec-swarm-qa-release/agents/openai.yaml +4 -0
- package/skills/spec-swarm-responsible-ai-safety/SKILL.md +120 -0
- package/skills/spec-swarm-security-privacy-legal/SKILL.md +95 -0
- package/skills/spec-swarm-security-privacy-legal/agents/openai.yaml +4 -0
- package/skills/spec-swarm-strategy-competitive/SKILL.md +96 -0
- package/skills/spec-swarm-strategy-competitive/agents/openai.yaml +4 -0
- package/skills/spec-swarm-technical-architect/SKILL.md +95 -0
- package/skills/spec-swarm-technical-architect/agents/openai.yaml +4 -0
- package/skills/spec-swarm-technical-lead/SKILL.md +96 -0
- package/skills/spec-swarm-technical-lead/agents/openai.yaml +4 -0
- package/skills/spec-swarm-user-research/SKILL.md +95 -0
- package/skills/spec-swarm-user-research/agents/openai.yaml +4 -0
- package/skills/strategy-check/SKILL.md +170 -0
- package/skills/strategy-check/agents/openai.yaml +4 -0
- package/skills/study-digest/SKILL.md +41 -0
- package/skills/synthetic-customer/SKILL.md +68 -0
- package/skills/update-cli-spec/SKILL.md +69 -0
- package/skills/update-cli-spec/agents/openai.yaml +4 -0
- package/skills/voc-researcher/SKILL.md +45 -0
- package/skills/voc-researcher/agents/openai.yaml +4 -0
- package/skills-lock.json +35 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// Cross-agent runtime registry for portable routines (portable-routines-v0).
|
|
2
|
+
//
|
|
3
|
+
// A routine's *contract* is canonical and runtime-neutral (purpose, observation
|
|
4
|
+
// source, allowed actions, verification check, terminal states, approval
|
|
5
|
+
// boundaries — see routines.ts). What differs per coding agent is only the
|
|
6
|
+
// *binding*: how a schedule is armed, and how that agent is invoked headless for
|
|
7
|
+
// one pass. This registry is that binding, kept in one place so adding a runtime
|
|
8
|
+
// is a data edit, not a code change.
|
|
9
|
+
//
|
|
10
|
+
// productfoo never runs a scheduler itself. It validates the canonical contract and
|
|
11
|
+
// emits the per-runtime binding artifact (a crontab line, a CI workflow, a
|
|
12
|
+
// `.claude`/`.codex` descriptor). The runtime's own scheduler fires it; each
|
|
13
|
+
// pass writes its iteration record back into the packet ledger, so the loop's
|
|
14
|
+
// output stays runtime-neutral no matter who ran it.
|
|
15
|
+
export function resolveHarnessCommandTarget(adapter, scope) {
|
|
16
|
+
if (adapter.support === "planned") {
|
|
17
|
+
return { supported: false, reason: adapter.unsupportedReason ?? `${adapter.label} command surface not yet supported` };
|
|
18
|
+
}
|
|
19
|
+
const dir = scope === "global" ? adapter.commandsDir.global : adapter.commandsDir.project;
|
|
20
|
+
if (dir == null) {
|
|
21
|
+
return { supported: false, reason: `${adapter.label} has no ${scope}-scope command directory` };
|
|
22
|
+
}
|
|
23
|
+
return { supported: true, dir, extension: adapter.commandExtension, format: adapter.commandFormat, prefix: adapter.commandPrefix ?? "" };
|
|
24
|
+
}
|
|
25
|
+
// Claude and Codex are the two supported runtimes for V0; the rest are mapped
|
|
26
|
+
// with the concrete gap so "what else we'd want to fit for" is explicit, not lost.
|
|
27
|
+
export const AGENT_ADAPTERS = {
|
|
28
|
+
claude: {
|
|
29
|
+
id: "claude",
|
|
30
|
+
label: "Claude Code",
|
|
31
|
+
support: "supported",
|
|
32
|
+
config_dir: ".claude",
|
|
33
|
+
can_run_headless: true,
|
|
34
|
+
trigger_mechanisms: ["manual", "schedule", "event"],
|
|
35
|
+
// Headless one-shot, least-privilege by default: -p runs non-interactively
|
|
36
|
+
// and exits, with normal permission prompts intact. Raising autonomy
|
|
37
|
+
// (acceptEdits / skip-permissions) for an unattended routine is a deliberate
|
|
38
|
+
// opt-in, never the emitted default (foo-roast Agent-Safety finding).
|
|
39
|
+
invoke_template: 'claude -p "{prompt}"',
|
|
40
|
+
notes: "Schedule via the harness scheduler (cron) or the /loop skill; events via hooks. Pass --output-format json to capture the iteration record for the ledger. Raise autonomy explicitly if a routine truly needs unattended edits.",
|
|
41
|
+
},
|
|
42
|
+
codex: {
|
|
43
|
+
id: "codex",
|
|
44
|
+
label: "Codex CLI",
|
|
45
|
+
support: "supported",
|
|
46
|
+
config_dir: ".codex",
|
|
47
|
+
can_run_headless: true,
|
|
48
|
+
trigger_mechanisms: ["manual", "schedule"],
|
|
49
|
+
// `codex exec` is Codex's non-interactive one-shot.
|
|
50
|
+
invoke_template: 'codex exec "{prompt}"',
|
|
51
|
+
notes: "Headless via `codex exec`. No first-party scheduler yet — arm the schedule with system cron or github-actions and let the binding invoke `codex exec`.",
|
|
52
|
+
},
|
|
53
|
+
cursor: {
|
|
54
|
+
id: "cursor",
|
|
55
|
+
label: "Cursor",
|
|
56
|
+
// A headless CLI now EXISTS — `cursor-agent -p "<prompt>"` — so the gap is no
|
|
57
|
+
// longer "no CLI"; it is RELIABILITY. `-p` has documented hang / terminal-not-
|
|
58
|
+
// released bugs (community reports, early 2026), which is precisely the B4
|
|
59
|
+
// failure mode: an unattended loop that never returns. So `can_run_headless`
|
|
60
|
+
// stays false until `-p` reliability is confirmed on a pinned version. First-
|
|
61
|
+
// class on the command surface (HARNESS_COMMAND_ADAPTERS); gated as an
|
|
62
|
+
// UNATTENDED runtime on purpose. (cursor.com/docs/cli/headless)
|
|
63
|
+
support: "planned",
|
|
64
|
+
config_dir: ".cursor",
|
|
65
|
+
can_run_headless: false,
|
|
66
|
+
trigger_mechanisms: ["manual"],
|
|
67
|
+
invoke_template: null,
|
|
68
|
+
notes: "Headless CLI exists (`cursor-agent -p`), but `-p` has reported reliability issues (hangs / does not release the terminal) that make it unsafe to arm for unattended loops today. Promote `can_run_headless` once `-p` is confirmed reliable on a pinned version; until then run a watched one-shot manually, or arm via github-actions running a supported runtime.",
|
|
69
|
+
},
|
|
70
|
+
"github-actions": {
|
|
71
|
+
id: "github-actions",
|
|
72
|
+
label: "GitHub Actions",
|
|
73
|
+
support: "planned",
|
|
74
|
+
config_dir: ".github/workflows",
|
|
75
|
+
can_run_headless: true,
|
|
76
|
+
// CI is the strongest portable *scheduling substrate*: it can arm a cron and
|
|
77
|
+
// then invoke ANY of the runtimes above in a job step.
|
|
78
|
+
trigger_mechanisms: ["schedule", "event"],
|
|
79
|
+
invoke_template: null,
|
|
80
|
+
notes: "Meta-adapter: `on: schedule` (cron) or `on:` events host any runtime's headless invocation in a step. Best path to arm Codex on a cadence today; needs secrets handling and a committed workflow.",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
// Human command surfaces for `foo agent setup`. The canonical behavior lives in
|
|
84
|
+
// `commands/*.md` and the CLI; these descriptors only adapt that portable
|
|
85
|
+
// payload to a harness filesystem convention.
|
|
86
|
+
export const HARNESS_COMMAND_ADAPTERS = {
|
|
87
|
+
"claude-code": {
|
|
88
|
+
id: "claude-code",
|
|
89
|
+
label: "Claude Code",
|
|
90
|
+
// Claude Code namespaces slash commands by SUBDIRECTORY of its native
|
|
91
|
+
// commands dir: .claude/commands/foo/spec.md is typed /foo:spec, loaded in
|
|
92
|
+
// every session with zero registration. The earlier plugin install
|
|
93
|
+
// (.claude/skills/foo/ + .claude-plugin/plugin.json) is retired: Claude
|
|
94
|
+
// Code only loads plugins registered in its plugin manager or passed via
|
|
95
|
+
// --plugin-dir, so the unregistered directory silently loaded nothing and
|
|
96
|
+
// fresh sessions had no /foo:* commands at all.
|
|
97
|
+
commandsDir: { global: ".claude/commands/foo", project: ".claude/commands/foo" },
|
|
98
|
+
commandExtension: ".md",
|
|
99
|
+
commandFormat: "markdown",
|
|
100
|
+
support: "supported",
|
|
101
|
+
commandNamespace: "foo",
|
|
102
|
+
projectPath: ".claude/commands",
|
|
103
|
+
legacyPaths: [".claude/skills"],
|
|
104
|
+
legacyCommandsDir: ".claude/skills/foo/commands",
|
|
105
|
+
legacyPluginDir: ".claude/skills/foo",
|
|
106
|
+
},
|
|
107
|
+
codex: {
|
|
108
|
+
id: "codex",
|
|
109
|
+
label: "Codex",
|
|
110
|
+
// Current Codex App + CLI share the plugin substrate. A personal plugin is
|
|
111
|
+
// the verified way to expose the SAME /foo:* namespace in both.
|
|
112
|
+
commandsDir: { global: "plugins/foo/skills", project: null },
|
|
113
|
+
commandExtension: ".md",
|
|
114
|
+
commandFormat: "markdown",
|
|
115
|
+
commandLayout: "skills",
|
|
116
|
+
support: "supported",
|
|
117
|
+
plugin: { dir: "plugins/foo", name: "foo", manifestRelPath: ".codex-plugin/plugin.json" },
|
|
118
|
+
marketplace: { manifestRelPath: ".agents/plugins/marketplace.json", name: "personal" },
|
|
119
|
+
projectPath: "plugins/foo",
|
|
120
|
+
legacyPaths: [".agents/skills"],
|
|
121
|
+
},
|
|
122
|
+
opencode: {
|
|
123
|
+
id: "opencode",
|
|
124
|
+
label: "OpenCode",
|
|
125
|
+
// ~/.config/opencode/commands (global) + .opencode/commands (project) — NOT .agents/.
|
|
126
|
+
commandsDir: { global: ".config/opencode/commands", project: ".opencode/commands" },
|
|
127
|
+
commandExtension: ".md",
|
|
128
|
+
commandFormat: "markdown",
|
|
129
|
+
support: "supported",
|
|
130
|
+
commandPrefix: "foo-",
|
|
131
|
+
projectPath: ".opencode/commands",
|
|
132
|
+
legacyPaths: [".agents/skills"],
|
|
133
|
+
legacyCommandsDir: ".agents/commands",
|
|
134
|
+
},
|
|
135
|
+
cursor: {
|
|
136
|
+
id: "cursor",
|
|
137
|
+
label: "Cursor",
|
|
138
|
+
// ~/.cursor/commands (global) + .cursor/commands (project); markdown, /-invoked.
|
|
139
|
+
commandsDir: { global: ".cursor/commands", project: ".cursor/commands" },
|
|
140
|
+
commandExtension: ".md",
|
|
141
|
+
commandFormat: "markdown",
|
|
142
|
+
support: "supported",
|
|
143
|
+
commandPrefix: "foo-",
|
|
144
|
+
projectPath: ".cursor/commands",
|
|
145
|
+
legacyPaths: [".agents/skills"],
|
|
146
|
+
legacyCommandsDir: ".agents/commands",
|
|
147
|
+
},
|
|
148
|
+
grok: {
|
|
149
|
+
id: "grok",
|
|
150
|
+
label: "Grok Bot",
|
|
151
|
+
// Grok Bot command directory follows the common .grok/commands pattern.
|
|
152
|
+
// D-001 (embedded invocation): bot skills embed command contract and call `foo <command>`.
|
|
153
|
+
// D-002: eight commands only (init, spec, ideate, pitch, research, preview, roast, discovery) — bug excluded.
|
|
154
|
+
commandsDir: { global: ".grok/commands", project: ".grok/commands" },
|
|
155
|
+
commandExtension: ".md",
|
|
156
|
+
commandFormat: "markdown",
|
|
157
|
+
support: "supported",
|
|
158
|
+
commandPrefix: "foo-",
|
|
159
|
+
projectPath: ".grok/commands",
|
|
160
|
+
excludedCommands: ["bug"], // D-002: exclude bug from third-party Grok Bot
|
|
161
|
+
legacyPaths: [],
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
export function getAdapter(id) {
|
|
165
|
+
return AGENT_ADAPTERS[id];
|
|
166
|
+
}
|
|
167
|
+
export function supportedRuntimes() {
|
|
168
|
+
return Object.keys(AGENT_ADAPTERS).filter((id) => AGENT_ADAPTERS[id].support === "supported");
|
|
169
|
+
}
|
|
170
|
+
export function knownRuntimes() {
|
|
171
|
+
return Object.keys(AGENT_ADAPTERS);
|
|
172
|
+
}
|
|
173
|
+
export function knownHarnessCommandAdapters() {
|
|
174
|
+
return Object.keys(HARNESS_COMMAND_ADAPTERS);
|
|
175
|
+
}
|
|
176
|
+
export function getHarnessCommandAdapter(id) {
|
|
177
|
+
return HARNESS_COMMAND_ADAPTERS[id];
|
|
178
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type AgentTelemetryConfig = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
testerId?: string;
|
|
4
|
+
};
|
|
5
|
+
export type CliUsageEvent = {
|
|
6
|
+
schema_version: "0.1";
|
|
7
|
+
event_type: "cli_usage";
|
|
8
|
+
id: string;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
command: string;
|
|
12
|
+
exit_code: number;
|
|
13
|
+
error_class: string;
|
|
14
|
+
error_code?: string;
|
|
15
|
+
duration_ms: number;
|
|
16
|
+
version: string;
|
|
17
|
+
tester_id?: string;
|
|
18
|
+
packet_slug?: string;
|
|
19
|
+
attributes?: {
|
|
20
|
+
interactive: boolean;
|
|
21
|
+
fingerprint?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare function agentLogPath(_root?: string): string;
|
|
25
|
+
export declare const LEDGER_MAX_BYTES: number;
|
|
26
|
+
export declare function appendLedgerEvent(logPath: string, line: string, maxBytes?: number): void;
|
|
27
|
+
export declare function agentTelemetryConfigPath(root: string): string;
|
|
28
|
+
export declare function machineTelemetryConfigPath(): string;
|
|
29
|
+
export declare function nextAgentEventId(): string;
|
|
30
|
+
export declare function readTelemetryFile(configPath: string): {
|
|
31
|
+
config: Partial<AgentTelemetryConfig>;
|
|
32
|
+
exists: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare function readAgentTelemetryConfig(root: string): {
|
|
35
|
+
config: AgentTelemetryConfig;
|
|
36
|
+
exists: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare function writeAgentTelemetryConfig(root: string, config: AgentTelemetryConfig): void;
|
|
39
|
+
export declare function writeMachineTesterId(testerId: string): void;
|
|
40
|
+
export declare function generateTesterId(): string;
|
|
41
|
+
export declare function resolveTesterId(root: string): string | undefined;
|
|
42
|
+
export declare function autoWireEligibleDomain(domain: string | undefined): boolean;
|
|
43
|
+
export declare function isFlagOnlyDomain(domain: string): boolean;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Light, boot-path agent state: the ledger/event primitives, telemetry config,
|
|
2
|
+
// tester identity, and the auto-wire eligibility predicate that cli.ts's
|
|
3
|
+
// per-invocation spine uses. This module exists so the every-invocation code
|
|
4
|
+
// path (usage telemetry, event ids, log path) does not pull the heavy `agent`
|
|
5
|
+
// command domain (harness adapters, redaction, agent setup) into the static
|
|
6
|
+
// import graph — cli_performance-v0 R-002 lazy dispatch. The functions are
|
|
7
|
+
// moved verbatim from commands/agent.ts, which re-exports them.
|
|
8
|
+
import { appendFileSync, mkdirSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { randomBytes } from "node:crypto";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { readJson } from "./jsonFile.js";
|
|
12
|
+
import { machineStateDir } from "./machineState.js";
|
|
13
|
+
import { fileStatKey, readMemoized, writeMemoized } from "./processMemo.js";
|
|
14
|
+
// The event ledger is MACHINE state, not project state — the same argument that
|
|
15
|
+
// already moved the tester id out of the project dir (see machineTelemetryConfigPath
|
|
16
|
+
// below). It used to be `<cwd>/.foo/agent-events.jsonl`: foo wrote telemetry INTO
|
|
17
|
+
// the user's git repo, on every invocation, and nothing gitignored it. An alpha
|
|
18
|
+
// tester found it as an untracked file she had to clean up herself.
|
|
19
|
+
//
|
|
20
|
+
// It never bit in dogfood for one reason: productfoo's OWN .gitignore has `.foo/`. productfoo
|
|
21
|
+
// was the only repo in the world where the bug was invisible.
|
|
22
|
+
//
|
|
23
|
+
// The other exit — writing `.foo/` into the user's .gitignore for them — is the
|
|
24
|
+
// same sin in a different file: editing a tracked project file nobody asked us to
|
|
25
|
+
// touch (R-004 says this out loud about shell profiles; a .gitignore is no
|
|
26
|
+
// different). So foo writes under its own home instead, and leaves the user's repo
|
|
27
|
+
// exactly as it found it. FOO_STATE_DIR overrides for tests. (R-005)
|
|
28
|
+
export function agentLogPath(_root) {
|
|
29
|
+
return path.join(machineStateDir(), "agent-events.jsonl");
|
|
30
|
+
}
|
|
31
|
+
// The ledger is read back whole (`foo agent logs|rate|telemetry` parse every
|
|
32
|
+
// line), so an unbounded file would make those reads grow with history. At
|
|
33
|
+
// the cap the current file rotates to `<name>.1` — one backup generation, the
|
|
34
|
+
// oldest events falling off first (cli-performance-v0 R-004, audit F7).
|
|
35
|
+
export const LEDGER_MAX_BYTES = 5 * 1024 * 1024;
|
|
36
|
+
// Single append per event, with size-cap rotation: every ledger write goes
|
|
37
|
+
// through here so no site can rewrite the file. Rotation is one rename (the
|
|
38
|
+
// live file becomes the backup, replaced in turn by the next rotation) —
|
|
39
|
+
// never a read-and-rewrite of the corpus. The cap is a parameter so tests can
|
|
40
|
+
// exercise the boundary without materializing megabytes.
|
|
41
|
+
export function appendLedgerEvent(logPath, line, maxBytes = LEDGER_MAX_BYTES) {
|
|
42
|
+
mkdirSync(path.dirname(logPath), { recursive: true });
|
|
43
|
+
if (maxBytes > 0) {
|
|
44
|
+
try {
|
|
45
|
+
if (statSync(logPath).size >= maxBytes)
|
|
46
|
+
renameSync(logPath, `${logPath}.1`);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
// No ledger yet is the normal first-append case, not a failure; any
|
|
50
|
+
// other stat error (permissions, EACCES) is real and must surface.
|
|
51
|
+
if (error.code !== "ENOENT")
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
appendFileSync(logPath, line);
|
|
56
|
+
}
|
|
57
|
+
export function agentTelemetryConfigPath(root) {
|
|
58
|
+
return path.join(root, ".foo", "telemetry.json");
|
|
59
|
+
}
|
|
60
|
+
// The tester id is a PER-MACHINE identity (one human, one id), so it lives
|
|
61
|
+
// under the home dir — never the project dir. Persisting it per-project minted
|
|
62
|
+
// a fresh id (and fired a fresh activation event) in every directory a tester
|
|
63
|
+
// ran foo from, inflating install counts. FOO_STATE_DIR overrides for tests.
|
|
64
|
+
export function machineTelemetryConfigPath() {
|
|
65
|
+
return path.join(machineStateDir(), "telemetry.json");
|
|
66
|
+
}
|
|
67
|
+
export function nextAgentEventId() {
|
|
68
|
+
return `evt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
69
|
+
}
|
|
70
|
+
// Per-process memo (cli_performance-v0 R-002): telemetry config is read 3× per
|
|
71
|
+
// invocation today (cli.ts usage path ×2 + resolveTesterId). Keyed on
|
|
72
|
+
// (mtime, size) so an external write between reads — a test fixture, another
|
|
73
|
+
// process — invalidates naturally; every in-process write deletes its entry.
|
|
74
|
+
const telemetryFileCache = new Map();
|
|
75
|
+
export function readTelemetryFile(configPath) {
|
|
76
|
+
const key = fileStatKey(configPath);
|
|
77
|
+
const cached = readMemoized(telemetryFileCache, configPath, key);
|
|
78
|
+
if (cached !== undefined)
|
|
79
|
+
return { exists: cached.exists, config: { ...cached.config } };
|
|
80
|
+
let value;
|
|
81
|
+
if (key === "absent")
|
|
82
|
+
value = { config: {}, exists: false };
|
|
83
|
+
else {
|
|
84
|
+
try {
|
|
85
|
+
value = { config: readJson(configPath), exists: true };
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
value = { config: {}, exists: false };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
writeMemoized(telemetryFileCache, configPath, key, value);
|
|
92
|
+
return { exists: value.exists, config: { ...value.config } };
|
|
93
|
+
}
|
|
94
|
+
// Merged view: the tester id comes from the machine config first (project as a
|
|
95
|
+
// pre-fix fallback, adopted upward by resolveTesterId); the opt-out honors a
|
|
96
|
+
// `false` at EITHER scope, so a disable always holds.
|
|
97
|
+
export function readAgentTelemetryConfig(root) {
|
|
98
|
+
const project = readTelemetryFile(agentTelemetryConfigPath(root));
|
|
99
|
+
const machine = readTelemetryFile(machineTelemetryConfigPath());
|
|
100
|
+
const testerId = machine.config.testerId ?? project.config.testerId;
|
|
101
|
+
return {
|
|
102
|
+
config: {
|
|
103
|
+
enabled: project.config.enabled !== false && machine.config.enabled !== false,
|
|
104
|
+
...(testerId ? { testerId } : {}),
|
|
105
|
+
},
|
|
106
|
+
exists: project.exists || machine.exists,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function writeTelemetryFile(configPath, config) {
|
|
110
|
+
mkdirSync(path.dirname(configPath), { recursive: true });
|
|
111
|
+
writeFileSync(configPath, `${JSON.stringify({ schema_version: "0.1", ...config }, null, 2)}\n`);
|
|
112
|
+
// Same-process reads must observe the write (enable/disable then read).
|
|
113
|
+
telemetryFileCache.delete(configPath);
|
|
114
|
+
}
|
|
115
|
+
// Per-repo settings (the enable/disable opt-out) stay in the project config.
|
|
116
|
+
export function writeAgentTelemetryConfig(root, config) {
|
|
117
|
+
writeTelemetryFile(agentTelemetryConfigPath(root), config);
|
|
118
|
+
}
|
|
119
|
+
// Identity writes go to the machine config — one id per human per machine.
|
|
120
|
+
export function writeMachineTesterId(testerId) {
|
|
121
|
+
const { config } = readTelemetryFile(machineTelemetryConfigPath());
|
|
122
|
+
writeTelemetryFile(machineTelemetryConfigPath(), { ...config, enabled: config.enabled !== false, testerId });
|
|
123
|
+
}
|
|
124
|
+
export function generateTesterId() {
|
|
125
|
+
return `t_${randomBytes(6).toString("hex")}`;
|
|
126
|
+
}
|
|
127
|
+
// Local installation identifier. Precedence:
|
|
128
|
+
// FOO_TESTER_ID env (maintainer-issued at invite) > machine config > project
|
|
129
|
+
// config (pre-fix installs; adopted upward once) > freshly generated. Opaque
|
|
130
|
+
// token, never a name; it attributes metadata-only usage and count-only
|
|
131
|
+
// Firecrawl bridge metering. The bridge is untrusted transport; sealing and
|
|
132
|
+
// exact-byte receipt validation are separate, and there is no multi-model panel.
|
|
133
|
+
// Returns undefined when telemetry is opted out — no id is minted
|
|
134
|
+
// or emitted in that case.
|
|
135
|
+
export function resolveTesterId(root) {
|
|
136
|
+
const { config } = readAgentTelemetryConfig(root);
|
|
137
|
+
if (!config.enabled)
|
|
138
|
+
return undefined;
|
|
139
|
+
const machine = readTelemetryFile(machineTelemetryConfigPath()).config;
|
|
140
|
+
const fromEnv = process.env.FOO_TESTER_ID?.trim();
|
|
141
|
+
if (fromEnv) {
|
|
142
|
+
if (machine.testerId !== fromEnv)
|
|
143
|
+
writeMachineTesterId(fromEnv);
|
|
144
|
+
return fromEnv;
|
|
145
|
+
}
|
|
146
|
+
if (machine.testerId)
|
|
147
|
+
return machine.testerId;
|
|
148
|
+
// Pre-fix installs persisted the id per-project: adopt it upward once so the
|
|
149
|
+
// tester keeps their identity and no duplicate activation fires.
|
|
150
|
+
if (config.testerId) {
|
|
151
|
+
writeMachineTesterId(config.testerId);
|
|
152
|
+
return config.testerId;
|
|
153
|
+
}
|
|
154
|
+
const generated = generateTesterId();
|
|
155
|
+
writeMachineTesterId(generated);
|
|
156
|
+
return generated;
|
|
157
|
+
}
|
|
158
|
+
// Which invocations may trigger the install-once-wire-all self-wiring
|
|
159
|
+
// (maybeAutoWireHarnesses, commands/agent.ts). Trivial meta commands are
|
|
160
|
+
// exempt, and so is the BARE invocation (no domain at all): a stranger's
|
|
161
|
+
// first-ever `foo` must answer before it writes — the front door used to wire
|
|
162
|
+
// `~/.claude/commands/*` and stamp `~/.foo` on the way to printing
|
|
163
|
+
// "domain missing" (FTUX defect: mutate-before-hello). Lives here (not the
|
|
164
|
+
// heavy agent domain) because dispatch consults it on every invocation.
|
|
165
|
+
export function autoWireEligibleDomain(domain) {
|
|
166
|
+
if (domain === undefined)
|
|
167
|
+
return false;
|
|
168
|
+
return !["--version", "-v", "version", "help", "--help", "-h"].includes(domain);
|
|
169
|
+
}
|
|
170
|
+
// Flag-only invocations (`--version`, `help`) carry no usage signal worth a
|
|
171
|
+
// ledger line: appending one trained a spurious event into every machine's
|
|
172
|
+
// ledger on every boot (cli-performance-v0 R-004, audit F7). Derived-domain
|
|
173
|
+
// form — deriveCliCommand normalizes --version/-v and --help/-h before this
|
|
174
|
+
// sees them. The keyed auto-report is a separate egress flow and is unaffected.
|
|
175
|
+
export function isFlagOnlyDomain(domain) {
|
|
176
|
+
return domain === "version" || domain === "help";
|
|
177
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ErrorClass, ErrorCode } from "./errorTaxonomy.js";
|
|
2
|
+
export type FieldValue = {
|
|
3
|
+
state: "collected";
|
|
4
|
+
value: string;
|
|
5
|
+
} | {
|
|
6
|
+
state: "not_collected" | "withheld" | "unavailable";
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
9
|
+
export type BugCapsule = {
|
|
10
|
+
schema_version: "0.1";
|
|
11
|
+
capsule_id: string;
|
|
12
|
+
occurred_at: string;
|
|
13
|
+
producer: {
|
|
14
|
+
name: string;
|
|
15
|
+
version: string;
|
|
16
|
+
};
|
|
17
|
+
product: {
|
|
18
|
+
name: string;
|
|
19
|
+
component: string;
|
|
20
|
+
version: string;
|
|
21
|
+
};
|
|
22
|
+
invocation: {
|
|
23
|
+
command: string;
|
|
24
|
+
runtime: {
|
|
25
|
+
node: string;
|
|
26
|
+
platform: string;
|
|
27
|
+
arch: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
failure: {
|
|
31
|
+
class: ErrorClass;
|
|
32
|
+
code: ErrorCode;
|
|
33
|
+
classifier_version: "0.1";
|
|
34
|
+
classification: "known" | "fallback";
|
|
35
|
+
message: FieldValue;
|
|
36
|
+
stack: FieldValue;
|
|
37
|
+
};
|
|
38
|
+
report: {
|
|
39
|
+
expected: FieldValue;
|
|
40
|
+
actual: FieldValue;
|
|
41
|
+
reproduction: FieldValue;
|
|
42
|
+
};
|
|
43
|
+
evidence: Array<{
|
|
44
|
+
kind: "diagnostic" | "user_report";
|
|
45
|
+
state: FieldValue["state"];
|
|
46
|
+
content_type: string;
|
|
47
|
+
}>;
|
|
48
|
+
similarity: {
|
|
49
|
+
version: "0.1";
|
|
50
|
+
signals: Array<{
|
|
51
|
+
kind: "error_fingerprint";
|
|
52
|
+
value: string;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
links: Array<{
|
|
56
|
+
relation: string;
|
|
57
|
+
provider: string;
|
|
58
|
+
external_id: string;
|
|
59
|
+
provenance: "reporter_observed";
|
|
60
|
+
authority: "reference";
|
|
61
|
+
}>;
|
|
62
|
+
extensions: Record<string, unknown> & {
|
|
63
|
+
foo?: {
|
|
64
|
+
spec_context?: {
|
|
65
|
+
spec_id: string;
|
|
66
|
+
packet_path: string;
|
|
67
|
+
revision?: string;
|
|
68
|
+
requirement_ids: string[];
|
|
69
|
+
task_ids: string[];
|
|
70
|
+
provenance: "reporter_observed";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
/** Historical delivery metadata retained so existing local archives remain readable. */
|
|
76
|
+
export type DeliveryReceipt = {
|
|
77
|
+
schema_version: "0.1";
|
|
78
|
+
receipt_id: string;
|
|
79
|
+
capsule_id: string;
|
|
80
|
+
payload_digest: string;
|
|
81
|
+
accepted_at: string;
|
|
82
|
+
destination: string;
|
|
83
|
+
status: "accepted" | "rejected" | "retryable";
|
|
84
|
+
error: null | {
|
|
85
|
+
code: string;
|
|
86
|
+
message: string;
|
|
87
|
+
retry_after?: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export declare function canonicalBytes(capsule: BugCapsule): Buffer;
|
|
91
|
+
export declare function payloadDigest(capsule: BugCapsule): string;
|
|
92
|
+
export declare function uuidV7(nowMs?: number, entropy?: Buffer): string;
|
|
93
|
+
export declare function parseBugCapsule(value: unknown): BugCapsule;
|
|
94
|
+
export declare function parseDeliveryReceipt(value: unknown): DeliveryReceipt;
|