nomoreide 0.1.44 → 0.1.46

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 (56) hide show
  1. package/dist/cli/git.js +4 -1
  2. package/dist/cli/git.js.map +1 -1
  3. package/dist/core/agent-runtime.d.ts +15 -0
  4. package/dist/core/agent-runtime.js +39 -3
  5. package/dist/core/agent-runtime.js.map +1 -1
  6. package/dist/core/config-store.d.ts +7 -0
  7. package/dist/core/config-store.js +45 -0
  8. package/dist/core/config-store.js.map +1 -1
  9. package/dist/core/git-actions.d.ts +30 -0
  10. package/dist/core/git-actions.js +58 -0
  11. package/dist/core/git-actions.js.map +1 -0
  12. package/dist/core/git-manager.d.ts +13 -0
  13. package/dist/core/git-manager.js +43 -1
  14. package/dist/core/git-manager.js.map +1 -1
  15. package/dist/core/github-manager.d.ts +149 -0
  16. package/dist/core/github-manager.js +181 -0
  17. package/dist/core/github-manager.js.map +1 -0
  18. package/dist/core/repo-onboard.d.ts +2 -2
  19. package/dist/core/types.d.ts +8 -0
  20. package/dist/core/workflows.d.ts +204 -0
  21. package/dist/core/workflows.js +146 -0
  22. package/dist/core/workflows.js.map +1 -0
  23. package/dist/mcp/tools/context.d.ts +3 -0
  24. package/dist/mcp/tools/context.js +5 -0
  25. package/dist/mcp/tools/context.js.map +1 -1
  26. package/dist/mcp/tools/git.d.ts +1 -1
  27. package/dist/mcp/tools/git.js +10 -1
  28. package/dist/mcp/tools/git.js.map +1 -1
  29. package/dist/mcp/tools/github.d.ts +4 -0
  30. package/dist/mcp/tools/github.js +206 -0
  31. package/dist/mcp/tools/github.js.map +1 -0
  32. package/dist/mcp/tools/index.d.ts +1 -1
  33. package/dist/mcp/tools/index.js +3 -0
  34. package/dist/mcp/tools/index.js.map +1 -1
  35. package/dist/web/client/assets/{code-editor-NLVWCtZl.js → code-editor-o1tS7fpw.js} +1 -1
  36. package/dist/web/client/assets/index-CFZyk7FD.js +201 -0
  37. package/dist/web/client/assets/index-Dcqu3Z0L.css +1 -0
  38. package/dist/web/client/index.html +2 -2
  39. package/dist/web/routes/agent-chat-routes.js +3 -0
  40. package/dist/web/routes/agent-chat-routes.js.map +1 -1
  41. package/dist/web/routes/git-routes.js +60 -0
  42. package/dist/web/routes/git-routes.js.map +1 -1
  43. package/dist/web/routes/github-context.d.ts +9 -0
  44. package/dist/web/routes/github-context.js +31 -0
  45. package/dist/web/routes/github-context.js.map +1 -0
  46. package/dist/web/routes/github-routes.d.ts +2 -0
  47. package/dist/web/routes/github-routes.js +342 -0
  48. package/dist/web/routes/github-routes.js.map +1 -0
  49. package/dist/web/routes/index.js +4 -0
  50. package/dist/web/routes/index.js.map +1 -1
  51. package/dist/web/routes/workflow-routes.d.ts +8 -0
  52. package/dist/web/routes/workflow-routes.js +45 -0
  53. package/dist/web/routes/workflow-routes.js.map +1 -0
  54. package/package.json +1 -1
  55. package/dist/web/client/assets/index-B-5D3C0G.js +0 -197
  56. package/dist/web/client/assets/index-g1k-tjDx.css +0 -1
