@get-bb/plugin-sdk 0.6.37 → 0.6.42
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.
- package/bundled-types/bb-plugin-sdk-app.d.ts +391 -281
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +1 -10
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +9 -23
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp-next.d.ts +606 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +32 -90
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +11 -10
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +66 -220
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-testing.d.ts +7 -3
- package/bundled-types/bb-plugin-sdk.d.ts +409 -284
- package/dist/internal/host-policy.js +13 -7
- package/dist/internal/plugin-app-collector.js +32 -0
- package/dist/provider-bridge-acp-next.js +24029 -0
- package/dist/provider-bridge-acp.js +959 -873
- package/dist/provider-bridge-testing.js +571 -510
- package/dist/provider-bridge.js +633 -559
- package/dist/testing/app.js +32 -0
- package/dist/testing/index.js +15 -7
- package/package.json +8 -1
|
@@ -46,17 +46,7 @@ var jsonObjectSchema = z2.record(
|
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
// ../domain/src/shared-types.ts
|
|
49
|
-
var
|
|
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-
|
|
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 =
|
|
1956
|
+
var providerForkSchema = z16.enum(PROVIDER_FORK_VALUES);
|
|
1906
1957
|
|
|
1907
1958
|
// ../domain/src/provider-types.ts
|
|
1908
|
-
import { z as
|
|
1909
|
-
var modelReasoningEffortSchema =
|
|
1959
|
+
import { z as z17 } from "zod";
|
|
1960
|
+
var modelReasoningEffortSchema = z17.object({
|
|
1910
1961
|
reasoningEffort: reasoningLevelSchema,
|
|
1911
|
-
|
|
1962
|
+
label: z17.string().min(1).optional(),
|
|
1963
|
+
description: z17.string()
|
|
1912
1964
|
});
|
|
1913
|
-
var modelServiceTierSchema =
|
|
1965
|
+
var modelServiceTierSchema = z17.object({
|
|
1914
1966
|
id: serviceTierSchema,
|
|
1915
|
-
label:
|
|
1916
|
-
description:
|
|
1917
|
-
});
|
|
1918
|
-
var availableModelSchema =
|
|
1919
|
-
id:
|
|
1920
|
-
model:
|
|
1921
|
-
displayName:
|
|
1922
|
-
routeProviderId:
|
|
1923
|
-
description:
|
|
1924
|
-
supportedReasoningEfforts:
|
|
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:
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
var
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
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 =
|
|
1993
|
+
var providerComposerCommandSchema = z17.object({
|
|
1941
1994
|
trigger: promptMentionCommandTriggerSchema,
|
|
1942
|
-
name:
|
|
1943
|
-
trailingText:
|
|
1995
|
+
name: z17.string().min(1).regex(/^[^\s/$]+$/u),
|
|
1996
|
+
trailingText: z17.string().regex(/^\s*$/u)
|
|
1944
1997
|
});
|
|
1945
|
-
var providerComposerActionSchema =
|
|
1946
|
-
|
|
1947
|
-
kind:
|
|
1998
|
+
var providerComposerActionSchema = z17.discriminatedUnion("kind", [
|
|
1999
|
+
z17.object({
|
|
2000
|
+
kind: z17.literal("skills"),
|
|
1948
2001
|
trigger: promptMentionCommandTriggerSchema
|
|
1949
2002
|
}),
|
|
1950
|
-
|
|
1951
|
-
kind:
|
|
2003
|
+
z17.object({
|
|
2004
|
+
kind: z17.literal("plan"),
|
|
1952
2005
|
command: providerComposerCommandSchema
|
|
1953
2006
|
}),
|
|
1954
|
-
|
|
1955
|
-
kind:
|
|
2007
|
+
z17.object({
|
|
2008
|
+
kind: z17.literal("goal"),
|
|
1956
2009
|
command: providerComposerCommandSchema
|
|
1957
2010
|
})
|
|
1958
2011
|
]);
|
|
1959
|
-
var providerStringsSchema =
|
|
1960
|
-
signInHint:
|
|
1961
|
-
expiredHint:
|
|
1962
|
-
installUrl:
|
|
1963
|
-
brandPrefix:
|
|
1964
|
-
planModeCopy:
|
|
1965
|
-
iconTint:
|
|
1966
|
-
});
|
|
1967
|
-
var providerOptionDescriptorSchema =
|
|
1968
|
-
id:
|
|
1969
|
-
label:
|
|
1970
|
-
description:
|
|
1971
|
-
});
|
|
1972
|
-
var providerExtensionKindInfoSchema =
|
|
1973
|
-
item:
|
|
1974
|
-
state:
|
|
1975
|
-
});
|
|
1976
|
-
var providerExtensionKindsSchema =
|
|
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 =
|
|
1981
|
-
id:
|
|
1982
|
-
pluginId:
|
|
1983
|
-
displayName:
|
|
1984
|
-
family:
|
|
1985
|
-
icon:
|
|
1986
|
-
logoUrl:
|
|
1987
|
-
maintenance:
|
|
1988
|
-
health:
|
|
1989
|
-
usage:
|
|
1990
|
-
installation:
|
|
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:
|
|
2046
|
+
composerActions: z17.array(providerComposerActionSchema),
|
|
1994
2047
|
completedTurnDisplay: completedTurnDisplaySchema,
|
|
1995
|
-
available:
|
|
2048
|
+
available: z17.boolean(),
|
|
1996
2049
|
strings: providerStringsSchema.optional(),
|
|
1997
|
-
serviceTiers:
|
|
1998
|
-
reasoningLevels:
|
|
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 =
|
|
2009
|
-
var toolCallOutputItemSchema =
|
|
2010
|
-
|
|
2011
|
-
type:
|
|
2012
|
-
text:
|
|
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
|
-
|
|
2015
|
-
type:
|
|
2016
|
-
imageUrl:
|
|
2067
|
+
z17.object({
|
|
2068
|
+
type: z17.literal("inputImage"),
|
|
2069
|
+
imageUrl: z17.string()
|
|
2017
2070
|
})
|
|
2018
2071
|
]);
|
|
2019
|
-
var toolCallRequestSchema =
|
|
2020
|
-
requestId:
|
|
2021
|
-
threadId:
|
|
2022
|
-
providerThreadId:
|
|
2023
|
-
turnId:
|
|
2024
|
-
callId:
|
|
2025
|
-
tool:
|
|
2026
|
-
arguments:
|
|
2027
|
-
});
|
|
2028
|
-
var toolCallResponseSchema =
|
|
2029
|
-
contentItems:
|
|
2030
|
-
success:
|
|
2031
|
-
});
|
|
2032
|
-
var dynamicToolSchema =
|
|
2033
|
-
name:
|
|
2034
|
-
description:
|
|
2035
|
-
inputSchema:
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
2054
|
-
path:
|
|
2055
|
-
kind:
|
|
2056
|
-
movePath:
|
|
2057
|
-
diff:
|
|
2058
|
-
oldText:
|
|
2059
|
-
newText:
|
|
2060
|
-
});
|
|
2061
|
-
var deltaBackgroundTaskShapeSchema =
|
|
2062
|
-
type:
|
|
2063
|
-
familyId:
|
|
2064
|
-
taskType:
|
|
2065
|
-
description:
|
|
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:
|
|
2069
|
-
workflowName:
|
|
2121
|
+
skipTranscript: z18.boolean(),
|
|
2122
|
+
workflowName: z18.string().optional(),
|
|
2070
2123
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2071
2124
|
usage: backgroundTaskUsageSchema.optional(),
|
|
2072
|
-
summary:
|
|
2073
|
-
error:
|
|
2074
|
-
outputFile:
|
|
2125
|
+
summary: z18.string().optional(),
|
|
2126
|
+
error: z18.string().optional(),
|
|
2127
|
+
outputFile: z18.string().optional()
|
|
2075
2128
|
});
|
|
2076
|
-
var deltaFileReadShapeSchema =
|
|
2077
|
-
type:
|
|
2078
|
-
path:
|
|
2079
|
-
cmd:
|
|
2129
|
+
var deltaFileReadShapeSchema = z18.object({
|
|
2130
|
+
type: z18.literal("fileRead"),
|
|
2131
|
+
path: z18.string(),
|
|
2132
|
+
cmd: z18.string().optional()
|
|
2080
2133
|
});
|
|
2081
|
-
var deltaSearchShapeSchema =
|
|
2082
|
-
type:
|
|
2134
|
+
var deltaSearchShapeSchema = z18.object({
|
|
2135
|
+
type: z18.literal("search"),
|
|
2083
2136
|
mode: threadEventSearchModeSchema,
|
|
2084
|
-
query:
|
|
2085
|
-
path:
|
|
2086
|
-
cmd:
|
|
2137
|
+
query: z18.string(),
|
|
2138
|
+
path: z18.string().optional(),
|
|
2139
|
+
cmd: z18.string().optional()
|
|
2087
2140
|
});
|
|
2088
|
-
var deltaDelegationShapeSchema =
|
|
2089
|
-
type:
|
|
2141
|
+
var deltaDelegationShapeSchema = z18.object({
|
|
2142
|
+
type: z18.literal("delegation"),
|
|
2090
2143
|
childRef: deltaKeyPartSchema,
|
|
2091
|
-
label:
|
|
2092
|
-
background:
|
|
2093
|
-
summary:
|
|
2144
|
+
label: z18.string(),
|
|
2145
|
+
background: z18.boolean(),
|
|
2146
|
+
summary: z18.string().optional()
|
|
2094
2147
|
});
|
|
2095
|
-
var deltaPlanStepsShapeSchema =
|
|
2096
|
-
type:
|
|
2097
|
-
steps:
|
|
2098
|
-
explanation:
|
|
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 =
|
|
2101
|
-
type:
|
|
2153
|
+
var deltaExtensionShapeSchema = z18.object({
|
|
2154
|
+
type: z18.literal("extension"),
|
|
2102
2155
|
kind: extensionKindSchema,
|
|
2103
2156
|
payload: jsonValueSchema
|
|
2104
2157
|
});
|
|
2105
|
-
var deltaItemShapeSchema =
|
|
2106
|
-
|
|
2107
|
-
type:
|
|
2108
|
-
command:
|
|
2109
|
-
cwd:
|
|
2110
|
-
aggregatedOutput:
|
|
2111
|
-
exitCode:
|
|
2112
|
-
durationMs:
|
|
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
|
-
|
|
2115
|
-
type:
|
|
2116
|
-
changes:
|
|
2167
|
+
z18.object({
|
|
2168
|
+
type: z18.literal("fileChange"),
|
|
2169
|
+
changes: z18.array(deltaFileChangeSchema)
|
|
2117
2170
|
}),
|
|
2118
|
-
|
|
2119
|
-
type:
|
|
2120
|
-
tool:
|
|
2121
|
-
server:
|
|
2122
|
-
args:
|
|
2123
|
-
result:
|
|
2124
|
-
error:
|
|
2125
|
-
durationMs:
|
|
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
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
type:
|
|
2131
|
-
summary:
|
|
2132
|
-
content:
|
|
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
|
-
|
|
2135
|
-
|
|
2136
|
-
type:
|
|
2137
|
-
queries:
|
|
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
|
-
|
|
2140
|
-
type:
|
|
2141
|
-
url:
|
|
2142
|
-
prompt:
|
|
2143
|
-
pattern:
|
|
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
|
-
|
|
2146
|
-
|
|
2147
|
-
type:
|
|
2148
|
-
prompt:
|
|
2149
|
-
path:
|
|
2150
|
-
result:
|
|
2151
|
-
error:
|
|
2152
|
-
transparentBackground:
|
|
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 =
|
|
2214
|
+
var deltaProgressSnapshotSchema = z18.discriminatedUnion("type", [
|
|
2162
2215
|
deltaBackgroundTaskShapeSchema,
|
|
2163
2216
|
deltaDelegationShapeSchema
|
|
2164
2217
|
]);
|
|
2165
|
-
var deltaTextChannelSchema =
|
|
2218
|
+
var deltaTextChannelSchema = z18.enum([
|
|
2166
2219
|
"agentMessage",
|
|
2167
2220
|
"reasoningSummary",
|
|
2168
2221
|
"reasoningText",
|
|
2169
2222
|
"plan"
|
|
2170
2223
|
]);
|
|
2171
|
-
var deltaOutputChannelSchema =
|
|
2172
|
-
var deltaErrorSchema =
|
|
2173
|
-
var deltaAttachSchema =
|
|
2174
|
-
var deltaNoTurnFallbackSchema =
|
|
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:
|
|
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 =
|
|
2188
|
-
|
|
2189
|
-
kind:
|
|
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
|
-
|
|
2194
|
-
kind:
|
|
2195
|
-
text:
|
|
2246
|
+
z18.object({
|
|
2247
|
+
kind: z18.literal("input.provider"),
|
|
2248
|
+
text: z18.string().min(1),
|
|
2196
2249
|
parentRef: deltaKeyPartSchema.optional()
|
|
2197
2250
|
}),
|
|
2198
|
-
|
|
2199
|
-
kind:
|
|
2251
|
+
z18.object({
|
|
2252
|
+
kind: z18.literal("turn.open"),
|
|
2200
2253
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2201
2254
|
parentRef: deltaKeyPartSchema.optional()
|
|
2202
2255
|
}),
|
|
2203
|
-
|
|
2204
|
-
kind:
|
|
2256
|
+
z18.object({
|
|
2257
|
+
kind: z18.literal("turn.boundary"),
|
|
2205
2258
|
status: threadEventTurnStatusSchema,
|
|
2206
2259
|
error: deltaErrorSchema.optional(),
|
|
2207
|
-
providerCheckpointId:
|
|
2208
|
-
claimIfIdle:
|
|
2260
|
+
providerCheckpointId: z18.string().min(1).optional(),
|
|
2261
|
+
claimIfIdle: z18.boolean().optional(),
|
|
2209
2262
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2210
2263
|
}),
|
|
2211
|
-
|
|
2212
|
-
kind:
|
|
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
|
-
|
|
2221
|
-
kind:
|
|
2273
|
+
z18.object({
|
|
2274
|
+
kind: z18.literal("item.close"),
|
|
2222
2275
|
key: deltaItemKeySchema,
|
|
2223
2276
|
status: threadEventItemStatusSchema,
|
|
2224
|
-
resultText:
|
|
2225
|
-
exitCode:
|
|
2226
|
-
aggregatedOutput:
|
|
2227
|
-
approvalStatus:
|
|
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
|
-
|
|
2234
|
-
kind:
|
|
2286
|
+
z18.object({
|
|
2287
|
+
kind: z18.literal("item.progress"),
|
|
2235
2288
|
key: deltaItemKeySchema,
|
|
2236
|
-
message:
|
|
2289
|
+
message: z18.string().optional(),
|
|
2237
2290
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
2238
|
-
flush:
|
|
2291
|
+
flush: z18.boolean().optional(),
|
|
2239
2292
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2240
2293
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2241
2294
|
}),
|
|
2242
|
-
|
|
2243
|
-
kind:
|
|
2295
|
+
z18.object({
|
|
2296
|
+
kind: z18.literal("item.textDelta"),
|
|
2244
2297
|
key: deltaItemKeySchema,
|
|
2245
2298
|
channel: deltaTextChannelSchema,
|
|
2246
|
-
text:
|
|
2299
|
+
text: z18.string(),
|
|
2247
2300
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2248
2301
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2249
2302
|
}),
|
|
2250
|
-
|
|
2251
|
-
kind:
|
|
2303
|
+
z18.object({
|
|
2304
|
+
kind: z18.literal("item.textClose"),
|
|
2252
2305
|
key: deltaItemKeySchema,
|
|
2253
2306
|
channel: deltaTextChannelSchema,
|
|
2254
|
-
text:
|
|
2307
|
+
text: z18.string().optional(),
|
|
2255
2308
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2256
2309
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2257
2310
|
}),
|
|
2258
|
-
|
|
2259
|
-
kind:
|
|
2311
|
+
z18.object({
|
|
2312
|
+
kind: z18.literal("item.outputDelta"),
|
|
2260
2313
|
key: deltaItemKeySchema,
|
|
2261
2314
|
channel: deltaOutputChannelSchema,
|
|
2262
|
-
text:
|
|
2315
|
+
text: z18.string(),
|
|
2263
2316
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2264
2317
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2265
2318
|
}),
|
|
2266
|
-
|
|
2267
|
-
kind:
|
|
2319
|
+
z18.object({
|
|
2320
|
+
kind: z18.literal("command.outputSnapshot"),
|
|
2268
2321
|
key: deltaItemKeySchema,
|
|
2269
|
-
text:
|
|
2322
|
+
text: z18.string(),
|
|
2270
2323
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2271
2324
|
}),
|
|
2272
|
-
|
|
2273
|
-
kind:
|
|
2325
|
+
z18.object({
|
|
2326
|
+
kind: z18.literal("usage"),
|
|
2274
2327
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2275
2328
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2276
|
-
modelContextWindow:
|
|
2329
|
+
modelContextWindow: z18.number().nullable(),
|
|
2277
2330
|
providerTurnId: providerTurnIdSchema.optional()
|
|
2278
2331
|
}),
|
|
2279
|
-
|
|
2280
|
-
kind:
|
|
2332
|
+
z18.object({
|
|
2333
|
+
kind: z18.literal("contextWindow"),
|
|
2281
2334
|
snapshot: contextSnapshotSchema.optional(),
|
|
2282
|
-
used:
|
|
2283
|
-
size:
|
|
2284
|
-
estimated:
|
|
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
|
-
|
|
2289
|
-
kind:
|
|
2342
|
+
z18.object({
|
|
2343
|
+
kind: z18.literal("context.compacted"),
|
|
2290
2344
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2291
2345
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
2292
2346
|
}),
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
kind:
|
|
2296
|
-
diff:
|
|
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
|
-
|
|
2300
|
-
|
|
2301
|
-
kind:
|
|
2302
|
-
providerThreadId:
|
|
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
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
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
|
-
|
|
2311
|
-
kind:
|
|
2368
|
+
z18.object({
|
|
2369
|
+
kind: z18.literal("provider.rateLimits"),
|
|
2312
2370
|
rateLimits: providerRateLimitStateSchema
|
|
2313
2371
|
}),
|
|
2314
|
-
|
|
2315
|
-
kind:
|
|
2316
|
-
message:
|
|
2317
|
-
detail:
|
|
2318
|
-
willRetry:
|
|
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:
|
|
2379
|
+
settlesTurn: z18.boolean().optional(),
|
|
2322
2380
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
2323
|
-
threadScoped:
|
|
2381
|
+
threadScoped: z18.boolean().optional()
|
|
2324
2382
|
}),
|
|
2325
|
-
|
|
2326
|
-
kind:
|
|
2327
|
-
originalModel:
|
|
2328
|
-
fallbackModel:
|
|
2329
|
-
reason:
|
|
2330
|
-
message:
|
|
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
|
-
|
|
2333
|
-
kind:
|
|
2334
|
-
summary:
|
|
2335
|
-
details:
|
|
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:
|
|
2395
|
+
vouchedTurn: z18.boolean().optional()
|
|
2338
2396
|
}),
|
|
2339
|
-
|
|
2340
|
-
kind:
|
|
2397
|
+
z18.object({
|
|
2398
|
+
kind: z18.literal("unhandled"),
|
|
2341
2399
|
raw: providerRawEventSchema,
|
|
2342
|
-
rawType:
|
|
2343
|
-
vouchedTurn:
|
|
2344
|
-
onlyIfNoTurn:
|
|
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
|
-
|
|
2349
|
-
|
|
2406
|
+
z18.object({ kind: z18.literal("session.ended") }),
|
|
2407
|
+
z18.object({ kind: z18.literal("session.reset") })
|
|
2350
2408
|
]);
|
|
2351
|
-
var threadDeltaNotificationParamsSchema =
|
|
2352
|
-
threadId:
|
|
2353
|
-
deltas:
|
|
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
|
|
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
|
|
2368
|
-
var bashArgsSchema =
|
|
2369
|
-
command:
|
|
2370
|
-
cwd:
|
|
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 =
|
|
2373
|
-
type:
|
|
2374
|
-
text:
|
|
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 =
|
|
2384
|
-
content:
|
|
2441
|
+
var contentWrapperSchema = z20.object({
|
|
2442
|
+
content: z20.array(z20.unknown())
|
|
2385
2443
|
}).passthrough();
|
|
2386
|
-
var shellEnvironmentVariableKeySchema =
|
|
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
|
|
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 =
|
|
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
|
|
4405
|
+
import { z as z29 } from "zod";
|
|
4346
4406
|
|
|
4347
4407
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
4348
|
-
import { z as
|
|
4349
|
-
var bridgeGrammarVersionsSchema =
|
|
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 =
|
|
4358
|
-
var bridgeCapabilitiesSchema =
|
|
4359
|
-
sessionRestore:
|
|
4360
|
-
threadArchive:
|
|
4361
|
-
threadRename:
|
|
4362
|
-
threadGoalClear:
|
|
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:
|
|
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:
|
|
4430
|
+
skills: z22.object({ configure: z22.boolean().default(false) }).default({ configure: false })
|
|
4371
4431
|
}).passthrough();
|
|
4372
|
-
var initializeParamsSchema =
|
|
4373
|
-
protocolVersion:
|
|
4374
|
-
client:
|
|
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 =
|
|
4381
|
-
protocolVersion:
|
|
4382
|
-
capabilities:
|
|
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
|
|
4390
|
-
var bridgeExecutionOptionsSchema =
|
|
4391
|
-
model:
|
|
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
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
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
|
|
4402
|
-
var providerMaintenanceParamsSchema =
|
|
4403
|
-
providerId:
|
|
4404
|
-
cwd:
|
|
4405
|
-
providerOptions:
|
|
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 =
|
|
4468
|
+
var providerInstallationRequirementSchema = z24.enum(["thread_rewind"]);
|
|
4408
4469
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
4409
4470
|
requirement: providerInstallationRequirementSchema.optional(),
|
|
4410
|
-
checkUpdates:
|
|
4471
|
+
checkUpdates: z24.boolean().default(true)
|
|
4411
4472
|
});
|
|
4412
|
-
var providerHealthSchema =
|
|
4413
|
-
status:
|
|
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:
|
|
4422
|
-
accountEmail:
|
|
4423
|
-
planLabel:
|
|
4424
|
-
installedVersion:
|
|
4425
|
-
minimumSupportedVersion:
|
|
4426
|
-
canInstall:
|
|
4427
|
-
canUpdate:
|
|
4428
|
-
loginCommand:
|
|
4429
|
-
localLoginCommand:
|
|
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 =
|
|
4432
|
-
label:
|
|
4433
|
-
usedPercent:
|
|
4434
|
-
resetsAt:
|
|
4435
|
-
cost:
|
|
4436
|
-
usedUsdCents:
|
|
4437
|
-
limitUsdCents:
|
|
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 =
|
|
4441
|
-
|
|
4442
|
-
status:
|
|
4443
|
-
accountEmail:
|
|
4444
|
-
planLabel:
|
|
4445
|
-
windows:
|
|
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
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
status:
|
|
4452
|
-
message:
|
|
4453
|
-
planLabel:
|
|
4454
|
-
accountEmail:
|
|
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 =
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
supported:
|
|
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 =
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
supported:
|
|
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 =
|
|
4532
|
+
var providerInstallationActionKindSchema = z24.enum([
|
|
4472
4533
|
"install",
|
|
4473
4534
|
"update"
|
|
4474
4535
|
]);
|
|
4475
|
-
var providerInstallationActionSchema =
|
|
4536
|
+
var providerInstallationActionSchema = z24.object({
|
|
4476
4537
|
kind: providerInstallationActionKindSchema,
|
|
4477
|
-
label:
|
|
4478
|
-
command:
|
|
4538
|
+
label: z24.enum(["Install", "Update"]),
|
|
4539
|
+
command: z24.string().min(1)
|
|
4479
4540
|
}).passthrough();
|
|
4480
|
-
var providerInstallationSourceSchema =
|
|
4541
|
+
var providerInstallationSourceSchema = z24.enum([
|
|
4481
4542
|
"notInstalled",
|
|
4482
4543
|
"npmGlobal",
|
|
4483
4544
|
"external"
|
|
4484
4545
|
]);
|
|
4485
|
-
var providerInstallationStatusSchema =
|
|
4486
|
-
executableName:
|
|
4487
|
-
executablePath:
|
|
4488
|
-
installed:
|
|
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:
|
|
4491
|
-
latestVersion:
|
|
4492
|
-
minimumSupportedVersion:
|
|
4493
|
-
npmPackageName:
|
|
4494
|
-
npmGlobalPackageVersion:
|
|
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:
|
|
4497
|
-
versionUnsupported:
|
|
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 =
|
|
4503
|
-
command:
|
|
4504
|
-
args:
|
|
4505
|
-
displayCommand:
|
|
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 =
|
|
4568
|
+
var providerInstallationVerificationSchema = z24.discriminatedUnion(
|
|
4508
4569
|
"kind",
|
|
4509
4570
|
[
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
kind:
|
|
4513
|
-
previousVersion:
|
|
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
|
-
|
|
4516
|
-
kind:
|
|
4517
|
-
version:
|
|
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 =
|
|
4582
|
+
var providerInstallationRunResultSchema = z24.discriminatedUnion(
|
|
4522
4583
|
"available",
|
|
4523
4584
|
[
|
|
4524
|
-
|
|
4525
|
-
available:
|
|
4526
|
-
message:
|
|
4585
|
+
z24.object({
|
|
4586
|
+
available: z24.literal(false),
|
|
4587
|
+
message: z24.string().min(1)
|
|
4527
4588
|
}).passthrough(),
|
|
4528
|
-
|
|
4529
|
-
available:
|
|
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
|
|
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:
|
|
4560
|
-
cwd:
|
|
4620
|
+
threadId: z25.string().min(1),
|
|
4621
|
+
cwd: z25.string().min(1),
|
|
4561
4622
|
options: bridgeExecutionOptionsSchema,
|
|
4562
|
-
dynamicTools:
|
|
4563
|
-
disallowedTools:
|
|
4623
|
+
dynamicTools: z25.array(dynamicToolSchema).optional(),
|
|
4624
|
+
disallowedTools: z25.array(z25.string().min(1)).optional(),
|
|
4564
4625
|
instructionMode: instructionModeSchema
|
|
4565
4626
|
};
|
|
4566
|
-
var modelListParamsSchema =
|
|
4567
|
-
var threadStartParamsSchema =
|
|
4627
|
+
var modelListParamsSchema = z25.object({ cwd: z25.string().min(1).optional() }).passthrough();
|
|
4628
|
+
var threadStartParamsSchema = z25.object({
|
|
4568
4629
|
...sessionConstructionFields,
|
|
4569
|
-
input:
|
|
4630
|
+
input: z25.array(promptInputSchema).optional()
|
|
4570
4631
|
}).passthrough();
|
|
4571
|
-
var threadResumeParamsSchema =
|
|
4632
|
+
var threadResumeParamsSchema = z25.object({
|
|
4572
4633
|
...sessionConstructionFields,
|
|
4573
|
-
providerThreadId:
|
|
4634
|
+
providerThreadId: z25.string().min(1)
|
|
4574
4635
|
}).passthrough();
|
|
4575
|
-
var threadForkParamsSchema =
|
|
4636
|
+
var threadForkParamsSchema = z25.object({
|
|
4576
4637
|
...sessionConstructionFields,
|
|
4577
|
-
sourceProviderThreadId:
|
|
4578
|
-
sourceProviderCheckpointId:
|
|
4638
|
+
sourceProviderThreadId: z25.string().min(1),
|
|
4639
|
+
sourceProviderCheckpointId: z25.string().min(1).optional()
|
|
4579
4640
|
}).passthrough();
|
|
4580
|
-
var threadStopParamsSchema =
|
|
4581
|
-
threadId:
|
|
4582
|
-
providerThreadId:
|
|
4583
|
-
intent:
|
|
4584
|
-
activeTurnId:
|
|
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 =
|
|
4587
|
-
threadId:
|
|
4588
|
-
providerThreadId:
|
|
4647
|
+
var threadRefParams = z25.object({
|
|
4648
|
+
threadId: z25.string().min(1),
|
|
4649
|
+
providerThreadId: z25.string().min(1)
|
|
4589
4650
|
}).passthrough();
|
|
4590
|
-
var threadNameSetParamsSchema =
|
|
4591
|
-
threadId:
|
|
4592
|
-
providerThreadId:
|
|
4593
|
-
title:
|
|
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:
|
|
4597
|
-
providerThreadId:
|
|
4598
|
-
input:
|
|
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 =
|
|
4603
|
-
var turnSteerParamsSchema =
|
|
4663
|
+
var turnStartParamsSchema = z25.object(turnInputFields).passthrough();
|
|
4664
|
+
var turnSteerParamsSchema = z25.object({
|
|
4604
4665
|
...turnInputFields,
|
|
4605
|
-
expectedTurnId:
|
|
4666
|
+
expectedTurnId: z25.string().min(1)
|
|
4606
4667
|
}).passthrough();
|
|
4607
|
-
var skillsConfigureRootSchema =
|
|
4608
|
-
id:
|
|
4609
|
-
path:
|
|
4610
|
-
skills:
|
|
4611
|
-
|
|
4612
|
-
name:
|
|
4613
|
-
description:
|
|
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 =
|
|
4618
|
-
roots:
|
|
4678
|
+
var skillsConfigureParamsSchema = z25.object({
|
|
4679
|
+
roots: z25.array(skillsConfigureRootSchema)
|
|
4619
4680
|
}).passthrough();
|
|
4620
|
-
var threadIdentityResultSchema =
|
|
4621
|
-
providerThreadId:
|
|
4622
|
-
sessionRestorable:
|
|
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
|
|
4687
|
+
import { z as z27 } from "zod";
|
|
4627
4688
|
|
|
4628
4689
|
// ../provider-bridge-protocol/src/errors.ts
|
|
4629
|
-
import { z as
|
|
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 =
|
|
4700
|
+
var providerRecoveryHintSchema = z26.object({
|
|
4640
4701
|
kind: providerRecoveryKindSchema,
|
|
4641
|
-
message:
|
|
4642
|
-
retryable:
|
|
4702
|
+
message: z26.string().min(1),
|
|
4703
|
+
retryable: z26.boolean()
|
|
4643
4704
|
});
|
|
4644
|
-
var bridgeErrorDataSchema =
|
|
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 =
|
|
4655
|
-
threadId:
|
|
4656
|
-
providerThreadId:
|
|
4657
|
-
sessionRestorable:
|
|
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 =
|
|
4660
|
-
threadId:
|
|
4661
|
-
providerThreadId:
|
|
4662
|
-
reason:
|
|
4663
|
-
contextLost:
|
|
4664
|
-
showRuntimeNote:
|
|
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 =
|
|
4667
|
-
threadId:
|
|
4727
|
+
var providerRecoveryNotificationSchema = z27.object({
|
|
4728
|
+
threadId: z27.string().min(1).optional(),
|
|
4668
4729
|
...providerRecoveryHintSchema.shape
|
|
4669
4730
|
}).passthrough();
|
|
4670
|
-
var errorNotificationSchema =
|
|
4671
|
-
threadId:
|
|
4672
|
-
providerThreadId:
|
|
4673
|
-
message:
|
|
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
|
|
4678
|
-
var toolCallRequestParamsSchema =
|
|
4679
|
-
providerThreadId:
|
|
4680
|
-
threadId:
|
|
4681
|
-
turnId:
|
|
4682
|
-
callId:
|
|
4683
|
-
tool:
|
|
4684
|
-
arguments:
|
|
4685
|
-
providerNativeIds:
|
|
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 =
|
|
4688
|
-
success:
|
|
4689
|
-
contentItems:
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
type:
|
|
4694
|
-
imageUrl:
|
|
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 =
|
|
4700
|
-
providerThreadId:
|
|
4701
|
-
threadId:
|
|
4702
|
-
turnId:
|
|
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:
|
|
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 =
|
|
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 =
|
|
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
|
|
6031
|
-
var bridgeJsonRpcValueSchema =
|
|
6032
|
-
() =>
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
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 =
|
|
6042
|
-
jsonrpc:
|
|
6043
|
-
id:
|
|
6044
|
-
method:
|
|
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:
|
|
6048
|
-
code:
|
|
6049
|
-
message:
|
|
6108
|
+
error: z30.object({
|
|
6109
|
+
code: z30.number(),
|
|
6110
|
+
message: z30.string(),
|
|
6050
6111
|
data: bridgeJsonRpcValueSchema.optional()
|
|
6051
6112
|
}).optional()
|
|
6052
6113
|
});
|