@deepraxis/sdk 0.1.1-dev.680e69b → 0.1.1-dev.68987ec

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.
@@ -100,7 +100,7 @@ export const getAgentConsolidation = (options) => (options.client ?? client).get
100
100
  ...options
101
101
  });
102
102
  /**
103
- * List an assume agent's waiting letters
103
+ * List a BYOA agent's waiting letters
104
104
  *
105
105
  * Check whether mail waits for an assume agent without taking it: answers unread, the count of delivered letters the agent has not read, and letters, the newest unread ones (id, sender address, summary, thread, create_time; never the body). Nothing is marked read, so calling it again answers the same until the agent reads its mail with its own inbox tool (praxis_assume_inbox, action "read"). Use it when something outside the agent has to learn that mail arrived: the local `praxis agent events wait` reads it once on start and after every reconnect to its agent's event stream, so no letter that arrived while nothing listened is missed. {agent_id} takes the agent_… id, the eight character identity number or the handle of an assume agent in your organization; any other kind answers 400 ASSUME_AGENT_REQUIRED. To read or answer the letters, use the agent's inbox tool, not this read. Example: GET /agent/v1/agents/R1M9TQ2X/inbox/letters?unread=true&limit=5.
106
106
  */
@@ -117,6 +117,26 @@ export const listAgentInboxLetters = (options) => (options.client ?? client).get
117
117
  url: '/agent/v1/agents/{agent_id}/inbox/letters',
118
118
  ...options
119
119
  });
120
+ /**
121
+ * Create a login intent for the calling agent
122
+ *
123
+ * Create a one-time login code for yourself from your own non-cli session, then redeem it on your own computer as a cli login.
124
+ *
125
+ * Only for yourself, and only for your own computer: the agent, its organization and its platform computer all come from the credential and the agent's record, and the request body accepts no field at all (place included), so this call can be aimed neither at another agent nor at somebody else's computer. The member driving the session must be that agent's sponsor: the code becomes a thirty-day cli login for the agent, so only the sponsor may open one, and a session that names no member (a terminal customer's session) is refused. A cli session is refused (a login token cannot mint another login). The code lives five minutes and is redeemed once, at the gateway, where the redeem credential rides in Authorization.
126
+ */
127
+ export const createAgentLoginIntent = (options) => (options?.client ?? client).post({
128
+ security: [{
129
+ key: 'BearerAuth',
130
+ scheme: 'bearer',
131
+ type: 'http'
132
+ }, {
133
+ key: 'ApiKeyAuth',
134
+ name: 'X-API-Key',
135
+ type: 'apiKey'
136
+ }],
137
+ url: '/agent/v1/login_intents',
138
+ ...options
139
+ });
120
140
  /**
121
141
  * Apply Agent Version
122
142
  *
@@ -793,6 +813,34 @@ export const getSessionContext = (options) => (options.client ?? client).get({
793
813
  url: '/agent/v1/sessions/{session_id}/context',
794
814
  ...options
795
815
  });
816
+ /**
817
+ * Read one turn's platform prompt Revs
818
+ *
819
+ * Read back which platform prompt inputs one turn ran on, from the session's own ledger.
820
+ *
821
+ * The answer carries the configuration revision the turn pinned, that revision's version number, one 8-hex content Rev per platform input and when the record was taken. The platform inputs are ONE map keyed by each input's own name — `section:<name>` for a prompt section, plus `catalog` and `tools` — because catalog and tools are ordinary entries of that map, not layers of their own. Revs are content hashes: no prompt text, no tool description and no catalog content is ever in the answer, so the body can be compared across turns and releases without exposing what it names.
822
+ *
823
+ * With `run_id` you read that run's own record; without it you read the LAST record written. The last record is rewritten when the Rev set moves, not once per turn, so it may be several turns older than this call — which is why the answer's `run_id` is null in that case rather than naming a turn the record does not belong to, and why `at` is there: it is how you see how old the answer is. `at` never takes part in a comparison.
824
+ *
825
+ * **This read constructs the session object once.** A Durable Object cannot be read without being entered, so the call runs the object's startup, which may settle an interrupted turn; `acknowledge_wake=true` is required for exactly that reason, and the answer reports `reaped_turns` — how many interrupted turns this call's own arrival settled, `0` when it settled none. Only a value above 0 is evidence about this call. The read writes no row and does not refresh the eviction ordering key of the session's cached context parts.
826
+ *
827
+ * **What this method does not tell you:** whether the object was a new instance or a rebuilt first probe. That distinction is not in the contract yet; when `agent.sessions.tablesInfo`'s contract face carries `start_phase`, the two read methods move to it together. Do not infer it from this answer.
828
+ *
829
+ * A run that was never recorded, or a session that has recorded nothing yet, answers 404 with `reason: unknown_run`; a session that is absent or unreadable answers 404 with `reason: unknown_session`. Neither 404 body carries a record field — not even `run_id: null` — because "no record" and "an empty record" must not look the same. Own face only: the compatible face's vocabulary is the vendor's.
830
+ */
831
+ export const getSessionPromptRevs = (options) => (options.client ?? client).get({
832
+ security: [{
833
+ key: 'BearerAuth',
834
+ scheme: 'bearer',
835
+ type: 'http'
836
+ }, {
837
+ key: 'ApiKeyAuth',
838
+ name: 'X-API-Key',
839
+ type: 'apiKey'
840
+ }],
841
+ url: '/agent/v1/sessions/{session_id}/prompt-revs',
842
+ ...options
843
+ });
796
844
  /**
797
845
  * Fork Session (Extension)
798
846
  *
@@ -929,6 +977,30 @@ export const listSessionRequests = (options) => (options.client ?? client).get({
929
977
  url: '/agent/v1/sessions/{session_id}/requests',
930
978
  ...options
931
979
  });
980
+ /**
981
+ * Create Session Dictation Stream (Extension)
982
+ *
983
+ * Open a dictation stream for a session and get the address to push microphone audio to.
984
+ *
985
+ * Own-face extension. The body is optional: hotwords (at most 50 words the recogniser should favour). Returns 201 { id, push_url, expires_at }: id is the stream id (mst_...), push_url a wss address, expires_at when the address stops accepting a new connection. The speech-to-text model is the agent's dictation_model, or the platform default when it names none. Once connected to push_url, send one text frame {"type":"start","format":"pcm_s16le","sample_rate":16000,"channels":1}, then binary PCM frames of at most 64 KiB, then {"type":"stop"}; the text frames you receive are partial, final, done (with audio_seconds and cost_usd) and error. Each final carries end_ms, where that sentence ends in the audio you sent: if the connection drops, send what comes after the last end_ms to a new dictation. You may connect ahead of time: the stream waits up to 5 minutes for start; after start it closes after 30 s without a frame, and it carries at most 10 minutes of audio. push_url carries a short-lived capability: treat it as a secret and do not store or log it. A session that is missing or not yours returns 404; a model that cannot transcribe a live stream returns 409 DICTATION_UNCONFIGURED; dictation not available in this environment returns 503 DICTATION_UNAVAILABLE; more than 50 hotwords or an unsupported field returns 400.
986
+ */
987
+ export const createSessionDictation = (options) => (options.client ?? client).post({
988
+ security: [{
989
+ key: 'BearerAuth',
990
+ scheme: 'bearer',
991
+ type: 'http'
992
+ }, {
993
+ key: 'ApiKeyAuth',
994
+ name: 'X-API-Key',
995
+ type: 'apiKey'
996
+ }],
997
+ url: '/agent/v1/sessions/{session_id}/dictations',
998
+ ...options,
999
+ headers: {
1000
+ 'Content-Type': 'application/json',
1001
+ ...options.headers
1002
+ }
1003
+ });
932
1004
  /**
933
1005
  * List Session Background Tasks (Extension)
934
1006
  *
@@ -1138,7 +1210,7 @@ export const browserListSessions = (options) => (options?.client ?? client).get(
1138
1210
  /**
1139
1211
  * 创建浏览器会话
1140
1212
  *
1141
- * 创建云端 Chrome,返回自带凭证的 connectUrl。API 会话默认断开后结束;最长 6 小时。
1213
+ * 创建云端 Chrome,返回自带凭证的 connectUrl;它是一条完整 CDP 连接,真指针事件(触摸、拖拽、按坐标点击)从那里发送,页面动作接口只做按 ref 的语义动作。API 会话默认断开后结束;最长 6 小时。运行中服务每 60 秒做一次健康检查(Browser.getVersion,超时 10 秒),连续 2 次失败即以 closeReason=watchdog 结束会话,keepAlive=true 也不豁免;该事件记录判据读数。
1142
1214
  */
