@lensmcp/protocol-types 1.26.35 → 1.26.37

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/index.d.ts CHANGED
@@ -72,8 +72,11 @@ export * from './lib/changes.js';
72
72
  export * from './lib/pull-requests.js';
73
73
  export * from './lib/goal-number.js';
74
74
  export * from './lib/delivery-status.js';
75
+ export * from './lib/goal-process.js';
76
+ export * from './lib/delivery-actions.js';
75
77
  export * from './lib/main-mirror.js';
76
78
  export * from './lib/team-design.js';
79
+ export * from './lib/team-decide.js';
77
80
  export * from './lib/team-library.js';
78
81
  export * from './lib/team-skills.js';
79
82
  export * from './lib/system-report.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/lens-hosts.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/account-drain.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/pull-requests.js";export*from"./lib/goal-number.js";export*from"./lib/delivery-status.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";export*from"./lib/canvas.js";export*from"./lib/canvas-catalog.js";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-chat.js";export*from"./lib/canvas-hub.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/dashboard-path.js";export*from"./lib/lens-hosts.js";export*from"./lib/dashboard-lint.js";export*from"./lib/dashboard-typecheck.js";export*from"./lib/lint-coverage.js";export*from"./lib/lint-ignores.js";export*from"./lib/static-checks.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/expected-failure.js";export*from"./lib/error-verdict.js";export*from"./lib/finding-proof.js";export*from"./lib/error-cause.js";export*from"./lib/metrics-reset.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-cache-facts.js";export*from"./lib/ai-cache.js";export*from"./lib/ai-cache-verdict.js";export*from"./lib/ai-together.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/ai-compare.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/docker-jobs.js";export*from"./lib/docker-report.js";export*from"./lib/docker-runs.js";export*from"./lib/docker-errors.js";export*from"./lib/peers.js";export*from"./lib/hosts.js";export*from"./lib/cluster-hosts.js";export*from"./lib/dashboard-updates.js";export*from"./lib/accounts.js";export*from"./lib/account-drain.js";export*from"./lib/host-agents.js";export*from"./lib/remote-instances.js";export*from"./lib/team.js";export*from"./lib/sessions.js";export*from"./lib/conversations.js";export*from"./lib/backlog.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/role-fidelity.js";export*from"./lib/goal-retro.js";export*from"./lib/follow-ups.js";export*from"./lib/changes.js";export*from"./lib/pull-requests.js";export*from"./lib/goal-number.js";export*from"./lib/delivery-status.js";export*from"./lib/goal-process.js";export*from"./lib/delivery-actions.js";export*from"./lib/main-mirror.js";export*from"./lib/team-design.js";export*from"./lib/team-decide.js";export*from"./lib/team-library.js";export*from"./lib/team-skills.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";export*from"./lib/goal-design.js";export*from"./lib/overseer-messages.js";export*from"./lib/team-roadmap.js";export*from"./lib/team-prompts.js";export{PROOF_ACTIONS,NOT_RUN_KINDS}from"./lib/team-delivery.js";export*from"./lib/canvas.js";export*from"./lib/canvas-catalog.js";export*from"./lib/canvas-frame-policy.js";export*from"./lib/canvas-attachments.js";export*from"./lib/canvas-editing.js";export*from"./lib/canvas-chat.js";export*from"./lib/canvas-hub.js";
