@github/copilot-sdk 1.0.14 → 1.0.15-preview.1
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/README.md +116 -11
- package/dist/cjs/cliVersion.js +1 -1
- package/dist/cjs/client.js +24 -17
- package/dist/cjs/copilotRequestHandler.js +156 -20
- package/dist/cjs/extension.js +12 -1
- package/dist/cjs/generated/rpc.js +349 -8
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/schema.js +40 -0
- package/dist/cjs/session.js +625 -3
- package/dist/cjs/workflow.js +134 -0
- package/dist/cliVersion.d.ts +1 -1
- package/dist/cliVersion.js +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.js +22 -15
- package/dist/copilotRequestHandler.js +156 -20
- package/dist/extension.d.ts +22 -8
- package/dist/extension.js +13 -1
- package/dist/generated/rpc.d.ts +2824 -315
- package/dist/generated/rpc.js +349 -8
- package/dist/generated/session-events.d.ts +565 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/schema.d.ts +4 -0
- package/dist/schema.js +14 -0
- package/dist/session.d.ts +26 -3
- package/dist/session.js +630 -3
- package/dist/types.d.ts +37 -5
- package/dist/workflow.d.ts +364 -0
- package/dist/workflow.js +106 -0
- package/docs/extensions.md +1 -0
- package/docs/workflows.md +257 -0
- package/package.json +17 -14
|
@@ -225,7 +225,15 @@ function createServerRpc(connection) {
|
|
|
225
225
|
*
|
|
226
226
|
* @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
|
|
227
227
|
*/
|
|
228
|
-
search: async (params) => connection.sendRequest("catalog.search", params)
|
|
228
|
+
search: async (params) => connection.sendRequest("catalog.search", params),
|
|
229
|
+
/**
|
|
230
|
+
* Terminates one retained catalog selection group. A selected outcome returns the native host a fresh single-use candidate handle plus the original searchId for a later explicit mcp.planInstall call; non-selected outcomes release the group without producing a planning input. Candidate state, cards, URLs, credentials and private identifiers remain inside the runtime. The model-facing catalog_select tool projects the result separately and never exposes the candidate handle or searchId.
|
|
231
|
+
*
|
|
232
|
+
* @param params Terminates one retained catalog selection group through an opaque reference previously returned by the model-safe search projection.
|
|
233
|
+
*
|
|
234
|
+
* @returns Typed outcome of catalog.select. Only the selected host result carries a fresh candidate handle; the model-facing projection removes both that handle and searchId.
|
|
235
|
+
*/
|
|
236
|
+
select: async (params) => connection.sendRequest("catalog.select", params)
|
|
229
237
|
},
|
|
230
238
|
/** @experimental */
|
|
231
239
|
plugins: {
|
|
@@ -456,7 +464,7 @@ function createServerRpc(connection) {
|
|
|
456
464
|
/**
|
|
457
465
|
* Registers an SDK client as the session filesystem provider.
|
|
458
466
|
*
|
|
459
|
-
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
|
|
467
|
+
* @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider. A registered provider is authoritative for path interpretation and filesystem facts used by workspace permission validation. Paths are interpreted lexically; home-relative paths (`~` and `~/...`) and Windows drive-relative paths such as `C:foo` are unsupported. Until provider-side canonicalization is supported, providers must not expose symlinks inside allowed roots that escape those roots.
|
|
460
468
|
*
|
|
461
469
|
* @returns Indicates whether the calling client was registered as the session filesystem provider.
|
|
462
470
|
*/
|
|
@@ -1020,6 +1028,108 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1020
1028
|
}
|
|
1021
1029
|
},
|
|
1022
1030
|
/** @experimental */
|
|
1031
|
+
workflow: {
|
|
1032
|
+
/**
|
|
1033
|
+
* Runs a registered dynamic workflow by name at the top level.
|
|
1034
|
+
*
|
|
1035
|
+
* @param params Parameters for invoking a registered workflow.
|
|
1036
|
+
*
|
|
1037
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
1038
|
+
*/
|
|
1039
|
+
run: async (params) => connection.sendRequest("session.workflow.run", { sessionId, ...params }),
|
|
1040
|
+
/**
|
|
1041
|
+
* Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
|
|
1042
|
+
*
|
|
1043
|
+
* @param params Parameters for resuming a workflow run from its persisted identity.
|
|
1044
|
+
*
|
|
1045
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
1046
|
+
*/
|
|
1047
|
+
resume: async (params) => connection.sendRequest("session.workflow.resume", { sessionId, ...params }),
|
|
1048
|
+
/**
|
|
1049
|
+
* Gets the current or settled envelope for a dynamic workflow run.
|
|
1050
|
+
*
|
|
1051
|
+
* @param params Parameters for retrieving a workflow run.
|
|
1052
|
+
*
|
|
1053
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
1054
|
+
*/
|
|
1055
|
+
getRun: async (params) => connection.sendRequest("session.workflow.getRun", { sessionId, ...params }),
|
|
1056
|
+
/**
|
|
1057
|
+
* Lists durable dynamic workflow runs for this session in creation order.
|
|
1058
|
+
*
|
|
1059
|
+
* @param params Parameters for paging workflow runs.
|
|
1060
|
+
*
|
|
1061
|
+
* @returns A page of workflow runs in durable creation order.
|
|
1062
|
+
*/
|
|
1063
|
+
listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { sessionId, ...params }),
|
|
1064
|
+
/**
|
|
1065
|
+
* Gets durable and live observability detail for one dynamic workflow run.
|
|
1066
|
+
*
|
|
1067
|
+
* @param params Parameters for retrieving a workflow run.
|
|
1068
|
+
*
|
|
1069
|
+
* @returns Full workflow run observability detail.
|
|
1070
|
+
*/
|
|
1071
|
+
getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { sessionId, ...params }),
|
|
1072
|
+
/**
|
|
1073
|
+
* Pages durable progress for one dynamic workflow run.
|
|
1074
|
+
*
|
|
1075
|
+
* @param params Parameters for paging workflow progress.
|
|
1076
|
+
*
|
|
1077
|
+
* @returns A bidirectional page of workflow progress.
|
|
1078
|
+
*/
|
|
1079
|
+
getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { sessionId, ...params }),
|
|
1080
|
+
/**
|
|
1081
|
+
* Requests cancellation of a dynamic workflow run and returns its run envelope.
|
|
1082
|
+
*
|
|
1083
|
+
* @param params Parameters for cancelling a workflow run.
|
|
1084
|
+
*
|
|
1085
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
1086
|
+
*/
|
|
1087
|
+
cancel: async (params) => connection.sendRequest("session.workflow.cancel", { sessionId, ...params }),
|
|
1088
|
+
/**
|
|
1089
|
+
* Pauses a running dynamic workflow and returns its settled run envelope.
|
|
1090
|
+
*
|
|
1091
|
+
* @param params Parameters for pausing a running workflow.
|
|
1092
|
+
*
|
|
1093
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
1094
|
+
*/
|
|
1095
|
+
pause: async (params) => connection.sendRequest("session.workflow.pause", { sessionId, ...params }),
|
|
1096
|
+
/**
|
|
1097
|
+
* Records a batch of ordered dynamic workflow progress lines.
|
|
1098
|
+
*
|
|
1099
|
+
* @param params Parameters for recording workflow progress.
|
|
1100
|
+
*
|
|
1101
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
1102
|
+
*/
|
|
1103
|
+
log: async (params) => connection.sendRequest("session.workflow.log", { sessionId, ...params }),
|
|
1104
|
+
/**
|
|
1105
|
+
* Runs one dynamic-workflow-scoped subagent and returns its result.
|
|
1106
|
+
*
|
|
1107
|
+
* @param params Parameters for one workflow-scoped subagent call.
|
|
1108
|
+
*
|
|
1109
|
+
* @returns Result of one workflow-scoped subagent call.
|
|
1110
|
+
*/
|
|
1111
|
+
agent: async (params) => connection.sendRequest("session.workflow.agent", { sessionId, ...params }),
|
|
1112
|
+
/** @experimental */
|
|
1113
|
+
journal: {
|
|
1114
|
+
/**
|
|
1115
|
+
* Reads a memoized dynamic workflow journal entry.
|
|
1116
|
+
*
|
|
1117
|
+
* @param params Parameters for reading a workflow journal entry.
|
|
1118
|
+
*
|
|
1119
|
+
* @returns Result of reading a workflow journal entry.
|
|
1120
|
+
*/
|
|
1121
|
+
get: async (params) => connection.sendRequest("session.workflow.journal.get", { sessionId, ...params }),
|
|
1122
|
+
/**
|
|
1123
|
+
* Stores a memoized dynamic workflow journal entry.
|
|
1124
|
+
*
|
|
1125
|
+
* @param params Parameters for storing a workflow journal entry.
|
|
1126
|
+
*
|
|
1127
|
+
* @returns Acknowledgement that a workflow request was accepted.
|
|
1128
|
+
*/
|
|
1129
|
+
put: async (params) => connection.sendRequest("session.workflow.journal.put", { sessionId, ...params })
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
/** @experimental */
|
|
1023
1133
|
model: {
|
|
1024
1134
|
/**
|
|
1025
1135
|
* Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.
|
|
@@ -1725,13 +1835,168 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1725
1835
|
}
|
|
1726
1836
|
},
|
|
1727
1837
|
/** @experimental */
|
|
1838
|
+
connectors: {
|
|
1839
|
+
/**
|
|
1840
|
+
* Returns feature availability and bounded polling limits for the EXPERIMENTAL session connector API. This method never performs a Connector service request.
|
|
1841
|
+
*
|
|
1842
|
+
* @returns Feature detection and hard polling limits for the EXPERIMENTAL session connector API.
|
|
1843
|
+
*/
|
|
1844
|
+
getCapabilities: async () => connection.sendRequest("session.connectors.getCapabilities", { sessionId }),
|
|
1845
|
+
/**
|
|
1846
|
+
* Returns authoritative session Connector state from current availability, pinned account selection, cached catalog, and live MCP projection without performing a Connector service request.
|
|
1847
|
+
*
|
|
1848
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
1849
|
+
*/
|
|
1850
|
+
getStatus: async () => connection.sendRequest("session.connectors.getStatus", { sessionId }),
|
|
1851
|
+
/**
|
|
1852
|
+
* Returns the cached Connector catalog for the pinned opaque account selection, fetching it only when this session has no cached catalog.
|
|
1853
|
+
*
|
|
1854
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
1855
|
+
*
|
|
1856
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
1857
|
+
*/
|
|
1858
|
+
list: async (params) => connection.sendRequest("session.connectors.list", { sessionId, ...params }),
|
|
1859
|
+
/**
|
|
1860
|
+
* Refreshes and validates the Connector catalog for the pinned opaque account selection.
|
|
1861
|
+
*
|
|
1862
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
1863
|
+
*
|
|
1864
|
+
* @returns Validated Connector catalog snapshot cached by the session.
|
|
1865
|
+
*/
|
|
1866
|
+
refresh: async (params) => connection.sendRequest("session.connectors.refresh", { sessionId, ...params }),
|
|
1867
|
+
/**
|
|
1868
|
+
* Initiates an idempotent Connector connection request without opening a browser. Returns connected when the service is immediately authoritative, consent_required with a validated URL, or pending with an opaque continuation ID.
|
|
1869
|
+
*
|
|
1870
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
1871
|
+
*
|
|
1872
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
1873
|
+
*/
|
|
1874
|
+
connect: async (params) => connection.sendRequest("session.connectors.connect", { sessionId, ...params }),
|
|
1875
|
+
/**
|
|
1876
|
+
* Re-initiates an idempotent Connector connection request without browser or UI effects, with the same typed outcomes as connect.
|
|
1877
|
+
*
|
|
1878
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
1879
|
+
*
|
|
1880
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
1881
|
+
*/
|
|
1882
|
+
reconnect: async (params) => connection.sendRequest("session.connectors.reconnect", { sessionId, ...params }),
|
|
1883
|
+
/**
|
|
1884
|
+
* Continues a pending Connector connection with caller-supplied attempt, interval, and deadline bounds. The runtime never opens the returned consent URL.
|
|
1885
|
+
*
|
|
1886
|
+
* @param params Explicitly bounded continuation of a pending Connector connection.
|
|
1887
|
+
*
|
|
1888
|
+
* @returns Typed result of initiating or continuing a Connector connection.
|
|
1889
|
+
*/
|
|
1890
|
+
continueConnection: async (params) => connection.sendRequest("session.connectors.continueConnection", { sessionId, ...params }),
|
|
1891
|
+
/**
|
|
1892
|
+
* Disconnects one Connector for the pinned opaque account selection, refreshes the authoritative catalog, and removes its session-owned MCP projection.
|
|
1893
|
+
*
|
|
1894
|
+
* @param params Selects one Connector and the pinned host-owned account used for its service and MCP authorization.
|
|
1895
|
+
*
|
|
1896
|
+
* @returns Authoritative result after disconnect and MCP reconciliation.
|
|
1897
|
+
*/
|
|
1898
|
+
disconnect: async (params) => connection.sendRequest("session.connectors.disconnect", { sessionId, ...params }),
|
|
1899
|
+
/**
|
|
1900
|
+
* Reconciles the authoritative cached or freshly requested Connector catalog into the session Connector MCP projection and returns live status.
|
|
1901
|
+
*
|
|
1902
|
+
* @param params Requests authoritative Connector-to-MCP reconciliation for the pinned account.
|
|
1903
|
+
*
|
|
1904
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
1905
|
+
*/
|
|
1906
|
+
reconcile: async (params) => connection.sendRequest("session.connectors.reconcile", { sessionId, ...params })
|
|
1907
|
+
},
|
|
1908
|
+
/** @experimental */
|
|
1909
|
+
managedSettings: {
|
|
1910
|
+
/**
|
|
1911
|
+
* Waits for the live session's in-flight managed-settings application, then returns the retained effective snapshot used by runtime enforcement and by `session.managed_settings_resolved`. It does not perform another account, device, or server resolution, and rejects when resolution has not produced a snapshot.
|
|
1912
|
+
*
|
|
1913
|
+
* @returns Enterprise managed-settings resolution: the effective managed settings the session applied and which channels contributed, so SDK clients can show users what is enterprise-managed. Fires whenever managed policy is (re)applied — at session start, on resume, and on account switch. This is an ephemeral live snapshot (delivered to subscribers but not persisted to the session event log), because at session start it resolves before `session.start` is emitted. Device values take precedence over server values, then the policy helper, per ordinary key, while permissions compose restrictively across device, server, policy-helper, and SDK-client layers. The account-scoped `getManagedSettings()` API does not include session-local client injection. Marked experimental while the managed-settings surface stabilizes.
|
|
1914
|
+
*/
|
|
1915
|
+
get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
|
|
1916
|
+
},
|
|
1917
|
+
/** @experimental */
|
|
1728
1918
|
plugins: {
|
|
1729
1919
|
/**
|
|
1730
|
-
* Lists
|
|
1920
|
+
* Lists globally installed, live, built-in, and enterprise-managed desired plugins using the live session's authoritative account, working directory, and retained managed policy.
|
|
1731
1921
|
*
|
|
1732
1922
|
* @returns Plugins installed for the session, with their enabled state and version metadata.
|
|
1733
1923
|
*/
|
|
1734
1924
|
list: async () => connection.sendRequest("session.plugins.list", { sessionId }),
|
|
1925
|
+
/**
|
|
1926
|
+
* Installs a plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
1927
|
+
*
|
|
1928
|
+
* @param params Plugin source resolved relative to the session's authoritative working directory.
|
|
1929
|
+
*
|
|
1930
|
+
* @returns Result of installing a plugin.
|
|
1931
|
+
*/
|
|
1932
|
+
install: async (params) => connection.sendRequest("session.plugins.install", { sessionId, ...params }),
|
|
1933
|
+
/**
|
|
1934
|
+
* Uninstalls a plugin when permitted by the live session's retained managed policy.
|
|
1935
|
+
*
|
|
1936
|
+
* @param params Name (or spec) of the plugin to uninstall.
|
|
1937
|
+
*/
|
|
1938
|
+
uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { sessionId, ...params }),
|
|
1939
|
+
/**
|
|
1940
|
+
* Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
|
|
1941
|
+
*
|
|
1942
|
+
* @param params Name (or spec) of the plugin to update.
|
|
1943
|
+
*
|
|
1944
|
+
* @returns Result of updating a single plugin.
|
|
1945
|
+
*/
|
|
1946
|
+
update: async (params) => connection.sendRequest("session.plugins.update", { sessionId, ...params }),
|
|
1947
|
+
/**
|
|
1948
|
+
* Enables installed plugins when permitted by the live session's retained managed policy.
|
|
1949
|
+
*
|
|
1950
|
+
* @param params Plugin names (or specs) to enable in the session's authoritative working directory.
|
|
1951
|
+
*/
|
|
1952
|
+
enable: async (params) => connection.sendRequest("session.plugins.enable", { sessionId, ...params }),
|
|
1953
|
+
/**
|
|
1954
|
+
* Disables installed plugins when permitted by the live session's retained managed policy.
|
|
1955
|
+
*
|
|
1956
|
+
* @param params Plugin names (or specs) to disable in the session's authoritative working directory.
|
|
1957
|
+
*/
|
|
1958
|
+
disable: async (params) => connection.sendRequest("session.plugins.disable", { sessionId, ...params }),
|
|
1959
|
+
/** @experimental */
|
|
1960
|
+
marketplaces: {
|
|
1961
|
+
/**
|
|
1962
|
+
* Lists registered and enterprise-managed desired marketplaces using the live session's retained policy.
|
|
1963
|
+
*
|
|
1964
|
+
* @returns All registered marketplaces, including built-in defaults.
|
|
1965
|
+
*/
|
|
1966
|
+
list: async () => connection.sendRequest("session.plugins.marketplaces.list", { sessionId }),
|
|
1967
|
+
/**
|
|
1968
|
+
* Adds a marketplace when permitted by the live session's retained managed policy.
|
|
1969
|
+
*
|
|
1970
|
+
* @param params Marketplace source and optional working directory for relative-path resolution.
|
|
1971
|
+
*
|
|
1972
|
+
* @returns Result of registering a new marketplace.
|
|
1973
|
+
*/
|
|
1974
|
+
add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { sessionId, ...params }),
|
|
1975
|
+
/**
|
|
1976
|
+
* Removes a marketplace when permitted by the live session's retained managed policy.
|
|
1977
|
+
*
|
|
1978
|
+
* @param params Name of the marketplace to remove and an optional force flag.
|
|
1979
|
+
*
|
|
1980
|
+
* @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
|
|
1981
|
+
*/
|
|
1982
|
+
remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { sessionId, ...params }),
|
|
1983
|
+
/**
|
|
1984
|
+
* Browses a marketplace resolved through the live session's working directory and retained managed policy.
|
|
1985
|
+
*
|
|
1986
|
+
* @param params Name of the marketplace whose plugin catalog to fetch.
|
|
1987
|
+
*
|
|
1988
|
+
* @returns Plugins advertised by the marketplace.
|
|
1989
|
+
*/
|
|
1990
|
+
browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { sessionId, ...params }),
|
|
1991
|
+
/**
|
|
1992
|
+
* Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
|
|
1993
|
+
*
|
|
1994
|
+
* @param params Optional marketplace name; omit to refresh all.
|
|
1995
|
+
*
|
|
1996
|
+
* @returns Result of refreshing one or more marketplace catalogs.
|
|
1997
|
+
*/
|
|
1998
|
+
refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { sessionId, ...params })
|
|
1999
|
+
},
|
|
1735
2000
|
/**
|
|
1736
2001
|
* Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately.
|
|
1737
2002
|
*
|
|
@@ -1756,7 +2021,15 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1756
2021
|
*
|
|
1757
2022
|
* @returns The selectable model entries synthesized for the models added by this call.
|
|
1758
2023
|
*/
|
|
1759
|
-
add: async (params) => connection.sendRequest("session.provider.add", { sessionId, ...params })
|
|
2024
|
+
add: async (params) => connection.sendRequest("session.provider.add", { sessionId, ...params }),
|
|
2025
|
+
/**
|
|
2026
|
+
* Atomically updates the session's BYOK provider and model registry by applying the supplied snapshot, replacing existing entries, updating models, or removing entries absent from the snapshot.
|
|
2027
|
+
*
|
|
2028
|
+
* @param params Authoritative BYOK provider and model registry snapshot to apply atomically to the session.
|
|
2029
|
+
*
|
|
2030
|
+
* @returns The selectable model entries and selection ids synthesized for the synchronized BYOK models.
|
|
2031
|
+
*/
|
|
2032
|
+
sync: async (params) => connection.sendRequest("session.provider.sync", { sessionId, ...params })
|
|
1760
2033
|
},
|
|
1761
2034
|
/** @experimental */
|
|
1762
2035
|
options: {
|
|
@@ -2082,9 +2355,9 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2082
2355
|
*/
|
|
2083
2356
|
setRequired: async (params) => connection.sendRequest("session.permissions.setRequired", { sessionId, ...params }),
|
|
2084
2357
|
/**
|
|
2085
|
-
* Clears session-scoped tool
|
|
2358
|
+
* Clears session-scoped tool approvals and, for full resets, exact session-approved paths.
|
|
2086
2359
|
*
|
|
2087
|
-
* @param params Clears session-scoped tool
|
|
2360
|
+
* @param params Clears session-scoped tool approvals and optionally clears location-scoped approvals and exact session-approved paths.
|
|
2088
2361
|
*
|
|
2089
2362
|
* @returns Indicates whether the operation succeeded.
|
|
2090
2363
|
*/
|
|
@@ -2100,9 +2373,9 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2100
2373
|
/** @experimental */
|
|
2101
2374
|
paths: {
|
|
2102
2375
|
/**
|
|
2103
|
-
* Returns the session's
|
|
2376
|
+
* Returns the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2104
2377
|
*
|
|
2105
|
-
* @returns Snapshot of the session's
|
|
2378
|
+
* @returns Snapshot of the session's recursive directory grants, exact session-approved paths, and primary working directory.
|
|
2106
2379
|
*/
|
|
2107
2380
|
list: async () => connection.sendRequest("session.permissions.paths.list", { sessionId }),
|
|
2108
2381
|
/**
|
|
@@ -2440,6 +2713,22 @@ function createSessionRpc(connection, sessionId) {
|
|
|
2440
2713
|
* @returns Result of editing a queued message.
|
|
2441
2714
|
*/
|
|
2442
2715
|
updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
|
|
2716
|
+
/**
|
|
2717
|
+
* Atomically withdraws an unchanged, unconsumed user message from the local queued or steering lane. A client retaining the original draft may restore it only when removed is true. Does not interrupt the running turn.
|
|
2718
|
+
*
|
|
2719
|
+
* @param params Conditional withdrawal of a single user message, before the runtime claims it for delivery.
|
|
2720
|
+
*
|
|
2721
|
+
* @returns Result of removing a queued item.
|
|
2722
|
+
*/
|
|
2723
|
+
withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
|
|
2724
|
+
/**
|
|
2725
|
+
* Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
|
|
2726
|
+
*
|
|
2727
|
+
* @param params Append to one pending steering message without changing its identity or delivery position.
|
|
2728
|
+
*
|
|
2729
|
+
* @returns Result of editing a queued message.
|
|
2730
|
+
*/
|
|
2731
|
+
appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { sessionId, ...params }),
|
|
2443
2732
|
/**
|
|
2444
2733
|
* Duplicates an addressable queued item immediately after its source.
|
|
2445
2734
|
*
|
|
@@ -2694,6 +2983,31 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2694
2983
|
pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
|
|
2695
2984
|
},
|
|
2696
2985
|
/** @experimental */
|
|
2986
|
+
workflow: {
|
|
2987
|
+
/**
|
|
2988
|
+
* Internal tool-originated dynamic workflow invocation.
|
|
2989
|
+
*
|
|
2990
|
+
* @param params Internal parameters for invoking a registered workflow from a tool.
|
|
2991
|
+
*
|
|
2992
|
+
* @returns Complete current or terminal workflow run envelope.
|
|
2993
|
+
*/
|
|
2994
|
+
runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { sessionId, ...params }),
|
|
2995
|
+
/**
|
|
2996
|
+
* Internal tool-originated dynamic workflow resume.
|
|
2997
|
+
*
|
|
2998
|
+
* @param params Internal parameters for resuming a workflow run from a tool.
|
|
2999
|
+
*
|
|
3000
|
+
* @returns Resolved persisted workflow identity and resumed run envelope.
|
|
3001
|
+
*/
|
|
3002
|
+
resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { sessionId, ...params }),
|
|
3003
|
+
/**
|
|
3004
|
+
* Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
|
|
3005
|
+
*
|
|
3006
|
+
* @param params Parameters for an owned durable pause checkpoint.
|
|
3007
|
+
*/
|
|
3008
|
+
pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { sessionId, ...params })
|
|
3009
|
+
},
|
|
3010
|
+
/** @experimental */
|
|
2697
3011
|
model: {
|
|
2698
3012
|
/**
|
|
2699
3013
|
* Resolves and applies organization-managed and repository model overlays.
|
|
@@ -2736,6 +3050,23 @@ function createInternalSessionRpc(connection, sessionId) {
|
|
|
2736
3050
|
unregisterExternalClient: async (params) => connection.sendRequest("session.mcp.unregisterExternalClient", { sessionId, ...params })
|
|
2737
3051
|
},
|
|
2738
3052
|
/** @experimental */
|
|
3053
|
+
connectors: {
|
|
3054
|
+
/**
|
|
3055
|
+
* Reconciles the authoritative Connector catalog into the session MCP projection during startup with a bounded deadline and fail-closed cleanup.
|
|
3056
|
+
*
|
|
3057
|
+
* @param params Pins a Connector operation to one host-owned GitHub account through its opaque selection ID. Provider tokens are never accepted.
|
|
3058
|
+
*
|
|
3059
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3060
|
+
*/
|
|
3061
|
+
reconcileForStartup: async (params) => connection.sendRequest("session.connectors.reconcileForStartup", { sessionId, ...params }),
|
|
3062
|
+
/**
|
|
3063
|
+
* Removes the runtime-owned Connector MCP projection without changing service-side connections.
|
|
3064
|
+
*
|
|
3065
|
+
* @returns Authoritative session connector state. Account IDs are opaque routing identifiers and credentials are never included.
|
|
3066
|
+
*/
|
|
3067
|
+
withdrawProjection: async () => connection.sendRequest("session.connectors.withdrawProjection", { sessionId })
|
|
3068
|
+
},
|
|
3069
|
+
/** @experimental */
|
|
2739
3070
|
commands: {
|
|
2740
3071
|
/**
|
|
2741
3072
|
* Finalizes persistence associated with a client-applied slash-command effect.
|
|
@@ -2889,6 +3220,16 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2889
3220
|
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2890
3221
|
return handler.abort(params);
|
|
2891
3222
|
});
|
|
3223
|
+
connection.onRequest("workflow.execute", async (params) => {
|
|
3224
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3225
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
3226
|
+
return handler.execute(params);
|
|
3227
|
+
});
|
|
3228
|
+
connection.onRequest("workflow.abort", async (params) => {
|
|
3229
|
+
const handler = getHandlers(params.sessionId).workflow;
|
|
3230
|
+
if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
|
|
3231
|
+
return handler.abort(params);
|
|
3232
|
+
});
|
|
2892
3233
|
connection.onRequest("tasks.cancel", async (params) => {
|
|
2893
3234
|
const handler = getHandlers(params.sessionId).tasks;
|
|
2894
3235
|
if (!handler) throw new Error(`No tasks handler registered for session: ${params.sessionId}`);
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
SYSTEM_MESSAGE_SECTIONS: () => import_types2.SYSTEM_MESSAGE_SECTIONS,
|
|
34
34
|
SessionFsSqliteTransactionFailure: () => import_types2.SessionFsSqliteTransactionFailure,
|
|
35
35
|
ToolSet: () => import_toolSet.ToolSet,
|
|
36
|
+
WorkflowResumeError: () => import_workflow.WorkflowResumeError,
|
|
36
37
|
approveAll: () => import_types2.approveAll,
|
|
37
38
|
convertMcpCallToolResult: () => import_types2.convertMcpCallToolResult,
|
|
38
39
|
createAttributedPermissionResult: () => import_types2.createAttributedPermissionResult,
|
|
@@ -40,7 +41,9 @@ __export(index_exports, {
|
|
|
40
41
|
createSessionFsAdapter: () => import_types2.createSessionFsAdapter,
|
|
41
42
|
defineFactory: () => import_factory.defineFactory,
|
|
42
43
|
defineTool: () => import_types2.defineTool,
|
|
43
|
-
|
|
44
|
+
defineWorkflow: () => import_workflow.defineWorkflow,
|
|
45
|
+
isFactoryRunTerminal: () => import_factory.isFactoryRunTerminal,
|
|
46
|
+
isWorkflowRunTerminal: () => import_workflow.isWorkflowRunTerminal
|
|
44
47
|
});
|
|
45
48
|
module.exports = __toCommonJS(index_exports);
|
|
46
49
|
var import_client = require("./client.js");
|
|
@@ -48,6 +51,7 @@ var import_types = require("./types.js");
|
|
|
48
51
|
var import_toolSet = require("./toolSet.js");
|
|
49
52
|
var import_session = require("./session.js");
|
|
50
53
|
var import_factory = require("./factory.js");
|
|
54
|
+
var import_workflow = require("./workflow.js");
|
|
51
55
|
var import_canvas = require("./canvas.js");
|
|
52
56
|
var import_types2 = require("./types.js");
|
|
53
57
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -67,6 +71,7 @@ var import_types2 = require("./types.js");
|
|
|
67
71
|
SYSTEM_MESSAGE_SECTIONS,
|
|
68
72
|
SessionFsSqliteTransactionFailure,
|
|
69
73
|
ToolSet,
|
|
74
|
+
WorkflowResumeError,
|
|
70
75
|
approveAll,
|
|
71
76
|
convertMcpCallToolResult,
|
|
72
77
|
createAttributedPermissionResult,
|
|
@@ -74,5 +79,7 @@ var import_types2 = require("./types.js");
|
|
|
74
79
|
createSessionFsAdapter,
|
|
75
80
|
defineFactory,
|
|
76
81
|
defineTool,
|
|
77
|
-
|
|
82
|
+
defineWorkflow,
|
|
83
|
+
isFactoryRunTerminal,
|
|
84
|
+
isWorkflowRunTerminal
|
|
78
85
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var schema_exports = {};
|
|
20
|
+
__export(schema_exports, {
|
|
21
|
+
isResponseSchema: () => isResponseSchema,
|
|
22
|
+
isZodSchema: () => isZodSchema,
|
|
23
|
+
toJsonSchema: () => toJsonSchema
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(schema_exports);
|
|
26
|
+
function isZodSchema(value) {
|
|
27
|
+
return typeof value === "object" && value !== null && "toJSONSchema" in value && typeof value.toJSONSchema === "function";
|
|
28
|
+
}
|
|
29
|
+
function toJsonSchema(schema) {
|
|
30
|
+
return isZodSchema(schema) ? schema.toJSONSchema() : schema;
|
|
31
|
+
}
|
|
32
|
+
function isResponseSchema(value) {
|
|
33
|
+
return isZodSchema(value) && "parse" in value && typeof value.parse === "function";
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
isResponseSchema,
|
|
38
|
+
isZodSchema,
|
|
39
|
+
toJsonSchema
|
|
40
|
+
});
|