audit-tools 0.34.41 → 0.35.0
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/dist/audit/cli/args.d.ts +6 -0
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +21 -4
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +6 -15
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +1 -1
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostFanoutGate.d.ts +21 -61
- package/dist/audit/cli/dispatch/hostFanoutGate.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostFanoutGate.js +18 -167
- package/dist/audit/cli/dispatch/hostFanoutGate.js.map +1 -1
- package/dist/audit/cli/dispatch/packetFilter.d.ts +2 -2
- package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/packetFilter.js +3 -1
- package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.d.ts +2 -14
- package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.js +16 -6
- package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
- package/dist/audit/cli/dispatch/tierRouting.d.ts +2 -2
- package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/tokenUsageObservation.js +10 -2
- package/dist/audit/cli/dispatch/tokenUsageObservation.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts +14 -3
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +87 -65
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.js +9 -1
- package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
- package/dist/audit/cli/hybridDispatch.d.ts +4 -9
- package/dist/audit/cli/hybridDispatch.d.ts.map +1 -1
- package/dist/audit/cli/hybridDispatch.js +1 -1
- package/dist/audit/cli/hybridDispatch.js.map +1 -1
- package/dist/audit/cli/lineIndex.d.ts +2 -0
- package/dist/audit/cli/lineIndex.d.ts.map +1 -1
- package/dist/audit/cli/lineIndex.js +4 -0
- package/dist/audit/cli/lineIndex.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts +0 -26
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +14 -358
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +5 -16
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +27 -157
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
- package/dist/audit/cli/quotaCommand.js +1 -5
- package/dist/audit/cli/quotaCommand.js.map +1 -1
- package/dist/audit/cli/reviewRun.d.ts.map +1 -1
- package/dist/audit/cli/reviewRun.js +58 -23
- package/dist/audit/cli/reviewRun.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +35 -54
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +4 -4
- package/dist/audit/cli/steps.d.ts.map +1 -1
- package/dist/audit/cli/steps.js +0 -1
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/cli/workPartitionRuntime.d.ts +11 -0
- package/dist/audit/cli/workPartitionRuntime.d.ts.map +1 -0
- package/dist/audit/cli/workPartitionRuntime.js +39 -0
- package/dist/audit/cli/workPartitionRuntime.js.map +1 -0
- package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
- package/dist/audit/io/artifacts.d.ts +1 -3
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +0 -3
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +0 -35
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +4 -63
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +9 -12
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +0 -5
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/hostInputPause.d.ts +1 -1
- package/dist/audit/orchestrator/hostInputPause.js +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +4 -1
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.d.ts +1 -65
- package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.js +3 -425
- package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +0 -13
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +0 -7
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +4 -1
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.d.ts +1 -1
- package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.js +5 -4
- package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts +0 -39
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +3 -29
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -2
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +7 -5
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/reporting/findingIdentity.d.ts +2 -2
- package/dist/audit/reporting/findingIdentity.js +2 -2
- package/dist/audit/reporting/synthesis.d.ts +7 -1
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +27 -7
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/workBlocks.d.ts +14 -3
- package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
- package/dist/audit/reporting/workBlocks.js +163 -73
- package/dist/audit/reporting/workBlocks.js.map +1 -1
- package/dist/audit/types/activeDispatch.d.ts +8 -7
- package/dist/audit/types/activeDispatch.d.ts.map +1 -1
- package/dist/audit/types/auditState.d.ts +6 -6
- package/dist/audit/types/externalAnalyzer.d.ts +6 -6
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +6 -1
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.d.ts +8 -0
- package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.js +63 -0
- package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.js +5 -3
- package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +1 -1
- package/dist/remediate/phases/plan.d.ts.map +1 -1
- package/dist/remediate/phases/plan.js +35 -12
- package/dist/remediate/phases/plan.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +6 -2
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +90 -6
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +4 -2
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.d.ts +6 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.js +16 -17
- package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts +7 -15
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.js +26 -19
- package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +5 -7
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +100 -82
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/rollingSession.d.ts +2 -1
- package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
- package/dist/remediate/steps/rollingSession.js +14 -8
- package/dist/remediate/steps/rollingSession.js.map +1 -1
- package/dist/remediate/steps/sessionConfigLoad.d.ts +3 -2
- package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -1
- package/dist/remediate/steps/sessionConfigLoad.js +4 -10
- package/dist/remediate/steps/sessionConfigLoad.js.map +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipeline.js +7 -1
- package/dist/remediate/validation/contractPipeline.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +8 -0
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +89 -0
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/config/resolveSessionConfig.d.ts.map +1 -1
- package/dist/shared/config/resolveSessionConfig.js +6 -5
- package/dist/shared/config/resolveSessionConfig.js.map +1 -1
- package/dist/shared/decompose/workPartition.d.ts +66 -0
- package/dist/shared/decompose/workPartition.d.ts.map +1 -0
- package/dist/shared/decompose/workPartition.js +523 -0
- package/dist/shared/decompose/workPartition.js.map +1 -0
- package/dist/shared/dispatch/admissionLoop.d.ts +5 -44
- package/dist/shared/dispatch/admissionLoop.d.ts.map +1 -1
- package/dist/shared/dispatch/admissionLoop.js +20 -82
- package/dist/shared/dispatch/admissionLoop.js.map +1 -1
- package/dist/shared/dispatch/coordinator.d.ts +5 -5
- package/dist/shared/dispatch/coordinator.d.ts.map +1 -1
- package/dist/shared/dispatch/coordinator.js +12 -11
- package/dist/shared/dispatch/coordinator.js.map +1 -1
- package/dist/shared/dispatch/costRank.d.ts +5 -155
- package/dist/shared/dispatch/costRank.d.ts.map +1 -1
- package/dist/shared/dispatch/costRank.js +2 -179
- package/dist/shared/dispatch/costRank.js.map +1 -1
- package/dist/shared/dispatch/dispatchQuotaContract.d.ts +37 -38
- package/dist/shared/dispatch/dispatchQuotaContract.d.ts.map +1 -1
- package/dist/shared/dispatch/dispatchQuotaContract.js +0 -1
- package/dist/shared/dispatch/dispatchQuotaContract.js.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.d.ts +6 -2
- package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.js +1 -1
- package/dist/shared/dispatch/hybridDispatch.js.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.d.ts +4 -4
- package/dist/shared/dispatch/rollingDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.js +13 -11
- package/dist/shared/dispatch/rollingDispatch.js.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.d.ts +2 -2
- package/dist/shared/dispatch/unifiedRolling.d.ts.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.js +1 -1
- package/dist/shared/dispatch/unifiedRolling.js.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +2 -2
- package/dist/shared/friction/stepBoundaryCapture.d.ts +5 -59
- package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.js +11 -107
- package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
- package/dist/shared/index.d.ts +13 -16
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +9 -13
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stateDir.d.ts +2 -2
- package/dist/shared/io/stateDir.js +2 -2
- package/dist/shared/providers/auditorSources.d.ts +10 -84
- package/dist/shared/providers/auditorSources.d.ts.map +1 -1
- package/dist/shared/providers/auditorSources.js +42 -261
- package/dist/shared/providers/auditorSources.js.map +1 -1
- package/dist/shared/providers/dispatchExclusion.d.ts +22 -0
- package/dist/shared/providers/dispatchExclusion.d.ts.map +1 -0
- package/dist/shared/providers/dispatchExclusion.js +23 -0
- package/dist/shared/providers/dispatchExclusion.js.map +1 -0
- package/dist/shared/providers/identity.d.ts +2 -66
- package/dist/shared/providers/identity.d.ts.map +1 -1
- package/dist/shared/providers/identity.js +2 -72
- package/dist/shared/providers/identity.js.map +1 -1
- package/dist/shared/providers/providerFactory.d.ts +0 -3
- package/dist/shared/providers/providerFactory.d.ts.map +1 -1
- package/dist/shared/providers/providerFactory.js +5 -32
- package/dist/shared/providers/providerFactory.js.map +1 -1
- package/dist/shared/providers/providerPathGuard.d.ts +3 -3
- package/dist/shared/providers/providerPathGuard.js +7 -7
- package/dist/shared/providers/providerPathGuard.js.map +1 -1
- package/dist/shared/quota/apiPool.d.ts +19 -22
- package/dist/shared/quota/apiPool.d.ts.map +1 -1
- package/dist/shared/quota/apiPool.js +66 -47
- package/dist/shared/quota/apiPool.js.map +1 -1
- package/dist/shared/quota/capacity.d.ts +29 -24
- package/dist/shared/quota/capacity.d.ts.map +1 -1
- package/dist/shared/quota/capacity.js +30 -4
- package/dist/shared/quota/capacity.js.map +1 -1
- package/dist/shared/quota/codexHostConfig.d.ts +6 -13
- package/dist/shared/quota/codexHostConfig.d.ts.map +1 -1
- package/dist/shared/quota/codexHostConfig.js +8 -14
- package/dist/shared/quota/codexHostConfig.js.map +1 -1
- package/dist/shared/quota/fileLock.d.ts +7 -0
- package/dist/shared/quota/fileLock.d.ts.map +1 -1
- package/dist/shared/quota/fileLock.js +32 -4
- package/dist/shared/quota/fileLock.js.map +1 -1
- package/dist/shared/quota/hostLimits.d.ts +1 -1
- package/dist/shared/quota/hostLimits.d.ts.map +1 -1
- package/dist/shared/quota/hostLimits.js +8 -11
- package/dist/shared/quota/hostLimits.js.map +1 -1
- package/dist/shared/quota/hostPool.d.ts +1 -1
- package/dist/shared/quota/hostPool.js +2 -2
- package/dist/shared/quota/hostPool.js.map +1 -1
- package/dist/shared/quota/limits.d.ts.map +1 -1
- package/dist/shared/quota/limits.js +30 -26
- package/dist/shared/quota/limits.js.map +1 -1
- package/dist/shared/quota/scheduler.d.ts +2 -3
- package/dist/shared/quota/scheduler.d.ts.map +1 -1
- package/dist/shared/quota/scheduler.js +1 -1
- package/dist/shared/quota/scheduler.js.map +1 -1
- package/dist/shared/quota/types.d.ts +10 -10
- package/dist/shared/quota/types.d.ts.map +1 -1
- package/dist/shared/quota/types.js +4 -7
- package/dist/shared/quota/types.js.map +1 -1
- package/dist/shared/repair/brokeredDispatch.d.ts.map +1 -1
- package/dist/shared/repair/brokeredDispatch.js +3 -0
- package/dist/shared/repair/brokeredDispatch.js.map +1 -1
- package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
- package/dist/shared/reporting/auditDeliverable.js +1 -0
- package/dist/shared/reporting/auditDeliverable.js.map +1 -1
- package/dist/shared/rolling/pausedState.d.ts +7 -7
- package/dist/shared/rolling/pausedState.js +3 -3
- package/dist/shared/tokens.d.ts +2 -5
- package/dist/shared/tokens.d.ts.map +1 -1
- package/dist/shared/tokens.js +15 -15
- package/dist/shared/tokens.js.map +1 -1
- package/dist/shared/types/auditorDescriptor.d.ts +3 -2
- package/dist/shared/types/auditorDescriptor.d.ts.map +1 -1
- package/dist/shared/types/auditorDescriptor.js +3 -2
- package/dist/shared/types/auditorDescriptor.js.map +1 -1
- package/dist/shared/types/finding.d.ts +80 -0
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +17 -0
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/sessionConfig.d.ts +5 -5
- package/dist/shared/types/sessionConfig.js +1 -1
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +3 -0
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/development.md +3 -2
- package/docs/audit-pkg/operator-guide.md +13 -106
- package/docs/audit-pkg/product.md +8 -7
- package/docs/audit-pkg/release.md +38 -29
- package/opencode.json +2 -2
- package/package.json +7 -4
- package/skills/audit-code/SKILL.md +2 -1
- package/skills/audit-code/audit-code.prompt.md +4 -3
- package/skills/remediate-code/remediate-code.prompt.md +2 -1
- package/dist/audit/cli/providerConfirmationStep.d.ts +0 -106
- package/dist/audit/cli/providerConfirmationStep.d.ts.map +0 -1
- package/dist/audit/cli/providerConfirmationStep.js +0 -396
- package/dist/audit/cli/providerConfirmationStep.js.map +0 -1
- package/dist/audit/orchestrator/providerConfirmation.d.ts +0 -25
- package/dist/audit/orchestrator/providerConfirmation.d.ts.map +0 -1
- package/dist/audit/orchestrator/providerConfirmation.js +0 -60
- package/dist/audit/orchestrator/providerConfirmation.js.map +0 -1
- package/dist/shared/providers/providerConfirmation.d.ts +0 -141
- package/dist/shared/providers/providerConfirmation.d.ts.map +0 -1
- package/dist/shared/providers/providerConfirmation.js +0 -420
- package/dist/shared/providers/providerConfirmation.js.map +0 -1
- package/dist/shared/providers/proxyCatalog.d.ts +0 -158
- package/dist/shared/providers/proxyCatalog.d.ts.map +0 -1
- package/dist/shared/providers/proxyCatalog.js +0 -658
- package/dist/shared/providers/proxyCatalog.js.map +0 -1
- package/dist/shared/providers/sharedProviderConfirmation.d.ts +0 -802
- package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +0 -1
- package/dist/shared/providers/sharedProviderConfirmation.js +0 -1865
- package/dist/shared/providers/sharedProviderConfirmation.js.map +0 -1
- package/dist/shared/types/providerConfirmation.d.ts +0 -334
- package/dist/shared/types/providerConfirmation.d.ts.map +0 -1
- package/dist/shared/types/providerConfirmation.js +0 -35
- package/dist/shared/types/providerConfirmation.js.map +0 -1
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type { DispatchableSource, ResolvedProviderName, SessionConfig } from "../types/sessionConfig.js";
|
|
2
|
-
import type { FreshSessionProvider, ProviderRateLimits } from "./types.js";
|
|
3
|
-
import type { ConfirmedPoolEntry, HostModelCostEntry, SourcePoolCostEntry, ProviderConfirmationInput } from "../types/providerConfirmation.js";
|
|
4
|
-
export type CapabilityTier = "frontier" | "capable" | "fast" | "unknown";
|
|
5
|
-
export interface DiscoveredProvider {
|
|
6
|
-
name: ResolvedProviderName;
|
|
7
|
-
command?: string;
|
|
8
|
-
capabilityTier: CapabilityTier;
|
|
9
|
-
quotaState?: ProviderRateLimits | null;
|
|
10
|
-
detected: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Machine-readable self-spawn-blocked flag. True when the provider is detected
|
|
13
|
-
* on PATH but cannot be launched as a fresh subprocess because the host is
|
|
14
|
-
* already inside an active session of that same agent (claude-code while
|
|
15
|
-
* `CLAUDECODE` is set, codex while `CODEX` is set). The Gate-0 confirmation
|
|
16
|
-
* EXCLUDES a self-spawn-blocked provider from the dispatchable pool unless the
|
|
17
|
-
* operator explicitly includes it. This FLAG is the security signal — a
|
|
18
|
-
* downstream consumer must never parse free text to make that decision.
|
|
19
|
-
*/
|
|
20
|
-
selfSpawnBlocked?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Probe PATH for each known CLI and return a DiscoveredProvider entry for each
|
|
24
|
-
* detected tool. Session-config `command` overrides decide which binary is probed.
|
|
25
|
-
*
|
|
26
|
-
* @param sessionConfig - Current session config (may be empty `{}`).
|
|
27
|
-
* @param env - Process env snapshot; defaults to `process.env`.
|
|
28
|
-
* @param detectCommand - Injectable PATH-detection hook (defaults to the
|
|
29
|
-
* single-sourced `commandExists`). Lets tests drive discovery deterministically
|
|
30
|
-
* without a real CLI on PATH, so the self-spawn-blocked security obligations are
|
|
31
|
-
* testable red-before-green regardless of what is installed in CI.
|
|
32
|
-
*/
|
|
33
|
-
export declare function discoverProviders(sessionConfig: SessionConfig, env?: NodeJS.ProcessEnv, detectCommand?: (command: string) => boolean): DiscoveredProvider[];
|
|
34
|
-
/**
|
|
35
|
-
* Query the rate-limit state from a live provider if the `queryLimits` method
|
|
36
|
-
* is available. Returns `null` on timeout/error — never throws.
|
|
37
|
-
*
|
|
38
|
-
* OBS-9a9091ad: a `queryLimits` rejection was previously swallowed with no
|
|
39
|
-
* signal, so a provider whose rate-limit query consistently fails was invisible
|
|
40
|
-
* to operators (the sibling CompositeQuotaSource logs the same swallow). Accept
|
|
41
|
-
* an optional injectable `log` (mirroring analyzerDeps' injectable-log pattern)
|
|
42
|
-
* that is invoked with the provider name + error on the swallowed-error path.
|
|
43
|
-
* The contract is unchanged — `log` is optional, the function still never throws
|
|
44
|
-
* and still returns null — so existing callers need no change while a caller
|
|
45
|
-
* that cares can route the diagnostic into its RunLogger.
|
|
46
|
-
*/
|
|
47
|
-
export declare function queryProviderQuota(provider: DiscoveredProvider, freshSessionProvider: FreshSessionProvider, log?: (providerName: string, error: unknown) => void): Promise<ProviderRateLimits | null>;
|
|
48
|
-
/**
|
|
49
|
-
* The representative model id a provider is priced/ordered by at Gate-0 (cost-first
|
|
50
|
-
* routing; spec/dispatch-quota.md). Only the providers that carry a configured
|
|
51
|
-
* model in session config are knowable here — a host-native model roster and a CLI
|
|
52
|
-
* backend's model arrive only at the dispatch handshake, so those return `undefined`
|
|
53
|
-
* and are priced deterministically at dispatch instead. Never hardcodes a model
|
|
54
|
-
* name; reads only operator-supplied config.
|
|
55
|
-
*/
|
|
56
|
-
export declare function representativeModelId(name: ResolvedProviderName, sessionConfig: SessionConfig): string | undefined;
|
|
57
|
-
/** A confirmed pool annotated with cost-first fields, plus any host-model tiers. */
|
|
58
|
-
export interface AnnotatedConfirmation {
|
|
59
|
-
/** Provider-keyed pool, each entry carrying model_id/price/cost_order. */
|
|
60
|
-
provider_pool: ConfirmedPoolEntry[];
|
|
61
|
-
/**
|
|
62
|
-
* Host self-reported model tiers with their confirmed positions (follow-up c),
|
|
63
|
-
* kept separate from `provider_pool` so no pool consumer sees duplicate names.
|
|
64
|
-
*/
|
|
65
|
-
host_model_cost_order: HostModelCostEntry[];
|
|
66
|
-
/**
|
|
67
|
-
* Dispatchable SOURCE pools (explicit `sources[]` + proxy expansion) with
|
|
68
|
-
* their confirmed positions (Gate-0 source fold). Kept separate from `provider_pool`
|
|
69
|
-
* because a source is keyed by `(transport, model)`, not a single transport name.
|
|
70
|
-
*/
|
|
71
|
-
source_pool_cost_order: SourcePoolCostEntry[];
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Annotate + order a confirmed pool with cost-first-routing fields, optionally
|
|
75
|
-
* applying an operator Gate-0 input. Each provider entry gets its representative
|
|
76
|
-
* `model_id`, `blended_price_usd_per_mtok` (or `null` when the dataset can't price
|
|
77
|
-
* it), and a `cost_order`. When `input` is absent this is the tool's
|
|
78
|
-
* price-ascending SUGGESTION (headless / no-operator path). When present, the
|
|
79
|
-
* operator's `cost_order` overrides the suggested positions and each
|
|
80
|
-
* `host_models` entry becomes a priced, orderable candidate whose confirmed
|
|
81
|
-
* position threads to dispatch by `model_id` via `host_model_cost_order`. Read
|
|
82
|
-
* back at dispatch (`resolveConfirmedCostPositions`) as rung 1 of `costRank`.
|
|
83
|
-
* Single-sourced so every confirmation site annotates identically.
|
|
84
|
-
*/
|
|
85
|
-
export declare function annotateConfirmedPool(pool: ConfirmedPoolEntry[], sessionConfig: SessionConfig, input?: ProviderConfirmationInput, sources?: DispatchableSource[], env?: NodeJS.ProcessEnv): AnnotatedConfirmation;
|
|
86
|
-
/**
|
|
87
|
-
* The suggestion-only annotation (no operator input, no host models). Preserved
|
|
88
|
-
* for the headless / auto-complete callers that just need the provider pool with
|
|
89
|
-
* the tool's price-ascending `cost_order`. Delegates to `annotateConfirmedPool`.
|
|
90
|
-
*/
|
|
91
|
-
export declare function annotateConfirmedPoolCost(pool: ConfirmedPoolEntry[], sessionConfig: SessionConfig): ConfirmedPoolEntry[];
|
|
92
|
-
/**
|
|
93
|
-
* Display-only view of one `sessionConfig.sources[]` pool for the Gate-0 roster.
|
|
94
|
-
*
|
|
95
|
-
* Backlog gap (a): `discoverProviders`/`buildSharedProviderConfirmation` only ever
|
|
96
|
-
* looked at PATH-probed CLIs + the legacy `openai_compatible` block, so an explicit
|
|
97
|
-
* `sources[]` pool (e.g. an opencode-free endpoint) never appeared at Gate-0 even
|
|
98
|
-
* though `collectDispatchableSources` (apiPool.ts) folds EVERY `sources[]` entry
|
|
99
|
-
* into what actually dispatches — the operator was confirming an ordering that
|
|
100
|
-
* omitted pools that WILL route. This type/derivation is display-only: it never
|
|
101
|
-
* round-trips through `ConfirmedPoolEntry` / the persisted `SharedProviderConfirmation`,
|
|
102
|
-
* so it can't perturb the existing cost_order/dispatch contract.
|
|
103
|
-
*/
|
|
104
|
-
export interface SourcePoolDisplayEntry {
|
|
105
|
-
/**
|
|
106
|
-
* Same id convention the dispatch side uses (explicit `id`, else
|
|
107
|
-
* `${transport}:${model ?? endpoint ?? "default"}`) — display-only, not a
|
|
108
|
-
* guaranteed exact match of the dispatch-side pool key.
|
|
109
|
-
*/
|
|
110
|
-
id: string;
|
|
111
|
-
transport: DispatchableSource["transport"];
|
|
112
|
-
model?: string;
|
|
113
|
-
/**
|
|
114
|
-
* Operator-declared `cost_per_mtok` on this source. Authoritative over the
|
|
115
|
-
* models.dev catalog price when present (mirrors the dispatch-side authority
|
|
116
|
-
* rule on `DispatchableSource.cost_per_mtok` — see sessionConfig.ts).
|
|
117
|
-
*/
|
|
118
|
-
declared_cost_per_mtok?: number;
|
|
119
|
-
/**
|
|
120
|
-
* models.dev blended price, computed only when the source has no declared cost
|
|
121
|
-
* and a model id is known; `null` when the dataset can't price it.
|
|
122
|
-
*/
|
|
123
|
-
blended_price_usd_per_mtok?: number | null;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Derive the Gate-0 display view of every configured `sessionConfig.sources[]`
|
|
127
|
-
* entry (backlog follow-up a). Read-only and additive: mirrors the same
|
|
128
|
-
* `sessionConfig.sources` array `collectDispatchableSources` (apiPool.ts) folds
|
|
129
|
-
* into dispatch, so what the operator sees at Gate-0 includes every pool that will
|
|
130
|
-
* actually route. Order is preserved from the operator-authored config array
|
|
131
|
-
* (content-derived, stable — never re-sorted by iteration/readdir order).
|
|
132
|
-
*/
|
|
133
|
-
export declare function deriveSourcePoolDisplay(sessionConfig: SessionConfig): SourcePoolDisplayEntry[];
|
|
134
|
-
/**
|
|
135
|
-
* Same display derivation as {@link deriveSourcePoolDisplay} but over an EXPLICIT source
|
|
136
|
-
* list — used by the Gate-0 confirmation display so the roster includes the async
|
|
137
|
-
* proxy catalog expansion (which is not in `sessionConfig.sources`), matching
|
|
138
|
-
* exactly what {@link gatherDispatchableSources} folds into dispatch.
|
|
139
|
-
*/
|
|
140
|
-
export declare function deriveSourcePoolDisplayFromSources(sources: DispatchableSource[]): SourcePoolDisplayEntry[];
|
|
141
|
-
//# sourceMappingURL=providerConfirmation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"providerConfirmation.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/providerConfirmation.ts"],"names":[],"mappings":"AA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Aa,EAAE,kBAAkB,EAAE,CAAC;IACpC;;;OAGG;IACH,qBAAqB,EAAE,kBAAkB,EAAE,CAAC;IAC5C;;;;OAIG;IACH,sBAAsB,EAAE,mBAAmB,EAAE,CAAC;CAC/C;AAiED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EAAE,EAC1B,aAAa,EAAE,aAAa,EAC5B,KAAK,CAAC,EAAE,yBAAyB,EACjC,OAAO,GAAE,kBAAkB,EAAO,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,qBAAqB,CA4IvB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,EAAE,EAC1B,aAAa,EAAE,aAAa,GAC3B,kBAAkB,EAAE,CAEtB;AAMD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,aAAa,GAC3B,sBAAsB,EAAE,CAE1B;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,kBAAkB,EAAE,GAC5B,sBAAsB,EAAE,CAmB1B"}
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
import { hasConfiguredOpenAiCompatible, hasConfiguredOpenCode, } from "./providerFactory.js";
|
|
2
|
-
import { commandExists, isSelfSpawnBlocked, resolveConversationHostProvider, } from "./providerPathGuard.js";
|
|
3
|
-
import { suggestCostOrdering, resolveModelPrice } from "../dispatch/costRank.js";
|
|
4
|
-
import { backendIdentity, sourceService } from "./identity.js";
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
|
-
// Internal helpers
|
|
7
|
-
// ---------------------------------------------------------------------------
|
|
8
|
-
/**
|
|
9
|
-
* Default capability tier for a given provider name.
|
|
10
|
-
*
|
|
11
|
-
* This is a fallback used only when no session-config override is available.
|
|
12
|
-
* Tiers are intentionally coarse and static here; the scheduler discovery
|
|
13
|
-
* path (HostModelRosterEntry / DiscoveredRateLimitsInput) is the authoritative
|
|
14
|
-
* source of per-model capability at dispatch time.
|
|
15
|
-
*
|
|
16
|
-
* INV-shared-core-02: provider-name → tier mapping must NOT be a flat lookup
|
|
17
|
-
* table that gates dispatch routing. Capability tier on DiscoveredProvider is
|
|
18
|
-
* a declared/discoverable input, not an opaque internal enum. This function
|
|
19
|
-
* is the single place where a default is applied; all routing uses the
|
|
20
|
-
* DispatchModelTier vocabulary on CapacityPool, not this field.
|
|
21
|
-
*/
|
|
22
|
-
function defaultCapabilityTier(name) {
|
|
23
|
-
switch (name) {
|
|
24
|
-
case "claude-code":
|
|
25
|
-
return "frontier";
|
|
26
|
-
case "opencode":
|
|
27
|
-
case "codex":
|
|
28
|
-
case "openai-compatible":
|
|
29
|
-
case "subprocess-template":
|
|
30
|
-
case "vscode-task":
|
|
31
|
-
case "antigravity":
|
|
32
|
-
case "agy":
|
|
33
|
-
case "claude-worker":
|
|
34
|
-
// Proxied non-Claude backend behind the Claude harness — ranks strictly below
|
|
35
|
-
// the host tier by default (the operator promotes deliberately; plan §risks).
|
|
36
|
-
return "capable";
|
|
37
|
-
case "worker-command":
|
|
38
|
-
return "unknown";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const CLI_PROBES = [
|
|
42
|
-
{
|
|
43
|
-
providerName: "claude-code",
|
|
44
|
-
defaultCommand: "claude",
|
|
45
|
-
configCommand: (cfg) => cfg.claude_code?.command,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
providerName: "opencode",
|
|
49
|
-
defaultCommand: "opencode",
|
|
50
|
-
configCommand: (cfg) => cfg.opencode?.command,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
providerName: "codex",
|
|
54
|
-
defaultCommand: "codex",
|
|
55
|
-
configCommand: (cfg) => cfg.codex?.command,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
providerName: "agy",
|
|
59
|
-
defaultCommand: "agy",
|
|
60
|
-
configCommand: (cfg) => {
|
|
61
|
-
if (cfg.agy?.command)
|
|
62
|
-
return cfg.agy.command;
|
|
63
|
-
// Gated for July 18, 2026 sunset cleanup: fallback to gemini command
|
|
64
|
-
if (commandExists("agy"))
|
|
65
|
-
return "agy";
|
|
66
|
-
if (commandExists("gemini"))
|
|
67
|
-
return "gemini";
|
|
68
|
-
return undefined;
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
];
|
|
72
|
-
// ---------------------------------------------------------------------------
|
|
73
|
-
// Public API
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
/**
|
|
76
|
-
* Probe PATH for each known CLI and return a DiscoveredProvider entry for each
|
|
77
|
-
* detected tool. Session-config `command` overrides decide which binary is probed.
|
|
78
|
-
*
|
|
79
|
-
* @param sessionConfig - Current session config (may be empty `{}`).
|
|
80
|
-
* @param env - Process env snapshot; defaults to `process.env`.
|
|
81
|
-
* @param detectCommand - Injectable PATH-detection hook (defaults to the
|
|
82
|
-
* single-sourced `commandExists`). Lets tests drive discovery deterministically
|
|
83
|
-
* without a real CLI on PATH, so the self-spawn-blocked security obligations are
|
|
84
|
-
* testable red-before-green regardless of what is installed in CI.
|
|
85
|
-
*/
|
|
86
|
-
export function discoverProviders(sessionConfig, env = process.env, detectCommand = commandExists) {
|
|
87
|
-
const discovered = [];
|
|
88
|
-
for (const probe of CLI_PROBES) {
|
|
89
|
-
const command = (probe.configCommand(sessionConfig) ?? "").trim() || probe.defaultCommand;
|
|
90
|
-
const available = detectCommand(command);
|
|
91
|
-
if (!available)
|
|
92
|
-
continue;
|
|
93
|
-
// PB-1: a bare-PATH opencode (no opencode.* config) is OPT-IN, not an
|
|
94
|
-
// eligible auto-dispatch target. Surfacing it here would let it join the
|
|
95
|
-
// confirmed pool and be launched unprompted. Only surface opencode when the
|
|
96
|
-
// operator has explicitly configured it (opencode.command / opencode.extra_args);
|
|
97
|
-
// all other PATH-detected providers are surfaced as before.
|
|
98
|
-
if (probe.providerName === "opencode" && !hasConfiguredOpenCode(sessionConfig)) {
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
// Machine-readable self-spawn-blocked flag, derived from the single-sourced
|
|
102
|
-
// guard. A self-spawn-blocked provider is still SURFACED (the operator may
|
|
103
|
-
// override) but carries the flag so Gate-0 can EXCLUDE it from the
|
|
104
|
-
// dispatchable pool without parsing free text.
|
|
105
|
-
const blocked = isSelfSpawnBlocked(probe.providerName, env);
|
|
106
|
-
discovered.push({
|
|
107
|
-
name: probe.providerName,
|
|
108
|
-
command,
|
|
109
|
-
capabilityTier: defaultCapabilityTier(probe.providerName),
|
|
110
|
-
detected: true,
|
|
111
|
-
selfSpawnBlocked: blocked,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
// openai-compatible (NIM / vLLM / LM Studio / …) is an API pool, not a CLI: it
|
|
115
|
-
// is config-gated (base_url + model), never PATH-probed, so the CLI loop above
|
|
116
|
-
// can't surface it. Surface it here when configured so it joins the confirmed
|
|
117
|
-
// pool as a real spill target (INV-QD-14) alongside the PATH-detected CLIs.
|
|
118
|
-
if (hasConfiguredOpenAiCompatible(sessionConfig.openai_compatible)) {
|
|
119
|
-
discovered.push({
|
|
120
|
-
name: "openai-compatible",
|
|
121
|
-
command: sessionConfig.openai_compatible?.model,
|
|
122
|
-
capabilityTier: defaultCapabilityTier("openai-compatible"),
|
|
123
|
-
detected: true,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return discovered;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Query the rate-limit state from a live provider if the `queryLimits` method
|
|
130
|
-
* is available. Returns `null` on timeout/error — never throws.
|
|
131
|
-
*
|
|
132
|
-
* OBS-9a9091ad: a `queryLimits` rejection was previously swallowed with no
|
|
133
|
-
* signal, so a provider whose rate-limit query consistently fails was invisible
|
|
134
|
-
* to operators (the sibling CompositeQuotaSource logs the same swallow). Accept
|
|
135
|
-
* an optional injectable `log` (mirroring analyzerDeps' injectable-log pattern)
|
|
136
|
-
* that is invoked with the provider name + error on the swallowed-error path.
|
|
137
|
-
* The contract is unchanged — `log` is optional, the function still never throws
|
|
138
|
-
* and still returns null — so existing callers need no change while a caller
|
|
139
|
-
* that cares can route the diagnostic into its RunLogger.
|
|
140
|
-
*/
|
|
141
|
-
export async function queryProviderQuota(provider, freshSessionProvider, log) {
|
|
142
|
-
if (typeof freshSessionProvider.queryLimits !== "function") {
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
try {
|
|
146
|
-
return await freshSessionProvider.queryLimits(null);
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
log?.(provider.name, error);
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* The representative model id a provider is priced/ordered by at Gate-0 (cost-first
|
|
155
|
-
* routing; spec/dispatch-quota.md). Only the providers that carry a configured
|
|
156
|
-
* model in session config are knowable here — a host-native model roster and a CLI
|
|
157
|
-
* backend's model arrive only at the dispatch handshake, so those return `undefined`
|
|
158
|
-
* and are priced deterministically at dispatch instead. Never hardcodes a model
|
|
159
|
-
* name; reads only operator-supplied config.
|
|
160
|
-
*/
|
|
161
|
-
export function representativeModelId(name, sessionConfig) {
|
|
162
|
-
switch (name) {
|
|
163
|
-
case "openai-compatible":
|
|
164
|
-
return sessionConfig.openai_compatible?.model?.trim() || undefined;
|
|
165
|
-
case "codex":
|
|
166
|
-
return sessionConfig.codex?.model?.trim() || undefined;
|
|
167
|
-
default:
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/** Stable source id (matches `deriveSourcePoolDisplay` / the dispatch id convention). */
|
|
172
|
-
function dispatchSourceKey(source) {
|
|
173
|
-
return source.id ?? `${source.transport}:${source.model ?? source.endpoint ?? "default"}`;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Internal candidate key for a source in the unified cost ordering. Prefixed so a source's
|
|
177
|
-
* operator-set id can never collide with a provider-NAME key or a host `model_id` key in
|
|
178
|
-
* the shared position map (they share one keyspace in `resolveFinalCostOrder`) — a collision
|
|
179
|
-
* would let one entry's `cost_order` silently overwrite the other's. The prefix is internal
|
|
180
|
-
* only; the emitted `source_id` + the operator `cost_order` keyspace are unaffected.
|
|
181
|
-
*/
|
|
182
|
-
const SOURCE_CANDIDATE_KEY_PREFIX = "source::";
|
|
183
|
-
function sourceCandidateKey(source) {
|
|
184
|
-
return `${SOURCE_CANDIDATE_KEY_PREFIX}${dispatchSourceKey(source)}`;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Resolve the FINAL 0-based cost position for every candidate key. Without an
|
|
188
|
-
* operator ordering this is the tool's price-ascending suggestion. With one, the
|
|
189
|
-
* operator's `cost_order` wins for the keys it names (dense from 0, unknown keys
|
|
190
|
-
* ignored); candidates it omits keep their suggested relative order, appended
|
|
191
|
-
* after. Single-sourced so provider pools and host models share one total order.
|
|
192
|
-
*/
|
|
193
|
-
function resolveFinalCostOrder(candidates, operatorOrder) {
|
|
194
|
-
const suggested = suggestCostOrdering(candidates);
|
|
195
|
-
if (!operatorOrder || operatorOrder.length === 0) {
|
|
196
|
-
return new Map(suggested.map((c) => [c.key, c.suggested_order]));
|
|
197
|
-
}
|
|
198
|
-
const knownKeys = new Set(candidates.map((c) => c.key));
|
|
199
|
-
// Display keyspace ≡ match keyspace (backlog: source pools were displayed as
|
|
200
|
-
// orderable but silently ignored). A source candidate is keyed
|
|
201
|
-
// `source::<id>` internally (collision-proofing against provider names / host
|
|
202
|
-
// model ids in this shared position map) but the Gate-0 prompt DISPLAYS it under
|
|
203
|
-
// its bare id — so the bare id must match too. An exact candidate key always
|
|
204
|
-
// wins the token: a bare alias never shadows a genuine provider/model key, which
|
|
205
|
-
// preserves exactly the collision-safety the prefix exists for.
|
|
206
|
-
const bareSourceAliases = new Map();
|
|
207
|
-
for (const key of knownKeys) {
|
|
208
|
-
if (!key.startsWith(SOURCE_CANDIDATE_KEY_PREFIX))
|
|
209
|
-
continue;
|
|
210
|
-
const bare = key.slice(SOURCE_CANDIDATE_KEY_PREFIX.length);
|
|
211
|
-
if (!knownKeys.has(bare) && !bareSourceAliases.has(bare)) {
|
|
212
|
-
bareSourceAliases.set(bare, key);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const seen = new Set();
|
|
216
|
-
const orderedNamed = [];
|
|
217
|
-
for (const token of operatorOrder) {
|
|
218
|
-
const key = knownKeys.has(token) ? token : bareSourceAliases.get(token);
|
|
219
|
-
if (key !== undefined && !seen.has(key)) {
|
|
220
|
-
seen.add(key);
|
|
221
|
-
orderedNamed.push(key);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
const rest = suggested.map((c) => c.key).filter((k) => !seen.has(k));
|
|
225
|
-
const finalOrder = [...orderedNamed, ...rest];
|
|
226
|
-
return new Map(finalOrder.map((key, index) => [key, index]));
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Annotate + order a confirmed pool with cost-first-routing fields, optionally
|
|
230
|
-
* applying an operator Gate-0 input. Each provider entry gets its representative
|
|
231
|
-
* `model_id`, `blended_price_usd_per_mtok` (or `null` when the dataset can't price
|
|
232
|
-
* it), and a `cost_order`. When `input` is absent this is the tool's
|
|
233
|
-
* price-ascending SUGGESTION (headless / no-operator path). When present, the
|
|
234
|
-
* operator's `cost_order` overrides the suggested positions and each
|
|
235
|
-
* `host_models` entry becomes a priced, orderable candidate whose confirmed
|
|
236
|
-
* position threads to dispatch by `model_id` via `host_model_cost_order`. Read
|
|
237
|
-
* back at dispatch (`resolveConfirmedCostPositions`) as rung 1 of `costRank`.
|
|
238
|
-
* Single-sourced so every confirmation site annotates identically.
|
|
239
|
-
*/
|
|
240
|
-
export function annotateConfirmedPool(pool, sessionConfig, input, sources = [], env = process.env) {
|
|
241
|
-
const hostModels = input?.host_models ?? [];
|
|
242
|
-
// The host roster is by definition the CONVERSATION HOST's own models, so the
|
|
243
|
-
// service half of each tier's identity is the resolved host. Resolved HERE (above
|
|
244
|
-
// the source fold) because the fold dedups on identity and therefore needs it.
|
|
245
|
-
const hostProvider = resolveConversationHostProvider({ sessionConfig, env });
|
|
246
|
-
const providerCandidates = pool.map((entry) => ({
|
|
247
|
-
key: entry.name,
|
|
248
|
-
model: representativeModelId(entry.name, sessionConfig),
|
|
249
|
-
}));
|
|
250
|
-
// tier is omitted: it only tiebreaks UNPRICED candidates, and HostRosterModel's
|
|
251
|
-
// CapabilityTier is a different vocabulary from CostCandidate's DispatchModelTier
|
|
252
|
-
// — host models are keyed + priced by model_id, which is what threads to dispatch.
|
|
253
|
-
const hostCandidates = hostModels.map((m) => ({
|
|
254
|
-
key: m.model_id,
|
|
255
|
-
model: m.model_id,
|
|
256
|
-
}));
|
|
257
|
-
// A source whose model is ALREADY represented by a provider candidate (the legacy
|
|
258
|
-
// `openai_compatible` block folds into BOTH the `openai-compatible` provider entry AND
|
|
259
|
-
// a `collectDispatchableSources` source) or a host tier is the SAME pool — folding it
|
|
260
|
-
// again would double-rank one model_id and let the source position overwrite the
|
|
261
|
-
// provider's in the model-keyed dispatch map. Dedup by model_id so each pool is ranked
|
|
262
|
-
// once. Repair-proxy sources carry distinct namespaced models, so they're never skipped.
|
|
263
|
-
// Dedup on BACKEND IDENTITY, never on the bare model string. A bare-model fold
|
|
264
|
-
// drops a source that merely SHARES a model id with a host tier or a configured
|
|
265
|
-
// pool on a DIFFERENT service — and since the confirmed set is derived from what
|
|
266
|
-
// survives this fold, that source could then never be confirmed: it would delta,
|
|
267
|
-
// the operator would confirm it, the fold would drop it again, and it would delta
|
|
268
|
-
// forever. (Before the gate key was service-qualified, the same bare-model collapse
|
|
269
|
-
// hid this as a silent BYPASS instead — the two are one defect seen from either
|
|
270
|
-
// side.) Identity-keyed, only a genuine duplicate folds: the legacy
|
|
271
|
-
// `openai_compatible` block, which really is represented twice (once as a provider
|
|
272
|
-
// entry, once as a `collectDispatchableSources` source) on ONE service.
|
|
273
|
-
const claimedIdentities = new Set();
|
|
274
|
-
for (const entry of pool) {
|
|
275
|
-
const m = representativeModelId(entry.name, sessionConfig);
|
|
276
|
-
if (m)
|
|
277
|
-
claimedIdentities.add(backendIdentity(m, entry.name));
|
|
278
|
-
}
|
|
279
|
-
for (const m of hostModels) {
|
|
280
|
-
claimedIdentities.add(backendIdentity(m.model_id, hostProvider));
|
|
281
|
-
}
|
|
282
|
-
const foldedSources = sources.filter((source) => !claimedIdentities.has(backendIdentity(source.model, sourceService(source))));
|
|
283
|
-
// Gate-0 source fold: every remaining dispatchable source pool (explicit sources[] +
|
|
284
|
-
// proxy expansion) becomes a ranked candidate, keyed by its stable source id so a
|
|
285
|
-
// namespaced `transport/model` never collides with a provider-name key. Each carries its
|
|
286
|
-
// declared cost (authoritative; 0 = free) and raw capability rank so the suggestion is
|
|
287
|
-
// truthful and the capability tiebreak applies among cost-equal source pools.
|
|
288
|
-
const sourceCandidates = foldedSources.map((source) => ({
|
|
289
|
-
key: sourceCandidateKey(source),
|
|
290
|
-
model: source.model ?? null,
|
|
291
|
-
// Price binds to the SERVICE, never the transport: `resolveModelStatics` falls
|
|
292
|
-
// through to the cheapest-collision default entry for a provider string the price
|
|
293
|
-
// table has never heard of, so passing a transport here (`claude-worker`) silently
|
|
294
|
-
// prices a proxied lane at some other vendor's rate.
|
|
295
|
-
provider: sourceService(source),
|
|
296
|
-
...(source.cost_per_mtok !== undefined ? { declaredCost: source.cost_per_mtok } : {}),
|
|
297
|
-
...(source.capability_rank != null ? { capabilityRank: source.capability_rank } : {}),
|
|
298
|
-
}));
|
|
299
|
-
const positions = resolveFinalCostOrder([...providerCandidates, ...hostCandidates, ...sourceCandidates], input?.cost_order);
|
|
300
|
-
// Capability-evidence ordering: the operator/LLM answer to the capability gate, over
|
|
301
|
-
// the SAME candidate keyspace the cost order uses. Position ⇒ `capability_rank`
|
|
302
|
-
// (LOWER = more capable), so the list is most-capable-first. Unlike the cost order
|
|
303
|
-
// there is no tool-computed suggestion to fall back to: absent input ⇒ no confirmed
|
|
304
|
-
// ranks at all, and pools keep whatever external evidence they carry.
|
|
305
|
-
//
|
|
306
|
-
// First occurrence wins on a duplicated key — a positional list is the operator's
|
|
307
|
-
// ORDERING, and silently re-ranking on a later repeat would make the tail of a
|
|
308
|
-
// typo'd list authoritative over its head.
|
|
309
|
-
const capabilityPositions = new Map();
|
|
310
|
-
(input?.capability_order ?? []).forEach((key, index) => {
|
|
311
|
-
if (!capabilityPositions.has(key))
|
|
312
|
-
capabilityPositions.set(key, index);
|
|
313
|
-
});
|
|
314
|
-
const provider_pool = pool.map((entry) => {
|
|
315
|
-
const model = representativeModelId(entry.name, sessionConfig);
|
|
316
|
-
const order = positions.get(entry.name);
|
|
317
|
-
return {
|
|
318
|
-
...entry,
|
|
319
|
-
...(model ? { model_id: model } : {}),
|
|
320
|
-
blended_price_usd_per_mtok: model ? resolveModelPrice(model) ?? null : null,
|
|
321
|
-
...(order !== undefined ? { cost_order: order } : {}),
|
|
322
|
-
// Keyed on the MODEL, never the provider name: `capability_rank` is read back
|
|
323
|
-
// by the model-keyed dispatch join (`readConfirmedCapabilityRanks` →
|
|
324
|
-
// `pool.hostModel`), and the delta + prompt both name models. Matching on the
|
|
325
|
-
// provider name here would silently drop the operator's answer, leaving the
|
|
326
|
-
// delta non-empty ⇒ `PRIORITY[0]` re-prompts the same question forever.
|
|
327
|
-
...(model && capabilityPositions.has(model)
|
|
328
|
-
? { capability_rank: capabilityPositions.get(model) }
|
|
329
|
-
: {}),
|
|
330
|
-
};
|
|
331
|
-
});
|
|
332
|
-
// Recorded at the only point the host is known for certain, rather than re-derived
|
|
333
|
-
// by a later reader running under a possibly different host.
|
|
334
|
-
const host_model_cost_order = hostModels.map((m) => ({
|
|
335
|
-
model_id: m.model_id,
|
|
336
|
-
provider: hostProvider,
|
|
337
|
-
blended_price_usd_per_mtok: resolveModelPrice(m.model_id) ?? null,
|
|
338
|
-
cost_order: positions.get(m.model_id) ?? 0,
|
|
339
|
-
// A host model is ranked exactly like any other model. The roster carries no
|
|
340
|
-
// capability field (HostModelRosterEntrySchema is .strict()), so the confirmed
|
|
341
|
-
// order is the ONLY road a host model's rank travels to dispatch.
|
|
342
|
-
...(capabilityPositions.has(m.model_id)
|
|
343
|
-
? { capability_rank: capabilityPositions.get(m.model_id) }
|
|
344
|
-
: {}),
|
|
345
|
-
}));
|
|
346
|
-
const source_pool_cost_order = foldedSources.map((source) => {
|
|
347
|
-
const key = sourceCandidateKey(source);
|
|
348
|
-
const declared = typeof source.cost_per_mtok === "number" && Number.isFinite(source.cost_per_mtok) && source.cost_per_mtok >= 0
|
|
349
|
-
? source.cost_per_mtok
|
|
350
|
-
: undefined;
|
|
351
|
-
const price =
|
|
352
|
-
// Service, not transport — see the CostCandidate note above.
|
|
353
|
-
declared ?? (source.model ? resolveModelPrice(source.model, sourceService(source)) ?? null : null);
|
|
354
|
-
return {
|
|
355
|
-
source_id: dispatchSourceKey(source),
|
|
356
|
-
transport: source.transport,
|
|
357
|
-
// Recorded so `confirmedBackendKeys` can reproduce the gate identity the delta
|
|
358
|
-
// computes for a proxied lane — see SourcePoolCostEntry.service.
|
|
359
|
-
...(source.service ? { service: source.service } : {}),
|
|
360
|
-
...(source.model ? { model_id: source.model } : {}),
|
|
361
|
-
blended_price_usd_per_mtok: price,
|
|
362
|
-
price_declared: declared !== undefined,
|
|
363
|
-
// External evidence FIRST: a source's own registry/declared rank is
|
|
364
|
-
// someone-else-maintained data about the model, so the confirmed ordering only
|
|
365
|
-
// fills the gap where none exists. Same precedence the pool constructors apply.
|
|
366
|
-
...(source.capability_rank != null
|
|
367
|
-
? { capability_rank: source.capability_rank }
|
|
368
|
-
: source.model && capabilityPositions.has(source.model)
|
|
369
|
-
? { capability_rank: capabilityPositions.get(source.model) }
|
|
370
|
-
: {}),
|
|
371
|
-
cost_order: positions.get(key) ?? 0,
|
|
372
|
-
};
|
|
373
|
-
});
|
|
374
|
-
return { provider_pool, host_model_cost_order, source_pool_cost_order };
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* The suggestion-only annotation (no operator input, no host models). Preserved
|
|
378
|
-
* for the headless / auto-complete callers that just need the provider pool with
|
|
379
|
-
* the tool's price-ascending `cost_order`. Delegates to `annotateConfirmedPool`.
|
|
380
|
-
*/
|
|
381
|
-
export function annotateConfirmedPoolCost(pool, sessionConfig) {
|
|
382
|
-
return annotateConfirmedPool(pool, sessionConfig).provider_pool;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Derive the Gate-0 display view of every configured `sessionConfig.sources[]`
|
|
386
|
-
* entry (backlog follow-up a). Read-only and additive: mirrors the same
|
|
387
|
-
* `sessionConfig.sources` array `collectDispatchableSources` (apiPool.ts) folds
|
|
388
|
-
* into dispatch, so what the operator sees at Gate-0 includes every pool that will
|
|
389
|
-
* actually route. Order is preserved from the operator-authored config array
|
|
390
|
-
* (content-derived, stable — never re-sorted by iteration/readdir order).
|
|
391
|
-
*/
|
|
392
|
-
export function deriveSourcePoolDisplay(sessionConfig) {
|
|
393
|
-
return deriveSourcePoolDisplayFromSources(sessionConfig.sources ?? []);
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Same display derivation as {@link deriveSourcePoolDisplay} but over an EXPLICIT source
|
|
397
|
-
* list — used by the Gate-0 confirmation display so the roster includes the async
|
|
398
|
-
* proxy catalog expansion (which is not in `sessionConfig.sources`), matching
|
|
399
|
-
* exactly what {@link gatherDispatchableSources} folds into dispatch.
|
|
400
|
-
*/
|
|
401
|
-
export function deriveSourcePoolDisplayFromSources(sources) {
|
|
402
|
-
return sources.map((source) => {
|
|
403
|
-
const id = source.id ?? `${source.transport}:${source.model ?? source.endpoint ?? "default"}`;
|
|
404
|
-
const entry = {
|
|
405
|
-
id,
|
|
406
|
-
transport: source.transport,
|
|
407
|
-
...(source.model ? { model: source.model } : {}),
|
|
408
|
-
...(source.cost_per_mtok !== undefined
|
|
409
|
-
? { declared_cost_per_mtok: source.cost_per_mtok }
|
|
410
|
-
: {}),
|
|
411
|
-
};
|
|
412
|
-
if (source.cost_per_mtok === undefined) {
|
|
413
|
-
entry.blended_price_usd_per_mtok = source.model
|
|
414
|
-
? (resolveModelPrice(source.model) ?? null)
|
|
415
|
-
: null;
|
|
416
|
-
}
|
|
417
|
-
return entry;
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
//# sourceMappingURL=providerConfirmation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"providerConfirmation.js","sourceRoot":"","sources":["../../../src/shared/providers/providerConfirmation.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAsB,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAgC/D,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;;;;;;;;;;GAaG;AACH,SAAS,qBAAqB,CAAC,IAA0B;IACvD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa;YAChB,OAAO,UAAU,CAAC;QACpB,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,mBAAmB,CAAC;QACzB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,aAAa,CAAC;QACnB,KAAK,aAAa,CAAC;QACnB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