@@ -2993,6 +2993,8 @@ export interface DashAiRun {
2993
2993
  design?: TeamDesign;
2994
2994
  /** The design was accepted on the Team page: when, the files it wrote, the goals it created. */
2995
2995
  accepted?: DashTeamDesignRun['accepted'];
2996
+ /** A team design run's parts the person decided, one by one or with «Accept all» (issues/closed/hub-09). */
2997
+ parts?: DashTeamDesignRun['parts'];
2996
2998
  /** The goal a combine run filed (`suggestions.combine`): its design waits for the person. */
2997
2999
  goal?: {
2998
3000
  id: string;
@@ -0,0 +1,234 @@
1
+ import type { DashDeliveryCommit } from './delivery-status.js';
2
+ /**
3
+ * Delivery ships work from the page (issues/closed/foodguard-334). The owner, 2026-11-25: «… to have options to merge and
4
+ * land and doing the correct things», then «it may be a specific agent that know what to do next that will use the
5
+ * claude api to do things and display status».
6
+ *
7
+ * Two halves, both the person's:
8
+ *
9
+ * actions a button on the row it belongs to — Land on main, Open / update its pull request, Merge the pull request,
10
+ * Push main, Pull main, Clean up, Park its app. Each is looked at first (`GET …/action/plan`: its
11
+ * preconditions, met or not, and exactly what it runs), confirmed in one dialog, and run on the server
12
+ * through the dashboard's mutation guard (`POST …/action`), one at a time per goal and per repository
13
+ * steward the Delivery steward: code lists the steps that may run now (the menu), Claude orders them and says why,
14
+ * and the steward runs what it may — a fetch, a park, a pull request kept in step, a cleanup — while what
15
+ * changes main or origin waits for the person's «Do it» (unless they let it), and what needs code goes to
16
+ * the goal's manager as a message
17
+ */
18
+ /** What an action does. `fetch` only moves origin's main; the others are below. */
19
+ export type DashDeliveryActionKind = 'land' | 'pr' | 'merge-pr' | 'push' | 'pull' | 'cleanup' | 'park' | 'fetch';
20
+ export declare const DELIVERY_ACTION_KINDS: readonly DashDeliveryActionKind[];
21
+ /** What an action is about: a goal (land, pr, cleanup, park), a pull request (merge-pr) or the repository (push, pull, fetch). */
22
+ export interface DashDeliveryActionTarget {
23
+ goalId?: string;
24
+ /** A pull request's number. */
25
+ number?: number;
26
+ }
27
+ /** One precondition, as the dialog lists it: met or not, and why not. */
28
+ export interface DashDeliveryActionCheck {
29
+ text: string;
30
+ ok: boolean;
31
+ /** Why it is not met, whole. */
32
+ why?: string;
33
+ }
34
+ /** A ref the action moves: from one commit to another (a new one: no `from`). */
35
+ export interface DashDeliveryActionRef {
36
+ ref: string;
37
+ from?: string;
38
+ to?: string;
39
+ /** In words: «local main moves to the squash commit». */
40
+ text: string;
41
+ }
42
+ /** The goal's last QA run and its other checks — what «Land on main» shows before it runs (it never runs them). */
43
+ export interface DashDeliveryVerdict {
44
+ qa: {
45
+ state: 'passed' | 'failed' | 'cancelled' | 'running' | 'none';
46
+ text: string;
47
+ at?: number;
48
+ };
49
+ /** Its packages integrated and nothing under it open — the rest of what the manager's own merge asks. */
50
+ checks: {
51
+ ok: boolean;
52
+ text: string;
53
+ };
54
+ /** QA did not pass: the person may land it anyway, ticking it — recorded on the goal and in its commit. */
55
+ anyway: boolean;
56
+ }
57
+ /** `GET /api/team/delivery/action/plan?kind=&goal=&number=`: what the action would do, and whether it may now. */
58
+ export interface DashDeliveryActionPlan {
59
+ kind: DashDeliveryActionKind;
60
+ target: DashDeliveryActionTarget;
61
+ /** «Land G-181 on main», «Push main», «Merge #140». */
62
+ title: string;
63
+ /** Every precondition met (with `anyway` ticked, for a land whose QA did not pass). */
64
+ ok: boolean;
65
+ checks: DashDeliveryActionCheck[];
66
+ /** The first precondition not met, whole — why the action is refused. */
67
+ refused?: string;
68
+ /** What runs, in order: each command exactly. */
69
+ commands: string[];
70
+ refs: DashDeliveryActionRef[];
71
+ /** The files it changes (a land's, a pull's), capped — `count` all of them. */
72
+ files: {
73
+ count: number;
74
+ paths: string[];
75
+ };
76
+ /** The commits it sends or brings (a push's, a pull's, a land's), newest first, capped. */
77
+ commits?: DashDeliveryCommit[];
78
+ verdict?: DashDeliveryVerdict;
79
+ /** The commit message a land writes — the manager's merge's own (`Goal:` and `Branch:` lines, the commits, the notes). */
80
+ message?: string;
81
+ /** What it never does, in one line: «never forced; nothing pushed». */
82
+ never: string;
83
+ /** What the run must be given back: the facts it was planned on, which it checks again before anything runs. */
84
+ token?: string;
85
+ /** What it is single-flight on: `repo` (main and origin), `goal:<id>`, `pr:<n>`. */
86
+ locks: string[];
87
+ /** An action of the same lock runs now. */
88
+ busy?: {
89
+ id: string;
90
+ title: string;
91
+ };
92
+ }
93
+ /** `POST /api/team/delivery/action`: the person's confirmation. */
94
+ export interface DashDeliveryActionRequest {
95
+ kind: DashDeliveryActionKind;
96
+ goalId?: string;
97
+ number?: number;
98
+ /** The plan's token: refused when the facts moved since. */
99
+ token: string;
100
+ /** A land whose QA did not pass, landed past it — and why (recorded on the goal and in its commit). */
101
+ anyway?: {
102
+ why: string;
103
+ };
104
+ /** A step of the steward's plan this act carries out. */
105
+ stepId?: string;
106
+ }
107
+ /** One action run: its progress while it runs, then what it did. `GET /api/team/delivery/action?id=`. */
108
+ export interface DashDeliveryActionRun {
109
+ id: string;
110
+ kind: DashDeliveryActionKind;
111
+ target: DashDeliveryActionTarget;
112
+ title: string;
113
+ state: 'running' | 'done' | 'failed';
114
+ /** Where it is now: «Squashing lensmcp/g-… onto main», «Pushing main to origin». */
115
+ stage: string;
116
+ startedAt: number;
117
+ endedAt?: number;
118
+ /** The person's click, or the steward's own act (with the person's standing permission). */
119
+ by: 'person' | 'steward';
120
+ /** What happened, line by line. */
121
+ did: string[];
122
+ error?: string;
123
+ /** What it made: a commit, a pull request, a worktree action's run. */
124
+ result?: {
125
+ sha?: string;
126
+ number?: number;
127
+ url?: string;
128
+ worktreeRun?: string;
129
+ };
130
+ }
131
+ /** `off`; `idle` (nothing to do, or a plan with nothing left); `planning` (Claude reads the menu); `waiting` (a step waits for you); `working`; `failed` (its last plan or step failed). */
132
+ export type DashStewardState = 'off' | 'idle' | 'planning' | 'waiting' | 'working' | 'failed';
133
+ /** A step of the steward's menu: an action, or a message to a goal's manager about work that needs code. */
134
+ export type DashStewardStepKind = DashDeliveryActionKind | 'tell-manager';
135
+ /**
136
+ * Who carries a step out: `auto` — the steward, by itself, when the person lets it tidy (a fetch, a park, a pull request
137
+ * kept in step, a cleanup of work on origin); `click` — the person's «Do it» (land, push, pull, merge — or the steward
138
+ * itself when they let it land, push and merge); `team` — the goal's manager, told by a message.
139
+ */
140
+ export type DashStewardHands = 'auto' | 'click' | 'team';
141
+ export interface DashStewardStep {
142
+ /** Stable while its facts hold: `land:<goal>`, `push`, `merge-pr:140`, `tell:<goal>:conflict`. */
143
+ id: string;
144
+ kind: DashStewardStepKind;
145
+ /** «Land G-181 on main», «Push main (2 commits)», «Tell G-182's manager: main moved past its branch». */
146
+ label: string;
147
+ target: DashDeliveryActionTarget;
148
+ /** The facts behind it, as code read them. */
149
+ facts: string[];
150
+ hands: DashStewardHands;
151
+ /** Why now, in one line — Claude's, or the code's own. */
152
+ why?: string;
153
+ state: 'proposed' | 'running' | 'done' | 'failed' | 'skipped';
154
+ /** Its run, once started (an action's), or what was sent (a message). */
155
+ run?: {
156
+ id?: string;
157
+ at: number;
158
+ text: string;
159
+ ok: boolean;
160
+ };
161
+ }
162
+ export interface DashStewardPlan {
163
+ at: number;
164
+ /** `model`: Claude ordered the menu; `code`: the code's own order (no key, the allowance spent, or an answer it could not use — `fallback` says which). */
165
+ by: 'model' | 'code';
166
+ trigger: 'click' | 'auto';
167
+ steps: DashStewardStep[];
168
+ fallback?: string;
169
+ model?: string;
170
+ costUsd?: number;
171
+ /** The AI call's ledger id (AI calls page). */
172
+ ledgerId?: string;
173
+ /** The menu it was planned from, one line: «4 steps: land, push, cleanup, tell-manager». */
174
+ menu: string;
175
+ }
176
+ /** The steward's switches — the person's alone, kept in the team's store (never a file an agent could edit). */
177
+ export interface DashStewardSettings {
178
+ /** The background look in the dashboard's minute: plans when the delivery facts change. Off by default. */
179
+ look: 'on' | 'off';
180
+ /** Steps that only read or tidy run by themselves: a fetch, a park, a pull request kept in step, a cleanup of work on origin. Off by default. */
181
+ tidy: 'on' | 'off';
182
+ /** «The steward may land, push and merge»: steps that change main or origin run without a click. Off by default. */
183
+ landPushMerge: 'on' | 'off';
184
+ updatedAt?: number;
185
+ }
186
+ export declare const STEWARD_DEFAULTS: DashStewardSettings;
187
+ export interface DashStewardLogEntry {
188
+ at: number;
189
+ kind: 'plan' | 'act' | 'tell' | 'fail' | 'settings';
190
+ text: string;
191
+ by: 'person' | 'steward';
192
+ goalId?: string;
193
+ costUsd?: number;
194
+ }
195
+ /** `GET /api/team/delivery/steward`: the panel at the top of Delivery › Status. */
196
+ export interface DashStewardView {
197
+ at: number;
198
+ state: DashStewardState;
199
+ /** One line: «Off — Plan next steps asks Claude once», «2 steps wait for you», «Planning…». */
200
+ stateText: string;
201
+ settings: DashStewardSettings;
202
+ plan?: DashStewardPlan;
203
+ /** What it did last. */
204
+ last?: DashStewardLogEntry;
205
+ /** Its newest log lines, newest first. */
206
+ log: DashStewardLogEntry[];
207
+ /** What its plans cost today (UTC), and each trigger's allowance as spent today by everything on it. */
208
+ cost: {
209
+ day: string;
210
+ usd: number;
211
+ plans: number;
212
+ click: {
213
+ spentUsd: number;
214
+ capUsd: number;
215
+ };
216
+ auto: {
217
+ spentUsd: number;
218
+ capUsd: number;
219
+ };
220
+ };
221
+ /** A working Anthropic key: without one, a plan is the code's order. */
222
+ hasKey: boolean;
223
+ /** «Plan next steps» may run now — and why not. */
224
+ canPlan: boolean;
225
+ whyNot?: string;
226
+ /** This dashboard runs the background look (the main checkout's). */
227
+ looks: boolean;
228
+ nextLookAt?: number;
229
+ }
230
+ /** `POST /api/team/delivery/steward/settings`: one switch, the person's. */
231
+ export interface DashStewardSettingRequest {
232
+ key: keyof Omit<DashStewardSettings, 'updatedAt'>;
233
+ value: 'on' | 'off';
234
+ }
@@ -0,0 +1 @@
1
+ "use strict";export const DELIVERY_ACTION_KINDS=["land","pr","merge-pr","push","pull","cleanup","park","fetch"],STEWARD_DEFAULTS={look:"off",tidy:"off",landPushMerge:"off"};
@@ -1,3 +1,4 @@
1
+ import type { DashDeliveryActionKind } from './delivery-actions.js';
1
2
  import type { DashPrProblemKind } from './pull-requests.js';
2
3
  /**
3
4
  * Delivery › Status (issues/closed/foodguard-312): the repository's whole delivery at a glance. The owner, 2026-11-25:
@@ -9,18 +10,22 @@ import type { DashPrProblemKind } from './pull-requests.js';
9
10
  */
10
11
  /** One line of «What needs you»: how many, what, and what to do. */
11
12
  export interface DashDeliveryNeed {
12
- key: 'main-behind' | 'main-diverged' | 'main-ahead' | 'main-ci' | 'prs-blocked' | 'prs-ready' | 'retarget' | 'goals-asking' | 'goals-ready' | 'goals-landed' | 'uncommitted' | 'goals-working' | 'goal-prs-closed' | 'goal-prs-failed';
13
+ key: 'main-behind' | 'main-diverged' | 'main-ahead' | 'main-ci' | 'prs-blocked' | 'prs-ready' | 'retarget' | 'goals-asking' | 'goals-ready' | 'goals-landed' | 'uncommitted' | 'goals-working' | 'goal-prs-closed' | 'goal-prs-failed' | 'goals-left';
13
14
  tone: 'bad' | 'warn' | 'info';
14
15
  count: number;
15
16
  text: string;
16
17
  /** A few names behind the count: the pull requests, the goals. */
17
18
  detail?: string;
18
- /** What to do: a command to run in the main checkout, or a page to open. */
19
+ /**
20
+ * What to do: a command to run in the main checkout, or a page to open — and `act`, the page's own action that does it
21
+ * (issues/closed/foodguard-334: «Push main», «Pull main»), looked at and confirmed in its dialog.
22
+ */
19
23
  action: {
20
24
  label: string;
21
25
  command?: string;
22
- page?: 'prs' | 'main' | 'changes' | 'inbox' | 'team' | 'pipeline';
26
+ page?: 'prs' | 'main' | 'changes' | 'inbox' | 'team' | 'pipeline' | 'finished';
23
27
  goalId?: string;
28
+ act?: DashDeliveryActionKind;
24
29
  };
25
30
  }
26
31
  export type DashDeliveryLaneId = 'progress' | 'ready' | 'local' | 'pr' | 'merged';
@@ -108,10 +113,19 @@ export interface DashDeliveryMain {
108
113
  push?: string;
109
114
  /** The newest CI runs of origin's main (one per workflow). */
110
115
  ci: DashDeliveryCiRun[];
111
- /** Uncommitted files in the main checkout — absent: not read. */
116
+ /**
117
+ * Uncommitted files in the main checkout — absent: not read. `files`/`paths`: those that need the person;
118
+ * `ignorable`: scratch, caches and build output (`tmp/`, `__pycache__/`, `dist/` …) counted apart — they never make
119
+ * «Something needs you» — with the `.gitignore` lines that would hide them (issues/closed/foodguard-334).
120
+ */
112
121
  uncommitted?: {
113
122
  files: number;
114
123
  paths: string[];
124
+ ignorable?: {
125
+ files: number;
126
+ paths: string[];
127
+ gitignore: string[];
128
+ };
115
129
  };
116
130
  fetch: DashDeliveryFetch;
117
131
  }
@@ -121,6 +135,12 @@ export interface DashDeliveryBranch {
121
135
  /** The census's class: `unique` — its work is on no main yet — or not classified yet. */
122
136
  class?: string;
123
137
  why?: string;
138
+ /**
139
+ * Its goal landed on main, and this tip is not proven to be what landed — say how it landed instead of its commits
140
+ * «main lacks» (issues/closed/foodguard-315): `landed as squash 82bef45b07 (by hand)`. A goal branch whose landed tip
141
+ * IS proven (its integration's tip, its tree on main, main holding it) is not listed at all.
142
+ */
143
+ goalLanded?: string;
124
144
  /** Commits it has that main lacks, and main has that it lacks. */
125
145
  ahead?: number;
126
146
  behind?: number;
@@ -177,6 +197,11 @@ export interface DashDeliveryStatus {
177
197
  text: string;
178
198
  };
179
199
  };
200
+ /**
201
+ * The goals that finished (completed or cancelled) in the last `days` days, each with where its work went and what is
202
+ * left of it (issues/closed/foodguard-315) — the ones that need the person first, then the newest.
203
+ */
204
+ finished: DashDeliveryFinished;
180
205
  /** `flow.json` `delivery.pullRequests`: whether the team writes on GitHub (the person's `lensmcp agent pr` always may). */
181
206
  settings: {
182
207
  pullRequests: 'on' | 'off';
@@ -185,6 +210,171 @@ export interface DashDeliveryStatus {
185
210
  /** What could not be read, in words. */
186
211
  problems: string[];
187
212
  }
213
+ /** Delivery › Status «Finished goals». */
214
+ export interface DashDeliveryFinished {
215
+ /** The window: goals finished in the last this many days (`?days=`, 14 unless asked). */
216
+ days: number;
217
+ goals: DashGoalLanding[];
218
+ /** Finished in the window beyond those listed. */
219
+ more: number;
220
+ /** Of those listed: how many need the person (not landed, not pushed, not pulled), and how many left something behind. */
221
+ needs: number;
222
+ left: number;
223
+ }
224
+ /**
225
+ * Where a goal's work went — or goes — and what is left of it (issues/closed/foodguard-315). The owner, 2026-11-25: «i
226
+ * need to understand if goal finished, what is her worktree, pr, if it's merged or not, cleaned up or still, what is the
227
+ * status». Delivery › Status lists the finished ones; the goal's drawer shows its own, a running goal's too.
228
+ */
229
+ export interface DashGoalLanding {
230
+ goalId: string;
231
+ /** Its number, shown G-44 (issues/closed/foodguard-314). */
232
+ number?: number;
233
+ title: string;
234
+ /** `completed`, `cancelled` — or, in the drawer, a running goal's state. */
235
+ state: string;
236
+ finishedAt?: number;
237
+ /**
238
+ * The one phrase: «Done and cleaned up», «Done — left: app running, worktree kept», «Done — not pushed», «Not
239
+ * landed», «Cancelled — cleaned up», «Running — not landed yet». `rank`: 0 most urgent.
240
+ */
241
+ status: {
242
+ text: string;
243
+ tone: 'ok' | 'warn' | 'bad' | 'muted';
244
+ rank: number;
245
+ };
246
+ landed: DashLandingLanded;
247
+ pr: DashLandingPr;
248
+ branch: DashLandingBranch;
249
+ worktree: DashLandingWorktree;
250
+ app: DashLandingApp;
251
+ /** What is the person's to do, each with the exact command to copy — run in the main checkout. */
252
+ steps: DashLandingStep[];
253
+ /** What the goal-end sweep did with what it left behind (issues/closed/foodguard-321) — none: not swept here. */
254
+ cleanup?: DashGoalCleanup;
255
+ }
256
+ /**
257
+ * A finished goal's cleanup as the goal-end sweep recorded it (storage goal-cleanup.ts), for Delivery's rows and drawer
258
+ * (issues/closed/foodguard-334): `kept` says why, `pending` when it looks next, `done` what it removed and parked.
259
+ */
260
+ export interface DashGoalCleanup {
261
+ state: 'pending' | 'kept' | 'done';
262
+ at: number;
263
+ why: string;
264
+ next?: number;
265
+ removed?: {
266
+ name: string;
267
+ root: string;
268
+ branch?: string;
269
+ archive?: string;
270
+ salvage?: string;
271
+ at: number;
272
+ };
273
+ parked?: {
274
+ name: string;
275
+ at: number;
276
+ };
277
+ running?: {
278
+ runId: string;
279
+ action: 'remove' | 'park';
280
+ at: number;
281
+ };
282
+ error?: string;
283
+ }
284
+ export interface DashLandingLanded {
285
+ /**
286
+ * `lensmcp`: LensMCP's merge (agent_task_update merge); `by-hand`: someone else's commit on main; `pull-request`: its
287
+ * pull request merged on GitHub; `none`: nothing of it is on main; `pending`: it is still worked.
288
+ */
289
+ how: 'lensmcp' | 'by-hand' | 'pull-request' | 'none' | 'pending';
290
+ /** What main got: one squash commit, a merge commit, a fast-forward to the branch — undefined: not known. */
291
+ kind?: 'squash' | 'merge' | 'ff';
292
+ /** The commit main got (whole when known; a census reading gives its first nine). */
293
+ sha?: string;
294
+ pr?: number;
295
+ /** On local main, and on origin's (pushed) — undefined: not known, or main tracks no remote. */
296
+ onLocal?: boolean;
297
+ onOrigin?: boolean;
298
+ /**
299
+ * How LensMCP knows: its merge record (`integration`), a commit on main whose message names the goal (`goal-line`,
300
+ * `Goal: <id>`), main's commit with the branch tip's tree (`tree`), the overseer's census (`census`), main holding the
301
+ * tip (`ancestor`), the goal completed in the main checkout (`completed-on-main`), a merged pull request (`pr`).
302
+ */
303
+ by?: 'integration' | 'goal-line' | 'tree' | 'census' | 'ancestor' | 'completed-on-main' | 'pr';
304
+ /** «LensMCP squash 68fa5276ed», «by hand as squash 82bef45b07», «not landed». */
305
+ text: string;
306
+ /** «the branch's 21 commits are on main as that one commit», «its work is only on branch lensmcp/g-…». */
307
+ detail?: string;
308
+ }
309
+ export interface DashLandingPr {
310
+ number?: number;
311
+ state?: 'open' | 'draft' | 'merged' | 'closed';
312
+ url?: string;
313
+ /** «#140 merged», «no pull request (pull requests are off)». */
314
+ text: string;
315
+ }
316
+ export interface DashLandingBranch {
317
+ name?: string;
318
+ /** `local`: on this machine only; `pushed`: on origin too; `deleted`; `none`: the goal had no branch of its own. */
319
+ state: 'local' | 'pushed' | 'deleted' | 'none';
320
+ tip?: string;
321
+ /** Commits of it main lacks — for one that landed as a squash, the commits the squash rewrote, never «work main lacks». */
322
+ offMain?: number;
323
+ /** Made by the lens with its worktree (`instance rm --delete-branch` deletes only such a branch). */
324
+ lensMade?: boolean;
325
+ text: string;
326
+ }
327
+ export interface DashLandingWorktree {
328
+ name?: string;
329
+ path?: string;
330
+ /** `removed`; `kept` (its folder is there); `gone` (git lists it, its folder is gone); `none` (the goal had none). */
331
+ state: 'removed' | 'kept' | 'gone' | 'none';
332
+ /** Why LensMCP kept it when the goal completed — its log, in a few words. */
333
+ why?: string;
334
+ /** Its uncommitted files when the census last read it (`readAt`) — undefined: not read. */
335
+ changes?: number;
336
+ readAt?: number;
337
+ text: string;
338
+ }
339
+ export interface DashLandingApp {
340
+ /** The instance's name (`lensmcp instance …<name>`) and key. */
341
+ name?: string;
342
+ key?: string;
343
+ /**
344
+ * `running` (the gateway serves it), `starting` (its create or start is under way), `parked` (on demand, nothing
345
+ * runs), `stopped`, `failed` (its create or start failed), `checkout-only` (no app of its own), `none` (no instance).
346
+ */
347
+ state: 'running' | 'starting' | 'parked' | 'stopped' | 'failed' | 'checkout-only' | 'none';
348
+ services?: number;
349
+ /** The last `instance run` asked for it; its last use (a request to its hosts); when it parks unless used again. */
350
+ runAt?: number;
351
+ lastUseAt?: number;
352
+ parkAt?: number;
353
+ /** Why it failed, or how far its start got. */
354
+ detail?: string;
355
+ text: string;
356
+ }
357
+ export interface DashLandingStep {
358
+ /** «Park its app», «Remove its worktree and branch», «Push main». */
359
+ label: string;
360
+ /** The command to copy, run in the main checkout — empty when only the page's action does it (Land on main). */
361
+ command: string;
362
+ /** What the command does, for its tip. */
363
+ why?: string;
364
+ /** The page's own action that does it (issues/closed/foodguard-334) — a button beside the command, its dialog first. */
365
+ action?: {
366
+ kind: DashDeliveryActionKind;
367
+ goalId?: string;
368
+ number?: number;
369
+ };
370
+ }
371
+ /** `GET /api/team/delivery/landing?goal=<id>`: one goal's landing, for its drawer. */
372
+ export interface DashGoalLandingAnswer {
373
+ at: number;
374
+ landing?: DashGoalLanding;
375
+ /** Why there is none: the goal is not this repository's, or the store could not be read. */
376
+ problem?: string;
377
+ }
188
378
  /** `POST /api/team/delivery/fetch`: the person's «Fetch now», or `auto` — the page's own, every five minutes. */
189
379
  export interface DashDeliveryFetchRequest {
190
380
  auto?: boolean;