@deepraxis/sdk 0.1.1-dev.441fd40 → 0.1.1-dev.44bea19

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.
@@ -903,6 +903,24 @@ export const browserListEvents = (options) => (options.client ?? client).get({
903
903
  url: '/browser/v1/sessions/{sessionId}/events',
904
904
  ...options
905
905
  });
906
+ /**
907
+ * 执行页面动作
908
+ *
909
+ * 在会话的浏览器里执行一个页面动作并返回结果,由浏览器服务执行,客户端不需要 Playwright。同一会话的动作按到达顺序串行执行,单个动作 30 秒内完成。先用 snapshot 读取页面:元素带 [ref=eN],click、fill 按 ref 操作;ref 只在最近一次快照里有效,页面跳转后失效(409 ACTION_REF_STALE,重新 snapshot)。省略 tab 时作用于当前标签页。
910
+ */
911
+ export const browserRunPageAction = (options) => (options.client ?? client).post({
912
+ security: [{
913
+ key: 'BrowserBearer',
914
+ scheme: 'bearer',
915
+ type: 'http'
916
+ }],
917
+ url: '/browser/v1/sessions/{sessionId}/actions',
918
+ ...options,
919
+ headers: {
920
+ 'Content-Type': 'application/json',
921
+ ...options.headers
922
+ }
923
+ });
906
924
  /**
907
925
  * 请求人工接管
908
926
  *
@@ -6547,6 +6565,7 @@ export const cutUndeleteProject = (options) => (options.client ?? client).post({
6547
6565
  * - `SCRIPT_LIMIT` — An execute budget was exceeded.
6548
6566
  * - `OPS_REJECTED` — An op failed; the whole edit rolled back.
6549
6567
  * - `EDIT_EXPIRED` — The saved edit id is over ten minutes old.
6568
+ * - `MEDIA_NOT_FOUND` — The asset id is not in that library.
6550
6569
  * - `MEDIA_OFFLINE` — The asset cannot be fetched right now.
6551
6570
  * - `MEDIA_UNAVAILABLE` — The asset is not usable for rendering.
6552
6571
  * - `MEDIA_IMPORT_FAILED` — Importing media failed.
@@ -6777,7 +6796,7 @@ export const cutCreateExport = (options) => (options.client ?? client).post({
6777
6796
  /**
6778
6797
  * Create draft range render
6779
6798
  *
6780
- * Render one interval of the timeline so you can hear or look at how that passage comes out, without publishing anything to a media library. Choose kind audio for the mixed soundtrack as an .m4a file, or kind video for a draft-quality .mp4 with picture and sound. from and to are seconds on the project clock and must satisfy 0 <= from < to, to <= the timeline duration, and to - from <= 120; a longer passage is requested in several 分段请求 ranges and joined by the caller. The result is a temporary file (purpose user_data) that expires 24 hours after it is stored and is never imported into a library, so it is not a deliverable and carries no cut-export tag. HTTP 202 only accepts the job; poll praxis.cut.renders.retrieve using the returned id until status is done or failed, then read url while it lasts. A draft also bills like a draft export, by rendered seconds. Each project runs at most 2 draft renders at a time, a budget separate from its exports; a third answers HTTP 429 CUT_BUSY and the same call succeeds once one finishes.
6799
+ * Render one interval of the timeline so you can hear or look at how that passage comes out, without publishing anything to a media library. Choose kind audio for the mixed soundtrack as an .m4a file, or kind video for a draft-quality .mp4 with picture and sound. from and to are seconds on the project clock and must satisfy 0 <= from < to, to <= the timeline duration (an end up to 0.05 s past it, a rounded duration, is read as the end), and to - from <= 120; a longer passage is requested in several 分段请求 ranges and joined by the caller. The result is a temporary file (purpose user_data) that expires 24 hours after it is stored and is never imported into a library, so it is not a deliverable and carries no cut-export tag. HTTP 202 only accepts the job; poll praxis.cut.renders.retrieve using the returned id until status is done or failed, then read url while it lasts. A draft also bills like a draft export, by rendered seconds. Each project runs at most 2 draft renders at a time, a budget separate from its exports; a third answers HTTP 429 CUT_BUSY and the same call succeeds once one finishes.
6781
6800
  */
