@get-bb/plugin-sdk 0.6.33 → 0.6.39

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.
@@ -46,17 +46,7 @@ var jsonObjectSchema = z2.record(
46
46
  );
47
47
 
48
48
  // ../domain/src/shared-types.ts
49
- var reasoningLevelValues = [
50
- "none",
51
- "low",
52
- "medium",
53
- "high",
54
- "xhigh",
55
- "ultracode",
56
- "max",
57
- "ultra"
58
- ];
59
- var reasoningLevelSchema = z3.enum(reasoningLevelValues);
49
+ var reasoningLevelSchema = z3.string().min(1);
60
50
  var serviceTierSchema = z3.string().min(1);
61
51
  var instructionModeValues = ["append", "replace"];
62
52
  var instructionModeSchema = z3.enum(instructionModeValues);
@@ -141,6 +131,11 @@ var canonicalPromptMentionResourceSchema = z3.discriminatedUnion("kind", [
141
131
  icon: z3.string().nullable().optional(),
142
132
  itemId: z3.string(),
143
133
  label: z3.string()
134
+ }),
135
+ z3.object({
136
+ kind: z3.literal("attachment"),
137
+ path: z3.string(),
138
+ label: z3.string()
144
139
  })
145
140
  ]);
146
141
  function normalizeLegacyPromptMentionResource(value) {
@@ -249,11 +244,17 @@ var runtimePermissionPolicySchema = z3.discriminatedUnion(
249
244
  ]
250
245
  );
251
246
  var promptModeSchema = z3.literal("plan");
247
+ var sessionOptionValueSchema = z3.union([z3.string(), z3.boolean()]);
248
+ var sessionOptionSelectionsSchema = z3.record(
249
+ z3.string().min(1),
250
+ sessionOptionValueSchema
251
+ );
252
252
  var runtimeThreadExecutionBaseOptionsSchema = z3.object({
253
253
  model: z3.string().min(1),
254
254
  serviceTier: serviceTierSchema,
255
255
  reasoningLevel: reasoningLevelSchema,
256
256
  promptMode: promptModeSchema.optional(),
257
+ sessionOptions: sessionOptionSelectionsSchema.optional(),
257
258
  providerOptions: jsonObjectSchema
258
259
  });
259
260
  var runtimeThreadExecutionOptionsSchema = runtimeThreadExecutionBaseOptionsSchema.and(runtimePermissionPolicySchema);
@@ -1411,11 +1412,16 @@ var threadEventTokenUsageBreakdownSchema = z14.object({
1411
1412
  outputTokens: z14.number(),
1412
1413
  reasoningOutputTokens: z14.number()
1413
1414
  });
1415
+ var threadUsageCostSchema = z14.object({
1416
+ amount: z14.number().nonnegative(),
1417
+ currency: z14.string().min(1)
1418
+ });
1414
1419
  var threadEventContextWindowUsageSchema = z14.object({
1415
1420
  snapshot: contextSnapshotSchema.optional(),
1416
1421
  usedTokens: z14.number().nullable(),
1417
1422
  modelContextWindow: z14.number().nullable(),
1418
- estimated: z14.boolean()
1423
+ estimated: z14.boolean(),
1424
+ cost: threadUsageCostSchema.optional()
1419
1425
  });
