create-interview-cockpit 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,6 +81,225 @@ export interface GithubActionsLabWorkspace {
81
81
  includeRunHistoryInContext?: boolean;
82
82
  /** Local act inputs mirroring GitHub repository variables, secrets, and runner env. */
83
83
  environment?: GithubActionsLabEnvironment;
84
+ /**
85
+ * Fake "org" roster used to resolve CODEOWNERS handles (e.g. @octocat or
86
+ * @my-org/frontend) into concrete people during the Pull Request sim.
87
+ * Mirrors how a real GitHub org's people/teams page would back the
88
+ * automatic reviewer-request flow.
89
+ */
90
+ ghOrg?: GithubLabOrg;
91
+ /**
92
+ * Repo-level branch protection rule for the simulated default branch.
93
+ * Mirrors GitHub's "Require a pull request before merging" settings page.
94
+ *
95
+ * @deprecated Superseded by `rulesets`. Kept on the type for backwards
96
+ * compatibility with saved labs from before rulesets were introduced;
97
+ * the loader migrates this into a synthetic ruleset on read.
98
+ */
99
+ branchProtection?: GithubLabBranchProtection;
100
+ /**
101
+ * Repository rulesets — the modern (2023+) replacement for classic
102
+ * branch protection. Each ruleset targets one or more branches and
103
+ * applies a set of rules (require_pull_request, required_status_checks,
104
+ * etc.). Rulesets are evaluated in addition to one another, so when
105
+ * multiple match a branch their constraints union.
106
+ */
107
+ rulesets?: GithubLabRuleset[];
108
+ /**
109
+ * Persisted draft pull-request state so users can iterate on the simulation
110
+ * across sessions (which files were "changed", who approved, etc.).
111
+ */
112
+ pullRequest?: GithubLabPullRequest;
113
+ /**
114
+ * List of branch names that exist in the simulated repo. Used by the
115
+ * Settings → Branches page so users can model multi-branch workflows
116
+ * (e.g. a `main` + `develop` setup and target rulesets at each).
117
+ * Defaults to `["main"]` if omitted.
118
+ */
119
+ branches?: string[];
120
+ /**
121
+ * Name of the default branch (the merge target shown on the PR page).
122
+ * Defaults to `"main"`. Mirrors the Settings → Branches → "Default branch"
123
+ * dropdown on github.com.
124
+ */
125
+ defaultBranch?: string;
126
+ }
127
+
128
+ // ─── GitHub Lab: people, teams, CODEOWNERS, PR simulation ───────────────
129
+
130
+ export interface GithubLabTeam {
131
+ /** Team slug without the `org/` prefix (e.g. `frontend`, `platform-sre`). */
132
+ slug: string;
133
+ /** Optional display name shown in the reviewer chips. */
134
+ name?: string;
135
+ /** GitHub logins (without @) that are members of this team. */
136
+ members: string[];
137
+ }
138
+
139
+ export interface GithubLabOrg {
140
+ /** Org slug used when matching `@org/team` handles in CODEOWNERS. */
141
+ slug: string;
142
+ /** All known individual logins (without @) in the lab. */
143
+ users: string[];
144
+ /** Known teams under the org. */
145
+ teams: GithubLabTeam[];
146
+ /** The login the lab user is acting as when opening the PR. */
147
+ viewerLogin: string;
148
+ }
149
+
150
+ export interface GithubLabBranchProtection {
151
+ /** Mirrors GitHub's "Require review from Code Owners" checkbox. */
152
+ requireCodeOwnerReview: boolean;
153
+ /** Total number of approving reviews required before merge is allowed. */
154
+ requiredApprovingReviews: number;
155
+ /**
156
+ * Status check (workflow job) names that must succeed on the latest act
157
+ * run before merging. An empty array disables the rule. Matches GitHub's
158
+ * "Require status checks to pass before merging" branch-protection box.
159
+ */
160
+ requiredStatusChecks?: string[];
161
+ }
162
+
163
+ // ─── Rulesets (modern branch protection model) ────────────────────
164
+ //
165
+ // Mirrors github.com Settings → Rules → Rulesets. Each ruleset has an
166
+ // enforcement state (active, evaluate-only, or disabled), one or more
167
+ // target branch patterns, an optional bypass list, and a flag bag of
168
+ // rules. We model only the rules a lab can actually exhibit; some
169
+ // (signed commits, code scanning) are surfaced as informational so the
170
+ // UI faithfully reflects github.com without misleading the user about
171
+ // what the simulator enforces.
172
+
173
+ export type GithubLabRulesetEnforcement = "active" | "evaluate" | "disabled";
174
+
175
+ export interface GithubLabRulesetPullRequestRule {
176
+ /** Number of approving reviews needed before the PR can merge. */
177
+ requiredApprovingReviewCount: number;
178
+ /** Mirrors "Require review from Code Owners". */
179
+ requireCodeOwnerReview: boolean;
180
+ /** Dismiss stale approving reviews when new commits land (informational). */
181
+ dismissStaleReviewsOnPush: boolean;
182
+ /** Require approval of the most recent reviewable push (informational). */
183
+ requireLastPushApproval: boolean;
184
+ }
185
+
186
+ export interface GithubLabRulesetStatusChecksRule {
187
+ /** Names of workflow jobs that must succeed before merging. */
188
+ checks: string[];
189
+ /** Whether branches must be up-to-date before merging (informational). */
190
+ strict: boolean;
191
+ }
192
+
193
+ /**
194
+ * Bag of rule toggles. Each field is independent; absent fields mean
195
+ * "rule not configured". When a ruleset is active and targets a branch,
196
+ * `evaluateMergeability` consults these to build the list of merge
197
+ * blockers.
198
+ */
199
+ export interface GithubLabRulesetRules {
200
+ /** Block creating refs that match the target. (Informational.) */
201
+ restrictCreations?: boolean;
202
+ /** Block direct pushes — force changes through pull requests. */
203
+ restrictUpdates?: boolean;
204
+ /** Block ref deletions. (Informational.) */
205
+ restrictDeletions?: boolean;
206
+ /** Disallow merge commits on the target branch. (Informational.) */
207
+ requireLinearHistory?: boolean;
208
+ /** Require successful deploys to listed environments before merging. */
209
+ requireDeployments?: { environments: string[] };
210
+ /** Require GPG/SSH-signed commits. (Informational.) */
211
+ requireSignedCommits?: boolean;
212
+ /** Require a pull request before merging into the target. */
213
+ pullRequest?: GithubLabRulesetPullRequestRule;
214
+ /** Require listed status checks to pass before merging. */
215
+ statusChecks?: GithubLabRulesetStatusChecksRule;
216
+ /** Block force pushes. (Informational.) */
217
+ blockForcePushes?: boolean;
218
+ /** Require code-scanning results before merging. (Informational.) */
219
+ requireCodeScanning?: { tools: string[] };
220
+ /** Require code-quality gates to pass. (Informational.) */
221
+ requireCodeQuality?: boolean;
222
+ }
223
+
224
+ export interface GithubLabRuleset {
225
+ /** Stable id used as the React key and for routing inside Settings. */
226
+ id: string;
227
+ /** Human name shown on the rulesets list ("Main branch protection"). */
228
+ name: string;
229
+ /**
230
+ * - `active` — enforced; merges and pushes that violate are blocked.
231
+ * - `evaluate` — logged but not enforced; surfaces in the UI as a
232
+ * warning so users can preview the impact.
233
+ * - `disabled` — ignored entirely.
234
+ */
235
+ enforcement: GithubLabRulesetEnforcement;
236
+ /**
237
+ * Branch patterns this ruleset targets. Supports literal names
238
+ * (`main`), the special token `~DEFAULT_BRANCH`, the wildcard
239
+ * `~ALL`, or globs (`release/**`).
240
+ */
241
+ targetInclude: string[];
242
+ /** Patterns to subtract from the include set (e.g. `experiments/**`). */
243
+ targetExclude: string[];
244
+ /**
245
+ * Logins (`octocat`) or team handles (`acme/admins`) allowed to
246
+ * bypass the ruleset. When the viewer is in this list, the ruleset
247
+ * doesn't block their merges.
248
+ */
249
+ bypass: string[];
250
+ /** The actual rule flags. */
251
+ rules: GithubLabRulesetRules;
252
+ }
253
+
254
+ /**
255
+ * One row in the PR's Review tab — mirrors what GitHub stores when a
256
+ * reviewer clicks Approve / Request changes / Comment with a body.
257
+ */
258
+ export interface GithubLabReview {
259
+ id: string;
260
+ /** Login (without @) of the person leaving the review. */
261
+ author: string;
262
+ state: "approved" | "changes_requested" | "commented";
263
+ /** Optional free-text review body. */
264
+ body?: string;
265
+ /** ISO timestamp; used to determine the latest review per author. */
266
+ createdAt: string;
267
+ }
268
+
269
+ /**
270
+ * Snapshot of one workflow job from the most recent act run, distilled
271
+ * down to what the "Checks" section on the PR cares about (name + status).
272
+ */
273
+ export interface GithubLabCheckRunJob {
274
+ name: string;
275
+ /** Mirrors act's terminal statuses; "queued" / "running" come from a live run. */
276
+ status: "queued" | "running" | "success" | "failed" | "cancelled" | "skipped";
277
+ durationMs?: number;
278
+ }
279
+
280
+ export interface GithubLabCheckRun {
281
+ /** Workflow file the run came from. */
282
+ workflow?: string;
283
+ /** ISO timestamp captured when the run finished. */
284
+ completedAt: string;
285
+ /** Per-job results recorded from the act stream. */
286
+ jobs: GithubLabCheckRunJob[];
287
+ }
288
+
289
+ export interface GithubLabPullRequest {
290
+ /** Repo paths (matching keys in workspace.files) the PR is "changing". */
291
+ changedFiles: string[];
292
+ /**
293
+ * @deprecated — kept only for back-compat with older saved labs.
294
+ * Approvals are now derived from `reviews` (latest review per author).
295
+ */
296
+ approvals?: string[];
297
+ /** Ordered review log (latest review per author wins for state). */
298
+ reviews?: GithubLabReview[];
299
+ /** Most recent CI snapshot used to compute required-check status. */
300
+ lastCheckRun?: GithubLabCheckRun;
301
+ /** Optional PR title for display purposes. */
302
+ title?: string;
84
303
  }
