@deepraxis/sdk 0.1.1-dev.d73d5e4 → 0.1.1-dev.d8d3f52

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.
@@ -6796,7 +6796,7 @@ export const cutCreateExport = (options) => (options.client ?? client).post({
6796
6796
  /**
6797
6797
  * Create draft range render
6798
6798
  *
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, 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.
6800
6800
  */
6801
6801
  export const cutCreateRender = (options) => (options.client ?? client).post({
6802
6802
  security: [{
@@ -8311,6 +8311,88 @@ export const mediaCreateDeliveryToken = (options) => (options.client ?? client).
8311
8311
  ...options.headers
8312
8312
  }
8313
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
+ });
8360
+ /**
8361
+ * Generate image
8362
+ *
8363
+ * Generate one or more images from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. Aspect ratio is not accepted for images; name size instead. Generation is charged through Router and the job records the charge in usage; nothing is charged for a request refused before it starts. The response is 202 with a queued Job whose type is image and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/images/generations with {"prompt":"A red kite above a calm sea at sunrise","n":1,"output":"sticker"}.
8364
+ */
8365
+ export const mediaGenerateImage = (options) => (options.client ?? client).post({
8366
+ security: [{
8367
+ key: 'media-BearerAuth',
8368
+ scheme: 'bearer',
8369
+ type: 'http'
8370
+ }],
8371
+ url: '/media/v1/libraries/{library_id}/images/generations',
8372
+ ...options,
8373
+ headers: {
8374
+ 'Content-Type': 'application/json',
8375
+ ...options.headers
8376
+ }
8377
+ });
8378
+ /**
8379
+ * Edit asset
8380
+ *
8381
+ * Edit an existing asset and store the result as a new asset. 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 source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor, remove_background and replace_background on images; every other type in the operation vocabulary — the video and audio edits — is refused with OPERATION_NOT_SUPPORTED. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing is charged through Router and the job records the charge in usage. The response is 202 with a queued Job whose type is image, whose operation is the edit applied, and whose source_asset_id is the asset edited; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read the produced asset. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/edits with {"operation":{"type":"variations","strength":"subtle"}}.
8382
+ */
8383
+ export const mediaEditAsset = (options) => (options.client ?? client).post({
8384
+ security: [{
8385
+ key: 'media-BearerAuth',
8386
+ scheme: 'bearer',
8387
+ type: 'http'
8388
+ }],
8389
+ url: '/media/v1/libraries/{library_id}/assets/{asset_id}/edits',
8390
+ ...options,
8391
+ headers: {
8392
+ 'Content-Type': 'application/json',
8393
+ ...options.headers
8394
+ }
8395
+ });
8314
8396
  /**
8315
8397
  * Summarize understanding failures
8316
8398
  *
@@ -8480,7 +8562,7 @@ export const ontologyListNodes = (options) => (options?.client ?? client).get({
8480
8562
  /**
8481
8563
  * Create node
8482
8564
  *
8483
- * 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.
8565
+ * 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.
8484
8566
  */
8485
8567
  export const ontologyCreateNode = (options) => (options.client ?? client).post({
8486
8568
  security: [{
@@ -8527,6 +8609,20 @@ export const ontologyUpdateNode = (options) => (options.client ?? client).patch(
8527
8609
  ...options.headers
8528
8610
  }
8529
8611
  });
8612
+ /**
8613
+ * Retrieve neighborhood
8614
+ *
8615
+ * 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.
8616
+ */
8617
+ export const ontologyNeighborhood = (options) => (options.client ?? client).get({
8618
+ security: [{
8619
+ key: 'ontology-bearerAuth',
8620
+ scheme: 'bearer',
8621
+ type: 'http'
8622
+ }],
8623
+ url: '/ontology/v1/nodes/{node_id}/neighborhood',
8624
+ ...options
8625
+ });
8530
8626
  /**
8531
8627
  * Merge node
8532
8628
  *
@@ -8562,7 +8658,7 @@ export const ontologyListRelations = (options) => (options?.client ?? client).ge
8562
8658
  /**
8563
8659
  * Create relation
8564
8660
  *
8565
- * 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.
8661
+ * 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.
8566
8662
  */
8567
8663
  export const ontologyCreateRelation = (options) => (options.client ?? client).post({
8568
8664
  security: [{
@@ -8630,7 +8726,7 @@ export const ontologyApplyChangeset = (options) => (options.client ?? client).po
8630
8726
  /**
8631
8727
  * Search nodes
8632
8728
  *
8633
- * 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.
8729
+ * 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.
8634
8730
  */
8635
8731
  export const ontologySearch = (options) => (options.client ?? client).post({
8636
8732
  security: [{
@@ -10635,7 +10731,7 @@ export const studioTemplatesGet = (options) => (options.client ?? client).get({
10635
10731
  /**
10636
10732
  * List the rendition themes of a platform
10637
10733
  *
10638
- * List themes: the layouts a rendition is produced with, for one platform or for all of them. Pass a platform to see only the themes that platform can use. A theme decides the page or card a rendition is built into, so read the chosen theme before creating a rendition rather than after the output looks wrong.
10734
+ * List themes: the layouts a rendition is produced with, for one platform or for all of them. Pass a platform to see only the themes that platform can use. The first page starts with the built-in themes (builtin true, such as warm-card@1 for Xiaohongshu cards and plain-mono@1 for WeChat articles), which every organization can use and nobody can change or delete; your organization's own themes follow. A theme decides the page or card a rendition is built into, so read the chosen theme before creating a rendition rather than after the output looks wrong.
10639
10735
  */
10640
10736
  export const studioThemesList = (options) => (options?.client ?? client).get({
10641
10737
  security: [{
@@ -10730,6 +10826,158 @@ export const studioThemesUpdate = (options) => (options.client ?? client).patch(
10730
10826
  ...options.headers
10731
10827
  }
10732
10828
  });
10829
+ /**
10830
+ * Create a rendition of a draft for a platform
10831
+ *
10832
+ * 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.
10833
+ */
10834
+ export const studioRenditionsCreate = (options) => (options.client ?? client).post({
10835
+ security: [{
10836
+ key: 'BearerAuth',
10837
+ scheme: 'bearer',
10838
+ type: 'http'
10839
+ }, {
10840
+ key: 'ApiKeyAuth',
10841
+ name: 'X-API-Key',
10842
+ type: 'apiKey'
10843
+ }],
10844
+ url: '/studio/v1/works/{work}/drafts/{draft}/renditions',
10845
+ ...options,
10846
+ headers: {
10847
+ 'Content-Type': 'application/json',
10848
+ ...options.headers
10849
+ }
10850
+ });
10851
+ /**
10852
+ * List the renditions of a work
10853
+ *
10854
+ * 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.
10855
+ */
10856
+ export const studioRenditionsList = (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',
10867
+ ...options
10868
+ });
10869
+ /**
10870
+ * Delete a rendition
10871
+ *
10872
+ * 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.
10873
+ */
10874
+ export const studioRenditionsDelete = (options) => (options.client ?? client).delete({
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
+ });
10887
+ /**
10888
+ * Read one rendition
10889
+ *
10890
+ * 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.
10891
+ */
10892
+ export const studioRenditionsGet = (options) => (options.client ?? client).get({
10893
+ security: [{
10894
+ key: 'BearerAuth',
10895
+ scheme: 'bearer',
10896
+ type: 'http'
10897
+ }, {
10898
+ key: 'ApiKeyAuth',
10899
+ name: 'X-API-Key',
10900
+ type: 'apiKey'
10901
+ }],
10902
+ url: '/studio/v1/works/{work}/renditions/{rendition}',
10903
+ ...options
10904
+ });
10905
+ /**
10906
+ * Change the theme or settings of a rendition
10907
+ *
10908
+ * 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.
10909
+ */
10910
+ export const studioRenditionsUpdate = (options) => (options.client ?? client).patch({
10911
+ security: [{
10912
+ key: 'BearerAuth',
10913
+ scheme: 'bearer',
10914
+ type: 'http'
10915
+ }, {
10916
+ key: 'ApiKeyAuth',
10917
+ name: 'X-API-Key',
10918
+ type: 'apiKey'
10919
+ }],
10920
+ url: '/studio/v1/works/{work}/renditions/{rendition}',
10921
+ ...options,
10922
+ headers: {
10923
+ 'Content-Type': 'application/json',
10924
+ ...options.headers
10925
+ }
10926
+ });
10927
+ /**
10928
+ * Render a rendition again from the current draft
10929
+ *
10930
+ * 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.
10931
+ */
10932
+ export const studioRenditionsRender = (options) => (options.client ?? client).post({
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}:render',
10943
+ ...options
10944
+ });
10945
+ /**
10946
+ * Export a rendition
10947
+ *
10948
+ * 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.
10949
+ */
10950
+ export const studioRenditionsPublish = (options) => (options.client ?? client).post({
10951
+ security: [{
10952
+ key: 'BearerAuth',
10953
+ scheme: 'bearer',
10954
+ type: 'http'
10955
+ }, {
10956
+ key: 'ApiKeyAuth',
10957
+ name: 'X-API-Key',
10958
+ type: 'apiKey'
10959
+ }],
10960
+ url: '/studio/v1/works/{work}/renditions/{rendition}:publish',
10961
+ ...options
10962
+ });
10963
+ /**
10964
+ * Get a download URL for a rendition file
10965
+ *
10966
+ * 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.
10967
+ */
10968
+ export const studioRenditionsContentUrl = (options) => (options.client ?? client).get({
10969
+ security: [{
10970
+ key: 'BearerAuth',
10971
+ scheme: 'bearer',
10972
+ type: 'http'
10973
+ }, {
10974
+ key: 'ApiKeyAuth',
10975
+ name: 'X-API-Key',
10976
+ type: 'apiKey'
10977
+ }],
10978
+ url: '/studio/v1/works/{work}/renditions/{rendition}/content',
10979
+ ...options
10980
+ });
10733
10981
  /**
10734
10982
  * List vaults
10735
10983
  *