@@ -0,0 +1,149 @@
1
+ export interface GitHubPR {
2
+ number: number;
3
+ title: string;
4
+ state: "open" | "closed" | "merged";
5
+ body: string | null;
6
+ html_url: string;
7
+ head: {
8
+ ref: string;
9
+ sha: string;
10
+ };
11
+ base: {
12
+ ref: string;
13
+ };
14
+ user: {
15
+ login: string;
16
+ };
17
+ created_at: string;
18
+ updated_at: string;
19
+ merged_at: string | null;
20
+ draft: boolean;
21
+ mergeable: boolean | null;
22
+ }
23
+ export interface GitHubIssue {
24
+ number: number;
25
+ title: string;
26
+ state: "open" | "closed";
27
+ body: string | null;
28
+ html_url: string;
29
+ user: {
30
+ login: string;
31
+ };
32
+ labels: Array<{
33
+ name: string;
34
+ color: string;
35
+ }>;
36
+ created_at: string;
37
+ updated_at: string;
38
+ comments: number;
39
+ pull_request?: object;
40
+ }
41
+ export interface GitHubComment {
42
+ id: number;
43
+ body: string;
44
+ user: {
45
+ login: string;
46
+ };
47
+ created_at: string;
48
+ html_url: string;
49
+ }
50
+ export interface GitHubCheckRun {
51
+ id: number;
52
+ name: string;
53
+ status: string;
54
+ conclusion: string | null;
55
+ html_url: string;
56
+ started_at: string | null;
57
+ completed_at: string | null;
58
+ }
59
+ export interface CommitCIStatus {
60
+ sha: string;
61
+ state: "pending" | "success" | "failure" | "error" | "unknown";
62
+ totalCount: number;
63
+ runs: GitHubCheckRun[];
64
+ }
65
+ export interface GitHubWorkflowRun {
66
+ id: number;
67
+ name: string;
68
+ status: string;
69
+ conclusion: string | null;
70
+ html_url: string;
71
+ head_sha: string;
72
+ head_branch: string;
73
+ created_at: string;
74
+ updated_at: string;
75
+ run_number: number;
76
+ event: string;
77
+ }
78
+ export interface GitHubWorkflowJobStep {
79
+ name: string;
80
+ status: string;
81
+ conclusion: string | null;
82
+ number: number;
83
+ started_at: string | null;
84
+ completed_at: string | null;
85
+ }
86
+ export interface GitHubWorkflowJob {
87
+ id: number;
88
+ run_id: number;
89
+ html_url: string;
90
+ status: string;
91
+ conclusion: string | null;
92
+ started_at: string | null;
93
+ completed_at: string | null;
94
+ name: string;
95
+ steps: GitHubWorkflowJobStep[];
96
+ }
97
+ export declare class GitHubApiError extends Error {
98
+ readonly status: number;
99
+ readonly path: string;
100
+ constructor(message: string, status: number, path: string);
101
+ }
102
+ export declare class GitHubManager {
103
+ private readonly token;
104
+ private readonly owner;
105
+ private readonly repo;
106
+ private readonly baseUrl;
107
+ constructor(token: string, owner: string, repo: string, baseUrl?: string);
108
+ static parseRemoteUrl(remoteUrl: string): {
109
+ owner: string;
110
+ repo: string;
111
+ } | null;
112
+ listPRs(state?: "open" | "closed" | "all", page?: number): Promise<GitHubPR[]>;
113
+ getPR(number: number): Promise<GitHubPR>;
114
+ getPRDiff(number: number): Promise<string>;
115
+ createPR(opts: {
116
+ title: string;
117
+ body?: string;
118
+ head: string;
119
+ base: string;
120
+ draft?: boolean;
121
+ }): Promise<GitHubPR>;
122
+ /**
123
+ * Merge a pull request via the GitHub API. Defaults to a squash merge — the
124
+ * common "Squash & merge" button behavior. GitHub rejects the call (405) if
125
+ * the PR isn't mergeable (conflicts, failing required checks, branch
126
+ * protection), and that message is surfaced to the caller.
127
+ */
128
+ mergePR(number: number, opts?: {
129
+ method?: "merge" | "squash" | "rebase";
130
+ commitTitle?: string;
131
+ commitMessage?: string;
132
+ }): Promise<{
133
+ merged: boolean;
134
+ sha: string;
135
+ message: string;
136
+ }>;
137
+ listIssues(state?: "open" | "closed" | "all", page?: number): Promise<GitHubIssue[]>;
138
+ getIssue(number: number): Promise<GitHubIssue>;
139
+ createIssue(opts: {
140
+ title: string;
141
+ body?: string;
142
+ }): Promise<GitHubIssue>;
143
+ listIssueComments(number: number): Promise<GitHubComment[]>;
144
+ addIssueComment(number: number, body: string): Promise<GitHubComment>;
145
+ getCommitChecks(sha: string): Promise<CommitCIStatus>;
146
+ listWorkflowRuns(branch?: string, page?: number): Promise<GitHubWorkflowRun[]>;
147
+ listWorkflowRunJobs(runId: number): Promise<GitHubWorkflowJob[]>;
148
+ private request;
149
+ }
@@ -0,0 +1,181 @@
1
+ export class GitHubApiError extends Error {
2
+ status;
3
+ path;
4
+ constructor(message, status, path) {
5
+ super(message);
6
+ this.status = status;
7
+ this.path = path;
8
+ this.name = "GitHubApiError";
9
+ }
10
+ }
11
+ export class GitHubManager {
12
+ token;
13
+ owner;
14
+ repo;
15
+ baseUrl;
16
+ constructor(token, owner, repo, baseUrl = "https://api.github.com") {
17
+ this.token = token;
18
+ this.owner = owner;
19
+ this.repo = repo;
20
+ this.baseUrl = baseUrl;
21
+ }
22
+ static parseRemoteUrl(remoteUrl) {
23
+ const trimmed = remoteUrl.trim();
24
+ // https://github.com/owner/repo[.git]
25
+ const httpsMatch = /^https?:\/\/(?:[^@]+@)?github\.com\/([^/]+)\/([^/]+?)(?:\.git)?(?:\/)?$/.exec(trimmed);
26
+ if (httpsMatch) {
27
+ return { owner: httpsMatch[1], repo: httpsMatch[2] };
28
+ }
29
+ // git@github.com:owner/repo[.git]
30
+ const sshMatch = /^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/.exec(trimmed);
31
+ if (sshMatch) {
32
+ return { owner: sshMatch[1], repo: sshMatch[2] };
33
+ }
34
+ return null;
35
+ }
36
+ async listPRs(state = "open", page = 1) {
37
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/pulls?state=${state}&per_page=30&page=${page}`);
38
+ return data.map(normalizePR);
39
+ }
40
+ async getPR(number) {
41
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/pulls/${number}`);
42
+ return normalizePR(data);
43
+ }
44
+ async getPRDiff(number) {
45
+ return this.request(`/repos/${this.owner}/${this.repo}/pulls/${number}`, { accept: "application/vnd.github.diff" });
46
+ }
47
+ async createPR(opts) {
48
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/pulls`, { method: "POST", body: opts });
49
+ return normalizePR(data);
50
+ }
51
+ /**
52
+ * Merge a pull request via the GitHub API. Defaults to a squash merge — the
53
+ * common "Squash & merge" button behavior. GitHub rejects the call (405) if
54
+ * the PR isn't mergeable (conflicts, failing required checks, branch
55
+ * protection), and that message is surfaced to the caller.
56
+ */
57
+ async mergePR(number, opts = {}) {
58
+ return this.request(`/repos/${this.owner}/${this.repo}/pulls/${number}/merge`, {
59
+ method: "PUT",
60
+ body: {
61
+ merge_method: opts.method ?? "squash",
62
+ ...(opts.commitTitle ? { commit_title: opts.commitTitle } : {}),
63
+ ...(opts.commitMessage ? { commit_message: opts.commitMessage } : {}),
64
+ },
65
+ });
66
+ }
67
+ async listIssues(state = "open", page = 1) {
68
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/issues?state=${state}&per_page=30&page=${page}`);
69
+ // Filter out PRs (issues endpoint includes them)
70
+ return data.filter((issue) => !issue.pull_request);
71
+ }
72
+ async getIssue(number) {
73
+ return this.request(`/repos/${this.owner}/${this.repo}/issues/${number}`);
74
+ }
75
+ async createIssue(opts) {
76
+ return this.request(`/repos/${this.owner}/${this.repo}/issues`, { method: "POST", body: opts });
77
+ }
78
+ async listIssueComments(number) {
79
+ return this.request(`/repos/${this.owner}/${this.repo}/issues/${number}/comments?per_page=100`);
80
+ }
81
+ async addIssueComment(number, body) {
82
+ return this.request(`/repos/${this.owner}/${this.repo}/issues/${number}/comments`, { method: "POST", body: { body } });
83
+ }
84
+ async getCommitChecks(sha) {
85
+ try {
86
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/commits/${sha}/check-runs?per_page=100`);
87
+ return {
88
+ sha,
89
+ state: deriveState(data.check_runs),
90
+ totalCount: data.total_count,
91
+ runs: data.check_runs,
92
+ };
93
+ }
94
+ catch (error) {
95
+ if (error instanceof GitHubApiError && error.status === 404) {
96
+ return { sha, state: "unknown", totalCount: 0, runs: [] };
97
+ }
98
+ throw error;
99
+ }
100
+ }
101
+ async listWorkflowRuns(branch, page = 1) {
102
+ const params = new URLSearchParams({ per_page: "30", page: String(page) });
103
+ if (branch)
104
+ params.set("branch", branch);
105
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/actions/runs?${params}`);
106
+ return data.workflow_runs;
107
+ }
108
+ async listWorkflowRunJobs(runId) {
109
+ const data = await this.request(`/repos/${this.owner}/${this.repo}/actions/runs/${runId}/jobs?per_page=100`);
110
+ return data.jobs;
111
+ }
112
+ async request(path, opts) {
113
+ const url = path.startsWith("http") ? path : `${this.baseUrl}${path}`;
114
+ const headers = {
115
+ Authorization: `Bearer ${this.token}`,
116
+ Accept: opts?.accept ?? "application/vnd.github+json",
117
+ "X-GitHub-Api-Version": "2022-11-28",
118
+ };
119
+ const init = {
120
+ method: opts?.method ?? "GET",
121
+ headers,
122
+ };
123
+ if (opts?.body !== undefined) {
124
+ if (opts.accept === "application/vnd.github.diff") {
125
+ // diff requests don't send a body
126
+ }
127
+ else {
128
+ headers["Content-Type"] = "application/json";
129
+ init.body = JSON.stringify(opts.body);
130
+ }
131
+ }
132
+ const response = await fetch(url, init);
133
+ if (opts?.accept === "application/vnd.github.diff") {
134
+ if (!response.ok) {
135
+ const text = await response.text().catch(() => response.statusText);
136
+ throw new GitHubApiError(text, response.status, path);
137
+ }
138
+ return response.text();
139
+ }
140
+ if (!response.ok) {
141
+ let message = response.statusText;
142
+ try {
143
+ const body = await response.json();
144
+ if (body.message)
145
+ message = body.message;
146
+ }
147
+ catch { /* ignore */ }
148
+ throw new GitHubApiError(message, response.status, path);
149
+ }
150
+ return response.json();
151
+ }
152
+ }
153
+ function normalizePR(pr) {
154
+ return {
155
+ number: pr.number,
156
+ title: pr.title,
157
+ state: pr.merged_at ? "merged" : pr.state,
158
+ body: pr.body,
159
+ html_url: pr.html_url,
160
+ head: pr.head,
161
+ base: pr.base,
162
+ user: pr.user,
163
+ created_at: pr.created_at,
164
+ updated_at: pr.updated_at,
165
+ merged_at: pr.merged_at,
166
+ draft: pr.draft ?? false,
167
+ mergeable: pr.mergeable ?? null,
168
+ };
169
+ }
170
+ function deriveState(runs) {
171
+ if (runs.length === 0)
172
+ return "unknown";
173
+ if (runs.some((r) => r.status === "in_progress" || r.status === "queued"))
174
+ return "pending";
175
+ if (runs.every((r) => r.conclusion === "success" || r.conclusion === "skipped" || r.conclusion === "neutral"))
176
+ return "success";
177
+ if (runs.some((r) => r.conclusion === "failure" || r.conclusion === "timed_out"))
178
+ return "failure";
179
+ return "error";
180
+ }
181
+ //# sourceMappingURL=github-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-manager.js","sourceRoot":"","sources":["../../src/core/github-manager.ts"],"names":[],"mappings":"AA0FA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGrB;IACA;IAHlB,YACE,OAAe,EACC,MAAc,EACd,IAAY;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,aAAa;IAEL;IACA;IACA;IACA;IAJnB,YACmB,KAAa,EACb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C,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IAChI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,UAAU,KAAK,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IACnG,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -213,8 +213,8 @@ export declare const proposedServiceSchema: z.ZodObject<{
213
213
  confidence: z.ZodEnum<["high", "medium", "low"]>;
