substrate-ai 0.20.44 → 0.20.46
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/cli/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, parseRuntimeProbes, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorMetrics } from "../health-
|
|
2
|
+
import { FileStateStore, RunManifest, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, aggregateProbeAuthorMetrics, buildPipelineStatusOutput, createDatabaseAdapter, createStateStore, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, parseDbTimestampAsUtc, parseRuntimeProbes, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorMetrics } from "../health-BV-rzjf7.js";
|
|
3
3
|
import { createLogger } from "../logger-KeHncl-f.js";
|
|
4
4
|
import { createEventBus } from "../helpers-CElYrONe.js";
|
|
5
5
|
import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, InMemoryDatabaseAdapter, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getRunningPipelineRuns, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-VcMmfo2w.js";
|
|
6
6
|
import "../adapter-registry-DXLMTmfD.js";
|
|
7
|
-
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
7
|
+
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BYMVrlGZ.js";
|
|
8
8
|
import "../errors-CogpxBUg.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -3667,7 +3667,7 @@ async function runStatusAction(options) {
|
|
|
3667
3667
|
logger$13.debug({ err }, "Work graph query failed, continuing without work graph data");
|
|
3668
3668
|
}
|
|
3669
3669
|
if (run === void 0) {
|
|
3670
|
-
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-
|
|
3670
|
+
const { inspectProcessTree: inspectProcessTree$1 } = await import("../health-DQrsmYTt.js");
|
|
3671
3671
|
const substrateDirPath = join(projectRoot, ".substrate");
|
|
3672
3672
|
const processInfo = inspectProcessTree$1({
|
|
3673
3673
|
projectRoot,
|
|
@@ -5204,7 +5204,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
5204
5204
|
await initSchema(expAdapter);
|
|
5205
5205
|
const { runRunAction: runPipeline } = await import(
|
|
5206
5206
|
/* @vite-ignore */
|
|
5207
|
-
"../run-
|
|
5207
|
+
"../run-Dwru4oKj.js"
|
|
5208
5208
|
);
|
|
5209
5209
|
const runStoryFn = async (opts) => {
|
|
5210
5210
|
const exitCode = await runPipeline({
|
|
@@ -4661,11 +4661,81 @@ function detectNegationContextLines(lines) {
|
|
|
4661
4661
|
}
|
|
4662
4662
|
return result;
|
|
4663
4663
|
}
|
|
4664
|
+
/**
|
|
4665
|
+
* obs_2026-05-02_020: dependency-context phrase patterns. When any of these
|
|
4666
|
+
* patterns appears on a line (or its indented continuation), every backtick-
|
|
4667
|
+
* wrapped path on the same line is tagged `dependency: true`. The phrases
|
|
4668
|
+
* indicate the AC is naming the path as an architectural integration point
|
|
4669
|
+
* (a peer package the implementation imports from, a service the code
|
|
4670
|
+
* queries, etc.) — NOT as a positive-delivery requirement.
|
|
4671
|
+
*
|
|
4672
|
+
* Strata Run 19 / Story 2-7 (2026-05-02): the AC said
|
|
4673
|
+
*
|
|
4674
|
+
* "publishes a `MorningBriefing` mesh record via `packages/mesh-agent`'s
|
|
4675
|
+
* outbox using the existing `MeshClient` surface"
|
|
4676
|
+
*
|
|
4677
|
+
* The implementation correctly imported `MeshClient` from
|
|
4678
|
+
* `@jplanow/agent-mesh` and called the existing publish surface, but
|
|
4679
|
+
* `pathReferencedInModifiedFiles` (Story 60-3, v0.20.23) couldn't match the
|
|
4680
|
+
* AC's `packages/mesh-agent` token against the package's `@jplanow/agent-mesh`
|
|
4681
|
+
* import path (the words `mesh` and `agent` are reordered between directory
|
|
4682
|
+
* name and package name). The check fired ERROR-level under-delivery and
|
|
4683
|
+
* VERIFICATION_FAILED'd a story whose code was correct.
|
|
4684
|
+
*
|
|
4685
|
+
* Patterns are anchored to backtick-wrapped paths to keep the trigger tight.
|
|
4686
|
+
* Bare prose like "uses the existing surface" or "from yesterday's run"
|
|
4687
|
+
* doesn't fire — only references where the path appears in backticks under
|
|
4688
|
+
* an explicit dependency-context preposition / verb.
|
|
4689
|
+
*
|
|
4690
|
+
* Coverage shapes (each must precede a backtick-wrapped path on the same line):
|
|
4691
|
+
* - `via \`X\`` / `via \`X\`'s ...` — Story 2-7 exact shape
|
|
4692
|
+
* - `imports? from \`X\`` — explicit import statement
|
|
4693
|
+
* - `consumes \`X\`` — skill / queue consumption
|
|
4694
|
+
* - `built atop \`X\`` — architectural foundation
|
|
4695
|
+
* - `\`X\`-shipped` — back-reference to a peer story's package
|
|
4696
|
+
* - `using \`X\`` — when AC narrates "using <package>'s API"
|
|
4697
|
+
*/
|
|
4698
|
+
const DEPENDENCY_CONTEXT_PHRASE_PATTERNS = [
|
|
4699
|
+
/\bvia\s+`[^`]+`/i,
|
|
4700
|
+
/\bimports?\s+from\s+`[^`]+`/i,
|
|
4701
|
+
/\bconsumes\s+`[^`]+`/i,
|
|
4702
|
+
/\bbuilt\s+(?:atop|on\s+top\s+of)\s+`[^`]+`/i,
|
|
4703
|
+
/`[^`]+`-shipped/i,
|
|
4704
|
+
/\busing\s+`[^`]+`['']s/i
|
|
4705
|
+
];
|
|
4706
|
+
/**
|
|
4707
|
+
* Find all line indices that fall within a dependency context. Mirrors the
|
|
4708
|
+
* `detectNegationContextLines` shape exactly (same continuation walk: the
|
|
4709
|
+
* dependency-phrase line plus indented non-bullet continuation lines).
|
|
4710
|
+
*/
|
|
4711
|
+
function detectDependencyContextLines(lines) {
|
|
4712
|
+
const result = new Set();
|
|
4713
|
+
for (let i = 0; i < lines.length; i++) {
|
|
4714
|
+
const line = lines[i] ?? "";
|
|
4715
|
+
if (DEPENDENCY_CONTEXT_PHRASE_PATTERNS.some((pat) => pat.test(line))) {
|
|
4716
|
+
result.add(i);
|
|
4717
|
+
let j = i + 1;
|
|
4718
|
+
while (j < lines.length) {
|
|
4719
|
+
const next = lines[j] ?? "";
|
|
4720
|
+
if (next.trim() === "") break;
|
|
4721
|
+
if (/^\s*(?:-|\*|\d+\.)\s+/.test(next)) break;
|
|
4722
|
+
if (/^\s+\S/.test(next)) {
|
|
4723
|
+
result.add(j);
|
|
4724
|
+
j++;
|
|
4725
|
+
continue;
|
|
4726
|
+
}
|
|
4727
|
+
break;
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
return result;
|
|
4732
|
+
}
|
|
4664
4733
|
function extractHardClauses(sectionContent) {
|
|
4665
4734
|
const clauses = [];
|
|
4666
4735
|
const lines = sectionContent.split("\n");
|
|
4667
4736
|
const alternativeOptions = detectAlternativeOptions(lines);
|
|
4668
4737
|
const negationContextLines = detectNegationContextLines(lines);
|
|
4738
|
+
const dependencyContextLines = detectDependencyContextLines(lines);
|
|
4669
4739
|
const mustPattern = /\b(MUST NOT|MUST|SHALL NOT|SHALL)\b/;
|
|
4670
4740
|
for (const line of lines) {
|
|
4671
4741
|
const match = mustPattern.exec(line);
|
|
@@ -4685,11 +4755,13 @@ function extractHardClauses(sectionContent) {
|
|
|
4685
4755
|
while ((pathMatch = pathPattern.exec(line)) !== null) {
|
|
4686
4756
|
const alt = findOptionForLine(lineIdx, alternativeOptions);
|
|
4687
4757
|
const inNegation = negationContextLines.has(lineIdx);
|
|
4758
|
+
const inDependency = dependencyContextLines.has(lineIdx);
|
|
4688
4759
|
clauses.push({
|
|
4689
4760
|
type: "path",
|
|
4690
4761
|
text: `\`${pathMatch[1]}\``,
|
|
4691
4762
|
...alt ? { alternative: alt } : {},
|
|
4692
|
-
...inNegation ? { negation: true } : {}
|
|
4763
|
+
...inNegation ? { negation: true } : {},
|
|
4764
|
+
...inDependency ? { dependency: true } : {}
|
|
4693
4765
|
});
|
|
4694
4766
|
}
|
|
4695
4767
|
}
|
|
@@ -4757,6 +4829,14 @@ var SourceAcFidelityCheck = class {
|
|
|
4757
4829
|
});
|
|
4758
4830
|
continue;
|
|
4759
4831
|
}
|
|
4832
|
+
if (clause.dependency === true) {
|
|
4833
|
+
findings.push({
|
|
4834
|
+
category: "source-ac-dependency-reference",
|
|
4835
|
+
severity: "info",
|
|
4836
|
+
message: `path: "${truncated}" referenced in source AC inside a dependency-context phrase (e.g., "via \`X\`", "via \`X\`'s outbox", "imports from \`X\`", "consumes \`X\`", "built atop \`X\`", "\`X\`-shipped", "using \`X\`'s") — the AC named this path as an architectural integration point the implementation interacts with, not a positive-delivery requirement; treated as reference-only`
|
|
4837
|
+
});
|
|
4838
|
+
continue;
|
|
4839
|
+
}
|
|
4760
4840
|
if (isOperationalPath(clause.text)) {
|
|
4761
4841
|
findings.push({
|
|
4762
4842
|
category: "source-ac-operational-path-reference",
|
|
@@ -6700,4 +6780,4 @@ function registerHealthCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
6700
6780
|
|
|
6701
6781
|
//#endregion
|
|
6702
6782
|
export { BMAD_BASELINE_TOKENS_FULL, DEFAULT_STALL_THRESHOLD_SECONDS, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN$1 as STORY_KEY_PATTERN, SUBSTRATE_OWNED_SETTINGS_KEYS, SupervisorLock, VALID_PHASES, WorkGraphRepository, ZERO_FINDINGS_BY_AUTHOR, ZERO_FINDING_COUNTS, ZERO_PROBE_AUTHOR_METRICS, __commonJS, __require, __toESM, aggregateProbeAuthorMetrics, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter$1 as createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, createStateStore, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, inspectProcessTree, isOrchestratorProcessLine, parseDbTimestampAsUtc, parseRuntimeProbes, registerHealthCommand, renderFindings, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveGraphPath, resolveMainRepoRoot, resolveRunManifest, rollupFindingCounts, rollupFindingsByAuthor, rollupProbeAuthorMetrics, runHealthAction, validateStoryKey };
|
|
6703
|
-
//# sourceMappingURL=health-
|
|
6783
|
+
//# sourceMappingURL=health-BV-rzjf7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-
|
|
1
|
+
import { DEFAULT_STALL_THRESHOLD_SECONDS, getAllDescendantPids, getAutoHealthData, inspectProcessTree, isOrchestratorProcessLine, registerHealthCommand, runHealthAction } from "./health-BV-rzjf7.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./dist-VcMmfo2w.js";
|
|
4
4
|
import "./decisions-C0pz9Clx.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-
|
|
1
|
+
import { BMAD_BASELINE_TOKENS_FULL, DoltMergeConflict, FileStateStore, FindingsInjector, RunManifest, RuntimeProbeListSchema, STOP_AFTER_VALID_PHASES, STORY_KEY_PATTERN, VALID_PHASES, WorkGraphRepository, __commonJS, __require, __toESM, applyConfigToGraph, buildPipelineStatusOutput, createDatabaseAdapter, createDefaultVerificationPipeline, createGraphOrchestrator, createSdlcCodeReviewHandler, createSdlcCreateStoryHandler, createSdlcDevStoryHandler, createSdlcPhaseHandler, detectCycles, detectsEventDrivenAC, extractTargetFilesFromStoryContent, formatOutput, formatPipelineSummary, formatTokenTelemetry, inspectProcessTree, parseDbTimestampAsUtc, renderFindings, resolveGraphPath, resolveMainRepoRoot, validateStoryKey } from "./health-BV-rzjf7.js";
|
|
2
2
|
import { createLogger } from "./logger-KeHncl-f.js";
|
|
3
3
|
import { TypedEventBusImpl, createEventBus, createTuiApp, isTuiCapable, printNonTtyWarning, sleep } from "./helpers-CElYrONe.js";
|
|
4
4
|
import { ADVISORY_NOTES, Categorizer, ConsumerAnalyzer, DEFAULT_GLOBAL_SETTINGS, DispatcherImpl, DoltClient, ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, EfficiencyScorer, IngestionServer, LogTurnAnalyzer, OPERATIONAL_FINDING, Recommender, RoutingRecommender, RoutingResolver, RoutingTelemetry, RoutingTokenAccumulator, RoutingTuner, STORY_METRICS, STORY_OUTCOME, SubstrateConfigSchema, TEST_EXPANSION_FINDING, TEST_PLAN, TelemetryNormalizer, TelemetryPipeline, TurnAnalyzer, addTokenUsage, aggregateTokenUsageForRun, aggregateTokenUsageForStory, callLLM, createConfigSystem, createDatabaseAdapter$1, createDecision, createPipelineRun, createRequirement, detectInterfaceChanges, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunMetrics, getRunningPipelineRuns, getStoryMetricsForRun, getTokenUsageSummary, initSchema, listRequirements, loadModelRoutingConfig, registerArtifact, updatePipelineRun, updatePipelineRunConfig, upsertDecision, writeRunMetrics, writeStoryMetrics } from "./dist-VcMmfo2w.js";
|
|
@@ -33422,8 +33422,110 @@ var AnthropicAdapter = class {
|
|
|
33422
33422
|
}
|
|
33423
33423
|
throw new Error("[anthropic] Unexpected end of retry loop");
|
|
33424
33424
|
}
|
|
33425
|
-
async *stream(
|
|
33426
|
-
|
|
33425
|
+
async *stream(request) {
|
|
33426
|
+
const { body, betaHeaders } = this.buildRequestBody(request);
|
|
33427
|
+
body.stream = true;
|
|
33428
|
+
const headers = this.buildHeaders(betaHeaders);
|
|
33429
|
+
const url = `${this.baseUrl}/v1/messages`;
|
|
33430
|
+
const response = await this.fetch(url, {
|
|
33431
|
+
method: "POST",
|
|
33432
|
+
headers,
|
|
33433
|
+
body: JSON.stringify(body)
|
|
33434
|
+
});
|
|
33435
|
+
if (!response.ok) {
|
|
33436
|
+
const errorBody = await response.json().catch(() => ({}));
|
|
33437
|
+
const errorObj = errorBody?.error;
|
|
33438
|
+
const message = typeof errorObj?.message === "string" ? errorObj.message : response.statusText;
|
|
33439
|
+
throw new LLMError(`[anthropic] ${response.status}: ${message}`, response.status, "anthropic");
|
|
33440
|
+
}
|
|
33441
|
+
const text = await response.text();
|
|
33442
|
+
const lines = text.split("\n");
|
|
33443
|
+
let currentEventName = "";
|
|
33444
|
+
const blockTypes = new Map();
|
|
33445
|
+
const blockToolIds = new Map();
|
|
33446
|
+
let inputTokens = 0;
|
|
33447
|
+
let started = false;
|
|
33448
|
+
for (const line of lines) {
|
|
33449
|
+
const trimmed = line.trim();
|
|
33450
|
+
if (trimmed.startsWith("event: ")) currentEventName = trimmed.slice(7).trim();
|
|
33451
|
+
else if (trimmed.startsWith("data: ")) {
|
|
33452
|
+
const dataStr = trimmed.slice(6).trim();
|
|
33453
|
+
if (dataStr === "") continue;
|
|
33454
|
+
let eventData;
|
|
33455
|
+
try {
|
|
33456
|
+
eventData = JSON.parse(dataStr);
|
|
33457
|
+
} catch {
|
|
33458
|
+
continue;
|
|
33459
|
+
}
|
|
33460
|
+
if (currentEventName === "message_start") {
|
|
33461
|
+
if (!started) {
|
|
33462
|
+
started = true;
|
|
33463
|
+
yield { type: "message_start" };
|
|
33464
|
+
}
|
|
33465
|
+
const message = eventData["message"];
|
|
33466
|
+
const usage = message?.["usage"];
|
|
33467
|
+
if (typeof usage?.["input_tokens"] === "number") inputTokens = usage["input_tokens"];
|
|
33468
|
+
} else if (currentEventName === "content_block_start") {
|
|
33469
|
+
const index = eventData["index"];
|
|
33470
|
+
const block = eventData["content_block"];
|
|
33471
|
+
const blockType = block?.["type"];
|
|
33472
|
+
if (blockType === "text") blockTypes.set(index, "text");
|
|
33473
|
+
else if (blockType === "tool_use") {
|
|
33474
|
+
blockTypes.set(index, "tool_use");
|
|
33475
|
+
const toolId = block?.["id"];
|
|
33476
|
+
const toolName = block?.["name"];
|
|
33477
|
+
if (toolId !== void 0) blockToolIds.set(index, toolId);
|
|
33478
|
+
const toolCallHeader = {};
|
|
33479
|
+
if (toolId !== void 0) toolCallHeader.id = toolId;
|
|
33480
|
+
if (toolName !== void 0) toolCallHeader.name = toolName;
|
|
33481
|
+
yield {
|
|
33482
|
+
type: "tool_call_delta",
|
|
33483
|
+
toolCall: toolCallHeader
|
|
33484
|
+
};
|
|
33485
|
+
} else if (blockType === "thinking") blockTypes.set(index, "thinking");
|
|
33486
|
+
} else if (currentEventName === "content_block_delta") {
|
|
33487
|
+
const index = eventData["index"];
|
|
33488
|
+
const delta = eventData["delta"];
|
|
33489
|
+
const deltaType = delta?.["type"];
|
|
33490
|
+
if (deltaType === "text_delta") yield {
|
|
33491
|
+
type: "text_delta",
|
|
33492
|
+
delta: delta?.["text"] ?? ""
|
|
33493
|
+
};
|
|
33494
|
+
else if (deltaType === "input_json_delta") {
|
|
33495
|
+
const toolId = blockToolIds.get(index);
|
|
33496
|
+
const toolCallDelta = { rawArguments: delta?.["partial_json"] ?? "" };
|
|
33497
|
+
if (toolId !== void 0) toolCallDelta.id = toolId;
|
|
33498
|
+
yield {
|
|
33499
|
+
type: "tool_call_delta",
|
|
33500
|
+
toolCall: toolCallDelta
|
|
33501
|
+
};
|
|
33502
|
+
} else if (deltaType === "thinking_delta") yield {
|
|
33503
|
+
type: "reasoning_delta",
|
|
33504
|
+
reasoningDelta: delta?.["thinking"] ?? ""
|
|
33505
|
+
};
|
|
33506
|
+
} else if (currentEventName === "message_delta") {
|
|
33507
|
+
const usage = eventData["usage"];
|
|
33508
|
+
const outputTokens = typeof usage?.["output_tokens"] === "number" ? usage["output_tokens"] : 0;
|
|
33509
|
+
yield {
|
|
33510
|
+
type: "usage",
|
|
33511
|
+
usage: {
|
|
33512
|
+
inputTokens,
|
|
33513
|
+
outputTokens,
|
|
33514
|
+
totalTokens: inputTokens + outputTokens
|
|
33515
|
+
}
|
|
33516
|
+
};
|
|
33517
|
+
const delta = eventData["delta"];
|
|
33518
|
+
const stopReasonRaw = delta?.["stop_reason"];
|
|
33519
|
+
if (stopReasonRaw !== void 0) yield {
|
|
33520
|
+
type: "message_stop",
|
|
33521
|
+
finishReason: {
|
|
33522
|
+
reason: mapStopReason(stopReasonRaw),
|
|
33523
|
+
raw: stopReasonRaw
|
|
33524
|
+
}
|
|
33525
|
+
};
|
|
33526
|
+
} else if (currentEventName === "message_stop") break;
|
|
33527
|
+
}
|
|
33528
|
+
}
|
|
33427
33529
|
}
|
|
33428
33530
|
buildRequestBody(request) {
|
|
33429
33531
|
const betaHeaders = [];
|
|
@@ -45175,4 +45277,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
45175
45277
|
|
|
45176
45278
|
//#endregion
|
|
45177
45279
|
export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveMaxReviewCycles, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runProbeAuthor, runRunAction, runSolutioningPhase, validateStopAfterFromConflict, wireNdjsonEmitter };
|
|
45178
|
-
//# sourceMappingURL=run-
|
|
45280
|
+
//# sourceMappingURL=run-BYMVrlGZ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./health-
|
|
1
|
+
import "./health-BV-rzjf7.js";
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
4
|
import "./dist-VcMmfo2w.js";
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, resolveMaxReviewCycles, runRunAction, wireNdjsonEmitter } from "./run-BYMVrlGZ.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|