85
304
 
86
305
  export interface WorkspaceMeta {
@@ -1 +1 @@
1
- {"root":["./src/app.tsx","./src/api.ts","./src/browsersecuritytemplates.ts","./src/enterpriselocallab.ts","./src/ghaconcurrency.ts","./src/githubactionslab.ts","./src/infralab.ts","./src/main.tsx","./src/reactlab.ts","./src/store.ts","./src/types.ts","./src/vite-env.d.ts","./src/components/aisettingsmodal.tsx","./src/components/annotationdialog.tsx","./src/components/browsersecuritylabmodal.tsx","./src/components/canvaslabmodal.tsx","./src/components/chatmessage.tsx","./src/components/chatview.tsx","./src/components/codecontextpanel.tsx","./src/components/codelineannotationpopup.tsx","./src/components/coderunnermodal.tsx","./src/components/deploymentlabmodal.tsx","./src/components/docrefmodal.tsx","./src/components/fileattachments.tsx","./src/components/filepickermodal.tsx","./src/components/fileviewermodal.tsx","./src/components/ghaconcurrencypanel.tsx","./src/components/ghahistorypanel.tsx","./src/components/ghajobspanel.tsx","./src/components/gitdiffpanel.tsx","./src/components/gitdiffviewermodal.tsx","./src/components/githubactionslabmodal.tsx","./src/components/infralabmodal.tsx","./src/components/labspanel.tsx","./src/components/linkedconvospicker.tsx","./src/components/markdownrenderer.tsx","./src/components/mermaiddiagram.tsx","./src/components/notesmodal.tsx","./src/components/plotembed.tsx","./src/components/sidebar.tsx","./src/components/textannotator.tsx","./src/components/vizcraftembed.tsx","./src/components/workspaceswitcher.tsx"],"version":"5.9.3"}
1
+ {"root":["./src/app.tsx","./src/api.ts","./src/browsersecuritytemplates.ts","./src/enterpriselocallab.ts","./src/ghaconcurrency.ts","./src/githubactionslab.ts","./src/infralab.ts","./src/main.tsx","./src/reactlab.ts","./src/store.ts","./src/types.ts","./src/vite-env.d.ts","./src/components/aisettingsmodal.tsx","./src/components/annotationdialog.tsx","./src/components/browsersecuritylabmodal.tsx","./src/components/canvaslabmodal.tsx","./src/components/chatmessage.tsx","./src/components/chatview.tsx","./src/components/codecontextpanel.tsx","./src/components/codelineannotationpopup.tsx","./src/components/coderunnermodal.tsx","./src/components/deploymentlabmodal.tsx","./src/components/diagramsmodal.tsx","./src/components/docrefmodal.tsx","./src/components/fileattachments.tsx","./src/components/filepickermodal.tsx","./src/components/fileviewermodal.tsx","./src/components/ghaconcurrencypanel.tsx","./src/components/ghahistorypanel.tsx","./src/components/ghajobspanel.tsx","./src/components/gitdiffpanel.tsx","./src/components/gitdiffviewermodal.tsx","./src/components/githubactionslabmodal.tsx","./src/components/infralabmodal.tsx","./src/components/labspanel.tsx","./src/components/linkedconvospicker.tsx","./src/components/markdownrenderer.tsx","./src/components/mermaiddiagram.tsx","./src/components/notesmodal.tsx","./src/components/plotembed.tsx","./src/components/sidebar.tsx","./src/components/textannotator.tsx","./src/components/vizcraftembed.tsx","./src/components/workspaceswitcher.tsx"],"version":"5.9.3"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.26.0"
2
+ "version": "0.27.0"
3
3
  }
@@ -273,7 +273,7 @@ function parseWorkspace(input: unknown): GithubActionsLabWorkspace {
273
273
  label:
274
274
  typeof candidate.label === "string" && candidate.label.trim()
275
275
  ? candidate.label.trim()
276
- : "GitHub Actions Lab",
276
+ : "GitHub Lab",
277
277
  activeFile:
278
278
  typeof candidate.activeFile === "string" &&
279
279
  Object.prototype.hasOwnProperty.call(files, candidate.activeFile)