@cluesmith/codev-types 3.2.0 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +47 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/command.d.ts +42 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +23 -0
- package/dist/command.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +52 -0
- package/src/command.ts +51 -0
- package/src/index.ts +10 -0
package/dist/api.d.ts
CHANGED
|
@@ -270,6 +270,18 @@ export interface OverviewData {
|
|
|
270
270
|
pendingPRs: OverviewPR[];
|
|
271
271
|
backlog: OverviewBacklogItem[];
|
|
272
272
|
recentlyClosed: OverviewRecentlyClosed[];
|
|
273
|
+
/**
|
|
274
|
+
* The workspace's architects with a live session (Issue 1104), main-first.
|
|
275
|
+
* Carries the same `ArchitectState[]` shape `DashboardState.architects`
|
|
276
|
+
* exposes, built by the shared `liveArchitects` helper from the live terminal
|
|
277
|
+
* sessions, so the overview payload and the dashboard-state payload never
|
|
278
|
+
* drift. Only architects with a live session are listed (stale registrations
|
|
279
|
+
* are skipped). `[]` when the workspace has no architects or none are live —
|
|
280
|
+
* never `undefined`, so consumers don't branch. Lets the VSCode Agents tree
|
|
281
|
+
* render its architect tier and the architect-attribution badge straight off
|
|
282
|
+
* the overview cache without a second fetch.
|
|
283
|
+
*/
|
|
284
|
+
architects: ArchitectState[];
|
|
273
285
|
/** Auto-detected GitHub login of the current user (via the user-identity forge concept). */
|
|
274
286
|
currentUser?: string;
|
|
275
287
|
errors?: {
|
|
@@ -303,6 +315,32 @@ export interface ResolvedWorktreeConfig {
|
|
|
303
315
|
*/
|
|
304
316
|
devUrls: WorktreeDevUrl[];
|
|
305
317
|
}
|
|
318
|
+
/** An abstract Codev activity the extension publishes to configured URL hooks. */
|
|
319
|
+
export type ActivityEvent = 'window-focus' | 'builder-active';
|
|
320
|
+
/**
|
|
321
|
+
* One configured sink from the `activityHooks` config block: when one of `on`'s
|
|
322
|
+
* events fires, the extension opens `url` (a template — `{workspace}`/`{builder}`
|
|
323
|
+
* placeholders are replaced with the URL-encoded event data). `background: true`
|
|
324
|
+
* delivers without foregrounding the handler app. The destination is the user's
|
|
325
|
+
* (a deep link, a companion app, a webhook launcher); the extension is agnostic.
|
|
326
|
+
*/
|
|
327
|
+
export interface ActivityHook {
|
|
328
|
+
on: ActivityEvent[];
|
|
329
|
+
url: string;
|
|
330
|
+
background?: boolean;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Resolved `activityHooks`. SECURITY: hooks resolve from the **personal config
|
|
334
|
+
* layers only** — `~/.codev/config.json` (global) + `.codev/config.local.json`
|
|
335
|
+
* (per-engineer) — and NEVER the committed `.codev/config.json` project layer.
|
|
336
|
+
* Hooks open URLs (a deep link, a companion app, a scheme handler), so sourcing
|
|
337
|
+
* them from repo-committed config would be a zero-click RCE (a cloned repo could
|
|
338
|
+
* ship a hook url that fires on `window-focus`). Do NOT widen this to `loadConfig`.
|
|
339
|
+
* Malformed entries are dropped; `hooks` is always an array (`[]` when unset).
|
|
340
|
+
*/
|
|
341
|
+
export interface ResolvedActivityHooks {
|
|
342
|
+
hooks: ActivityHook[];
|
|
343
|
+
}
|
|
306
344
|
/**
|
|
307
345
|
* A single issue as returned by the `issue-view` forge concept and
|
|
308
346
|
* surfaced verbatim by Tower's GET /api/issue. Mirrors the server-side
|
|
@@ -312,6 +350,15 @@ export interface IssueView {
|
|
|
312
350
|
title: string;
|
|
313
351
|
body: string;
|
|
314
352
|
state: string;
|
|
353
|
+
/**
|
|
354
|
+
* The issue's **browser/web** URL (NOT an API endpoint), when the forge
|
|
355
|
+
* concept supplies it. Each forge maps its own web-URL field into this:
|
|
356
|
+
* GitHub `url`, GitLab `web_url`, Gitea `html_url` (Gitea's `url` is the API
|
|
357
|
+
* endpoint — do not use it), Linear `url`. Optional so the contract stays
|
|
358
|
+
* forge-neutral; consumers that open the issue in a browser degrade
|
|
359
|
+
* gracefully when it's absent (e.g. a forge script that doesn't emit it).
|
|
360
|
+
*/
|
|
361
|
+
url?: string;
|
|
315
362
|
comments: Array<{
|
|
316
363
|
body: string;
|
|
317
364
|
createdAt: string;
|
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;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC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AAC,CAAC;KACnD,CAAC;IACF,YAAY,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,OAAO,EAAE,KAAK,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;YACzB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC,CAAC;QACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC,CAAC;IACF,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contracts for Tower's command channel.
|
|
3
|
+
*
|
|
4
|
+
* Lets a CONTROLLER (an external control device or companion app) drive the
|
|
5
|
+
* active editor PROVIDER (the VSCode extension today, the web dashboard later)
|
|
6
|
+
* over Tower's existing SSE + REST transport:
|
|
7
|
+
* - controller -> Tower: REST POST `/api/command` (run a canonical verb).
|
|
8
|
+
* - Tower -> provider: SSE `command` (the verb to run).
|
|
9
|
+
*
|
|
10
|
+
* The channel carries CANONICAL VERBS (`view-diff`, `forward-hunk`, ...), not
|
|
11
|
+
* provider-specific command ids, so one controller drives any provider; each
|
|
12
|
+
* provider maps the verb to its own implementation. Pure wire shapes only.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Controller -> Tower (`/api/command`): run a canonical verb on the active
|
|
16
|
+
* editor provider. The verb (e.g. `view-diff`, `forward-hunk`) is
|
|
17
|
+
* provider-agnostic; the provider maps it to its own implementation. `args`
|
|
18
|
+
* carries verb operands (typically the target builder id).
|
|
19
|
+
*
|
|
20
|
+
* `workspace` (optional) is the absolute path of the workspace the command
|
|
21
|
+
* targets. A provider that knows its own workspace drops a command whose
|
|
22
|
+
* `workspace` does not match, so a single Tower serving multiple workspaces does
|
|
23
|
+
* not run a verb against the wrong one. Omitted today (no controller populates it
|
|
24
|
+
* yet); when present, it is the authoritative scope (mirrors how `builder-spawned`
|
|
25
|
+
* carries `workspacePath`). The focus-gate alone is insufficient once a second
|
|
26
|
+
* workspace exists.
|
|
27
|
+
*/
|
|
28
|
+
export interface CommandRequest {
|
|
29
|
+
verb: string;
|
|
30
|
+
args?: unknown[];
|
|
31
|
+
workspace?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Result of a relayed command (the `/api/command` response). */
|
|
34
|
+
export interface CommandResult {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
error?: string;
|
|
37
|
+
}
|
|
38
|
+
/** REST route a controller POSTs a command to. */
|
|
39
|
+
export declare const COMMAND_ROUTE = "/api/command";
|
|
40
|
+
/** SSE event-type name Tower fans a command out to providers as. */
|
|
41
|
+
export declare const COMMAND_EVENT = "command";
|
|
42
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAQD,kDAAkD;AAClD,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
package/dist/command.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contracts for Tower's command channel.
|
|
3
|
+
*
|
|
4
|
+
* Lets a CONTROLLER (an external control device or companion app) drive the
|
|
5
|
+
* active editor PROVIDER (the VSCode extension today, the web dashboard later)
|
|
6
|
+
* over Tower's existing SSE + REST transport:
|
|
7
|
+
* - controller -> Tower: REST POST `/api/command` (run a canonical verb).
|
|
8
|
+
* - Tower -> provider: SSE `command` (the verb to run).
|
|
9
|
+
*
|
|
10
|
+
* The channel carries CANONICAL VERBS (`view-diff`, `forward-hunk`, ...), not
|
|
11
|
+
* provider-specific command ids, so one controller drives any provider; each
|
|
12
|
+
* provider maps the verb to its own implementation. Pure wire shapes only.
|
|
13
|
+
*/
|
|
14
|
+
// ----- Wire protocol names (single source for the route + event type) -----
|
|
15
|
+
// The route path and SSE event-type name ARE the contract: the controller,
|
|
16
|
+
// Tower, and the provider must agree on them. Defining them once here (rather
|
|
17
|
+
// than repeating string literals in each package) keeps the protocol in lockstep
|
|
18
|
+
// and gives compile-time references instead of stringly-typed coupling.
|
|
19
|
+
/** REST route a controller POSTs a command to. */
|
|
20
|
+
export const COMMAND_ROUTE = '/api/command';
|
|
21
|
+
/** SSE event-type name Tower fans a command out to providers as. */
|
|
22
|
+
export const COMMAND_EVENT = 'command';
|
|
23
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA4BH,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,iFAAiF;AACjF,wEAAwE;AAExE,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;AAE5C,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
|
3
|
+
export { type CommandRequest, type CommandResult, COMMAND_ROUTE, COMMAND_EVENT, } from './command.js';
|
|
4
|
+
export { type ArchitectState, type Builder, type UtilTerminal, type Annotation, type DashboardState, type TerminalEntry, type PlanPhase, type OverviewBuilder, type OverviewPR, type OverviewBacklogItem, type OverviewRecentlyClosed, type OverviewData, type IssueView, type IssueSearchItem, type IssueSearchResponse, type WorktreeDevUrl, type ResolvedWorktreeConfig, type ActivityEvent, type ActivityHook, type ResolvedActivityHooks, type TeamMemberGitHubData, type ReviewBlockingEntry, type TeamApiMember, type TeamApiMessage, type TeamApiResponse, type TunnelStatus, type TowerVersionInfo, type ProtocolStats, type AnalyticsResponse, } from './api.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,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,gBAAgB,EACrB,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,aAAa,EAClB,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,GAGX,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,GAGX,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EAGL,aAAa,EACb,aAAa,GACd,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -285,6 +285,18 @@ export interface OverviewData {
|
|
|
285
285
|
pendingPRs: OverviewPR[];
|
|
286
286
|
backlog: OverviewBacklogItem[];
|
|
287
287
|
recentlyClosed: OverviewRecentlyClosed[];
|
|
288
|
+
/**
|
|
289
|
+
* The workspace's architects with a live session (Issue 1104), main-first.
|
|
290
|
+
* Carries the same `ArchitectState[]` shape `DashboardState.architects`
|
|
291
|
+
* exposes, built by the shared `liveArchitects` helper from the live terminal
|
|
292
|
+
* sessions, so the overview payload and the dashboard-state payload never
|
|
293
|
+
* drift. Only architects with a live session are listed (stale registrations
|
|
294
|
+
* are skipped). `[]` when the workspace has no architects or none are live —
|
|
295
|
+
* never `undefined`, so consumers don't branch. Lets the VSCode Agents tree
|
|
296
|
+
* render its architect tier and the architect-attribution badge straight off
|
|
297
|
+
* the overview cache without a second fetch.
|
|
298
|
+
*/
|
|
299
|
+
architects: ArchitectState[];
|
|
288
300
|
/** Auto-detected GitHub login of the current user (via the user-identity forge concept). */
|
|
289
301
|
currentUser?: string;
|
|
290
302
|
errors?: { prs?: string; issues?: string };
|
|
@@ -320,6 +332,37 @@ export interface ResolvedWorktreeConfig {
|
|
|
320
332
|
devUrls: WorktreeDevUrl[];
|
|
321
333
|
}
|
|
322
334
|
|
|
335
|
+
// --- Activity hooks (GET /api/activity-hooks) ---
|
|
336
|
+
|
|
337
|
+
/** An abstract Codev activity the extension publishes to configured URL hooks. */
|
|
338
|
+
export type ActivityEvent = 'window-focus' | 'builder-active';
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* One configured sink from the `activityHooks` config block: when one of `on`'s
|
|
342
|
+
* events fires, the extension opens `url` (a template — `{workspace}`/`{builder}`
|
|
343
|
+
* placeholders are replaced with the URL-encoded event data). `background: true`
|
|
344
|
+
* delivers without foregrounding the handler app. The destination is the user's
|
|
345
|
+
* (a deep link, a companion app, a webhook launcher); the extension is agnostic.
|
|
346
|
+
*/
|
|
347
|
+
export interface ActivityHook {
|
|
348
|
+
on: ActivityEvent[];
|
|
349
|
+
url: string;
|
|
350
|
+
background?: boolean;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Resolved `activityHooks`. SECURITY: hooks resolve from the **personal config
|
|
355
|
+
* layers only** — `~/.codev/config.json` (global) + `.codev/config.local.json`
|
|
356
|
+
* (per-engineer) — and NEVER the committed `.codev/config.json` project layer.
|
|
357
|
+
* Hooks open URLs (a deep link, a companion app, a scheme handler), so sourcing
|
|
358
|
+
* them from repo-committed config would be a zero-click RCE (a cloned repo could
|
|
359
|
+
* ship a hook url that fires on `window-focus`). Do NOT widen this to `loadConfig`.
|
|
360
|
+
* Malformed entries are dropped; `hooks` is always an array (`[]` when unset).
|
|
361
|
+
*/
|
|
362
|
+
export interface ResolvedActivityHooks {
|
|
363
|
+
hooks: ActivityHook[];
|
|
364
|
+
}
|
|
365
|
+
|
|
323
366
|
// --- Issue view (GET /api/issue) ---
|
|
324
367
|
|
|
325
368
|
/**
|
|
@@ -331,6 +374,15 @@ export interface IssueView {
|
|
|
331
374
|
title: string;
|
|
332
375
|
body: string;
|
|
333
376
|
state: string;
|
|
377
|
+
/**
|
|
378
|
+
* The issue's **browser/web** URL (NOT an API endpoint), when the forge
|
|
379
|
+
* concept supplies it. Each forge maps its own web-URL field into this:
|
|
380
|
+
* GitHub `url`, GitLab `web_url`, Gitea `html_url` (Gitea's `url` is the API
|
|
381
|
+
* endpoint — do not use it), Linear `url`. Optional so the contract stays
|
|
382
|
+
* forge-neutral; consumers that open the issue in a browser degrade
|
|
383
|
+
* gracefully when it's absent (e.g. a forge script that doesn't emit it).
|
|
384
|
+
*/
|
|
385
|
+
url?: string;
|
|
334
386
|
comments: Array<{
|
|
335
387
|
body: string;
|
|
336
388
|
createdAt: string;
|
package/src/command.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contracts for Tower's command channel.
|
|
3
|
+
*
|
|
4
|
+
* Lets a CONTROLLER (an external control device or companion app) drive the
|
|
5
|
+
* active editor PROVIDER (the VSCode extension today, the web dashboard later)
|
|
6
|
+
* over Tower's existing SSE + REST transport:
|
|
7
|
+
* - controller -> Tower: REST POST `/api/command` (run a canonical verb).
|
|
8
|
+
* - Tower -> provider: SSE `command` (the verb to run).
|
|
9
|
+
*
|
|
10
|
+
* The channel carries CANONICAL VERBS (`view-diff`, `forward-hunk`, ...), not
|
|
11
|
+
* provider-specific command ids, so one controller drives any provider; each
|
|
12
|
+
* provider maps the verb to its own implementation. Pure wire shapes only.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Controller -> Tower (`/api/command`): run a canonical verb on the active
|
|
17
|
+
* editor provider. The verb (e.g. `view-diff`, `forward-hunk`) is
|
|
18
|
+
* provider-agnostic; the provider maps it to its own implementation. `args`
|
|
19
|
+
* carries verb operands (typically the target builder id).
|
|
20
|
+
*
|
|
21
|
+
* `workspace` (optional) is the absolute path of the workspace the command
|
|
22
|
+
* targets. A provider that knows its own workspace drops a command whose
|
|
23
|
+
* `workspace` does not match, so a single Tower serving multiple workspaces does
|
|
24
|
+
* not run a verb against the wrong one. Omitted today (no controller populates it
|
|
25
|
+
* yet); when present, it is the authoritative scope (mirrors how `builder-spawned`
|
|
26
|
+
* carries `workspacePath`). The focus-gate alone is insufficient once a second
|
|
27
|
+
* workspace exists.
|
|
28
|
+
*/
|
|
29
|
+
export interface CommandRequest {
|
|
30
|
+
verb: string;
|
|
31
|
+
args?: unknown[];
|
|
32
|
+
workspace?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Result of a relayed command (the `/api/command` response). */
|
|
36
|
+
export interface CommandResult {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ----- Wire protocol names (single source for the route + event type) -----
|
|
42
|
+
// The route path and SSE event-type name ARE the contract: the controller,
|
|
43
|
+
// Tower, and the provider must agree on them. Defining them once here (rather
|
|
44
|
+
// than repeating string literals in each package) keeps the protocol in lockstep
|
|
45
|
+
// and gives compile-time references instead of stringly-typed coupling.
|
|
46
|
+
|
|
47
|
+
/** REST route a controller POSTs a command to. */
|
|
48
|
+
export const COMMAND_ROUTE = '/api/command';
|
|
49
|
+
|
|
50
|
+
/** SSE event-type name Tower fans a command out to providers as. */
|
|
51
|
+
export const COMMAND_EVENT = 'command';
|
package/src/index.ts
CHANGED
|
@@ -11,6 +11,13 @@ export {
|
|
|
11
11
|
type BuilderSpawnedPayload,
|
|
12
12
|
} from './sse.js';
|
|
13
13
|
|
|
14
|
+
export {
|
|
15
|
+
type CommandRequest,
|
|
16
|
+
type CommandResult,
|
|
17
|
+
COMMAND_ROUTE,
|
|
18
|
+
COMMAND_EVENT,
|
|
19
|
+
} from './command.js';
|
|
20
|
+
|
|
14
21
|
export {
|
|
15
22
|
type ArchitectState,
|
|
16
23
|
type Builder,
|
|
@@ -29,6 +36,9 @@ export {
|
|
|
29
36
|
type IssueSearchResponse,
|
|
30
37
|
type WorktreeDevUrl,
|
|
31
38
|
type ResolvedWorktreeConfig,
|
|
39
|
+
type ActivityEvent,
|
|
40
|
+
type ActivityHook,
|
|
41
|
+
type ResolvedActivityHooks,
|
|
32
42
|
type TeamMemberGitHubData,
|
|
33
43
|
type ReviewBlockingEntry,
|
|
34
44
|
type TeamApiMember,
|