@github/copilot-sdk 1.0.14 → 1.0.15-preview.0

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.
@@ -197,7 +197,15 @@ function createServerRpc(connection) {
197
197
  *
198
198
  * @returns Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.
199
199
  */
200
- search: async (params) => connection.sendRequest("catalog.search", params)
200
+ search: async (params) => connection.sendRequest("catalog.search", params),
201
+ /**
202
+ * 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.
203
+ *
204
+ * @param params Terminates one retained catalog selection group through an opaque reference previously returned by the model-safe search projection.
205
+ *
206
+ * @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.
207
+ */
208
+ select: async (params) => connection.sendRequest("catalog.select", params)
201
209
  },
202
210
  /** @experimental */
203
211
  plugins: {
@@ -428,7 +436,7 @@ function createServerRpc(connection) {
428
436
  /**
429
437
  * Registers an SDK client as the session filesystem provider.
430
438
  *
431
- * @param params Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.
439
+ * @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.
432
440
  *
433
441
  * @returns Indicates whether the calling client was registered as the session filesystem provider.
434
442
  */
@@ -992,6 +1000,108 @@ function createSessionRpc(connection, sessionId) {
992
1000
  }
993
1001
  },
994
1002
  /** @experimental */
1003
+ workflow: {
1004
+ /**
1005
+ * Runs a registered dynamic workflow by name at the top level.
1006
+ *
1007
+ * @param params Parameters for invoking a registered workflow.
1008
+ *
1009
+ * @returns Complete current or terminal workflow run envelope.
1010
+ */
1011
+ run: async (params) => connection.sendRequest("session.workflow.run", { sessionId, ...params }),
1012
+ /**
1013
+ * Resumes a dynamic workflow run using its persisted name, arguments, journal, and accounting.
1014
+ *
1015
+ * @param params Parameters for resuming a workflow run from its persisted identity.
1016
+ *
1017
+ * @returns Resolved persisted workflow identity and resumed run envelope.
1018
+ */
1019
+ resume: async (params) => connection.sendRequest("session.workflow.resume", { sessionId, ...params }),
1020
+ /**
1021
+ * Gets the current or settled envelope for a dynamic workflow run.
1022
+ *
1023
+ * @param params Parameters for retrieving a workflow run.
1024
+ *
1025
+ * @returns Complete current or terminal workflow run envelope.
1026
+ */
1027
+ getRun: async (params) => connection.sendRequest("session.workflow.getRun", { sessionId, ...params }),
1028
+ /**
1029
+ * Lists durable dynamic workflow runs for this session in creation order.
1030
+ *
1031
+ * @param params Parameters for paging workflow runs.
1032
+ *
1033
+ * @returns A page of workflow runs in durable creation order.
1034
+ */
1035
+ listRuns: async (params) => connection.sendRequest("session.workflow.listRuns", { sessionId, ...params }),
1036
+ /**
1037
+ * Gets durable and live observability detail for one dynamic workflow run.
1038
+ *
1039
+ * @param params Parameters for retrieving a workflow run.
1040
+ *
1041
+ * @returns Full workflow run observability detail.
1042
+ */
1043
+ getRunDetail: async (params) => connection.sendRequest("session.workflow.getRunDetail", { sessionId, ...params }),
1044
+ /**
1045
+ * Pages durable progress for one dynamic workflow run.
1046
+ *
1047
+ * @param params Parameters for paging workflow progress.
1048
+ *
1049
+ * @returns A bidirectional page of workflow progress.
1050
+ */
1051
+ getRunProgress: async (params) => connection.sendRequest("session.workflow.getRunProgress", { sessionId, ...params }),
1052
+ /**
1053
+ * Requests cancellation of a dynamic workflow run and returns its run envelope.
1054
+ *
1055
+ * @param params Parameters for cancelling a workflow run.
1056
+ *
1057
+ * @returns Complete current or terminal workflow run envelope.
1058
+ */
1059
+ cancel: async (params) => connection.sendRequest("session.workflow.cancel", { sessionId, ...params }),
1060
+ /**
1061
+ * Pauses a running dynamic workflow and returns its settled run envelope.
1062
+ *
1063
+ * @param params Parameters for pausing a running workflow.
1064
+ *
1065
+ * @returns Complete current or terminal workflow run envelope.
1066
+ */
1067
+ pause: async (params) => connection.sendRequest("session.workflow.pause", { sessionId, ...params }),
1068
+ /**
1069
+ * Records a batch of ordered dynamic workflow progress lines.
1070
+ *
1071
+ * @param params Parameters for recording workflow progress.
1072
+ *
1073
+ * @returns Acknowledgement that a workflow request was accepted.
1074
+ */
1075
+ log: async (params) => connection.sendRequest("session.workflow.log", { sessionId, ...params }),
1076
+ /**
1077
+ * Runs one dynamic-workflow-scoped subagent and returns its result.
1078
+ *
1079
+ * @param params Parameters for one workflow-scoped subagent call.
1080
+ *
1081
+ * @returns Result of one workflow-scoped subagent call.
1082
+ */
1083
+ agent: async (params) => connection.sendRequest("session.workflow.agent", { sessionId, ...params }),
1084
+ /** @experimental */
1085
+ journal: {
1086
+ /**
1087
+ * Reads a memoized dynamic workflow journal entry.
1088
+ *
1089
+ * @param params Parameters for reading a workflow journal entry.
1090
+ *
1091
+ * @returns Result of reading a workflow journal entry.
1092
+ */
1093
+ get: async (params) => connection.sendRequest("session.workflow.journal.get", { sessionId, ...params }),
1094
+ /**
1095
+ * Stores a memoized dynamic workflow journal entry.
1096
+ *
1097
+ * @param params Parameters for storing a workflow journal entry.
1098
+ *
1099
+ * @returns Acknowledgement that a workflow request was accepted.
1100
+ */
1101
+ put: async (params) => connection.sendRequest("session.workflow.journal.put", { sessionId, ...params })
1102
+ }
1103
+ },
1104
+ /** @experimental */
995
1105
  model: {
996
1106
  /**
997
1107
  * Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.
@@ -1697,13 +1807,97 @@ function createSessionRpc(connection, sessionId) {
1697
1807
  }
1698
1808
  },
1699
1809
  /** @experimental */
1810
+ managedSettings: {
1811
+ /**
1812
+ * 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.
1813
+ *
1814
+ * @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.
1815
+ */
1816
+ get: async () => connection.sendRequest("session.managedSettings.get", { sessionId })
1817
+ },
1818
+ /** @experimental */
1700
1819
  plugins: {
1701
1820
  /**
1702
- * Lists plugins installed for the session.
1821
+ * Lists globally installed, live, built-in, and enterprise-managed desired plugins using the live session's authoritative account, working directory, and retained managed policy.
1703
1822
  *
1704
1823
  * @returns Plugins installed for the session, with their enabled state and version metadata.
1705
1824
  */
1706
1825
  list: async () => connection.sendRequest("session.plugins.list", { sessionId }),
1826
+ /**
1827
+ * Installs a plugin using the live session's authoritative account, working directory, and retained managed policy.
1828
+ *
1829
+ * @param params Plugin source resolved relative to the session's authoritative working directory.
1830
+ *
1831
+ * @returns Result of installing a plugin.
1832
+ */
1833
+ install: async (params) => connection.sendRequest("session.plugins.install", { sessionId, ...params }),
1834
+ /**
1835
+ * Uninstalls a plugin when permitted by the live session's retained managed policy.
1836
+ *
1837
+ * @param params Name (or spec) of the plugin to uninstall.
1838
+ */
1839
+ uninstall: async (params) => connection.sendRequest("session.plugins.uninstall", { sessionId, ...params }),
1840
+ /**
1841
+ * Updates an installed plugin using the live session's authoritative account, working directory, and retained managed policy.
1842
+ *
1843
+ * @param params Name (or spec) of the plugin to update.
1844
+ *
1845
+ * @returns Result of updating a single plugin.
1846
+ */
1847
+ update: async (params) => connection.sendRequest("session.plugins.update", { sessionId, ...params }),
1848
+ /**
1849
+ * Enables installed plugins when permitted by the live session's retained managed policy.
1850
+ *
1851
+ * @param params Plugin names (or specs) to enable in the session's authoritative working directory.
1852
+ */
1853
+ enable: async (params) => connection.sendRequest("session.plugins.enable", { sessionId, ...params }),
1854
+ /**
1855
+ * Disables installed plugins when permitted by the live session's retained managed policy.
1856
+ *
1857
+ * @param params Plugin names (or specs) to disable in the session's authoritative working directory.
1858
+ */
1859
+ disable: async (params) => connection.sendRequest("session.plugins.disable", { sessionId, ...params }),
1860
+ /** @experimental */
1861
+ marketplaces: {
1862
+ /**
1863
+ * Lists registered and enterprise-managed desired marketplaces using the live session's retained policy.
1864
+ *
1865
+ * @returns All registered marketplaces, including built-in defaults.
1866
+ */
1867
+ list: async () => connection.sendRequest("session.plugins.marketplaces.list", { sessionId }),
1868
+ /**
1869
+ * Adds a marketplace when permitted by the live session's retained managed policy.
1870
+ *
1871
+ * @param params Marketplace source and optional working directory for relative-path resolution.
1872
+ *
1873
+ * @returns Result of registering a new marketplace.
1874
+ */
1875
+ add: async (params) => connection.sendRequest("session.plugins.marketplaces.add", { sessionId, ...params }),
1876
+ /**
1877
+ * Removes a marketplace when permitted by the live session's retained managed policy.
1878
+ *
1879
+ * @param params Name of the marketplace to remove and an optional force flag.
1880
+ *
1881
+ * @returns Outcome of the remove attempt, including dependent-plugin info when applicable.
1882
+ */
1883
+ remove: async (params) => connection.sendRequest("session.plugins.marketplaces.remove", { sessionId, ...params }),
1884
+ /**
1885
+ * Browses a marketplace resolved through the live session's working directory and retained managed policy.
1886
+ *
1887
+ * @param params Name of the marketplace whose plugin catalog to fetch.
1888
+ *
1889
+ * @returns Plugins advertised by the marketplace.
1890
+ */
1891
+ browse: async (params) => connection.sendRequest("session.plugins.marketplaces.browse", { sessionId, ...params }),
1892
+ /**
1893
+ * Refreshes marketplaces resolved through the live session's working directory and retained managed policy.
1894
+ *
1895
+ * @param params Optional marketplace name; omit to refresh all.
1896
+ *
1897
+ * @returns Result of refreshing one or more marketplace catalogs.
1898
+ */
1899
+ refresh: async (params) => connection.sendRequest("session.plugins.marketplaces.refresh", { sessionId, ...params })
1900
+ },
1707
1901
  /**
1708
1902
  * 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.
1709
1903
  *
@@ -2412,6 +2606,22 @@ function createSessionRpc(connection, sessionId) {
2412
2606
  * @returns Result of editing a queued message.
2413
2607
  */
2414
2608
  updateText: async (params) => connection.sendRequest("session.queue.updateText", { sessionId, ...params }),
2609
+ /**
2610
+ * 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.
2611
+ *
2612
+ * @param params Conditional withdrawal of a single user message, before the runtime claims it for delivery.
2613
+ *
2614
+ * @returns Result of removing a queued item.
2615
+ */
2616
+ withdrawMessage: async (params) => connection.sendRequest("session.queue.withdrawMessage", { sessionId, ...params }),
2617
+ /**
2618
+ * Atomically appends text and attachments to an unchanged, unconsumed local steering message. Returns updated=false if delivery or withdrawal already claimed the message.
2619
+ *
2620
+ * @param params Append to one pending steering message without changing its identity or delivery position.
2621
+ *
2622
+ * @returns Result of editing a queued message.
2623
+ */
2624
+ appendSteering: async (params) => connection.sendRequest("session.queue.appendSteering", { sessionId, ...params }),
2415
2625
  /**
2416
2626
  * Duplicates an addressable queued item immediately after its source.
2417
2627
  *
@@ -2666,6 +2876,31 @@ function createInternalSessionRpc(connection, sessionId) {
2666
2876
  pauseAtCheckpoint: async (params) => connection.sendRequest("session.factory.pauseAtCheckpoint", { sessionId, ...params })
2667
2877
  },
2668
2878
  /** @experimental */
2879
+ workflow: {
2880
+ /**
2881
+ * Internal tool-originated dynamic workflow invocation.
2882
+ *
2883
+ * @param params Internal parameters for invoking a registered workflow from a tool.
2884
+ *
2885
+ * @returns Complete current or terminal workflow run envelope.
2886
+ */
2887
+ runFromTool: async (params) => connection.sendRequest("session.workflow.runFromTool", { sessionId, ...params }),
2888
+ /**
2889
+ * Internal tool-originated dynamic workflow resume.
2890
+ *
2891
+ * @param params Internal parameters for resuming a workflow run from a tool.
2892
+ *
2893
+ * @returns Resolved persisted workflow identity and resumed run envelope.
2894
+ */
2895
+ resumeFromTool: async (params) => connection.sendRequest("session.workflow.resumeFromTool", { sessionId, ...params }),
2896
+ /**
2897
+ * Atomically pauses an owned dynamic workflow attempt at a durable checkpoint.
2898
+ *
2899
+ * @param params Parameters for an owned durable pause checkpoint.
2900
+ */
2901
+ pauseAtCheckpoint: async (params) => connection.sendRequest("session.workflow.pauseAtCheckpoint", { sessionId, ...params })
2902
+ },
2903
+ /** @experimental */
2669
2904
  model: {
2670
2905
  /**
2671
2906
  * Resolves and applies organization-managed and repository model overlays.
@@ -2861,6 +3096,16 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
2861
3096
  if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
2862
3097
  return handler.abort(params);
2863
3098
  });
3099
+ connection.onRequest("workflow.execute", async (params) => {
3100
+ const handler = getHandlers(params.sessionId).workflow;
3101
+ if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
3102
+ return handler.execute(params);
3103
+ });
3104
+ connection.onRequest("workflow.abort", async (params) => {
3105
+ const handler = getHandlers(params.sessionId).workflow;
3106
+ if (!handler) throw new Error(`No workflow handler registered for session: ${params.sessionId}`);
3107
+ return handler.abort(params);
3108
+ });
2864
3109
  connection.onRequest("tasks.cancel", async (params) => {
2865
3110
  const handler = getHandlers(params.sessionId).tasks;
2866
3111
  if (!handler) throw new Error(`No tasks handler registered for session: ${params.sessionId}`);