@cluesmith/codev-types 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -6,6 +6,13 @@
6
6
  * VS Code extension (packages/codev-vscode).
7
7
  */
8
8
  export interface ArchitectState {
9
+ /**
10
+ * The architect's stable name (Spec 755). For single-architect workspaces this is
11
+ * `'main'`. For sibling-architect workspaces, additional architects are
12
+ * `'architect-2'`, `'architect-3'`, or whatever custom name was supplied via
13
+ * `afx workspace add-architect --name <name>`.
14
+ */
15
+ name: string;
9
16
  port: number;
10
17
  pid: number;
11
18
  terminalId?: string;
@@ -24,6 +31,14 @@ export interface Builder {
24
31
  projectId?: string;
25
32
  terminalId?: string;
26
33
  persistent?: boolean;
34
+ /**
35
+ * Spec 755 / Spec 786: the architect that spawned this builder, if any.
36
+ * `null` for builders spawned outside of an architect context; the
37
+ * architect's name (`'main'` or a sibling name) otherwise. Surfaced to the
38
+ * dashboard so the remove-architect confirmation modal (Phase 4) can show
39
+ * users which builders are affected before they confirm the removal.
40
+ */
41
+ spawnedByArchitect?: string | null;
27
42
  }
28
43
  export interface UtilTerminal {
29
44
  id: string;
@@ -39,13 +54,32 @@ export interface Annotation {
39
54
  file: string;
40
55
  port: number;
41
56
  pid: number;
42
- parent: {
57
+ /**
58
+ * Optional parent reference. The Tower `/api/state` handler does not populate
59
+ * this; the field is reserved for richer client-driven annotation flows that
60
+ * may emerge later. Treat as informational only.
61
+ */
62
+ parent?: {
43
63
  type: string;
44
64
  id?: string;
45
65
  };
46
66
  }
47
67
  export interface DashboardState {
68
+ /**
69
+ * Backward-compatible scalar pointer to the dashboard's "default" architect.
70
+ * Populated as the architect named `'main'` if present, else the first
71
+ * registered architect. Consumers that only need one architect (e.g. older
72
+ * VSCode-extension builds) should read this field.
73
+ */
48
74
  architect: ArchitectState | null;
75
+ /**
76
+ * Full collection of registered architects (Spec 761). The entry whose
77
+ * `name === 'main'` is always at index 0 when present; remaining entries
78
+ * follow insertion order from Tower's internal map. Empty array means no
79
+ * architect is registered. Consumers that need to surface all architects
80
+ * (e.g. the dashboard tab strip) should read this field.
81
+ */
82
+ architects: ArchitectState[];
49
83
  builders: Builder[];
50
84
  utils: UtilTerminal[];
51
85
  annotations: Annotation[];
@@ -60,6 +94,27 @@ export interface TerminalEntry {
60
94
  label: string;
61
95
  url: string;
62
96
  active: boolean;
97
+ /**
98
+ * Spec 786 Phase 5: when `type === 'architect'`, the architect's stable
99
+ * name (`'main'` or a sibling). Allows consumers to enumerate architects
100
+ * without parsing the tab id.
101
+ */
102
+ architectName?: string;
103
+ /**
104
+ * Spec 786 Phase 5: live PID from Tower's in-memory PtySession (architect
105
+ * entries only; not persisted in `state.db`).
106
+ */
107
+ pid?: number;
108
+ /**
109
+ * Spec 786 Phase 5: port assigned to the terminal, if any.
110
+ */
111
+ port?: number;
112
+ /**
113
+ * Spec 786 Phase 5: the underlying PtySession id. For architects, the
114
+ * `id` field carries the tab identifier (Spec 761 deep-link convention);
115
+ * this field exposes the actual session id for terminal-attach correlation.
116
+ */
117
+ terminalId?: string;
63
118
  }
64
119
  export interface OverviewBuilder {
65
120
  id: string;
@@ -69,6 +124,14 @@ export interface OverviewBuilder {
69
124
  mode: 'strict' | 'soft';
70
125
  gates: Record<string, string>;
71
126
  worktreePath: string;
127
+ /**
128
+ * Canonical role identifier (e.g. `builder-pir-1423`) derived from the
129
+ * worktree basename. Stable across requests for a given builder while
130
+ * its worktree exists, and the key by which Tower's runtime terminal
131
+ * registry indexes the live session. `null` for soft-mode builders
132
+ * whose worktree name doesn't match a known protocol pattern.
133
+ */
134
+ roleId: string | null;
72
135
  protocol: string;
73
136
  planPhases: Array<{
74
137
  id: string;
@@ -76,10 +139,33 @@ export interface OverviewBuilder {
76
139
  status: string;
77
140
  }>;
78
141
  progress: number;
142
+ /** Human-readable label for the gate the builder is blocked on (e.g. "plan review"). */
79
143
  blocked: string | null;
144
+ /**
145
+ * Canonical gate name (e.g. "plan-approval") for the gate the builder is
146
+ * blocked on. Use this when calling `porch approve` — `blocked` is a
147
+ * display label and won't match porch's gate keys.
148
+ */
149
+ blockedGate: string | null;
80
150
  blockedSince: string | null;
81
151
  startedAt: string | null;
82
152
  idleMs: number;
153
+ /**
154
+ * Wall-clock ISO timestamp of the last DATA frame Tower received from
155
+ * this builder's shellper, or `null` when no live session exists.
156
+ * Clients use it to flag builders that have been silent for a threshold
157
+ * — likely waiting for non-gate human input. Distinct from `idleMs`,
158
+ * which sums time spent at formal porch gates.
159
+ */
160
+ lastDataAt: string | null;
161
+ /**
162
+ * Name of the architect that spawned this builder (Spec 755 / 823). `null` for
163
+ * legacy rows from before #755, for builders whose worktree doesn't have a
164
+ * matching row in `state.db.builders`, or when state.db is unavailable. Used
165
+ * by the dashboard to render an inline attribution tag when the workspace
166
+ * hosts more than one architect.
167
+ */
168
+ spawnedByArchitect: string | null;
83
169
  }
84
170
  export interface OverviewPR {
85
171
  id: string;
@@ -123,11 +209,56 @@ export interface OverviewData {
123
209
  pendingPRs: OverviewPR[];
124
210
  backlog: OverviewBacklogItem[];
125
211
  recentlyClosed: OverviewRecentlyClosed[];
212
+ /** Auto-detected GitHub login of the current user (via the user-identity forge concept). */
213
+ currentUser?: string;
126
214
  errors?: {
127
215
  prs?: string;
128
216
  issues?: string;
129
217
  };
130
218
  }
219
+ /** One row in the VSCode "Open Dev URL" workspace surface. */
220
+ export interface WorktreeDevUrl {
221
+ label: string;
222
+ url: string;
223
+ }
224
+ /**
225
+ * Resolved view of the `worktree` config block with defaults applied
226
+ * across the loadConfig layer chain (defaults / cache / global /
227
+ * project / project-local). Always has populated fields — unset
228
+ * scalars collapse to null, unset collections to empty arrays — so
229
+ * consumers don't have to branch.
230
+ */
231
+ export interface ResolvedWorktreeConfig {
232
+ /** Glob patterns to symlink from workspace root into each worktree. `[]` when unset. */
233
+ symlinks: string[];
234
+ /** Shell commands to run in each worktree after creation. `[]` when unset. */
235
+ postSpawn: string[];
236
+ /** Command for `afx dev <builder-id>`. `null` when unset. */
237
+ devCommand: string | null;
238
+ /**
239
+ * Canonical resolved list of dev URLs for the VSCode "Open Dev URL"
240
+ * workspace surface. Always an array — `[]` when neither `devUrl`
241
+ * nor `devUrls` is set in the user config.
242
+ */
243
+ devUrls: WorktreeDevUrl[];
244
+ }
245
+ /**
246
+ * A single issue as returned by the `issue-view` forge concept and
247
+ * surfaced verbatim by Tower's GET /api/issue. Mirrors the server-side
248
+ * IssueViewResult (packages/codev/src/lib/forge-contracts.ts).
249
+ */
250
+ export interface IssueView {
251
+ title: string;
252
+ body: string;
253
+ state: string;
254
+ comments: Array<{
255
+ body: string;
256
+ createdAt: string;
257
+ author: {
258
+ login: string;
259
+ };
260
+ }>;
261
+ }
131
262
  export interface ReviewBlockingEntry {
132
263
  direction: 'authored' | 'reviewing';
133
264
  otherName: string;
@@ -145,11 +276,13 @@ export interface TeamMemberGitHubData {
145
276
  title: string;
146
277
  url: string;
147
278
  }[];
279
+ assignedIssuesCount: number;
148
280
  openPRs: {
149
281
  number: number;
150
282
  title: string;
151
283
  url: string;
152
284
  }[];
285
+ openPRsCount: number;
153
286
  recentActivity: {
154
287
  mergedPRs: {
155
288
  number: number;
@@ -157,12 +290,14 @@ export interface TeamMemberGitHubData {
157
290
  url: string;
158
291
  mergedAt: string;
159
292
  }[];
293
+ mergedPRsCount: number;
160
294
  closedIssues: {
161
295
  number: number;
162
296
  title: string;
163
297
  url: string;
164
298
  closedAt: string;
165
299
  }[];
300
+ closedIssuesCount: number;
166
301
  };
167
302
  reviewBlocking: ReviewBlockingEntry[];
168
303
  }
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,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AAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { FRAME_CONTROL, FRAME_DATA, type ControlMessage, type DecodedFrame, } from './websocket.js';
2
2
  export { type SSEEventType, type SSENotification, type BuilderSpawnedPayload, } from './sse.js';
3
- export { type ArchitectState, type Builder, type UtilTerminal, type Annotation, type DashboardState, type TerminalEntry, type OverviewBuilder, type OverviewPR, type OverviewBacklogItem, type OverviewRecentlyClosed, type OverviewData, type TeamMemberGitHubData, type ReviewBlockingEntry, type TeamApiMember, type TeamApiMessage, type TeamApiResponse, type TunnelStatus, type ProtocolStats, type AnalyticsResponse, } from './api.js';
3
+ export { type ArchitectState, type Builder, type UtilTerminal, type Annotation, type DashboardState, type TerminalEntry, type OverviewBuilder, type OverviewPR, type OverviewBacklogItem, type OverviewRecentlyClosed, type OverviewData, type IssueView, type WorktreeDevUrl, type ResolvedWorktreeConfig, type TeamMemberGitHubData, type ReviewBlockingEntry, type TeamApiMember, type TeamApiMessage, type TeamApiResponse, type TunnelStatus, type ProtocolStats, type AnalyticsResponse, } from './api.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluesmith/codev-types",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Shared TypeScript types for Codev — WebSocket protocol, API shapes, SSE events",
5
5
  "type": "module",
6
6
  "exports": {
package/src/api.ts CHANGED
@@ -9,6 +9,13 @@
9
9
  // --- Dashboard State (GET /workspace/:path/api/state) ---
10
10
 
11
11
  export interface ArchitectState {
12
+ /**
13
+ * The architect's stable name (Spec 755). For single-architect workspaces this is
14
+ * `'main'`. For sibling-architect workspaces, additional architects are
15
+ * `'architect-2'`, `'architect-3'`, or whatever custom name was supplied via
16
+ * `afx workspace add-architect --name <name>`.
17
+ */
18
+ name: string;
12
19
  port: number;
13
20
  pid: number;
14
21
  terminalId?: string;
@@ -28,6 +35,14 @@ export interface Builder {
28
35
  projectId?: string;
29
36
  terminalId?: string;
30
37
  persistent?: boolean;
38
+ /**
39
+ * Spec 755 / Spec 786: the architect that spawned this builder, if any.
40
+ * `null` for builders spawned outside of an architect context; the
41
+ * architect's name (`'main'` or a sibling name) otherwise. Surfaced to the
42
+ * dashboard so the remove-architect confirmation modal (Phase 4) can show
43
+ * users which builders are affected before they confirm the removal.
44
+ */
45
+ spawnedByArchitect?: string | null;
31
46
  }
32
47
 
33
48
  export interface UtilTerminal {
@@ -45,11 +60,30 @@ export interface Annotation {
45
60
  file: string;
46
61
  port: number;
47
62
  pid: number;
48
- parent: { type: string; id?: string };
63
+ /**
64
+ * Optional parent reference. The Tower `/api/state` handler does not populate
65
+ * this; the field is reserved for richer client-driven annotation flows that
66
+ * may emerge later. Treat as informational only.
67
+ */
68
+ parent?: { type: string; id?: string };
49
69
  }
50
70
 
51
71
  export interface DashboardState {
72
+ /**
73
+ * Backward-compatible scalar pointer to the dashboard's "default" architect.
74
+ * Populated as the architect named `'main'` if present, else the first
75
+ * registered architect. Consumers that only need one architect (e.g. older
76
+ * VSCode-extension builds) should read this field.
77
+ */
52
78
  architect: ArchitectState | null;
79
+ /**
80
+ * Full collection of registered architects (Spec 761). The entry whose
81
+ * `name === 'main'` is always at index 0 when present; remaining entries
82
+ * follow insertion order from Tower's internal map. Empty array means no
83
+ * architect is registered. Consumers that need to surface all architects
84
+ * (e.g. the dashboard tab strip) should read this field.
85
+ */
86
+ architects: ArchitectState[];
53
87
  builders: Builder[];
54
88
  utils: UtilTerminal[];
55
89
  annotations: Annotation[];
@@ -67,6 +101,27 @@ export interface TerminalEntry {
67
101
  label: string;
68
102
  url: string;
69
103
  active: boolean;
104
+ /**
105
+ * Spec 786 Phase 5: when `type === 'architect'`, the architect's stable
106
+ * name (`'main'` or a sibling). Allows consumers to enumerate architects
107
+ * without parsing the tab id.
108
+ */
109
+ architectName?: string;
110
+ /**
111
+ * Spec 786 Phase 5: live PID from Tower's in-memory PtySession (architect
112
+ * entries only; not persisted in `state.db`).
113
+ */
114
+ pid?: number;
115
+ /**
116
+ * Spec 786 Phase 5: port assigned to the terminal, if any.
117
+ */
118
+ port?: number;
119
+ /**
120
+ * Spec 786 Phase 5: the underlying PtySession id. For architects, the
121
+ * `id` field carries the tab identifier (Spec 761 deep-link convention);
122
+ * this field exposes the actual session id for terminal-attach correlation.
123
+ */
124
+ terminalId?: string;
70
125
  }
71
126
 
72
127
  // --- Overview (GET /api/overview) ---
@@ -79,13 +134,44 @@ export interface OverviewBuilder {
79
134
  mode: 'strict' | 'soft';
80
135
  gates: Record<string, string>;
81
136
  worktreePath: string;
137
+ /**
138
+ * Canonical role identifier (e.g. `builder-pir-1423`) derived from the
139
+ * worktree basename. Stable across requests for a given builder while
140
+ * its worktree exists, and the key by which Tower's runtime terminal
141
+ * registry indexes the live session. `null` for soft-mode builders
142
+ * whose worktree name doesn't match a known protocol pattern.
143
+ */
144
+ roleId: string | null;
82
145
  protocol: string;
83
146
  planPhases: Array<{ id: string; title: string; status: string }>;
84
147
  progress: number;
148
+ /** Human-readable label for the gate the builder is blocked on (e.g. "plan review"). */
85
149
  blocked: string | null;
150
+ /**
151
+ * Canonical gate name (e.g. "plan-approval") for the gate the builder is
152
+ * blocked on. Use this when calling `porch approve` — `blocked` is a
153
+ * display label and won't match porch's gate keys.
154
+ */
155
+ blockedGate: string | null;
86
156
  blockedSince: string | null;
87
157
  startedAt: string | null;
88
158
  idleMs: number;
159
+ /**
160
+ * Wall-clock ISO timestamp of the last DATA frame Tower received from
161
+ * this builder's shellper, or `null` when no live session exists.
162
+ * Clients use it to flag builders that have been silent for a threshold
163
+ * — likely waiting for non-gate human input. Distinct from `idleMs`,
164
+ * which sums time spent at formal porch gates.
165
+ */
166
+ lastDataAt: string | null;
167
+ /**
168
+ * Name of the architect that spawned this builder (Spec 755 / 823). `null` for
169
+ * legacy rows from before #755, for builders whose worktree doesn't have a
170
+ * matching row in `state.db.builders`, or when state.db is unavailable. Used
171
+ * by the dashboard to render an inline attribution tag when the workspace
172
+ * hosts more than one architect.
173
+ */
174
+ spawnedByArchitect: string | null;
89
175
  }
90
176
 
91
177
  export interface OverviewPR {
@@ -133,9 +219,59 @@ export interface OverviewData {
133
219
  pendingPRs: OverviewPR[];
134
220
  backlog: OverviewBacklogItem[];
135
221
  recentlyClosed: OverviewRecentlyClosed[];
222
+ /** Auto-detected GitHub login of the current user (via the user-identity forge concept). */
223
+ currentUser?: string;
136
224
  errors?: { prs?: string; issues?: string };
137
225
  }
138
226
 
227
+ // --- Worktree config (GET /api/worktree-config) ---
228
+
229
+ /** One row in the VSCode "Open Dev URL" workspace surface. */
230
+ export interface WorktreeDevUrl {
231
+ label: string;
232
+ url: string;
233
+ }
234
+
235
+ /**
236
+ * Resolved view of the `worktree` config block with defaults applied
237
+ * across the loadConfig layer chain (defaults / cache / global /
238
+ * project / project-local). Always has populated fields — unset
239
+ * scalars collapse to null, unset collections to empty arrays — so
240
+ * consumers don't have to branch.
241
+ */
242
+ export interface ResolvedWorktreeConfig {
243
+ /** Glob patterns to symlink from workspace root into each worktree. `[]` when unset. */
244
+ symlinks: string[];
245
+ /** Shell commands to run in each worktree after creation. `[]` when unset. */
246
+ postSpawn: string[];
247
+ /** Command for `afx dev <builder-id>`. `null` when unset. */
248
+ devCommand: string | null;
249
+ /**
250
+ * Canonical resolved list of dev URLs for the VSCode "Open Dev URL"
251
+ * workspace surface. Always an array — `[]` when neither `devUrl`
252
+ * nor `devUrls` is set in the user config.
253
+ */
254
+ devUrls: WorktreeDevUrl[];
255
+ }
256
+
257
+ // --- Issue view (GET /api/issue) ---
258
+
259
+ /**
260
+ * A single issue as returned by the `issue-view` forge concept and
261
+ * surfaced verbatim by Tower's GET /api/issue. Mirrors the server-side
262
+ * IssueViewResult (packages/codev/src/lib/forge-contracts.ts).
263
+ */
264
+ export interface IssueView {
265
+ title: string;
266
+ body: string;
267
+ state: string;
268
+ comments: Array<{
269
+ body: string;
270
+ createdAt: string;
271
+ author: { login: string };
272
+ }>;
273
+ }
274
+
139
275
  // --- Team (GET /workspace/:path/api/team) ---
140
276
 
141
277
  export interface ReviewBlockingEntry {
@@ -151,11 +287,18 @@ export interface ReviewBlockingEntry {
151
287
  }
152
288
 
153
289
  export interface TeamMemberGitHubData {
290
+ // node arrays are capped at GitHub search `first` (20) and feed lists /
291
+ // review-blocking; the *Count fields are the true totals (search.issueCount)
292
+ // and must be used for any "N assigned / N open" display.
154
293
  assignedIssues: { number: number; title: string; url: string }[];
294
+ assignedIssuesCount: number;
155
295
  openPRs: { number: number; title: string; url: string }[];
296
+ openPRsCount: number;
156
297
  recentActivity: {
157
298
  mergedPRs: { number: number; title: string; url: string; mergedAt: string }[];
299
+ mergedPRsCount: number;
158
300
  closedIssues: { number: number; title: string; url: string; closedAt: string }[];
301
+ closedIssuesCount: number;
159
302
  };
160
303
  reviewBlocking: ReviewBlockingEntry[];
161
304
  }
package/src/index.ts CHANGED
@@ -23,6 +23,9 @@ export {
23
23
  type OverviewBacklogItem,
24
24
  type OverviewRecentlyClosed,
25
25
  type OverviewData,
26
+ type IssueView,
27
+ type WorktreeDevUrl,
28
+ type ResolvedWorktreeConfig,
26
29
  type TeamMemberGitHubData,
27
30
  type ReviewBlockingEntry,
28
31
  type TeamApiMember,