214
214
  reason: z.ZodString;
215
215
  }, "strip", z.ZodTypeAny, {
216
- name: string;
217
216
  kind: "local" | "docker-compose";
217
+ name: string;
218
218
  cwd: string;
219
219
  confidence: "high" | "medium" | "low";
220
220
  reason: string;
@@ -226,8 +226,8 @@ export declare const proposedServiceSchema: z.ZodObject<{
226
226
  composeService?: string | undefined;
227
227
  installCommand?: string | undefined;
228
228
  }, {
229
- name: string;
230
229
  kind: "local" | "docker-compose";
230
+ name: string;
231
231
  cwd: string;
232
232
  confidence: "high" | "medium" | "low";
233
233
  reason: string;
@@ -1,5 +1,6 @@
1
1
  import type { ProcessTreeSummary } from "./process-tree.js";
2
2
  import type { PortBindingStatus } from "./port-utils.js";
3
+ import type { Workflow } from "./workflows.js";
3
4
  export type ServiceKind = "local" | "docker-compose" | "ssh";
4
5
  export interface ServiceDefinition {
5
6
  name: string;
@@ -90,6 +91,10 @@ export interface LogQuery {
90
91
  /** journald cursor to page *older* than — returns the `lines` entries before it. */
91
92
  before?: string;
92
93
  }
94
+ export interface GitHubToken {
95
+ host: string;
96
+ token: string;
97
+ }
93
98
  export interface NoMoreIdeConfig {
94
99
  version: 1;
95
100
  services: ServiceDefinition[];
@@ -98,6 +103,9 @@ export interface NoMoreIdeConfig {
98
103
  selectedGitRepository?: string;
99
104
  databases: DatabaseConnection[];
100
105
  logSources: LogSourceDefinition[];
106
+ githubTokens: GitHubToken[];
107
+ /** User-saved git/GitHub workflows (forks/edits of the built-in templates). */
108
+ workflows: Workflow[];
101
109
  }
102
110
  export type ServiceState = "stopped" | "starting" | "running" | "exited";
103
111
  export interface ServiceStatus {
@@ -0,0 +1,204 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * User-owned git/GitHub workflows — the AI-native answer to fixed IDE buttons.
4
+ *
5
+ * A workflow is an ordered list of steps the runner walks one at a time. A step
6
+ * is one of three kinds:
7
+ *
8
+ * - **action** — deterministic, no inputs needed (e.g. `push`). Runs via the
9
+ * REST API and its result tells us pass/fail. Predictable, no tokens spent.
10
+ * - **agent** — a scoped natural-language task handed to the dock agent, which
11
+ * does the fuzzy work (review a diff, group commits, draft + file a PR/issue)
12
+ * using its own git/GitHub tools. Optionally `verify`-d against real git state.
13
+ * - **gate** — a hard stop that waits for the human (Approve / Skip / Stop).
14
+ *
15
+ * The runner itself lives client-side (agent steps execute through the dock
16
+ * conversation); this module owns the *shape* and the built-in templates, and is
17
+ * persisted through {@link ConfigStore} so a user can fork/edit them later.
18
+ */
19
+ export declare const workflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
20
+ kind: z.ZodLiteral<"action">;
21
+ id: z.ZodString;
22
+ title: z.ZodString;
23
+ /**
24
+ * Deterministic op with no inputs — runs straight through the REST API with
25
+ * zero agent tokens. `commit` stages everything and commits with a generated
26
+ * message (no diff reading, no quality analysis); `push` pushes the branch.
27
+ */
28
+ op: z.ZodEnum<["push", "commit"]>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ kind: "action";
31
+ id: string;
32
+ title: string;
33
+ op: "push" | "commit";
34
+ }, {
35
+ kind: "action";
36
+ id: string;
37
+ title: string;
38
+ op: "push" | "commit";
39
+ }>, z.ZodObject<{
40
+ kind: z.ZodLiteral<"agent">;
41
+ id: z.ZodString;
42
+ title: z.ZodString;
43
+ /** The instruction handed to the dock agent. */
44
+ prompt: z.ZodString;
45
+ /**
46
+ * Real-state check run after the agent's turn before advancing:
47
+ * - `committed` — the working tree is clean (changes were committed).
48
+ * - `pushed` — the branch is no longer ahead of its upstream.
49
+ */
50
+ verify: z.ZodOptional<z.ZodEnum<["committed", "pushed"]>>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ kind: "agent";
53
+ id: string;
54
+ title: string;
55
+ prompt: string;
56
+ verify?: "committed" | "pushed" | undefined;
57
+ }, {
58
+ kind: "agent";
59
+ id: string;
60
+ title: string;
61
+ prompt: string;
62
+ verify?: "committed" | "pushed" | undefined;
63
+ }>, z.ZodObject<{
64
+ kind: z.ZodLiteral<"gate">;
65
+ id: z.ZodString;
66
+ title: z.ZodString;
67
+ /** Shown at the pause so the user knows what they're approving. */
68
+ message: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ kind: "gate";
71
+ message: string;
72
+ id: string;
73
+ title: string;
74
+ }, {
75
+ kind: "gate";
76
+ message: string;
77
+ id: string;
78
+ title: string;
79
+ }>]>;
80
+ export declare const workflowSchema: z.ZodObject<{
81
+ id: z.ZodString;
82
+ name: z.ZodString;
83
+ description: z.ZodOptional<z.ZodString>;
84
+ /** True for the shipped templates; false/absent for user-saved workflows. */
85
+ builtin: z.ZodOptional<z.ZodBoolean>;
86
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
87
+ kind: z.ZodLiteral<"action">;
88
+ id: z.ZodString;
89
+ title: z.ZodString;
90
+ /**
91
+ * Deterministic op with no inputs — runs straight through the REST API with
92
+ * zero agent tokens. `commit` stages everything and commits with a generated
93
+ * message (no diff reading, no quality analysis); `push` pushes the branch.
94
+ */
95
+ op: z.ZodEnum<["push", "commit"]>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ kind: "action";
98
+ id: string;
99
+ title: string;
100
+ op: "push" | "commit";
101
+ }, {
102
+ kind: "action";
103
+ id: string;
104
+ title: string;
105
+ op: "push" | "commit";
106
+ }>, z.ZodObject<{
107
+ kind: z.ZodLiteral<"agent">;
108
+ id: z.ZodString;
109
+ title: z.ZodString;
110
+ /** The instruction handed to the dock agent. */
111
+ prompt: z.ZodString;
112
+ /**
113
+ * Real-state check run after the agent's turn before advancing:
114
+ * - `committed` — the working tree is clean (changes were committed).
115
+ * - `pushed` — the branch is no longer ahead of its upstream.
116
+ */
117
+ verify: z.ZodOptional<z.ZodEnum<["committed", "pushed"]>>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ kind: "agent";
120
+ id: string;
121
+ title: string;
122
+ prompt: string;
123
+ verify?: "committed" | "pushed" | undefined;
124
+ }, {
125
+ kind: "agent";
126
+ id: string;
127
+ title: string;
128
+ prompt: string;
129
+ verify?: "committed" | "pushed" | undefined;
130
+ }>, z.ZodObject<{
131
+ kind: z.ZodLiteral<"gate">;
132
+ id: z.ZodString;
133
+ title: z.ZodString;
134
+ /** Shown at the pause so the user knows what they're approving. */
135
+ message: z.ZodString;
136
+ }, "strip", z.ZodTypeAny, {
137
+ kind: "gate";
138
+ message: string;
139
+ id: string;
140
+ title: string;
141
+ }, {
142
+ kind: "gate";
143
+ message: string;
144
+ id: string;
145
+ title: string;
146
+ }>]>, "many">;
147
+ }, "strip", z.ZodTypeAny, {
148
+ id: string;
149
+ name: string;
150
+ steps: ({
151
+ kind: "action";
152
+ id: string;
153
+ title: string;
154
+ op: "push" | "commit";
155
+ } | {
156
+ kind: "agent";
157
+ id: string;
158
+ title: string;
159
+ prompt: string;
160
+ verify?: "committed" | "pushed" | undefined;
161
+ } | {
162
+ kind: "gate";
163
+ message: string;
164
+ id: string;
165
+ title: string;
166
+ })[];
167
+ description?: string | undefined;
168
+ builtin?: boolean | undefined;
169
+ }, {
170
+ id: string;
171
+ name: string;
172
+ steps: ({
173
+ kind: "action";
174
+ id: string;
175
+ title: string;
176
+ op: "push" | "commit";
177
+ } | {
178
+ kind: "agent";
179
+ id: string;
180
+ title: string;
181
+ prompt: string;
182
+ verify?: "committed" | "pushed" | undefined;
183
+ } | {
184
+ kind: "gate";
185
+ message: string;
186
+ id: string;
187
+ title: string;
188
+ })[];
189
+ description?: string | undefined;
190
+ builtin?: boolean | undefined;
191
+ }>;
192
+ export type WorkflowStep = z.infer<typeof workflowStepSchema>;
193
+ export type Workflow = z.infer<typeof workflowSchema>;
194
+ /**
195
+ * The Phase-1 starter set. These are plain data (not hardcoded UI), so the same
196
+ * structure a user authors later can be forked from one of these.
197
+ */
198
+ export declare const BUILTIN_WORKFLOWS: Workflow[];
199
+ /**
200
+ * Merge the built-in templates with the user's saved workflows. A stored
201
+ * workflow whose id matches a built-in *replaces* it (that's a fork/edit);
202
+ * everything else is appended. Built-ins come first.
203
+ */
204
+ export declare function listWorkflows(stored: Workflow[]): Workflow[];