@nick848/sf-cli 1.0.0 → 1.0.2
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/README.md +61 -0
- package/dist/cli/index.js +398 -166
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.mts +254 -245
- package/dist/index.d.ts +254 -245
- package/dist/index.js +215 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +287 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1375,9 +1375,258 @@ interface REPLState {
|
|
|
1375
1375
|
contextLimit: number;
|
|
1376
1376
|
}
|
|
1377
1377
|
|
|
1378
|
+
/**
|
|
1379
|
+
* 工作流确认点系统
|
|
1380
|
+
* 在关键节点要求开发者确认才能继续
|
|
1381
|
+
*/
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* 确认点类型
|
|
1385
|
+
*/
|
|
1386
|
+
type ConfirmationPointType = 'spec-review' | 'architecture' | 'code-review';
|
|
1387
|
+
/**
|
|
1388
|
+
* 确认点定义
|
|
1389
|
+
*/
|
|
1390
|
+
interface ConfirmationPoint {
|
|
1391
|
+
type: ConfirmationPointType;
|
|
1392
|
+
name: string;
|
|
1393
|
+
description: string;
|
|
1394
|
+
triggerStep: WorkflowStep;
|
|
1395
|
+
targetStep: WorkflowStep;
|
|
1396
|
+
required: boolean;
|
|
1397
|
+
timeout?: number;
|
|
1398
|
+
}
|
|
1399
|
+
/**
|
|
1400
|
+
* 确认状态
|
|
1401
|
+
*/
|
|
1402
|
+
interface ConfirmationStatus {
|
|
1403
|
+
type: ConfirmationPointType;
|
|
1404
|
+
confirmed: boolean;
|
|
1405
|
+
confirmedAt?: Date;
|
|
1406
|
+
confirmedBy?: string;
|
|
1407
|
+
comment?: string;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* 回滚规则
|
|
1411
|
+
* 定义从哪些阶段可以回滚到哪些阶段
|
|
1412
|
+
*
|
|
1413
|
+
* 复杂流程: explore → new → continue → apply → archive
|
|
1414
|
+
* 简单流程: propose → apply → archive
|
|
1415
|
+
*/
|
|
1416
|
+
declare const ROLLBACK_RULES: Record<WorkflowStep, WorkflowStep[]>;
|
|
1417
|
+
/**
|
|
1418
|
+
* 回滚原因类型
|
|
1419
|
+
*/
|
|
1420
|
+
type RollbackReason = 'code-review-failed' | 'requirement-changed' | 'design-issue' | 'user-request';
|
|
1421
|
+
/**
|
|
1422
|
+
* 回滚请求
|
|
1423
|
+
*/
|
|
1424
|
+
interface RollbackRequest {
|
|
1425
|
+
fromStep: WorkflowStep;
|
|
1426
|
+
toStep: WorkflowStep;
|
|
1427
|
+
reason: RollbackReason;
|
|
1428
|
+
description: string;
|
|
1429
|
+
timestamp: Date;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* 确认点管理器
|
|
1433
|
+
*/
|
|
1434
|
+
declare class ConfirmationManager {
|
|
1435
|
+
private confirmationPoints;
|
|
1436
|
+
private confirmations;
|
|
1437
|
+
constructor(customPoints?: ConfirmationPoint[]);
|
|
1438
|
+
/**
|
|
1439
|
+
* 获取指定阶段的确认点
|
|
1440
|
+
*/
|
|
1441
|
+
getConfirmationPointForTransition(from: WorkflowStep, to: WorkflowStep): ConfirmationPoint | undefined;
|
|
1442
|
+
/**
|
|
1443
|
+
* 检查是否需要确认
|
|
1444
|
+
*/
|
|
1445
|
+
needsConfirmation(from: WorkflowStep, to: WorkflowStep): boolean;
|
|
1446
|
+
/**
|
|
1447
|
+
* 获取确认点详情
|
|
1448
|
+
*/
|
|
1449
|
+
getConfirmationPoint(type: ConfirmationPointType): ConfirmationPoint | undefined;
|
|
1450
|
+
/**
|
|
1451
|
+
* 记录确认
|
|
1452
|
+
*/
|
|
1453
|
+
confirm(type: ConfirmationPointType, comment?: string): ConfirmationStatus;
|
|
1454
|
+
/**
|
|
1455
|
+
* 获取确认状态
|
|
1456
|
+
*/
|
|
1457
|
+
getConfirmationStatus(type: ConfirmationPointType): ConfirmationStatus | undefined;
|
|
1458
|
+
/**
|
|
1459
|
+
* 检查确认点是否已确认
|
|
1460
|
+
*/
|
|
1461
|
+
isConfirmed(type: ConfirmationPointType): boolean;
|
|
1462
|
+
/**
|
|
1463
|
+
* 清除确认状态(用于回滚后)
|
|
1464
|
+
*/
|
|
1465
|
+
clearConfirmation(type: ConfirmationPointType): void;
|
|
1466
|
+
/**
|
|
1467
|
+
* 清除所有确认状态
|
|
1468
|
+
*/
|
|
1469
|
+
clearAllConfirmations(): void;
|
|
1470
|
+
/**
|
|
1471
|
+
* 获取所有确认点
|
|
1472
|
+
*/
|
|
1473
|
+
getAllConfirmationPoints(): ConfirmationPoint[];
|
|
1474
|
+
/**
|
|
1475
|
+
* 获取指定阶段需要清除的确认点
|
|
1476
|
+
*/
|
|
1477
|
+
getConfirmationsToClear(targetStep: WorkflowStep): ConfirmationPointType[];
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* 生成确认提示消息
|
|
1481
|
+
*/
|
|
1482
|
+
declare function generateConfirmationPrompt(point: ConfirmationPoint): string;
|
|
1483
|
+
/**
|
|
1484
|
+
* 生成回滚选项提示
|
|
1485
|
+
*/
|
|
1486
|
+
declare function generateRollbackPrompt(fromStep: WorkflowStep): string;
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* OpenSpec 工作流引擎
|
|
1490
|
+
* 管理工作流状态、状态转换、确认点、回滚
|
|
1491
|
+
*/
|
|
1492
|
+
|
|
1493
|
+
interface WorkflowSnapshot {
|
|
1494
|
+
step: WorkflowStep;
|
|
1495
|
+
timestamp: Date;
|
|
1496
|
+
state: WorkflowState;
|
|
1497
|
+
artifacts: string[];
|
|
1498
|
+
}
|
|
1499
|
+
interface RollbackResult {
|
|
1500
|
+
success: boolean;
|
|
1501
|
+
from: WorkflowStep;
|
|
1502
|
+
to: WorkflowStep | null;
|
|
1503
|
+
message: string;
|
|
1504
|
+
snapshot?: WorkflowSnapshot;
|
|
1505
|
+
}
|
|
1506
|
+
interface ConfirmationResult {
|
|
1507
|
+
required: boolean;
|
|
1508
|
+
confirmed: boolean;
|
|
1509
|
+
point?: ConfirmationPoint;
|
|
1510
|
+
}
|
|
1511
|
+
declare class WorkflowEngine {
|
|
1512
|
+
private state;
|
|
1513
|
+
private projectPath;
|
|
1514
|
+
private openspecPath;
|
|
1515
|
+
private confirmationManager;
|
|
1516
|
+
private snapshots;
|
|
1517
|
+
private projectContext;
|
|
1518
|
+
private projectConfig;
|
|
1519
|
+
private devStandards;
|
|
1520
|
+
constructor();
|
|
1521
|
+
/**
|
|
1522
|
+
* 初始化工作流引擎
|
|
1523
|
+
*/
|
|
1524
|
+
initialize(projectPath: string): Promise<void>;
|
|
1525
|
+
/**
|
|
1526
|
+
* 加载项目上下文(AGENTS.md 和 config.yaml)
|
|
1527
|
+
*/
|
|
1528
|
+
private loadProjectContext;
|
|
1529
|
+
/**
|
|
1530
|
+
* 获取项目上下文
|
|
1531
|
+
*/
|
|
1532
|
+
getProjectContext(): {
|
|
1533
|
+
agentsMd: string;
|
|
1534
|
+
configYaml: string;
|
|
1535
|
+
devStandards: string;
|
|
1536
|
+
};
|
|
1537
|
+
/**
|
|
1538
|
+
* 启动新工作流
|
|
1539
|
+
*/
|
|
1540
|
+
start(requirement: string, complexity: number, options?: {
|
|
1541
|
+
title?: string;
|
|
1542
|
+
}): Promise<WorkflowState>;
|
|
1543
|
+
/**
|
|
1544
|
+
* 检查转换是否需要确认
|
|
1545
|
+
*/
|
|
1546
|
+
checkConfirmationNeeded(from: WorkflowStep, to: WorkflowStep): ConfirmationResult;
|
|
1547
|
+
/**
|
|
1548
|
+
* 确认检查点
|
|
1549
|
+
*/
|
|
1550
|
+
confirm(type: ConfirmationPointType, comment?: string): void;
|
|
1551
|
+
/**
|
|
1552
|
+
* 获取确认点信息
|
|
1553
|
+
*/
|
|
1554
|
+
getConfirmationPoint(type: ConfirmationPointType): ConfirmationPoint | undefined;
|
|
1555
|
+
/**
|
|
1556
|
+
* 获取当前转换需要的确认点
|
|
1557
|
+
*/
|
|
1558
|
+
getCurrentConfirmationPoint(): ConfirmationPoint | undefined;
|
|
1559
|
+
/**
|
|
1560
|
+
* 执行状态转换
|
|
1561
|
+
*/
|
|
1562
|
+
transition(targetStep: WorkflowStep, reason?: string): Promise<WorkflowTransition>;
|
|
1563
|
+
/**
|
|
1564
|
+
* 获取可回滚的目标阶段
|
|
1565
|
+
*/
|
|
1566
|
+
getRollbackTargets(): WorkflowStep[];
|
|
1567
|
+
/**
|
|
1568
|
+
* 检查是否可以回滚到指定阶段
|
|
1569
|
+
*/
|
|
1570
|
+
canRollbackTo(targetStep: WorkflowStep): boolean;
|
|
1571
|
+
/**
|
|
1572
|
+
* 执行回滚
|
|
1573
|
+
*/
|
|
1574
|
+
rollback(targetStep: WorkflowStep, reason: RollbackReason, description?: string): Promise<RollbackResult>;
|
|
1575
|
+
/**
|
|
1576
|
+
* 获取回滚原因描述
|
|
1577
|
+
*/
|
|
1578
|
+
getRollbackReasonDescription(reason: RollbackReason): string;
|
|
1579
|
+
/**
|
|
1580
|
+
* 获取当前状态
|
|
1581
|
+
*/
|
|
1582
|
+
getState(): WorkflowState | null;
|
|
1583
|
+
/**
|
|
1584
|
+
* 获取允许的下一步
|
|
1585
|
+
*/
|
|
1586
|
+
getAllowedTransitions(): WorkflowStep[];
|
|
1587
|
+
/**
|
|
1588
|
+
* 获取快照历史
|
|
1589
|
+
*/
|
|
1590
|
+
getSnapshots(): WorkflowSnapshot[];
|
|
1591
|
+
/**
|
|
1592
|
+
* 完成当前步骤
|
|
1593
|
+
*/
|
|
1594
|
+
completeCurrentStep(artifacts?: string[]): Promise<void>;
|
|
1595
|
+
/**
|
|
1596
|
+
* 归档工作流
|
|
1597
|
+
*/
|
|
1598
|
+
archive(summary: string): Promise<void>;
|
|
1599
|
+
/**
|
|
1600
|
+
* 取消工作流
|
|
1601
|
+
*/
|
|
1602
|
+
cancel(reason: string): Promise<void>;
|
|
1603
|
+
private ensureDirectories;
|
|
1604
|
+
private restoreState;
|
|
1605
|
+
private saveState;
|
|
1606
|
+
private restoreSnapshots;
|
|
1607
|
+
private saveSnapshots;
|
|
1608
|
+
private createSnapshot;
|
|
1609
|
+
private generateChangeId;
|
|
1610
|
+
private createChangeRecord;
|
|
1611
|
+
private updateChangeRecord;
|
|
1612
|
+
private formatChangeRecord;
|
|
1613
|
+
private createSpecDocument;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* 确认点需要确认错误
|
|
1617
|
+
*/
|
|
1618
|
+
declare class ConfirmationRequiredError extends Error {
|
|
1619
|
+
readonly point: ConfirmationPoint;
|
|
1620
|
+
constructor(message: string, point: ConfirmationPoint);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1378
1623
|
/**
|
|
1379
1624
|
* 命令执行器
|
|
1380
1625
|
* 执行解析后的命令
|
|
1626
|
+
*
|
|
1627
|
+
* 强制工作流机制:
|
|
1628
|
+
* - 没有活跃工作流时,只允许基础命令(/help, /init, /model, /new, /exit, /clear, /update, /version)
|
|
1629
|
+
* - 有活跃工作流时,根据当前阶段限制操作
|
|
1381
1630
|
*/
|
|
1382
1631
|
|
|
1383
1632
|
interface ExecutorContext {
|
|
@@ -1385,6 +1634,7 @@ interface ExecutorContext {
|
|
|
1385
1634
|
configManager: ConfigManager;
|
|
1386
1635
|
modelService: ModelService;
|
|
1387
1636
|
normsManager?: NormsManager;
|
|
1637
|
+
workflowEngine?: WorkflowEngine;
|
|
1388
1638
|
state: REPLState;
|
|
1389
1639
|
options: {
|
|
1390
1640
|
workingDirectory: string;
|
|
@@ -1399,6 +1649,10 @@ interface ExecutionResult {
|
|
|
1399
1649
|
}
|
|
1400
1650
|
declare class CommandExecutor {
|
|
1401
1651
|
execute(parseResult: ParseResult, ctx: ExecutorContext): Promise<ExecutionResult>;
|
|
1652
|
+
/**
|
|
1653
|
+
* 检查工作流权限
|
|
1654
|
+
*/
|
|
1655
|
+
private checkWorkflowPermission;
|
|
1402
1656
|
private executeSlashCommand;
|
|
1403
1657
|
private executeFileReference;
|
|
1404
1658
|
private executeAgent;
|
|
@@ -1644,251 +1898,6 @@ declare function createAgentScheduler(executor: AgentExecutor): AgentScheduler;
|
|
|
1644
1898
|
*/
|
|
1645
1899
|
declare function getScheduleRuleDescription(step: WorkflowStep): string;
|
|
1646
1900
|
|
|
1647
|
-
/**
|
|
1648
|
-
* 工作流确认点系统
|
|
1649
|
-
* 在关键节点要求开发者确认才能继续
|
|
1650
|
-
*/
|
|
1651
|
-
|
|
1652
|
-
/**
|
|
1653
|
-
* 确认点类型
|
|
1654
|
-
*/
|
|
1655
|
-
type ConfirmationPointType = 'spec-review' | 'architecture' | 'code-review';
|
|
1656
|
-
/**
|
|
1657
|
-
* 确认点定义
|
|
1658
|
-
*/
|
|
1659
|
-
interface ConfirmationPoint {
|
|
1660
|
-
type: ConfirmationPointType;
|
|
1661
|
-
name: string;
|
|
1662
|
-
description: string;
|
|
1663
|
-
triggerStep: WorkflowStep;
|
|
1664
|
-
targetStep: WorkflowStep;
|
|
1665
|
-
required: boolean;
|
|
1666
|
-
timeout?: number;
|
|
1667
|
-
}
|
|
1668
|
-
/**
|
|
1669
|
-
* 确认状态
|
|
1670
|
-
*/
|
|
1671
|
-
interface ConfirmationStatus {
|
|
1672
|
-
type: ConfirmationPointType;
|
|
1673
|
-
confirmed: boolean;
|
|
1674
|
-
confirmedAt?: Date;
|
|
1675
|
-
confirmedBy?: string;
|
|
1676
|
-
comment?: string;
|
|
1677
|
-
}
|
|
1678
|
-
/**
|
|
1679
|
-
* 回滚规则
|
|
1680
|
-
* 定义从哪些阶段可以回滚到哪些阶段
|
|
1681
|
-
*
|
|
1682
|
-
* 复杂流程: explore → new → continue → apply → archive
|
|
1683
|
-
* 简单流程: propose → apply → archive
|
|
1684
|
-
*/
|
|
1685
|
-
declare const ROLLBACK_RULES: Record<WorkflowStep, WorkflowStep[]>;
|
|
1686
|
-
/**
|
|
1687
|
-
* 回滚原因类型
|
|
1688
|
-
*/
|
|
1689
|
-
type RollbackReason = 'code-review-failed' | 'requirement-changed' | 'design-issue' | 'user-request';
|
|
1690
|
-
/**
|
|
1691
|
-
* 回滚请求
|
|
1692
|
-
*/
|
|
1693
|
-
interface RollbackRequest {
|
|
1694
|
-
fromStep: WorkflowStep;
|
|
1695
|
-
toStep: WorkflowStep;
|
|
1696
|
-
reason: RollbackReason;
|
|
1697
|
-
description: string;
|
|
1698
|
-
timestamp: Date;
|
|
1699
|
-
}
|
|
1700
|
-
/**
|
|
1701
|
-
* 确认点管理器
|
|
1702
|
-
*/
|
|
1703
|
-
declare class ConfirmationManager {
|
|
1704
|
-
private confirmationPoints;
|
|
1705
|
-
private confirmations;
|
|
1706
|
-
constructor(customPoints?: ConfirmationPoint[]);
|
|
1707
|
-
/**
|
|
1708
|
-
* 获取指定阶段的确认点
|
|
1709
|
-
*/
|
|
1710
|
-
getConfirmationPointForTransition(from: WorkflowStep, to: WorkflowStep): ConfirmationPoint | undefined;
|
|
1711
|
-
/**
|
|
1712
|
-
* 检查是否需要确认
|
|
1713
|
-
*/
|
|
1714
|
-
needsConfirmation(from: WorkflowStep, to: WorkflowStep): boolean;
|
|
1715
|
-
/**
|
|
1716
|
-
* 获取确认点详情
|
|
1717
|
-
*/
|
|
1718
|
-
getConfirmationPoint(type: ConfirmationPointType): ConfirmationPoint | undefined;
|
|
1719
|
-
/**
|
|
1720
|
-
* 记录确认
|
|
1721
|
-
*/
|
|
1722
|
-
confirm(type: ConfirmationPointType, comment?: string): ConfirmationStatus;
|
|
1723
|
-
/**
|
|
1724
|
-
* 获取确认状态
|
|
1725
|
-
*/
|
|
1726
|
-
getConfirmationStatus(type: ConfirmationPointType): ConfirmationStatus | undefined;
|
|
1727
|
-
/**
|
|
1728
|
-
* 检查确认点是否已确认
|
|
1729
|
-
*/
|
|
1730
|
-
isConfirmed(type: ConfirmationPointType): boolean;
|
|
1731
|
-
/**
|
|
1732
|
-
* 清除确认状态(用于回滚后)
|
|
1733
|
-
*/
|
|
1734
|
-
clearConfirmation(type: ConfirmationPointType): void;
|
|
1735
|
-
/**
|
|
1736
|
-
* 清除所有确认状态
|
|
1737
|
-
*/
|
|
1738
|
-
clearAllConfirmations(): void;
|
|
1739
|
-
/**
|
|
1740
|
-
* 获取所有确认点
|
|
1741
|
-
*/
|
|
1742
|
-
getAllConfirmationPoints(): ConfirmationPoint[];
|
|
1743
|
-
/**
|
|
1744
|
-
* 获取指定阶段需要清除的确认点
|
|
1745
|
-
*/
|
|
1746
|
-
getConfirmationsToClear(targetStep: WorkflowStep): ConfirmationPointType[];
|
|
1747
|
-
}
|
|
1748
|
-
/**
|
|
1749
|
-
* 生成确认提示消息
|
|
1750
|
-
*/
|
|
1751
|
-
declare function generateConfirmationPrompt(point: ConfirmationPoint): string;
|
|
1752
|
-
/**
|
|
1753
|
-
* 生成回滚选项提示
|
|
1754
|
-
*/
|
|
1755
|
-
declare function generateRollbackPrompt(fromStep: WorkflowStep): string;
|
|
1756
|
-
|
|
1757
|
-
/**
|
|
1758
|
-
* OpenSpec 工作流引擎
|
|
1759
|
-
* 管理工作流状态、状态转换、确认点、回滚
|
|
1760
|
-
*/
|
|
1761
|
-
|
|
1762
|
-
interface WorkflowSnapshot {
|
|
1763
|
-
step: WorkflowStep;
|
|
1764
|
-
timestamp: Date;
|
|
1765
|
-
state: WorkflowState;
|
|
1766
|
-
artifacts: string[];
|
|
1767
|
-
}
|
|
1768
|
-
interface RollbackResult {
|
|
1769
|
-
success: boolean;
|
|
1770
|
-
from: WorkflowStep;
|
|
1771
|
-
to: WorkflowStep | null;
|
|
1772
|
-
message: string;
|
|
1773
|
-
snapshot?: WorkflowSnapshot;
|
|
1774
|
-
}
|
|
1775
|
-
interface ConfirmationResult {
|
|
1776
|
-
required: boolean;
|
|
1777
|
-
confirmed: boolean;
|
|
1778
|
-
point?: ConfirmationPoint;
|
|
1779
|
-
}
|
|
1780
|
-
declare class WorkflowEngine {
|
|
1781
|
-
private state;
|
|
1782
|
-
private projectPath;
|
|
1783
|
-
private openspecPath;
|
|
1784
|
-
private confirmationManager;
|
|
1785
|
-
private snapshots;
|
|
1786
|
-
private projectContext;
|
|
1787
|
-
private projectConfig;
|
|
1788
|
-
private devStandards;
|
|
1789
|
-
constructor();
|
|
1790
|
-
/**
|
|
1791
|
-
* 初始化工作流引擎
|
|
1792
|
-
*/
|
|
1793
|
-
initialize(projectPath: string): Promise<void>;
|
|
1794
|
-
/**
|
|
1795
|
-
* 加载项目上下文(AGENTS.md 和 config.yaml)
|
|
1796
|
-
*/
|
|
1797
|
-
private loadProjectContext;
|
|
1798
|
-
/**
|
|
1799
|
-
* 获取项目上下文
|
|
1800
|
-
*/
|
|
1801
|
-
getProjectContext(): {
|
|
1802
|
-
agentsMd: string;
|
|
1803
|
-
configYaml: string;
|
|
1804
|
-
devStandards: string;
|
|
1805
|
-
};
|
|
1806
|
-
/**
|
|
1807
|
-
* 启动新工作流
|
|
1808
|
-
*/
|
|
1809
|
-
start(requirement: string, complexity: number, options?: {
|
|
1810
|
-
title?: string;
|
|
1811
|
-
}): Promise<WorkflowState>;
|
|
1812
|
-
/**
|
|
1813
|
-
* 检查转换是否需要确认
|
|
1814
|
-
*/
|
|
1815
|
-
checkConfirmationNeeded(from: WorkflowStep, to: WorkflowStep): ConfirmationResult;
|
|
1816
|
-
/**
|
|
1817
|
-
* 确认检查点
|
|
1818
|
-
*/
|
|
1819
|
-
confirm(type: ConfirmationPointType, comment?: string): void;
|
|
1820
|
-
/**
|
|
1821
|
-
* 获取确认点信息
|
|
1822
|
-
*/
|
|
1823
|
-
getConfirmationPoint(type: ConfirmationPointType): ConfirmationPoint | undefined;
|
|
1824
|
-
/**
|
|
1825
|
-
* 获取当前转换需要的确认点
|
|
1826
|
-
*/
|
|
1827
|
-
getCurrentConfirmationPoint(): ConfirmationPoint | undefined;
|
|
1828
|
-
/**
|
|
1829
|
-
* 执行状态转换
|
|
1830
|
-
*/
|
|
1831
|
-
transition(targetStep: WorkflowStep, reason?: string): Promise<WorkflowTransition>;
|
|
1832
|
-
/**
|
|
1833
|
-
* 获取可回滚的目标阶段
|
|
1834
|
-
*/
|
|
1835
|
-
getRollbackTargets(): WorkflowStep[];
|
|
1836
|
-
/**
|
|
1837
|
-
* 检查是否可以回滚到指定阶段
|
|
1838
|
-
*/
|
|
1839
|
-
canRollbackTo(targetStep: WorkflowStep): boolean;
|
|
1840
|
-
/**
|
|
1841
|
-
* 执行回滚
|
|
1842
|
-
*/
|
|
1843
|
-
rollback(targetStep: WorkflowStep, reason: RollbackReason, description?: string): Promise<RollbackResult>;
|
|
1844
|
-
/**
|
|
1845
|
-
* 获取回滚原因描述
|
|
1846
|
-
*/
|
|
1847
|
-
getRollbackReasonDescription(reason: RollbackReason): string;
|
|
1848
|
-
/**
|
|
1849
|
-
* 获取当前状态
|
|
1850
|
-
*/
|
|
1851
|
-
getState(): WorkflowState | null;
|
|
1852
|
-
/**
|
|
1853
|
-
* 获取允许的下一步
|
|
1854
|
-
*/
|
|
1855
|
-
getAllowedTransitions(): WorkflowStep[];
|
|
1856
|
-
/**
|
|
1857
|
-
* 获取快照历史
|
|
1858
|
-
*/
|
|
1859
|
-
getSnapshots(): WorkflowSnapshot[];
|
|
1860
|
-
/**
|
|
1861
|
-
* 完成当前步骤
|
|
1862
|
-
*/
|
|
1863
|
-
completeCurrentStep(artifacts?: string[]): Promise<void>;
|
|
1864
|
-
/**
|
|
1865
|
-
* 归档工作流
|
|
1866
|
-
*/
|
|
1867
|
-
archive(summary: string): Promise<void>;
|
|
1868
|
-
/**
|
|
1869
|
-
* 取消工作流
|
|
1870
|
-
*/
|
|
1871
|
-
cancel(reason: string): Promise<void>;
|
|
1872
|
-
private ensureDirectories;
|
|
1873
|
-
private restoreState;
|
|
1874
|
-
private saveState;
|
|
1875
|
-
private restoreSnapshots;
|
|
1876
|
-
private saveSnapshots;
|
|
1877
|
-
private createSnapshot;
|
|
1878
|
-
private generateChangeId;
|
|
1879
|
-
private createChangeRecord;
|
|
1880
|
-
private updateChangeRecord;
|
|
1881
|
-
private formatChangeRecord;
|
|
1882
|
-
private createSpecDocument;
|
|
1883
|
-
}
|
|
1884
|
-
/**
|
|
1885
|
-
* 确认点需要确认错误
|
|
1886
|
-
*/
|
|
1887
|
-
declare class ConfirmationRequiredError extends Error {
|
|
1888
|
-
readonly point: ConfirmationPoint;
|
|
1889
|
-
constructor(message: string, point: ConfirmationPoint);
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
1901
|
/**
|
|
1893
1902
|
* 自动补全器
|
|
1894
1903
|
* 提供命令、文件路径、历史记录的自动补全
|