1143
1215
  export const browserCreateSession = (options) => (options.client ?? client).post({
1144
1216
  security: [{
@@ -1188,7 +1260,7 @@ export const browserCloseSession = (options) => (options.client ?? client).post(
1188
1260
  /**
1189
1261
  * 读取调试地址
1190
1262
  *
1191
- * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接。
1263
+ * 读取当前会话及各标签页的实时观看地址和 CDP 连接地址。直接使用返回的完整链接,保留查询凭证;会话不在运行状态时 pages 为空,返回地址不代表会话仍可连接——会话结束后(进入释放或已释放),用返回的 wsUrl 建立 CDP 连接会得到 409 SESSION_ENDED。
1192
1264
  */
1193
1265
  export const browserGetDebug = (options) => (options.client ?? client).get({
1194
1266
  security: [{
@@ -1216,7 +1288,7 @@ export const browserListEvents = (options) => (options.client ?? client).get({
1216
1288
  /**
1217
1289
  * 执行页面动作
1218
1290
  *
1219
- * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。
1291
+ * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill、select 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。动作都是语义动作:click、fill、select 按快照 ref 定位元素,scroll 派发滚轮事件;没有触摸、拖拽或按坐标点击,也没有按坐标派发指针事件的动作。页面必须收到真手指或指针事件(touchstart/touchmove/touchend、拖拽、按坐标点击)时,改用 CDP 连接:使用创建会话返回的 connectUrl,或 /browser/v1/connect 建立连接,再发送 Input.dispatchTouchEvent、Input.dispatchMouseEvent 等 CDP 命令。
1220
1292
  */
1221
1293
  export const browserRunPageAction = (options) => (options.client ?? client).post({
1222
1294
  security: [{
@@ -1376,7 +1448,7 @@ export const browserUpdateContext = (options) => (options.client ?? client).put(
1376
1448
  /**
1377
1449
  * 连接云端浏览器
1378
1450
  *
1379
- * CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl。
1451
+ * CDP WebSocket:不填 session 或 name 时新开;session 连接已有会话;name 有就连接、没有就新开。session 与 name 不可同时提供。新建参数在连接已有会话时忽略。使用 Authorization: Bearer API_KEY,或直接使用创建会话返回的带 signingKey 的 connectUrl。连上后发送 CDP 命令 Praxis.getSession,获取 sessionId、liveViewUrl、consoleUrl。这是完整 CDP 连接:真手指或指针事件(Emulation.setTouchEmulationEnabled 加 Input.dispatchTouchEvent、拖拽用的 Input.dispatchMouseEvent)只能从这里发,页面动作接口只做按 ref 的语义动作。要挂指定登录态,可用 context 参数,或直接连接 sessions.create 返回的 connectUrl。
1380
1452
  */
1381
1453
  export const browserConnect = (options) => (options?.client ?? client).get({
1382
1454
  security: [{
@@ -1742,6 +1814,414 @@ export const metaDocsRetrieve = (options) => (options.client ?? client).get({ ur
1742
1814
  * Find guides and references by keyword before reading them with praxis.meta.docs.retrieve. Public; no API key required. Matches documentation titles, headings and page text without case sensitivity; all query words must occur. q is required; limit defaults to 20 and accepts 1–50. lang defaults to zh or use en for English. Returns paths, page titles, canonical URLs and short matching snippets; no matches returns an empty array.
1743
1815
  */
1744
1816
  export const metaDocsSearch = (options) => (options.client ?? client).get({ url: '/meta/v1/docs/search', ...options });
1817
+ /**
1818
+ * List streams
1819
+ *
1820
+ * List the streams of your organization, newest first, to find a stream id or to see which are active; to read one stream use streams.retrieve. Pages hold limit streams (1 to 100, default 20); when has_more is true pass the id of the last stream you received as starting_after to get the next page. A stream that is deleted leaves the list at once. The list never shows another organization's streams. Example: GET /media/v1/streams?limit=20.
1821
+ */
1822
+ export const listMediaStreams = (options) => (options?.client ?? client).get({
1823
+ security: [{
1824
+ key: 'BearerAuth',
1825
+ scheme: 'bearer',
1826
+ type: 'http'
1827
+ }, {
1828
+ key: 'ApiKeyAuth',
1829
+ name: 'X-API-Key',
1830
+ type: 'apiKey'
1831
+ }],
1832
+ url: '/media/v1/streams',
1833
+ ...options
1834
+ });
1835
+ /**
1836
+ * Create a stream
1837
+ *
1838
+ * Register one live source and get its id; use it before anything else on this face, and use streams.update instead to change a stream you already have. Send input as {kind: pull, url} to have Praxis pull an https, http, rtmp or rtmps address (an HLS .m3u8 or HTTP-FLV playlist, or an RTMP URL; SRT is not supported and answers 400), or as {kind: push} to receive a push address: the response then carries push {url, token, expires_at}, and the token is shown only in this response and in streams.resetToken.create because only its hash is kept. The answer shows the stream idle. A pull stream starts pulling as soon as it is created, so a read a few seconds later shows waiting or active; a push stream stays idle until a source connects. Nothing is charged until a source goes active. reconnect_window_s (0 to 1800, default 60) is how long a source that drops may come back and continue the same broadcast; max_continuous_duration_s (60 to 43200, default 43200) ends a broadcast that runs that long. recording defaults to off. The owner is your organization (and the agent and session when a session token calls); the body cannot set it and unknown fields answer 400. Example: {"input":{"kind":"pull","url":"https://live.example.com/room/index.m3u8"},"recording":{"mode":"automatic","rendition":"source"}}.
1839
+ */
1840
+ export const createMediaStream = (options) => (options.client ?? client).post({
1841
+ security: [{
1842
+ key: 'BearerAuth',
1843
+ scheme: 'bearer',
1844
+ type: 'http'
1845
+ }, {
1846
+ key: 'ApiKeyAuth',
1847
+ name: 'X-API-Key',
1848
+ type: 'apiKey'
1849
+ }],
1850
+ url: '/media/v1/streams',
1851
+ ...options,
1852
+ headers: {
1853
+ 'Content-Type': 'application/json',
1854
+ ...options.headers
1855
+ }
1856
+ });
1857
+ /**
1858
+ * Delete a stream
1859
+ *
1860
+ * Delete a stream and its event log for good; only an idle or disabled stream can be deleted, so stop a live one first with streams.disable.create. The stream leaves the list at once and gives back any slot it held. Recordings it already made are Media assets and stay. Deleting is not undone and the id is not reused. Example: DELETE /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec.
1861
+ */
1862
+ export const deleteMediaStream = (options) => (options.client ?? client).delete({
1863
+ security: [{
1864
+ key: 'BearerAuth',
1865
+ scheme: 'bearer',
1866
+ type: 'http'
1867
+ }, {
1868
+ key: 'ApiKeyAuth',
1869
+ name: 'X-API-Key',
1870
+ type: 'apiKey'
1871
+ }],
1872
+ url: '/media/v1/streams/{stream_id}',
1873
+ ...options
1874
+ });
1875
+ /**
1876
+ * Retrieve a stream
1877
+ *
1878
+ * Read one stream: its status, input, reconnect and duration limits, recording settings, pipeline, the asset of the current broadcast and the recent ones. Use it to check whether a stream is idle, waiting, active or disabled; to follow what happened to it read streams.events.list instead. The push token is never returned here, only in the create and reset-token responses. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec.
1879
+ */
1880
+ export const getMediaStream = (options) => (options.client ?? client).get({
1881
+ security: [{
1882
+ key: 'BearerAuth',
1883
+ scheme: 'bearer',
1884
+ type: 'http'
1885
+ }, {
1886
+ key: 'ApiKeyAuth',
1887
+ name: 'X-API-Key',
1888
+ type: 'apiKey'
1889
+ }],
1890
+ url: '/media/v1/streams/{stream_id}',
1891
+ ...options
1892
+ });
1893
+ /**
1894
+ * Update a stream
1895
+ *
1896
+ * Change the settings of a stream you own; send only the fields to change. reconnect_window_s and max_continuous_duration_s take the same ranges as on create. recording is merged onto the current settings (send {rendition: sd} to change only the rendition; a null optional field such as library_id clears it). pipeline_id is stored as given (null clears it). input can change only the url of a pull stream and only while it is idle or disabled; a push stream has no address to change and a live pull stream answers 409. An empty patch, an unknown field or an invalid value answers 400. Example: {"reconnect_window_s":120,"recording":{"mode":"automatic"}}.
1897
+ */
1898
+ export const updateMediaStream = (options) => (options.client ?? client).patch({
1899
+ security: [{
1900
+ key: 'BearerAuth',
1901
+ scheme: 'bearer',
1902
+ type: 'http'
1903
+ }, {
1904
+ key: 'ApiKeyAuth',
1905
+ name: 'X-API-Key',
1906
+ type: 'apiKey'
1907
+ }],
1908
+ url: '/media/v1/streams/{stream_id}',
1909
+ ...options,
1910
+ headers: {
1911
+ 'Content-Type': 'application/json',
1912
+ ...options.headers
1913
+ }
1914
+ });
1915
+ /**
1916
+ * Enable a stream
1917
+ *
1918
+ * Bring a disabled stream back to idle so a source may drive it again; it does not start anything by itself. Only a disabled stream can be enabled; an idle, waiting or active stream answers 409. Use streams.disable.create to stop a stream. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/enable with no body.
1919
+ */
1920
+ export const enableMediaStream = (options) => (options.client ?? client).post({
1921
+ security: [{
1922
+ key: 'BearerAuth',
1923
+ scheme: 'bearer',
1924
+ type: 'http'
1925
+ }, {
1926
+ key: 'ApiKeyAuth',
1927
+ name: 'X-API-Key',
1928
+ type: 'apiKey'
1929
+ }],
1930
+ url: '/media/v1/streams/{stream_id}/enable',
1931
+ ...options
1932
+ });
1933
+ /**
1934
+ * Disable a stream
1935
+ *
1936
+ * Stop a stream from any status: a live stream is closed out (its log records stream.disconnected and stream.idle), it gives back its active slot, and a source can no longer drive it until streams.enable.create. Disabling a disabled stream changes nothing and answers 200. Use it before deleting a live stream or to switch a source off without losing the stream. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/disable with no body.
1937
+ */
1938
+ export const disableMediaStream = (options) => (options.client ?? client).post({
1939
+ security: [{
1940
+ key: 'BearerAuth',
1941
+ scheme: 'bearer',
1942
+ type: 'http'
1943
+ }, {
1944
+ key: 'ApiKeyAuth',
1945
+ name: 'X-API-Key',
1946
+ type: 'apiKey'
1947
+ }],
1948
+ url: '/media/v1/streams/{stream_id}/disable',
1949
+ ...options
1950
+ });
1951
+ /**
1952
+ * Get the address and capability to subscribe to a stream's events
1953
+ *
1954
+ * Mint a subscribe capability for the stream's event socket: a WebSocket that sends every event after a sequence number, then each new event as it is written. Use it for live delivery to an app or a dashboard; to read the log in pages without holding a socket use streams.events.list, and to receive events at your server use a webhook element of a pipeline. The response carries {url, token, expires_at}: open the url as a WebSocket and append &after=<seq> with the highest seq you have already seen (omit it, or use 0, to read from the start). A subscriber that was away comes back with its last seq and is sent every event it missed, then the live ones; the same event can arrive again, so de-duplicate on the event id. The token opens the socket and nothing else, is valid for one hour, may be held by any number of subscribers at once and is shown only in this response; mint a new one to reconnect after it expires. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/subscribe-token with no body.
1955
+ */
1956
+ export const createMediaStreamSubscription = (options) => (options.client ?? client).post({
1957
+ security: [{
1958
+ key: 'BearerAuth',
1959
+ scheme: 'bearer',
1960
+ type: 'http'
1961
+ }, {
1962
+ key: 'ApiKeyAuth',
1963
+ name: 'X-API-Key',
1964
+ type: 'apiKey'
1965
+ }],
1966
+ url: '/media/v1/streams/{stream_id}/subscribe-token',
1967
+ ...options
1968
+ });
1969
+ /**
1970
+ * Get the address and capability to play a stream live
1971
+ *
1972
+ * Mint a playback capability for the stream: an address of its live HLS playlist that a browser player can open with no API key. Call it from your own server and hand the address to the page, so the API key never reaches the browser; the Praxis Kit LiveStreamPlayer takes it as playbackUrl. The stream must have playback.enabled set (or record automatically), otherwise nothing is kept to play and the answer is 409. The response carries {url, expires_at}: the token is valid for one hour, any number can be held at once, and it opens this stream's playlist and nothing else. The playlist shows the newest six segments of the broadcast in progress with PROGRAM-DATE-TIME on each, and ends (EXT-X-ENDLIST) when the stream is idle or disabled. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/playback-token with no body.
1973
+ */
1974
+ export const createMediaStreamPlayback = (options) => (options.client ?? client).post({
1975
+ security: [{
1976
+ key: 'BearerAuth',
1977
+ scheme: 'bearer',
1978
+ type: 'http'
1979
+ }, {
1980
+ key: 'ApiKeyAuth',
1981
+ name: 'X-API-Key',
1982
+ type: 'apiKey'
1983
+ }],
1984
+ url: '/media/v1/streams/{stream_id}/playback-token',
1985
+ ...options
1986
+ });
1987
+ /**
1988
+ * Read the live HLS playlist of a stream
1989
+ *
1990
+ * The live HLS playlist of the broadcast in progress: a sliding window of the newest six segments, each with EXT-X-PROGRAM-DATE-TIME (the wall clock of its first frame) and the address of its media, signed for ten minutes. Players read it again every few seconds. It carries no media itself and takes no API key: the token in the address (minted by streams.playbackToken) is the credential, and the answer is open to any browser origin. Use the address as given; do not build it by hand. The playlist ends with EXT-X-ENDLIST once the stream is idle or disabled. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/live.m3u8?token=Qm9v.
1991
+ */
1992
+ export const getMediaStreamLivePlaylist = (options) => (options.client ?? client).get({ url: '/media/v1/streams/{stream_id}/live.m3u8', ...options });
1993
+ /**
1994
+ * Reset the push token of a stream
1995
+ *
1996
+ * Mint a new push token for a push stream and invalidate the old one, for example when the token leaked or has expired (a token is valid for 24 hours). The response carries the new push {url, token, expires_at}; the token is shown only here. A pull stream has no token and answers 409. Example: POST /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/reset-token with no body.
1997
+ */
1998
+ export const resetMediaStreamToken = (options) => (options.client ?? client).post({
1999
+ security: [{
2000
+ key: 'BearerAuth',
2001
+ scheme: 'bearer',
2002
+ type: 'http'
2003
+ }, {
2004
+ key: 'ApiKeyAuth',
2005
+ name: 'X-API-Key',
2006
+ type: 'apiKey'
2007
+ }],
2008
+ url: '/media/v1/streams/{stream_id}/reset-token',
2009
+ ...options
2010
+ });
2011
+ /**
2012
+ * List the events of a stream
2013
+ *
2014
+ * Read the stream's event log in order, to follow what the stream did or to catch up after a disconnect: pass after set to the highest seq you have seen and you receive every later event, oldest first, up to limit (1 to 100, default 100). Events are delivered at least once and each has a stable id, so a repeat is the same event. Kinds are the life cycle of the stream (stream.waiting, stream.connected, stream.active, stream.disconnected, stream.idle), recording.ready and recording.failed, output.status, and the results of its pipeline (transcript.partial, transcript.final, frame.described, alert, pipeline.unsupported_audio, pipeline.describe_failed). at is wall-clock time and at_source says whether it came from the source (program_date_time) or was the time Praxis received it; offset_ms is the position inside the stream when known. Events are kept at least 24 hours. When has_more is false next_after is the seq to pass next time. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/events?after=12&limit=50.
2015
+ */
2016
+ export const listMediaStreamEvents = (options) => (options.client ?? client).get({
2017
+ security: [{
2018
+ key: 'BearerAuth',
2019
+ scheme: 'bearer',
2020
+ type: 'http'
2021
+ }, {
2022
+ key: 'ApiKeyAuth',
2023
+ name: 'X-API-Key',
2024
+ type: 'apiKey'
2025
+ }],
2026
+ url: '/media/v1/streams/{stream_id}/events',
2027
+ ...options
2028
+ });
2029
+ /**
2030
+ * List pipelines
2031
+ *
2032
+ * List the pipelines of your organization, newest first, to find a pipeline id; to read one use pipelines.retrieve. Pages hold limit pipelines (1 to 100, default 20); when has_more is true pass the id of the last pipeline you received as starting_after to get the next page. Example: GET /media/v1/pipelines?limit=20.
2033
+ */
2034
+ export const listMediaPipelines = (options) => (options?.client ?? client).get({
2035
+ security: [{
2036
+ key: 'BearerAuth',
2037
+ scheme: 'bearer',
2038
+ type: 'http'
2039
+ }, {
2040
+ key: 'ApiKeyAuth',
2041
+ name: 'X-API-Key',
2042
+ type: 'apiKey'
2043
+ }],
2044
+ url: '/media/v1/pipelines',
2045
+ ...options
2046
+ });
2047
+ /**
2048
+ * Create a pipeline
2049
+ *
2050
+ * Describe what to run while a stream is live, once, and attach it to as many streams as you like with pipeline_id. A pipeline is an ordered list of elements: processors that read the broadcast and sinks that receive the results. transcribe {language?, hot_words?} turns the speech into transcript.partial and transcript.final events (each carries offset_ms in the stream, end_ms and the wall-clock time at, which is the source's own PROGRAM-DATE-TIME when it has one and the time received otherwise). describe_frames {interval_s 5 to 300 default 10, prompt?, model?} describes one keyframe every interval_s as a frame.described event; a slow description skips the frames in between, it never queues them. match_keywords {keywords} raises an alert event when a final sentence of the transcript holds one of the words, as a keyword_match alert rule does; the sinks send the results on: webhook {url} posts every event of the stream to your server, signed as Standard Webhooks (the secret whsec_ is shown once, in the response that adds the webhook), and agent {session_id} sends them to an agent session; the events sink is always on. A processor appears once; webhook and agent sinks up to five each. alert_rules holds keyword_match {keywords} and model_judgment {prompt}. A stream runs the pipeline as it was when the broadcast began: editing it changes the next broadcast, not the one on air. Example: {"name":"jewellery room","elements":[{"type":"transcribe","language":"zh"},{"type":"describe_frames","interval_s":20}]}.
2051
+ */
2052
+ export const createMediaPipeline = (options) => (options.client ?? client).post({
2053
+ security: [{
2054
+ key: 'BearerAuth',
2055
+ scheme: 'bearer',
2056
+ type: 'http'
2057
+ }, {
2058
+ key: 'ApiKeyAuth',
2059
+ name: 'X-API-Key',
2060
+ type: 'apiKey'
2061
+ }],
2062
+ url: '/media/v1/pipelines',
2063
+ ...options,
2064
+ headers: {
2065
+ 'Content-Type': 'application/json',
2066
+ ...options.headers
2067
+ }
2068
+ });
2069
+ /**
2070
+ * Delete a pipeline
2071
+ *
2072
+ * Delete a pipeline that no stream names. A stream that still has it as its pipeline_id keeps the deletion from happening, so detach it first with streams.update (pipeline_id: null) or delete the stream. Deleting is not undone and the id is not reused. Example: DELETE /media/v1/pipelines/msp_zpnqd7a2kxwg3vhr5tj4bfm6ec.
2073
+ */
2074
+ export const deleteMediaPipeline = (options) => (options.client ?? client).delete({
2075
+ security: [{
2076
+ key: 'BearerAuth',
2077
+ scheme: 'bearer',
2078
+ type: 'http'
2079
+ }, {
2080
+ key: 'ApiKeyAuth',
2081
+ name: 'X-API-Key',
2082
+ type: 'apiKey'
2083
+ }],
2084
+ url: '/media/v1/pipelines/{pipeline_id}',
2085
+ ...options
2086
+ });
2087
+ /**
2088
+ * Retrieve a pipeline
2089
+ *
2090
+ * Read one pipeline: its name, elements and alert rules, as a stream that names it will run them. Example: GET /media/v1/pipelines/msp_zpnqd7a2kxwg3vhr5tj4bfm6ec.
2091
+ */
2092
+ export const getMediaPipeline = (options) => (options.client ?? client).get({
2093
+ security: [{
2094
+ key: 'BearerAuth',
2095
+ scheme: 'bearer',
2096
+ type: 'http'
2097
+ }, {
2098
+ key: 'ApiKeyAuth',
2099
+ name: 'X-API-Key',
2100
+ type: 'apiKey'
2101
+ }],
2102
+ url: '/media/v1/pipelines/{pipeline_id}',
2103
+ ...options
2104
+ });
2105
+ /**
2106
+ * Update a pipeline
2107
+ *
2108
+ * Change a pipeline's name, elements or alert_rules; each field you send replaces the whole of that field (elements is a list, not a merge) and a field you leave out stays. A stream that is live keeps the pipeline it began its broadcast with; the change takes effect from its next broadcast. An empty body answers 400. Example: {"elements":[{"type":"transcribe"}]}.
2109
+ */
2110
+ export const updateMediaPipeline = (options) => (options.client ?? client).patch({
2111
+ security: [{
2112
+ key: 'BearerAuth',
2113
+ scheme: 'bearer',
2114
+ type: 'http'
2115
+ }, {
2116
+ key: 'ApiKeyAuth',
2117
+ name: 'X-API-Key',
2118
+ type: 'apiKey'
2119
+ }],
2120
+ url: '/media/v1/pipelines/{pipeline_id}',
2121
+ ...options,
2122
+ headers: {
2123
+ 'Content-Type': 'application/json',
2124
+ ...options.headers
2125
+ }
2126
+ });
2127
+ /**
2128
+ * List a stream's re-broadcast targets
2129
+ *
2130
+ * List every output of one stream, oldest first, with the status of each (idle, starting, broadcasting or errored) and the error of an errored one. Use it to see at a glance which targets are live; to change one use streams.outputs.update and to follow status changes as they happen read streams.events.list. A stream has at most 5 outputs, so the list is one page. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/outputs.
2131
+ */
2132
+ export const listMediaStreamOutputs = (options) => (options.client ?? client).get({
2133
+ security: [{
2134
+ key: 'BearerAuth',
2135
+ scheme: 'bearer',
2136
+ type: 'http'
2137
+ }, {
2138
+ key: 'ApiKeyAuth',
2139
+ name: 'X-API-Key',
2140
+ type: 'apiKey'
2141
+ }],
2142
+ url: '/media/v1/streams/{stream_id}/outputs',
2143
+ ...options
2144
+ });
2145
+ /**
2146
+ * Add a re-broadcast target to a stream
2147
+ *
2148
+ * Re-broadcast a live stream to another service (simulcast): give the target's RTMP address in url and its stream key in stream_key, and every broadcast of this stream is also sent there, without transcoding, while the stream is active. Use it to feed YouTube, Twitch or your own RTMP server from one source; to follow what the target does read streams.events.list for output.status events, and use streams.outputs.retrieve for its current status. url must be rtmp:// or rtmps:// on a public host and name the application (rtmp://a.rtmp.youtube.com/live2); the key is write-only, it is never returned, a read only says stream_key_set is true. A stream has at most 5 outputs. A new output is idle and starts with the next broadcast, or at once when the stream is active. One output that is slow or down never affects the others, the recording or the pipeline. Example: {"url":"rtmps://live.example.com:443/app","stream_key":"live_abc123"}.
2149
+ */
2150
+ export const createMediaStreamOutput = (options) => (options.client ?? client).post({
2151
+ security: [{
2152
+ key: 'BearerAuth',
2153
+ scheme: 'bearer',
2154
+ type: 'http'
2155
+ }, {
2156
+ key: 'ApiKeyAuth',
2157
+ name: 'X-API-Key',
2158
+ type: 'apiKey'
2159
+ }],
2160
+ url: '/media/v1/streams/{stream_id}/outputs',
2161
+ ...options,
2162
+ headers: {
2163
+ 'Content-Type': 'application/json',
2164
+ ...options.headers
2165
+ }
2166
+ });
2167
+ /**
2168
+ * Remove a re-broadcast target
2169
+ *
2170
+ * Stop re-broadcasting to a target and forget it: its connection is closed at once and its key is deleted. The stream, its recording and its other outputs are not touched. Deleting is not undone and the id is not reused; to send there again create a new output. Example: DELETE /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/outputs/mso_zpnqd7a2kxwg3vhr5tj4bfm6ec.
2171
+ */
2172
+ export const deleteMediaStreamOutput = (options) => (options.client ?? client).delete({
2173
+ security: [{
2174
+ key: 'BearerAuth',
2175
+ scheme: 'bearer',
2176
+ type: 'http'
2177
+ }, {
2178
+ key: 'ApiKeyAuth',
2179
+ name: 'X-API-Key',
2180
+ type: 'apiKey'
2181
+ }],
2182
+ url: '/media/v1/streams/{stream_id}/outputs/{output_id}',
2183
+ ...options
2184
+ });
2185
+ /**
2186
+ * Read one re-broadcast target
2187
+ *
2188
+ * Read one output: its address, whether a key is set (the key itself is never returned), its status and, when it is errored, why. Use it to check a target after streams.outputs.create or after an output.status event; status broadcasting means the target accepted the stream and is receiving it. Example: GET /media/v1/streams/mst_zpnqd7a2kxwg3vhr5tj4bfm6ec/outputs/mso_zpnqd7a2kxwg3vhr5tj4bfm6ec.
2189
+ */
2190
+ export const getMediaStreamOutput = (options) => (options.client ?? client).get({
2191
+ security: [{
2192
+ key: 'BearerAuth',
2193
+ scheme: 'bearer',
2194
+ type: 'http'
2195
+ }, {
2196
+ key: 'ApiKeyAuth',
2197
+ name: 'X-API-Key',
2198
+ type: 'apiKey'
2199
+ }],
2200
+ url: '/media/v1/streams/{stream_id}/outputs/{output_id}',
2201
+ ...options
2202
+ });
2203
+ /**
2204
+ * Change a re-broadcast target
2205
+ *
2206
+ * Change the address or the key of an output, for example after the target gave you a new key or an errored output was refused for a bad one; send at least one of url and stream_key. An output that is running starts over with the new values: its connection is closed and opened again, and its status goes through starting again. Use streams.outputs.delete to stop sending to a target for good. Example: {"stream_key":"live_new456"}.
2207
+ */
2208
+ export const updateMediaStreamOutput = (options) => (options.client ?? client).patch({
2209
+ security: [{
2210
+ key: 'BearerAuth',
2211
+ scheme: 'bearer',
2212
+ type: 'http'
2213
+ }, {
2214
+ key: 'ApiKeyAuth',
2215
+ name: 'X-API-Key',
2216
+ type: 'apiKey'
2217
+ }],
2218
+ url: '/media/v1/streams/{stream_id}/outputs/{output_id}',
2219
+ ...options,
2220
+ headers: {
2221
+ 'Content-Type': 'application/json',
2222
+ ...options.headers
2223
+ }
2224
+ });
1745
2225
  /**
1746
2226
  * List Models
1747
2227
  *
@@ -2687,7 +3167,7 @@ export const getOrganizationNotificationsInbox = (options) => (options?.client ?
2687
3167
  /**
2688
3168
  * List the letters addressed to you
2689
3169
  *
2690
- * The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5): the sender's display name (never an address or an internal id; an unknown sender answers 「某位成员」), the summary, the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
3170
+ * The letters this person received in this organization, newest first, as the notification center lists them (ADR-193 §5, #4107): the sender, the summary and the whole body are the copy this reader receives — every human:/agent: address is rendered as the directory's display name, and one the directory cannot name reads 「未知成员」, never an address or an internal id. Also the kind, when it arrived, whether it is read, and one line saying why it reached this person. The address is the credential's own and is never a request field. Details stay whole in body; open one by its id. Pass next_cursor unchanged as cursor; null ends the list. Read-only; no usage charge.
2691
3171
  */
2692
3172
  export const listOrganizationNotificationLetters = (options) => (options?.client ?? client).get({
2693
3173
  security: [{
@@ -2702,10 +3182,68 @@ export const listOrganizationNotificationLetters = (options) => (options?.client
2702
3182
  url: '/organization/v1/notifications/letters',
2703
3183
  ...options
2704
3184
  });
3185
+ /**
3186
+ * Mark one of your letters read
3187
+ *
3188
+ * Mark one letter addressed to you as read, together with the bell notice it wrote, so the platform does not email it later as unread. The mailbox is the credential's own — an agent credential reads its own agent mailbox, never its owner's — and the request names only the letter. Repeating the call changes nothing and keeps the first read time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
3189
+ */
3190
+ export const readOrganizationNotificationLetter = (options) => (options.client ?? client).post({
3191
+ security: [{
3192
+ key: 'BearerAuth',
3193
+ scheme: 'bearer',
3194
+ type: 'http'
3195
+ }, {
3196
+ key: 'ApiKeyAuth',
3197
+ name: 'X-API-Key',
3198
+ type: 'apiKey'
3199
+ }],
3200
+ url: '/organization/v1/notifications/letters/{id}:read',
3201
+ ...options
3202
+ });
3203
+ /**
3204
+ * Mark all your letters read
3205
+ *
3206
+ * Mark every delivered letter in your own mailbox in this organization as read, with their bell notices; give kind to read only letters of that kind. Nothing in another mailbox is touched. Letters still scheduled are not delivered yet and stay as they are. Returns how many delivered letters you still have unread. No usage charge.
3207
+ */
3208
+ export const readAllOrganizationNotificationLetters = (options) => (options?.client ?? client).post({
3209
+ security: [{
3210
+ key: 'BearerAuth',
3211
+ scheme: 'bearer',
3212
+ type: 'http'
3213
+ }, {
3214
+ key: 'ApiKeyAuth',
3215
+ name: 'X-API-Key',
3216
+ type: 'apiKey'
3217
+ }],
3218
+ url: '/organization/v1/notifications/letters:readAll',
3219
+ ...options,
3220
+ headers: {
3221
+ 'Content-Type': 'application/json',
3222
+ ...options?.headers
3223
+ }
3224
+ });
3225
+ /**
3226
+ * Archive one of your letters
3227
+ *
3228
+ * Archive one letter addressed to you: it leaves the default letters list (ask for archived=true to see archived ones) and is marked read, with its bell notice. Repeating the call changes nothing and keeps the first archive time. A letter that is not in your mailbox in this organization, or does not exist, answers 404 the same way. Returns how many delivered letters you still have unread. No usage charge.
3229
+ */
3230
+ export const archiveOrganizationNotificationLetter = (options) => (options.client ?? client).post({
3231
+ security: [{
3232
+ key: 'BearerAuth',
3233
+ scheme: 'bearer',
3234
+ type: 'http'
3235
+ }, {
3236
+ key: 'ApiKeyAuth',
3237
+ name: 'X-API-Key',
3238
+ type: 'apiKey'
3239
+ }],
3240
+ url: '/organization/v1/notifications/letters/{id}:archive',
3241
+ ...options
3242
+ });
2705
3243
  /**
2706
3244
  * Your notification switches, and what they resolve to
2707
3245
  *
2708
- * This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Severity never appears here because it never decides delivery. Read-only; no usage charge.
3246
+ * This person's notification preferences in the organization behind the credential: their own per-category switches, the channels they unsubscribed from everywhere, the organization's layer (defaults, blocked channels, whether members may change their own switches, hidden categories), and for every offered channel the answer the five layers produce — which layer decided it (platform_mandatory, channel_opt_out, person, organization_default, platform_default). Each catalog row also carries its severity (high/medium/low/none): it shapes the display only and never decides delivery (#4107). Read-only; no usage charge.
2709
3247
  */
2710
3248
  export const getOrganizationNotificationPreferences = (options) => (options?.client ?? client).get({
2711
3249
  security: [{
@@ -3311,7 +3849,7 @@ export const listOrganizationDepartments = (options) => (options?.client ?? clie
3311
3849
  /**
3312
3850
  * Establish a department
3313
3851
  *
3314
- * Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position and no charter: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
3852
+ * Creates a department under an existing active parent department; use it to grow the tree, and use reorganize to rename or move one that already exists. order defaults to one after the last active sibling. The new department has no head position: open a position in it, then designate that position as head. Requires an organization owner or admin, or the head of the parent department or of a department above it. Errors: 400 INVALID_PARAMS for a missing or empty name, a name over 100 characters, an unknown body field or an active sibling with the same name; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND when the parent does not exist; 409 DEPARTMENT_DISSOLVED when the parent is dissolved. Example body: {"parent_id":"dept_123","name":"Support"}.
3315
3853
  */
3316
3854
  export const establishOrganizationDepartment = (options) => (options.client ?? client).post({
3317
3855
  security: [{
@@ -3333,7 +3871,7 @@ export const establishOrganizationDepartment = (options) => (options.client ?? c
3333
3871
  /**
3334
3872
  * Get a department
3335
3873
  *
3336
- * Reads one department with its head position id and its charter, including the charter revision you need before amending the charter. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3874
+ * Reads one department with its head position id. A department's charter is the document of its spec (GET /workforce/v1/specs/department/{id}), not a field of the department. Read-only. Errors: 404 DEPARTMENT_NOT_FOUND when the id is not a department of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3337
3875
  */
3338
3876
  export const getOrganizationDepartment = (options) => (options.client ?? client).get({
3339
3877
  security: [{
@@ -3389,9 +3927,11 @@ export const dissolveOrganizationDepartment = (options) => (options.client ?? cl
3389
3927
  ...options
3390
3928
  });
3391
3929
  /**
3392
- * Amend a department charter
3930
+ * Amend a department charter (gone)
3393
3931
  *
3394
- * Replaces the charter of a department: free-text rules that apply to the department and are inherited by every department below it. Send the charter.revision you last read as expected_revision (0 when the department has no charter yet); each successful amendment raises the revision by one. Requires an organization owner or admin, or the head of the department or of a department above it. Errors: 400 INVALID_PARAMS for text over 2000 characters or a non-integer expected_revision; 403 PERMISSION_DENIED; 404 DEPARTMENT_NOT_FOUND; 409 DEPARTMENT_DISSOLVED; 409 REVISION_CONFLICT when the charter moved on, so get the department again, merge your change and retry with its revision.
3932
+ * Deprecated: use PUT /workforce/v1/specs/department/{id} instead; this path stops working on 2026-11-28. A department's charter is now the `document` of its spec, not a field of the department: read it at GET /workforce/v1/specs/department/{id} and replace it with PUT /workforce/v1/specs/department/{id} sending metadata.revision and spec.document. The root department's charter is the organization's own spec at /workforce/v1/specs/organization/{organization_id}. Until then this path answers 410 with code DEPARTMENT_CHARTER_GONE and the same instruction.
3933
+ *
3934
+ * @deprecated
3395
3935
  */
3396
3936
  export const amendOrganizationDepartmentCharter = (options) => (options.client ?? client).put({
3397
3937
  security: [{
@@ -3404,11 +3944,7 @@ export const amendOrganizationDepartmentCharter = (options) => (options.client ?
3404
3944
  type: 'apiKey'
3405
3945
  }],
3406
3946
  url: '/workforce/v1/departments/{id}/charter',
3407
- ...options,
3408
- headers: {
3409
- 'Content-Type': 'application/json',
3410
- ...options.headers
3411
- }
3947
+ ...options
3412
3948
  });
3413
3949
  /**
3414
3950
  * List jobs
@@ -3947,7 +4483,7 @@ export const listOrganizationActors = (options) => (options?.client ?? client).g
3947
4483
  /**
3948
4484
  * Get the position chain of an actor
3949
4485
  *
3950
- * Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down with every level's charter, the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
4486
+ * Reads where an actor, person or agent, sits in the organization: its primary position and its concurrent positions, each with the department path from the root down (ids and names; a department's charter is its spec's document, read through /workforce/v1/specs), the job, title and level name, the manager (the first filled position up the reporting line), the position's own duties and methods, and objectives. Use it to answer who this actor is and what it is responsible for. An actor that holds no position is not an error: primary is null and concurrent is empty. Read-only. Errors: 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.
3951
4487
  */
3952
4488
  export const getOrganizationActor = (options) => (options.client ?? client).get({
3953
4489
  security: [{
@@ -4393,7 +4929,7 @@ export const planOrganizationReconcile = (options) => (options.client ?? client)
4393
4929
  /**
4394
4930
  * Read reconcile status
4395
4931
  *
4396
- * Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human or paused), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/status?actor=agent:agent_123.
4932
+ * Reads the reconciler's last result for one holder: whether the sweep is paused, the seats and layer revisions of the last applied run, each block's state (ready, pending, failed, waiting_human, paused or not_applicable), the drift between what is applied and what the specs want, and when it last applied. Read-only; it changes nothing. Give the holder as actor. Errors: 400 INVALID_PARAMS when actor is missing or is not an actor address, or a query parameter is unknown; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent. Example: GET /workforce/v1/reconcile/status?actor=agent:agent_123.
4397
4933
  */
4398
4934
  export const getOrganizationReconcileStatus = (options) => (options.client ?? client).get({
4399
4935
  security: [{
@@ -5049,7 +5585,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
5049
5585
  /**
5050
5586
  * Create deployment
5051
5587
  *
5052
- * Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
5588
+ * Freeze session parameters as a deployment; this operation does not open a session. An agent reference with only an id follows the agent's active version: each run uses the version in effect at that moment, so a later agent save reaches the next run with no edit here. Name a version to pin it; only a version that is applied can be pinned, so a save made with apply false is refused with 409 AGENT_VERSION_NOT_APPLIED. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. environment_id and target are alternatives: send at least one of them; target:{type:"computer"} is for general agents and needs no environment_id, while target:{type:"environment"} still requires one. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400. Example, a weekly cron deployment on the agent's computer: {"agent":"agent_123","name":"weekly report","initial_events":[{"type":"user.message","content":[{"type":"text","text":"Write the weekly report."}]}],"target":{"type":"computer"},"schedule":{"type":"cron","expression":"0 9 * * 1","timezone":"America/Los_Angeles"}}.
5053
5589
  */
5054
5590
  export const deploymentsCreate = (options) => (options.client ?? client).post({
5055
5591
  security: [{
@@ -5089,7 +5625,7 @@ export const deploymentsRetrieve = (options) => (options.client ?? client).get({
5089
5625
  /**
5090
5626
  * Update deployment
5091
5627
  *
5092
- * Partially update a deployment. Omitted fields keep their values; a supplied agent id re-pins the latest version, or supply a versioned reference. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.
5628
+ * Partially update a deployment. Omitted fields keep their values. An agent reference with only an id makes the deployment follow the agent's active version from now on, so later agent saves carry through; name a version to pin it instead, and only a version that is applied (not one saved with apply false) may be pinned. Metadata merges string values and deletes keys set to null. Null clears schedule, resources and description; name, environment_id and initial_events cannot be cleared. Archived deployments return 409. Overrides apply to new sessions; updating a schedule recalculates its next occurrence.
5093
5629
  */
5094
5630
  export const deploymentsUpdate = (options) => (options.client ?? client).post({
5095
5631
  security: [{
@@ -7625,6 +8161,84 @@ export const canvasRestoreCanvas = (options) => (options.client ?? client).post(
7625
8161
  ...options.headers
7626
8162
  }
7627
8163
  });
8164
+ /**
8165
+ * Publish canvas library
8166
+ *
8167
+ * Freeze the reusable components of a canvas as the next numbered library version, so other canvases can use them; the first publish turns the canvas into a library. Supply a canvas_id from canvases.list or create after marking frames as components. The result lists which components were added, changed (compared by content) or removed since the previous version, and whether variables or themes changed. A removed component stays readable in the new version, marked removed. Publishing is not an edit, so the canvas version does not change. Component libraries are available only to organizations where the canvas-libraries feature is enabled; others receive FEATURE_DISABLED.
8168
+ */
8169
+ export const canvasPublishLibrary = (options) => (options.client ?? client).post({
8170
+ security: [{
8171
+ key: 'canvas-bearerAuth',
8172
+ scheme: 'bearer',
8173
+ type: 'http'
8174
+ }],
8175
+ url: '/canvas/v1/canvases/{canvas_id}:publish',
8176
+ ...options,
8177
+ headers: {
8178
+ 'Content-Type': 'application/json',
8179
+ ...options.headers
8180
+ }
8181
+ });
8182
+ /**
8183
+ * List library versions
8184
+ *
8185
+ * Read the release history of a library canvas, newest first, including each version's description and what it added, changed or removed. Supply a canvas_id of a canvas that has been published at least once; a canvas that never was answers NOT_A_LIBRARY. limit is 1–100 and defaults to 30; pass next_cursor as cursor until it is null. Library versions are never pruned. Listing does not change the canvas. Available only to organizations where the canvas-libraries feature is enabled.
8186
+ */
8187
+ export const canvasListLibraryVersions = (options) => (options.client ?? client).get({
8188
+ security: [{
8189
+ key: 'canvas-bearerAuth',
8190
+ scheme: 'bearer',
8191
+ type: 'http'
8192
+ }],
8193
+ url: '/canvas/v1/canvases/{canvas_id}/library_versions',
8194
+ ...options
8195
+ });
8196
+ /**
8197
+ * List libraries
8198
+ *
8199
+ * Discover the component libraries of the API key's organization, most recently published first. A library is a canvas that has been published at least once; each item gives its latest version, component count and how many live canvases use it. query keeps only libraries whose name contains the text, ignoring case. limit is 1–100 and defaults to 50; pass next_cursor as cursor until it is null. Deleted canvases are not listed. Available only to organizations where the canvas-libraries feature is enabled.
8200
+ */
8201
+ export const canvasListLibraries = (options) => (options?.client ?? client).get({
8202
+ security: [{
8203
+ key: 'canvas-bearerAuth',
8204
+ scheme: 'bearer',
8205
+ type: 'http'
8206
+ }],
8207
+ url: '/canvas/v1/libraries',
8208
+ ...options
8209
+ });
8210
+ /**
8211
+ * Import canvas library
8212
+ *
8213
+ * Make a published library's components usable in this canvas under an alias, or move an existing alias to another library version. Supply this canvas's canvas_id and the library's canvas id from libraries.list; the library must have been published at least once, and a library cannot itself import another library. After importing, reference a component as alias:component_id (for example ref ui:btn in a script) and a library variable as $alias:name; library nodes are read-only here. Moving an alias to a newer version keeps every instance and its overrides. The import is one new canvas version, so restoring an earlier version also restores the library versions it used. Importing the same alias and version again changes nothing. Component libraries are available only to organizations where the canvas-libraries feature is enabled.
8214
+ */
8215
+ export const canvasSetImport = (options) => (options.client ?? client).post({
8216
+ security: [{
8217
+ key: 'canvas-bearerAuth',
8218
+ scheme: 'bearer',
8219
+ type: 'http'
8220
+ }],
8221
+ url: '/canvas/v1/canvases/{canvas_id}/imports',
8222
+ ...options,
8223
+ headers: {
8224
+ 'Content-Type': 'application/json',
8225
+ ...options.headers
8226
+ }
8227
+ });
8228
+ /**
8229
+ * Remove canvas library import
8230
+ *
8231
+ * Stop using an imported library in this canvas. Supply this canvas's canvas_id and the alias it was imported under, as listed in imports of retrieve. The import is refused while any node still instantiates one of the library's components (the count is in error.details.instances, and retrieve lists them per component), so delete or replace those nodes first. The removal is one new canvas version. Component libraries are available only to organizations where the canvas-libraries feature is enabled.
8232
+ */
8233
+ export const canvasDeleteImport = (options) => (options.client ?? client).delete({
8234
+ security: [{
8235
+ key: 'canvas-bearerAuth',
8236
+ scheme: 'bearer',
8237
+ type: 'http'
8238
+ }],
8239
+ url: '/canvas/v1/canvases/{canvas_id}/imports/{alias}',
8240
+ ...options
8241
+ });
7628
8242
  /**
7629
8243
  * List contents
7630
8244
  *
@@ -8427,7 +9041,7 @@ export const customerCreateGrantCode = (options) => (options.client ?? client).p
8427
9041
  /**
8428
9042
  * Exchange a grant code or publishable key
8429
9043
  *
8430
- * Turn a grant code, or a publishable key for an anonymous visitor, into the Praxis customer access token that authorizes the Kit's sessions and playbacks. It is PRE-AUTH: no platform API key is needed, because the grant code or the publishable key is the credential; the Kit calls it from the browser, so send the page Origin when the code or key is bound to one. Send exactly one of grant_code or publishable_key — the door refuses any other combination with 400. With grant_code the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, already used, expired and foreign codes all answer 401 GRANT_CODE_INVALID. With publishable_key a new anonymous customer (anon_…) is created and merged into the identified one later if it signs in. The sign-in may be bound to an origin at creation; when the request Origin does not satisfy it, the exchange answers 403 ORIGIN_NOT_ALLOWED, and a blocked end user answers 403 CUSTOMER_BLOCKED. The access token lasts at most two hours and never outlives the sign-in; renew it with praxis.customer.accessTokens.renew before expires_at. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After.
9044
+ * Turn a grant code, or a publishable key for an anonymous visitor, into the Praxis customer access token that authorizes the Kit's sessions and playbacks. It is PRE-AUTH: no platform API key is needed, because the grant code or the publishable key is the credential; the Kit calls it from the browser, so send the page Origin when the code or key is bound to one. Send exactly one of grant_code or publishable_key — the door refuses any other combination with 400. With grant_code the code is consumed atomically: concurrent attempts have exactly one winner, and unknown, already used, expired and foreign codes all answer 401 GRANT_CODE_INVALID. With publishable_key a new anonymous customer (anon_…) is created and merged into the identified one later if it signs in. The sign-in may be bound to an origin at creation; when the request Origin does not satisfy it, the exchange answers 403 ORIGIN_NOT_ALLOWED, and a blocked end user answers 403 CUSTOMER_BLOCKED. The access token lasts at most two hours and never outlives the sign-in; renew it with praxis.customer.accessTokens.renew before expires_at. This door has its own per-IP anonymous budget: over it answers 429 RATE_LIMITED with Retry-After. A publishable key may also carry its own limits (anon_rate_per_min and daily_session_cap, set on the key): over the key's per-minute exchanges the door answers 429 PUBLISHABLE_KEY_RATE_LIMITED, and once the key has admitted daily_session_cap new anonymous visitors in the current UTC day it answers 429 PUBLISHABLE_KEY_DAILY_CAP_REACHED to a new visitor while a returning visitor with a continuation_token still continues; both carry Retry-After, the seconds until their UTC minute or day ends. A key may also carry a daily_spend_cap, the most its visitors' usage may cost in one UTC day: once the usage events of this key in the current UTC day add up to it (when the platform has switched the spend cap on for your organization), the door answers 429 PUBLISHABLE_KEY_DAILY_SPEND_CAP_REACHED to every visitor, a returning one with a continuation_token included, with Retry-After until 00:00 UTC.
8431
9045
  */
8432
9046
  export const customerCreateAccessToken = (options) => (options.client ?? client).post({
8433
9047
  url: '/customer/v1/access_tokens',
@@ -8600,7 +9214,7 @@ export const customerListPublishableKeys = (options) => (options?.client ?? clie
8600
9214
  /**
8601
9215
  * Create a publishable key
8602
9216
  *
8603
- * Mint a publishable key so a page can admit anonymous visitors without you signing each one in from your backend. name labels the key for the console and the key list. resources is required and names what an anonymous visitor may reach, in the same form as the grant-code scopes: agent:<id>:chat, content:<id>:play or application:<id>:visit, with * for every object of one type; give it only what the anonymous experience needs, because any visitor who has the page can use the key. The response carries the plaintext key once, in key, and the store keeps only its hash — save it then, because no later call returns it. Returns HTTP 201; the exchange that consumes it is praxis.customer.accessTokens.create with publishable_key.
9217
+ * Mint a publishable key so a page can admit anonymous visitors without you signing each one in from your backend. name labels the key for the console and the key list. resources is required and names what an anonymous visitor may reach, in the same form as the grant-code scopes: agent:<id>:chat, content:<id>:play or application:<id>:visit, with * for every object of one type; give it only what the anonymous experience needs, because any visitor who has the page can use the key. The response carries the plaintext key once, in key, and the store keeps only its hash — save it then, because no later call returns it. anon_rate_per_min, daily_session_cap and daily_spend_cap are optional limits of the key itself, all absent by default: the first caps how many exchanges the key allows per UTC minute across all visitors, the second how many new anonymous visitors it admits per UTC day (returning visitors are not counted); the third, daily_spend_cap, is the most the usage of this key's visitors may cost in one UTC day, as an amount with its currency such as {"amount": "5.00", "currency": "USD"} (at most 2 decimals), read from the key's usage events; change them later with praxis.customer.publishableKeys.update. Returns HTTP 201; the exchange that consumes it is praxis.customer.accessTokens.create with publishable_key.
8604
9218
  */
8605
9219
  export const customerCreatePublishableKey = (options) => (options.client ?? client).post({
8606
9220
  security: [{
@@ -8637,6 +9251,28 @@ export const customerDeletePublishableKey = (options) => (options.client ?? clie
8637
9251
  url: '/customer/v1/publishable_keys/{key_id}',
8638
9252
  ...options
8639
9253
  });
9254
+ /**
9255
+ * Update a publishable key
9256
+ *
9257
+ * Change the name of a publishable key or its own limits on anonymous admittance, for example to cap a page that is drawing more anonymous visitors than you want to pay for. Send at least one of name, anon_rate_per_min, daily_session_cap or daily_spend_cap; a field left out keeps its value, and null removes that limit. anon_rate_per_min caps the exchanges of this key per UTC minute across all visitors (returning visitors included), daily_session_cap caps the new anonymous visitors it admits per UTC day, and daily_spend_cap caps what its visitors' usage may cost per UTC day (a returning visitor is refused too, because it would start new chargeable work); a returning visitor that sends its continuation_token is never counted toward or refused by the daily cap. A new limit applies from the next exchange. The resources a key grants and its plaintext value never change; mint a new key for different resources. Get the key id from the publishable key list. An unknown, deleted or foreign id answers 400 INVALID_PARAMS, as does a limit outside its range.
9258
+ */
9259
+ export const customerUpdatePublishableKey = (options) => (options.client ?? client).patch({
9260
+ security: [{
9261
+ key: 'BearerAuth',
9262
+ scheme: 'bearer',
9263
+ type: 'http'
9264
+ }, {
9265
+ key: 'ApiKeyAuth',
9266
+ name: 'X-API-Key',
9267
+ type: 'apiKey'
9268
+ }],
9269
+ url: '/customer/v1/publishable_keys/{key_id}',
9270
+ ...options,
9271
+ headers: {
9272
+ 'Content-Type': 'application/json',
9273
+ ...options.headers
9274
+ }
9275
+ });
8640
9276
  /**
8641
9277
  * List projects
8642
9278
  *
@@ -10793,7 +11429,7 @@ export const devopsPromotionsGet = (options) => (options.client ?? client).get({
10793
11429
  /**
10794
11430
  * Approve or reject a promotion
10795
11431
  *
10796
- * Answer the approval an environment asked for: send approved true to let the promotion proceed, false to reject it and end it in approval_rejected. This is the environment-level gate an environment with requireApproval raises, not the per-rollout approval. Comment records the reasoning next to the decision, which is what a later reader sees instead of the bare verdict. The call is refused with PROMOTION_NOT_AWAITING_APPROVAL when the promotion is not waiting for one, so a stale approval cannot restart something that already finished. Approving is attributed to the credential that sends it. It needs state awaiting_approval, which `praxis api devops promotion get <id>` shows in state; read the plan field there first, because the decision is about that plan. Approving a plan that names another commit than the one now planned is refused with PLAN_STALE; create the promotion again.
11432
+ * Not supported yet (Sean 2026-11-27: approvals return as a step of the workflow engine): every call answers 409 ENGINE_UNSUPPORTED, and an environment that requires approval is refused when a promotion into it is created, so no promotion waits for an answer.
10797
11433
  */
10798
11434
  export const devopsPromotionsApprove = (options) => (options.client ?? client).post({
10799
11435
  security: [{
@@ -10843,7 +11479,7 @@ export const devopsPromotionsRetry = (options) => (options.client ?? client).pos
10843
11479
  /**
10844
11480
  * Conclude an observation
10845
11481
  *
10846
- * Record the verdict on a promotion that is observing: send keep to accept the deployment as the environment's new state, or rollback to record it as unhealthy. This is the decision the observation window exists for, so a promotion in observing state stays open until it is concluded; reason is stored as the attribution. Concluding with rollback only records the verdict: the observation closes unhealthy and the promotion fails with observation_failed, but the deployment is not moved. To move the deployment back, call `praxis api devops environment rollback <environment_id>` (that one deploys the earlier release again). A promotion that is not observing is refused with PROMOTION_NOT_OBSERVING, which is how a caller tells "already concluded" apart from a call that had no effect. It needs state observing, which `praxis api devops promotion get <id>` shows in state.
11482
+ * Retired with the observation window (ticket-4240): a promotion ends when its deploy ends, so no promotion is ever observing and every call answers 409 PROMOTION_NOT_OBSERVING. Watching production after a release is its author's own work; to undo a release use environments.rollback, which also takes the culprit Change this call used to record.
10847
11483
  */
10848
11484
  export const devopsPromotionsConclude = (options) => (options.client ?? client).post({
10849
11485
  security: [{
@@ -11859,7 +12495,7 @@ export const devopsUnitsConnect = (options) => (options.client ?? client).post({
11859
12495
  /**
11860
12496
  * Run a command inside a unit
11861
12497
  *
11862
- * Run one command inside the unit's own machine, and answer what it printed: exitCode, stdout and stderr, verbatim (the sandbox already caps their length). This is the door for a caller that holds no reach of the machine on its own — an agent whose credential opens development units — and it goes through the unit, the way `gh codespace ssh` goes through the codespace rather than the VM underneath. The command's environment carries the caller's signature — GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL are the caller's principal id and its noreply address — so a commit made here is signed by whoever ran it, and a checkout that has no user.email of its own is configured with the change's initiator when the unit is created. cwd defaults to the unit's repository directory. timeoutMs defaults to 120000 milliseconds and may not exceed 600000. A non-zero exit code is a result, not an error: it comes back in exitCode and is recorded on the unit's transitions as EXIT_<code> with the first line of stderr. The unit must be available with a machine, or the call answers 409 UNIT_INVALID_STATE — start it first; a unit of another organization answers 404 UNIT_NOT_FOUND, exactly as an unknown id does. The machine holds no git credential, so a commit made here still reaches the remote through devops.units.push; a command that fails to run at all answers 500 EXECUTION_FAILED and the machine's own words are in the unit's transitions.
12498
+ * Run one command inside the unit's own machine, and answer what it printed: exitCode, stdout and stderr, verbatim (the sandbox already caps their length). This is the door for a caller that holds no reach of the machine on its own — an agent whose credential opens development units — and it goes through the unit, the way `gh codespace ssh` goes through the codespace rather than the VM underneath. The command's environment carries the caller's signature — GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL are the caller's principal id and its noreply address — so a commit made here is signed by whoever ran it, and a checkout that has no user.email of its own is configured with the change's initiator when the unit is created. cwd defaults to the unit's repository directory. timeoutMs defaults to 120000 milliseconds and may not exceed 600000, and that 600000 ceiling is fixed: a task that needs longer than 240 seconds is not run by raising it — start it in the background and poll for its result, because a foreground call that long outlives the caller's own patience, and when the caller disconnects the command used to keep running on the machine with nobody collecting it (the reclaimer that ends that is #4404). When a command is stopped at its budget the answer is exitCode 124 with whatever it had already printed in stdout and stderr, so a stopped command shows its output instead of an empty result. A non-zero exit code is a result, not an error: it comes back in exitCode and is recorded on the unit's transitions as EXIT_<code> with the first line of stderr. The unit must be available with a machine, or the call answers 409 UNIT_INVALID_STATE — start it first; a unit of another organization answers 404 UNIT_NOT_FOUND, exactly as an unknown id does. The machine holds no git credential, so a commit made here still reaches the remote through devops.units.push; a command that fails to run at all answers 500 EXECUTION_FAILED and the machine's own words are in the unit's transitions.
11863
12499
  */
11864
12500
  export const devopsUnitsExec = (options) => (options.client ?? client).post({
11865
12501
  security: [{