@get-bb/plugin-sdk 0.6.104 → 0.6.109
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 +76 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk.d.ts +86 -3
- package/dist/internal/rpc-query-host.js +4 -0
- package/dist/provider-bridge-acp-next.js +2712 -2707
- package/dist/provider-bridge-acp.js +2712 -2707
- package/dist/provider-bridge-testing.js +1294 -1289
- package/dist/provider-bridge.js +1366 -1361
- package/dist/testing/app.js +4 -0
- package/dist/testing/index.js +4 -0
- package/package.json +1 -1
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 z26 } from "zod";
|
|
1034
1034
|
|
|
1035
1035
|
// ../domain/src/context-snapshot.ts
|
|
1036
1036
|
import { z as z3 } from "zod";
|
|
@@ -1682,8 +1682,12 @@ import { z as z8 } from "zod";
|
|
|
1682
1682
|
var COMPLETED_TURN_DISPLAY_VALUES = ["collapse", "flat"];
|
|
1683
1683
|
var completedTurnDisplaySchema = z8.enum(COMPLETED_TURN_DISPLAY_VALUES);
|
|
1684
1684
|
|
|
1685
|
-
// ../domain/src/
|
|
1685
|
+
// ../domain/src/plugin-id.ts
|
|
1686
1686
|
import { z as z9 } from "zod";
|
|
1687
|
+
var pluginIdSchema = z9.string().regex(/^[a-z0-9][a-z0-9-]*$/u);
|
|
1688
|
+
|
|
1689
|
+
// ../domain/src/background-task.ts
|
|
1690
|
+
import { z as z10 } from "zod";
|
|
1687
1691
|
var LOCAL_WORKFLOW_TASK_TYPE = "local_workflow";
|
|
1688
1692
|
var LOCAL_BASH_TASK_TYPE = "local_bash";
|
|
1689
1693
|
var LOCAL_AGENT_TASK_TYPE = "local_agent";
|
|
@@ -1700,7 +1704,7 @@ var backgroundTaskStatusValues = [
|
|
|
1700
1704
|
"killed",
|
|
1701
1705
|
"stopped"
|
|
1702
1706
|
];
|
|
1703
|
-
var backgroundTaskStatusSchema =
|
|
1707
|
+
var backgroundTaskStatusSchema = z10.enum(backgroundTaskStatusValues);
|
|
1704
1708
|
var workflowAgentStateValues = [
|
|
1705
1709
|
"queued",
|
|
1706
1710
|
"running",
|
|
@@ -1708,43 +1712,43 @@ var workflowAgentStateValues = [
|
|
|
1708
1712
|
"failed",
|
|
1709
1713
|
"skipped"
|
|
1710
1714
|
];
|
|
1711
|
-
var workflowAgentStateSchema =
|
|
1712
|
-
var workflowAgentSnapshotSchema =
|
|
1713
|
-
index:
|
|
1714
|
-
label:
|
|
1715
|
+
var workflowAgentStateSchema = z10.enum(workflowAgentStateValues);
|
|
1716
|
+
var workflowAgentSnapshotSchema = z10.object({
|
|
1717
|
+
index: z10.number().int().positive(),
|
|
1718
|
+
label: z10.string(),
|
|
1715
1719
|
state: workflowAgentStateSchema,
|
|
1716
|
-
model:
|
|
1717
|
-
attempt:
|
|
1718
|
-
cached:
|
|
1719
|
-
lastProgressAt:
|
|
1720
|
-
phaseIndex:
|
|
1721
|
-
phaseTitle:
|
|
1722
|
-
agentType:
|
|
1723
|
-
isolation:
|
|
1724
|
-
queuedAt:
|
|
1725
|
-
startedAt:
|
|
1726
|
-
lastToolName:
|
|
1727
|
-
lastToolSummary:
|
|
1728
|
-
promptPreview:
|
|
1729
|
-
resultPreview:
|
|
1730
|
-
error:
|
|
1731
|
-
tokens:
|
|
1732
|
-
toolCalls:
|
|
1733
|
-
durationMs:
|
|
1734
|
-
});
|
|
1735
|
-
var workflowPhaseSnapshotSchema =
|
|
1736
|
-
index:
|
|
1737
|
-
title:
|
|
1738
|
-
kind:
|
|
1739
|
-
});
|
|
1740
|
-
var workflowProgressSnapshotSchema =
|
|
1741
|
-
phases:
|
|
1742
|
-
agents:
|
|
1743
|
-
});
|
|
1744
|
-
var backgroundTaskUsageSchema =
|
|
1745
|
-
totalTokens:
|
|
1746
|
-
toolUses:
|
|
1747
|
-
durationMs:
|
|
1720
|
+
model: z10.string(),
|
|
1721
|
+
attempt: z10.number().int().positive(),
|
|
1722
|
+
cached: z10.boolean(),
|
|
1723
|
+
lastProgressAt: z10.number(),
|
|
1724
|
+
phaseIndex: z10.number().int().positive().optional(),
|
|
1725
|
+
phaseTitle: z10.string().optional(),
|
|
1726
|
+
agentType: z10.string().optional(),
|
|
1727
|
+
isolation: z10.string().optional(),
|
|
1728
|
+
queuedAt: z10.number().optional(),
|
|
1729
|
+
startedAt: z10.number().optional(),
|
|
1730
|
+
lastToolName: z10.string().optional(),
|
|
1731
|
+
lastToolSummary: z10.string().optional(),
|
|
1732
|
+
promptPreview: z10.string().optional(),
|
|
1733
|
+
resultPreview: z10.string().optional(),
|
|
1734
|
+
error: z10.string().optional(),
|
|
1735
|
+
tokens: z10.number().optional(),
|
|
1736
|
+
toolCalls: z10.number().optional(),
|
|
1737
|
+
durationMs: z10.number().optional()
|
|
1738
|
+
});
|
|
1739
|
+
var workflowPhaseSnapshotSchema = z10.object({
|
|
1740
|
+
index: z10.number().int().positive(),
|
|
1741
|
+
title: z10.string(),
|
|
1742
|
+
kind: z10.string().optional()
|
|
1743
|
+
});
|
|
1744
|
+
var workflowProgressSnapshotSchema = z10.object({
|
|
1745
|
+
phases: z10.array(workflowPhaseSnapshotSchema),
|
|
1746
|
+
agents: z10.array(workflowAgentSnapshotSchema)
|
|
1747
|
+
});
|
|
1748
|
+
var backgroundTaskUsageSchema = z10.object({
|
|
1749
|
+
totalTokens: z10.number(),
|
|
1750
|
+
toolUses: z10.number(),
|
|
1751
|
+
durationMs: z10.number()
|
|
1748
1752
|
});
|
|
1749
1753
|
function backgroundTaskItemStatus(taskStatus) {
|
|
1750
1754
|
switch (taskStatus) {
|
|
@@ -1766,11 +1770,11 @@ function isSettledBackgroundTaskStatus(taskStatus) {
|
|
|
1766
1770
|
}
|
|
1767
1771
|
|
|
1768
1772
|
// ../domain/src/protocol-ids.ts
|
|
1769
|
-
import { z as
|
|
1770
|
-
var clientTurnRequestIdSchema =
|
|
1773
|
+
import { z as z11 } from "zod";
|
|
1774
|
+
var clientTurnRequestIdSchema = z11.string().regex(/^creq_[23456789abcdefghijkmnpqrstuvwxyz]{10}$/u);
|
|
1771
1775
|
|
|
1772
1776
|
// ../domain/src/system-message.ts
|
|
1773
|
-
import { z as
|
|
1777
|
+
import { z as z12 } from "zod";
|
|
1774
1778
|
var systemMessageKindValues = [
|
|
1775
1779
|
"ownership-assigned",
|
|
1776
1780
|
"ownership-removed",
|
|
@@ -1783,71 +1787,71 @@ var systemMessageKindValues = [
|
|
|
1783
1787
|
"environment-directory-updated",
|
|
1784
1788
|
"unlabeled"
|
|
1785
1789
|
];
|
|
1786
|
-
var systemMessageKindSchema =
|
|
1787
|
-
var systemThreadInterruptedReasonSchema =
|
|
1790
|
+
var systemMessageKindSchema = z12.enum(systemMessageKindValues);
|
|
1791
|
+
var systemThreadInterruptedReasonSchema = z12.enum([
|
|
1788
1792
|
"manual-stop",
|
|
1789
1793
|
"host-daemon-restarted",
|
|
1790
1794
|
"host-removed",
|
|
1791
1795
|
"provider-turn-idle"
|
|
1792
1796
|
]);
|
|
1793
|
-
var childThreadOutcomeSchema =
|
|
1794
|
-
threadId:
|
|
1795
|
-
status:
|
|
1796
|
-
interruption:
|
|
1797
|
+
var childThreadOutcomeSchema = z12.object({
|
|
1798
|
+
threadId: z12.string(),
|
|
1799
|
+
status: z12.enum(["completed", "failed", "interrupted"]),
|
|
1800
|
+
interruption: z12.object({
|
|
1797
1801
|
reason: systemThreadInterruptedReasonSchema,
|
|
1798
|
-
cause:
|
|
1802
|
+
cause: z12.literal("host-connection-lost").optional()
|
|
1799
1803
|
}).optional()
|
|
1800
1804
|
});
|
|
1801
|
-
var systemMessageSubjectSchema =
|
|
1802
|
-
|
|
1803
|
-
kind:
|
|
1804
|
-
threadId:
|
|
1805
|
-
threadName:
|
|
1806
|
-
outcomes:
|
|
1805
|
+
var systemMessageSubjectSchema = z12.discriminatedUnion("kind", [
|
|
1806
|
+
z12.object({
|
|
1807
|
+
kind: z12.literal("thread"),
|
|
1808
|
+
threadId: z12.string(),
|
|
1809
|
+
threadName: z12.string(),
|
|
1810
|
+
outcomes: z12.array(childThreadOutcomeSchema).optional()
|
|
1807
1811
|
}),
|
|
1808
|
-
|
|
1809
|
-
kind:
|
|
1810
|
-
count:
|
|
1811
|
-
outcomes:
|
|
1812
|
+
z12.object({
|
|
1813
|
+
kind: z12.literal("thread-batch"),
|
|
1814
|
+
count: z12.number(),
|
|
1815
|
+
outcomes: z12.array(childThreadOutcomeSchema).optional()
|
|
1812
1816
|
}),
|
|
1813
|
-
|
|
1814
|
-
kind:
|
|
1815
|
-
toolName:
|
|
1816
|
-
suppress:
|
|
1817
|
+
z12.object({
|
|
1818
|
+
kind: z12.literal("tool-call"),
|
|
1819
|
+
toolName: z12.string(),
|
|
1820
|
+
suppress: z12.boolean()
|
|
1817
1821
|
}),
|
|
1818
|
-
|
|
1819
|
-
kind:
|
|
1820
|
-
path:
|
|
1822
|
+
z12.object({
|
|
1823
|
+
kind: z12.literal("directory"),
|
|
1824
|
+
path: z12.string()
|
|
1821
1825
|
})
|
|
1822
1826
|
]);
|
|
1823
1827
|
|
|
1824
1828
|
// ../domain/src/item-presentation.ts
|
|
1825
|
-
import { z as
|
|
1829
|
+
import { z as z13 } from "zod";
|
|
1826
1830
|
var THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH = 280;
|
|
1827
|
-
var threadEventItemPresentationLabelSchema =
|
|
1828
|
-
pending:
|
|
1829
|
-
completed:
|
|
1831
|
+
var threadEventItemPresentationLabelSchema = z13.object({
|
|
1832
|
+
pending: z13.string().min(1),
|
|
1833
|
+
completed: z13.string().min(1)
|
|
1830
1834
|
});
|
|
1831
|
-
var threadEventItemPresentationIconSchema =
|
|
1832
|
-
glyph:
|
|
1835
|
+
var threadEventItemPresentationIconSchema = z13.object({
|
|
1836
|
+
glyph: z13.string().min(1)
|
|
1833
1837
|
});
|
|
1834
|
-
var threadEventItemPresentationTintSchema =
|
|
1835
|
-
light:
|
|
1836
|
-
dark:
|
|
1838
|
+
var threadEventItemPresentationTintSchema = z13.object({
|
|
1839
|
+
light: z13.string().min(1),
|
|
1840
|
+
dark: z13.string().min(1)
|
|
1837
1841
|
});
|
|
1838
1842
|
var THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH = 80;
|
|
1839
|
-
var threadEventItemPresentationBadgeSchema =
|
|
1840
|
-
glyph:
|
|
1841
|
-
label:
|
|
1842
|
-
hint:
|
|
1843
|
-
tone:
|
|
1843
|
+
var threadEventItemPresentationBadgeSchema = z13.object({
|
|
1844
|
+
glyph: z13.string().min(1),
|
|
1845
|
+
label: z13.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
|
|
1846
|
+
hint: z13.string().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_BADGE_LABEL_MAX_LENGTH),
|
|
1847
|
+
tone: z13.enum(["neutral", "destructive"])
|
|
1844
1848
|
});
|
|
1845
|
-
var threadEventItemPresentationSchema =
|
|
1849
|
+
var threadEventItemPresentationSchema = z13.object({
|
|
1846
1850
|
label: threadEventItemPresentationLabelSchema,
|
|
1847
1851
|
icon: threadEventItemPresentationIconSchema,
|
|
1848
|
-
title:
|
|
1849
|
-
detail:
|
|
1850
|
-
suppress:
|
|
1852
|
+
title: z13.string().optional(),
|
|
1853
|
+
detail: z13.string().max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
|
|
1854
|
+
suppress: z13.boolean().optional(),
|
|
1851
1855
|
tint: threadEventItemPresentationTintSchema.optional(),
|
|
1852
1856
|
badge: threadEventItemPresentationBadgeSchema.optional()
|
|
1853
1857
|
});
|
|
@@ -1858,7 +1862,7 @@ function toPositiveNumber(value) {
|
|
|
1858
1862
|
}
|
|
1859
1863
|
|
|
1860
1864
|
// ../domain/src/pending-interactions.ts
|
|
1861
|
-
import { z as
|
|
1865
|
+
import { z as z15 } from "zod";
|
|
1862
1866
|
|
|
1863
1867
|
// ../domain/src/plugin-interaction-limits.ts
|
|
1864
1868
|
var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
|
|
@@ -1869,193 +1873,193 @@ function jsonByteLength(value) {
|
|
|
1869
1873
|
}
|
|
1870
1874
|
|
|
1871
1875
|
// ../domain/src/provider-extension-kind.ts
|
|
1872
|
-
import { z as
|
|
1876
|
+
import { z as z14 } from "zod";
|
|
1873
1877
|
var EXTENSION_KIND_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/u;
|
|
1874
1878
|
function isExtensionKind(value) {
|
|
1875
1879
|
return EXTENSION_KIND_PATTERN.test(value);
|
|
1876
1880
|
}
|
|
1877
|
-
var extensionKindSchema =
|
|
1881
|
+
var extensionKindSchema = z14.string().refine(isExtensionKind, {
|
|
1878
1882
|
message: 'extension kinds are "<pluginId>/<name>" (lowercase letters, digits, and "-")'
|
|
1879
1883
|
});
|
|
1880
1884
|
|
|
1881
1885
|
// ../domain/src/pending-interactions.ts
|
|
1882
|
-
var pendingInteractionStatusSchema =
|
|
1886
|
+
var pendingInteractionStatusSchema = z15.enum([
|
|
1883
1887
|
"pending",
|
|
1884
1888
|
"resolving",
|
|
1885
1889
|
"resolved",
|
|
1886
1890
|
"interrupted"
|
|
1887
1891
|
]);
|
|
1888
|
-
var pendingInteractionCommandActionSchema =
|
|
1892
|
+
var pendingInteractionCommandActionSchema = z15.discriminatedUnion(
|
|
1889
1893
|
"type",
|
|
1890
1894
|
[
|
|
1891
|
-
|
|
1892
|
-
type:
|
|
1893
|
-
command:
|
|
1894
|
-
name:
|
|
1895
|
-
path:
|
|
1895
|
+
z15.object({
|
|
1896
|
+
type: z15.literal("read"),
|
|
1897
|
+
command: z15.string(),
|
|
1898
|
+
name: z15.string(),
|
|
1899
|
+
path: z15.string()
|
|
1896
1900
|
}),
|
|
1897
|
-
|
|
1898
|
-
type:
|
|
1899
|
-
command:
|
|
1900
|
-
path:
|
|
1901
|
+
z15.object({
|
|
1902
|
+
type: z15.literal("listFiles"),
|
|
1903
|
+
command: z15.string(),
|
|
1904
|
+
path: z15.string().nullable()
|
|
1901
1905
|
}),
|
|
1902
|
-
|
|
1903
|
-
type:
|
|
1904
|
-
command:
|
|
1905
|
-
query:
|
|
1906
|
-
path:
|
|
1906
|
+
z15.object({
|
|
1907
|
+
type: z15.literal("search"),
|
|
1908
|
+
command: z15.string(),
|
|
1909
|
+
query: z15.string().nullable(),
|
|
1910
|
+
path: z15.string().nullable()
|
|
1907
1911
|
}),
|
|
1908
|
-
|
|
1909
|
-
type:
|
|
1910
|
-
command:
|
|
1912
|
+
z15.object({
|
|
1913
|
+
type: z15.literal("unknown"),
|
|
1914
|
+
command: z15.string()
|
|
1911
1915
|
})
|
|
1912
1916
|
]
|
|
1913
1917
|
);
|
|
1914
|
-
var pendingInteractionNetworkPermissionsSchema =
|
|
1915
|
-
enabled:
|
|
1918
|
+
var pendingInteractionNetworkPermissionsSchema = z15.object({
|
|
1919
|
+
enabled: z15.boolean().nullable()
|
|
1916
1920
|
});
|
|
1917
|
-
var pendingInteractionFileSystemPermissionsSchema =
|
|
1918
|
-
read:
|
|
1919
|
-
write:
|
|
1921
|
+
var pendingInteractionFileSystemPermissionsSchema = z15.object({
|
|
1922
|
+
read: z15.array(z15.string()),
|
|
1923
|
+
write: z15.array(z15.string())
|
|
1920
1924
|
});
|
|
1921
|
-
var pendingInteractionMacOsPreferencesPermissionSchema =
|
|
1925
|
+
var pendingInteractionMacOsPreferencesPermissionSchema = z15.enum([
|
|
1922
1926
|
"none",
|
|
1923
1927
|
"read_only",
|
|
1924
1928
|
"read_write"
|
|
1925
1929
|
]);
|
|
1926
|
-
var pendingInteractionMacOsContactsPermissionSchema =
|
|
1930
|
+
var pendingInteractionMacOsContactsPermissionSchema = z15.enum([
|
|
1927
1931
|
"none",
|
|
1928
1932
|
"read_only",
|
|
1929
1933
|
"read_write"
|
|
1930
1934
|
]);
|
|
1931
|
-
var pendingInteractionMacOsAutomationPermissionSchema =
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
kind:
|
|
1936
|
-
bundleIds:
|
|
1935
|
+
var pendingInteractionMacOsAutomationPermissionSchema = z15.union([
|
|
1936
|
+
z15.literal("none"),
|
|
1937
|
+
z15.literal("all"),
|
|
1938
|
+
z15.object({
|
|
1939
|
+
kind: z15.literal("bundle_ids"),
|
|
1940
|
+
bundleIds: z15.array(z15.string())
|
|
1937
1941
|
})
|
|
1938
1942
|
]);
|
|
1939
|
-
var pendingInteractionMacOsPermissionsSchema =
|
|
1943
|
+
var pendingInteractionMacOsPermissionsSchema = z15.object({
|
|
1940
1944
|
preferences: pendingInteractionMacOsPreferencesPermissionSchema,
|
|
1941
1945
|
automations: pendingInteractionMacOsAutomationPermissionSchema,
|
|
1942
|
-
launchServices:
|
|
1943
|
-
accessibility:
|
|
1944
|
-
calendar:
|
|
1945
|
-
reminders:
|
|
1946
|
+
launchServices: z15.boolean(),
|
|
1947
|
+
accessibility: z15.boolean(),
|
|
1948
|
+
calendar: z15.boolean(),
|
|
1949
|
+
reminders: z15.boolean(),
|
|
1946
1950
|
contacts: pendingInteractionMacOsContactsPermissionSchema
|
|
1947
1951
|
});
|
|
1948
|
-
var pendingInteractionRequestedPermissionProfileSchema =
|
|
1952
|
+
var pendingInteractionRequestedPermissionProfileSchema = z15.object({
|
|
1949
1953
|
network: pendingInteractionNetworkPermissionsSchema.nullable(),
|
|
1950
1954
|
fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable(),
|
|
1951
1955
|
macos: pendingInteractionMacOsPermissionsSchema.nullable()
|
|
1952
1956
|
});
|
|
1953
|
-
var pendingInteractionGrantablePermissionProfileSchema =
|
|
1957
|
+
var pendingInteractionGrantablePermissionProfileSchema = z15.object({
|
|
1954
1958
|
network: pendingInteractionNetworkPermissionsSchema.nullable(),
|
|
1955
1959
|
fileSystem: pendingInteractionFileSystemPermissionsSchema.nullable()
|
|
1956
1960
|
}).strict();
|
|
1957
1961
|
var pendingInteractionGrantedPermissionProfileSchema = pendingInteractionGrantablePermissionProfileSchema;
|
|
1958
|
-
var pendingInteractionApprovalDecisionSchema =
|
|
1962
|
+
var pendingInteractionApprovalDecisionSchema = z15.enum([
|
|
1959
1963
|
"allow_once",
|
|
1960
1964
|
"allow_for_session",
|
|
1961
1965
|
"deny"
|
|
1962
1966
|
]);
|
|
1963
|
-
var pendingInteractionFileChangeWriteScopeSchema =
|
|
1964
|
-
var pendingInteractionCommandApprovalSubjectSchema =
|
|
1965
|
-
kind:
|
|
1966
|
-
itemId:
|
|
1967
|
-
command:
|
|
1968
|
-
cwd:
|
|
1969
|
-
actions:
|
|
1967
|
+
var pendingInteractionFileChangeWriteScopeSchema = z15.string().min(1);
|
|
1968
|
+
var pendingInteractionCommandApprovalSubjectSchema = z15.object({
|
|
1969
|
+
kind: z15.literal("command"),
|
|
1970
|
+
itemId: z15.string().min(1),
|
|
1971
|
+
command: z15.string().min(1),
|
|
1972
|
+
cwd: z15.string().nullable(),
|
|
1973
|
+
actions: z15.array(pendingInteractionCommandActionSchema),
|
|
1970
1974
|
sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
|
|
1971
1975
|
});
|
|
1972
|
-
var pendingInteractionFileChangeApprovalSubjectSchema =
|
|
1973
|
-
kind:
|
|
1974
|
-
itemId:
|
|
1976
|
+
var pendingInteractionFileChangeApprovalSubjectSchema = z15.object({
|
|
1977
|
+
kind: z15.literal("file_change"),
|
|
1978
|
+
itemId: z15.string().min(1),
|
|
1975
1979
|
writeScope: pendingInteractionFileChangeWriteScopeSchema.nullable(),
|
|
1976
1980
|
sessionGrant: pendingInteractionGrantablePermissionProfileSchema.nullable()
|
|
1977
1981
|
});
|
|
1978
|
-
var pendingInteractionPermissionGrantApprovalSubjectSchema =
|
|
1979
|
-
kind:
|
|
1980
|
-
itemId:
|
|
1981
|
-
toolName:
|
|
1982
|
+
var pendingInteractionPermissionGrantApprovalSubjectSchema = z15.object({
|
|
1983
|
+
kind: z15.literal("permission_grant"),
|
|
1984
|
+
itemId: z15.string().min(1),
|
|
1985
|
+
toolName: z15.string().nullable(),
|
|
1982
1986
|
permissions: pendingInteractionGrantablePermissionProfileSchema
|
|
1983
1987
|
});
|
|
1984
|
-
var pendingInteractionPlanApprovalSubjectSchema =
|
|
1985
|
-
kind:
|
|
1986
|
-
itemId:
|
|
1987
|
-
plan:
|
|
1988
|
-
planFilePath:
|
|
1988
|
+
var pendingInteractionPlanApprovalSubjectSchema = z15.object({
|
|
1989
|
+
kind: z15.literal("plan"),
|
|
1990
|
+
itemId: z15.string().min(1),
|
|
1991
|
+
plan: z15.string().min(1),
|
|
1992
|
+
planFilePath: z15.string().min(1).nullable()
|
|
1989
1993
|
});
|
|
1990
|
-
var pendingInteractionToolUseApprovalSubjectSchema =
|
|
1991
|
-
kind:
|
|
1992
|
-
itemId:
|
|
1993
|
-
tool:
|
|
1994
|
+
var pendingInteractionToolUseApprovalSubjectSchema = z15.object({
|
|
1995
|
+
kind: z15.literal("tool_use"),
|
|
1996
|
+
itemId: z15.string().min(1),
|
|
1997
|
+
tool: z15.string().min(1),
|
|
1994
1998
|
presentation: threadEventItemPresentationSchema
|
|
1995
1999
|
});
|
|
1996
|
-
var pendingInteractionApprovalSubjectSchema =
|
|
2000
|
+
var pendingInteractionApprovalSubjectSchema = z15.discriminatedUnion("kind", [
|
|
1997
2001
|
pendingInteractionCommandApprovalSubjectSchema,
|
|
1998
2002
|
pendingInteractionFileChangeApprovalSubjectSchema,
|
|
1999
2003
|
pendingInteractionPermissionGrantApprovalSubjectSchema,
|
|
2000
2004
|
pendingInteractionPlanApprovalSubjectSchema,
|
|
2001
2005
|
pendingInteractionToolUseApprovalSubjectSchema
|
|
2002
2006
|
]);
|
|
2003
|
-
var approvalPendingInteractionPayloadSchema =
|
|
2004
|
-
kind:
|
|
2007
|
+
var approvalPendingInteractionPayloadSchema = z15.object({
|
|
2008
|
+
kind: z15.literal("approval"),
|
|
2005
2009
|
subject: pendingInteractionApprovalSubjectSchema,
|
|
2006
|
-
reason:
|
|
2007
|
-
availableDecisions:
|
|
2010
|
+
reason: z15.string().nullable(),
|
|
2011
|
+
availableDecisions: z15.array(pendingInteractionApprovalDecisionSchema).min(1)
|
|
2008
2012
|
});
|
|
2009
2013
|
var USER_QUESTION_MAX_QUESTIONS = 10;
|
|
2010
2014
|
var USER_QUESTION_MAX_OPTIONS = 4;
|
|
2011
2015
|
var USER_QUESTION_MAX_SELECTED = 4;
|
|
2012
2016
|
var USER_QUESTION_MAX_FREE_TEXT_LENGTH = 4096;
|
|
2013
|
-
var pendingInteractionUserQuestionIdSchema =
|
|
2017
|
+
var pendingInteractionUserQuestionIdSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2014
2018
|
message: "User question ids cannot be blank"
|
|
2015
2019
|
});
|
|
2016
|
-
var pendingInteractionUserQuestionPromptSchema =
|
|
2020
|
+
var pendingInteractionUserQuestionPromptSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2017
2021
|
message: "User question prompts cannot be blank"
|
|
2018
2022
|
});
|
|
2019
|
-
var pendingInteractionUserQuestionShortLabelSchema =
|
|
2023
|
+
var pendingInteractionUserQuestionShortLabelSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2020
2024
|
message: "User question short labels cannot be blank"
|
|
2021
2025
|
});
|
|
2022
|
-
var pendingInteractionUserQuestionOptionValueSchema =
|
|
2026
|
+
var pendingInteractionUserQuestionOptionValueSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2023
2027
|
message: "User question option values cannot be blank"
|
|
2024
2028
|
});
|
|
2025
|
-
var pendingInteractionUserQuestionOptionLabelSchema =
|
|
2029
|
+
var pendingInteractionUserQuestionOptionLabelSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2026
2030
|
message: "User question option labels cannot be blank"
|
|
2027
2031
|
});
|
|
2028
|
-
var pendingInteractionUserQuestionOptionDescriptionSchema =
|
|
2032
|
+
var pendingInteractionUserQuestionOptionDescriptionSchema = z15.string().min(1).refine((value) => value.trim().length > 0, {
|
|
2029
2033
|
message: "User question option descriptions cannot be blank"
|
|
2030
2034
|
});
|
|
2031
|
-
var pendingInteractionUserQuestionFreeTextSchema =
|
|
2035
|
+
var pendingInteractionUserQuestionFreeTextSchema = z15.string().min(1).max(
|
|
2032
2036
|
USER_QUESTION_MAX_FREE_TEXT_LENGTH,
|
|
2033
2037
|
`User question free text cannot exceed ${USER_QUESTION_MAX_FREE_TEXT_LENGTH} characters`
|
|
2034
2038
|
).refine((value) => value.trim().length > 0, {
|
|
2035
2039
|
message: "User question free text cannot be blank"
|
|
2036
2040
|
});
|
|
2037
|
-
var pendingInteractionUserQuestionOptionSchema =
|
|
2041
|
+
var pendingInteractionUserQuestionOptionSchema = z15.object({
|
|
2038
2042
|
value: pendingInteractionUserQuestionOptionValueSchema,
|
|
2039
2043
|
label: pendingInteractionUserQuestionOptionLabelSchema,
|
|
2040
2044
|
description: pendingInteractionUserQuestionOptionDescriptionSchema.optional()
|
|
2041
2045
|
});
|
|
2042
|
-
var pendingInteractionUserQuestionQuestionSchema =
|
|
2046
|
+
var pendingInteractionUserQuestionQuestionSchema = z15.object({
|
|
2043
2047
|
id: pendingInteractionUserQuestionIdSchema,
|
|
2044
2048
|
prompt: pendingInteractionUserQuestionPromptSchema,
|
|
2045
2049
|
shortLabel: pendingInteractionUserQuestionShortLabelSchema.optional(),
|
|
2046
|
-
multiSelect:
|
|
2047
|
-
options:
|
|
2050
|
+
multiSelect: z15.boolean(),
|
|
2051
|
+
options: z15.array(pendingInteractionUserQuestionOptionSchema).max(
|
|
2048
2052
|
USER_QUESTION_MAX_OPTIONS,
|
|
2049
2053
|
`User questions cannot include more than ${USER_QUESTION_MAX_OPTIONS} options`
|
|
2050
2054
|
).optional(),
|
|
2051
|
-
allowFreeText:
|
|
2052
|
-
required:
|
|
2055
|
+
allowFreeText: z15.boolean(),
|
|
2056
|
+
required: z15.boolean().default(true)
|
|
2053
2057
|
}).superRefine((question, context) => {
|
|
2054
2058
|
const optionValues = /* @__PURE__ */ new Set();
|
|
2055
2059
|
question.options?.forEach((option, index) => {
|
|
2056
2060
|
if (optionValues.has(option.value)) {
|
|
2057
2061
|
context.addIssue({
|
|
2058
|
-
code:
|
|
2062
|
+
code: z15.ZodIssueCode.custom,
|
|
2059
2063
|
message: "User question option values must be unique",
|
|
2060
2064
|
path: ["options", index, "value"]
|
|
2061
2065
|
});
|
|
@@ -2070,9 +2074,9 @@ var pendingInteractionUserQuestionQuestionSchema = z14.object({
|
|
|
2070
2074
|
path: ["options"]
|
|
2071
2075
|
}
|
|
2072
2076
|
);
|
|
2073
|
-
var userQuestionPendingInteractionPayloadSchema =
|
|
2074
|
-
kind:
|
|
2075
|
-
questions:
|
|
2077
|
+
var userQuestionPendingInteractionPayloadSchema = z15.object({
|
|
2078
|
+
kind: z15.literal("user_question"),
|
|
2079
|
+
questions: z15.array(pendingInteractionUserQuestionQuestionSchema).min(1).max(
|
|
2076
2080
|
USER_QUESTION_MAX_QUESTIONS,
|
|
2077
2081
|
`User questions cannot include more than ${USER_QUESTION_MAX_QUESTIONS} questions`
|
|
2078
2082
|
)
|
|
@@ -2081,7 +2085,7 @@ var userQuestionPendingInteractionPayloadSchema = z14.object({
|
|
|
2081
2085
|
payload.questions.forEach((question, index) => {
|
|
2082
2086
|
if (questionIds.has(question.id)) {
|
|
2083
2087
|
context.addIssue({
|
|
2084
|
-
code:
|
|
2088
|
+
code: z15.ZodIssueCode.custom,
|
|
2085
2089
|
message: "User question ids must be unique",
|
|
2086
2090
|
path: ["questions", index, "id"]
|
|
2087
2091
|
});
|
|
@@ -2090,25 +2094,25 @@ var userQuestionPendingInteractionPayloadSchema = z14.object({
|
|
|
2090
2094
|
questionIds.add(question.id);
|
|
2091
2095
|
});
|
|
2092
2096
|
});
|
|
2093
|
-
var pluginPendingInteractionPayloadSchema =
|
|
2094
|
-
kind:
|
|
2095
|
-
title:
|
|
2097
|
+
var pluginPendingInteractionPayloadSchema = z15.object({
|
|
2098
|
+
kind: z15.literal("plugin"),
|
|
2099
|
+
title: z15.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
|
|
2096
2100
|
data: jsonValueSchema,
|
|
2097
2101
|
presentation: threadEventItemPresentationSchema.optional()
|
|
2098
2102
|
});
|
|
2099
|
-
var pluginExtensionInteractionRequestPayloadSchema =
|
|
2103
|
+
var pluginExtensionInteractionRequestPayloadSchema = z15.object({
|
|
2100
2104
|
kind: extensionKindSchema,
|
|
2101
|
-
title:
|
|
2105
|
+
title: z15.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH),
|
|
2102
2106
|
data: jsonValueSchema.refine(
|
|
2103
2107
|
(value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
|
|
2104
2108
|
{ message: "Plugin request data exceeds 64 KiB" }
|
|
2105
2109
|
)
|
|
2106
2110
|
});
|
|
2107
|
-
var interactionRequestPayloadSchema =
|
|
2111
|
+
var interactionRequestPayloadSchema = z15.union([
|
|
2108
2112
|
userQuestionPendingInteractionPayloadSchema,
|
|
2109
2113
|
pluginExtensionInteractionRequestPayloadSchema
|
|
2110
2114
|
]);
|
|
2111
|
-
var pendingInteractionPayloadSchema =
|
|
2115
|
+
var pendingInteractionPayloadSchema = z15.union([
|
|
2112
2116
|
approvalPendingInteractionPayloadSchema,
|
|
2113
2117
|
userQuestionPendingInteractionPayloadSchema,
|
|
2114
2118
|
pluginExtensionInteractionRequestPayloadSchema
|
|
@@ -2120,51 +2124,51 @@ function isUserQuestionPendingInteractionPayload(payload) {
|
|
|
2120
2124
|
return payload.kind === "user_question";
|
|
2121
2125
|
}
|
|
2122
2126
|
var approvalDecisionDiscriminatorError = "Invalid discriminator value. Expected 'allow_once' | 'allow_for_session' | 'deny'";
|
|
2123
|
-
var approvalPendingInteractionResolutionSchema =
|
|
2127
|
+
var approvalPendingInteractionResolutionSchema = z15.discriminatedUnion(
|
|
2124
2128
|
"decision",
|
|
2125
2129
|
[
|
|
2126
|
-
|
|
2127
|
-
decision:
|
|
2130
|
+
z15.object({
|
|
2131
|
+
decision: z15.literal("allow_once"),
|
|
2128
2132
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
2129
2133
|
}),
|
|
2130
|
-
|
|
2131
|
-
decision:
|
|
2134
|
+
z15.object({
|
|
2135
|
+
decision: z15.literal("allow_for_session"),
|
|
2132
2136
|
grantedPermissions: pendingInteractionGrantedPermissionProfileSchema.nullable()
|
|
2133
2137
|
}),
|
|
2134
|
-
|
|
2135
|
-
decision:
|
|
2138
|
+
z15.object({
|
|
2139
|
+
decision: z15.literal("deny")
|
|
2136
2140
|
})
|
|
2137
2141
|
],
|
|
2138
2142
|
approvalDecisionDiscriminatorError
|
|
2139
2143
|
);
|
|
2140
|
-
var pendingInteractionUserAnswerSchema =
|
|
2141
|
-
selected:
|
|
2144
|
+
var pendingInteractionUserAnswerSchema = z15.object({
|
|
2145
|
+
selected: z15.array(z15.string().min(1)).max(
|
|
2142
2146
|
USER_QUESTION_MAX_SELECTED,
|
|
2143
2147
|
`User question selected choices cannot exceed ${USER_QUESTION_MAX_SELECTED}`
|
|
2144
2148
|
),
|
|
2145
2149
|
freeText: pendingInteractionUserQuestionFreeTextSchema.optional()
|
|
2146
2150
|
});
|
|
2147
|
-
var userQuestionPendingInteractionResolutionSchema =
|
|
2148
|
-
kind:
|
|
2149
|
-
answers:
|
|
2151
|
+
var userQuestionPendingInteractionResolutionSchema = z15.object({
|
|
2152
|
+
kind: z15.literal("user_answer"),
|
|
2153
|
+
answers: z15.record(z15.string().min(1), pendingInteractionUserAnswerSchema)
|
|
2150
2154
|
});
|
|
2151
|
-
var pluginInteractionDescriptionSchema =
|
|
2152
|
-
title:
|
|
2153
|
-
detail:
|
|
2155
|
+
var pluginInteractionDescriptionSchema = z15.object({
|
|
2156
|
+
title: z15.string().trim().min(1).max(PLUGIN_INTERACTION_MAX_TITLE_LENGTH).optional(),
|
|
2157
|
+
detail: z15.string().trim().min(1).max(THREAD_EVENT_ITEM_PRESENTATION_DETAIL_MAX_LENGTH).optional(),
|
|
2154
2158
|
payload: jsonValueSchema.refine(
|
|
2155
2159
|
(value) => jsonByteLength(value) <= PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES,
|
|
2156
2160
|
{ message: "Plugin interaction description payload exceeds 64 KiB" }
|
|
2157
2161
|
).optional()
|
|
2158
2162
|
});
|
|
2159
|
-
var pluginPendingInteractionResolutionSchema =
|
|
2160
|
-
kind:
|
|
2163
|
+
var pluginPendingInteractionResolutionSchema = z15.object({
|
|
2164
|
+
kind: z15.literal("plugin_submitted"),
|
|
2161
2165
|
description: pluginInteractionDescriptionSchema.optional()
|
|
2162
2166
|
});
|
|
2163
|
-
var pluginExtensionInteractionResolutionSchema =
|
|
2164
|
-
kind:
|
|
2167
|
+
var pluginExtensionInteractionResolutionSchema = z15.object({
|
|
2168
|
+
kind: z15.literal("request_answer"),
|
|
2165
2169
|
value: jsonValueSchema
|
|
2166
2170
|
});
|
|
2167
|
-
var pendingInteractionResolutionSchema =
|
|
2171
|
+
var pendingInteractionResolutionSchema = z15.union(
|
|
2168
2172
|
[
|
|
2169
2173
|
approvalPendingInteractionResolutionSchema,
|
|
2170
2174
|
userQuestionPendingInteractionResolutionSchema,
|
|
@@ -2179,19 +2183,19 @@ function isApprovalPendingInteractionResolution(resolution) {
|
|
|
2179
2183
|
function isUserQuestionPendingInteractionResolution(resolution) {
|
|
2180
2184
|
return "kind" in resolution && resolution.kind === "user_answer";
|
|
2181
2185
|
}
|
|
2182
|
-
var approvalInteractionOutcomeSchema =
|
|
2186
|
+
var approvalInteractionOutcomeSchema = z15.object({
|
|
2183
2187
|
payload: approvalPendingInteractionPayloadSchema,
|
|
2184
2188
|
resolution: approvalPendingInteractionResolutionSchema
|
|
2185
2189
|
});
|
|
2186
|
-
var userQuestionInteractionOutcomeSchema =
|
|
2190
|
+
var userQuestionInteractionOutcomeSchema = z15.object({
|
|
2187
2191
|
payload: userQuestionPendingInteractionPayloadSchema,
|
|
2188
2192
|
resolution: userQuestionPendingInteractionResolutionSchema
|
|
2189
2193
|
});
|
|
2190
|
-
var pluginExtensionInteractionOutcomeSchema =
|
|
2194
|
+
var pluginExtensionInteractionOutcomeSchema = z15.object({
|
|
2191
2195
|
payload: pluginExtensionInteractionRequestPayloadSchema,
|
|
2192
2196
|
resolution: pluginExtensionInteractionResolutionSchema
|
|
2193
2197
|
});
|
|
2194
|
-
var providerInteractionOutcomeSchema =
|
|
2198
|
+
var providerInteractionOutcomeSchema = z15.union([
|
|
2195
2199
|
approvalInteractionOutcomeSchema,
|
|
2196
2200
|
userQuestionInteractionOutcomeSchema,
|
|
2197
2201
|
pluginExtensionInteractionOutcomeSchema
|
|
@@ -2199,39 +2203,39 @@ var providerInteractionOutcomeSchema = z14.union([
|
|
|
2199
2203
|
function isApprovalInteractionOutcome(outcome) {
|
|
2200
2204
|
return outcome.payload.kind === "approval";
|
|
2201
2205
|
}
|
|
2202
|
-
var pendingInteractionProviderOriginSchema =
|
|
2203
|
-
kind:
|
|
2204
|
-
providerId:
|
|
2205
|
-
providerThreadId:
|
|
2206
|
-
providerRequestId:
|
|
2207
|
-
});
|
|
2208
|
-
var pendingInteractionPluginOriginSchema =
|
|
2209
|
-
kind:
|
|
2210
|
-
pluginId:
|
|
2211
|
-
rendererId:
|
|
2212
|
-
});
|
|
2213
|
-
var pendingInteractionCreateSchema =
|
|
2214
|
-
threadId:
|
|
2215
|
-
turnId:
|
|
2216
|
-
providerId:
|
|
2217
|
-
providerThreadId:
|
|
2218
|
-
providerRequestId:
|
|
2206
|
+
var pendingInteractionProviderOriginSchema = z15.object({
|
|
2207
|
+
kind: z15.literal("provider"),
|
|
2208
|
+
providerId: z15.string().min(1),
|
|
2209
|
+
providerThreadId: z15.string().min(1),
|
|
2210
|
+
providerRequestId: z15.string().min(1)
|
|
2211
|
+
});
|
|
2212
|
+
var pendingInteractionPluginOriginSchema = z15.object({
|
|
2213
|
+
kind: z15.literal("plugin"),
|
|
2214
|
+
pluginId: z15.string().min(1),
|
|
2215
|
+
rendererId: z15.string().min(1)
|
|
2216
|
+
});
|
|
2217
|
+
var pendingInteractionCreateSchema = z15.object({
|
|
2218
|
+
threadId: z15.string().min(1),
|
|
2219
|
+
turnId: z15.string().min(1),
|
|
2220
|
+
providerId: z15.string().min(1),
|
|
2221
|
+
providerThreadId: z15.string().min(1),
|
|
2222
|
+
providerRequestId: z15.string().min(1),
|
|
2219
2223
|
payload: pendingInteractionPayloadSchema
|
|
2220
2224
|
});
|
|
2221
|
-
var pendingInteractionBaseSchema =
|
|
2222
|
-
id:
|
|
2223
|
-
threadId:
|
|
2225
|
+
var pendingInteractionBaseSchema = z15.object({
|
|
2226
|
+
id: z15.string().min(1),
|
|
2227
|
+
threadId: z15.string().min(1),
|
|
2224
2228
|
status: pendingInteractionStatusSchema,
|
|
2225
|
-
statusReason:
|
|
2226
|
-
createdAt:
|
|
2227
|
-
expiresAt:
|
|
2228
|
-
resolvedAt:
|
|
2229
|
+
statusReason: z15.string().nullable(),
|
|
2230
|
+
createdAt: z15.number().int().nonnegative(),
|
|
2231
|
+
expiresAt: z15.number().int().nonnegative().nullable().optional(),
|
|
2232
|
+
resolvedAt: z15.number().int().nonnegative().nullable()
|
|
2229
2233
|
});
|
|
2230
2234
|
var providerPendingInteractionBaseSchema = pendingInteractionBaseSchema.extend({
|
|
2231
|
-
turnId:
|
|
2232
|
-
providerId:
|
|
2233
|
-
providerThreadId:
|
|
2234
|
-
providerRequestId:
|
|
2235
|
+
turnId: z15.string().min(1),
|
|
2236
|
+
providerId: z15.string().min(1),
|
|
2237
|
+
providerThreadId: z15.string().min(1),
|
|
2238
|
+
providerRequestId: z15.string().min(1),
|
|
2235
2239
|
origin: pendingInteractionProviderOriginSchema.optional()
|
|
2236
2240
|
});
|
|
2237
2241
|
var approvalPendingInteractionSchema = providerPendingInteractionBaseSchema.extend({
|
|
@@ -2246,30 +2250,30 @@ var pluginExtensionPendingInteractionSchema = providerPendingInteractionBaseSche
|
|
|
2246
2250
|
payload: pluginExtensionInteractionRequestPayloadSchema,
|
|
2247
2251
|
resolution: pluginExtensionInteractionResolutionSchema.nullable()
|
|
2248
2252
|
});
|
|
2249
|
-
var providerPendingInteractionSchema =
|
|
2253
|
+
var providerPendingInteractionSchema = z15.union([
|
|
2250
2254
|
approvalPendingInteractionSchema,
|
|
2251
2255
|
userQuestionPendingInteractionSchema,
|
|
2252
2256
|
pluginExtensionPendingInteractionSchema
|
|
2253
2257
|
]);
|
|
2254
2258
|
var pluginPendingInteractionSchema = pendingInteractionBaseSchema.extend({
|
|
2255
|
-
turnId:
|
|
2259
|
+
turnId: z15.string().min(1).nullable(),
|
|
2256
2260
|
origin: pendingInteractionPluginOriginSchema,
|
|
2257
2261
|
payload: pluginPendingInteractionPayloadSchema,
|
|
2258
2262
|
resolution: pluginPendingInteractionResolutionSchema.nullable()
|
|
2259
2263
|
});
|
|
2260
|
-
var pendingInteractionSchema =
|
|
2264
|
+
var pendingInteractionSchema = z15.union([
|
|
2261
2265
|
providerPendingInteractionSchema,
|
|
2262
2266
|
pluginPendingInteractionSchema
|
|
2263
2267
|
]);
|
|
2264
|
-
var interactionLifecycleRecordBaseSchema =
|
|
2265
|
-
id:
|
|
2268
|
+
var interactionLifecycleRecordBaseSchema = z15.object({
|
|
2269
|
+
id: z15.string().min(1),
|
|
2266
2270
|
status: pendingInteractionStatusSchema,
|
|
2267
|
-
statusReason:
|
|
2271
|
+
statusReason: z15.string().nullable()
|
|
2268
2272
|
});
|
|
2269
|
-
var interactionLifecycleProviderOriginSchema =
|
|
2270
|
-
kind:
|
|
2271
|
-
providerId:
|
|
2272
|
-
providerRequestId:
|
|
2273
|
+
var interactionLifecycleProviderOriginSchema = z15.object({
|
|
2274
|
+
kind: z15.literal("provider"),
|
|
2275
|
+
providerId: z15.string().min(1),
|
|
2276
|
+
providerRequestId: z15.string().min(1)
|
|
2273
2277
|
});
|
|
2274
2278
|
var approvalInteractionLifecycleRecordPayloadSchema = approvalPendingInteractionPayloadSchema.omit({ availableDecisions: true });
|
|
2275
2279
|
var approvalInteractionLifecycleSchema = interactionLifecycleRecordBaseSchema.extend({
|
|
@@ -2294,7 +2298,7 @@ var pluginExtensionInteractionLifecycleSchema = interactionLifecycleRecordBaseSc
|
|
|
2294
2298
|
}),
|
|
2295
2299
|
resolution: pluginExtensionInteractionResolutionSchema.omit({ value: true }).nullable()
|
|
2296
2300
|
});
|
|
2297
|
-
var interactionLifecycleSchema =
|
|
2301
|
+
var interactionLifecycleSchema = z15.union([
|
|
2298
2302
|
approvalInteractionLifecycleSchema,
|
|
2299
2303
|
userQuestionInteractionLifecycleSchema,
|
|
2300
2304
|
pluginInteractionLifecycleSchema,
|
|
@@ -2302,36 +2306,36 @@ var interactionLifecycleSchema = z14.union([
|
|
|
2302
2306
|
]);
|
|
2303
2307
|
|
|
2304
2308
|
// ../domain/src/provider-event.ts
|
|
2305
|
-
import { z as
|
|
2309
|
+
import { z as z20 } from "zod";
|
|
2306
2310
|
|
|
2307
2311
|
// ../domain/src/thread-events.ts
|
|
2308
|
-
import { z as
|
|
2312
|
+
import { z as z16 } from "zod";
|
|
2309
2313
|
var threadTurnInitiatorValues = ["user", "agent", "system"];
|
|
2310
|
-
var threadTurnInitiatorSchema =
|
|
2314
|
+
var threadTurnInitiatorSchema = z16.enum(threadTurnInitiatorValues);
|
|
2311
2315
|
var turnRequestOptionsSchema = recordedThreadExecutionOptionsSchema;
|
|
2312
|
-
var turnRequestTargetSchema =
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
kind:
|
|
2317
|
-
expectedTurnId:
|
|
2316
|
+
var turnRequestTargetSchema = z16.discriminatedUnion("kind", [
|
|
2317
|
+
z16.object({ kind: z16.literal("thread-start") }),
|
|
2318
|
+
z16.object({ kind: z16.literal("new-turn") }),
|
|
2319
|
+
z16.object({
|
|
2320
|
+
kind: z16.literal("auto"),
|
|
2321
|
+
expectedTurnId: z16.string().nullable()
|
|
2318
2322
|
}),
|
|
2319
|
-
|
|
2320
|
-
kind:
|
|
2321
|
-
expectedTurnId:
|
|
2323
|
+
z16.object({
|
|
2324
|
+
kind: z16.literal("steer"),
|
|
2325
|
+
expectedTurnId: z16.string().nullable()
|
|
2322
2326
|
})
|
|
2323
2327
|
]);
|
|
2324
|
-
var clientTurnLifecycleEventDataSchema =
|
|
2325
|
-
direction:
|
|
2326
|
-
source:
|
|
2328
|
+
var clientTurnLifecycleEventDataSchema = z16.object({
|
|
2329
|
+
direction: z16.literal("outbound"),
|
|
2330
|
+
source: z16.enum(["spawn", "tell"]),
|
|
2327
2331
|
initiator: threadTurnInitiatorSchema,
|
|
2328
|
-
request:
|
|
2329
|
-
method:
|
|
2330
|
-
params:
|
|
2332
|
+
request: z16.object({
|
|
2333
|
+
method: z16.enum(["thread/start", "turn/start"]),
|
|
2334
|
+
params: z16.record(z16.string(), z16.unknown())
|
|
2331
2335
|
})
|
|
2332
2336
|
});
|
|
2333
|
-
var turnRequestEventDataSchema =
|
|
2334
|
-
direction:
|
|
2337
|
+
var turnRequestEventDataSchema = z16.object({
|
|
2338
|
+
direction: z16.literal("outbound"),
|
|
2335
2339
|
requestId: clientTurnRequestIdSchema,
|
|
2336
2340
|
// Retry provenance, written only when a `turn.failed` gate's retry row
|
|
2337
2341
|
// dispatches. Both fields are present together or not at all: absence means
|
|
@@ -2341,85 +2345,86 @@ var turnRequestEventDataSchema = z15.object({
|
|
|
2341
2345
|
/** The original request this attempt re-submits, unchanged across attempts. */
|
|
2342
2346
|
retryOfRequestId: clientTurnRequestIdSchema.optional(),
|
|
2343
2347
|
/** Which attempt this is: 2 is the first retry of the original request. */
|
|
2344
|
-
retryAttempt:
|
|
2345
|
-
source:
|
|
2348
|
+
retryAttempt: z16.number().int().min(2).optional(),
|
|
2349
|
+
source: z16.enum(["spawn", "tell"]),
|
|
2346
2350
|
initiator: threadTurnInitiatorSchema,
|
|
2347
|
-
senderThreadId:
|
|
2351
|
+
senderThreadId: z16.string().nullable(),
|
|
2352
|
+
originPluginId: pluginIdSchema.optional(),
|
|
2348
2353
|
systemMessageKind: systemMessageKindSchema.optional(),
|
|
2349
2354
|
systemMessageSubject: systemMessageSubjectSchema.nullable().optional(),
|
|
2350
|
-
input:
|
|
2351
|
-
inputGroups:
|
|
2355
|
+
input: z16.array(promptInputSchema),
|
|
2356
|
+
inputGroups: z16.array(z16.array(promptInputSchema).min(1)).min(1).optional(),
|
|
2352
2357
|
target: turnRequestTargetSchema,
|
|
2353
|
-
request:
|
|
2354
|
-
method:
|
|
2355
|
-
params:
|
|
2358
|
+
request: z16.object({
|
|
2359
|
+
method: z16.enum(["thread/start", "turn/start"]),
|
|
2360
|
+
params: z16.record(z16.string(), z16.unknown())
|
|
2356
2361
|
}),
|
|
2357
2362
|
execution: turnRequestOptionsSchema
|
|
2358
2363
|
});
|
|
2359
|
-
var turnRequestRejectedEventDataSchema =
|
|
2364
|
+
var turnRequestRejectedEventDataSchema = z16.object({
|
|
2360
2365
|
requestId: clientTurnRequestIdSchema,
|
|
2361
|
-
reason:
|
|
2362
|
-
message:
|
|
2366
|
+
reason: z16.string().min(1),
|
|
2367
|
+
message: z16.string().min(1)
|
|
2363
2368
|
});
|
|
2364
|
-
var systemErrorEventDataSchema =
|
|
2365
|
-
code:
|
|
2366
|
-
message:
|
|
2367
|
-
detail:
|
|
2369
|
+
var systemErrorEventDataSchema = z16.object({
|
|
2370
|
+
code: z16.string().optional(),
|
|
2371
|
+
message: z16.string(),
|
|
2372
|
+
detail: z16.string().optional()
|
|
2368
2373
|
});
|
|
2369
2374
|
var ownershipChangeOperationActionValues = [
|
|
2370
2375
|
"assign",
|
|
2371
2376
|
"release",
|
|
2372
2377
|
"transfer"
|
|
2373
2378
|
];
|
|
2374
|
-
var ownershipChangeOperationActionSchema =
|
|
2379
|
+
var ownershipChangeOperationActionSchema = z16.enum(
|
|
2375
2380
|
ownershipChangeOperationActionValues
|
|
2376
2381
|
);
|
|
2377
|
-
var ownershipChangeOperationMetadataSchema =
|
|
2382
|
+
var ownershipChangeOperationMetadataSchema = z16.object({
|
|
2378
2383
|
action: ownershipChangeOperationActionSchema,
|
|
2379
|
-
nextParentThreadId:
|
|
2380
|
-
nextParentThreadTitle:
|
|
2381
|
-
previousParentThreadId:
|
|
2382
|
-
previousParentThreadTitle:
|
|
2383
|
-
});
|
|
2384
|
-
var systemOperationEventDataSchema =
|
|
2385
|
-
operation:
|
|
2386
|
-
status:
|
|
2387
|
-
message:
|
|
2388
|
-
operationId:
|
|
2389
|
-
metadata:
|
|
2390
|
-
});
|
|
2391
|
-
var systemInteractionLifecycleEventDataSchema =
|
|
2384
|
+
nextParentThreadId: z16.string().nullable(),
|
|
2385
|
+
nextParentThreadTitle: z16.string().nullable(),
|
|
2386
|
+
previousParentThreadId: z16.string().nullable(),
|
|
2387
|
+
previousParentThreadTitle: z16.string().nullable()
|
|
2388
|
+
});
|
|
2389
|
+
var systemOperationEventDataSchema = z16.object({
|
|
2390
|
+
operation: z16.string(),
|
|
2391
|
+
status: z16.string(),
|
|
2392
|
+
message: z16.string(),
|
|
2393
|
+
operationId: z16.string(),
|
|
2394
|
+
metadata: z16.record(z16.string(), jsonValueSchema).optional()
|
|
2395
|
+
});
|
|
2396
|
+
var systemInteractionLifecycleEventDataSchema = z16.object({
|
|
2392
2397
|
interaction: interactionLifecycleSchema
|
|
2393
2398
|
});
|
|
2394
|
-
var systemPermissionGrantLifecycleEventDataSchema =
|
|
2395
|
-
interactionId:
|
|
2396
|
-
providerId:
|
|
2397
|
-
providerRequestId:
|
|
2399
|
+
var systemPermissionGrantLifecycleEventDataSchema = z16.object({
|
|
2400
|
+
interactionId: z16.string(),
|
|
2401
|
+
providerId: z16.string(),
|
|
2402
|
+
providerRequestId: z16.string(),
|
|
2398
2403
|
status: pendingInteractionStatusSchema,
|
|
2399
2404
|
resolution: approvalPendingInteractionResolutionSchema.nullable().default(null),
|
|
2400
|
-
statusReason:
|
|
2405
|
+
statusReason: z16.string().nullable().default(null),
|
|
2401
2406
|
subject: pendingInteractionPermissionGrantApprovalSubjectSchema
|
|
2402
2407
|
});
|
|
2403
|
-
var systemUserQuestionLifecycleEventDataSchema =
|
|
2404
|
-
interactionId:
|
|
2405
|
-
providerId:
|
|
2406
|
-
providerRequestId:
|
|
2408
|
+
var systemUserQuestionLifecycleEventDataSchema = z16.object({
|
|
2409
|
+
interactionId: z16.string(),
|
|
2410
|
+
providerId: z16.string(),
|
|
2411
|
+
providerRequestId: z16.string(),
|
|
2407
2412
|
status: pendingInteractionStatusSchema,
|
|
2408
2413
|
resolution: userQuestionPendingInteractionResolutionSchema.nullable().default(null),
|
|
2409
|
-
statusReason:
|
|
2414
|
+
statusReason: z16.string().nullable().default(null),
|
|
2410
2415
|
payload: userQuestionPendingInteractionPayloadSchema
|
|
2411
2416
|
});
|
|
2412
|
-
var systemThreadInterruptedEventDataSchema =
|
|
2417
|
+
var systemThreadInterruptedEventDataSchema = z16.object({
|
|
2413
2418
|
reason: systemThreadInterruptedReasonSchema,
|
|
2414
|
-
cause:
|
|
2419
|
+
cause: z16.literal("host-connection-lost").optional()
|
|
2415
2420
|
});
|
|
2416
|
-
var provisioningTranscriptEntrySchema =
|
|
2417
|
-
type:
|
|
2418
|
-
key:
|
|
2419
|
-
text:
|
|
2420
|
-
startedAt:
|
|
2421
|
-
status:
|
|
2422
|
-
metadata:
|
|
2421
|
+
var provisioningTranscriptEntrySchema = z16.object({
|
|
2422
|
+
type: z16.enum(["step", "output"]),
|
|
2423
|
+
key: z16.string(),
|
|
2424
|
+
text: z16.string(),
|
|
2425
|
+
startedAt: z16.number().optional(),
|
|
2426
|
+
status: z16.enum(["started", "completed", "failed"]).optional(),
|
|
2427
|
+
metadata: z16.record(z16.string(), z16.unknown()).optional()
|
|
2423
2428
|
});
|
|
2424
2429
|
var systemThreadProvisioningStatusValues = [
|
|
2425
2430
|
"active",
|
|
@@ -2427,48 +2432,48 @@ var systemThreadProvisioningStatusValues = [
|
|
|
2427
2432
|
"failed",
|
|
2428
2433
|
"cancelled"
|
|
2429
2434
|
];
|
|
2430
|
-
var systemThreadProvisioningStatusSchema =
|
|
2435
|
+
var systemThreadProvisioningStatusSchema = z16.enum(
|
|
2431
2436
|
systemThreadProvisioningStatusValues
|
|
2432
2437
|
);
|
|
2433
|
-
var systemThreadProvisioningEventDataSchema =
|
|
2434
|
-
provisioningId:
|
|
2438
|
+
var systemThreadProvisioningEventDataSchema = z16.object({
|
|
2439
|
+
provisioningId: z16.string(),
|
|
2435
2440
|
status: systemThreadProvisioningStatusSchema,
|
|
2436
|
-
environmentId:
|
|
2437
|
-
entries:
|
|
2438
|
-
});
|
|
2439
|
-
var systemLegacyUserMessageEventDataSchema =
|
|
2440
|
-
text:
|
|
2441
|
-
toolCallId:
|
|
2442
|
-
turnId:
|
|
2443
|
-
});
|
|
2444
|
-
var systemProviderTurnWatchdogEventDataSchema =
|
|
2445
|
-
reason:
|
|
2446
|
-
thresholdMs:
|
|
2447
|
-
elapsedMs:
|
|
2448
|
-
activeTurnId:
|
|
2449
|
-
activeTurnStartedAt:
|
|
2450
|
-
lastActivityEventSequence:
|
|
2451
|
-
lastActivityEventType:
|
|
2452
|
-
lastActivityEventAt:
|
|
2453
|
-
providerId:
|
|
2454
|
-
providerThreadId:
|
|
2455
|
-
firedAt:
|
|
2441
|
+
environmentId: z16.string().nullable(),
|
|
2442
|
+
entries: z16.array(provisioningTranscriptEntrySchema)
|
|
2443
|
+
});
|
|
2444
|
+
var systemLegacyUserMessageEventDataSchema = z16.object({
|
|
2445
|
+
text: z16.string(),
|
|
2446
|
+
toolCallId: z16.string().optional(),
|
|
2447
|
+
turnId: z16.string().optional()
|
|
2448
|
+
});
|
|
2449
|
+
var systemProviderTurnWatchdogEventDataSchema = z16.object({
|
|
2450
|
+
reason: z16.literal("provider-turn-idle"),
|
|
2451
|
+
thresholdMs: z16.number().int().positive(),
|
|
2452
|
+
elapsedMs: z16.number().int().nonnegative(),
|
|
2453
|
+
activeTurnId: z16.string().min(1),
|
|
2454
|
+
activeTurnStartedAt: z16.number().int().nonnegative(),
|
|
2455
|
+
lastActivityEventSequence: z16.number().int().positive(),
|
|
2456
|
+
lastActivityEventType: z16.string().min(1),
|
|
2457
|
+
lastActivityEventAt: z16.number().int().nonnegative(),
|
|
2458
|
+
providerId: z16.string().min(1),
|
|
2459
|
+
providerThreadId: z16.string().min(1).nullable(),
|
|
2460
|
+
firedAt: z16.number().int().nonnegative()
|
|
2456
2461
|
});
|
|
2457
2462
|
|
|
2458
2463
|
// ../domain/src/thread-event-scope.ts
|
|
2459
|
-
import { z as
|
|
2464
|
+
import { z as z17 } from "zod";
|
|
2460
2465
|
var threadEventScopeKindValues = ["thread", "turn"];
|
|
2461
|
-
var threadEventScopeKindSchema =
|
|
2462
|
-
var threadEventScopeSchema =
|
|
2463
|
-
|
|
2464
|
-
|
|
2466
|
+
var threadEventScopeKindSchema = z17.enum(threadEventScopeKindValues);
|
|
2467
|
+
var threadEventScopeSchema = z17.discriminatedUnion("kind", [
|
|
2468
|
+
z17.object({ kind: z17.literal("thread") }),
|
|
2469
|
+
z17.object({ kind: z17.literal("turn"), turnId: z17.string().min(1) })
|
|
2465
2470
|
]);
|
|
2466
2471
|
var threadEventScopePolicyValues = [
|
|
2467
2472
|
"thread",
|
|
2468
2473
|
"turn",
|
|
2469
2474
|
"thread-or-turn"
|
|
2470
2475
|
];
|
|
2471
|
-
var threadEventScopePolicySchema =
|
|
2476
|
+
var threadEventScopePolicySchema = z17.enum(threadEventScopePolicyValues);
|
|
2472
2477
|
var threadEventScopeDefinitionByType = {
|
|
2473
2478
|
"thread/started": {
|
|
2474
2479
|
policy: "thread",
|
|
@@ -2635,8 +2640,8 @@ function validateThreadEventScope(args) {
|
|
|
2635
2640
|
}
|
|
2636
2641
|
|
|
2637
2642
|
// ../domain/src/thread-timeline-goal.ts
|
|
2638
|
-
import { z as
|
|
2639
|
-
var threadTimelineGoalStatusSchema =
|
|
2643
|
+
import { z as z18 } from "zod";
|
|
2644
|
+
var threadTimelineGoalStatusSchema = z18.enum([
|
|
2640
2645
|
"active",
|
|
2641
2646
|
"paused",
|
|
2642
2647
|
"blocked",
|
|
@@ -2644,32 +2649,32 @@ var threadTimelineGoalStatusSchema = z17.enum([
|
|
|
2644
2649
|
"budgetLimited",
|
|
2645
2650
|
"complete"
|
|
2646
2651
|
]);
|
|
2647
|
-
var threadTimelineGoalSchema =
|
|
2648
|
-
sourceSeq:
|
|
2649
|
-
updatedAt:
|
|
2650
|
-
objective:
|
|
2652
|
+
var threadTimelineGoalSchema = z18.object({
|
|
2653
|
+
sourceSeq: z18.number().int().nonnegative(),
|
|
2654
|
+
updatedAt: z18.number(),
|
|
2655
|
+
objective: z18.string(),
|
|
2651
2656
|
status: threadTimelineGoalStatusSchema,
|
|
2652
|
-
tokenBudget:
|
|
2653
|
-
tokensUsed:
|
|
2654
|
-
timeUsedSeconds:
|
|
2657
|
+
tokenBudget: z18.number().nullable(),
|
|
2658
|
+
tokensUsed: z18.number(),
|
|
2659
|
+
timeUsedSeconds: z18.number()
|
|
2655
2660
|
});
|
|
2656
2661
|
|
|
2657
2662
|
// ../domain/src/thread-usage-cost.ts
|
|
2658
|
-
import { z as
|
|
2659
|
-
var threadUsageCostSchema =
|
|
2660
|
-
amount:
|
|
2661
|
-
currency:
|
|
2663
|
+
import { z as z19 } from "zod";
|
|
2664
|
+
var threadUsageCostSchema = z19.object({
|
|
2665
|
+
amount: z19.number().nonnegative(),
|
|
2666
|
+
currency: z19.string().min(1)
|
|
2662
2667
|
});
|
|
2663
2668
|
|
|
2664
2669
|
// ../domain/src/provider-event.ts
|
|
2665
|
-
var threadEventItemStatusSchema =
|
|
2670
|
+
var threadEventItemStatusSchema = z20.enum([
|
|
2666
2671
|
"pending",
|
|
2667
2672
|
"completed",
|
|
2668
2673
|
"failed",
|
|
2669
2674
|
"interrupted"
|
|
2670
2675
|
]);
|
|
2671
|
-
var threadEventItemApprovalStatusSchema =
|
|
2672
|
-
var threadEventTurnStatusSchema =
|
|
2676
|
+
var threadEventItemApprovalStatusSchema = z20.enum(["waiting_for_approval", "denied"]).nullable();
|
|
2677
|
+
var threadEventTurnStatusSchema = z20.enum([
|
|
2673
2678
|
"completed",
|
|
2674
2679
|
"failed",
|
|
2675
2680
|
"interrupted"
|
|
@@ -2695,267 +2700,267 @@ var providerErrorCategoryValues = [
|
|
|
2695
2700
|
"unauthorized",
|
|
2696
2701
|
"unknown"
|
|
2697
2702
|
];
|
|
2698
|
-
var providerErrorCategorySchema =
|
|
2699
|
-
var providerErrorInfoSchema =
|
|
2703
|
+
var providerErrorCategorySchema = z20.enum(providerErrorCategoryValues);
|
|
2704
|
+
var providerErrorInfoSchema = z20.object({
|
|
2700
2705
|
category: providerErrorCategorySchema,
|
|
2701
|
-
providerCode:
|
|
2702
|
-
httpStatusCode:
|
|
2706
|
+
providerCode: z20.string().nullable(),
|
|
2707
|
+
httpStatusCode: z20.number().nullable()
|
|
2703
2708
|
});
|
|
2704
|
-
var providerRateLimitStatusSchema =
|
|
2709
|
+
var providerRateLimitStatusSchema = z20.enum([
|
|
2705
2710
|
"allowed",
|
|
2706
2711
|
"warning",
|
|
2707
2712
|
"blocked",
|
|
2708
2713
|
"unknown"
|
|
2709
2714
|
]);
|
|
2710
|
-
var providerRateLimitWindowSchema =
|
|
2711
|
-
providerKey:
|
|
2712
|
-
label:
|
|
2715
|
+
var providerRateLimitWindowSchema = z20.object({
|
|
2716
|
+
providerKey: z20.string().min(1).nullable(),
|
|
2717
|
+
label: z20.string().min(1).nullable(),
|
|
2713
2718
|
status: providerRateLimitStatusSchema,
|
|
2714
|
-
resetsAtMs:
|
|
2719
|
+
resetsAtMs: z20.number().int().nonnegative().nullable()
|
|
2715
2720
|
});
|
|
2716
|
-
var providerRateLimitStateSchema =
|
|
2717
|
-
providerId:
|
|
2721
|
+
var providerRateLimitStateSchema = z20.object({
|
|
2722
|
+
providerId: z20.string().min(1),
|
|
2718
2723
|
status: providerRateLimitStatusSchema,
|
|
2719
|
-
kind:
|
|
2720
|
-
windows:
|
|
2721
|
-
reachedReason:
|
|
2722
|
-
overageStatus:
|
|
2723
|
-
overageReason:
|
|
2724
|
-
});
|
|
2725
|
-
var threadEventFileChangeKindSchema =
|
|
2726
|
-
var threadEventFileChangeSchema =
|
|
2727
|
-
path:
|
|
2724
|
+
kind: z20.enum(["subscription-window", "credits", "spend-control", "unknown"]),
|
|
2725
|
+
windows: z20.array(providerRateLimitWindowSchema),
|
|
2726
|
+
reachedReason: z20.string().min(1).nullable(),
|
|
2727
|
+
overageStatus: z20.enum(["allowed", "warning", "rejected", "unavailable"]).nullable(),
|
|
2728
|
+
overageReason: z20.string().min(1).nullable()
|
|
2729
|
+
});
|
|
2730
|
+
var threadEventFileChangeKindSchema = z20.enum(["add", "delete", "update"]);
|
|
2731
|
+
var threadEventFileChangeSchema = z20.object({
|
|
2732
|
+
path: z20.string(),
|
|
2728
2733
|
kind: threadEventFileChangeKindSchema,
|
|
2729
|
-
movePath:
|
|
2730
|
-
diff:
|
|
2734
|
+
movePath: z20.string().optional(),
|
|
2735
|
+
diff: z20.string().optional()
|
|
2731
2736
|
});
|
|
2732
|
-
var threadEventPlanStepStatusSchema =
|
|
2737
|
+
var threadEventPlanStepStatusSchema = z20.enum([
|
|
2733
2738
|
"pending",
|
|
2734
2739
|
"active",
|
|
2735
2740
|
"completed",
|
|
2736
2741
|
"failed"
|
|
2737
2742
|
]);
|
|
2738
|
-
var threadEventPlanStepSchema =
|
|
2739
|
-
step:
|
|
2743
|
+
var threadEventPlanStepSchema = z20.object({
|
|
2744
|
+
step: z20.string(),
|
|
2740
2745
|
status: threadEventPlanStepStatusSchema.optional()
|
|
2741
2746
|
});
|
|
2742
2747
|
var itemPresentationField = {
|
|
2743
2748
|
presentation: threadEventItemPresentationSchema.optional()
|
|
2744
2749
|
};
|
|
2745
|
-
var threadEventWebSearchItemSchema =
|
|
2746
|
-
type:
|
|
2747
|
-
id:
|
|
2748
|
-
queries:
|
|
2749
|
-
resultText:
|
|
2750
|
+
var threadEventWebSearchItemSchema = z20.object({
|
|
2751
|
+
type: z20.literal("webSearch"),
|
|
2752
|
+
id: z20.string(),
|
|
2753
|
+
queries: z20.array(z20.string()).min(1),
|
|
2754
|
+
resultText: z20.string().nullable(),
|
|
2750
2755
|
...itemPresentationField,
|
|
2751
|
-
parentToolCallId:
|
|
2752
|
-
});
|
|
2753
|
-
var threadEventWebFetchItemSchema =
|
|
2754
|
-
type:
|
|
2755
|
-
id:
|
|
2756
|
-
url:
|
|
2757
|
-
prompt:
|
|
2758
|
-
pattern:
|
|
2759
|
-
resultText:
|
|
2756
|
+
parentToolCallId: z20.string().optional()
|
|
2757
|
+
});
|
|
2758
|
+
var threadEventWebFetchItemSchema = z20.object({
|
|
2759
|
+
type: z20.literal("webFetch"),
|
|
2760
|
+
id: z20.string(),
|
|
2761
|
+
url: z20.string(),
|
|
2762
|
+
prompt: z20.string().nullable(),
|
|
2763
|
+
pattern: z20.string().nullable(),
|
|
2764
|
+
resultText: z20.string().nullable(),
|
|
2760
2765
|
...itemPresentationField,
|
|
2761
|
-
parentToolCallId:
|
|
2766
|
+
parentToolCallId: z20.string().optional()
|
|
2762
2767
|
});
|
|
2763
|
-
var threadEventImageViewItemSchema =
|
|
2764
|
-
type:
|
|
2765
|
-
id:
|
|
2766
|
-
path:
|
|
2768
|
+
var threadEventImageViewItemSchema = z20.object({
|
|
2769
|
+
type: z20.literal("imageView"),
|
|
2770
|
+
id: z20.string(),
|
|
2771
|
+
path: z20.string(),
|
|
2767
2772
|
...itemPresentationField,
|
|
2768
|
-
parentToolCallId:
|
|
2773
|
+
parentToolCallId: z20.string().optional()
|
|
2769
2774
|
});
|
|
2770
|
-
var threadEventFileReadItemSchema =
|
|
2771
|
-
type:
|
|
2772
|
-
id:
|
|
2773
|
-
path:
|
|
2774
|
-
cmd:
|
|
2775
|
+
var threadEventFileReadItemSchema = z20.object({
|
|
2776
|
+
type: z20.literal("fileRead"),
|
|
2777
|
+
id: z20.string(),
|
|
2778
|
+
path: z20.string(),
|
|
2779
|
+
cmd: z20.string().optional(),
|
|
2775
2780
|
status: threadEventItemStatusSchema,
|
|
2776
2781
|
...itemPresentationField,
|
|
2777
|
-
parentToolCallId:
|
|
2782
|
+
parentToolCallId: z20.string().optional()
|
|
2778
2783
|
});
|
|
2779
|
-
var threadEventSearchModeSchema =
|
|
2780
|
-
var threadEventSearchItemSchema =
|
|
2781
|
-
type:
|
|
2782
|
-
id:
|
|
2784
|
+
var threadEventSearchModeSchema = z20.enum(["content", "path", "list"]);
|
|
2785
|
+
var threadEventSearchItemSchema = z20.object({
|
|
2786
|
+
type: z20.literal("search"),
|
|
2787
|
+
id: z20.string(),
|
|
2783
2788
|
mode: threadEventSearchModeSchema,
|
|
2784
|
-
query:
|
|
2785
|
-
path:
|
|
2786
|
-
cmd:
|
|
2789
|
+
query: z20.string(),
|
|
2790
|
+
path: z20.string().optional(),
|
|
2791
|
+
cmd: z20.string().optional(),
|
|
2787
2792
|
status: threadEventItemStatusSchema,
|
|
2788
2793
|
...itemPresentationField,
|
|
2789
|
-
parentToolCallId:
|
|
2794
|
+
parentToolCallId: z20.string().optional()
|
|
2790
2795
|
});
|
|
2791
|
-
var threadEventDelegationItemSchema =
|
|
2792
|
-
type:
|
|
2793
|
-
id:
|
|
2794
|
-
childRef:
|
|
2795
|
-
label:
|
|
2796
|
+
var threadEventDelegationItemSchema = z20.object({
|
|
2797
|
+
type: z20.literal("delegation"),
|
|
2798
|
+
id: z20.string(),
|
|
2799
|
+
childRef: z20.string().min(1),
|
|
2800
|
+
label: z20.string(),
|
|
2796
2801
|
status: threadEventItemStatusSchema,
|
|
2797
|
-
background:
|
|
2798
|
-
summary:
|
|
2802
|
+
background: z20.boolean(),
|
|
2803
|
+
summary: z20.string().optional(),
|
|
2799
2804
|
...itemPresentationField,
|
|
2800
|
-
parentToolCallId:
|
|
2805
|
+
parentToolCallId: z20.string().optional()
|
|
2801
2806
|
});
|
|
2802
|
-
var threadEventPlanStepsItemSchema =
|
|
2803
|
-
type:
|
|
2804
|
-
id:
|
|
2805
|
-
steps:
|
|
2806
|
-
explanation:
|
|
2807
|
+
var threadEventPlanStepsItemSchema = z20.object({
|
|
2808
|
+
type: z20.literal("planSteps"),
|
|
2809
|
+
id: z20.string(),
|
|
2810
|
+
steps: z20.array(threadEventPlanStepSchema),
|
|
2811
|
+
explanation: z20.string().optional(),
|
|
2807
2812
|
status: threadEventItemStatusSchema,
|
|
2808
2813
|
...itemPresentationField,
|
|
2809
|
-
parentToolCallId:
|
|
2814
|
+
parentToolCallId: z20.string().optional()
|
|
2810
2815
|
});
|
|
2811
|
-
var threadEventExtensionItemSchema =
|
|
2812
|
-
type:
|
|
2813
|
-
id:
|
|
2816
|
+
var threadEventExtensionItemSchema = z20.object({
|
|
2817
|
+
type: z20.literal("extension"),
|
|
2818
|
+
id: z20.string(),
|
|
2814
2819
|
kind: extensionKindSchema,
|
|
2815
2820
|
payload: jsonValueSchema,
|
|
2816
2821
|
status: threadEventItemStatusSchema,
|
|
2817
2822
|
presentation: threadEventItemPresentationSchema,
|
|
2818
|
-
parentToolCallId:
|
|
2823
|
+
parentToolCallId: z20.string().optional()
|
|
2819
2824
|
});
|
|
2820
|
-
var threadEventTextTruncationSchema =
|
|
2821
|
-
originalLength:
|
|
2822
|
-
retainedHeadLength:
|
|
2823
|
-
retainedTailLength:
|
|
2824
|
-
truncatedAt:
|
|
2825
|
+
var threadEventTextTruncationSchema = z20.object({
|
|
2826
|
+
originalLength: z20.number(),
|
|
2827
|
+
retainedHeadLength: z20.number(),
|
|
2828
|
+
retainedTailLength: z20.number(),
|
|
2829
|
+
truncatedAt: z20.number()
|
|
2825
2830
|
});
|
|
2826
|
-
var threadEventItemTruncationSchema =
|
|
2831
|
+
var threadEventItemTruncationSchema = z20.object({
|
|
2827
2832
|
aggregatedOutput: threadEventTextTruncationSchema.optional(),
|
|
2828
2833
|
result: threadEventTextTruncationSchema.optional(),
|
|
2829
2834
|
resultText: threadEventTextTruncationSchema.optional()
|
|
2830
2835
|
});
|
|
2831
|
-
var threadEventImageGenerationItemSchema =
|
|
2832
|
-
type:
|
|
2833
|
-
id:
|
|
2836
|
+
var threadEventImageGenerationItemSchema = z20.object({
|
|
2837
|
+
type: z20.literal("imageGeneration"),
|
|
2838
|
+
id: z20.string(),
|
|
2834
2839
|
status: threadEventItemStatusSchema,
|
|
2835
|
-
prompt:
|
|
2836
|
-
path:
|
|
2837
|
-
result:
|
|
2838
|
-
error:
|
|
2839
|
-
transparentBackground:
|
|
2840
|
+
prompt: z20.string().nullable(),
|
|
2841
|
+
path: z20.string().nullable(),
|
|
2842
|
+
result: z20.string().optional(),
|
|
2843
|
+
error: z20.string().nullable(),
|
|
2844
|
+
transparentBackground: z20.boolean(),
|
|
2840
2845
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
2841
2846
|
...itemPresentationField,
|
|
2842
|
-
parentToolCallId:
|
|
2847
|
+
parentToolCallId: z20.string().optional()
|
|
2843
2848
|
});
|
|
2844
|
-
var threadEventUserContentSchema =
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
+
var threadEventUserContentSchema = z20.discriminatedUnion("type", [
|
|
2850
|
+
z20.object({ type: z20.literal("text"), text: z20.string() }),
|
|
2851
|
+
z20.object({ type: z20.literal("image"), url: z20.string() }),
|
|
2852
|
+
z20.object({ type: z20.literal("localImage"), path: z20.string() }),
|
|
2853
|
+
z20.object({ type: z20.literal("localFile"), path: z20.string() })
|
|
2849
2854
|
]);
|
|
2850
|
-
var threadEventTokenUsageBreakdownSchema =
|
|
2851
|
-
totalTokens:
|
|
2852
|
-
inputTokens:
|
|
2853
|
-
cachedInputTokens:
|
|
2854
|
-
cacheReadInputTokens:
|
|
2855
|
-
cacheWriteInputTokens:
|
|
2856
|
-
outputTokens:
|
|
2857
|
-
reasoningOutputTokens:
|
|
2858
|
-
});
|
|
2859
|
-
var threadEventContextWindowUsageSchema =
|
|
2855
|
+
var threadEventTokenUsageBreakdownSchema = z20.object({
|
|
2856
|
+
totalTokens: z20.number(),
|
|
2857
|
+
inputTokens: z20.number(),
|
|
2858
|
+
cachedInputTokens: z20.number(),
|
|
2859
|
+
cacheReadInputTokens: z20.number().nonnegative().optional(),
|
|
2860
|
+
cacheWriteInputTokens: z20.number().nonnegative().optional(),
|
|
2861
|
+
outputTokens: z20.number(),
|
|
2862
|
+
reasoningOutputTokens: z20.number()
|
|
2863
|
+
});
|
|
2864
|
+
var threadEventContextWindowUsageSchema = z20.object({
|
|
2860
2865
|
snapshot: contextSnapshotSchema.optional(),
|
|
2861
|
-
usedTokens:
|
|
2862
|
-
modelContextWindow:
|
|
2863
|
-
estimated:
|
|
2866
|
+
usedTokens: z20.number().nullable(),
|
|
2867
|
+
modelContextWindow: z20.number().nullable(),
|
|
2868
|
+
estimated: z20.boolean(),
|
|
2864
2869
|
cost: threadUsageCostSchema.optional()
|
|
2865
2870
|
});
|
|
2866
|
-
var promptCacheTtlMsSchema =
|
|
2867
|
-
var threadEventTokenUsageSchema =
|
|
2871
|
+
var promptCacheTtlMsSchema = z20.number().int().positive();
|
|
2872
|
+
var threadEventTokenUsageSchema = z20.object({
|
|
2868
2873
|
total: threadEventTokenUsageBreakdownSchema,
|
|
2869
2874
|
last: threadEventTokenUsageBreakdownSchema,
|
|
2870
|
-
modelContextWindow:
|
|
2875
|
+
modelContextWindow: z20.number().nullable(),
|
|
2871
2876
|
promptCacheTtlMs: promptCacheTtlMsSchema.optional()
|
|
2872
2877
|
});
|
|
2873
|
-
var threadEventWarningCategorySchema =
|
|
2878
|
+
var threadEventWarningCategorySchema = z20.enum([
|
|
2874
2879
|
"deprecation",
|
|
2875
2880
|
"config",
|
|
2876
2881
|
"general",
|
|
2877
2882
|
"compaction-skipped"
|
|
2878
2883
|
]);
|
|
2879
|
-
var providerRawEventSchema =
|
|
2880
|
-
jsonrpc:
|
|
2881
|
-
id:
|
|
2882
|
-
method:
|
|
2884
|
+
var providerRawEventSchema = z20.object({
|
|
2885
|
+
jsonrpc: z20.literal("2.0"),
|
|
2886
|
+
id: z20.union([z20.string(), z20.number()]).optional(),
|
|
2887
|
+
method: z20.string(),
|
|
2883
2888
|
params: jsonValueSchema.optional()
|
|
2884
2889
|
});
|
|
2885
|
-
var providerUnhandledEventSchema =
|
|
2886
|
-
type:
|
|
2887
|
-
threadId:
|
|
2888
|
-
providerThreadId:
|
|
2889
|
-
providerId:
|
|
2890
|
-
rawType:
|
|
2890
|
+
var providerUnhandledEventSchema = z20.object({
|
|
2891
|
+
type: z20.literal("provider/unhandled"),
|
|
2892
|
+
threadId: z20.string(),
|
|
2893
|
+
providerThreadId: z20.string(),
|
|
2894
|
+
providerId: z20.string(),
|
|
2895
|
+
rawType: z20.string(),
|
|
2891
2896
|
rawEvent: providerRawEventSchema,
|
|
2892
|
-
parentToolCallId:
|
|
2893
|
-
});
|
|
2894
|
-
var toolCallProgressEventSchema =
|
|
2895
|
-
type:
|
|
2896
|
-
threadId:
|
|
2897
|
-
providerThreadId:
|
|
2898
|
-
itemId:
|
|
2899
|
-
message:
|
|
2900
|
-
parentToolCallId:
|
|
2901
|
-
});
|
|
2902
|
-
var threadEventBackgroundTaskItemSchema =
|
|
2903
|
-
type:
|
|
2904
|
-
id:
|
|
2905
|
-
familyId:
|
|
2906
|
-
taskType:
|
|
2907
|
-
description:
|
|
2897
|
+
parentToolCallId: z20.string().optional()
|
|
2898
|
+
});
|
|
2899
|
+
var toolCallProgressEventSchema = z20.object({
|
|
2900
|
+
type: z20.literal("item/toolCall/progress"),
|
|
2901
|
+
threadId: z20.string(),
|
|
2902
|
+
providerThreadId: z20.string(),
|
|
2903
|
+
itemId: z20.string(),
|
|
2904
|
+
message: z20.string().optional(),
|
|
2905
|
+
parentToolCallId: z20.string().optional()
|
|
2906
|
+
});
|
|
2907
|
+
var threadEventBackgroundTaskItemSchema = z20.object({
|
|
2908
|
+
type: z20.literal("backgroundTask"),
|
|
2909
|
+
id: z20.string(),
|
|
2910
|
+
familyId: z20.string().optional(),
|
|
2911
|
+
taskType: z20.string(),
|
|
2912
|
+
description: z20.string(),
|
|
2908
2913
|
status: threadEventItemStatusSchema,
|
|
2909
2914
|
taskStatus: backgroundTaskStatusSchema,
|
|
2910
|
-
skipTranscript:
|
|
2911
|
-
foreground:
|
|
2912
|
-
workflowName:
|
|
2915
|
+
skipTranscript: z20.boolean(),
|
|
2916
|
+
foreground: z20.boolean(),
|
|
2917
|
+
workflowName: z20.string().optional(),
|
|
2913
2918
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
2914
2919
|
usage: backgroundTaskUsageSchema.optional(),
|
|
2915
|
-
summary:
|
|
2916
|
-
error:
|
|
2917
|
-
outputFile:
|
|
2920
|
+
summary: z20.string().optional(),
|
|
2921
|
+
error: z20.string().optional(),
|
|
2922
|
+
outputFile: z20.string().optional(),
|
|
2918
2923
|
...itemPresentationField,
|
|
2919
|
-
parentToolCallId:
|
|
2924
|
+
parentToolCallId: z20.string().optional()
|
|
2920
2925
|
});
|
|
2921
|
-
var threadEventItemSchema =
|
|
2922
|
-
|
|
2923
|
-
type:
|
|
2924
|
-
id:
|
|
2925
|
-
content:
|
|
2926
|
+
var threadEventItemSchema = z20.discriminatedUnion("type", [
|
|
2927
|
+
z20.object({
|
|
2928
|
+
type: z20.literal("userMessage"),
|
|
2929
|
+
id: z20.string(),
|
|
2930
|
+
content: z20.array(threadEventUserContentSchema),
|
|
2926
2931
|
clientRequestId: clientTurnRequestIdSchema.optional(),
|
|
2927
|
-
parentToolCallId:
|
|
2932
|
+
parentToolCallId: z20.string().optional()
|
|
2928
2933
|
}).strict(),
|
|
2929
|
-
|
|
2930
|
-
type:
|
|
2931
|
-
id:
|
|
2932
|
-
text:
|
|
2934
|
+
z20.object({
|
|
2935
|
+
type: z20.literal("agentMessage"),
|
|
2936
|
+
id: z20.string(),
|
|
2937
|
+
text: z20.string(),
|
|
2933
2938
|
...itemPresentationField,
|
|
2934
|
-
parentToolCallId:
|
|
2939
|
+
parentToolCallId: z20.string().optional()
|
|
2935
2940
|
}),
|
|
2936
|
-
|
|
2937
|
-
type:
|
|
2938
|
-
id:
|
|
2939
|
-
command:
|
|
2940
|
-
cwd:
|
|
2941
|
+
z20.object({
|
|
2942
|
+
type: z20.literal("commandExecution"),
|
|
2943
|
+
id: z20.string(),
|
|
2944
|
+
command: z20.string(),
|
|
2945
|
+
cwd: z20.string(),
|
|
2941
2946
|
status: threadEventItemStatusSchema,
|
|
2942
2947
|
approvalStatus: threadEventItemApprovalStatusSchema,
|
|
2943
|
-
aggregatedOutput:
|
|
2944
|
-
exitCode:
|
|
2945
|
-
durationMs:
|
|
2948
|
+
aggregatedOutput: z20.string().optional(),
|
|
2949
|
+
exitCode: z20.number().optional(),
|
|
2950
|
+
durationMs: z20.number().optional(),
|
|
2946
2951
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
2947
2952
|
...itemPresentationField,
|
|
2948
|
-
parentToolCallId:
|
|
2953
|
+
parentToolCallId: z20.string().optional()
|
|
2949
2954
|
}),
|
|
2950
|
-
|
|
2951
|
-
type:
|
|
2952
|
-
id:
|
|
2953
|
-
changes:
|
|
2955
|
+
z20.object({
|
|
2956
|
+
type: z20.literal("fileChange"),
|
|
2957
|
+
id: z20.string(),
|
|
2958
|
+
changes: z20.array(threadEventFileChangeSchema),
|
|
2954
2959
|
status: threadEventItemStatusSchema,
|
|
2955
2960
|
approvalStatus: threadEventItemApprovalStatusSchema,
|
|
2956
|
-
error:
|
|
2961
|
+
error: z20.string().optional(),
|
|
2957
2962
|
...itemPresentationField,
|
|
2958
|
-
parentToolCallId:
|
|
2963
|
+
parentToolCallId: z20.string().optional()
|
|
2959
2964
|
}),
|
|
2960
2965
|
threadEventWebSearchItemSchema,
|
|
2961
2966
|
threadEventWebFetchItemSchema,
|
|
@@ -2963,345 +2968,345 @@ var threadEventItemSchema = z19.discriminatedUnion("type", [
|
|
|
2963
2968
|
threadEventImageGenerationItemSchema,
|
|
2964
2969
|
threadEventFileReadItemSchema,
|
|
2965
2970
|
threadEventSearchItemSchema,
|
|
2966
|
-
|
|
2967
|
-
type:
|
|
2968
|
-
id:
|
|
2969
|
-
server:
|
|
2970
|
-
tool:
|
|
2971
|
-
arguments:
|
|
2971
|
+
z20.object({
|
|
2972
|
+
type: z20.literal("toolCall"),
|
|
2973
|
+
id: z20.string(),
|
|
2974
|
+
server: z20.string().optional(),
|
|
2975
|
+
tool: z20.string(),
|
|
2976
|
+
arguments: z20.record(z20.string(), z20.unknown()).optional(),
|
|
2972
2977
|
status: threadEventItemStatusSchema,
|
|
2973
|
-
result:
|
|
2974
|
-
error:
|
|
2975
|
-
durationMs:
|
|
2978
|
+
result: z20.unknown().optional(),
|
|
2979
|
+
error: z20.string().optional(),
|
|
2980
|
+
durationMs: z20.number().optional(),
|
|
2976
2981
|
truncation: threadEventItemTruncationSchema.optional(),
|
|
2977
2982
|
...itemPresentationField,
|
|
2978
|
-
parentToolCallId:
|
|
2983
|
+
parentToolCallId: z20.string().optional()
|
|
2979
2984
|
}),
|
|
2980
|
-
|
|
2981
|
-
type:
|
|
2982
|
-
id:
|
|
2983
|
-
summary:
|
|
2984
|
-
content:
|
|
2985
|
+
z20.object({
|
|
2986
|
+
type: z20.literal("reasoning"),
|
|
2987
|
+
id: z20.string(),
|
|
2988
|
+
summary: z20.array(z20.string()),
|
|
2989
|
+
content: z20.array(z20.string()),
|
|
2985
2990
|
...itemPresentationField,
|
|
2986
|
-
parentToolCallId:
|
|
2991
|
+
parentToolCallId: z20.string().optional()
|
|
2987
2992
|
}),
|
|
2988
|
-
|
|
2989
|
-
type:
|
|
2990
|
-
id:
|
|
2991
|
-
text:
|
|
2993
|
+
z20.object({
|
|
2994
|
+
type: z20.literal("plan"),
|
|
2995
|
+
id: z20.string(),
|
|
2996
|
+
text: z20.string(),
|
|
2992
2997
|
...itemPresentationField,
|
|
2993
|
-
parentToolCallId:
|
|
2998
|
+
parentToolCallId: z20.string().optional()
|
|
2994
2999
|
}),
|
|
2995
3000
|
threadEventPlanStepsItemSchema,
|
|
2996
|
-
|
|
2997
|
-
type:
|
|
2998
|
-
id:
|
|
3001
|
+
z20.object({
|
|
3002
|
+
type: z20.literal("contextCompaction"),
|
|
3003
|
+
id: z20.string(),
|
|
2999
3004
|
...itemPresentationField,
|
|
3000
|
-
parentToolCallId:
|
|
3005
|
+
parentToolCallId: z20.string().optional()
|
|
3001
3006
|
}),
|
|
3002
3007
|
threadEventBackgroundTaskItemSchema,
|
|
3003
3008
|
threadEventDelegationItemSchema,
|
|
3004
3009
|
threadEventExtensionItemSchema
|
|
3005
3010
|
]);
|
|
3006
3011
|
function itemTextDeltaEventSchema(type) {
|
|
3007
|
-
return
|
|
3008
|
-
type:
|
|
3009
|
-
threadId:
|
|
3010
|
-
providerThreadId:
|
|
3011
|
-
itemId:
|
|
3012
|
-
delta:
|
|
3013
|
-
parentToolCallId:
|
|
3012
|
+
return z20.object({
|
|
3013
|
+
type: z20.literal(type),
|
|
3014
|
+
threadId: z20.string(),
|
|
3015
|
+
providerThreadId: z20.string(),
|
|
3016
|
+
itemId: z20.string(),
|
|
3017
|
+
delta: z20.string(),
|
|
3018
|
+
parentToolCallId: z20.string().optional()
|
|
3014
3019
|
});
|
|
3015
3020
|
}
|
|
3016
|
-
var unscopedProviderEventSchema =
|
|
3017
|
-
|
|
3018
|
-
type:
|
|
3019
|
-
threadId:
|
|
3021
|
+
var unscopedProviderEventSchema = z20.discriminatedUnion("type", [
|
|
3022
|
+
z20.object({
|
|
3023
|
+
type: z20.literal("thread/started"),
|
|
3024
|
+
threadId: z20.string()
|
|
3020
3025
|
}),
|
|
3021
|
-
|
|
3022
|
-
type:
|
|
3023
|
-
threadId:
|
|
3024
|
-
providerThreadId:
|
|
3026
|
+
z20.object({
|
|
3027
|
+
type: z20.literal("thread/identity"),
|
|
3028
|
+
threadId: z20.string(),
|
|
3029
|
+
providerThreadId: z20.string()
|
|
3025
3030
|
}),
|
|
3026
|
-
|
|
3027
|
-
type:
|
|
3028
|
-
threadId:
|
|
3029
|
-
providerThreadId:
|
|
3030
|
-
parentToolCallId:
|
|
3031
|
+
z20.object({
|
|
3032
|
+
type: z20.literal("turn/started"),
|
|
3033
|
+
threadId: z20.string(),
|
|
3034
|
+
providerThreadId: z20.string(),
|
|
3035
|
+
parentToolCallId: z20.string().optional()
|
|
3031
3036
|
}),
|
|
3032
|
-
|
|
3033
|
-
type:
|
|
3034
|
-
threadId:
|
|
3035
|
-
providerThreadId:
|
|
3037
|
+
z20.object({
|
|
3038
|
+
type: z20.literal("turn/completed"),
|
|
3039
|
+
threadId: z20.string(),
|
|
3040
|
+
providerThreadId: z20.string().nullable(),
|
|
3036
3041
|
status: threadEventTurnStatusSchema,
|
|
3037
|
-
error:
|
|
3038
|
-
providerCheckpointId:
|
|
3042
|
+
error: z20.object({ message: z20.string() }).optional(),
|
|
3043
|
+
providerCheckpointId: z20.string().min(1).optional()
|
|
3039
3044
|
}),
|
|
3040
|
-
|
|
3041
|
-
type:
|
|
3042
|
-
threadId:
|
|
3043
|
-
providerThreadId:
|
|
3045
|
+
z20.object({
|
|
3046
|
+
type: z20.literal("turn/input/accepted"),
|
|
3047
|
+
threadId: z20.string(),
|
|
3048
|
+
providerThreadId: z20.string(),
|
|
3044
3049
|
clientRequestId: clientTurnRequestIdSchema,
|
|
3045
3050
|
scope: threadEventScopeSchema
|
|
3046
3051
|
}).strict(),
|
|
3047
|
-
|
|
3048
|
-
type:
|
|
3049
|
-
threadId:
|
|
3050
|
-
providerThreadId:
|
|
3051
|
-
threadName:
|
|
3052
|
-
source:
|
|
3052
|
+
z20.object({
|
|
3053
|
+
type: z20.literal("thread/name/updated"),
|
|
3054
|
+
threadId: z20.string(),
|
|
3055
|
+
providerThreadId: z20.string(),
|
|
3056
|
+
threadName: z20.string(),
|
|
3057
|
+
source: z20.literal("agent").optional()
|
|
3053
3058
|
}),
|
|
3054
|
-
|
|
3055
|
-
type:
|
|
3056
|
-
threadId:
|
|
3057
|
-
providerThreadId:
|
|
3059
|
+
z20.object({
|
|
3060
|
+
type: z20.literal("thread/compacted"),
|
|
3061
|
+
threadId: z20.string(),
|
|
3062
|
+
providerThreadId: z20.string()
|
|
3058
3063
|
}),
|
|
3059
|
-
|
|
3060
|
-
type:
|
|
3061
|
-
threadId:
|
|
3062
|
-
providerThreadId:
|
|
3064
|
+
z20.object({
|
|
3065
|
+
type: z20.literal("thread/context/cleared"),
|
|
3066
|
+
threadId: z20.string(),
|
|
3067
|
+
providerThreadId: z20.string()
|
|
3063
3068
|
}),
|
|
3064
|
-
|
|
3065
|
-
type:
|
|
3066
|
-
threadId:
|
|
3067
|
-
providerThreadId:
|
|
3068
|
-
objective:
|
|
3069
|
+
z20.object({
|
|
3070
|
+
type: z20.literal("thread/goal/updated"),
|
|
3071
|
+
threadId: z20.string(),
|
|
3072
|
+
providerThreadId: z20.string(),
|
|
3073
|
+
objective: z20.string(),
|
|
3069
3074
|
status: threadTimelineGoalStatusSchema,
|
|
3070
|
-
tokenBudget:
|
|
3071
|
-
tokensUsed:
|
|
3072
|
-
timeUsedSeconds:
|
|
3075
|
+
tokenBudget: z20.number().nullable(),
|
|
3076
|
+
tokensUsed: z20.number(),
|
|
3077
|
+
timeUsedSeconds: z20.number()
|
|
3073
3078
|
}),
|
|
3074
|
-
|
|
3075
|
-
type:
|
|
3076
|
-
threadId:
|
|
3077
|
-
providerThreadId:
|
|
3079
|
+
z20.object({
|
|
3080
|
+
type: z20.literal("thread/goal/cleared"),
|
|
3081
|
+
threadId: z20.string(),
|
|
3082
|
+
providerThreadId: z20.string()
|
|
3078
3083
|
}),
|
|
3079
|
-
|
|
3080
|
-
type:
|
|
3081
|
-
threadId:
|
|
3082
|
-
providerThreadId:
|
|
3084
|
+
z20.object({
|
|
3085
|
+
type: z20.literal("item/started"),
|
|
3086
|
+
threadId: z20.string(),
|
|
3087
|
+
providerThreadId: z20.string(),
|
|
3083
3088
|
item: threadEventItemSchema
|
|
3084
3089
|
}),
|
|
3085
|
-
|
|
3086
|
-
type:
|
|
3087
|
-
threadId:
|
|
3088
|
-
providerThreadId:
|
|
3090
|
+
z20.object({
|
|
3091
|
+
type: z20.literal("item/completed"),
|
|
3092
|
+
threadId: z20.string(),
|
|
3093
|
+
providerThreadId: z20.string(),
|
|
3089
3094
|
item: threadEventItemSchema
|
|
3090
3095
|
}),
|
|
3091
3096
|
itemTextDeltaEventSchema("item/agentMessage/delta"),
|
|
3092
|
-
|
|
3093
|
-
type:
|
|
3094
|
-
threadId:
|
|
3095
|
-
providerThreadId:
|
|
3096
|
-
itemId:
|
|
3097
|
-
delta:
|
|
3098
|
-
reset:
|
|
3099
|
-
parentToolCallId:
|
|
3097
|
+
z20.object({
|
|
3098
|
+
type: z20.literal("item/commandExecution/outputDelta"),
|
|
3099
|
+
threadId: z20.string(),
|
|
3100
|
+
providerThreadId: z20.string(),
|
|
3101
|
+
itemId: z20.string(),
|
|
3102
|
+
delta: z20.string(),
|
|
3103
|
+
reset: z20.boolean().optional(),
|
|
3104
|
+
parentToolCallId: z20.string().optional()
|
|
3100
3105
|
}),
|
|
3101
3106
|
itemTextDeltaEventSchema("item/fileChange/outputDelta"),
|
|
3102
3107
|
itemTextDeltaEventSchema("item/reasoning/summaryTextDelta"),
|
|
3103
3108
|
itemTextDeltaEventSchema("item/reasoning/textDelta"),
|
|
3104
3109
|
itemTextDeltaEventSchema("item/plan/delta"),
|
|
3105
|
-
|
|
3106
|
-
type:
|
|
3107
|
-
threadId:
|
|
3108
|
-
providerThreadId:
|
|
3109
|
-
itemId:
|
|
3110
|
-
message:
|
|
3111
|
-
parentToolCallId:
|
|
3110
|
+
z20.object({
|
|
3111
|
+
type: z20.literal("item/mcpToolCall/progress"),
|
|
3112
|
+
threadId: z20.string(),
|
|
3113
|
+
providerThreadId: z20.string(),
|
|
3114
|
+
itemId: z20.string(),
|
|
3115
|
+
message: z20.string().optional(),
|
|
3116
|
+
parentToolCallId: z20.string().optional()
|
|
3112
3117
|
}),
|
|
3113
3118
|
toolCallProgressEventSchema,
|
|
3114
|
-
|
|
3115
|
-
type:
|
|
3116
|
-
threadId:
|
|
3117
|
-
providerThreadId:
|
|
3119
|
+
z20.object({
|
|
3120
|
+
type: z20.literal("item/backgroundTask/progress"),
|
|
3121
|
+
threadId: z20.string(),
|
|
3122
|
+
providerThreadId: z20.string(),
|
|
3118
3123
|
item: threadEventBackgroundTaskItemSchema
|
|
3119
3124
|
}),
|
|
3120
|
-
|
|
3121
|
-
type:
|
|
3122
|
-
threadId:
|
|
3123
|
-
providerThreadId:
|
|
3125
|
+
z20.object({
|
|
3126
|
+
type: z20.literal("item/backgroundTask/completed"),
|
|
3127
|
+
threadId: z20.string(),
|
|
3128
|
+
providerThreadId: z20.string(),
|
|
3124
3129
|
item: threadEventBackgroundTaskItemSchema
|
|
3125
3130
|
}),
|
|
3126
|
-
|
|
3127
|
-
type:
|
|
3128
|
-
threadId:
|
|
3129
|
-
providerThreadId:
|
|
3131
|
+
z20.object({
|
|
3132
|
+
type: z20.literal("item/delegation/progress"),
|
|
3133
|
+
threadId: z20.string(),
|
|
3134
|
+
providerThreadId: z20.string(),
|
|
3130
3135
|
item: threadEventDelegationItemSchema
|
|
3131
3136
|
}),
|
|
3132
|
-
|
|
3133
|
-
type:
|
|
3134
|
-
threadId:
|
|
3135
|
-
providerThreadId:
|
|
3137
|
+
z20.object({
|
|
3138
|
+
type: z20.literal("item/delegation/completed"),
|
|
3139
|
+
threadId: z20.string(),
|
|
3140
|
+
providerThreadId: z20.string(),
|
|
3136
3141
|
item: threadEventDelegationItemSchema
|
|
3137
3142
|
}),
|
|
3138
|
-
|
|
3139
|
-
type:
|
|
3140
|
-
threadId:
|
|
3141
|
-
providerThreadId:
|
|
3143
|
+
z20.object({
|
|
3144
|
+
type: z20.literal("thread/tokenUsage/updated"),
|
|
3145
|
+
threadId: z20.string(),
|
|
3146
|
+
providerThreadId: z20.string(),
|
|
3142
3147
|
tokenUsage: threadEventTokenUsageSchema
|
|
3143
3148
|
}),
|
|
3144
|
-
|
|
3145
|
-
type:
|
|
3146
|
-
threadId:
|
|
3147
|
-
providerThreadId:
|
|
3149
|
+
z20.object({
|
|
3150
|
+
type: z20.literal("thread/contextWindowUsage/updated"),
|
|
3151
|
+
threadId: z20.string(),
|
|
3152
|
+
providerThreadId: z20.string(),
|
|
3148
3153
|
contextWindowUsage: threadEventContextWindowUsageSchema
|
|
3149
3154
|
}),
|
|
3150
|
-
|
|
3151
|
-
type:
|
|
3152
|
-
threadId:
|
|
3153
|
-
providerThreadId:
|
|
3154
|
-
plan:
|
|
3155
|
-
explanation:
|
|
3155
|
+
z20.object({
|
|
3156
|
+
type: z20.literal("turn/plan/updated"),
|
|
3157
|
+
threadId: z20.string(),
|
|
3158
|
+
providerThreadId: z20.string(),
|
|
3159
|
+
plan: z20.array(threadEventPlanStepSchema),
|
|
3160
|
+
explanation: z20.string().optional()
|
|
3156
3161
|
}),
|
|
3157
|
-
|
|
3158
|
-
type:
|
|
3159
|
-
threadId:
|
|
3160
|
-
providerThreadId:
|
|
3161
|
-
state:
|
|
3162
|
+
z20.object({
|
|
3163
|
+
type: z20.literal("turn/mainRun/updated"),
|
|
3164
|
+
threadId: z20.string(),
|
|
3165
|
+
providerThreadId: z20.string(),
|
|
3166
|
+
state: z20.enum(["idle", "running"])
|
|
3162
3167
|
}),
|
|
3163
|
-
|
|
3164
|
-
type:
|
|
3165
|
-
threadId:
|
|
3166
|
-
providerThreadId:
|
|
3167
|
-
diff:
|
|
3168
|
+
z20.object({
|
|
3169
|
+
type: z20.literal("turn/diff/updated"),
|
|
3170
|
+
threadId: z20.string(),
|
|
3171
|
+
providerThreadId: z20.string(),
|
|
3172
|
+
diff: z20.string().optional()
|
|
3168
3173
|
}),
|
|
3169
|
-
|
|
3170
|
-
type:
|
|
3171
|
-
threadId:
|
|
3172
|
-
providerThreadId:
|
|
3173
|
-
message:
|
|
3174
|
-
detail:
|
|
3175
|
-
willRetry:
|
|
3174
|
+
z20.object({
|
|
3175
|
+
type: z20.literal("provider/error"),
|
|
3176
|
+
threadId: z20.string(),
|
|
3177
|
+
providerThreadId: z20.string(),
|
|
3178
|
+
message: z20.string(),
|
|
3179
|
+
detail: z20.string().optional(),
|
|
3180
|
+
willRetry: z20.boolean().optional(),
|
|
3176
3181
|
errorInfo: providerErrorInfoSchema.optional()
|
|
3177
3182
|
}),
|
|
3178
|
-
|
|
3179
|
-
type:
|
|
3180
|
-
threadId:
|
|
3181
|
-
providerThreadId:
|
|
3183
|
+
z20.object({
|
|
3184
|
+
type: z20.literal("provider/rateLimits/updated"),
|
|
3185
|
+
threadId: z20.string(),
|
|
3186
|
+
providerThreadId: z20.string(),
|
|
3182
3187
|
rateLimits: providerRateLimitStateSchema
|
|
3183
3188
|
}),
|
|
3184
|
-
|
|
3185
|
-
type:
|
|
3186
|
-
threadId:
|
|
3187
|
-
providerThreadId:
|
|
3188
|
-
entries:
|
|
3189
|
-
|
|
3190
|
-
name:
|
|
3191
|
-
source:
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
core:
|
|
3189
|
+
z20.object({
|
|
3190
|
+
type: z20.literal("provider.env-resolved"),
|
|
3191
|
+
threadId: z20.string(),
|
|
3192
|
+
providerThreadId: z20.string(),
|
|
3193
|
+
entries: z20.array(
|
|
3194
|
+
z20.object({
|
|
3195
|
+
name: z20.string(),
|
|
3196
|
+
source: z20.union([
|
|
3197
|
+
z20.literal("shell"),
|
|
3198
|
+
z20.object({ plugin: z20.string() }).strict(),
|
|
3199
|
+
z20.object({
|
|
3200
|
+
core: z20.enum([
|
|
3196
3201
|
"machine-git",
|
|
3197
3202
|
"machine-environment",
|
|
3198
3203
|
"project-environment"
|
|
3199
3204
|
])
|
|
3200
3205
|
}).strict()
|
|
3201
3206
|
]),
|
|
3202
|
-
value:
|
|
3203
|
-
|
|
3204
|
-
|
|
3207
|
+
value: z20.union([
|
|
3208
|
+
z20.string(),
|
|
3209
|
+
z20.object({ masked: z20.literal(true) }).strict()
|
|
3205
3210
|
]),
|
|
3206
|
-
reason:
|
|
3211
|
+
reason: z20.string().optional()
|
|
3207
3212
|
}).strict()
|
|
3208
3213
|
)
|
|
3209
3214
|
}),
|
|
3210
|
-
|
|
3211
|
-
type:
|
|
3212
|
-
threadId:
|
|
3213
|
-
providerThreadId:
|
|
3215
|
+
z20.object({
|
|
3216
|
+
type: z20.literal("thread/extensionState/updated"),
|
|
3217
|
+
threadId: z20.string(),
|
|
3218
|
+
providerThreadId: z20.string(),
|
|
3214
3219
|
kind: extensionKindSchema,
|
|
3215
3220
|
payload: jsonValueSchema
|
|
3216
3221
|
}),
|
|
3217
|
-
|
|
3218
|
-
type:
|
|
3219
|
-
threadId:
|
|
3220
|
-
providerThreadId:
|
|
3222
|
+
z20.object({
|
|
3223
|
+
type: z20.literal("provider/warning"),
|
|
3224
|
+
threadId: z20.string(),
|
|
3225
|
+
providerThreadId: z20.string(),
|
|
3221
3226
|
category: threadEventWarningCategorySchema,
|
|
3222
|
-
summary:
|
|
3223
|
-
details:
|
|
3227
|
+
summary: z20.string().optional(),
|
|
3228
|
+
details: z20.string().optional()
|
|
3224
3229
|
}),
|
|
3225
|
-
|
|
3226
|
-
type:
|
|
3227
|
-
threadId:
|
|
3228
|
-
providerThreadId:
|
|
3229
|
-
originalModel:
|
|
3230
|
-
fallbackModel:
|
|
3231
|
-
reason:
|
|
3232
|
-
message:
|
|
3230
|
+
z20.object({
|
|
3231
|
+
type: z20.literal("provider/modelFallback"),
|
|
3232
|
+
threadId: z20.string(),
|
|
3233
|
+
providerThreadId: z20.string(),
|
|
3234
|
+
originalModel: z20.string().min(1),
|
|
3235
|
+
fallbackModel: z20.string().min(1),
|
|
3236
|
+
reason: z20.enum(["refusal", "provider"]),
|
|
3237
|
+
message: z20.string()
|
|
3233
3238
|
}),
|
|
3234
3239
|
providerUnhandledEventSchema
|
|
3235
3240
|
]);
|
|
3236
|
-
var scopedEventDataSchema =
|
|
3241
|
+
var scopedEventDataSchema = z20.object({
|
|
3237
3242
|
scope: threadEventScopeSchema
|
|
3238
3243
|
});
|
|
3239
3244
|
var providerEventSchema = unscopedProviderEventSchema.and(
|
|
3240
3245
|
scopedEventDataSchema
|
|
3241
3246
|
);
|
|
3242
|
-
var unscopedSystemEventSchema =
|
|
3243
|
-
|
|
3244
|
-
type:
|
|
3245
|
-
threadId:
|
|
3247
|
+
var unscopedSystemEventSchema = z20.discriminatedUnion("type", [
|
|
3248
|
+
z20.object({
|
|
3249
|
+
type: z20.literal("client/thread/start"),
|
|
3250
|
+
threadId: z20.string()
|
|
3246
3251
|
}).merge(clientTurnLifecycleEventDataSchema),
|
|
3247
|
-
|
|
3248
|
-
type:
|
|
3249
|
-
threadId:
|
|
3252
|
+
z20.object({
|
|
3253
|
+
type: z20.literal("client/turn/requested"),
|
|
3254
|
+
threadId: z20.string()
|
|
3250
3255
|
}).merge(turnRequestEventDataSchema),
|
|
3251
|
-
|
|
3252
|
-
type:
|
|
3253
|
-
threadId:
|
|
3256
|
+
z20.object({
|
|
3257
|
+
type: z20.literal("client/turn/rejected"),
|
|
3258
|
+
threadId: z20.string()
|
|
3254
3259
|
}).merge(turnRequestRejectedEventDataSchema),
|
|
3255
|
-
|
|
3256
|
-
type:
|
|
3257
|
-
threadId:
|
|
3260
|
+
z20.object({
|
|
3261
|
+
type: z20.literal("client/turn/start"),
|
|
3262
|
+
threadId: z20.string()
|
|
3258
3263
|
}).merge(clientTurnLifecycleEventDataSchema),
|
|
3259
|
-
|
|
3260
|
-
type:
|
|
3261
|
-
threadId:
|
|
3264
|
+
z20.object({
|
|
3265
|
+
type: z20.literal("system/error"),
|
|
3266
|
+
threadId: z20.string()
|
|
3262
3267
|
}).merge(systemErrorEventDataSchema),
|
|
3263
|
-
|
|
3264
|
-
type:
|
|
3265
|
-
threadId:
|
|
3268
|
+
z20.object({
|
|
3269
|
+
type: z20.literal("system/manager/user_message"),
|
|
3270
|
+
threadId: z20.string()
|
|
3266
3271
|
}).merge(systemLegacyUserMessageEventDataSchema),
|
|
3267
|
-
|
|
3268
|
-
type:
|
|
3269
|
-
threadId:
|
|
3272
|
+
z20.object({
|
|
3273
|
+
type: z20.literal("system/thread/interrupted"),
|
|
3274
|
+
threadId: z20.string()
|
|
3270
3275
|
}).merge(systemThreadInterruptedEventDataSchema),
|
|
3271
|
-
|
|
3272
|
-
type:
|
|
3273
|
-
threadId:
|
|
3276
|
+
z20.object({
|
|
3277
|
+
type: z20.literal("system/operation"),
|
|
3278
|
+
threadId: z20.string()
|
|
3274
3279
|
}).merge(systemOperationEventDataSchema),
|
|
3275
|
-
|
|
3276
|
-
type:
|
|
3277
|
-
threadId:
|
|
3280
|
+
z20.object({
|
|
3281
|
+
type: z20.literal("system/interaction/lifecycle"),
|
|
3282
|
+
threadId: z20.string()
|
|
3278
3283
|
}).merge(systemInteractionLifecycleEventDataSchema),
|
|
3279
|
-
|
|
3280
|
-
type:
|
|
3281
|
-
threadId:
|
|
3284
|
+
z20.object({
|
|
3285
|
+
type: z20.literal("system/permissionGrant/lifecycle"),
|
|
3286
|
+
threadId: z20.string()
|
|
3282
3287
|
}).merge(systemPermissionGrantLifecycleEventDataSchema),
|
|
3283
|
-
|
|
3284
|
-
type:
|
|
3285
|
-
threadId:
|
|
3288
|
+
z20.object({
|
|
3289
|
+
type: z20.literal("system/userQuestion/lifecycle"),
|
|
3290
|
+
threadId: z20.string()
|
|
3286
3291
|
}).merge(systemUserQuestionLifecycleEventDataSchema),
|
|
3287
|
-
|
|
3288
|
-
type:
|
|
3289
|
-
threadId:
|
|
3292
|
+
z20.object({
|
|
3293
|
+
type: z20.literal("system/thread-provisioning"),
|
|
3294
|
+
threadId: z20.string()
|
|
3290
3295
|
}).merge(systemThreadProvisioningEventDataSchema),
|
|
3291
|
-
|
|
3292
|
-
type:
|
|
3293
|
-
threadId:
|
|
3296
|
+
z20.object({
|
|
3297
|
+
type: z20.literal("system/provider-turn-watchdog"),
|
|
3298
|
+
threadId: z20.string()
|
|
3294
3299
|
}).merge(systemProviderTurnWatchdogEventDataSchema)
|
|
3295
3300
|
]);
|
|
3296
3301
|
var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
|
|
3297
|
-
var threadEventSchema =
|
|
3302
|
+
var threadEventSchema = z20.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
|
|
3298
3303
|
const result = validateThreadEventScope({
|
|
3299
3304
|
type: event.type,
|
|
3300
3305
|
scope: event.scope
|
|
3301
3306
|
});
|
|
3302
3307
|
if (!result.valid) {
|
|
3303
3308
|
ctx.addIssue({
|
|
3304
|
-
code:
|
|
3309
|
+
code: z20.ZodIssueCode.custom,
|
|
3305
3310
|
message: result.message ?? "Invalid thread event scope",
|
|
3306
3311
|
path: ["scope"]
|
|
3307
3312
|
});
|
|
@@ -3310,135 +3315,135 @@ var threadEventSchema = z19.union([providerEventSchema, systemEventSchema]).supe
|
|
|
3310
3315
|
});
|
|
3311
3316
|
|
|
3312
3317
|
// ../domain/src/thread-provider-state.ts
|
|
3313
|
-
import { z as
|
|
3318
|
+
import { z as z23 } from "zod";
|
|
3314
3319
|
|
|
3315
3320
|
// ../domain/src/provider-types.ts
|
|
3316
|
-
import { z as
|
|
3321
|
+
import { z as z22 } from "zod";
|
|
3317
3322
|
|
|
3318
3323
|
// ../domain/src/thread-session-option.ts
|
|
3319
|
-
import { z as
|
|
3320
|
-
var threadSessionOptionValueSchema =
|
|
3321
|
-
id:
|
|
3322
|
-
label:
|
|
3323
|
-
description:
|
|
3324
|
-
group:
|
|
3324
|
+
import { z as z21 } from "zod";
|
|
3325
|
+
var threadSessionOptionValueSchema = z21.object({
|
|
3326
|
+
id: z21.string().min(1),
|
|
3327
|
+
label: z21.string().min(1),
|
|
3328
|
+
description: z21.string().min(1).optional(),
|
|
3329
|
+
group: z21.string().min(1).optional()
|
|
3325
3330
|
});
|
|
3326
3331
|
var threadSessionOptionBaseShape = {
|
|
3327
|
-
id:
|
|
3328
|
-
label:
|
|
3329
|
-
description:
|
|
3330
|
-
category:
|
|
3332
|
+
id: z21.string().min(1),
|
|
3333
|
+
label: z21.string().min(1),
|
|
3334
|
+
description: z21.string().min(1).optional(),
|
|
3335
|
+
category: z21.string().min(1).optional()
|
|
3331
3336
|
};
|
|
3332
|
-
var threadSessionOptionSchema =
|
|
3333
|
-
|
|
3337
|
+
var threadSessionOptionSchema = z21.discriminatedUnion("type", [
|
|
3338
|
+
z21.object({
|
|
3334
3339
|
...threadSessionOptionBaseShape,
|
|
3335
|
-
type:
|
|
3336
|
-
value:
|
|
3337
|
-
values:
|
|
3340
|
+
type: z21.literal("select"),
|
|
3341
|
+
value: z21.string(),
|
|
3342
|
+
values: z21.array(threadSessionOptionValueSchema).max(1e3)
|
|
3338
3343
|
}),
|
|
3339
|
-
|
|
3344
|
+
z21.object({
|
|
3340
3345
|
...threadSessionOptionBaseShape,
|
|
3341
|
-
type:
|
|
3342
|
-
value:
|
|
3343
|
-
fixed:
|
|
3346
|
+
type: z21.literal("boolean"),
|
|
3347
|
+
value: z21.boolean(),
|
|
3348
|
+
fixed: z21.boolean().optional()
|
|
3344
3349
|
})
|
|
3345
3350
|
]);
|
|
3346
3351
|
|
|
3347
3352
|
// ../domain/src/provider-types.ts
|
|
3348
|
-
var modelReasoningEffortSchema =
|
|
3353
|
+
var modelReasoningEffortSchema = z22.object({
|
|
3349
3354
|
reasoningEffort: reasoningLevelSchema,
|
|
3350
|
-
label:
|
|
3351
|
-
description:
|
|
3355
|
+
label: z22.string().min(1).optional(),
|
|
3356
|
+
description: z22.string()
|
|
3352
3357
|
});
|
|
3353
|
-
var modelServiceTierSchema =
|
|
3358
|
+
var modelServiceTierSchema = z22.object({
|
|
3354
3359
|
id: serviceTierSchema,
|
|
3355
|
-
label:
|
|
3356
|
-
description:
|
|
3357
|
-
});
|
|
3358
|
-
var availableModelSchema =
|
|
3359
|
-
id:
|
|
3360
|
-
model:
|
|
3361
|
-
displayName:
|
|
3362
|
-
routeProviderId:
|
|
3363
|
-
description:
|
|
3364
|
-
reasoningDiscovery:
|
|
3365
|
-
supportedReasoningEfforts:
|
|
3360
|
+
label: z22.string().min(1).optional(),
|
|
3361
|
+
description: z22.string().min(1).optional()
|
|
3362
|
+
});
|
|
3363
|
+
var availableModelSchema = z22.object({
|
|
3364
|
+
id: z22.string(),
|
|
3365
|
+
model: z22.string(),
|
|
3366
|
+
displayName: z22.string(),
|
|
3367
|
+
routeProviderId: z22.string().min(1).optional(),
|
|
3368
|
+
description: z22.string(),
|
|
3369
|
+
reasoningDiscovery: z22.enum(["unknown", "known"]).default("known"),
|
|
3370
|
+
supportedReasoningEfforts: z22.array(modelReasoningEffortSchema),
|
|
3366
3371
|
defaultReasoningEffort: reasoningLevelSchema,
|
|
3367
|
-
supportedServiceTiers:
|
|
3368
|
-
sessionOptions:
|
|
3369
|
-
isDefault:
|
|
3370
|
-
});
|
|
3371
|
-
var providerModelCatalogScopeSchema =
|
|
3372
|
-
var providerCapabilitiesSchema =
|
|
3373
|
-
supportsThreadArchive:
|
|
3374
|
-
supportsThreadRename:
|
|
3375
|
-
supportsServiceTier:
|
|
3376
|
-
supportsNativeUserQuestion:
|
|
3377
|
-
supportsFork:
|
|
3378
|
-
supportsSessionRewind:
|
|
3379
|
-
permissionModes:
|
|
3372
|
+
supportedServiceTiers: z22.array(modelServiceTierSchema).optional(),
|
|
3373
|
+
sessionOptions: z22.array(threadSessionOptionSchema).max(64).optional(),
|
|
3374
|
+
isDefault: z22.boolean()
|
|
3375
|
+
});
|
|
3376
|
+
var providerModelCatalogScopeSchema = z22.enum(["host", "workspace"]);
|
|
3377
|
+
var providerCapabilitiesSchema = z22.object({
|
|
3378
|
+
supportsThreadArchive: z22.boolean(),
|
|
3379
|
+
supportsThreadRename: z22.boolean(),
|
|
3380
|
+
supportsServiceTier: z22.boolean(),
|
|
3381
|
+
supportsNativeUserQuestion: z22.boolean(),
|
|
3382
|
+
supportsFork: z22.boolean(),
|
|
3383
|
+
supportsSessionRewind: z22.boolean(),
|
|
3384
|
+
permissionModes: z22.array(permissionModeSchema).min(1),
|
|
3380
3385
|
modelCatalogScope: providerModelCatalogScopeSchema
|
|
3381
3386
|
});
|
|
3382
|
-
var providerComposerCommandSchema =
|
|
3387
|
+
var providerComposerCommandSchema = z22.object({
|
|
3383
3388
|
trigger: promptMentionCommandTriggerSchema,
|
|
3384
|
-
name:
|
|
3385
|
-
trailingText:
|
|
3389
|
+
name: z22.string().min(1).regex(/^[^\s/$]+$/u),
|
|
3390
|
+
trailingText: z22.string().regex(/^\s*$/u)
|
|
3386
3391
|
});
|
|
3387
|
-
var providerComposerActionSchema =
|
|
3388
|
-
|
|
3389
|
-
kind:
|
|
3392
|
+
var providerComposerActionSchema = z22.discriminatedUnion("kind", [
|
|
3393
|
+
z22.object({
|
|
3394
|
+
kind: z22.literal("skills"),
|
|
3390
3395
|
trigger: promptMentionCommandTriggerSchema
|
|
3391
3396
|
}),
|
|
3392
|
-
|
|
3393
|
-
kind:
|
|
3397
|
+
z22.object({
|
|
3398
|
+
kind: z22.literal("plan"),
|
|
3394
3399
|
command: providerComposerCommandSchema
|
|
3395
3400
|
}),
|
|
3396
|
-
|
|
3397
|
-
kind:
|
|
3401
|
+
z22.object({
|
|
3402
|
+
kind: z22.literal("goal"),
|
|
3398
3403
|
command: providerComposerCommandSchema
|
|
3399
3404
|
})
|
|
3400
3405
|
]);
|
|
3401
|
-
var providerStringsSchema =
|
|
3402
|
-
signInHint:
|
|
3403
|
-
expiredHint:
|
|
3404
|
-
installUrl:
|
|
3405
|
-
brandPrefix:
|
|
3406
|
-
planModeCopy:
|
|
3407
|
-
iconTint:
|
|
3408
|
-
});
|
|
3409
|
-
var providerOptionDescriptorSchema =
|
|
3410
|
-
id:
|
|
3411
|
-
label:
|
|
3412
|
-
description:
|
|
3413
|
-
icon:
|
|
3414
|
-
});
|
|
3415
|
-
var providerExtensionKindInfoSchema =
|
|
3416
|
-
item:
|
|
3417
|
-
state:
|
|
3418
|
-
});
|
|
3419
|
-
var providerExtensionKindsSchema =
|
|
3406
|
+
var providerStringsSchema = z22.object({
|
|
3407
|
+
signInHint: z22.string().min(1),
|
|
3408
|
+
expiredHint: z22.string().min(1),
|
|
3409
|
+
installUrl: z22.string().min(1),
|
|
3410
|
+
brandPrefix: z22.string().min(1).optional(),
|
|
3411
|
+
planModeCopy: z22.string().min(1).optional(),
|
|
3412
|
+
iconTint: z22.object({ light: z22.string().min(1), dark: z22.string().min(1) }).optional()
|
|
3413
|
+
});
|
|
3414
|
+
var providerOptionDescriptorSchema = z22.object({
|
|
3415
|
+
id: z22.string().min(1),
|
|
3416
|
+
label: z22.string().min(1),
|
|
3417
|
+
description: z22.string().min(1).optional(),
|
|
3418
|
+
icon: z22.string().min(1).optional()
|
|
3419
|
+
});
|
|
3420
|
+
var providerExtensionKindInfoSchema = z22.object({
|
|
3421
|
+
item: z22.boolean(),
|
|
3422
|
+
state: z22.boolean()
|
|
3423
|
+
});
|
|
3424
|
+
var providerExtensionKindsSchema = z22.record(
|
|
3420
3425
|
extensionKindSchema,
|
|
3421
3426
|
providerExtensionKindInfoSchema
|
|
3422
3427
|
);
|
|
3423
|
-
var providerInfoSchema =
|
|
3424
|
-
id:
|
|
3425
|
-
pluginId:
|
|
3426
|
-
displayName:
|
|
3427
|
-
family:
|
|
3428
|
-
icon:
|
|
3429
|
-
logoUrl:
|
|
3430
|
-
maintenance:
|
|
3431
|
-
health:
|
|
3432
|
-
usage:
|
|
3433
|
-
installation:
|
|
3428
|
+
var providerInfoSchema = z22.object({
|
|
3429
|
+
id: z22.string(),
|
|
3430
|
+
pluginId: z22.string().min(1),
|
|
3431
|
+
displayName: z22.string(),
|
|
3432
|
+
family: z22.string().min(1).optional(),
|
|
3433
|
+
icon: z22.object({ glyph: z22.string().min(1) }).optional(),
|
|
3434
|
+
logoUrl: z22.string().min(1).nullable(),
|
|
3435
|
+
maintenance: z22.object({
|
|
3436
|
+
health: z22.boolean(),
|
|
3437
|
+
usage: z22.boolean(),
|
|
3438
|
+
installation: z22.boolean()
|
|
3434
3439
|
}),
|
|
3435
3440
|
capabilities: providerCapabilitiesSchema,
|
|
3436
|
-
composerActions:
|
|
3441
|
+
composerActions: z22.array(providerComposerActionSchema),
|
|
3437
3442
|
completedTurnDisplay: completedTurnDisplaySchema,
|
|
3438
|
-
available:
|
|
3443
|
+
available: z22.boolean(),
|
|
3439
3444
|
strings: providerStringsSchema.optional(),
|
|
3440
|
-
serviceTiers:
|
|
3441
|
-
reasoningLevels:
|
|
3445
|
+
serviceTiers: z22.array(providerOptionDescriptorSchema).optional(),
|
|
3446
|
+
reasoningLevels: z22.array(providerOptionDescriptorSchema).optional(),
|
|
3442
3447
|
extensionKinds: providerExtensionKindsSchema.optional()
|
|
3443
3448
|
});
|
|
3444
3449
|
var providerRecoveryKindValues = [
|
|
@@ -3448,34 +3453,34 @@ var providerRecoveryKindValues = [
|
|
|
3448
3453
|
"staleTurn",
|
|
3449
3454
|
"rateLimited"
|
|
3450
3455
|
];
|
|
3451
|
-
var providerRecoveryKindSchema =
|
|
3452
|
-
var toolCallOutputItemSchema =
|
|
3453
|
-
|
|
3454
|
-
type:
|
|
3455
|
-
text:
|
|
3456
|
+
var providerRecoveryKindSchema = z22.enum(providerRecoveryKindValues);
|
|
3457
|
+
var toolCallOutputItemSchema = z22.discriminatedUnion("type", [
|
|
3458
|
+
z22.object({
|
|
3459
|
+
type: z22.literal("inputText"),
|
|
3460
|
+
text: z22.string()
|
|
3456
3461
|
}),
|
|
3457
|
-
|
|
3458
|
-
type:
|
|
3459
|
-
imageUrl:
|
|
3462
|
+
z22.object({
|
|
3463
|
+
type: z22.literal("inputImage"),
|
|
3464
|
+
imageUrl: z22.string()
|
|
3460
3465
|
})
|
|
3461
3466
|
]);
|
|
3462
|
-
var toolCallRequestSchema =
|
|
3463
|
-
requestId:
|
|
3464
|
-
threadId:
|
|
3465
|
-
providerThreadId:
|
|
3466
|
-
turnId:
|
|
3467
|
-
callId:
|
|
3468
|
-
tool:
|
|
3469
|
-
arguments:
|
|
3470
|
-
});
|
|
3471
|
-
var toolCallResponseSchema =
|
|
3472
|
-
contentItems:
|
|
3473
|
-
success:
|
|
3474
|
-
});
|
|
3475
|
-
var dynamicToolSchema =
|
|
3476
|
-
name:
|
|
3477
|
-
description:
|
|
3478
|
-
inputSchema:
|
|
3467
|
+
var toolCallRequestSchema = z22.object({
|
|
3468
|
+
requestId: z22.union([z22.string().min(1), z22.number()]),
|
|
3469
|
+
threadId: z22.string().min(1),
|
|
3470
|
+
providerThreadId: z22.string().min(1),
|
|
3471
|
+
turnId: z22.string().min(1),
|
|
3472
|
+
callId: z22.string().min(1),
|
|
3473
|
+
tool: z22.string().min(1),
|
|
3474
|
+
arguments: z22.unknown().optional()
|
|
3475
|
+
});
|
|
3476
|
+
var toolCallResponseSchema = z22.object({
|
|
3477
|
+
contentItems: z22.array(toolCallOutputItemSchema),
|
|
3478
|
+
success: z22.boolean()
|
|
3479
|
+
});
|
|
3480
|
+
var dynamicToolSchema = z22.object({
|
|
3481
|
+
name: z22.string(),
|
|
3482
|
+
description: z22.string(),
|
|
3483
|
+
inputSchema: z22.unknown(),
|
|
3479
3484
|
presentation: threadEventItemPresentationSchema.optional()
|
|
3480
3485
|
});
|
|
3481
3486
|
|
|
@@ -3483,22 +3488,22 @@ var dynamicToolSchema = z21.object({
|
|
|
3483
3488
|
var THREAD_PROVIDER_COMMANDS_STATE_KIND = "bb/provider-commands";
|
|
3484
3489
|
var THREAD_SESSION_OPTIONS_STATE_KIND = "bb/session-options";
|
|
3485
3490
|
var THREAD_PROVIDER_MODEL_CATALOG_STATE_KIND = "bb/provider-model-catalog";
|
|
3486
|
-
var threadProviderModelCatalogStateSchema =
|
|
3487
|
-
models:
|
|
3488
|
-
selectedOnlyModels:
|
|
3491
|
+
var threadProviderModelCatalogStateSchema = z23.object({
|
|
3492
|
+
models: z23.array(availableModelSchema).max(1e3),
|
|
3493
|
+
selectedOnlyModels: z23.array(availableModelSchema).max(1e3)
|
|
3489
3494
|
});
|
|
3490
|
-
var threadProviderCommandSchema =
|
|
3491
|
-
name:
|
|
3492
|
-
description:
|
|
3493
|
-
inputHint:
|
|
3495
|
+
var threadProviderCommandSchema = z23.object({
|
|
3496
|
+
name: z23.string().min(1),
|
|
3497
|
+
description: z23.string(),
|
|
3498
|
+
inputHint: z23.string().min(1).optional()
|
|
3494
3499
|
});
|
|
3495
|
-
var threadProviderCommandsStateSchema =
|
|
3496
|
-
commands:
|
|
3500
|
+
var threadProviderCommandsStateSchema = z23.object({
|
|
3501
|
+
commands: z23.array(threadProviderCommandSchema).max(500)
|
|
3497
3502
|
});
|
|
3498
|
-
var threadSessionOptionsStateSchema =
|
|
3499
|
-
options:
|
|
3503
|
+
var threadSessionOptionsStateSchema = z23.object({
|
|
3504
|
+
options: z23.array(threadSessionOptionSchema).max(64)
|
|
3500
3505
|
});
|
|
3501
|
-
var threadSessionOptionSelectionsStateSchema =
|
|
3506
|
+
var threadSessionOptionSelectionsStateSchema = z23.object({
|
|
3502
3507
|
selections: sessionOptionSelectionsSchema
|
|
3503
3508
|
});
|
|
3504
3509
|
var CORE_THREAD_STATE_SCHEMAS = {
|
|
@@ -3508,9 +3513,9 @@ var CORE_THREAD_STATE_SCHEMAS = {
|
|
|
3508
3513
|
};
|
|
3509
3514
|
|
|
3510
3515
|
// ../domain/src/provider-fork.ts
|
|
3511
|
-
import { z as
|
|
3516
|
+
import { z as z24 } from "zod";
|
|
3512
3517
|
var PROVIDER_FORK_VALUES = ["none", "tip", "checkpoint"];
|
|
3513
|
-
var providerForkSchema =
|
|
3518
|
+
var providerForkSchema = z24.enum(PROVIDER_FORK_VALUES);
|
|
3514
3519
|
|
|
3515
3520
|
// ../domain/src/reasoning-efforts.ts
|
|
3516
3521
|
var NONE_REASONING_EFFORT = {
|
|
@@ -3562,58 +3567,58 @@ function reasoningEffortsForLevels(levels) {
|
|
|
3562
3567
|
}
|
|
3563
3568
|
|
|
3564
3569
|
// ../provider-bridge-protocol/src/bridge-requests.ts
|
|
3565
|
-
import { z as
|
|
3570
|
+
import { z as z25 } from "zod";
|
|
3566
3571
|
var BRIDGE_INBOUND_REQUEST_METHODS = {
|
|
3567
3572
|
toolCall: "item/tool/call",
|
|
3568
3573
|
interactionRequest: "interaction/request"
|
|
3569
3574
|
};
|
|
3570
|
-
var toolCallRequestParamsSchema =
|
|
3571
|
-
providerThreadId:
|
|
3572
|
-
threadId:
|
|
3573
|
-
turnId:
|
|
3574
|
-
callId:
|
|
3575
|
-
tool:
|
|
3576
|
-
arguments:
|
|
3575
|
+
var toolCallRequestParamsSchema = z25.object({
|
|
3576
|
+
providerThreadId: z25.string().min(1),
|
|
3577
|
+
threadId: z25.string().min(1).optional(),
|
|
3578
|
+
turnId: z25.union([z25.string().min(1), z25.null()]),
|
|
3579
|
+
callId: z25.string().min(1),
|
|
3580
|
+
tool: z25.string().min(1),
|
|
3581
|
+
arguments: z25.unknown()
|
|
3577
3582
|
}).passthrough();
|
|
3578
|
-
var toolCallResultSchema =
|
|
3579
|
-
success:
|
|
3580
|
-
contentItems:
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
type:
|
|
3585
|
-
imageUrl:
|
|
3583
|
+
var toolCallResultSchema = z25.object({
|
|
3584
|
+
success: z25.boolean(),
|
|
3585
|
+
contentItems: z25.array(
|
|
3586
|
+
z25.discriminatedUnion("type", [
|
|
3587
|
+
z25.object({ type: z25.literal("inputText"), text: z25.string() }),
|
|
3588
|
+
z25.object({
|
|
3589
|
+
type: z25.literal("inputImage"),
|
|
3590
|
+
imageUrl: z25.string().min(1)
|
|
3586
3591
|
})
|
|
3587
3592
|
])
|
|
3588
3593
|
)
|
|
3589
3594
|
}).passthrough();
|
|
3590
|
-
var interactionRequestParamsSchema =
|
|
3591
|
-
providerThreadId:
|
|
3592
|
-
threadId:
|
|
3593
|
-
turnId:
|
|
3595
|
+
var interactionRequestParamsSchema = z25.object({
|
|
3596
|
+
providerThreadId: z25.string().min(1),
|
|
3597
|
+
threadId: z25.string().min(1).optional(),
|
|
3598
|
+
turnId: z25.union([z25.string().min(1), z25.null()]),
|
|
3594
3599
|
payload: pendingInteractionPayloadSchema
|
|
3595
3600
|
}).passthrough();
|
|
3596
3601
|
|
|
3597
3602
|
// ../provider-bridge-protocol/src/bridge-kit/bridge-tool-calls.ts
|
|
3598
|
-
var bridgeRequestEnvelopeSchema =
|
|
3599
|
-
jsonrpc:
|
|
3600
|
-
id:
|
|
3601
|
-
method:
|
|
3602
|
-
params:
|
|
3603
|
-
});
|
|
3604
|
-
var jsonRpcErrorSchema =
|
|
3605
|
-
code:
|
|
3606
|
-
message:
|
|
3607
|
-
data:
|
|
3608
|
-
});
|
|
3609
|
-
var jsonRpcSuccessResponseSchema =
|
|
3610
|
-
jsonrpc:
|
|
3611
|
-
id:
|
|
3612
|
-
result:
|
|
3613
|
-
});
|
|
3614
|
-
var jsonRpcErrorResponseSchema =
|
|
3615
|
-
jsonrpc:
|
|
3616
|
-
id:
|
|
3603
|
+
var bridgeRequestEnvelopeSchema = z26.object({
|
|
3604
|
+
jsonrpc: z26.literal("2.0"),
|
|
3605
|
+
id: z26.union([z26.string(), z26.number()]),
|
|
3606
|
+
method: z26.string(),
|
|
3607
|
+
params: z26.record(z26.string(), z26.unknown()).optional()
|
|
3608
|
+
});
|
|
3609
|
+
var jsonRpcErrorSchema = z26.object({
|
|
3610
|
+
code: z26.number(),
|
|
3611
|
+
message: z26.string().optional(),
|
|
3612
|
+
data: z26.unknown().optional()
|
|
3613
|
+
});
|
|
3614
|
+
var jsonRpcSuccessResponseSchema = z26.object({
|
|
3615
|
+
jsonrpc: z26.literal("2.0"),
|
|
3616
|
+
id: z26.union([z26.string(), z26.number()]),
|
|
3617
|
+
result: z26.unknown()
|
|
3618
|
+
});
|
|
3619
|
+
var jsonRpcErrorResponseSchema = z26.object({
|
|
3620
|
+
jsonrpc: z26.literal("2.0"),
|
|
3621
|
+
id: z26.union([z26.string(), z26.number()]),
|
|
3617
3622
|
error: jsonRpcErrorSchema
|
|
3618
3623
|
});
|
|
3619
3624
|
function isJsonRpcRequest(input) {
|
|
@@ -3701,47 +3706,47 @@ function buildBridgeToolCallContent(result) {
|
|
|
3701
3706
|
}
|
|
3702
3707
|
|
|
3703
3708
|
// ../provider-bridge-protocol/src/bridge-kit/json-rpc-envelope.ts
|
|
3704
|
-
import { z as
|
|
3705
|
-
var recordSchema =
|
|
3706
|
-
var jsonRpcEnvelopeSchema =
|
|
3707
|
-
jsonrpc:
|
|
3708
|
-
method:
|
|
3709
|
+
import { z as z27 } from "zod";
|
|
3710
|
+
var recordSchema = z27.record(z27.string(), z27.unknown());
|
|
3711
|
+
var jsonRpcEnvelopeSchema = z27.object({
|
|
3712
|
+
jsonrpc: z27.literal("2.0"),
|
|
3713
|
+
method: z27.string(),
|
|
3709
3714
|
params: recordSchema.optional()
|
|
3710
3715
|
}).passthrough();
|
|
3711
|
-
var sdkMessageEnvelopeSchema =
|
|
3712
|
-
jsonrpc:
|
|
3713
|
-
method:
|
|
3714
|
-
params:
|
|
3715
|
-
message:
|
|
3716
|
-
threadId:
|
|
3717
|
-
parent_tool_use_id:
|
|
3716
|
+
var sdkMessageEnvelopeSchema = z27.object({
|
|
3717
|
+
jsonrpc: z27.literal("2.0"),
|
|
3718
|
+
method: z27.literal("sdk/message"),
|
|
3719
|
+
params: z27.object({
|
|
3720
|
+
message: z27.unknown(),
|
|
3721
|
+
threadId: z27.string().optional(),
|
|
3722
|
+
parent_tool_use_id: z27.string().optional()
|
|
3718
3723
|
}).passthrough()
|
|
3719
3724
|
}).passthrough();
|
|
3720
|
-
var threadIdentityEnvelopeSchema =
|
|
3721
|
-
jsonrpc:
|
|
3722
|
-
method:
|
|
3723
|
-
params:
|
|
3724
|
-
threadId:
|
|
3725
|
-
providerThreadId:
|
|
3725
|
+
var threadIdentityEnvelopeSchema = z27.object({
|
|
3726
|
+
jsonrpc: z27.literal("2.0"),
|
|
3727
|
+
method: z27.literal("thread/identity"),
|
|
3728
|
+
params: z27.object({
|
|
3729
|
+
threadId: z27.string().optional(),
|
|
3730
|
+
providerThreadId: z27.string().optional()
|
|
3726
3731
|
}).passthrough()
|
|
3727
3732
|
}).passthrough();
|
|
3728
|
-
var threadContextWindowUsageEnvelopeSchema =
|
|
3729
|
-
jsonrpc:
|
|
3730
|
-
method:
|
|
3731
|
-
params:
|
|
3732
|
-
threadId:
|
|
3733
|
-
contextWindowUsage:
|
|
3734
|
-
usedTokens:
|
|
3735
|
-
modelContextWindow:
|
|
3736
|
-
estimated:
|
|
3733
|
+
var threadContextWindowUsageEnvelopeSchema = z27.object({
|
|
3734
|
+
jsonrpc: z27.literal("2.0"),
|
|
3735
|
+
method: z27.literal("thread/contextWindowUsage/updated"),
|
|
3736
|
+
params: z27.object({
|
|
3737
|
+
threadId: z27.string().optional(),
|
|
3738
|
+
contextWindowUsage: z27.object({
|
|
3739
|
+
usedTokens: z27.number().nullable(),
|
|
3740
|
+
modelContextWindow: z27.number().nullable(),
|
|
3741
|
+
estimated: z27.boolean()
|
|
3737
3742
|
})
|
|
3738
3743
|
}).passthrough()
|
|
3739
3744
|
}).passthrough();
|
|
3740
|
-
var errorEnvelopeSchema =
|
|
3741
|
-
jsonrpc:
|
|
3742
|
-
method:
|
|
3743
|
-
params:
|
|
3744
|
-
message:
|
|
3745
|
+
var errorEnvelopeSchema = z27.object({
|
|
3746
|
+
jsonrpc: z27.literal("2.0"),
|
|
3747
|
+
method: z27.literal("error"),
|
|
3748
|
+
params: z27.object({
|
|
3749
|
+
message: z27.string().optional()
|
|
3745
3750
|
}).passthrough().optional()
|
|
3746
3751
|
}).passthrough();
|
|
3747
3752
|
|
|
@@ -11842,7 +11847,7 @@ function sanitizeInheritedChildProcessEnv(args) {
|
|
|
11842
11847
|
var import_compare = __toESM(require_compare(), 1);
|
|
11843
11848
|
var import_valid = __toESM(require_valid(), 1);
|
|
11844
11849
|
import path8 from "node:path";
|
|
11845
|
-
import { z as
|
|
11850
|
+
import { z as z28 } from "zod";
|
|
11846
11851
|
var CLI_PROBE_TIMEOUT_MS = 5e3;
|
|
11847
11852
|
var INSTALLATION_CHECK_TIMEOUT_MS = 15e3;
|
|
11848
11853
|
async function resolveExecutablePath(command) {
|
|
@@ -11919,8 +11924,8 @@ function firstLine(value) {
|
|
|
11919
11924
|
function npmGlobalPackageVersion(value, npmPackage) {
|
|
11920
11925
|
if (value === null) return null;
|
|
11921
11926
|
try {
|
|
11922
|
-
const parsed =
|
|
11923
|
-
dependencies:
|
|
11927
|
+
const parsed = z28.object({
|
|
11928
|
+
dependencies: z28.record(z28.string(), z28.object({ version: z28.string().min(1) })).default({})
|
|
11924
11929
|
}).safeParse(JSON.parse(value));
|
|
11925
11930
|
return parsed.success ? parsed.data.dependencies[npmPackage]?.version ?? null : null;
|
|
11926
11931
|
} catch {
|
|
@@ -11971,9 +11976,9 @@ function clampPercent(value) {
|
|
|
11971
11976
|
}
|
|
11972
11977
|
|
|
11973
11978
|
// ../provider-bridge-protocol/src/bridge-kit/provider-tool-call-contract.ts
|
|
11974
|
-
import { z as
|
|
11975
|
-
var providerToolCallCancellationSchema =
|
|
11976
|
-
requestId:
|
|
11979
|
+
import { z as z29 } from "zod";
|
|
11980
|
+
var providerToolCallCancellationSchema = z29.object({
|
|
11981
|
+
requestId: z29.union([z29.string(), z29.number().int()])
|
|
11977
11982
|
});
|
|
11978
11983
|
|
|
11979
11984
|
// ../provider-bridge-protocol/src/bridge-kit/provider-visibility.ts
|
|
@@ -11988,10 +11993,10 @@ function createProviderVisibilityMetadata(args) {
|
|
|
11988
11993
|
}
|
|
11989
11994
|
|
|
11990
11995
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
11991
|
-
import { z as
|
|
11996
|
+
import { z as z31 } from "zod";
|
|
11992
11997
|
|
|
11993
11998
|
// ../provider-bridge-protocol/src/errors.ts
|
|
11994
|
-
import { z as
|
|
11999
|
+
import { z as z30 } from "zod";
|
|
11995
12000
|
var BRIDGE_JSON_RPC_ERRORS = {
|
|
11996
12001
|
INVALID_PARAMS: -32602,
|
|
11997
12002
|
METHOD_NOT_FOUND: -32601,
|
|
@@ -12001,12 +12006,12 @@ var BRIDGE_JSON_RPC_ERRORS = {
|
|
|
12001
12006
|
FORK_CHECKPOINT_UNSUPPORTED: -32003,
|
|
12002
12007
|
MISSING_EXECUTABLE: -32004
|
|
12003
12008
|
};
|
|
12004
|
-
var providerRecoveryHintSchema =
|
|
12009
|
+
var providerRecoveryHintSchema = z30.object({
|
|
12005
12010
|
kind: providerRecoveryKindSchema,
|
|
12006
|
-
message:
|
|
12007
|
-
retryable:
|
|
12011
|
+
message: z30.string().min(1),
|
|
12012
|
+
retryable: z30.boolean()
|
|
12008
12013
|
});
|
|
12009
|
-
var bridgeErrorDataSchema =
|
|
12014
|
+
var bridgeErrorDataSchema = z30.object({ recovery: providerRecoveryHintSchema.optional() }).passthrough();
|
|
12010
12015
|
|
|
12011
12016
|
// ../provider-bridge-protocol/src/bridge-kit/runtime-json-rpc.ts
|
|
12012
12017
|
var JSON_RPC_INVALID_PARAMS_CODE = -32602;
|
|
@@ -12024,7 +12029,7 @@ var ProviderResponseEncodeError = class extends Error {
|
|
|
12024
12029
|
this.name = "ProviderResponseEncodeError";
|
|
12025
12030
|
}
|
|
12026
12031
|
};
|
|
12027
|
-
var ignoredJsonRpcResultSchema =
|
|
12032
|
+
var ignoredJsonRpcResultSchema = z31.unknown();
|
|
12028
12033
|
|
|
12029
12034
|
// ../provider-bridge-protocol/src/version.ts
|
|
12030
12035
|
var PROVIDER_BRIDGE_PROTOCOL_VERSION = 2;
|
|
@@ -12032,69 +12037,69 @@ var THREAD_DELTA_GRAMMAR_V2 = PROVIDER_BRIDGE_PROTOCOL_VERSION;
|
|
|
12032
12037
|
var THREAD_DELTA_GRAMMAR_V3 = 3;
|
|
12033
12038
|
|
|
12034
12039
|
// ../provider-bridge-protocol/src/handshake.ts
|
|
12035
|
-
import { z as
|
|
12036
|
-
var bridgeGrammarVersionsSchema =
|
|
12040
|
+
import { z as z32 } from "zod";
|
|
12041
|
+
var bridgeGrammarVersionsSchema = z32.tuple([z32.number().int().positive(), z32.number().int().positive()]).refine(([min, max]) => min <= max, {
|
|
12037
12042
|
message: "grammarVersions must be an ascending [min, max] range"
|
|
12038
12043
|
});
|
|
12039
|
-
var bridgeSteerModeSchema =
|
|
12040
|
-
var bridgeCapabilitiesSchema =
|
|
12041
|
-
sessionRestore:
|
|
12042
|
-
threadArchive:
|
|
12043
|
-
threadRename:
|
|
12044
|
-
threadGoalClear:
|
|
12044
|
+
var bridgeSteerModeSchema = z32.enum(["inject", "queue"]);
|
|
12045
|
+
var bridgeCapabilitiesSchema = z32.object({
|
|
12046
|
+
sessionRestore: z32.boolean().default(false),
|
|
12047
|
+
threadArchive: z32.boolean().default(false),
|
|
12048
|
+
threadRename: z32.boolean().default(false),
|
|
12049
|
+
threadGoalClear: z32.boolean().default(false),
|
|
12045
12050
|
fork: providerForkSchema.default("none"),
|
|
12046
|
-
approvalEnforcedBy:
|
|
12051
|
+
approvalEnforcedBy: z32.enum(["runtime", "provider"]).default("runtime"),
|
|
12047
12052
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
12048
12053
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
12049
12054
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
12050
12055
|
]),
|
|
12051
12056
|
steerMode: bridgeSteerModeSchema.default("queue"),
|
|
12052
|
-
skills:
|
|
12053
|
-
commands:
|
|
12057
|
+
skills: z32.object({ configure: z32.boolean().default(false) }).default({ configure: false }),
|
|
12058
|
+
commands: z32.object({ list: z32.boolean().default(false) }).default({ list: false })
|
|
12054
12059
|
}).passthrough();
|
|
12055
|
-
var initializeParamsSchema =
|
|
12056
|
-
protocolVersion:
|
|
12057
|
-
client:
|
|
12060
|
+
var initializeParamsSchema = z32.object({
|
|
12061
|
+
protocolVersion: z32.number().int().positive(),
|
|
12062
|
+
client: z32.object({ name: z32.string().min(1), version: z32.string().min(1) }),
|
|
12058
12063
|
grammarVersions: bridgeGrammarVersionsSchema.default([
|
|
12059
12064
|
PROVIDER_BRIDGE_PROTOCOL_VERSION,
|
|
12060
12065
|
PROVIDER_BRIDGE_PROTOCOL_VERSION
|
|
12061
12066
|
])
|
|
12062
12067
|
}).passthrough();
|
|
12063
|
-
var initializeResultSchema =
|
|
12064
|
-
protocolVersion:
|
|
12065
|
-
capabilities:
|
|
12068
|
+
var initializeResultSchema = z32.object({
|
|
12069
|
+
protocolVersion: z32.number().int().positive(),
|
|
12070
|
+
capabilities: z32.preprocess(
|
|
12066
12071
|
(value) => value ?? {},
|
|
12067
12072
|
bridgeCapabilitiesSchema
|
|
12068
12073
|
)
|
|
12069
12074
|
}).passthrough();
|
|
12070
12075
|
|
|
12071
12076
|
// ../provider-bridge-protocol/src/execution-options.ts
|
|
12072
|
-
import { z as
|
|
12073
|
-
var bridgeExecutionOptionsSchema =
|
|
12074
|
-
model:
|
|
12077
|
+
import { z as z33 } from "zod";
|
|
12078
|
+
var bridgeExecutionOptionsSchema = z33.object({
|
|
12079
|
+
model: z33.string().min(1).optional(),
|
|
12075
12080
|
serviceTier: serviceTierSchema.optional(),
|
|
12076
12081
|
reasoningLevel: reasoningLevelSchema.optional(),
|
|
12077
12082
|
promptMode: promptModeSchema.optional(),
|
|
12078
12083
|
sessionOptions: sessionOptionSelectionsSchema.optional(),
|
|
12079
|
-
instructions:
|
|
12080
|
-
envVars:
|
|
12081
|
-
providerOptions:
|
|
12084
|
+
instructions: z33.string().optional(),
|
|
12085
|
+
envVars: z33.record(z33.string(), z33.string()).optional(),
|
|
12086
|
+
providerOptions: z33.record(z33.string(), z33.unknown()).optional()
|
|
12082
12087
|
}).and(runtimePermissionPolicySchema);
|
|
12083
12088
|
|
|
12084
12089
|
// ../provider-bridge-protocol/src/provider-maintenance.ts
|
|
12085
|
-
import { z as
|
|
12086
|
-
var providerMaintenanceParamsSchema =
|
|
12087
|
-
providerId:
|
|
12088
|
-
cwd:
|
|
12089
|
-
providerOptions:
|
|
12090
|
+
import { z as z34 } from "zod";
|
|
12091
|
+
var providerMaintenanceParamsSchema = z34.object({
|
|
12092
|
+
providerId: z34.string().min(1),
|
|
12093
|
+
cwd: z34.string().min(1).optional(),
|
|
12094
|
+
providerOptions: z34.record(z34.string(), z34.unknown()).optional()
|
|
12090
12095
|
}).passthrough();
|
|
12091
|
-
var providerInstallationRequirementSchema =
|
|
12096
|
+
var providerInstallationRequirementSchema = z34.enum(["thread_rewind"]);
|
|
12092
12097
|
var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
12093
12098
|
requirement: providerInstallationRequirementSchema.optional(),
|
|
12094
|
-
checkUpdates:
|
|
12099
|
+
checkUpdates: z34.boolean().default(true)
|
|
12095
12100
|
});
|
|
12096
|
-
var providerHealthSchema =
|
|
12097
|
-
status:
|
|
12101
|
+
var providerHealthSchema = z34.object({
|
|
12102
|
+
status: z34.enum([
|
|
12098
12103
|
"ready",
|
|
12099
12104
|
"not_installed",
|
|
12100
12105
|
"unauthenticated",
|
|
@@ -12102,115 +12107,115 @@ var providerHealthSchema = z33.object({
|
|
|
12102
12107
|
"unsupported_version",
|
|
12103
12108
|
"unknown"
|
|
12104
12109
|
]),
|
|
12105
|
-
statusMessage:
|
|
12106
|
-
accountEmail:
|
|
12107
|
-
planLabel:
|
|
12108
|
-
installedVersion:
|
|
12109
|
-
minimumSupportedVersion:
|
|
12110
|
-
canInstall:
|
|
12111
|
-
canUpdate:
|
|
12112
|
-
loginCommand:
|
|
12113
|
-
localLoginCommand:
|
|
12110
|
+
statusMessage: z34.string().min(1).nullable(),
|
|
12111
|
+
accountEmail: z34.string().nullable(),
|
|
12112
|
+
planLabel: z34.string().min(1).nullable(),
|
|
12113
|
+
installedVersion: z34.string().min(1).nullable(),
|
|
12114
|
+
minimumSupportedVersion: z34.string().min(1).nullable(),
|
|
12115
|
+
canInstall: z34.boolean(),
|
|
12116
|
+
canUpdate: z34.boolean(),
|
|
12117
|
+
loginCommand: z34.string().min(1).nullable(),
|
|
12118
|
+
localLoginCommand: z34.string().min(1).nullable().optional()
|
|
12114
12119
|
}).passthrough();
|
|
12115
|
-
var providerUsageWindowSchema =
|
|
12116
|
-
label:
|
|
12117
|
-
usedPercent:
|
|
12118
|
-
resetsAt:
|
|
12119
|
-
cost:
|
|
12120
|
-
usedUsdCents:
|
|
12121
|
-
limitUsdCents:
|
|
12120
|
+
var providerUsageWindowSchema = z34.object({
|
|
12121
|
+
label: z34.string().min(1),
|
|
12122
|
+
usedPercent: z34.number().min(0).max(100),
|
|
12123
|
+
resetsAt: z34.string().min(1).nullable(),
|
|
12124
|
+
cost: z34.object({
|
|
12125
|
+
usedUsdCents: z34.number().int().nonnegative(),
|
|
12126
|
+
limitUsdCents: z34.number().int().positive()
|
|
12122
12127
|
}).optional()
|
|
12123
12128
|
}).passthrough();
|
|
12124
|
-
var providerUsageSchema =
|
|
12125
|
-
|
|
12126
|
-
status:
|
|
12127
|
-
accountEmail:
|
|
12128
|
-
planLabel:
|
|
12129
|
-
windows:
|
|
12129
|
+
var providerUsageSchema = z34.discriminatedUnion("status", [
|
|
12130
|
+
z34.object({
|
|
12131
|
+
status: z34.literal("ok"),
|
|
12132
|
+
accountEmail: z34.string().email().nullable(),
|
|
12133
|
+
planLabel: z34.string().min(1).nullable(),
|
|
12134
|
+
windows: z34.array(providerUsageWindowSchema)
|
|
12130
12135
|
}).passthrough(),
|
|
12131
|
-
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
status:
|
|
12136
|
-
message:
|
|
12137
|
-
planLabel:
|
|
12138
|
-
accountEmail:
|
|
12136
|
+
z34.object({ status: z34.literal("not_installed") }).passthrough(),
|
|
12137
|
+
z34.object({ status: z34.literal("unauthenticated") }).passthrough(),
|
|
12138
|
+
z34.object({ status: z34.literal("expired") }).passthrough(),
|
|
12139
|
+
z34.object({
|
|
12140
|
+
status: z34.literal("error"),
|
|
12141
|
+
message: z34.string().min(1),
|
|
12142
|
+
planLabel: z34.string().min(1).nullable().default(null),
|
|
12143
|
+
accountEmail: z34.string().nullable().default(null)
|
|
12139
12144
|
}).passthrough()
|
|
12140
12145
|
]);
|
|
12141
|
-
var providerHealthResultSchema =
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
supported:
|
|
12146
|
+
var providerHealthResultSchema = z34.discriminatedUnion("supported", [
|
|
12147
|
+
z34.object({ supported: z34.literal(false) }).passthrough(),
|
|
12148
|
+
z34.object({
|
|
12149
|
+
supported: z34.literal(true),
|
|
12145
12150
|
health: providerHealthSchema
|
|
12146
12151
|
}).passthrough()
|
|
12147
12152
|
]);
|
|
12148
|
-
var providerUsageResultSchema =
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
supported:
|
|
12153
|
+
var providerUsageResultSchema = z34.discriminatedUnion("supported", [
|
|
12154
|
+
z34.object({ supported: z34.literal(false) }).passthrough(),
|
|
12155
|
+
z34.object({
|
|
12156
|
+
supported: z34.literal(true),
|
|
12152
12157
|
usage: providerUsageSchema
|
|
12153
12158
|
}).passthrough()
|
|
12154
12159
|
]);
|
|
12155
|
-
var providerInstallationActionKindSchema =
|
|
12160
|
+
var providerInstallationActionKindSchema = z34.enum([
|
|
12156
12161
|
"install",
|
|
12157
12162
|
"update"
|
|
12158
12163
|
]);
|
|
12159
|
-
var providerInstallationActionSchema =
|
|
12164
|
+
var providerInstallationActionSchema = z34.object({
|
|
12160
12165
|
kind: providerInstallationActionKindSchema,
|
|
12161
|
-
label:
|
|
12162
|
-
command:
|
|
12166
|
+
label: z34.enum(["Install", "Update"]),
|
|
12167
|
+
command: z34.string().min(1)
|
|
12163
12168
|
}).passthrough();
|
|
12164
|
-
var providerInstallationSourceSchema =
|
|
12169
|
+
var providerInstallationSourceSchema = z34.enum([
|
|
12165
12170
|
"notInstalled",
|
|
12166
12171
|
"npmGlobal",
|
|
12167
12172
|
"external"
|
|
12168
12173
|
]);
|
|
12169
|
-
var providerInstallationStatusSchema =
|
|
12170
|
-
executableName:
|
|
12171
|
-
executablePath:
|
|
12172
|
-
installed:
|
|
12174
|
+
var providerInstallationStatusSchema = z34.object({
|
|
12175
|
+
executableName: z34.string().min(1),
|
|
12176
|
+
executablePath: z34.string().min(1).nullable(),
|
|
12177
|
+
installed: z34.boolean(),
|
|
12173
12178
|
installSource: providerInstallationSourceSchema,
|
|
12174
|
-
currentVersion:
|
|
12175
|
-
latestVersion:
|
|
12176
|
-
minimumSupportedVersion:
|
|
12177
|
-
npmPackageName:
|
|
12178
|
-
npmGlobalPackageVersion:
|
|
12179
|
+
currentVersion: z34.string().min(1).nullable(),
|
|
12180
|
+
latestVersion: z34.string().min(1).nullable(),
|
|
12181
|
+
minimumSupportedVersion: z34.string().min(1).nullable(),
|
|
12182
|
+
npmPackageName: z34.string().min(1).nullable(),
|
|
12183
|
+
npmGlobalPackageVersion: z34.string().min(1).nullable(),
|
|
12179
12184
|
installAction: providerInstallationActionSchema.nullable(),
|
|
12180
|
-
needsUpdate:
|
|
12181
|
-
versionUnsupported:
|
|
12185
|
+
needsUpdate: z34.boolean(),
|
|
12186
|
+
versionUnsupported: z34.boolean()
|
|
12182
12187
|
}).passthrough();
|
|
12183
12188
|
var providerInstallationRunParamsSchema = providerMaintenanceParamsSchema.extend({
|
|
12184
12189
|
action: providerInstallationActionKindSchema
|
|
12185
12190
|
});
|
|
12186
|
-
var providerInstallationCommandSchema =
|
|
12187
|
-
command:
|
|
12188
|
-
args:
|
|
12189
|
-
displayCommand:
|
|
12191
|
+
var providerInstallationCommandSchema = z34.object({
|
|
12192
|
+
command: z34.string().min(1),
|
|
12193
|
+
args: z34.array(z34.string()).max(64),
|
|
12194
|
+
displayCommand: z34.string().min(1)
|
|
12190
12195
|
}).passthrough();
|
|
12191
|
-
var providerInstallationVerificationSchema =
|
|
12196
|
+
var providerInstallationVerificationSchema = z34.discriminatedUnion(
|
|
12192
12197
|
"kind",
|
|
12193
12198
|
[
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
kind:
|
|
12197
|
-
previousVersion:
|
|
12199
|
+
z34.object({ kind: z34.literal("installed") }).passthrough(),
|
|
12200
|
+
z34.object({
|
|
12201
|
+
kind: z34.literal("version_changed"),
|
|
12202
|
+
previousVersion: z34.string().min(1)
|
|
12198
12203
|
}).passthrough(),
|
|
12199
|
-
|
|
12200
|
-
kind:
|
|
12201
|
-
version:
|
|
12204
|
+
z34.object({
|
|
12205
|
+
kind: z34.literal("version_at_least"),
|
|
12206
|
+
version: z34.string().min(1)
|
|
12202
12207
|
}).passthrough()
|
|
12203
12208
|
]
|
|
12204
12209
|
);
|
|
12205
|
-
var providerInstallationRunResultSchema =
|
|
12210
|
+
var providerInstallationRunResultSchema = z34.discriminatedUnion(
|
|
12206
12211
|
"available",
|
|
12207
12212
|
[
|
|
12208
|
-
|
|
12209
|
-
available:
|
|
12210
|
-
message:
|
|
12213
|
+
z34.object({
|
|
12214
|
+
available: z34.literal(false),
|
|
12215
|
+
message: z34.string().min(1)
|
|
12211
12216
|
}).passthrough(),
|
|
12212
|
-
|
|
12213
|
-
available:
|
|
12217
|
+
z34.object({
|
|
12218
|
+
available: z34.literal(true),
|
|
12214
12219
|
command: providerInstallationCommandSchema,
|
|
12215
12220
|
verification: providerInstallationVerificationSchema
|
|
12216
12221
|
}).passthrough()
|
|
@@ -12218,7 +12223,7 @@ var providerInstallationRunResultSchema = z33.discriminatedUnion(
|
|
|
12218
12223
|
);
|
|
12219
12224
|
|
|
12220
12225
|
// ../provider-bridge-protocol/src/requests.ts
|
|
12221
|
-
import { z as
|
|
12226
|
+
import { z as z35 } from "zod";
|
|
12222
12227
|
var BRIDGE_REQUEST_METHODS = {
|
|
12223
12228
|
initialize: "initialize",
|
|
12224
12229
|
modelList: "model/list",
|
|
@@ -12241,84 +12246,84 @@ var BRIDGE_REQUEST_METHODS = {
|
|
|
12241
12246
|
skillsConfigure: "skills/configure"
|
|
12242
12247
|
};
|
|
12243
12248
|
var sessionConstructionFields = {
|
|
12244
|
-
threadId:
|
|
12245
|
-
cwd:
|
|
12249
|
+
threadId: z35.string().min(1),
|
|
12250
|
+
cwd: z35.string().min(1),
|
|
12246
12251
|
options: bridgeExecutionOptionsSchema,
|
|
12247
|
-
dynamicTools:
|
|
12248
|
-
disallowedTools:
|
|
12252
|
+
dynamicTools: z35.array(dynamicToolSchema).optional(),
|
|
12253
|
+
disallowedTools: z35.array(z35.string().min(1)).optional(),
|
|
12249
12254
|
instructionMode: instructionModeSchema
|
|
12250
12255
|
};
|
|
12251
|
-
var modelListParamsSchema =
|
|
12252
|
-
cwd:
|
|
12253
|
-
envVars:
|
|
12254
|
-
selectedModel:
|
|
12256
|
+
var modelListParamsSchema = z35.object({
|
|
12257
|
+
cwd: z35.string().min(1).optional(),
|
|
12258
|
+
envVars: z35.record(z35.string(), z35.string()).optional(),
|
|
12259
|
+
selectedModel: z35.string().min(1).optional()
|
|
12255
12260
|
}).passthrough();
|
|
12256
|
-
var commandListParamsSchema =
|
|
12261
|
+
var commandListParamsSchema = z35.object({ cwd: z35.string().min(1) }).passthrough();
|
|
12257
12262
|
var commandListResultSchema = threadProviderCommandsStateSchema;
|
|
12258
|
-
var threadStartParamsSchema =
|
|
12263
|
+
var threadStartParamsSchema = z35.object({
|
|
12259
12264
|
...sessionConstructionFields,
|
|
12260
|
-
input:
|
|
12265
|
+
input: z35.array(promptInputSchema).optional()
|
|
12261
12266
|
}).passthrough();
|
|
12262
|
-
var threadResumeParamsSchema =
|
|
12267
|
+
var threadResumeParamsSchema = z35.object({
|
|
12263
12268
|
...sessionConstructionFields,
|
|
12264
|
-
providerThreadId:
|
|
12269
|
+
providerThreadId: z35.string().min(1)
|
|
12265
12270
|
}).passthrough();
|
|
12266
|
-
var threadForkParamsSchema =
|
|
12271
|
+
var threadForkParamsSchema = z35.object({
|
|
12267
12272
|
...sessionConstructionFields,
|
|
12268
|
-
sourceProviderThreadId:
|
|
12269
|
-
sourceProviderCheckpointId:
|
|
12273
|
+
sourceProviderThreadId: z35.string().min(1),
|
|
12274
|
+
sourceProviderCheckpointId: z35.string().min(1).optional()
|
|
12270
12275
|
}).passthrough();
|
|
12271
|
-
var threadStopParamsSchema =
|
|
12272
|
-
threadId:
|
|
12273
|
-
providerThreadId:
|
|
12274
|
-
intent:
|
|
12275
|
-
activeTurnId:
|
|
12276
|
+
var threadStopParamsSchema = z35.object({
|
|
12277
|
+
threadId: z35.string().min(1),
|
|
12278
|
+
providerThreadId: z35.string().min(1),
|
|
12279
|
+
intent: z35.enum(["interrupt", "release"]),
|
|
12280
|
+
activeTurnId: z35.string().min(1).nullable()
|
|
12276
12281
|
}).passthrough();
|
|
12277
|
-
var threadRefParams =
|
|
12278
|
-
threadId:
|
|
12279
|
-
providerThreadId:
|
|
12282
|
+
var threadRefParams = z35.object({
|
|
12283
|
+
threadId: z35.string().min(1),
|
|
12284
|
+
providerThreadId: z35.string().min(1)
|
|
12280
12285
|
}).passthrough();
|
|
12281
12286
|
var threadDiscardParamsSchema = threadRefParams;
|
|
12282
12287
|
var threadArchiveParamsSchema = threadRefParams;
|
|
12283
12288
|
var threadUnarchiveParamsSchema = threadRefParams;
|
|
12284
12289
|
var threadGoalClearParamsSchema = threadRefParams;
|
|
12285
|
-
var threadNameSetParamsSchema =
|
|
12286
|
-
threadId:
|
|
12287
|
-
providerThreadId:
|
|
12288
|
-
title:
|
|
12290
|
+
var threadNameSetParamsSchema = z35.object({
|
|
12291
|
+
threadId: z35.string().min(1),
|
|
12292
|
+
providerThreadId: z35.string().min(1),
|
|
12293
|
+
title: z35.string().min(1)
|
|
12289
12294
|
}).passthrough();
|
|
12290
12295
|
var turnInputFields = {
|
|
12291
|
-
threadId:
|
|
12292
|
-
providerThreadId:
|
|
12293
|
-
input:
|
|
12296
|
+
threadId: z35.string().min(1),
|
|
12297
|
+
providerThreadId: z35.string().min(1),
|
|
12298
|
+
input: z35.array(promptInputSchema),
|
|
12294
12299
|
clientRequestId: clientTurnRequestIdSchema,
|
|
12295
12300
|
options: bridgeExecutionOptionsSchema
|
|
12296
12301
|
};
|
|
12297
|
-
var turnStartParamsSchema =
|
|
12298
|
-
var turnSteerParamsSchema =
|
|
12302
|
+
var turnStartParamsSchema = z35.object(turnInputFields).passthrough();
|
|
12303
|
+
var turnSteerParamsSchema = z35.object({
|
|
12299
12304
|
...turnInputFields,
|
|
12300
|
-
expectedTurnId:
|
|
12305
|
+
expectedTurnId: z35.string().min(1)
|
|
12301
12306
|
}).passthrough();
|
|
12302
|
-
var skillsConfigureRootSchema =
|
|
12303
|
-
id:
|
|
12304
|
-
path:
|
|
12305
|
-
skills:
|
|
12306
|
-
|
|
12307
|
-
name:
|
|
12308
|
-
description:
|
|
12307
|
+
var skillsConfigureRootSchema = z35.object({
|
|
12308
|
+
id: z35.string().min(1),
|
|
12309
|
+
path: z35.string().min(1),
|
|
12310
|
+
skills: z35.array(
|
|
12311
|
+
z35.object({
|
|
12312
|
+
name: z35.string().min(1),
|
|
12313
|
+
description: z35.string()
|
|
12309
12314
|
}).passthrough()
|
|
12310
12315
|
)
|
|
12311
12316
|
}).passthrough();
|
|
12312
|
-
var skillsConfigureParamsSchema =
|
|
12313
|
-
roots:
|
|
12317
|
+
var skillsConfigureParamsSchema = z35.object({
|
|
12318
|
+
roots: z35.array(skillsConfigureRootSchema)
|
|
12314
12319
|
}).passthrough();
|
|
12315
|
-
var threadIdentityResultSchema =
|
|
12316
|
-
providerThreadId:
|
|
12317
|
-
sessionRestorable:
|
|
12320
|
+
var threadIdentityResultSchema = z35.object({
|
|
12321
|
+
providerThreadId: z35.string().min(1),
|
|
12322
|
+
sessionRestorable: z35.boolean().optional()
|
|
12318
12323
|
}).passthrough();
|
|
12319
12324
|
|
|
12320
12325
|
// ../provider-bridge-protocol/src/notifications.ts
|
|
12321
|
-
import { z as
|
|
12326
|
+
import { z as z36 } from "zod";
|
|
12322
12327
|
var BRIDGE_NOTIFICATION_METHODS = {
|
|
12323
12328
|
threadIdentity: "thread/identity",
|
|
12324
12329
|
sessionReplaced: "session/replaced",
|
|
@@ -12326,143 +12331,143 @@ var BRIDGE_NOTIFICATION_METHODS = {
|
|
|
12326
12331
|
providerRecovery: "provider/recovery",
|
|
12327
12332
|
error: "error"
|
|
12328
12333
|
};
|
|
12329
|
-
var threadIdentityNotificationSchema =
|
|
12330
|
-
threadId:
|
|
12331
|
-
providerThreadId:
|
|
12332
|
-
sessionRestorable:
|
|
12334
|
+
var threadIdentityNotificationSchema = z36.object({
|
|
12335
|
+
threadId: z36.string().min(1),
|
|
12336
|
+
providerThreadId: z36.string().min(1),
|
|
12337
|
+
sessionRestorable: z36.boolean().optional()
|
|
12333
12338
|
}).passthrough();
|
|
12334
|
-
var sessionReplacedNotificationSchema =
|
|
12335
|
-
threadId:
|
|
12336
|
-
providerThreadId:
|
|
12337
|
-
reason:
|
|
12338
|
-
contextLost:
|
|
12339
|
-
showRuntimeNote:
|
|
12339
|
+
var sessionReplacedNotificationSchema = z36.object({
|
|
12340
|
+
threadId: z36.string().min(1),
|
|
12341
|
+
providerThreadId: z36.string().min(1).nullable(),
|
|
12342
|
+
reason: z36.string().min(1),
|
|
12343
|
+
contextLost: z36.boolean().default(false),
|
|
12344
|
+
showRuntimeNote: z36.boolean().default(false)
|
|
12340
12345
|
}).passthrough();
|
|
12341
|
-
var providerRecoveryNotificationSchema =
|
|
12342
|
-
threadId:
|
|
12346
|
+
var providerRecoveryNotificationSchema = z36.object({
|
|
12347
|
+
threadId: z36.string().min(1).optional(),
|
|
12343
12348
|
...providerRecoveryHintSchema.shape
|
|
12344
12349
|
}).passthrough();
|
|
12345
|
-
var errorNotificationSchema =
|
|
12346
|
-
threadId:
|
|
12347
|
-
providerThreadId:
|
|
12348
|
-
message:
|
|
12350
|
+
var errorNotificationSchema = z36.object({
|
|
12351
|
+
threadId: z36.string().min(1).optional(),
|
|
12352
|
+
providerThreadId: z36.string().min(1).optional(),
|
|
12353
|
+
message: z36.string().min(1)
|
|
12349
12354
|
}).passthrough();
|
|
12350
12355
|
|
|
12351
12356
|
// ../provider-bridge-protocol/src/thread-delta.ts
|
|
12352
|
-
import { z as
|
|
12357
|
+
import { z as z37 } from "zod";
|
|
12353
12358
|
var THREAD_DELTA_NOTIFICATION_METHOD = "thread/delta";
|
|
12354
12359
|
var deltaPresentationSchema = threadEventItemPresentationSchema;
|
|
12355
12360
|
var THREAD_DELTA_KEY_SEPARATOR = "";
|
|
12356
|
-
var deltaKeyPartSchema =
|
|
12361
|
+
var deltaKeyPartSchema = z37.string().min(1).refine((value) => !value.includes(THREAD_DELTA_KEY_SEPARATOR), {
|
|
12357
12362
|
message: "provider keys must not contain the internal key separator (\\u001f)"
|
|
12358
12363
|
});
|
|
12359
|
-
var deltaItemKeySchema =
|
|
12364
|
+
var deltaItemKeySchema = z37.object({
|
|
12360
12365
|
providerItemId: deltaKeyPartSchema.optional(),
|
|
12361
12366
|
channel: deltaKeyPartSchema.optional(),
|
|
12362
12367
|
parentRef: deltaKeyPartSchema.optional()
|
|
12363
12368
|
});
|
|
12364
12369
|
var providerTurnIdSchema = deltaKeyPartSchema;
|
|
12365
|
-
var deltaFileChangeSchema =
|
|
12366
|
-
path:
|
|
12367
|
-
kind:
|
|
12368
|
-
movePath:
|
|
12369
|
-
diff:
|
|
12370
|
-
oldText:
|
|
12371
|
-
newText:
|
|
12372
|
-
});
|
|
12373
|
-
var deltaBackgroundTaskShapeSchema =
|
|
12374
|
-
type:
|
|
12375
|
-
familyId:
|
|
12376
|
-
taskType:
|
|
12377
|
-
description:
|
|
12370
|
+
var deltaFileChangeSchema = z37.object({
|
|
12371
|
+
path: z37.string(),
|
|
12372
|
+
kind: z37.enum(["add", "update", "delete"]),
|
|
12373
|
+
movePath: z37.string().optional(),
|
|
12374
|
+
diff: z37.string().optional(),
|
|
12375
|
+
oldText: z37.string().optional(),
|
|
12376
|
+
newText: z37.string().optional()
|
|
12377
|
+
});
|
|
12378
|
+
var deltaBackgroundTaskShapeSchema = z37.object({
|
|
12379
|
+
type: z37.literal("backgroundTask"),
|
|
12380
|
+
familyId: z37.string().min(1),
|
|
12381
|
+
taskType: z37.string(),
|
|
12382
|
+
description: z37.string(),
|
|
12378
12383
|
status: threadEventItemStatusSchema,
|
|
12379
12384
|
taskStatus: backgroundTaskStatusSchema,
|
|
12380
|
-
skipTranscript:
|
|
12381
|
-
foreground:
|
|
12382
|
-
workflowName:
|
|
12385
|
+
skipTranscript: z37.boolean(),
|
|
12386
|
+
foreground: z37.boolean().optional(),
|
|
12387
|
+
workflowName: z37.string().optional(),
|
|
12383
12388
|
workflow: workflowProgressSnapshotSchema.optional(),
|
|
12384
12389
|
usage: backgroundTaskUsageSchema.optional(),
|
|
12385
|
-
summary:
|
|
12386
|
-
error:
|
|
12387
|
-
outputFile:
|
|
12390
|
+
summary: z37.string().optional(),
|
|
12391
|
+
error: z37.string().optional(),
|
|
12392
|
+
outputFile: z37.string().optional()
|
|
12388
12393
|
});
|
|
12389
|
-
var deltaFileReadShapeSchema =
|
|
12390
|
-
type:
|
|
12391
|
-
path:
|
|
12392
|
-
cmd:
|
|
12394
|
+
var deltaFileReadShapeSchema = z37.object({
|
|
12395
|
+
type: z37.literal("fileRead"),
|
|
12396
|
+
path: z37.string(),
|
|
12397
|
+
cmd: z37.string().optional()
|
|
12393
12398
|
});
|
|
12394
|
-
var deltaSearchShapeSchema =
|
|
12395
|
-
type:
|
|
12399
|
+
var deltaSearchShapeSchema = z37.object({
|
|
12400
|
+
type: z37.literal("search"),
|
|
12396
12401
|
mode: threadEventSearchModeSchema,
|
|
12397
|
-
query:
|
|
12398
|
-
path:
|
|
12399
|
-
cmd:
|
|
12402
|
+
query: z37.string(),
|
|
12403
|
+
path: z37.string().optional(),
|
|
12404
|
+
cmd: z37.string().optional()
|
|
12400
12405
|
});
|
|
12401
|
-
var deltaDelegationShapeSchema =
|
|
12402
|
-
type:
|
|
12406
|
+
var deltaDelegationShapeSchema = z37.object({
|
|
12407
|
+
type: z37.literal("delegation"),
|
|
12403
12408
|
childRef: deltaKeyPartSchema,
|
|
12404
|
-
label:
|
|
12405
|
-
background:
|
|
12406
|
-
summary:
|
|
12409
|
+
label: z37.string(),
|
|
12410
|
+
background: z37.boolean(),
|
|
12411
|
+
summary: z37.string().optional()
|
|
12407
12412
|
});
|
|
12408
|
-
var deltaPlanStepsShapeSchema =
|
|
12409
|
-
type:
|
|
12410
|
-
steps:
|
|
12411
|
-
explanation:
|
|
12413
|
+
var deltaPlanStepsShapeSchema = z37.object({
|
|
12414
|
+
type: z37.literal("planSteps"),
|
|
12415
|
+
steps: z37.array(threadEventPlanStepSchema),
|
|
12416
|
+
explanation: z37.string().optional()
|
|
12412
12417
|
});
|
|
12413
|
-
var deltaExtensionShapeSchema =
|
|
12414
|
-
type:
|
|
12418
|
+
var deltaExtensionShapeSchema = z37.object({
|
|
12419
|
+
type: z37.literal("extension"),
|
|
12415
12420
|
kind: extensionKindSchema,
|
|
12416
12421
|
payload: jsonValueSchema
|
|
12417
12422
|
});
|
|
12418
|
-
var deltaItemShapeSchema =
|
|
12419
|
-
|
|
12420
|
-
type:
|
|
12421
|
-
command:
|
|
12422
|
-
cwd:
|
|
12423
|
-
aggregatedOutput:
|
|
12424
|
-
exitCode:
|
|
12425
|
-
durationMs:
|
|
12423
|
+
var deltaItemShapeSchema = z37.discriminatedUnion("type", [
|
|
12424
|
+
z37.object({
|
|
12425
|
+
type: z37.literal("command"),
|
|
12426
|
+
command: z37.string(),
|
|
12427
|
+
cwd: z37.string(),
|
|
12428
|
+
aggregatedOutput: z37.string().optional(),
|
|
12429
|
+
exitCode: z37.number().optional(),
|
|
12430
|
+
durationMs: z37.number().optional()
|
|
12426
12431
|
}),
|
|
12427
|
-
|
|
12428
|
-
type:
|
|
12429
|
-
changes:
|
|
12432
|
+
z37.object({
|
|
12433
|
+
type: z37.literal("fileChange"),
|
|
12434
|
+
changes: z37.array(deltaFileChangeSchema)
|
|
12430
12435
|
}),
|
|
12431
|
-
|
|
12432
|
-
type:
|
|
12433
|
-
tool:
|
|
12434
|
-
server:
|
|
12435
|
-
args:
|
|
12436
|
-
result:
|
|
12437
|
-
error:
|
|
12438
|
-
durationMs:
|
|
12436
|
+
z37.object({
|
|
12437
|
+
type: z37.literal("tool"),
|
|
12438
|
+
tool: z37.string(),
|
|
12439
|
+
server: z37.string().optional(),
|
|
12440
|
+
args: z37.unknown().optional(),
|
|
12441
|
+
result: z37.unknown().optional(),
|
|
12442
|
+
error: z37.string().optional(),
|
|
12443
|
+
durationMs: z37.number().optional()
|
|
12439
12444
|
}),
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
type:
|
|
12444
|
-
summary:
|
|
12445
|
-
content:
|
|
12445
|
+
z37.object({ type: z37.literal("compaction") }),
|
|
12446
|
+
z37.object({ type: z37.literal("agentMessage"), text: z37.string() }),
|
|
12447
|
+
z37.object({
|
|
12448
|
+
type: z37.literal("reasoning"),
|
|
12449
|
+
summary: z37.array(z37.string()),
|
|
12450
|
+
content: z37.array(z37.string())
|
|
12446
12451
|
}),
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
type:
|
|
12450
|
-
queries:
|
|
12452
|
+
z37.object({ type: z37.literal("plan"), text: z37.string() }),
|
|
12453
|
+
z37.object({
|
|
12454
|
+
type: z37.literal("webSearch"),
|
|
12455
|
+
queries: z37.array(z37.string()).min(1)
|
|
12451
12456
|
}),
|
|
12452
|
-
|
|
12453
|
-
type:
|
|
12454
|
-
url:
|
|
12455
|
-
prompt:
|
|
12456
|
-
pattern:
|
|
12457
|
+
z37.object({
|
|
12458
|
+
type: z37.literal("webFetch"),
|
|
12459
|
+
url: z37.string(),
|
|
12460
|
+
prompt: z37.string().nullable().optional(),
|
|
12461
|
+
pattern: z37.string().nullable()
|
|
12457
12462
|
}),
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
type:
|
|
12461
|
-
prompt:
|
|
12462
|
-
path:
|
|
12463
|
-
result:
|
|
12464
|
-
error:
|
|
12465
|
-
transparentBackground:
|
|
12463
|
+
z37.object({ type: z37.literal("imageView"), path: z37.string() }),
|
|
12464
|
+
z37.object({
|
|
12465
|
+
type: z37.literal("imageGeneration"),
|
|
12466
|
+
prompt: z37.string().nullable(),
|
|
12467
|
+
path: z37.string().nullable(),
|
|
12468
|
+
result: z37.string().optional(),
|
|
12469
|
+
error: z37.string().nullable(),
|
|
12470
|
+
transparentBackground: z37.boolean()
|
|
12466
12471
|
}),
|
|
12467
12472
|
deltaBackgroundTaskShapeSchema,
|
|
12468
12473
|
deltaFileReadShapeSchema,
|
|
@@ -12471,22 +12476,22 @@ var deltaItemShapeSchema = z36.discriminatedUnion("type", [
|
|
|
12471
12476
|
deltaPlanStepsShapeSchema,
|
|
12472
12477
|
deltaExtensionShapeSchema
|
|
12473
12478
|
]);
|
|
12474
|
-
var deltaProgressSnapshotSchema =
|
|
12479
|
+
var deltaProgressSnapshotSchema = z37.discriminatedUnion("type", [
|
|
12475
12480
|
deltaBackgroundTaskShapeSchema,
|
|
12476
12481
|
deltaDelegationShapeSchema
|
|
12477
12482
|
]);
|
|
12478
|
-
var deltaTextChannelSchema =
|
|
12483
|
+
var deltaTextChannelSchema = z37.enum([
|
|
12479
12484
|
"agentMessage",
|
|
12480
12485
|
"reasoningSummary",
|
|
12481
12486
|
"reasoningText",
|
|
12482
12487
|
"plan"
|
|
12483
12488
|
]);
|
|
12484
|
-
var deltaOutputChannelSchema =
|
|
12485
|
-
var deltaErrorSchema =
|
|
12486
|
-
var deltaAttachSchema =
|
|
12487
|
-
var deltaNoTurnFallbackSchema =
|
|
12489
|
+
var deltaOutputChannelSchema = z37.enum(["command", "fileChange"]);
|
|
12490
|
+
var deltaErrorSchema = z37.object({ message: z37.string() });
|
|
12491
|
+
var deltaAttachSchema = z37.enum(["open", "currentOrLast"]);
|
|
12492
|
+
var deltaNoTurnFallbackSchema = z37.object({
|
|
12488
12493
|
raw: providerRawEventSchema,
|
|
12489
|
-
rawType:
|
|
12494
|
+
rawType: z37.string()
|
|
12490
12495
|
});
|
|
12491
12496
|
function requireExtensionPresentation(delta, ctx) {
|
|
12492
12497
|
if (delta.item.type === "extension" && delta.presentation === void 0) {
|
|
@@ -12497,36 +12502,36 @@ function requireExtensionPresentation(delta, ctx) {
|
|
|
12497
12502
|
});
|
|
12498
12503
|
}
|
|
12499
12504
|
}
|
|
12500
|
-
var threadDeltaSchema =
|
|
12501
|
-
|
|
12502
|
-
kind:
|
|
12505
|
+
var threadDeltaSchema = z37.discriminatedUnion("kind", [
|
|
12506
|
+
z37.object({
|
|
12507
|
+
kind: z37.literal("input.accepted"),
|
|
12503
12508
|
clientRequestId: clientTurnRequestIdSchema,
|
|
12504
12509
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12505
12510
|
}),
|
|
12506
|
-
|
|
12507
|
-
kind:
|
|
12508
|
-
text:
|
|
12511
|
+
z37.object({
|
|
12512
|
+
kind: z37.literal("input.provider"),
|
|
12513
|
+
text: z37.string().min(1),
|
|
12509
12514
|
parentRef: deltaKeyPartSchema.optional()
|
|
12510
12515
|
}),
|
|
12511
|
-
|
|
12512
|
-
kind:
|
|
12516
|
+
z37.object({
|
|
12517
|
+
kind: z37.literal("turn.open"),
|
|
12513
12518
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12514
12519
|
parentRef: deltaKeyPartSchema.optional()
|
|
12515
12520
|
}),
|
|
12516
|
-
|
|
12517
|
-
kind:
|
|
12518
|
-
state:
|
|
12521
|
+
z37.object({
|
|
12522
|
+
kind: z37.literal("turn.mainRun"),
|
|
12523
|
+
state: z37.enum(["idle", "running"])
|
|
12519
12524
|
}),
|
|
12520
|
-
|
|
12521
|
-
kind:
|
|
12525
|
+
z37.object({
|
|
12526
|
+
kind: z37.literal("turn.boundary"),
|
|
12522
12527
|
status: threadEventTurnStatusSchema,
|
|
12523
12528
|
error: deltaErrorSchema.optional(),
|
|
12524
|
-
providerCheckpointId:
|
|
12525
|
-
claimIfIdle:
|
|
12529
|
+
providerCheckpointId: z37.string().min(1).optional(),
|
|
12530
|
+
claimIfIdle: z37.boolean().optional(),
|
|
12526
12531
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12527
12532
|
}),
|
|
12528
|
-
|
|
12529
|
-
kind:
|
|
12533
|
+
z37.object({
|
|
12534
|
+
kind: z37.literal("item.open"),
|
|
12530
12535
|
key: deltaItemKeySchema,
|
|
12531
12536
|
item: deltaItemShapeSchema,
|
|
12532
12537
|
presentation: deltaPresentationSchema.optional(),
|
|
@@ -12534,153 +12539,153 @@ var threadDeltaSchema = z36.discriminatedUnion("kind", [
|
|
|
12534
12539
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12535
12540
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12536
12541
|
}).superRefine(requireExtensionPresentation),
|
|
12537
|
-
|
|
12538
|
-
kind:
|
|
12542
|
+
z37.object({
|
|
12543
|
+
kind: z37.literal("item.close"),
|
|
12539
12544
|
key: deltaItemKeySchema,
|
|
12540
12545
|
status: threadEventItemStatusSchema,
|
|
12541
|
-
resultText:
|
|
12542
|
-
exitCode:
|
|
12543
|
-
aggregatedOutput:
|
|
12544
|
-
approvalStatus:
|
|
12546
|
+
resultText: z37.string().optional(),
|
|
12547
|
+
exitCode: z37.number().optional(),
|
|
12548
|
+
aggregatedOutput: z37.string().optional(),
|
|
12549
|
+
approvalStatus: z37.literal("denied").optional(),
|
|
12545
12550
|
item: deltaItemShapeSchema,
|
|
12546
12551
|
presentation: deltaPresentationSchema.optional(),
|
|
12547
12552
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12548
12553
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12549
12554
|
}).superRefine(requireExtensionPresentation),
|
|
12550
|
-
|
|
12551
|
-
kind:
|
|
12555
|
+
z37.object({
|
|
12556
|
+
kind: z37.literal("item.progress"),
|
|
12552
12557
|
key: deltaItemKeySchema,
|
|
12553
|
-
message:
|
|
12558
|
+
message: z37.string().optional(),
|
|
12554
12559
|
snapshot: deltaProgressSnapshotSchema.optional(),
|
|
12555
|
-
flush:
|
|
12560
|
+
flush: z37.boolean().optional(),
|
|
12556
12561
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12557
12562
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12558
12563
|
}),
|
|
12559
|
-
|
|
12560
|
-
kind:
|
|
12564
|
+
z37.object({
|
|
12565
|
+
kind: z37.literal("item.textDelta"),
|
|
12561
12566
|
key: deltaItemKeySchema,
|
|
12562
12567
|
channel: deltaTextChannelSchema,
|
|
12563
|
-
text:
|
|
12568
|
+
text: z37.string(),
|
|
12564
12569
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12565
12570
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12566
12571
|
}),
|
|
12567
|
-
|
|
12568
|
-
kind:
|
|
12572
|
+
z37.object({
|
|
12573
|
+
kind: z37.literal("item.textClose"),
|
|
12569
12574
|
key: deltaItemKeySchema,
|
|
12570
12575
|
channel: deltaTextChannelSchema,
|
|
12571
|
-
text:
|
|
12576
|
+
text: z37.string().optional(),
|
|
12572
12577
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12573
12578
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12574
12579
|
}),
|
|
12575
|
-
|
|
12576
|
-
kind:
|
|
12580
|
+
z37.object({
|
|
12581
|
+
kind: z37.literal("item.outputDelta"),
|
|
12577
12582
|
key: deltaItemKeySchema,
|
|
12578
12583
|
channel: deltaOutputChannelSchema,
|
|
12579
|
-
text:
|
|
12584
|
+
text: z37.string(),
|
|
12580
12585
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12581
12586
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12582
12587
|
}),
|
|
12583
|
-
|
|
12584
|
-
kind:
|
|
12588
|
+
z37.object({
|
|
12589
|
+
kind: z37.literal("command.outputSnapshot"),
|
|
12585
12590
|
key: deltaItemKeySchema,
|
|
12586
|
-
text:
|
|
12591
|
+
text: z37.string(),
|
|
12587
12592
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12588
12593
|
}),
|
|
12589
|
-
|
|
12590
|
-
kind:
|
|
12594
|
+
z37.object({
|
|
12595
|
+
kind: z37.literal("usage"),
|
|
12591
12596
|
total: threadEventTokenUsageBreakdownSchema,
|
|
12592
12597
|
last: threadEventTokenUsageBreakdownSchema,
|
|
12593
|
-
modelContextWindow:
|
|
12598
|
+
modelContextWindow: z37.number().nullable(),
|
|
12594
12599
|
promptCacheTtlMs: promptCacheTtlMsSchema.optional(),
|
|
12595
12600
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12596
12601
|
}),
|
|
12597
|
-
|
|
12598
|
-
kind:
|
|
12602
|
+
z37.object({
|
|
12603
|
+
kind: z37.literal("contextWindow"),
|
|
12599
12604
|
snapshot: contextSnapshotSchema.optional(),
|
|
12600
|
-
used:
|
|
12601
|
-
size:
|
|
12602
|
-
estimated:
|
|
12605
|
+
used: z37.number().nullable(),
|
|
12606
|
+
size: z37.number().nullable().optional(),
|
|
12607
|
+
estimated: z37.boolean(),
|
|
12603
12608
|
cost: threadUsageCostSchema.optional(),
|
|
12604
12609
|
attach: deltaAttachSchema,
|
|
12605
12610
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12606
12611
|
}),
|
|
12607
|
-
|
|
12608
|
-
kind:
|
|
12612
|
+
z37.object({
|
|
12613
|
+
kind: z37.literal("context.compacted"),
|
|
12609
12614
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12610
12615
|
noTurnFallback: deltaNoTurnFallbackSchema.optional()
|
|
12611
12616
|
}),
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
kind:
|
|
12615
|
-
diff:
|
|
12617
|
+
z37.object({ kind: z37.literal("context.cleared") }),
|
|
12618
|
+
z37.object({
|
|
12619
|
+
kind: z37.literal("turn.diff"),
|
|
12620
|
+
diff: z37.string(),
|
|
12616
12621
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12617
12622
|
}),
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
kind:
|
|
12621
|
-
providerThreadId:
|
|
12623
|
+
z37.object({ kind: z37.literal("thread.started") }),
|
|
12624
|
+
z37.object({
|
|
12625
|
+
kind: z37.literal("thread.identity"),
|
|
12626
|
+
providerThreadId: z37.string().min(1)
|
|
12622
12627
|
}),
|
|
12623
|
-
|
|
12624
|
-
kind:
|
|
12625
|
-
name:
|
|
12626
|
-
source:
|
|
12628
|
+
z37.object({
|
|
12629
|
+
kind: z37.literal("thread.name"),
|
|
12630
|
+
name: z37.string().min(1),
|
|
12631
|
+
source: z37.literal("agent").optional()
|
|
12627
12632
|
}),
|
|
12628
|
-
|
|
12629
|
-
kind:
|
|
12633
|
+
z37.object({
|
|
12634
|
+
kind: z37.literal("extension.state"),
|
|
12630
12635
|
extensionKind: extensionKindSchema,
|
|
12631
12636
|
payload: jsonValueSchema
|
|
12632
12637
|
}),
|
|
12633
|
-
|
|
12634
|
-
kind:
|
|
12638
|
+
z37.object({
|
|
12639
|
+
kind: z37.literal("provider.rateLimits"),
|
|
12635
12640
|
rateLimits: providerRateLimitStateSchema
|
|
12636
12641
|
}),
|
|
12637
|
-
|
|
12638
|
-
kind:
|
|
12639
|
-
message:
|
|
12640
|
-
detail:
|
|
12641
|
-
willRetry:
|
|
12642
|
+
z37.object({
|
|
12643
|
+
kind: z37.literal("provider.error"),
|
|
12644
|
+
message: z37.string(),
|
|
12645
|
+
detail: z37.string().optional(),
|
|
12646
|
+
willRetry: z37.boolean().optional(),
|
|
12642
12647
|
category: providerErrorCategorySchema.optional(),
|
|
12643
12648
|
errorInfo: providerErrorInfoSchema.optional(),
|
|
12644
|
-
settlesTurn:
|
|
12649
|
+
settlesTurn: z37.boolean().optional(),
|
|
12645
12650
|
providerTurnId: providerTurnIdSchema.optional(),
|
|
12646
|
-
threadScoped:
|
|
12651
|
+
threadScoped: z37.boolean().optional()
|
|
12647
12652
|
}),
|
|
12648
|
-
|
|
12649
|
-
kind:
|
|
12650
|
-
originalModel:
|
|
12651
|
-
fallbackModel:
|
|
12652
|
-
reason:
|
|
12653
|
-
message:
|
|
12653
|
+
z37.object({
|
|
12654
|
+
kind: z37.literal("provider.modelFallback"),
|
|
12655
|
+
originalModel: z37.string().min(1),
|
|
12656
|
+
fallbackModel: z37.string().min(1),
|
|
12657
|
+
reason: z37.enum(["refusal", "provider"]),
|
|
12658
|
+
message: z37.string()
|
|
12654
12659
|
}),
|
|
12655
|
-
|
|
12656
|
-
kind:
|
|
12657
|
-
summary:
|
|
12658
|
-
details:
|
|
12660
|
+
z37.object({
|
|
12661
|
+
kind: z37.literal("provider.warning"),
|
|
12662
|
+
summary: z37.string().optional(),
|
|
12663
|
+
details: z37.string().optional(),
|
|
12659
12664
|
category: threadEventWarningCategorySchema.optional(),
|
|
12660
|
-
vouchedTurn:
|
|
12665
|
+
vouchedTurn: z37.boolean().optional()
|
|
12661
12666
|
}),
|
|
12662
|
-
|
|
12663
|
-
kind:
|
|
12667
|
+
z37.object({
|
|
12668
|
+
kind: z37.literal("unhandled"),
|
|
12664
12669
|
raw: providerRawEventSchema,
|
|
12665
|
-
rawType:
|
|
12666
|
-
vouchedTurn:
|
|
12667
|
-
onlyIfNoTurn:
|
|
12670
|
+
rawType: z37.string(),
|
|
12671
|
+
vouchedTurn: z37.boolean(),
|
|
12672
|
+
onlyIfNoTurn: z37.boolean().optional(),
|
|
12668
12673
|
parentRef: deltaKeyPartSchema.optional(),
|
|
12669
12674
|
providerTurnId: providerTurnIdSchema.optional()
|
|
12670
12675
|
}),
|
|
12671
|
-
|
|
12672
|
-
|
|
12676
|
+
z37.object({ kind: z37.literal("session.ended") }),
|
|
12677
|
+
z37.object({ kind: z37.literal("session.reset") })
|
|
12673
12678
|
]);
|
|
12674
|
-
var threadDeltaNotificationParamsSchema =
|
|
12675
|
-
threadId:
|
|
12676
|
-
deltas:
|
|
12679
|
+
var threadDeltaNotificationParamsSchema = z37.object({
|
|
12680
|
+
threadId: z37.string().min(1),
|
|
12681
|
+
deltas: z37.array(threadDeltaSchema)
|
|
12677
12682
|
}).passthrough();
|
|
12678
12683
|
|
|
12679
12684
|
// ../provider-bridge-acp/src/launch-spec.ts
|
|
12680
|
-
import { z as
|
|
12681
|
-
var acpNativeSkillRootsSchema =
|
|
12682
|
-
user:
|
|
12683
|
-
project:
|
|
12685
|
+
import { z as z38 } from "zod";
|
|
12686
|
+
var acpNativeSkillRootsSchema = z38.object({
|
|
12687
|
+
user: z38.array(providerNativeRootInputSchema).default([]),
|
|
12688
|
+
project: z38.array(providerNativeRootInputSchema).default([])
|
|
12684
12689
|
}).strict().superRefine((roots, context) => {
|
|
12685
12690
|
const normalized = providerNativeRootsSchema.safeParse(
|
|
12686
12691
|
normalizeProviderNativeRoots(roots)
|
|
@@ -12696,16 +12701,16 @@ var acpNativeSkillRootsSchema = z37.object({
|
|
|
12696
12701
|
});
|
|
12697
12702
|
}
|
|
12698
12703
|
});
|
|
12699
|
-
var acpLaunchSpecSchema =
|
|
12700
|
-
displayName:
|
|
12701
|
-
command:
|
|
12702
|
-
args:
|
|
12703
|
-
env:
|
|
12704
|
-
cwd:
|
|
12705
|
-
modelCli:
|
|
12706
|
-
listArgs:
|
|
12707
|
-
selectFlag:
|
|
12708
|
-
primaryModels:
|
|
12704
|
+
var acpLaunchSpecSchema = z38.object({
|
|
12705
|
+
displayName: z38.string().min(1),
|
|
12706
|
+
command: z38.string().min(1),
|
|
12707
|
+
args: z38.array(z38.string()),
|
|
12708
|
+
env: z38.record(z38.string().min(1), z38.string()),
|
|
12709
|
+
cwd: z38.string().min(1).optional(),
|
|
12710
|
+
modelCli: z38.object({
|
|
12711
|
+
listArgs: z38.array(z38.string()),
|
|
12712
|
+
selectFlag: z38.string().min(1).optional(),
|
|
12713
|
+
primaryModels: z38.array(z38.string())
|
|
12709
12714
|
}).strict().transform(
|
|
12710
12715
|
(modelCli) => modelCli.listArgs.length > 0 ? modelCli : void 0
|
|
12711
12716
|
).optional(),
|
|
@@ -12743,35 +12748,35 @@ function normalizeAcpLaunchSpec(spec) {
|
|
|
12743
12748
|
}
|
|
12744
12749
|
|
|
12745
12750
|
// src/claude-task-tools.ts
|
|
12746
|
-
import { z as
|
|
12747
|
-
var claudeTaskToolNameSchema =
|
|
12751
|
+
import { z as z39 } from "zod";
|
|
12752
|
+
var claudeTaskToolNameSchema = z39.enum([
|
|
12748
12753
|
"TaskCreate",
|
|
12749
12754
|
"TaskGet",
|
|
12750
12755
|
"TaskList",
|
|
12751
12756
|
"TaskUpdate"
|
|
12752
12757
|
]);
|
|
12753
|
-
var claudeTaskStatusSchema =
|
|
12754
|
-
var claudeTaskCreateOutputSchema =
|
|
12755
|
-
task:
|
|
12756
|
-
id:
|
|
12757
|
-
subject:
|
|
12758
|
+
var claudeTaskStatusSchema = z39.enum(["pending", "in_progress", "completed"]);
|
|
12759
|
+
var claudeTaskCreateOutputSchema = z39.object({
|
|
12760
|
+
task: z39.object({
|
|
12761
|
+
id: z39.string(),
|
|
12762
|
+
subject: z39.string()
|
|
12758
12763
|
}).passthrough()
|
|
12759
12764
|
}).passthrough();
|
|
12760
|
-
var claudeTaskGetOutputSchema =
|
|
12761
|
-
task:
|
|
12762
|
-
id:
|
|
12765
|
+
var claudeTaskGetOutputSchema = z39.object({
|
|
12766
|
+
task: z39.object({
|
|
12767
|
+
id: z39.string(),
|
|
12763
12768
|
status: claudeTaskStatusSchema,
|
|
12764
|
-
subject:
|
|
12769
|
+
subject: z39.string()
|
|
12765
12770
|
}).passthrough().nullable()
|
|
12766
12771
|
}).passthrough();
|
|
12767
|
-
var claudeTaskUpdateOutputSchema =
|
|
12768
|
-
success:
|
|
12769
|
-
taskId:
|
|
12772
|
+
var claudeTaskUpdateOutputSchema = z39.object({
|
|
12773
|
+
success: z39.boolean(),
|
|
12774
|
+
taskId: z39.string()
|
|
12770
12775
|
}).passthrough();
|
|
12771
|
-
var claudeTaskListOutputSchema =
|
|
12772
|
-
tasks:
|
|
12776
|
+
var claudeTaskListOutputSchema = z39.object({
|
|
12777
|
+
tasks: z39.array(z39.unknown())
|
|
12773
12778
|
}).passthrough();
|
|
12774
|
-
var claudeTaskToolOutputSchema =
|
|
12779
|
+
var claudeTaskToolOutputSchema = z39.union([
|
|
12775
12780
|
claudeTaskCreateOutputSchema,
|
|
12776
12781
|
claudeTaskGetOutputSchema,
|
|
12777
12782
|
claudeTaskListOutputSchema,
|