@get-bb/plugin-sdk 0.6.65 → 0.6.68

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.
@@ -1030,7 +1030,7 @@ function withoutBridgeRuntimeEnv(env) {
1030
1030
  }
1031
1031
 
1032
1032
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
1033
- import { z as z23 } from "zod";
1033
+ import { z as z24 } from "zod";
1034
1034
 
1035
1035
  // ../domain/src/context-snapshot.ts
1036
1036
  import { z as z3 } from "zod";
@@ -1765,241 +1765,296 @@ function isSettledBackgroundTaskStatus(taskStatus) {
1765
1765
  return backgroundTaskItemStatus(taskStatus) !== "pending";
1766
1766
  }
1767
1767
 
1768
- // ../domain/src/provider-event.ts
1769
- import { z as z18 } from "zod";
1770
-
1771
- // ../domain/src/thread-events.ts
1772
- import { z as z15 } from "zod";
1773
-
1774
- // ../domain/src/pending-interactions.ts
1775
- import { z as z12 } from "zod";
1768
+ // ../domain/src/protocol-ids.ts
1769
+ import { z as z10 } from "zod";
1770
+ var clientTurnRequestIdSchema = z10.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
1776
1771
 
1777
- // ../domain/src/plugin-interaction-limits.ts
1778
- var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
1779
- var PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES = 64 * 1024;
1780
- var PLUGIN_INTERACTION_MAX_TIMEOUT_MS = 7 * 24 * 60 * 60 * 1e3;
1781
- function jsonByteLength(value) {
1782
- return new TextEncoder().encode(JSON.stringify(value)).length;
1783
- }
1772
+ // ../domain/src/system-message.ts
1773
+ import { z as z11 } from "zod";
1774
+ var systemMessageKindValues = [
1775
+ "ownership-assigned",
1776
+ "ownership-removed",
1777
+ "child-needs-attention",
1778
+ "child-completed",
1779
+ "child-failed",
1780
+ "child-interrupted",
1781
+ "child-outcome-batch",
1782
+ "tool-result-delivered",
1783
+ "environment-directory-updated",
1784
+ "unlabeled"
1785
+ ];
1786
+ var systemMessageKindSchema = z11.enum(systemMessageKindValues);
1787
+ var systemThreadInterruptedReasonSchema = z11.enum([
1788
+ "manual-stop",
1789
+ "host-daemon-restarted",
1790
+ "host-removed",
1791
+ "provider-turn-idle"
1792
+ ]);
1793
+ var childThreadOutcomeSchema = z11.object({
1794
+ threadId: z11.string(),
1795
+ status: z11.enum(["completed", "failed", "interrupted"]),
1796
+ interruption: z11.object({
1797
+ reason: systemThreadInterruptedReasonSchema,
1798
+ cause: z11.literal("host-connection-lost").optional()
1799
+ }).optional()
1800
+ });
1801
+ var systemMessageSubjectSchema = z11.discriminatedUnion("kind", [
1802
+ z11.object({
1803
+ kind: z11.literal("thread"),
1804
+ threadId: z11.string(),
1805
+ threadName: z11.string(),
1806
+ outcomes: z11.array(childThreadOutcomeSchema).optional()
1807
+ }),
1808
+ z11.object({
1809
+ kind: z11.literal("thread-batch"),
1810
+ count: z11.number(),
1811
+ outcomes: z11.array(childThreadOutcomeSchema).optional()
1812
+ }),
1813
+ z11.object({
1814
+ kind: z11.literal("tool-call"),
1815
+ toolName: z11.string(),
1816
+ suppress: z11.boolean()
1817
+ }),
1818
+ z11.object({
1819
+ kind: z11.literal("directory"),
1820
+ path: z11.string()
1821
+ })
1822
+ ]);
1784
1823
 
1785
1824
  // ../domain/src/item-presentation.ts
1786
- import { z as z10 } from "zod";
1825
+ import { z as z12 } from "zod";
1787
1826
  var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
