@wizdear/atlas-code 0.2.4 → 0.2.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.
Files changed (93) hide show
  1. package/dist/agent-factory.d.ts +8 -1
  2. package/dist/agent-factory.d.ts.map +1 -1
  3. package/dist/agent-factory.js +42 -2
  4. package/dist/agent-factory.js.map +1 -1
  5. package/dist/cli.d.ts +7 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +8 -0
  8. package/dist/cli.js.map +1 -1
  9. package/dist/discovery.d.ts +9 -0
  10. package/dist/discovery.d.ts.map +1 -1
  11. package/dist/discovery.js +4 -4
  12. package/dist/discovery.js.map +1 -1
  13. package/dist/extension.d.ts +9 -2
  14. package/dist/extension.d.ts.map +1 -1
  15. package/dist/extension.js +1096 -333
  16. package/dist/extension.js.map +1 -1
  17. package/dist/gate.d.ts +1 -1
  18. package/dist/gate.d.ts.map +1 -1
  19. package/dist/gate.js.map +1 -1
  20. package/dist/orchestrator.d.ts +0 -2
  21. package/dist/orchestrator.d.ts.map +1 -1
  22. package/dist/orchestrator.js +0 -1
  23. package/dist/orchestrator.js.map +1 -1
  24. package/dist/pipeline-editor.d.ts +2 -0
  25. package/dist/pipeline-editor.d.ts.map +1 -1
  26. package/dist/pipeline-editor.js +36 -5
  27. package/dist/pipeline-editor.js.map +1 -1
  28. package/dist/pipeline.d.ts +2 -5
  29. package/dist/pipeline.d.ts.map +1 -1
  30. package/dist/pipeline.js +4 -3
  31. package/dist/pipeline.js.map +1 -1
  32. package/dist/planner.d.ts +9 -0
  33. package/dist/planner.d.ts.map +1 -1
  34. package/dist/planner.js +20 -10
  35. package/dist/planner.js.map +1 -1
  36. package/dist/roles/architect.d.ts +1 -1
  37. package/dist/roles/architect.d.ts.map +1 -1
  38. package/dist/roles/architect.js +1 -1
  39. package/dist/roles/architect.js.map +1 -1
  40. package/dist/roles/documenter.d.ts +1 -1
  41. package/dist/roles/documenter.d.ts.map +1 -1
  42. package/dist/roles/documenter.js +11 -0
  43. package/dist/roles/documenter.js.map +1 -1
  44. package/dist/roles/index.d.ts +1 -0
  45. package/dist/roles/index.d.ts.map +1 -1
  46. package/dist/roles/index.js +3 -0
  47. package/dist/roles/index.js.map +1 -1
  48. package/dist/roles/recover.d.ts +5 -0
  49. package/dist/roles/recover.d.ts.map +1 -0
  50. package/dist/roles/recover.js +82 -0
  51. package/dist/roles/recover.js.map +1 -0
  52. package/dist/router.d.ts.map +1 -1
  53. package/dist/router.js +6 -6
  54. package/dist/router.js.map +1 -1
  55. package/dist/standards.d.ts.map +1 -1
  56. package/dist/standards.js +1 -0
  57. package/dist/standards.js.map +1 -1
  58. package/dist/step-executor.d.ts +2 -0
  59. package/dist/step-executor.d.ts.map +1 -1
  60. package/dist/step-executor.js +16 -4
  61. package/dist/step-executor.js.map +1 -1
  62. package/dist/store.d.ts +3 -0
  63. package/dist/store.d.ts.map +1 -1
  64. package/dist/store.js +48 -19
  65. package/dist/store.js.map +1 -1
  66. package/dist/system-architect.d.ts +9 -0
  67. package/dist/system-architect.d.ts.map +1 -1
  68. package/dist/system-architect.js +11 -9
  69. package/dist/system-architect.js.map +1 -1
  70. package/dist/telegram/bridge.d.ts +39 -0
  71. package/dist/telegram/bridge.d.ts.map +1 -0
  72. package/dist/telegram/bridge.js +380 -0
  73. package/dist/telegram/bridge.js.map +1 -0
  74. package/dist/telegram/formatter.d.ts +15 -0
  75. package/dist/telegram/formatter.d.ts.map +1 -0
  76. package/dist/telegram/formatter.js +86 -0
  77. package/dist/telegram/formatter.js.map +1 -0
  78. package/dist/telegram/renderer.d.ts +45 -0
  79. package/dist/telegram/renderer.d.ts.map +1 -0
  80. package/dist/telegram/renderer.js +150 -0
  81. package/dist/telegram/renderer.js.map +1 -0
  82. package/dist/telegram/telegram-api.d.ts +84 -0
  83. package/dist/telegram/telegram-api.d.ts.map +1 -0
  84. package/dist/telegram/telegram-api.js +134 -0
  85. package/dist/telegram/telegram-api.js.map +1 -0
  86. package/dist/types.d.ts +10 -1
  87. package/dist/types.d.ts.map +1 -1
  88. package/dist/types.js.map +1 -1
  89. package/dist/ui.d.ts +1 -1
  90. package/dist/ui.d.ts.map +1 -1
  91. package/dist/ui.js +2 -0
  92. package/dist/ui.js.map +1 -1
  93. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Telegram Bot API wrapper using fetch (no external SDK).
3
+ */
4
+ export class TelegramAPI {
5
+ baseUrl;
6
+ chatId;
7
+ pollOffset = 0;
8
+ /** Pending promise resolvers for interactive UI. */
9
+ pendingCallback = null;
10
+ pendingText = null;
11
+ constructor(token, chatId) {
12
+ this.baseUrl = `https://api.telegram.org/bot${token}`;
13
+ this.chatId = chatId ?? "";
14
+ }
15
+ /** Set the chat ID (used during auto-discovery). */
16
+ setChatId(chatId) {
17
+ this.chatId = chatId;
18
+ }
19
+ /** Whether a chat ID has been set. */
20
+ hasChatId() {
21
+ return this.chatId !== "";
22
+ }
23
+ /** Send a text message. Returns the message_id. Set parseMode to null to send plain text. */
24
+ async sendMessage(text, extra) {
25
+ const body = {
26
+ chat_id: this.chatId,
27
+ text,
28
+ parse_mode: "Markdown",
29
+ ...extra,
30
+ };
31
+ // Remove parse_mode if explicitly set to falsy (plain text mode)
32
+ if (extra && "parse_mode" in extra && !extra.parse_mode) {
33
+ delete body.parse_mode;
34
+ }
35
+ const res = await fetch(`${this.baseUrl}/sendMessage`, {
36
+ method: "POST",
37
+ headers: { "Content-Type": "application/json" },
38
+ body: JSON.stringify(body),
39
+ });
40
+ const data = (await res.json());
41
+ if (!data.ok || !data.result) {
42
+ throw new Error(`sendMessage failed: ${JSON.stringify(data)}`);
43
+ }
44
+ return data.result.message_id;
45
+ }
46
+ /** Edit an existing message's text. Silently ignores "same text" errors. */
47
+ async editMessage(messageId, text, extra) {
48
+ const body = {
49
+ chat_id: this.chatId,
50
+ message_id: messageId,
51
+ text,
52
+ parse_mode: "Markdown",
53
+ ...extra,
54
+ };
55
+ if (extra && "parse_mode" in extra && !extra.parse_mode) {
56
+ delete body.parse_mode;
57
+ }
58
+ try {
59
+ await fetch(`${this.baseUrl}/editMessageText`, {
60
+ method: "POST",
61
+ headers: { "Content-Type": "application/json" },
62
+ body: JSON.stringify(body),
63
+ });
64
+ }
65
+ catch {
66
+ // Ignore network errors on edit (non-critical)
67
+ }
68
+ }
69
+ /** Register bot commands in Telegram's menu. */
70
+ async setMyCommands(commands) {
71
+ await fetch(`${this.baseUrl}/setMyCommands`, {
72
+ method: "POST",
73
+ headers: { "Content-Type": "application/json" },
74
+ body: JSON.stringify({ commands }),
75
+ }).catch(() => { });
76
+ }
77
+ /** Acknowledge a callback query (required by Telegram to dismiss loading state). */
78
+ async answerCallbackQuery(callbackQueryId, text) {
79
+ await fetch(`${this.baseUrl}/answerCallbackQuery`, {
80
+ method: "POST",
81
+ headers: { "Content-Type": "application/json" },
82
+ body: JSON.stringify({ callback_query_id: callbackQueryId, text }),
83
+ });
84
+ }
85
+ /** Long-poll for updates. Returns new updates (30s timeout). */
86
+ async getUpdates() {
87
+ const res = await fetch(`${this.baseUrl}/getUpdates?offset=${this.pollOffset}&timeout=30`);
88
+ const data = (await res.json());
89
+ const updates = data.result ?? [];
90
+ for (const u of updates) {
91
+ this.pollOffset = u.update_id + 1;
92
+ }
93
+ return updates;
94
+ }
95
+ /** Wait for the next callback query data (used by select/confirm UI). */
96
+ waitForCallbackQuery() {
97
+ return new Promise((resolve) => {
98
+ this.pendingCallback = resolve;
99
+ });
100
+ }
101
+ /** Wait for the next text message (used by input/editor UI). */
102
+ waitForTextMessage() {
103
+ return new Promise((resolve) => {
104
+ this.pendingText = resolve;
105
+ });
106
+ }
107
+ /** Resolve a pending callback query promise. Returns true if resolved. */
108
+ resolveCallback(data) {
109
+ if (this.pendingCallback) {
110
+ this.pendingCallback(data);
111
+ this.pendingCallback = null;
112
+ return true;
113
+ }
114
+ return false;
115
+ }
116
+ /** Resolve a pending text message promise. Returns true if resolved. */
117
+ resolveText(text) {
118
+ if (this.pendingText) {
119
+ this.pendingText(text);
120
+ this.pendingText = null;
121
+ return true;
122
+ }
123
+ return false;
124
+ }
125
+ /** Whether there is a pending callback or text promise. */
126
+ hasPending() {
127
+ return this.pendingCallback !== null || this.pendingText !== null;
128
+ }
129
+ /** Whether there is a pending text promise. */
130
+ hasPendingText() {
131
+ return this.pendingText !== null;
132
+ }
133
+ }
134
+ //# sourceMappingURL=telegram-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telegram-api.js","sourceRoot":"","sources":["../../src/telegram/telegram-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmCH,MAAM,OAAO,WAAW;IACN,OAAO,CAAS;IACzB,MAAM,CAAS;IACf,UAAU,GAAG,CAAC,CAAC;IAEvB,oDAAoD;IAC5C,eAAe,GAAqC,IAAI,CAAC;IACzD,WAAW,GAAqC,IAAI,CAAC;IAE7D,YAAY,KAAa,EAAE,MAAe,EAAE;QAC3C,IAAI,CAAC,OAAO,GAAG,+BAA+B,KAAK,EAAE,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IAAA,CAC3B;IAED,oDAAoD;IACpD,SAAS,CAAC,MAAc,EAAQ;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAAA,CACrB;IAED,sCAAsC;IACtC,SAAS,GAAY;QACpB,OAAO,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC;IAAA,CAC1B;IAED,6FAA6F;IAC7F,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,KAA+B,EAAmB;QACjF,MAAM,IAAI,GAA4B;YACrC,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,IAAI;YACJ,UAAU,EAAE,UAAU;YACtB,GAAG,KAAK;SACR,CAAC;QACF,iEAAiE;QACjE,IAAI,KAAK,IAAI,YAAY,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;YACzD,OAAO,IAAI,CAAC,UAAU,C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AC,eAAe,GAAG,OAAO,CAAC;QAAA,CAC/B,CAAC,CAAC;IAAA,CACH;IAED,gEAAgE;IAChE,kBAAkB,GAAoB;QACrC,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE,CAAC;YACvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAAA,CAC3B,CAAC,CAAC;IAAA,CACH;IAED,0EAA0E;IAC1E,eAAe,CAAC,IAAY,EAAW;QACtC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IAAA,CACb;IAED,wEAAwE;IACxE,WAAW,CAAC,IAAY,EAAW;QAClC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IAAA,CACb;IAED,2DAA2D;IAC3D,UAAU,GAAY;QACrB,OAAO,IAAI,CAAC,eAAe,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IAAA,CAClE;IAED,+CAA+C;IAC/C,cAAc,GAAY;QACzB,OAAO,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC;IAAA,CACjC;CACD","sourcesContent":["/**\n * Telegram Bot API wrapper using fetch (no external SDK).\n */\n\n/** Interface for Telegram API operations (enables mocking in tests). */\nexport interface ITelegramAPI {\n\tsendMessage(text: string, extra?: Record<string, unknown>): Promise<number>;\n\teditMessage(messageId: number, text: string, extra?: Record<string, unknown>): Promise<void>;\n\tanswerCallbackQuery(callbackQueryId: string, text?: string): Promise<void>;\n\tgetUpdates(): Promise<TelegramUpdate[]>;\n\twaitForCallbackQuery(): Promise<string>;\n\twaitForTextMessage(): Promise<string>;\n\tresolveCallback(data: string): boolean;\n\tresolveText(text: string): boolean;\n\thasPending(): boolean;\n\thasPendingText(): boolean;\n\tsetChatId(chatId: string): void;\n\thasChatId(): boolean;\n}\n\n/** Subset of Telegram Update object. */\nexport interface TelegramUpdate {\n\tupdate_id: number;\n\tmessage?: {\n\t\tmessage_id: number;\n\t\tchat: { id: number };\n\t\ttext?: string;\n\t\tfrom?: { id: number };\n\t};\n\tcallback_query?: {\n\t\tid: string;\n\t\tdata?: string;\n\t\tfrom: { id: number };\n\t\tmessage?: { message_id: number; chat: { id: number } };\n\t};\n}\n\nexport class TelegramAPI {\n\tprivate readonly baseUrl: string;\n\tprivate chatId: string;\n\tprivate pollOffset = 0;\n\n\t/** Pending promise resolvers for interactive UI. */\n\tprivate pendingCallback: ((value: string) => void) | null = null;\n\tprivate pendingText: ((value: string) => void) | null = null;\n\n\tconstructor(token: string, chatId?: string) {\n\t\tthis.baseUrl = `https://api.telegram.org/bot${token}`;\n\t\tthis.chatId = chatId ?? \"\";\n\t}\n\n\t/** Set the chat ID (used during auto-discovery). */\n\tsetChatId(chatId: string): void {\n\t\tthis.chatId = chatId;\n\t}\n\n\t/** Whether a chat ID has been set. */\n\thasChatId(): boolean {\n\t\treturn this.chatId !== \"\";\n\t}\n\n\t/** Send a text message. Returns the message_id. Set parseMode to null to send plain text. */\n\tasync sendMessage(text: string, extra?: Record<string, unknown>): Promise<number> {\n\t\tconst body: Record<string, unknown> = {\n\t\t\tchat_id: this.chatId,\n\t\t\ttext,\n\t\t\tparse_mode: \"Markdown\",\n\t\t\t...extra,\n\t\t};\n\t\t// Remove parse_mode if explicitly set to falsy (plain text mode)\n\t\tif (extra && \"parse_mode\" in extra && !extra.parse_mode) {\n\t\t\tdelete body.parse_mode;\n\t\t}\n\t\tconst res = await fetch(`${this.baseUrl}/sendMessage`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(body),\n\t\t});\n\t\tconst data = (await res.json()) as { ok: boolean; result?: { message_id: number } };\n\t\tif (!data.ok || !data.result) {\n\t\t\tthrow new Error(`sendMessage failed: ${JSON.stringify(data)}`);\n\t\t}\n\t\treturn data.result.message_id;\n\t}\n\n\t/** Edit an existing message's text. Silently ignores \"same text\" errors. */\n\tasync editMessage(messageId: number, text: string, extra?: Record<string, unknown>): Promise<void> {\n\t\tconst body: Record<string, unknown> = {\n\t\t\tchat_id: this.chatId,\n\t\t\tmessage_id: messageId,\n\t\t\ttext,\n\t\t\tparse_mode: \"Markdown\",\n\t\t\t...extra,\n\t\t};\n\t\tif (extra && \"parse_mode\" in extra && !extra.parse_mode) {\n\t\t\tdelete body.parse_mode;\n\t\t}\n\t\ttry {\n\t\t\tawait fetch(`${this.baseUrl}/editMessageText`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\t\t} catch {\n\t\t\t// Ignore network errors on edit (non-critical)\n\t\t}\n\t}\n\n\t/** Register bot commands in Telegram's menu. */\n\tasync setMyCommands(commands: Array<{ command: string; description: string }>): Promise<void> {\n\t\tawait fetch(`${this.baseUrl}/setMyCommands`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify({ commands }),\n\t\t}).catch(() => {});\n\t}\n\n\t/** Acknowledge a callback query (required by Telegram to dismiss loading state). */\n\tasync answerCallbackQuery(callbackQueryId: string, text?: string): Promise<void> {\n\t\tawait fetch(`${this.baseUrl}/answerCallbackQuery`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify({ callback_query_id: callbackQueryId, text }),\n\t\t});\n\t}\n\n\t/** Long-poll for updates. Returns new updates (30s timeout). */\n\tasync getUpdates(): Promise<TelegramUpdate[]> {\n\t\tconst res = await fetch(`${this.baseUrl}/getUpdates?offset=${this.pollOffset}&timeout=30`);\n\t\tconst data = (await res.json()) as { ok: boolean; result?: TelegramUpdate[] };\n\t\tconst updates = data.result ?? [];\n\t\tfor (const u of updates) {\n\t\t\tthis.pollOffset = u.update_id + 1;\n\t\t}\n\t\treturn updates;\n\t}\n\n\t/** Wait for the next callback query data (used by select/confirm UI). */\n\twaitForCallbackQuery(): Promise<string> {\n\t\treturn new Promise<string>((resolve) => {\n\t\t\tthis.pendingCallback = resolve;\n\t\t});\n\t}\n\n\t/** Wait for the next text message (used by input/editor UI). */\n\twaitForTextMessage(): Promise<string> {\n\t\treturn new Promise<string>((resolve) => {\n\t\t\tthis.pendingText = resolve;\n\t\t});\n\t}\n\n\t/** Resolve a pending callback query promise. Returns true if resolved. */\n\tresolveCallback(data: string): boolean {\n\t\tif (this.pendingCallback) {\n\t\t\tthis.pendingCallback(data);\n\t\t\tthis.pendingCallback = null;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Resolve a pending text message promise. Returns true if resolved. */\n\tresolveText(text: string): boolean {\n\t\tif (this.pendingText) {\n\t\t\tthis.pendingText(text);\n\t\t\tthis.pendingText = null;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Whether there is a pending callback or text promise. */\n\thasPending(): boolean {\n\t\treturn this.pendingCallback !== null || this.pendingText !== null;\n\t}\n\n\t/** Whether there is a pending text promise. */\n\thasPendingText(): boolean {\n\t\treturn this.pendingText !== null;\n\t}\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface WorkflowDefinition {
8
8
  steps: PipelineStep[];