6782
6801
  export const cutCreateRender = (options) => (options.client ?? client).post({
6783
6802
  security: [{
@@ -8292,6 +8311,52 @@ export const mediaCreateDeliveryToken = (options) => (options.client ?? client).
8292
8311
  ...options.headers
8293
8312
  }
8294
8313
  });
8314
+ /**
8315
+ * Get default library
8316
+ *
8317
+ * Return this organization’s default library. Calling ensures the organization’s default library exists (ADR-093): the first call creates it and later calls return the same library, so this is the method to call before writing when no library id is known. Generated and edited media land here when no library is named. The path segment {lib} accepts the literal default, which resolves to this library before the credential check — so an agent that has never listed libraries can still write to the right place. Returns the same Library object as libraries.retrieve; a credential bound to one library reaches this only when that binding covers the default library.
8318
+ */
8319
+ export const mediaGetDefaultLibrary = (options) => (options?.client ?? client).get({
8320
+ security: [{
8321
+ key: 'media-BearerAuth',
8322
+ scheme: 'bearer',
8323
+ type: 'http'
8324
+ }],
8325
+ url: '/media/v1/libraries/default',
8326
+ ...options
8327
+ });
8328
+ /**
8329
+ * Set default library
8330
+ *
8331
+ * Point this organization’s default library at an existing library. Calling ensures the organization’s default library exists (ADR-093): the path is resolved before the credential check, so a first call creates the default library when there is none and then repoints it. The path segment {lib} accepts the literal default, which resolves to this library before the credential check. Supply library_id from library creation or listing; the library must be active and belong to the organization. This changes where library-less generation and uploads land across the whole organization, so it affects other callers as well as this one. It does not move or copy any asset — assets already in the previous default library stay there. Returns the library now set as the default. Deleting the default library is refused with LIBRARY_IS_DEFAULT until another library is made the default.
8332
+ */
8333
+ export const mediaSetDefaultLibrary = (options) => (options.client ?? client).put({
8334
+ security: [{
8335
+ key: 'media-BearerAuth',
8336
+ scheme: 'bearer',
8337
+ type: 'http'
8338
+ }],
8339
+ url: '/media/v1/libraries/default',
8340
+ ...options,
8341
+ headers: {
8342
+ 'Content-Type': 'application/json',
8343
+ ...options.headers
8344
+ }
8345
+ });
8346
+ /**
8347
+ * Get asset lineage
8348
+ *
8349
+ * Read the whole edit tree containing one asset, so a caller sees what it was edited from and what was edited from it. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The response names the root the tree descends from, the asset asked about, and every step between them, each with the operation, prompt and creation time that produced it. Deleted assets stay in the tree, marked deleted, so the chain stays connected after cleanup. This is a read: it starts no processing and changes no asset. Example: GET /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/lineage.
8350
+ */
8351
+ export const mediaGetAssetLineage = (options) => (options.client ?? client).get({
8352
+ security: [{
8353
+ key: 'media-BearerAuth',
8354
+ scheme: 'bearer',
8355
+ type: 'http'
8356
+ }],
8357
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/lineage',
8358
+ ...options
8359
+ });
8295
8360
  /**
8296
8361
  * Summarize understanding failures
8297
8362
  *
@@ -8461,7 +8526,7 @@ export const ontologyListNodes = (options) => (options?.client ?? client).get({
8461
8526
  /**
8462
8527
  * Create node
8463
8528
  *
8464
- * Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only — to give an agent something to remember, use POST /agent/v1/agents/{agent_id}/consolidations.
8529
+ * Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only; it does not give any agent a memory.
8465
8530
  */
8466
8531
  export const ontologyCreateNode = (options) => (options.client ?? client).post({
8467
8532
  security: [{
@@ -8508,6 +8573,20 @@ export const ontologyUpdateNode = (options) => (options.client ?? client).patch(
8508
8573
  ...options.headers
8509
8574
  }
8510
8575
  });
8576
+ /**
8577
+ * Retrieve neighborhood
8578
+ *
8579
+ * Load the subgraph around one node instead of the whole graph — the read to use when a screen or an agent needs the context of one entity. Returns the start node, every node within depth hops of it, the relations whose both ends are in that set, and truncated true when the node limit cut the walk short. direction chooses which way relations are followed; as_of and include_invalid read the graph as those parameters do elsewhere. Visibility is exactly nodes.retrieve's — a node you may reach but not read comes back restricted with its name only, and relations touching it are withheld, so this read never reaches further than a node read does. The node id comes from nodes.list, nodes.create or a changeset; an unknown one answers ONTOLOGY_NODE_NOT_FOUND, the same answer nodes.retrieve gives.
8580
+ */
8581
+ export const ontologyNeighborhood = (options) => (options.client ?? client).get({
8582
+ security: [{
8583
+ key: 'ontology-bearerAuth',
8584
+ scheme: 'bearer',
8585
+ type: 'http'
8586
+ }],
8587
+ url: '/ontology/v1/nodes/{node_id}/neighborhood',
8588
+ ...options
8589
+ });
8511
8590
  /**
8512
8591
  * Merge node
8513
8592
  *
@@ -8543,7 +8622,7 @@ export const ontologyListRelations = (options) => (options?.client ?? client).ge
8543
8622
  /**
8544
8623
  * Create relation
8545
8624
  *
8546
- * Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only — to give an agent something to remember, use POST /agent/v1/agents/{agent_id}/consolidations.
8625
+ * Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only; it does not give any agent a memory.
8547
8626
  */
8548
8627
  export const ontologyCreateRelation = (options) => (options.client ?? client).post({
8549
8628
  security: [{
@@ -8611,7 +8690,7 @@ export const ontologyApplyChangeset = (options) => (options.client ?? client).po
8611
8690
  /**
8612
8691
  * Search nodes
8613
8692
  *
8614
- * Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent recall — agents recall through POST /agent/v1/agents/{agent_id}/consolidations.
8693
+ * Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent's recall, which reads the graph from that agent's own viewpoint inside its sessions.
8615
8694
  */
8616
8695
  export const ontologySearch = (options) => (options.client ?? client).post({
8617
8696
  security: [{
@@ -10711,6 +10790,158 @@ export const studioThemesUpdate = (options) => (options.client ?? client).patch(
10711
10790
  ...options.headers
10712
10791
  }
10713
10792
  });
10793
+ /**
10794
+ * Create a rendition of a draft for a platform
10795
+ *
10796
+ * Create a rendition: the form of one draft that a platform receives, such as a Xiaohongshu card set, a DOCX file or a Markdown file. Read the platform first with the platform call and pass its versioned key; pass a theme only to override the platform's default layout. Pass render true to render in the same call and read render_state and issues in the answer; without it the rendition starts as pending and the render call produces it. Rendering a Xiaohongshu card set is billed by Browser Rendering time (meter browser_ms, product studio-render); DOCX and Markdown renditions are not billed. A draft with no body renders as invalid with a draft_empty issue, and an unavailable render service leaves render_state failed with a render_unavailable issue, so repeat the render call later. Send a request_id to make a repeated call return the first rendition instead of creating another. Next, publish the rendition to export it.
10797
+ */
10798
+ export const studioRenditionsCreate = (options) => (options.client ?? client).post({
10799
+ security: [{
10800
+ key: 'BearerAuth',
10801
+ scheme: 'bearer',
10802
+ type: 'http'
10803
+ }, {
10804
+ key: 'ApiKeyAuth',
10805
+ name: 'X-API-Key',
10806
+ type: 'apiKey'
10807
+ }],
10808
+ url: '/studio/v1/works/{work}/drafts/{draft}/renditions',
10809
+ ...options,
10810
+ headers: {
10811
+ 'Content-Type': 'application/json',
10812
+ ...options.headers
10813
+ }
10814
+ });
10815
+ /**
10816
+ * List the renditions of a work
10817
+ *
10818
+ * List the renditions of one work, each with its platform, render state, stale flag and publish state. Pass draft to see only the renditions of one draft. Use it to find the rendition to publish or to render again, and read stale before exporting: a stale rendition was built from an older draft and cannot be exported until the render call has rebuilt it. The answer is one page; keep following next_page_token while it is present.
10819
+ */
10820
+ export const studioRenditionsList = (options) => (options.client ?? client).get({
10821
+ security: [{
10822
+ key: 'BearerAuth',
10823
+ scheme: 'bearer',
10824
+ type: 'http'
10825
+ }, {
10826
+ key: 'ApiKeyAuth',
10827
+ name: 'X-API-Key',
10828
+ type: 'apiKey'
10829
+ }],
10830
+ url: '/studio/v1/works/{work}/renditions',
10831
+ ...options
10832
+ });
10833
+ /**
10834
+ * Delete a rendition
10835
+ *
10836
+ * Delete a rendition and stop listing it. The draft it was built from is untouched, and a new rendition can be created from it at any time. Files already downloaded from an earlier export are not affected. Use it to clear a failed or abandoned rendition; to refresh one, call the render operation instead.
10837
+ */
10838
+ export const studioRenditionsDelete = (options) => (options.client ?? client).delete({
10839
+ security: [{
10840
+ key: 'BearerAuth',
10841
+ scheme: 'bearer',
10842
+ type: 'http'
10843
+ }, {
10844
+ key: 'ApiKeyAuth',
10845
+ name: 'X-API-Key',
10846
+ type: 'apiKey'
10847
+ }],
10848
+ url: '/studio/v1/works/{work}/renditions/{rendition}',
10849
+ ...options
10850
+ });
10851
+ /**
10852
+ * Read one rendition
10853
+ *
10854
+ * Read one rendition in full: its render state, the validation issues the render found, the parts (one per card page or thread post), the files it produced and its publish state. Call it after create, render or publish to see the outcome, because a render that finished invalid or failed is reported here and not as an HTTP error. stale is true when the draft has changed since source_revision; call the render operation before exporting a stale rendition.
10855
+ */
10856
+ export const studioRenditionsGet = (options) => (options.client ?? client).get({
10857
+ security: [{
10858
+ key: 'BearerAuth',
10859
+ scheme: 'bearer',
10860
+ type: 'http'
10861
+ }, {
10862
+ key: 'ApiKeyAuth',
10863
+ name: 'X-API-Key',
10864
+ type: 'apiKey'
10865
+ }],
10866
+ url: '/studio/v1/works/{work}/renditions/{rendition}',
10867
+ ...options
10868
+ });
10869
+ /**
10870
+ * Change the theme or settings of a rendition
10871
+ *
10872
+ * Change a rendition's theme or settings. Send update_mask naming exactly the fields you change, such as theme or settings; a field left out keeps its value. The produced files are not rebuilt by this call, so call the render operation afterwards to apply the change. A rendition whose export or publish has started is locked and answers RENDITION_PUBLISH_LOCKED; create a new rendition for new content.
10873
+ */
10874
+ export const studioRenditionsUpdate = (options) => (options.client ?? client).patch({
10875
+ security: [{
10876
+ key: 'BearerAuth',
10877
+ scheme: 'bearer',
10878
+ type: 'http'
10879
+ }, {
10880
+ key: 'ApiKeyAuth',
10881
+ name: 'X-API-Key',
10882
+ type: 'apiKey'
10883
+ }],
10884
+ url: '/studio/v1/works/{work}/renditions/{rendition}',
10885
+ ...options,
10886
+ headers: {
10887
+ 'Content-Type': 'application/json',
10888
+ ...options.headers
10889
+ }
10890
+ });
10891
+ /**
10892
+ * Render a rendition again from the current draft
10893
+ *
10894
+ * Render the rendition from the draft as it is now, replacing its parts and files and clearing stale. Call it after the draft changed, after a theme or settings change, or after a failed render. The answer carries render_state: rendered, invalid when the draft has an error-level issue (for example draft_empty on a draft with no body), or failed when the render service was unavailable (issue render_unavailable; repeat later). A render does not fail the HTTP call for those outcomes, so read render_state and issues. Rendering a Xiaohongshu card set is billed by Browser Rendering time (meter browser_ms, product studio-render); DOCX and Markdown are not billed. Rendering the same rendition twice at once answers REVISION_CONFLICT; retry shortly. Next, publish the rendition to export it.
10895
+ */
10896
+ export const studioRenditionsRender = (options) => (options.client ?? client).post({
10897
+ security: [{
10898
+ key: 'BearerAuth',
10899
+ scheme: 'bearer',
10900
+ type: 'http'
10901
+ }, {
10902
+ key: 'ApiKeyAuth',
10903
+ name: 'X-API-Key',
10904
+ type: 'apiKey'
10905
+ }],
10906
+ url: '/studio/v1/works/{work}/renditions/{rendition}:render',
10907
+ ...options
10908
+ });
10909
+ /**
10910
+ * Export a rendition
10911
+ *
10912
+ * Export a rendition for the platforms that deliver a file: markdown@1, docx@1 and xiaohongshu@1 end with publish.state exported, and a card rendition gains one ZIP of its pages in files. Publishing to a platform account such as X or WeChat is not available yet and answers PLATFORM_NOT_AVAILABLE; export instead. The rendition must be rendered, not stale and without error-level issues: RENDITION_NOT_RENDERED means call the render operation first, RENDITION_STALE means the draft changed so render again, RENDITION_INVALID means fix the draft problems listed in issues and render again. Exporting the same rendition twice at once answers REVISION_CONFLICT; retry shortly. Next, call the content operation to download the file.
10913
+ */
10914
+ export const studioRenditionsPublish = (options) => (options.client ?? client).post({
10915
+ security: [{
10916
+ key: 'BearerAuth',
10917
+ scheme: 'bearer',
10918
+ type: 'http'
10919
+ }, {
10920
+ key: 'ApiKeyAuth',
10921
+ name: 'X-API-Key',
10922
+ type: 'apiKey'
10923
+ }],
10924
+ url: '/studio/v1/works/{work}/renditions/{rendition}:publish',
10925
+ ...options
10926
+ });
10927
+ /**
10928
+ * Get a download URL for a rendition file
10929
+ *
10930
+ * Get a signed, short-lived URL to download what a rendition produced. Without part it points to the rendition's own first file: the ZIP of pages for a card rendition, the DOCX for docx@1. With part it points to that part's first file, such as one card PNG; a part that has no file, or a rendition not rendered yet, answers RENDITION_NOT_RENDERED, and an index no part has answers INVALID_PARAMS. Call it after a successful render or export, download the url before expire_time, and call again for a fresh one when it has expired. The URL is a credential: do not store or share it.
10931
+ */
10932
+ export const studioRenditionsContentUrl = (options) => (options.client ?? client).get({
10933
+ security: [{
10934
+ key: 'BearerAuth',
10935
+ scheme: 'bearer',
10936
+ type: 'http'
10937
+ }, {
10938
+ key: 'ApiKeyAuth',
10939
+ name: 'X-API-Key',
10940
+ type: 'apiKey'
10941
+ }],
10942
+ url: '/studio/v1/works/{work}/renditions/{rendition}/content',
10943
+ ...options
10944
+ });
10714
10945
  /**
10715
10946
  * List vaults
10716
10947
  *