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