跳转到内容
EN

Read the whole unit outline as Markdown

Code Mode: praxis.studio.works.drafts.retrieveOutline

HTTP: GET /studio/v1/works/{work}/drafts/{draft}/outline

Read the draft structure as one Markdown page: one line per unit carrying its number, structure name, intent, status, length and revision, followed by the unit list itself. Use it to plan a sequence of writes without reading every unit, since it carries no body text. Read one unit in full with the unit call once you know which one to write.

签名

praxis.studio.works.drafts.retrieveOutline(args:{path:{/** e.g. "wu-gang" */ work:string;/** e.g. "novel" */ draft:string}}):Promise<{/** One line per unit with its number, structure name, intent, status, length and revision, so a plan can be read in a single answer. e.g. "#1 第一章 · 排字房 — 主角看到通缉令 (drafted, 2680 字, r12)" */ markdown:string;/** Units the Markdown was rendered from, without bodies, in draft order. */ units:Array<{/** Unit identifier, stable when units are moved or renamed. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Work this unit belongs to; it is the same value the work path segment carries. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work?:string;/** Draft this unit belongs to; units never move between drafts. e.g. "drf_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ draft?:string;/** In-work number assigned in creation order, never reused and unchanged by a move; it is what the unit path segment takes. e.g. 12 */ number:number;/** Unit this one sits under, or null at the top level of the tree. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ parent?:string;/** Sort key among siblings; it is opaque, and moving a unit rewrites only its own row. e.g. "0|hzzzzz:" */ position?:string;/** Structural kind of this unit, which must be one the genre allows at this position of the tree. e.g. "chapter" */ kind:string;/** Structure name used by people and agents to manage the tree, such as the second scene of a chapter; it is not the published heading. e.g. "第二章 · 排字房" */ name:string;/** Heading the finished piece shows for this unit, or null when it shows none; a genre may require it or forbid it. e.g. "第二章 排字房" */ heading?:string;intent:{/** What this unit has to accomplish, written as the story so far for later units; it is what a reader of the outline sees. e.g. "主角在排字房看到通缉令,第一次动摇了立场。" */ synopsis:string;/** Points this unit hits, called beats, arguments or selling points depending on the genre. */ points:Array<string>;/** Keys of the brief points this unit claims, which is how the requirement coverage check knows a point landed. */ brief_points:Array<string>;/** Intent revision, moved whenever the synopsis or the points change; a body written against an older value is behind. e.g. 4 */ revision:number;/** Whether the writer confirmed the synopsis matches what the body actually says, rather than what was planned. */ synopsis_from_body:boolean};/** How far this unit has come, moving forward as intent and body are written; a unit marked final refuses changes without confirmation. */ status:"idea"|"outlined"|"writing"|"drafted"|"revised"|"final";/** Intent revision the current body was written against, or null when there is no body; an older value means the intent moved on. e.g. 4 */ body_from_intent?:number;/** Unit of the upstream draft this one was written from, present when the draft derives from another; a serial of a novel records it per section. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ source_unit?:string;/** Reference entries this unit is tied to, including the mentions detected in its text. */ links?:Array<{/** Identifier of the reference entry this unit is tied to. e.g. "ent_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ entry?:string;/** How the tie came about, which decides whether the entry reaches the context pack for this unit. */ kind?:"mention"|"attached"|"excluded";/** Role of the entry inside this genre, such as point-of-view character or main product; it lifts the entry's priority in the pack. e.g. "视角人物" */ role?:string}>;/** Characters in the body with whitespace removed, which is what the length checks measure. e.g. 2680 */ chars:number;/** Duration in seconds for units of a video genre, or null for a written unit. e.g. 42 */ seconds?:number;/** Unit revision, moved by any change to the unit; pass it as expected_revision when writing the body. e.g. 6 */ revision:number;last_editor?:{/** Whether the change came from a person, an agent or the platform itself; an agent session through the API is recorded as an agent. */ kind?:"user"|"agent"|"system";/** Identifier of that actor, such as a user identifier or an agent session identifier. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id?:string;/** Display name of the actor when one is known, shown beside the change. e.g. "张三" */ label?:string};/** Body blocks, present only when the unit was read with its content; writing block by block needs their identifiers. */ blocks?:Array<{/** Block identifier, carried inline in Markdown as an anchor comment so an edit can address one block without rewriting the body. e.g. "blk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Unit revision at which this block was last changed; it decides whether an older precondition still allows a block edit. e.g. 6 */ revision:number;/** Element kind of this block, from the set the genre allows; it decides how the block is rendered in a rendition. */ type:"paragraph"|"heading"|"list"|"quote"|"code"|"image"|"video"|"divider"|"scene_break"|"callout"|"hashtags"|"link"|"cut"|"canvas";/** Markdown text of this block, empty for blocks that carry a reference instead of words. e.g. "排字房的铅字盘上,压着一张通缉令。" */ text:string;/** File this block shows, for image and video blocks, referenced by its file identifier. e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ file?:string;/** Caption shown with a media block and carried into renditions that keep captions. e.g. "1935 年的排字房" */ caption?:string;/** Heading depth for a heading block, one to four, which decides the outline level in the finished piece. e.g. 2 */ level?:number}>}>}>;

参数

名称位置类型必填说明
workpathstring是The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value.
draftpathstring是Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value.

响应

状态码内容类型说明
200application/jsonThe outline as Markdown plus the unit list it was rendered from, without unit bodies.
400application/jsonINVALID_PARAMS means a field is missing, malformed or not allowed for this resource; correct the named field and repeat the call.
401application/jsonThe API key is missing, invalid or carries no organization; send a valid organization key in the Authorization header.
404application/jsonWORK_NOT_FOUND or DRAFT_NOT_FOUND means the work or the draft inside it is not reachable; use the slug and the draft key from the lists, or resolve a loose name first. A draft renamed earlier still answers under its previous key.
500application/jsonINTERNAL means the request could not complete; re-read the resource before retrying a write, because the write may already have landed.