@wrongstack/core 0.8.2 → 0.8.5
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/coordination/index.js +8 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +2 -2
- package/dist/defaults/index.js +52 -26
- package/dist/defaults/index.js.map +1 -1
- package/dist/execution/index.d.ts +11 -5
- package/dist/execution/index.js +33 -8
- package/dist/execution/index.js.map +1 -1
- package/dist/index.d.ts +497 -5
- package/dist/index.js +1328 -89
- package/dist/index.js.map +1 -1
- package/dist/{plan-templates-BnlpEkX8.d.ts → plan-templates-D8zQgZzc.d.ts} +1 -1
- package/dist/sdd/index.d.ts +7 -7
- package/dist/sdd/index.js +10 -14
- package/dist/sdd/index.js.map +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/skills/index.js +7 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +1 -3
- package/dist/storage/index.js.map +1 -1
- package/dist/types/index.js +22 -3
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +40 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/{wstack-paths-gCrJ631C.d.ts → wstack-paths-Bxik3CsK.d.ts} +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,11 +30,12 @@ import { c as ModeStore } from './mode-CV077NjV.js';
|
|
|
30
30
|
export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-CV077NjV.js';
|
|
31
31
|
export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-DPxcUVkn.js';
|
|
32
32
|
export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, j as BudgetUsage, C as CoordinatorEvents, k as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, l as MultiAgentCoordinator, S as SpawnResult, m as SubagentBudget, n as SubagentConfig, o as SubagentContext, p as SubagentError, q as SubagentErrorKind, r as SubagentRunContext, s as SubagentRunOutcome, t as SubagentRunner, T as TaskDelegation, u as TaskResult, v as TaskSpec } from './multi-agent-CRMznZmf.js';
|
|
33
|
-
|
|
33
|
+
import { l as TaskGraph, r as TaskType, n as TaskPriority, m as TaskNode } from './task-graph-D1YQbpxF.js';
|
|
34
|
+
export { C as CriticalPathResult, D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, o as TaskProgress, p as TaskSort, q as TaskStatus, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from './task-graph-D1YQbpxF.js';
|
|
34
35
|
export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from './observability-BhnVLBLS.js';
|
|
35
36
|
export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, MessageRepairReport, MessageRepairResult, NewlineStyle, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, formatTodosList, matchAny, matchGlob, normalizeToLf, repairToolUseAdjacency, safeParse, safeStringify, sanitizeJsonString, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema } from './utils/index.js';
|
|
36
|
-
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-
|
|
37
|
-
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-
|
|
37
|
+
export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-Bxik3CsK.js';
|
|
38
|
+
export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-D8zQgZzc.js';
|
|
38
39
|
export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BmYi3DGA.js';
|
|
39
40
|
export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-BBa1M1xc.js';
|
|
40
41
|
export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, AutonomyPromptContributorOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, EternalAutonomyEngine, EternalAutonomyOptions, EternalEngineState, IntelligentCompactor, IntelligentCompactorOptions, ParallelEngineState, ParallelEternalEngine, ParallelEternalOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions, buildGoalPreamble, makeAutonomyPromptContributor } from './execution/index.js';
|
|
@@ -43,7 +44,8 @@ export { a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d
|
|
|
43
44
|
export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-IQKrMfXz.js';
|
|
44
45
|
export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from './agent-subagent-runner-Cav3yEJM.js';
|
|
45
46
|
export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from './models/index.js';
|
|
46
|
-
|
|
47
|
+
import { TaskStore } from './sdd/index.js';
|
|
48
|
+
export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from './sdd/index.js';
|
|
47
49
|
export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from './observability/index.js';
|
|
48
50
|
export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from './mcp-servers-n2L9ohMX.js';
|
|
49
51
|
export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
|
|
@@ -808,4 +810,494 @@ declare function loadPlugins(plugins: Plugin[], opts: LoadPluginsOptions): Promi
|
|
|
808
810
|
*/
|
|
809
811
|
declare function unloadPlugins(loadedPlugins: Plugin[], opts: LoadPluginsOptions): Promise<void>;
|
|
810
812
|
|
|
811
|
-
|
|
813
|
+
type PhaseStatus = 'pending' | 'ready' | 'running' | 'paused' | 'completed' | 'failed' | 'skipped';
|
|
814
|
+
interface PhaseNode {
|
|
815
|
+
id: string;
|
|
816
|
+
/** Faz adı, örn: "Discovery", "Design", "Implementation", "Testing" */
|
|
817
|
+
name: string;
|
|
818
|
+
description: string;
|
|
819
|
+
status: PhaseStatus;
|
|
820
|
+
/** Bu fazın görev grafiği */
|
|
821
|
+
taskGraph: TaskGraph;
|
|
822
|
+
/** Önceki faz ID'leri — bunlar tamamlanmadan bu faz başlayamaz */
|
|
823
|
+
dependsOn: string[];
|
|
824
|
+
/** Sonraki faz ID'leri */
|
|
825
|
+
nextPhases: string[];
|
|
826
|
+
/** Bu faz parallel çalışabilir mi? (önceki faz bitmeden başlayabilir) */
|
|
827
|
+
parallelizable: boolean;
|
|
828
|
+
/** Faz önceliği */
|
|
829
|
+
priority: 'critical' | 'high' | 'medium' | 'low';
|
|
830
|
+
/** Tahmini süre (saat) */
|
|
831
|
+
estimateHours: number;
|
|
832
|
+
/** Gerçekleşen süre (ms) */
|
|
833
|
+
actualDurationMs?: number;
|
|
834
|
+
/** Başlangıç zamanı */
|
|
835
|
+
startedAt?: number;
|
|
836
|
+
/** Bitiş zamanı */
|
|
837
|
+
completedAt?: number;
|
|
838
|
+
/** Bu fazda atanmış agent'lar */
|
|
839
|
+
assignedAgents: string[];
|
|
840
|
+
/** Faz metadata */
|
|
841
|
+
metadata?: Record<string, unknown>;
|
|
842
|
+
createdAt: number;
|
|
843
|
+
updatedAt: number;
|
|
844
|
+
}
|
|
845
|
+
interface PhaseGraph {
|
|
846
|
+
id: string;
|
|
847
|
+
/** Proje başlığı */
|
|
848
|
+
title: string;
|
|
849
|
+
description: string;
|
|
850
|
+
phases: Map<string, PhaseNode>;
|
|
851
|
+
/** Başlangıç faz ID'leri */
|
|
852
|
+
rootPhaseIds: string[];
|
|
853
|
+
/** Aktif faz ID'leri (running durumunda olanlar) */
|
|
854
|
+
activePhaseIds: string[];
|
|
855
|
+
/** Tamamlanan faz ID'leri */
|
|
856
|
+
completedPhaseIds: string[];
|
|
857
|
+
/** Başarısız faz ID'leri */
|
|
858
|
+
failedPhaseIds: string[];
|
|
859
|
+
/** Otonom mod aktif mi? */
|
|
860
|
+
autonomous: boolean;
|
|
861
|
+
/** Tüm fazlar tamamlandığında dur */
|
|
862
|
+
stopOnComplete: boolean;
|
|
863
|
+
createdAt: number;
|
|
864
|
+
updatedAt: number;
|
|
865
|
+
startedAt?: number;
|
|
866
|
+
completedAt?: number;
|
|
867
|
+
}
|
|
868
|
+
interface PhaseProgress {
|
|
869
|
+
totalPhases: number;
|
|
870
|
+
pending: number;
|
|
871
|
+
ready: number;
|
|
872
|
+
running: number;
|
|
873
|
+
paused: number;
|
|
874
|
+
completed: number;
|
|
875
|
+
failed: number;
|
|
876
|
+
skipped: number;
|
|
877
|
+
percentComplete: number;
|
|
878
|
+
totalTasks: number;
|
|
879
|
+
completedTasks: number;
|
|
880
|
+
failedTasks: number;
|
|
881
|
+
estimatedHours: number;
|
|
882
|
+
actualHours: number;
|
|
883
|
+
}
|
|
884
|
+
interface PhaseEventMap {
|
|
885
|
+
'phase.statusChange': {
|
|
886
|
+
phaseId: string;
|
|
887
|
+
from: PhaseStatus;
|
|
888
|
+
to: PhaseStatus;
|
|
889
|
+
};
|
|
890
|
+
'phase.started': {
|
|
891
|
+
phaseId: string;
|
|
892
|
+
name: string;
|
|
893
|
+
};
|
|
894
|
+
'phase.completed': {
|
|
895
|
+
phaseId: string;
|
|
896
|
+
name: string;
|
|
897
|
+
durationMs: number;
|
|
898
|
+
};
|
|
899
|
+
'phase.failed': {
|
|
900
|
+
phaseId: string;
|
|
901
|
+
name: string;
|
|
902
|
+
error?: string;
|
|
903
|
+
};
|
|
904
|
+
'phase.taskCompleted': {
|
|
905
|
+
phaseId: string;
|
|
906
|
+
taskId: string;
|
|
907
|
+
taskTitle: string;
|
|
908
|
+
};
|
|
909
|
+
'phase.taskFailed': {
|
|
910
|
+
phaseId: string;
|
|
911
|
+
taskId: string;
|
|
912
|
+
taskTitle: string;
|
|
913
|
+
error: string;
|
|
914
|
+
};
|
|
915
|
+
'phase.taskRetrying': {
|
|
916
|
+
phaseId: string;
|
|
917
|
+
taskId: string;
|
|
918
|
+
taskTitle: string;
|
|
919
|
+
attempt: number;
|
|
920
|
+
maxRetries: number;
|
|
921
|
+
};
|
|
922
|
+
'phase.allTasksDone': {
|
|
923
|
+
phaseId: string;
|
|
924
|
+
completed: number;
|
|
925
|
+
failed: number;
|
|
926
|
+
};
|
|
927
|
+
'graph.completed': {
|
|
928
|
+
graphId: string;
|
|
929
|
+
durationMs: number;
|
|
930
|
+
};
|
|
931
|
+
'graph.failed': {
|
|
932
|
+
graphId: string;
|
|
933
|
+
failedPhaseId: string;
|
|
934
|
+
error: string;
|
|
935
|
+
};
|
|
936
|
+
'autonomous.tick': {
|
|
937
|
+
activePhases: string[];
|
|
938
|
+
queuedPhases: string[];
|
|
939
|
+
};
|
|
940
|
+
'agent.assigned': {
|
|
941
|
+
phaseId: string;
|
|
942
|
+
agentId: string;
|
|
943
|
+
};
|
|
944
|
+
'agent.released': {
|
|
945
|
+
phaseId: string;
|
|
946
|
+
agentId: string;
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
type PhaseEventName = keyof PhaseEventMap;
|
|
950
|
+
interface PhaseExecutionContext {
|
|
951
|
+
/** Bir görevi çalıştır — AI agent tarafından yapılır */
|
|
952
|
+
executeTask: (task: TaskNode, phaseId: string) => Promise<unknown>;
|
|
953
|
+
/** Bir faz tamamlandığında çağrılır */
|
|
954
|
+
onPhaseComplete?: (phase: PhaseNode) => void;
|
|
955
|
+
/** Bir faz başarısız olduğunda çağrılır */
|
|
956
|
+
onPhaseFail?: (phase: PhaseNode, error: Error) => void;
|
|
957
|
+
/** Her tick'te çağrılır (otonom modda) */
|
|
958
|
+
onTick?: (ctx: {
|
|
959
|
+
activePhases: PhaseNode[];
|
|
960
|
+
readyPhases: PhaseNode[];
|
|
961
|
+
}) => void;
|
|
962
|
+
}
|
|
963
|
+
interface AutoPhaseOptions {
|
|
964
|
+
/** Maksimum parallel faz sayısı */
|
|
965
|
+
maxConcurrentPhases?: number;
|
|
966
|
+
/** Maksimum parallel görev sayısı (faz içinde) */
|
|
967
|
+
maxConcurrentTasks?: number;
|
|
968
|
+
/** Başarısız görev retry sayısı */
|
|
969
|
+
maxRetries?: number;
|
|
970
|
+
/** Otonom mod: faz tamamlandıkça otomatik sonrakine geç */
|
|
971
|
+
autonomous?: boolean;
|
|
972
|
+
/** Fazlar arası bekleme süresi (ms) */
|
|
973
|
+
phaseDelayMs?: number;
|
|
974
|
+
/** Bir faz failed olursa dur */
|
|
975
|
+
stopOnFailure?: boolean;
|
|
976
|
+
/** Event bus */
|
|
977
|
+
events?: EventBus;
|
|
978
|
+
}
|
|
979
|
+
interface PhaseFilter {
|
|
980
|
+
status?: PhaseStatus[];
|
|
981
|
+
priority?: PhaseNode['priority'][];
|
|
982
|
+
}
|
|
983
|
+
interface PhaseSort {
|
|
984
|
+
field: 'priority' | 'createdAt' | 'startedAt' | 'completedAt';
|
|
985
|
+
direction: 'asc' | 'desc';
|
|
986
|
+
}
|
|
987
|
+
interface PhaseTemplate {
|
|
988
|
+
name: string;
|
|
989
|
+
description: string;
|
|
990
|
+
priority: PhaseNode['priority'];
|
|
991
|
+
estimateHours: number;
|
|
992
|
+
parallelizable: boolean;
|
|
993
|
+
/** Otomatik oluşturulacak task şablonları */
|
|
994
|
+
taskTemplates?: Array<{
|
|
995
|
+
title: string;
|
|
996
|
+
description: string;
|
|
997
|
+
type: TaskType;
|
|
998
|
+
priority: TaskPriority;
|
|
999
|
+
estimateHours: number;
|
|
1000
|
+
tags?: string[];
|
|
1001
|
+
}>;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
interface AutoPhaseRunnerOptions extends AutoPhaseOptions {
|
|
1005
|
+
/** Proje başlığı */
|
|
1006
|
+
title: string;
|
|
1007
|
+
description?: string;
|
|
1008
|
+
/** Faz şablonları */
|
|
1009
|
+
phases: PhaseTemplate[];
|
|
1010
|
+
/** Task çalıştırma fonksiyonu */
|
|
1011
|
+
executeTask: (task: TaskNode, phaseId: string) => Promise<unknown>;
|
|
1012
|
+
/** Faz tamamlandığında */
|
|
1013
|
+
onPhaseComplete?: (phase: PhaseNode) => void;
|
|
1014
|
+
/** Faz başarısız olduğunda */
|
|
1015
|
+
onPhaseFail?: (phase: PhaseNode, error: Error) => void;
|
|
1016
|
+
/** Her tick'te */
|
|
1017
|
+
onTick?: (ctx: {
|
|
1018
|
+
activePhases: PhaseNode[];
|
|
1019
|
+
readyPhases: PhaseNode[];
|
|
1020
|
+
}) => void;
|
|
1021
|
+
/** Progress değiştiğinde */
|
|
1022
|
+
onProgress?: (progress: PhaseProgress) => void;
|
|
1023
|
+
/** Graph tamamlandığında */
|
|
1024
|
+
onComplete?: (graph: PhaseGraph) => void;
|
|
1025
|
+
/** Graph başarısız olduğunda */
|
|
1026
|
+
onFail?: (graph: PhaseGraph, failedPhase: PhaseNode, error: Error) => void;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* AutoPhaseRunner — Tek bir entry point'ten tüm otonom faz akışını yöneten üst seviye API.
|
|
1030
|
+
*
|
|
1031
|
+
* Kullanım:
|
|
1032
|
+
* const runner = new AutoPhaseRunner({
|
|
1033
|
+
* title: 'Auth Refactor',
|
|
1034
|
+
* phases: [...],
|
|
1035
|
+
* executeTask: async (task, phaseId) => { ... },
|
|
1036
|
+
* onProgress: (p) => console.log(`${p.percentComplete}% done`),
|
|
1037
|
+
* });
|
|
1038
|
+
* await runner.start();
|
|
1039
|
+
*/
|
|
1040
|
+
declare class AutoPhaseRunner {
|
|
1041
|
+
private graph;
|
|
1042
|
+
private orchestrator;
|
|
1043
|
+
private opts;
|
|
1044
|
+
private progressInterval;
|
|
1045
|
+
private readonly graphCompletedHandler;
|
|
1046
|
+
private readonly graphFailedHandler;
|
|
1047
|
+
/** Stores the unsubscribe function returned by EventBus.on() */
|
|
1048
|
+
private unsubscribeCompleted;
|
|
1049
|
+
private unsubscribeFailed;
|
|
1050
|
+
constructor(opts: AutoPhaseRunnerOptions);
|
|
1051
|
+
start(): Promise<PhaseGraph>;
|
|
1052
|
+
pause(): void;
|
|
1053
|
+
resume(): void;
|
|
1054
|
+
stop(): void;
|
|
1055
|
+
getProgress(): PhaseProgress | null;
|
|
1056
|
+
getGraph(): PhaseGraph | null;
|
|
1057
|
+
isRunning(): boolean;
|
|
1058
|
+
isPaused(): boolean;
|
|
1059
|
+
assignAgent(phaseId: string, agentId: string): void;
|
|
1060
|
+
releaseAgent(phaseId: string, agentId: string): void;
|
|
1061
|
+
private cleanup;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Quick-start helper: Var olan bir TaskGraph'tan AutoPhaseRunner oluştur.
|
|
1065
|
+
*/
|
|
1066
|
+
declare function createAutoPhaseFromTaskGraph(taskGraph: TaskGraph, options: Omit<AutoPhaseRunnerOptions, 'phases' | 'title'> & {
|
|
1067
|
+
title?: string;
|
|
1068
|
+
tasksPerPhase?: number;
|
|
1069
|
+
}): Promise<AutoPhaseRunner>;
|
|
1070
|
+
|
|
1071
|
+
interface PhaseOrchestratorOptions extends AutoPhaseOptions {
|
|
1072
|
+
graph: PhaseGraph;
|
|
1073
|
+
ctx: PhaseExecutionContext;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* PhaseOrchestrator — Fazları dependency-aware, otonom olarak çalıştıran motor.
|
|
1077
|
+
*
|
|
1078
|
+
* Özellikler:
|
|
1079
|
+
* - Bir faz tamamlandıkça sonrakini otomatik başlatır (autonomous mode)
|
|
1080
|
+
* - Parallel faz desteği (parallelizable=true)
|
|
1081
|
+
* - Agent atama / serbest bırakma
|
|
1082
|
+
* - Event bus entegrasyonu
|
|
1083
|
+
* - Pause / resume desteği
|
|
1084
|
+
*/
|
|
1085
|
+
declare class PhaseOrchestrator {
|
|
1086
|
+
private graph;
|
|
1087
|
+
private ctx;
|
|
1088
|
+
private opts;
|
|
1089
|
+
private events;
|
|
1090
|
+
private stopped;
|
|
1091
|
+
private paused;
|
|
1092
|
+
private runningPhases;
|
|
1093
|
+
private tickInterval;
|
|
1094
|
+
private trackerCache;
|
|
1095
|
+
private taskRetryCounts;
|
|
1096
|
+
constructor(opts: PhaseOrchestratorOptions);
|
|
1097
|
+
/**
|
|
1098
|
+
* Tüm faz akışını başlat.
|
|
1099
|
+
* Autonomous mode'da: kök faz(lar)ı başlatır, bitince sonrakini otomatik başlatır.
|
|
1100
|
+
*/
|
|
1101
|
+
start(): Promise<void>;
|
|
1102
|
+
/** Duraklat — aktif fazlar çalışmaya devam eder ama yeni faz başlamaz */
|
|
1103
|
+
pause(): void;
|
|
1104
|
+
/** Devam et — yeni fazlar başlayabilir */
|
|
1105
|
+
resume(): void;
|
|
1106
|
+
/** Tamamen durdur — aktif fazlar da durdurulur */
|
|
1107
|
+
stop(): void;
|
|
1108
|
+
private tick;
|
|
1109
|
+
private startPhase;
|
|
1110
|
+
private executePhaseTasks;
|
|
1111
|
+
private executeSingleTask;
|
|
1112
|
+
private markTaskCompleted;
|
|
1113
|
+
private markTaskFailed;
|
|
1114
|
+
private getReadyPhases;
|
|
1115
|
+
private getActivePhases;
|
|
1116
|
+
private getExecutableTasks;
|
|
1117
|
+
private getTrackerForPhase;
|
|
1118
|
+
private getFailedTaskCount;
|
|
1119
|
+
private getCompletedTaskCount;
|
|
1120
|
+
private updatePhaseStatus;
|
|
1121
|
+
private isComplete;
|
|
1122
|
+
private onGraphComplete;
|
|
1123
|
+
private onGraphFailed;
|
|
1124
|
+
getProgress(): PhaseProgress;
|
|
1125
|
+
getGraph(): PhaseGraph;
|
|
1126
|
+
isRunning(): boolean;
|
|
1127
|
+
isPaused(): boolean;
|
|
1128
|
+
assignAgent(phaseId: string, agentId: string): void;
|
|
1129
|
+
releaseAgent(phaseId: string, agentId: string): void;
|
|
1130
|
+
private emit;
|
|
1131
|
+
private createNoopEventBus;
|
|
1132
|
+
private delay;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
interface PhaseGraphBuilderOptions {
|
|
1136
|
+
title: string;
|
|
1137
|
+
description?: string;
|
|
1138
|
+
/** Faz şablonları (sıralı) */
|
|
1139
|
+
phases: PhaseTemplate[];
|
|
1140
|
+
/** Otonom mod */
|
|
1141
|
+
autonomous?: boolean;
|
|
1142
|
+
/** Başarısızlıkta dur */
|
|
1143
|
+
stopOnFailure?: boolean;
|
|
1144
|
+
/** Harici TaskStore (opsiyonel) */
|
|
1145
|
+
externalTaskStore?: TaskStore;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* PhaseGraphBuilder — Projeyi fazlara bölen ve her faz için task graph oluşturan builder.
|
|
1149
|
+
*
|
|
1150
|
+
* Kullanım:
|
|
1151
|
+
* const builder = new PhaseGraphBuilder({
|
|
1152
|
+
* title: 'Auth System Refactor',
|
|
1153
|
+
* phases: [
|
|
1154
|
+
* { name: 'Discovery', description: '...', priority: 'high', estimateHours: 2, parallelizable: false },
|
|
1155
|
+
* { name: 'Design', description: '...', priority: 'critical', estimateHours: 4, parallelizable: false },
|
|
1156
|
+
* { name: 'Implementation', description: '...', priority: 'critical', estimateHours: 12, parallelizable: false },
|
|
1157
|
+
* { name: 'Testing', description: '...', priority: 'high', estimateHours: 6, parallelizable: true },
|
|
1158
|
+
* { name: 'Deployment', description: '...', priority: 'medium', estimateHours: 2, parallelizable: false },
|
|
1159
|
+
* ]
|
|
1160
|
+
* });
|
|
1161
|
+
* const graph = await builder.build();
|
|
1162
|
+
*/
|
|
1163
|
+
declare class PhaseGraphBuilder {
|
|
1164
|
+
private readonly opts;
|
|
1165
|
+
constructor(opts: PhaseGraphBuilderOptions);
|
|
1166
|
+
build(): Promise<PhaseGraph>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Var olan bir TaskGraph'tan fazlar oluştur.
|
|
1169
|
+
* Task'ları priority/type göre gruplayarak fazlara ayırır.
|
|
1170
|
+
*/
|
|
1171
|
+
static fromTaskGraph(taskGraph: TaskGraph, options: Omit<PhaseGraphBuilderOptions, 'phases'> & {
|
|
1172
|
+
/** Faz başına düşen task sayısı (default: 5) */
|
|
1173
|
+
tasksPerPhase?: number;
|
|
1174
|
+
}): Promise<PhaseGraph>;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* AutoPhasePlanner — Bir hedefi (goal) gerçek bir LLM çağrısıyla faz faz,
|
|
1179
|
+
* her fazın altında bir sürü todo içeren büyük bir task listesine dönüştürür.
|
|
1180
|
+
*
|
|
1181
|
+
* SDD'nin spec→task akışına benzer ama farklı: burada çıktı doğrudan
|
|
1182
|
+
* `PhaseTemplate[]` — her faz `taskTemplates` taşır, böylece
|
|
1183
|
+
* `PhaseGraphBuilder` dolu bir `PhaseGraph` üretir ve `PhaseOrchestrator`
|
|
1184
|
+
* her görevi gerçek bir agent koşusuyla çalıştırır.
|
|
1185
|
+
*
|
|
1186
|
+
* Planner LLM'e bağımlı değildir: çağıran taraf bir `runOnce(prompt)` fonksiyonu
|
|
1187
|
+
* verir (CLI'de bu bir subagent koşusudur, testte bir stub olabilir).
|
|
1188
|
+
*/
|
|
1189
|
+
|
|
1190
|
+
interface AutoPhasePlannerOptions {
|
|
1191
|
+
/**
|
|
1192
|
+
* Tek seferlik LLM çağrısı: prompt verir, modelin metin çıktısını döndürür.
|
|
1193
|
+
* CLI'de bir subagent.run sarmalayıcısıdır; testte deterministik stub.
|
|
1194
|
+
*/
|
|
1195
|
+
runOnce: (prompt: string) => Promise<string>;
|
|
1196
|
+
/** Hedef/proje başlığı. */
|
|
1197
|
+
goal: string;
|
|
1198
|
+
/** package.json/dizin yapısı gibi opsiyonel proje bağlamı. */
|
|
1199
|
+
projectContext?: string;
|
|
1200
|
+
/** İstenen minimum faz sayısı (default 3). */
|
|
1201
|
+
minPhases?: number;
|
|
1202
|
+
/** İstenen maksimum faz sayısı (default 8). */
|
|
1203
|
+
maxPhases?: number;
|
|
1204
|
+
/** Faz başına hedeflenen todo sayısı (default 6). */
|
|
1205
|
+
todosPerPhase?: number;
|
|
1206
|
+
}
|
|
1207
|
+
interface AutoPhasePlanResult {
|
|
1208
|
+
/** PhaseGraphBuilder'a verilecek faz şablonları. */
|
|
1209
|
+
phases: PhaseTemplate[];
|
|
1210
|
+
/** Modelin ham çıktısı (debug/log için). */
|
|
1211
|
+
raw: string;
|
|
1212
|
+
/** JSON ayrıştırılamadıysa true; bu durumda `phases` boş döner. */
|
|
1213
|
+
parseFailed: boolean;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* AutoPhasePlanner — `plan()` çağrısı modeli sürer ve `PhaseTemplate[]` üretir.
|
|
1217
|
+
*/
|
|
1218
|
+
declare class AutoPhasePlanner {
|
|
1219
|
+
private readonly opts;
|
|
1220
|
+
constructor(opts: AutoPhasePlannerOptions);
|
|
1221
|
+
/** Hedefi faz+todo planına dönüştür. */
|
|
1222
|
+
plan(): Promise<AutoPhasePlanResult>;
|
|
1223
|
+
/** Modelin üreteceği plan için talimat prompt'u. */
|
|
1224
|
+
buildPrompt(): string;
|
|
1225
|
+
/** Ham çıktıdan JSON'u çıkar, doğrula ve PhaseTemplate[]'e dönüştür. */
|
|
1226
|
+
parse(raw: string): PhaseTemplate[];
|
|
1227
|
+
private coercePhase;
|
|
1228
|
+
private coerceTask;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
interface PhaseStoreOptions {
|
|
1232
|
+
baseDir: string;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* PhaseStore — PhaseGraph'ı diske kaydeden ve yükleyen persistence katmanı.
|
|
1236
|
+
*/
|
|
1237
|
+
declare class PhaseStore {
|
|
1238
|
+
readonly baseDir: string;
|
|
1239
|
+
constructor(opts: PhaseStoreOptions);
|
|
1240
|
+
save(graph: PhaseGraph): Promise<void>;
|
|
1241
|
+
load(graphId: string): Promise<PhaseGraph | null>;
|
|
1242
|
+
delete(graphId: string): Promise<void>;
|
|
1243
|
+
list(): Promise<Array<{
|
|
1244
|
+
id: string;
|
|
1245
|
+
title: string;
|
|
1246
|
+
updatedAt: number;
|
|
1247
|
+
status: string;
|
|
1248
|
+
}>>;
|
|
1249
|
+
private getFilePath;
|
|
1250
|
+
private serializeGraph;
|
|
1251
|
+
private serializePhase;
|
|
1252
|
+
private serializeTaskGraph;
|
|
1253
|
+
private serializeTaskNode;
|
|
1254
|
+
private deserializeGraph;
|
|
1255
|
+
private deserializePhase;
|
|
1256
|
+
private deserializeTaskGraph;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
interface Checkpoint {
|
|
1260
|
+
id: string;
|
|
1261
|
+
graphId: string;
|
|
1262
|
+
phaseId: string;
|
|
1263
|
+
phaseStatus: PhaseNode['status'];
|
|
1264
|
+
taskStatuses: Array<{
|
|
1265
|
+
taskId: string;
|
|
1266
|
+
status: string;
|
|
1267
|
+
title: string;
|
|
1268
|
+
}>;
|
|
1269
|
+
timestamp: number;
|
|
1270
|
+
label?: string;
|
|
1271
|
+
}
|
|
1272
|
+
interface CheckpointManagerOptions {
|
|
1273
|
+
store: PhaseStore;
|
|
1274
|
+
maxCheckpoints?: number;
|
|
1275
|
+
baseDir?: string;
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* CheckpointManager — Phase graph'ın anlık görüntülerini alır ve geri yükler.
|
|
1279
|
+
*
|
|
1280
|
+
* Kullanım:
|
|
1281
|
+
* const cm = new CheckpointManager({ store });
|
|
1282
|
+
* await cm.saveCheckpoint(graph, 'Before risky refactor');
|
|
1283
|
+
* // ... işler ters giderse ...
|
|
1284
|
+
* const restored = await cm.restoreCheckpoint(checkpointId);
|
|
1285
|
+
*/
|
|
1286
|
+
declare class CheckpointManager {
|
|
1287
|
+
private store;
|
|
1288
|
+
private maxCheckpoints;
|
|
1289
|
+
private checkpoints;
|
|
1290
|
+
private baseDir;
|
|
1291
|
+
constructor(opts: CheckpointManagerOptions);
|
|
1292
|
+
initialize(): Promise<void>;
|
|
1293
|
+
saveCheckpoint(graph: PhaseGraph, label?: string): Promise<Checkpoint>;
|
|
1294
|
+
restoreCheckpoint(checkpointId: string): Promise<PhaseGraph | null>;
|
|
1295
|
+
listCheckpoints(graphId?: string): Checkpoint[];
|
|
1296
|
+
deleteCheckpoint(checkpointId: string): Promise<boolean>;
|
|
1297
|
+
private saveToDisk;
|
|
1298
|
+
private deleteFromDisk;
|
|
1299
|
+
private loadFromDisk;
|
|
1300
|
+
private pruneCheckpoints;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
export { AddAttachmentInput, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, BuildContext, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, Config, Container, ContentBlock, Context, type ContinueDirective, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, type MCPRegistryHandle, MCPRegistryView, MCPServerConfig, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, type PackageManager, type PhaseEventMap, type PhaseEventName, type PhaseExecutionContext, type PhaseFilter, type PhaseGraph, PhaseGraphBuilder, type PhaseGraphBuilderOptions, type PhaseNode, PhaseOrchestrator, type PhaseOrchestratorOptions, type PhaseProgress, type PhaseSort, type PhaseStatus, PhaseStore, type PhaseStoreOptions, type PhaseTemplate, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ReportGenerator, type ReportOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TaskGraph, TaskNode, TaskPriority, TaskStore, TaskType, type TechStack, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolRegistry, ToolRegistryView, buildBtwBlock, consumeBtwNotes, createAutoPhaseFromTaskGraph, createMcpControlTool, createSecuritySlashCommand, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, loadPlugins, makeContinueToNextIterationTool, parseContinueDirective, pendingBtwCount, securitySlashCommand, setBtwNote, unloadPlugins };
|