9
9
  }
10
10
  /** Agent role. */
11
- export type AgentRole = "planner" | "architect" | "developer" | "tester" | "reviewer" | "cicd" | "analyzer" | "diagnostician" | "discovery" | "projectAnalyzer" | "documenter" | "standardsEnricher" | "systemArchitect";
11
+ export type AgentRole = "planner" | "architect" | "developer" | "tester" | "reviewer" | "cicd" | "analyzer" | "diagnostician" | "discovery" | "projectAnalyzer" | "documenter" | "standardsEnricher" | "systemArchitect" | "recover";
12
12
  /** Per-agent configuration. */
13
13
  export interface AgentRoleConfig {
14
14
  role: AgentRole;
@@ -123,6 +123,13 @@ export interface TestingConfig {
123
123
  /** CI verification commands auto-detected from CI config or manually configured. */
124
124
  ciChecks: CiCheck[];
125
125
  }
126
+ /** Telegram bridge configuration. */
127
+ export interface TelegramConfig {
128
+ /** Bot API token. */
129
+ token?: string;
130
+ /** Target chat ID. Auto-discovered from first incoming message if not set. */
131
+ chatId?: string;
132
+ }
126
133
  /** Per-project configuration. */
127
134
  export interface VibeConfig {
128
135
  autonomyLevel: AutonomyLevel;
@@ -136,6 +143,8 @@ export interface VibeConfig {
136
143
  testing: TestingConfig;
137
144
  /** Base branch for feature branching and merging. Auto-detected from current branch if not set. */
138
145
  baseBranch?: string;
146
+ /** Telegram bridge settings. */
147
+ telegram?: TelegramConfig;
139
148
  }
140
149
  /** Feature status value (for status.json). Distinct from PipelineStatus; represents feature-level progress. */
141
150
  export type FeatureStatusValue = "planned" | "designing" | "branching" | "implementing" | "testing" | "reviewing" | "merging" | "done" | "blocked" | "failed";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD;0GAC0G;AAC1G,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE3F,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,EAAE,CAAC;CACtB;AAID,kBAAkB;AAClB,MAAM,MAAM,SAAS,GAClB,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,eAAe,GACf,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,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID,kBAAkB;AAClB,MAAM,MAAM,aAAa,GACtB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,YAAY,GACZ,cAAc,GACd,eAAe,GACf,eAAe,GACf,SAAS,GACT,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,cAAc,GACd,iBAAiB,CAAC;AAErB,+CAA+C;AAC/C,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B","sourcesContent":["import type { Message } from \"@mariozechner/pi-ai\";\n\n// ─── Workflow ────────────────────────────────────────────────────────────────\n\n/** Workflow type: pipeline structure varies by requirement nature.\n * \"mixed\" indicates the plan has composite requirements. Not used as individual feature pipeline type. */\nexport type WorkflowType = \"new_feature\" | \"enhancement\" | \"bugfix\" | \"refactor\" | \"mixed\";\n\n/** Workflow definition: pipeline step list per type. */\nexport interface WorkflowDefinition {\n\ttype: WorkflowType;\n\tsteps: PipelineStep[];\n}\n\n// ─── Agent ───────────────────────────────────────────────────────────────────\n\n/** Agent role. */\nexport type AgentRole =\n\t| \"planner\"\n\t| \"architect\"\n\t| \"developer\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"cicd\"\n\t| \"analyzer\"\n\t| \"diagnostician\"\n\t| \"discovery\"\n\t| \"projectAnalyzer\"\n\t| \"documenter\"\n\t| \"standardsEnricher\"\n\t| \"systemArchitect\";\n\n/** Per-agent configuration. */\nexport interface AgentRoleConfig {\n\trole: AgentRole;\n\tsystemPrompt: string;\n\ttools: string[];\n\tmodel?: string;\n\tcontextScope: string[];\n}\n\n// ─── Pipeline ────────────────────────────────────────────────────────────────\n\n/** Pipeline status. */\nexport type PipelineStatus = \"pending\" | \"running\" | \"blocked\" | \"done\" | \"failed\" | \"aborted\";\n\n/** Gate condition type. */\nexport type GateConditionType =\n\t| \"test_pass\"\n\t| \"review_approve\"\n\t| \"file_exists\"\n\t| \"regression_pass\"\n\t| \"all_tests_pass\"\n\t| \"diagnosis_approve\"\n\t| \"merge_approve\";\n\n/** Condition for advancing to the next step. */\nexport interface GateCondition {\n\ttype: GateConditionType;\n\ttarget: string;\n}\n\n/** A single step in the pipeline. */\nexport interface PipelineStep {\n\tagent: AgentRole;\n\taction: string;\n\tinputs: string[];\n\toutputs: string[];\n\tgate?: GateCondition;\n\tskip?: boolean;\n\t/** When true, load conversation history from prior steps of the same role. Default: false. */\n\tinheritPriorHistory?: boolean;\n}\n\n/** Workflow state for a single feature. */\nexport interface FeaturePipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tsteps: PipelineStep[];\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Standards ───────────────────────────────────────────────────────────────\n\n/** Standard file names (14 types). */\nexport type StandardFileName =\n\t| \"coding-style.md\"\n\t| \"coding-conventions.md\"\n\t| \"tech-stack.md\"\n\t| \"architecture-principles.md\"\n\t| \"design-guide.md\"\n\t| \"api-design.md\"\n\t| \"testing-standards.md\"\n\t| \"documentation.md\"\n\t| \"git-workflow.md\"\n\t| \"security-policy.md\"\n\t| \"dependency-policy.md\"\n\t| \"performance-guidelines.md\"\n\t| \"accessibility.md\"\n\t| \"observability.md\"\n\t| \"logging.md\"\n\t| \".artifact-standards.md\";\n\n/** Standards file mapping type per role. */\nexport type RoleStandardsMapping = Record<AgentRole, StandardFileName[]>;\n\n/** Standards system configuration. */\nexport interface StandardsConfig {\n\tsources: string[];\n\troleMapping?: Partial<Record<AgentRole, string[]>>;\n}\n\n// ─── Config ──────────────────────────────────────────────────────────────────\n\n/** Autonomy level. */\nexport type AutonomyLevel = \"full_auto\" | \"gate_auto\" | \"step_by_step\";\n\n/** Gate activation settings. */\nexport interface GateConfig {\n\trequireRequirementsApproval: boolean;\n\trequirePlanApproval: boolean;\n\trequireDesignApproval: boolean;\n\trequireSystemDesignApproval: boolean;\n\trequireMergeApproval: boolean;\n\trequireDiagnosisApproval: boolean;\n}\n\n/** Retry count settings. */\nexport interface RetryConfig {\n\tmaxTestRetries: number;\n\tmaxReviewRetries: number;\n\tmaxRegressionRetries: number;\n\t/** Maximum retries for transient step execution errors (e.g., network \"terminated\", API 5xx). Defaults to 2. */\n\tmaxStepRetries: number;\n}\n\n/** Notification channel. */\nexport type NotificationChannel = \"terminal\" | \"slack\" | \"webhook\";\n\n/** Notification settings. */\nexport interface NotificationConfig {\n\tonStepComplete: boolean;\n\tonBlocked: boolean;\n\tonPRReady: boolean;\n\tchannel: NotificationChannel;\n}\n\n/** Project analysis settings. */\nexport interface ProjectAnalysisConfig {\n\tautoAnalyzeOnInit: boolean;\n\tstaleThresholdDays: number;\n\texcludePaths: string[];\n}\n\n/** Discovery settings. */\nexport interface DiscoveryConfig {\n\tmaxQuestionRounds: number;\n\tskipIfClear: boolean;\n}\n\n/** Compaction settings. */\nexport interface CompactionConfig {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n}\n\n/** CI verification check (lint, type-check, format, etc.). */\nexport interface CiCheck {\n\t/** Human-readable name (e.g., \"lint\", \"type-check\", \"format\"). */\n\tname: string;\n\t/** Shell command to execute (e.g., \"make lint\", \"mypy app/\"). */\n\tcommand: string;\n}\n\n/** Testing configuration. Auto-detected during project analysis or manually configured. */\nexport interface TestingConfig {\n\t/** Command to run the project's test suite (e.g., \"make test\", \"npm test\", \"pytest tests/\"). Empty = not configured. */\n\ttestCommand: string;\n\t/** Timeout in seconds for test execution. */\n\ttestTimeout: number;\n\t/** Whether regression step should run existing project tests. */\n\trunExistingTests: boolean;\n\t/** Test file patterns to exclude from execution (e.g., [\"test_tools_async.py\"]). */\n\texcludePatterns: string[];\n\t/** CI verification commands auto-detected from CI config or manually configured. */\n\tciChecks: CiCheck[];\n}\n\n/** Per-project configuration. */\nexport interface VibeConfig {\n\tautonomyLevel: AutonomyLevel;\n\tgates: GateConfig;\n\tretry: RetryConfig;\n\tstandards: StandardsConfig;\n\tnotifications: NotificationConfig;\n\tprojectAnalysis: ProjectAnalysisConfig;\n\tdiscovery: DiscoveryConfig;\n\tcompaction: CompactionConfig;\n\ttesting: TestingConfig;\n\t/** Base branch for feature branching and merging. Auto-detected from current branch if not set. */\n\tbaseBranch?: string;\n}\n\n// ─── Store ───────────────────────────────────────────────────────────────────\n\n/** Feature status value (for status.json). Distinct from PipelineStatus; represents feature-level progress. */\nexport type FeatureStatusValue =\n\t| \"planned\"\n\t| \"designing\"\n\t| \"branching\"\n\t| \"implementing\"\n\t| \"testing\"\n\t| \"reviewing\"\n\t| \"merging\"\n\t| \"done\"\n\t| \"blocked\"\n\t| \"failed\";\n\n/** Feature status file structure (status.json). */\nexport interface FeatureStatus {\n\tstatus: FeatureStatusValue;\n\tupdatedAt: string;\n\tphase?: string;\n\terror?: string;\n}\n\n/** Feature complexity. */\nexport type FeatureComplexity = \"low\" | \"medium\" | \"high\";\n\n/** Individual feature entry in plan.json. */\nexport interface PlanFeature {\n\tfeatureId: string;\n\ttitle: string;\n\tstatus: FeatureStatusValue;\n\tpriority: number;\n\tdependencies: string[];\n\trequirementRefs?: string[];\n\testimatedComplexity?: FeatureComplexity;\n}\n\n/** Overall plan.json structure. */\nexport interface PlanData {\n\tproject: string;\n\tdescription: string;\n\tworkflowType: WorkflowType;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tfeatures: PlanFeature[];\n\tdependencyGraph: Record<string, string[]>;\n\trequirementsRef?: string;\n\tphases?: Record<string, string[]>;\n}\n\n/** Per-feature artifact file names. */\nexport type ArtifactName =\n\t| \"spec.md\"\n\t| \"design.md\"\n\t| \"impact-report.md\"\n\t| \"diagnosis.md\"\n\t| \"review.md\"\n\t| \"test-report.md\"\n\t| \"regression-report.md\"\n\t| \"retry-log.md\"\n\t| \"status.json\"\n\t| \"requirements.md\"\n\t| \"project-context.md\";\n\n// ─── Pipeline Persistence ─────────────────────────────────────────────────────\n\n/** Orchestration progress phase. */\nexport type OrchestrationPhase =\n\t| \"discovery\"\n\t| \"requirements_gate\"\n\t| \"system_architecture\"\n\t| \"system_design_gate\"\n\t| \"analyze\"\n\t| \"planning\"\n\t| \"plan_gate\"\n\t| \"orchestrating\"\n\t| \"single_pipeline\"\n\t| \"done\";\n\n/** Orchestration progress state (persisted to disk: .vibe/orchestration-state.json). */\nexport interface OrchestrationState {\n\tworkflowType: WorkflowType;\n\tphase: OrchestrationPhase;\n\tcompletedFeatures: string[];\n\tfailedFeatures: string[];\n\tskippedFeatures: string[];\n\trequirement: string;\n\toptions?: { parentFeatureId?: string; issueRef?: string };\n\t/** featureId used in single-feature path. */\n\tsingleFeatureId?: string;\n\t/** Resolved base branch for this orchestration run. */\n\tbaseBranch?: string;\n\tupdatedAt: string;\n}\n\n/** Persisted pipeline state (.vibe/features/{featureId}/pipeline.json). */\nexport interface PersistedPipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Checkpointing ───────────────────────────────────────────────────────────\n\n/** Agent conversation history checkpoint. */\nexport interface AgentCheckpoint {\n\t/** Agent role. */\n\trole: AgentRole;\n\t/** Execution action (design, implement, test, discovery, etc.). */\n\taction: string;\n\t/** Conversation message history (JSON-serializable Message[]). */\n\tmessages: Message[];\n\t/** Checkpoint creation time (ISO 8601). */\n\ttimestamp: string;\n\t/** Additional metadata (round count, retry count, etc.). */\n\tmetadata?: Record<string, unknown>;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** Event type. */\nexport type VibeEventType =\n\t| \"step_start\"\n\t| \"step_complete\"\n\t| \"step_failed\"\n\t| \"step_retry\"\n\t| \"gate_waiting\"\n\t| \"gate_approved\"\n\t| \"gate_rejected\"\n\t| \"blocked\"\n\t| \"pipeline_complete\"\n\t| \"standards_loaded\"\n\t| \"orchestration_start\"\n\t| \"feature_start\"\n\t| \"feature_complete\"\n\t| \"feature_skipped\"\n\t| \"orchestration_complete\"\n\t| \"gate_skipped\"\n\t| \"feature_aborted\";\n\n/** Event emitted during pipeline execution. */\nexport interface VibeEvent {\n\ttype: VibeEventType;\n\tfeatureId: string;\n\ttimestamp: string;\n\tstep?: PipelineStep;\n\tdata?: Record<string, unknown>;\n}\n"]}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD;0GAC0G;AAC1G,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAE3F,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,EAAE,CAAC;CACtB;AAID,kBAAkB;AAClB,MAAM,MAAM,SAAS,GAClB,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,mBAAmB,GACnB,iBAAiB,GACjB,SAAS,CAAC;AAEb,+BAA+B;AAC/B,MAAM,WAAW,eAAe;IAC/B,IAAI,EAA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AAC7C,MAAM,WAAW,eAAe;IAC/B,kBAAkB;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID,kBAAkB;AAClB,MAAM,MAAM,aAAa,GACtB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,YAAY,GACZ,cAAc,GACd,eAAe,GACf,eAAe,GACf,SAAS,GACT,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,iBAAiB,GACjB,wBAAwB,GACxB,cAAc,GACd,iBAAiB,CAAC;AAErB,+CAA+C;AAC/C,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B","sourcesContent":["import type { Message } from \"@mariozechner/pi-ai\";\n\n// ─── Workflow ────────────────────────────────────────────────────────────────\n\n/** Workflow type: pipeline structure varies by requirement nature.\n * \"mixed\" indicates the plan has composite requirements. Not used as individual feature pipeline type. */\nexport type WorkflowType = \"new_feature\" | \"enhancement\" | \"bugfix\" | \"refactor\" | \"mixed\";\n\n/** Workflow definition: pipeline step list per type. */\nexport interface WorkflowDefinition {\n\ttype: WorkflowType;\n\tsteps: PipelineStep[];\n}\n\n// ─── Agent ───────────────────────────────────────────────────────────────────\n\n/** Agent role. */\nexport type AgentRole =\n\t| \"planner\"\n\t| \"architect\"\n\t| \"developer\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"cicd\"\n\t| \"analyzer\"\n\t| \"diagnostician\"\n\t| \"discovery\"\n\t| \"projectAnalyzer\"\n\t| \"documenter\"\n\t| \"standardsEnricher\"\n\t| \"systemArchitect\"\n\t| \"recover\";\n\n/** Per-agent configuration. */\nexport interface AgentRoleConfig {\n\trole: AgentRole;\n\tsystemPrompt: string;\n\ttools: string[];\n\tmodel?: string;\n\tcontextScope: string[];\n}\n\n// ─── Pipeline ────────────────────────────────────────────────────────────────\n\n/** Pipeline status. */\nexport type PipelineStatus = \"pending\" | \"running\" | \"blocked\" | \"done\" | \"failed\" | \"aborted\";\n\n/** Gate condition type. */\nexport type GateConditionType =\n\t| \"test_pass\"\n\t| \"review_approve\"\n\t| \"file_exists\"\n\t| \"regression_pass\"\n\t| \"all_tests_pass\"\n\t| \"diagnosis_approve\"\n\t| \"merge_approve\";\n\n/** Condition for advancing to the next step. */\nexport interface GateCondition {\n\ttype: GateConditionType;\n\ttarget: string;\n}\n\n/** A single step in the pipeline. */\nexport interface PipelineStep {\n\tagent: AgentRole;\n\taction: string;\n\tinputs: string[];\n\toutputs: string[];\n\tgate?: GateCondition;\n\tskip?: boolean;\n\t/** When true, load conversation history from prior steps of the same role. Default: false. */\n\tinheritPriorHistory?: boolean;\n}\n\n/** Workflow state for a single feature. */\nexport interface FeaturePipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tsteps: PipelineStep[];\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Standards ───────────────────────────────────────────────────────────────\n\n/** Standard file names (14 types). */\nexport type StandardFileName =\n\t| \"coding-style.md\"\n\t| \"coding-conventions.md\"\n\t| \"tech-stack.md\"\n\t| \"architecture-principles.md\"\n\t| \"design-guide.md\"\n\t| \"api-design.md\"\n\t| \"testing-standards.md\"\n\t| \"documentation.md\"\n\t| \"git-workflow.md\"\n\t| \"security-policy.md\"\n\t| \"dependency-policy.md\"\n\t| \"performance-guidelines.md\"\n\t| \"accessibility.md\"\n\t| \"observability.md\"\n\t| \"logging.md\"\n\t| \".artifact-standards.md\";\n\n/** Standards file mapping type per role. */\nexport type RoleStandardsMapping = Record<AgentRole, StandardFileName[]>;\n\n/** Standards system configuration. */\nexport interface StandardsConfig {\n\tsources: string[];\n\troleMapping?: Partial<Record<AgentRole, string[]>>;\n}\n\n// ─── Config ──────────────────────────────────────────────────────────────────\n\n/** Autonomy level. */\nexport type AutonomyLevel = \"full_auto\" | \"gate_auto\" | \"step_by_step\";\n\n/** Gate activation settings. */\nexport interface GateConfig {\n\trequireRequirementsApproval: boolean;\n\trequirePlanApproval: boolean;\n\trequireDesignApproval: boolean;\n\trequireSystemDesignApproval: boolean;\n\trequireMergeApproval: boolean;\n\trequireDiagnosisApproval: boolean;\n}\n\n/** Retry count settings. */\nexport interface RetryConfig {\n\tmaxTestRetries: number;\n\tmaxReviewRetries: number;\n\tmaxRegressionRetries: number;\n\t/** Maximum retries for transient step execution errors (e.g., network \"terminated\", API 5xx). Defaults to 2. */\n\tmaxStepRetries: number;\n}\n\n/** Notification channel. */\nexport type NotificationChannel = \"terminal\" | \"slack\" | \"webhook\";\n\n/** Notification settings. */\nexport interface NotificationConfig {\n\tonStepComplete: boolean;\n\tonBlocked: boolean;\n\tonPRReady: boolean;\n\tchannel: NotificationChannel;\n}\n\n/** Project analysis settings. */\nexport interface ProjectAnalysisConfig {\n\tautoAnalyzeOnInit: boolean;\n\tstaleThresholdDays: number;\n\texcludePaths: string[];\n}\n\n/** Discovery settings. */\nexport interface DiscoveryConfig {\n\tmaxQuestionRounds: number;\n\tskipIfClear: boolean;\n}\n\n/** Compaction settings. */\nexport interface CompactionConfig {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n}\n\n/** CI verification check (lint, type-check, format, etc.). */\nexport interface CiCheck {\n\t/** Human-readable name (e.g., \"lint\", \"type-check\", \"format\"). */\n\tname: string;\n\t/** Shell command to execute (e.g., \"make lint\", \"mypy app/\"). */\n\tcommand: string;\n}\n\n/** Testing configuration. Auto-detected during project analysis or manually configured. */\nexport interface TestingConfig {\n\t/** Command to run the project's test suite (e.g., \"make test\", \"npm test\", \"pytest tests/\"). Empty = not configured. */\n\ttestCommand: string;\n\t/** Timeout in seconds for test execution. */\n\ttestTimeout: number;\n\t/** Whether regression step should run existing project tests. */\n\trunExistingTests: boolean;\n\t/** Test file patterns to exclude from execution (e.g., [\"test_tools_async.py\"]). */\n\texcludePatterns: string[];\n\t/** CI verification commands auto-detected from CI config or manually configured. */\n\tciChecks: CiCheck[];\n}\n\n/** Telegram bridge configuration. */\nexport interface TelegramConfig {\n\t/** Bot API token. */\n\ttoken?: string;\n\t/** Target chat ID. Auto-discovered from first incoming message if not set. */\n\tchatId?: string;\n}\n\n/** Per-project configuration. */\nexport interface VibeConfig {\n\tautonomyLevel: AutonomyLevel;\n\tgates: GateConfig;\n\tretry: RetryConfig;\n\tstandards: StandardsConfig;\n\tnotifications: NotificationConfig;\n\tprojectAnalysis: ProjectAnalysisConfig;\n\tdiscovery: DiscoveryConfig;\n\tcompaction: CompactionConfig;\n\ttesting: TestingConfig;\n\t/** Base branch for feature branching and merging. Auto-detected from current branch if not set. */\n\tbaseBranch?: string;\n\t/** Telegram bridge settings. */\n\ttelegram?: TelegramConfig;\n}\n\n// ─── Store ───────────────────────────────────────────────────────────────────\n\n/** Feature status value (for status.json). Distinct from PipelineStatus; represents feature-level progress. */\nexport type FeatureStatusValue =\n\t| \"planned\"\n\t| \"designing\"\n\t| \"branching\"\n\t| \"implementing\"\n\t| \"testing\"\n\t| \"reviewing\"\n\t| \"merging\"\n\t| \"done\"\n\t| \"blocked\"\n\t| \"failed\";\n\n/** Feature status file structure (status.json). */\nexport interface FeatureStatus {\n\tstatus: FeatureStatusValue;\n\tupdatedAt: string;\n\tphase?: string;\n\terror?: string;\n}\n\n/** Feature complexity. */\nexport type FeatureComplexity = \"low\" | \"medium\" | \"high\";\n\n/** Individual feature entry in plan.json. */\nexport interface PlanFeature {\n\tfeatureId: string;\n\ttitle: string;\n\tstatus: FeatureStatusValue;\n\tpriority: number;\n\tdependencies: string[];\n\trequirementRefs?: string[];\n\testimatedComplexity?: FeatureComplexity;\n}\n\n/** Overall plan.json structure. */\nexport interface PlanData {\n\tproject: string;\n\tdescription: string;\n\tworkflowType: WorkflowType;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tfeatures: PlanFeature[];\n\tdependencyGraph: Record<string, string[]>;\n\trequirementsRef?: string;\n\tphases?: Record<string, string[]>;\n}\n\n/** Per-feature artifact file names. */\nexport type ArtifactName =\n\t| \"spec.md\"\n\t| \"design.md\"\n\t| \"impact-report.md\"\n\t| \"diagnosis.md\"\n\t| \"review.md\"\n\t| \"test-report.md\"\n\t| \"regression-report.md\"\n\t| \"retry-log.md\"\n\t| \"status.json\"\n\t| \"requirements.md\"\n\t| \"project-context.md\";\n\n// ─── Pipeline Persistence ─────────────────────────────────────────────────────\n\n/** Orchestration progress phase. */\nexport type OrchestrationPhase =\n\t| \"discovery\"\n\t| \"requirements_gate\"\n\t| \"system_architecture\"\n\t| \"system_design_gate\"\n\t| \"analyze\"\n\t| \"planning\"\n\t| \"plan_gate\"\n\t| \"orchestrating\"\n\t| \"single_pipeline\"\n\t| \"done\";\n\n/** Orchestration progress state (persisted to disk: .vibe/orchestration-state.json). */\nexport interface OrchestrationState {\n\tworkflowType: WorkflowType;\n\tphase: OrchestrationPhase;\n\tcompletedFeatures: string[];\n\tfailedFeatures: string[];\n\tskippedFeatures: string[];\n\trequirement: string;\n\toptions?: { parentFeatureId?: string; issueRef?: string };\n\t/** featureId used in single-feature path. */\n\tsingleFeatureId?: string;\n\t/** Resolved base branch for this orchestration run. */\n\tbaseBranch?: string;\n\tupdatedAt: string;\n}\n\n/** Persisted pipeline state (.vibe/features/{featureId}/pipeline.json). */\nexport interface PersistedPipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Checkpointing ───────────────────────────────────────────────────────────\n\n/** Agent conversation history checkpoint. */\nexport interface AgentCheckpoint {\n\t/** Agent role. */\n\trole: AgentRole;\n\t/** Execution action (design, implement, test, discovery, etc.). */\n\taction: string;\n\t/** Conversation message history (JSON-serializable Message[]). */\n\tmessages: Message[];\n\t/** Checkpoint creation time (ISO 8601). */\n\ttimestamp: string;\n\t/** Additional metadata (round count, retry count, etc.). */\n\tmetadata?: Record<string, unknown>;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** Event type. */\nexport type VibeEventType =\n\t| \"step_start\"\n\t| \"step_complete\"\n\t| \"step_failed\"\n\t| \"step_retry\"\n\t| \"gate_waiting\"\n\t| \"gate_approved\"\n\t| \"gate_rejected\"\n\t| \"blocked\"\n\t| \"pipeline_complete\"\n\t| \"standards_loaded\"\n\t| \"orchestration_start\"\n\t| \"feature_start\"\n\t| \"feature_complete\"\n\t| \"feature_skipped\"\n\t| \"orchestration_complete\"\n\t| \"gate_skipped\"\n\t| \"feature_aborted\";\n\n/** Event emitted during pipeline execution. */\nexport interface VibeEvent {\n\ttype: VibeEventType;\n\tfeatureId: string;\n\ttimestamp: string;\n\tstep?: PipelineStep;\n\tdata?: Record<string, unknown>;\n}\n"]}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Message } from \"@mariozechner/pi-ai\";\n\n// ─── Workflow ────────────────────────────────────────────────────────────────\n\n/** Workflow type: pipeline structure varies by requirement nature.\n * \"mixed\" indicates the plan has composite requirements. Not used as individual feature pipeline type. */\nexport type WorkflowType = \"new_feature\" | \"enhancement\" | \"bugfix\" | \"refactor\" | \"mixed\";\n\n/** Workflow definition: pipeline step list per type. */\nexport interface WorkflowDefinition {\n\ttype: WorkflowType;\n\tsteps: PipelineStep[];\n}\n\n// ─── Agent ───────────────────────────────────────────────────────────────────\n\n/** Agent role. */\nexport type AgentRole =\n\t| \"planner\"\n\t| \"architect\"\n\t| \"developer\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"cicd\"\n\t| \"analyzer\"\n\t| \"diagnostician\"\n\t| \"discovery\"\n\t| \"projectAnalyzer\"\n\t| \"documenter\"\n\t| \"standardsEnricher\"\n\t| \"systemArchitect\";\n\n/** Per-agent configuration. */\nexport interface AgentRoleConfig {\n\trole: AgentRole;\n\tsystemPrompt: string;\n\ttools: string[];\n\tmodel?: string;\n\tcontextScope: string[];\n}\n\n// ─── Pipeline ────────────────────────────────────────────────────────────────\n\n/** Pipeline status. */\nexport type PipelineStatus = \"pending\" | \"running\" | \"blocked\" | \"done\" | \"failed\" | \"aborted\";\n\n/** Gate condition type. */\nexport type GateConditionType =\n\t| \"test_pass\"\n\t| \"review_approve\"\n\t| \"file_exists\"\n\t| \"regression_pass\"\n\t| \"all_tests_pass\"\n\t| \"diagnosis_approve\"\n\t| \"merge_approve\";\n\n/** Condition for advancing to the next step. */\nexport interface GateCondition {\n\ttype: GateConditionType;\n\ttarget: string;\n}\n\n/** A single step in the pipeline. */\nexport interface PipelineStep {\n\tagent: AgentRole;\n\taction: string;\n\tinputs: string[];\n\toutputs: string[];\n\tgate?: GateCondition;\n\tskip?: boolean;\n\t/** When true, load conversation history from prior steps of the same role. Default: false. */\n\tinheritPriorHistory?: boolean;\n}\n\n/** Workflow state for a single feature. */\nexport interface FeaturePipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tsteps: PipelineStep[];\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Standards ───────────────────────────────────────────────────────────────\n\n/** Standard file names (14 types). */\nexport type StandardFileName =\n\t| \"coding-style.md\"\n\t| \"coding-conventions.md\"\n\t| \"tech-stack.md\"\n\t| \"architecture-principles.md\"\n\t| \"design-guide.md\"\n\t| \"api-design.md\"\n\t| \"testing-standards.md\"\n\t| \"documentation.md\"\n\t| \"git-workflow.md\"\n\t| \"security-policy.md\"\n\t| \"dependency-policy.md\"\n\t| \"performance-guidelines.md\"\n\t| \"accessibility.md\"\n\t| \"observability.md\"\n\t| \"logging.md\"\n\t| \".artifact-standards.md\";\n\n/** Standards file mapping type per role. */\nexport type RoleStandardsMapping = Record<AgentRole, StandardFileName[]>;\n\n/** Standards system configuration. */\nexport interface StandardsConfig {\n\tsources: string[];\n\troleMapping?: Partial<Record<AgentRole, string[]>>;\n}\n\n// ─── Config ──────────────────────────────────────────────────────────────────\n\n/** Autonomy level. */\nexport type AutonomyLevel = \"full_auto\" | \"gate_auto\" | \"step_by_step\";\n\n/** Gate activation settings. */\nexport interface GateConfig {\n\trequireRequirementsApproval: boolean;\n\trequirePlanApproval: boolean;\n\trequireDesignApproval: boolean;\n\trequireSystemDesignApproval: boolean;\n\trequireMergeApproval: boolean;\n\trequireDiagnosisApproval: boolean;\n}\n\n/** Retry count settings. */\nexport interface RetryConfig {\n\tmaxTestRetries: number;\n\tmaxReviewRetries: number;\n\tmaxRegressionRetries: number;\n\t/** Maximum retries for transient step execution errors (e.g., network \"terminated\", API 5xx). Defaults to 2. */\n\tmaxStepRetries: number;\n}\n\n/** Notification channel. */\nexport type NotificationChannel = \"terminal\" | \"slack\" | \"webhook\";\n\n/** Notification settings. */\nexport interface NotificationConfig {\n\tonStepComplete: boolean;\n\tonBlocked: boolean;\n\tonPRReady: boolean;\n\tchannel: NotificationChannel;\n}\n\n/** Project analysis settings. */\nexport interface ProjectAnalysisConfig {\n\tautoAnalyzeOnInit: boolean;\n\tstaleThresholdDays: number;\n\texcludePaths: string[];\n}\n\n/** Discovery settings. */\nexport interface DiscoveryConfig {\n\tmaxQuestionRounds: number;\n\tskipIfClear: boolean;\n}\n\n/** Compaction settings. */\nexport interface CompactionConfig {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n}\n\n/** CI verification check (lint, type-check, format, etc.). */\nexport interface CiCheck {\n\t/** Human-readable name (e.g., \"lint\", \"type-check\", \"format\"). */\n\tname: string;\n\t/** Shell command to execute (e.g., \"make lint\", \"mypy app/\"). */\n\tcommand: string;\n}\n\n/** Testing configuration. Auto-detected during project analysis or manually configured. */\nexport interface TestingConfig {\n\t/** Command to run the project's test suite (e.g., \"make test\", \"npm test\", \"pytest tests/\"). Empty = not configured. */\n\ttestCommand: string;\n\t/** Timeout in seconds for test execution. */\n\ttestTimeout: number;\n\t/** Whether regression step should run existing project tests. */\n\trunExistingTests: boolean;\n\t/** Test file patterns to exclude from execution (e.g., [\"test_tools_async.py\"]). */\n\texcludePatterns: string[];\n\t/** CI verification commands auto-detected from CI config or manually configured. */\n\tciChecks: CiCheck[];\n}\n\n/** Per-project configuration. */\nexport interface VibeConfig {\n\tautonomyLevel: AutonomyLevel;\n\tgates: GateConfig;\n\tretry: RetryConfig;\n\tstandards: StandardsConfig;\n\tnotifications: NotificationConfig;\n\tprojectAnalysis: ProjectAnalysisConfig;\n\tdiscovery: DiscoveryConfig;\n\tcompaction: CompactionConfig;\n\ttesting: TestingConfig;\n\t/** Base branch for feature branching and merging. Auto-detected from current branch if not set. */\n\tbaseBranch?: string;\n}\n\n// ─── Store ───────────────────────────────────────────────────────────────────\n\n/** Feature status value (for status.json). Distinct from PipelineStatus; represents feature-level progress. */\nexport type FeatureStatusValue =\n\t| \"planned\"\n\t| \"designing\"\n\t| \"branching\"\n\t| \"implementing\"\n\t| \"testing\"\n\t| \"reviewing\"\n\t| \"merging\"\n\t| \"done\"\n\t| \"blocked\"\n\t| \"failed\";\n\n/** Feature status file structure (status.json). */\nexport interface FeatureStatus {\n\tstatus: FeatureStatusValue;\n\tupdatedAt: string;\n\tphase?: string;\n\terror?: string;\n}\n\n/** Feature complexity. */\nexport type FeatureComplexity = \"low\" | \"medium\" | \"high\";\n\n/** Individual feature entry in plan.json. */\nexport interface PlanFeature {\n\tfeatureId: string;\n\ttitle: string;\n\tstatus: FeatureStatusValue;\n\tpriority: number;\n\tdependencies: string[];\n\trequirementRefs?: string[];\n\testimatedComplexity?: FeatureComplexity;\n}\n\n/** Overall plan.json structure. */\nexport interface PlanData {\n\tproject: string;\n\tdescription: string;\n\tworkflowType: WorkflowType;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tfeatures: PlanFeature[];\n\tdependencyGraph: Record<string, string[]>;\n\trequirementsRef?: string;\n\tphases?: Record<string, string[]>;\n}\n\n/** Per-feature artifact file names. */\nexport type ArtifactName =\n\t| \"spec.md\"\n\t| \"design.md\"\n\t| \"impact-report.md\"\n\t| \"diagnosis.md\"\n\t| \"review.md\"\n\t| \"test-report.md\"\n\t| \"regression-report.md\"\n\t| \"retry-log.md\"\n\t| \"status.json\"\n\t| \"requirements.md\"\n\t| \"project-context.md\";\n\n// ─── Pipeline Persistence ─────────────────────────────────────────────────────\n\n/** Orchestration progress phase. */\nexport type OrchestrationPhase =\n\t| \"discovery\"\n\t| \"requirements_gate\"\n\t| \"system_architecture\"\n\t| \"system_design_gate\"\n\t| \"analyze\"\n\t| \"planning\"\n\t| \"plan_gate\"\n\t| \"orchestrating\"\n\t| \"single_pipeline\"\n\t| \"done\";\n\n/** Orchestration progress state (persisted to disk: .vibe/orchestration-state.json). */\nexport interface OrchestrationState {\n\tworkflowType: WorkflowType;\n\tphase: OrchestrationPhase;\n\tcompletedFeatures: string[];\n\tfailedFeatures: string[];\n\tskippedFeatures: string[];\n\trequirement: string;\n\toptions?: { parentFeatureId?: string; issueRef?: string };\n\t/** featureId used in single-feature path. */\n\tsingleFeatureId?: string;\n\t/** Resolved base branch for this orchestration run. */\n\tbaseBranch?: string;\n\tupdatedAt: string;\n}\n\n/** Persisted pipeline state (.vibe/features/{featureId}/pipeline.json). */\nexport interface PersistedPipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Checkpointing ───────────────────────────────────────────────────────────\n\n/** Agent conversation history checkpoint. */\nexport interface AgentCheckpoint {\n\t/** Agent role. */\n\trole: AgentRole;\n\t/** Execution action (design, implement, test, discovery, etc.). */\n\taction: string;\n\t/** Conversation message history (JSON-serializable Message[]). */\n\tmessages: Message[];\n\t/** Checkpoint creation time (ISO 8601). */\n\ttimestamp: string;\n\t/** Additional metadata (round count, retry count, etc.). */\n\tmetadata?: Record<string, unknown>;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** Event type. */\nexport type VibeEventType =\n\t| \"step_start\"\n\t| \"step_complete\"\n\t| \"step_failed\"\n\t| \"step_retry\"\n\t| \"gate_waiting\"\n\t| \"gate_approved\"\n\t| \"gate_rejected\"\n\t| \"blocked\"\n\t| \"pipeline_complete\"\n\t| \"standards_loaded\"\n\t| \"orchestration_start\"\n\t| \"feature_start\"\n\t| \"feature_complete\"\n\t| \"feature_skipped\"\n\t| \"orchestration_complete\"\n\t| \"gate_skipped\"\n\t| \"feature_aborted\";\n\n/** Event emitted during pipeline execution. */\nexport interface VibeEvent {\n\ttype: VibeEventType;\n\tfeatureId: string;\n\ttimestamp: string;\n\tstep?: PipelineStep;\n\tdata?: Record<string, unknown>;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Message } from \"@mariozechner/pi-ai\";\n\n// ─── Workflow ────────────────────────────────────────────────────────────────\n\n/** Workflow type: pipeline structure varies by requirement nature.\n * \"mixed\" indicates the plan has composite requirements. Not used as individual feature pipeline type. */\nexport type WorkflowType = \"new_feature\" | \"enhancement\" | \"bugfix\" | \"refactor\" | \"mixed\";\n\n/** Workflow definition: pipeline step list per type. */\nexport interface WorkflowDefinition {\n\ttype: WorkflowType;\n\tsteps: PipelineStep[];\n}\n\n// ─── Agent ───────────────────────────────────────────────────────────────────\n\n/** Agent role. */\nexport type AgentRole =\n\t| \"planner\"\n\t| \"architect\"\n\t| \"developer\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"cicd\"\n\t| \"analyzer\"\n\t| \"diagnostician\"\n\t| \"discovery\"\n\t| \"projectAnalyzer\"\n\t| \"documenter\"\n\t| \"standardsEnricher\"\n\t| \"systemArchitect\"\n\t| \"recover\";\n\n/** Per-agent configuration. */\nexport interface AgentRoleConfig {\n\trole: AgentRole;\n\tsystemPrompt: string;\n\ttools: string[];\n\tmodel?: string;\n\tcontextScope: string[];\n}\n\n// ─── Pipeline ────────────────────────────────────────────────────────────────\n\n/** Pipeline status. */\nexport type PipelineStatus = \"pending\" | \"running\" | \"blocked\" | \"done\" | \"failed\" | \"aborted\";\n\n/** Gate condition type. */\nexport type GateConditionType =\n\t| \"test_pass\"\n\t| \"review_approve\"\n\t| \"file_exists\"\n\t| \"regression_pass\"\n\t| \"all_tests_pass\"\n\t| \"diagnosis_approve\"\n\t| \"merge_approve\";\n\n/** Condition for advancing to the next step. */\nexport interface GateCondition {\n\ttype: GateConditionType;\n\ttarget: string;\n}\n\n/** A single step in the pipeline. */\nexport interface PipelineStep {\n\tagent: AgentRole;\n\taction: string;\n\tinputs: string[];\n\toutputs: string[];\n\tgate?: GateCondition;\n\tskip?: boolean;\n\t/** When true, load conversation history from prior steps of the same role. Default: false. */\n\tinheritPriorHistory?: boolean;\n}\n\n/** Workflow state for a single feature. */\nexport interface FeaturePipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tsteps: PipelineStep[];\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Standards ───────────────────────────────────────────────────────────────\n\n/** Standard file names (14 types). */\nexport type StandardFileName =\n\t| \"coding-style.md\"\n\t| \"coding-conventions.md\"\n\t| \"tech-stack.md\"\n\t| \"architecture-principles.md\"\n\t| \"design-guide.md\"\n\t| \"api-design.md\"\n\t| \"testing-standards.md\"\n\t| \"documentation.md\"\n\t| \"git-workflow.md\"\n\t| \"security-policy.md\"\n\t| \"dependency-policy.md\"\n\t| \"performance-guidelines.md\"\n\t| \"accessibility.md\"\n\t| \"observability.md\"\n\t| \"logging.md\"\n\t| \".artifact-standards.md\";\n\n/** Standards file mapping type per role. */\nexport type RoleStandardsMapping = Record<AgentRole, StandardFileName[]>;\n\n/** Standards system configuration. */\nexport interface StandardsConfig {\n\tsources: string[];\n\troleMapping?: Partial<Record<AgentRole, string[]>>;\n}\n\n// ─── Config ──────────────────────────────────────────────────────────────────\n\n/** Autonomy level. */\nexport type AutonomyLevel = \"full_auto\" | \"gate_auto\" | \"step_by_step\";\n\n/** Gate activation settings. */\nexport interface GateConfig {\n\trequireRequirementsApproval: boolean;\n\trequirePlanApproval: boolean;\n\trequireDesignApproval: boolean;\n\trequireSystemDesignApproval: boolean;\n\trequireMergeApproval: boolean;\n\trequireDiagnosisApproval: boolean;\n}\n\n/** Retry count settings. */\nexport interface RetryConfig {\n\tmaxTestRetries: number;\n\tmaxReviewRetries: number;\n\tmaxRegressionRetries: number;\n\t/** Maximum retries for transient step execution errors (e.g., network \"terminated\", API 5xx). Defaults to 2. */\n\tmaxStepRetries: number;\n}\n\n/** Notification channel. */\nexport type NotificationChannel = \"terminal\" | \"slack\" | \"webhook\";\n\n/** Notification settings. */\nexport interface NotificationConfig {\n\tonStepComplete: boolean;\n\tonBlocked: boolean;\n\tonPRReady: boolean;\n\tchannel: NotificationChannel;\n}\n\n/** Project analysis settings. */\nexport interface ProjectAnalysisConfig {\n\tautoAnalyzeOnInit: boolean;\n\tstaleThresholdDays: number;\n\texcludePaths: string[];\n}\n\n/** Discovery settings. */\nexport interface DiscoveryConfig {\n\tmaxQuestionRounds: number;\n\tskipIfClear: boolean;\n}\n\n/** Compaction settings. */\nexport interface CompactionConfig {\n\tenabled: boolean;\n\treserveTokens: number;\n\tkeepRecentTokens: number;\n}\n\n/** CI verification check (lint, type-check, format, etc.). */\nexport interface CiCheck {\n\t/** Human-readable name (e.g., \"lint\", \"type-check\", \"format\"). */\n\tname: string;\n\t/** Shell command to execute (e.g., \"make lint\", \"mypy app/\"). */\n\tcommand: string;\n}\n\n/** Testing configuration. Auto-detected during project analysis or manually configured. */\nexport interface TestingConfig {\n\t/** Command to run the project's test suite (e.g., \"make test\", \"npm test\", \"pytest tests/\"). Empty = not configured. */\n\ttestCommand: string;\n\t/** Timeout in seconds for test execution. */\n\ttestTimeout: number;\n\t/** Whether regression step should run existing project tests. */\n\trunExistingTests: boolean;\n\t/** Test file patterns to exclude from execution (e.g., [\"test_tools_async.py\"]). */\n\texcludePatterns: string[];\n\t/** CI verification commands auto-detected from CI config or manually configured. */\n\tciChecks: CiCheck[];\n}\n\n/** Telegram bridge configuration. */\nexport interface TelegramConfig {\n\t/** Bot API token. */\n\ttoken?: string;\n\t/** Target chat ID. Auto-discovered from first incoming message if not set. */\n\tchatId?: string;\n}\n\n/** Per-project configuration. */\nexport interface VibeConfig {\n\tautonomyLevel: AutonomyLevel;\n\tgates: GateConfig;\n\tretry: RetryConfig;\n\tstandards: StandardsConfig;\n\tnotifications: NotificationConfig;\n\tprojectAnalysis: ProjectAnalysisConfig;\n\tdiscovery: DiscoveryConfig;\n\tcompaction: CompactionConfig;\n\ttesting: TestingConfig;\n\t/** Base branch for feature branching and merging. Auto-detected from current branch if not set. */\n\tbaseBranch?: string;\n\t/** Telegram bridge settings. */\n\ttelegram?: TelegramConfig;\n}\n\n// ─── Store ───────────────────────────────────────────────────────────────────\n\n/** Feature status value (for status.json). Distinct from PipelineStatus; represents feature-level progress. */\nexport type FeatureStatusValue =\n\t| \"planned\"\n\t| \"designing\"\n\t| \"branching\"\n\t| \"implementing\"\n\t| \"testing\"\n\t| \"reviewing\"\n\t| \"merging\"\n\t| \"done\"\n\t| \"blocked\"\n\t| \"failed\";\n\n/** Feature status file structure (status.json). */\nexport interface FeatureStatus {\n\tstatus: FeatureStatusValue;\n\tupdatedAt: string;\n\tphase?: string;\n\terror?: string;\n}\n\n/** Feature complexity. */\nexport type FeatureComplexity = \"low\" | \"medium\" | \"high\";\n\n/** Individual feature entry in plan.json. */\nexport interface PlanFeature {\n\tfeatureId: string;\n\ttitle: string;\n\tstatus: FeatureStatusValue;\n\tpriority: number;\n\tdependencies: string[];\n\trequirementRefs?: string[];\n\testimatedComplexity?: FeatureComplexity;\n}\n\n/** Overall plan.json structure. */\nexport interface PlanData {\n\tproject: string;\n\tdescription: string;\n\tworkflowType: WorkflowType;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\tfeatures: PlanFeature[];\n\tdependencyGraph: Record<string, string[]>;\n\trequirementsRef?: string;\n\tphases?: Record<string, string[]>;\n}\n\n/** Per-feature artifact file names. */\nexport type ArtifactName =\n\t| \"spec.md\"\n\t| \"design.md\"\n\t| \"impact-report.md\"\n\t| \"diagnosis.md\"\n\t| \"review.md\"\n\t| \"test-report.md\"\n\t| \"regression-report.md\"\n\t| \"retry-log.md\"\n\t| \"status.json\"\n\t| \"requirements.md\"\n\t| \"project-context.md\";\n\n// ─── Pipeline Persistence ─────────────────────────────────────────────────────\n\n/** Orchestration progress phase. */\nexport type OrchestrationPhase =\n\t| \"discovery\"\n\t| \"requirements_gate\"\n\t| \"system_architecture\"\n\t| \"system_design_gate\"\n\t| \"analyze\"\n\t| \"planning\"\n\t| \"plan_gate\"\n\t| \"orchestrating\"\n\t| \"single_pipeline\"\n\t| \"done\";\n\n/** Orchestration progress state (persisted to disk: .vibe/orchestration-state.json). */\nexport interface OrchestrationState {\n\tworkflowType: WorkflowType;\n\tphase: OrchestrationPhase;\n\tcompletedFeatures: string[];\n\tfailedFeatures: string[];\n\tskippedFeatures: string[];\n\trequirement: string;\n\toptions?: { parentFeatureId?: string; issueRef?: string };\n\t/** featureId used in single-feature path. */\n\tsingleFeatureId?: string;\n\t/** Resolved base branch for this orchestration run. */\n\tbaseBranch?: string;\n\tupdatedAt: string;\n}\n\n/** Persisted pipeline state (.vibe/features/{featureId}/pipeline.json). */\nexport interface PersistedPipeline {\n\tfeatureId: string;\n\tworkflowType: WorkflowType;\n\tcurrentStep: number;\n\tstatus: PipelineStatus;\n\tretryCount: number;\n\tmaxRetries: number;\n\tparentFeatureId?: string;\n\tissueRef?: string;\n}\n\n// ─── Checkpointing ───────────────────────────────────────────────────────────\n\n/** Agent conversation history checkpoint. */\nexport interface AgentCheckpoint {\n\t/** Agent role. */\n\trole: AgentRole;\n\t/** Execution action (design, implement, test, discovery, etc.). */\n\taction: string;\n\t/** Conversation message history (JSON-serializable Message[]). */\n\tmessages: Message[];\n\t/** Checkpoint creation time (ISO 8601). */\n\ttimestamp: string;\n\t/** Additional metadata (round count, retry count, etc.). */\n\tmetadata?: Record<string, unknown>;\n}\n\n// ─── Events ──────────────────────────────────────────────────────────────────\n\n/** Event type. */\nexport type VibeEventType =\n\t| \"step_start\"\n\t| \"step_complete\"\n\t| \"step_failed\"\n\t| \"step_retry\"\n\t| \"gate_waiting\"\n\t| \"gate_approved\"\n\t| \"gate_rejected\"\n\t| \"blocked\"\n\t| \"pipeline_complete\"\n\t| \"standards_loaded\"\n\t| \"orchestration_start\"\n\t| \"feature_start\"\n\t| \"feature_complete\"\n\t| \"feature_skipped\"\n\t| \"orchestration_complete\"\n\t| \"gate_skipped\"\n\t| \"feature_aborted\";\n\n/** Event emitted during pipeline execution. */\nexport interface VibeEvent {\n\ttype: VibeEventType;\n\tfeatureId: string;\n\ttimestamp: string;\n\tstep?: PipelineStep;\n\tdata?: Record<string, unknown>;\n}\n"]}