1788
- var threadEventItemPresentationLabelSchema = z10.object({
1789
- pending: z10.string().min(1),
1790
- completed: z10.string().min(1)
1827
+ var threadEventItemPresentationLabelSchema = z12.object({
1828
+ pending: z12.string().min(1),
1829
+ completed: z12.string().min(1)
1791
1830
  });
1792
- var threadEventItemPresentationIconSchema = z10.object({
1793
- glyph: z10.string().min(1)
1831
+ var threadEventItemPresentationIconSchema = z12.object({
1832
+ glyph: z12.string().min(1)
1794
1833
  });
1795
- var threadEventItemPresentationTintSchema = z10.object({
1796
- light: z10.string().min(1),
1797
- dark: z10.string().min(1)
1834
+ var threadEventItemPresentationTintSchema = z12.object({
1835
+ light: z12.string().min(1),
1836
+ dark: z12.string().min(1)
1798
1837
  });
1799
1838
  var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
1800
- var threadEventItemPresentationBadgeSchema = z10.object({
1801
- glyph: z10.string().min(1),
1802
- label: z10.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1803
- hint: z10.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1804
- tone: z10.enum(["neutral", "destructive"])
1839
+ var threadEventItemPresentationBadgeSchema = z12.object({
1840
+ glyph: z12.string().min(1),
1841
+ label: z12.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1842
+ hint: z12.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
1843
+ tone: z12.enum(["neutral", "destructive"])
1805
1844
  });
1806
- var threadEventItemPresentationSchema = z10.object({
1845
+ var threadEventItemPresentationSchema = z12.object({
1807
1846
  label: threadEventItemPresentationLabelSchema,
1808
1847
  icon: threadEventItemPresentationIconSchema,
1809
- title: z10.string().optional(),
1810
- detail: z10.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
1811
- suppress: z10.boolean().optional(),
1848
+ title: z12.string().optional(),
1849
+ detail: z12.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
1850
+ suppress: z12.boolean().optional(),
1812
1851
  tint: threadEventItemPresentationTintSchema.optional(),
1813
1852
  badge: threadEventItemPresentationBadgeSchema.optional()
1814
1853
  });
1815
1854
 
1855
+ // ../domain/src/number-utils.ts
1856
+ function toPositiveNumber(value) {
1857
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
1858
+ }
1859
+
1860
+ // ../domain/src/pending-interactions.ts
1861
+ import { z as z14 } from "zod";
1862
+
1863
+ // ../domain/src/plugin-interaction-limits.ts
1864
+ var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
1865
+ var PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES = 64 * 1024;
1866
+ var PLUGIN_INTERACTION_MAX_TIMEOUT_MS = 7 * 24 * 60 * 60 * 1e3;
1867
+ function jsonByteLength(value) {
1868
+ return new TextEncoder().encode(JSON.stringify(value)).length;
1869
+ }
1870
+
1816
1871
  // ../domain/src/provider-extension-kind.ts
1817
- import { z as z11 } from "zod";
1872
+ import { z as z13 } from "zod";
1818
1873
  var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
1819
1874
  function isExtensionKind(value) {
1820
1875
  return EXTENSION_KIND_PATTERN.test(value);
1821
1876
  }
1822
- var extensionKindSchema = z11.string().refine(isExtensionKind, {
1877
+ var extensionKindSchema = z13.string().refine(isExtensionKind, {
1823
1878
  message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
1824
1879
  });
1825
1880
 
1826
1881
  // ../domain/src/pending-interactions.ts
1827
- var pendingInteractionStatusSchema = z12.enum([
1882
+ var pendingInteractionStatusSchema = z14.enum([
1828
1883
  "pending",
1829
1884
  "resolving",
1830
1885
  "resolved",
1831
1886
  "interrupted"
1832
1887
  ]);
1833
- var pendingInteractionCommandActionSchema = z12.discriminatedUnion(
1888
+ var pendingInteractionCommandActionSchema = z14.discriminatedUnion(
1834
1889
  "type",
1835
1890
  [
1836
- z12.object({
1837
- type: z12.literal("read"),
1838
- command: z12.string(),
1839
- name: z12.string(),
1840
- path: z12.string()
1891
+ z14.object({
1892
+ type: z14.literal("read"),
1893
+ command: z14.string(),
1894
+ name: z14.string(),
1895
+ path: z14.string()
1841
1896
  }),
1842
- z12.object({
1843
- type: z12.literal("listFiles"),
1844
- command: z12.string(),
1845
- path: z12.string().nullable()
1897
+ z14.object({
1898
+ type: z14.literal("listFiles"),
1899
+ command: z14.string(),
1900
+ path: z14.string().nullable()
1846
1901
  }),
1847
- z12.object({
1848
- type: z12.literal("search"),
1849
- command: z12.string(),
1850
- query: z12.string().nullable(),
1851
- path: z12.string().nullable()
1902
+ z14.object({
1903
+ type: z14.literal("search"),
1904
+ command: z14.string(),
1905
+ query: z14.string().nullable(),
1906
+ path: z14.string().nullable()
1852
1907
  }),
1853
- z12.object({
1854
- type: z12.literal("unknown"),
1855
- command: z12.string()
1908
+ z14.object({
1909
+ type: z14.literal("unknown"),
1910
+ command: z14.string()
1856
1911
  })
1857
1912
  ]
1858
1913
  );
1859
- var pendingInteractionNetworkPermissionsSchema = z12.object({
1860
- enabled: z12.boolean().nullable()
1914
+ var pendingInteractionNetworkPermissionsSchema = z14.object({
1915
+ enabled: z14.boolean().nullable()
1861
1916
  });
1862
- var pendingInteractionFileSystemPermissionsSchema = z12.object({
1863
- read: z12.array(z12.string()),
1864
- write: z12.array(z12.string())
1917
+ var pendingInteractionFileSystemPermissionsSchema = z14.object({
1918
+ read: z14.array(z14.string()),
1919
+ write: z14.array(z14.string())
1865
1920
  });
1866
- var pendingInteractionMacOsPreferencesPermissionSchema = z12.enum([
1921
+ var pendingInteractionMacOsPreferencesPermissionSchema = z14.enum([
1867
1922
  "none",
1868
1923
  "read_only",
1869
1924
  "read_write"
1870
1925
  ]);
1871
- var pendingInteractionMacOsContactsPermissionSchema = z12.enum([
1926
+ var pendingInteractionMacOsContactsPermissionSchema = z14.enum([
1872
1927
  "none",
1873
1928
  "read_only",
1874
1929
  "read_write"
1875
1930
  ]);
1876
- var pendingInteractionMacOsAutomationPermissionSchema = z12.union([
1877
- z12.literal("none"),
1878
- z12.literal("all"),
1879
- z12.object({
1880
- kind: z12.literal("bundle_ids"),
1881
- bundleIds: z12.array(z12.string())
1931
+ var pendingInteractionMacOsAutomationPermissionSchema = z14.union([
1932
+ z14.literal("none"),
1933
+ z14.literal("all"),
1934
+ z14.object({
1935
+ kind: z14.literal("bundle_ids"),
1936
+ bundleIds: z14.array(z14.string())
1882
1937
  })
1883
1938
  ]);
1884
- var pendingInteractionMacOsPermissionsSchema = z12.object({
1939
+ var pendingInteractionMacOsPermissionsSchema = z14.object({
1885
1940
  preferences: pendingInteractionMacOsPreferencesPermissionSchema,
1886
1941
  automations: pendingInteractionMacOsAutomationPermissionSchema,
1887
- launchServices: z12.boolean(),
1888
- accessibility: z12.boolean(),
1889
- calendar: z12.boolean(),
1890
- reminders: z12.boolean(),
1942
+ launchServices: z14.boolean(),
1943
+ accessibility: z14.boolean(),
1944
+ calendar: z14.boolean(),
1945
+ reminders: z14.boolean(),
1891
1946
  contacts: pendingInteractionMacOsContactsPermissionSchema
1892
1947
  });
1893
- var pendingInteractionRequestedPermissionProfileSchema = z12.object({
1948
+ var pendingInteractionRequestedPermissionProfileSchema = z14.object({
1894
1949
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
1895
1950
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
1896
1951
  macos: pendingInteractionMacOsPermissionsSchema.nullable()
1897
1952
  });
1898
- var pendingInteractionGrantablePermissionProfileSchema = z12.object({
1953
+ var pendingInteractionGrantablePermissionProfileSchema = z14.object({
1899
1954
  network: pendingInteractionNetworkPermissionsSchema.nullable(),
1900
1955
  fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
1901
1956
  }).strict();
1902
1957
  var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
1903
- var pendingInteractionApprovalDecisionSchema = z12.enum([
1958
+ var pendingInteractionApprovalDecisionSchema = z14.enum([
1904
1959
  "allow_once",
1905
1960
  "allow_for_session",
1906
1961
  "deny"
1907
1962
  ]);
1908
- var pendingInteractionFileChangeWriteScopeSchema = z12.string().min(1);
1909
- var pendingInteractionCommandApprovalSubjectSchema = z12.object({
1910
- kind: z12.literal("command"),
1911
- itemId: z12.string().min(1),
1912
- command: z12.string().min(1),
1913
- cwd: z12.string().nullable(),
1914
- actions: z12.array(pendingInteractionCommandActionSchema),
1963
+ var pendingInteractionFileChangeWriteScopeSchema = z14.string().min(1);
1964
+ var pendingInteractionCommandApprovalSubjectSchema = z14.object({
1965
+ kind: z14.literal("command"),
1966
+ itemId: z14.string().min(1),
1967
+ command: z14.string().min(1),
1968
+ cwd: z14.string().nullable(),
1969
+ actions: z14.array(pendingInteractionCommandActionSchema),
1915
1970
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
1916
1971
  });
1917
- var pendingInteractionFileChangeApprovalSubjectSchema = z12.object({
1918
- kind: z12.literal("file_change"),
1919
- itemId: z12.string().min(1),
1972
+ var pendingInteractionFileChangeApprovalSubjectSchema = z14.object({
1973
+ kind: z14.literal("file_change"),
1974
+ itemId: z14.string().min(1),
1920
1975
  writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
1921
1976
  sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
1922
1977
  });
1923
- var pendingInteractionPermissionGrantApprovalSubjectSchema = z12.object({
1924
- kind: z12.literal("permission_grant"),
1925
- itemId: z12.string().min(1),
1926
- toolName: z12.string().nullable(),
1978
+ var pendingInteractionPermissionGrantApprovalSubjectSchema = z14.object({
1979
+ kind: z14.literal("permission_grant"),
1980
+ itemId: z14.string().min(1),
1981
+ toolName: z14.string().nullable(),
1927
1982
  permissions: pendingInteractionGrantablePermissionProfileSchema
1928
1983
  });
1929
- var pendingInteractionPlanApprovalSubjectSchema = z12.object({
1930
- kind: z12.literal("plan"),
1931
- itemId: z12.string().min(1),
1932
- plan: z12.string().min(1),
1933
- planFilePath: z12.string().min(1).nullable()
1984
+ var pendingInteractionPlanApprovalSubjectSchema = z14.object({
1985
+ kind: z14.literal("plan"),
1986
+ itemId: z14.string().min(1),
1987
+ plan: z14.string().min(1),
1988
+ planFilePath: z14.string().min(1).nullable()
1934
1989
  });
1935
- var pendingInteractionToolUseApprovalSubjectSchema = z12.object({
1936
- kind: z12.literal("tool_use"),
1937
- itemId: z12.string().min(1),
1938
- tool: z12.string().min(1),
1990
+ var pendingInteractionToolUseApprovalSubjectSchema = z14.object({
1991
+ kind: z14.literal("tool_use"),
1992
+ itemId: z14.string().min(1),
1993
+ tool: z14.string().min(1),
1939
1994
  presentation: threadEventItemPresentationSchema
1940
1995
  });
1941
- var pendingInteractionApprovalSubjectSchema = z12.discriminatedUnion("kind", [
1996
+ var pendingInteractionApprovalSubjectSchema = z14.discriminatedUnion("kind", [
1942
1997
  pendingInteractionCommandApprovalSubjectSchema,
1943
1998
  pendingInteractionFileChangeApprovalSubjectSchema,
1944
1999
  pendingInteractionPermissionGrantApprovalSubjectSchema,
1945
2000
  pendingInteractionPlanApprovalSubjectSchema,
1946
2001
  pendingInteractionToolUseApprovalSubjectSchema
1947
2002
  ]);
1948
- var approvalPendingInteractionPayloadSchema = z12.object({
1949
- kind: z12.literal("approval"),
2003
+ var approvalPendingInteractionPayloadSchema = z14.object({
2004
+ kind: z14.literal("approval"),
1950
2005
  subject: pendingInteractionApprovalSubjectSchema,
1951
- reason: z12.string().nullable(),
1952
- availableDecisions: z12.array(pendingInteractionApprovalDecisionSchema).min(1)
2006
+ reason: z14.string().nullable(),
2007
+ availableDecisions: z14.array(pendingInteractionApprovalDecisionSchema).min(1)
1953
2008
  });
1954
2009
  var USER_QUESTION_MAX_QUESTIONS = 4;
1955
2010
  var USER_QUESTION_MAX_OPTIONS = 4;
1956
2011
  var USER_QUESTION_MAX_SELECTED = 4;
1957
2012
  var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
1958
- var pendingInteractionUserQuestionIdSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2013
+ var pendingInteractionUserQuestionIdSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1959
2014
  message: "User question ids cannot be blank"
1960
2015
  });
1961
- var pendingInteractionUserQuestionPromptSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2016
+ var pendingInteractionUserQuestionPromptSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1962
2017
  message: "User question prompts cannot be blank"
1963
2018
  });
1964
- var pendingInteractionUserQuestionShortLabelSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2019
+ var pendingInteractionUserQuestionShortLabelSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1965
2020
  message: "User question short labels cannot be blank"
1966
2021
  });
1967
- var pendingInteractionUserQuestionOptionValueSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2022
+ var pendingInteractionUserQuestionOptionValueSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1968
2023
  message: "User question option values cannot be blank"
1969
2024
  });
1970
- var pendingInteractionUserQuestionOptionLabelSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2025
+ var pendingInteractionUserQuestionOptionLabelSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1971
2026
  message: "User question option labels cannot be blank"
1972
2027
  });
1973
- var pendingInteractionUserQuestionOptionDescriptionSchema = z12.string().min(1).refine((value) => value.trim().length > 0, {
2028
+ var pendingInteractionUserQuestionOptionDescriptionSchema = z14.string().min(1).refine((value) => value.trim().length > 0, {
1974
2029
  message: "User question option descriptions cannot be blank"
1975
2030
  });
1976
- var pendingInteractionUserQuestionFreeTextSchema = z12.string().min(1).max(
2031
+ var pendingInteractionUserQuestionFreeTextSchema = z14.string().min(1).max(
1977
2032
  USER_QUESTION_MAX_FREE_TEXT_LENGTH,
1978
2033
  `User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
1979
2034
  ).refine((value) => value.trim().length > 0, {
1980
2035
  message: "User question free text cannot be blank"
1981
2036
  });
1982
- var pendingInteractionUserQuestionOptionSchema = z12.object({
2037
+ var pendingInteractionUserQuestionOptionSchema = z14.object({
1983
2038
  value: pendingInteractionUserQuestionOptionValueSchema,
1984
2039
  label: pendingInteractionUserQuestionOptionLabelSchema,
1985
2040
  description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
1986
2041
  });
1987
- var pendingInteractionUserQuestionQuestionSchema = z12.object({
2042
+ var pendingInteractionUserQuestionQuestionSchema = z14.object({
1988
2043
  id: pendingInteractionUserQuestionIdSchema,
1989
2044
  prompt: pendingInteractionUserQuestionPromptSchema,
1990
2045
  shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
1991
- multiSelect: z12.boolean(),
1992
- options: z12.array(pendingInteractionUserQuestionOptionSchema).max(
2046
+ multiSelect: z14.boolean(),
2047
+ options: z14.array(pendingInteractionUserQuestionOptionSchema).max(
1993
2048
  USER_QUESTION_MAX_OPTIONS,
1994
2049
  `User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
1995
2050
  ).optional(),
1996
- allowFreeText: z12.boolean()
2051
+ allowFreeText: z14.boolean()
1997
2052
  }).superRefine((question, context) => {
1998
2053
  const optionValues = /* @__PURE__ */ new Set();
1999
2054
  question.options?.forEach((option, index) => {
2000
2055
  if (optionValues.has(option.value)) {
2001
2056
  context.addIssue({
2002
- code: z12.ZodIssueCode.custom,
2057
+ code: z14.ZodIssueCode.custom,
2003
2058
  message: "User question option values must be unique",
2004
2059
  path: ["options", index, "value"]
2005
2060
  });
@@ -2014,9 +2069,9 @@ var pendingInteractionUserQuestionQuestionSchema = z12.object({
2014
2069
  path: ["options"]
2015
2070
  }
2016
2071
  );
2017
- var userQuestionPendingInteractionPayloadSchema = z12.object({
2018
- kind: z12.literal("user_question"),
2019
- questions: z12.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
2072
+ var userQuestionPendingInteractionPayloadSchema = z14.object({
2073
+ kind: z14.literal("user_question"),
2074
+ questions: z14.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
2020
2075
  USER_QUESTION_MAX_QUESTIONS,
2021
2076
  `User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
2022
2077
  )
@@ -2025,7 +2080,7 @@ var userQuestionPendingInteractionPayloadSchema = z12.object({
2025
2080
  payload.questions.forEach((question, index) => {
2026
2081
  if (questionIds.has(question.id)) {
2027
2082
  context.addIssue({
2028
- code: z12.ZodIssueCode.custom,
2083
+ code: z14.ZodIssueCode.custom,
2029
2084
  message: "User question ids must be unique",
2030
2085
  path: ["questions", index, "id"]
2031
2086
  });
@@ -2034,25 +2089,25 @@ var userQuestionPendingInteractionPayloadSchema = z12.object({
2034
2089
  questionIds.add(question.id);
2035
2090
  });
2036
2091
  });
2037
- var pluginPendingInteractionPayloadSchema = z12.object({
2038
- kind: z12.literal("plugin"),
2039
- title: z12.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2092
+ var pluginPendingInteractionPayloadSchema = z14.object({
2093
+ kind: z14.literal("plugin"),
2094
+ title: z14.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2040
2095
  data: jsonValueSchema,
2041
2096
  presentation: threadEventItemPresentationSchema.optional()
2042
2097
  });
2043
- var pluginExtensionInteractionRequestPayloadSchema = z12.object({
2098
+ var pluginExtensionInteractionRequestPayloadSchema = z14.object({
2044
2099
  kind: extensionKindSchema,
2045
- title: z12.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2100
+ title: z14.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
2046
2101
  data: jsonValueSchema.refine(
2047
2102
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
2048
2103
  { message: "Plugin request data exceeds 64 KiB" }
2049
2104
  )
2050
2105
  });
2051
- var interactionRequestPayloadSchema = z12.union([
2106
+ var interactionRequestPayloadSchema = z14.union([
2052
2107
  userQuestionPendingInteractionPayloadSchema,
2053
2108
  pluginExtensionInteractionRequestPayloadSchema
2054
2109
  ]);
2055
- var pendingInteractionPayloadSchema = z12.union([
2110
+ var pendingInteractionPayloadSchema = z14.union([
2056
2111
  approvalPendingInteractionPayloadSchema,
2057
2112
  userQuestionPendingInteractionPayloadSchema,
2058
2113
  pluginExtensionInteractionRequestPayloadSchema
@@ -2064,51 +2119,51 @@ function isUserQuestionPendingInteractionPayload(payload) {
2064
2119
  return payload.kind === "user_question";
2065
2120
  }
2066
2121
  var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
2067
- var approvalPendingInteractionResolutionSchema = z12.discriminatedUnion(
2122
+ var approvalPendingInteractionResolutionSchema = z14.discriminatedUnion(
2068
2123
  "decision",
2069
2124
  [
2070
- z12.object({
2071
- decision: z12.literal("allow_once"),
2125
+ z14.object({
2126
+ decision: z14.literal("allow_once"),
2072
2127
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
2073
2128
  }),
2074
- z12.object({
2075
- decision: z12.literal("allow_for_session"),
2129
+ z14.object({
2130
+ decision: z14.literal("allow_for_session"),
2076
2131
  grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
2077
2132
  }),
2078
- z12.object({
2079
- decision: z12.literal("deny")
2133
+ z14.object({
2134
+ decision: z14.literal("deny")
2080
2135
  })
2081
2136
  ],
2082
2137
  approvalDecisionDiscriminatorError
2083
2138
  );
2084
- var pendingInteractionUserAnswerSchema = z12.object({
2085
- selected: z12.array(z12.string().min(1)).max(
2139
+ var pendingInteractionUserAnswerSchema = z14.object({
2140
+ selected: z14.array(z14.string().min(1)).max(
2086
2141
  USER_QUESTION_MAX_SELECTED,
2087
2142
  `User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
2088
2143
  ),
2089
2144
  freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
2090
2145
  });
2091
- var userQuestionPendingInteractionResolutionSchema = z12.object({
2092
- kind: z12.literal("user_answer"),
2093
- answers: z12.record(z12.string().min(1), pendingInteractionUserAnswerSchema)
2146
+ var userQuestionPendingInteractionResolutionSchema = z14.object({
2147
+ kind: z14.literal("user_answer"),
2148
+ answers: z14.record(z14.string().min(1), pendingInteractionUserAnswerSchema)
2094
2149
  });
2095
- var pluginInteractionDescriptionSchema = z12.object({
2096
- title: z12.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH).optional(),
2097
- detail: z12.string().trim().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
2150
+ var pluginInteractionDescriptionSchema = z14.object({
2151
+ title: z14.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH).optional(),
2152
+ detail: z14.string().trim().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
2098
2153
  payload: jsonValueSchema.refine(
2099
2154
  (value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
2100
2155
  { message: "Plugin interaction description payload exceeds 64 KiB" }
2101
2156
  ).optional()
2102
2157
  });
2103
- var pluginPendingInteractionResolutionSchema = z12.object({
2104
- kind: z12.literal("plugin_submitted"),
2158
+ var pluginPendingInteractionResolutionSchema = z14.object({
2159
+ kind: z14.literal("plugin_submitted"),
2105
2160
  description: pluginInteractionDescriptionSchema.optional()
2106
2161
  });
2107
- var pluginExtensionInteractionResolutionSchema = z12.object({
2108
- kind: z12.literal("request_answer"),
2162
+ var pluginExtensionInteractionResolutionSchema = z14.object({
2163
+ kind: z14.literal("request_answer"),
2109
2164
  value: jsonValueSchema
2110
2165
  });
2111
- var pendingInteractionResolutionSchema = z12.union(
2166
+ var pendingInteractionResolutionSchema = z14.union(
2112
2167
  [
2113
2168
  approvalPendingInteractionResolutionSchema,
2114
2169
  userQuestionPendingInteractionResolutionSchema,
@@ -2123,19 +2178,19 @@ function isApprovalPendingInteractionResolution(resolution) {
2123
2178
  function isUserQuestionPendingInteractionResolution(resolution) {
2124
2179
  return "kind" in resolution && resolution.kind === "user_answer";
2125
2180
  }
2126
- var approvalInteractionOutcomeSchema = z12.object({
2181
+ var approvalInteractionOutcomeSchema = z14.object({
2127
2182
  payload: approvalPendingInteractionPayloadSchema,
2128
2183
  resolution: approvalPendingInteractionResolutionSchema
2129
2184
  });
2130
- var userQuestionInteractionOutcomeSchema = z12.object({
2185
+ var userQuestionInteractionOutcomeSchema = z14.object({
2131
2186
  payload: userQuestionPendingInteractionPayloadSchema,
2132
2187
  resolution: userQuestionPendingInteractionResolutionSchema
2133
2188
  });
2134
- var pluginExtensionInteractionOutcomeSchema = z12.object({
2189
+ var pluginExtensionInteractionOutcomeSchema = z14.object({
2135
2190
  payload: pluginExtensionInteractionRequestPayloadSchema,
2136
2191
  resolution: pluginExtensionInteractionResolutionSchema
2137
2192
  });
2138
- var providerInteractionOutcomeSchema = z12.union([
2193
+ var providerInteractionOutcomeSchema = z14.union([
2139
2194
  approvalInteractionOutcomeSchema,
2140
2195
  userQuestionInteractionOutcomeSchema,
2141
2196
  pluginExtensionInteractionOutcomeSchema
@@ -2143,39 +2198,39 @@ var providerInteractionOutcomeSchema = z12.union([
2143
2198
  function isApprovalInteractionOutcome(outcome) {
2144
2199
  return outcome.payload.kind === "approval";
2145
2200
  }
2146
- var pendingInteractionProviderOriginSchema = z12.object({
2147
- kind: z12.literal("provider"),
2148
- providerId: z12.string().min(1),
2149
- providerThreadId: z12.string().min(1),
2150
- providerRequestId: z12.string().min(1)
2151
- });
2152
- var pendingInteractionPluginOriginSchema = z12.object({
2153
- kind: z12.literal("plugin"),
2154
- pluginId: z12.string().min(1),
2155
- rendererId: z12.string().min(1)
2156
- });
2157
- var pendingInteractionCreateSchema = z12.object({
2158
- threadId: z12.string().min(1),
2159
- turnId: z12.string().min(1),
2160
- providerId: z12.string().min(1),
2161
- providerThreadId: z12.string().min(1),
2162
- providerRequestId: z12.string().min(1),
2201
+ var pendingInteractionProviderOriginSchema = z14.object({
2202
+ kind: z14.literal("provider"),
2203
+ providerId: z14.string().min(1),
2204
+ providerThreadId: z14.string().min(1),
2205
+ providerRequestId: z14.string().min(1)
2206
+ });
2207
+ var pendingInteractionPluginOriginSchema = z14.object({
2208
+ kind: z14.literal("plugin"),
2209
+ pluginId: z14.string().min(1),
2210
+ rendererId: z14.string().min(1)
2211
+ });
2212
+ var pendingInteractionCreateSchema = z14.object({
2213
+ threadId: z14.string().min(1),
2214
+ turnId: z14.string().min(1),
2215
+ providerId: z14.string().min(1),
2216
+ providerThreadId: z14.string().min(1),
2217
+ providerRequestId: z14.string().min(1),
2163
2218
  payload: pendingInteractionPayloadSchema
2164
2219
  });
2165
- var pendingInteractionBaseSchema = z12.object({
2166
- id: z12.string().min(1),
2167
- threadId: z12.string().min(1),
2220
+ var pendingInteractionBaseSchema = z14.object({
2221
+ id: z14.string().min(1),
2222
+ threadId: z14.string().min(1),
2168
2223
  status: pendingInteractionStatusSchema,
2169
- statusReason: z12.string().nullable(),
2170
- createdAt: z12.number().int().nonnegative(),
2171
- expiresAt: z12.number().int().nonnegative().nullable().optional(),
2172
- resolvedAt: z12.number().int().nonnegative().nullable()
2224
+ statusReason: z14.string().nullable(),
2225
+ createdAt: z14.number().int().nonnegative(),
2226
+ expiresAt: z14.number().int().nonnegative().nullable().optional(),
2227
+ resolvedAt: z14.number().int().nonnegative().nullable()
2173
2228
  });
2174
2229
  var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
2175
- turnId: z12.string().min(1),
2176
- providerId: z12.string().min(1),
2177
- providerThreadId: z12.string().min(1),
2178
- providerRequestId: z12.string().min(1),
2230
+ turnId: z14.string().min(1),
2231
+ providerId: z14.string().min(1),
2232
+ providerThreadId: z14.string().min(1),
2233
+ providerRequestId: z14.string().min(1),
2179
2234
  origin: pendingInteractionProviderOriginSchema.optional()
2180
2235
  });
2181
2236
  var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
@@ -2190,30 +2245,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
2190
2245
  payload: pluginExtensionInteractionRequestPayloadSchema,
2191
2246
  resolution: pluginExtensionInteractionResolutionSchema.nullable()
2192
2247
  });
2193
- var providerPendingInteractionSchema = z12.union([
2248
+ var providerPendingInteractionSchema = z14.union([
2194
2249
  approvalPendingInteractionSchema,
2195
2250
  userQuestionPendingInteractionSchema,
2196
2251
  pluginExtensionPendingInteractionSchema
2197
2252
  ]);
2198
2253
  var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
2199
- turnId: z12.string().min(1).nullable(),
2254
+ turnId: z14.string().min(1).nullable(),
2200
2255
  origin: pendingInteractionPluginOriginSchema,
2201
2256
  payload: pluginPendingInteractionPayloadSchema,
2202
2257
  resolution: pluginPendingInteractionResolutionSchema.nullable()
2203
2258
  });
2204
- var pendingInteractionSchema = z12.union([
2259
+ var pendingInteractionSchema = z14.union([
2205
2260
  providerPendingInteractionSchema,
2206
2261
  pluginPendingInteractionSchema
2207
2262
  ]);
2208
- var interactionLifecycleRecordBaseSchema = z12.object({
2209
- id: z12.string().min(1),
2263
+ var interactionLifecycleRecordBaseSchema = z14.object({
2264
+ id: z14.string().min(1),
2210
2265
  status: pendingInteractionStatusSchema,
2211
- statusReason: z12.string().nullable()
2266
+ statusReason: z14.string().nullable()
2212
2267
  });
2213
- var interactionLifecycleProviderOriginSchema = z12.object({
2214
- kind: z12.literal("provider"),
2215
- providerId: z12.string().min(1),
2216
- providerRequestId: z12.string().min(1)
2268
+ var interactionLifecycleProviderOriginSchema = z14.object({
2269
+ kind: z14.literal("provider"),
2270
+ providerId: z14.string().min(1),
2271
+ providerRequestId: z14.string().min(1)
2217
2272
  });
2218
2273
  var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
2219
2274
  var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
@@ -2238,87 +2293,18 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
2238
2293
  }),
2239
2294
  resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
2240
2295
  });
2241
- var interactionLifecycleSchema = z12.union([
2296
+ var interactionLifecycleSchema = z14.union([
2242
2297
  approvalInteractionLifecycleSchema,
2243
2298
  userQuestionInteractionLifecycleSchema,
2244
2299
  pluginInteractionLifecycleSchema,
2245
2300
  pluginExtensionInteractionLifecycleSchema
2246
2301
  ]);
2247
2302
 
2248
- // ../domain/src/protocol-ids.ts
2249
- import { z as z13 } from "zod";
2250
- var clientTurnRequestIdSchema = z13.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
2251
-
2252
- // ../domain/src/system-message.ts
2253
- import { z as z14 } from "zod";
2254
- var systemMessageKindValues = [
2255
- "ownership-assigned",
2256
- "ownership-removed",
2257
- "child-needs-attention",
2258
- "child-completed",
2259
- "child-failed",
2260
- "child-interrupted",
2261
- "child-outcome-batch",
2262
- "tool-result-delivered",
2263
- "environment-directory-updated",
2264
- "unlabeled"
2265
- ];
2266
- var systemMessageKindSchema = z14.enum(systemMessageKindValues);
2267
- var systemThreadInterruptedReasonSchema = z14.enum([
2268
- "manual-stop",
2269
- "host-daemon-restarted",
2270
- "host-removed",
2271
- "provider-turn-idle"
2272
- ]);
2273
- var childThreadOutcomeSchema = z14.object({
2274
- threadId: z14.string(),
2275
- status: z14.enum(["completed", "failed", "interrupted"]),
2276
- interruption: z14.object({
2277
- reason: systemThreadInterruptedReasonSchema,
2278
- cause: z14.literal("host-connection-lost").optional()
2279
- }).optional()
2280
- });
2281
- var systemMessageSubjectSchema = z14.discriminatedUnion("kind", [
2282
- z14.object({
2283
- kind: z14.literal("thread"),
2284
- threadId: z14.string(),
2285
- threadName: z14.string(),
2286
- outcomes: z14.array(childThreadOutcomeSchema).optional()
2287
- }),
2288
- z14.object({
2289
- kind: z14.literal("thread-batch"),
2290
- count: z14.number(),
2291
- outcomes: z14.array(childThreadOutcomeSchema).optional()
2292
- }),
2293
- z14.object({
2294
- kind: z14.literal("tool-call"),
2295
- toolName: z14.string(),
2296
- suppress: z14.boolean()
2297
- }),
2298
- z14.object({
2299
- kind: z14.literal("directory"),
2300
- path: z14.string()
2301
- })
2302
- ]);
2303
+ // ../domain/src/provider-event.ts
2304
+ import { z as z19 } from "zod";
2303
2305
 
2304
2306
  // ../domain/src/thread-events.ts
2305
- var systemEventTypeValues = [
2306
- "client/thread/start",
2307
- "client/turn/requested",
2308
- "client/turn/rejected",
2309
- "client/turn/start",
2310
- "system/error",
2311
- "system/manager/user_message",
2312
- "system/thread/interrupted",
2313
- "system/operation",
2314
- "system/interaction/lifecycle",
2315
- "system/permissionGrant/lifecycle",
2316
- "system/userQuestion/lifecycle",
2317
- "system/thread-provisioning",
2318
- // Legacy persisted watchdog diagnostic; retained for read/decode/render
2319
- // only, with no current producer.
2320
- "system/provider-turn-watchdog"
2321
- ];
2307
+ import { z as z15 } from "zod";
2322
2308
  var threadTurnInitiatorValues = ["user", "agent", "system"];
2323
2309
  var threadTurnInitiatorSchema = z15.enum(threadTurnInitiatorValues);
2324
2310
  var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
@@ -2665,15 +2651,22 @@ var threadTimelineGoalSchema = z17.object({
2665
2651
  timeUsedSeconds: z17.number()
2666
2652
  });
2667
2653
 
2654
+ // ../domain/src/thread-usage-cost.ts
2655
+ import { z as z18 } from "zod";
2656
+ var threadUsageCostSchema = z18.object({
2657
+ amount: z18.number().nonnegative(),
2658
+ currency: z18.string().min(1)
2659
+ });
2660
+
2668
2661
  // ../domain/src/provider-event.ts
2669
- var threadEventItemStatusSchema = z18.enum([
2662
+ var threadEventItemStatusSchema = z19.enum([
2670
2663
  "pending",
2671
2664
  "completed",
2672
2665
  "failed",
2673
2666
  "interrupted"
2674
2667
  ]);
2675
- var threadEventItemApprovalStatusSchema = z18.enum(["waiting_for_approval", "denied"]).nullable();
2676
- var threadEventTurnStatusSchema = z18.enum([
2668
+ var threadEventItemApprovalStatusSchema = z19.enum(["waiting_for_approval", "denied"]).nullable();
2669
+ var threadEventTurnStatusSchema = z19.enum([
2677
2670
  "completed",
2678
2671
  "failed",
2679
2672
  "interrupted"
@@ -2699,271 +2692,267 @@ var providerErrorCategoryValues = [
2699
2692
  "unauthorized",
2700
2693
  "unknown"
2701
2694
  ];
2702
- var providerErrorCategorySchema = z18.enum(providerErrorCategoryValues);
2703
- var providerErrorInfoSchema = z18.object({
2695
+ var providerErrorCategorySchema = z19.enum(providerErrorCategoryValues);
2696
+ var providerErrorInfoSchema = z19.object({
2704
2697
  category: providerErrorCategorySchema,
2705
- providerCode: z18.string().nullable(),
2706
- httpStatusCode: z18.number().nullable()
2698
+ providerCode: z19.string().nullable(),
2699
+ httpStatusCode: z19.number().nullable()
2707
2700
  });
2708
- var providerRateLimitStatusSchema = z18.enum([
2701
+ var providerRateLimitStatusSchema = z19.enum([
2709
2702
  "allowed",
2710
2703
  "warning",
2711
2704
  "blocked",
2712
2705
  "unknown"
2713
2706
  ]);
2714
- var providerRateLimitWindowSchema = z18.object({
2715
- providerKey: z18.string().min(1).nullable(),
2716
- label: z18.string().min(1).nullable(),
2707
+ var providerRateLimitWindowSchema = z19.object({
2708
+ providerKey: z19.string().min(1).nullable(),
2709
+ label: z19.string().min(1).nullable(),
2717
2710
  status: providerRateLimitStatusSchema,
2718
- resetsAtMs: z18.number().int().nonnegative().nullable()
2711
+ resetsAtMs: z19.number().int().nonnegative().nullable()
2719
2712
  });
2720
- var providerRateLimitStateSchema = z18.object({
2721
- providerId: z18.string().min(1),
2713
+ var providerRateLimitStateSchema = z19.object({
2714
+ providerId: z19.string().min(1),
2722
2715
  status: providerRateLimitStatusSchema,
2723
- kind: z18.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2724
- windows: z18.array(providerRateLimitWindowSchema),
2725
- reachedReason: z18.string().min(1).nullable(),
2726
- overageStatus: z18.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2727
- overageReason: z18.string().min(1).nullable()
2728
- });
2729
- var threadEventFileChangeKindSchema = z18.enum(["add", "delete", "update"]);
2730
- var threadEventFileChangeSchema = z18.object({
2731
- path: z18.string(),
2716
+ kind: z19.enum(["subscription-window", "credits", "spend-control", "unknown"]),
2717
+ windows: z19.array(providerRateLimitWindowSchema),
2718
+ reachedReason: z19.string().min(1).nullable(),
2719
+ overageStatus: z19.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
2720
+ overageReason: z19.string().min(1).nullable()
2721
+ });
2722
+ var threadEventFileChangeKindSchema = z19.enum(["add", "delete", "update"]);
2723
+ var threadEventFileChangeSchema = z19.object({
2724
+ path: z19.string(),
2732
2725
  kind: threadEventFileChangeKindSchema,
2733
- movePath: z18.string().optional(),
2734
- diff: z18.string().optional()
2726
+ movePath: z19.string().optional(),
2727
+ diff: z19.string().optional()
2735
2728
  });
2736
- var threadEventPlanStepStatusSchema = z18.enum([
2729
+ var threadEventPlanStepStatusSchema = z19.enum([
2737
2730
  "pending",
2738
2731
  "active",
2739
2732
  "completed",
2740
2733
  "failed"
2741
2734
  ]);
2742
- var threadEventPlanStepSchema = z18.object({
2743
- step: z18.string(),
2735
+ var threadEventPlanStepSchema = z19.object({
2736
+ step: z19.string(),
2744
2737
  status: threadEventPlanStepStatusSchema.optional()
2745
2738
  });
2746
2739
  var itemPresentationField = {
2747
2740
  presentation: threadEventItemPresentationSchema.optional()
2748
2741
  };
2749
- var threadEventWebSearchItemSchema = z18.object({
2750
- type: z18.literal("webSearch"),
2751
- id: z18.string(),
2752
- queries: z18.array(z18.string()).min(1),
2753
- resultText: z18.string().nullable(),
2742
+ var threadEventWebSearchItemSchema = z19.object({
2743
+ type: z19.literal("webSearch"),
2744
+ id: z19.string(),
2745
+ queries: z19.array(z19.string()).min(1),
2746
+ resultText: z19.string().nullable(),
2754
2747
  ...itemPresentationField,
2755
- parentToolCallId: z18.string().optional()
2756
- });
2757
- var threadEventWebFetchItemSchema = z18.object({
2758
- type: z18.literal("webFetch"),
2759
- id: z18.string(),
2760
- url: z18.string(),
2761
- prompt: z18.string().nullable(),
2762
- pattern: z18.string().nullable(),
2763
- resultText: z18.string().nullable(),
2748
+ parentToolCallId: z19.string().optional()
2749
+ });
2750
+ var threadEventWebFetchItemSchema = z19.object({
2751
+ type: z19.literal("webFetch"),
2752
+ id: z19.string(),
2753
+ url: z19.string(),
2754
+ prompt: z19.string().nullable(),
2755
+ pattern: z19.string().nullable(),
2756
+ resultText: z19.string().nullable(),
2764
2757
  ...itemPresentationField,
2765
- parentToolCallId: z18.string().optional()
2758
+ parentToolCallId: z19.string().optional()
2766
2759
  });
2767
- var threadEventImageViewItemSchema = z18.object({
2768
- type: z18.literal("imageView"),
2769
- id: z18.string(),
2770
- path: z18.string(),
2760
+ var threadEventImageViewItemSchema = z19.object({
2761
+ type: z19.literal("imageView"),
2762
+ id: z19.string(),
2763
+ path: z19.string(),
2771
2764
  ...itemPresentationField,
2772
- parentToolCallId: z18.string().optional()
2765
+ parentToolCallId: z19.string().optional()
2773
2766
  });
2774
- var threadEventFileReadItemSchema = z18.object({
2775
- type: z18.literal("fileRead"),
2776
- id: z18.string(),
2777
- path: z18.string(),
2778
- cmd: z18.string().optional(),
2767
+ var threadEventFileReadItemSchema = z19.object({
2768
+ type: z19.literal("fileRead"),
2769
+ id: z19.string(),
2770
+ path: z19.string(),
2771
+ cmd: z19.string().optional(),
2779
2772
  status: threadEventItemStatusSchema,
2780
2773
  ...itemPresentationField,
2781
- parentToolCallId: z18.string().optional()
2774
+ parentToolCallId: z19.string().optional()
2782
2775
  });
2783
- var threadEventSearchModeSchema = z18.enum(["content", "path", "list"]);
2784
- var threadEventSearchItemSchema = z18.object({
2785
- type: z18.literal("search"),
2786
- id: z18.string(),
2776
+ var threadEventSearchModeSchema = z19.enum(["content", "path", "list"]);
2777
+ var threadEventSearchItemSchema = z19.object({
2778
+ type: z19.literal("search"),
2779
+ id: z19.string(),
2787
2780
  mode: threadEventSearchModeSchema,
2788
- query: z18.string(),
2789
- path: z18.string().optional(),
2790
- cmd: z18.string().optional(),
2781
+ query: z19.string(),
2782
+ path: z19.string().optional(),
2783
+ cmd: z19.string().optional(),
2791
2784
  status: threadEventItemStatusSchema,
2792
2785
  ...itemPresentationField,
2793
- parentToolCallId: z18.string().optional()
2786
+ parentToolCallId: z19.string().optional()
2794
2787
  });
2795
- var threadEventDelegationItemSchema = z18.object({
2796
- type: z18.literal("delegation"),
2797
- id: z18.string(),
2798
- childRef: z18.string().min(1),
2799
- label: z18.string(),
2788
+ var threadEventDelegationItemSchema = z19.object({
2789
+ type: z19.literal("delegation"),
2790
+ id: z19.string(),
2791
+ childRef: z19.string().min(1),
2792
+ label: z19.string(),
2800
2793
  status: threadEventItemStatusSchema,
2801
- background: z18.boolean(),
2802
- summary: z18.string().optional(),
2794
+ background: z19.boolean(),
2795
+ summary: z19.string().optional(),
2803
2796
  ...itemPresentationField,
2804
- parentToolCallId: z18.string().optional()
2797
+ parentToolCallId: z19.string().optional()
2805
2798
  });
2806
- var threadEventPlanStepsItemSchema = z18.object({
2807
- type: z18.literal("planSteps"),
2808
- id: z18.string(),
2809
- steps: z18.array(threadEventPlanStepSchema),
2810
- explanation: z18.string().optional(),
2799
+ var threadEventPlanStepsItemSchema = z19.object({
2800
+ type: z19.literal("planSteps"),
2801
+ id: z19.string(),
2802
+ steps: z19.array(threadEventPlanStepSchema),
2803
+ explanation: z19.string().optional(),
2811
2804
  status: threadEventItemStatusSchema,
2812
2805
  ...itemPresentationField,
2813
- parentToolCallId: z18.string().optional()
2806
+ parentToolCallId: z19.string().optional()
2814
2807
  });
2815
- var threadEventExtensionItemSchema = z18.object({
2816
- type: z18.literal("extension"),
2817
- id: z18.string(),
2808
+ var threadEventExtensionItemSchema = z19.object({
2809
+ type: z19.literal("extension"),
2810
+ id: z19.string(),
2818
2811
  kind: extensionKindSchema,
2819
2812
  payload: jsonValueSchema,
2820
2813
  status: threadEventItemStatusSchema,
2821
2814
  presentation: threadEventItemPresentationSchema,
2822
- parentToolCallId: z18.string().optional()
2815
+ parentToolCallId: z19.string().optional()
2823
2816
  });
2824
- var threadEventTextTruncationSchema = z18.object({
2825
- originalLength: z18.number(),
2826
- retainedHeadLength: z18.number(),
2827
- retainedTailLength: z18.number(),
2828
- truncatedAt: z18.number()
2817
+ var threadEventTextTruncationSchema = z19.object({
2818
+ originalLength: z19.number(),
2819
+ retainedHeadLength: z19.number(),
2820
+ retainedTailLength: z19.number(),
2821
+ truncatedAt: z19.number()
2829
2822
  });
2830
- var threadEventItemTruncationSchema = z18.object({
2823
+ var threadEventItemTruncationSchema = z19.object({
2831
2824
  aggregatedOutput: threadEventTextTruncationSchema.optional(),
2832
2825
  result: threadEventTextTruncationSchema.optional(),
2833
2826
  resultText: threadEventTextTruncationSchema.optional()
2834
2827
  });
2835
- var threadEventImageGenerationItemSchema = z18.object({
2836
- type: z18.literal("imageGeneration"),
2837
- id: z18.string(),
2828
+ var threadEventImageGenerationItemSchema = z19.object({
2829
+ type: z19.literal("imageGeneration"),
2830
+ id: z19.string(),
2838
2831
  status: threadEventItemStatusSchema,
2839
- prompt: z18.string().nullable(),
2840
- path: z18.string().nullable(),
2841
- result: z18.string().optional(),
2842
- error: z18.string().nullable(),
2843
- transparentBackground: z18.boolean(),
2832
+ prompt: z19.string().nullable(),
2833
+ path: z19.string().nullable(),
2834
+ result: z19.string().optional(),
2835
+ error: z19.string().nullable(),
2836
+ transparentBackground: z19.boolean(),
2844
2837
  truncation: threadEventItemTruncationSchema.optional(),
2845
2838
  ...itemPresentationField,
2846
- parentToolCallId: z18.string().optional()
2839
+ parentToolCallId: z19.string().optional()
2847
2840
  });
2848
- var threadEventUserContentSchema = z18.discriminatedUnion("type", [
2849
- z18.object({ type: z18.literal("text"), text: z18.string() }),
2850
- z18.object({ type: z18.literal("image"), url: z18.string() }),
2851
- z18.object({ type: z18.literal("localImage"), path: z18.string() }),
2852
- z18.object({ type: z18.literal("localFile"), path: z18.string() })
2841
+ var threadEventUserContentSchema = z19.discriminatedUnion("type", [
2842
+ z19.object({ type: z19.literal("text"), text: z19.string() }),
2843
+ z19.object({ type: z19.literal("image"), url: z19.string() }),
2844
+ z19.object({ type: z19.literal("localImage"), path: z19.string() }),
2845
+ z19.object({ type: z19.literal("localFile"), path: z19.string() })
2853
2846
  ]);
2854
- var threadEventTokenUsageBreakdownSchema = z18.object({
2855
- totalTokens: z18.number(),
2856
- inputTokens: z18.number(),
2857
- cachedInputTokens: z18.number(),
2858
- cacheReadInputTokens: z18.number().nonnegative().optional(),
2859
- cacheWriteInputTokens: z18.number().nonnegative().optional(),
2860
- outputTokens: z18.number(),
2861
- reasoningOutputTokens: z18.number()
2862
- });
2863
- var threadUsageCostSchema = z18.object({
2864
- amount: z18.number().nonnegative(),
2865
- currency: z18.string().min(1)
2866
- });
2867
- var threadEventContextWindowUsageSchema = z18.object({
2847
+ var threadEventTokenUsageBreakdownSchema = z19.object({
2848
+ totalTokens: z19.number(),
2849
+ inputTokens: z19.number(),
2850
+ cachedInputTokens: z19.number(),
2851
+ cacheReadInputTokens: z19.number().nonnegative().optional(),
2852
+ cacheWriteInputTokens: z19.number().nonnegative().optional(),
2853
+ outputTokens: z19.number(),
2854
+ reasoningOutputTokens: z19.number()
2855
+ });
2856
+ var threadEventContextWindowUsageSchema = z19.object({
2868
2857
  snapshot: contextSnapshotSchema.optional(),
2869
- usedTokens: z18.number().nullable(),
2870
- modelContextWindow: z18.number().nullable(),
2871
- estimated: z18.boolean(),
2858
+ usedTokens: z19.number().nullable(),
2859
+ modelContextWindow: z19.number().nullable(),
2860
+ estimated: z19.boolean(),
2872
2861
  cost: threadUsageCostSchema.optional()
2873
2862
  });
2874
- var promptCacheTtlMsSchema = z18.number().int().positive();
2875
- var threadEventTokenUsageSchema = z18.object({
2863
+ var promptCacheTtlMsSchema = z19.number().int().positive();
2864
+ var threadEventTokenUsageSchema = z19.object({
2876
2865
  total: threadEventTokenUsageBreakdownSchema,
2877
2866
  last: threadEventTokenUsageBreakdownSchema,
2878
- modelContextWindow: z18.number().nullable(),
2867
+ modelContextWindow: z19.number().nullable(),
2879
2868
  promptCacheTtlMs: promptCacheTtlMsSchema.optional()
2880
2869
  });
2881
- var threadEventWarningCategorySchema = z18.enum([
2870
+ var threadEventWarningCategorySchema = z19.enum([
2882
2871
  "deprecation",
2883
2872
  "config",
2884
2873
  "general",
2885
2874
  "compaction-skipped"
2886
2875
  ]);
2887
- var providerRawEventSchema = z18.object({
2888
- jsonrpc: z18.literal("2.0"),
2889
- id: z18.union([z18.string(), z18.number()]).optional(),
2890
- method: z18.string(),
2876
+ var providerRawEventSchema = z19.object({
2877
+ jsonrpc: z19.literal("2.0"),
2878
+ id: z19.union([z19.string(), z19.number()]).optional(),
2879
+ method: z19.string(),
2891
2880
  params: jsonValueSchema.optional()
2892
2881
  });
2893
- var providerUnhandledEventSchema = z18.object({
2894
- type: z18.literal("provider/unhandled"),
2895
- threadId: z18.string(),
2896
- providerThreadId: z18.string(),
2897
- providerId: z18.string(),
2898
- rawType: z18.string(),
2882
+ var providerUnhandledEventSchema = z19.object({
2883
+ type: z19.literal("provider/unhandled"),
2884
+ threadId: z19.string(),
2885
+ providerThreadId: z19.string(),
2886
+ providerId: z19.string(),
2887
+ rawType: z19.string(),
2899
2888
  rawEvent: providerRawEventSchema,
2900
- parentToolCallId: z18.string().optional()
2901
- });
2902
- var toolCallProgressEventSchema = z18.object({
2903
- type: z18.literal("item/toolCall/progress"),
2904
- threadId: z18.string(),
2905
- providerThreadId: z18.string(),
2906
- itemId: z18.string(),
2907
- message: z18.string().optional(),
2908
- parentToolCallId: z18.string().optional()
2909
- });
2910
- var threadEventBackgroundTaskItemSchema = z18.object({
2911
- type: z18.literal("backgroundTask"),
2912
- id: z18.string(),
2913
- familyId: z18.string().optional(),
2914
- taskType: z18.string(),
2915
- description: z18.string(),
2889
+ parentToolCallId: z19.string().optional()
2890
+ });
2891
+ var toolCallProgressEventSchema = z19.object({
2892
+ type: z19.literal("item/toolCall/progress"),
2893
+ threadId: z19.string(),
2894
+ providerThreadId: z19.string(),
2895
+ itemId: z19.string(),
2896
+ message: z19.string().optional(),
2897
+ parentToolCallId: z19.string().optional()
2898
+ });
2899
+ var threadEventBackgroundTaskItemSchema = z19.object({
2900
+ type: z19.literal("backgroundTask"),
2901
+ id: z19.string(),
2902
+ familyId: z19.string().optional(),
2903
+ taskType: z19.string(),
2904
+ description: z19.string(),
2916
2905
  status: threadEventItemStatusSchema,
2917
2906
  taskStatus: backgroundTaskStatusSchema,
2918
- skipTranscript: z18.boolean(),
2919
- foreground: z18.boolean(),
2920
- workflowName: z18.string().optional(),
2907
+ skipTranscript: z19.boolean(),
2908
+ foreground: z19.boolean(),
2909
+ workflowName: z19.string().optional(),
2921
2910
  workflow: workflowProgressSnapshotSchema.optional(),
2922
2911
  usage: backgroundTaskUsageSchema.optional(),
2923
- summary: z18.string().optional(),
2924
- error: z18.string().optional(),
2925
- outputFile: z18.string().optional(),
2912
+ summary: z19.string().optional(),
2913
+ error: z19.string().optional(),
2914
+ outputFile: z19.string().optional(),
2926
2915
  ...itemPresentationField,
2927
- parentToolCallId: z18.string().optional()
2916
+ parentToolCallId: z19.string().optional()
2928
2917
  });
2929
- var threadEventItemSchema = z18.discriminatedUnion("type", [
2930
- z18.object({
2931
- type: z18.literal("userMessage"),
2932
- id: z18.string(),
2933
- content: z18.array(threadEventUserContentSchema),
2918
+ var threadEventItemSchema = z19.discriminatedUnion("type", [
2919
+ z19.object({
2920
+ type: z19.literal("userMessage"),
2921
+ id: z19.string(),
2922
+ content: z19.array(threadEventUserContentSchema),
2934
2923
  clientRequestId: clientTurnRequestIdSchema.optional(),
2935
- parentToolCallId: z18.string().optional()
2924
+ parentToolCallId: z19.string().optional()
2936
2925
  }).strict(),
2937
- z18.object({
2938
- type: z18.literal("agentMessage"),
2939
- id: z18.string(),
2940
- text: z18.string(),
2926
+ z19.object({
2927
+ type: z19.literal("agentMessage"),
2928
+ id: z19.string(),
2929
+ text: z19.string(),
2941
2930
  ...itemPresentationField,
2942
- parentToolCallId: z18.string().optional()
2931
+ parentToolCallId: z19.string().optional()
2943
2932
  }),
2944
- z18.object({
2945
- type: z18.literal("commandExecution"),
2946
- id: z18.string(),
2947
- command: z18.string(),
2948
- cwd: z18.string(),
2933
+ z19.object({
2934
+ type: z19.literal("commandExecution"),
2935
+ id: z19.string(),
2936
+ command: z19.string(),
2937
+ cwd: z19.string(),
2949
2938
  status: threadEventItemStatusSchema,
2950
2939
  approvalStatus: threadEventItemApprovalStatusSchema,
2951
- aggregatedOutput: z18.string().optional(),
2952
- exitCode: z18.number().optional(),
2953
- durationMs: z18.number().optional(),
2940
+ aggregatedOutput: z19.string().optional(),
2941
+ exitCode: z19.number().optional(),
2942
+ durationMs: z19.number().optional(),
2954
2943
  truncation: threadEventItemTruncationSchema.optional(),
2955
2944
  ...itemPresentationField,
2956
- parentToolCallId: z18.string().optional()
2945
+ parentToolCallId: z19.string().optional()
2957
2946
  }),
2958
- z18.object({
2959
- type: z18.literal("fileChange"),
2960
- id: z18.string(),
2961
- changes: z18.array(threadEventFileChangeSchema),
2947
+ z19.object({
2948
+ type: z19.literal("fileChange"),
2949
+ id: z19.string(),
2950
+ changes: z19.array(threadEventFileChangeSchema),
2962
2951
  status: threadEventItemStatusSchema,
2963
2952
  approvalStatus: threadEventItemApprovalStatusSchema,
2964
- error: z18.string().optional(),
2953
+ error: z19.string().optional(),
2965
2954
  ...itemPresentationField,
2966
- parentToolCallId: z18.string().optional()
2955
+ parentToolCallId: z19.string().optional()
2967
2956
  }),
2968
2957
  threadEventWebSearchItemSchema,
2969
2958
  threadEventWebFetchItemSchema,
@@ -2971,411 +2960,394 @@ var threadEventItemSchema = z18.discriminatedUnion("type", [
2971
2960
  threadEventImageGenerationItemSchema,
2972
2961
  threadEventFileReadItemSchema,
2973
2962
  threadEventSearchItemSchema,
2974
- z18.object({
2975
- type: z18.literal("toolCall"),
2976
- id: z18.string(),
2977
- server: z18.string().optional(),
2978
- tool: z18.string(),
2979
- arguments: z18.record(z18.string(), z18.unknown()).optional(),
2963
+ z19.object({
2964
+ type: z19.literal("toolCall"),
2965
+ id: z19.string(),
2966
+ server: z19.string().optional(),
2967
+ tool: z19.string(),
2968
+ arguments: z19.record(z19.string(), z19.unknown()).optional(),
2980
2969
  status: threadEventItemStatusSchema,
2981
- result: z18.unknown().optional(),
2982
- error: z18.string().optional(),
2983
- durationMs: z18.number().optional(),
2970
+ result: z19.unknown().optional(),
2971
+ error: z19.string().optional(),
2972
+ durationMs: z19.number().optional(),
2984
2973
  truncation: threadEventItemTruncationSchema.optional(),
2985
2974
  ...itemPresentationField,
2986
- parentToolCallId: z18.string().optional()
2975
+ parentToolCallId: z19.string().optional()
2987
2976
  }),
2988
- z18.object({
2989
- type: z18.literal("reasoning"),
2990
- id: z18.string(),
2991
- summary: z18.array(z18.string()),
2992
- content: z18.array(z18.string()),
2977
+ z19.object({
2978
+ type: z19.literal("reasoning"),
2979
+ id: z19.string(),
2980
+ summary: z19.array(z19.string()),
2981
+ content: z19.array(z19.string()),
2993
2982
  ...itemPresentationField,
2994
- parentToolCallId: z18.string().optional()
2983
+ parentToolCallId: z19.string().optional()
2995
2984
  }),
2996
- z18.object({
2997
- type: z18.literal("plan"),
2998
- id: z18.string(),
2999
- text: z18.string(),
2985
+ z19.object({
2986
+ type: z19.literal("plan"),
2987
+ id: z19.string(),
2988
+ text: z19.string(),
3000
2989
  ...itemPresentationField,
3001
- parentToolCallId: z18.string().optional()
2990
+ parentToolCallId: z19.string().optional()
3002
2991
  }),
3003
2992
  threadEventPlanStepsItemSchema,
3004
- z18.object({
3005
- type: z18.literal("contextCompaction"),
3006
- id: z18.string(),
2993
+ z19.object({
2994
+ type: z19.literal("contextCompaction"),
2995
+ id: z19.string(),
3007
2996
  ...itemPresentationField,
3008
- parentToolCallId: z18.string().optional()
2997
+ parentToolCallId: z19.string().optional()
3009
2998
  }),
3010
2999
  threadEventBackgroundTaskItemSchema,
3011
3000
  threadEventDelegationItemSchema,
3012
3001
  threadEventExtensionItemSchema
3013
3002
  ]);
3014
3003
  function itemTextDeltaEventSchema(type) {
3015
- return z18.object({
3016
- type: z18.literal(type),
3017
- threadId: z18.string(),
3018
- providerThreadId: z18.string(),
3019
- itemId: z18.string(),
3020
- delta: z18.string(),
3021
- parentToolCallId: z18.string().optional()
3004
+ return z19.object({
3005
+ type: z19.literal(type),
3006
+ threadId: z19.string(),
3007
+ providerThreadId: z19.string(),
3008
+ itemId: z19.string(),
3009
+ delta: z19.string(),
3010
+ parentToolCallId: z19.string().optional()
3022
3011
  });
3023
3012
  }
3024
- var unscopedProviderEventSchema = z18.discriminatedUnion("type", [
3025
- z18.object({
3026
- type: z18.literal("thread/started"),
3027
- threadId: z18.string()
3013
+ var unscopedProviderEventSchema = z19.discriminatedUnion("type", [
3014
+ z19.object({
3015
+ type: z19.literal("thread/started"),
3016
+ threadId: z19.string()
3028
3017
  }),
3029
- z18.object({
3030
- type: z18.literal("thread/identity"),
3031
- threadId: z18.string(),
3032
- providerThreadId: z18.string()
3018
+ z19.object({
3019
+ type: z19.literal("thread/identity"),
3020
+ threadId: z19.string(),
3021
+ providerThreadId: z19.string()
3033
3022
  }),
3034
- z18.object({
3035
- type: z18.literal("turn/started"),
3036
- threadId: z18.string(),
3037
- providerThreadId: z18.string(),
3038
- parentToolCallId: z18.string().optional()
3023
+ z19.object({
3024
+ type: z19.literal("turn/started"),
3025
+ threadId: z19.string(),
3026
+ providerThreadId: z19.string(),
3027
+ parentToolCallId: z19.string().optional()
3039
3028
  }),
3040
- z18.object({
3041
- type: z18.literal("turn/completed"),
3042
- threadId: z18.string(),
3043
- providerThreadId: z18.string().nullable(),
3029
+ z19.object({
3030
+ type: z19.literal("turn/completed"),
3031
+ threadId: z19.string(),
3032
+ providerThreadId: z19.string().nullable(),
3044
3033
  status: threadEventTurnStatusSchema,
3045
- error: z18.object({ message: z18.string() }).optional(),
3046
- providerCheckpointId: z18.string().min(1).optional()
3034
+ error: z19.object({ message: z19.string() }).optional(),
3035
+ providerCheckpointId: z19.string().min(1).optional()
3047
3036
  }),
3048
- z18.object({
3049
- type: z18.literal("turn/input/accepted"),
3050
- threadId: z18.string(),
3051
- providerThreadId: z18.string(),
3037
+ z19.object({
3038
+ type: z19.literal("turn/input/accepted"),
3039
+ threadId: z19.string(),
3040
+ providerThreadId: z19.string(),
3052
3041
  clientRequestId: clientTurnRequestIdSchema,
3053
3042
  scope: threadEventScopeSchema
3054
3043
  }).strict(),
3055
- z18.object({
3056
- type: z18.literal("thread/name/updated"),
3057
- threadId: z18.string(),
3058
- providerThreadId: z18.string(),
3059
- threadName: z18.string(),
3060
- source: z18.literal("agent").optional()
3044
+ z19.object({
3045
+ type: z19.literal("thread/name/updated"),
3046
+ threadId: z19.string(),
3047
+ providerThreadId: z19.string(),
3048
+ threadName: z19.string(),
3049
+ source: z19.literal("agent").optional()
3061
3050
  }),
3062
- z18.object({
3063
- type: z18.literal("thread/compacted"),
3064
- threadId: z18.string(),
3065
- providerThreadId: z18.string()
3051
+ z19.object({
3052
+ type: z19.literal("thread/compacted"),
3053
+ threadId: z19.string(),
3054
+ providerThreadId: z19.string()
3066
3055
  }),
3067
- z18.object({
3068
- type: z18.literal("thread/context/cleared"),
3069
- threadId: z18.string(),
3070
- providerThreadId: z18.string()
3056
+ z19.object({
3057
+ type: z19.literal("thread/context/cleared"),
3058
+ threadId: z19.string(),
3059
+ providerThreadId: z19.string()
3071
3060
  }),
3072
- z18.object({
3073
- type: z18.literal("thread/goal/updated"),
3074
- threadId: z18.string(),
3075
- providerThreadId: z18.string(),
3076
- objective: z18.string(),
3061
+ z19.object({
3062
+ type: z19.literal("thread/goal/updated"),
3063
+ threadId: z19.string(),
3064
+ providerThreadId: z19.string(),
3065
+ objective: z19.string(),
3077
3066
  status: threadTimelineGoalStatusSchema,
3078
- tokenBudget: z18.number().nullable(),
3079
- tokensUsed: z18.number(),
3080
- timeUsedSeconds: z18.number()
3067
+ tokenBudget: z19.number().nullable(),
3068
+ tokensUsed: z19.number(),
3069
+ timeUsedSeconds: z19.number()
3081
3070
  }),
3082
- z18.object({
3083
- type: z18.literal("thread/goal/cleared"),
3084
- threadId: z18.string(),
3085
- providerThreadId: z18.string()
3071
+ z19.object({
3072
+ type: z19.literal("thread/goal/cleared"),
3073
+ threadId: z19.string(),
3074
+ providerThreadId: z19.string()
3086
3075
  }),
3087
- z18.object({
3088
- type: z18.literal("item/started"),
3089
- threadId: z18.string(),
3090
- providerThreadId: z18.string(),
3076
+ z19.object({
3077
+ type: z19.literal("item/started"),
3078
+ threadId: z19.string(),
3079
+ providerThreadId: z19.string(),
3091
3080
  item: threadEventItemSchema
3092
3081
  }),
3093
- z18.object({
3094
- type: z18.literal("item/completed"),
3095
- threadId: z18.string(),
3096
- providerThreadId: z18.string(),
3082
+ z19.object({
3083
+ type: z19.literal("item/completed"),
3084
+ threadId: z19.string(),
3085
+ providerThreadId: z19.string(),
3097
3086
  item: threadEventItemSchema
3098
3087
  }),
3099
3088
  itemTextDeltaEventSchema("item/agentMessage/delta"),
3100
- z18.object({
3101
- type: z18.literal("item/commandExecution/outputDelta"),
3102
- threadId: z18.string(),
3103
- providerThreadId: z18.string(),
3104
- itemId: z18.string(),
3105
- delta: z18.string(),
3106
- reset: z18.boolean().optional(),
3107
- parentToolCallId: z18.string().optional()
3089
+ z19.object({
3090
+ type: z19.literal("item/commandExecution/outputDelta"),
3091
+ threadId: z19.string(),
3092
+ providerThreadId: z19.string(),
3093
+ itemId: z19.string(),
3094
+ delta: z19.string(),
3095
+ reset: z19.boolean().optional(),
3096
+ parentToolCallId: z19.string().optional()
3108
3097
  }),
3109
3098
  itemTextDeltaEventSchema("item/fileChange/outputDelta"),
3110
3099
  itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
3111
3100
  itemTextDeltaEventSchema("item/reasoning/textDelta"),
3112
3101
  itemTextDeltaEventSchema("item/plan/delta"),
3113
- z18.object({
3114
- type: z18.literal("item/mcpToolCall/progress"),
3115
- threadId: z18.string(),
3116
- providerThreadId: z18.string(),
3117
- itemId: z18.string(),
3118
- message: z18.string().optional(),
3119
- parentToolCallId: z18.string().optional()
3102
+ z19.object({
3103
+ type: z19.literal("item/mcpToolCall/progress"),
3104
+ threadId: z19.string(),
3105
+ providerThreadId: z19.string(),
3106
+ itemId: z19.string(),
3107
+ message: z19.string().optional(),
3108
+ parentToolCallId: z19.string().optional()
3120
3109
  }),
3121
3110
  toolCallProgressEventSchema,
3122
- z18.object({
3123
- type: z18.literal("item/backgroundTask/progress"),
3124
- threadId: z18.string(),
3125
- providerThreadId: z18.string(),
3111
+ z19.object({
3112
+ type: z19.literal("item/backgroundTask/progress"),
3113
+ threadId: z19.string(),
3114
+ providerThreadId: z19.string(),
3126
3115
  item: threadEventBackgroundTaskItemSchema
3127
3116
  }),
3128
- z18.object({
3129
- type: z18.literal("item/backgroundTask/completed"),
3130
- threadId: z18.string(),
3131
- providerThreadId: z18.string(),
3117
+ z19.object({
3118
+ type: z19.literal("item/backgroundTask/completed"),
3119
+ threadId: z19.string(),
3120
+ providerThreadId: z19.string(),
3132
3121
  item: threadEventBackgroundTaskItemSchema
3133
3122
  }),
3134
- z18.object({
3135
- type: z18.literal("item/delegation/progress"),
3136
- threadId: z18.string(),
3137
- providerThreadId: z18.string(),
3123
+ z19.object({
3124
+ type: z19.literal("item/delegation/progress"),
3125
+ threadId: z19.string(),
3126
+ providerThreadId: z19.string(),
3138
3127
  item: threadEventDelegationItemSchema
3139
3128
  }),
3140
- z18.object({
3141
- type: z18.literal("item/delegation/completed"),
3142
- threadId: z18.string(),
3143
- providerThreadId: z18.string(),
3129
+ z19.object({
3130
+ type: z19.literal("item/delegation/completed"),
3131
+ threadId: z19.string(),
3132
+ providerThreadId: z19.string(),
3144
3133
  item: threadEventDelegationItemSchema
3145
3134
  }),
3146
- z18.object({
3147
- type: z18.literal("thread/tokenUsage/updated"),
3148
- threadId: z18.string(),
3149
- providerThreadId: z18.string(),
3135
+ z19.object({
3136
+ type: z19.literal("thread/tokenUsage/updated"),
3137
+ threadId: z19.string(),
3138
+ providerThreadId: z19.string(),
3150
3139
  tokenUsage: threadEventTokenUsageSchema
3151
3140
  }),
3152
- z18.object({
3153
- type: z18.literal("thread/contextWindowUsage/updated"),
3154
- threadId: z18.string(),
3155
- providerThreadId: z18.string(),
3141
+ z19.object({
3142
+ type: z19.literal("thread/contextWindowUsage/updated"),
3143
+ threadId: z19.string(),
3144
+ providerThreadId: z19.string(),
3156
3145
  contextWindowUsage: threadEventContextWindowUsageSchema
3157
3146
  }),
3158
- z18.object({
3159
- type: z18.literal("turn/plan/updated"),
3160
- threadId: z18.string(),
3161
- providerThreadId: z18.string(),
3162
- plan: z18.array(threadEventPlanStepSchema),
3163
- explanation: z18.string().optional()
3147
+ z19.object({
3148
+ type: z19.literal("turn/plan/updated"),
3149
+ threadId: z19.string(),
3150
+ providerThreadId: z19.string(),
3151
+ plan: z19.array(threadEventPlanStepSchema),
3152
+ explanation: z19.string().optional()
3164
3153
  }),
3165
- z18.object({
3166
- type: z18.literal("turn/mainRun/updated"),
3167
- threadId: z18.string(),
3168
- providerThreadId: z18.string(),
3169
- state: z18.enum(["idle", "running"])
3154
+ z19.object({
3155
+ type: z19.literal("turn/mainRun/updated"),
3156
+ threadId: z19.string(),
3157
+ providerThreadId: z19.string(),
3158
+ state: z19.enum(["idle", "running"])
3170
3159
  }),
3171
- z18.object({
3172
- type: z18.literal("turn/diff/updated"),
3173
- threadId: z18.string(),
3174
- providerThreadId: z18.string(),
3175
- diff: z18.string().optional()
3160
+ z19.object({
3161
+ type: z19.literal("turn/diff/updated"),
3162
+ threadId: z19.string(),
3163
+ providerThreadId: z19.string(),
3164
+ diff: z19.string().optional()
3176
3165
  }),
3177
- z18.object({
3178
- type: z18.literal("provider/error"),
3179
- threadId: z18.string(),
3180
- providerThreadId: z18.string(),
3181
- message: z18.string(),
3182
- detail: z18.string().optional(),
3183
- willRetry: z18.boolean().optional(),
3166
+ z19.object({
3167
+ type: z19.literal("provider/error"),
3168
+ threadId: z19.string(),
3169
+ providerThreadId: z19.string(),
3170
+ message: z19.string(),
3171
+ detail: z19.string().optional(),
3172
+ willRetry: z19.boolean().optional(),
3184
3173
  errorInfo: providerErrorInfoSchema.optional()
3185
3174
  }),
3186
- z18.object({
3187
- type: z18.literal("provider/rateLimits/updated"),
3188
- threadId: z18.string(),
3189
- providerThreadId: z18.string(),
3175
+ z19.object({
3176
+ type: z19.literal("provider/rateLimits/updated"),
3177
+ threadId: z19.string(),
3178
+ providerThreadId: z19.string(),
3190
3179
  rateLimits: providerRateLimitStateSchema
3191
3180
  }),
3192
- z18.object({
3193
- type: z18.literal("provider.env-resolved"),
3194
- threadId: z18.string(),
3195
- providerThreadId: z18.string(),
3196
- entries: z18.array(
3197
- z18.object({
3198
- name: z18.string(),
3199
- source: z18.union([
3200
- z18.literal("shell"),
3201
- z18.object({ plugin: z18.string() }).strict(),
3202
- z18.object({
3203
- core: z18.enum([
3181
+ z19.object({
3182
+ type: z19.literal("provider.env-resolved"),
3183
+ threadId: z19.string(),
3184
+ providerThreadId: z19.string(),
3185
+ entries: z19.array(
3186
+ z19.object({
3187
+ name: z19.string(),
3188
+ source: z19.union([
3189
+ z19.literal("shell"),
3190
+ z19.object({ plugin: z19.string() }).strict(),
3191
+ z19.object({
3192
+ core: z19.enum([
3204
3193
  "machine-git",
3205
3194
  "machine-environment",
3206
3195
  "project-environment"
3207
3196
  ])
3208
3197
  }).strict()
3209
3198
  ]),
3210
- value: z18.union([
3211
- z18.string(),
3212
- z18.object({ masked: z18.literal(true) }).strict()
3199
+ value: z19.union([
3200
+ z19.string(),
3201
+ z19.object({ masked: z19.literal(true) }).strict()
3213
3202
  ]),
3214
- reason: z18.string().optional()
3203
+ reason: z19.string().optional()
3215
3204
  }).strict()
3216
3205
  )
3217
3206
  }),
3218
- z18.object({
3219
- type: z18.literal("thread/extensionState/updated"),
3220
- threadId: z18.string(),
3221
- providerThreadId: z18.string(),
3207
+ z19.object({
3208
+ type: z19.literal("thread/extensionState/updated"),
3209
+ threadId: z19.string(),
3210
+ providerThreadId: z19.string(),
3222
3211
  kind: extensionKindSchema,
3223
3212
  payload: jsonValueSchema
3224
3213
  }),
3225
- z18.object({
3226
- type: z18.literal("provider/warning"),
3227
- threadId: z18.string(),
3228
- providerThreadId: z18.string(),
3214
+ z19.object({
3215
+ type: z19.literal("provider/warning"),
3216
+ threadId: z19.string(),
3217
+ providerThreadId: z19.string(),
3229
3218
  category: threadEventWarningCategorySchema,
3230
- summary: z18.string().optional(),
3231
- details: z18.string().optional()
3219
+ summary: z19.string().optional(),
3220
+ details: z19.string().optional()
3232
3221
  }),
3233
- z18.object({
3234
- type: z18.literal("provider/modelFallback"),
3235
- threadId: z18.string(),
3236
- providerThreadId: z18.string(),
3237
- originalModel: z18.string().min(1),
3238
- fallbackModel: z18.string().min(1),
3239
- reason: z18.enum(["refusal", "provider"]),
3240
- message: z18.string()
3222
+ z19.object({
3223
+ type: z19.literal("provider/modelFallback"),
3224
+ threadId: z19.string(),
3225
+ providerThreadId: z19.string(),
3226
+ originalModel: z19.string().min(1),
3227
+ fallbackModel: z19.string().min(1),
3228
+ reason: z19.enum(["refusal", "provider"]),
3229
+ message: z19.string()
3241
3230
  }),
3242
3231
  providerUnhandledEventSchema
3243
3232
  ]);
3244
- var scopedEventDataSchema = z18.object({
3233
+ var scopedEventDataSchema = z19.object({
3245
3234
  scope: threadEventScopeSchema
3246
3235
  });
3247
3236
  var providerEventSchema = unscopedProviderEventSchema.and(
3248
3237
  scopedEventDataSchema
3249
3238
  );
3250
- var providerEventTypeValues = unscopedProviderEventSchema.options.map(
3251
- (option) => option.shape.type.value
3252
- );
3253
- var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
3254
- z18.object({
3255
- type: z18.literal("client/thread/start"),
3256
- threadId: z18.string()
3239
+ var unscopedSystemEventSchema = z19.discriminatedUnion("type", [
3240
+ z19.object({
3241
+ type: z19.literal("client/thread/start"),
3242
+ threadId: z19.string()
3257
3243
  }).merge(clientTurnLifecycleEventDataSchema),
3258
- z18.object({
3259
- type: z18.literal("client/turn/requested"),
3260
- threadId: z18.string()
3244
+ z19.object({
3245
+ type: z19.literal("client/turn/requested"),
3246
+ threadId: z19.string()
3261
3247
  }).merge(turnRequestEventDataSchema),
3262
- z18.object({
3263
- type: z18.literal("client/turn/rejected"),
3264
- threadId: z18.string()
3248
+ z19.object({
3249
+ type: z19.literal("client/turn/rejected"),
3250
+ threadId: z19.string()
3265
3251
  }).merge(turnRequestRejectedEventDataSchema),
3266
- z18.object({
3267
- type: z18.literal("client/turn/start"),
3268
- threadId: z18.string()
3252
+ z19.object({
3253
+ type: z19.literal("client/turn/start"),
3254
+ threadId: z19.string()
3269
3255
  }).merge(clientTurnLifecycleEventDataSchema),
3270
- z18.object({
3271
- type: z18.literal("system/error"),
3272
- threadId: z18.string()
3256
+ z19.object({
3257
+ type: z19.literal("system/error"),
3258
+ threadId: z19.string()
3273
3259
  }).merge(systemErrorEventDataSchema),
3274
- z18.object({
3275
- type: z18.literal("system/manager/user_message"),
3276
- threadId: z18.string()
3260
+ z19.object({
3261
+ type: z19.literal("system/manager/user_message"),
3262
+ threadId: z19.string()
3277
3263
  }).merge(systemLegacyUserMessageEventDataSchema),
3278
- z18.object({
3279
- type: z18.literal("system/thread/interrupted"),
3280
- threadId: z18.string()
3264
+ z19.object({
3265
+ type: z19.literal("system/thread/interrupted"),
3266
+ threadId: z19.string()
3281
3267
  }).merge(systemThreadInterruptedEventDataSchema),
3282
- z18.object({
3283
- type: z18.literal("system/operation"),
3284
- threadId: z18.string()
3268
+ z19.object({
3269
+ type: z19.literal("system/operation"),
3270
+ threadId: z19.string()
3285
3271
  }).merge(systemOperationEventDataSchema),
3286
- z18.object({
3287
- type: z18.literal("system/interaction/lifecycle"),
3288
- threadId: z18.string()
3272
+ z19.object({
3273
+ type: z19.literal("system/interaction/lifecycle"),
3274
+ threadId: z19.string()
3289
3275
  }).merge(systemInteractionLifecycleEventDataSchema),
3290
- z18.object({
3291
- type: z18.literal("system/permissionGrant/lifecycle"),
3292
- threadId: z18.string()
3276
+ z19.object({
3277
+ type: z19.literal("system/permissionGrant/lifecycle"),
3278
+ threadId: z19.string()
3293
3279
  }).merge(systemPermissionGrantLifecycleEventDataSchema),
3294
- z18.object({
3295
- type: z18.literal("system/userQuestion/lifecycle"),
3296
- threadId: z18.string()
3280
+ z19.object({
3281
+ type: z19.literal("system/userQuestion/lifecycle"),
3282
+ threadId: z19.string()
3297
3283
  }).merge(systemUserQuestionLifecycleEventDataSchema),
3298
- z18.object({
3299
- type: z18.literal("system/thread-provisioning"),
3300
- threadId: z18.string()
3284
+ z19.object({
3285
+ type: z19.literal("system/thread-provisioning"),
3286
+ threadId: z19.string()
3301
3287
  }).merge(systemThreadProvisioningEventDataSchema),
3302
- z18.object({
3303
- type: z18.literal("system/provider-turn-watchdog"),
3304
- threadId: z18.string()
3288
+ z19.object({
3289
+ type: z19.literal("system/provider-turn-watchdog"),
3290
+ threadId: z19.string()
3305
3291
  }).merge(systemProviderTurnWatchdogEventDataSchema)
3306
3292
  ]);
3307
3293
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
3308
- var threadEventSchema = z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3294
+ var threadEventSchema = z19.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3309
3295
  const result = validateThreadEventScope({
3310
3296
  type: event.type,
3311
3297
  scope: event.scope
3312
3298
  });
3313
3299
  if (!result.valid) {
3314
3300
  ctx.addIssue({
3315
- code: z18.ZodIssueCode.custom,
3301
+ code: z19.ZodIssueCode.custom,
3316
3302
  message: result.message ?? "Invalid thread event scope",
3317
3303
  path: ["scope"]
3318
3304
  });
3319
3305
  return;
3320
3306
  }
3321
3307
  });
3322
- var threadEventTypeValues = [
3323
- ...providerEventTypeValues,
3324
- ...systemEventTypeValues
3325
- ];
3326
- var threadEventTypeSet = new Set(threadEventTypeValues);
3327
- var threadEventTypeSchema = z18.string().refine(
3328
- (value) => threadEventTypeSet.has(value),
3329
- "Invalid thread event type"
3330
- );
3331
-
3332
- // ../domain/src/number-utils.ts
3333
- function toPositiveNumber(value) {
3334
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
3335
- }
3336
3308
 
3337
3309
  // ../domain/src/thread-provider-state.ts
3338
- import { z as z19 } from "zod";
3310
+ import { z as z20 } from "zod";
3339
3311
  var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
3340
3312
  var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
3341
- var threadProviderCommandSchema = z19.object({
3342
- name: z19.string().min(1),
3343
- description: z19.string(),
3344
- inputHint: z19.string().min(1).optional()
3313
+ var threadProviderCommandSchema = z20.object({
3314
+ name: z20.string().min(1),
3315
+ description: z20.string(),
3316
+ inputHint: z20.string().min(1).optional()
3345
3317
  });
3346
- var threadProviderCommandsStateSchema = z19.object({
3347
- commands: z19.array(threadProviderCommandSchema).max(500)
3318
+ var threadProviderCommandsStateSchema = z20.object({
3319
+ commands: z20.array(threadProviderCommandSchema).max(500)
3348
3320
  });
3349
- var threadSessionOptionValueSchema = z19.object({
3350
- id: z19.string().min(1),
3351
- label: z19.string().min(1),
3352
- description: z19.string().min(1).optional(),
3353
- group: z19.string().min(1).optional()
3321
+ var threadSessionOptionValueSchema = z20.object({
3322
+ id: z20.string().min(1),
3323
+ label: z20.string().min(1),
3324
+ description: z20.string().min(1).optional(),
3325
+ group: z20.string().min(1).optional()
3354
3326
  });
3355
3327
  var threadSessionOptionBaseShape = {
3356
- id: z19.string().min(1),
3357
- label: z19.string().min(1),
3358
- description: z19.string().min(1).optional(),
3359
- category: z19.string().min(1).optional()
3328
+ id: z20.string().min(1),
3329
+ label: z20.string().min(1),
3330
+ description: z20.string().min(1).optional(),
3331
+ category: z20.string().min(1).optional()
3360
3332
  };
3361
- var threadSessionOptionSchema = z19.discriminatedUnion("type", [
3362
- z19.object({
3333
+ var threadSessionOptionSchema = z20.discriminatedUnion("type", [
3334
+ z20.object({
3363
3335
  ...threadSessionOptionBaseShape,
3364
- type: z19.literal("select"),
3365
- value: z19.string(),
3366
- values: z19.array(threadSessionOptionValueSchema).max(1e3)
3336
+ type: z20.literal("select"),
3337
+ value: z20.string(),
3338
+ values: z20.array(threadSessionOptionValueSchema).max(1e3)
3367
3339
  }),
3368
- z19.object({
3340
+ z20.object({
3369
3341
  ...threadSessionOptionBaseShape,
3370
- type: z19.literal("boolean"),
3371
- value: z19.boolean(),
3372
- fixed: z19.boolean().optional()
3342
+ type: z20.literal("boolean"),
3343
+ value: z20.boolean(),
3344
+ fixed: z20.boolean().optional()
3373
3345
  })
3374
3346
  ]);
3375
- var threadSessionOptionsStateSchema = z19.object({
3376
- options: z19.array(threadSessionOptionSchema).max(64)
3347
+ var threadSessionOptionsStateSchema = z20.object({
3348
+ options: z20.array(threadSessionOptionSchema).max(64)
3377
3349
  });
3378
- var threadSessionOptionSelectionsStateSchema = z19.object({
3350
+ var threadSessionOptionSelectionsStateSchema = z20.object({
3379
3351
  selections: sessionOptionSelectionsSchema
3380
3352
  });
3381
3353
  var CORE_THREAD_STATE_SCHEMAS = {
@@ -3384,104 +3356,104 @@ var CORE_THREAD_STATE_SCHEMAS = {
3384
3356
  };
3385
3357
 
3386
3358
  // ../domain/src/provider-fork.ts
3387
- import { z as z20 } from "zod";
3359
+ import { z as z21 } from "zod";
3388
3360
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
3389
- var providerForkSchema = z20.enum(PROVIDER_FORK_VALUES);
3361
+ var providerForkSchema = z21.enum(PROVIDER_FORK_VALUES);
3390
3362
 
3391
3363
  // ../domain/src/provider-types.ts
3392
- import { z as z21 } from "zod";
3393
- var modelReasoningEffortSchema = z21.object({
3364
+ import { z as z22 } from "zod";
3365
+ var modelReasoningEffortSchema = z22.object({
3394
3366
  reasoningEffort: reasoningLevelSchema,
3395
- label: z21.string().min(1).optional(),
3396
- description: z21.string()
3367
+ label: z22.string().min(1).optional(),
3368
+ description: z22.string()
3397
3369
  });
3398
- var modelServiceTierSchema = z21.object({
3370
+ var modelServiceTierSchema = z22.object({
3399
3371
  id: serviceTierSchema,
3400
- label: z21.string().min(1).optional(),
3401
- description: z21.string().min(1).optional()
3402
- });
3403
- var availableModelSchema = z21.object({
3404
- id: z21.string(),
3405
- model: z21.string(),
3406
- displayName: z21.string(),
3407
- routeProviderId: z21.string().min(1).optional(),
3408
- description: z21.string(),
3409
- supportedReasoningEfforts: z21.array(modelReasoningEffortSchema),
3372
+ label: z22.string().min(1).optional(),
3373
+ description: z22.string().min(1).optional()
3374
+ });
3375
+ var availableModelSchema = z22.object({
3376
+ id: z22.string(),
3377
+ model: z22.string(),
3378
+ displayName: z22.string(),
3379
+ routeProviderId: z22.string().min(1).optional(),
3380
+ description: z22.string(),
3381
+ supportedReasoningEfforts: z22.array(modelReasoningEffortSchema),
3410
3382
  defaultReasoningEffort: reasoningLevelSchema,
3411
- supportedServiceTiers: z21.array(modelServiceTierSchema).optional(),
3412
- sessionOptions: z21.array(threadSessionOptionSchema).max(64).optional(),
3413
- isDefault: z21.boolean()
3414
- });
3415
- var providerModelCatalogScopeSchema = z21.enum(["host", "workspace"]);
3416
- var providerCapabilitiesSchema = z21.object({
3417
- supportsThreadArchive: z21.boolean(),
3418
- supportsThreadRename: z21.boolean(),
3419
- supportsServiceTier: z21.boolean(),
3420
- supportsNativeUserQuestion: z21.boolean(),
3421
- supportsFork: z21.boolean(),
3422
- supportsSessionRewind: z21.boolean(),
3423
- permissionModes: z21.array(permissionModeSchema).min(1),
3383
+ supportedServiceTiers: z22.array(modelServiceTierSchema).optional(),
3384
+ sessionOptions: z22.array(threadSessionOptionSchema).max(64).optional(),
3385
+ isDefault: z22.boolean()
3386
+ });
3387
+ var providerModelCatalogScopeSchema = z22.enum(["host", "workspace"]);
3388
+ var providerCapabilitiesSchema = z22.object({
3389
+ supportsThreadArchive: z22.boolean(),
3390
+ supportsThreadRename: z22.boolean(),
3391
+ supportsServiceTier: z22.boolean(),
3392
+ supportsNativeUserQuestion: z22.boolean(),
3393
+ supportsFork: z22.boolean(),
3394
+ supportsSessionRewind: z22.boolean(),
3395
+ permissionModes: z22.array(permissionModeSchema).min(1),
3424
3396
  modelCatalogScope: providerModelCatalogScopeSchema
3425
3397
  });
3426
- var providerComposerCommandSchema = z21.object({
3398
+ var providerComposerCommandSchema = z22.object({
3427
3399
  trigger: promptMentionCommandTriggerSchema,
3428
- name: z21.string().min(1).regex(/^[^\s/$]+$/u),
3429
- trailingText: z21.string().regex(/^\s*$/u)
3400
+ name: z22.string().min(1).regex(/^[^\s/$]+$/u),
3401
+ trailingText: z22.string().regex(/^\s*$/u)
3430
3402
  });
3431
- var providerComposerActionSchema = z21.discriminatedUnion("kind", [
3432
- z21.object({
3433
- kind: z21.literal("skills"),
3403
+ var providerComposerActionSchema = z22.discriminatedUnion("kind", [
3404
+ z22.object({
3405
+ kind: z22.literal("skills"),
3434
3406
  trigger: promptMentionCommandTriggerSchema
3435
3407
  }),
3436
- z21.object({
3437
- kind: z21.literal("plan"),
3408
+ z22.object({
3409
+ kind: z22.literal("plan"),
3438
3410
  command: providerComposerCommandSchema
3439
3411
  }),
3440
- z21.object({
3441
- kind: z21.literal("goal"),
3412
+ z22.object({
3413
+ kind: z22.literal("goal"),
3442
3414
  command: providerComposerCommandSchema
3443
3415
  })
3444
3416
  ]);
3445
- var providerStringsSchema = z21.object({
3446
- signInHint: z21.string().min(1),
3447
- expiredHint: z21.string().min(1),
3448
- installUrl: z21.string().min(1),
3449
- brandPrefix: z21.string().min(1).optional(),
3450
- planModeCopy: z21.string().min(1).optional(),
3451
- iconTint: z21.object({ light: z21.string().min(1), dark: z21.string().min(1) }).optional()
3452
- });
3453
- var providerOptionDescriptorSchema = z21.object({
3454
- id: z21.string().min(1),
3455
- label: z21.string().min(1),
3456
- description: z21.string().min(1).optional()
3457
- });
3458
- var providerExtensionKindInfoSchema = z21.object({
3459
- item: z21.boolean(),
3460
- state: z21.boolean()
3461
- });
3462
- var providerExtensionKindsSchema = z21.record(
3417
+ var providerStringsSchema = z22.object({
3418
+ signInHint: z22.string().min(1),
3419
+ expiredHint: z22.string().min(1),
3420
+ installUrl: z22.string().min(1),
3421
+ brandPrefix: z22.string().min(1).optional(),
3422
+ planModeCopy: z22.string().min(1).optional(),
3423
+ iconTint: z22.object({ light: z22.string().min(1), dark: z22.string().min(1) }).optional()
3424
+ });
3425
+ var providerOptionDescriptorSchema = z22.object({
3426
+ id: z22.string().min(1),
3427
+ label: z22.string().min(1),
3428
+ description: z22.string().min(1).optional()
3429
+ });
3430
+ var providerExtensionKindInfoSchema = z22.object({
3431
+ item: z22.boolean(),
3432
+ state: z22.boolean()
3433
+ });
3434
+ var providerExtensionKindsSchema = z22.record(
3463
3435
  extensionKindSchema,
3464
3436
  providerExtensionKindInfoSchema
3465
3437
  );
3466
- var providerInfoSchema = z21.object({
3467
- id: z21.string(),
3468
- pluginId: z21.string().min(1),
3469
- displayName: z21.string(),
3470
- family: z21.string().min(1).optional(),
3471
- icon: z21.object({ glyph: z21.string().min(1) }).optional(),
3472
- logoUrl: z21.string().min(1).nullable(),
3473
- maintenance: z21.object({
3474
- health: z21.boolean(),
3475
- usage: z21.boolean(),
3476
- installation: z21.boolean()
3438
+ var providerInfoSchema = z22.object({
3439
+ id: z22.string(),
3440
+ pluginId: z22.string().min(1),
3441
+ displayName: z22.string(),
3442
+ family: z22.string().min(1).optional(),
3443
+ icon: z22.object({ glyph: z22.string().min(1) }).optional(),
3444
+ logoUrl: z22.string().min(1).nullable(),
3445
+ maintenance: z22.object({
3446
+ health: z22.boolean(),
3447
+ usage: z22.boolean(),
3448
+ installation: z22.boolean()
3477
3449
  }),
3478
3450
  capabilities: providerCapabilitiesSchema,
3479
- composerActions: z21.array(providerComposerActionSchema),
3451
+ composerActions: z22.array(providerComposerActionSchema),
3480
3452
  completedTurnDisplay: completedTurnDisplaySchema,
3481
- available: z21.boolean(),
3453
+ available: z22.boolean(),
3482
3454
  strings: providerStringsSchema.optional(),
3483
- serviceTiers: z21.array(providerOptionDescriptorSchema).optional(),
3484
- reasoningLevels: z21.array(providerOptionDescriptorSchema).optional(),
3455
+ serviceTiers: z22.array(providerOptionDescriptorSchema).optional(),
3456
+ reasoningLevels: z22.array(providerOptionDescriptorSchema).optional(),
3485
3457
  extensionKinds: providerExtensionKindsSchema.optional()
3486
3458
  });
3487
3459
  var providerRecoveryKindValues = [
@@ -3491,34 +3463,34 @@ var providerRecoveryKindValues = [
3491
3463
  "staleTurn",
3492
3464
  "rateLimited"
3493
3465
  ];
3494
- var providerRecoveryKindSchema = z21.enum(providerRecoveryKindValues);
3495
- var toolCallOutputItemSchema = z21.discriminatedUnion("type", [
3496
- z21.object({
3497
- type: z21.literal("inputText"),
3498
- text: z21.string()
3466
+ var providerRecoveryKindSchema = z22.enum(providerRecoveryKindValues);
3467
+ var toolCallOutputItemSchema = z22.discriminatedUnion("type", [
3468
+ z22.object({
3469
+ type: z22.literal("inputText"),
3470
+ text: z22.string()
3499
3471
  }),
3500
- z21.object({
3501
- type: z21.literal("inputImage"),
3502
- imageUrl: z21.string()
3472
+ z22.object({
3473
+ type: z22.literal("inputImage"),
3474
+ imageUrl: z22.string()
3503
3475
  })
3504
3476
  ]);
3505
- var toolCallRequestSchema = z21.object({
3506
- requestId: z21.union([z21.string().min(1), z21.number()]),
3507
- threadId: z21.string().min(1),
3508
- providerThreadId: z21.string().min(1),
3509
- turnId: z21.string().min(1),
3510
- callId: z21.string().min(1),
3511
- tool: z21.string().min(1),
3512
- arguments: z21.unknown().optional()
3513
- });
3514
- var toolCallResponseSchema = z21.object({
3515
- contentItems: z21.array(toolCallOutputItemSchema),
3516
- success: z21.boolean()
3517
- });
3518
- var dynamicToolSchema = z21.object({
3519
- name: z21.string(),
3520
- description: z21.string(),
3521
- inputSchema: z21.unknown(),
3477
+ var toolCallRequestSchema = z22.object({
3478
+ requestId: z22.union([z22.string().min(1), z22.number()]),
3479
+ threadId: z22.string().min(1),
3480
+ providerThreadId: z22.string().min(1),
3481
+ turnId: z22.string().min(1),
3482
+ callId: z22.string().min(1),
3483
+ tool: z22.string().min(1),
3484
+ arguments: z22.unknown().optional()
3485
+ });
3486
+ var toolCallResponseSchema = z22.object({
3487
+ contentItems: z22.array(toolCallOutputItemSchema),
3488
+ success: z22.boolean()
3489
+ });
3490
+ var dynamicToolSchema = z22.object({
3491
+ name: z22.string(),
3492
+ description: z22.string(),
3493
+ inputSchema: z22.unknown(),
3522
3494
  presentation: threadEventItemPresentationSchema.optional()
3523
3495
  });
3524
3496
 
@@ -3572,60 +3544,60 @@ function reasoningEffortsForLevels(levels) {
3572
3544
  }
3573
3545
 
3574
3546
  // ../provider-bridge-protocol/src/bridge-requests.ts
3575
- import { z as z22 } from "zod";
3547
+ import { z as z23 } from "zod";
3576
3548
  var BRIDGE_INBOUND_REQUEST_METHODS = {
3577
3549
  toolCall: "item/tool/call",
3578
3550
  interactionRequest: "interaction/request"
3579
3551
  };
3580
- var toolCallRequestParamsSchema = z22.object({
3581
- providerThreadId: z22.string().min(1),
3582
- threadId: z22.string().min(1).optional(),
3583
- turnId: z22.union([z22.string().min(1), z22.null()]),
3584
- callId: z22.string().min(1),
3585
- tool: z22.string().min(1),
3586
- arguments: z22.unknown(),
3587
- providerNativeIds: z22.boolean().optional()
3552
+ var toolCallRequestParamsSchema = z23.object({
3553
+ providerThreadId: z23.string().min(1),
3554
+ threadId: z23.string().min(1).optional(),
3555
+ turnId: z23.union([z23.string().min(1), z23.null()]),
3556
+ callId: z23.string().min(1),
3557
+ tool: z23.string().min(1),
3558
+ arguments: z23.unknown(),
3559
+ providerNativeIds: z23.boolean().optional()
3588
3560
  }).passthrough();
3589
- var toolCallResultSchema = z22.object({
3590
- success: z22.boolean(),
3591
- contentItems: z22.array(
3592
- z22.discriminatedUnion("type", [
3593
- z22.object({ type: z22.literal("inputText"), text: z22.string() }),
3594
- z22.object({
3595
- type: z22.literal("inputImage"),
3596
- imageUrl: z22.string().min(1)
3561
+ var toolCallResultSchema = z23.object({
3562
+ success: z23.boolean(),
3563
+ contentItems: z23.array(
3564
+ z23.discriminatedUnion("type", [
3565
+ z23.object({ type: z23.literal("inputText"), text: z23.string() }),
3566
+ z23.object({
3567
+ type: z23.literal("inputImage"),
3568
+ imageUrl: z23.string().min(1)
3597
3569
  })
3598
3570
  ])
3599
3571
  )
3600
3572
  }).passthrough();
3601
- var interactionRequestParamsSchema = z22.object({
3602
- providerThreadId: z22.string().min(1),
3603
- threadId: z22.string().min(1).optional(),
3604
- turnId: z22.union([z22.string().min(1), z22.null()]),
3573
+ var interactionRequestParamsSchema = z23.object({
3574
+ providerThreadId: z23.string().min(1),
3575
+ threadId: z23.string().min(1).optional(),
3576
+ turnId: z23.union([z23.string().min(1), z23.null()]),
3605
3577
  payload: pendingInteractionPayloadSchema,
3606
- providerNativeIds: z22.boolean().optional()
3578
+ providerNativeIds: z23.boolean().optional()
3607
3579
  }).passthrough();
3608
3580
 
3609
3581
  // ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
3610
- var bridgeRequestEnvelopeSchema = z23.object({
3611
- jsonrpc: z23.literal("2.0"),
3612
- id: z23.union([z23.string(), z23.number()]),
3613
- method: z23.string(),
3614
- params: z23.record(z23.string(), z23.unknown()).optional()
3615
- });
3616
- var jsonRpcErrorSchema = z23.object({
3617
- code: z23.number(),
3618
- message: z23.string().optional(),
3619
- data: z23.unknown().optional()
3620
- });
3621
- var jsonRpcSuccessResponseSchema = z23.object({
3622
- jsonrpc: z23.literal("2.0"),
3623
- id: z23.union([z23.string(), z23.number()]),
3624
- result: z23.unknown()
3625
- });
3626
- var jsonRpcErrorResponseSchema = z23.object({
3627
- jsonrpc: z23.literal("2.0"),
3628
- id: z23.union([z23.string(), z23.number()]),
3582
+ var bridgeRequestEnvelopeSchema = z24.object({
3583
+ jsonrpc: z24.literal("2.0"),
3584
+ id: z24.union([z24.string(), z24.number()]),
3585
+ method: z24.string(),
3586
+ params: z24.record(z24.string(), z24.unknown()).optional()
3587
+ });
3588
+ var jsonRpcErrorSchema = z24.object({
3589
+ code: z24.number(),
3590
+ message: z24.string().optional(),
3591
+ data: z24.unknown().optional()
3592
+ });
3593
+ var jsonRpcSuccessResponseSchema = z24.object({
3594
+ jsonrpc: z24.literal("2.0"),
3595
+ id: z24.union([z24.string(), z24.number()]),
3596
+ result: z24.unknown()
3597
+ });
3598
+ var jsonRpcErrorResponseSchema = z24.object({
3599
+ jsonrpc: z24.literal("2.0"),
3600
+ id: z24.union([z24.string(), z24.number()]),
3629
3601
  error: jsonRpcErrorSchema
3630
3602
  });
3631
3603
  function isJsonRpcRequest(input) {
@@ -3713,47 +3685,47 @@ function buildBridgeToolCallContent(result) {
3713
3685
  }
3714
3686
 
3715
3687
  // ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
3716
- import { z as z24 } from "zod";
3717
- var recordSchema = z24.record(z24.string(), z24.unknown());
3718
- var jsonRpcEnvelopeSchema = z24.object({
3719
- jsonrpc: z24.literal("2.0"),
3720
- method: z24.string(),
3688
+ import { z as z25 } from "zod";
3689
+ var recordSchema = z25.record(z25.string(), z25.unknown());
3690
+ var jsonRpcEnvelopeSchema = z25.object({
3691
+ jsonrpc: z25.literal("2.0"),
3692
+ method: z25.string(),
3721
3693
  params: recordSchema.optional()
3722
3694
  }).passthrough();
3723
- var sdkMessageEnvelopeSchema = z24.object({
3724
- jsonrpc: z24.literal("2.0"),
3725
- method: z24.literal("sdk/message"),
3726
- params: z24.object({
3727
- message: z24.unknown(),
3728
- threadId: z24.string().optional(),
3729
- parent_tool_use_id: z24.string().optional()
3695
+ var sdkMessageEnvelopeSchema = z25.object({
3696
+ jsonrpc: z25.literal("2.0"),
3697
+ method: z25.literal("sdk/message"),
3698
+ params: z25.object({
3699
+ message: z25.unknown(),
3700
+ threadId: z25.string().optional(),
3701
+ parent_tool_use_id: z25.string().optional()
3730
3702
  }).passthrough()
3731
3703
  }).passthrough();
3732
- var threadIdentityEnvelopeSchema = z24.object({
3733
- jsonrpc: z24.literal("2.0"),
3734
- method: z24.literal("thread/identity"),
3735
- params: z24.object({
3736
- threadId: z24.string().optional(),
3737
- providerThreadId: z24.string().optional()
3704
+ var threadIdentityEnvelopeSchema = z25.object({
3705
+ jsonrpc: z25.literal("2.0"),
3706
+ method: z25.literal("thread/identity"),
3707
+ params: z25.object({
3708
+ threadId: z25.string().optional(),
3709
+ providerThreadId: z25.string().optional()
3738
3710
  }).passthrough()
3739
3711
  }).passthrough();
3740
- var threadContextWindowUsageEnvelopeSchema = z24.object({
3741
- jsonrpc: z24.literal("2.0"),
3742
- method: z24.literal("thread/contextWindowUsage/updated"),
3743
- params: z24.object({
3744
- threadId: z24.string().optional(),
3745
- contextWindowUsage: z24.object({
3746
- usedTokens: z24.number().nullable(),
3747
- modelContextWindow: z24.number().nullable(),
3748
- estimated: z24.boolean()
3712
+ var threadContextWindowUsageEnvelopeSchema = z25.object({
3713
+ jsonrpc: z25.literal("2.0"),
3714
+ method: z25.literal("thread/contextWindowUsage/updated"),
3715
+ params: z25.object({
3716
+ threadId: z25.string().optional(),
3717
+ contextWindowUsage: z25.object({
3718
+ usedTokens: z25.number().nullable(),
3719
+ modelContextWindow: z25.number().nullable(),
3720
+ estimated: z25.boolean()
3749
3721
  })
3750
3722
  }).passthrough()
3751
3723
  }).passthrough();
3752
- var errorEnvelopeSchema = z24.object({
3753
- jsonrpc: z24.literal("2.0"),
3754
- method: z24.literal("error"),
3755
- params: z24.object({
3756
- message: z24.string().optional()
3724
+ var errorEnvelopeSchema = z25.object({
3725
+ jsonrpc: z25.literal("2.0"),
3726
+ method: z25.literal("error"),
3727
+ params: z25.object({
3728
+ message: z25.string().optional()
3757
3729
  }).passthrough().optional()
3758
3730
  }).passthrough();
3759
3731
 
@@ -11333,7 +11305,7 @@ import { constants as fsConstants } from "node:fs";
11333
11305
  import { access } from "node:fs/promises";
11334
11306
  import path8 from "node:path";
11335
11307
  import { promisify as promisify4 } from "node:util";
11336
- import { z as z25 } from "zod";
11308
+ import { z as z26 } from "zod";
11337
11309
  var execFileAsync2 = promisify4(execFile3);
11338
11310
  var CLI_PROBE_TIMEOUT_MS = 5e3;
11339
11311
  var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
@@ -11442,8 +11414,8 @@ function firstLine(value) {
11442
11414
  function npmGlobalPackageVersion(value, npmPackage) {
11443
11415
  if (value === null) return null;
11444
11416
  try {
11445
- const parsed = z25.object({
11446
- dependencies: z25.record(z25.string(), z25.object({ version: z25.string().min(1) })).default({})
11417
+ const parsed = z26.object({
11418
+ dependencies: z26.record(z26.string(), z26.object({ version: z26.string().min(1) })).default({})
11447
11419
  }).safeParse(JSON.parse(value));
11448
11420
  return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
11449
11421
  } catch {
@@ -11494,9 +11466,9 @@ function clampPercent(value) {
11494
11466
  }
11495
11467
 
11496
11468
  // ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
11497
- import { z as z26 } from "zod";
11498
- var providerToolCallCancellationSchema = z26.object({
11499
- requestId: z26.union([z26.string(), z26.number().int()])
11469
+ import { z as z27 } from "zod";
11470
+ var providerToolCallCancellationSchema = z27.object({
11471
+ requestId: z27.union([z27.string(), z27.number().int()])
11500
11472
  });
11501
11473
 
11502
11474
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
@@ -11511,10 +11483,10 @@ function createProviderVisibilityMetadata(args) {
11511
11483
  }
11512
11484
 
11513
11485
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
11514
- import { z as z28 } from "zod";
11486
+ import { z as z29 } from "zod";
11515
11487
 
11516
11488
  // ../provider-bridge-protocol/src/errors.ts
11517
- import { z as z27 } from "zod";
11489
+ import { z as z28 } from "zod";
11518
11490
  var BRIDGE_JSON_RPC_ERRORS = {
11519
11491
  INVALID_PARAMS: -32602,
11520
11492
  METHOD_NOT_FOUND: -32601,
@@ -11524,12 +11496,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
11524
11496
  FORK_CHECKPOINT_UNSUPPORTED: -32003,
11525
11497
  MISSING_EXECUTABLE: -32004
11526
11498
  };
11527
- var providerRecoveryHintSchema = z27.object({
11499
+ var providerRecoveryHintSchema = z28.object({
11528
11500
  kind: providerRecoveryKindSchema,
11529
- message: z27.string().min(1),
11530
- retryable: z27.boolean()
11501
+ message: z28.string().min(1),
11502
+ retryable: z28.boolean()
11531
11503
  });
11532
- var bridgeErrorDataSchema = z27.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
11504
+ var bridgeErrorDataSchema = z28.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
11533
11505
 
11534
11506
  // ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
11535
11507
  var JSON_RPC_INVALID_PARAMS_CODE = -32602;
@@ -11547,7 +11519,7 @@ var ProviderResponseEncodeError = class extends Error {
11547
11519
  this.name = "ProviderResponseEncodeError";
11548
11520
  }
11549
11521
  };
11550
- var ignoredJsonRpcResultSchema = z28.unknown();
11522
+ var ignoredJsonRpcResultSchema = z29.unknown();
11551
11523
 
11552
11524
  // ../provider-bridge-protocol/src/version.ts
11553
11525
  var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
@@ -11555,69 +11527,69 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
11555
11527
  var THREAD_DELTA_GRAMMAR_V3 = 3;
11556
11528
 
11557
11529
  // ../provider-bridge-protocol/src/handshake.ts
11558
- import { z as z29 } from "zod";
11559
- var bridgeGrammarVersionsSchema = z29.tuple([z29.number().int().positive(), z29.number().int().positive()]).refine(([min, max]) => min <= max, {
11530
+ import { z as z30 } from "zod";
11531
+ var bridgeGrammarVersionsSchema = z30.tuple([z30.number().int().positive(), z30.number().int().positive()]).refine(([min, max]) => min <= max, {
11560
11532
  message: "grammarVersions must be an ascending [min, max] range"
11561
11533
  });
11562
- var bridgeSteerModeSchema = z29.enum(["inject", "queue"]);
11563
- var bridgeCapabilitiesSchema = z29.object({
11564
- sessionRestore: z29.boolean().default(false),
11565
- threadArchive: z29.boolean().default(false),
11566
- threadRename: z29.boolean().default(false),
11567
- threadGoalClear: z29.boolean().default(false),
11534
+ var bridgeSteerModeSchema = z30.enum(["inject", "queue"]);
11535
+ var bridgeCapabilitiesSchema = z30.object({
11536
+ sessionRestore: z30.boolean().default(false),
11537
+ threadArchive: z30.boolean().default(false),
11538
+ threadRename: z30.boolean().default(false),
11539
+ threadGoalClear: z30.boolean().default(false),
11568
11540
  fork: providerForkSchema.default("none"),
11569
- approvalEnforcedBy: z29.enum(["runtime", "provider"]).default("runtime"),
11541
+ approvalEnforcedBy: z30.enum(["runtime", "provider"]).default("runtime"),
11570
11542
  grammarVersions: bridgeGrammarVersionsSchema.default([
11571
11543
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
11572
11544
  PROVIDER_BRIDGE_PROTOCOL_VERSION
11573
11545
  ]),
11574
11546
  steerMode: bridgeSteerModeSchema.default("queue"),
11575
- skills: z29.object({ configure: z29.boolean().default(false) }).default({ configure: false }),
11576
- commands: z29.object({ list: z29.boolean().default(false) }).default({ list: false })
11547
+ skills: z30.object({ configure: z30.boolean().default(false) }).default({ configure: false }),
11548
+ commands: z30.object({ list: z30.boolean().default(false) }).default({ list: false })
11577
11549
  }).passthrough();
11578
- var initializeParamsSchema = z29.object({
11579
- protocolVersion: z29.number().int().positive(),
11580
- client: z29.object({ name: z29.string().min(1), version: z29.string().min(1) }),
11550
+ var initializeParamsSchema = z30.object({
11551
+ protocolVersion: z30.number().int().positive(),
11552
+ client: z30.object({ name: z30.string().min(1), version: z30.string().min(1) }),
11581
11553
  grammarVersions: bridgeGrammarVersionsSchema.default([
11582
11554
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
11583
11555
  PROVIDER_BRIDGE_PROTOCOL_VERSION
11584
11556
  ])
11585
11557
  }).passthrough();
11586
- var initializeResultSchema = z29.object({
11587
- protocolVersion: z29.number().int().positive(),
11588
- capabilities: z29.preprocess(
11558
+ var initializeResultSchema = z30.object({
11559
+ protocolVersion: z30.number().int().positive(),
11560
+ capabilities: z30.preprocess(
11589
11561
  (value) => value ?? {},
11590
11562
  bridgeCapabilitiesSchema
11591
11563
  )
11592
11564
  }).passthrough();
11593
11565
 
11594
11566
  // ../provider-bridge-protocol/src/execution-options.ts
11595
- import { z as z30 } from "zod";
11596
- var bridgeExecutionOptionsSchema = z30.object({
11597
- model: z30.string().min(1).optional(),
11567
+ import { z as z31 } from "zod";
11568
+ var bridgeExecutionOptionsSchema = z31.object({
11569
+ model: z31.string().min(1).optional(),
11598
11570
  serviceTier: serviceTierSchema.optional(),
11599
11571
  reasoningLevel: reasoningLevelSchema.optional(),
11600
11572
  promptMode: promptModeSchema.optional(),
11601
11573
  sessionOptions: sessionOptionSelectionsSchema.optional(),
11602
- instructions: z30.string().optional(),
11603
- envVars: z30.record(z30.string(), z30.string()).optional(),
11604
- providerOptions: z30.record(z30.string(), z30.unknown()).optional()
11574
+ instructions: z31.string().optional(),
11575
+ envVars: z31.record(z31.string(), z31.string()).optional(),
11576
+ providerOptions: z31.record(z31.string(), z31.unknown()).optional()
11605
11577
  }).and(runtimePermissionPolicySchema);
11606
11578
 
11607
11579
  // ../provider-bridge-protocol/src/provider-maintenance.ts
11608
- import { z as z31 } from "zod";
11609
- var providerMaintenanceParamsSchema = z31.object({
11610
- providerId: z31.string().min(1),
11611
- cwd: z31.string().min(1).optional(),
11612
- providerOptions: z31.record(z31.string(), z31.unknown()).optional()
11580
+ import { z as z32 } from "zod";
11581
+ var providerMaintenanceParamsSchema = z32.object({
11582
+ providerId: z32.string().min(1),
11583
+ cwd: z32.string().min(1).optional(),
11584
+ providerOptions: z32.record(z32.string(), z32.unknown()).optional()
11613
11585
  }).passthrough();
11614
- var providerInstallationRequirementSchema = z31.enum(["thread_rewind"]);
11586
+ var providerInstallationRequirementSchema = z32.enum(["thread_rewind"]);
11615
11587
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
11616
11588
  requirement: providerInstallationRequirementSchema.optional(),
11617
- checkUpdates: z31.boolean().default(true)
11589
+ checkUpdates: z32.boolean().default(true)
11618
11590
  });
11619
- var providerHealthSchema = z31.object({
11620
- status: z31.enum([
11591
+ var providerHealthSchema = z32.object({
11592
+ status: z32.enum([
11621
11593
  "ready",
11622
11594
  "not_installed",
11623
11595
  "unauthenticated",
@@ -11625,115 +11597,115 @@ var providerHealthSchema = z31.object({
11625
11597
  "unsupported_version",
11626
11598
  "unknown"
11627
11599
  ]),
11628
- statusMessage: z31.string().min(1).nullable(),
11629
- accountEmail: z31.string().nullable(),
11630
- planLabel: z31.string().min(1).nullable(),
11631
- installedVersion: z31.string().min(1).nullable(),
11632
- minimumSupportedVersion: z31.string().min(1).nullable(),
11633
- canInstall: z31.boolean(),
11634
- canUpdate: z31.boolean(),
11635
- loginCommand: z31.string().min(1).nullable(),
11636
- localLoginCommand: z31.string().min(1).nullable().optional()
11600
+ statusMessage: z32.string().min(1).nullable(),
11601
+ accountEmail: z32.string().nullable(),
11602
+ planLabel: z32.string().min(1).nullable(),
11603
+ installedVersion: z32.string().min(1).nullable(),
11604
+ minimumSupportedVersion: z32.string().min(1).nullable(),
11605
+ canInstall: z32.boolean(),
11606
+ canUpdate: z32.boolean(),
11607
+ loginCommand: z32.string().min(1).nullable(),
11608
+ localLoginCommand: z32.string().min(1).nullable().optional()
11637
11609
  }).passthrough();
11638
- var providerUsageWindowSchema = z31.object({
11639
- label: z31.string().min(1),
11640
- usedPercent: z31.number().min(0).max(100),
11641
- resetsAt: z31.string().min(1).nullable(),
11642
- cost: z31.object({
11643
- usedUsdCents: z31.number().int().nonnegative(),
11644
- limitUsdCents: z31.number().int().positive()
11610
+ var providerUsageWindowSchema = z32.object({
11611
+ label: z32.string().min(1),
11612
+ usedPercent: z32.number().min(0).max(100),
11613
+ resetsAt: z32.string().min(1).nullable(),
11614
+ cost: z32.object({
11615
+ usedUsdCents: z32.number().int().nonnegative(),
11616
+ limitUsdCents: z32.number().int().positive()
11645
11617
  }).optional()
11646
11618
  }).passthrough();
11647
- var providerUsageSchema = z31.discriminatedUnion("status", [
11648
- z31.object({
11649
- status: z31.literal("ok"),
11650
- accountEmail: z31.string().email().nullable(),
11651
- planLabel: z31.string().min(1).nullable(),
11652
- windows: z31.array(providerUsageWindowSchema)
11619
+ var providerUsageSchema = z32.discriminatedUnion("status", [
11620
+ z32.object({
11621
+ status: z32.literal("ok"),
11622
+ accountEmail: z32.string().email().nullable(),
11623
+ planLabel: z32.string().min(1).nullable(),
11624
+ windows: z32.array(providerUsageWindowSchema)
11653
11625
  }).passthrough(),
11654
- z31.object({ status: z31.literal("not_installed") }).passthrough(),
11655
- z31.object({ status: z31.literal("unauthenticated") }).passthrough(),
11656
- z31.object({ status: z31.literal("expired") }).passthrough(),
11657
- z31.object({
11658
- status: z31.literal("error"),
11659
- message: z31.string().min(1),
11660
- planLabel: z31.string().min(1).nullable().default(null),
11661
- accountEmail: z31.string().nullable().default(null)
11626
+ z32.object({ status: z32.literal("not_installed") }).passthrough(),
11627
+ z32.object({ status: z32.literal("unauthenticated") }).passthrough(),
11628
+ z32.object({ status: z32.literal("expired") }).passthrough(),
11629
+ z32.object({
11630
+ status: z32.literal("error"),
11631
+ message: z32.string().min(1),
11632
+ planLabel: z32.string().min(1).nullable().default(null),
11633
+ accountEmail: z32.string().nullable().default(null)
11662
11634
  }).passthrough()
11663
11635
  ]);
11664
- var providerHealthResultSchema = z31.discriminatedUnion("supported", [
11665
- z31.object({ supported: z31.literal(false) }).passthrough(),
11666
- z31.object({
11667
- supported: z31.literal(true),
11636
+ var providerHealthResultSchema = z32.discriminatedUnion("supported", [
11637
+ z32.object({ supported: z32.literal(false) }).passthrough(),
11638
+ z32.object({
11639
+ supported: z32.literal(true),
11668
11640
  health: providerHealthSchema
11669
11641
  }).passthrough()
11670
11642
  ]);
11671
- var providerUsageResultSchema = z31.discriminatedUnion("supported", [
11672
- z31.object({ supported: z31.literal(false) }).passthrough(),
11673
- z31.object({
11674
- supported: z31.literal(true),
11643
+ var providerUsageResultSchema = z32.discriminatedUnion("supported", [
11644
+ z32.object({ supported: z32.literal(false) }).passthrough(),
11645
+ z32.object({
11646
+ supported: z32.literal(true),
11675
11647
  usage: providerUsageSchema
11676
11648
  }).passthrough()
11677
11649
  ]);
11678
- var providerInstallationActionKindSchema = z31.enum([
11650
+ var providerInstallationActionKindSchema = z32.enum([
11679
11651
  "install",
11680
11652
  "update"
11681
11653
  ]);
11682
- var providerInstallationActionSchema = z31.object({
11654
+ var providerInstallationActionSchema = z32.object({
11683
11655
  kind: providerInstallationActionKindSchema,
11684
- label: z31.enum(["Install", "Update"]),
11685
- command: z31.string().min(1)
11656
+ label: z32.enum(["Install", "Update"]),
11657
+ command: z32.string().min(1)
11686
11658
  }).passthrough();
11687
- var providerInstallationSourceSchema = z31.enum([
11659
+ var providerInstallationSourceSchema = z32.enum([
11688
11660
  "notInstalled",
11689
11661
  "npmGlobal",
11690
11662
  "external"
11691
11663
  ]);
11692
- var providerInstallationStatusSchema = z31.object({
11693
- executableName: z31.string().min(1),
11694
- executablePath: z31.string().min(1).nullable(),
11695
- installed: z31.boolean(),
11664
+ var providerInstallationStatusSchema = z32.object({
11665
+ executableName: z32.string().min(1),
11666
+ executablePath: z32.string().min(1).nullable(),
11667
+ installed: z32.boolean(),
11696
11668
  installSource: providerInstallationSourceSchema,
11697
- currentVersion: z31.string().min(1).nullable(),
11698
- latestVersion: z31.string().min(1).nullable(),
11699
- minimumSupportedVersion: z31.string().min(1).nullable(),
11700
- npmPackageName: z31.string().min(1).nullable(),
11701
- npmGlobalPackageVersion: z31.string().min(1).nullable(),
11669
+ currentVersion: z32.string().min(1).nullable(),
11670
+ latestVersion: z32.string().min(1).nullable(),
11671
+ minimumSupportedVersion: z32.string().min(1).nullable(),
11672
+ npmPackageName: z32.string().min(1).nullable(),
11673
+ npmGlobalPackageVersion: z32.string().min(1).nullable(),
11702
11674
  installAction: providerInstallationActionSchema.nullable(),
11703
- needsUpdate: z31.boolean(),
11704
- versionUnsupported: z31.boolean()
11675
+ needsUpdate: z32.boolean(),
11676
+ versionUnsupported: z32.boolean()
11705
11677
  }).passthrough();
11706
11678
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
11707
11679
  action: providerInstallationActionKindSchema
11708
11680
  });
11709
- var providerInstallationCommandSchema = z31.object({
11710
- command: z31.string().min(1),
11711
- args: z31.array(z31.string()).max(64),
11712
- displayCommand: z31.string().min(1)
11681
+ var providerInstallationCommandSchema = z32.object({
11682
+ command: z32.string().min(1),
11683
+ args: z32.array(z32.string()).max(64),
11684
+ displayCommand: z32.string().min(1)
11713
11685
  }).passthrough();
11714
- var providerInstallationVerificationSchema = z31.discriminatedUnion(
11686
+ var providerInstallationVerificationSchema = z32.discriminatedUnion(
11715
11687
  "kind",
11716
11688
  [
11717
- z31.object({ kind: z31.literal("installed") }).passthrough(),
11718
- z31.object({
11719
- kind: z31.literal("version_changed"),
11720
- previousVersion: z31.string().min(1)
11689
+ z32.object({ kind: z32.literal("installed") }).passthrough(),
11690
+ z32.object({
11691
+ kind: z32.literal("version_changed"),
11692
+ previousVersion: z32.string().min(1)
11721
11693
  }).passthrough(),
11722
- z31.object({
11723
- kind: z31.literal("version_at_least"),
11724
- version: z31.string().min(1)
11694
+ z32.object({
11695
+ kind: z32.literal("version_at_least"),
11696
+ version: z32.string().min(1)
11725
11697
  }).passthrough()
11726
11698
  ]
11727
11699
  );
11728
- var providerInstallationRunResultSchema = z31.discriminatedUnion(
11700
+ var providerInstallationRunResultSchema = z32.discriminatedUnion(
11729
11701
  "available",
11730
11702
  [
11731
- z31.object({
11732
- available: z31.literal(false),
11733
- message: z31.string().min(1)
11703
+ z32.object({
11704
+ available: z32.literal(false),
11705
+ message: z32.string().min(1)
11734
11706
  }).passthrough(),
11735
- z31.object({
11736
- available: z31.literal(true),
11707
+ z32.object({
11708
+ available: z32.literal(true),
11737
11709
  command: providerInstallationCommandSchema,
11738
11710
  verification: providerInstallationVerificationSchema
11739
11711
  }).passthrough()
@@ -11741,7 +11713,7 @@ var providerInstallationRunResultSchema = z31.discriminatedUnion(
11741
11713
  );
11742
11714
 
11743
11715
  // ../provider-bridge-protocol/src/requests.ts
11744
- import { z as z32 } from "zod";
11716
+ import { z as z33 } from "zod";
11745
11717
  var BRIDGE_REQUEST_METHODS = {
11746
11718
  initialize: "initialize",
11747
11719
  modelList: "model/list",
@@ -11764,83 +11736,83 @@ var BRIDGE_REQUEST_METHODS = {
11764
11736
  skillsConfigure: "skills/configure"
11765
11737
  };
11766
11738
  var sessionConstructionFields = {
11767
- threadId: z32.string().min(1),
11768
- cwd: z32.string().min(1),
11739
+ threadId: z33.string().min(1),
11740
+ cwd: z33.string().min(1),
11769
11741
  options: bridgeExecutionOptionsSchema,
11770
- dynamicTools: z32.array(dynamicToolSchema).optional(),
11771
- disallowedTools: z32.array(z32.string().min(1)).optional(),
11742
+ dynamicTools: z33.array(dynamicToolSchema).optional(),
11743
+ disallowedTools: z33.array(z33.string().min(1)).optional(),
11772
11744
  instructionMode: instructionModeSchema
11773
11745
  };
11774
- var modelListParamsSchema = z32.object({
11775
- cwd: z32.string().min(1).optional(),
11776
- envVars: z32.record(z32.string(), z32.string()).optional()
11746
+ var modelListParamsSchema = z33.object({
11747
+ cwd: z33.string().min(1).optional(),
11748
+ envVars: z33.record(z33.string(), z33.string()).optional()
11777
11749
  }).passthrough();
11778
- var commandListParamsSchema = z32.object({ cwd: z32.string().min(1) }).passthrough();
11750
+ var commandListParamsSchema = z33.object({ cwd: z33.string().min(1) }).passthrough();
11779
11751
  var commandListResultSchema = threadProviderCommandsStateSchema;
11780
- var threadStartParamsSchema = z32.object({
11752
+ var threadStartParamsSchema = z33.object({
11781
11753
  ...sessionConstructionFields,
11782
- input: z32.array(promptInputSchema).optional()
11754
+ input: z33.array(promptInputSchema).optional()
11783
11755
  }).passthrough();
11784
- var threadResumeParamsSchema = z32.object({
11756
+ var threadResumeParamsSchema = z33.object({
11785
11757
  ...sessionConstructionFields,
11786
- providerThreadId: z32.string().min(1)
11758
+ providerThreadId: z33.string().min(1)
11787
11759
  }).passthrough();
11788
- var threadForkParamsSchema = z32.object({
11760
+ var threadForkParamsSchema = z33.object({
11789
11761
  ...sessionConstructionFields,
11790
- sourceProviderThreadId: z32.string().min(1),
11791
- sourceProviderCheckpointId: z32.string().min(1).optional()
11762
+ sourceProviderThreadId: z33.string().min(1),
11763
+ sourceProviderCheckpointId: z33.string().min(1).optional()
11792
11764
  }).passthrough();
11793
- var threadStopParamsSchema = z32.object({
11794
- threadId: z32.string().min(1),
11795
- providerThreadId: z32.string().min(1),
11796
- intent: z32.enum(["interrupt", "release"]),
11797
- activeTurnId: z32.string().min(1).nullable()
11765
+ var threadStopParamsSchema = z33.object({
11766
+ threadId: z33.string().min(1),
11767
+ providerThreadId: z33.string().min(1),
11768
+ intent: z33.enum(["interrupt", "release"]),
11769
+ activeTurnId: z33.string().min(1).nullable()
11798
11770
  }).passthrough();
11799
- var threadRefParams = z32.object({
11800
- threadId: z32.string().min(1),
11801
- providerThreadId: z32.string().min(1)
11771
+ var threadRefParams = z33.object({
11772
+ threadId: z33.string().min(1),
11773
+ providerThreadId: z33.string().min(1)
11802
11774
  }).passthrough();
11803
11775
  var threadDiscardParamsSchema = threadRefParams;
11804
11776
  var threadArchiveParamsSchema = threadRefParams;
11805
11777
  var threadUnarchiveParamsSchema = threadRefParams;
11806
11778
  var threadGoalClearParamsSchema = threadRefParams;
11807
- var threadNameSetParamsSchema = z32.object({
11808
- threadId: z32.string().min(1),
11809
- providerThreadId: z32.string().min(1),
11810
- title: z32.string().min(1)
11779
+ var threadNameSetParamsSchema = z33.object({
11780
+ threadId: z33.string().min(1),
11781
+ providerThreadId: z33.string().min(1),
11782
+ title: z33.string().min(1)
11811
11783
  }).passthrough();
11812
11784
  var turnInputFields = {
11813
- threadId: z32.string().min(1),
11814
- providerThreadId: z32.string().min(1),
11815
- input: z32.array(promptInputSchema),
11785
+ threadId: z33.string().min(1),
11786
+ providerThreadId: z33.string().min(1),
11787
+ input: z33.array(promptInputSchema),
11816
11788
  clientRequestId: clientTurnRequestIdSchema,
11817
11789
  options: bridgeExecutionOptionsSchema
11818
11790
  };
11819
- var turnStartParamsSchema = z32.object(turnInputFields).passthrough();
11820
- var turnSteerParamsSchema = z32.object({
11791
+ var turnStartParamsSchema = z33.object(turnInputFields).passthrough();
11792
+ var turnSteerParamsSchema = z33.object({
11821
11793
  ...turnInputFields,
11822
- expectedTurnId: z32.string().min(1)
11794
+ expectedTurnId: z33.string().min(1)
11823
11795
  }).passthrough();
11824
- var skillsConfigureRootSchema = z32.object({
11825
- id: z32.string().min(1),
11826
- path: z32.string().min(1),
11827
- skills: z32.array(
11828
- z32.object({
11829
- name: z32.string().min(1),
11830
- description: z32.string()
11796
+ var skillsConfigureRootSchema = z33.object({
11797
+ id: z33.string().min(1),
11798
+ path: z33.string().min(1),
11799
+ skills: z33.array(
11800
+ z33.object({
11801
+ name: z33.string().min(1),
11802
+ description: z33.string()
11831
11803
  }).passthrough()
11832
11804
  )
11833
11805
  }).passthrough();
11834
- var skillsConfigureParamsSchema = z32.object({
11835
- roots: z32.array(skillsConfigureRootSchema)
11806
+ var skillsConfigureParamsSchema = z33.object({
11807
+ roots: z33.array(skillsConfigureRootSchema)
11836
11808
  }).passthrough();
11837
- var threadIdentityResultSchema = z32.object({
11838
- providerThreadId: z32.string().min(1),
11839
- sessionRestorable: z32.boolean().optional()
11809
+ var threadIdentityResultSchema = z33.object({
11810
+ providerThreadId: z33.string().min(1),
11811
+ sessionRestorable: z33.boolean().optional()
11840
11812
  }).passthrough();
11841
11813
 
11842
11814
  // ../provider-bridge-protocol/src/notifications.ts
11843
- import { z as z33 } from "zod";
11815
+ import { z as z34 } from "zod";
11844
11816
  var BRIDGE_NOTIFICATION_METHODS = {
11845
11817
  threadIdentity: "thread/identity",
11846
11818
  sessionReplaced: "session/replaced",
@@ -11848,143 +11820,143 @@ var BRIDGE_NOTIFICATION_METHODS = {
11848
11820
  providerRecovery: "provider/recovery",
11849
11821
  error: "error"
11850
11822
  };
11851
- var threadIdentityNotificationSchema = z33.object({
11852
- threadId: z33.string().min(1),
11853
- providerThreadId: z33.string().min(1),
11854
- sessionRestorable: z33.boolean().optional()
11823
+ var threadIdentityNotificationSchema = z34.object({
11824
+ threadId: z34.string().min(1),
11825
+ providerThreadId: z34.string().min(1),
11826
+ sessionRestorable: z34.boolean().optional()
11855
11827
  }).passthrough();
11856
- var sessionReplacedNotificationSchema = z33.object({
11857
- threadId: z33.string().min(1),
11858
- providerThreadId: z33.string().min(1).nullable(),
11859
- reason: z33.string().min(1),
11860
- contextLost: z33.boolean().default(false),
11861
- showRuntimeNote: z33.boolean().default(false)
11828
+ var sessionReplacedNotificationSchema = z34.object({
11829
+ threadId: z34.string().min(1),
11830
+ providerThreadId: z34.string().min(1).nullable(),
11831
+ reason: z34.string().min(1),
11832
+ contextLost: z34.boolean().default(false),
11833
+ showRuntimeNote: z34.boolean().default(false)
11862
11834
  }).passthrough();
11863
- var providerRecoveryNotificationSchema = z33.object({
11864
- threadId: z33.string().min(1).optional(),
11835
+ var providerRecoveryNotificationSchema = z34.object({
11836
+ threadId: z34.string().min(1).optional(),
11865
11837
  ...providerRecoveryHintSchema.shape
11866
11838
  }).passthrough();
11867
- var errorNotificationSchema = z33.object({
11868
- threadId: z33.string().min(1).optional(),
11869
- providerThreadId: z33.string().min(1).optional(),
11870
- message: z33.string().min(1)
11839
+ var errorNotificationSchema = z34.object({
11840
+ threadId: z34.string().min(1).optional(),
11841
+ providerThreadId: z34.string().min(1).optional(),
11842
+ message: z34.string().min(1)
11871
11843
  }).passthrough();
11872
11844
 
11873
11845
  // ../provider-bridge-protocol/src/thread-delta.ts
11874
- import { z as z34 } from "zod";
11846
+ import { z as z35 } from "zod";
11875
11847
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
11876
11848
  var deltaPresentationSchema = threadEventItemPresentationSchema;
11877
11849
  var THREAD_DELTA_KEY_SEPARATOR = "";
11878
- var deltaKeyPartSchema = z34.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
11850
+ var deltaKeyPartSchema = z35.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
11879
11851
  message: "provider keys must not contain the internal key separator (\\u001f)"
11880
11852
  });
11881
- var deltaItemKeySchema = z34.object({
11853
+ var deltaItemKeySchema = z35.object({
11882
11854
  providerItemId: deltaKeyPartSchema.optional(),
11883
11855
  channel: deltaKeyPartSchema.optional(),
11884
11856
  parentRef: deltaKeyPartSchema.optional()
11885
11857
  });
11886
11858
  var providerTurnIdSchema = deltaKeyPartSchema;
11887
- var deltaFileChangeSchema = z34.object({
11888
- path: z34.string(),
11889
- kind: z34.enum(["add", "update", "delete"]),
11890
- movePath: z34.string().optional(),
11891
- diff: z34.string().optional(),
11892
- oldText: z34.string().optional(),
11893
- newText: z34.string().optional()
11894
- });
11895
- var deltaBackgroundTaskShapeSchema = z34.object({
11896
- type: z34.literal("backgroundTask"),
11897
- familyId: z34.string().min(1),
11898
- taskType: z34.string(),
11899
- description: z34.string(),
11859
+ var deltaFileChangeSchema = z35.object({
11860
+ path: z35.string(),
11861
+ kind: z35.enum(["add", "update", "delete"]),
11862
+ movePath: z35.string().optional(),
11863
+ diff: z35.string().optional(),
11864
+ oldText: z35.string().optional(),
11865
+ newText: z35.string().optional()
11866
+ });
11867
+ var deltaBackgroundTaskShapeSchema = z35.object({
11868
+ type: z35.literal("backgroundTask"),
11869
+ familyId: z35.string().min(1),
11870
+ taskType: z35.string(),
11871
+ description: z35.string(),
11900
11872
  status: threadEventItemStatusSchema,
11901
11873
  taskStatus: backgroundTaskStatusSchema,
11902
- skipTranscript: z34.boolean(),
11903
- foreground: z34.boolean().optional(),
11904
- workflowName: z34.string().optional(),
11874
+ skipTranscript: z35.boolean(),
11875
+ foreground: z35.boolean().optional(),
11876
+ workflowName: z35.string().optional(),
11905
11877
  workflow: workflowProgressSnapshotSchema.optional(),
11906
11878
  usage: backgroundTaskUsageSchema.optional(),
11907
- summary: z34.string().optional(),
11908
- error: z34.string().optional(),
11909
- outputFile: z34.string().optional()
11879
+ summary: z35.string().optional(),
11880
+ error: z35.string().optional(),
11881
+ outputFile: z35.string().optional()
11910
11882
  });
11911
- var deltaFileReadShapeSchema = z34.object({
11912
- type: z34.literal("fileRead"),
11913
- path: z34.string(),
11914
- cmd: z34.string().optional()
11883
+ var deltaFileReadShapeSchema = z35.object({
11884
+ type: z35.literal("fileRead"),
11885
+ path: z35.string(),
11886
+ cmd: z35.string().optional()
11915
11887
  });
11916
- var deltaSearchShapeSchema = z34.object({
11917
- type: z34.literal("search"),
11888
+ var deltaSearchShapeSchema = z35.object({
11889
+ type: z35.literal("search"),
11918
11890
  mode: threadEventSearchModeSchema,
11919
- query: z34.string(),
11920
- path: z34.string().optional(),
11921
- cmd: z34.string().optional()
11891
+ query: z35.string(),
11892
+ path: z35.string().optional(),
11893
+ cmd: z35.string().optional()
11922
11894
  });
11923
- var deltaDelegationShapeSchema = z34.object({
11924
- type: z34.literal("delegation"),
11895
+ var deltaDelegationShapeSchema = z35.object({
11896
+ type: z35.literal("delegation"),
11925
11897
  childRef: deltaKeyPartSchema,
11926
- label: z34.string(),
11927
- background: z34.boolean(),
11928
- summary: z34.string().optional()
11898
+ label: z35.string(),
11899
+ background: z35.boolean(),
11900
+ summary: z35.string().optional()
11929
11901
  });
11930
- var deltaPlanStepsShapeSchema = z34.object({
11931
- type: z34.literal("planSteps"),
11932
- steps: z34.array(threadEventPlanStepSchema),
11933
- explanation: z34.string().optional()
11902
+ var deltaPlanStepsShapeSchema = z35.object({
11903
+ type: z35.literal("planSteps"),
11904
+ steps: z35.array(threadEventPlanStepSchema),
11905
+ explanation: z35.string().optional()
11934
11906
  });
11935
- var deltaExtensionShapeSchema = z34.object({
11936
- type: z34.literal("extension"),
11907
+ var deltaExtensionShapeSchema = z35.object({
11908
+ type: z35.literal("extension"),
11937
11909
  kind: extensionKindSchema,
11938
11910
  payload: jsonValueSchema
11939
11911
  });
11940
- var deltaItemShapeSchema = z34.discriminatedUnion("type", [
11941
- z34.object({
11942
- type: z34.literal("command"),
11943
- command: z34.string(),
11944
- cwd: z34.string(),
11945
- aggregatedOutput: z34.string().optional(),
11946
- exitCode: z34.number().optional(),
11947
- durationMs: z34.number().optional()
11912
+ var deltaItemShapeSchema = z35.discriminatedUnion("type", [
11913
+ z35.object({
11914
+ type: z35.literal("command"),
11915
+ command: z35.string(),
11916
+ cwd: z35.string(),
11917
+ aggregatedOutput: z35.string().optional(),
11918
+ exitCode: z35.number().optional(),
11919
+ durationMs: z35.number().optional()
11948
11920
  }),
11949
- z34.object({
11950
- type: z34.literal("fileChange"),
11951
- changes: z34.array(deltaFileChangeSchema)
11921
+ z35.object({
11922
+ type: z35.literal("fileChange"),
11923
+ changes: z35.array(deltaFileChangeSchema)
11952
11924
  }),
11953
- z34.object({
11954
- type: z34.literal("tool"),
11955
- tool: z34.string(),
11956
- server: z34.string().optional(),
11957
- args: z34.unknown().optional(),
11958
- result: z34.unknown().optional(),
11959
- error: z34.string().optional(),
11960
- durationMs: z34.number().optional()
11925
+ z35.object({
11926
+ type: z35.literal("tool"),
11927
+ tool: z35.string(),
11928
+ server: z35.string().optional(),
11929
+ args: z35.unknown().optional(),
11930
+ result: z35.unknown().optional(),
11931
+ error: z35.string().optional(),
11932
+ durationMs: z35.number().optional()
11961
11933
  }),
11962
- z34.object({ type: z34.literal("compaction") }),
11963
- z34.object({ type: z34.literal("agentMessage"), text: z34.string() }),
11964
- z34.object({
11965
- type: z34.literal("reasoning"),
11966
- summary: z34.array(z34.string()),
11967
- content: z34.array(z34.string())
11934
+ z35.object({ type: z35.literal("compaction") }),
11935
+ z35.object({ type: z35.literal("agentMessage"), text: z35.string() }),
11936
+ z35.object({
11937
+ type: z35.literal("reasoning"),
11938
+ summary: z35.array(z35.string()),
11939
+ content: z35.array(z35.string())
11968
11940
  }),
11969
- z34.object({ type: z34.literal("plan"), text: z34.string() }),
11970
- z34.object({
11971
- type: z34.literal("webSearch"),
11972
- queries: z34.array(z34.string()).min(1)
11941
+ z35.object({ type: z35.literal("plan"), text: z35.string() }),
11942
+ z35.object({
11943
+ type: z35.literal("webSearch"),
11944
+ queries: z35.array(z35.string()).min(1)
11973
11945
  }),
11974
- z34.object({
11975
- type: z34.literal("webFetch"),
11976
- url: z34.string(),
11977
- prompt: z34.string().nullable().optional(),
11978
- pattern: z34.string().nullable()
11946
+ z35.object({
11947
+ type: z35.literal("webFetch"),
11948
+ url: z35.string(),
11949
+ prompt: z35.string().nullable().optional(),
11950
+ pattern: z35.string().nullable()
11979
11951
  }),
11980
- z34.object({ type: z34.literal("imageView"), path: z34.string() }),
11981
- z34.object({
11982
- type: z34.literal("imageGeneration"),
11983
- prompt: z34.string().nullable(),
11984
- path: z34.string().nullable(),
11985
- result: z34.string().optional(),
11986
- error: z34.string().nullable(),
11987
- transparentBackground: z34.boolean()
11952
+ z35.object({ type: z35.literal("imageView"), path: z35.string() }),
11953
+ z35.object({
11954
+ type: z35.literal("imageGeneration"),
11955
+ prompt: z35.string().nullable(),
11956
+ path: z35.string().nullable(),
11957
+ result: z35.string().optional(),
11958
+ error: z35.string().nullable(),
11959
+ transparentBackground: z35.boolean()
11988
11960
  }),
11989
11961
  deltaBackgroundTaskShapeSchema,
11990
11962
  deltaFileReadShapeSchema,
@@ -11993,22 +11965,22 @@ var deltaItemShapeSchema = z34.discriminatedUnion("type", [
11993
11965
  deltaPlanStepsShapeSchema,
11994
11966
  deltaExtensionShapeSchema
11995
11967
  ]);
11996
- var deltaProgressSnapshotSchema = z34.discriminatedUnion("type", [
11968
+ var deltaProgressSnapshotSchema = z35.discriminatedUnion("type", [
11997
11969
  deltaBackgroundTaskShapeSchema,
11998
11970
  deltaDelegationShapeSchema
11999
11971
  ]);
12000
- var deltaTextChannelSchema = z34.enum([
11972
+ var deltaTextChannelSchema = z35.enum([
12001
11973
  "agentMessage",
12002
11974
  "reasoningSummary",
12003
11975
  "reasoningText",
12004
11976
  "plan"
12005
11977
  ]);
12006
- var deltaOutputChannelSchema = z34.enum(["command", "fileChange"]);
12007
- var deltaErrorSchema = z34.object({ message: z34.string() });
12008
- var deltaAttachSchema = z34.enum(["open", "currentOrLast"]);
12009
- var deltaNoTurnFallbackSchema = z34.object({
11978
+ var deltaOutputChannelSchema = z35.enum(["command", "fileChange"]);
11979
+ var deltaErrorSchema = z35.object({ message: z35.string() });
11980
+ var deltaAttachSchema = z35.enum(["open", "currentOrLast"]);
11981
+ var deltaNoTurnFallbackSchema = z35.object({
12010
11982
  raw: providerRawEventSchema,
12011
- rawType: z34.string()
11983
+ rawType: z35.string()
12012
11984
  });
12013
11985
  function requireExtensionPresentation(delta, ctx) {
12014
11986
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -12019,36 +11991,36 @@ function requireExtensionPresentation(delta, ctx) {
12019
11991
  });
12020
11992
  }
12021
11993
  }
12022
- var threadDeltaSchema = z34.discriminatedUnion("kind", [
12023
- z34.object({
12024
- kind: z34.literal("input.accepted"),
11994
+ var threadDeltaSchema = z35.discriminatedUnion("kind", [
11995
+ z35.object({
11996
+ kind: z35.literal("input.accepted"),
12025
11997
  clientRequestId: clientTurnRequestIdSchema,
12026
11998
  providerTurnId: providerTurnIdSchema.optional()
12027
11999
  }),
12028
- z34.object({
12029
- kind: z34.literal("input.provider"),
12030
- text: z34.string().min(1),
12000
+ z35.object({
12001
+ kind: z35.literal("input.provider"),
12002
+ text: z35.string().min(1),
12031
12003
  parentRef: deltaKeyPartSchema.optional()
12032
12004
  }),
12033
- z34.object({
12034
- kind: z34.literal("turn.open"),
12005
+ z35.object({
12006
+ kind: z35.literal("turn.open"),
12035
12007
  providerTurnId: providerTurnIdSchema.optional(),
12036
12008
  parentRef: deltaKeyPartSchema.optional()
12037
12009
  }),
12038
- z34.object({
12039
- kind: z34.literal("turn.mainRun"),
12040
- state: z34.enum(["idle", "running"])
12010
+ z35.object({
12011
+ kind: z35.literal("turn.mainRun"),
12012
+ state: z35.enum(["idle", "running"])
12041
12013
  }),
12042
- z34.object({
12043
- kind: z34.literal("turn.boundary"),
12014
+ z35.object({
12015
+ kind: z35.literal("turn.boundary"),
12044
12016
  status: threadEventTurnStatusSchema,
12045
12017
  error: deltaErrorSchema.optional(),
12046
- providerCheckpointId: z34.string().min(1).optional(),
12047
- claimIfIdle: z34.boolean().optional(),
12018
+ providerCheckpointId: z35.string().min(1).optional(),
12019
+ claimIfIdle: z35.boolean().optional(),
12048
12020
  providerTurnId: providerTurnIdSchema.optional()
12049
12021
  }),
12050
- z34.object({
12051
- kind: z34.literal("item.open"),
12022
+ z35.object({
12023
+ kind: z35.literal("item.open"),
12052
12024
  key: deltaItemKeySchema,
12053
12025
  item: deltaItemShapeSchema,
12054
12026
  presentation: deltaPresentationSchema.optional(),
@@ -12056,153 +12028,153 @@ var threadDeltaSchema = z34.discriminatedUnion("kind", [
12056
12028
  providerTurnId: providerTurnIdSchema.optional(),
12057
12029
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12058
12030
  }).superRefine(requireExtensionPresentation),
12059
- z34.object({
12060
- kind: z34.literal("item.close"),
12031
+ z35.object({
12032
+ kind: z35.literal("item.close"),
12061
12033
  key: deltaItemKeySchema,
12062
12034
  status: threadEventItemStatusSchema,
12063
- resultText: z34.string().optional(),
12064
- exitCode: z34.number().optional(),
12065
- aggregatedOutput: z34.string().optional(),
12066
- approvalStatus: z34.literal("denied").optional(),
12035
+ resultText: z35.string().optional(),
12036
+ exitCode: z35.number().optional(),
12037
+ aggregatedOutput: z35.string().optional(),
12038
+ approvalStatus: z35.literal("denied").optional(),
12067
12039
  item: deltaItemShapeSchema,
12068
12040
  presentation: deltaPresentationSchema.optional(),
12069
12041
  providerTurnId: providerTurnIdSchema.optional(),
12070
12042
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12071
12043
  }).superRefine(requireExtensionPresentation),
12072
- z34.object({
12073
- kind: z34.literal("item.progress"),
12044
+ z35.object({
12045
+ kind: z35.literal("item.progress"),
12074
12046
  key: deltaItemKeySchema,
12075
- message: z34.string().optional(),
12047
+ message: z35.string().optional(),
12076
12048
  snapshot: deltaProgressSnapshotSchema.optional(),
12077
- flush: z34.boolean().optional(),
12049
+ flush: z35.boolean().optional(),
12078
12050
  providerTurnId: providerTurnIdSchema.optional(),
12079
12051
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12080
12052
  }),
12081
- z34.object({
12082
- kind: z34.literal("item.textDelta"),
12053
+ z35.object({
12054
+ kind: z35.literal("item.textDelta"),
12083
12055
  key: deltaItemKeySchema,
12084
12056
  channel: deltaTextChannelSchema,
12085
- text: z34.string(),
12057
+ text: z35.string(),
12086
12058
  providerTurnId: providerTurnIdSchema.optional(),
12087
12059
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12088
12060
  }),
12089
- z34.object({
12090
- kind: z34.literal("item.textClose"),
12061
+ z35.object({
12062
+ kind: z35.literal("item.textClose"),
12091
12063
  key: deltaItemKeySchema,
12092
12064
  channel: deltaTextChannelSchema,
12093
- text: z34.string().optional(),
12065
+ text: z35.string().optional(),
12094
12066
  providerTurnId: providerTurnIdSchema.optional(),
12095
12067
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12096
12068
  }),
12097
- z34.object({
12098
- kind: z34.literal("item.outputDelta"),
12069
+ z35.object({
12070
+ kind: z35.literal("item.outputDelta"),
12099
12071
  key: deltaItemKeySchema,
12100
12072
  channel: deltaOutputChannelSchema,
12101
- text: z34.string(),
12073
+ text: z35.string(),
12102
12074
  providerTurnId: providerTurnIdSchema.optional(),
12103
12075
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12104
12076
  }),
12105
- z34.object({
12106
- kind: z34.literal("command.outputSnapshot"),
12077
+ z35.object({
12078
+ kind: z35.literal("command.outputSnapshot"),
12107
12079
  key: deltaItemKeySchema,
12108
- text: z34.string(),
12080
+ text: z35.string(),
12109
12081
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12110
12082
  }),
12111
- z34.object({
12112
- kind: z34.literal("usage"),
12083
+ z35.object({
12084
+ kind: z35.literal("usage"),
12113
12085
  total: threadEventTokenUsageBreakdownSchema,
12114
12086
  last: threadEventTokenUsageBreakdownSchema,
12115
- modelContextWindow: z34.number().nullable(),
12087
+ modelContextWindow: z35.number().nullable(),
12116
12088
  promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
12117
12089
  providerTurnId: providerTurnIdSchema.optional()
12118
12090
  }),
12119
- z34.object({
12120
- kind: z34.literal("contextWindow"),
12091
+ z35.object({
12092
+ kind: z35.literal("contextWindow"),
12121
12093
  snapshot: contextSnapshotSchema.optional(),
12122
- used: z34.number().nullable(),
12123
- size: z34.number().nullable().optional(),
12124
- estimated: z34.boolean(),
12094
+ used: z35.number().nullable(),
12095
+ size: z35.number().nullable().optional(),
12096
+ estimated: z35.boolean(),
12125
12097
  cost: threadUsageCostSchema.optional(),
12126
12098
  attach: deltaAttachSchema,
12127
12099
  providerTurnId: providerTurnIdSchema.optional()
12128
12100
  }),
12129
- z34.object({
12130
- kind: z34.literal("context.compacted"),
12101
+ z35.object({
12102
+ kind: z35.literal("context.compacted"),
12131
12103
  providerTurnId: providerTurnIdSchema.optional(),
12132
12104
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
12133
12105
  }),
12134
- z34.object({ kind: z34.literal("context.cleared") }),
12135
- z34.object({
12136
- kind: z34.literal("turn.diff"),
12137
- diff: z34.string(),
12106
+ z35.object({ kind: z35.literal("context.cleared") }),
12107
+ z35.object({
12108
+ kind: z35.literal("turn.diff"),
12109
+ diff: z35.string(),
12138
12110
  providerTurnId: providerTurnIdSchema.optional()
12139
12111
  }),
12140
- z34.object({ kind: z34.literal("thread.started") }),
12141
- z34.object({
12142
- kind: z34.literal("thread.identity"),
12143
- providerThreadId: z34.string().min(1)
12112
+ z35.object({ kind: z35.literal("thread.started") }),
12113
+ z35.object({
12114
+ kind: z35.literal("thread.identity"),
12115
+ providerThreadId: z35.string().min(1)
12144
12116
  }),
12145
- z34.object({
12146
- kind: z34.literal("thread.name"),
12147
- name: z34.string().min(1),
12148
- source: z34.literal("agent").optional()
12117
+ z35.object({
12118
+ kind: z35.literal("thread.name"),
12119
+ name: z35.string().min(1),
12120
+ source: z35.literal("agent").optional()
12149
12121
  }),
12150
- z34.object({
12151
- kind: z34.literal("extension.state"),
12122
+ z35.object({
12123
+ kind: z35.literal("extension.state"),
12152
12124
  extensionKind: extensionKindSchema,
12153
12125
  payload: jsonValueSchema
12154
12126
  }),
12155
- z34.object({
12156
- kind: z34.literal("provider.rateLimits"),
12127
+ z35.object({
12128
+ kind: z35.literal("provider.rateLimits"),
12157
12129
  rateLimits: providerRateLimitStateSchema
12158
12130
  }),
12159
- z34.object({
12160
- kind: z34.literal("provider.error"),
12161
- message: z34.string(),
12162
- detail: z34.string().optional(),
12163
- willRetry: z34.boolean().optional(),
12131
+ z35.object({
12132
+ kind: z35.literal("provider.error"),
12133
+ message: z35.string(),
12134
+ detail: z35.string().optional(),
12135
+ willRetry: z35.boolean().optional(),
12164
12136
  category: providerErrorCategorySchema.optional(),
12165
12137
  errorInfo: providerErrorInfoSchema.optional(),
12166
- settlesTurn: z34.boolean().optional(),
12138
+ settlesTurn: z35.boolean().optional(),
12167
12139
  providerTurnId: providerTurnIdSchema.optional(),
12168
- threadScoped: z34.boolean().optional()
12140
+ threadScoped: z35.boolean().optional()
12169
12141
  }),
12170
- z34.object({
12171
- kind: z34.literal("provider.modelFallback"),
12172
- originalModel: z34.string().min(1),
12173
- fallbackModel: z34.string().min(1),
12174
- reason: z34.enum(["refusal", "provider"]),
12175
- message: z34.string()
12142
+ z35.object({
12143
+ kind: z35.literal("provider.modelFallback"),
12144
+ originalModel: z35.string().min(1),
12145
+ fallbackModel: z35.string().min(1),
12146
+ reason: z35.enum(["refusal", "provider"]),
12147
+ message: z35.string()
12176
12148
  }),
12177
- z34.object({
12178
- kind: z34.literal("provider.warning"),
12179
- summary: z34.string().optional(),
12180
- details: z34.string().optional(),
12149
+ z35.object({
12150
+ kind: z35.literal("provider.warning"),
12151
+ summary: z35.string().optional(),
12152
+ details: z35.string().optional(),
12181
12153
  category: threadEventWarningCategorySchema.optional(),
12182
- vouchedTurn: z34.boolean().optional()
12154
+ vouchedTurn: z35.boolean().optional()
12183
12155
  }),
12184
- z34.object({
12185
- kind: z34.literal("unhandled"),
12156
+ z35.object({
12157
+ kind: z35.literal("unhandled"),
12186
12158
  raw: providerRawEventSchema,
12187
- rawType: z34.string(),
12188
- vouchedTurn: z34.boolean(),
12189
- onlyIfNoTurn: z34.boolean().optional(),
12159
+ rawType: z35.string(),
12160
+ vouchedTurn: z35.boolean(),
12161
+ onlyIfNoTurn: z35.boolean().optional(),
12190
12162
  parentRef: deltaKeyPartSchema.optional(),
12191
12163
  providerTurnId: providerTurnIdSchema.optional()
12192
12164
  }),
12193
- z34.object({ kind: z34.literal("session.ended") }),
12194
- z34.object({ kind: z34.literal("session.reset") })
12165
+ z35.object({ kind: z35.literal("session.ended") }),
12166
+ z35.object({ kind: z35.literal("session.reset") })
12195
12167
  ]);
12196
- var threadDeltaNotificationParamsSchema = z34.object({
12197
- threadId: z34.string().min(1),
12198
- deltas: z34.array(threadDeltaSchema)
12168
+ var threadDeltaNotificationParamsSchema = z35.object({
12169
+ threadId: z35.string().min(1),
12170
+ deltas: z35.array(threadDeltaSchema)
12199
12171
  }).passthrough();
12200
12172
 
12201
12173
  // ../provider-bridge-acp/src/launch-spec.ts
12202
- import { z as z35 } from "zod";
12203
- var acpNativeSkillRootsSchema = z35.object({
12204
- user: z35.array(providerNativeRootInputSchema).default([]),
12205
- project: z35.array(providerNativeRootInputSchema).default([])
12174
+ import { z as z36 } from "zod";
12175
+ var acpNativeSkillRootsSchema = z36.object({
12176
+ user: z36.array(providerNativeRootInputSchema).default([]),
12177
+ project: z36.array(providerNativeRootInputSchema).default([])
12206
12178
  }).strict().superRefine((roots, context) => {
12207
12179
  const normalized = providerNativeRootsSchema.safeParse(
12208
12180
  normalizeProviderNativeRoots(roots)
@@ -12218,16 +12190,16 @@ var acpNativeSkillRootsSchema = z35.object({
12218
12190
  });
12219
12191
  }
12220
12192
  });
12221
- var acpLaunchSpecSchema = z35.object({
12222
- displayName: z35.string().min(1),
12223
- command: z35.string().min(1),
12224
- args: z35.array(z35.string()),
12225
- env: z35.record(z35.string().min(1), z35.string()),
12226
- cwd: z35.string().min(1).optional(),
12227
- modelCli: z35.object({
12228
- listArgs: z35.array(z35.string()),
12229
- selectFlag: z35.string().min(1).optional(),
12230
- primaryModels: z35.array(z35.string())
12193
+ var acpLaunchSpecSchema = z36.object({
12194
+ displayName: z36.string().min(1),
12195
+ command: z36.string().min(1),
12196
+ args: z36.array(z36.string()),
12197
+ env: z36.record(z36.string().min(1), z36.string()),
12198
+ cwd: z36.string().min(1).optional(),
12199
+ modelCli: z36.object({
12200
+ listArgs: z36.array(z36.string()),
12201
+ selectFlag: z36.string().min(1).optional(),
12202
+ primaryModels: z36.array(z36.string())
12231
12203
  }).strict().transform(
12232
12204
  (modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
12233
12205
  ).optional(),
@@ -12265,35 +12237,35 @@ function normalizeAcpLaunchSpec(spec) {
12265
12237
  }
12266
12238
 
12267
12239
  // src/claude-task-tools.ts
12268
- import { z as z36 } from "zod";
12269
- var claudeTaskToolNameSchema = z36.enum([
12240
+ import { z as z37 } from "zod";
12241
+ var claudeTaskToolNameSchema = z37.enum([
12270
12242
  "TaskCreate",
12271
12243
  "TaskGet",
12272
12244
  "TaskList",
12273
12245
  "TaskUpdate"
12274
12246
  ]);
12275
- var claudeTaskStatusSchema = z36.enum(["pending", "in_progress", "completed"]);
12276
- var claudeTaskCreateOutputSchema = z36.object({
12277
- task: z36.object({
12278
- id: z36.string(),
12279
- subject: z36.string()
12247
+ var claudeTaskStatusSchema = z37.enum(["pending", "in_progress", "completed"]);
12248
+ var claudeTaskCreateOutputSchema = z37.object({
12249
+ task: z37.object({
12250
+ id: z37.string(),
12251
+ subject: z37.string()
12280
12252
  }).passthrough()
12281
12253
  }).passthrough();
12282
- var claudeTaskGetOutputSchema = z36.object({
12283
- task: z36.object({
12284
- id: z36.string(),
12254
+ var claudeTaskGetOutputSchema = z37.object({
12255
+ task: z37.object({
12256
+ id: z37.string(),
12285
12257
  status: claudeTaskStatusSchema,
12286
- subject: z36.string()
12258
+ subject: z37.string()
12287
12259
  }).passthrough().nullable()
12288
12260
  }).passthrough();
12289
- var claudeTaskUpdateOutputSchema = z36.object({
12290
- success: z36.boolean(),
12291
- taskId: z36.string()
12261
+ var claudeTaskUpdateOutputSchema = z37.object({
12262
+ success: z37.boolean(),
12263
+ taskId: z37.string()
12292
12264
  }).passthrough();
12293
- var claudeTaskListOutputSchema = z36.object({
12294
- tasks: z36.array(z36.unknown())
12265
+ var claudeTaskListOutputSchema = z37.object({
12266
+ tasks: z37.array(z37.unknown())
12295
12267
  }).passthrough();
12296
- var claudeTaskToolOutputSchema = z36.union([
12268
+ var claudeTaskToolOutputSchema = z37.union([
12297
12269
  claudeTaskCreateOutputSchema,
12298
12270
  claudeTaskGetOutputSchema,
12299
12271
  claudeTaskListOutputSchema,