1420
1426
  var threadEventTokenUsageSchema = z14.object({
1421
1427
  total: threadEventTokenUsageBreakdownSchema,
@@ -1598,7 +1604,8 @@ var unscopedProviderEventSchema = z14.discriminatedUnion("type", [
1598
1604
  type: z14.literal("thread/name/updated"),
1599
1605
  threadId: z14.string(),
1600
1606
  providerThreadId: z14.string(),
1601
- threadName: z14.string()
1607
+ threadName: z14.string(),
1608
+ source: z14.literal("agent").optional()
1602
1609
  }),
1603
1610
  z14.object({
1604
1611
  type: z14.literal("thread/compacted"),
@@ -1894,103 +1901,154 @@ function parseNamespacedGlyph(glyph) {
1894
1901
  };
1895
1902
  }
1896
1903
 
1897
- // ../domain/src/provider-fork.ts
1904
+ // ../domain/src/thread-provider-state.ts
1898
1905
  import { z as z15 } from "zod";
1906
+ var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
1907
+ var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
1908
+ var threadProviderCommandSchema = z15.object({
1909
+ name: z15.string().min(1),
1910
+ description: z15.string(),
1911
+ inputHint: z15.string().min(1).optional()
1912
+ });
1913
+ var threadProviderCommandsStateSchema = z15.object({
1914
+ commands: z15.array(threadProviderCommandSchema).max(500)
1915
+ });
1916
+ var threadSessionOptionValueSchema = z15.object({
1917
+ id: z15.string().min(1),
1918
+ label: z15.string().min(1),
1919
+ description: z15.string().min(1).optional(),
1920
+ group: z15.string().min(1).optional()
1921
+ });
1922
+ var threadSessionOptionBaseShape = {
1923
+ id: z15.string().min(1),
1924
+ label: z15.string().min(1),
1925
+ description: z15.string().min(1).optional(),
1926
+ category: z15.string().min(1).optional()
1927
+ };
1928
+ var threadSessionOptionSchema = z15.discriminatedUnion("type", [
1929
+ z15.object({
1930
+ ...threadSessionOptionBaseShape,
1931
+ type: z15.literal("select"),
1932
+ value: z15.string(),
1933
+ values: z15.array(threadSessionOptionValueSchema).max(1e3)
1934
+ }),
1935
+ z15.object({
1936
+ ...threadSessionOptionBaseShape,
1937
+ type: z15.literal("boolean"),
1938
+ value: z15.boolean(),
1939
+ fixed: z15.boolean().optional()
1940
+ })
1941
+ ]);
1942
+ var threadSessionOptionsStateSchema = z15.object({
1943
+ options: z15.array(threadSessionOptionSchema).max(64)
1944
+ });
1945
+ var threadSessionOptionSelectionsStateSchema = z15.object({
1946
+ selections: sessionOptionSelectionsSchema
1947
+ });
1948
+ var CORE_THREAD_STATE_SCHEMAS = {
1949
+ [THREAD_PROVIDER_COMMANDS_STATE_KIND]: threadProviderCommandsStateSchema,
1950
+ [THREAD_SESSION_OPTIONS_STATE_KIND]: threadSessionOptionsStateSchema
1951
+ };
1952
+
1953
+ // ../domain/src/provider-fork.ts
1954
+ import { z as z16 } from "zod";
1899
1955
  var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
1900
- var providerForkSchema = z15.enum(PROVIDER_FORK_VALUES);
1956
+ var providerForkSchema = z16.enum(PROVIDER_FORK_VALUES);
1901
1957
 
1902
1958
  // ../domain/src/provider-types.ts
1903
- import { z as z16 } from "zod";
1904
- var modelReasoningEffortSchema = z16.object({
1959
+ import { z as z17 } from "zod";
1960
+ var modelReasoningEffortSchema = z17.object({
1905
1961
  reasoningEffort: reasoningLevelSchema,
1906
- description: z16.string()
1962
+ label: z17.string().min(1).optional(),
1963
+ description: z17.string()
1907
1964
  });
1908
- var modelServiceTierSchema = z16.object({
1965
+ var modelServiceTierSchema = z17.object({
1909
1966
  id: serviceTierSchema,
1910
- label: z16.string().min(1).optional(),
1911
- description: z16.string().min(1).optional()
1912
- });
1913
- var availableModelSchema = z16.object({
1914
- id: z16.string(),
1915
- model: z16.string(),
1916
- displayName: z16.string(),
1917
- routeProviderId: z16.string().min(1).optional(),
1918
- description: z16.string(),
1919
- supportedReasoningEfforts: z16.array(modelReasoningEffortSchema),
1967
+ label: z17.string().min(1).optional(),
1968
+ description: z17.string().min(1).optional()
1969
+ });
1970
+ var availableModelSchema = z17.object({
1971
+ id: z17.string(),
1972
+ model: z17.string(),
1973
+ displayName: z17.string(),
1974
+ routeProviderId: z17.string().min(1).optional(),
1975
+ description: z17.string(),
1976
+ supportedReasoningEfforts: z17.array(modelReasoningEffortSchema),
1920
1977
  defaultReasoningEffort: reasoningLevelSchema,
1921
- supportedServiceTiers: z16.array(modelServiceTierSchema).optional(),
1922
- isDefault: z16.boolean()
1923
- });
1924
- var providerModelCatalogScopeSchema = z16.enum(["host", "workspace"]);
1925
- var providerCapabilitiesSchema = z16.object({
1926
- supportsThreadArchive: z16.boolean(),
1927
- supportsThreadRename: z16.boolean(),
1928
- supportsServiceTier: z16.boolean(),
1929
- supportsNativeUserQuestion: z16.boolean(),
1930
- supportsFork: z16.boolean(),
1931
- supportsSessionRewind: z16.boolean(),
1932
- permissionModes: z16.array(permissionModeSchema).min(1),
1978
+ supportedServiceTiers: z17.array(modelServiceTierSchema).optional(),
1979
+ sessionOptions: z17.array(threadSessionOptionSchema).max(64).optional(),
1980
+ isDefault: z17.boolean()
1981
+ });
1982
+ var providerModelCatalogScopeSchema = z17.enum(["host", "workspace"]);
1983
+ var providerCapabilitiesSchema = z17.object({
1984
+ supportsThreadArchive: z17.boolean(),
1985
+ supportsThreadRename: z17.boolean(),
1986
+ supportsServiceTier: z17.boolean(),
1987
+ supportsNativeUserQuestion: z17.boolean(),
1988
+ supportsFork: z17.boolean(),
1989
+ supportsSessionRewind: z17.boolean(),
1990
+ permissionModes: z17.array(permissionModeSchema).min(1),
1933
1991
  modelCatalogScope: providerModelCatalogScopeSchema
1934
1992
  });
1935
- var providerComposerCommandSchema = z16.object({
1993
+ var providerComposerCommandSchema = z17.object({
1936
1994
  trigger: promptMentionCommandTriggerSchema,
1937
- name: z16.string().min(1).regex(/^[^\s/$]+$/u),
1938
- trailingText: z16.string().regex(/^\s*$/u)
1995
+ name: z17.string().min(1).regex(/^[^\s/$]+$/u),
1996
+ trailingText: z17.string().regex(/^\s*$/u)
1939
1997
  });
1940
- var providerComposerActionSchema = z16.discriminatedUnion("kind", [
1941
- z16.object({
1942
- kind: z16.literal("skills"),
1998
+ var providerComposerActionSchema = z17.discriminatedUnion("kind", [
1999
+ z17.object({
2000
+ kind: z17.literal("skills"),
1943
2001
  trigger: promptMentionCommandTriggerSchema
1944
2002
  }),
1945
- z16.object({
1946
- kind: z16.literal("plan"),
2003
+ z17.object({
2004
+ kind: z17.literal("plan"),
1947
2005
  command: providerComposerCommandSchema
1948
2006
  }),
1949
- z16.object({
1950
- kind: z16.literal("goal"),
2007
+ z17.object({
2008
+ kind: z17.literal("goal"),
1951
2009
  command: providerComposerCommandSchema
1952
2010
  })
1953
2011
  ]);
1954
- var providerStringsSchema = z16.object({
1955
- signInHint: z16.string().min(1),
1956
- expiredHint: z16.string().min(1),
1957
- installUrl: z16.string().min(1),
1958
- brandPrefix: z16.string().min(1).optional(),
1959
- planModeCopy: z16.string().min(1).optional(),
1960
- iconTint: z16.object({ light: z16.string().min(1), dark: z16.string().min(1) }).optional()
1961
- });
1962
- var providerOptionDescriptorSchema = z16.object({
1963
- id: z16.string().min(1),
1964
- label: z16.string().min(1),
1965
- description: z16.string().min(1).optional()
1966
- });
1967
- var providerExtensionKindInfoSchema = z16.object({
1968
- item: z16.boolean(),
1969
- state: z16.boolean()
1970
- });
1971
- var providerExtensionKindsSchema = z16.record(
2012
+ var providerStringsSchema = z17.object({
2013
+ signInHint: z17.string().min(1),
2014
+ expiredHint: z17.string().min(1),
2015
+ installUrl: z17.string().min(1),
2016
+ brandPrefix: z17.string().min(1).optional(),
2017
+ planModeCopy: z17.string().min(1).optional(),
2018
+ iconTint: z17.object({ light: z17.string().min(1), dark: z17.string().min(1) }).optional()
2019
+ });
2020
+ var providerOptionDescriptorSchema = z17.object({
2021
+ id: z17.string().min(1),
2022
+ label: z17.string().min(1),
2023
+ description: z17.string().min(1).optional()
2024
+ });
2025
+ var providerExtensionKindInfoSchema = z17.object({
2026
+ item: z17.boolean(),
2027
+ state: z17.boolean()
2028
+ });
2029
+ var providerExtensionKindsSchema = z17.record(
1972
2030
  extensionKindSchema,
1973
2031
  providerExtensionKindInfoSchema
1974
2032
  );
1975
- var providerInfoSchema = z16.object({
1976
- id: z16.string(),
1977
- pluginId: z16.string().min(1),
1978
- displayName: z16.string(),
1979
- family: z16.string().min(1).optional(),
1980
- icon: z16.object({ glyph: z16.string().min(1) }).optional(),
1981
- logoUrl: z16.string().min(1).nullable(),
1982
- maintenance: z16.object({
1983
- health: z16.boolean(),
1984
- usage: z16.boolean(),
1985
- installation: z16.boolean()
2033
+ var providerInfoSchema = z17.object({
2034
+ id: z17.string(),
2035
+ pluginId: z17.string().min(1),
2036
+ displayName: z17.string(),
2037
+ family: z17.string().min(1).optional(),
2038
+ icon: z17.object({ glyph: z17.string().min(1) }).optional(),
2039
+ logoUrl: z17.string().min(1).nullable(),
2040
+ maintenance: z17.object({
2041
+ health: z17.boolean(),
2042
+ usage: z17.boolean(),
2043
+ installation: z17.boolean()
1986
2044
  }),
1987
2045
  capabilities: providerCapabilitiesSchema,
1988
- composerActions: z16.array(providerComposerActionSchema),
2046
+ composerActions: z17.array(providerComposerActionSchema),
1989
2047
  completedTurnDisplay: completedTurnDisplaySchema,
1990
- available: z16.boolean(),
2048
+ available: z17.boolean(),
1991
2049
  strings: providerStringsSchema.optional(),
1992
- serviceTiers: z16.array(providerOptionDescriptorSchema).optional(),
1993
- reasoningLevels: z16.array(providerOptionDescriptorSchema).optional(),
2050
+ serviceTiers: z17.array(providerOptionDescriptorSchema).optional(),
2051
+ reasoningLevels: z17.array(providerOptionDescriptorSchema).optional(),
1994
2052
  extensionKinds: providerExtensionKindsSchema.optional()
1995
2053
  });
1996
2054
  var providerRecoveryKindValues = [
@@ -2000,151 +2058,151 @@ var providerRecoveryKindValues = [
2000
2058
  "staleTurn",
2001
2059
  "rateLimited"
2002
2060
  ];
2003
- var providerRecoveryKindSchema = z16.enum(providerRecoveryKindValues);
2004
- var toolCallOutputItemSchema = z16.discriminatedUnion("type", [
2005
- z16.object({
2006
- type: z16.literal("inputText"),
2007
- text: z16.string()
2061
+ var providerRecoveryKindSchema = z17.enum(providerRecoveryKindValues);
2062
+ var toolCallOutputItemSchema = z17.discriminatedUnion("type", [
2063
+ z17.object({
2064
+ type: z17.literal("inputText"),
2065
+ text: z17.string()
2008
2066
  }),
2009
- z16.object({
2010
- type: z16.literal("inputImage"),
2011
- imageUrl: z16.string()
2067
+ z17.object({
2068
+ type: z17.literal("inputImage"),
2069
+ imageUrl: z17.string()
2012
2070
  })
2013
2071
  ]);
2014
- var toolCallRequestSchema = z16.object({
2015
- requestId: z16.union([z16.string().min(1), z16.number()]),
2016
- threadId: z16.string().min(1),
2017
- providerThreadId: z16.string().min(1),
2018
- turnId: z16.string().min(1),
2019
- callId: z16.string().min(1),
2020
- tool: z16.string().min(1),
2021
- arguments: z16.unknown().optional()
2022
- });
2023
- var toolCallResponseSchema = z16.object({
2024
- contentItems: z16.array(toolCallOutputItemSchema),
2025
- success: z16.boolean()
2026
- });
2027
- var dynamicToolSchema = z16.object({
2028
- name: z16.string(),
2029
- description: z16.string(),
2030
- inputSchema: z16.unknown(),
2072
+ var toolCallRequestSchema = z17.object({
2073
+ requestId: z17.union([z17.string().min(1), z17.number()]),
2074
+ threadId: z17.string().min(1),
2075
+ providerThreadId: z17.string().min(1),
2076
+ turnId: z17.string().min(1),
2077
+ callId: z17.string().min(1),
2078
+ tool: z17.string().min(1),
2079
+ arguments: z17.unknown().optional()
2080
+ });
2081
+ var toolCallResponseSchema = z17.object({
2082
+ contentItems: z17.array(toolCallOutputItemSchema),
2083
+ success: z17.boolean()
2084
+ });
2085
+ var dynamicToolSchema = z17.object({
2086
+ name: z17.string(),
2087
+ description: z17.string(),
2088
+ inputSchema: z17.unknown(),
2031
2089
  presentation: threadEventItemPresentationSchema.optional()
2032
2090
  });
2033
2091
 
2034
2092
  // ../provider-bridge-protocol/src/thread-delta.ts
2035
- import { z as z17 } from "zod";
2093
+ import { z as z18 } from "zod";
2036
2094
  var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
2037
2095
  var deltaPresentationSchema = threadEventItemPresentationSchema;
2038
2096
  var THREAD_DELTA_KEY_SEPARATOR = "";
2039
- var deltaKeyPartSchema = z17.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2097
+ var deltaKeyPartSchema = z18.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
2040
2098
  message: "provider keys must not contain the internal key separator (\\u001f)"
2041
2099
  });
2042
- var deltaItemKeySchema = z17.object({
2100
+ var deltaItemKeySchema = z18.object({
2043
2101
  providerItemId: deltaKeyPartSchema.optional(),
2044
2102
  channel: deltaKeyPartSchema.optional(),
2045
2103
  parentRef: deltaKeyPartSchema.optional()
2046
2104
  });
2047
2105
  var providerTurnIdSchema = deltaKeyPartSchema;
2048
- var deltaFileChangeSchema = z17.object({
2049
- path: z17.string(),
2050
- kind: z17.enum(["add", "update", "delete"]),
2051
- movePath: z17.string().optional(),
2052
- diff: z17.string().optional(),
2053
- oldText: z17.string().optional(),
2054
- newText: z17.string().optional()
2055
- });
2056
- var deltaBackgroundTaskShapeSchema = z17.object({
2057
- type: z17.literal("backgroundTask"),
2058
- familyId: z17.string().min(1),
2059
- taskType: z17.string(),
2060
- description: z17.string(),
2106
+ var deltaFileChangeSchema = z18.object({
2107
+ path: z18.string(),
2108
+ kind: z18.enum(["add", "update", "delete"]),
2109
+ movePath: z18.string().optional(),
2110
+ diff: z18.string().optional(),
2111
+ oldText: z18.string().optional(),
2112
+ newText: z18.string().optional()
2113
+ });
2114
+ var deltaBackgroundTaskShapeSchema = z18.object({
2115
+ type: z18.literal("backgroundTask"),
2116
+ familyId: z18.string().min(1),
2117
+ taskType: z18.string(),
2118
+ description: z18.string(),
2061
2119
  status: threadEventItemStatusSchema,
2062
2120
  taskStatus: backgroundTaskStatusSchema,
2063
- skipTranscript: z17.boolean(),
2064
- workflowName: z17.string().optional(),
2121
+ skipTranscript: z18.boolean(),
2122
+ workflowName: z18.string().optional(),
2065
2123
  workflow: workflowProgressSnapshotSchema.optional(),
2066
2124
  usage: backgroundTaskUsageSchema.optional(),
2067
- summary: z17.string().optional(),
2068
- error: z17.string().optional(),
2069
- outputFile: z17.string().optional()
2125
+ summary: z18.string().optional(),
2126
+ error: z18.string().optional(),
2127
+ outputFile: z18.string().optional()
2070
2128
  });
2071
- var deltaFileReadShapeSchema = z17.object({
2072
- type: z17.literal("fileRead"),
2073
- path: z17.string(),
2074
- cmd: z17.string().optional()
2129
+ var deltaFileReadShapeSchema = z18.object({
2130
+ type: z18.literal("fileRead"),
2131
+ path: z18.string(),
2132
+ cmd: z18.string().optional()
2075
2133
  });
2076
- var deltaSearchShapeSchema = z17.object({
2077
- type: z17.literal("search"),
2134
+ var deltaSearchShapeSchema = z18.object({
2135
+ type: z18.literal("search"),
2078
2136
  mode: threadEventSearchModeSchema,
2079
- query: z17.string(),
2080
- path: z17.string().optional(),
2081
- cmd: z17.string().optional()
2137
+ query: z18.string(),
2138
+ path: z18.string().optional(),
2139
+ cmd: z18.string().optional()
2082
2140
  });
2083
- var deltaDelegationShapeSchema = z17.object({
2084
- type: z17.literal("delegation"),
2141
+ var deltaDelegationShapeSchema = z18.object({
2142
+ type: z18.literal("delegation"),
2085
2143
  childRef: deltaKeyPartSchema,
2086
- label: z17.string(),
2087
- background: z17.boolean(),
2088
- summary: z17.string().optional()
2144
+ label: z18.string(),
2145
+ background: z18.boolean(),
2146
+ summary: z18.string().optional()
2089
2147
  });
2090
- var deltaPlanStepsShapeSchema = z17.object({
2091
- type: z17.literal("planSteps"),
2092
- steps: z17.array(threadEventPlanStepSchema),
2093
- explanation: z17.string().optional()
2148
+ var deltaPlanStepsShapeSchema = z18.object({
2149
+ type: z18.literal("planSteps"),
2150
+ steps: z18.array(threadEventPlanStepSchema),
2151
+ explanation: z18.string().optional()
2094
2152
  });
2095
- var deltaExtensionShapeSchema = z17.object({
2096
- type: z17.literal("extension"),
2153
+ var deltaExtensionShapeSchema = z18.object({
2154
+ type: z18.literal("extension"),
2097
2155
  kind: extensionKindSchema,
2098
2156
  payload: jsonValueSchema
2099
2157
  });
2100
- var deltaItemShapeSchema = z17.discriminatedUnion("type", [
2101
- z17.object({
2102
- type: z17.literal("command"),
2103
- command: z17.string(),
2104
- cwd: z17.string(),
2105
- aggregatedOutput: z17.string().optional(),
2106
- exitCode: z17.number().optional(),
2107
- durationMs: z17.number().optional()
2158
+ var deltaItemShapeSchema = z18.discriminatedUnion("type", [
2159
+ z18.object({
2160
+ type: z18.literal("command"),
2161
+ command: z18.string(),
2162
+ cwd: z18.string(),
2163
+ aggregatedOutput: z18.string().optional(),
2164
+ exitCode: z18.number().optional(),
2165
+ durationMs: z18.number().optional()
2108
2166
  }),
2109
- z17.object({
2110
- type: z17.literal("fileChange"),
2111
- changes: z17.array(deltaFileChangeSchema)
2167
+ z18.object({
2168
+ type: z18.literal("fileChange"),
2169
+ changes: z18.array(deltaFileChangeSchema)
2112
2170
  }),
2113
- z17.object({
2114
- type: z17.literal("tool"),
2115
- tool: z17.string(),
2116
- server: z17.string().optional(),
2117
- args: z17.unknown().optional(),
2118
- result: z17.unknown().optional(),
2119
- error: z17.string().optional(),
2120
- durationMs: z17.number().optional()
2171
+ z18.object({
2172
+ type: z18.literal("tool"),
2173
+ tool: z18.string(),
2174
+ server: z18.string().optional(),
2175
+ args: z18.unknown().optional(),
2176
+ result: z18.unknown().optional(),
2177
+ error: z18.string().optional(),
2178
+ durationMs: z18.number().optional()
2121
2179
  }),
2122
- z17.object({ type: z17.literal("compaction") }),
2123
- z17.object({ type: z17.literal("agentMessage"), text: z17.string() }),
2124
- z17.object({
2125
- type: z17.literal("reasoning"),
2126
- summary: z17.array(z17.string()),
2127
- content: z17.array(z17.string())
2180
+ z18.object({ type: z18.literal("compaction") }),
2181
+ z18.object({ type: z18.literal("agentMessage"), text: z18.string() }),
2182
+ z18.object({
2183
+ type: z18.literal("reasoning"),
2184
+ summary: z18.array(z18.string()),
2185
+ content: z18.array(z18.string())
2128
2186
  }),
2129
- z17.object({ type: z17.literal("plan"), text: z17.string() }),
2130
- z17.object({
2131
- type: z17.literal("webSearch"),
2132
- queries: z17.array(z17.string()).min(1)
2187
+ z18.object({ type: z18.literal("plan"), text: z18.string() }),
2188
+ z18.object({
2189
+ type: z18.literal("webSearch"),
2190
+ queries: z18.array(z18.string()).min(1)
2133
2191
  }),
2134
- z17.object({
2135
- type: z17.literal("webFetch"),
2136
- url: z17.string(),
2137
- prompt: z17.string().nullable().optional(),
2138
- pattern: z17.string().nullable()
2192
+ z18.object({
2193
+ type: z18.literal("webFetch"),
2194
+ url: z18.string(),
2195
+ prompt: z18.string().nullable().optional(),
2196
+ pattern: z18.string().nullable()
2139
2197
  }),
2140
- z17.object({ type: z17.literal("imageView"), path: z17.string() }),
2141
- z17.object({
2142
- type: z17.literal("imageGeneration"),
2143
- prompt: z17.string().nullable(),
2144
- path: z17.string().nullable(),
2145
- result: z17.string().optional(),
2146
- error: z17.string().nullable(),
2147
- transparentBackground: z17.boolean()
2198
+ z18.object({ type: z18.literal("imageView"), path: z18.string() }),
2199
+ z18.object({
2200
+ type: z18.literal("imageGeneration"),
2201
+ prompt: z18.string().nullable(),
2202
+ path: z18.string().nullable(),
2203
+ result: z18.string().optional(),
2204
+ error: z18.string().nullable(),
2205
+ transparentBackground: z18.boolean()
2148
2206
  }),
2149
2207
  deltaBackgroundTaskShapeSchema,
2150
2208
  deltaFileReadShapeSchema,
@@ -2153,22 +2211,22 @@ var deltaItemShapeSchema = z17.discriminatedUnion("type", [
2153
2211
  deltaPlanStepsShapeSchema,
2154
2212
  deltaExtensionShapeSchema
2155
2213
  ]);
2156
- var deltaProgressSnapshotSchema = z17.discriminatedUnion("type", [
2214
+ var deltaProgressSnapshotSchema = z18.discriminatedUnion("type", [
2157
2215
  deltaBackgroundTaskShapeSchema,
2158
2216
  deltaDelegationShapeSchema
2159
2217
  ]);
2160
- var deltaTextChannelSchema = z17.enum([
2218
+ var deltaTextChannelSchema = z18.enum([
2161
2219
  "agentMessage",
2162
2220
  "reasoningSummary",
2163
2221
  "reasoningText",
2164
2222
  "plan"
2165
2223
  ]);
2166
- var deltaOutputChannelSchema = z17.enum(["command", "fileChange"]);
2167
- var deltaErrorSchema = z17.object({ message: z17.string() });
2168
- var deltaAttachSchema = z17.enum(["open", "currentOrLast"]);
2169
- var deltaNoTurnFallbackSchema = z17.object({
2224
+ var deltaOutputChannelSchema = z18.enum(["command", "fileChange"]);
2225
+ var deltaErrorSchema = z18.object({ message: z18.string() });
2226
+ var deltaAttachSchema = z18.enum(["open", "currentOrLast"]);
2227
+ var deltaNoTurnFallbackSchema = z18.object({
2170
2228
  raw: providerRawEventSchema,
2171
- rawType: z17.string()
2229
+ rawType: z18.string()
2172
2230
  });
2173
2231
  function requireExtensionPresentation(delta, ctx) {
2174
2232
  if (delta.item.type === "extension" && delta.presentation === void 0) {
@@ -2179,32 +2237,32 @@ function requireExtensionPresentation(delta, ctx) {
2179
2237
  });
2180
2238
  }
2181
2239
  }
2182
- var threadDeltaSchema = z17.discriminatedUnion("kind", [
2183
- z17.object({
2184
- kind: z17.literal("input.accepted"),
2240
+ var threadDeltaSchema = z18.discriminatedUnion("kind", [
2241
+ z18.object({
2242
+ kind: z18.literal("input.accepted"),
2185
2243
  clientRequestId: clientTurnRequestIdSchema,
2186
2244
  providerTurnId: providerTurnIdSchema.optional()
2187
2245
  }),
2188
- z17.object({
2189
- kind: z17.literal("input.provider"),
2190
- text: z17.string().min(1),
2246
+ z18.object({
2247
+ kind: z18.literal("input.provider"),
2248
+ text: z18.string().min(1),
2191
2249
  parentRef: deltaKeyPartSchema.optional()
2192
2250
  }),
2193
- z17.object({
2194
- kind: z17.literal("turn.open"),
2251
+ z18.object({
2252
+ kind: z18.literal("turn.open"),
2195
2253
  providerTurnId: providerTurnIdSchema.optional(),
2196
2254
  parentRef: deltaKeyPartSchema.optional()
2197
2255
  }),
2198
- z17.object({
2199
- kind: z17.literal("turn.boundary"),
2256
+ z18.object({
2257
+ kind: z18.literal("turn.boundary"),
2200
2258
  status: threadEventTurnStatusSchema,
2201
2259
  error: deltaErrorSchema.optional(),
2202
- providerCheckpointId: z17.string().min(1).optional(),
2203
- claimIfIdle: z17.boolean().optional(),
2260
+ providerCheckpointId: z18.string().min(1).optional(),
2261
+ claimIfIdle: z18.boolean().optional(),
2204
2262
  providerTurnId: providerTurnIdSchema.optional()
2205
2263
  }),
2206
- z17.object({
2207
- kind: z17.literal("item.open"),
2264
+ z18.object({
2265
+ kind: z18.literal("item.open"),
2208
2266
  key: deltaItemKeySchema,
2209
2267
  item: deltaItemShapeSchema,
2210
2268
  presentation: deltaPresentationSchema.optional(),
@@ -2212,140 +2270,145 @@ var threadDeltaSchema = z17.discriminatedUnion("kind", [
2212
2270
  providerTurnId: providerTurnIdSchema.optional(),
2213
2271
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2214
2272
  }).superRefine(requireExtensionPresentation),
2215
- z17.object({
2216
- kind: z17.literal("item.close"),
2273
+ z18.object({
2274
+ kind: z18.literal("item.close"),
2217
2275
  key: deltaItemKeySchema,
2218
2276
  status: threadEventItemStatusSchema,
2219
- resultText: z17.string().optional(),
2220
- exitCode: z17.number().optional(),
2221
- aggregatedOutput: z17.string().optional(),
2222
- approvalStatus: z17.literal("denied").optional(),
2277
+ resultText: z18.string().optional(),
2278
+ exitCode: z18.number().optional(),
2279
+ aggregatedOutput: z18.string().optional(),
2280
+ approvalStatus: z18.literal("denied").optional(),
2223
2281
  item: deltaItemShapeSchema,
2224
2282
  presentation: deltaPresentationSchema.optional(),
2225
2283
  providerTurnId: providerTurnIdSchema.optional(),
2226
2284
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2227
2285
  }).superRefine(requireExtensionPresentation),
2228
- z17.object({
2229
- kind: z17.literal("item.progress"),
2286
+ z18.object({
2287
+ kind: z18.literal("item.progress"),
2230
2288
  key: deltaItemKeySchema,
2231
- message: z17.string().optional(),
2289
+ message: z18.string().optional(),
2232
2290
  snapshot: deltaProgressSnapshotSchema.optional(),
2233
- flush: z17.boolean().optional(),
2291
+ flush: z18.boolean().optional(),
2234
2292
  providerTurnId: providerTurnIdSchema.optional(),
2235
2293
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2236
2294
  }),
2237
- z17.object({
2238
- kind: z17.literal("item.textDelta"),
2295
+ z18.object({
2296
+ kind: z18.literal("item.textDelta"),
2239
2297
  key: deltaItemKeySchema,
2240
2298
  channel: deltaTextChannelSchema,
2241
- text: z17.string(),
2299
+ text: z18.string(),
2242
2300
  providerTurnId: providerTurnIdSchema.optional(),
2243
2301
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2244
2302
  }),
2245
- z17.object({
2246
- kind: z17.literal("item.textClose"),
2303
+ z18.object({
2304
+ kind: z18.literal("item.textClose"),
2247
2305
  key: deltaItemKeySchema,
2248
2306
  channel: deltaTextChannelSchema,
2249
- text: z17.string().optional(),
2307
+ text: z18.string().optional(),
2250
2308
  providerTurnId: providerTurnIdSchema.optional(),
2251
2309
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2252
2310
  }),
2253
- z17.object({
2254
- kind: z17.literal("item.outputDelta"),
2311
+ z18.object({
2312
+ kind: z18.literal("item.outputDelta"),
2255
2313
  key: deltaItemKeySchema,
2256
2314
  channel: deltaOutputChannelSchema,
2257
- text: z17.string(),
2315
+ text: z18.string(),
2258
2316
  providerTurnId: providerTurnIdSchema.optional(),
2259
2317
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2260
2318
  }),
2261
- z17.object({
2262
- kind: z17.literal("command.outputSnapshot"),
2319
+ z18.object({
2320
+ kind: z18.literal("command.outputSnapshot"),
2263
2321
  key: deltaItemKeySchema,
2264
- text: z17.string(),
2322
+ text: z18.string(),
2265
2323
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2266
2324
  }),
2267
- z17.object({
2268
- kind: z17.literal("usage"),
2325
+ z18.object({
2326
+ kind: z18.literal("usage"),
2269
2327
  total: threadEventTokenUsageBreakdownSchema,
2270
2328
  last: threadEventTokenUsageBreakdownSchema,
2271
- modelContextWindow: z17.number().nullable(),
2329
+ modelContextWindow: z18.number().nullable(),
2272
2330
  providerTurnId: providerTurnIdSchema.optional()
2273
2331
  }),
2274
- z17.object({
2275
- kind: z17.literal("contextWindow"),
2332
+ z18.object({
2333
+ kind: z18.literal("contextWindow"),
2276
2334
  snapshot: contextSnapshotSchema.optional(),
2277
- used: z17.number().nullable(),
2278
- size: z17.number().nullable().optional(),
2279
- estimated: z17.boolean(),
2335
+ used: z18.number().nullable(),
2336
+ size: z18.number().nullable().optional(),
2337
+ estimated: z18.boolean(),
2338
+ cost: threadUsageCostSchema.optional(),
2280
2339
  attach: deltaAttachSchema,
2281
2340
  providerTurnId: providerTurnIdSchema.optional()
2282
2341
  }),
2283
- z17.object({
2284
- kind: z17.literal("context.compacted"),
2342
+ z18.object({
2343
+ kind: z18.literal("context.compacted"),
2285
2344
  providerTurnId: providerTurnIdSchema.optional(),
2286
2345
  noTurnFallback: deltaNoTurnFallbackSchema.optional()
2287
2346
  }),
2288
- z17.object({ kind: z17.literal("context.cleared") }),
2289
- z17.object({
2290
- kind: z17.literal("turn.diff"),
2291
- diff: z17.string(),
2347
+ z18.object({ kind: z18.literal("context.cleared") }),
2348
+ z18.object({
2349
+ kind: z18.literal("turn.diff"),
2350
+ diff: z18.string(),
2292
2351
  providerTurnId: providerTurnIdSchema.optional()
2293
2352
  }),
2294
- z17.object({ kind: z17.literal("thread.started") }),
2295
- z17.object({
2296
- kind: z17.literal("thread.identity"),
2297
- providerThreadId: z17.string().min(1)
2353
+ z18.object({ kind: z18.literal("thread.started") }),
2354
+ z18.object({
2355
+ kind: z18.literal("thread.identity"),
2356
+ providerThreadId: z18.string().min(1)
2298
2357
  }),
2299
- z17.object({ kind: z17.literal("thread.name"), name: z17.string().min(1) }),
2300
- z17.object({
2301
- kind: z17.literal("extension.state"),
2358
+ z18.object({
2359
+ kind: z18.literal("thread.name"),
2360
+ name: z18.string().min(1),
2361
+ source: z18.literal("agent").optional()
2362
+ }),
2363
+ z18.object({
2364
+ kind: z18.literal("extension.state"),
2302
2365
  extensionKind: extensionKindSchema,
2303
2366
  payload: jsonValueSchema
2304
2367
  }),
2305
- z17.object({
2306
- kind: z17.literal("provider.rateLimits"),
2368
+ z18.object({
2369
+ kind: z18.literal("provider.rateLimits"),
2307
2370
  rateLimits: providerRateLimitStateSchema
2308
2371
  }),
2309
- z17.object({
2310
- kind: z17.literal("provider.error"),
2311
- message: z17.string(),
2312
- detail: z17.string().optional(),
2313
- willRetry: z17.boolean().optional(),
2372
+ z18.object({
2373
+ kind: z18.literal("provider.error"),
2374
+ message: z18.string(),
2375
+ detail: z18.string().optional(),
2376
+ willRetry: z18.boolean().optional(),
2314
2377
  category: providerErrorCategorySchema.optional(),
2315
2378
  errorInfo: providerErrorInfoSchema.optional(),
2316
- settlesTurn: z17.boolean().optional(),
2379
+ settlesTurn: z18.boolean().optional(),
2317
2380
  providerTurnId: providerTurnIdSchema.optional(),
2318
- threadScoped: z17.boolean().optional()
2381
+ threadScoped: z18.boolean().optional()
2319
2382
  }),
2320
- z17.object({
2321
- kind: z17.literal("provider.modelFallback"),
2322
- originalModel: z17.string().min(1),
2323
- fallbackModel: z17.string().min(1),
2324
- reason: z17.enum(["refusal", "provider"]),
2325
- message: z17.string()
2383
+ z18.object({
2384
+ kind: z18.literal("provider.modelFallback"),
2385
+ originalModel: z18.string().min(1),
2386
+ fallbackModel: z18.string().min(1),
2387
+ reason: z18.enum(["refusal", "provider"]),
2388
+ message: z18.string()
2326
2389
  }),
2327
- z17.object({
2328
- kind: z17.literal("provider.warning"),
2329
- summary: z17.string().optional(),
2330
- details: z17.string().optional(),
2390
+ z18.object({
2391
+ kind: z18.literal("provider.warning"),
2392
+ summary: z18.string().optional(),
2393
+ details: z18.string().optional(),
2331
2394
  category: threadEventWarningCategorySchema.optional(),
2332
- vouchedTurn: z17.boolean().optional()
2395
+ vouchedTurn: z18.boolean().optional()
2333
2396
  }),
2334
- z17.object({
2335
- kind: z17.literal("unhandled"),
2397
+ z18.object({
2398
+ kind: z18.literal("unhandled"),
2336
2399
  raw: providerRawEventSchema,
2337
- rawType: z17.string(),
2338
- vouchedTurn: z17.boolean(),
2339
- onlyIfNoTurn: z17.boolean().optional(),
2400
+ rawType: z18.string(),
2401
+ vouchedTurn: z18.boolean(),
2402
+ onlyIfNoTurn: z18.boolean().optional(),
2340
2403
  parentRef: deltaKeyPartSchema.optional(),
2341
2404
  providerTurnId: providerTurnIdSchema.optional()
2342
2405
  }),
2343
- z17.object({ kind: z17.literal("session.ended") }),
2344
- z17.object({ kind: z17.literal("session.reset") })
2406
+ z18.object({ kind: z18.literal("session.ended") }),
2407
+ z18.object({ kind: z18.literal("session.reset") })
2345
2408
  ]);
2346
- var threadDeltaNotificationParamsSchema = z17.object({
2347
- threadId: z17.string().min(1),
2348
- deltas: z17.array(threadDeltaSchema)
2409
+ var threadDeltaNotificationParamsSchema = z18.object({
2410
+ threadId: z18.string().min(1),
2411
+ deltas: z18.array(threadDeltaSchema)
2349
2412
  }).passthrough();
2350
2413
 
2351
2414
  // ../provider-bridge-protocol/src/assembler/delta-assembler.ts
@@ -2356,17 +2419,17 @@ var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
2356
2419
  var THREAD_DELTA_GRAMMAR_V3 = 3;
2357
2420
 
2358
2421
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2359
- import { z as z19 } from "zod";
2422
+ import { z as z20 } from "zod";
2360
2423
 
2361
2424
  // ../provider-bridge-protocol/src/bridge-kit/tool-arg-schemas.ts
2362
- import { z as z18 } from "zod";
2363
- var bashArgsSchema = z18.object({
2364
- command: z18.string().optional(),
2365
- cwd: z18.string().optional()
2425
+ import { z as z19 } from "zod";
2426
+ var bashArgsSchema = z19.object({
2427
+ command: z19.string().optional(),
2428
+ cwd: z19.string().optional()
2366
2429
  }).passthrough();
2367
- var textBlockSchema = z18.object({
2368
- type: z18.literal("text"),
2369
- text: z18.string()
2430
+ var textBlockSchema = z19.object({
2431
+ type: z19.literal("text"),
2432
+ text: z19.string()
2370
2433
  });
2371
2434
 
2372
2435
  // ../provider-bridge-protocol/src/bridge-kit/provider-visibility-helpers.ts
@@ -2375,10 +2438,10 @@ function isRecord(value) {
2375
2438
  }
2376
2439
 
2377
2440
  // ../provider-bridge-protocol/src/bridge-kit/adapter-utils.ts
2378
- var contentWrapperSchema = z19.object({
2379
- content: z19.array(z19.unknown())
2441
+ var contentWrapperSchema = z20.object({
2442
+ content: z20.array(z20.unknown())
2380
2443
  }).passthrough();
2381
- var shellEnvironmentVariableKeySchema = z19.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2444
+ var shellEnvironmentVariableKeySchema = z20.string().regex(/^[A-Z_][A-Z0-9_]*$/i);
2382
2445
  var MAX_EXACT_LINE_DIFF_CELLS = 1e6;
2383
2446
  function splitComparableLines(text) {
2384
2447
  const normalized = text.replace(/\r\n?/gu, "\n");
@@ -3920,7 +3983,8 @@ function createDeltaAssembler(options) {
3920
3983
  usedTokens: delta.snapshot?.usedTokens ?? delta.used,
3921
3984
  modelContextWindow: delta.snapshot?.contextWindowTokens ?? delta.size ?? null,
3922
3985
  estimated: delta.snapshot?.estimated ?? delta.estimated,
3923
- ...delta.snapshot ? { snapshot: delta.snapshot } : {}
3986
+ ...delta.snapshot ? { snapshot: delta.snapshot } : {},
3987
+ ...delta.cost ? { cost: delta.cost } : {}
3924
3988
  }
3925
3989
  });
3926
3990
  return;
@@ -4058,7 +4122,8 @@ function createDeltaAssembler(options) {
4058
4122
  threadId: UNSTAMPED_THREAD_ID,
4059
4123
  providerThreadId: "",
4060
4124
  scope: threadScope(),
4061
- threadName: delta.name
4125
+ threadName: delta.name,
4126
+ ...delta.source === void 0 ? {} : { source: delta.source }
4062
4127
  });
4063
4128
  return;
4064
4129
  }
@@ -4224,11 +4289,11 @@ function assembleCapturedThreadEvents(messages, providerId = "pi") {
4224
4289
  }
4225
4290
 
4226
4291
  // ../provider-bridge-protocol/src/conformance/client.ts
4227
- import { z as z20 } from "zod";
4292
+ import { z as z21 } from "zod";
4228
4293
  function isWireMessage(value) {
4229
4294
  return typeof value === "object" && value !== null && !Array.isArray(value);
4230
4295
  }
4231
- var threadDeltaAddressSchema = z20.object({ threadId: z20.string() }).passthrough();
4296
+ var threadDeltaAddressSchema = z21.object({ threadId: z21.string() }).passthrough();
4232
4297
  var ConformanceClient = class {
4233
4298
  constructor(transport, timeoutMs, collector) {
4234
4299
  this.transport = transport;
@@ -4337,11 +4402,11 @@ function nextConformanceClientRequestId() {
4337
4402
  }
4338
4403
 
4339
4404
  // ../provider-bridge-protocol/src/conformance/scenarios.ts
4340
- import { z as z28 } from "zod";
4405
+ import { z as z29 } from "zod";
4341
4406
 
4342
4407
  // ../provider-bridge-protocol/src/handshake.ts
4343
- import { z as z21 } from "zod";
4344
- var bridgeGrammarVersionsSchema = z21.tuple([z21.number().int().positive(), z21.number().int().positive()]).refine(([min, max]) => min <= max, {
4408
+ import { z as z22 } from "zod";
4409
+ var bridgeGrammarVersionsSchema = z22.tuple([z22.number().int().positive(), z22.number().int().positive()]).refine(([min, max]) => min <= max, {
4345
4410
  message: "grammarVersions must be an ascending [min, max] range"
4346
4411
  });
4347
4412
  function negotiateGrammarVersion(runtime, bridge) {
@@ -4349,63 +4414,64 @@ function negotiateGrammarVersion(runtime, bridge) {
4349
4414
  const max = Math.min(runtime[1], bridge[1]);
4350
4415
  return min <= max ? max : null;
4351
4416
  }
4352
- var bridgeSteerModeSchema = z21.enum(["inject", "queue"]);
4353
- var bridgeCapabilitiesSchema = z21.object({
4354
- sessionRestore: z21.boolean().default(false),
4355
- threadArchive: z21.boolean().default(false),
4356
- threadRename: z21.boolean().default(false),
4357
- threadGoalClear: z21.boolean().default(false),
4417
+ var bridgeSteerModeSchema = z22.enum(["inject", "queue"]);
4418
+ var bridgeCapabilitiesSchema = z22.object({
4419
+ sessionRestore: z22.boolean().default(false),
4420
+ threadArchive: z22.boolean().default(false),
4421
+ threadRename: z22.boolean().default(false),
4422
+ threadGoalClear: z22.boolean().default(false),
4358
4423
  fork: providerForkSchema.default("none"),
4359
- approvalEnforcedBy: z21.enum(["runtime", "provider"]).default("runtime"),
4424
+ approvalEnforcedBy: z22.enum(["runtime", "provider"]).default("runtime"),
4360
4425
  grammarVersions: bridgeGrammarVersionsSchema.default([
4361
4426
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4362
4427
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4363
4428
  ]),
4364
4429
  steerMode: bridgeSteerModeSchema.default("queue"),
4365
- skills: z21.object({ configure: z21.boolean().default(false) }).default({ configure: false })
4430
+ skills: z22.object({ configure: z22.boolean().default(false) }).default({ configure: false })
4366
4431
  }).passthrough();
4367
- var initializeParamsSchema = z21.object({
4368
- protocolVersion: z21.number().int().positive(),
4369
- client: z21.object({ name: z21.string().min(1), version: z21.string().min(1) }),
4432
+ var initializeParamsSchema = z22.object({
4433
+ protocolVersion: z22.number().int().positive(),
4434
+ client: z22.object({ name: z22.string().min(1), version: z22.string().min(1) }),
4370
4435
  grammarVersions: bridgeGrammarVersionsSchema.default([
4371
4436
  PROVIDER_BRIDGE_PROTOCOL_VERSION,
4372
4437
  PROVIDER_BRIDGE_PROTOCOL_VERSION
4373
4438
  ])
4374
4439
  }).passthrough();
4375
- var initializeResultSchema = z21.object({
4376
- protocolVersion: z21.number().int().positive(),
4377
- capabilities: z21.preprocess(
4440
+ var initializeResultSchema = z22.object({
4441
+ protocolVersion: z22.number().int().positive(),
4442
+ capabilities: z22.preprocess(
4378
4443
  (value) => value ?? {},
4379
4444
  bridgeCapabilitiesSchema
4380
4445
  )
4381
4446
  }).passthrough();
4382
4447
 
4383
4448
  // ../provider-bridge-protocol/src/execution-options.ts
4384
- import { z as z22 } from "zod";
4385
- var bridgeExecutionOptionsSchema = z22.object({
4386
- model: z22.string().min(1).optional(),
4449
+ import { z as z23 } from "zod";
4450
+ var bridgeExecutionOptionsSchema = z23.object({
4451
+ model: z23.string().min(1).optional(),
4387
4452
  serviceTier: serviceTierSchema.optional(),
4388
4453
  reasoningLevel: reasoningLevelSchema.optional(),
4389
4454
  promptMode: promptModeSchema.optional(),
4390
- instructions: z22.string().optional(),
4391
- envVars: z22.record(z22.string(), z22.string()).optional(),
4392
- providerOptions: z22.record(z22.string(), z22.unknown()).optional()
4455
+ sessionOptions: sessionOptionSelectionsSchema.optional(),
4456
+ instructions: z23.string().optional(),
4457
+ envVars: z23.record(z23.string(), z23.string()).optional(),
4458
+ providerOptions: z23.record(z23.string(), z23.unknown()).optional()
4393
4459
  }).and(runtimePermissionPolicySchema);
4394
4460
 
4395
4461
  // ../provider-bridge-protocol/src/provider-maintenance.ts
4396
- import { z as z23 } from "zod";
4397
- var providerMaintenanceParamsSchema = z23.object({
4398
- providerId: z23.string().min(1),
4399
- cwd: z23.string().min(1).optional(),
4400
- providerOptions: z23.record(z23.string(), z23.unknown()).optional()
4462
+ import { z as z24 } from "zod";
4463
+ var providerMaintenanceParamsSchema = z24.object({
4464
+ providerId: z24.string().min(1),
4465
+ cwd: z24.string().min(1).optional(),
4466
+ providerOptions: z24.record(z24.string(), z24.unknown()).optional()
4401
4467
  }).passthrough();
4402
- var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
4468
+ var providerInstallationRequirementSchema = z24.enum(["thread_rewind"]);
4403
4469
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4404
4470
  requirement: providerInstallationRequirementSchema.optional(),
4405
- checkUpdates: z23.boolean().default(true)
4471
+ checkUpdates: z24.boolean().default(true)
4406
4472
  });
4407
- var providerHealthSchema = z23.object({
4408
- status: z23.enum([
4473
+ var providerHealthSchema = z24.object({
4474
+ status: z24.enum([
4409
4475
  "ready",
4410
4476
  "not_installed",
4411
4477
  "unauthenticated",
@@ -4413,115 +4479,115 @@ var providerHealthSchema = z23.object({
4413
4479
  "unsupported_version",
4414
4480
  "unknown"
4415
4481
  ]),
4416
- statusMessage: z23.string().min(1).nullable(),
4417
- accountEmail: z23.string().nullable(),
4418
- planLabel: z23.string().min(1).nullable(),
4419
- installedVersion: z23.string().min(1).nullable(),
4420
- minimumSupportedVersion: z23.string().min(1).nullable(),
4421
- canInstall: z23.boolean(),
4422
- canUpdate: z23.boolean(),
4423
- loginCommand: z23.string().min(1).nullable(),
4424
- localLoginCommand: z23.string().min(1).nullable().optional()
4482
+ statusMessage: z24.string().min(1).nullable(),
4483
+ accountEmail: z24.string().nullable(),
4484
+ planLabel: z24.string().min(1).nullable(),
4485
+ installedVersion: z24.string().min(1).nullable(),
4486
+ minimumSupportedVersion: z24.string().min(1).nullable(),
4487
+ canInstall: z24.boolean(),
4488
+ canUpdate: z24.boolean(),
4489
+ loginCommand: z24.string().min(1).nullable(),
4490
+ localLoginCommand: z24.string().min(1).nullable().optional()
4425
4491
  }).passthrough();
4426
- var providerUsageWindowSchema = z23.object({
4427
- label: z23.string().min(1),
4428
- usedPercent: z23.number().min(0).max(100),
4429
- resetsAt: z23.string().min(1).nullable(),
4430
- cost: z23.object({
4431
- usedUsdCents: z23.number().int().nonnegative(),
4432
- limitUsdCents: z23.number().int().positive()
4492
+ var providerUsageWindowSchema = z24.object({
4493
+ label: z24.string().min(1),
4494
+ usedPercent: z24.number().min(0).max(100),
4495
+ resetsAt: z24.string().min(1).nullable(),
4496
+ cost: z24.object({
4497
+ usedUsdCents: z24.number().int().nonnegative(),
4498
+ limitUsdCents: z24.number().int().positive()
4433
4499
  }).optional()
4434
4500
  }).passthrough();
4435
- var providerUsageSchema = z23.discriminatedUnion("status", [
4436
- z23.object({
4437
- status: z23.literal("ok"),
4438
- accountEmail: z23.string().email().nullable(),
4439
- planLabel: z23.string().min(1).nullable(),
4440
- windows: z23.array(providerUsageWindowSchema)
4501
+ var providerUsageSchema = z24.discriminatedUnion("status", [
4502
+ z24.object({
4503
+ status: z24.literal("ok"),
4504
+ accountEmail: z24.string().email().nullable(),
4505
+ planLabel: z24.string().min(1).nullable(),
4506
+ windows: z24.array(providerUsageWindowSchema)
4441
4507
  }).passthrough(),
4442
- z23.object({ status: z23.literal("not_installed") }).passthrough(),
4443
- z23.object({ status: z23.literal("unauthenticated") }).passthrough(),
4444
- z23.object({ status: z23.literal("expired") }).passthrough(),
4445
- z23.object({
4446
- status: z23.literal("error"),
4447
- message: z23.string().min(1),
4448
- planLabel: z23.string().min(1).nullable().default(null),
4449
- accountEmail: z23.string().nullable().default(null)
4508
+ z24.object({ status: z24.literal("not_installed") }).passthrough(),
4509
+ z24.object({ status: z24.literal("unauthenticated") }).passthrough(),
4510
+ z24.object({ status: z24.literal("expired") }).passthrough(),
4511
+ z24.object({
4512
+ status: z24.literal("error"),
4513
+ message: z24.string().min(1),
4514
+ planLabel: z24.string().min(1).nullable().default(null),
4515
+ accountEmail: z24.string().nullable().default(null)
4450
4516
  }).passthrough()
4451
4517
  ]);
4452
- var providerHealthResultSchema = z23.discriminatedUnion("supported", [
4453
- z23.object({ supported: z23.literal(false) }).passthrough(),
4454
- z23.object({
4455
- supported: z23.literal(true),
4518
+ var providerHealthResultSchema = z24.discriminatedUnion("supported", [
4519
+ z24.object({ supported: z24.literal(false) }).passthrough(),
4520
+ z24.object({
4521
+ supported: z24.literal(true),
4456
4522
  health: providerHealthSchema
4457
4523
  }).passthrough()
4458
4524
  ]);
4459
- var providerUsageResultSchema = z23.discriminatedUnion("supported", [
4460
- z23.object({ supported: z23.literal(false) }).passthrough(),
4461
- z23.object({
4462
- supported: z23.literal(true),
4525
+ var providerUsageResultSchema = z24.discriminatedUnion("supported", [
4526
+ z24.object({ supported: z24.literal(false) }).passthrough(),
4527
+ z24.object({
4528
+ supported: z24.literal(true),
4463
4529
  usage: providerUsageSchema
4464
4530
  }).passthrough()
4465
4531
  ]);
4466
- var providerInstallationActionKindSchema = z23.enum([
4532
+ var providerInstallationActionKindSchema = z24.enum([
4467
4533
  "install",
4468
4534
  "update"
4469
4535
  ]);
4470
- var providerInstallationActionSchema = z23.object({
4536
+ var providerInstallationActionSchema = z24.object({
4471
4537
  kind: providerInstallationActionKindSchema,
4472
- label: z23.enum(["Install", "Update"]),
4473
- command: z23.string().min(1)
4538
+ label: z24.enum(["Install", "Update"]),
4539
+ command: z24.string().min(1)
4474
4540
  }).passthrough();
4475
- var providerInstallationSourceSchema = z23.enum([
4541
+ var providerInstallationSourceSchema = z24.enum([
4476
4542
  "notInstalled",
4477
4543
  "npmGlobal",
4478
4544
  "external"
4479
4545
  ]);
4480
- var providerInstallationStatusSchema = z23.object({
4481
- executableName: z23.string().min(1),
4482
- executablePath: z23.string().min(1).nullable(),
4483
- installed: z23.boolean(),
4546
+ var providerInstallationStatusSchema = z24.object({
4547
+ executableName: z24.string().min(1),
4548
+ executablePath: z24.string().min(1).nullable(),
4549
+ installed: z24.boolean(),
4484
4550
  installSource: providerInstallationSourceSchema,
4485
- currentVersion: z23.string().min(1).nullable(),
4486
- latestVersion: z23.string().min(1).nullable(),
4487
- minimumSupportedVersion: z23.string().min(1).nullable(),
4488
- npmPackageName: z23.string().min(1).nullable(),
4489
- npmGlobalPackageVersion: z23.string().min(1).nullable(),
4551
+ currentVersion: z24.string().min(1).nullable(),
4552
+ latestVersion: z24.string().min(1).nullable(),
4553
+ minimumSupportedVersion: z24.string().min(1).nullable(),
4554
+ npmPackageName: z24.string().min(1).nullable(),
4555
+ npmGlobalPackageVersion: z24.string().min(1).nullable(),
4490
4556
  installAction: providerInstallationActionSchema.nullable(),
4491
- needsUpdate: z23.boolean(),
4492
- versionUnsupported: z23.boolean()
4557
+ needsUpdate: z24.boolean(),
4558
+ versionUnsupported: z24.boolean()
4493
4559
  }).passthrough();
4494
4560
  var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
4495
4561
  action: providerInstallationActionKindSchema
4496
4562
  });
4497
- var providerInstallationCommandSchema = z23.object({
4498
- command: z23.string().min(1),
4499
- args: z23.array(z23.string()).max(64),
4500
- displayCommand: z23.string().min(1)
4563
+ var providerInstallationCommandSchema = z24.object({
4564
+ command: z24.string().min(1),
4565
+ args: z24.array(z24.string()).max(64),
4566
+ displayCommand: z24.string().min(1)
4501
4567
  }).passthrough();
4502
- var providerInstallationVerificationSchema = z23.discriminatedUnion(
4568
+ var providerInstallationVerificationSchema = z24.discriminatedUnion(
4503
4569
  "kind",
4504
4570
  [
4505
- z23.object({ kind: z23.literal("installed") }).passthrough(),
4506
- z23.object({
4507
- kind: z23.literal("version_changed"),
4508
- previousVersion: z23.string().min(1)
4571
+ z24.object({ kind: z24.literal("installed") }).passthrough(),
4572
+ z24.object({
4573
+ kind: z24.literal("version_changed"),
4574
+ previousVersion: z24.string().min(1)
4509
4575
  }).passthrough(),
4510
- z23.object({
4511
- kind: z23.literal("version_at_least"),
4512
- version: z23.string().min(1)
4576
+ z24.object({
4577
+ kind: z24.literal("version_at_least"),
4578
+ version: z24.string().min(1)
4513
4579
  }).passthrough()
4514
4580
  ]
4515
4581
  );
4516
- var providerInstallationRunResultSchema = z23.discriminatedUnion(
4582
+ var providerInstallationRunResultSchema = z24.discriminatedUnion(
4517
4583
  "available",
4518
4584
  [
4519
- z23.object({
4520
- available: z23.literal(false),
4521
- message: z23.string().min(1)
4585
+ z24.object({
4586
+ available: z24.literal(false),
4587
+ message: z24.string().min(1)
4522
4588
  }).passthrough(),
4523
- z23.object({
4524
- available: z23.literal(true),
4589
+ z24.object({
4590
+ available: z24.literal(true),
4525
4591
  command: providerInstallationCommandSchema,
4526
4592
  verification: providerInstallationVerificationSchema
4527
4593
  }).passthrough()
@@ -4529,7 +4595,7 @@ var providerInstallationRunResultSchema = z23.discriminatedUnion(
4529
4595
  );
4530
4596
 
4531
4597
  // ../provider-bridge-protocol/src/requests.ts
4532
- import { z as z24 } from "zod";
4598
+ import { z as z25 } from "zod";
4533
4599
  var BRIDGE_REQUEST_METHODS = {
4534
4600
  initialize: "initialize",
4535
4601
  modelList: "model/list",
@@ -4551,77 +4617,77 @@ var BRIDGE_REQUEST_METHODS = {
4551
4617
  skillsConfigure: "skills/configure"
4552
4618
  };
4553
4619
  var sessionConstructionFields = {
4554
- threadId: z24.string().min(1),
4555
- cwd: z24.string().min(1),
4620
+ threadId: z25.string().min(1),
4621
+ cwd: z25.string().min(1),
4556
4622
  options: bridgeExecutionOptionsSchema,
4557
- dynamicTools: z24.array(dynamicToolSchema).optional(),
4558
- disallowedTools: z24.array(z24.string().min(1)).optional(),
4623
+ dynamicTools: z25.array(dynamicToolSchema).optional(),
4624
+ disallowedTools: z25.array(z25.string().min(1)).optional(),
4559
4625
  instructionMode: instructionModeSchema
4560
4626
  };
4561
- var modelListParamsSchema = z24.object({ cwd: z24.string().min(1).optional() }).passthrough();
4562
- var threadStartParamsSchema = z24.object({
4627
+ var modelListParamsSchema = z25.object({ cwd: z25.string().min(1).optional() }).passthrough();
4628
+ var threadStartParamsSchema = z25.object({
4563
4629
  ...sessionConstructionFields,
4564
- input: z24.array(promptInputSchema).optional()
4630
+ input: z25.array(promptInputSchema).optional()
4565
4631
  }).passthrough();
4566
- var threadResumeParamsSchema = z24.object({
4632
+ var threadResumeParamsSchema = z25.object({
4567
4633
  ...sessionConstructionFields,
4568
- providerThreadId: z24.string().min(1)
4634
+ providerThreadId: z25.string().min(1)
4569
4635
  }).passthrough();
4570
- var threadForkParamsSchema = z24.object({
4636
+ var threadForkParamsSchema = z25.object({
4571
4637
  ...sessionConstructionFields,
4572
- sourceProviderThreadId: z24.string().min(1),
4573
- sourceProviderCheckpointId: z24.string().min(1).optional()
4638
+ sourceProviderThreadId: z25.string().min(1),
4639
+ sourceProviderCheckpointId: z25.string().min(1).optional()
4574
4640
  }).passthrough();
4575
- var threadStopParamsSchema = z24.object({
4576
- threadId: z24.string().min(1),
4577
- providerThreadId: z24.string().min(1),
4578
- intent: z24.enum(["interrupt", "release"]),
4579
- activeTurnId: z24.string().min(1).nullable()
4641
+ var threadStopParamsSchema = z25.object({
4642
+ threadId: z25.string().min(1),
4643
+ providerThreadId: z25.string().min(1),
4644
+ intent: z25.enum(["interrupt", "release"]),
4645
+ activeTurnId: z25.string().min(1).nullable()
4580
4646
  }).passthrough();
4581
- var threadRefParams = z24.object({
4582
- threadId: z24.string().min(1),
4583
- providerThreadId: z24.string().min(1)
4647
+ var threadRefParams = z25.object({
4648
+ threadId: z25.string().min(1),
4649
+ providerThreadId: z25.string().min(1)
4584
4650
  }).passthrough();
4585
- var threadNameSetParamsSchema = z24.object({
4586
- threadId: z24.string().min(1),
4587
- providerThreadId: z24.string().min(1),
4588
- title: z24.string().min(1)
4651
+ var threadNameSetParamsSchema = z25.object({
4652
+ threadId: z25.string().min(1),
4653
+ providerThreadId: z25.string().min(1),
4654
+ title: z25.string().min(1)
4589
4655
  }).passthrough();
4590
4656
  var turnInputFields = {
4591
- threadId: z24.string().min(1),
4592
- providerThreadId: z24.string().min(1),
4593
- input: z24.array(promptInputSchema),
4657
+ threadId: z25.string().min(1),
4658
+ providerThreadId: z25.string().min(1),
4659
+ input: z25.array(promptInputSchema),
4594
4660
  clientRequestId: clientTurnRequestIdSchema,
4595
4661
  options: bridgeExecutionOptionsSchema
4596
4662
  };
4597
- var turnStartParamsSchema = z24.object(turnInputFields).passthrough();
4598
- var turnSteerParamsSchema = z24.object({
4663
+ var turnStartParamsSchema = z25.object(turnInputFields).passthrough();
4664
+ var turnSteerParamsSchema = z25.object({
4599
4665
  ...turnInputFields,
4600
- expectedTurnId: z24.string().min(1)
4666
+ expectedTurnId: z25.string().min(1)
4601
4667
  }).passthrough();
4602
- var skillsConfigureRootSchema = z24.object({
4603
- id: z24.string().min(1),
4604
- path: z24.string().min(1),
4605
- skills: z24.array(
4606
- z24.object({
4607
- name: z24.string().min(1),
4608
- description: z24.string()
4668
+ var skillsConfigureRootSchema = z25.object({
4669
+ id: z25.string().min(1),
4670
+ path: z25.string().min(1),
4671
+ skills: z25.array(
4672
+ z25.object({
4673
+ name: z25.string().min(1),
4674
+ description: z25.string()
4609
4675
  }).passthrough()
4610
4676
  )
4611
4677
  }).passthrough();
4612
- var skillsConfigureParamsSchema = z24.object({
4613
- roots: z24.array(skillsConfigureRootSchema)
4678
+ var skillsConfigureParamsSchema = z25.object({
4679
+ roots: z25.array(skillsConfigureRootSchema)
4614
4680
  }).passthrough();
4615
- var threadIdentityResultSchema = z24.object({
4616
- providerThreadId: z24.string().min(1),
4617
- sessionRestorable: z24.boolean().optional()
4681
+ var threadIdentityResultSchema = z25.object({
4682
+ providerThreadId: z25.string().min(1),
4683
+ sessionRestorable: z25.boolean().optional()
4618
4684
  }).passthrough();
4619
4685
 
4620
4686
  // ../provider-bridge-protocol/src/notifications.ts
4621
- import { z as z26 } from "zod";
4687
+ import { z as z27 } from "zod";
4622
4688
 
4623
4689
  // ../provider-bridge-protocol/src/errors.ts
4624
- import { z as z25 } from "zod";
4690
+ import { z as z26 } from "zod";
4625
4691
  var BRIDGE_JSON_RPC_ERRORS = {
4626
4692
  INVALID_PARAMS: -32602,
4627
4693
  METHOD_NOT_FOUND: -32601,
@@ -4631,12 +4697,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
4631
4697
  FORK_CHECKPOINT_UNSUPPORTED: -32003,
4632
4698
  MISSING_EXECUTABLE: -32004
4633
4699
  };
4634
- var providerRecoveryHintSchema = z25.object({
4700
+ var providerRecoveryHintSchema = z26.object({
4635
4701
  kind: providerRecoveryKindSchema,
4636
- message: z25.string().min(1),
4637
- retryable: z25.boolean()
4702
+ message: z26.string().min(1),
4703
+ retryable: z26.boolean()
4638
4704
  });
4639
- var bridgeErrorDataSchema = z25.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4705
+ var bridgeErrorDataSchema = z26.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
4640
4706
 
4641
4707
  // ../provider-bridge-protocol/src/notifications.ts
4642
4708
  var BRIDGE_NOTIFICATION_METHODS = {
@@ -4646,57 +4712,57 @@ var BRIDGE_NOTIFICATION_METHODS = {
4646
4712
  providerRecovery: "provider/recovery",
4647
4713
  error: "error"
4648
4714
  };
4649
- var threadIdentityNotificationSchema = z26.object({
4650
- threadId: z26.string().min(1),
4651
- providerThreadId: z26.string().min(1),
4652
- sessionRestorable: z26.boolean().optional()
4715
+ var threadIdentityNotificationSchema = z27.object({
4716
+ threadId: z27.string().min(1),
4717
+ providerThreadId: z27.string().min(1),
4718
+ sessionRestorable: z27.boolean().optional()
4653
4719
  }).passthrough();
4654
- var sessionReplacedNotificationSchema = z26.object({
4655
- threadId: z26.string().min(1),
4656
- providerThreadId: z26.string().min(1).nullable(),
4657
- reason: z26.string().min(1),
4658
- contextLost: z26.boolean().default(false),
4659
- showRuntimeNote: z26.boolean().default(false)
4720
+ var sessionReplacedNotificationSchema = z27.object({
4721
+ threadId: z27.string().min(1),
4722
+ providerThreadId: z27.string().min(1).nullable(),
4723
+ reason: z27.string().min(1),
4724
+ contextLost: z27.boolean().default(false),
4725
+ showRuntimeNote: z27.boolean().default(false)
4660
4726
  }).passthrough();
4661
- var providerRecoveryNotificationSchema = z26.object({
4662
- threadId: z26.string().min(1).optional(),
4727
+ var providerRecoveryNotificationSchema = z27.object({
4728
+ threadId: z27.string().min(1).optional(),
4663
4729
  ...providerRecoveryHintSchema.shape
4664
4730
  }).passthrough();
4665
- var errorNotificationSchema = z26.object({
4666
- threadId: z26.string().min(1).optional(),
4667
- providerThreadId: z26.string().min(1).optional(),
4668
- message: z26.string().min(1)
4731
+ var errorNotificationSchema = z27.object({
4732
+ threadId: z27.string().min(1).optional(),
4733
+ providerThreadId: z27.string().min(1).optional(),
4734
+ message: z27.string().min(1)
4669
4735
  }).passthrough();
4670
4736
 
4671
4737
  // ../provider-bridge-protocol/src/bridge-requests.ts
4672
- import { z as z27 } from "zod";
4673
- var toolCallRequestParamsSchema = z27.object({
4674
- providerThreadId: z27.string().min(1),
4675
- threadId: z27.string().min(1).optional(),
4676
- turnId: z27.union([z27.string().min(1), z27.null()]),
4677
- callId: z27.string().min(1),
4678
- tool: z27.string().min(1),
4679
- arguments: z27.unknown(),
4680
- providerNativeIds: z27.boolean().optional()
4738
+ import { z as z28 } from "zod";
4739
+ var toolCallRequestParamsSchema = z28.object({
4740
+ providerThreadId: z28.string().min(1),
4741
+ threadId: z28.string().min(1).optional(),
4742
+ turnId: z28.union([z28.string().min(1), z28.null()]),
4743
+ callId: z28.string().min(1),
4744
+ tool: z28.string().min(1),
4745
+ arguments: z28.unknown(),
4746
+ providerNativeIds: z28.boolean().optional()
4681
4747
  }).passthrough();
4682
- var toolCallResultSchema = z27.object({
4683
- success: z27.boolean(),
4684
- contentItems: z27.array(
4685
- z27.discriminatedUnion("type", [
4686
- z27.object({ type: z27.literal("inputText"), text: z27.string() }),
4687
- z27.object({
4688
- type: z27.literal("inputImage"),
4689
- imageUrl: z27.string().min(1)
4748
+ var toolCallResultSchema = z28.object({
4749
+ success: z28.boolean(),
4750
+ contentItems: z28.array(
4751
+ z28.discriminatedUnion("type", [
4752
+ z28.object({ type: z28.literal("inputText"), text: z28.string() }),
4753
+ z28.object({
4754
+ type: z28.literal("inputImage"),
4755
+ imageUrl: z28.string().min(1)
4690
4756
  })
4691
4757
  ])
4692
4758
  )
4693
4759
  }).passthrough();
4694
- var interactionRequestParamsSchema = z27.object({
4695
- providerThreadId: z27.string().min(1),
4696
- threadId: z27.string().min(1).optional(),
4697
- turnId: z27.union([z27.string().min(1), z27.null()]),
4760
+ var interactionRequestParamsSchema = z28.object({
4761
+ providerThreadId: z28.string().min(1),
4762
+ threadId: z28.string().min(1).optional(),
4763
+ turnId: z28.union([z28.string().min(1), z28.null()]),
4698
4764
  payload: pendingInteractionPayloadSchema,
4699
- providerNativeIds: z27.boolean().optional()
4765
+ providerNativeIds: z28.boolean().optional()
4700
4766
  }).passthrough();
4701
4767
 
4702
4768
  // ../provider-bridge-protocol/src/thread-event-grammar.ts
@@ -4852,7 +4918,7 @@ var IDENTITY_RESULT_SHAPE = "{ providerThreadId, sessionRestorable? }";
4852
4918
  function identityProblem(parsed, result2) {
4853
4919
  return `the result must be ${IDENTITY_RESULT_SHAPE} \u2014 the runtime adopts no session without providerThreadId on the result (a thread/identity notification does not substitute for it); issues: ${parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")} (got ${JSON.stringify(result2)})`;
4854
4920
  }
4855
- var identityNotificationParamsSchema = z28.object({ threadId: z28.string(), providerThreadId: z28.string() }).passthrough();
4921
+ var identityNotificationParamsSchema = z29.object({ threadId: z29.string(), providerThreadId: z29.string() }).passthrough();
4856
4922
  async function checkIdentityAnnounced(context, args) {
4857
4923
  const { client } = context;
4858
4924
  const announced = await client.waitFor(() => {
@@ -4903,7 +4969,7 @@ function threadEvents(context, threadId) {
4903
4969
  context.client.drainIntoLog();
4904
4970
  return context.client.events.filter((entry) => entry.threadId === threadId).map((entry) => entry.event);
4905
4971
  }
4906
- var persistedEventSchema = z28.preprocess(
4972
+ var persistedEventSchema = z29.preprocess(
4907
4973
  (event) => JSON.parse(JSON.stringify(event)),
4908
4974
  threadEventSchema
4909
4975
  );
@@ -6022,26 +6088,26 @@ function formatConformanceReport(report) {
6022
6088
  }
6023
6089
 
6024
6090
  // ../provider-bridge-protocol/src/testing/bridge-json-rpc-test-helpers.ts
6025
- import { z as z29 } from "zod";
6026
- var bridgeJsonRpcValueSchema = z29.lazy(
6027
- () => z29.union([
6028
- z29.string(),
6029
- z29.number(),
6030
- z29.boolean(),
6031
- z29.null(),
6032
- z29.array(bridgeJsonRpcValueSchema),
6033
- z29.record(z29.string(), bridgeJsonRpcValueSchema)
6091
+ import { z as z30 } from "zod";
6092
+ var bridgeJsonRpcValueSchema = z30.lazy(
6093
+ () => z30.union([
6094
+ z30.string(),
6095
+ z30.number(),
6096
+ z30.boolean(),
6097
+ z30.null(),
6098
+ z30.array(bridgeJsonRpcValueSchema),
6099
+ z30.record(z30.string(), bridgeJsonRpcValueSchema)
6034
6100
  ])
6035
6101
  );
6036
- var bridgeJsonRpcOutputSchema = z29.object({
6037
- jsonrpc: z29.literal("2.0"),
6038
- id: z29.union([z29.string(), z29.number()]).optional(),
6039
- method: z29.string().optional(),
6102
+ var bridgeJsonRpcOutputSchema = z30.object({
6103
+ jsonrpc: z30.literal("2.0"),
6104
+ id: z30.union([z30.string(), z30.number()]).optional(),
6105
+ method: z30.string().optional(),
6040
6106
  params: bridgeJsonRpcValueSchema.optional(),
6041
6107
  result: bridgeJsonRpcValueSchema.optional(),
6042
- error: z29.object({
6043
- code: z29.number(),
6044
- message: z29.string(),
6108
+ error: z30.object({
6109
+ code: z30.number(),
6110
+ message: z30.string(),
6045
6111
  data: bridgeJsonRpcValueSchema.optional()
6046
6112
  }).optional()
6047
6113
  });