@structured-vibe-coding/core 0.19.0 → 0.21.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/index.d.ts CHANGED
@@ -3261,6 +3261,7 @@ declare function formatMcpContextForHandoff(results: McpFetchResult[]): string;
3261
3261
  declare function listMatchingSourceIds(sources: McpSource[], match: McpMatchContext): string[];
3262
3262
 
3263
3263
  interface RoleLists {
3264
+ stages: string[];
3264
3265
  owns: string[];
3265
3266
  inputs: string[];
3266
3267
  outputs: string[];
@@ -3360,6 +3361,10 @@ interface RunRoleInput {
3360
3361
  stop?: boolean;
3361
3362
  model?: RoleModel;
3362
3363
  now?: () => Date;
3364
+ /** One draft for the guide. Writes stay inside this role, and a team file is not used. */
3365
+ guide?: {
3366
+ changeDir: string;
3367
+ };
3363
3368
  }
3364
3369
  interface AllowRoleInput {
3365
3370
  runId: string;
@@ -3369,6 +3374,55 @@ interface AllowRoleInput {
3369
3374
  declare function runRole(root: string, input: RunRoleInput): Promise<RoleCommandResult>;
3370
3375
  declare function allowRole(root: string, input: AllowRoleInput): Promise<RoleCommandResult>;
3371
3376
 
3377
+ declare function roleContextBody(root: string, name: string): Promise<string>;
3378
+ declare function setRoleContext(root: string, input: {
3379
+ name: string;
3380
+ text?: string;
3381
+ knowledge?: string;
3382
+ generate?: boolean;
3383
+ }): Promise<RoleCommandResult>;
3384
+
3385
+ type Duty = "planning" | "architecture" | "construction";
3386
+ declare function dutyForStage(id: string, allIds: string[]): Duty;
3387
+ declare function prepareGuide(root: string, input?: {
3388
+ workflow?: string;
3389
+ agents?: false | AgentTarget;
3390
+ }): Promise<RoleCommandResult>;
3391
+ declare function runGuide(root: string, input?: {
3392
+ title?: string;
3393
+ answer?: string;
3394
+ workflow?: string;
3395
+ model?: RoleModel;
3396
+ agents?: false | AgentTarget;
3397
+ now?: () => Date;
3398
+ }): Promise<RoleCommandResult>;
3399
+
3400
+ declare const SETUP_STEP_IDS: readonly ["folder", "workflow", "host", "roles", "model", "check", "start"];
3401
+ type SetupStepId = (typeof SETUP_STEP_IDS)[number];
3402
+ declare const SETUP_WHY: Record<SetupStepId, string>;
3403
+ type SetupRolesChoice = "duties" | "software" | "keep";
3404
+ type SetupModelState = "configured" | "missing" | {
3405
+ error: string;
3406
+ };
3407
+ type SetupStatus = {
3408
+ folder: boolean;
3409
+ host: string | null;
3410
+ roles: string[];
3411
+ model: SetupModelState;
3412
+ };
3413
+ type SetupStepInput = {
3414
+ step: SetupStepId;
3415
+ workflow?: string;
3416
+ host?: false | AgentTarget;
3417
+ roles?: SetupRolesChoice;
3418
+ /** When the model is missing, true exits 1. False prints the sentence and exits 0. */
3419
+ requireModel?: boolean;
3420
+ };
3421
+ declare function parseSetupStep(raw: string): SetupStepId | null;
3422
+ declare function formatSetupStatus(status: SetupStatus): string;
3423
+ declare function readSetupStatus(root: string, env?: Record<string, string | undefined>): Promise<SetupStatus>;
3424
+ declare function runSetupStep(root: string, input: SetupStepInput, env?: Record<string, string | undefined>): Promise<RoleCommandResult>;
3425
+
3372
3426
  declare function recordSignoff(root: string, input: {
3373
3427
  note?: string;
3374
3428
  stage?: string;
@@ -3391,6 +3445,7 @@ declare function editRole(root: string, nameInput: string, patch: {
3391
3445
  job?: string;
3392
3446
  description?: string;
3393
3447
  askFirst?: boolean;
3448
+ stages?: string[];
3394
3449
  }): Promise<RoleCommandResult>;
3395
3450
  declare function pinRole(root: string, name: string): Promise<RoleCommandResult>;
3396
3451
  declare function hideRole(root: string, name: string): Promise<RoleCommandResult>;
@@ -3976,4 +4031,4 @@ declare function formatEpicGraph(nodes: StoryNode[]): {
3976
4031
  /** Graph errors, then open dependencies. Null means the branch may be created. */
3977
4032
  declare function branchBlock(nodes: StoryNode[], story: string): string | null;
3978
4033
 
3979
- export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdapterExtractResult, AdapterRegistry, type AdvanceResult, type AgentInstallPlan, AgentInstallPreflightError, type AgentIntegration, type AgentTarget, type AgentTargetOption, type AllowRoleInput, type ArtifactDef, ArtifactDefSchema, type BuildRefinePlanOptions, type CallMcpToolResult, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type ChangeMetrics, ChangeMetricsSchema, type ChangePhaseOrder, type CodeContextCaps, type CodeContextGap, type CodeContextGapCode, type CodeContextRequest, type CodeContextResult, type CodeContextSummary, type CodeSlice, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_CODE_CONTEXT_CAPS, DEFAULT_INIT_INTEGRATION, type DecideInput, type DecisionMetric, DecisionMetricSchema, type DecisionModel, type DecisionOutcome, EMBEDDINGS_UNAVAILABLE, EMBEDDING_MODEL, type Embedder, type FastembedHooks, type FocusPlan, type Gate, GateSchema, type GatherMcpOptions, type GenerateCodeContextDeps, type GeneratedManifest, type GeneratedState, type GitHeadRunner, type GreenfieldFeature, type IndexStats, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, type InstalledAgentSnapshot, type KeptFile, type KeptReason, type LanguageAdapter, type McpConfig, McpConfigSchema, type McpFetchResult, type McpInvoke, McpInvokeSchema, type McpMatchContext, type McpSource, McpSourceSchema, type McpWhen, McpWhenSchema, type MetricsImportResult, type ModelChoice, type ModelContext, type ModelEntry, type ModelsConfig, ModelsConfigSchema, PROTOCOL_MD, type PhaseMetric, PhaseMetricSchema, type PhaseTiming, type PhaseTimingRow, type PlannedWrite, type PriceCard, type Prices, type ProductTeamMember, RRF_K, type RawHit, type ReconcileGeneratedResult, type RefineArtifactRef, type RefineMode, type RefinePlan, type RemoveAgentHostsResult, type RenderChangeReportInput, type RoleCommandResult, type RoleLists, type RoleModel, type RoleProfile, type RouteDeps, type RouteHit, type RouteItem, type RunRoleInput, SDD_AGENT_ROLES, SDD_CORE_VERSION, SDD_DIR, SUMMARY_TOKEN_CAP, type SddAgentRole, type SddAgentRoleId, SddError, type SearchConfig, SearchConfigError, type SearchHit, type SearchProvider, type SearchQuery, type SearchResult, type SearchRuntime, type SearchScope, type Stage, StageSchema, type StartFeatureInput, type StartGreenfieldInput, type StartGreenfieldResult, type StoryDraft, type StoryNode, type SymbolInfo, type SymbolKind, type SyncChangeResult, type TeamConfig, TeamSchema, type TokenCounts, type TokenUsageMetric, TokenUsageMetricSchema, VerifyCommandSchema, type VerifyResult, type VerifyStatus, WORK_TYPES, type WorkType, type Workflow, WorkflowSchema, acceptNetwork, activePointerPath, activeStages, addLesson, addMcpSource, advanceStage, agentHostPaths, agentKickoffMessage, allowRole, approveGate, archiveDir, assertAgentInstallable, assertSessionLogAllowed, branchBlock, budgetForStage, buildAgentPrompt, buildContext, buildRefinePlan, buildRetrievedInner, callMcpSourceTool, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, changesPathRel, checkModels, checkTeam, chunkCode, chunkMarkdown, classifyPath, clearActiveIf, clearRegisteredSearchProviders, compareChangesByFirstPhase, completeChange, configPath, contentHash, copyDir, copyDirSkipExisting, costFor, countTokens, createBuiltinProvider, createChange, createFastembedEmbedder, createRole, createRoleFromTemplate, decide, defaultConfig, defaultMcpConfig, defaultMcpYamlPath, defaultMemoryDir, defaultPricesYamlPath, defaultSearchYamlPath, defaultTeamsDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, deleteRole, describeFsError, describeKept, displayArchivePath, displayChangePath, domainsDir, duplicateRole, editRole, embedSearchQuery, emptyChangeMetrics, ensureDir, ensureMcpConfig, errorMessage, executeSearch, explainMatch, explainModel, extractiveSummary, fallbackAdapter, fallbackIncompleteStageId, fallbackWarning, fastembedImportCount, findFeaturesBacklogPath, firstActiveStageId, formatDuration, formatEpicGraph, formatJsonSummary, formatMcpContextForHandoff, formatModels, formatStatus, formatTeam, formatTokenInventory, ftsTokens, fuseByRank, fuseHits, gatherMcpContext, gatherMcpContextForChange, generateCodeContext, generatedState, getActiveChangeId, getFacts, getHeadSha, getIntegration, getStage, gitUserName, guidancePaths, handoffRole, hideRole, importSessionMetrics, incompletePriorStageErrors, indexDbPath, inferComplexity, initProject, initTeam, installAgentIntegration, installAgentIntegrations, integrationKeyFor, interpolate, interpolateArgs, isHardDenied, isIgnoredPath, isInitialized, isPrunedDir, isSddError, isSecretPath, isStageSkipped, isSubstantiveArtifactContent, isWorkType, keywordHits, listBacklogFeatures, listBundledWorkflowNames, listChanges, listDirs, listFacts, listFiles, listMatchingSourceIds, listMcpSourceTools, listRoleTemplates, listScopeHits, listTeamTemplates, listWorkflowNames, loadBrain, loadChangeMeta, loadConfig, loadEpicStories, loadExcluder, loadGeneratedManifest, loadInstalledAgent, loadMcpConfig, loadModels, loadPrices, loadProductTeam, loadSearchConfig, loadWorkflow, markGenerated, matchMcpSources, mcpConfigPath, mcpTimeoutMs, memoryDir, memoryPathRel, mergeCaps, mergeConfigDefaults, mergeRankedHits, migrateTeamMemory, missingBundledWorkflows, modelFromEnv, nextStageId, nowIso, optionForTarget, packHits, parseAgentTargets, parseFeaturesBacklog, parseIntegration, parseStoryDraft, pathExists, phaseTiming, pinRole, planAgentIntegration, planNetwork, postRoom, productTeamHome, promoteGreenfieldToMemory, queueRole, rankScope, readChangeMetrics, readHandoffCodePoints, readTeamConfig, readText, readYaml, rebuildNetwork, recommendWorkflow, reconcileGeneratedTree, recordDecisionMetric, recordDecisionRequest, recordSignoff, refreshActiveAgentContext, refreshConfiguredGuidance, registerSearchProvider, removeMcpSource, removeOtherAgentHosts, removeOtherAgentHostsDetailed, removePath, renderAgentsMd, renderBlock, renderChangeReport, renderMemoryIndex, renderProductTeamSection, renderProtocolMd, renderSddReadme, renderThinAgent, repairRequiredIgnores, reportAllChanges, reportChange, resolveActiveDirectory, resolveBot, resolveChangeId, resolveEmbedder, resolveFocus, resolveSearchProvider, resolveStages, reviewRoom, routeRole, rrf, runLocalVerify, runLoop, runNetwork, runRole, saveChangeMeta, saveConfig, saveGeneratedManifest, saveMcpConfig, scopeForPath, sddRoot, searchConfigPath, searchPreamble, selectModel, setActiveChange, setFact, setRoleMessaging, shouldAutoSkip, showFact, showMemory, showRoleGroup, showRoles, showRoom, showTeam, skipStage, slugify, spawnModelCommand, startFeatureFromBacklog, startGreenfield, startPhase, storyIdTaken, switchWorkflow, syncChangeHead, takeRole, templatesDir, toProcessEnv, todayIsoDate, tokenizeKeywords, transitionPhase, typescriptAdapter, uniqueChangeDirName, updateFeatureStatus, validBranchName, withMcpSource, workKind, workflowUnavailableMessage, workflowsDir, writeAgentHandoff, writeRefineBrief, writeText, writeTextIfMissing, writeYaml };
4034
+ export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdapterExtractResult, AdapterRegistry, type AdvanceResult, type AgentInstallPlan, AgentInstallPreflightError, type AgentIntegration, type AgentTarget, type AgentTargetOption, type AllowRoleInput, type ArtifactDef, ArtifactDefSchema, type BuildRefinePlanOptions, type CallMcpToolResult, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type ChangeMetrics, ChangeMetricsSchema, type ChangePhaseOrder, type CodeContextCaps, type CodeContextGap, type CodeContextGapCode, type CodeContextRequest, type CodeContextResult, type CodeContextSummary, type CodeSlice, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_CODE_CONTEXT_CAPS, DEFAULT_INIT_INTEGRATION, type DecideInput, type DecisionMetric, DecisionMetricSchema, type DecisionModel, type DecisionOutcome, type Duty, EMBEDDINGS_UNAVAILABLE, EMBEDDING_MODEL, type Embedder, type FastembedHooks, type FocusPlan, type Gate, GateSchema, type GatherMcpOptions, type GenerateCodeContextDeps, type GeneratedManifest, type GeneratedState, type GitHeadRunner, type GreenfieldFeature, type IndexStats, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, type InstalledAgentSnapshot, type KeptFile, type KeptReason, type LanguageAdapter, type McpConfig, McpConfigSchema, type McpFetchResult, type McpInvoke, McpInvokeSchema, type McpMatchContext, type McpSource, McpSourceSchema, type McpWhen, McpWhenSchema, type MetricsImportResult, type ModelChoice, type ModelContext, type ModelEntry, type ModelsConfig, ModelsConfigSchema, PROTOCOL_MD, type PhaseMetric, PhaseMetricSchema, type PhaseTiming, type PhaseTimingRow, type PlannedWrite, type PriceCard, type Prices, type ProductTeamMember, RRF_K, type RawHit, type ReconcileGeneratedResult, type RefineArtifactRef, type RefineMode, type RefinePlan, type RemoveAgentHostsResult, type RenderChangeReportInput, type RoleCommandResult, type RoleLists, type RoleModel, type RoleProfile, type RouteDeps, type RouteHit, type RouteItem, type RunRoleInput, SDD_AGENT_ROLES, SDD_CORE_VERSION, SDD_DIR, SETUP_STEP_IDS, SETUP_WHY, SUMMARY_TOKEN_CAP, type SddAgentRole, type SddAgentRoleId, SddError, type SearchConfig, SearchConfigError, type SearchHit, type SearchProvider, type SearchQuery, type SearchResult, type SearchRuntime, type SearchScope, type SetupModelState, type SetupRolesChoice, type SetupStatus, type SetupStepId, type SetupStepInput, type Stage, StageSchema, type StartFeatureInput, type StartGreenfieldInput, type StartGreenfieldResult, type StoryDraft, type StoryNode, type SymbolInfo, type SymbolKind, type SyncChangeResult, type TeamConfig, TeamSchema, type TokenCounts, type TokenUsageMetric, TokenUsageMetricSchema, VerifyCommandSchema, type VerifyResult, type VerifyStatus, WORK_TYPES, type WorkType, type Workflow, WorkflowSchema, acceptNetwork, activePointerPath, activeStages, addLesson, addMcpSource, advanceStage, agentHostPaths, agentKickoffMessage, allowRole, approveGate, archiveDir, assertAgentInstallable, assertSessionLogAllowed, branchBlock, budgetForStage, buildAgentPrompt, buildContext, buildRefinePlan, buildRetrievedInner, callMcpSourceTool, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, changesPathRel, checkModels, checkTeam, chunkCode, chunkMarkdown, classifyPath, clearActiveIf, clearRegisteredSearchProviders, compareChangesByFirstPhase, completeChange, configPath, contentHash, copyDir, copyDirSkipExisting, costFor, countTokens, createBuiltinProvider, createChange, createFastembedEmbedder, createRole, createRoleFromTemplate, decide, defaultConfig, defaultMcpConfig, defaultMcpYamlPath, defaultMemoryDir, defaultPricesYamlPath, defaultSearchYamlPath, defaultTeamsDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, deleteRole, describeFsError, describeKept, displayArchivePath, displayChangePath, domainsDir, duplicateRole, dutyForStage, editRole, embedSearchQuery, emptyChangeMetrics, ensureDir, ensureMcpConfig, errorMessage, executeSearch, explainMatch, explainModel, extractiveSummary, fallbackAdapter, fallbackIncompleteStageId, fallbackWarning, fastembedImportCount, findFeaturesBacklogPath, firstActiveStageId, formatDuration, formatEpicGraph, formatJsonSummary, formatMcpContextForHandoff, formatModels, formatSetupStatus, formatStatus, formatTeam, formatTokenInventory, ftsTokens, fuseByRank, fuseHits, gatherMcpContext, gatherMcpContextForChange, generateCodeContext, generatedState, getActiveChangeId, getFacts, getHeadSha, getIntegration, getStage, gitUserName, guidancePaths, handoffRole, hideRole, importSessionMetrics, incompletePriorStageErrors, indexDbPath, inferComplexity, initProject, initTeam, installAgentIntegration, installAgentIntegrations, integrationKeyFor, interpolate, interpolateArgs, isHardDenied, isIgnoredPath, isInitialized, isPrunedDir, isSddError, isSecretPath, isStageSkipped, isSubstantiveArtifactContent, isWorkType, keywordHits, listBacklogFeatures, listBundledWorkflowNames, listChanges, listDirs, listFacts, listFiles, listMatchingSourceIds, listMcpSourceTools, listRoleTemplates, listScopeHits, listTeamTemplates, listWorkflowNames, loadBrain, loadChangeMeta, loadConfig, loadEpicStories, loadExcluder, loadGeneratedManifest, loadInstalledAgent, loadMcpConfig, loadModels, loadPrices, loadProductTeam, loadSearchConfig, loadWorkflow, markGenerated, matchMcpSources, mcpConfigPath, mcpTimeoutMs, memoryDir, memoryPathRel, mergeCaps, mergeConfigDefaults, mergeRankedHits, migrateTeamMemory, missingBundledWorkflows, modelFromEnv, nextStageId, nowIso, optionForTarget, packHits, parseAgentTargets, parseFeaturesBacklog, parseIntegration, parseSetupStep, parseStoryDraft, pathExists, phaseTiming, pinRole, planAgentIntegration, planNetwork, postRoom, prepareGuide, productTeamHome, promoteGreenfieldToMemory, queueRole, rankScope, readChangeMetrics, readHandoffCodePoints, readSetupStatus, readTeamConfig, readText, readYaml, rebuildNetwork, recommendWorkflow, reconcileGeneratedTree, recordDecisionMetric, recordDecisionRequest, recordSignoff, refreshActiveAgentContext, refreshConfiguredGuidance, registerSearchProvider, removeMcpSource, removeOtherAgentHosts, removeOtherAgentHostsDetailed, removePath, renderAgentsMd, renderBlock, renderChangeReport, renderMemoryIndex, renderProductTeamSection, renderProtocolMd, renderSddReadme, renderThinAgent, repairRequiredIgnores, reportAllChanges, reportChange, resolveActiveDirectory, resolveBot, resolveChangeId, resolveEmbedder, resolveFocus, resolveSearchProvider, resolveStages, reviewRoom, roleContextBody, routeRole, rrf, runGuide, runLocalVerify, runLoop, runNetwork, runRole, runSetupStep, saveChangeMeta, saveConfig, saveGeneratedManifest, saveMcpConfig, scopeForPath, sddRoot, searchConfigPath, searchPreamble, selectModel, setActiveChange, setFact, setRoleContext, setRoleMessaging, shouldAutoSkip, showFact, showMemory, showRoleGroup, showRoles, showRoom, showTeam, skipStage, slugify, spawnModelCommand, startFeatureFromBacklog, startGreenfield, startPhase, storyIdTaken, switchWorkflow, syncChangeHead, takeRole, templatesDir, toProcessEnv, todayIsoDate, tokenizeKeywords, transitionPhase, typescriptAdapter, uniqueChangeDirName, updateFeatureStatus, validBranchName, withMcpSource, workKind, workflowUnavailableMessage, workflowsDir, writeAgentHandoff, writeRefineBrief, writeText, writeTextIfMissing, writeYaml };