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