package/dist/ui.d.ts CHANGED
@@ -6,5 +6,5 @@ export declare function formatPipelineStatus(pipeline: FeaturePipeline): string;
6
6
  /** Generates feature status details. */
7
7
  export declare function formatFeatureDetail(featureId: string, status: FeatureStatus, artifacts: string[]): string;
8
8
  /** /vibe help text */
9
- export declare const VIBE_HELP = "Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n";
9
+ export declare const VIBE_HELP = "Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n recover Recover lost orchestration state from artifacts\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n reset Delete .vibe/ and re-initialize\n";
10
10
  //# sourceMappingURL=ui.d.ts.map
package/dist/ui.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AA4C3F,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAyFxD;AAID,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CA6BtE;AAED,wCAAwC;AACxC,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAuBzG;AAID,sBAAsB;AACtB,eAAO,MAAM,SAAS,k1BAqBrB,CAAC","sourcesContent":["import type { FeaturePipeline, FeatureStatus, VibeEvent, VibeEventType } from \"./types.js\";\n\n// ─── Event Icons ─────────────────────────────────────────────────────────────\n\n/** Icons by event type */\nconst EVENT_ICONS: Partial<Record<VibeEventType, string>> = {\n\tstep_start: \"⚙\",\n\tstep_complete: \"✓\",\n\tstep_failed: \"✗\",\n\tstep_retry: \"↻\",\n\tgate_waiting: \"◈\",\n\tgate_approved: \"✓\",\n\tgate_rejected: \"✗\",\n\tgate_skipped: \"⊘\",\n\tblocked: \"⚠\",\n\tpipeline_complete: \"✓\",\n\tfeature_start: \"▸\",\n\tfeature_complete: \"✓\",\n\tfeature_skipped: \"⊘\",\n\tfeature_aborted: \"✗\",\n\torchestration_start: \"▸\",\n\torchestration_complete: \"✓\",\n\tstandards_loaded: \"✓\",\n};\n\n// ─── Event Formatting ────────────────────────────────────────────────────────\n\n/** Converts an agent role to a display string. */\nfunction roleLabel(role: string): string {\n\tconst labels: Record<string, string> = {\n\t\tplanner: \"Planner\",\n\t\tarchitect: \"Architect\",\n\t\tdeveloper: \"Developer\",\n\t\ttester: \"Tester\",\n\t\treviewer: \"Reviewer\",\n\t\tcicd: \"CI/CD\",\n\t\tanalyzer: \"Analyzer\",\n\t\tdiagnostician: \"Diagnostician\",\n\t\tdiscovery: \"Discovery\",\n\t\tprojectAnalyzer: \"Project Analyzer\",\n\t};\n\treturn labels[role] ?? role;\n}\n\n/** Converts a VibeEvent to a user-friendly string. */\nexport function formatVibeEvent(event: VibeEvent): string {\n\tconst icon = EVENT_ICONS[event.type] ?? \"·\";\n\n\tswitch (event.type) {\n\t\tcase \"step_start\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst action = event.step?.action ?? \"\";\n\t\t\treturn `${icon} [${agent}] ${action}...`;\n\t\t}\n\n\t\tcase \"step_complete\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst elapsed = event.data?.elapsed ? ` (${event.data.elapsed}ms)` : \"\";\n\t\t\treturn `${icon} [${agent}] done${elapsed}`;\n\t\t}\n\n\t\tcase \"step_failed\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst error = event.data?.error ?? event.data?.reason ?? \"unknown error\";\n\t\t\tconst attempts = event.data?.attempts ? ` (${event.data.attempts} attempts)` : \"\";\n\t\t\treturn `${icon} [${agent}] FAILED: ${error}${attempts}`;\n\t\t}\n\n\t\tcase \"step_retry\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst attempt = event.data?.attempt ?? \"?\";\n\t\t\tconst maxRetries = event.data?.maxRetries ?? \"?\";\n\t\t\tconst delayMs = event.data?.delayMs ?? 0;\n\t\t\tconst delaySec = Math.round((delayMs as number) / 1000);\n\t\t\tconst error = event.data?.error ?? \"unknown error\";\n\t\t\treturn `${icon} [${agent}] Retrying (${attempt}/${maxRetries}) in ${delaySec}s: ${error}`;\n\t\t}\n\n\t\tcase \"gate_waiting\":\n\t\t\treturn `${icon} [Gate] Waiting for approval...`;\n\n\t\tcase \"gate_approved\":\n\t\t\treturn `${icon} [Gate] Approved`;\n\n\t\tcase \"gate_rejected\": {\n\t\t\tconst feedback = event.data?.feedback ? `: ${event.data.feedback}` : \"\";\n\t\t\treturn `${icon} [Gate] Rejected${feedback}`;\n\t\t}\n\n\t\tcase \"blocked\": {\n\t\t\tconst reason = event.data?.reason ?? \"unknown\";\n\t\t\treturn `${icon} [BLOCKED] ${reason}`;\n\t\t}\n\n\t\tcase \"pipeline_complete\":\n\t\t\treturn `${icon} [Pipeline] Complete: ${event.featureId}`;\n\n\t\tcase \"standards_loaded\":\n\t\t\treturn `${icon} [Orchestrator] Standards loaded`;\n\n\t\tcase \"orchestration_start\": {\n\t\t\tconst count = event.data?.featureCount ?? 0;\n\t\t\treturn `${icon} [Orchestrator] Starting ${count} features...`;\n\t\t}\n\n\t\tcase \"feature_start\": {\n\t\t\tconst title = event.data?.title ?? event.featureId;\n\t\t\treturn `${icon} [Orchestrator] Feature: ${title} (${event.featureId})`;\n\t\t}\n\n\t\tcase \"feature_complete\":\n\t\t\treturn `${icon} [Orchestrator] Feature complete: ${event.featureId}`;\n\n\t\tcase \"feature_skipped\": {\n\t\t\tconst reason = event.data?.reason ?? \"dependency failed\";\n\t\t\treturn `${icon} [Orchestrator] Feature skipped: ${event.featureId} (${reason})`;\n\t\t}\n\n\t\tcase \"orchestration_complete\": {\n\t\t\tconst completedCount = (event.data?.completed as string[])?.length ?? 0;\n\t\t\tconst total = event.data?.total ?? 0;\n\t\t\tconst aborted = event.data?.abortedFeature ? ` (aborted: ${event.data.abortedFeature})` : \"\";\n\t\t\treturn `${icon} [Orchestrator] Complete: ${completedCount}/${total} features${aborted}`;\n\t\t}\n\n\t\tcase \"gate_skipped\":\n\t\t\treturn `${icon} [Gate] Skipped (review not performed)`;\n\n\t\tcase \"feature_aborted\":\n\t\t\treturn `${icon} [Orchestrator] Feature aborted: ${event.featureId}`;\n\n\t\tdefault:\n\t\t\treturn `${icon} [Event] ${event.type}`;\n\t}\n}\n\n// ─── Status Formatting ──────────────────────────────────────────────────────\n\n/** Generates a pipeline status summary. */\nexport function formatPipelineStatus(pipeline: FeaturePipeline): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${pipeline.featureId}`);\n\tlines.push(`Workflow: ${pipeline.workflowType}`);\n\tlines.push(`Status: ${pipeline.status}`);\n\tlines.push(`Progress: ${pipeline.currentStep}/${pipeline.steps.length}`);\n\n\tif (pipeline.retryCount > 0) {\n\t\tlines.push(`Retries: ${pipeline.retryCount}/${pipeline.maxRetries}`);\n\t}\n\n\tlines.push(\"\");\n\tlines.push(\"Steps:\");\n\tfor (let i = 0; i < pipeline.steps.length; i++) {\n\t\tconst step = pipeline.steps[i];\n\t\tlet marker: string;\n\t\tif (i < pipeline.currentStep) {\n\t\t\tmarker = \"✓\";\n\t\t} else if (i === pipeline.currentStep && pipeline.status === \"running\") {\n\t\t\tmarker = \"●\";\n\t\t} else if (step.skip) {\n\t\t\tmarker = \"⊘\";\n\t\t} else {\n\t\t\tmarker = \"○\";\n\t\t}\n\t\tlines.push(` ${marker} ${i + 1}. ${roleLabel(step.agent)}: ${step.action}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/** Generates feature status details. */\nexport function formatFeatureDetail(featureId: string, status: FeatureStatus, artifacts: string[]): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${featureId}`);\n\tlines.push(`Status: ${status.status}`);\n\tlines.push(`Updated: ${status.updatedAt}`);\n\n\tif (status.phase) {\n\t\tlines.push(`Phase: ${status.phase}`);\n\t}\n\n\tif (status.error) {\n\t\tlines.push(`Error: ${status.error}`);\n\t}\n\n\tif (artifacts.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Artifacts:\");\n\t\tfor (const artifact of artifacts) {\n\t\t\tlines.push(` - ${artifact}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n// ─── Help ────────────────────────────────────────────────────────────────────\n\n/** /vibe help text */\nexport const VIBE_HELP = `Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n`;\n"]}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AA4C3F,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAyFxD;AAID,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CA6BtE;AAED,wCAAwC;AACxC,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAuBzG;AAID,sBAAsB;AACtB,eAAO,MAAM,SAAS,0+BAuBrB,CAAC","sourcesContent":["import type { FeaturePipeline, FeatureStatus, VibeEvent, VibeEventType } from \"./types.js\";\n\n// ─── Event Icons ─────────────────────────────────────────────────────────────\n\n/** Icons by event type */\nconst EVENT_ICONS: Partial<Record<VibeEventType, string>> = {\n\tstep_start: \"⚙\",\n\tstep_complete: \"✓\",\n\tstep_failed: \"✗\",\n\tstep_retry: \"↻\",\n\tgate_waiting: \"◈\",\n\tgate_approved: \"✓\",\n\tgate_rejected: \"✗\",\n\tgate_skipped: \"⊘\",\n\tblocked: \"⚠\",\n\tpipeline_complete: \"✓\",\n\tfeature_start: \"▸\",\n\tfeature_complete: \"✓\",\n\tfeature_skipped: \"⊘\",\n\tfeature_aborted: \"✗\",\n\torchestration_start: \"▸\",\n\torchestration_complete: \"✓\",\n\tstandards_loaded: \"✓\",\n};\n\n// ─── Event Formatting ────────────────────────────────────────────────────────\n\n/** Converts an agent role to a display string. */\nfunction roleLabel(role: string): string {\n\tconst labels: Record<string, string> = {\n\t\tplanner: \"Planner\",\n\t\tarchitect: \"Architect\",\n\t\tdeveloper: \"Developer\",\n\t\ttester: \"Tester\",\n\t\treviewer: \"Reviewer\",\n\t\tcicd: \"CI/CD\",\n\t\tanalyzer: \"Analyzer\",\n\t\tdiagnostician: \"Diagnostician\",\n\t\tdiscovery: \"Discovery\",\n\t\tprojectAnalyzer: \"Project Analyzer\",\n\t};\n\treturn labels[role] ?? role;\n}\n\n/** Converts a VibeEvent to a user-friendly string. */\nexport function formatVibeEvent(event: VibeEvent): string {\n\tconst icon = EVENT_ICONS[event.type] ?? \"·\";\n\n\tswitch (event.type) {\n\t\tcase \"step_start\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst action = event.step?.action ?? \"\";\n\t\t\treturn `${icon} [${agent}] ${action}...`;\n\t\t}\n\n\t\tcase \"step_complete\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst elapsed = event.data?.elapsed ? ` (${event.data.elapsed}ms)` : \"\";\n\t\t\treturn `${icon} [${agent}] done${elapsed}`;\n\t\t}\n\n\t\tcase \"step_failed\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst error = event.data?.error ?? event.data?.reason ?? \"unknown error\";\n\t\t\tconst attempts = event.data?.attempts ? ` (${event.data.attempts} attempts)` : \"\";\n\t\t\treturn `${icon} [${agent}] FAILED: ${error}${attempts}`;\n\t\t}\n\n\t\tcase \"step_retry\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst attempt = event.data?.attempt ?? \"?\";\n\t\t\tconst maxRetries = event.data?.maxRetries ?? \"?\";\n\t\t\tconst delayMs = event.data?.delayMs ?? 0;\n\t\t\tconst delaySec = Math.round((delayMs as number) / 1000);\n\t\t\tconst error = event.data?.error ?? \"unknown error\";\n\t\t\treturn `${icon} [${agent}] Retrying (${attempt}/${maxRetries}) in ${delaySec}s: ${error}`;\n\t\t}\n\n\t\tcase \"gate_waiting\":\n\t\t\treturn `${icon} [Gate] Waiting for approval...`;\n\n\t\tcase \"gate_approved\":\n\t\t\treturn `${icon} [Gate] Approved`;\n\n\t\tcase \"gate_rejected\": {\n\t\t\tconst feedback = event.data?.feedback ? `: ${event.data.feedback}` : \"\";\n\t\t\treturn `${icon} [Gate] Rejected${feedback}`;\n\t\t}\n\n\t\tcase \"blocked\": {\n\t\t\tconst reason = event.data?.reason ?? \"unknown\";\n\t\t\treturn `${icon} [BLOCKED] ${reason}`;\n\t\t}\n\n\t\tcase \"pipeline_complete\":\n\t\t\treturn `${icon} [Pipeline] Complete: ${event.featureId}`;\n\n\t\tcase \"standards_loaded\":\n\t\t\treturn `${icon} [Orchestrator] Standards loaded`;\n\n\t\tcase \"orchestration_start\": {\n\t\t\tconst count = event.data?.featureCount ?? 0;\n\t\t\treturn `${icon} [Orchestrator] Starting ${count} features...`;\n\t\t}\n\n\t\tcase \"feature_start\": {\n\t\t\tconst title = event.data?.title ?? event.featureId;\n\t\t\treturn `${icon} [Orchestrator] Feature: ${title} (${event.featureId})`;\n\t\t}\n\n\t\tcase \"feature_complete\":\n\t\t\treturn `${icon} [Orchestrator] Feature complete: ${event.featureId}`;\n\n\t\tcase \"feature_skipped\": {\n\t\t\tconst reason = event.data?.reason ?? \"dependency failed\";\n\t\t\treturn `${icon} [Orchestrator] Feature skipped: ${event.featureId} (${reason})`;\n\t\t}\n\n\t\tcase \"orchestration_complete\": {\n\t\t\tconst completedCount = (event.data?.completed as string[])?.length ?? 0;\n\t\t\tconst total = event.data?.total ?? 0;\n\t\t\tconst aborted = event.data?.abortedFeature ? ` (aborted: ${event.data.abortedFeature})` : \"\";\n\t\t\treturn `${icon} [Orchestrator] Complete: ${completedCount}/${total} features${aborted}`;\n\t\t}\n\n\t\tcase \"gate_skipped\":\n\t\t\treturn `${icon} [Gate] Skipped (review not performed)`;\n\n\t\tcase \"feature_aborted\":\n\t\t\treturn `${icon} [Orchestrator] Feature aborted: ${event.featureId}`;\n\n\t\tdefault:\n\t\t\treturn `${icon} [Event] ${event.type}`;\n\t}\n}\n\n// ─── Status Formatting ──────────────────────────────────────────────────────\n\n/** Generates a pipeline status summary. */\nexport function formatPipelineStatus(pipeline: FeaturePipeline): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${pipeline.featureId}`);\n\tlines.push(`Workflow: ${pipeline.workflowType}`);\n\tlines.push(`Status: ${pipeline.status}`);\n\tlines.push(`Progress: ${pipeline.currentStep}/${pipeline.steps.length}`);\n\n\tif (pipeline.retryCount > 0) {\n\t\tlines.push(`Retries: ${pipeline.retryCount}/${pipeline.maxRetries}`);\n\t}\n\n\tlines.push(\"\");\n\tlines.push(\"Steps:\");\n\tfor (let i = 0; i < pipeline.steps.length; i++) {\n\t\tconst step = pipeline.steps[i];\n\t\tlet marker: string;\n\t\tif (i < pipeline.currentStep) {\n\t\t\tmarker = \"✓\";\n\t\t} else if (i === pipeline.currentStep && pipeline.status === \"running\") {\n\t\t\tmarker = \"●\";\n\t\t} else if (step.skip) {\n\t\t\tmarker = \"⊘\";\n\t\t} else {\n\t\t\tmarker = \"○\";\n\t\t}\n\t\tlines.push(` ${marker} ${i + 1}. ${roleLabel(step.agent)}: ${step.action}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/** Generates feature status details. */\nexport function formatFeatureDetail(featureId: string, status: FeatureStatus, artifacts: string[]): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${featureId}`);\n\tlines.push(`Status: ${status.status}`);\n\tlines.push(`Updated: ${status.updatedAt}`);\n\n\tif (status.phase) {\n\t\tlines.push(`Phase: ${status.phase}`);\n\t}\n\n\tif (status.error) {\n\t\tlines.push(`Error: ${status.error}`);\n\t}\n\n\tif (artifacts.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Artifacts:\");\n\t\tfor (const artifact of artifacts) {\n\t\t\tlines.push(` - ${artifact}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n// ─── Help ────────────────────────────────────────────────────────────────────\n\n/** /vibe help text */\nexport const VIBE_HELP = `Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n recover Recover lost orchestration state from artifacts\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n reset Delete .vibe/ and re-initialize\n`;\n"]}
package/dist/ui.js CHANGED
@@ -176,6 +176,7 @@ Control Commands:
176
176
  status [featureId] Show pipeline status
