@rallycry/conveyor-agent 10.9.0 → 10.10.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.
@@ -2,6 +2,13 @@ import {
2
2
  LoopLagMonitor
3
3
  } from "./chunk-7TQO4ZF4.js";
4
4
 
5
+ // src/utils/sleep.ts
6
+ function sleep(ms) {
7
+ return new Promise((resolve) => {
8
+ setTimeout(resolve, ms);
9
+ });
10
+ }
11
+
5
12
  // src/setup/bootstrap.ts
6
13
  var BOOTSTRAP_TIMEOUT_MS = 3e4;
7
14
  var RETRY_DELAYS_MS = [5e3, 1e4, 2e4];
@@ -37,11 +44,6 @@ async function singleBootstrapAttempt(apiUrl, instanceName, bootstrapToken, time
37
44
  clearTimeout(timer);
38
45
  }
39
46
  }
40
- async function sleep(ms) {
41
- await new Promise((resolve) => {
42
- setTimeout(resolve, ms);
43
- });
44
- }
45
47
  function buildFailure(reason, attempts, status, detail) {
46
48
  const out = { ok: false, reason, attempts };
47
49
  if (status === void 0) {
@@ -133,11 +135,6 @@ var PollUntilBoundHttpError = class extends Error {
133
135
  }
134
136
  status;
135
137
  };
136
- async function sleep2(ms) {
137
- await new Promise((resolve) => {
138
- setTimeout(resolve, ms);
139
- });
140
- }
141
138
  async function pollUntilBound(opts) {
142
139
  const pollIntervalMs = opts.pollIntervalMs ?? 2e3;
143
140
  const maxWaitMs = opts.maxWaitMs ?? 30 * 60 * 1e3;
@@ -153,7 +150,7 @@ async function pollUntilBound(opts) {
153
150
  if (Date.now() >= deadline) {
154
151
  throw new Error(`pollUntilBound timed out after ${maxWaitMs}ms waiting for pod bind`);
155
152
  }
156
- await sleep2(pollIntervalMs);
153
+ await sleep(pollIntervalMs);
157
154
  continue;
158
155
  }
159
156
  throw new PollUntilBoundHttpError(response.status);
@@ -1903,6 +1900,7 @@ async function restoreOnBoot(bundle, cwd) {
1903
1900
  // ../shared/dist/index.js
1904
1901
  import { z } from "zod";
1905
1902
  import { z as z2 } from "zod";
1903
+ import { z as z3 } from "zod";
1906
1904
  var DEFAULT_SONNET_MODEL = "claude-sonnet-5";
1907
1905
  var FABLE_MODEL = "claude-fable-5";
1908
1906
  var TUI_KINDS = ["claude-code", "opencode"];
@@ -1910,784 +1908,892 @@ var MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
1910
1908
  var EMBED_THRESHOLD_IMAGES = 5 * 1024 * 1024;
1911
1909
  var EMBED_THRESHOLD_TEXT = 2 * 1024 * 1024;
1912
1910
  var IDLE_HEARTBEAT_MS = 90 * 1e3;
1913
- var AgentHeartbeatSchema = z.object({
1914
- sessionId: z.string().optional(),
1915
- timestamp: z.string(),
1916
- status: z.enum(["active", "idle", "building"]),
1917
- currentAction: z.string().optional(),
1911
+ var TurnEndToolCallSchema = z.object({
1912
+ tool: z.string(),
1913
+ input: z.string().optional(),
1914
+ output: z.string().optional(),
1915
+ timestamp: z.string().optional()
1916
+ }).passthrough();
1917
+ var KnownAgentEventSchema = z.discriminatedUnion("type", [
1918
+ // ── Lifecycle / connection ────────────────────────────────────────────
1919
+ z.object({
1920
+ type: z.literal("connected"),
1921
+ sessionId: z.string(),
1922
+ projectId: z.string().optional()
1923
+ }).passthrough(),
1924
+ // Open-ended context snapshot spread from buildInitializationContext().
1925
+ z.object({ type: z.literal("session_manifest") }).passthrough(),
1926
+ z.object({
1927
+ type: z.literal("agent_runner_status"),
1928
+ reason: z.string(),
1929
+ attempt: z.number().optional(),
1930
+ attempts: z.number().optional()
1931
+ }).passthrough(),
1932
+ z.object({ type: z.literal("shutdown"), reason: z.string().optional() }).passthrough(),
1933
+ z.object({ type: z.literal("mode_changed"), agentMode: z.string() }).passthrough(),
1934
+ z.object({ type: z.literal("mode_transition"), from: z.string(), to: z.string() }).passthrough(),
1935
+ // ── Turn stream ───────────────────────────────────────────────────────
1936
+ z.object({ type: z.literal("message"), content: z.string() }).passthrough(),
1937
+ z.object({ type: z.literal("thinking"), message: z.string() }).passthrough(),
1938
+ z.object({
1939
+ type: z.literal("tool_use"),
1940
+ tool: z.string(),
1941
+ // Producers send JSON.stringify(input); consumers defend against
1942
+ // object inputs from older agents, so the wire stays permissive here.
1943
+ input: z.unknown().optional()
1944
+ }).passthrough(),
1945
+ z.object({
1946
+ type: z.literal("tool_result"),
1947
+ tool: z.string(),
1948
+ output: z.unknown().optional(),
1949
+ isError: z.boolean().optional(),
1950
+ redactedCount: z.number().optional()
1951
+ }).passthrough(),
1952
+ z.object({ type: z.literal("turn_end"), toolCalls: z.array(TurnEndToolCallSchema) }).passthrough(),
1953
+ z.object({
1954
+ type: z.literal("completed"),
1955
+ summary: z.string().optional(),
1956
+ durationMs: z.number().optional()
1957
+ }).passthrough(),
1958
+ z.object({ type: z.literal("error"), message: z.string() }).passthrough(),
1959
+ z.object({ type: z.literal("agent_typing_start") }).passthrough(),
1960
+ z.object({ type: z.literal("agent_typing_stop") }).passthrough(),
1961
+ // ── Telemetry ─────────────────────────────────────────────────────────
1962
+ // heartbeat/typing: legacy telemetry the server still classifies as
1963
+ // transient (TRANSIENT_EVENT_TYPES) — kept in the vocabulary.
1964
+ z.object({ type: z.literal("heartbeat") }).passthrough(),
1965
+ z.object({ type: z.literal("typing") }).passthrough(),
1966
+ z.object({
1967
+ type: z.literal("context_update"),
1968
+ contextTokens: z.number(),
1969
+ contextWindow: z.number(),
1970
+ inputTokens: z.number().optional(),
1971
+ cacheReadInputTokens: z.number().optional(),
1972
+ cacheCreationInputTokens: z.number().optional(),
1973
+ totalTokensUsed: z.number().optional()
1974
+ }).passthrough(),
1975
+ // Two producer shapes share this type: {rateLimitType, utilization, status}
1976
+ // (SDK rate_limit_event) and {resetsAt} (agent-connection resume notice).
1977
+ z.object({
1978
+ type: z.literal("rate_limit_update"),
1979
+ rateLimitType: z.string().optional(),
1980
+ utilization: z.number().optional(),
1981
+ status: z.string().optional(),
1982
+ resetsAt: z.string().optional()
1983
+ }).passthrough(),
1984
+ z.object({
1985
+ type: z.literal("context_compacted"),
1986
+ trigger: z.string().optional(),
1987
+ preTokens: z.number().optional()
1988
+ }).passthrough(),
1989
+ z.object({
1990
+ type: z.literal("tool_progress"),
1991
+ toolName: z.string().optional(),
1992
+ elapsedSeconds: z.number().optional()
1993
+ }).passthrough(),
1994
+ z.object({
1995
+ type: z.literal("subagent_started"),
1996
+ sdkTaskId: z.string().optional(),
1997
+ description: z.string().optional()
1998
+ }).passthrough(),
1999
+ z.object({
2000
+ type: z.literal("subagent_progress"),
2001
+ sdkTaskId: z.string().optional(),
2002
+ description: z.string().optional(),
2003
+ toolUses: z.number().optional(),
2004
+ durationMs: z.number().optional()
2005
+ }).passthrough(),
2006
+ // ── Work products ─────────────────────────────────────────────────────
2007
+ z.object({ type: z.literal("pr_created"), url: z.string(), number: z.number() }).passthrough(),
2008
+ z.object({
2009
+ type: z.literal("code_review_complete"),
2010
+ result: z.enum(["approved", "changes_requested"]),
2011
+ summary: z.string().optional(),
2012
+ issues: z.array(
2013
+ z.object({
2014
+ file: z.string(),
2015
+ line: z.number().optional(),
2016
+ severity: z.string().optional(),
2017
+ description: z.string().optional()
2018
+ }).passthrough()
2019
+ ).optional()
2020
+ }).passthrough(),
2021
+ // ── Environment setup / start command ─────────────────────────────────
2022
+ z.object({ type: z.literal("setup_output"), stream: z.string(), data: z.string() }).passthrough(),
2023
+ z.object({
2024
+ type: z.literal("setup_complete"),
2025
+ startCommandRunning: z.boolean().optional(),
2026
+ // Sanitized server-side by sanitizeSessionPreviewPorts — stays unknown.
2027
+ previewPorts: z.unknown().optional()
2028
+ }).passthrough(),
2029
+ z.object({ type: z.literal("setup_error"), message: z.string() }).passthrough(),
2030
+ z.object({ type: z.literal("start_command_started") }).passthrough(),
2031
+ z.object({ type: z.literal("start_command_output"), stream: z.string(), data: z.string() }).passthrough(),
2032
+ z.object({
2033
+ type: z.literal("start_command_exited"),
2034
+ code: z.number().nullable().optional(),
2035
+ signal: z.string().nullable().optional(),
2036
+ message: z.string().optional()
2037
+ }).passthrough(),
2038
+ z.object({ type: z.literal("start_command_error"), message: z.string() }).passthrough()
2039
+ ]);
2040
+ var AgentEventSchema = z.union([
2041
+ KnownAgentEventSchema,
2042
+ z.object({ type: z.string().min(1) }).catchall(z.unknown())
2043
+ ]);
2044
+ var AgentHeartbeatSchema = z2.object({
2045
+ sessionId: z2.string().optional(),
2046
+ timestamp: z2.string(),
2047
+ status: z2.enum(["active", "idle", "building"]),
2048
+ currentAction: z2.string().optional(),
1918
2049
  /** Sender-observed main event-loop lag (ms) — see AgentHeartbeat.loopLagMs. */
1919
- loopLagMs: z.number().nonnegative().optional()
2050
+ loopLagMs: z2.number().nonnegative().optional()
1920
2051
  });
1921
- var CreatePRInputSchema = z.object({
1922
- title: z.string().min(1),
1923
- body: z.string(),
1924
- head: z.string().optional(),
1925
- base: z.string().optional()
2052
+ var CreatePRInputSchema = z2.object({
2053
+ title: z2.string().min(1),
2054
+ body: z2.string(),
2055
+ head: z2.string().optional(),
2056
+ base: z2.string().optional()
1926
2057
  });
1927
- var PostToChatInputSchema = z.object({
1928
- message: z.string().min(1),
1929
- type: z.enum(["message", "question", "update"]).optional().default("message")
2058
+ var PostToChatInputSchema = z2.object({
2059
+ message: z2.string().min(1),
2060
+ type: z2.enum(["message", "question", "update"]).optional().default("message")
1930
2061
  });
1931
- var GetTaskContextRequestSchema = z.object({
1932
- sessionId: z.string(),
1933
- includeHistory: z.boolean().optional().default(false)
2062
+ var GetTaskContextRequestSchema = z2.object({
2063
+ sessionId: z2.string(),
2064
+ includeHistory: z2.boolean().optional().default(false)
1934
2065
  });
1935
- var GetChatMessagesRequestSchema = z.object({
1936
- sessionId: z.string(),
1937
- limit: z.number().int().positive().optional().default(50),
1938
- offset: z.number().int().nonnegative().optional().default(0)
2066
+ var GetChatMessagesRequestSchema = z2.object({
2067
+ sessionId: z2.string(),
2068
+ limit: z2.number().int().positive().optional().default(50),
2069
+ offset: z2.number().int().nonnegative().optional().default(0)
1939
2070
  });
1940
- var GetTaskFilesRequestSchema = z.object({
1941
- sessionId: z.string()
2071
+ var GetTaskFilesRequestSchema = z2.object({
2072
+ sessionId: z2.string()
1942
2073
  });
1943
- var GetTaskFileRequestSchema = z.object({
1944
- sessionId: z.string(),
1945
- fileId: z.string()
2074
+ var GetTaskFileRequestSchema = z2.object({
2075
+ sessionId: z2.string(),
2076
+ fileId: z2.string()
1946
2077
  });
1947
- var GetTaskRequestSchema = z.object({
1948
- sessionId: z.string(),
1949
- taskSlugOrId: z.string()
2078
+ var GetTaskRequestSchema = z2.object({
2079
+ sessionId: z2.string(),
2080
+ taskSlugOrId: z2.string()
1950
2081
  });
1951
- var GetCliHistoryRequestSchema = z.object({
1952
- sessionId: z.string(),
1953
- limit: z.number().int().positive().optional().default(100),
1954
- source: z.enum(["agent", "application"]).optional()
2082
+ var GetCliHistoryRequestSchema = z2.object({
2083
+ sessionId: z2.string(),
2084
+ limit: z2.number().int().positive().optional().default(100),
2085
+ source: z2.enum(["agent", "application"]).optional()
1955
2086
  });
1956
- var ListSubtasksRequestSchema = z.object({
1957
- sessionId: z.string(),
2087
+ var ListSubtasksRequestSchema = z2.object({
2088
+ sessionId: z2.string(),
1958
2089
  /** "compact" returns the slim orchestration view (ListSubtasksCompactResponse)
1959
2090
  * with the pack build-slot picture; "full" (default — wire-compat with older
1960
2091
  * agents) returns the verbose SubtaskSummaryDTO[] including description/plan. */
1961
- view: z.enum(["compact", "full"]).optional()
1962
- });
1963
- var GetDependenciesRequestSchema = z.object({
1964
- sessionId: z.string()
1965
- });
1966
- var GetSuggestionsRequestSchema = z.object({
1967
- sessionId: z.string(),
1968
- status: z.string().optional(),
1969
- limit: z.number().int().min(1).max(100).optional()
1970
- });
1971
- var ListManualTestsRequestSchema = z.object({
1972
- sessionId: z.string()
1973
- });
1974
- var QueryManualTestsRequestSchema = z.object({
1975
- sessionId: z.string(),
1976
- cardStatuses: z.array(z.string()).optional(),
1977
- testStatuses: z.array(z.enum(["open", "approved", "rejected"])).optional()
1978
- });
1979
- var CreatePullRequestRequestSchema = CreatePRInputSchema.extend({ sessionId: z.string() });
1980
- var RequestFileUploadRequestSchema = z.object({
1981
- sessionId: z.string(),
1982
- fileName: z.string().min(1).max(255),
1983
- mimeType: z.string().min(1).max(128),
1984
- fileSize: z.number().int().positive().max(MAX_FILE_SIZE_BYTES)
1985
- });
1986
- var ConfirmFileUploadRequestSchema = z.object({
1987
- sessionId: z.string(),
1988
- fileId: z.string(),
1989
- title: z.string().max(500).optional()
1990
- });
1991
- var UpdateTaskStatusRequestSchema = z.object({
1992
- sessionId: z.string(),
1993
- status: z.string(),
1994
- force: z.boolean().optional().default(false)
1995
- });
1996
- var StoreSessionIdRequestSchema = z.object({
1997
- sessionId: z.string(),
1998
- sdkSessionId: z.string()
1999
- });
2000
- var SetManualTestsRequestSchema = z.object({
2001
- sessionId: z.string(),
2002
- items: z.array(z.object({ title: z.string().min(1) })).min(1)
2003
- });
2004
- var EditManualTestRequestSchema = z.object({
2005
- sessionId: z.string(),
2006
- title: z.string().min(1),
2007
- newTitle: z.string().min(1)
2008
- });
2009
- var RemoveManualTestRequestSchema = z.object({
2010
- sessionId: z.string(),
2011
- title: z.string().min(1)
2012
- });
2013
- var ApproveManualTestRequestSchema = z.object({
2014
- sessionId: z.string(),
2015
- title: z.string().min(1)
2016
- });
2017
- var RejectManualTestRequestSchema = z.object({
2018
- sessionId: z.string(),
2019
- title: z.string().min(1),
2020
- reason: z.string().min(1).max(2e3)
2021
- });
2022
- var TrackSpendingRequestSchema = z.object({
2023
- sessionId: z.string(),
2024
- inputTokens: z.number().int().nonnegative(),
2025
- outputTokens: z.number().int().nonnegative(),
2026
- costUsd: z.number().nonnegative(),
2027
- model: z.string()
2028
- });
2029
- var SessionStartRequestSchema = z.object({
2030
- sessionId: z.string(),
2031
- agentVersion: z.string(),
2032
- capabilities: z.array(z.string())
2033
- });
2034
- var SessionStopRequestSchema = z.object({
2035
- sessionId: z.string(),
2036
- reason: z.string().optional()
2037
- });
2038
- var EndReviewSessionRequestSchema = z.object({
2039
- sessionId: z.string(),
2040
- reason: z.enum(["approved", "changes_requested", "finished"]).optional()
2041
- });
2042
- var ConnectAgentRequestSchema = z.object({
2043
- sessionId: z.string()
2044
- });
2045
- var ReportAgentStatusRequestSchema = z.object({
2046
- sessionId: z.string(),
2047
- status: z.string(),
2092
+ view: z2.enum(["compact", "full"]).optional()
2093
+ });
2094
+ var GetDependenciesRequestSchema = z2.object({
2095
+ sessionId: z2.string()
2096
+ });
2097
+ var GetSuggestionsRequestSchema = z2.object({
2098
+ sessionId: z2.string(),
2099
+ status: z2.string().optional(),
2100
+ limit: z2.number().int().min(1).max(100).optional()
2101
+ });
2102
+ var ListManualTestsRequestSchema = z2.object({
2103
+ sessionId: z2.string()
2104
+ });
2105
+ var QueryManualTestsRequestSchema = z2.object({
2106
+ sessionId: z2.string(),
2107
+ cardStatuses: z2.array(z2.string()).optional(),
2108
+ testStatuses: z2.array(z2.enum(["open", "approved", "rejected"])).optional()
2109
+ });
2110
+ var CreatePullRequestRequestSchema = CreatePRInputSchema.extend({ sessionId: z2.string() });
2111
+ var RequestFileUploadRequestSchema = z2.object({
2112
+ sessionId: z2.string(),
2113
+ fileName: z2.string().min(1).max(255),
2114
+ mimeType: z2.string().min(1).max(128),
2115
+ fileSize: z2.number().int().positive().max(MAX_FILE_SIZE_BYTES)
2116
+ });
2117
+ var ConfirmFileUploadRequestSchema = z2.object({
2118
+ sessionId: z2.string(),
2119
+ fileId: z2.string(),
2120
+ title: z2.string().max(500).optional()
2121
+ });
2122
+ var UpdateTaskStatusRequestSchema = z2.object({
2123
+ sessionId: z2.string(),
2124
+ status: z2.string(),
2125
+ force: z2.boolean().optional().default(false)
2126
+ });
2127
+ var StoreSessionIdRequestSchema = z2.object({
2128
+ sessionId: z2.string(),
2129
+ sdkSessionId: z2.string()
2130
+ });
2131
+ var SetManualTestsRequestSchema = z2.object({
2132
+ sessionId: z2.string(),
2133
+ items: z2.array(z2.object({ title: z2.string().min(1) })).min(1)
2134
+ });
2135
+ var EditManualTestRequestSchema = z2.object({
2136
+ sessionId: z2.string(),
2137
+ title: z2.string().min(1),
2138
+ newTitle: z2.string().min(1)
2139
+ });
2140
+ var RemoveManualTestRequestSchema = z2.object({
2141
+ sessionId: z2.string(),
2142
+ title: z2.string().min(1)
2143
+ });
2144
+ var ApproveManualTestRequestSchema = z2.object({
2145
+ sessionId: z2.string(),
2146
+ title: z2.string().min(1)
2147
+ });
2148
+ var RejectManualTestRequestSchema = z2.object({
2149
+ sessionId: z2.string(),
2150
+ title: z2.string().min(1),
2151
+ reason: z2.string().min(1).max(2e3)
2152
+ });
2153
+ var SessionStartRequestSchema = z2.object({
2154
+ sessionId: z2.string(),
2155
+ agentVersion: z2.string(),
2156
+ capabilities: z2.array(z2.string())
2157
+ });
2158
+ var SessionStopRequestSchema = z2.object({
2159
+ sessionId: z2.string(),
2160
+ reason: z2.string().optional()
2161
+ });
2162
+ var EndReviewSessionRequestSchema = z2.object({
2163
+ sessionId: z2.string(),
2164
+ reason: z2.enum(["approved", "changes_requested", "finished"]).optional()
2165
+ });
2166
+ var ConnectAgentRequestSchema = z2.object({
2167
+ sessionId: z2.string()
2168
+ });
2169
+ var ReportAgentStatusRequestSchema = z2.object({
2170
+ sessionId: z2.string(),
2171
+ status: z2.string(),
2048
2172
  /** Why the agent reports this status (e.g. "user_question" while an AskUserQuestion questionnaire is pending in the TUI). */
2049
- reason: z.string().optional(),
2173
+ reason: z2.string().optional(),
2050
2174
  /**
2051
2175
  * The pending question text, sent only alongside `reason: "user_question"`
2052
2176
  * so the server can surface it in the user-question notification body (and
2053
2177
  * thus the Attention feed) instead of a generic string. Optional: older
2054
2178
  * agents omit it and the server falls back to the generic wording.
2055
2179
  */
2056
- questionText: z.string().optional()
2057
- });
2058
- var NotifyAgentVersionRequestSchema = z.object({
2059
- sessionId: z.string(),
2060
- agentVersion: z.string()
2061
- });
2062
- var DiscoveredPortSchema = z.object({
2063
- port: z.number().int().min(1).max(65535),
2064
- label: z.string().min(1).max(64).optional(),
2065
- protocol: z.enum(["http", "tcp"]).optional(),
2066
- detectedAt: z.string()
2067
- });
2068
- var ReportDiscoveredPortsRequestSchema = z.object({
2069
- sessionId: z.string(),
2070
- ports: z.array(DiscoveredPortSchema).max(64)
2071
- });
2072
- var CreateSubtaskRequestSchema = z.object({
2073
- sessionId: z.string(),
2074
- title: z.string().min(1),
2075
- description: z.string().optional(),
2076
- plan: z.string().optional(),
2077
- storyPointValue: z.number().int().positive().optional(),
2078
- ordinal: z.number().int().nonnegative().optional(),
2079
- followParentStatus: z.boolean().optional(),
2180
+ questionText: z2.string().optional()
2181
+ });
2182
+ var NotifyAgentVersionRequestSchema = z2.object({
2183
+ sessionId: z2.string(),
2184
+ agentVersion: z2.string()
2185
+ });
2186
+ var DiscoveredPortSchema = z2.object({
2187
+ port: z2.number().int().min(1).max(65535),
2188
+ label: z2.string().min(1).max(64).optional(),
2189
+ protocol: z2.enum(["http", "tcp"]).optional(),
2190
+ detectedAt: z2.string()
2191
+ });
2192
+ var ReportDiscoveredPortsRequestSchema = z2.object({
2193
+ sessionId: z2.string(),
2194
+ ports: z2.array(DiscoveredPortSchema).max(64)
2195
+ });
2196
+ var CreateSubtaskRequestSchema = z2.object({
2197
+ sessionId: z2.string(),
2198
+ title: z2.string().min(1),
2199
+ description: z2.string().optional(),
2200
+ plan: z2.string().optional(),
2201
+ storyPointValue: z2.number().int().positive().optional(),
2202
+ ordinal: z2.number().int().nonnegative().optional(),
2203
+ followParentStatus: z2.boolean().optional(),
2080
2204
  /** Sibling subtask ids or slugs this subtask blocks on (explicit dependency
2081
2205
  * metadata — preferred over encoding order in plan text / ordinal). */
2082
- dependsOn: z.array(z.string().min(1)).max(32).optional()
2083
- });
2084
- var UpdateSubtaskRequestSchema = z.object({
2085
- sessionId: z.string(),
2086
- subtaskId: z.string(),
2087
- title: z.string().min(1).optional(),
2088
- description: z.string().optional(),
2089
- plan: z.string().optional(),
2206
+ dependsOn: z2.array(z2.string().min(1)).max(32).optional()
2207
+ });
2208
+ var UpdateSubtaskRequestSchema = z2.object({
2209
+ sessionId: z2.string(),
2210
+ subtaskId: z2.string(),
2211
+ title: z2.string().min(1).optional(),
2212
+ description: z2.string().optional(),
2213
+ plan: z2.string().optional(),
2090
2214
  /** Orchestration statuses only ("Planning" | "Open") — the pack parent's
2091
2215
  * sanctioned promotion path. Execution statuses stay with the build
2092
2216
  * pipeline / force_update_task_status. Enforced server-side. */
2093
- status: z.string().optional(),
2217
+ status: z2.string().optional(),
2094
2218
  /** Assign a project agent to the child — accepts the agent's id or exact
2095
2219
  * name; resolved against the parent task's project server-side. */
2096
- agentIdOrName: z.string().min(1).optional(),
2097
- storyPointValue: z.number().int().positive().optional(),
2098
- followParentStatus: z.boolean().optional(),
2220
+ agentIdOrName: z2.string().min(1).optional(),
2221
+ storyPointValue: z2.number().int().positive().optional(),
2222
+ followParentStatus: z2.boolean().optional(),
2099
2223
  /** Replace this subtask's dependency edges with these sibling ids/slugs.
2100
2224
  * Empty array clears all. Omit to leave dependencies unchanged. */
2101
- dependsOn: z.array(z.string().min(1)).max(32).optional()
2102
- });
2103
- var DeleteSubtaskRequestSchema = z.object({
2104
- sessionId: z.string(),
2105
- subtaskId: z.string()
2106
- });
2107
- var GetTaskPropertiesRequestSchema = z.object({
2108
- sessionId: z.string()
2109
- });
2110
- var GetCumulativeSpendingRequestSchema = z.object({
2111
- sessionId: z.string()
2112
- });
2113
- var ModelUsageEntrySchema = z.object({
2114
- model: z.string(),
2115
- inputTokens: z.number().nonnegative(),
2116
- outputTokens: z.number().nonnegative(),
2117
- cacheReadInputTokens: z.number().nonnegative(),
2118
- cacheCreationInputTokens: z.number().nonnegative(),
2119
- costUSD: z.number().nonnegative()
2120
- });
2121
- var GetCumulativeSpendingResponseSchema = z.object({
2122
- totalCostUsd: z.number().nonnegative(),
2123
- modelUsage: z.array(ModelUsageEntrySchema)
2124
- });
2125
- var UpdateTaskFieldsRequestSchema = z.object({
2126
- sessionId: z.string(),
2127
- plan: z.string().optional(),
2128
- description: z.string().optional()
2129
- });
2130
- var UpdateTaskPropertiesRequestSchema = z.object({
2131
- sessionId: z.string(),
2132
- title: z.string().optional(),
2133
- storyPointValue: z.number().int().positive().optional(),
2134
- tagIds: z.array(z.string()).optional(),
2135
- tagNames: z.array(z.string()).optional(),
2136
- githubPRUrl: z.string().url().optional(),
2137
- githubBranch: z.string().optional()
2138
- });
2139
- var ListIconsRequestSchema = z.object({
2140
- sessionId: z.string()
2141
- });
2142
- var GenerateTaskIconRequestSchema = z.object({
2143
- sessionId: z.string(),
2144
- prompt: z.string().min(1),
2145
- aspectRatio: z.string().optional()
2146
- });
2147
- var SearchFaIconsRequestSchema = z.object({
2148
- sessionId: z.string(),
2149
- query: z.string().min(1),
2150
- first: z.number().int().positive().optional()
2151
- });
2152
- var PickFaIconRequestSchema = z.object({
2153
- sessionId: z.string(),
2154
- fontAwesomeId: z.string().min(1),
2155
- fontAwesomeStyle: z.string().optional()
2156
- });
2157
- var CreateFollowUpTaskRequestSchema = z.object({
2158
- sessionId: z.string(),
2159
- title: z.string().min(1),
2160
- description: z.string().optional(),
2161
- plan: z.string().optional(),
2162
- storyPointValue: z.number().int().positive().optional()
2163
- });
2164
- var AddDependencyRequestSchema = z.object({
2165
- sessionId: z.string(),
2166
- dependsOnSlugOrId: z.string()
2167
- });
2168
- var RemoveDependencyRequestSchema = z.object({
2169
- sessionId: z.string(),
2170
- dependsOnSlugOrId: z.string()
2171
- });
2172
- var CreateSuggestionRequestSchema = z.object({
2173
- sessionId: z.string(),
2174
- title: z.string().min(1),
2175
- description: z.string().optional(),
2176
- tagNames: z.array(z.string()).optional()
2177
- });
2178
- var VoteSuggestionRequestSchema = z.object({
2179
- sessionId: z.string(),
2180
- suggestionId: z.string(),
2181
- value: z.union([z.literal(1), z.literal(-1)])
2182
- });
2183
- var TriggerIdentificationRequestSchema = z.object({
2184
- sessionId: z.string()
2185
- });
2186
- var SubmitCodeReviewResultRequestSchema = z.object({
2187
- sessionId: z.string(),
2188
- approved: z.boolean(),
2189
- content: z.string()
2190
- });
2191
- var CycleCodingAgentKeyRequestSchema = z.object({
2192
- sessionId: z.string(),
2193
- rateLimitType: z.string(),
2194
- resetsAt: z.string().optional()
2195
- });
2196
- var StartChildCloudBuildRequestSchema = z.object({
2197
- sessionId: z.string(),
2198
- childTaskId: z.string()
2199
- });
2200
- var StopChildBuildRequestSchema = z.object({
2201
- sessionId: z.string(),
2202
- childTaskId: z.string()
2203
- });
2204
- var ApproveAndMergePRRequestSchema = z.object({
2205
- sessionId: z.string(),
2206
- childTaskId: z.string()
2207
- });
2208
- var PostChildChatMessageRequestSchema = z.object({
2209
- sessionId: z.string(),
2210
- childTaskId: z.string(),
2211
- message: z.string().min(1)
2212
- });
2213
- var UpdateChildStatusRequestSchema = z.object({
2214
- sessionId: z.string(),
2215
- childTaskId: z.string(),
2216
- status: z.string()
2217
- });
2218
- var GetAgentStatusRequestSchema = z.object({
2219
- taskId: z.string()
2220
- });
2221
- var GetUiCliHistoryRequestSchema = z.object({
2222
- taskId: z.string()
2223
- });
2224
- var GetActivePtySessionRequestSchema = z.object({
2225
- taskId: z.string()
2226
- });
2227
- var ListActivePtySessionsRequestSchema = z.object({
2228
- taskId: z.string()
2229
- });
2230
- var SendSoftStopRequestSchema = z.object({
2231
- taskId: z.string()
2232
- });
2233
- var StopTaskSessionRequestSchema = z.object({
2234
- taskId: z.string(),
2235
- sessionId: z.string()
2236
- });
2237
- var FlushTaskQueueRequestSchema = z.object({
2238
- taskId: z.string(),
2239
- softStop: z.boolean().optional()
2240
- });
2241
- var CancelTaskQueuedMessageRequestSchema = z.object({
2242
- taskId: z.string(),
2243
- messageId: z.string()
2244
- });
2245
- var FlushSingleQueuedMessageRequestSchema = z.object({
2246
- taskId: z.string(),
2247
- messageId: z.string(),
2248
- softStop: z.boolean().optional()
2249
- });
2250
- var AnswerAgentQuestionRequestSchema = z.object({
2251
- taskId: z.string(),
2252
- requestId: z.string(),
2253
- answers: z.record(z.string(), z.string())
2254
- });
2255
- var ClearAgentTodosRequestSchema = z.object({
2256
- taskId: z.string()
2257
- });
2258
- var AgentQuestionOptionSchema = z.object({
2259
- label: z.string(),
2260
- description: z.string(),
2261
- preview: z.string().optional()
2262
- });
2263
- var AgentQuestionSchema = z.object({
2264
- question: z.string(),
2265
- header: z.string(),
2266
- options: z.array(AgentQuestionOptionSchema),
2267
- multiSelect: z.boolean().optional()
2268
- });
2269
- var AskUserQuestionRequestSchema = z.object({
2270
- sessionId: z.string(),
2271
- question: z.string().min(1),
2272
- requestId: z.string().min(1),
2273
- questions: z.array(AgentQuestionSchema).min(1)
2274
- });
2275
- var AgentEventSchema = z.object({
2276
- type: z.string().min(1)
2277
- }).catchall(z.unknown());
2278
- var EmitAgentEventRequestSchema = z.object({
2279
- sessionId: z.string(),
2280
- events: z.array(AgentEventSchema).max(500)
2281
- });
2282
- var RefreshGithubTokenRequestSchema = z.object({
2283
- sessionId: z.string()
2284
- });
2285
- var ReportReviewSpawnFailureRequestSchema = z.object({
2286
- sessionId: z.string(),
2287
- reviewSessionId: z.string(),
2288
- error: z.string().max(2e3).optional()
2289
- });
2290
- var SpawnTaskSessionRequestSchema = z.object({
2291
- taskId: z.string(),
2292
- kind: z.enum(["tui", "shell"])
2293
- });
2294
- var SpawnTaskReviewRequestSchema = z.object({
2295
- taskId: z.string()
2296
- });
2297
- var ReportSessionSpawnFailureRequestSchema = z.object({
2298
- sessionId: z.string(),
2299
- spawnedSessionId: z.string(),
2300
- error: z.string().max(2e3).optional()
2301
- });
2302
- var RefreshGithubTokenResponseSchema = z.object({
2303
- token: z.string()
2225
+ dependsOn: z2.array(z2.string().min(1)).max(32).optional()
2304
2226
  });
2305
- var PTY_FRAME_MAX_CHARS = 256 * 1024;
2306
- var PTY_MAX_DIMENSION = 1e3;
2307
- var PtyOutputRequestSchema = z.object({
2308
- sessionId: z.string(),
2309
- data: z.string().max(PTY_FRAME_MAX_CHARS),
2310
- cols: z.number().int().positive().max(PTY_MAX_DIMENSION).optional(),
2311
- rows: z.number().int().positive().max(PTY_MAX_DIMENSION).optional()
2227
+ var DeleteSubtaskRequestSchema = z2.object({
2228
+ sessionId: z2.string(),
2229
+ subtaskId: z2.string()
2312
2230
  });
2313
- var PtyEndedRequestSchema = z.object({
2314
- sessionId: z.string()
2231
+ var GetTaskPropertiesRequestSchema = z2.object({
2232
+ sessionId: z2.string()
2315
2233
  });
2316
- var PtyInputRequestSchema = z.object({
2317
- sessionId: z.string(),
2318
- data: z.string().max(PTY_FRAME_MAX_CHARS)
2234
+ var UpdateTaskFieldsRequestSchema = z2.object({
2235
+ sessionId: z2.string(),
2236
+ plan: z2.string().optional(),
2237
+ description: z2.string().optional()
2319
2238
  });
2320
- var PtyResizeRequestSchema = z.object({
2321
- sessionId: z.string(),
2322
- cols: z.number().int().positive().max(PTY_MAX_DIMENSION),
2323
- rows: z.number().int().positive().max(PTY_MAX_DIMENSION)
2239
+ var UpdateTaskPropertiesRequestSchema = z2.object({
2240
+ sessionId: z2.string(),
2241
+ title: z2.string().optional(),
2242
+ storyPointValue: z2.number().int().positive().optional(),
2243
+ tagIds: z2.array(z2.string()).optional(),
2244
+ tagNames: z2.array(z2.string()).optional(),
2245
+ githubPRUrl: z2.string().url().optional(),
2246
+ githubBranch: z2.string().optional()
2324
2247
  });
2325
- var PtyAttachRequestSchema = z.object({
2326
- sessionId: z.string()
2248
+ var ListIconsRequestSchema = z2.object({
2249
+ sessionId: z2.string()
2327
2250
  });
2328
- var PtyChatEventPayloadSchema = z.discriminatedUnion("kind", [
2329
- z.object({
2330
- kind: z.literal("init"),
2331
- model: z.string().max(200),
2332
- claudeSessionId: z.string().max(100).optional()
2333
- }),
2334
- z.object({ kind: z.literal("user_text"), text: z.string().max(16384) }),
2335
- z.object({ kind: z.literal("assistant_text"), text: z.string().max(16384) }),
2336
- z.object({
2337
- kind: z.literal("tool_use"),
2338
- name: z.string().max(200),
2339
- // Compact preview: JSON.stringify(input) truncated agent-side.
2340
- input: z.string().max(2e3)
2341
- }),
2342
- z.object({ kind: z.literal("turn_end") })
2343
- ]);
2344
- var PtyChatEventRequestSchema = z.object({
2345
- sessionId: z.string(),
2346
- event: PtyChatEventPayloadSchema
2251
+ var GenerateTaskIconRequestSchema = z2.object({
2252
+ sessionId: z2.string(),
2253
+ prompt: z2.string().min(1),
2254
+ aspectRatio: z2.string().optional()
2347
2255
  });
2348
- var PtyChatAttachRequestSchema = z.object({
2349
- sessionId: z.string()
2256
+ var SearchFaIconsRequestSchema = z2.object({
2257
+ sessionId: z2.string(),
2258
+ query: z2.string().min(1),
2259
+ first: z2.number().int().positive().optional()
2350
2260
  });
2351
- var CreatePRResponseSchema = z.object({
2352
- prNumber: z.number().int().positive(),
2353
- prUrl: z.string().url()
2261
+ var PickFaIconRequestSchema = z2.object({
2262
+ sessionId: z2.string(),
2263
+ fontAwesomeId: z2.string().min(1),
2264
+ fontAwesomeStyle: z2.string().optional()
2354
2265
  });
2355
- var PostToChatResponseSchema = z.object({
2356
- messageId: z.string()
2266
+ var CreateFollowUpTaskRequestSchema = z2.object({
2267
+ sessionId: z2.string(),
2268
+ title: z2.string().min(1),
2269
+ description: z2.string().optional(),
2270
+ plan: z2.string().optional(),
2271
+ storyPointValue: z2.number().int().positive().optional()
2357
2272
  });
2358
- var UpdateTaskStatusResponseSchema = z.object({
2359
- taskId: z.string(),
2360
- status: z.string()
2273
+ var AddDependencyRequestSchema = z2.object({
2274
+ sessionId: z2.string(),
2275
+ dependsOnSlugOrId: z2.string()
2361
2276
  });
2362
- var StoreSessionIdResponseSchema = z.object({
2363
- success: z.boolean()
2277
+ var RemoveDependencyRequestSchema = z2.object({
2278
+ sessionId: z2.string(),
2279
+ dependsOnSlugOrId: z2.string()
2364
2280
  });
2365
- var HeartbeatResponseSchema = z.object({
2366
- acknowledged: z.boolean()
2281
+ var CreateSuggestionRequestSchema = z2.object({
2282
+ sessionId: z2.string(),
2283
+ title: z2.string().min(1),
2284
+ description: z2.string().optional(),
2285
+ tagNames: z2.array(z2.string()).optional()
2367
2286
  });
2368
- var SessionStartResponseSchema = z.object({
2369
- sessionId: z.string(),
2370
- startedAt: z.string()
2287
+ var VoteSuggestionRequestSchema = z2.object({
2288
+ sessionId: z2.string(),
2289
+ suggestionId: z2.string(),
2290
+ value: z2.union([z2.literal(1), z2.literal(-1)])
2371
2291
  });
2372
- var SessionStopResponseSchema = z.object({
2373
- sessionId: z.string(),
2374
- stoppedAt: z.string()
2292
+ var TriggerIdentificationRequestSchema = z2.object({
2293
+ sessionId: z2.string()
2375
2294
  });
2376
- var DeleteSubtaskResponseSchema = z.object({
2377
- deleted: z.boolean()
2295
+ var SubmitCodeReviewResultRequestSchema = z2.object({
2296
+ sessionId: z2.string(),
2297
+ approved: z2.boolean(),
2298
+ content: z2.string()
2378
2299
  });
2379
- var ListAccessibleProjectsRequestSchema = z2.object({
2380
- pageSize: z2.number().int().positive().max(100).optional().default(100)
2300
+ var CycleCodingAgentKeyRequestSchema = z2.object({
2301
+ sessionId: z2.string(),
2302
+ rateLimitType: z2.string(),
2303
+ resetsAt: z2.string().optional()
2381
2304
  });
2382
- var ListProjectTasksRequestSchema = z2.object({
2383
- projectId: z2.string(),
2384
- status: z2.string().optional(),
2385
- assigneeId: z2.string().optional(),
2386
- unassigned: z2.boolean().optional(),
2387
- limit: z2.number().int().positive().optional().default(50)
2388
- }).refine((p) => !(p.unassigned && p.assigneeId), {
2389
- message: "Pass either assigneeId or unassigned, not both"
2305
+ var StartChildCloudBuildRequestSchema = z2.object({
2306
+ sessionId: z2.string(),
2307
+ childTaskId: z2.string()
2390
2308
  });
2391
- var GetProjectTaskRequestSchema = z2.object({
2392
- projectId: z2.string(),
2393
- taskId: z2.string()
2309
+ var StopChildBuildRequestSchema = z2.object({
2310
+ sessionId: z2.string(),
2311
+ childTaskId: z2.string()
2394
2312
  });
2395
- var SearchProjectTasksRequestSchema = z2.object({
2396
- projectId: z2.string(),
2397
- tagNames: z2.array(z2.string()).optional(),
2398
- searchQuery: z2.string().optional(),
2399
- statusFilters: z2.array(z2.string()).optional(),
2400
- // Card types to include. Omitted/empty → defaults to ["task"] in the handler so
2401
- // search doesn't surface incidents/suggestions unless asked. Enum validation lives
2402
- // at the MCP tool layer (mirrors statusFilters).
2403
- typeFilters: z2.array(z2.string()).optional(),
2404
- assigneeId: z2.string().optional(),
2405
- unassigned: z2.boolean().optional(),
2406
- limit: z2.number().int().positive().optional().default(20)
2407
- }).refine((p) => !(p.unassigned && p.assigneeId), {
2408
- message: "Pass either assigneeId or unassigned, not both"
2313
+ var ApproveAndMergePRRequestSchema = z2.object({
2314
+ sessionId: z2.string(),
2315
+ childTaskId: z2.string()
2409
2316
  });
2410
- var ListProjectTagsRequestSchema = z2.object({
2411
- projectId: z2.string()
2317
+ var PostChildChatMessageRequestSchema = z2.object({
2318
+ sessionId: z2.string(),
2319
+ childTaskId: z2.string(),
2320
+ message: z2.string().min(1)
2412
2321
  });
2413
- var GetProjectSummaryRequestSchema = z2.object({
2414
- projectId: z2.string()
2322
+ var UpdateChildStatusRequestSchema = z2.object({
2323
+ sessionId: z2.string(),
2324
+ childTaskId: z2.string(),
2325
+ status: z2.string()
2415
2326
  });
2416
- var CreateProjectTaskRequestSchema = z2.object({
2417
- projectId: z2.string(),
2418
- title: z2.string().min(1),
2419
- description: z2.string().optional(),
2420
- plan: z2.string().optional(),
2421
- status: z2.string().optional(),
2422
- requestingUserId: z2.string().optional()
2327
+ var GetAgentStatusRequestSchema = z2.object({
2328
+ taskId: z2.string()
2423
2329
  });
2424
- var UpdateProjectTaskRequestSchema = z2.object({
2425
- projectId: z2.string(),
2426
- taskId: z2.string(),
2427
- title: z2.string().optional(),
2428
- description: z2.string().optional(),
2429
- plan: z2.string().optional(),
2430
- status: z2.string().optional(),
2431
- assignedUserId: z2.string().nullish(),
2432
- requestingUserId: z2.string().optional()
2330
+ var GetUiCliHistoryRequestSchema = z2.object({
2331
+ taskId: z2.string()
2433
2332
  });
2434
- var PostToProjectTaskChatRequestSchema = z2.object({
2435
- projectId: z2.string(),
2436
- taskId: z2.string(),
2437
- content: z2.string(),
2438
- requestingUserId: z2.string().optional()
2333
+ var GetActivePtySessionRequestSchema = z2.object({
2334
+ taskId: z2.string()
2439
2335
  });
2440
- var GetProjectTaskCliRequestSchema = z2.object({
2441
- projectId: z2.string(),
2442
- taskId: z2.string(),
2443
- limit: z2.number().int().positive().optional().default(50),
2444
- source: z2.string().optional()
2336
+ var ListActivePtySessionsRequestSchema = z2.object({
2337
+ taskId: z2.string()
2445
2338
  });
2446
- var GetProjectTaskSessionsRequestSchema = z2.object({
2447
- projectId: z2.string(),
2339
+ var SendSoftStopRequestSchema = z2.object({
2448
2340
  taskId: z2.string()
2449
2341
  });
2450
- var QueryProjectGcpLogsRequestSchema = z2.object({
2451
- projectId: z2.string(),
2452
- env: z2.enum(["prod", "dev", "claudespace"]).optional(),
2453
- severity: z2.enum(["DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "CRITICAL", "ALERT", "EMERGENCY"]).optional(),
2454
- services: z2.array(z2.string().min(1).max(200)).max(25).optional(),
2455
- sqlInstances: z2.array(z2.string().min(1).max(200)).max(25).optional(),
2456
- allServices: z2.boolean().optional(),
2457
- search: z2.string().max(256).optional(),
2458
- filter: z2.string().max(1e3).optional(),
2459
- startTime: z2.string().optional(),
2460
- endTime: z2.string().optional(),
2461
- limit: z2.number().int().min(1).max(200).optional().default(50),
2462
- pageToken: z2.string().max(4096).optional()
2463
- });
2464
- var StartProjectBuildRequestSchema = z2.object({
2465
- projectId: z2.string(),
2342
+ var StopTaskSessionRequestSchema = z2.object({
2466
2343
  taskId: z2.string(),
2467
- requestingUserId: z2.string().optional()
2344
+ sessionId: z2.string()
2468
2345
  });
2469
- var StopProjectBuildRequestSchema = z2.object({
2470
- projectId: z2.string(),
2346
+ var FlushTaskQueueRequestSchema = z2.object({
2471
2347
  taskId: z2.string(),
2472
- requestingUserId: z2.string().optional()
2348
+ softStop: z2.boolean().optional()
2473
2349
  });
2474
- var StartProjectWorkspaceRequestSchema = z2.object({
2475
- projectId: z2.string(),
2476
- requestingUserId: z2.string().optional()
2350
+ var CancelTaskQueuedMessageRequestSchema = z2.object({
2351
+ taskId: z2.string(),
2352
+ messageId: z2.string()
2477
2353
  });
2478
- var StopProjectWorkspaceRequestSchema = z2.object({
2479
- projectId: z2.string(),
2480
- destroy: z2.boolean().optional(),
2481
- requestingUserId: z2.string().optional()
2354
+ var FlushSingleQueuedMessageRequestSchema = z2.object({
2355
+ taskId: z2.string(),
2356
+ messageId: z2.string(),
2357
+ softStop: z2.boolean().optional()
2482
2358
  });
2483
- var ListMyLiveSessionsRequestSchema = z2.object({
2484
- projectId: z2.string(),
2485
- /** Admin-only: list another member's sessions instead of the caller's. */
2486
- targetUserId: z2.string().optional()
2359
+ var AnswerAgentQuestionRequestSchema = z2.object({
2360
+ taskId: z2.string(),
2361
+ requestId: z2.string(),
2362
+ answers: z2.record(z2.string(), z2.string())
2487
2363
  });
2488
- var ListProjectSessionGroupsRequestSchema = z2.object({
2489
- projectId: z2.string()
2364
+ var ClearAgentTodosRequestSchema = z2.object({
2365
+ taskId: z2.string()
2490
2366
  });
2491
- var GetProjectAvailableTuisRequestSchema = z2.object({
2492
- projectId: z2.string()
2367
+ var AgentQuestionOptionSchema = z2.object({
2368
+ label: z2.string(),
2369
+ description: z2.string(),
2370
+ preview: z2.string().optional()
2493
2371
  });
2494
- var StartAdhocSessionRequestSchema = z2.object({
2495
- projectId: z2.string(),
2496
- label: z2.string().max(200).optional(),
2497
- /** Coding-agent key to launch under — validated pick-time (ownership + TUI availability) in the handler. */
2498
- codingAgentKeyId: z2.string().optional(),
2499
- /**
2500
- * Session role. Constrained: other task-less modes fall through to the pm
2501
- * runner in the pod entrypoint, and "review" would crash without a task.
2502
- */
2503
- mode: z2.enum(["adhoc", "pm"]).optional(),
2504
- /** Base branch to check out (defaults to the project's dev branch). */
2505
- branch: z2.string().max(300).optional(),
2506
- requestingUserId: z2.string().optional()
2507
- });
2508
- var StopAdhocSessionRequestSchema = z2.object({
2509
- projectId: z2.string(),
2510
- workspaceId: z2.string(),
2511
- destroy: z2.boolean().optional(),
2512
- requestingUserId: z2.string().optional()
2513
- });
2514
- var ResumeAdhocSessionRequestSchema = z2.object({
2515
- projectId: z2.string(),
2516
- workspaceId: z2.string(),
2517
- requestingUserId: z2.string().optional()
2518
- });
2519
- var CreateProjectReleaseRequestSchema = z2.object({
2520
- projectId: z2.string(),
2521
- taskIds: z2.array(z2.string()).optional(),
2522
- requestingUserId: z2.string().optional()
2523
- });
2524
- var ApproveProjectMergePRRequestSchema = z2.object({
2525
- projectId: z2.string(),
2526
- childTaskId: z2.string(),
2527
- requestingUserId: z2.string().optional()
2372
+ var AgentQuestionSchema = z2.object({
2373
+ question: z2.string(),
2374
+ header: z2.string(),
2375
+ options: z2.array(AgentQuestionOptionSchema),
2376
+ multiSelect: z2.boolean().optional()
2528
2377
  });
2529
- var ListProjectSubtasksRequestSchema = z2.object({
2530
- projectId: z2.string(),
2531
- taskId: z2.string()
2378
+ var AskUserQuestionRequestSchema = z2.object({
2379
+ sessionId: z2.string(),
2380
+ question: z2.string().min(1),
2381
+ requestId: z2.string().min(1),
2382
+ questions: z2.array(AgentQuestionSchema).min(1)
2532
2383
  });
2533
- var CreateProjectSubtaskRequestSchema = z2.object({
2534
- projectId: z2.string(),
2535
- parentTaskId: z2.string(),
2536
- title: z2.string().min(1),
2537
- description: z2.string().optional(),
2538
- plan: z2.string().optional(),
2539
- ordinal: z2.number().int().nonnegative().optional(),
2540
- storyPointValue: z2.number().int().positive().optional(),
2541
- followParentStatus: z2.boolean().optional(),
2542
- /** Sibling subtask ids or slugs this subtask blocks on (explicit dependency
2543
- * metadata — preferred over encoding order in plan text / ordinal). */
2544
- dependsOn: z2.array(z2.string().min(1)).max(32).optional(),
2545
- requestingUserId: z2.string().optional()
2384
+ var EmitAgentEventRequestSchema = z2.object({
2385
+ sessionId: z2.string(),
2386
+ events: z2.array(AgentEventSchema).max(500)
2546
2387
  });
2547
- var UpdateProjectSubtaskRequestSchema = z2.object({
2548
- projectId: z2.string(),
2549
- subtaskId: z2.string(),
2550
- title: z2.string().optional(),
2551
- description: z2.string().optional(),
2552
- plan: z2.string().optional(),
2553
- status: z2.string().optional(),
2554
- ordinal: z2.number().int().nonnegative().optional(),
2555
- storyPointValue: z2.number().int().positive().optional(),
2556
- followParentStatus: z2.boolean().optional(),
2557
- requestingUserId: z2.string().optional()
2388
+ var RefreshGithubTokenRequestSchema = z2.object({
2389
+ sessionId: z2.string()
2558
2390
  });
2559
- var DeleteProjectSubtaskRequestSchema = z2.object({
2560
- projectId: z2.string(),
2561
- subtaskId: z2.string(),
2562
- requestingUserId: z2.string().optional()
2391
+ var ReportReviewSpawnFailureRequestSchema = z2.object({
2392
+ sessionId: z2.string(),
2393
+ reviewSessionId: z2.string(),
2394
+ error: z2.string().max(2e3).optional()
2563
2395
  });
2564
- var GetProjectTaskChatRequestSchema = z2.object({
2565
- projectId: z2.string(),
2396
+ var SpawnTaskSessionRequestSchema = z2.object({
2566
2397
  taskId: z2.string(),
2567
- limit: z2.number().int().positive().optional().default(20)
2398
+ kind: z2.enum(["tui", "shell"])
2568
2399
  });
2569
- var AddProjectTaskDependencyRequestSchema = z2.object({
2570
- projectId: z2.string(),
2571
- taskId: z2.string(),
2572
- dependsOnSlugOrId: z2.string(),
2573
- requestingUserId: z2.string().optional()
2400
+ var SpawnTaskReviewRequestSchema = z2.object({
2401
+ taskId: z2.string()
2574
2402
  });
2575
- var RemoveProjectTaskDependencyRequestSchema = z2.object({
2576
- projectId: z2.string(),
2577
- taskId: z2.string(),
2578
- dependsOnSlugOrId: z2.string(),
2579
- requestingUserId: z2.string().optional()
2403
+ var ReportSessionSpawnFailureRequestSchema = z2.object({
2404
+ sessionId: z2.string(),
2405
+ spawnedSessionId: z2.string(),
2406
+ error: z2.string().max(2e3).optional()
2580
2407
  });
2581
- var VoteProjectSuggestionRequestSchema = z2.object({
2582
- projectId: z2.string(),
2583
- suggestionId: z2.string(),
2584
- value: z2.union([z2.literal(1), z2.literal(-1)]),
2585
- requestingUserId: z2.string().optional()
2408
+ var RefreshGithubTokenResponseSchema = z2.object({
2409
+ token: z2.string()
2586
2410
  });
2587
- var GetProjectTaskDependenciesRequestSchema = z2.object({
2588
- projectId: z2.string(),
2589
- taskId: z2.string()
2411
+ var PTY_FRAME_MAX_CHARS = 256 * 1024;
2412
+ var PTY_MAX_DIMENSION = 1e3;
2413
+ var PtyOutputRequestSchema = z2.object({
2414
+ sessionId: z2.string(),
2415
+ data: z2.string().max(PTY_FRAME_MAX_CHARS),
2416
+ cols: z2.number().int().positive().max(PTY_MAX_DIMENSION).optional(),
2417
+ rows: z2.number().int().positive().max(PTY_MAX_DIMENSION).optional()
2418
+ });
2419
+ var PtyEndedRequestSchema = z2.object({
2420
+ sessionId: z2.string()
2421
+ });
2422
+ var PtyInputRequestSchema = z2.object({
2423
+ sessionId: z2.string(),
2424
+ data: z2.string().max(PTY_FRAME_MAX_CHARS)
2425
+ });
2426
+ var PtyResizeRequestSchema = z2.object({
2427
+ sessionId: z2.string(),
2428
+ cols: z2.number().int().positive().max(PTY_MAX_DIMENSION),
2429
+ rows: z2.number().int().positive().max(PTY_MAX_DIMENSION)
2430
+ });
2431
+ var PtyAttachRequestSchema = z2.object({
2432
+ sessionId: z2.string()
2433
+ });
2434
+ var PtyChatEventPayloadSchema = z2.discriminatedUnion("kind", [
2435
+ z2.object({
2436
+ kind: z2.literal("init"),
2437
+ model: z2.string().max(200),
2438
+ claudeSessionId: z2.string().max(100).optional()
2439
+ }),
2440
+ z2.object({ kind: z2.literal("user_text"), text: z2.string().max(16384) }),
2441
+ z2.object({ kind: z2.literal("assistant_text"), text: z2.string().max(16384) }),
2442
+ z2.object({
2443
+ kind: z2.literal("tool_use"),
2444
+ name: z2.string().max(200),
2445
+ // Compact preview: JSON.stringify(input) truncated agent-side.
2446
+ input: z2.string().max(2e3)
2447
+ }),
2448
+ z2.object({ kind: z2.literal("turn_end") })
2449
+ ]);
2450
+ var PtyChatEventRequestSchema = z2.object({
2451
+ sessionId: z2.string(),
2452
+ event: PtyChatEventPayloadSchema
2590
2453
  });
2591
- var ListProjectTaskFilesRequestSchema = z2.object({
2592
- projectId: z2.string(),
2593
- taskId: z2.string()
2454
+ var PtyChatAttachRequestSchema = z2.object({
2455
+ sessionId: z2.string()
2594
2456
  });
2595
- var GetProjectAttachmentRequestSchema = z2.object({
2596
- projectId: z2.string(),
2597
- taskId: z2.string(),
2598
- fileId: z2.string(),
2599
- /** Byte offset into text content (paging large logs/JSON). Default 0. */
2600
- offset: z2.number().int().nonnegative().optional(),
2601
- /** Max bytes of text content to return from `offset`. Server default applies. */
2602
- maxBytes: z2.number().int().positive().optional()
2457
+ var CreatePRResponseSchema = z2.object({
2458
+ prNumber: z2.number().int().positive(),
2459
+ prUrl: z2.string().url()
2603
2460
  });
2604
- var RequestProjectFileUploadRequestSchema = z2.object({
2605
- projectId: z2.string(),
2606
- taskId: z2.string(),
2607
- fileName: z2.string().min(1).max(255),
2608
- mimeType: z2.string().min(1).max(128),
2609
- fileSize: z2.number().int().positive().max(MAX_FILE_SIZE_BYTES),
2610
- requestingUserId: z2.string().optional()
2461
+ var PostToChatResponseSchema = z2.object({
2462
+ messageId: z2.string()
2611
2463
  });
2612
- var ConfirmProjectFileUploadRequestSchema = z2.object({
2613
- projectId: z2.string(),
2464
+ var UpdateTaskStatusResponseSchema = z2.object({
2614
2465
  taskId: z2.string(),
2615
- fileId: z2.string(),
2616
- /** When set, the attachment is also posted to the task chat with this text. */
2617
- comment: z2.string().max(2e3).optional(),
2618
- requestingUserId: z2.string().optional()
2466
+ status: z2.string()
2619
2467
  });
2620
- var CreateProjectPullRequestRequestSchema = z2.object({
2621
- projectId: z2.string(),
2622
- taskId: z2.string(),
2623
- title: z2.string().min(1),
2624
- body: z2.string(),
2625
- head: z2.string().optional(),
2626
- base: z2.string().optional(),
2627
- requestingUserId: z2.string().optional()
2468
+ var StoreSessionIdResponseSchema = z2.object({
2469
+ success: z2.boolean()
2628
2470
  });
2629
- var ListProjectMembersRequestSchema = z2.object({
2630
- projectId: z2.string()
2471
+ var HeartbeatResponseSchema = z2.object({
2472
+ acknowledged: z2.boolean()
2631
2473
  });
2632
- var AddProjectTaskReviewerRequestSchema = z2.object({
2633
- projectId: z2.string(),
2634
- taskId: z2.string(),
2635
- userId: z2.string(),
2636
- requestingUserId: z2.string().optional()
2474
+ var SessionStartResponseSchema = z2.object({
2475
+ sessionId: z2.string(),
2476
+ startedAt: z2.string()
2637
2477
  });
2638
- var RemoveProjectTaskReviewerRequestSchema = z2.object({
2639
- projectId: z2.string(),
2640
- taskId: z2.string(),
2641
- userId: z2.string(),
2642
- requestingUserId: z2.string().optional()
2478
+ var SessionStopResponseSchema = z2.object({
2479
+ sessionId: z2.string(),
2480
+ stoppedAt: z2.string()
2643
2481
  });
2644
- var ListProjectManualTestsRequestSchema = z2.object({
2645
- projectId: z2.string(),
2646
- taskId: z2.string()
2482
+ var DeleteSubtaskResponseSchema = z2.object({
2483
+ deleted: z2.boolean()
2647
2484
  });
2648
- var QueryProjectManualTestsRequestSchema = z2.object({
2649
- projectId: z2.string(),
2650
- cardStatuses: z2.array(z2.string()).optional(),
2651
- testStatuses: z2.array(z2.enum(["open", "approved", "rejected"])).optional()
2485
+ var ListAccessibleProjectsRequestSchema = z3.object({
2486
+ pageSize: z3.number().int().positive().max(100).optional().default(100)
2652
2487
  });
2653
- var SetProjectManualTestsRequestSchema = z2.object({
2654
- projectId: z2.string(),
2655
- taskId: z2.string(),
2656
- items: z2.array(z2.object({ title: z2.string().min(1) })).min(1),
2657
- requestingUserId: z2.string().optional()
2488
+ var ListProjectTasksRequestSchema = z3.object({
2489
+ projectId: z3.string(),
2490
+ status: z3.string().optional(),
2491
+ assigneeId: z3.string().optional(),
2492
+ unassigned: z3.boolean().optional(),
2493
+ limit: z3.number().int().positive().optional().default(50)
2494
+ }).refine((p) => !(p.unassigned && p.assigneeId), {
2495
+ message: "Pass either assigneeId or unassigned, not both"
2658
2496
  });
2659
- var EditProjectManualTestRequestSchema = z2.object({
2660
- projectId: z2.string(),
2661
- taskId: z2.string(),
2662
- title: z2.string().min(1),
2663
- newTitle: z2.string().min(1),
2664
- requestingUserId: z2.string().optional()
2497
+ var GetProjectTaskRequestSchema = z3.object({
2498
+ projectId: z3.string(),
2499
+ taskId: z3.string()
2665
2500
  });
2666
- var RemoveProjectManualTestRequestSchema = z2.object({
2667
- projectId: z2.string(),
2668
- taskId: z2.string(),
2669
- title: z2.string().min(1),
2670
- requestingUserId: z2.string().optional()
2501
+ var SearchProjectTasksRequestSchema = z3.object({
2502
+ projectId: z3.string(),
2503
+ tagNames: z3.array(z3.string()).optional(),
2504
+ searchQuery: z3.string().optional(),
2505
+ statusFilters: z3.array(z3.string()).optional(),
2506
+ // Card types to include. Omitted/empty → defaults to ["task"] in the handler so
2507
+ // search doesn't surface incidents/suggestions unless asked. Enum validation lives
2508
+ // at the MCP tool layer (mirrors statusFilters).
2509
+ typeFilters: z3.array(z3.string()).optional(),
2510
+ assigneeId: z3.string().optional(),
2511
+ unassigned: z3.boolean().optional(),
2512
+ limit: z3.number().int().positive().optional().default(20)
2513
+ }).refine((p) => !(p.unassigned && p.assigneeId), {
2514
+ message: "Pass either assigneeId or unassigned, not both"
2671
2515
  });
2672
- var ApproveProjectManualTestRequestSchema = z2.object({
2673
- projectId: z2.string(),
2674
- taskId: z2.string(),
2675
- title: z2.string().min(1),
2676
- requestingUserId: z2.string().optional()
2516
+ var ListProjectTagsRequestSchema = z3.object({
2517
+ projectId: z3.string()
2518
+ });
2519
+ var GetProjectSummaryRequestSchema = z3.object({
2520
+ projectId: z3.string()
2521
+ });
2522
+ var CreateProjectTaskRequestSchema = z3.object({
2523
+ projectId: z3.string(),
2524
+ title: z3.string().min(1),
2525
+ description: z3.string().optional(),
2526
+ plan: z3.string().optional(),
2527
+ status: z3.string().optional(),
2528
+ requestingUserId: z3.string().optional()
2529
+ });
2530
+ var UpdateProjectTaskRequestSchema = z3.object({
2531
+ projectId: z3.string(),
2532
+ taskId: z3.string(),
2533
+ title: z3.string().optional(),
2534
+ description: z3.string().optional(),
2535
+ plan: z3.string().optional(),
2536
+ status: z3.string().optional(),
2537
+ assignedUserId: z3.string().nullish(),
2538
+ requestingUserId: z3.string().optional()
2539
+ });
2540
+ var PostToProjectTaskChatRequestSchema = z3.object({
2541
+ projectId: z3.string(),
2542
+ taskId: z3.string(),
2543
+ content: z3.string(),
2544
+ requestingUserId: z3.string().optional()
2545
+ });
2546
+ var GetProjectTaskCliRequestSchema = z3.object({
2547
+ projectId: z3.string(),
2548
+ taskId: z3.string(),
2549
+ limit: z3.number().int().positive().optional().default(50),
2550
+ source: z3.string().optional()
2551
+ });
2552
+ var GetProjectTaskSessionsRequestSchema = z3.object({
2553
+ projectId: z3.string(),
2554
+ taskId: z3.string()
2555
+ });
2556
+ var QueryProjectGcpLogsRequestSchema = z3.object({
2557
+ projectId: z3.string(),
2558
+ env: z3.enum(["prod", "dev", "claudespace"]).optional(),
2559
+ severity: z3.enum(["DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "CRITICAL", "ALERT", "EMERGENCY"]).optional(),
2560
+ services: z3.array(z3.string().min(1).max(200)).max(25).optional(),
2561
+ sqlInstances: z3.array(z3.string().min(1).max(200)).max(25).optional(),
2562
+ allServices: z3.boolean().optional(),
2563
+ search: z3.string().max(256).optional(),
2564
+ filter: z3.string().max(1e3).optional(),
2565
+ startTime: z3.string().optional(),
2566
+ endTime: z3.string().optional(),
2567
+ limit: z3.number().int().min(1).max(200).optional().default(50),
2568
+ pageToken: z3.string().max(4096).optional()
2569
+ });
2570
+ var StartProjectBuildRequestSchema = z3.object({
2571
+ projectId: z3.string(),
2572
+ taskId: z3.string(),
2573
+ requestingUserId: z3.string().optional()
2574
+ });
2575
+ var StopProjectBuildRequestSchema = z3.object({
2576
+ projectId: z3.string(),
2577
+ taskId: z3.string(),
2578
+ requestingUserId: z3.string().optional()
2579
+ });
2580
+ var StartProjectWorkspaceRequestSchema = z3.object({
2581
+ projectId: z3.string(),
2582
+ requestingUserId: z3.string().optional()
2583
+ });
2584
+ var StopProjectWorkspaceRequestSchema = z3.object({
2585
+ projectId: z3.string(),
2586
+ destroy: z3.boolean().optional(),
2587
+ requestingUserId: z3.string().optional()
2588
+ });
2589
+ var ListMyLiveSessionsRequestSchema = z3.object({
2590
+ projectId: z3.string(),
2591
+ /** Admin-only: list another member's sessions instead of the caller's. */
2592
+ targetUserId: z3.string().optional()
2677
2593
  });
2678
- var RejectProjectManualTestRequestSchema = z2.object({
2679
- projectId: z2.string(),
2680
- taskId: z2.string(),
2681
- title: z2.string().min(1),
2682
- reason: z2.string().min(1).max(2e3),
2683
- requestingUserId: z2.string().optional()
2594
+ var ListProjectSessionGroupsRequestSchema = z3.object({
2595
+ projectId: z3.string()
2684
2596
  });
2685
- var CreateProjectSuggestionRequestSchema = z2.object({
2686
- projectId: z2.string(),
2687
- title: z2.string().min(1),
2688
- description: z2.string().optional(),
2689
- tagNames: z2.array(z2.string()).optional(),
2690
- requestingUserId: z2.string().optional()
2597
+ var GetProjectAvailableTuisRequestSchema = z3.object({
2598
+ projectId: z3.string()
2599
+ });
2600
+ var StartAdhocSessionRequestSchema = z3.object({
2601
+ projectId: z3.string(),
2602
+ label: z3.string().max(200).optional(),
2603
+ /** Coding-agent key to launch under — validated pick-time (ownership + TUI availability) in the handler. */
2604
+ codingAgentKeyId: z3.string().optional(),
2605
+ /**
2606
+ * Session role. Constrained: other task-less modes fall through to the pm
2607
+ * runner in the pod entrypoint, and "review" would crash without a task.
2608
+ */
2609
+ mode: z3.enum(["adhoc", "pm"]).optional(),
2610
+ /** Base branch to check out (defaults to the project's dev branch). */
2611
+ branch: z3.string().max(300).optional(),
2612
+ requestingUserId: z3.string().optional()
2613
+ });
2614
+ var StopAdhocSessionRequestSchema = z3.object({
2615
+ projectId: z3.string(),
2616
+ workspaceId: z3.string(),
2617
+ destroy: z3.boolean().optional(),
2618
+ requestingUserId: z3.string().optional()
2619
+ });
2620
+ var ResumeAdhocSessionRequestSchema = z3.object({
2621
+ projectId: z3.string(),
2622
+ workspaceId: z3.string(),
2623
+ requestingUserId: z3.string().optional()
2624
+ });
2625
+ var CreateProjectReleaseRequestSchema = z3.object({
2626
+ projectId: z3.string(),
2627
+ taskIds: z3.array(z3.string()).optional(),
2628
+ requestingUserId: z3.string().optional()
2629
+ });
2630
+ var ApproveProjectMergePRRequestSchema = z3.object({
2631
+ projectId: z3.string(),
2632
+ childTaskId: z3.string(),
2633
+ requestingUserId: z3.string().optional()
2634
+ });
2635
+ var ListProjectSubtasksRequestSchema = z3.object({
2636
+ projectId: z3.string(),
2637
+ taskId: z3.string()
2638
+ });
2639
+ var CreateProjectSubtaskRequestSchema = z3.object({
2640
+ projectId: z3.string(),
2641
+ parentTaskId: z3.string(),
2642
+ title: z3.string().min(1),
2643
+ description: z3.string().optional(),
2644
+ plan: z3.string().optional(),
2645
+ ordinal: z3.number().int().nonnegative().optional(),
2646
+ storyPointValue: z3.number().int().positive().optional(),
2647
+ followParentStatus: z3.boolean().optional(),
2648
+ /** Sibling subtask ids or slugs this subtask blocks on (explicit dependency
2649
+ * metadata — preferred over encoding order in plan text / ordinal). */
2650
+ dependsOn: z3.array(z3.string().min(1)).max(32).optional(),
2651
+ requestingUserId: z3.string().optional()
2652
+ });
2653
+ var UpdateProjectSubtaskRequestSchema = z3.object({
2654
+ projectId: z3.string(),
2655
+ subtaskId: z3.string(),
2656
+ title: z3.string().optional(),
2657
+ description: z3.string().optional(),
2658
+ plan: z3.string().optional(),
2659
+ status: z3.string().optional(),
2660
+ ordinal: z3.number().int().nonnegative().optional(),
2661
+ storyPointValue: z3.number().int().positive().optional(),
2662
+ followParentStatus: z3.boolean().optional(),
2663
+ requestingUserId: z3.string().optional()
2664
+ });
2665
+ var DeleteProjectSubtaskRequestSchema = z3.object({
2666
+ projectId: z3.string(),
2667
+ subtaskId: z3.string(),
2668
+ requestingUserId: z3.string().optional()
2669
+ });
2670
+ var GetProjectTaskChatRequestSchema = z3.object({
2671
+ projectId: z3.string(),
2672
+ taskId: z3.string(),
2673
+ limit: z3.number().int().positive().optional().default(20)
2674
+ });
2675
+ var AddProjectTaskDependencyRequestSchema = z3.object({
2676
+ projectId: z3.string(),
2677
+ taskId: z3.string(),
2678
+ dependsOnSlugOrId: z3.string(),
2679
+ requestingUserId: z3.string().optional()
2680
+ });
2681
+ var RemoveProjectTaskDependencyRequestSchema = z3.object({
2682
+ projectId: z3.string(),
2683
+ taskId: z3.string(),
2684
+ dependsOnSlugOrId: z3.string(),
2685
+ requestingUserId: z3.string().optional()
2686
+ });
2687
+ var VoteProjectSuggestionRequestSchema = z3.object({
2688
+ projectId: z3.string(),
2689
+ suggestionId: z3.string(),
2690
+ value: z3.union([z3.literal(1), z3.literal(-1)]),
2691
+ requestingUserId: z3.string().optional()
2692
+ });
2693
+ var GetProjectTaskDependenciesRequestSchema = z3.object({
2694
+ projectId: z3.string(),
2695
+ taskId: z3.string()
2696
+ });
2697
+ var ListProjectTaskFilesRequestSchema = z3.object({
2698
+ projectId: z3.string(),
2699
+ taskId: z3.string()
2700
+ });
2701
+ var GetProjectAttachmentRequestSchema = z3.object({
2702
+ projectId: z3.string(),
2703
+ taskId: z3.string(),
2704
+ fileId: z3.string(),
2705
+ /** Byte offset into text content (paging large logs/JSON). Default 0. */
2706
+ offset: z3.number().int().nonnegative().optional(),
2707
+ /** Max bytes of text content to return from `offset`. Server default applies. */
2708
+ maxBytes: z3.number().int().positive().optional()
2709
+ });
2710
+ var RequestProjectFileUploadRequestSchema = z3.object({
2711
+ projectId: z3.string(),
2712
+ taskId: z3.string(),
2713
+ fileName: z3.string().min(1).max(255),
2714
+ mimeType: z3.string().min(1).max(128),
2715
+ fileSize: z3.number().int().positive().max(MAX_FILE_SIZE_BYTES),
2716
+ requestingUserId: z3.string().optional()
2717
+ });
2718
+ var ConfirmProjectFileUploadRequestSchema = z3.object({
2719
+ projectId: z3.string(),
2720
+ taskId: z3.string(),
2721
+ fileId: z3.string(),
2722
+ /** When set, the attachment is also posted to the task chat with this text. */
2723
+ comment: z3.string().max(2e3).optional(),
2724
+ requestingUserId: z3.string().optional()
2725
+ });
2726
+ var CreateProjectPullRequestRequestSchema = z3.object({
2727
+ projectId: z3.string(),
2728
+ taskId: z3.string(),
2729
+ title: z3.string().min(1),
2730
+ body: z3.string(),
2731
+ head: z3.string().optional(),
2732
+ base: z3.string().optional(),
2733
+ requestingUserId: z3.string().optional()
2734
+ });
2735
+ var ListProjectMembersRequestSchema = z3.object({
2736
+ projectId: z3.string()
2737
+ });
2738
+ var AddProjectTaskReviewerRequestSchema = z3.object({
2739
+ projectId: z3.string(),
2740
+ taskId: z3.string(),
2741
+ userId: z3.string(),
2742
+ requestingUserId: z3.string().optional()
2743
+ });
2744
+ var RemoveProjectTaskReviewerRequestSchema = z3.object({
2745
+ projectId: z3.string(),
2746
+ taskId: z3.string(),
2747
+ userId: z3.string(),
2748
+ requestingUserId: z3.string().optional()
2749
+ });
2750
+ var ListProjectManualTestsRequestSchema = z3.object({
2751
+ projectId: z3.string(),
2752
+ taskId: z3.string()
2753
+ });
2754
+ var QueryProjectManualTestsRequestSchema = z3.object({
2755
+ projectId: z3.string(),
2756
+ cardStatuses: z3.array(z3.string()).optional(),
2757
+ testStatuses: z3.array(z3.enum(["open", "approved", "rejected"])).optional()
2758
+ });
2759
+ var SetProjectManualTestsRequestSchema = z3.object({
2760
+ projectId: z3.string(),
2761
+ taskId: z3.string(),
2762
+ items: z3.array(z3.object({ title: z3.string().min(1) })).min(1),
2763
+ requestingUserId: z3.string().optional()
2764
+ });
2765
+ var EditProjectManualTestRequestSchema = z3.object({
2766
+ projectId: z3.string(),
2767
+ taskId: z3.string(),
2768
+ title: z3.string().min(1),
2769
+ newTitle: z3.string().min(1),
2770
+ requestingUserId: z3.string().optional()
2771
+ });
2772
+ var RemoveProjectManualTestRequestSchema = z3.object({
2773
+ projectId: z3.string(),
2774
+ taskId: z3.string(),
2775
+ title: z3.string().min(1),
2776
+ requestingUserId: z3.string().optional()
2777
+ });
2778
+ var ApproveProjectManualTestRequestSchema = z3.object({
2779
+ projectId: z3.string(),
2780
+ taskId: z3.string(),
2781
+ title: z3.string().min(1),
2782
+ requestingUserId: z3.string().optional()
2783
+ });
2784
+ var RejectProjectManualTestRequestSchema = z3.object({
2785
+ projectId: z3.string(),
2786
+ taskId: z3.string(),
2787
+ title: z3.string().min(1),
2788
+ reason: z3.string().min(1).max(2e3),
2789
+ requestingUserId: z3.string().optional()
2790
+ });
2791
+ var CreateProjectSuggestionRequestSchema = z3.object({
2792
+ projectId: z3.string(),
2793
+ title: z3.string().min(1),
2794
+ description: z3.string().optional(),
2795
+ tagNames: z3.array(z3.string()).optional(),
2796
+ requestingUserId: z3.string().optional()
2691
2797
  });
2692
2798
  var AGENT_STATUS_REASON_USER_QUESTION = "user_question";
2693
2799
  var TASK_CHAT_HISTORY_LIMIT = 20;
@@ -3816,7 +3922,7 @@ var PtyOutputCoalescer = class {
3816
3922
 
3817
3923
  // src/harness/pty/tool-server.ts
3818
3924
  import { createServer as createServer2 } from "http";
3819
- import { z as z3 } from "zod";
3925
+ import { z as z4 } from "zod";
3820
3926
  import { writeFile as writeFile3 } from "fs/promises";
3821
3927
  import { join as join2 } from "path";
3822
3928
  import { randomBytes } from "crypto";
@@ -3873,7 +3979,7 @@ var PtyToolServer = class {
3873
3979
  const mcp = new McpServer({ name: this.name, version: "1.0.0" });
3874
3980
  const register = mcp.registerTool.bind(mcp);
3875
3981
  for (const tool2 of this.tools) {
3876
- const inputSchema = tool2.strict ? z3.strictObject(tool2.schema) : tool2.schema;
3982
+ const inputSchema = tool2.strict ? z4.strictObject(tool2.schema) : tool2.schema;
3877
3983
  register(
3878
3984
  tool2.name,
3879
3985
  {
@@ -4156,12 +4262,12 @@ var defaultSleep = (ms) => new Promise((resolve) => {
4156
4262
  setTimeout(resolve, ms);
4157
4263
  });
4158
4264
  async function writeWithReadBackRetry(io2, contents, delaysMs = READ_BACK_DELAYS_MS) {
4159
- const sleep4 = io2.sleep ?? defaultSleep;
4265
+ const sleep2 = io2.sleep ?? defaultSleep;
4160
4266
  for (let attempt = 0; ; attempt++) {
4161
4267
  await io2.write(contents);
4162
4268
  if (await io2.read() === contents) return true;
4163
4269
  if (attempt >= delaysMs.length) return false;
4164
- await sleep4(delaysMs[attempt]);
4270
+ await sleep2(delaysMs[attempt]);
4165
4271
  }
4166
4272
  }
4167
4273
  function fsWriteIo(path4, mode) {
@@ -4501,11 +4607,6 @@ function renderPromptContentText(content) {
4501
4607
  return JSON.stringify(block);
4502
4608
  }).join("\n\n");
4503
4609
  }
4504
- function sleep3(ms) {
4505
- return new Promise((resolve) => {
4506
- setTimeout(resolve, ms);
4507
- });
4508
- }
4509
4610
  async function transcriptSize(path4) {
4510
4611
  try {
4511
4612
  return (await stat2(path4)).size;
@@ -5004,7 +5105,7 @@ var PtySession = class {
5004
5105
  if (text === "" && !this.adapter.capabilities.prefill) return;
5005
5106
  this.writeStdin(this.adapter.encodePromptBytes(text));
5006
5107
  if (this.turn.promptDelivery === "prefill") return;
5007
- await sleep3(resolveSubmitSettleMs());
5108
+ await sleep(resolveSubmitSettleMs());
5008
5109
  if (this._toreDown) return;
5009
5110
  this.writeStdin("\r");
5010
5111
  if (this.adapter.capabilities.structuredEvents) this.armSubmitNudge();
@@ -6814,7 +6915,7 @@ async function buildInitialPrompt(mode, context, isAuto, agentMode) {
6814
6915
  }
6815
6916
 
6816
6917
  // src/tools/task-context-tools.ts
6817
- import { z as z4 } from "zod";
6918
+ import { z as z5 } from "zod";
6818
6919
 
6819
6920
  // src/tools/helpers.ts
6820
6921
  function textResult(text) {
@@ -6848,8 +6949,8 @@ function buildReadTaskChatTool(connection) {
6848
6949
  "read_task_chat",
6849
6950
  "Read recent human/user chat messages for a task. Omit task_id for the current task; pass a child ID for a child's chat. For agent logs use get_execution_logs.",
6850
6951
  {
6851
- limit: z4.number().optional().describe("Number of recent messages to fetch (default 20)"),
6852
- task_id: z4.string().optional().describe("Child task ID to read chat from. Omit to read the current task's chat.")
6952
+ limit: z5.number().optional().describe("Number of recent messages to fetch (default 20)"),
6953
+ task_id: z5.string().optional().describe("Child task ID to read chat from. Omit to read the current task's chat.")
6853
6954
  },
6854
6955
  async ({ limit, task_id }) => {
6855
6956
  try {
@@ -6893,7 +6994,7 @@ function buildGetTaskTool(connection) {
6893
6994
  "get_task",
6894
6995
  "Look up any task by slug or ID. Returns JSON with id, slug, title, description, plan, status, branch, githubPRNumber, githubPRUrl, storyPoints. For children use list_subtasks.",
6895
6996
  {
6896
- slug_or_id: z4.string().describe("The task slug (e.g. 'my-task') or CUID")
6997
+ slug_or_id: z5.string().describe("The task slug (e.g. 'my-task') or CUID")
6897
6998
  },
6898
6999
  async ({ slug_or_id }) => {
6899
7000
  try {
@@ -6916,9 +7017,9 @@ function buildGetExecutionLogsTool(connection) {
6916
7017
  "get_execution_logs",
6917
7018
  "Read CLI execution logs \u2014 agent reasoning, tool calls, and setup/dev-server output. Filter via source='agent' or 'application'. For human chat use read_task_chat.",
6918
7019
  {
6919
- task_id: z4.string().optional().describe("Task ID or slug. Omit to read logs from the current task."),
6920
- source: z4.enum(["agent", "application"]).optional().describe("Filter by log source. Omit for all logs."),
6921
- limit: z4.number().optional().describe("Max number of log entries to return (default 50, max 500).")
7020
+ task_id: z5.string().optional().describe("Task ID or slug. Omit to read logs from the current task."),
7021
+ source: z5.enum(["agent", "application"]).optional().describe("Filter by log source. Omit for all logs."),
7022
+ limit: z5.number().optional().describe("Max number of log entries to return (default 50, max 500).")
6922
7023
  },
6923
7024
  async ({ task_id, source, limit }) => {
6924
7025
  try {
@@ -6978,7 +7079,7 @@ function buildGetAttachmentTool(connection) {
6978
7079
  return defineTool(
6979
7080
  "get_attachment",
6980
7081
  "Fetch one task file's content plus metadata by file ID. Call list_task_files first to discover IDs and check sizes \u2014 large binaries may be truncated by the service's size limit.",
6981
- { fileId: z4.string().describe("The file ID to retrieve") },
7082
+ { fileId: z5.string().describe("The file ID to retrieve") },
6982
7083
  async ({ fileId }) => {
6983
7084
  try {
6984
7085
  const file = await connection.call("getTaskFile", {
@@ -7016,7 +7117,7 @@ function buildTaskContextTools(connection) {
7016
7117
  }
7017
7118
 
7018
7119
  // src/tools/dependency-suggestion-tools.ts
7019
- import { z as z5 } from "zod";
7120
+ import { z as z6 } from "zod";
7020
7121
  function buildGetDependenciesTool(connection) {
7021
7122
  return defineTool(
7022
7123
  "get_dependencies",
@@ -7042,10 +7143,10 @@ function buildGetSuggestionsTool(connection) {
7042
7143
  "get_suggestions",
7043
7144
  "List project suggestions sorted by vote score. Filter by status or cap with limit (default 20). Suggestions are project-level ideas, not tasks \u2014 use get_task for tasks.",
7044
7145
  {
7045
- status: z5.string().optional().describe(
7146
+ status: z6.string().optional().describe(
7046
7147
  "Filter by status: Planning, Open, InProgress, ReviewPR, ReviewDev, ReviewLive, Complete, Cancelled"
7047
7148
  ),
7048
- limit: z5.number().int().min(1).max(100).optional().describe("Max results (default 20)")
7149
+ limit: z6.number().int().min(1).max(100).optional().describe("Max results (default 20)")
7049
7150
  },
7050
7151
  async ({ status, limit }) => {
7051
7152
  try {
@@ -7069,14 +7170,14 @@ function buildGetSuggestionsTool(connection) {
7069
7170
  }
7070
7171
 
7071
7172
  // src/tools/mutation-tools.ts
7072
- import { z as z6 } from "zod";
7173
+ import { z as z7 } from "zod";
7073
7174
  function buildPostToChatTool(connection) {
7074
7175
  return defineTool(
7075
7176
  "post_to_chat",
7076
7177
  "Post a message to the task chat for the team to see. Your turn output is NOT shown in chat, so this is the only way the team sees your status, summaries, and questions. Omit task_id to post to the current task's chat; pass a child's ID to message its chat.",
7077
7178
  {
7078
- message: z6.string().describe("The message to post to the team"),
7079
- task_id: z6.string().optional().describe("Child task ID to post to. Omit to post to the current task's chat.")
7179
+ message: z7.string().describe("The message to post to the team"),
7180
+ task_id: z7.string().optional().describe("Child task ID to post to. Omit to post to the current task's chat.")
7080
7181
  },
7081
7182
  async ({ message, task_id }) => {
7082
7183
  try {
@@ -7114,8 +7215,8 @@ function buildForceUpdateTaskStatusTool(connection) {
7114
7215
  "force_update_task_status",
7115
7216
  "EMERGENCY ONLY: force-override a task's Kanban status. Use when an automatic transition failed and the task is wedged. Normal flow transitions status automatically.",
7116
7217
  {
7117
- status: z6.enum(["InProgress", "ReviewPR", "ReviewDev", "Complete"]).describe("The new status for the task"),
7118
- task_id: z6.string().optional().describe("Child task ID to update. Omit to update the current task.")
7218
+ status: z7.enum(["InProgress", "ReviewPR", "ReviewDev", "Complete"]).describe("The new status for the task"),
7219
+ task_id: z7.string().optional().describe("Child task ID to update. Omit to update the current task.")
7119
7220
  },
7120
7221
  async ({ status, task_id }) => {
7121
7222
  try {
@@ -7146,18 +7247,18 @@ function buildCreatePullRequestTool(connection, config) {
7146
7247
  "create_pull_request",
7147
7248
  "Create a GitHub PR for this task. Auto-stages, commits (commitMessage or title default), pushes to origin, then opens the PR. Always use this instead of gh CLI or raw git.",
7148
7249
  {
7149
- title: z6.string().describe("The PR title"),
7150
- body: z6.string().describe("The PR description/body in markdown"),
7151
- branch: z6.string().optional().describe(
7250
+ title: z7.string().describe("The PR title"),
7251
+ body: z7.string().describe("The PR description/body in markdown"),
7252
+ branch: z7.string().optional().describe(
7152
7253
  "The head branch name for the PR. If the task doesn't have a branch set, this will be used. Defaults to the task's existing branch."
7153
7254
  ),
7154
- baseBranch: z6.string().optional().describe(
7255
+ baseBranch: z7.string().optional().describe(
7155
7256
  "The base branch to target for the PR (e.g. 'main', 'develop'). Defaults to the project's configured dev branch."
7156
7257
  ),
7157
- commitMessage: z6.string().optional().describe(
7258
+ commitMessage: z7.string().optional().describe(
7158
7259
  "Commit message for staging uncommitted changes. If not provided, a default message based on the PR title will be used."
7159
7260
  ),
7160
- skipVerify: z6.boolean().optional().describe(
7261
+ skipVerify: z7.boolean().optional().describe(
7161
7262
  "Controls the local pre-push quality gate (lint/typecheck/test). Defaults to true (--no-verify): the push skips the local gate because you should run gates yourself before opening the PR and CI re-runs them on the resulting PR. Running the full gate synchronously during the push would block the agent's event loop long enough to drop the Conveyor socket connection. Pass false to force the local pre-push hook to run."
7162
7263
  )
7163
7264
  },
@@ -7239,7 +7340,7 @@ function buildAddDependencyTool(connection) {
7239
7340
  "add_dependency",
7240
7341
  "Add a blocking dependency \u2014 this task cannot start until the named task is merged to dev. For post-task follow-ups use create_follow_up_task instead.",
7241
7342
  {
7242
- depends_on_slug_or_id: z6.string().describe("Slug or ID of the task this task depends on")
7343
+ depends_on_slug_or_id: z7.string().describe("Slug or ID of the task this task depends on")
7243
7344
  },
7244
7345
  async ({ depends_on_slug_or_id }) => {
7245
7346
  try {
@@ -7261,7 +7362,7 @@ function buildRemoveDependencyTool(connection) {
7261
7362
  "remove_dependency",
7262
7363
  "Remove a previously added dependency from this task. When to use: the dependency was added in error or is no longer relevant. Returns: confirmation string.",
7263
7364
  {
7264
- depends_on_slug_or_id: z6.string().describe("Slug or ID of the task to remove as dependency")
7365
+ depends_on_slug_or_id: z7.string().describe("Slug or ID of the task to remove as dependency")
7265
7366
  },
7266
7367
  async ({ depends_on_slug_or_id }) => {
7267
7368
  try {
@@ -7283,10 +7384,10 @@ function buildCreateFollowUpTaskTool(connection) {
7283
7384
  "create_follow_up_task",
7284
7385
  "Create a follow-up task that depends on the current task. Use for out-of-scope work or cleanup that should land after this task merges. For blockers use add_dependency.",
7285
7386
  {
7286
- title: z6.string().describe("Follow-up task title"),
7287
- description: z6.string().optional().describe("Brief description of the follow-up work"),
7288
- plan: z6.string().optional().describe("Implementation plan if known"),
7289
- story_point_value: z6.number().optional().describe("Story point estimate (1=Common, 2=Magic, 3=Rare, 5=Unique)")
7387
+ title: z7.string().describe("Follow-up task title"),
7388
+ description: z7.string().optional().describe("Brief description of the follow-up work"),
7389
+ plan: z7.string().optional().describe("Implementation plan if known"),
7390
+ story_point_value: z7.number().optional().describe("Story point estimate (1=Common, 2=Magic, 3=Rare, 5=Unique)")
7290
7391
  },
7291
7392
  async ({ title, description, plan, story_point_value }) => {
7292
7393
  try {
@@ -7313,11 +7414,11 @@ function buildCreateSuggestionTool(connection) {
7313
7414
  "create_suggestion",
7314
7415
  "Suggest a feature, improvement, rule, or idea for the project. Duplicates are deduped and your upvote is recorded. For actionable work on this task open a follow-up task.",
7315
7416
  {
7316
- title: z6.string().describe("Short title for the suggestion"),
7317
- description: z6.string().optional().describe(
7417
+ title: z7.string().describe("Short title for the suggestion"),
7418
+ description: z7.string().optional().describe(
7318
7419
  "1-2 sentence description of what should change and why. Keep concise and project-focused."
7319
7420
  ),
7320
- tag_names: z6.array(z6.string()).optional().describe("Tag names to categorize the suggestion")
7421
+ tag_names: z7.array(z7.string()).optional().describe("Tag names to categorize the suggestion")
7321
7422
  },
7322
7423
  async ({ title, description, tag_names }) => {
7323
7424
  try {
@@ -7346,8 +7447,8 @@ function buildVoteSuggestionTool(connection) {
7346
7447
  "vote_suggestion",
7347
7448
  "Vote +1 or -1 on a project suggestion. Use to express support or disagreement with a specific suggestion returned by get_suggestions.",
7348
7449
  {
7349
- suggestion_id: z6.string().describe("The suggestion ID to vote on"),
7350
- value: z6.number().refine((v) => v === 1 || v === -1, { message: "Value must be 1 or -1" }).describe("+1 to upvote, -1 to downvote")
7450
+ suggestion_id: z7.string().describe("The suggestion ID to vote on"),
7451
+ value: z7.number().refine((v) => v === 1 || v === -1, { message: "Value must be 1 or -1" }).describe("+1 to upvote, -1 to downvote")
7351
7452
  },
7352
7453
  async ({ suggestion_id, value }) => {
7353
7454
  try {
@@ -7380,7 +7481,7 @@ function buildMutationTools(connection, config) {
7380
7481
  // src/tools/attachment-tools.ts
7381
7482
  import { readFile as readFile3, stat as stat4 } from "fs/promises";
7382
7483
  import { basename, extname, isAbsolute, join as join5 } from "path";
7383
- import { z as z7 } from "zod";
7484
+ import { z as z8 } from "zod";
7384
7485
  var IMAGE_MIME_BY_EXT = {
7385
7486
  ".png": "image/png",
7386
7487
  ".jpg": "image/jpeg",
@@ -7393,8 +7494,8 @@ function buildUploadAttachmentTool(connection, config) {
7393
7494
  "upload_attachment",
7394
7495
  "Upload an image file (e.g. a Playwright screenshot) as a task attachment AND post it to the task chat in one step \u2014 no follow-up post_to_chat call needed. Supports png/jpg/gif/webp.",
7395
7496
  {
7396
- path: z7.string().describe("Path to the image file \u2014 absolute, or relative to the workspace root"),
7397
- title: z7.string().optional().describe("Short caption posted with the image (defaults to the file name)")
7497
+ path: z8.string().describe("Path to the image file \u2014 absolute, or relative to the workspace root"),
7498
+ title: z8.string().optional().describe("Short caption posted with the image (defaults to the file name)")
7398
7499
  },
7399
7500
  async ({ path: path4, title }) => {
7400
7501
  try {
@@ -7450,7 +7551,7 @@ function buildUploadAttachmentTool(connection, config) {
7450
7551
  }
7451
7552
 
7452
7553
  // src/tools/checklist-tools.ts
7453
- import { z as z8 } from "zod";
7554
+ import { z as z9 } from "zod";
7454
7555
  function buildListManualTestsTool(connection) {
7455
7556
  return defineTool(
7456
7557
  "list_manual_tests",
@@ -7502,8 +7603,8 @@ function buildQueryManualTestsTool(connection) {
7502
7603
  "query_manual_tests",
7503
7604
  "Query manual tests across many tasks in this project, grouped by task. Filter by card status (ReviewDev, ReviewLive, Complete, ...) and/or test status (open | approved | rejected). Use to answer 'show all OPEN manual tests in ReviewDev' or 'show all REJECTED manual tests with the failing reason'. With no filters it defaults to the needs-attention view: open+rejected tests on ReviewDev/ReviewLive cards.",
7504
7605
  {
7505
- cardStatuses: z8.array(z8.string()).optional().describe('Filter tasks by card status, e.g. ["ReviewDev", "ReviewLive"]'),
7506
- testStatuses: z8.array(z8.enum(["open", "approved", "rejected"])).optional().describe("Filter tests by status: open | approved | rejected")
7606
+ cardStatuses: z9.array(z9.string()).optional().describe('Filter tasks by card status, e.g. ["ReviewDev", "ReviewLive"]'),
7607
+ testStatuses: z9.array(z9.enum(["open", "approved", "rejected"])).optional().describe("Filter tests by status: open | approved | rejected")
7507
7608
  },
7508
7609
  async ({ cardStatuses, testStatuses }) => {
7509
7610
  try {
@@ -7527,7 +7628,7 @@ function buildSetManualTestsTool(connection) {
7527
7628
  "set_manual_tests",
7528
7629
  "Add manual test steps to the task checklist. Existing items with the same title are automatically skipped (deduplication). Use to record specific manual verification steps that reviewers should follow when testing this PR.",
7529
7630
  {
7530
- items: z8.array(z8.object({ title: z8.string().min(1).describe("A concise, actionable test step") })).min(1).describe("List of manual test steps to add")
7631
+ items: z9.array(z9.object({ title: z9.string().min(1).describe("A concise, actionable test step") })).min(1).describe("List of manual test steps to add")
7531
7632
  },
7532
7633
  async ({ items }) => {
7533
7634
  try {
@@ -7550,8 +7651,8 @@ function buildEditManualTestTool(connection) {
7550
7651
  "edit_manual_test",
7551
7652
  "Rename an existing manual test step. Identify the test by its current title (case-insensitive); pass the new title to replace it. Use to correct or refine a recorded manual verification step.",
7552
7653
  {
7553
- title: z8.string().min(1).describe("The current title of the manual test to edit"),
7554
- newTitle: z8.string().min(1).describe("The new title for the manual test")
7654
+ title: z9.string().min(1).describe("The current title of the manual test to edit"),
7655
+ newTitle: z9.string().min(1).describe("The new title for the manual test")
7555
7656
  },
7556
7657
  async ({ title, newTitle }) => {
7557
7658
  try {
@@ -7573,7 +7674,7 @@ function buildRemoveManualTestTool(connection) {
7573
7674
  "remove_manual_test",
7574
7675
  "Remove an existing manual test step from the task checklist. Identify the test by its title (case-insensitive). Use to delete a stale or incorrect manual verification step.",
7575
7676
  {
7576
- title: z8.string().min(1).describe("The title of the manual test to remove")
7677
+ title: z9.string().min(1).describe("The title of the manual test to remove")
7577
7678
  },
7578
7679
  async ({ title }) => {
7579
7680
  try {
@@ -7594,7 +7695,7 @@ function buildApproveManualTestTool(connection) {
7594
7695
  "approve_manual_test",
7595
7696
  "Sign off on (approve) a manual test step on behalf of your authenticated user. Identify the test by its title (case-insensitive). Use after you have verified the step passes.",
7596
7697
  {
7597
- title: z8.string().min(1).describe("The title of the manual test to approve")
7698
+ title: z9.string().min(1).describe("The title of the manual test to approve")
7598
7699
  },
7599
7700
  async ({ title }) => {
7600
7701
  try {
@@ -7615,8 +7716,8 @@ function buildRejectManualTestTool(connection) {
7615
7716
  "reject_manual_test",
7616
7717
  "Flag an issue with (reject) a manual test step on behalf of your authenticated user, recording the reason. Identify the test by its title (case-insensitive). Use when the step fails verification.",
7617
7718
  {
7618
- title: z8.string().min(1).describe("The title of the manual test to reject"),
7619
- reason: z8.string().min(1).max(2e3).describe("Why the test failed \u2014 what went wrong, shown to the team")
7719
+ title: z9.string().min(1).describe("The title of the manual test to reject"),
7720
+ reason: z9.string().min(1).max(2e3).describe("Why the test failed \u2014 what went wrong, shown to the team")
7620
7721
  },
7621
7722
  async ({ title, reason }) => {
7622
7723
  try {
@@ -7653,7 +7754,7 @@ function buildCommonTools(connection, config) {
7653
7754
  }
7654
7755
 
7655
7756
  // src/tools/pm-tools.ts
7656
- import { z as z9 } from "zod";
7757
+ import { z as z10 } from "zod";
7657
7758
  var SP_DESCRIPTION = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique)";
7658
7759
  var FOLLOW_PARENT_STATUS_DESCRIPTION = "Child mirrors the parent task's status automatically \u2014 for subtasks that ship on the parent's branch/PR with no build or PR of their own. Manual status writes on a follower stick only until the parent's next transition.";
7659
7760
  var DEPENDS_ON_DESCRIPTION = "Sibling subtask ids or slugs this subtask blocks on (it won't start until they merge to dev). Set explicit dependency metadata here instead of describing order in the plan text \u2014 the pack runner schedules children off these edges. Omit / leave empty for independent children so they run in parallel.";
@@ -7662,8 +7763,8 @@ function buildUpdateTaskTool(connection) {
7662
7763
  "update_task_plan",
7663
7764
  "Save the plan and/or description to the current task. In auto/building mode, save the plan BEFORE writing code and keep it current as the approach evolves \u2014 post it, then build; never pause the build waiting for approval. For children use update_subtask; for title/tags/PR use update_task_properties.",
7664
7765
  {
7665
- plan: z9.string().optional().describe("The task plan in markdown"),
7666
- description: z9.string().optional().describe("Updated task description")
7766
+ plan: z10.string().optional().describe("The task plan in markdown"),
7767
+ description: z10.string().optional().describe("Updated task description")
7667
7768
  },
7668
7769
  async ({ plan, description }) => {
7669
7770
  try {
@@ -7684,13 +7785,13 @@ function buildCreateSubtaskTool(connection) {
7684
7785
  "create_subtask",
7685
7786
  "Create a subtask under the current parent task. Use when breaking a complex parent into smaller pieces during planning. For post-task follow-ups use create_follow_up_task.",
7686
7787
  {
7687
- title: z9.string().describe("Subtask title"),
7688
- description: z9.string().optional().describe("Brief description"),
7689
- plan: z9.string().optional().describe("Implementation plan in markdown"),
7690
- ordinal: z9.number().optional().describe("Step/order number (0-based)"),
7691
- storyPointValue: z9.number().optional().describe(SP_DESCRIPTION),
7692
- followParentStatus: z9.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION),
7693
- dependsOn: z9.array(z9.string()).optional().describe(DEPENDS_ON_DESCRIPTION)
7788
+ title: z10.string().describe("Subtask title"),
7789
+ description: z10.string().optional().describe("Brief description"),
7790
+ plan: z10.string().optional().describe("Implementation plan in markdown"),
7791
+ ordinal: z10.number().optional().describe("Step/order number (0-based)"),
7792
+ storyPointValue: z10.number().optional().describe(SP_DESCRIPTION),
7793
+ followParentStatus: z10.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION),
7794
+ dependsOn: z10.array(z10.string()).optional().describe(DEPENDS_ON_DESCRIPTION)
7694
7795
  },
7695
7796
  async ({
7696
7797
  title,
@@ -7726,20 +7827,20 @@ function buildUpdateSubtaskTool(connection) {
7726
7827
  "update_subtask",
7727
7828
  "Update an existing subtask's fields (title, description, plan, ordinal, storyPointValue, dependsOn) \u2014 and the sanctioned path to make a child buildable: promote it to status Open, assign its agent (agentIdOrName), and set story points. Setting story points does NOT auto-promote; set status explicitly. For the current task use update_task_plan.",
7728
7829
  {
7729
- subtaskId: z9.string().describe("The subtask ID to update"),
7730
- title: z9.string().optional(),
7731
- description: z9.string().optional(),
7732
- plan: z9.string().optional(),
7733
- status: z9.enum(["Planning", "Open"]).optional().describe(
7830
+ subtaskId: z10.string().describe("The subtask ID to update"),
7831
+ title: z10.string().optional(),
7832
+ description: z10.string().optional(),
7833
+ plan: z10.string().optional(),
7834
+ status: z10.enum(["Planning", "Open"]).optional().describe(
7734
7835
  'Move the child between "Planning" and "Open". "Open" marks it ready to execute \u2014 required before start_child_cloud_build. Execution statuses transition automatically.'
7735
7836
  ),
7736
- agentIdOrName: z9.string().optional().describe(
7837
+ agentIdOrName: z10.string().optional().describe(
7737
7838
  "Assign a project agent to the child (agent id or exact name from the Project Agents list). Required before start_child_cloud_build."
7738
7839
  ),
7739
- ordinal: z9.number().optional(),
7740
- storyPointValue: z9.number().optional().describe(SP_DESCRIPTION),
7741
- followParentStatus: z9.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION),
7742
- dependsOn: z9.array(z9.string()).optional().describe(
7840
+ ordinal: z10.number().optional(),
7841
+ storyPointValue: z10.number().optional().describe(SP_DESCRIPTION),
7842
+ followParentStatus: z10.boolean().optional().describe(FOLLOW_PARENT_STATUS_DESCRIPTION),
7843
+ dependsOn: z10.array(z10.string()).optional().describe(
7743
7844
  `${DEPENDS_ON_DESCRIPTION} Replaces the full dependency set \u2014 pass [] to clear all, omit to leave unchanged.`
7744
7845
  )
7745
7846
  },
@@ -7778,7 +7879,7 @@ function buildDeleteSubtaskTool(connection) {
7778
7879
  return defineTool(
7779
7880
  "delete_subtask",
7780
7881
  "Delete a subtask by id. When to use: a subtask was created in error or is no longer needed. Returns: confirmation string.",
7781
- { subtaskId: z9.string().describe("The subtask ID to delete") },
7882
+ { subtaskId: z10.string().describe("The subtask ID to delete") },
7782
7883
  async ({ subtaskId }) => {
7783
7884
  try {
7784
7885
  await connection.call("deleteSubtask", {
@@ -7797,7 +7898,7 @@ function buildListSubtasksTool(connection) {
7797
7898
  "list_subtasks",
7798
7899
  "List all subtasks under the current parent task. Default compact view returns per child: status, agent, story points, PR number/state, dependencies, and holdsBuildSlot \u2014 plus packSlots (in-flight environments vs the PACK_CHILD_LIMIT cap, and which children hold the slots). Use to coordinate child work; pass verbose:true only when you need full description/plan text (large). For non-child tasks use get_task.",
7799
7900
  {
7800
- verbose: z9.boolean().optional().describe(
7901
+ verbose: z10.boolean().optional().describe(
7801
7902
  "Return full task rows including description and plan text (large \u2014 can exceed tool result limits on big packs). Default: compact orchestration view."
7802
7903
  )
7803
7904
  },
@@ -7821,7 +7922,7 @@ function buildPackTools(connection) {
7821
7922
  "start_child_cloud_build",
7822
7923
  "Start a cloud build (codespace) for a child task. Preconditions: child status is `Open`, story points set, and an agent assigned \u2014 satisfy all three with update_subtask (status/agentIdOrName/storyPointValue) first; none happen automatically. A PACK_CHILD_LIMIT error is backpressure, not failure: check list_subtasks packSlots for which children hold the in-flight slots, merge/stop one, then retry.",
7823
7924
  {
7824
- childTaskId: z9.string().describe("The child task ID to start a cloud build for")
7925
+ childTaskId: z10.string().describe("The child task ID to start a cloud build for")
7825
7926
  },
7826
7927
  async ({ childTaskId }) => {
7827
7928
  try {
@@ -7841,7 +7942,7 @@ function buildPackTools(connection) {
7841
7942
  "stop_child_build",
7842
7943
  "Send a graceful stop signal to a running child build's agent. Not a force-kill \u2014 the agent may take a moment to wind down. Stopping a child eventually frees its PACK_CHILD_LIMIT build slot (see list_subtasks packSlots).",
7843
7944
  {
7844
- childTaskId: z9.string().describe("The child task ID whose build should be stopped")
7945
+ childTaskId: z10.string().describe("The child task ID whose build should be stopped")
7845
7946
  },
7846
7947
  async ({ childTaskId }) => {
7847
7948
  try {
@@ -7861,7 +7962,7 @@ function buildPackTools(connection) {
7861
7962
  "approve_and_merge_pr",
7862
7963
  "Approve and merge a child task's PR. Preconditions: child in ReviewPR. Returns { merged }: true = merged (status\u2192ReviewDev); false = automerge queued, wait for ReviewDev.",
7863
7964
  {
7864
- childTaskId: z9.string().describe("The child task ID whose PR should be approved and merged")
7965
+ childTaskId: z10.string().describe("The child task ID whose PR should be approved and merged")
7865
7966
  },
7866
7967
  async ({ childTaskId }) => {
7867
7968
  try {
@@ -7899,7 +8000,7 @@ function buildPmTools(connection, options) {
7899
8000
  }
7900
8001
 
7901
8002
  // src/tools/discovery-tools.ts
7902
- import { z as z10 } from "zod";
8003
+ import { z as z11 } from "zod";
7903
8004
  var SP_DESCRIPTION2 = "Story point value (1=Common, 2=Magic, 3=Rare, 5=Unique). The key is 'storyPointValue' \u2014 not 'storyPoints'.";
7904
8005
  var VALID_PROPERTY_KEYS = "title, storyPointValue, tagNames, githubPRUrl, githubBranch";
7905
8006
  function buildDiscoveryTools(connection) {
@@ -7908,11 +8009,11 @@ function buildDiscoveryTools(connection) {
7908
8009
  "update_task_properties",
7909
8010
  "Set one or more task properties in a single call. Valid keys: title, storyPointValue, tagNames, githubPRUrl, githubBranch. All are optional \u2014 include only the ones you want to update (at least one). Unknown keys are rejected.",
7910
8011
  {
7911
- title: z10.string().optional().describe("The new task title"),
7912
- storyPointValue: z10.number().optional().describe(SP_DESCRIPTION2),
7913
- tagNames: z10.array(z10.string()).optional().describe("Array of tag names to assign"),
7914
- githubPRUrl: z10.string().url().optional().describe("GitHub pull request URL to link to this task"),
7915
- githubBranch: z10.string().optional().describe("Set the GitHub branch name for this task (e.g. 'conveyor/my-feature-abc123')")
8012
+ title: z11.string().optional().describe("The new task title"),
8013
+ storyPointValue: z11.number().optional().describe(SP_DESCRIPTION2),
8014
+ tagNames: z11.array(z11.string()).optional().describe("Array of tag names to assign"),
8015
+ githubPRUrl: z11.string().url().optional().describe("GitHub pull request URL to link to this task"),
8016
+ githubBranch: z11.string().optional().describe("Set the GitHub branch name for this task (e.g. 'conveyor/my-feature-abc123')")
7916
8017
  },
7917
8018
  async ({ title, storyPointValue, tagNames, githubPRUrl, githubBranch }) => {
7918
8019
  try {
@@ -7953,7 +8054,7 @@ function buildDiscoveryTools(connection) {
7953
8054
  }
7954
8055
 
7955
8056
  // src/tools/code-review-tools.ts
7956
- import { z as z11 } from "zod";
8057
+ import { z as z12 } from "zod";
7957
8058
  async function endReviewSession(connection, reason) {
7958
8059
  await connection.call("endReviewSession", {
7959
8060
  sessionId: connection.sessionId,
@@ -7966,7 +8067,7 @@ function buildCodeReviewTools(connection) {
7966
8067
  "approve_code_review",
7967
8068
  "Approve the code review and exit. Use when the diff passes all review criteria. Takes only a summary \u2014 for changes, use request_code_changes with a structured issues[] list.",
7968
8069
  {
7969
- summary: z11.string().describe("Brief summary of what was reviewed and why it looks good")
8070
+ summary: z12.string().describe("Brief summary of what was reviewed and why it looks good")
7970
8071
  },
7971
8072
  async ({ summary }) => {
7972
8073
  const content = `**Code Review: Approved** :white_check_mark:
@@ -7990,15 +8091,15 @@ ${summary}`;
7990
8091
  "request_code_changes",
7991
8092
  "Request changes during code review and exit. Use when substantive issues must be fixed before merge. Each issue: { file, line?, severity: critical|major|minor, description }.",
7992
8093
  {
7993
- issues: z11.array(
7994
- z11.object({
7995
- file: z11.string().describe("File path where the issue was found"),
7996
- line: z11.number().optional().describe("Line number (if applicable)"),
7997
- severity: z11.enum(["critical", "major", "minor"]).describe("Issue severity"),
7998
- description: z11.string().describe("What is wrong and how to fix it")
8094
+ issues: z12.array(
8095
+ z12.object({
8096
+ file: z12.string().describe("File path where the issue was found"),
8097
+ line: z12.number().optional().describe("Line number (if applicable)"),
8098
+ severity: z12.enum(["critical", "major", "minor"]).describe("Issue severity"),
8099
+ description: z12.string().describe("What is wrong and how to fix it")
7999
8100
  })
8000
8101
  ).describe("List of issues found during review"),
8001
- summary: z11.string().describe("Brief overall summary of the review findings")
8102
+ summary: z12.string().describe("Brief overall summary of the review findings")
8002
8103
  },
8003
8104
  async ({ issues, summary }) => {
8004
8105
  const issueLines = issues.map((issue) => {
@@ -10218,7 +10319,7 @@ async function readListeningPorts() {
10218
10319
  }
10219
10320
  var DEFAULT_EXCLUDED_PORTS = [2222, 5432, 6379, 9200];
10220
10321
  var DEFAULT_EPHEMERAL_PORT_MIN = 32768;
10221
- var DEFAULT_INTERVAL_MS = 15e3;
10322
+ var DEFAULT_DISCOVERY_INTERVAL_MS = 15e3;
10222
10323
  var DEFAULT_MAX_PORTS = 16;
10223
10324
  var CONFIRM_SCANS = 2;
10224
10325
  var PortDiscovery = class {
@@ -10244,7 +10345,7 @@ var PortDiscovery = class {
10244
10345
  lastReportedKey = "";
10245
10346
  constructor(options) {
10246
10347
  this.opts = options;
10247
- this.intervalMs = options.intervalMs ?? DEFAULT_INTERVAL_MS;
10348
+ this.intervalMs = options.intervalMs ?? DEFAULT_DISCOVERY_INTERVAL_MS;
10248
10349
  this.maxPorts = options.maxPorts ?? DEFAULT_MAX_PORTS;
10249
10350
  this.excluded = new Set(options.excludedPorts ?? DEFAULT_EXCLUDED_PORTS);
10250
10351
  this.ephemeralPortMin = options.ephemeralPortMin ?? DEFAULT_EPHEMERAL_PORT_MIN;
@@ -11511,6 +11612,7 @@ export {
11511
11612
  ClaudeTuiAdapter,
11512
11613
  PtyHarness,
11513
11614
  createServiceLogger,
11615
+ GIT_TIMEOUT_MS,
11514
11616
  hasUncommittedChanges,
11515
11617
  getCurrentBranch,
11516
11618
  hasUnpushedCommits,
@@ -11541,4 +11643,4 @@ export {
11541
11643
  runStartCommand,
11542
11644
  unshallowRepo
11543
11645
  };
11544
- //# sourceMappingURL=chunk-H3OGNJS4.js.map
11646
+ //# sourceMappingURL=chunk-BN5TDTW7.js.map