@openspecui/core 0.9.0 → 1.0.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.mts +966 -54
- package/dist/index.mjs +897 -122
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -17,13 +17,13 @@ declare const ChangeFileSchema: z.ZodObject<{
|
|
|
17
17
|
/** Optional byte size for files */
|
|
18
18
|
size: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
path: string;
|
|
21
20
|
type: "file" | "directory";
|
|
21
|
+
path: string;
|
|
22
22
|
content?: string | undefined;
|
|
23
23
|
size?: number | undefined;
|
|
24
24
|
}, {
|
|
25
|
-
path: string;
|
|
26
25
|
type: "file" | "directory";
|
|
26
|
+
path: string;
|
|
27
27
|
content?: string | undefined;
|
|
28
28
|
size?: number | undefined;
|
|
29
29
|
}>;
|
|
@@ -1475,6 +1475,18 @@ declare class CliExecutor {
|
|
|
1475
1475
|
* 执行 openspec validate [type] [id]
|
|
1476
1476
|
*/
|
|
1477
1477
|
validate(type?: 'spec' | 'change', id?: string): Promise<CliResult>;
|
|
1478
|
+
/**
|
|
1479
|
+
* 执行 openspec schemas --json
|
|
1480
|
+
*/
|
|
1481
|
+
schemas(): Promise<CliResult>;
|
|
1482
|
+
/**
|
|
1483
|
+
* 执行 openspec schema which <name> --json
|
|
1484
|
+
*/
|
|
1485
|
+
schemaWhich(name: string): Promise<CliResult>;
|
|
1486
|
+
/**
|
|
1487
|
+
* 执行 openspec templates --json [--schema <name>]
|
|
1488
|
+
*/
|
|
1489
|
+
templates(schema?: string): Promise<CliResult>;
|
|
1478
1490
|
/**
|
|
1479
1491
|
* 流式执行 openspec validate
|
|
1480
1492
|
*/
|
|
@@ -1524,23 +1536,9 @@ declare class CliExecutor {
|
|
|
1524
1536
|
/**
|
|
1525
1537
|
* 工具配置检测模块
|
|
1526
1538
|
*
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1530
|
-
* 重要:使用响应式文件系统实现,监听配置目录,
|
|
1531
|
-
* 当配置文件变化时会自动触发更新。
|
|
1532
|
-
*
|
|
1533
|
-
* @see references/openspec/src/core/config.ts (AI_TOOLS)
|
|
1534
|
-
* @see references/openspec/src/core/configurators/slash/
|
|
1535
|
-
* @see references/openspec/src/core/init.ts (isToolConfigured)
|
|
1536
|
-
*/
|
|
1537
|
-
/**
|
|
1538
|
-
* 检测路径范围
|
|
1539
|
-
* - project: 相对于项目根目录
|
|
1540
|
-
* - global: 绝对路径(如 Codex 的 ~/.codex/prompts/)
|
|
1541
|
-
* - none: 无检测路径(如 Universal AGENTS.md 通过项目 AGENTS.md 检测)
|
|
1539
|
+
* 对齐 @fission-ai/openspec 的 skills 体系,
|
|
1540
|
+
* 通过 `skills/<skill>/SKILL.md` 判断工具是否已配置。
|
|
1542
1541
|
*/
|
|
1543
|
-
type DetectionScope = 'project' | 'global' | 'none';
|
|
1544
1542
|
/**
|
|
1545
1543
|
* AI 工具选项(与官方 OpenSpec CLI 完全一致)
|
|
1546
1544
|
* @see references/openspec/src/core/config.ts
|
|
@@ -1554,33 +1552,16 @@ interface AIToolOption {
|
|
|
1554
1552
|
available: boolean;
|
|
1555
1553
|
/** 成功消息中使用的标签 */
|
|
1556
1554
|
successLabel?: string;
|
|
1555
|
+
/** 技能目录(相对项目根目录) */
|
|
1556
|
+
skillsDir?: string;
|
|
1557
1557
|
}
|
|
1558
1558
|
/**
|
|
1559
|
-
*
|
|
1559
|
+
* 完整的工具配置(元信息 + skills 目录)
|
|
1560
1560
|
*/
|
|
1561
|
-
interface
|
|
1562
|
-
/** 检测路径范围 */
|
|
1563
|
-
scope: DetectionScope;
|
|
1564
|
-
/**
|
|
1565
|
-
* 检测路径
|
|
1566
|
-
* - scope='project': 相对于项目根目录的路径
|
|
1567
|
-
* - scope='global': 返回绝对路径的函数
|
|
1568
|
-
* - scope='none': undefined
|
|
1569
|
-
*/
|
|
1570
|
-
detectionPath?: string | (() => string);
|
|
1571
|
-
}
|
|
1572
|
-
/**
|
|
1573
|
-
* 完整的工具配置(元信息 + 检测配置)
|
|
1574
|
-
*/
|
|
1575
|
-
interface ToolConfig extends AIToolOption, ToolDetectionConfig {}
|
|
1561
|
+
interface ToolConfig extends AIToolOption {}
|
|
1576
1562
|
/**
|
|
1577
1563
|
* 所有支持的 AI 工具配置
|
|
1578
|
-
*
|
|
1579
1564
|
* 完全对齐官方 OpenSpec CLI 的 AI_TOOLS
|
|
1580
|
-
* 按字母顺序排序(与官方一致)
|
|
1581
|
-
*
|
|
1582
|
-
* @see references/openspec/src/core/config.ts
|
|
1583
|
-
* @see references/openspec/src/core/configurators/slash/registry.ts
|
|
1584
1565
|
*/
|
|
1585
1566
|
declare const AI_TOOLS: ToolConfig[];
|
|
1586
1567
|
/**
|
|
@@ -1605,28 +1586,401 @@ declare function getAllToolIds(): string[];
|
|
|
1605
1586
|
declare function getToolById(toolId: string): ToolConfig | undefined;
|
|
1606
1587
|
/**
|
|
1607
1588
|
* 检测项目中已配置的工具(响应式)
|
|
1608
|
-
*
|
|
1609
|
-
* 监听两类目录:
|
|
1610
|
-
* 1. 项目级配置目录(如 .claude, .cursor 等)
|
|
1611
|
-
* 2. 全局配置目录(如 ~/.codex/prompts/)
|
|
1612
|
-
*
|
|
1613
|
-
* @param projectDir 项目根目录
|
|
1614
|
-
* @returns 已配置的工具 ID 列表
|
|
1615
1589
|
*/
|
|
1616
1590
|
declare function getConfiguredTools(projectDir: string): Promise<string[]>;
|
|
1617
1591
|
/**
|
|
1618
1592
|
* 检查特定工具是否已配置
|
|
1619
|
-
*
|
|
1620
|
-
* @param projectDir 项目根目录
|
|
1621
|
-
* @param toolId 工具 ID
|
|
1622
|
-
* @returns 是否已配置
|
|
1623
1593
|
*/
|
|
1624
1594
|
declare function isToolConfigured(projectDir: string, toolId: string): Promise<boolean>;
|
|
1625
1595
|
//#endregion
|
|
1596
|
+
//#region src/opsx-types.d.ts
|
|
1597
|
+
/** Check if an outputPath contains glob pattern characters */
|
|
1598
|
+
declare function isGlobPattern(pattern: string): boolean;
|
|
1599
|
+
declare const ArtifactStatusSchema: z.ZodObject<{
|
|
1600
|
+
id: z.ZodString;
|
|
1601
|
+
outputPath: z.ZodString;
|
|
1602
|
+
status: z.ZodEnum<["done", "ready", "blocked"]>;
|
|
1603
|
+
missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1604
|
+
relativePath: z.ZodOptional<z.ZodString>;
|
|
1605
|
+
}, "strip", z.ZodTypeAny, {
|
|
1606
|
+
status: "done" | "ready" | "blocked";
|
|
1607
|
+
id: string;
|
|
1608
|
+
outputPath: string;
|
|
1609
|
+
missingDeps?: string[] | undefined;
|
|
1610
|
+
relativePath?: string | undefined;
|
|
1611
|
+
}, {
|
|
1612
|
+
status: "done" | "ready" | "blocked";
|
|
1613
|
+
id: string;
|
|
1614
|
+
outputPath: string;
|
|
1615
|
+
missingDeps?: string[] | undefined;
|
|
1616
|
+
relativePath?: string | undefined;
|
|
1617
|
+
}>;
|
|
1618
|
+
type ArtifactStatus = z.infer<typeof ArtifactStatusSchema>;
|
|
1619
|
+
declare const ChangeStatusSchema: z.ZodObject<{
|
|
1620
|
+
changeName: z.ZodString;
|
|
1621
|
+
schemaName: z.ZodString;
|
|
1622
|
+
isComplete: z.ZodBoolean;
|
|
1623
|
+
applyRequires: z.ZodArray<z.ZodString, "many">;
|
|
1624
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
1625
|
+
id: z.ZodString;
|
|
1626
|
+
outputPath: z.ZodString;
|
|
1627
|
+
status: z.ZodEnum<["done", "ready", "blocked"]>;
|
|
1628
|
+
missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1629
|
+
relativePath: z.ZodOptional<z.ZodString>;
|
|
1630
|
+
}, "strip", z.ZodTypeAny, {
|
|
1631
|
+
status: "done" | "ready" | "blocked";
|
|
1632
|
+
id: string;
|
|
1633
|
+
outputPath: string;
|
|
1634
|
+
missingDeps?: string[] | undefined;
|
|
1635
|
+
relativePath?: string | undefined;
|
|
1636
|
+
}, {
|
|
1637
|
+
status: "done" | "ready" | "blocked";
|
|
1638
|
+
id: string;
|
|
1639
|
+
outputPath: string;
|
|
1640
|
+
missingDeps?: string[] | undefined;
|
|
1641
|
+
relativePath?: string | undefined;
|
|
1642
|
+
}>, "many">;
|
|
1643
|
+
}, "strip", z.ZodTypeAny, {
|
|
1644
|
+
changeName: string;
|
|
1645
|
+
schemaName: string;
|
|
1646
|
+
isComplete: boolean;
|
|
1647
|
+
applyRequires: string[];
|
|
1648
|
+
artifacts: {
|
|
1649
|
+
status: "done" | "ready" | "blocked";
|
|
1650
|
+
id: string;
|
|
1651
|
+
outputPath: string;
|
|
1652
|
+
missingDeps?: string[] | undefined;
|
|
1653
|
+
relativePath?: string | undefined;
|
|
1654
|
+
}[];
|
|
1655
|
+
}, {
|
|
1656
|
+
changeName: string;
|
|
1657
|
+
schemaName: string;
|
|
1658
|
+
isComplete: boolean;
|
|
1659
|
+
applyRequires: string[];
|
|
1660
|
+
artifacts: {
|
|
1661
|
+
status: "done" | "ready" | "blocked";
|
|
1662
|
+
id: string;
|
|
1663
|
+
outputPath: string;
|
|
1664
|
+
missingDeps?: string[] | undefined;
|
|
1665
|
+
relativePath?: string | undefined;
|
|
1666
|
+
}[];
|
|
1667
|
+
}>;
|
|
1668
|
+
type ChangeStatus = z.infer<typeof ChangeStatusSchema>;
|
|
1669
|
+
declare const DependencyInfoSchema: z.ZodObject<{
|
|
1670
|
+
id: z.ZodString;
|
|
1671
|
+
done: z.ZodBoolean;
|
|
1672
|
+
path: z.ZodString;
|
|
1673
|
+
description: z.ZodString;
|
|
1674
|
+
}, "strip", z.ZodTypeAny, {
|
|
1675
|
+
path: string;
|
|
1676
|
+
id: string;
|
|
1677
|
+
description: string;
|
|
1678
|
+
done: boolean;
|
|
1679
|
+
}, {
|
|
1680
|
+
path: string;
|
|
1681
|
+
id: string;
|
|
1682
|
+
description: string;
|
|
1683
|
+
done: boolean;
|
|
1684
|
+
}>;
|
|
1685
|
+
type DependencyInfo = z.infer<typeof DependencyInfoSchema>;
|
|
1686
|
+
declare const ApplyTaskSchema: z.ZodObject<{
|
|
1687
|
+
id: z.ZodString;
|
|
1688
|
+
description: z.ZodString;
|
|
1689
|
+
done: z.ZodBoolean;
|
|
1690
|
+
}, "strip", z.ZodTypeAny, {
|
|
1691
|
+
id: string;
|
|
1692
|
+
description: string;
|
|
1693
|
+
done: boolean;
|
|
1694
|
+
}, {
|
|
1695
|
+
id: string;
|
|
1696
|
+
description: string;
|
|
1697
|
+
done: boolean;
|
|
1698
|
+
}>;
|
|
1699
|
+
type ApplyTask = z.infer<typeof ApplyTaskSchema>;
|
|
1700
|
+
declare const ApplyInstructionsSchema: z.ZodObject<{
|
|
1701
|
+
changeName: z.ZodString;
|
|
1702
|
+
changeDir: z.ZodString;
|
|
1703
|
+
schemaName: z.ZodString;
|
|
1704
|
+
contextFiles: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1705
|
+
progress: z.ZodObject<{
|
|
1706
|
+
total: z.ZodNumber;
|
|
1707
|
+
complete: z.ZodNumber;
|
|
1708
|
+
remaining: z.ZodNumber;
|
|
1709
|
+
}, "strip", z.ZodTypeAny, {
|
|
1710
|
+
total: number;
|
|
1711
|
+
complete: number;
|
|
1712
|
+
remaining: number;
|
|
1713
|
+
}, {
|
|
1714
|
+
total: number;
|
|
1715
|
+
complete: number;
|
|
1716
|
+
remaining: number;
|
|
1717
|
+
}>;
|
|
1718
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
1719
|
+
id: z.ZodString;
|
|
1720
|
+
description: z.ZodString;
|
|
1721
|
+
done: z.ZodBoolean;
|
|
1722
|
+
}, "strip", z.ZodTypeAny, {
|
|
1723
|
+
id: string;
|
|
1724
|
+
description: string;
|
|
1725
|
+
done: boolean;
|
|
1726
|
+
}, {
|
|
1727
|
+
id: string;
|
|
1728
|
+
description: string;
|
|
1729
|
+
done: boolean;
|
|
1730
|
+
}>, "many">;
|
|
1731
|
+
state: z.ZodEnum<["blocked", "all_done", "ready"]>;
|
|
1732
|
+
missingArtifacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1733
|
+
instruction: z.ZodString;
|
|
1734
|
+
}, "strip", z.ZodTypeAny, {
|
|
1735
|
+
tasks: {
|
|
1736
|
+
id: string;
|
|
1737
|
+
description: string;
|
|
1738
|
+
done: boolean;
|
|
1739
|
+
}[];
|
|
1740
|
+
progress: {
|
|
1741
|
+
total: number;
|
|
1742
|
+
complete: number;
|
|
1743
|
+
remaining: number;
|
|
1744
|
+
};
|
|
1745
|
+
changeName: string;
|
|
1746
|
+
schemaName: string;
|
|
1747
|
+
changeDir: string;
|
|
1748
|
+
contextFiles: Record<string, string>;
|
|
1749
|
+
state: "ready" | "blocked" | "all_done";
|
|
1750
|
+
instruction: string;
|
|
1751
|
+
missingArtifacts?: string[] | undefined;
|
|
1752
|
+
}, {
|
|
1753
|
+
tasks: {
|
|
1754
|
+
id: string;
|
|
1755
|
+
description: string;
|
|
1756
|
+
done: boolean;
|
|
1757
|
+
}[];
|
|
1758
|
+
progress: {
|
|
1759
|
+
total: number;
|
|
1760
|
+
complete: number;
|
|
1761
|
+
remaining: number;
|
|
1762
|
+
};
|
|
1763
|
+
changeName: string;
|
|
1764
|
+
schemaName: string;
|
|
1765
|
+
changeDir: string;
|
|
1766
|
+
contextFiles: Record<string, string>;
|
|
1767
|
+
state: "ready" | "blocked" | "all_done";
|
|
1768
|
+
instruction: string;
|
|
1769
|
+
missingArtifacts?: string[] | undefined;
|
|
1770
|
+
}>;
|
|
1771
|
+
type ApplyInstructions = z.infer<typeof ApplyInstructionsSchema>;
|
|
1772
|
+
declare const ArtifactInstructionsSchema: z.ZodObject<{
|
|
1773
|
+
changeName: z.ZodString;
|
|
1774
|
+
artifactId: z.ZodString;
|
|
1775
|
+
schemaName: z.ZodString;
|
|
1776
|
+
changeDir: z.ZodString;
|
|
1777
|
+
outputPath: z.ZodString;
|
|
1778
|
+
description: z.ZodString;
|
|
1779
|
+
instruction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1780
|
+
context: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1781
|
+
rules: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1782
|
+
template: z.ZodString;
|
|
1783
|
+
dependencies: z.ZodArray<z.ZodObject<{
|
|
1784
|
+
id: z.ZodString;
|
|
1785
|
+
done: z.ZodBoolean;
|
|
1786
|
+
path: z.ZodString;
|
|
1787
|
+
description: z.ZodString;
|
|
1788
|
+
}, "strip", z.ZodTypeAny, {
|
|
1789
|
+
path: string;
|
|
1790
|
+
id: string;
|
|
1791
|
+
description: string;
|
|
1792
|
+
done: boolean;
|
|
1793
|
+
}, {
|
|
1794
|
+
path: string;
|
|
1795
|
+
id: string;
|
|
1796
|
+
description: string;
|
|
1797
|
+
done: boolean;
|
|
1798
|
+
}>, "many">;
|
|
1799
|
+
unlocks: z.ZodArray<z.ZodString, "many">;
|
|
1800
|
+
}, "strip", z.ZodTypeAny, {
|
|
1801
|
+
description: string;
|
|
1802
|
+
outputPath: string;
|
|
1803
|
+
changeName: string;
|
|
1804
|
+
schemaName: string;
|
|
1805
|
+
changeDir: string;
|
|
1806
|
+
artifactId: string;
|
|
1807
|
+
template: string;
|
|
1808
|
+
dependencies: {
|
|
1809
|
+
path: string;
|
|
1810
|
+
id: string;
|
|
1811
|
+
description: string;
|
|
1812
|
+
done: boolean;
|
|
1813
|
+
}[];
|
|
1814
|
+
unlocks: string[];
|
|
1815
|
+
instruction?: string | null | undefined;
|
|
1816
|
+
context?: string | null | undefined;
|
|
1817
|
+
rules?: string[] | null | undefined;
|
|
1818
|
+
}, {
|
|
1819
|
+
description: string;
|
|
1820
|
+
outputPath: string;
|
|
1821
|
+
changeName: string;
|
|
1822
|
+
schemaName: string;
|
|
1823
|
+
changeDir: string;
|
|
1824
|
+
artifactId: string;
|
|
1825
|
+
template: string;
|
|
1826
|
+
dependencies: {
|
|
1827
|
+
path: string;
|
|
1828
|
+
id: string;
|
|
1829
|
+
description: string;
|
|
1830
|
+
done: boolean;
|
|
1831
|
+
}[];
|
|
1832
|
+
unlocks: string[];
|
|
1833
|
+
instruction?: string | null | undefined;
|
|
1834
|
+
context?: string | null | undefined;
|
|
1835
|
+
rules?: string[] | null | undefined;
|
|
1836
|
+
}>;
|
|
1837
|
+
type ArtifactInstructions = z.infer<typeof ArtifactInstructionsSchema>;
|
|
1838
|
+
declare const SchemaInfoSchema: z.ZodObject<{
|
|
1839
|
+
name: z.ZodString;
|
|
1840
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1841
|
+
artifacts: z.ZodArray<z.ZodString, "many">;
|
|
1842
|
+
source: z.ZodEnum<["project", "user", "package"]>;
|
|
1843
|
+
}, "strip", z.ZodTypeAny, {
|
|
1844
|
+
name: string;
|
|
1845
|
+
artifacts: string[];
|
|
1846
|
+
source: "project" | "user" | "package";
|
|
1847
|
+
description?: string | undefined;
|
|
1848
|
+
}, {
|
|
1849
|
+
name: string;
|
|
1850
|
+
artifacts: string[];
|
|
1851
|
+
source: "project" | "user" | "package";
|
|
1852
|
+
description?: string | undefined;
|
|
1853
|
+
}>;
|
|
1854
|
+
type SchemaInfo = z.infer<typeof SchemaInfoSchema>;
|
|
1855
|
+
declare const SchemaResolutionSchema: z.ZodObject<{
|
|
1856
|
+
name: z.ZodString;
|
|
1857
|
+
source: z.ZodEnum<["project", "user", "package"]>;
|
|
1858
|
+
path: z.ZodString;
|
|
1859
|
+
shadows: z.ZodArray<z.ZodObject<{
|
|
1860
|
+
source: z.ZodEnum<["project", "user", "package"]>;
|
|
1861
|
+
path: z.ZodString;
|
|
1862
|
+
}, "strip", z.ZodTypeAny, {
|
|
1863
|
+
path: string;
|
|
1864
|
+
source: "project" | "user" | "package";
|
|
1865
|
+
}, {
|
|
1866
|
+
path: string;
|
|
1867
|
+
source: "project" | "user" | "package";
|
|
1868
|
+
}>, "many">;
|
|
1869
|
+
}, "strip", z.ZodTypeAny, {
|
|
1870
|
+
path: string;
|
|
1871
|
+
name: string;
|
|
1872
|
+
source: "project" | "user" | "package";
|
|
1873
|
+
shadows: {
|
|
1874
|
+
path: string;
|
|
1875
|
+
source: "project" | "user" | "package";
|
|
1876
|
+
}[];
|
|
1877
|
+
}, {
|
|
1878
|
+
path: string;
|
|
1879
|
+
name: string;
|
|
1880
|
+
source: "project" | "user" | "package";
|
|
1881
|
+
shadows: {
|
|
1882
|
+
path: string;
|
|
1883
|
+
source: "project" | "user" | "package";
|
|
1884
|
+
}[];
|
|
1885
|
+
}>;
|
|
1886
|
+
type SchemaResolution = z.infer<typeof SchemaResolutionSchema>;
|
|
1887
|
+
declare const TemplatesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1888
|
+
path: z.ZodString;
|
|
1889
|
+
source: z.ZodEnum<["project", "user", "package"]>;
|
|
1890
|
+
}, "strip", z.ZodTypeAny, {
|
|
1891
|
+
path: string;
|
|
1892
|
+
source: "project" | "user" | "package";
|
|
1893
|
+
}, {
|
|
1894
|
+
path: string;
|
|
1895
|
+
source: "project" | "user" | "package";
|
|
1896
|
+
}>>;
|
|
1897
|
+
type TemplatesMap = z.infer<typeof TemplatesSchema>;
|
|
1898
|
+
declare const SchemaArtifactSchema: z.ZodObject<{
|
|
1899
|
+
id: z.ZodString;
|
|
1900
|
+
outputPath: z.ZodString;
|
|
1901
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1902
|
+
template: z.ZodOptional<z.ZodString>;
|
|
1903
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
1904
|
+
requires: z.ZodArray<z.ZodString, "many">;
|
|
1905
|
+
}, "strip", z.ZodTypeAny, {
|
|
1906
|
+
id: string;
|
|
1907
|
+
outputPath: string;
|
|
1908
|
+
requires: string[];
|
|
1909
|
+
description?: string | undefined;
|
|
1910
|
+
instruction?: string | undefined;
|
|
1911
|
+
template?: string | undefined;
|
|
1912
|
+
}, {
|
|
1913
|
+
id: string;
|
|
1914
|
+
outputPath: string;
|
|
1915
|
+
requires: string[];
|
|
1916
|
+
description?: string | undefined;
|
|
1917
|
+
instruction?: string | undefined;
|
|
1918
|
+
template?: string | undefined;
|
|
1919
|
+
}>;
|
|
1920
|
+
type SchemaArtifact = z.infer<typeof SchemaArtifactSchema>;
|
|
1921
|
+
declare const SchemaDetailSchema: z.ZodObject<{
|
|
1922
|
+
name: z.ZodString;
|
|
1923
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1924
|
+
version: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
1925
|
+
artifacts: z.ZodArray<z.ZodObject<{
|
|
1926
|
+
id: z.ZodString;
|
|
1927
|
+
outputPath: z.ZodString;
|
|
1928
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1929
|
+
template: z.ZodOptional<z.ZodString>;
|
|
1930
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
1931
|
+
requires: z.ZodArray<z.ZodString, "many">;
|
|
1932
|
+
}, "strip", z.ZodTypeAny, {
|
|
1933
|
+
id: string;
|
|
1934
|
+
outputPath: string;
|
|
1935
|
+
requires: string[];
|
|
1936
|
+
description?: string | undefined;
|
|
1937
|
+
instruction?: string | undefined;
|
|
1938
|
+
template?: string | undefined;
|
|
1939
|
+
}, {
|
|
1940
|
+
id: string;
|
|
1941
|
+
outputPath: string;
|
|
1942
|
+
requires: string[];
|
|
1943
|
+
description?: string | undefined;
|
|
1944
|
+
instruction?: string | undefined;
|
|
1945
|
+
template?: string | undefined;
|
|
1946
|
+
}>, "many">;
|
|
1947
|
+
applyRequires: z.ZodArray<z.ZodString, "many">;
|
|
1948
|
+
applyTracks: z.ZodOptional<z.ZodString>;
|
|
1949
|
+
applyInstruction: z.ZodOptional<z.ZodString>;
|
|
1950
|
+
}, "strip", z.ZodTypeAny, {
|
|
1951
|
+
name: string;
|
|
1952
|
+
applyRequires: string[];
|
|
1953
|
+
artifacts: {
|
|
1954
|
+
id: string;
|
|
1955
|
+
outputPath: string;
|
|
1956
|
+
requires: string[];
|
|
1957
|
+
description?: string | undefined;
|
|
1958
|
+
instruction?: string | undefined;
|
|
1959
|
+
template?: string | undefined;
|
|
1960
|
+
}[];
|
|
1961
|
+
version?: string | number | undefined;
|
|
1962
|
+
description?: string | undefined;
|
|
1963
|
+
applyTracks?: string | undefined;
|
|
1964
|
+
applyInstruction?: string | undefined;
|
|
1965
|
+
}, {
|
|
1966
|
+
name: string;
|
|
1967
|
+
applyRequires: string[];
|
|
1968
|
+
artifacts: {
|
|
1969
|
+
id: string;
|
|
1970
|
+
outputPath: string;
|
|
1971
|
+
requires: string[];
|
|
1972
|
+
description?: string | undefined;
|
|
1973
|
+
instruction?: string | undefined;
|
|
1974
|
+
template?: string | undefined;
|
|
1975
|
+
}[];
|
|
1976
|
+
version?: string | number | undefined;
|
|
1977
|
+
description?: string | undefined;
|
|
1978
|
+
applyTracks?: string | undefined;
|
|
1979
|
+
applyInstruction?: string | undefined;
|
|
1980
|
+
}>;
|
|
1981
|
+
type SchemaDetail = z.infer<typeof SchemaDetailSchema>;
|
|
1982
|
+
//#endregion
|
|
1626
1983
|
//#region src/export-types.d.ts
|
|
1627
|
-
/**
|
|
1628
|
-
* Types for static export / SSG
|
|
1629
|
-
*/
|
|
1630
1984
|
/**
|
|
1631
1985
|
* Complete snapshot of an OpenSpec project for static export
|
|
1632
1986
|
*/
|
|
@@ -1707,6 +2061,564 @@ interface ExportSnapshot {
|
|
|
1707
2061
|
projectMd?: string;
|
|
1708
2062
|
/** AGENTS.md content */
|
|
1709
2063
|
agentsMd?: string;
|
|
2064
|
+
/** OPSX configuration data (for Config view) */
|
|
2065
|
+
opsx?: {
|
|
2066
|
+
configYaml?: string;
|
|
2067
|
+
schemas: SchemaInfo[];
|
|
2068
|
+
schemaDetails: Record<string, SchemaDetail>;
|
|
2069
|
+
schemaResolutions: Record<string, SchemaResolution>;
|
|
2070
|
+
templates: Record<string, TemplatesMap>;
|
|
2071
|
+
changeMetadata: Record<string, string | null>;
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
//#endregion
|
|
2075
|
+
//#region src/opsx-kernel.d.ts
|
|
2076
|
+
type TemplateContentMap = Record<string, {
|
|
2077
|
+
content: string | null;
|
|
2078
|
+
path: string;
|
|
2079
|
+
source: TemplatesMap[string]['source'];
|
|
2080
|
+
}>;
|
|
2081
|
+
interface GlobArtifactFile {
|
|
2082
|
+
path: string;
|
|
2083
|
+
type: 'file';
|
|
2084
|
+
content: string;
|
|
1710
2085
|
}
|
|
2086
|
+
declare class OpsxKernel {
|
|
2087
|
+
private readonly projectDir;
|
|
2088
|
+
private readonly cliExecutor;
|
|
2089
|
+
private readonly controller;
|
|
2090
|
+
private _statusList;
|
|
2091
|
+
private _schemas;
|
|
2092
|
+
private _changeIds;
|
|
2093
|
+
private _projectConfig;
|
|
2094
|
+
private _schemaResolutions;
|
|
2095
|
+
private _schemaDetails;
|
|
2096
|
+
private _schemaFiles;
|
|
2097
|
+
private _schemaYamls;
|
|
2098
|
+
private _templates;
|
|
2099
|
+
private _templateContents;
|
|
2100
|
+
private _statuses;
|
|
2101
|
+
private _instructions;
|
|
2102
|
+
private _applyInstructions;
|
|
2103
|
+
private _changeMetadata;
|
|
2104
|
+
private _artifactOutputs;
|
|
2105
|
+
private _globArtifactFiles;
|
|
2106
|
+
private _entityControllers;
|
|
2107
|
+
constructor(projectDir: string, cliExecutor: CliExecutor);
|
|
2108
|
+
warmup(): Promise<void>;
|
|
2109
|
+
dispose(): void;
|
|
2110
|
+
getStatusList(): ChangeStatus[];
|
|
2111
|
+
getSchemas(): SchemaInfo[];
|
|
2112
|
+
getChangeIds(): string[];
|
|
2113
|
+
getProjectConfig(): string | null;
|
|
2114
|
+
getTemplates(schema?: string): TemplatesMap;
|
|
2115
|
+
getTemplateContents(schema?: string): TemplateContentMap;
|
|
2116
|
+
getStatus(changeId: string, schema?: string): ChangeStatus;
|
|
2117
|
+
getInstructions(changeId: string, artifact: string, schema?: string): ArtifactInstructions;
|
|
2118
|
+
getApplyInstructions(changeId: string, schema?: string): ApplyInstructions;
|
|
2119
|
+
getSchemaResolution(name: string): SchemaResolution;
|
|
2120
|
+
getSchemaDetail(name: string): SchemaDetail;
|
|
2121
|
+
getSchemaFiles(name: string): ChangeFile[];
|
|
2122
|
+
getSchemaYaml(name: string): string | null;
|
|
2123
|
+
getChangeMetadata(changeId: string): string | null;
|
|
2124
|
+
getArtifactOutput(changeId: string, outputPath: string): string | null;
|
|
2125
|
+
getGlobArtifactFiles(changeId: string, outputPath: string): GlobArtifactFile[];
|
|
2126
|
+
private startStream;
|
|
2127
|
+
private warmupSchema;
|
|
2128
|
+
private warmupChange;
|
|
2129
|
+
private watchSchemaChanges;
|
|
2130
|
+
private watchChangeIdChanges;
|
|
2131
|
+
private teardownEntity;
|
|
2132
|
+
private fetchSchemas;
|
|
2133
|
+
private fetchChangeIds;
|
|
2134
|
+
private fetchProjectConfig;
|
|
2135
|
+
private fetchStatus;
|
|
2136
|
+
private fetchStatusList;
|
|
2137
|
+
private fetchInstructions;
|
|
2138
|
+
private fetchApplyInstructions;
|
|
2139
|
+
private fetchSchemaResolution;
|
|
2140
|
+
private fetchSchemaDetail;
|
|
2141
|
+
private fetchSchemaFiles;
|
|
2142
|
+
private fetchSchemaYaml;
|
|
2143
|
+
private fetchTemplates;
|
|
2144
|
+
private fetchTemplateContents;
|
|
2145
|
+
private fetchChangeMetadata;
|
|
2146
|
+
private fetchArtifactOutput;
|
|
2147
|
+
/**
|
|
2148
|
+
* Ensure a per-change status stream exists. If not yet warmed up,
|
|
2149
|
+
* creates the state and starts a stream lazily.
|
|
2150
|
+
*/
|
|
2151
|
+
ensureStatus(changeId: string, schema?: string): void;
|
|
2152
|
+
ensureInstructions(changeId: string, artifact: string, schema?: string): void;
|
|
2153
|
+
ensureApplyInstructions(changeId: string, schema?: string): void;
|
|
2154
|
+
ensureArtifactOutput(changeId: string, outputPath: string): void;
|
|
2155
|
+
ensureGlobArtifactFiles(changeId: string, outputPath: string): void;
|
|
2156
|
+
ensureSchemaResolution(name: string): void;
|
|
2157
|
+
ensureSchemaDetail(name: string): void;
|
|
2158
|
+
ensureSchemaFiles(name: string): void;
|
|
2159
|
+
ensureSchemaYaml(name: string): void;
|
|
2160
|
+
ensureTemplates(schema?: string): void;
|
|
2161
|
+
ensureTemplateContents(schema?: string): void;
|
|
2162
|
+
ensureChangeMetadata(changeId: string): void;
|
|
2163
|
+
private combineSignals;
|
|
2164
|
+
}
|
|
2165
|
+
//#endregion
|
|
2166
|
+
//#region src/pty-protocol.d.ts
|
|
2167
|
+
declare const PtyPlatformSchema: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2168
|
+
declare const PtySessionInfoSchema: z.ZodObject<{
|
|
2169
|
+
id: z.ZodString;
|
|
2170
|
+
title: z.ZodString;
|
|
2171
|
+
command: z.ZodString;
|
|
2172
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
2173
|
+
platform: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2174
|
+
isExited: z.ZodBoolean;
|
|
2175
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
2176
|
+
}, "strip", z.ZodTypeAny, {
|
|
2177
|
+
command: string;
|
|
2178
|
+
args: string[];
|
|
2179
|
+
platform: "windows" | "macos" | "common";
|
|
2180
|
+
exitCode: number | null;
|
|
2181
|
+
title: string;
|
|
2182
|
+
id: string;
|
|
2183
|
+
isExited: boolean;
|
|
2184
|
+
}, {
|
|
2185
|
+
command: string;
|
|
2186
|
+
args: string[];
|
|
2187
|
+
platform: "windows" | "macos" | "common";
|
|
2188
|
+
exitCode: number | null;
|
|
2189
|
+
title: string;
|
|
2190
|
+
id: string;
|
|
2191
|
+
isExited: boolean;
|
|
2192
|
+
}>;
|
|
2193
|
+
declare const PtyCreateMessageSchema: z.ZodObject<{
|
|
2194
|
+
type: z.ZodLiteral<"create">;
|
|
2195
|
+
requestId: z.ZodString;
|
|
2196
|
+
cols: z.ZodOptional<z.ZodNumber>;
|
|
2197
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
2198
|
+
command: z.ZodOptional<z.ZodString>;
|
|
2199
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2200
|
+
}, "strip", z.ZodTypeAny, {
|
|
2201
|
+
type: "create";
|
|
2202
|
+
requestId: string;
|
|
2203
|
+
cols?: number | undefined;
|
|
2204
|
+
rows?: number | undefined;
|
|
2205
|
+
command?: string | undefined;
|
|
2206
|
+
args?: string[] | undefined;
|
|
2207
|
+
}, {
|
|
2208
|
+
type: "create";
|
|
2209
|
+
requestId: string;
|
|
2210
|
+
cols?: number | undefined;
|
|
2211
|
+
rows?: number | undefined;
|
|
2212
|
+
command?: string | undefined;
|
|
2213
|
+
args?: string[] | undefined;
|
|
2214
|
+
}>;
|
|
2215
|
+
declare const PtyInputMessageSchema: z.ZodObject<{
|
|
2216
|
+
type: z.ZodLiteral<"input">;
|
|
2217
|
+
sessionId: z.ZodString;
|
|
2218
|
+
data: z.ZodString;
|
|
2219
|
+
}, "strip", z.ZodTypeAny, {
|
|
2220
|
+
type: "input";
|
|
2221
|
+
sessionId: string;
|
|
2222
|
+
data: string;
|
|
2223
|
+
}, {
|
|
2224
|
+
type: "input";
|
|
2225
|
+
sessionId: string;
|
|
2226
|
+
data: string;
|
|
2227
|
+
}>;
|
|
2228
|
+
declare const PtyResizeMessageSchema: z.ZodObject<{
|
|
2229
|
+
type: z.ZodLiteral<"resize">;
|
|
2230
|
+
sessionId: z.ZodString;
|
|
2231
|
+
cols: z.ZodNumber;
|
|
2232
|
+
rows: z.ZodNumber;
|
|
2233
|
+
}, "strip", z.ZodTypeAny, {
|
|
2234
|
+
type: "resize";
|
|
2235
|
+
cols: number;
|
|
2236
|
+
rows: number;
|
|
2237
|
+
sessionId: string;
|
|
2238
|
+
}, {
|
|
2239
|
+
type: "resize";
|
|
2240
|
+
cols: number;
|
|
2241
|
+
rows: number;
|
|
2242
|
+
sessionId: string;
|
|
2243
|
+
}>;
|
|
2244
|
+
declare const PtyCloseMessageSchema: z.ZodObject<{
|
|
2245
|
+
type: z.ZodLiteral<"close">;
|
|
2246
|
+
sessionId: z.ZodString;
|
|
2247
|
+
}, "strip", z.ZodTypeAny, {
|
|
2248
|
+
type: "close";
|
|
2249
|
+
sessionId: string;
|
|
2250
|
+
}, {
|
|
2251
|
+
type: "close";
|
|
2252
|
+
sessionId: string;
|
|
2253
|
+
}>;
|
|
2254
|
+
declare const PtyAttachMessageSchema: z.ZodObject<{
|
|
2255
|
+
type: z.ZodLiteral<"attach">;
|
|
2256
|
+
sessionId: z.ZodString;
|
|
2257
|
+
cols: z.ZodOptional<z.ZodNumber>;
|
|
2258
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
2259
|
+
}, "strip", z.ZodTypeAny, {
|
|
2260
|
+
type: "attach";
|
|
2261
|
+
sessionId: string;
|
|
2262
|
+
cols?: number | undefined;
|
|
2263
|
+
rows?: number | undefined;
|
|
2264
|
+
}, {
|
|
2265
|
+
type: "attach";
|
|
2266
|
+
sessionId: string;
|
|
2267
|
+
cols?: number | undefined;
|
|
2268
|
+
rows?: number | undefined;
|
|
2269
|
+
}>;
|
|
2270
|
+
declare const PtyListMessageSchema: z.ZodObject<{
|
|
2271
|
+
type: z.ZodLiteral<"list">;
|
|
2272
|
+
}, "strip", z.ZodTypeAny, {
|
|
2273
|
+
type: "list";
|
|
2274
|
+
}, {
|
|
2275
|
+
type: "list";
|
|
2276
|
+
}>;
|
|
2277
|
+
declare const PtyClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2278
|
+
type: z.ZodLiteral<"create">;
|
|
2279
|
+
requestId: z.ZodString;
|
|
2280
|
+
cols: z.ZodOptional<z.ZodNumber>;
|
|
2281
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
2282
|
+
command: z.ZodOptional<z.ZodString>;
|
|
2283
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2284
|
+
}, "strip", z.ZodTypeAny, {
|
|
2285
|
+
type: "create";
|
|
2286
|
+
requestId: string;
|
|
2287
|
+
cols?: number | undefined;
|
|
2288
|
+
rows?: number | undefined;
|
|
2289
|
+
command?: string | undefined;
|
|
2290
|
+
args?: string[] | undefined;
|
|
2291
|
+
}, {
|
|
2292
|
+
type: "create";
|
|
2293
|
+
requestId: string;
|
|
2294
|
+
cols?: number | undefined;
|
|
2295
|
+
rows?: number | undefined;
|
|
2296
|
+
command?: string | undefined;
|
|
2297
|
+
args?: string[] | undefined;
|
|
2298
|
+
}>, z.ZodObject<{
|
|
2299
|
+
type: z.ZodLiteral<"input">;
|
|
2300
|
+
sessionId: z.ZodString;
|
|
2301
|
+
data: z.ZodString;
|
|
2302
|
+
}, "strip", z.ZodTypeAny, {
|
|
2303
|
+
type: "input";
|
|
2304
|
+
sessionId: string;
|
|
2305
|
+
data: string;
|
|
2306
|
+
}, {
|
|
2307
|
+
type: "input";
|
|
2308
|
+
sessionId: string;
|
|
2309
|
+
data: string;
|
|
2310
|
+
}>, z.ZodObject<{
|
|
2311
|
+
type: z.ZodLiteral<"resize">;
|
|
2312
|
+
sessionId: z.ZodString;
|
|
2313
|
+
cols: z.ZodNumber;
|
|
2314
|
+
rows: z.ZodNumber;
|
|
2315
|
+
}, "strip", z.ZodTypeAny, {
|
|
2316
|
+
type: "resize";
|
|
2317
|
+
cols: number;
|
|
2318
|
+
rows: number;
|
|
2319
|
+
sessionId: string;
|
|
2320
|
+
}, {
|
|
2321
|
+
type: "resize";
|
|
2322
|
+
cols: number;
|
|
2323
|
+
rows: number;
|
|
2324
|
+
sessionId: string;
|
|
2325
|
+
}>, z.ZodObject<{
|
|
2326
|
+
type: z.ZodLiteral<"close">;
|
|
2327
|
+
sessionId: z.ZodString;
|
|
2328
|
+
}, "strip", z.ZodTypeAny, {
|
|
2329
|
+
type: "close";
|
|
2330
|
+
sessionId: string;
|
|
2331
|
+
}, {
|
|
2332
|
+
type: "close";
|
|
2333
|
+
sessionId: string;
|
|
2334
|
+
}>, z.ZodObject<{
|
|
2335
|
+
type: z.ZodLiteral<"attach">;
|
|
2336
|
+
sessionId: z.ZodString;
|
|
2337
|
+
cols: z.ZodOptional<z.ZodNumber>;
|
|
2338
|
+
rows: z.ZodOptional<z.ZodNumber>;
|
|
2339
|
+
}, "strip", z.ZodTypeAny, {
|
|
2340
|
+
type: "attach";
|
|
2341
|
+
sessionId: string;
|
|
2342
|
+
cols?: number | undefined;
|
|
2343
|
+
rows?: number | undefined;
|
|
2344
|
+
}, {
|
|
2345
|
+
type: "attach";
|
|
2346
|
+
sessionId: string;
|
|
2347
|
+
cols?: number | undefined;
|
|
2348
|
+
rows?: number | undefined;
|
|
2349
|
+
}>, z.ZodObject<{
|
|
2350
|
+
type: z.ZodLiteral<"list">;
|
|
2351
|
+
}, "strip", z.ZodTypeAny, {
|
|
2352
|
+
type: "list";
|
|
2353
|
+
}, {
|
|
2354
|
+
type: "list";
|
|
2355
|
+
}>]>;
|
|
2356
|
+
declare const PtyCreatedResponseSchema: z.ZodObject<{
|
|
2357
|
+
type: z.ZodLiteral<"created">;
|
|
2358
|
+
requestId: z.ZodString;
|
|
2359
|
+
sessionId: z.ZodString;
|
|
2360
|
+
platform: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2361
|
+
}, "strip", z.ZodTypeAny, {
|
|
2362
|
+
type: "created";
|
|
2363
|
+
requestId: string;
|
|
2364
|
+
sessionId: string;
|
|
2365
|
+
platform: "windows" | "macos" | "common";
|
|
2366
|
+
}, {
|
|
2367
|
+
type: "created";
|
|
2368
|
+
requestId: string;
|
|
2369
|
+
sessionId: string;
|
|
2370
|
+
platform: "windows" | "macos" | "common";
|
|
2371
|
+
}>;
|
|
2372
|
+
declare const PtyOutputResponseSchema: z.ZodObject<{
|
|
2373
|
+
type: z.ZodLiteral<"output">;
|
|
2374
|
+
sessionId: z.ZodString;
|
|
2375
|
+
data: z.ZodString;
|
|
2376
|
+
}, "strip", z.ZodTypeAny, {
|
|
2377
|
+
type: "output";
|
|
2378
|
+
sessionId: string;
|
|
2379
|
+
data: string;
|
|
2380
|
+
}, {
|
|
2381
|
+
type: "output";
|
|
2382
|
+
sessionId: string;
|
|
2383
|
+
data: string;
|
|
2384
|
+
}>;
|
|
2385
|
+
declare const PtyExitResponseSchema: z.ZodObject<{
|
|
2386
|
+
type: z.ZodLiteral<"exit">;
|
|
2387
|
+
sessionId: z.ZodString;
|
|
2388
|
+
exitCode: z.ZodNumber;
|
|
2389
|
+
}, "strip", z.ZodTypeAny, {
|
|
2390
|
+
type: "exit";
|
|
2391
|
+
sessionId: string;
|
|
2392
|
+
exitCode: number;
|
|
2393
|
+
}, {
|
|
2394
|
+
type: "exit";
|
|
2395
|
+
sessionId: string;
|
|
2396
|
+
exitCode: number;
|
|
2397
|
+
}>;
|
|
2398
|
+
declare const PtyTitleResponseSchema: z.ZodObject<{
|
|
2399
|
+
type: z.ZodLiteral<"title">;
|
|
2400
|
+
sessionId: z.ZodString;
|
|
2401
|
+
title: z.ZodString;
|
|
2402
|
+
}, "strip", z.ZodTypeAny, {
|
|
2403
|
+
type: "title";
|
|
2404
|
+
sessionId: string;
|
|
2405
|
+
title: string;
|
|
2406
|
+
}, {
|
|
2407
|
+
type: "title";
|
|
2408
|
+
sessionId: string;
|
|
2409
|
+
title: string;
|
|
2410
|
+
}>;
|
|
2411
|
+
declare const PtyBufferResponseSchema: z.ZodObject<{
|
|
2412
|
+
type: z.ZodLiteral<"buffer">;
|
|
2413
|
+
sessionId: z.ZodString;
|
|
2414
|
+
data: z.ZodString;
|
|
2415
|
+
}, "strip", z.ZodTypeAny, {
|
|
2416
|
+
type: "buffer";
|
|
2417
|
+
sessionId: string;
|
|
2418
|
+
data: string;
|
|
2419
|
+
}, {
|
|
2420
|
+
type: "buffer";
|
|
2421
|
+
sessionId: string;
|
|
2422
|
+
data: string;
|
|
2423
|
+
}>;
|
|
2424
|
+
declare const PtyListResponseSchema: z.ZodObject<{
|
|
2425
|
+
type: z.ZodLiteral<"list">;
|
|
2426
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
2427
|
+
id: z.ZodString;
|
|
2428
|
+
title: z.ZodString;
|
|
2429
|
+
command: z.ZodString;
|
|
2430
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
2431
|
+
platform: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2432
|
+
isExited: z.ZodBoolean;
|
|
2433
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
2434
|
+
}, "strip", z.ZodTypeAny, {
|
|
2435
|
+
command: string;
|
|
2436
|
+
args: string[];
|
|
2437
|
+
platform: "windows" | "macos" | "common";
|
|
2438
|
+
exitCode: number | null;
|
|
2439
|
+
title: string;
|
|
2440
|
+
id: string;
|
|
2441
|
+
isExited: boolean;
|
|
2442
|
+
}, {
|
|
2443
|
+
command: string;
|
|
2444
|
+
args: string[];
|
|
2445
|
+
platform: "windows" | "macos" | "common";
|
|
2446
|
+
exitCode: number | null;
|
|
2447
|
+
title: string;
|
|
2448
|
+
id: string;
|
|
2449
|
+
isExited: boolean;
|
|
2450
|
+
}>, "many">;
|
|
2451
|
+
}, "strip", z.ZodTypeAny, {
|
|
2452
|
+
type: "list";
|
|
2453
|
+
sessions: {
|
|
2454
|
+
command: string;
|
|
2455
|
+
args: string[];
|
|
2456
|
+
platform: "windows" | "macos" | "common";
|
|
2457
|
+
exitCode: number | null;
|
|
2458
|
+
title: string;
|
|
2459
|
+
id: string;
|
|
2460
|
+
isExited: boolean;
|
|
2461
|
+
}[];
|
|
2462
|
+
}, {
|
|
2463
|
+
type: "list";
|
|
2464
|
+
sessions: {
|
|
2465
|
+
command: string;
|
|
2466
|
+
args: string[];
|
|
2467
|
+
platform: "windows" | "macos" | "common";
|
|
2468
|
+
exitCode: number | null;
|
|
2469
|
+
title: string;
|
|
2470
|
+
id: string;
|
|
2471
|
+
isExited: boolean;
|
|
2472
|
+
}[];
|
|
2473
|
+
}>;
|
|
2474
|
+
declare const PtyErrorCodeSchema: z.ZodEnum<["INVALID_JSON", "INVALID_MESSAGE", "SESSION_NOT_FOUND"]>;
|
|
2475
|
+
declare const PtyErrorResponseSchema: z.ZodObject<{
|
|
2476
|
+
type: z.ZodLiteral<"error">;
|
|
2477
|
+
code: z.ZodEnum<["INVALID_JSON", "INVALID_MESSAGE", "SESSION_NOT_FOUND"]>;
|
|
2478
|
+
message: z.ZodString;
|
|
2479
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2480
|
+
}, "strip", z.ZodTypeAny, {
|
|
2481
|
+
type: "error";
|
|
2482
|
+
code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND";
|
|
2483
|
+
message: string;
|
|
2484
|
+
sessionId?: string | undefined;
|
|
2485
|
+
}, {
|
|
2486
|
+
type: "error";
|
|
2487
|
+
code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND";
|
|
2488
|
+
message: string;
|
|
2489
|
+
sessionId?: string | undefined;
|
|
2490
|
+
}>;
|
|
2491
|
+
declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
2492
|
+
type: z.ZodLiteral<"created">;
|
|
2493
|
+
requestId: z.ZodString;
|
|
2494
|
+
sessionId: z.ZodString;
|
|
2495
|
+
platform: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2496
|
+
}, "strip", z.ZodTypeAny, {
|
|
2497
|
+
type: "created";
|
|
2498
|
+
requestId: string;
|
|
2499
|
+
sessionId: string;
|
|
2500
|
+
platform: "windows" | "macos" | "common";
|
|
2501
|
+
}, {
|
|
2502
|
+
type: "created";
|
|
2503
|
+
requestId: string;
|
|
2504
|
+
sessionId: string;
|
|
2505
|
+
platform: "windows" | "macos" | "common";
|
|
2506
|
+
}>, z.ZodObject<{
|
|
2507
|
+
type: z.ZodLiteral<"output">;
|
|
2508
|
+
sessionId: z.ZodString;
|
|
2509
|
+
data: z.ZodString;
|
|
2510
|
+
}, "strip", z.ZodTypeAny, {
|
|
2511
|
+
type: "output";
|
|
2512
|
+
sessionId: string;
|
|
2513
|
+
data: string;
|
|
2514
|
+
}, {
|
|
2515
|
+
type: "output";
|
|
2516
|
+
sessionId: string;
|
|
2517
|
+
data: string;
|
|
2518
|
+
}>, z.ZodObject<{
|
|
2519
|
+
type: z.ZodLiteral<"exit">;
|
|
2520
|
+
sessionId: z.ZodString;
|
|
2521
|
+
exitCode: z.ZodNumber;
|
|
2522
|
+
}, "strip", z.ZodTypeAny, {
|
|
2523
|
+
type: "exit";
|
|
2524
|
+
sessionId: string;
|
|
2525
|
+
exitCode: number;
|
|
2526
|
+
}, {
|
|
2527
|
+
type: "exit";
|
|
2528
|
+
sessionId: string;
|
|
2529
|
+
exitCode: number;
|
|
2530
|
+
}>, z.ZodObject<{
|
|
2531
|
+
type: z.ZodLiteral<"title">;
|
|
2532
|
+
sessionId: z.ZodString;
|
|
2533
|
+
title: z.ZodString;
|
|
2534
|
+
}, "strip", z.ZodTypeAny, {
|
|
2535
|
+
type: "title";
|
|
2536
|
+
sessionId: string;
|
|
2537
|
+
title: string;
|
|
2538
|
+
}, {
|
|
2539
|
+
type: "title";
|
|
2540
|
+
sessionId: string;
|
|
2541
|
+
title: string;
|
|
2542
|
+
}>, z.ZodObject<{
|
|
2543
|
+
type: z.ZodLiteral<"buffer">;
|
|
2544
|
+
sessionId: z.ZodString;
|
|
2545
|
+
data: z.ZodString;
|
|
2546
|
+
}, "strip", z.ZodTypeAny, {
|
|
2547
|
+
type: "buffer";
|
|
2548
|
+
sessionId: string;
|
|
2549
|
+
data: string;
|
|
2550
|
+
}, {
|
|
2551
|
+
type: "buffer";
|
|
2552
|
+
sessionId: string;
|
|
2553
|
+
data: string;
|
|
2554
|
+
}>, z.ZodObject<{
|
|
2555
|
+
type: z.ZodLiteral<"list">;
|
|
2556
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
2557
|
+
id: z.ZodString;
|
|
2558
|
+
title: z.ZodString;
|
|
2559
|
+
command: z.ZodString;
|
|
2560
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
2561
|
+
platform: z.ZodEnum<["windows", "macos", "common"]>;
|
|
2562
|
+
isExited: z.ZodBoolean;
|
|
2563
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
2564
|
+
}, "strip", z.ZodTypeAny, {
|
|
2565
|
+
command: string;
|
|
2566
|
+
args: string[];
|
|
2567
|
+
platform: "windows" | "macos" | "common";
|
|
2568
|
+
exitCode: number | null;
|
|
2569
|
+
title: string;
|
|
2570
|
+
id: string;
|
|
2571
|
+
isExited: boolean;
|
|
2572
|
+
}, {
|
|
2573
|
+
command: string;
|
|
2574
|
+
args: string[];
|
|
2575
|
+
platform: "windows" | "macos" | "common";
|
|
2576
|
+
exitCode: number | null;
|
|
2577
|
+
title: string;
|
|
2578
|
+
id: string;
|
|
2579
|
+
isExited: boolean;
|
|
2580
|
+
}>, "many">;
|
|
2581
|
+
}, "strip", z.ZodTypeAny, {
|
|
2582
|
+
type: "list";
|
|
2583
|
+
sessions: {
|
|
2584
|
+
command: string;
|
|
2585
|
+
args: string[];
|
|
2586
|
+
platform: "windows" | "macos" | "common";
|
|
2587
|
+
exitCode: number | null;
|
|
2588
|
+
title: string;
|
|
2589
|
+
id: string;
|
|
2590
|
+
isExited: boolean;
|
|
2591
|
+
}[];
|
|
2592
|
+
}, {
|
|
2593
|
+
type: "list";
|
|
2594
|
+
sessions: {
|
|
2595
|
+
command: string;
|
|
2596
|
+
args: string[];
|
|
2597
|
+
platform: "windows" | "macos" | "common";
|
|
2598
|
+
exitCode: number | null;
|
|
2599
|
+
title: string;
|
|
2600
|
+
id: string;
|
|
2601
|
+
isExited: boolean;
|
|
2602
|
+
}[];
|
|
2603
|
+
}>, z.ZodObject<{
|
|
2604
|
+
type: z.ZodLiteral<"error">;
|
|
2605
|
+
code: z.ZodEnum<["INVALID_JSON", "INVALID_MESSAGE", "SESSION_NOT_FOUND"]>;
|
|
2606
|
+
message: z.ZodString;
|
|
2607
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
2608
|
+
}, "strip", z.ZodTypeAny, {
|
|
2609
|
+
type: "error";
|
|
2610
|
+
code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND";
|
|
2611
|
+
message: string;
|
|
2612
|
+
sessionId?: string | undefined;
|
|
2613
|
+
}, {
|
|
2614
|
+
type: "error";
|
|
2615
|
+
code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND";
|
|
2616
|
+
message: string;
|
|
2617
|
+
sessionId?: string | undefined;
|
|
2618
|
+
}>]>;
|
|
2619
|
+
type PtyClientMessage = z.infer<typeof PtyClientMessageSchema>;
|
|
2620
|
+
type PtyServerMessage = z.infer<typeof PtyServerMessageSchema>;
|
|
2621
|
+
type PtySessionInfo = z.infer<typeof PtySessionInfoSchema>;
|
|
2622
|
+
type PtyPlatform = z.infer<typeof PtyPlatformSchema>;
|
|
1711
2623
|
//#endregion
|
|
1712
|
-
export { type AIToolOption, AI_TOOLS, type ArchiveMeta, type Change, type ChangeFile, ChangeFileSchema, type ChangeMeta, ChangeSchema, CliExecutor, type CliResult, type CliSniffResult, type CliStreamEvent, ConfigManager, DEFAULT_CONFIG, type Delta, type DeltaOperation, DeltaOperationType, DeltaSchema, type DeltaSpec, DeltaSpecSchema, type ExportSnapshot, type FileChangeEvent, type FileChangeType, MarkdownParser, OpenSpecAdapter, type OpenSpecUIConfig, OpenSpecUIConfigSchema, OpenSpecWatcher, type PathCallback, ProjectWatcher, ReactiveContext, ReactiveState, type ReactiveStateOptions, type Requirement, RequirementSchema, type Spec, type SpecMeta, SpecSchema, type Task, TaskSchema, type
|
|
2624
|
+
export { type AIToolOption, AI_TOOLS, type ApplyInstructions, ApplyInstructionsSchema, type ApplyTask, ApplyTaskSchema, type ArchiveMeta, type ArtifactInstructions, ArtifactInstructionsSchema, type ArtifactStatus, ArtifactStatusSchema, type Change, type ChangeFile, ChangeFileSchema, type ChangeMeta, ChangeSchema, type ChangeStatus, ChangeStatusSchema, CliExecutor, type CliResult, type CliSniffResult, type CliStreamEvent, ConfigManager, DEFAULT_CONFIG, type Delta, type DeltaOperation, DeltaOperationType, DeltaSchema, type DeltaSpec, DeltaSpecSchema, type DependencyInfo, DependencyInfoSchema, type ExportSnapshot, type FileChangeEvent, type FileChangeType, MarkdownParser, OpenSpecAdapter, type OpenSpecUIConfig, OpenSpecUIConfigSchema, OpenSpecWatcher, OpsxKernel, type PathCallback, ProjectWatcher, PtyAttachMessageSchema, PtyBufferResponseSchema, type PtyClientMessage, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, type PtyPlatform, PtyPlatformSchema, PtyResizeMessageSchema, type PtyServerMessage, PtyServerMessageSchema, type PtySessionInfo, PtyTitleResponseSchema, ReactiveContext, ReactiveState, type ReactiveStateOptions, type Requirement, RequirementSchema, type SchemaArtifact, SchemaArtifactSchema, type SchemaDetail, SchemaDetailSchema, type SchemaInfo, SchemaInfoSchema, type SchemaResolution, SchemaResolutionSchema, type Spec, type SpecMeta, SpecSchema, type Task, TaskSchema, type TemplateContentMap, type TemplatesMap, TemplatesSchema, type ToolConfig, type ValidationIssue, type ValidationResult, Validator, type WatchEvent, type WatchEventType, acquireWatcher, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createFileChangeObservable, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getProjectWatcher, getToolById, getWatchedProjectDir, initWatcherPool, isGlobPattern, isToolConfigured, isWatcherPoolInitialized, parseCliCommand, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, sniffGlobalCli };
|