177
177
  pause <featureId> Pause a running pipeline
178
178
  resume <featureId> Resume a paused pipeline
179
+ recover Recover lost orchestration state from artifacts
179
180
  steer <featureId> <feedback> Send feedback to running agent
180
181
  log <featureId> Show execution log
181
182
 
@@ -185,5 +186,6 @@ Analysis Commands:
185
186
  Setup Commands:
186
187
  config Show/edit configuration
187
188
  init Initialize .vibe/ directory
189
+ reset Delete .vibe/ and re-initialize
188
190
  `;
189
191
  //# sourceMappingURL=ui.js.map
package/dist/ui.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAEA,gNAAgF;AAEhF,0BAA0B;AAC1B,MAAM,WAAW,GAA2C;IAC3D,UAAU,EAAE,KAAG;IACf,aAAa,EAAE,KAAG;IAClB,WAAW,EAAE,KAAG;IAChB,UAAU,EAAE,KAAG;IACf,YAAY,EAAE,KAAG;IACjB,aAAa,EAAE,KAAG;IAClB,aAAa,EAAE,KAAG;IAClB,YAAY,EAAE,KAAG;IACjB,OAAO,EAAE,KAAG;IACZ,iBAAiB,EAAE,KAAG;IACtB,aAAa,EAAE,KAAG;IAClB,gBAAgB,EAAE,KAAG;IACrB,eAAe,EAAE,KAAG;IACpB,eAAe,EAAE,KAAG;IACpB,mBAAmB,EAAE,KAAG;IACxB,sBAAsB,EAAE,KAAG;IAC3B,gBAAgB,EAAE,KAAG;CACrB,CAAC;AAEF,sMAAgF;AAEhF,kDAAkD;AAClD,SAAS,SAAS,CAAC,IAAY,EAAU;IACxC,MAAM,MAAM,GAA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IAE3C,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAAA,CACxB;AAED,8NAAgF;AAEhF,sBAAsB;AACtB,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBxB,CAAC","sourcesContent":["import type { FeaturePipeline, FeatureStatus, VibeEvent, VibeEventType } from \"./types.js\";\n\n// ─── Event Icons ─────────────────────────────────────────────────────────────\n\n/** Icons by event type */\nconst EVENT_ICONS: Partial<Record<VibeEventType, string>> = {\n\tstep_start: \"⚙\",\n\tstep_complete: \"✓\",\n\tstep_failed: \"✗\",\n\tstep_retry: \"↻\",\n\tgate_waiting: \"◈\",\n\tgate_approved: \"✓\",\n\tgate_rejected: \"✗\",\n\tgate_skipped: \"⊘\",\n\tblocked: \"⚠\",\n\tpipeline_complete: \"✓\",\n\tfeature_start: \"▸\",\n\tfeature_complete: \"✓\",\n\tfeature_skipped: \"⊘\",\n\tfeature_aborted: \"✗\",\n\torchestration_start: \"▸\",\n\torchestration_complete: \"✓\",\n\tstandards_loaded: \"✓\",\n};\n\n// ─── Event Formatting ────────────────────────────────────────────────────────\n\n/** Converts an agent role to a display string. */\nfunction roleLabel(role: string): string {\n\tconst labels: Record<string, string> = {\n\t\tplanner: \"Planner\",\n\t\tarchitect: \"Architect\",\n\t\tdeveloper: \"Developer\",\n\t\ttester: \"Tester\",\n\t\treviewer: \"Reviewer\",\n\t\tcicd: \"CI/CD\",\n\t\tanalyzer: \"Analyzer\",\n\t\tdiagnostician: \"Diagnostician\",\n\t\tdiscovery: \"Discovery\",\n\t\tprojectAnalyzer: \"Project Analyzer\",\n\t};\n\treturn labels[role] ?? role;\n}\n\n/** Converts a VibeEvent to a user-friendly string. */\nexport function formatVibeEvent(event: VibeEvent): string {\n\tconst icon = EVENT_ICONS[event.type] ?? \"·\";\n\n\tswitch (event.type) {\n\t\tcase \"step_start\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst action = event.step?.action ?? \"\";\n\t\t\treturn `${icon} [${agent}] ${action}...`;\n\t\t}\n\n\t\tcase \"step_complete\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst elapsed = event.data?.elapsed ? ` (${event.data.elapsed}ms)` : \"\";\n\t\t\treturn `${icon} [${agent}] done${elapsed}`;\n\t\t}\n\n\t\tcase \"step_failed\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst error = event.data?.error ?? event.data?.reason ?? \"unknown error\";\n\t\t\tconst attempts = event.data?.attempts ? ` (${event.data.attempts} attempts)` : \"\";\n\t\t\treturn `${icon} [${agent}] FAILED: ${error}${attempts}`;\n\t\t}\n\n\t\tcase \"step_retry\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst attempt = event.data?.attempt ?? \"?\";\n\t\t\tconst maxRetries = event.data?.maxRetries ?? \"?\";\n\t\t\tconst delayMs = event.data?.delayMs ?? 0;\n\t\t\tconst delaySec = Math.round((delayMs as number) / 1000);\n\t\t\tconst error = event.data?.error ?? \"unknown error\";\n\t\t\treturn `${icon} [${agent}] Retrying (${attempt}/${maxRetries}) in ${delaySec}s: ${error}`;\n\t\t}\n\n\t\tcase \"gate_waiting\":\n\t\t\treturn `${icon} [Gate] Waiting for approval...`;\n\n\t\tcase \"gate_approved\":\n\t\t\treturn `${icon} [Gate] Approved`;\n\n\t\tcase \"gate_rejected\": {\n\t\t\tconst feedback = event.data?.feedback ? `: ${event.data.feedback}` : \"\";\n\t\t\treturn `${icon} [Gate] Rejected${feedback}`;\n\t\t}\n\n\t\tcase \"blocked\": {\n\t\t\tconst reason = event.data?.reason ?? \"unknown\";\n\t\t\treturn `${icon} [BLOCKED] ${reason}`;\n\t\t}\n\n\t\tcase \"pipeline_complete\":\n\t\t\treturn `${icon} [Pipeline] Complete: ${event.featureId}`;\n\n\t\tcase \"standards_loaded\":\n\t\t\treturn `${icon} [Orchestrator] Standards loaded`;\n\n\t\tcase \"orchestration_start\": {\n\t\t\tconst count = event.data?.featureCount ?? 0;\n\t\t\treturn `${icon} [Orchestrator] Starting ${count} features...`;\n\t\t}\n\n\t\tcase \"feature_start\": {\n\t\t\tconst title = event.data?.title ?? event.featureId;\n\t\t\treturn `${icon} [Orchestrator] Feature: ${title} (${event.featureId})`;\n\t\t}\n\n\t\tcase \"feature_complete\":\n\t\t\treturn `${icon} [Orchestrator] Feature complete: ${event.featureId}`;\n\n\t\tcase \"feature_skipped\": {\n\t\t\tconst reason = event.data?.reason ?? \"dependency failed\";\n\t\t\treturn `${icon} [Orchestrator] Feature skipped: ${event.featureId} (${reason})`;\n\t\t}\n\n\t\tcase \"orchestration_complete\": {\n\t\t\tconst completedCount = (event.data?.completed as string[])?.length ?? 0;\n\t\t\tconst total = event.data?.total ?? 0;\n\t\t\tconst aborted = event.data?.abortedFeature ? ` (aborted: ${event.data.abortedFeature})` : \"\";\n\t\t\treturn `${icon} [Orchestrator] Complete: ${completedCount}/${total} features${aborted}`;\n\t\t}\n\n\t\tcase \"gate_skipped\":\n\t\t\treturn `${icon} [Gate] Skipped (review not performed)`;\n\n\t\tcase \"feature_aborted\":\n\t\t\treturn `${icon} [Orchestrator] Feature aborted: ${event.featureId}`;\n\n\t\tdefault:\n\t\t\treturn `${icon} [Event] ${event.type}`;\n\t}\n}\n\n// ─── Status Formatting ──────────────────────────────────────────────────────\n\n/** Generates a pipeline status summary. */\nexport function formatPipelineStatus(pipeline: FeaturePipeline): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${pipeline.featureId}`);\n\tlines.push(`Workflow: ${pipeline.workflowType}`);\n\tlines.push(`Status: ${pipeline.status}`);\n\tlines.push(`Progress: ${pipeline.currentStep}/${pipeline.steps.length}`);\n\n\tif (pipeline.retryCount > 0) {\n\t\tlines.push(`Retries: ${pipeline.retryCount}/${pipeline.maxRetries}`);\n\t}\n\n\tlines.push(\"\");\n\tlines.push(\"Steps:\");\n\tfor (let i = 0; i < pipeline.steps.length; i++) {\n\t\tconst step = pipeline.steps[i];\n\t\tlet marker: string;\n\t\tif (i < pipeline.currentStep) {\n\t\t\tmarker = \"✓\";\n\t\t} else if (i === pipeline.currentStep && pipeline.status === \"running\") {\n\t\t\tmarker = \"●\";\n\t\t} else if (step.skip) {\n\t\t\tmarker = \"⊘\";\n\t\t} else {\n\t\t\tmarker = \"○\";\n\t\t}\n\t\tlines.push(` ${marker} ${i + 1}. ${roleLabel(step.agent)}: ${step.action}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/** Generates feature status details. */\nexport function formatFeatureDetail(featureId: string, status: FeatureStatus, artifacts: string[]): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${featureId}`);\n\tlines.push(`Status: ${status.status}`);\n\tlines.push(`Updated: ${status.updatedAt}`);\n\n\tif (status.phase) {\n\t\tlines.push(`Phase: ${status.phase}`);\n\t}\n\n\tif (status.error) {\n\t\tlines.push(`Error: ${status.error}`);\n\t}\n\n\tif (artifacts.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Artifacts:\");\n\t\tfor (const artifact of artifacts) {\n\t\t\tlines.push(` - ${artifact}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n// ─── Help ────────────────────────────────────────────────────────────────────\n\n/** /vibe help text */\nexport const VIBE_HELP = `Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n`;\n"]}
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAEA,gNAAgF;AAEhF,0BAA0B;AAC1B,MAAM,WAAW,GAA2C;IAC3D,UAAU,EAAE,KAAG;IACf,aAAa,EAAE,KAAG;IAClB,WAAW,EAAE,KAAG;IAChB,UAAU,EAAE,KAAG;IACf,YAAY,EAAE,KAAG;IACjB,aAAa,EAAE,KAAG;IAClB,aAAa,EAAE,KAAG;IAClB,YAAY,EAAE,KAAG;IACjB,OAAO,EAAE,KAAG;IACZ,iBAAiB,EAAE,KAAG;IACtB,aAAa,EAAE,KAAG;IAClB,gBAAgB,EAAE,KAAG;IACrB,eAAe,EAAE,KAAG;IACpB,eAAe,EAAE,KAAG;IACpB,mBAAmB,EAAE,KAAG;IACxB,sBAAsB,EAAE,KAAG;IAC3B,gBAAgB,EAAE,KAAG;CACrB,CAAC;AAEF,sMAAgF;AAEhF,kDAAkD;AAClD,SAAS,SAAS,CAAC,IAAY,EAAU;IACxC,MAAM,MAAM,GAA2B;QACtC,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,WAAW;QACtB,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AM,CAAC,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC;QAC/B,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAAA,CACxB;AAED,8NAAgF;AAEhF,sBAAsB;AACtB,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxB,CAAC","sourcesContent":["import type { FeaturePipeline, FeatureStatus, VibeEvent, VibeEventType } from \"./types.js\";\n\n// ─── Event Icons ─────────────────────────────────────────────────────────────\n\n/** Icons by event type */\nconst EVENT_ICONS: Partial<Record<VibeEventType, string>> = {\n\tstep_start: \"⚙\",\n\tstep_complete: \"✓\",\n\tstep_failed: \"✗\",\n\tstep_retry: \"↻\",\n\tgate_waiting: \"◈\",\n\tgate_approved: \"✓\",\n\tgate_rejected: \"✗\",\n\tgate_skipped: \"⊘\",\n\tblocked: \"⚠\",\n\tpipeline_complete: \"✓\",\n\tfeature_start: \"▸\",\n\tfeature_complete: \"✓\",\n\tfeature_skipped: \"⊘\",\n\tfeature_aborted: \"✗\",\n\torchestration_start: \"▸\",\n\torchestration_complete: \"✓\",\n\tstandards_loaded: \"✓\",\n};\n\n// ─── Event Formatting ────────────────────────────────────────────────────────\n\n/** Converts an agent role to a display string. */\nfunction roleLabel(role: string): string {\n\tconst labels: Record<string, string> = {\n\t\tplanner: \"Planner\",\n\t\tarchitect: \"Architect\",\n\t\tdeveloper: \"Developer\",\n\t\ttester: \"Tester\",\n\t\treviewer: \"Reviewer\",\n\t\tcicd: \"CI/CD\",\n\t\tanalyzer: \"Analyzer\",\n\t\tdiagnostician: \"Diagnostician\",\n\t\tdiscovery: \"Discovery\",\n\t\tprojectAnalyzer: \"Project Analyzer\",\n\t};\n\treturn labels[role] ?? role;\n}\n\n/** Converts a VibeEvent to a user-friendly string. */\nexport function formatVibeEvent(event: VibeEvent): string {\n\tconst icon = EVENT_ICONS[event.type] ?? \"·\";\n\n\tswitch (event.type) {\n\t\tcase \"step_start\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst action = event.step?.action ?? \"\";\n\t\t\treturn `${icon} [${agent}] ${action}...`;\n\t\t}\n\n\t\tcase \"step_complete\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst elapsed = event.data?.elapsed ? ` (${event.data.elapsed}ms)` : \"\";\n\t\t\treturn `${icon} [${agent}] done${elapsed}`;\n\t\t}\n\n\t\tcase \"step_failed\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst error = event.data?.error ?? event.data?.reason ?? \"unknown error\";\n\t\t\tconst attempts = event.data?.attempts ? ` (${event.data.attempts} attempts)` : \"\";\n\t\t\treturn `${icon} [${agent}] FAILED: ${error}${attempts}`;\n\t\t}\n\n\t\tcase \"step_retry\": {\n\t\t\tconst agent = event.step ? roleLabel(event.step.agent) : \"Unknown\";\n\t\t\tconst attempt = event.data?.attempt ?? \"?\";\n\t\t\tconst maxRetries = event.data?.maxRetries ?? \"?\";\n\t\t\tconst delayMs = event.data?.delayMs ?? 0;\n\t\t\tconst delaySec = Math.round((delayMs as number) / 1000);\n\t\t\tconst error = event.data?.error ?? \"unknown error\";\n\t\t\treturn `${icon} [${agent}] Retrying (${attempt}/${maxRetries}) in ${delaySec}s: ${error}`;\n\t\t}\n\n\t\tcase \"gate_waiting\":\n\t\t\treturn `${icon} [Gate] Waiting for approval...`;\n\n\t\tcase \"gate_approved\":\n\t\t\treturn `${icon} [Gate] Approved`;\n\n\t\tcase \"gate_rejected\": {\n\t\t\tconst feedback = event.data?.feedback ? `: ${event.data.feedback}` : \"\";\n\t\t\treturn `${icon} [Gate] Rejected${feedback}`;\n\t\t}\n\n\t\tcase \"blocked\": {\n\t\t\tconst reason = event.data?.reason ?? \"unknown\";\n\t\t\treturn `${icon} [BLOCKED] ${reason}`;\n\t\t}\n\n\t\tcase \"pipeline_complete\":\n\t\t\treturn `${icon} [Pipeline] Complete: ${event.featureId}`;\n\n\t\tcase \"standards_loaded\":\n\t\t\treturn `${icon} [Orchestrator] Standards loaded`;\n\n\t\tcase \"orchestration_start\": {\n\t\t\tconst count = event.data?.featureCount ?? 0;\n\t\t\treturn `${icon} [Orchestrator] Starting ${count} features...`;\n\t\t}\n\n\t\tcase \"feature_start\": {\n\t\t\tconst title = event.data?.title ?? event.featureId;\n\t\t\treturn `${icon} [Orchestrator] Feature: ${title} (${event.featureId})`;\n\t\t}\n\n\t\tcase \"feature_complete\":\n\t\t\treturn `${icon} [Orchestrator] Feature complete: ${event.featureId}`;\n\n\t\tcase \"feature_skipped\": {\n\t\t\tconst reason = event.data?.reason ?? \"dependency failed\";\n\t\t\treturn `${icon} [Orchestrator] Feature skipped: ${event.featureId} (${reason})`;\n\t\t}\n\n\t\tcase \"orchestration_complete\": {\n\t\t\tconst completedCount = (event.data?.completed as string[])?.length ?? 0;\n\t\t\tconst total = event.data?.total ?? 0;\n\t\t\tconst aborted = event.data?.abortedFeature ? ` (aborted: ${event.data.abortedFeature})` : \"\";\n\t\t\treturn `${icon} [Orchestrator] Complete: ${completedCount}/${total} features${aborted}`;\n\t\t}\n\n\t\tcase \"gate_skipped\":\n\t\t\treturn `${icon} [Gate] Skipped (review not performed)`;\n\n\t\tcase \"feature_aborted\":\n\t\t\treturn `${icon} [Orchestrator] Feature aborted: ${event.featureId}`;\n\n\t\tdefault:\n\t\t\treturn `${icon} [Event] ${event.type}`;\n\t}\n}\n\n// ─── Status Formatting ──────────────────────────────────────────────────────\n\n/** Generates a pipeline status summary. */\nexport function formatPipelineStatus(pipeline: FeaturePipeline): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${pipeline.featureId}`);\n\tlines.push(`Workflow: ${pipeline.workflowType}`);\n\tlines.push(`Status: ${pipeline.status}`);\n\tlines.push(`Progress: ${pipeline.currentStep}/${pipeline.steps.length}`);\n\n\tif (pipeline.retryCount > 0) {\n\t\tlines.push(`Retries: ${pipeline.retryCount}/${pipeline.maxRetries}`);\n\t}\n\n\tlines.push(\"\");\n\tlines.push(\"Steps:\");\n\tfor (let i = 0; i < pipeline.steps.length; i++) {\n\t\tconst step = pipeline.steps[i];\n\t\tlet marker: string;\n\t\tif (i < pipeline.currentStep) {\n\t\t\tmarker = \"✓\";\n\t\t} else if (i === pipeline.currentStep && pipeline.status === \"running\") {\n\t\t\tmarker = \"●\";\n\t\t} else if (step.skip) {\n\t\t\tmarker = \"⊘\";\n\t\t} else {\n\t\t\tmarker = \"○\";\n\t\t}\n\t\tlines.push(` ${marker} ${i + 1}. ${roleLabel(step.agent)}: ${step.action}`);\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/** Generates feature status details. */\nexport function formatFeatureDetail(featureId: string, status: FeatureStatus, artifacts: string[]): string {\n\tconst lines: string[] = [];\n\tlines.push(`Feature: ${featureId}`);\n\tlines.push(`Status: ${status.status}`);\n\tlines.push(`Updated: ${status.updatedAt}`);\n\n\tif (status.phase) {\n\t\tlines.push(`Phase: ${status.phase}`);\n\t}\n\n\tif (status.error) {\n\t\tlines.push(`Error: ${status.error}`);\n\t}\n\n\tif (artifacts.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Artifacts:\");\n\t\tfor (const artifact of artifacts) {\n\t\t\tlines.push(` - ${artifact}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n// ─── Help ────────────────────────────────────────────────────────────────────\n\n/** /vibe help text */\nexport const VIBE_HELP = `Usage: /vibe <command> [args]\n\nWorkflow Commands:\n new <requirement> Start a new feature\n enhance <featureId> <req> Enhance an existing feature\n fix <description> [--issue N] Fix a bug\n refactor <featureId> <purpose> Refactor a feature\n\nControl Commands:\n status [featureId] Show pipeline status\n pause <featureId> Pause a running pipeline\n resume <featureId> Resume a paused pipeline\n recover Recover lost orchestration state from artifacts\n steer <featureId> <feedback> Send feedback to running agent\n log <featureId> Show execution log\n\nAnalysis Commands:\n analyze Analyze project and generate project-context.md\n\nSetup Commands:\n config Show/edit configuration\n init Initialize .vibe/ directory\n reset Delete .vibe/ and re-initialize\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wizdear/atlas-code",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "AI Atlas Code Engineering System - Multi-agent orchestration for pi-coding-agent",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",