@deepraxis/cli 0.2.1-dev.fcdebee → 0.2.2-dev.3987a02

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.
package/dist/praxis.js CHANGED
@@ -1218,6 +1218,37 @@ Praxis extension: MA only has session-scoped temporary containers and memory_sto
1218
1218
  }
1219
1219
  ]
1220
1220
  },
1221
+ {
1222
+ resource: "agent.computers.files.convert",
1223
+ method: "create",
1224
+ summary: "Convert a Computer Document to PDF",
1225
+ description: `Convert an Office document (docx, doc, ppt, pptx, rtf, odt; up to 16 MiB) to PDF inside a platform-owned ephemeral document sandbox, whatever machine family the computer itself runs on. Returns base64 PDF bytes.
1226
+
1227
+ Praxis extension: the preview conversion endpoint. The browser never parses an untrusted document — LibreOffice runs only inside an ephemeral document-family sandbox and the converter instance is killed after use. The file stays tenant-owned; non-convertible types answer EXTENSION_NOT_CONVERTIBLE and a failed conversion answers CONVERSION_FAILED.`,
1228
+ http: "POST",
1229
+ path: "/agent/v1/computers/{computer_id}/files/convert",
1230
+ streaming: "no",
1231
+ pagination: false,
1232
+ pathParams: [
1233
+ {
1234
+ name: "computer_id",
1235
+ sdkName: "computer_id",
1236
+ description: "Computer id (cmp_...), as returned by computers.create or computers.list."
1237
+ }
1238
+ ],
1239
+ query: [],
1240
+ body: {
1241
+ required: true,
1242
+ fields: [
1243
+ {
1244
+ name: "name",
1245
+ type: "string",
1246
+ required: true,
1247
+ description: "Name of the entry or object."
1248
+ }
1249
+ ]
1250
+ }
1251
+ },
1221
1252
  {
1222
1253
  resource: "agent.computers.leases",
1223
1254
  method: "delete",
@@ -6100,7 +6131,7 @@ file at the root of that directory.`
6100
6131
  "allow"
6101
6132
  ],
6102
6133
  required: false,
6103
- description: "skip (default) skips when a previous run is still active; allow permits overlapping runs."
6134
+ description: "skip skips while a previous run is still active; allow permits overlapping runs. When omitted, schedule triggers use skip and webhook triggers use allow."
6104
6135
  },
6105
6136
  {
6106
6137
  name: "catchup_window_seconds",
@@ -6274,7 +6305,7 @@ file at the root of that directory.`
6274
6305
  "allow"
6275
6306
  ],
6276
6307
  required: false,
6277
- description: "skip (default) skips when a previous run is still active; allow permits overlapping runs."
6308
+ description: "skip skips while a previous run is still active; allow permits overlapping runs. When omitted, schedule triggers use skip and webhook triggers use allow."
6278
6309
  },
6279
6310
  {
6280
6311
  name: "catchup_window_seconds",
@@ -7085,13 +7116,19 @@ file at the root of that directory.`
7085
7116
  resource: "browser.contexts",
7086
7117
  method: "list",
7087
7118
  summary: "列出浏览器上下文",
7088
- description: "分页列出当前账户保存的登录态,按登录态 ID 升序排列。每项返回名称、标签及保存内容的统计信息;将 nextCursor 原样传入读取下一页,直到其为 null。",
7119
+ description: "分页列出当前账户保存的登录态,按登录态 ID 升序排列。每项返回名称、标签及保存内容的统计信息;将 nextCursor 原样传入读取下一页,直到其为 null。传 name 时只返回该名称的登录态;名称在当前账户内唯一,所以最多一条。",
7089
7120
  http: "GET",
7090
7121
  path: "/browser/v1/contexts",
7091
7122
  streaming: "no",
7092
7123
  pagination: false,
7093
7124
  pathParams: [],
7094
7125
  query: [
7126
+ {
7127
+ name: "name",
7128
+ type: "string",
7129
+ required: false,
7130
+ description: "按登录态名称精确匹配;名称在当前账户内唯一,所以最多返回一条。省略时列出全部登录态。"
7131
+ },
7095
7132
  {
7096
7133
  name: "cursor",
7097
7134
  type: "string",
@@ -9961,8 +9998,8 @@ Execution errors include error.details.prints containing output printed before f
9961
9998
  {
9962
9999
  resource: "cut.projects.analysis",
9963
10000
  method: "create",
9964
- summary: "Analyze project media",
9965
- description: "Request silence, filler-word or scene analysis for selected bound assets before editing. Omit media to select project sources; ranges returned in segments use source seconds. A pending result is not completion: use retry_after_sec before checking again, and inspect failed or unsupported asset results before deciding which edits are possible. Silence measures transcript-based speech pauses, not music or loudness. A completed transcript without words returns ready with empty segments and reason no_speech; no completed transcript returns unsupported with reason no_transcript. A failed transcription remains failed.",
10001
+ summary: "Analyze project media or measure the project mix",
10002
+ description: "Request silence, filler-word or scene analysis for selected bound assets before editing, or measure the mix the timeline itself renders with kind mix. That kind is a render job, not a read: it answers pending with retry_after_sec and is polled by the id it returned, because the answer only exists once the audio has been rendered and measured. Omit media to select project sources; ranges returned in segments use source seconds. A pending result is not completion: use retry_after_sec before checking again, and inspect failed or unsupported asset results before deciding which edits are possible. Silence measures transcript-based speech pauses, not music or loudness. A completed transcript without words returns ready with empty segments and reason no_speech; no completed transcript returns unsupported with reason no_transcript. A failed transcription remains failed. kind mix is separate: it reports the project mix loudness, the loudness of each role and where music masks speech, so an editor can fix the mix rather than guess at it.",
9966
10003
  http: "POST",
9967
10004
  path: "/cut/v1/projects/{project_id}/analysis",
9968
10005
  streaming: "no",
@@ -9992,10 +10029,35 @@ Execution errors include error.details.prints containing output printed before f
9992
10029
  enum: [
9993
10030
  "silence",
9994
10031
  "filler",
9995
- "scenes"
10032
+ "scenes",
10033
+ "mix"
9996
10034
  ],
9997
10035
  required: true,
9998
- description: "Analysis types to request for the selected source assets."
10036
+ description: "Analysis types to request. silence, filler and scenes analyze the selected source assets and are read from the media library; mix measures the project's own rendered mix and is requested on its own."
10037
+ },
10038
+ {
10039
+ name: "from",
10040
+ type: "number",
10041
+ required: false,
10042
+ description: "Range start for kind mix, in seconds on the project clock. Omitted with to, the whole timeline is measured, capped at 120 seconds. Ignored by the asset kinds."
10043
+ },
10044
+ {
10045
+ name: "to",
10046
+ type: "number",
10047
+ required: false,
10048
+ description: "Range end for kind mix, in seconds on the project clock, exclusive. A range longer than 120 seconds is refused; request several ranges instead."
10049
+ },
10050
+ {
10051
+ name: "revision",
10052
+ type: "integer",
10053
+ required: false,
10054
+ description: "Optional committed project revision to measure; omission uses the current revision. Mix only."
10055
+ },
10056
+ {
10057
+ name: "id",
10058
+ type: "string",
10059
+ required: false,
10060
+ description: "Poll one running mix measurement by the id its first call returned. Sending id reads that measurement and renders nothing."
9999
10061
  }
10000
10062
  ]
10001
10063
  }
@@ -10167,7 +10229,13 @@ Execution errors include error.details.prints containing output printed before f
10167
10229
  name: "loudness",
10168
10230
  type: "object",
10169
10231
  required: false,
10170
- description: "Optional loudness normalization target; normalization adds analysis and rendering work."
10232
+ description: "Loudness normalization target. Omitted, the export is normalized to -14 LUFS integrated and -1 dBTP true peak, the level short-video and streaming platforms play at; null renders without normalization. Normalization adds analysis and rendering work."
10233
+ },
10234
+ {
10235
+ name: "poster",
10236
+ type: "object",
10237
+ required: false,
10238
+ description: "Cover frame, in seconds on the project clock. Omitted, the cover is the first frame with picture that is not inside a fade-in or a transition — a black opening no longer makes the library thumbnail black. A frame inside a transition is skipped, and a timeline that is black throughout keeps its first frame (reported as BLACK_FIRST_FRAME). The frame actually used is reported as poster_at on the export."
10171
10239
  }
10172
10240
  ]
10173
10241
  }
@@ -10250,6 +10318,57 @@ Execution errors include error.details.prints containing output printed before f
10250
10318
  ]
10251
10319
  }
10252
10320
  },
10321
+ {
10322
+ resource: "cut.projects.renders",
10323
+ method: "create",
10324
+ summary: "Create draft range render",
10325
+ description: "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.",
10326
+ http: "POST",
10327
+ path: "/cut/v1/projects/{project_id}/renders",
10328
+ streaming: "no",
10329
+ pagination: false,
10330
+ pathParams: [
10331
+ {
10332
+ name: "project_id",
10333
+ sdkName: "project_id",
10334
+ description: "Project identifier returned by its create or list operation; use the id, not a display name."
10335
+ }
10336
+ ],
10337
+ query: [],
10338
+ body: {
10339
+ required: true,
10340
+ fields: [
10341
+ {
10342
+ name: "kind",
10343
+ type: "string",
10344
+ enum: [
10345
+ "audio",
10346
+ "video"
10347
+ ],
10348
+ required: true,
10349
+ description: "audio renders the mixed soundtrack alone as an .m4a file for listening; video renders a draft-quality .mp4 with picture and sound for looking at. An audio draft is the cheaper of the two and is what a loudness or mix measurement asks for."
10350
+ },
10351
+ {
10352
+ name: "from",
10353
+ type: "number",
10354
+ required: true,
10355
+ description: "Start of the interval in seconds on the project clock, inclusive. Must be less than to."
10356
+ },
10357
+ {
10358
+ name: "to",
10359
+ type: "number",
10360
+ required: true,
10361
+ description: "End of the interval in seconds on the project clock, exclusive. At most 120 seconds after from, and never beyond the timeline duration; a longer passage is requested as several ranges."
10362
+ },
10363
+ {
10364
+ name: "revision",
10365
+ type: "integer",
10366
+ required: false,
10367
+ description: "Committed project revision from retrieve, state, timeline or execute; increases after each successful write."
10368
+ }
10369
+ ]
10370
+ }
10371
+ },
10253
10372
  {
10254
10373
  resource: "cut.projects",
10255
10374
  method: "retrieveState",
@@ -10391,7 +10510,159 @@ Execution errors include error.details.prints containing output printed before f
10391
10510
  resource: "cut.projects",
10392
10511
  method: "execute",
10393
10512
  summary: "Execute editing script",
10394
- description: 'Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project: `const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);`\n\n### Script function reference\n\nFunctions are synchronous globals; do not import them. `project` is the current project ID. TrackId and ClipId are strings returned by AddTrack and Insert or read from GetTimeline. JoinId is the string returned by Join or read from GetTimeline().joins. Reads see earlier writes in the same script.\n\n```ts\nGetTimeline(o?: { from?: number; to?: number; tracks?: TrackId[] }): TimelineView;\nGetItem(id: ClipId): ItemView;\nFindItems<T>(visit: (item: ItemView, ctx: { track: TrackView; index: number }) => T | undefined): T[];\nGetMedia(ref: MediaRef): MediaInfo;\nGetTranscript(ref: MediaRef, o?: { from?: number; to?: number }): Word[];\nGetAnalysis(ref: MediaRef, kind: AnalysisKind): Segment[];\nListTransitions(): TransitionInfo[];\nListEffects(): EffectInfo[];\nListTextStyles(): TextStylePreset[];\nListTextTemplates(): TextTemplate[];\nListAnimations(): { id: string; version: number; phase: "in" | "out" | "loop"; target: "any" | "text"; name: string; description: string; defaultDuration: number; params: { name: string; type: string; values?: string[]; default?: string | number; min?: number; max?: number; description: string }[] }[];\nListFonts(): { family: string; weights: number[]; scripts: ("latin"|"cjk")[]; source: "bundled"|"catalog" }[];\nInsert(track: TrackId, item: ItemInit, o?: { ripple?: boolean }): ClipId;\nUpdate(id: ClipId, patch: ItemPatchView): void;\nSetSpeed(id: ClipId, rate: number | { curve: { at: number; rate: number; ease?: Ease }[]; audio?: "mute" | "resample" }, o: { keep: "source" | "duration"; ripple?: boolean }): { length: number; sourceOut: number };\nDelete(id: ClipId, o?: { ripple?: boolean }): void;\nJoin(left: ClipId, right: ClipId, o: { length?: number; effect: TransitionInput }): JoinId;\nUpdateJoin(id: JoinId, patch: { length?: number; effect?: TransitionInput }): void;\nDeleteJoin(id: JoinId): void;\nSplit(id: ClipId, at: number): ClipId;\nTrim(id: ClipId, edge: "in" | "out", delta: number, o?: { ripple?: boolean }): void;\nMove(id: ClipId, start: number, track?: TrackId): void;\nRippleDeleteRange(from: number, to: number, tracks?: TrackId[]): void;\nAddTrack(kind: "video" | "audio" | "caption", init?: { name?: string; role?: "voice" | "music" | "sfx" }, index?: number): TrackId;\nUpdateTrack(id: TrackId, patch: TrackPatch): void;\nDeleteTrack(id: TrackId): void;\nSetSettings(patch: Partial<ProjectSettingsView>): void;\nAddCaptionsFromTranscript(track: TrackId, source: ClipId, o?: { style?: Partial<CaptionStyle> & { preset?: string }; maxChars?: number }): ClipId[];\nInsertTemplate(track: TrackId, o: { template: string; start: number; slots?: Record<string, string> }): ClipId[];\nAlignCaptions(trackId: TrackId, script: string): { replaced: number; added: number; deleted: number };\nSetMarker(at: number, label: string): string;\nPrint(...values: unknown[]): void;\nPreview(at: number[]): void;\n```\n\n| Functions | Behavior and arguments |\n| --- | --- |\n| GetTimeline, GetItem | Read compact item views: id, track, type, start, end, length, optional media, playback, sourceIn/sourceOut, text, effects, blend and offline reason. GetTimeline returns duration, tracks (id, kind, name, index, locked, items), and joins (id, track, left, right, length in seconds, normalized effect). from/to and tracks narrow the items and joins; joins are selected by their overlap window. |\n| ListEffects | Discover the shared visual-effect catalog with parameter types, ranges, defaults, cost and bounds. Effects are supported only on visual clips. |\n| ListTransitions | Discover the shared validation catalog: each entry contains kind (effect ID), name, description and params. Each parameter has name, type (enum/number/integer), default, description, enum values or numeric min/max. Use the returned kind and parameter names inside effect. |\n| ListAnimations | Discover animation presets. Each entry has id, version, phase (`in`, `out`, `loop`), target (`any`, `text`), name, description, defaultDuration (seconds), and params (name, type, values/default/min/max/description as applicable). A slot use is `{preset, duration?, ...params}`; duration is seconds. |\n| FindItems | Visit items with their track and index; return undefined to omit an item, any other value to collect it. |\n| GetMedia | Read metadata for `{libraryId, assetId}` in a bound library: kind, dimensions, fps, hasAudio and durationUs when available. durationUs is microseconds. |\n| GetTranscript, GetAnalysis | Read available transcript words or silence/filler/scenes segments. Transcript filter from/to is seconds; returned word and segment from/to values are source microseconds (divide by 1,000,000 for editing). Words contain text and optional speaker/filler; segments may include label/confidence. Request analysis first if unavailable. |\n| Insert, Update, Delete | Insert returns the new clip ID; Update changes supplied fields; Delete removes the clip. Optional ripple on Insert/Delete closes or opens space on the track. |\n| SetSpeed | Change video/audio rate in 0.25–4; keep is required. A `{curve: [{at, rate, ease?}, ...], audio?: "mute" | "resample"}` rate is forward-only and holds output duration fixed; pitch preservation is unavailable. Scalar rates: source preserves consumed source and changes length; duration preserves output length. Returns actual length and sourceOut in seconds. Optional ripple explicitly shifts same-track followers when keeping source; otherwise overlaps are rejected. |\n| Join, UpdateJoin, DeleteJoin | Join creates an overlap between two butt-adjacent visual clips on the same track and returns its ID. length defaults to 0.5 seconds; effect is required. The right clip and all same-track followers move left by length, shortening that track and potentially the project. UpdateJoin moves those followers by the difference in length; omitted fields are preserved. DeleteJoin moves them right to restore the butt cut. Other tracks stay in place. |\n| Split, Trim, Move | Split at a timeline position and return the new right-hand clip ID. Trim changes the in or out edge by delta seconds. Move sets the timeline start and optionally a new track. |\n| RippleDeleteRange | Delete a timeline interval and close its gap on the specified tracks, or all unlocked tracks when omitted. |\n| AddTrack, UpdateTrack, DeleteTrack | Add video/audio/caption tracks; index selects layer order (0 is top). TrackPatch supports name, locked, hidden, muted, gainDb, audio role (`voice`, `music`, `sfx`) and style as appropriate to track kind. |\n| SetSettings | Supply any of width/height (pixels), fps (frames per second), background (color). |\n| AddCaptionsFromTranscript | Create captions from an audio/video clip\'s kept words. Optional maxChars is 1–1000, default 16; style updates the caption track. Returns caption IDs. |\n| SetMarker | Add a label at a timeline time and return its ID. |\n| Print, Preview | Print appends text to prints. Preview requests up to eight times total per execute and puts images in the result\'s frames. Each url is an inline PNG data URL, not an HTTP image link. Decode the base64 payload to save an image. Codemode returns at most four images per call; request at most four times there. |\n\n#### Joins between clips\n\nEndpoints may be video, image, text, color or shape; audio and caption are rejected. Require 0 < length < each endpoint\'s length. Each clip allows at most one incoming and one outgoing join; their summed lengths cannot exceed its length. Three-input overlaps, nonadjacent endpoints and cross-track joins are rejected with OPS_REJECTED. Read the rejection\'s code and message, shorten or remove conflicting joins, and retry the saved edit.\n\nTransitionInput is an object with kind plus the parameters returned by ListTransitions; omitted parameters use catalog defaults. Unknown kinds and invalid parameters return INVALID_TRANSITION_PARAM with available parameters. Effects: dissolve; dip color black/white default black; push and wipe direction left/right/up/down default left; wipe softness 0–1 default 0; iris centerX/centerY 0–1 default 0.5; blinds integer count 2–64 default 8 and orientation vertical/horizontal default vertical; blur radius 0–100 pixels at 1080-pixel frame height default 24; zoom direction in/out default in, amount 0.1–3 default 1, blur 0–1 default 0.5; clock direction clockwise/counterclockwise default clockwise, startAngle 0–360 degrees default 0 (twelve o\'clock), softness 0–1 default 0; flash color white/black default white, intensity 0–1 default 1. Zoom blur uses up to eight radial samples per shot and is slower on server rendering. Join options and UpdateJoin patches accept only length and effect. Effect updates replace the effect object and apply defaults for omitted parameters.\n\nMinimal example on an existing visual track with adjacent clips left and right: `Print(ListTransitions()); const j = Join(left, right, {length: 0.5, effect: {kind: "dissolve"}}); Print(GetTimeline().joins); Preview([GetItem(right).start + 0.25]);` Use `UpdateJoin(j, {length: 0.8})` to adjust it in a later edit or `DeleteJoin(j)` to restore the cut. Preview uses server-rendered frames and includes joins. Per-clip transitionIn/transitionOut remain separate entrance/exit effects.\n\n#### Insert fields (ItemInit)\n\nEvery item requires `type` and `start`. Times used for editing are seconds and snap to the project frame rate: start, length, sourceIn, fadeIn/fadeOut, transition length, keyframe at, reveal delay/stagger/duration. Keyframe and reveal times are relative to the clip start. Video/audio may omit length to use the remaining source duration; other types require length.\n\n| type | Required fields beyond type/start | Optional fields |\n| --- | --- | --- |\n| video | media | length, sourceIn, playback, volumeDb, transform, fit, blend, animate, animation, effects, mask, transitionIn, transitionOut |\n| image | media, length | transform, fit, blend, animate, animation, effects, mask, transitionIn, transitionOut |\n| text | text, length | style, transform, blend, reveal, animate, animation, effects, mask, transitionIn, transitionOut |\n| color | color, length | transform, fill, blend, animate, animation, effects, mask, transitionIn, transitionOut |\n| shape | shape, length, width, height, fill | radius, stroke, transform, blend, animate, animation, effects, mask, transitionIn, transitionOut |\n| audio | media | length, sourceIn, playback, volumeDb, gain, fadeIn, fadeOut |\n| caption | text, length | — |\n\nVisual Insert/Update also accepts `blend`: `normal` (default), `screen`, `multiply`, `overlay`, or `add`; set it to null in Update to clear it. During a Join overlap, both inputs render with normal blending. Video tracks accept video/image/text/color/shape; audio and caption tracks accept their corresponding type. Media is `{libraryId: string, assetId: string}` from a bound library. sourceIn defaults to 0, volumeDb to 0 dB, audio fades to 0 seconds. fit defaults to contain: contain fits the whole image, cover fills and crops, fill stretches, none keeps native dimensions.\n\n| Field | Value |\n| --- | --- |\n| transform | Partial `{x, y, scale, rotation, opacity, crop, blur}`. x/y are normalized canvas center coordinates (default 0.5); scale 1 is fitted size; rotation is degrees (default 0); opacity is 0–1 (default 1). crop is `{top,right,bottom,left}`. blur is 0–100 pixels at 1080-pixel frame height. |\n| style | Partial `{fontFamily, fontSize, fontWeight, color, fill, stroke, strokes, shadows, glow, background, align, maxWidth, position, margin}`. fill accepts a color or linear/radial gradient across the entire text bounding box. strokes draw outside to inside; at most 4, width 0–40. shadows accepts at most 4 `{color,x,y,blur}` entries; blur is 0–100. glow is `{color,radius,strength}` with radius 0–100 and strength 0–1. All dimensions use pixels at 1080 frame height and scale with the text. Glow and large shadow blur increase render time. Invalid colors or ranges return actionable INVALID_STYLE errors. `ListFonts()` discovers family, available weights, scripts and bundled/catalog source. Text and captions share the style fields; caption style additionally supports highlightColor and maxLines: 2. |\n| animate | An object keyed by x, y, scale, rotation, opacity or blur. Each value is an array of `{at: number, value: number, ease?: Ease}` sorted by at with distinct frame-snapped times. Values hold before the first and after the last keyframe, overriding the static transform. |\n| animation | `{in?: AnimationUse, out?: AnimationUse, loop?: AnimationUse}` on visual clips. Each use is `{preset: string, duration?: number, ...params}`; duration and parameter units follow `ListAnimations()`. Presets replace existing animate and reveal when applied. Update accepts `animation: null` to clear the preset and its generated effects. |\n| Ease | linear, in, out, inOut, `{bezier: [x1,y1,x2,y2]}` or `{spring: {stiffness, damping, mass?}}`. Easing shapes the segment arriving at that keyframe; springs may overshoot. |\n| reveal | `{by, delay?: number, stagger: number, duration: number, from: {y?, opacity?, scale?, blur?}, ease?: Ease}`. by selects char, word or line. Unit k starts at delay + k * stagger and takes duration seconds to reach its resting state; from.y is a fraction of font size. |\n| fill | A color string (#RRGGBB or #RRGGBBAA), `{linear: {angle, stops: [{at,color}, ...]}}` or `{radial: {stops: [{at,color}, ...]}}`. Stop positions are 0–1; angle is degrees, 0 left to right. On color clips, fill replaces color when supplied. |\n| shape, width, height, radius, stroke | shape is rect or ellipse. width/height are fractions of canvas width/height before scaling. radius rounds rect corners in pixels at 1080-pixel frame height. stroke is `{color: string, width: number}`. |\n| transitionIn, transitionOut | `{kind, length: number}` at the clip\'s beginning/end. length is seconds. fade changes opacity; dissolve blends; push_left/push_right move horizontally; wipe_left reveals horizontally. |\n\n#### Visual effects\n\n`effects` is an ordered stack of at most 8 catalog entries. Call `ListEffects()` to discover the catalog; unknown kinds return `UNKNOWN_EFFECT`, invalid names/values/keyframes return `INVALID_EFFECT_PARAM`, and stacks over 8 return `TOO_MANY_EFFECTS`. Entries include blur, color adjustment, vignette, film grain, chromatic aberration, pixelate, glitch, shake, flash, light leak and built-in `lut` looks; user `.cube` LUTs are not supported. `speed` is cycles per second. Effects run on CPU during export and increase render time. Parameters are discovered with ListEffects(). Catalog entries expose their own parameters through ListEffects(), including `blur` (`radius` 0–100, default 24) and `color_adjust`: `brightness`, `contrast`, `temperature`, and `tint` each range -1–1 (default 0), while `saturation` ranges 0–2 (default 1). Disabled entries are skipped. `color_adjust` uses an SDR-only Rec.709 adjustment matrix with no color management.\n\nNumeric and integer effect parameters accept `keyframes: {parameter: [{at, value, ease?}, ...]}`; times are seconds relative to the clip, snap to frames like `animate`, must be strictly increasing and within clip duration, and values follow that parameter\'s catalog range. Omitted parameters use catalog defaults. Trim and Split preserve effect keyframes with the same clip-local behavior as `animate`. There are no custom shaders.\n\n`blend` applies to the completed visual layer after its content, effects and `transform.blur`; `add` maps to Skia Plus. The default `normal` path adds no blend layer. During Join overlaps, blending is forced to normal because each input is composed on transparency.\n\n#### Update fields (ItemPatchView)\n\nAll fields are optional; use only fields relevant to the item\'s type. Supported fields: start, length, sourceIn, playback, volumeDb, transform, fit, text, style, color, fadeIn, fadeOut, animate, reveal, animation, fill, stroke, shape, width, height, radius, transitionIn, transitionOut, effects, blend, mask, gain. Values and units match Insert; set effects or blend to null to clear them. Set animation to null to clear the preset; set animate or reveal to null to remove that effect. Applying a preset replaces existing animate/reveal. Do not set animation together with animate or reveal in one Insert/Update call. Omit a field to preserve it.\n\n#### Animation presets\n\nDiscover the catalog with `ListAnimations()`. Its entries contain id, version, phase (`in`, `out`, `loop`), target (`any` or `text`), name, description, defaultDuration in seconds, and params. Slots may combine one in, one out and one loop preset. A loop runs only in the interval between in and out; if the same property is animated by multiple slots, loop occupies only that middle interval. Text-target presets are entrances. Their duration controls the rhythm per character/word/line, not the total reveal time. Out and loop presets apply to the whole clip, not per text unit.\n\nPresets replace the clip\'s existing animate and reveal when applied. The source preset is retained, so changing clip length or transform automatically regenerates its keyframes/reveal. If a clip becomes shorter, in/out durations shrink proportionally; when it grows, the requested durations are restored. Split keeps in on the left, out on the right, and loop on both. Writing animate or reveal directly detaches the preset; setting animation to null clears both source and generated effects. Insert/Update reject a call that supplies animation together with animate or reveal.\n\nErrors: UNKNOWN_ANIMATION (unknown preset), INVALID_ANIMATION_PARAM (invalid slot/parameter or frame/keyframe limit), ANIMATION_TOO_LONG (in+out exceed clip length), ANIMATION_TARGET_MISMATCH (text-only preset on a non-text or preset on non-visual clip), ANIMATION_PHASE_MISMATCH (preset in the wrong slot). Each animated property is limited to 600 keyframes; loop duration must be at least 4 frames. `ANIMATION_TOO_LONG` is avoided during later length changes by proportional fitting.\n\n#### Speed, reverse and freeze\n\nVideo/audio Insert and Update accept playback as `{kind: "rate", rate: number, direction: "forward" | "reverse", audio: "preservePitch" | "resample" | "mute"}` or `{kind: "freeze"}`. Rate is finite and inclusive 0.25–4. Omitted playback defaults to 1× forward with preservePitch; supply the complete rate object when changing playback. preservePitch keeps pitch, resample changes pitch with speed, mute removes audio. Reverse requires explicit audio: "mute"; preservePitch/resample are rejected with UNSUPPORTED_PLAYBACK rather than silently muted. Freeze holds sourceIn and is silent. GetItem/GetTimeline echo playback and the source interval in seconds; sourceOut is exclusive even for reverse and equals sourceIn for freeze.\n\nUpdate of playback keeps output length unless length is also supplied. SetSpeed preserves direction/audio, rejects frozen and non-video/audio clips, and requires keep: "source" or "duration". keep: "source" computes round(consumed source / new rate × fps) frames, falling back to floor if rounding would exceed the source end; the returned length/sourceOut are actual frame-rounded seconds. keep: "duration" keeps output length and changes source consumption. Length conflicts fail with OVERLAP; move/shorten the conflicting clip, keep duration, or explicitly use ripple: true to shift following clips on the same track. Source overflow fails with OUT_OF_SOURCE; rate limits fail with RATE_OUT_OF_RANGE. Unknown playback fields and SetSpeed options are rejected with UNKNOWN_FIELD; options only accept keep and boolean ripple.\n\nExample for an existing four-second video/audio clip id: `Print(SetSpeed(id, 0.5, {keep: "source"})); Print(SetSpeed(id, 2, {keep: "source"}));` returns lengths 8 then 2, keeping the same source interval. Reverse: `Update(id, {playback: {kind: "rate", rate: 1, direction: "reverse", audio: "mute"}})`. Freeze: `Update(id, {playback: {kind: "freeze"}})`. Ensure enough source remains for the chosen length/rate. Browser reverse playback currently displays a placeholder; server-rendered Preview/frames and exports support reverse normally. Speed-adjusted audio is generated asynchronously after the edit transaction commits; exports wait for that audio before rendering.\n\n#### Script names versus HTTP response names\n\nUse camelCase inside scripts, including nested objects. HTTP request/response JSON outside script source uses snake_case. Map media.library_id → media.libraryId, media.asset_id → media.assetId, source_in → sourceIn, volume_db → volumeDb, fade_in/fade_out → fadeIn/fadeOut, transition_in/transition_out → transitionIn/transitionOut, font_family/font_size/font_weight/max_width → fontFamily/fontSize/fontWeight/maxWidth, gain_db → gainDb, highlight_color/max_lines → highlightColor/maxLines. Fields such as animate, reveal, fill, stroke, at and length retain their spelling. GetTimeline/GetItem already return camelCase compact views; the expanded retrieveTimeline HTTP response is not an Insert object.\n\nUnrecognized script fields fail with OPS_REJECTED and rejection code UNKNOWN_FIELD; snake_case mistakes suggest the corresponding camelCase name. The error message lists each rejection\'s #opIndex, code and reason. Correct the named fields and retry the saved edit; do not assume an ignored field applied an effect.\n',
10513
+ description: `Edit the current timeline atomically using synchronous JavaScript source. Read state or timeline first, then pass its revision as expected_revision to detect concurrent changes. Unlike Shotstack, execute applies script edits to a persistent project in one transaction. Provide script or a saved edit_id with literal edits, never both; failures roll back writes. A revision conflict while preparing the response may follow a committed edit: retrieve state before retrying. Minimal script after creating a project: \`const t = AddTrack("video"); Insert(t, {type: "color", color: "#123456", start: 0, length: 3}); Print(t);\`
10514
+
10515
+ <!-- cut-reference:start -->
10516
+ ### Script function, field and error reference
10517
+
10518
+ Every script function, clip field and error code has its own section, read one at a time:
10519
+
10520
+ \`\`\`
10521
+ codemode.describe("praxis.cut.script.<Name>") // one function: signature, arguments, return, errors, example
10522
+ codemode.describe("praxis.cut.fields.<name>") // one field: type, unit, range, default, where writable
10523
+ codemode.describe("praxis.cut.errors.<CODE>") // one code: meaning, causes, fix
10524
+ codemode.describe("praxis.cut.script") // names, one page at a time
10525
+ \`\`\`
10526
+
10527
+ Published at https://docs.deepraxis.com/docs/developers/cut/script-reference with one anchor per entry. Names below omit the \`praxis.cut.<kind>.\` prefix.
10528
+
10529
+ #### Script functions (script)
10530
+
10531
+ - \`GetTimeline\` — Duration, tracks, joins; clips are under \`items\`.
10532
+ - \`GetItem\` — One clip's compact view, by id.
10533
+ - \`FindItems\` — Visit every clip with its track; collect results.
10534
+ - \`GetMedia\` — Media metadata; \`durationUs\` is microseconds.
10535
+ - \`GetTranscript\` — Transcript words in source microseconds.
10536
+ - \`GetAnalysis\` — Silence, filler or scene segments.
10537
+ - \`ListTransitions\` — Join transition kinds and parameters.
10538
+ - \`ListEffects\` — Visual-effect catalog and parameters.
10539
+ - \`ListAnimations\` — Animation presets by phase and target.
10540
+ - \`ListFonts\` — Font families, weights and scripts.
10541
+ - \`ListTextStyles\` — Text style presets for \`style.preset\`.
10542
+ - \`ListTextTemplates\` — Multi-layer templates and their slots.
10543
+ - \`Insert\` — Add a clip; a track never overlaps itself.
10544
+ - \`Append\` — Add a clip at the end of a track.
10545
+ - \`Update\` — Change named fields; the rest stay.
10546
+ - \`SetSpeed\` — Change rate, keeping source or duration.
10547
+ - \`Delete\` — Remove a clip. There is no \`Remove\`.
10548
+ - \`Join\` — Overlap clips; followers shift, track shortens.
10549
+ - \`UpdateJoin\` — Change a join's length or effect.
10550
+ - \`DeleteJoin\` — Remove a join; restore the butt cut.
10551
+ - \`Split\` — Cut a clip in two at a time.
10552
+ - \`Trim\` — Move one clip edge by seconds.
10553
+ - \`Move\` — Set a clip's start or track.
10554
+ - \`RippleDeleteRange\` — Cut a time range and close the gap.
10555
+ - \`AddTrack\` — Add a video, audio or caption track.
10556
+ - \`UpdateTrack\` — Change a track's name, lock, gain or role.
10557
+ - \`DeleteTrack\` — Remove a track and its clips.
10558
+ - \`SetSettings\` — Change canvas, frame rate or background.
10559
+ - \`AddCaptionsFromTranscript\` — Captions from a clip's kept words.
10560
+ - \`InsertTemplate\` — Insert a template and fill its slots.
10561
+ - \`AlignCaptions\` — Rebuild captions from text punctuation.
10562
+ - \`ImportCaptions\` — Import SRT or WebVTT onto captions.
10563
+ - \`ExportCaptions\` — Export captions as SRT or WebVTT.
10564
+ - \`SetMarker\` — Label a timeline position.
10565
+ - \`Print\` — Append values to the result's \`prints\`.
10566
+ - \`Preview\` — Up to 8 frames as inline PNG data URLs.
10567
+
10568
+ #### Fields (fields)
10569
+
10570
+ - \`type\` — Clip kind; decides which fields apply.
10571
+ - \`start\` — Clip start in seconds; snaps to frames.
10572
+ - \`length\` — Duration; optional for video and audio.
10573
+ - \`media\` — Source \`{ libraryId, assetId }\`.
10574
+ - \`sourceIn\` — First source second kept; default 0.
10575
+ - \`sourceOut\` — Exclusive source end; read-only.
10576
+ - \`text\` — Text of a text or caption clip.
10577
+ - \`color\` — Solid colour of a color clip.
10578
+ - \`shape\` — Shape clip kind: \`rect\` or \`ellipse\`.
10579
+ - \`width\` — Shape width, a fraction of canvas width.
10580
+ - \`height\` — Shape height, a fraction of canvas height.
10581
+ - \`radius\` — Rect corner rounding, in 1080-height px.
10582
+ - \`fill\` — Shape or text paint: colour or gradient.
10583
+ - \`stroke\` — Shape outline: colour and width.
10584
+ - \`transform\` — Position, scale, rotation, opacity, crop, blur.
10585
+ - \`fit\` — contain, cover, fill or none.
10586
+ - \`blend\` — Layer blend mode; null clears.
10587
+ - \`style\` — Text styling: font, fill, strokes, glow, position.
10588
+ - \`style.position\` — top, middle or bottom; omit it, never null.
10589
+ - \`playback\` — Rate, direction, audio policy, or freeze.
10590
+ - \`volumeDb\` — Audio level in dB; 0 is source level.
10591
+ - \`gain\` — Keyframed audio level in dB.
10592
+ - \`fadeIn\` — Fade-in seconds at the clip's start.
10593
+ - \`fadeOut\` — Fade-out seconds at the clip's end.
10594
+ - \`duck\` — Lower this clip while another track plays.
10595
+ - \`animate\` — Transform keyframes; \`at\` is clip-relative seconds.
10596
+ - \`reveal\` — Per-character, word or line reveal timing.
10597
+ - \`animation\` — Preset slots \`{ in, out, loop }\`; null clears.
10598
+ - \`effects\` — Effect stack, at most 8; null clears.
10599
+ - \`transitionIn\` — Entrance effect: kind plus seconds.
10600
+ - \`transitionOut\` — Exit effect: kind plus seconds.
10601
+ - \`mask\` — Shape, path or track matte.
10602
+ - \`words\` — Caption words with clip-local times.
10603
+
10604
+ #### Error codes (errors)
10605
+
10606
+ - \`JOIN_CONFLICT\` — A join is invalid or blocks this edit.
10607
+ - \`INVALID_TRANSITION\` — Bad transition kind, parameter or length.
10608
+ - \`INVALID_STYLE\` — A style value is out of range.
10609
+ - \`INVALID_MASK\` — A mask definition is malformed.
10610
+ - \`MASK_IN_USE\` — The edit would break a live mask.
10611
+ - \`TOO_MANY_MASKS\` — At most 16 masks per project.
10612
+ - \`RATE_OUT_OF_RANGE\` — A rate is outside 0.25-4.
10613
+ - \`UNSUPPORTED_PLAYBACK\` — Reverse without an explicit mute.
10614
+ - \`INVALID_PLAYBACK\` — A playback object is partial or malformed.
10615
+ - \`UNKNOWN_FONT\` — The family is not in \`ListFonts()\`.
10616
+ - \`UNKNOWN_FIELD\` — The field name is not accepted here.
10617
+ - \`UNKNOWN_TEXT_STYLE\` — \`style.preset\` is not in the catalog.
10618
+ - \`TEXT_STYLE_TARGET_MISMATCH\` — Preset on the wrong clip type.
10619
+ - \`CAPTION_ALIGN_LOW_CONFIDENCE\` — Alignment confidence too low; nothing changed.
10620
+ - \`OVERLAP\` — Two clips on one track would share time.
10621
+ - \`OUT_OF_SOURCE\` — The clip would read past its source.
10622
+ - \`LOCKED_TRACK\` — The edit targets a locked track.
10623
+ - \`UNBOUND_LIBRARY\` — The library is not bound to the project.
10624
+ - \`TRACK_KIND_MISMATCH\` — The clip type does not fit the track.
10625
+ - \`NOT_FOUND\` — The named id is not in this project.
10626
+ - \`TOO_SHORT\` — The result would be under one frame.
10627
+ - \`INVALID_DUCK\` — Bad \`duck\` level or a missing track.
10628
+ - \`UNKNOWN_ANIMATION\` — The preset is not in \`ListAnimations()\`.
10629
+ - \`INVALID_ANIMATION_PARAM\` — Bad slot, parameter or keyframe limit.
10630
+ - \`ANIMATION_TOO_LONG\` — In plus out exceed the clip length.
10631
+ - \`ANIMATION_TARGET_MISMATCH\` — The preset does not match the clip type.
10632
+ - \`ANIMATION_PHASE_MISMATCH\` — The preset is in the wrong slot.
10633
+ - \`UNKNOWN_EFFECT\` — The effect is not in \`ListEffects()\`.
10634
+ - \`INVALID_EFFECT_PARAM\` — Bad effect parameter or keyframe.
10635
+ - \`TOO_MANY_EFFECTS\` — More than 8 effects on one clip.
10636
+ - \`PROJECT_NOT_FOUND\` — No visible project has this id.
10637
+ - \`EXPORT_NOT_FOUND\` — No such export in this project.
10638
+ - \`DRAFT_RENDER_NOT_FOUND\` — No such draft render.
10639
+ - \`VERSION_NOT_FOUND\` — No saved version has this revision.
10640
+ - \`LIBRARY_NOT_FOUND\` — The library is missing or invisible.
10641
+ - \`BINDING_INVALID\` — The binding request is malformed.
10642
+ - \`BINDING_IN_USE\` — Clips still use this library's assets.
10643
+ - \`NOTHING_TO_UNDO\` — No earlier revision to return to.
10644
+ - \`NOTHING_TO_REDO\` — No undone revision is waiting.
10645
+ - \`UNDO_CONFLICT\` — The revision to undo is no longer head.
10646
+ - \`REVISION_CONFLICT\` — The project moved; your revision is stale.
10647
+ - \`CUT_BUSY\` — The project is busy; retry.
10648
+ - \`INVALID_CAPTION_FILE\` — The subtitle file is malformed or too big.
10649
+ - \`SCRIPT_ERROR\` — The script threw or did not parse.
10650
+ - \`SCRIPT_LIMIT\` — An execute budget was exceeded.
10651
+ - \`OPS_REJECTED\` — An op failed; the whole edit rolled back.
10652
+ - \`EDIT_EXPIRED\` — The saved edit id is over ten minutes old.
10653
+ - \`MEDIA_OFFLINE\` — The asset cannot be fetched right now.
10654
+ - \`MEDIA_UNAVAILABLE\` — The asset is not usable for rendering.
10655
+ - \`MEDIA_IMPORT_FAILED\` — Importing media failed.
10656
+ - \`FRAME_OUT_OF_RANGE\` — The preview time is outside the project.
10657
+ - \`PROJECT_TOO_LARGE\` — The project exceeds the size limit.
10658
+ - \`RESPONSE_TOO_LARGE\` — The response would exceed its budget.
10659
+ - \`EXPORT_FAILED\` — The render failed; read \`error.cause\`.
10660
+ - \`INVALID_PARAMS\` — The request is malformed.
10661
+ - \`PERMISSION_DENIED\` — This credential may not do that here.
10662
+ - \`NOT_IMPLEMENTED\` — Not available on this platform yet.
10663
+ - \`INTERNAL\` — Unexpected failure; retry with the request id.
10664
+ <!-- cut-reference:end -->
10665
+ `,
10395
10666
  http: "POST",
10396
10667
  path: "/cut/v1/projects/{project_id}:execute",
10397
10668
  streaming: "no",
@@ -10453,6 +10724,24 @@ Execution errors include error.details.prints containing output printed before f
10453
10724
  ],
10454
10725
  query: []
10455
10726
  },
10727
+ {
10728
+ resource: "cut.renders",
10729
+ method: "retrieve",
10730
+ summary: "Retrieve draft range render",
10731
+ description: "Poll a draft render id returned by projects.renders.create to see whether the interval is ready, then read url while it lasts. queued and rendering are in progress; done provides file_id and a short-lived url for the rendered .m4a or .mp4; failed provides error. Only done yields a url, and the file behind it disappears 24 hours after it was stored, so retrieve again when the link has expired.",
10732
+ http: "GET",
10733
+ path: "/cut/v1/renders/{render_id}",
10734
+ streaming: "no",
10735
+ pagination: false,
10736
+ pathParams: [
10737
+ {
10738
+ name: "render_id",
10739
+ sdkName: "render_id",
10740
+ description: "Draft render id (cutr_…) returned by projects.renders.create."
10741
+ }
10742
+ ],
10743
+ query: []
10744
+ },
10456
10745
  {
10457
10746
  resource: "cut.versions",
10458
10747
  method: "restore",
@@ -11425,6 +11714,696 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11425
11714
  ]
11426
11715
  }
11427
11716
  },
11717
+ {
11718
+ resource: "devops.projects.testCases",
11719
+ method: "list",
11720
+ summary: "List test cases",
11721
+ description: "List a project's cases with their health, state and recent statistics, so you can decide which ones a plan must run and which are quarantined. This is the read a test dashboard is built on; filter it to narrow by state or health instead of paging through everything. A case's id is a fingerprint of its own title and path, so it survives a rename — read aliases when reconciling history recorded under an older title.",
11722
+ http: "GET",
11723
+ path: "/devops/v1/projects/{project}/test-cases",
11724
+ streaming: "no",
11725
+ pagination: false,
11726
+ pathParams: [
11727
+ {
11728
+ name: "project",
11729
+ sdkName: "project",
11730
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11731
+ }
11732
+ ],
11733
+ query: [
11734
+ {
11735
+ name: "pageSize",
11736
+ type: "integer",
11737
+ required: false,
11738
+ description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
11739
+ },
11740
+ {
11741
+ name: "pageToken",
11742
+ type: "string",
11743
+ required: false,
11744
+ description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
11745
+ },
11746
+ {
11747
+ name: "filter",
11748
+ type: "string",
11749
+ required: false,
11750
+ description: "AIP-160 equality filter over one declared field at a time, for example state=quarantined or health=broken. Fields a case list does not declare are refused with INVALID_ARGUMENT rather than ignored, so a typo never silently widens the result."
11751
+ },
11752
+ {
11753
+ name: "orderBy",
11754
+ type: "string",
11755
+ required: false,
11756
+ description: "Comma-separated fields to order by, each optionally suffixed with desc, for example createTime desc. Only the fields the resource declares are accepted; anything else is refused so an ordering typo cannot silently return a different order. Omitted uses the resource's own order."
11757
+ }
11758
+ ]
11759
+ },
11760
+ {
11761
+ resource: "devops.projects",
11762
+ method: "retrieveTestCatalog",
11763
+ summary: "Read a commit's test catalog",
11764
+ description: 'Read the catalog version discovered at one commit — how many suites and cases it holds, which frameworks they come from, and how the commit changed them. Call this first: it tells you which suites, cases and sizes exist before you list them or select them into a plan, and the reported diff explains why a case count moved. A commit whose discovery has not finished answers CATALOG_NOT_READY, which means "not yet", not "no tests"; wait and read again. Omit commit to read the newest catalog published for the project.',
11765
+ http: "GET",
11766
+ path: "/devops/v1/projects/{project}/test-catalog",
11767
+ streaming: "no",
11768
+ pagination: false,
11769
+ pathParams: [
11770
+ {
11771
+ name: "project",
11772
+ sdkName: "project",
11773
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11774
+ }
11775
+ ],
11776
+ query: [
11777
+ {
11778
+ name: "commit",
11779
+ type: "string",
11780
+ required: false,
11781
+ description: "Full 40-character commit sha whose catalog you want, from a project branch or commit read. Omit it to read the newest catalog published for the project."
11782
+ }
11783
+ ]
11784
+ },
11785
+ {
11786
+ resource: "devops.projects.testPlans",
11787
+ method: "list",
11788
+ summary: "List test plans",
11789
+ description: "List the project's plans — what each one selects, which stage and gate it belongs to, and when it runs next. Read this before creating a plan, so a new plan extends what exists instead of duplicating a selector an existing plan already covers.",
11790
+ http: "GET",
11791
+ path: "/devops/v1/projects/{project}/test-plans",
11792
+ streaming: "no",
11793
+ pagination: false,
11794
+ pathParams: [
11795
+ {
11796
+ name: "project",
11797
+ sdkName: "project",
11798
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11799
+ }
11800
+ ],
11801
+ query: [
11802
+ {
11803
+ name: "pageSize",
11804
+ type: "integer",
11805
+ required: false,
11806
+ description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
11807
+ },
11808
+ {
11809
+ name: "pageToken",
11810
+ type: "string",
11811
+ required: false,
11812
+ description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
11813
+ },
11814
+ {
11815
+ name: "orderBy",
11816
+ type: "string",
11817
+ required: false,
11818
+ description: "Comma-separated fields to order by, each optionally suffixed with desc, for example createTime desc. Only the fields the resource declares are accepted; anything else is refused so an ordering typo cannot silently return a different order. Omitted uses the resource's own order."
11819
+ }
11820
+ ]
11821
+ },
11822
+ {
11823
+ resource: "devops.projects.testPlans",
11824
+ method: "create",
11825
+ summary: "Create a test plan",
11826
+ description: "Create a plan that decides which cases a stage must run. The plan's key is unique inside the project and is what a later run names; the selector chooses cases by size, purpose, tag, package or explicit ids, and the trigger says when the plan fires by itself. A merge or promotion gate must name the environment it guards, and a plan with a gate but no environment is refused with PLAN_GATE_ENVIRONMENT_MISMATCH rather than created and silently ignored. A plan has no revision history: update it with a patch.",
11827
+ http: "POST",
11828
+ path: "/devops/v1/projects/{project}/test-plans",
11829
+ streaming: "no",
11830
+ pagination: false,
11831
+ pathParams: [
11832
+ {
11833
+ name: "project",
11834
+ sdkName: "project",
11835
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11836
+ }
11837
+ ],
11838
+ query: [],
11839
+ body: {
11840
+ required: true,
11841
+ fields: [
11842
+ {
11843
+ name: "key",
11844
+ type: "string",
11845
+ required: true,
11846
+ description: "Short name for the plan, unique inside the project; a key already in use is refused rather than silently reused."
11847
+ },
11848
+ {
11849
+ name: "title",
11850
+ type: "string",
11851
+ required: true,
11852
+ description: "Display title of the plan, shown wherever the plan is listed."
11853
+ },
11854
+ {
11855
+ name: "stage",
11856
+ type: "string",
11857
+ enum: [
11858
+ "dev",
11859
+ "presubmit",
11860
+ "postsubmit",
11861
+ "nightly",
11862
+ "production"
11863
+ ],
11864
+ required: true,
11865
+ description: "Which stage of delivery this plan belongs to, which decides when it is expected to run."
11866
+ },
11867
+ {
11868
+ name: "trigger",
11869
+ type: "object",
11870
+ required: true,
11871
+ description: "What starts a run of this plan. Exactly one kind applies; the fields a kind needs are the ones it carries."
11872
+ },
11873
+ {
11874
+ name: "selector",
11875
+ type: "object",
11876
+ required: true,
11877
+ description: "Which cases a plan or run selects. Every member is optional and they combine as an intersection, so a selector with no member selects every case in the catalog."
11878
+ },
11879
+ {
11880
+ name: "environment",
11881
+ type: "string",
11882
+ required: false,
11883
+ description: "The environment this plan runs against; required by a merge or promotion gate, and refused with PLAN_GATE_ENVIRONMENT_MISMATCH when it disagrees with the gate."
11884
+ },
11885
+ {
11886
+ name: "gate",
11887
+ type: "string",
11888
+ enum: [
11889
+ "merge",
11890
+ "promotion",
11891
+ "observation",
11892
+ "none"
11893
+ ],
11894
+ required: true,
11895
+ description: "Whether this plan's result blocks a stage; a merge or promotion gate must name its environment."
11896
+ },
11897
+ {
11898
+ name: "repeat",
11899
+ type: "integer",
11900
+ required: false,
11901
+ description: "How many times each selected case runs in one run; omit for once. More than one is how a flake is told apart from a real failure."
11902
+ },
11903
+ {
11904
+ name: "timeoutMinutes",
11905
+ type: "integer",
11906
+ required: false,
11907
+ description: "How many minutes a run of this plan may take before it is timed out; omit for the service's default."
11908
+ }
11909
+ ]
11910
+ }
11911
+ },
11912
+ {
11913
+ resource: "devops.projects.testReports",
11914
+ method: "create",
11915
+ summary: "Upload an external test report",
11916
+ description: "Record the results of a run executed outside Praxis by uploading a CTRF or JUnit report. Nothing has to exist first: a first upload from CI creates the run it reports on (executor external) and catalogues the cases the report names, so there is no setup call before the first result. When the report already belongs to a run, pass ref and the upload joins it; the run's counts and verdict are recomputed from the report. Uploading the same reportId again is idempotent and counts once, so a retry after a timeout is safe — and a reported case is catalogued once, however many reports carry it. The report's bytes are kept as a file (the file field of the answer) rather than in the results database, so the original document stays retrievable.",
11917
+ http: "POST",
11918
+ path: "/devops/v1/projects/{project}/test-reports",
11919
+ streaming: "no",
11920
+ pagination: false,
11921
+ pathParams: [
11922
+ {
11923
+ name: "project",
11924
+ sdkName: "project",
11925
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11926
+ }
11927
+ ],
11928
+ query: [],
11929
+ body: {
11930
+ required: true,
11931
+ fields: [
11932
+ {
11933
+ name: "reportId",
11934
+ type: "string",
11935
+ required: true,
11936
+ description: "Your own identifier for this report. Uploading the same id again is idempotent and counts once, so a retry after a timeout is safe."
11937
+ },
11938
+ {
11939
+ name: "format",
11940
+ type: "string",
11941
+ enum: [
11942
+ "ctrf",
11943
+ "junit"
11944
+ ],
11945
+ required: true,
11946
+ description: "Which report format the document is in; it decides how the document is parsed."
11947
+ },
11948
+ {
11949
+ name: "ref",
11950
+ type: "object",
11951
+ required: true,
11952
+ description: "The exact revision a run tested. A commit is always named, because a run without one has nothing to report against."
11953
+ },
11954
+ {
11955
+ name: "report",
11956
+ type: "string",
11957
+ required: true,
11958
+ description: "The report document itself, as text — JSON for ctrf, XML for junit. Send the file's contents unchanged; a malformed document is refused with REPORT_INVALID and records nothing."
11959
+ }
11960
+ ]
11961
+ }
11962
+ },
11963
+ {
11964
+ resource: "devops.projects.testRuns",
11965
+ method: "list",
11966
+ summary: "List test runs",
11967
+ description: "List the project's runs newest first, with each run's state, result and counts. Use it to find the run id whose executions you want to read, or to see whether a commit's tests have finished. A run whose result is pending has not reached a verdict yet — read it again rather than treating it as passed. Filter by state or result to watch only the runs still in flight.",
11968
+ http: "GET",
11969
+ path: "/devops/v1/projects/{project}/test-runs",
11970
+ streaming: "no",
11971
+ pagination: false,
11972
+ pathParams: [
11973
+ {
11974
+ name: "project",
11975
+ sdkName: "project",
11976
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
11977
+ }
11978
+ ],
11979
+ query: [
11980
+ {
11981
+ name: "pageSize",
11982
+ type: "integer",
11983
+ required: false,
11984
+ description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
11985
+ },
11986
+ {
11987
+ name: "pageToken",
11988
+ type: "string",
11989
+ required: false,
11990
+ description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
11991
+ },
11992
+ {
11993
+ name: "filter",
11994
+ type: "string",
11995
+ required: false,
11996
+ description: "AIP-160 equality filter over one declared field, for example state=running or result=failed. An undeclared field is refused with INVALID_ARGUMENT; it is never ignored, so a mistyped filter cannot quietly return everything."
11997
+ },
11998
+ {
11999
+ name: "orderBy",
12000
+ type: "string",
12001
+ required: false,
12002
+ description: "Comma-separated fields to order by, each optionally suffixed with desc, for example createTime desc. Only the fields the resource declares are accepted; anything else is refused so an ordering typo cannot silently return a different order. Omitted uses the resource's own order."
12003
+ }
12004
+ ]
12005
+ },
12006
+ {
12007
+ resource: "devops.projects.testRuns",
12008
+ method: "create",
12009
+ summary: "Create a test run",
12010
+ description: "Start a run of the project's tests at one commit. Name a plan to use its selector, or pass a selector directly for this run alone; the ref says which commit to test and is required, because a run without a commit has nothing to report against. waitUntil decides how far the call waits before answering — queued, the default, returns as soon as the run exists; started waits until the run has begun, except for an external run, which is answered at once because it leaves queued only when your own CI uploads; finished waits for a verdict. The wait is bounded at about 25 seconds, and a wait that reaches that bound returns the run as it stands rather than failing — read state to see whether it finished. A retry of an earlier run is a new run: pass its commit and selector, and read the earlier run to compare.",
12011
+ http: "POST",
12012
+ path: "/devops/v1/projects/{project}/test-runs",
12013
+ streaming: "no",
12014
+ pagination: false,
12015
+ pathParams: [
12016
+ {
12017
+ name: "project",
12018
+ sdkName: "project",
12019
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
12020
+ }
12021
+ ],
12022
+ query: [],
12023
+ body: {
12024
+ required: true,
12025
+ fields: [
12026
+ {
12027
+ name: "ref",
12028
+ type: "object",
12029
+ required: true,
12030
+ description: "The exact revision a run tested. A commit is always named, because a run without one has nothing to report against."
12031
+ },
12032
+ {
12033
+ name: "plan",
12034
+ type: "string",
12035
+ required: false,
12036
+ description: "Plan whose selector this run uses; omit it when passing selector instead. Naming a plan records the run against that plan, which is what a gate reads."
12037
+ },
12038
+ {
12039
+ name: "selector",
12040
+ type: "object",
12041
+ required: false,
12042
+ description: "An ad-hoc selector for this run alone, used instead of a plan's; it is not saved as a plan, so a run you want to repeat should name a plan."
12043
+ },
12044
+ {
12045
+ name: "environment",
12046
+ type: "string",
12047
+ required: false,
12048
+ description: "Environment to run against; it decides whether production-only cases become selectable. Omit it for a run that needs no environment."
12049
+ },
12050
+ {
12051
+ name: "repeat",
12052
+ type: "integer",
12053
+ required: false,
12054
+ description: "How many times each selected case runs, which is how a flake is told apart from a real failure; omit for once."
12055
+ },
12056
+ {
12057
+ name: "waitUntil",
12058
+ type: "string",
12059
+ enum: [
12060
+ "queued",
12061
+ "started",
12062
+ "finished"
12063
+ ],
12064
+ required: false,
12065
+ description: "How far the call waits before answering, bounded at about 25 seconds; omit it for queued, which returns at once. The wait reads the run's own state, so a wait that reaches the bound returns the run as it stands instead of failing — check state before assuming the request was honoured."
12066
+ },
12067
+ {
12068
+ name: "executor",
12069
+ type: "string",
12070
+ enum: [
12071
+ "cloud",
12072
+ "external"
12073
+ ],
12074
+ required: false,
12075
+ description: "Who carries the run out. cloud, the default, runs the selected cases in Praxis at the commit; external creates a run that waits for your own CI to upload a report with test-reports."
12076
+ },
12077
+ {
12078
+ name: "requestId",
12079
+ type: "string",
12080
+ required: false,
12081
+ description: "A key you choose to make creating this run idempotent: repeating the call with the same requestId returns the run it created instead of starting another, so a retry after a timeout is safe."
12082
+ }
12083
+ ]
12084
+ }
12085
+ },
12086
+ {
12087
+ resource: "devops.projects.testSuites",
12088
+ method: "list",
12089
+ summary: "List test suites",
12090
+ description: "List the suites the project's newest catalog discovered — one suite per test file and framework pair, with its size, purposes and question count. Use it to find the suite id a case belongs to, or to see which files make up an area before selecting cases from them. Suites come from the catalog, so a file added in code appears only after its commit's catalog is published. Archived suites are returned too; they carry archived true and no case is ever silently dropped from the list.",
12091
+ http: "GET",
12092
+ path: "/devops/v1/projects/{project}/test-suites",
12093
+ streaming: "no",
12094
+ pagination: false,
12095
+ pathParams: [
12096
+ {
12097
+ name: "project",
12098
+ sdkName: "project",
12099
+ description: "Identifies the project whose data you are reading, from the project list or create answer."
12100
+ }
12101
+ ],
12102
+ query: [
12103
+ {
12104
+ name: "pageSize",
12105
+ type: "integer",
12106
+ required: false,
12107
+ description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
12108
+ },
12109
+ {
12110
+ name: "pageToken",
12111
+ type: "string",
12112
+ required: false,
12113
+ description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
12114
+ },
12115
+ {
12116
+ name: "orderBy",
12117
+ type: "string",
12118
+ required: false,
12119
+ description: "Comma-separated fields to order by, each optionally suffixed with desc, for example createTime desc. Only the fields the resource declares are accepted; anything else is refused so an ordering typo cannot silently return a different order. Omitted uses the resource's own order."
12120
+ }
12121
+ ]
12122
+ },
12123
+ {
12124
+ resource: "devops.testCases",
12125
+ method: "retrieve",
12126
+ summary: "Retrieve a test case",
12127
+ description: "Read one case in full — its steps, tags, declared owners, current state with the policy and ticket behind it, and its rolling 7 or 30 day statistics. Use it before quarantining or fixing a case, to see what the state already is and why. A case that was renamed is reachable by both its current fingerprint id and the ids listed in aliases.",
12128
+ http: "GET",
12129
+ path: "/devops/v1/test-cases/{id}",
12130
+ streaming: "no",
12131
+ pagination: false,
12132
+ pathParams: [
12133
+ {
12134
+ name: "id",
12135
+ sdkName: "id",
12136
+ description: "The case identifier returned by a case list, or an older id listed in that case's aliases."
12137
+ }
12138
+ ],
12139
+ query: []
12140
+ },
12141
+ {
12142
+ resource: "devops.testPlans",
12143
+ method: "delete",
12144
+ summary: "Delete a test plan",
12145
+ description: "Delete a plan so it schedules nothing further. The plan stops firing immediately; runs it already produced keep their own record and are not deleted with it. To stop a plan temporarily and keep it for later, pause it instead — deleting cannot be undone and the plan's key becomes free for another plan to take.",
12146
+ http: "DELETE",
12147
+ path: "/devops/v1/test-plans/{id}",
12148
+ streaming: "no",
12149
+ pagination: false,
12150
+ pathParams: [
12151
+ {
12152
+ name: "id",
12153
+ sdkName: "id",
12154
+ description: "The plan identifier returned by a plan list or create answer."
12155
+ }
12156
+ ],
12157
+ query: []
12158
+ },
12159
+ {
12160
+ resource: "devops.testPlans",
12161
+ method: "retrieve",
12162
+ summary: "Retrieve a test plan",
12163
+ description: "Read one plan by the id a plan list returned, to see its selector, gate, repeat count, timeout and pause state before updating or deleting it. A paused plan carries the reason, the actor and the time it resumes, so a pause you did not set is explained here rather than guessed at.",
12164
+ http: "GET",
12165
+ path: "/devops/v1/test-plans/{id}",
12166
+ streaming: "no",
12167
+ pagination: false,
12168
+ pathParams: [
12169
+ {
12170
+ name: "id",
12171
+ sdkName: "id",
12172
+ description: "The plan identifier returned by a plan list or create answer."
12173
+ }
12174
+ ],
12175
+ query: []
12176
+ },
12177
+ {
12178
+ resource: "devops.testPlans",
12179
+ method: "update",
12180
+ summary: "Update a test plan",
12181
+ description: "Change a plan's title, trigger, selector, gate, repeat count, timeout or enabled flag. Only the fields present in the body are changed, so a body naming one field leaves the rest exactly as they were. Changing a selector does not create a version — the plan is not a published artefact, and runs already started keep the selection they were created with. Read the plan first to know what you are leaving unchanged.",
12182
+ http: "PATCH",
12183
+ path: "/devops/v1/test-plans/{id}",
12184
+ streaming: "no",
12185
+ pagination: false,
12186
+ pathParams: [
12187
+ {
12188
+ name: "id",
12189
+ sdkName: "id",
12190
+ description: "The plan identifier returned by a plan list or create answer."
12191
+ }
12192
+ ],
12193
+ query: [],
12194
+ body: {
12195
+ required: true,
12196
+ fields: [
12197
+ {
12198
+ name: "plan",
12199
+ type: "object",
12200
+ required: true,
12201
+ description: "The fields to change. Anything absent keeps its current value, so read the plan first if you need to know what you are leaving alone."
12202
+ },
12203
+ {
12204
+ name: "updateMask",
12205
+ type: "string",
12206
+ required: false,
12207
+ description: "Comma-separated names of the plan fields this patch intends to change, for example title,enabled. Omit it to apply every field present in plan; naming fields makes the intent explicit and keeps a concurrent edit from being overwritten by accident."
12208
+ }
12209
+ ]
12210
+ }
12211
+ },
12212
+ {
12213
+ resource: "devops.testPlans",
12214
+ method: "pause",
12215
+ summary: "Pause a test plan",
12216
+ description: "Stop a plan from starting new runs while keeping it and its history. A reason is required and is recorded on the plan, so the next reader learns why it stopped. Give until to resume automatically at a time; omit it to stay paused until someone resumes it. Runs already in flight are not cancelled — cancel those individually.",
12217
+ http: "POST",
12218
+ path: "/devops/v1/test-plans/{id}:pause",
12219
+ streaming: "no",
12220
+ pagination: false,
12221
+ pathParams: [
12222
+ {
12223
+ name: "id",
12224
+ sdkName: "id",
12225
+ description: "The plan identifier returned by a plan list or create answer."
12226
+ }
12227
+ ],
12228
+ query: [],
12229
+ body: {
12230
+ required: true,
12231
+ fields: [
12232
+ {
12233
+ name: "reason",
12234
+ type: "string",
12235
+ required: true,
12236
+ description: "Why the plan is being paused; it is stored on the plan and read by whoever finds it stopped."
12237
+ },
12238
+ {
12239
+ name: "until",
12240
+ type: "string",
12241
+ required: false,
12242
+ description: "RFC 3339 UTC time the plan resumes by itself; omit it to stay paused until someone resumes it."
12243
+ }
12244
+ ]
12245
+ }
12246
+ },
12247
+ {
12248
+ resource: "devops.testPlans",
12249
+ method: "resume",
12250
+ summary: "Resume a test plan",
12251
+ description: "Clear a plan's pause so it schedules runs again. Resuming an active plan changes nothing and is safe to repeat. The plan keeps its selector, gate and key; only the pause is removed.",
12252
+ http: "POST",
12253
+ path: "/devops/v1/test-plans/{id}:resume",
12254
+ streaming: "no",
12255
+ pagination: false,
12256
+ pathParams: [
12257
+ {
12258
+ name: "id",
12259
+ sdkName: "id",
12260
+ description: "The plan identifier returned by a plan list or create answer."
12261
+ }
12262
+ ],
12263
+ query: []
12264
+ },
12265
+ {
12266
+ resource: "devops.testRuns",
12267
+ method: "retrieve",
12268
+ summary: "Retrieve a test run",
12269
+ description: "Read one run's current state, result and counts, and ask for its failed executions inline with expand. Poll this after creating a run whose result was pending. A result is monotonic once it reaches a verdict — a failed run never becomes passed by a later report, so read the run rather than the last report to know where it ended.",
12270
+ http: "GET",
12271
+ path: "/devops/v1/test-runs/{id}",
12272
+ streaming: "no",
12273
+ pagination: false,
12274
+ pathParams: [
12275
+ {
12276
+ name: "id",
12277
+ sdkName: "id",
12278
+ description: "The run identifier returned by a run list or create answer."
12279
+ }
12280
+ ],
12281
+ query: [
12282
+ {
12283
+ name: "expand",
12284
+ type: "array",
12285
+ itemType: "string",
12286
+ enum: [
12287
+ "failedExecutions"
12288
+ ],
12289
+ required: false,
12290
+ description: "Repeatable field to expand inline. failedExecutions returns the non-passed executions with the run, which saves a second call when you only need to see what broke; omit it for the bare run."
12291
+ }
12292
+ ]
12293
+ },
12294
+ {
12295
+ resource: "devops.testRuns",
12296
+ method: "cancel",
12297
+ summary: "Cancel a test run",
12298
+ description: "Stop a run that is still going. A reason is required and is recorded on the run, because a cancelled run is read later as evidence about why a commit was not verified. Cancelling a run that already reached a verdict is refused with RUN_ALREADY_FINISHED: its result is final and cancelling it would erase the verdict. Executions already recorded stay readable.",
12299
+ http: "POST",
12300
+ path: "/devops/v1/test-runs/{id}:cancel",
12301
+ streaming: "no",
12302
+ pagination: false,
12303
+ pathParams: [
12304
+ {
12305
+ name: "id",
12306
+ sdkName: "id",
12307
+ description: "The run identifier returned by a run list or create answer."
12308
+ }
12309
+ ],
12310
+ query: [],
12311
+ body: {
12312
+ required: true,
12313
+ fields: [
12314
+ {
12315
+ name: "reason",
12316
+ type: "string",
12317
+ required: true,
12318
+ description: "Why the run is being cancelled; it is stored on the run and is what a later reader finds instead of a result."
12319
+ }
12320
+ ]
12321
+ }
12322
+ },
12323
+ {
12324
+ resource: "devops.testRuns.executions",
12325
+ method: "list",
12326
+ summary: "List a run's executions",
12327
+ description: "List the executions recorded against one run — one entry per case the run selected, with its status, duration, attempts and evidence. Use it to find the case that failed, or to compare a repeat run against the previous one case by case. Reads happen while the run is still going, so a case may still be pending; filter by status to watch only the failures.",
12328
+ http: "GET",
12329
+ path: "/devops/v1/test-runs/{run}/executions",
12330
+ streaming: "no",
12331
+ pagination: false,
12332
+ pathParams: [
12333
+ {
12334
+ name: "run",
12335
+ sdkName: "run",
12336
+ description: "The run whose executions you are reading, from a run list or create answer."
12337
+ }
12338
+ ],
12339
+ query: [
12340
+ {
12341
+ name: "pageSize",
12342
+ type: "integer",
12343
+ required: false,
12344
+ description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
12345
+ },
12346
+ {
12347
+ name: "pageToken",
12348
+ type: "string",
12349
+ required: false,
12350
+ description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
12351
+ },
12352
+ {
12353
+ name: "filter",
12354
+ type: "string",
12355
+ required: false,
12356
+ description: "AIP-160 equality filter over one declared field, for example result=failed to read only a run's failures. Fields an execution list does not declare are refused with INVALID_ARGUMENT rather than ignored."
12357
+ },
12358
+ {
12359
+ name: "orderBy",
12360
+ type: "string",
12361
+ required: false,
12362
+ description: "Comma-separated fields to order by, each optionally suffixed with desc, for example createTime desc. Only the fields the resource declares are accepted; anything else is refused so an ordering typo cannot silently return a different order. Omitted uses the resource's own order."
12363
+ }
12364
+ ]
12365
+ },
12366
+ {
12367
+ resource: "devops.testRuns.executions",
12368
+ method: "retrieve",
12369
+ summary: "Retrieve one case's execution in a run",
12370
+ description: "Read one case's execution inside one run, including every attempt with its own duration and message. Use it after a run reports a failure to see whether the case failed once and passed on retry — that is what flaky true means — and to reach the evidence files a triage needs. Both ids come from the run and case reads; an execution that does not exist for that pair is NOT_FOUND rather than an empty answer.",
12371
+ http: "GET",
12372
+ path: "/devops/v1/test-runs/{run}/executions/{case}",
12373
+ streaming: "no",
12374
+ pagination: false,
12375
+ pathParams: [
12376
+ {
12377
+ name: "run",
12378
+ sdkName: "run",
12379
+ description: "The run whose executions you are reading, from a run list or create answer."
12380
+ },
12381
+ {
12382
+ name: "case",
12383
+ sdkName: "case",
12384
+ description: "The case to read inside that run, from the run's execution list or the project's case list."
12385
+ }
12386
+ ],
12387
+ query: []
12388
+ },
12389
+ {
12390
+ resource: "devops.testSuites",
12391
+ method: "retrieve",
12392
+ summary: "Retrieve a test suite",
12393
+ description: "Read one suite by the id a suite list returned, to learn its file, framework, size, purposes and how many cases it holds. Use it when a case's suite id needs a name for display, or to confirm which commit's catalog a suite came from. The id is opaque; it comes from the list, never from the file path.",
12394
+ http: "GET",
12395
+ path: "/devops/v1/test-suites/{id}",
12396
+ streaming: "no",
12397
+ pagination: false,
12398
+ pathParams: [
12399
+ {
12400
+ name: "id",
12401
+ sdkName: "id",
12402
+ description: "The suite identifier returned by a suite list, not the file path it was discovered from."
12403
+ }
12404
+ ],
12405
+ query: []
12406
+ },
11428
12407
  {
11429
12408
  resource: "file.files",
11430
12409
  method: "list",
@@ -11636,7 +12615,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11636
12615
  resource: "file.uploads",
11637
12616
  method: "create",
11638
12617
  summary: "Create an upload",
11639
- description: "Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data, assistants and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.",
12618
+ description: "Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 20 GiB (21474836480 bytes) and only user_data, assistants and vision purposes. Send parts of at most 64000000 bytes; an unfinished upload waits for them for 7 days, so a client can create → send parts → query GET /file/v1/uploads/{upload_id} → resend only the missing parts → complete. Optional part_size fixes every part length and makes each numbered part retryable with identical bytes. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.",
11640
12619
  http: "POST",
11641
12620
  path: "/file/v1/uploads",
11642
12621
  streaming: "no",
@@ -11650,7 +12629,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11650
12629
  name: "bytes",
11651
12630
  type: "integer",
11652
12631
  required: true,
11653
- description: "Exact complete file length in bytes, from 1 through 2147483648 (2 GiB); the sum of completed parts must match."
12632
+ description: "Exact complete file length in bytes, from 1 through 21474836480 (20 GiB); the sum of completed parts must match."
11654
12633
  },
11655
12634
  {
11656
12635
  name: "filename",
@@ -11694,7 +12673,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11694
12673
  resource: "file.uploads",
11695
12674
  method: "createSigned",
11696
12675
  summary: "Create a one-time upload URL",
11697
- description: "Upload a local file of up to 2 GiB from a coding agent without sending bytes through the model. Provide basename, exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes), PUT each chunk to its numbered parts[].url in any order, then POST complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 3600 for multipart, at most 604800; all multipart URLs share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {\"filename\":\"photo.png\",\"bytes\":2048,\"content_type\":\"image/png\"}.",
12676
+ description: "Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide basename, exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid, wrong-action or cross-organization URLs return 404. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {\"filename\":\"photo.png\",\"bytes\":2048,\"content_type\":\"image/png\"}.",
11698
12677
  http: "POST",
11699
12678
  path: "/file/v1/uploads/signed",
11700
12679
  streaming: "no",
@@ -11714,7 +12693,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11714
12693
  name: "bytes",
11715
12694
  type: "integer",
11716
12695
  required: true,
11717
- description: "Exact local file size in bytes, from 1 through 2147483648 (2 GiB). Up to 104857600 bytes returns one PUT URL; larger files return numbered part URLs and a completion URL. Every PUT requires its exact signed Content-Length."
12696
+ description: "Exact local file size in bytes, from 1 through 21474836480 (20 GiB). Up to 104857600 bytes returns one PUT URL; larger files return numbered part URLs, a completion URL and a status URL. Every PUT requires its exact signed Content-Length."
11718
12697
  },
11719
12698
  {
11720
12699
  name: "content_type",
@@ -11737,7 +12716,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11737
12716
  name: "expires_in",
11738
12717
  type: "integer",
11739
12718
  required: false,
11740
- description: "Lifetime in seconds, from 1 through 604800: defaults to 900 for single PUT or 3600 for multipart. All part URLs and the completion URL share one expiry. This does not set the resulting file's lifetime."
12719
+ description: "Lifetime in seconds, from 1 through 604800: defaults to 900 for single PUT or 604800 (7 days) for multipart. All part URLs, the status URL and the completion URL share one expiry. This does not set the resulting file's lifetime."
11741
12720
  },
11742
12721
  {
11743
12722
  name: "part_size",
@@ -11748,6 +12727,24 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11748
12727
  ]
11749
12728
  }
11750
12729
  },
12730
+ {
12731
+ resource: "file.uploads",
12732
+ method: "retrieve",
12733
+ summary: "Retrieve an upload",
12734
+ description: "Read the state of an unfinished upload — its status, declared bytes, fixed part_size and the parts it already holds (received_parts, each with part_number, bytes and sha256). After a break or a failed part, call it to resend only the missing numbers, then complete. A cancelled or expired upload is refused; a completed one returns its file. A missing or other-organization upload returns 404.",
12735
+ http: "GET",
12736
+ path: "/file/v1/uploads/{upload_id}",
12737
+ streaming: "no",
12738
+ pagination: false,
12739
+ pathParams: [
12740
+ {
12741
+ name: "upload_id",
12742
+ sdkName: "upload_id",
12743
+ description: "Upload identifier returned by create; the upload must belong to your organization."
12744
+ }
12745
+ ],
12746
+ query: []
12747
+ },
11751
12748
  {
11752
12749
  resource: "file.uploads",
11753
12750
  method: "cancel",
@@ -11770,7 +12767,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11770
12767
  resource: "file.uploads",
11771
12768
  method: "complete",
11772
12769
  summary: "Complete an upload",
11773
- description: "Assemble the uploaded parts into a file. Supply upload_id from create and part_ids from addPart in file byte order; their sizes must total the declared bytes. Optional md5 verifies the assembled content. Retrying identical part_ids and normalized md5 returns the same result; different inputs return 409. Unlike OpenAI, completed can contain a file still processing (status uploaded). Poll files.retrieve using file.id until status processed (own face state active); error, expiry or 404 means processing failed and the file cannot be used.",
12770
+ description: "Assemble the uploaded parts into a file. Supply upload_id from create and part_ids from addPart in file byte order; their sizes must total the declared bytes. When parts were lost, query GET /file/v1/uploads/{upload_id} and resend them before completing. Optional md5 verifies the assembled content. Retrying identical part_ids and normalized md5 returns the same result; different inputs return 409. Unlike OpenAI, completed can contain a file still processing (status uploaded). Poll files.retrieve using file.id until status processed (own face state active); error, expiry or 404 means processing failed and the file cannot be used.",
11774
12771
  http: "POST",
11775
12772
  path: "/file/v1/uploads/{upload_id}/complete",
11776
12773
  streaming: "no",
@@ -11806,7 +12803,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
11806
12803
  resource: "file.uploads.parts",
11807
12804
  method: "create",
11808
12805
  summary: "Add an upload part",
11809
- description: "Send one nonempty part as the multipart data field, at most 64000000 bytes. Parts may arrive concurrently in any order. Use upload_id from create. For a fixed-size upload, supply part_number starting at 1 and exactly part_size bytes except for the final remainder; retry the same number with identical bytes to recover its part ID. Without part_size, each request creates a new part and part_number is ignored. Save the returned part IDs for complete.",
12806
+ description: "Send one nonempty part as the multipart data field, at most 64000000 bytes. Parts may arrive concurrently in any order. Use upload_id from create. For a fixed-size upload, supply part_number starting at 1 and exactly part_size bytes except for the final remainder; retry the same number with identical bytes to recover its part ID, and query GET /file/v1/uploads/{upload_id} to see which numbers already arrived. Without part_size, each request creates a new part and part_number is ignored. Save the returned part IDs for complete.",
11810
12807
  http: "POST",
11811
12808
  path: "/file/v1/uploads/{upload_id}/parts",
11812
12809
  streaming: "no",
@@ -12855,7 +13852,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
12855
13852
  resource: "media.libraries.assets",
12856
13853
  method: "create",
12857
13854
  summary: "Upload asset",
12858
- description: " For understanding, Media generates proxies for video sources of 25 MB or more and audio-only sources of 100 MB or more; originals remain available unchanged. The duration limit is 10 minutes. A video proxy still above 95 MB after recompression, or a source exceeding the duration limit, is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
13855
+ description: " For understanding, Media generates proxies for video sources of 25 MB or more or longer than 10 minutes, and for audio-only sources of 100 MB or more; originals remain available unchanged. Long videos are supported. When a video proxy is needed and is still above 95 MB after recompression, the source is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
12859
13856
  http: "POST",
12860
13857
  path: "/media/v1/libraries/{library_id}/assets",
12861
13858
  streaming: "no",
@@ -12979,7 +13976,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
12979
13976
  resource: "media.libraries.assets.import",
12980
13977
  method: "create",
12981
13978
  summary: "Import file",
12982
- description: "Copy a File into an independent Media asset. New assets default to organization-private delivery (type=authenticated); explicitly set type=upload for public originals and derivatives. Omitting type on overwrite preserves the current type. Deleting the source File does not delete this copy. For understanding, Media generates proxies for video sources of 25 MB or more and audio-only sources of 100 MB or more; originals remain available unchanged. The duration limit is 10 minutes. A video proxy still above 95 MB after recompression, or a source exceeding the duration limit, is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
13979
+ description: "Copy a File into an independent Media asset. New assets default to organization-private delivery (type=authenticated); explicitly set type=upload for public originals and derivatives. Omitting type on overwrite preserves the current type. Deleting the source File does not delete this copy. For understanding, Media generates proxies for video sources of 25 MB or more or longer than 10 minutes, and for audio-only sources of 100 MB or more; originals remain available unchanged. Long videos are supported. When a video proxy is needed and is still above 95 MB after recompression, the source is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
12983
13980
  http: "POST",
12984
13981
  path: "/media/v1/libraries/{library_id}/assets/import",
12985
13982
  streaming: "no",
@@ -13247,7 +14244,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
13247
14244
  resource: "media.libraries.assets.reprocess",
13248
14245
  method: "create",
13249
14246
  summary: "Reprocess asset",
13250
- description: " For understanding, Media generates proxies for video sources of 25 MB or more and audio-only sources of 100 MB or more; originals remain available unchanged. The duration limit is 10 minutes. A video proxy still above 95 MB after recompression, or a source exceeding the duration limit, is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
14247
+ description: " For understanding, Media generates proxies for video sources of 25 MB or more or longer than 10 minutes, and for audio-only sources of 100 MB or more; originals remain available unchanged. Long videos are supported. When a video proxy is needed and is still above 95 MB after recompression, the source is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.",
13251
14248
  http: "POST",
13252
14249
  path: "/media/v1/libraries/{library_id}/assets/{asset_id}/reprocess",
13253
14250
  streaming: "no",
@@ -13323,10 +14320,13 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
13323
14320
  "frame",
13324
14321
  "overview",
13325
14322
  "audio",
14323
+ "loudness",
14324
+ "beats",
14325
+ "content",
13326
14326
  "embedding"
13327
14327
  ],
13328
14328
  required: false,
13329
- description: "Return one output kind: caption is a visual description, tags are generated labels, ocr is visible text, transcript is speech, frame is a video shot, overview is a video summary, audio is sampled audio understanding, and embedding reports a failed embedding step."
14329
+ description: "Return one output kind: caption is a visual description, tags are generated labels, ocr is visible text, transcript is speech, frame is a video shot, overview is a video summary, audio is sampled audio understanding, loudness is measured loudness, beats is the measured tempo and beat grid, content is the derived speech, music and silence split, and embedding reports a failed embedding step."
13330
14330
  },
13331
14331
  {
13332
14332
  name: "cursor",
@@ -13346,7 +14346,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
13346
14346
  resource: "media.libraries.assets",
13347
14347
  method: "batch",
13348
14348
  summary: "Batch assets alias",
13349
- description: 'Queue a frozen selection for tagging, untagging, context replacement, moving, deleting or reprocessing. IDs are limited to 1000; use an expression for larger selections, subject to the search scan budget. reprocess starts at most 30 assets per rolling minute per library. Only retryable failed steps and legacy source-size unsupported steps rerun. Omit kinds to inspect all recoverable steps, or supply kinds to narrow them. Other unsupported, permanent and completed steps remain unchanged; a permanent output blocks only its own step. Assets without any selected recoverable step count as failed items without starting understanding. Poll the returned job id; done counts accepted launches, not successful model inference. Staff Admin only permits reprocess and requires a nonblank reason. Example: {"action":"reprocess","selector":{"expression":"processing_state=failed AND failure_code=UPSTREAM_FAILED"}}. For understanding, Media generates proxies for video sources of 25 MB or more and audio-only sources of 100 MB or more; originals remain available unchanged. The duration limit is 10 minutes. A video proxy still above 95 MB after recompression, or a source exceeding the duration limit, is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.',
14349
+ description: 'Queue a frozen selection for tagging, untagging, context replacement, moving, deleting or reprocessing. IDs are limited to 1000; use an expression for larger selections, subject to the search scan budget. reprocess starts at most 30 assets per rolling minute per library. Only retryable failed steps and legacy source-size unsupported steps rerun. Omit kinds to inspect all recoverable steps, or supply kinds to narrow them. Other unsupported, permanent and completed steps remain unchanged; a permanent output blocks only its own step. Assets without any selected recoverable step count as failed items without starting understanding. Poll the returned job id; done counts accepted launches, not successful model inference. Staff Admin only permits reprocess and requires a nonblank reason. Example: {"action":"reprocess","selector":{"expression":"processing_state=failed AND failure_code=UPSTREAM_FAILED"}}. For understanding, Media generates proxies for video sources of 25 MB or more or longer than 10 minutes, and for audio-only sources of 100 MB or more; originals remain available unchanged. Long videos are supported. When a video proxy is needed and is still above 95 MB after recompression, the source is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.',
13350
14350
  http: "POST",
13351
14351
  path: "/media/v1/libraries/{library_id}/assets:batch",
13352
14352
  streaming: "no",
@@ -13381,7 +14381,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
13381
14381
  resource: "media.libraries.batches",
13382
14382
  method: "create",
13383
14383
  summary: "Create batch",
13384
- description: 'Queue a frozen selection for tagging, untagging, context replacement, moving, deleting or reprocessing. IDs are limited to 1000; use an expression for larger selections, subject to the search scan budget. reprocess starts at most 30 assets per rolling minute per library. Only retryable failed steps and legacy source-size unsupported steps rerun. Omit kinds to inspect all recoverable steps, or supply kinds to narrow them. Other unsupported, permanent and completed steps remain unchanged; a permanent output blocks only its own step. Assets without any selected recoverable step count as failed items without starting understanding. Poll the returned job id; done counts accepted launches, not successful model inference. Staff Admin only permits reprocess and requires a nonblank reason. Example: {"action":"reprocess","selector":{"expression":"processing_state=failed AND failure_code=UPSTREAM_FAILED"}}. For understanding, Media generates proxies for video sources of 25 MB or more and audio-only sources of 100 MB or more; originals remain available unchanged. The duration limit is 10 minutes. A video proxy still above 95 MB after recompression, or a source exceeding the duration limit, is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.',
14384
+ description: 'Queue a frozen selection for tagging, untagging, context replacement, moving, deleting or reprocessing. IDs are limited to 1000; use an expression for larger selections, subject to the search scan budget. reprocess starts at most 30 assets per rolling minute per library. Only retryable failed steps and legacy source-size unsupported steps rerun. Omit kinds to inspect all recoverable steps, or supply kinds to narrow them. Other unsupported, permanent and completed steps remain unchanged; a permanent output blocks only its own step. Assets without any selected recoverable step count as failed items without starting understanding. Poll the returned job id; done counts accepted launches, not successful model inference. Staff Admin only permits reprocess and requires a nonblank reason. Example: {"action":"reprocess","selector":{"expression":"processing_state=failed AND failure_code=UPSTREAM_FAILED"}}. For understanding, Media generates proxies for video sources of 25 MB or more or longer than 10 minutes, and for audio-only sources of 100 MB or more; originals remain available unchanged. Long videos are supported. When a video proxy is needed and is still above 95 MB after recompression, the source is reported as UNSUPPORTED with the limit in the failure message. Proxy preparation uses the organization’s metered sandbox resources.',
13385
14385
  http: "POST",
13386
14386
  path: "/media/v1/libraries/{library_id}/batches",
13387
14387
  streaming: "no",
@@ -14078,7 +15078,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
14078
15078
  name: "kinds",
14079
15079
  type: "string",
14080
15080
  required: false,
14081
- description: "Comma-separated output kinds: caption, tags, ocr, frame, transcript, overview, audio, embedding. Omit or empty to include every kind."
15081
+ description: "Comma-separated output kinds: caption, tags, ocr, frame, transcript, overview, audio, loudness, beats, content, embedding. Omit or empty to include every kind."
14082
15082
  },
14083
15083
  {
14084
15084
  name: "cursor",
@@ -16303,293 +17303,826 @@ for more details.`
16303
17303
  sdkName: "response_id",
16304
17304
  description: "Id of the stored response, the `id` returned by createResponse (it looks like resp_...). An unknown id, a response created with store false, an expired response and another tenant's response all answer 404."
16305
17305
  }
16306
- ],
16307
- query: []
17306
+ ],
17307
+ query: []
17308
+ },
17309
+ {
17310
+ resource: "model.responses.inputItems",
17311
+ method: "list",
17312
+ summary: "List Response Input Items",
17313
+ description: "Read the input items of a stored response using its id from creation. Use the returned items to inspect the input that produced that response.",
17314
+ http: "GET",
17315
+ path: "/model/v1/responses/{response_id}/input_items",
17316
+ streaming: "no",
17317
+ pagination: false,
17318
+ pathParams: [
17319
+ {
17320
+ name: "response_id",
17321
+ sdkName: "response_id",
17322
+ description: "Id of the stored response, the `id` returned by createResponse (it looks like resp_...). An unknown id, a response created with store false, an expired response and another tenant's response all answer 404."
17323
+ }
17324
+ ],
17325
+ query: []
17326
+ },
17327
+ {
17328
+ resource: "model.systemone",
17329
+ method: "create",
17330
+ summary: "Ask structured decision questions",
17331
+ description: "Ask typed questions about a state and get calibrated probabilities instead of generated text. Same request and response as TypeSafe System One. Use model ids from model.models.list declaring typesafe.systemone. Send one or more noul, choice or score questions; answers use the same question ids. Input tokens are charged at the catalog input price; output tokens are free. usage.cost and X-Praxis-Cost-Usd expose the same customer charge in USD. box questions and assets are unsupported and return 400: images are not supported. Unknown top-level fields pass unchanged to the native upstream.",
17332
+ http: "POST",
17333
+ path: "/model/v1/systemone",
17334
+ streaming: "no",
17335
+ pagination: false,
17336
+ pathParams: [],
17337
+ query: [],
17338
+ body: {
17339
+ required: true,
17340
+ fields: [
17341
+ {
17342
+ name: "model",
17343
+ type: "string",
17344
+ required: true,
17345
+ description: "Published model id from model.models.list with supported_apis containing typesafe.systemone; returned unchanged in the response."
17346
+ },
17347
+ {
17348
+ name: "state",
17349
+ type: "object",
17350
+ required: true,
17351
+ description: "Shared content evaluated by every question, supplied as text, a JSON object or an array."
17352
+ },
17353
+ {
17354
+ name: "questions",
17355
+ type: "object",
17356
+ required: true,
17357
+ description: "Non-empty map of caller-chosen question ids to typed questions; answers preserve these ids. noul evaluates yes/no, choice selects a named option, score rates ordered levels. box is unsupported."
17358
+ },
17359
+ {
17360
+ name: "assets",
17361
+ type: "object",
17362
+ required: false,
17363
+ description: "Unsupported image assets. Supplying this field, including null or an empty collection, returns 400: images are not supported."
17364
+ }
17365
+ ]
17366
+ }
17367
+ },
17368
+ {
17369
+ resource: "model.videos",
17370
+ method: "list",
17371
+ summary: "List videos",
17372
+ description: "OpenAI video API with OpenRouter request and response extensions.",
17373
+ http: "GET",
17374
+ path: "/model/v1/videos",
17375
+ streaming: "no",
17376
+ pagination: false,
17377
+ pathParams: [],
17378
+ query: [
17379
+ {
17380
+ name: "after",
17381
+ type: "string",
17382
+ required: false,
17383
+ description: "Cursor: the id of the video job after which the page starts, normally the `last_id` of the previous page. It must refer to an existing job of yours, otherwise the call fails."
17384
+ },
17385
+ {
17386
+ name: "limit",
17387
+ type: "integer",
17388
+ required: false,
17389
+ description: "Maximum number of jobs per page, from 1 to 100; defaults to 20."
17390
+ },
17391
+ {
17392
+ name: "order",
17393
+ type: "string",
17394
+ enum: [
17395
+ "asc",
17396
+ "desc"
17397
+ ],
17398
+ required: false,
17399
+ description: "Sort order by creation time: desc (default) lists the newest job first, asc the oldest first."
17400
+ }
17401
+ ]
17402
+ },
17403
+ {
17404
+ resource: "model.videos",
17405
+ method: "create",
17406
+ summary: "Create video",
17407
+ description: "OpenAI video API with OpenRouter request and response extensions.",
17408
+ http: "POST",
17409
+ path: "/model/v1/videos",
17410
+ streaming: "no",
17411
+ pagination: false,
17412
+ multipart: true,
17413
+ pathParams: [],
17414
+ query: [],
17415
+ body: {
17416
+ required: true,
17417
+ fields: [
17418
+ {
17419
+ name: "model",
17420
+ type: "string",
17421
+ required: false,
17422
+ description: "Video model id, for example `wan2.7-t2v`; list candidates with listModels?type=video. Router support (partial): Select a registered video model explicitly, for example wan2.7-t2v (size=1280x720, seconds=4). Capability preflight errors are reported before creation."
17423
+ },
17424
+ {
17425
+ name: "prompt",
17426
+ type: "string",
17427
+ required: true,
17428
+ description: "Text description of the video, at least 1 character. Router support (supported): Controls video content; missing or empty values return 400."
17429
+ },
17430
+ {
17431
+ name: "seconds",
17432
+ type: "object",
17433
+ required: false,
17434
+ description: "Takes precedence over duration."
17435
+ },
17436
+ {
17437
+ name: "duration",
17438
+ type: "integer",
17439
+ required: false,
17440
+ description: "Length of the video in whole seconds. `seconds` takes precedence when both are given."
17441
+ },
17442
+ {
17443
+ name: "size",
17444
+ type: "string",
17445
+ required: false,
17446
+ description: "Output resolution as `WIDTHxHEIGHT`, for example `1280x720`. Router support (partial): Subject to model capability preflight. Earlier wan2.7-t2v samples always produced 1280x720; accepted sizes are not guaranteed pixel-for-pixel."
17447
+ },
17448
+ {
17449
+ name: "input_reference",
17450
+ type: "object",
17451
+ required: false,
17452
+ description: "Reference image for image-to-video: a URL or base64 data URL, an object with `image_url`, or an uploaded image file (multipart, at most 20 MiB)."
17453
+ },
17454
+ {
17455
+ name: "input_references",
17456
+ type: "array",
17457
+ itemType: "object",
17458
+ required: false,
17459
+ description: "Several reference images; each entry is a URL or base64 data URL, or an object with `image_url`."
17460
+ },
17461
+ {
17462
+ name: "frame_images",
17463
+ type: "array",
17464
+ itemType: "object",
17465
+ required: false,
17466
+ description: "Images that pin the first and last frame; at most 2 entries."
17467
+ },
17468
+ {
17469
+ name: "resolution",
17470
+ type: "string",
17471
+ required: false,
17472
+ description: "Output resolution label such as `720p`, for models that take a label instead of `size`."
17473
+ },
17474
+ {
17475
+ name: "aspect_ratio",
17476
+ type: "string",
17477
+ required: false,
17478
+ description: "Aspect ratio of the video such as `16:9`."
17479
+ },
17480
+ {
17481
+ name: "generate_audio",
17482
+ type: "boolean",
17483
+ required: false,
17484
+ description: "Whether the video carries a generated audio track. Router support (supported): false produces no audio track on wan2.7-t2v; the default output includes audio."
17485
+ },
17486
+ {
17487
+ name: "seed",
17488
+ type: "integer",
17489
+ required: false,
17490
+ description: "Seed for reproducible generation, on models that support it."
17491
+ },
17492
+ {
17493
+ name: "callback_url",
17494
+ type: "string",
17495
+ required: false,
17496
+ description: "HTTP or HTTPS callback URL, forwarded to models that support completion callbacks."
17497
+ },
17498
+ {
17499
+ name: "quality",
17500
+ type: "string",
17501
+ required: false,
17502
+ description: "Provider-specific quality setting."
17503
+ }
17504
+ ]
17505
+ }
17506
+ },
17507
+ {
17508
+ resource: "model.videos",
17509
+ method: "delete",
17510
+ summary: "Delete video",
17511
+ description: "OpenAI video API with OpenRouter request and response extensions.",
17512
+ http: "DELETE",
17513
+ path: "/model/v1/videos/{video_id}",
17514
+ streaming: "no",
17515
+ pagination: false,
17516
+ pathParams: [
17517
+ {
17518
+ name: "video_id",
17519
+ sdkName: "video_id",
17520
+ description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
17521
+ }
17522
+ ],
17523
+ query: []
17524
+ },
17525
+ {
17526
+ resource: "model.videos",
17527
+ method: "retrieve",
17528
+ summary: "Retrieve video",
17529
+ description: "OpenAI video API with OpenRouter request and response extensions.",
17530
+ http: "GET",
17531
+ path: "/model/v1/videos/{video_id}",
17532
+ streaming: "no",
17533
+ pagination: false,
17534
+ pathParams: [
17535
+ {
17536
+ name: "video_id",
17537
+ sdkName: "video_id",
17538
+ description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
17539
+ }
17540
+ ],
17541
+ query: []
17542
+ },
17543
+ {
17544
+ resource: "model.videos",
17545
+ method: "retrieveContent",
17546
+ summary: "Download video",
17547
+ description: "OpenAI video API with OpenRouter request and response extensions.",
17548
+ http: "GET",
17549
+ path: "/model/v1/videos/{video_id}/content",
17550
+ streaming: "no",
17551
+ pagination: false,
17552
+ pathParams: [
17553
+ {
17554
+ name: "video_id",
17555
+ sdkName: "video_id",
17556
+ description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
17557
+ }
17558
+ ],
17559
+ query: [
17560
+ {
17561
+ name: "variant",
17562
+ type: "string",
17563
+ enum: [
17564
+ "video",
17565
+ "thumbnail",
17566
+ "spritesheet"
17567
+ ],
17568
+ required: false,
17569
+ description: "Spritesheet is not available in this release (400)."
17570
+ },
17571
+ {
17572
+ name: "index",
17573
+ type: "integer",
17574
+ required: false,
17575
+ description: "Output index; this release produces index 0. variant takes precedence."
17576
+ }
17577
+ ]
17578
+ },
17579
+ {
17580
+ resource: "model.videos",
17581
+ method: "remix",
17582
+ summary: "Remix video",
17583
+ description: "Not supported in this release; always returns 400.",
17584
+ http: "POST",
17585
+ path: "/model/v1/videos/{video_id}/remix",
17586
+ streaming: "no",
17587
+ pagination: false,
17588
+ pathParams: [
17589
+ {
17590
+ name: "video_id",
17591
+ sdkName: "video_id",
17592
+ description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
17593
+ }
17594
+ ],
17595
+ query: []
17596
+ },
17597
+ {
17598
+ resource: "ontology.changesets",
17599
+ method: "create",
17600
+ summary: "Apply changeset",
17601
+ description: "Apply a batch of node, relation and invalidation operations as one transaction, when a mirror has several records to write together and a partial write would leave the graph inconsistent. Every operation succeeds or none is applied. Send an Idempotency-Key header; the same key with the same content replays the first result, and the same key with different content is ONTOLOGY_CONFLICT.",
17602
+ http: "POST",
17603
+ path: "/ontology/v1/changesets",
17604
+ streaming: "no",
17605
+ pagination: false,
17606
+ pathParams: [],
17607
+ query: [],
17608
+ body: {
17609
+ required: true,
17610
+ fields: [
17611
+ {
17612
+ name: "at",
17613
+ type: "string",
17614
+ required: true,
17615
+ description: "World time the batch describes, in ISO 8601 UTC; operations without their own time are dated by it."
17616
+ },
17617
+ {
17618
+ name: "scope",
17619
+ type: "string",
17620
+ required: false,
17621
+ description: "Scope the batch came from, normally the session id it was observed in; it is stored with the operations for later reading."
17622
+ },
17623
+ {
17624
+ name: "ops",
17625
+ type: "array",
17626
+ itemType: "object",
17627
+ required: true,
17628
+ description: "At most 500 operations, applied in order; each names its kind in op and the fields that kind requires."
17629
+ }
17630
+ ]
17631
+ }
17632
+ },
17633
+ {
17634
+ resource: "ontology.nodes",
17635
+ method: "list",
17636
+ summary: "List nodes",
17637
+ description: "Discover the entities in this organization's graph and obtain node ids for retrieval, updates and relations. Filter by type, by free text over names, aliases, descriptions and facts, or by owner; limit is 1–100 and defaults to 50. Omit cursor for the first page, then copy next_cursor into the next request until it is null. A node whose content belongs to somebody else comes back as a restricted entry carrying only its id, type and name.",
17638
+ http: "GET",
17639
+ path: "/ontology/v1/nodes",
17640
+ streaming: "no",
17641
+ pagination: true,
17642
+ pathParams: [],
17643
+ query: [
17644
+ {
17645
+ name: "type",
17646
+ type: "array",
17647
+ itemType: "string",
17648
+ required: false,
17649
+ description: "Repeat to filter to any of several registered node type names, for example type=file&type=ticket; omit to list every type."
17650
+ },
17651
+ {
17652
+ name: "q",
17653
+ type: "string",
17654
+ required: false,
17655
+ description: "Free text matched against node names, aliases and descriptions; omit to list without a text filter."
17656
+ },
17657
+ {
17658
+ name: "owner",
17659
+ type: "string",
17660
+ required: false,
17661
+ description: "Filter to nodes owned by this member id, or omit to list nodes of every owner; organization-wide nodes carry no owner."
17662
+ },
17663
+ {
17664
+ name: "as_of",
17665
+ type: "string",
17666
+ required: false,
17667
+ description: "ISO 8601 timestamp; return the graph as it was then, so a node recorded later is absent. Omit to read current state."
17668
+ },
17669
+ {
17670
+ name: "limit",
17671
+ type: "integer",
17672
+ required: false,
17673
+ description: "Maximum items to return per page, from 1 to 100; defaults to 50 when omitted. Values above 100 are clamped to 100."
17674
+ },
17675
+ {
17676
+ name: "cursor",
17677
+ type: "string",
17678
+ required: false,
17679
+ description: "Opaque next_cursor from the preceding list response; omit for the first page and stop when next_cursor is null."
17680
+ }
17681
+ ]
17682
+ },
17683
+ {
17684
+ resource: "ontology.nodes",
17685
+ method: "create",
17686
+ summary: "Create node",
17687
+ description: "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.",
17688
+ http: "POST",
17689
+ path: "/ontology/v1/nodes",
17690
+ streaming: "no",
17691
+ pagination: false,
17692
+ pathParams: [],
17693
+ query: [],
17694
+ body: {
17695
+ required: true,
17696
+ fields: [
17697
+ {
17698
+ name: "type",
17699
+ type: "string",
17700
+ required: true,
17701
+ description: "Registered node type name from types.list; an unregistered name is refused and nothing is written."
17702
+ },
17703
+ {
17704
+ name: "ref",
17705
+ type: "string",
17706
+ required: false,
17707
+ description: "Id of the mirrored record in the owning service, which must start with the type's ref_prefix; omit or null for a concept with no external record."
17708
+ },
17709
+ {
17710
+ name: "name",
17711
+ type: "string",
17712
+ required: true,
17713
+ description: "Display name of the entity, at most 200 characters."
17714
+ },
17715
+ {
17716
+ name: "aliases",
17717
+ type: "array",
17718
+ itemType: "string",
17719
+ required: false,
17720
+ description: "Other names this entity is known by; they are matched by search alongside the name."
17721
+ },
17722
+ {
17723
+ name: "description",
17724
+ type: "string",
17725
+ required: false,
17726
+ description: "Profile of the entity, at most 500 characters; omit or null for none."
17727
+ },
17728
+ {
17729
+ name: "owner",
17730
+ type: "string",
17731
+ required: false,
17732
+ description: "Member id whose content this is, restricting it to that member; omit or null to make it readable organization-wide."
17733
+ }
17734
+ ]
17735
+ }
17736
+ },
17737
+ {
17738
+ resource: "ontology.nodes",
17739
+ method: "retrieve",
17740
+ summary: "Retrieve node",
17741
+ description: "Read one node's content and, with expand=relations, every relation on and around it. as_of reads the node as it was at that time. A node id from another organization, or one that never existed, answers ONTOLOGY_NODE_NOT_FOUND; a node you may reach but not read returns restricted true with its name only.",
17742
+ http: "GET",
17743
+ path: "/ontology/v1/nodes/{node_id}",
17744
+ streaming: "no",
17745
+ pagination: false,
17746
+ pathParams: [
17747
+ {
17748
+ name: "node_id",
17749
+ sdkName: "node_id",
17750
+ description: "Node id returned by nodes.list, nodes.create or a changeset, in the form ond_ followed by 32 lowercase letters or digits; a name or an external record id is not accepted."
17751
+ }
17752
+ ],
17753
+ query: [
17754
+ {
17755
+ name: "expand",
17756
+ type: "string",
17757
+ enum: [
17758
+ "relations"
17759
+ ],
17760
+ required: false,
17761
+ description: "Set to relations to include the node's incoming and outgoing relations in the same response; omit for the node alone."
17762
+ },
17763
+ {
17764
+ name: "as_of",
17765
+ type: "string",
17766
+ required: false,
17767
+ description: "ISO 8601 timestamp; read the node and its relations as they were then, including relations invalidated since. Omit to read current state."
17768
+ }
17769
+ ]
16308
17770
  },
16309
17771
  {
16310
- resource: "model.responses.inputItems",
16311
- method: "list",
16312
- summary: "List Response Input Items",
16313
- description: "Read the input items of a stored response using its id from creation. Use the returned items to inspect the input that produced that response.",
16314
- http: "GET",
16315
- path: "/model/v1/responses/{response_id}/input_items",
17772
+ resource: "ontology.nodes",
17773
+ method: "update",
17774
+ summary: "Update node",
17775
+ description: "Change a node's name, aliases or description when the mirrored record was renamed, without touching its type or identity. Send only the fields to change; omitted fields keep their current values and an explicitly null description clears it. Repeating the same edit converges on the same node, so this needs no Idempotency-Key.",
17776
+ http: "PATCH",
17777
+ path: "/ontology/v1/nodes/{node_id}",
16316
17778
  streaming: "no",
16317
17779
  pagination: false,
16318
17780
  pathParams: [
16319
17781
  {
16320
- name: "response_id",
16321
- sdkName: "response_id",
16322
- description: "Id of the stored response, the `id` returned by createResponse (it looks like resp_...). An unknown id, a response created with store false, an expired response and another tenant's response all answer 404."
17782
+ name: "node_id",
17783
+ sdkName: "node_id",
17784
+ description: "Node id returned by nodes.list, nodes.create or a changeset, in the form ond_ followed by 32 lowercase letters or digits; a name or an external record id is not accepted."
16323
17785
  }
16324
17786
  ],
16325
- query: []
17787
+ query: [],
17788
+ body: {
17789
+ required: true,
17790
+ fields: [
17791
+ {
17792
+ name: "name",
17793
+ type: "string",
17794
+ required: false,
17795
+ description: "New display name, at most 200 characters; omit to keep the current name."
17796
+ },
17797
+ {
17798
+ name: "aliases",
17799
+ type: "array",
17800
+ itemType: "string",
17801
+ required: false,
17802
+ description: "Replacement alias list; an empty array clears the aliases and omitting the field keeps them."
17803
+ },
17804
+ {
17805
+ name: "description",
17806
+ type: "string",
17807
+ required: false,
17808
+ description: "Replacement profile, at most 500 characters; an explicit null clears it and omitting the field keeps it."
17809
+ }
17810
+ ]
17811
+ }
16326
17812
  },
16327
17813
  {
16328
- resource: "model.systemone",
17814
+ resource: "ontology.nodes.merge",
16329
17815
  method: "create",
16330
- summary: "Ask structured decision questions",
16331
- description: "Ask typed questions about a state and get calibrated probabilities instead of generated text. Same request and response as TypeSafe System One. Use model ids from model.models.list declaring typesafe.systemone. Send one or more noul, choice or score questions; answers use the same question ids. Input tokens are charged at the catalog input price; output tokens are free. usage.cost and X-Praxis-Cost-Usd expose the same customer charge in USD. box questions and assets are unsupported and return 400: images are not supported. Unknown top-level fields pass unchanged to the native upstream.",
17816
+ summary: "Merge node",
17817
+ description: "Fold a duplicate node into the node that should survive, when two records are discovered to be the same entity. The merged node's relations and aliases move to the survivor and later reads of the duplicate resolve to it. Send an Idempotency-Key header; repeating the same key replays the first result. Reversal is a staff operation, not available here.",
16332
17818
  http: "POST",
16333
- path: "/model/v1/systemone",
17819
+ path: "/ontology/v1/nodes/{node_id}/merge",
16334
17820
  streaming: "no",
16335
17821
  pagination: false,
16336
- pathParams: [],
17822
+ pathParams: [
17823
+ {
17824
+ name: "node_id",
17825
+ sdkName: "node_id",
17826
+ description: "Node id returned by nodes.list, nodes.create or a changeset, in the form ond_ followed by 32 lowercase letters or digits; a name or an external record id is not accepted."
17827
+ }
17828
+ ],
16337
17829
  query: [],
16338
17830
  body: {
16339
17831
  required: true,
16340
17832
  fields: [
16341
17833
  {
16342
- name: "model",
17834
+ name: "into",
16343
17835
  type: "string",
16344
17836
  required: true,
16345
- description: "Published model id from model.models.list with supported_apis containing typesafe.systemone; returned unchanged in the response."
16346
- },
16347
- {
16348
- name: "state",
16349
- type: "object",
16350
- required: true,
16351
- description: "Shared content evaluated by every question, supplied as text, a JSON object or an array."
16352
- },
16353
- {
16354
- name: "questions",
16355
- type: "object",
16356
- required: true,
16357
- description: "Non-empty map of caller-chosen question ids to typed questions; answers preserve these ids. noul evaluates yes/no, choice selects a named option, score rates ordered levels. box is unsupported."
16358
- },
16359
- {
16360
- name: "assets",
16361
- type: "object",
16362
- required: false,
16363
- description: "Unsupported image assets. Supplying this field, including null or an empty collection, returns 400: images are not supported."
17837
+ description: "Node id that should survive, from nodes.list or search; the merged node's relations and aliases move to it."
16364
17838
  }
16365
17839
  ]
16366
17840
  }
16367
17841
  },
16368
17842
  {
16369
- resource: "model.videos",
17843
+ resource: "ontology.relations",
16370
17844
  method: "list",
16371
- summary: "List videos",
16372
- description: "OpenAI video API with OpenRouter request and response extensions.",
17845
+ summary: "List relations",
17846
+ description: "Read the facts in the graph and obtain relation ids for retrieval, invalidation or spreading. Filter by endpoint node, by type and by direction; as_of reads the relations as they were then. Invalidated relations are omitted unless include_invalid is true. limit is 1–100 and defaults to 50; follow next_cursor until it is null.",
16373
17847
  http: "GET",
16374
- path: "/model/v1/videos",
17848
+ path: "/ontology/v1/relations",
16375
17849
  streaming: "no",
16376
- pagination: false,
17850
+ pagination: true,
16377
17851
  pathParams: [],
16378
17852
  query: [
16379
17853
  {
16380
- name: "after",
17854
+ name: "node",
16381
17855
  type: "string",
16382
17856
  required: false,
16383
- description: "Cursor: the id of the video job after which the page starts, normally the `last_id` of the previous page. It must refer to an existing job of yours, otherwise the call fails."
17857
+ description: "A node id from nodes.list or nodes.create; returns the relations this node takes part in, narrowed by direction. Omit to list relations between every node."
16384
17858
  },
16385
17859
  {
16386
- name: "limit",
16387
- type: "integer",
17860
+ name: "type",
17861
+ type: "array",
17862
+ itemType: "string",
16388
17863
  required: false,
16389
- description: "Maximum number of jobs per page, from 1 to 100; defaults to 20."
17864
+ description: "Repeat to filter to any of several registered relation type names, for example type=references&type=serves; omit to list every type."
16390
17865
  },
16391
17866
  {
16392
- name: "order",
17867
+ name: "direction",
16393
17868
  type: "string",
16394
17869
  enum: [
16395
- "asc",
16396
- "desc"
17870
+ "out",
17871
+ "in",
17872
+ "both"
16397
17873
  ],
16398
17874
  required: false,
16399
- description: "Sort order by creation time: desc (default) lists the newest job first, asc the oldest first."
17875
+ description: "Which side of node to follow; out returns relations the node is the source of, in returns those it is the target of. Only meaningful together with node."
17876
+ },
17877
+ {
17878
+ name: "as_of",
17879
+ type: "string",
17880
+ required: false,
17881
+ description: "ISO 8601 timestamp; read relations as they were then, so one recorded or invalidated later is judged by that time. Omit to read current state."
17882
+ },
17883
+ {
17884
+ name: "include_invalid",
17885
+ type: "boolean",
17886
+ required: false,
17887
+ description: "Set true to include relations whose invalid_at has passed, which is how a relation that stopped being true stays readable. Omit or false for currently valid relations only."
17888
+ },
17889
+ {
17890
+ name: "limit",
17891
+ type: "integer",
17892
+ required: false,
17893
+ description: "Maximum items to return per page, from 1 to 100; defaults to 50 when omitted. Values above 100 are clamped to 100."
17894
+ },
17895
+ {
17896
+ name: "cursor",
17897
+ type: "string",
17898
+ required: false,
17899
+ description: "Opaque next_cursor from the preceding list response; omit for the first page and stop when next_cursor is null."
16400
17900
  }
16401
17901
  ]
16402
17902
  },
16403
17903
  {
16404
- resource: "model.videos",
17904
+ resource: "ontology.relations",
16405
17905
  method: "create",
16406
- summary: "Create video",
16407
- description: "OpenAI video API with OpenRouter request and response extensions.",
17906
+ summary: "Create relation",
17907
+ description: "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.",
16408
17908
  http: "POST",
16409
- path: "/model/v1/videos",
17909
+ path: "/ontology/v1/relations",
16410
17910
  streaming: "no",
16411
17911
  pagination: false,
16412
- multipart: true,
16413
17912
  pathParams: [],
16414
17913
  query: [],
16415
17914
  body: {
16416
17915
  required: true,
16417
17916
  fields: [
16418
17917
  {
16419
- name: "model",
17918
+ name: "type",
16420
17919
  type: "string",
16421
- required: false,
16422
- description: "Video model id, for example `wan2.7-t2v`; list candidates with listModels?type=video. Router support (partial): Select a registered video model explicitly, for example wan2.7-t2v (size=1280x720, seconds=4). Capability preflight errors are reported before creation."
17920
+ required: true,
17921
+ description: "Registered relation type name from types.list; it must admit both endpoints or the write is refused."
16423
17922
  },
16424
17923
  {
16425
- name: "prompt",
17924
+ name: "source",
16426
17925
  type: "string",
16427
17926
  required: true,
16428
- description: "Text description of the video, at least 1 character. Router support (supported): Controls video content; missing or empty values return 400."
16429
- },
16430
- {
16431
- name: "seconds",
16432
- type: "object",
16433
- required: false,
16434
- description: "Takes precedence over duration."
17927
+ description: "Node id the fact starts from, from nodes.list or nodes.create."
16435
17928
  },
16436
17929
  {
16437
- name: "duration",
16438
- type: "integer",
16439
- required: false,
16440
- description: "Length of the video in whole seconds. `seconds` takes precedence when both are given."
17930
+ name: "target",
17931
+ type: "string",
17932
+ required: true,
17933
+ description: "Node id the fact points at, from nodes.list or nodes.create."
16441
17934
  },
16442
17935
  {
16443
- name: "size",
17936
+ name: "fact",
16444
17937
  type: "string",
16445
- required: false,
16446
- description: "Output resolution as `WIDTHxHEIGHT`, for example `1280x720`. Router support (partial): Subject to model capability preflight. Earlier wan2.7-t2v samples always produced 1280x720; accepted sizes are not guaranteed pixel-for-pixel."
17938
+ required: true,
17939
+ description: "The relationship in one sentence, at most 280 characters, written to read back on its own."
16447
17940
  },
16448
17941
  {
16449
- name: "input_reference",
16450
- type: "object",
17942
+ name: "valid_at",
17943
+ type: "string",
16451
17944
  required: false,
16452
- description: "Reference image for image-to-video: a URL or base64 data URL, an object with `image_url`, or an uploaded image file (multipart, at most 20 MiB)."
17945
+ description: "World time the fact became true, when the mirrored record dates it; omit to leave it undated."
16453
17946
  },
16454
17947
  {
16455
- name: "input_references",
16456
- type: "array",
16457
- itemType: "object",
17948
+ name: "owner",
17949
+ type: "string",
16458
17950
  required: false,
16459
- description: "Several reference images; each entry is a URL or base64 data URL, or an object with `image_url`."
16460
- },
17951
+ description: "Member id whose content this fact is, restricting it to that member; omit or null for organization-wide."
17952
+ }
17953
+ ]
17954
+ }
17955
+ },
17956
+ {
17957
+ resource: "ontology.relations",
17958
+ method: "retrieve",
17959
+ summary: "Retrieve relation",
17960
+ description: "Read one relation's fact and both of its clocks — valid_at and invalid_at for when it was true in the world, created_at and expired_at for when it was recorded and retired. An id from another organization, or one that never existed, answers ONTOLOGY_EDGE_NOT_FOUND.",
17961
+ http: "GET",
17962
+ path: "/ontology/v1/relations/{relation_id}",
17963
+ streaming: "no",
17964
+ pagination: false,
17965
+ pathParams: [
17966
+ {
17967
+ name: "relation_id",
17968
+ sdkName: "relation_id",
17969
+ description: "Relation id returned by relations.list, relations.create or a changeset, in the form oed_ followed by 32 lowercase letters or digits; a node id is not accepted."
17970
+ }
17971
+ ],
17972
+ query: []
17973
+ },
17974
+ {
17975
+ resource: "ontology.relations.invalidate",
17976
+ method: "create",
17977
+ summary: "Invalidate relation",
17978
+ description: "Mark a relation as no longer true from a world time, when the mirrored record changed. The relation is kept — invalid_at moves and the relation still reads at an earlier as_of, so history stays answerable. Send an Idempotency-Key header; repeating the same key replays the first result. There is no delete.",
17979
+ http: "POST",
17980
+ path: "/ontology/v1/relations/{relation_id}/invalidate",
17981
+ streaming: "no",
17982
+ pagination: false,
17983
+ pathParams: [
17984
+ {
17985
+ name: "relation_id",
17986
+ sdkName: "relation_id",
17987
+ description: "Relation id returned by relations.list, relations.create or a changeset, in the form oed_ followed by 32 lowercase letters or digits; a node id is not accepted."
17988
+ }
17989
+ ],
17990
+ query: [],
17991
+ body: {
17992
+ required: true,
17993
+ fields: [
16461
17994
  {
16462
- name: "frame_images",
16463
- type: "array",
16464
- itemType: "object",
16465
- required: false,
16466
- description: "Images that pin the first and last frame; at most 2 entries."
17995
+ name: "invalid_at",
17996
+ type: "string",
17997
+ required: true,
17998
+ description: "World time the fact stopped being true, in ISO 8601 UTC; reads at an earlier as_of still return the relation."
16467
17999
  },
16468
18000
  {
16469
- name: "resolution",
18001
+ name: "superseded_by",
16470
18002
  type: "string",
16471
18003
  required: false,
16472
- description: "Output resolution label such as `720p`, for models that take a label instead of `size`."
18004
+ description: "Relation id that replaces this one, when a successor was recorded; omit or null when nothing replaced it."
16473
18005
  },
16474
18006
  {
16475
- name: "aspect_ratio",
18007
+ name: "reason",
16476
18008
  type: "string",
16477
18009
  required: false,
16478
- description: "Aspect ratio of the video such as `16:9`."
16479
- },
18010
+ description: "Why it stopped being true, for people reading the history later; not enforced and safe to omit."
18011
+ }
18012
+ ]
18013
+ }
18014
+ },
18015
+ {
18016
+ resource: "ontology.search",
18017
+ method: "create",
18018
+ summary: "Search nodes",
18019
+ description: "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.",
18020
+ http: "POST",
18021
+ path: "/ontology/v1/search",
18022
+ streaming: "no",
18023
+ pagination: false,
18024
+ pathParams: [],
18025
+ query: [],
18026
+ body: {
18027
+ required: true,
18028
+ fields: [
16480
18029
  {
16481
- name: "generate_audio",
16482
- type: "boolean",
16483
- required: false,
16484
- description: "Whether the video carries a generated audio track. Router support (supported): false produces no audio track on wan2.7-t2v; the default output includes audio."
18030
+ name: "text",
18031
+ type: "string",
18032
+ required: true,
18033
+ description: "Text to find nodes for, matched against names, aliases, descriptions and relation facts; an empty string is refused."
16485
18034
  },
16486
18035
  {
16487
- name: "seed",
16488
- type: "integer",
18036
+ name: "types",
18037
+ type: "array",
18038
+ itemType: "string",
16489
18039
  required: false,
16490
- description: "Seed for reproducible generation, on models that support it."
18040
+ description: "Registered node type names to search within; omit to search every type."
16491
18041
  },
16492
18042
  {
16493
- name: "callback_url",
16494
- type: "string",
18043
+ name: "window",
18044
+ type: "object",
16495
18045
  required: false,
16496
- description: "HTTP or HTTPS callback URL, forwarded to models that support completion callbacks."
18046
+ description: "Restrict matches to facts recorded within a period; omit to search all time."
16497
18047
  },
16498
18048
  {
16499
- name: "quality",
16500
- type: "string",
18049
+ name: "limit",
18050
+ type: "integer",
16501
18051
  required: false,
16502
- description: "Provider-specific quality setting."
18052
+ description: "Maximum candidate nodes to return, from 1 to 50; defaults to 20 when omitted."
16503
18053
  }
16504
18054
  ]
16505
18055
  }
16506
18056
  },
16507
18057
  {
16508
- resource: "model.videos",
16509
- method: "delete",
16510
- summary: "Delete video",
16511
- description: "OpenAI video API with OpenRouter request and response extensions.",
16512
- http: "DELETE",
16513
- path: "/model/v1/videos/{video_id}",
16514
- streaming: "no",
16515
- pagination: false,
16516
- pathParams: [
16517
- {
16518
- name: "video_id",
16519
- sdkName: "video_id",
16520
- description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
16521
- }
16522
- ],
16523
- query: []
16524
- },
16525
- {
16526
- resource: "model.videos",
16527
- method: "retrieve",
16528
- summary: "Retrieve video",
16529
- description: "OpenAI video API with OpenRouter request and response extensions.",
18058
+ resource: "ontology.types",
18059
+ method: "list",
18060
+ summary: "List types",
18061
+ description: "Read the node and relation types registered for this organization before writing, so a create names a type the graph accepts. Each entry is one registrant's registration with its owner, version and definitions. Types cannot be created at runtime; they are registered by the owning service at deploy time, so a type missing here is not available to write.",
16530
18062
  http: "GET",
16531
- path: "/model/v1/videos/{video_id}",
18063
+ path: "/ontology/v1/types",
16532
18064
  streaming: "no",
16533
18065
  pagination: false,
16534
- pathParams: [
16535
- {
16536
- name: "video_id",
16537
- sdkName: "video_id",
16538
- description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
16539
- }
16540
- ],
18066
+ pathParams: [],
16541
18067
  query: []
16542
18068
  },
16543
18069
  {
16544
- resource: "model.videos",
16545
- method: "retrieveContent",
16546
- summary: "Download video",
16547
- description: "OpenAI video API with OpenRouter request and response extensions.",
16548
- http: "GET",
16549
- path: "/model/v1/videos/{video_id}/content",
18070
+ resource: "ontology.types",
18071
+ method: "create",
18072
+ summary: "Register type",
18073
+ description: "Register a node or relation type for this organization. Not open yet — this call currently answers 501 NOT_IMPLEMENTED and writes nothing, because a registration is checked and stored by the deploy gate that ships the registering service, not by a runtime call. Until it opens, read the types already in force with praxis.ontology.types.list and create records only of those types.",
18074
+ http: "POST",
18075
+ path: "/ontology/v1/types",
16550
18076
  streaming: "no",
16551
18077
  pagination: false,
16552
- pathParams: [
16553
- {
16554
- name: "video_id",
16555
- sdkName: "video_id",
16556
- description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
16557
- }
16558
- ],
16559
- query: [
16560
- {
16561
- name: "variant",
16562
- type: "string",
16563
- enum: [
16564
- "video",
16565
- "thumbnail",
16566
- "spritesheet"
16567
- ],
16568
- required: false,
16569
- description: "Spritesheet is not available in this release (400)."
16570
- },
16571
- {
16572
- name: "index",
16573
- type: "integer",
16574
- required: false,
16575
- description: "Output index; this release produces index 0. variant takes precedence."
16576
- }
16577
- ]
18078
+ pathParams: [],
18079
+ query: [],
18080
+ body: {
18081
+ required: true,
18082
+ fields: [
18083
+ {
18084
+ name: "owner",
18085
+ type: "string",
18086
+ required: true,
18087
+ description: "Service that registered these types, for example file or ticket; it is the registrant a later change to a type is checked against."
18088
+ },
18089
+ {
18090
+ name: "version",
18091
+ type: "integer",
18092
+ required: true,
18093
+ description: "Monotonic version of this owner's registration; a later registration must extend this one without removing or narrowing anything."
18094
+ },
18095
+ {
18096
+ name: "nodes",
18097
+ type: "array",
18098
+ itemType: "object",
18099
+ required: true,
18100
+ description: "Node types this owner registers."
18101
+ },
18102
+ {
18103
+ name: "edges",
18104
+ type: "array",
18105
+ itemType: "object",
18106
+ required: true,
18107
+ description: "Relation types this owner registers."
18108
+ }
18109
+ ]
18110
+ }
16578
18111
  },
16579
18112
  {
16580
- resource: "model.videos",
16581
- method: "remix",
16582
- summary: "Remix video",
16583
- description: "Not supported in this release; always returns 400.",
16584
- http: "POST",
16585
- path: "/model/v1/videos/{video_id}/remix",
18113
+ resource: "ontology.types",
18114
+ method: "retrieve",
18115
+ summary: "Retrieve type",
18116
+ description: "Read one registered type's definition before writing a record of it, to learn whether it is a node or an edge, which endpoints an edge type admits, and which origins it accepts. The name comes from types.list; a name that is not registered answers ONTOLOGY_TYPE_UNKNOWN, and writes of that type are refused.",
18117
+ http: "GET",
18118
+ path: "/ontology/v1/types/{name}",
16586
18119
  streaming: "no",
16587
18120
  pagination: false,
16588
18121
  pathParams: [
16589
18122
  {
16590
- name: "video_id",
16591
- sdkName: "video_id",
16592
- description: "Id of the video job whose output you want, the `id` returned by createVideo. The job must be completed; before that the call answers 400."
18123
+ name: "name",
18124
+ sdkName: "name",
18125
+ description: "A type name from types.list, with its dots preserved — a display label is not accepted."
16593
18126
  }
16594
18127
  ],
16595
18128
  query: []
@@ -19317,7 +20850,7 @@ for more details.`
19317
20850
  resource: "ticket.labels",
19318
20851
  method: "create",
19319
20852
  summary: "Create or add labels",
19320
- description: "Create or add labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.",
20853
+ description: "Create or add labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.",
19321
20854
  http: "POST",
19322
20855
  path: "/ticket/v1/labels",
19323
20856
  streaming: "no",
@@ -19359,7 +20892,7 @@ for more details.`
19359
20892
  resource: "ticket.labels",
19360
20893
  method: "delete",
19361
20894
  summary: "Remove labels",
19362
- description: "Remove labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.",
20895
+ description: "Remove labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.",
19363
20896
  http: "DELETE",
19364
20897
  path: "/ticket/v1/labels/{name}",
19365
20898
  streaming: "no",
@@ -19384,7 +20917,7 @@ for more details.`
19384
20917
  resource: "ticket.labels",
19385
20918
  method: "update",
19386
20919
  summary: "Update labels",
19387
- description: "Update labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Organization owner or admin authority is required for this write; API keys without role information act as members.",
20920
+ description: "Update labels within the authenticated organization. Obtain resource identifiers from the corresponding list or create response. Writes complete synchronously; read the returned resource to observe the result. Service authorization applies to the verified human subject.",
19388
20921
  http: "PATCH",
19389
20922
  path: "/ticket/v1/labels/{name}",
19390
20923
  streaming: "no",
@@ -20786,7 +22319,7 @@ for more details.`
20786
22319
  resource: "vault.vaults",
20787
22320
  method: "create",
20788
22321
  summary: "Create vault",
20789
- description: "Create an empty, active vault to hold credentials for your account, with a display name and optional metadata. Use its returned id as vault_id when creating secrets or OAuth authorizations. Unlike Anthropic, Agent sessions do not accept nonempty vault_ids; storing a credential or adding its ID to metadata does not enable vault-backed MCP authentication. Application vault references are also unavailable; praxis_vault_ref version bindings and secret writes with a vault source return 501, so creating a vault does not yet enable either consumer.",
22322
+ description: "Create an empty, active vault to hold credentials for your account, with a display name and optional metadata. Use its returned id as vault_id when creating secrets or OAuth authorizations. Agent sessions and deployments accept up to 50 vault_ids and match their credentials against the session's MCP servers, so a stored static or oauth credential does serve as vault-backed MCP authentication; only environment_variable credentials are not yet placed, because the egress proxy ADR-058 §6 gives them is not built. Application vault references are also unavailable; praxis_vault_ref version bindings and secret writes with a vault source return 501, so creating a vault does not yet enable either consumer.",
20790
22323
  http: "POST",
20791
22324
  path: "/vault/v1/vaults",
20792
22325
  streaming: "no",
@@ -21319,6 +22852,8 @@ function problemFrom(status, headers, body, statusText) {
21319
22852
  param: typeof param === "string" ? param : param === null || nested.param === null ? null : undefined,
21320
22853
  errors: Array.isArray(value.errors) ? value.errors : [],
21321
22854
  requestId: headers.get("x-request-id") ?? string(value.requestId) ?? string(value.request_id),
22855
+ docUrl: string(nested.doc_url) ?? string(value.doc_url) ?? string(nested.docUrl) ?? string(value.docUrl),
22856
+ describe: string(nested.describe) ?? string(value.describe),
21322
22857
  raw: body
21323
22858
  };
21324
22859
  }
@@ -21332,6 +22867,8 @@ class PraxisError extends Error {
21332
22867
  errors;
21333
22868
  requestId;
21334
22869
  param;
22870
+ docUrl;
22871
+ describe;
21335
22872
  raw;
21336
22873
  constructor(problem = {}, options) {
21337
22874
  super(problem.message ?? problem.detail ?? problem.title ?? `Praxis request failed${problem.status ? ` (${problem.status})` : ""}`, options);
@@ -21344,6 +22881,8 @@ class PraxisError extends Error {
21344
22881
  this.errors = problem.errors ?? [];
21345
22882
  this.requestId = problem.requestId;
21346
22883
  this.param = problem.param;
22884
+ this.docUrl = problem.docUrl;
22885
+ this.describe = problem.describe;
21347
22886
  this.raw = problem.raw;
21348
22887
  }
21349
22888
  static fromResponse(response, body) {
@@ -22748,6 +24287,23 @@ var computersFilesContent = (options) => (options.client ?? client).get({
22748
24287
  url: "/agent/v1/computers/{computer_id}/files/content",
22749
24288
  ...options
22750
24289
  });
24290
+ var computersFilesConvert = (options) => (options.client ?? client).post({
24291
+ security: [{
24292
+ key: "BearerAuth",
24293
+ scheme: "bearer",
24294
+ type: "http"
24295
+ }, {
24296
+ key: "ApiKeyAuth",
24297
+ name: "X-API-Key",
24298
+ type: "apiKey"
24299
+ }],
24300
+ url: "/agent/v1/computers/{computer_id}/files/convert",
24301
+ ...options,
24302
+ headers: {
24303
+ "Content-Type": "application/json",
24304
+ ...options.headers
24305
+ }
24306
+ });
22751
24307
  var connectComputer = (options) => (options.client ?? client).post({
22752
24308
  security: [{
22753
24309
  key: "BearerAuth",
@@ -23246,6 +24802,15 @@ var fileCancelUpload = (options) => (options.client ?? client).post({
23246
24802
  url: "/file/v1/uploads/{upload_id}/cancel",
23247
24803
  ...options
23248
24804
  });
24805
+ var fileRetrieveUpload = (options) => (options.client ?? client).get({
24806
+ security: [{
24807
+ key: "BearerAuth",
24808
+ scheme: "bearer",
24809
+ type: "http"
24810
+ }],
24811
+ url: "/file/v1/uploads/{upload_id}",
24812
+ ...options
24813
+ });
23249
24814
  var fileCreateSignedUpload = (options) => (options.client ?? client).post({
23250
24815
  security: [{
23251
24816
  key: "BearerAuth",
@@ -27122,6 +28687,36 @@ var cutCreateExport = (options) => (options.client ?? client).post({
27122
28687
  ...options.headers
27123
28688
  }
27124
28689
  });
28690
+ var cutCreateRender = (options) => (options.client ?? client).post({
28691
+ security: [{
28692
+ key: "BearerAuth",
28693
+ scheme: "bearer",
28694
+ type: "http"
28695
+ }, {
28696
+ key: "ApiKeyAuth",
28697
+ name: "X-API-Key",
28698
+ type: "apiKey"
28699
+ }],
28700
+ url: "/cut/v1/projects/{project_id}/renders",
28701
+ ...options,
28702
+ headers: {
28703
+ "Content-Type": "application/json",
28704
+ ...options.headers
28705
+ }
28706
+ });
28707
+ var cutRetrieveRender = (options) => (options.client ?? client).get({
28708
+ security: [{
28709
+ key: "BearerAuth",
28710
+ scheme: "bearer",
28711
+ type: "http"
28712
+ }, {
28713
+ key: "ApiKeyAuth",
28714
+ name: "X-API-Key",
28715
+ type: "apiKey"
28716
+ }],
28717
+ url: "/cut/v1/renders/{render_id}",
28718
+ ...options
28719
+ });
27125
28720
  var cutRetrieveExport = (options) => (options.client ?? client).get({
27126
28721
  security: [{
27127
28722
  key: "BearerAuth",
@@ -27412,6 +29007,201 @@ var databaseInsert = (options) => (options.client ?? client).post({
27412
29007
  ...options.headers
27413
29008
  }
27414
29009
  });
29010
+ var devopsTestCatalogGet = (options) => (options.client ?? client).get({
29011
+ security: [{
29012
+ key: "devops-bearerAuth",
29013
+ scheme: "bearer",
29014
+ type: "http"
29015
+ }],
29016
+ url: "/devops/v1/projects/{project}/test-catalog",
29017
+ ...options
29018
+ });
29019
+ var devopsTestSuitesList = (options) => (options.client ?? client).get({
29020
+ security: [{
29021
+ key: "devops-bearerAuth",
29022
+ scheme: "bearer",
29023
+ type: "http"
29024
+ }],
29025
+ url: "/devops/v1/projects/{project}/test-suites",
29026
+ ...options
29027
+ });
29028
+ var devopsTestSuitesGet = (options) => (options.client ?? client).get({
29029
+ security: [{
29030
+ key: "devops-bearerAuth",
29031
+ scheme: "bearer",
29032
+ type: "http"
29033
+ }],
29034
+ url: "/devops/v1/test-suites/{id}",
29035
+ ...options
29036
+ });
29037
+ var devopsTestCasesList = (options) => (options.client ?? client).get({
29038
+ security: [{
29039
+ key: "devops-bearerAuth",
29040
+ scheme: "bearer",
29041
+ type: "http"
29042
+ }],
29043
+ url: "/devops/v1/projects/{project}/test-cases",
29044
+ ...options
29045
+ });
29046
+ var devopsTestCasesGet = (options) => (options.client ?? client).get({
29047
+ security: [{
29048
+ key: "devops-bearerAuth",
29049
+ scheme: "bearer",
29050
+ type: "http"
29051
+ }],
29052
+ url: "/devops/v1/test-cases/{id}",
29053
+ ...options
29054
+ });
29055
+ var devopsTestPlansList = (options) => (options.client ?? client).get({
29056
+ security: [{
29057
+ key: "devops-bearerAuth",
29058
+ scheme: "bearer",
29059
+ type: "http"
29060
+ }],
29061
+ url: "/devops/v1/projects/{project}/test-plans",
29062
+ ...options
29063
+ });
29064
+ var devopsTestPlansCreate = (options) => (options.client ?? client).post({
29065
+ security: [{
29066
+ key: "devops-bearerAuth",
29067
+ scheme: "bearer",
29068
+ type: "http"
29069
+ }],
29070
+ url: "/devops/v1/projects/{project}/test-plans",
29071
+ ...options,
29072
+ headers: {
29073
+ "Content-Type": "application/json",
29074
+ ...options.headers
29075
+ }
29076
+ });
29077
+ var devopsTestPlansDelete = (options) => (options.client ?? client).delete({
29078
+ security: [{
29079
+ key: "devops-bearerAuth",
29080
+ scheme: "bearer",
29081
+ type: "http"
29082
+ }],
29083
+ url: "/devops/v1/test-plans/{id}",
29084
+ ...options
29085
+ });
29086
+ var devopsTestPlansGet = (options) => (options.client ?? client).get({
29087
+ security: [{
29088
+ key: "devops-bearerAuth",
29089
+ scheme: "bearer",
29090
+ type: "http"
29091
+ }],
29092
+ url: "/devops/v1/test-plans/{id}",
29093
+ ...options
29094
+ });
29095
+ var devopsTestPlansUpdate = (options) => (options.client ?? client).patch({
29096
+ security: [{
29097
+ key: "devops-bearerAuth",
29098
+ scheme: "bearer",
29099
+ type: "http"
29100
+ }],
29101
+ url: "/devops/v1/test-plans/{id}",
29102
+ ...options,
29103
+ headers: {
29104
+ "Content-Type": "application/json",
29105
+ ...options.headers
29106
+ }
29107
+ });
29108
+ var devopsTestPlansPause = (options) => (options.client ?? client).post({
29109
+ security: [{
29110
+ key: "devops-bearerAuth",
29111
+ scheme: "bearer",
29112
+ type: "http"
29113
+ }],
29114
+ url: "/devops/v1/test-plans/{id}:pause",
29115
+ ...options,
29116
+ headers: {
29117
+ "Content-Type": "application/json",
29118
+ ...options.headers
29119
+ }
29120
+ });
29121
+ var devopsTestPlansResume = (options) => (options.client ?? client).post({
29122
+ security: [{
29123
+ key: "devops-bearerAuth",
29124
+ scheme: "bearer",
29125
+ type: "http"
29126
+ }],
29127
+ url: "/devops/v1/test-plans/{id}:resume",
29128
+ ...options
29129
+ });
29130
+ var devopsTestRunsList = (options) => (options.client ?? client).get({
29131
+ security: [{
29132
+ key: "devops-bearerAuth",
29133
+ scheme: "bearer",
29134
+ type: "http"
29135
+ }],
29136
+ url: "/devops/v1/projects/{project}/test-runs",
29137
+ ...options
29138
+ });
29139
+ var devopsTestRunsCreate = (options) => (options.client ?? client).post({
29140
+ security: [{
29141
+ key: "devops-bearerAuth",
29142
+ scheme: "bearer",
29143
+ type: "http"
29144
+ }],
29145
+ url: "/devops/v1/projects/{project}/test-runs",
29146
+ ...options,
29147
+ headers: {
29148
+ "Content-Type": "application/json",
29149
+ ...options.headers
29150
+ }
29151
+ });
29152
+ var devopsTestRunsGet = (options) => (options.client ?? client).get({
29153
+ security: [{
29154
+ key: "devops-bearerAuth",
29155
+ scheme: "bearer",
29156
+ type: "http"
29157
+ }],
29158
+ url: "/devops/v1/test-runs/{id}",
29159
+ ...options
29160
+ });
29161
+ var devopsTestRunsCancel = (options) => (options.client ?? client).post({
29162
+ security: [{
29163
+ key: "devops-bearerAuth",
29164
+ scheme: "bearer",
29165
+ type: "http"
29166
+ }],
29167
+ url: "/devops/v1/test-runs/{id}:cancel",
29168
+ ...options,
29169
+ headers: {
29170
+ "Content-Type": "application/json",
29171
+ ...options.headers
29172
+ }
29173
+ });
29174
+ var devopsTestExecutionsList = (options) => (options.client ?? client).get({
29175
+ security: [{
29176
+ key: "devops-bearerAuth",
29177
+ scheme: "bearer",
29178
+ type: "http"
29179
+ }],
29180
+ url: "/devops/v1/test-runs/{run}/executions",
29181
+ ...options
29182
+ });
29183
+ var devopsTestExecutionsGet = (options) => (options.client ?? client).get({
29184
+ security: [{
29185
+ key: "devops-bearerAuth",
29186
+ scheme: "bearer",
29187
+ type: "http"
29188
+ }],
29189
+ url: "/devops/v1/test-runs/{run}/executions/{case}",
29190
+ ...options
29191
+ });
29192
+ var devopsTestReportsUpload = (options) => (options.client ?? client).post({
29193
+ security: [{
29194
+ key: "devops-bearerAuth",
29195
+ scheme: "bearer",
29196
+ type: "http"
29197
+ }],
29198
+ url: "/devops/v1/projects/{project}/test-reports",
29199
+ ...options,
29200
+ headers: {
29201
+ "Content-Type": "application/json",
29202
+ ...options.headers
29203
+ }
29204
+ });
27415
29205
  var knowledgeListVectorStores = (options) => (options?.client ?? client).get({
27416
29206
  security: [{
27417
29207
  key: "knowledge-bearerAuth",
@@ -28004,6 +29794,164 @@ var mediaGetGenerationCapabilities = (options) => (options?.client ?? client).ge
28004
29794
  url: "/media/v1/generation/capabilities",
28005
29795
  ...options
28006
29796
  });
29797
+ var ontologyListTypes = (options) => (options?.client ?? client).get({
29798
+ security: [{
29799
+ key: "ontology-bearerAuth",
29800
+ scheme: "bearer",
29801
+ type: "http"
29802
+ }],
29803
+ url: "/ontology/v1/types",
29804
+ ...options
29805
+ });
29806
+ var ontologyRegisterType = (options) => (options.client ?? client).post({
29807
+ security: [{
29808
+ key: "ontology-bearerAuth",
29809
+ scheme: "bearer",
29810
+ type: "http"
29811
+ }],
29812
+ url: "/ontology/v1/types",
29813
+ ...options,
29814
+ headers: {
29815
+ "Content-Type": "application/json",
29816
+ ...options.headers
29817
+ }
29818
+ });
29819
+ var ontologyRetrieveType = (options) => (options.client ?? client).get({
29820
+ security: [{
29821
+ key: "ontology-bearerAuth",
29822
+ scheme: "bearer",
29823
+ type: "http"
29824
+ }],
29825
+ url: "/ontology/v1/types/{name}",
29826
+ ...options
29827
+ });
29828
+ var ontologyListNodes = (options) => (options?.client ?? client).get({
29829
+ security: [{
29830
+ key: "ontology-bearerAuth",
29831
+ scheme: "bearer",
29832
+ type: "http"
29833
+ }],
29834
+ url: "/ontology/v1/nodes",
29835
+ ...options
29836
+ });
29837
+ var ontologyCreateNode = (options) => (options.client ?? client).post({
29838
+ security: [{
29839
+ key: "ontology-bearerAuth",
29840
+ scheme: "bearer",
29841
+ type: "http"
29842
+ }],
29843
+ url: "/ontology/v1/nodes",
29844
+ ...options,
29845
+ headers: {
29846
+ "Content-Type": "application/json",
29847
+ ...options.headers
29848
+ }
29849
+ });
29850
+ var ontologyRetrieveNode = (options) => (options.client ?? client).get({
29851
+ security: [{
29852
+ key: "ontology-bearerAuth",
29853
+ scheme: "bearer",
29854
+ type: "http"
29855
+ }],
29856
+ url: "/ontology/v1/nodes/{node_id}",
29857
+ ...options
29858
+ });
29859
+ var ontologyUpdateNode = (options) => (options.client ?? client).patch({
29860
+ security: [{
29861
+ key: "ontology-bearerAuth",
29862
+ scheme: "bearer",
29863
+ type: "http"
29864
+ }],
29865
+ url: "/ontology/v1/nodes/{node_id}",
29866
+ ...options,
29867
+ headers: {
29868
+ "Content-Type": "application/json",
29869
+ ...options.headers
29870
+ }
29871
+ });
29872
+ var ontologyMergeNode = (options) => (options.client ?? client).post({
29873
+ security: [{
29874
+ key: "ontology-bearerAuth",
29875
+ scheme: "bearer",
29876
+ type: "http"
29877
+ }],
29878
+ url: "/ontology/v1/nodes/{node_id}/merge",
29879
+ ...options,
29880
+ headers: {
29881
+ "Content-Type": "application/json",
29882
+ ...options.headers
29883
+ }
29884
+ });
29885
+ var ontologyListRelations = (options) => (options?.client ?? client).get({
29886
+ security: [{
29887
+ key: "ontology-bearerAuth",
29888
+ scheme: "bearer",
29889
+ type: "http"
29890
+ }],
29891
+ url: "/ontology/v1/relations",
29892
+ ...options
29893
+ });
29894
+ var ontologyCreateRelation = (options) => (options.client ?? client).post({
29895
+ security: [{
29896
+ key: "ontology-bearerAuth",
29897
+ scheme: "bearer",
29898
+ type: "http"
29899
+ }],
29900
+ url: "/ontology/v1/relations",
29901
+ ...options,
29902
+ headers: {
29903
+ "Content-Type": "application/json",
29904
+ ...options.headers
29905
+ }
29906
+ });
29907
+ var ontologyRetrieveRelation = (options) => (options.client ?? client).get({
29908
+ security: [{
29909
+ key: "ontology-bearerAuth",
29910
+ scheme: "bearer",
29911
+ type: "http"
29912
+ }],
29913
+ url: "/ontology/v1/relations/{relation_id}",
29914
+ ...options
29915
+ });
29916
+ var ontologyInvalidateRelation = (options) => (options.client ?? client).post({
29917
+ security: [{
29918
+ key: "ontology-bearerAuth",
29919
+ scheme: "bearer",
29920
+ type: "http"
29921
+ }],
29922
+ url: "/ontology/v1/relations/{relation_id}/invalidate",
29923
+ ...options,
29924
+ headers: {
29925
+ "Content-Type": "application/json",
29926
+ ...options.headers
29927
+ }
29928
+ });
29929
+ var ontologyApplyChangeset = (options) => (options.client ?? client).post({
29930
+ security: [{
29931
+ key: "ontology-bearerAuth",
29932
+ scheme: "bearer",
29933
+ type: "http"
29934
+ }],
29935
+ url: "/ontology/v1/changesets",
29936
+ ...options,
29937
+ headers: {
29938
+ "Content-Type": "application/json",
29939
+ ...options.headers
29940
+ }
29941
+ });
29942
+ var ontologySearch = (options) => (options.client ?? client).post({
29943
+ security: [{
29944
+ key: "ontology-bearerAuth",
29945
+ scheme: "bearer",
29946
+ type: "http"
29947
+ }],
29948
+ url: "/ontology/v1/search",
29949
+ ...options,
29950
+ headers: {
29951
+ "Content-Type": "application/json",
29952
+ ...options.headers
29953
+ }
29954
+ });
28007
29955
  var getSandboxV1Sandboxes = (options) => (options?.client ?? client).get({
28008
29956
  querySerializer: { parameters: { state: { array: { explode: false } } } },
28009
29957
  security: [
@@ -29881,6 +31829,9 @@ function createAgent(transport) {
29881
31829
  create: bind(transport, computersCreate),
29882
31830
  delete: bind(transport, computersDelete),
29883
31831
  files: {
31832
+ convert: {
31833
+ create: bind(transport, computersFilesConvert)
31834
+ },
29884
31835
  list: bind(transport, computersFilesList),
29885
31836
  retrieveContent: bind(transport, computersFilesContent)
29886
31837
  },
@@ -30328,6 +32279,9 @@ function createCut(transport) {
30328
32279
  media: {
30329
32280
  import: bind(transport, cutImportMedia)
30330
32281
  },
32282
+ renders: {
32283
+ create: bind(transport, cutCreateRender)
32284
+ },
30331
32285
  retrieve: bind(transport, cutRetrieveProject),
30332
32286
  retrieveState: bind(transport, cutRetrieveState),
30333
32287
  retrieveTimeline: bind(transport, cutRetrieveTimeline),
@@ -30338,6 +32292,9 @@ function createCut(transport) {
30338
32292
  list: bind(transport, cutListVersions)
30339
32293
  }
30340
32294
  },
32295
+ renders: {
32296
+ retrieve: bind(transport, cutRetrieveRender)
32297
+ },
30341
32298
  versions: {
30342
32299
  restore: bind(transport, cutRestoreVersion)
30343
32300
  }
@@ -30380,6 +32337,51 @@ function createDatabase(transport) {
30380
32337
  }
30381
32338
  };
30382
32339
  }
32340
+ function createDevops(transport) {
32341
+ return {
32342
+ projects: {
32343
+ retrieveTestCatalog: bind(transport, devopsTestCatalogGet),
32344
+ testCases: {
32345
+ list: bind(transport, devopsTestCasesList)
32346
+ },
32347
+ testPlans: {
32348
+ create: bind(transport, devopsTestPlansCreate),
32349
+ list: bind(transport, devopsTestPlansList)
32350
+ },
32351
+ testReports: {
32352
+ create: bind(transport, devopsTestReportsUpload)
32353
+ },
32354
+ testRuns: {
32355
+ create: bind(transport, devopsTestRunsCreate),
32356
+ list: bind(transport, devopsTestRunsList)
32357
+ },
32358
+ testSuites: {
32359
+ list: bind(transport, devopsTestSuitesList)
32360
+ }
32361
+ },
32362
+ testCases: {
32363
+ retrieve: bind(transport, devopsTestCasesGet)
32364
+ },
32365
+ testPlans: {
32366
+ delete: bind(transport, devopsTestPlansDelete),
32367
+ pause: bind(transport, devopsTestPlansPause),
32368
+ resume: bind(transport, devopsTestPlansResume),
32369
+ retrieve: bind(transport, devopsTestPlansGet),
32370
+ update: bind(transport, devopsTestPlansUpdate)
32371
+ },
32372
+ testRuns: {
32373
+ cancel: bind(transport, devopsTestRunsCancel),
32374
+ executions: {
32375
+ list: bind(transport, devopsTestExecutionsList),
32376
+ retrieve: bind(transport, devopsTestExecutionsGet)
32377
+ },
32378
+ retrieve: bind(transport, devopsTestRunsGet)
32379
+ },
32380
+ testSuites: {
32381
+ retrieve: bind(transport, devopsTestSuitesGet)
32382
+ }
32383
+ };
32384
+ }
30383
32385
  function createFile(transport) {
30384
32386
  return {
30385
32387
  files: {
@@ -30402,7 +32404,8 @@ function createFile(transport) {
30402
32404
  createSigned: bind(transport, fileCreateSignedUpload),
30403
32405
  parts: {
30404
32406
  create: bind(transport, (options) => fileAddUploadPart({ ...options, bodySerializer: multipartBodySerializer, headers: { "Content-Type": null, ...options.headers } }))
30405
- }
32407
+ },
32408
+ retrieve: bind(transport, fileRetrieveUpload)
30406
32409
  }
30407
32410
  };
30408
32411
  }
@@ -30630,6 +32633,38 @@ function createModel(transport) {
30630
32633
  }
30631
32634
  };
30632
32635
  }
32636
+ function createOntology(transport) {
32637
+ return {
32638
+ changesets: {
32639
+ create: bind(transport, ontologyApplyChangeset)
32640
+ },
32641
+ nodes: {
32642
+ create: bind(transport, ontologyCreateNode),
32643
+ list: bindPage(transport, ontologyListNodes),
32644
+ merge: {
32645
+ create: bind(transport, ontologyMergeNode)
32646
+ },
32647
+ retrieve: bind(transport, ontologyRetrieveNode),
32648
+ update: bind(transport, ontologyUpdateNode)
32649
+ },
32650
+ relations: {
32651
+ create: bind(transport, ontologyCreateRelation),
32652
+ invalidate: {
32653
+ create: bind(transport, ontologyInvalidateRelation)
32654
+ },
32655
+ list: bindPage(transport, ontologyListRelations),
32656
+ retrieve: bind(transport, ontologyRetrieveRelation)
32657
+ },
32658
+ search: {
32659
+ create: bind(transport, ontologySearch)
32660
+ },
32661
+ types: {
32662
+ create: bind(transport, ontologyRegisterType),
32663
+ list: bind(transport, ontologyListTypes),
32664
+ retrieve: bind(transport, ontologyRetrieveType)
32665
+ }
32666
+ };
32667
+ }
30633
32668
  function createOrganization(transport) {
30634
32669
  return {
30635
32670
  charges: {
@@ -30891,11 +32926,13 @@ var resourceFactories = {
30891
32926
  crm: createCrm,
30892
32927
  cut: createCut,
30893
32928
  database: createDatabase,
32929
+ devops: createDevops,
30894
32930
  file: createFile,
30895
32931
  knowledge: createKnowledge,
30896
32932
  media: createMedia,
30897
32933
  meta: createMeta,
30898
32934
  model: createModel,
32935
+ ontology: createOntology,
30899
32936
  organization: createOrganization,
30900
32937
  sandbox: createSandbox,
30901
32938
  search: createSearch,
@@ -31467,6 +33504,34 @@ function isBlankTab(value) {
31467
33504
  return false;
31468
33505
  }
31469
33506
  }
33507
+ function matchTargetsToPages(targets, pageUrls) {
33508
+ const byUrl = new Map;
33509
+ for (const target of targets)
33510
+ if (target.type === "page")
33511
+ byUrl.set(target.url, [...byUrl.get(target.url) ?? [], target]);
33512
+ const pagesPerUrl = new Map;
33513
+ for (const url of pageUrls)
33514
+ pagesPerUrl.set(url, (pagesPerUrl.get(url) ?? 0) + 1);
33515
+ const matched = new Map;
33516
+ const unmatched = [];
33517
+ pageUrls.forEach((url, index) => {
33518
+ const candidates = byUrl.get(url);
33519
+ const target = candidates?.length === 1 && pagesPerUrl.get(url) === 1 ? candidates[0] : undefined;
33520
+ if (target)
33521
+ matched.set(index, target);
33522
+ else
33523
+ unmatched.push(index);
33524
+ });
33525
+ return { matched, unmatched };
33526
+ }
33527
+ function pickContextByName(contexts, agentId) {
33528
+ const wanted = agentContextName(agentId);
33529
+ return contexts.find((context) => context.name === wanted && context.labels?.agent === agentId);
33530
+ }
33531
+ function isDuplicateNameError(error) {
33532
+ const problem = error;
33533
+ return problem?.code === "INVALID_PARAMS" && typeof problem.message === "string" && problem.message.includes("already exists");
33534
+ }
31470
33535
 
31471
33536
  // ../../packages/sdk/typescript/src/helpers/browser-connect.ts
31472
33537
  var PLAYWRIGHT_CORE_VERSION = "1.63.0";
@@ -31489,6 +33554,8 @@ function node(deps, name) {
31489
33554
  throw needsFullMachine();
31490
33555
  }
31491
33556
  async function loadPlaywright(deps, home) {
33557
+ if (deps.playwright)
33558
+ return deps.playwright;
31492
33559
  node(deps, "node:child_process");
31493
33560
  const fs = node(deps, "node:fs");
31494
33561
  const entry = (root2) => `${root2}/index.mjs`;
@@ -31507,19 +33574,43 @@ async function loadPlaywright(deps, home) {
31507
33574
  return await import(`file://${entry(root)}`);
31508
33575
  }
31509
33576
  async function ensureContext(deps, agentId) {
31510
- const seen = [];
31511
- let cursor;
31512
- for (let page = 0;page < 20; page++) {
31513
- const result = await deps.contexts.list({ query: { limit: 100, ...cursor ? { cursor } : {} } });
31514
- seen.push(...result.data);
31515
- const own = pickAgentContext(seen, agentId);
31516
- if (own)
31517
- return own.id;
31518
- if (!result.nextCursor)
31519
- break;
31520
- cursor = result.nextCursor;
33577
+ const name = agentContextName(agentId);
33578
+ const byNameQuery = () => deps.contexts.list({ query: { name, limit: 1 } });
33579
+ const paged = async () => {
33580
+ const seen = [];
33581
+ let cursor;
33582
+ for (let page = 0;page < 20; page++) {
33583
+ const result = await deps.contexts.list({ query: { limit: 100, ...cursor ? { cursor } : {} } });
33584
+ seen.push(...result.data);
33585
+ const own = pickAgentContext(seen, agentId);
33586
+ if (own)
33587
+ return own.id;
33588
+ if (!result.nextCursor)
33589
+ break;
33590
+ cursor = result.nextCursor;
33591
+ }
33592
+ return;
33593
+ };
33594
+ const find = async () => {
33595
+ const answer = (await byNameQuery()).data;
33596
+ const byName = pickContextByName(answer, agentId);
33597
+ if (byName)
33598
+ return byName.id;
33599
+ return answer.length > 0 ? paged() : undefined;
33600
+ };
33601
+ const existing = await find();
33602
+ if (existing)
33603
+ return existing;
33604
+ try {
33605
+ return (await deps.contexts.create({ body: { name, labels: { agent: agentId } } })).id;
33606
+ } catch (cause) {
33607
+ if (!isDuplicateNameError(cause))
33608
+ throw cause;
33609
+ const raced = await find();
33610
+ if (raced)
33611
+ return raced;
33612
+ throw cause;
31521
33613
  }
31522
- return (await deps.contexts.create({ body: { name: agentContextName(agentId), labels: { agent: agentId } } })).id;
31523
33614
  }
31524
33615
  var bounded = (work, ms) => Promise.race([work, new Promise((_, reject) => setTimeout(() => reject(new Error("timed out")), ms))]);
31525
33616
  async function connectBrowser(deps, options = {}) {
@@ -31543,6 +33634,29 @@ async function connectBrowser(deps, options = {}) {
31543
33634
  const now = deps.now ?? Date.now;
31544
33635
  const pages = () => browser.contexts().flatMap((c) => c.pages());
31545
33636
  const ids = new WeakMap;
33637
+ let cdp;
33638
+ const browserSession = async () => {
33639
+ if (!browser.newBrowserCDPSession)
33640
+ return;
33641
+ if (!cdp) {
33642
+ try {
33643
+ cdp = await browser.newBrowserCDPSession();
33644
+ } catch {
33645
+ return;
33646
+ }
33647
+ }
33648
+ return cdp;
33649
+ };
33650
+ const pageTargets = async () => {
33651
+ const session = await browserSession();
33652
+ if (!session)
33653
+ return;
33654
+ try {
33655
+ return (await session.send("Target.getTargets"))?.targetInfos ?? [];
33656
+ } catch {
33657
+ return;
33658
+ }
33659
+ };
31546
33660
  const idOf = async (page) => {
31547
33661
  const known = ids.get(page);
31548
33662
  if (known)
@@ -31556,6 +33670,19 @@ async function connectBrowser(deps, options = {}) {
31556
33670
  await session.detach().catch(() => {});
31557
33671
  }
31558
33672
  };
33673
+ const observed = async () => {
33674
+ const all = pages();
33675
+ const urls = all.map((page) => page.url());
33676
+ const targets = await pageTargets();
33677
+ const { matched } = matchTargetsToPages(targets ?? [], urls);
33678
+ return all.map((page, index) => {
33679
+ const target = matched.get(index);
33680
+ if (target)
33681
+ ids.set(page, target.targetId);
33682
+ return { page, id: target?.targetId, url: target?.url ?? urls[index] ?? "", title: target?.title };
33683
+ });
33684
+ };
33685
+ const idOfObserved = async (tab) => tab.id ?? await bounded(idOf(tab.page), 2000).catch(() => "");
31559
33686
  const wrap = async (page) => {
31560
33687
  const id = await idOf(page);
31561
33688
  return {
@@ -31588,18 +33715,20 @@ async function connectBrowser(deps, options = {}) {
31588
33715
  }
31589
33716
  };
31590
33717
  };
31591
- const list = async () => Promise.all(pages().map(async (page) => ({
31592
- id: await idOf(page),
31593
- url: page.url(),
31594
- title: await bounded(page.title(), 2000).catch(() => ""),
31595
- active: await bounded(page.evaluate(() => document.visibilityState === "visible"), 2000).catch(() => false)
33718
+ const list = async () => Promise.all((await observed()).map(async (tab) => ({
33719
+ id: await idOfObserved(tab),
33720
+ url: tab.url,
33721
+ title: tab.title ?? await bounded(tab.page.title(), 2000).catch(() => ""),
33722
+ active: await bounded(tab.page.evaluate(() => document.visibilityState === "visible"), 2000).catch(() => false)
31596
33723
  })));
31597
33724
  const get = async (id) => {
31598
- for (const page of pages())
31599
- if (await idOf(page) === id) {
31600
- await page.bringToFront().catch(() => {});
31601
- return wrap(page);
33725
+ for (const tab of await observed()) {
33726
+ const known = await idOfObserved(tab);
33727
+ if (known === id && known) {
33728
+ await tab.page.bringToFront().catch(() => {});
33729
+ return wrap(tab.page);
31602
33730
  }
33731
+ }
31603
33732
  throw new PraxisError({ status: 404, code: "TAB_NOT_FOUND", message: `No tab with id ${id}; call browser.tabs.list() for the current tabs.` });
31604
33733
  };
31605
33734
  const create = async () => {
@@ -31625,6 +33754,8 @@ async function connectBrowser(deps, options = {}) {
31625
33754
  },
31626
33755
  documentation: () => BROWSER_DOCUMENTATION,
31627
33756
  disconnect: async () => {
33757
+ await cdp?.detach().catch(() => {});
33758
+ cdp = undefined;
31628
33759
  await browser.close();
31629
33760
  }
31630
33761
  };
@@ -31969,6 +34100,26 @@ async function prepareMultipart(op, opts) {
31969
34100
  opts.body = body;
31970
34101
  }
31971
34102
 
34103
+ // src/core/pagination.ts
34104
+ var PAGE_TOKENS = /^(page_?token|next_?page_?token)$/i;
34105
+ function pageTokenField(op) {
34106
+ return op.query.find((field) => PAGE_TOKENS.test(field.name));
34107
+ }
34108
+ function nextPageToken(result) {
34109
+ const value = result;
34110
+ const token = value?.next_page_token ?? value?.nextPageToken ?? value?.next_cursor;
34111
+ return typeof token === "string" && token ? token : undefined;
34112
+ }
34113
+ function pageOf(result) {
34114
+ const value = result;
34115
+ const arrays = value && typeof value === "object" ? Object.values(value).filter(Array.isArray) : [];
34116
+ const data = Array.isArray(value?.data) ? value.data : Array.isArray(value?.items) ? value.items : arrays.length === 1 ? arrays[0] : undefined;
34117
+ if (!Array.isArray(data))
34118
+ return;
34119
+ const token = nextPageToken(result);
34120
+ return { items: data, ...token ? { token } : {} };
34121
+ }
34122
+
31972
34123
  // src/core/bind-args.ts
31973
34124
  var globalOptions = [
31974
34125
  { name: "org", type: "string" },
@@ -32184,7 +34335,7 @@ function bindArgs(parsed, op, data) {
32184
34335
  (opts.query ??= {})[key] ??= convert(String(globals[name]), { name, type: field.type, enum: field.enum });
32185
34336
  }
32186
34337
  }
32187
- if (globals.all && !op.pagination)
34338
+ if (globals.all && !op.pagination && !pageTokenField(op))
32188
34339
  throw new UsageError("--all requires a paginated operation");
32189
34340
  for (const p of op.pathParams)
32190
34341
  if (p !== target && opts.path?.[p.sdkName] === undefined)
@@ -32210,8 +34361,8 @@ function bindArgs(parsed, op, data) {
32210
34361
  }
32211
34362
 
32212
34363
  // src/core/help.ts
32213
- function describeOption(s) {
32214
- return `--${s.name}${s.type === "boolean" ? " [true|false]" : ` <${s.type}>`}${s.repeated ? " (repeatable)" : ""}${s.required ? " (required)" : ""}${s.enum ? ` [${s.enum.join(" | ")}]` : ""}${s.description ? ` — ${s.description.replace(/\s+/g, " ")}` : ""}`;
34364
+ function describeOption(s, required = s.required) {
34365
+ return `--${s.name}${s.type === "boolean" ? " [true|false]" : ` <${s.type}>`}${s.repeated ? " (repeatable)" : ""}${required ? " (required)" : ""}${s.enum ? ` [${s.enum.join(" | ")}]` : ""}${s.description ? ` — ${s.description.replace(/\s+/g, " ")}` : ""}`;
32215
34366
  }
32216
34367
  function example(command) {
32217
34368
  const target = targetParam(command.op);
@@ -32227,18 +34378,22 @@ function example(command) {
32227
34378
  args.push("--yes");
32228
34379
  return args.join(" ");
32229
34380
  }
34381
+ function fieldRequired(op, field, location) {
34382
+ return Boolean(field.required) && (location === "path" || location === "query" || Boolean(op.body?.required));
34383
+ }
32230
34384
  function help(commands, prefix, command) {
32231
34385
  if (command) {
32232
34386
  const target = targetParam(command.op);
34387
+ const parents = operationOptions(command.op).filter((s) => s.location === "path" && s.required).map((s) => ` --${s.name} <${s.field?.name ?? s.sdkName}>`).join("");
32233
34388
  return [
32234
- `praxis ${command.words.join(" ")}${target ? ` <${target.sdkName}>` : ""} [options]`,
34389
+ `praxis ${command.words.join(" ")}${parents}${target ? ` <${target.sdkName}>` : ""} [options]`,
32235
34390
  `SDK: ${command.op.resource}.${command.alias ?? command.op.method}`,
32236
34391
  `${command.op.http} ${command.op.path}`,
32237
34392
  ...target ? [`Position: <${target.sdkName}>${target.type ? ` <${target.type}>` : ""} (required target ID)`] : [],
32238
34393
  "",
32239
34394
  "Options:",
32240
34395
  ...target?.description ? [` <${target.sdkName}> — ${target.description.replace(/\s+/g, " ")}`] : [],
32241
- ...[...operationOptions(command.op), ...bodyDataOption(command.op), ...globalOptions].map((s) => ` ${describeOption(s)}`),
34396
+ ...[...operationOptions(command.op), ...bodyDataOption(command.op), ...globalOptions].map((s) => ` ${describeOption(s, s.required && fieldRequired(command.op, s, s.location ?? "query"))}`),
32242
34397
  ...command.op.body?.fields.filter((f) => !operationOptions(command.op).some((s) => s.location === "body" && s.field === f) && (f.type === "object" || f.type === "array" && !["string", "number", "integer", "boolean"].includes(f.itemType ?? ""))).map((f) => ` --data: ${f.name} (${f.type}${f.required ? ", required" : ""})`) ?? [],
32243
34398
  " -h is an alias of --help",
32244
34399
  "PRAXIS_ENV=develop|production (default: develop); no --env option.",
@@ -32306,6 +34461,7 @@ var workflows = [
32306
34461
  { words: ["app", "create"], usage: "app create <name> [--dir <path>] [--template <dir>] [--no-install]", summary: "Create an application project from the standard template and install its dependencies.", example: "praxis app create my-app" },
32307
34462
  { words: ["app", "deploy"], usage: "app deploy [--dir <path>] [--no-build]", summary: "Build the project, publish it, create declared secrets, run the health check and print the URL.", example: "praxis app deploy --dir ./my-app" },
32308
34463
  { words: ["app", "rollback"], usage: "app rollback [--dir <path>] [--to <version_id>]", summary: "Deploy the previous version again (or --to a given version) and wait until it is active.", example: "praxis app rollback --to <version_id>" },
34464
+ { words: ["devops", "test", "run"], usage: "devops test run --remote [--project <dvp_…>] [--no-wait] [--repeat <n>] [--select <kind:value>]", summary: "Run the DevOps test selection for the pushed HEAD on the Praxis cloud, wait for the verdict and list the failed cases.", example: "praxis devops test run --remote --select smoke" },
32309
34465
  { words: ["skill"], usage: "skill [--install <dir>]", summary: "Print the AI skill, or write <dir>/praxis-cli/SKILL.md." }
32310
34466
  ];
32311
34467
  var workflowNouns = [...new Set(workflows.filter((w) => w.words.length > 1).map((w) => w.words[0]))];
@@ -32536,21 +34692,90 @@ function toStored(tokens, now, previous) {
32536
34692
  return { ...previous?.organization_id ? { organization_id: previous.organization_id } : {}, access_token: tokens.access_token, ...refresh ? { refresh_token: refresh } : {}, expires_at: now + (tokens.expires_in ?? 900) * 1000 };
32537
34693
  }
32538
34694
  var REFRESH_SKEW_MS = 30000;
32539
- async function refreshTokens(stored, accountUrl, fetchImpl, now) {
32540
- if (!stored.refresh_token)
32541
- return null;
32542
- const res = await fetchImpl(`${accountUrl}/api/auth/oauth2/token`, {
32543
- method: "POST",
32544
- headers: { "content-type": "application/x-www-form-urlencoded" },
32545
- body: new URLSearchParams({ grant_type: "refresh_token", refresh_token: stored.refresh_token, client_id: CLIENT_ID }).toString()
34695
+ var ATTEMPT_TIMEOUT_MS = 8000;
34696
+ var RETRY_DELAYS_MS = [1000, 3000];
34697
+ var RETRY_DEADLINE_MS = 20000;
34698
+ var REFRESH_UNKNOWN_SAFE_MS = 25000;
34699
+ var defaultSleep = (ms, signal) => new Promise((resolve) => {
34700
+ if (signal?.aborted) {
34701
+ resolve();
34702
+ return;
34703
+ }
34704
+ const timer = setTimeout(finish, ms);
34705
+ function finish() {
34706
+ clearTimeout(timer);
34707
+ signal?.removeEventListener("abort", finish);
34708
+ resolve();
34709
+ }
34710
+ signal?.addEventListener("abort", finish, { once: true });
34711
+ });
34712
+ var defaultSchedule = (ms, fire) => {
34713
+ const timer = setTimeout(fire, ms);
34714
+ return () => clearTimeout(timer);
34715
+ };
34716
+ var TRANSIENT_STATUSES = new Set([408, 425, 429]);
34717
+ async function attemptRefresh(stored, accountUrl, fetchImpl, now, schedule) {
34718
+ const controller = new AbortController;
34719
+ let timedOut = false;
34720
+ const cancel = schedule(ATTEMPT_TIMEOUT_MS, () => {
34721
+ timedOut = true;
34722
+ controller.abort();
32546
34723
  });
32547
- const body = await res.json().catch(() => ({}));
32548
- if (!res.ok || typeof body.access_token !== "string")
32549
- return null;
32550
- return toStored(body, now, stored);
34724
+ let response;
34725
+ try {
34726
+ response = await fetchImpl(`${accountUrl}/api/auth/oauth2/token`, {
34727
+ method: "POST",
34728
+ headers: { "content-type": "application/x-www-form-urlencoded" },
34729
+ body: new URLSearchParams({ grant_type: "refresh_token", refresh_token: stored.refresh_token, client_id: CLIENT_ID }).toString(),
34730
+ signal: controller.signal
34731
+ });
34732
+ } catch (error2) {
34733
+ const name = error2?.name;
34734
+ return { kind: "transient", reason: timedOut || name === "AbortError" || name === "TimeoutError" ? "timeout" : "network" };
34735
+ } finally {
34736
+ cancel();
34737
+ }
34738
+ let body;
34739
+ try {
34740
+ body = await response.json();
34741
+ } catch {
34742
+ return { kind: "transient", reason: response.ok ? "unparseable" : `http ${response.status}` };
34743
+ }
34744
+ const error = body.error;
34745
+ if (response.ok) {
34746
+ if (typeof body.access_token !== "string")
34747
+ return { kind: "transient", reason: "unparseable" };
34748
+ return { kind: "ok", tokens: toStored(body, now, stored) };
34749
+ }
34750
+ if (response.status === 400 && error === "invalid_grant")
34751
+ return { kind: "rejected" };
34752
+ if (response.status === 401)
34753
+ return { kind: "rejected" };
34754
+ if (response.status >= 500 || TRANSIENT_STATUSES.has(response.status))
34755
+ return { kind: "transient", reason: `http ${response.status}` };
34756
+ return { kind: "rejected" };
34757
+ }
34758
+ async function refreshWithRetry(stored, accountUrl, fetchImpl, now, sleep2, schedule) {
34759
+ const startedAt = now();
34760
+ let outcome = { kind: "transient", reason: "no attempt made" };
34761
+ for (let attempt = 0;attempt <= RETRY_DELAYS_MS.length; attempt += 1) {
34762
+ if (attempt > 0) {
34763
+ if (now() + RETRY_DELAYS_MS[attempt - 1] - startedAt > RETRY_DEADLINE_MS)
34764
+ break;
34765
+ await sleep2(RETRY_DELAYS_MS[attempt - 1]);
34766
+ }
34767
+ if (now() - startedAt > RETRY_DEADLINE_MS)
34768
+ break;
34769
+ outcome = await attemptRefresh(stored, accountUrl, fetchImpl, now(), schedule);
34770
+ if (outcome.kind !== "transient")
34771
+ return outcome;
34772
+ }
34773
+ return outcome;
32551
34774
  }
32552
34775
  async function currentAccessToken(options) {
32553
34776
  const now = options.now ?? Date.now;
34777
+ const sleep2 = options.sleep ?? defaultSleep;
34778
+ const schedule = options.schedule ?? defaultSchedule;
32554
34779
  const path = options.path ?? tokenPath(options.env);
32555
34780
  const fresh = (t) => t !== null && t.expires_at - REFRESH_SKEW_MS > now();
32556
34781
  const store = options.store ?? createTokenStore(options.env, path, options.secretStore);
@@ -32560,17 +34785,41 @@ async function currentAccessToken(options) {
32560
34785
  return null;
32561
34786
  if (fresh(current))
32562
34787
  return current.access_token;
32563
- const refreshed = await refreshTokens(current, options.accountUrl, options.fetch, now());
32564
- if (!refreshed)
34788
+ const unknownSince = current.rotation_unknown_since;
34789
+ if (unknownSince !== undefined && now() - unknownSince >= REFRESH_UNKNOWN_SAFE_MS) {
34790
+ await session.delete();
32565
34791
  return null;
32566
- await session.save(refreshed);
32567
- return refreshed.access_token;
34792
+ }
34793
+ const firstAttempt = now();
34794
+ await session.save({ ...current, rotation_unknown_since: unknownSince ?? firstAttempt });
34795
+ const outcome = await refreshWithRetry(current, options.accountUrl, options.fetch, () => now(), sleep2, schedule);
34796
+ switch (outcome.kind) {
34797
+ case "ok":
34798
+ await session.save(outcome.tokens);
34799
+ return outcome.tokens.access_token;
34800
+ case "rejected":
34801
+ await session.delete();
34802
+ return null;
34803
+ case "transient":
34804
+ throw new PraxisError({ code: "AUTH_REFRESH_UNAVAILABLE", message: `The token service is temporarily unavailable (${outcome.reason}); the login is kept, retry shortly.` });
34805
+ }
32568
34806
  });
32569
34807
  }
32570
- var LOCK_STALE_MS = 15000;
32571
- async function withLock(lockPath, run) {
34808
+ var REFRESH_MAX_HOLD_MS = RETRY_DEADLINE_MS + ATTEMPT_TIMEOUT_MS;
34809
+ var LOCK_STALE_MS = REFRESH_MAX_HOLD_MS + 1e4;
34810
+ function isLockStale(ageMs, waitedMs) {
34811
+ return ageMs > LOCK_STALE_MS || waitedMs > LOCK_STALE_MS;
34812
+ }
34813
+ var fileLockAge = (lockPath) => Date.now() - statSync(lockPath).mtimeMs;
34814
+ async function withLock(lockPath, run, ports = {}) {
34815
+ const now = ports.now ?? Date.now;
34816
+ const wait = ports.wait ?? ((ms) => new Promise((resolve) => {
34817
+ setTimeout(resolve, ms);
34818
+ }));
34819
+ const lockAge = ports.lockAge ?? fileLockAge;
32572
34820
  mkdirSync(join(lockPath, ".."), { recursive: true, mode: 448 });
32573
- for (let waited = 0;; waited += 50) {
34821
+ const startedAt = now();
34822
+ for (;; ) {
32574
34823
  try {
32575
34824
  closeSync(openSync(lockPath, "wx", 384));
32576
34825
  break;
@@ -32579,15 +34828,15 @@ async function withLock(lockPath, run) {
32579
34828
  throw error;
32580
34829
  let age = 0;
32581
34830
  try {
32582
- age = Date.now() - statSync(lockPath).mtimeMs;
34831
+ age = lockAge(lockPath);
32583
34832
  } catch {
32584
34833
  continue;
32585
34834
  }
32586
- if (age > LOCK_STALE_MS || waited > LOCK_STALE_MS) {
34835
+ if (isLockStale(age, now() - startedAt)) {
32587
34836
  rmSync(lockPath, { force: true });
32588
34837
  continue;
32589
34838
  }
32590
- await new Promise((resolve) => setTimeout(resolve, 50));
34839
+ await wait(50);
32591
34840
  }
32592
34841
  }
32593
34842
  try {
@@ -32653,7 +34902,7 @@ function credentials(config, vars, ports) {
32653
34902
  if (stored.refresh_token)
32654
34903
  remember(stored.refresh_token);
32655
34904
  }
32656
- const opaque = await currentAccessToken({ env: config.env, accountUrl: config.accountUrl, path, store, now: ports.now, fetch: (url, init) => ports.fetch(url, { ...init, signal: AbortSignal.timeout(1e4), redirect: "error" }) });
34905
+ const opaque = await currentAccessToken({ env: config.env, accountUrl: config.accountUrl, path, store, now: ports.now, fetch: (url, init) => ports.fetch(url, { ...init, redirect: "error" }) });
32657
34906
  if (!opaque)
32658
34907
  throw new PraxisError({ code: "NOT_LOGGED_IN", message: "Not logged in or login has expired." });
32659
34908
  remember(opaque);
@@ -32762,7 +35011,18 @@ function skillDocument(commands) {
32762
35011
  "## Account and CLI",
32763
35012
  "",
32764
35013
  ...workflows.map((w) => `praxis ${w.usage} — ${w.summary.replace("Print the AI skill, or write", "Print this skill; use --install <dir> to write")}`),
32765
- "praxis api <METHOD> <path> — Call an API path directly. (--data for a request body)"
35014
+ "praxis api <METHOD> <path> — Call an API path directly. (--data for a request body)",
35015
+ "",
35016
+ "## devops test run (workflow)",
35017
+ "",
35018
+ "Run the project's tests at the commit HEAD is on, on the Praxis cloud executor, and wait for the verdict:",
35019
+ "",
35020
+ "- Only the pushed commit is tested. HEAD must be on a remote branch (`git push` first); this command never pushes for you. Uncommitted changes are a warning only — the working tree is not what runs.",
35021
+ "- The project comes from `--project dvp_…`, or from `devops.project` in the current directory's praxis.jsonc. Neither present is a usage error, exit code 2.",
35022
+ "- `--select` narrows the run: `tag:<tag>` (a bare word reads as a tag), `package:<path>`, `suite:<path>`, `file:<path>`. `--repeat N` runs each selected case N times (a flake then shows up as flaky, not as a failure).",
35023
+ "- The run waits by default and polls every 5s; `--no-wait` returns as soon as the run exists, with `result` still `pending`.",
35024
+ "- Exit code 0 means the verdict passed (or is still pending); 1 means failed, errored, cancelled or timed out — the failed cases are listed, up to 20, with the run URL for the rest; 2 is a usage error.",
35025
+ "- The run URL is on the Console of the environment the CLI talks to; the run id is also on stdout with `--json`."
32766
35026
  ];
32767
35027
  let domain;
32768
35028
  for (const command of commands) {
@@ -33308,6 +35568,191 @@ async function appRollback(args, client2, ports) {
33308
35568
  ports.emit({ kind: "object", data: { url: worker.subdomain?.url ?? null, worker_id: worker.id, from_version: from, to_version: to, deployment_id: done.id } });
33309
35569
  }
33310
35570
 
35571
+ // src/commands/devops.ts
35572
+ import { join as join4 } from "node:path";
35573
+
35574
+ // src/devops/pure.ts
35575
+ import { createHash as createHash2 } from "node:crypto";
35576
+ var PROJECT_ID = /^dvp_[a-z0-9]+$/;
35577
+ var POLL_MS = 5000;
35578
+ var FAILURE_LIMIT = 20;
35579
+ var hint = 'Pass --project dvp_…, or add "devops": { "project": "dvp_…" } to praxis.jsonc in the current directory.';
35580
+ function checkProject(value, hintText = hint) {
35581
+ if (typeof value !== "string" || !value.trim())
35582
+ throw new UsageError("A DevOps project id must be a non-empty string", hintText);
35583
+ if (!PROJECT_ID.test(value.trim()))
35584
+ throw new UsageError(`Not a DevOps project id: ${value}`, "A project id starts with dvp_ and comes from the project list. " + hintText);
35585
+ return value.trim();
35586
+ }
35587
+ function parseDevopsProject(value) {
35588
+ if (value === null || value === undefined || typeof value !== "object" || Array.isArray(value))
35589
+ return;
35590
+ const devops = value.devops;
35591
+ if (devops === undefined)
35592
+ return;
35593
+ if (devops === null || typeof devops !== "object" || Array.isArray(devops))
35594
+ throw new UsageError("praxis.jsonc devops must be an object", 'Write {"devops":{"project":"dvp_…"}}. ' + hint);
35595
+ const project = devops.project;
35596
+ if (project === undefined)
35597
+ return;
35598
+ return checkProject(project);
35599
+ }
35600
+ function resolveProject(flag, projectFile) {
35601
+ if (flag !== undefined)
35602
+ return checkProject(flag);
35603
+ const fromFile = parseDevopsProject(projectFile);
35604
+ if (fromFile !== undefined)
35605
+ return fromFile;
35606
+ throw new UsageError("No DevOps project named for this run", hint);
35607
+ }
35608
+ var sorted = (values) => [...values].sort();
35609
+ var SELECT_KINDS = { tag: "anyTags", package: "packages", suite: "packages", file: "packages" };
35610
+ function parseSelect(values) {
35611
+ if (!values.length)
35612
+ return;
35613
+ const tags = [], packages = [];
35614
+ for (const raw of values) {
35615
+ const at = raw.indexOf(":");
35616
+ const kind = at < 0 ? "tag" : raw.slice(0, at).trim().toLowerCase();
35617
+ const value = (at < 0 ? raw : raw.slice(at + 1)).trim();
35618
+ const kinds = Object.keys(SELECT_KINDS).join(", ");
35619
+ if (!value)
35620
+ throw new UsageError(`--select ${raw} names no value`, `Use --select <kind>:<value>, or a bare tag name; kinds are ${kinds}.`);
35621
+ if (!Object.hasOwn(SELECT_KINDS, kind))
35622
+ throw new UsageError(`--select ${raw}: unknown kind "${kind}"`, `Use one of: ${kinds}.`);
35623
+ (SELECT_KINDS[kind] === "anyTags" ? tags : packages).push(value);
35624
+ }
35625
+ return { ...tags.length ? { anyTags: sorted(tags) } : {}, ...packages.length ? { packages: sorted(packages) } : {} };
35626
+ }
35627
+ function parseRepeat(value) {
35628
+ if (value === undefined)
35629
+ return 1;
35630
+ const n = typeof value === "string" && value.trim() ? Number(value) : NaN;
35631
+ if (!Number.isSafeInteger(n) || n < 1)
35632
+ throw new UsageError("--repeat must be an integer of at least 1");
35633
+ return n;
35634
+ }
35635
+ function requireRemote(remote) {
35636
+ if (!remote)
35637
+ throw new UsageError("Only remote test runs are available", "Add --remote to run the selected cases on the Praxis cloud executor.");
35638
+ }
35639
+ function requestIdFor(input) {
35640
+ const selector = input.selector === undefined ? null : {
35641
+ sizes: sorted(input.selector.sizes ?? []),
35642
+ anyTags: sorted(input.selector.anyTags ?? []),
35643
+ packages: sorted(input.selector.packages ?? []),
35644
+ cases: sorted(input.selector.cases ?? [])
35645
+ };
35646
+ const material = JSON.stringify(["devops-test-run", input.project, input.commit, input.repeat, selector]);
35647
+ return `req_${createHash2("sha256").update(material).digest("hex").slice(0, 32)}`;
35648
+ }
35649
+ var isTerminal = (state) => state === "finished";
35650
+ function shortSha(commit) {
35651
+ return commit.slice(0, 7);
35652
+ }
35653
+ function headBranch(output) {
35654
+ const name = output.trim();
35655
+ return !name || name === "HEAD" ? undefined : name;
35656
+ }
35657
+ function requirePushed(remoteContains, commit, branch) {
35658
+ if (remoteContains.trim())
35659
+ return;
35660
+ throw new UsageError(`Commit ${shortSha(commit)}${branch ? ` on ${branch}` : ""} is not on any remote branch`, `Push it first (git push${branch ? ` origin ${branch}` : ""}); the run tests the pushed commit, and this command never pushes for you.`);
35661
+ }
35662
+ function dirtyNotice(status, commit) {
35663
+ const files = status.split(`
35664
+ `).filter((line) => line.trim()).length;
35665
+ if (files === 0)
35666
+ return;
35667
+ return `Warning: ${files} uncommitted change${files === 1 ? "" : "s"}; the run tests the pushed commit ${shortSha(commit)}, not this working tree.`;
35668
+ }
35669
+ function exitCodeFor(result) {
35670
+ return result === "passed" || result === "pending" ? 0 : 1;
35671
+ }
35672
+ var wantsFailures = (result) => result !== "passed" && result !== "pending";
35673
+ function failedList(items, nextPageToken2, url) {
35674
+ const shown = items.slice(0, FAILURE_LIMIT);
35675
+ if (items.length <= FAILURE_LIMIT && !nextPageToken2)
35676
+ return { shown };
35677
+ return { shown, hint: `Showing ${FAILURE_LIMIT} of the failed cases; the run page lists them all: ${url}` };
35678
+ }
35679
+ var CONSOLE = { develop: "https://console-develop.deepraxis.com", production: "https://console.deepraxis.com" };
35680
+ function runUrl(env, project, id, viewerUrl) {
35681
+ return viewerUrl?.trim() || `${CONSOLE[env]}/devops/projects/${project}/test-runs/${id}`;
35682
+ }
35683
+
35684
+ // src/commands/devops.ts
35685
+ async function projectFile(cwd, ports) {
35686
+ let text;
35687
+ try {
35688
+ text = await ports.readFile(join4(cwd, "praxis.jsonc"));
35689
+ } catch (error) {
35690
+ if (error.code === "ENOENT")
35691
+ return;
35692
+ throw error;
35693
+ }
35694
+ try {
35695
+ return parseJsonc(text);
35696
+ } catch (error) {
35697
+ throw new UsageError(`praxis.jsonc is not valid JSONC: ${error.message}`);
35698
+ }
35699
+ }
35700
+ var COUNT_ORDER = ["passed", "failed", "flaky", "skipped", "pending", "other"];
35701
+ var countLine = (counts) => COUNT_ORDER.filter((key) => counts?.[key]).map((key) => `${counts[key]} ${key}`).join(", ") || "no counts reported";
35702
+ async function devopsTestRun(args, connect, env, ports) {
35703
+ requireRemote(args.remote);
35704
+ const project = resolveProject(args.project, await projectFile(ports.cwd, ports));
35705
+ const selector = parseSelect(args.select ?? []);
35706
+ const repeat = parseRepeat(args.repeat);
35707
+ const git = async (gitArgs) => (await ports.git(gitArgs, ports.cwd)).output;
35708
+ const commit = (await git(["rev-parse", "HEAD"])).trim();
35709
+ if (!commit)
35710
+ throw new UsageError("git rev-parse HEAD answered no commit", "Run this command inside a git repository.");
35711
+ const branch = headBranch(await git(["rev-parse", "--abbrev-ref", "HEAD"]));
35712
+ requirePushed(await git(["branch", "-r", "--contains", "HEAD"]), commit, branch);
35713
+ const notice = dirtyNotice(await git(["status", "--porcelain"]), commit);
35714
+ if (notice)
35715
+ ports.emit({ kind: "message", channel: "stderr", text: notice });
35716
+ const client2 = await connect();
35717
+ const requestId = requestIdFor({ project, commit, selector, repeat });
35718
+ let run = await client2.devops.projects.testRuns.create({ path: { project }, body: { ref: { ...branch ? { branch } : {}, commit }, ...selector ? { selector } : {}, repeat, executor: "cloud", requestId } });
35719
+ while (args.wait && !isTerminal(run.state)) {
35720
+ await ports.wait(POLL_MS);
35721
+ run = await client2.devops.testRuns.retrieve({ path: { id: run.id } });
35722
+ }
35723
+ const url = runUrl(env, project, run.id, run.viewerUrl);
35724
+ let failures = [], failureHint;
35725
+ if (wantsFailures(run.result)) {
35726
+ const page = await client2.devops.testRuns.executions.list({ path: { run: run.id }, query: { pageSize: FAILURE_LIMIT, filter: "result=failed" } });
35727
+ ({ shown: failures, hint: failureHint } = failedList(page.items, page.nextPageToken, url));
35728
+ }
35729
+ const data = {
35730
+ id: run.id,
35731
+ url,
35732
+ project,
35733
+ state: run.state,
35734
+ result: run.result,
35735
+ repeat,
35736
+ commit,
35737
+ ...branch ? { branch } : {},
35738
+ selected: run.selection?.selectedCount ?? null,
35739
+ counts: run.counts ?? null,
35740
+ request_id: requestId,
35741
+ failures: failures.map((execution) => ({ case: execution.case, title: execution.title, package: execution.package ?? null, status: execution.status })),
35742
+ ...failureHint ? { failures_hint: failureHint } : {}
35743
+ };
35744
+ ports.emit({ kind: "object", data });
35745
+ ports.human([
35746
+ `${run.result} — ${project} @ ${commit.slice(0, 7)}${branch ? ` (${branch})` : ""}`,
35747
+ `state ${run.state}, ${countLine(run.counts)}`,
35748
+ url,
35749
+ ...failures.map((execution) => ` failed ${execution.title}`),
35750
+ ...failureHint ? [failureHint] : []
35751
+ ].join(`
35752
+ `));
35753
+ return exitCodeFor(run.result);
35754
+ }
35755
+
33311
35756
  // src/main.ts
33312
35757
  import { spawnSync } from "node:child_process";
33313
35758
 
@@ -33606,9 +36051,11 @@ function renderHuman(result, ctx) {
33606
36051
  const details = result.details !== undefined ? JSON.stringify(result.details) : undefined;
33607
36052
  const detailsLine = details !== undefined ? ` details ${details.length > 2000 ? details.slice(0, 1999) + "…" : details}
33608
36053
  ` : "";
36054
+ const problemLine = problemLines(result.problem).map((line) => ` ${plain(line)}
36055
+ `).join("");
33609
36056
  return { stderr: err.red(`✗ ${plain(result.message)}`) + `
33610
36057
  ` + err.dim(` code ${plain(result.code)}${result.status !== undefined ? ` · ${result.status}` : ""} · env ${plain(result.env)}${result.request_id ? ` · request ${plain(result.request_id)}` : ""}`) + `
33611
- ` + detailsLine + (result.hint ? ` → ${plain(result.hint)}
36058
+ ` + detailsLine + problemLine + (result.hint ? ` → ${plain(result.hint)}
33612
36059
  ` : "") };
33613
36060
  }
33614
36061
  case "list":
@@ -33696,8 +36143,33 @@ ${usage ? `usage: ${JSON.stringify(usage)}
33696
36143
  }
33697
36144
 
33698
36145
  // src/output/render.ts
36146
+ var PROBLEM_HINTS = ["hint", "errors", "violations", "title", "type"];
36147
+ function serverProblem(raw) {
36148
+ const value = record(raw);
36149
+ const problem = {};
36150
+ for (const member of ["code", "detail", ...PROBLEM_HINTS, "status"]) {
36151
+ const entry = value[member];
36152
+ if (entry !== undefined && entry !== null)
36153
+ problem[member] = entry;
36154
+ }
36155
+ const adds = PROBLEM_HINTS.some((member) => Array.isArray(problem[member]) ? problem[member].length > 0 : problem[member] !== undefined);
36156
+ return adds ? problem : undefined;
36157
+ }
36158
+ function problemLines(problem) {
36159
+ const lines = [];
36160
+ for (const group of [problem?.errors, problem?.violations]) {
36161
+ for (const item of Array.isArray(group) ? group : []) {
36162
+ const entry = record(item);
36163
+ const where = scalar(entry.pointer ?? entry.field);
36164
+ const detail = scalar(entry.detail ?? entry.message ?? entry.reason);
36165
+ if (where || detail)
36166
+ lines.push(`${where ? `${where}: ` : ""}${detail}`);
36167
+ }
36168
+ }
36169
+ return lines;
36170
+ }
33699
36171
  function errorJSON(result, ctx) {
33700
- return JSON.stringify({ error: { code: result.code, ...result.details !== undefined ? { details: result.details } : {}, message: result.message, hint: result.hint ?? null, env: result.env, command: ctx.command ?? null, status: result.status ?? null, request_id: result.request_id ?? null, ...result.credential_source ? { credential_source: result.credential_source } : {} } }) + `
36172
+ return JSON.stringify({ error: { code: result.code, ...result.details !== undefined ? { details: result.details } : {}, message: result.message, hint: result.hint ?? null, env: result.env, command: ctx.command ?? null, status: result.status ?? null, request_id: result.request_id ?? null, ...result.problem !== undefined ? { problem: result.problem } : {}, ...result.credential_source ? { credential_source: result.credential_source } : {} } }) + `
33701
36173
  `;
33702
36174
  }
33703
36175
  function render(result, ctx) {
@@ -33853,6 +36325,8 @@ function errorInput(error, ctx) {
33853
36325
  const raw = record(sdk?.raw), nested = record(raw.error);
33854
36326
  const candidate = nested.details ?? raw.details;
33855
36327
  const details = candidate !== null && typeof candidate === "object" && !Array.isArray(candidate) ? candidate : undefined;
36328
+ const problem = serverProblem(Object.keys(nested).length ? nested : raw);
36329
+ const serverText = (value) => typeof value === "string" && value.trim() ? value : undefined;
33856
36330
  let message = error instanceof Error ? error.message : "Unexpected error";
33857
36331
  const prefix = message.match(/^([A-Z][A-Z0-9_]+):\s*/)?.[1];
33858
36332
  const code = error instanceof UsageError ? error.code : businessCode(raw.code) ?? businessCode(nested.code) ?? businessCode(raw.error_code) ?? prefix ?? businessCode(sdk?.code) ?? (sdk?.status ? `HTTP_${sdk.status}` : sdk ? "API_ERROR" : "RUNTIME_ERROR");
@@ -33864,22 +36338,25 @@ function errorInput(error, ctx) {
33864
36338
  if (stripped)
33865
36339
  message = `${humanize(code)}${message ? `: ${message}` : ""}`;
33866
36340
  const status = sdk?.status, request_id = sdk?.requestId;
36341
+ message = serverText(problem?.detail) ?? serverText(problem?.title) ?? message;
33867
36342
  const authFailure = status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED"].includes(code);
33868
36343
  const source = ctx.credentialSource ?? "login";
33869
- let hint = genericHint;
36344
+ let hint2 = genericHint;
33870
36345
  if (error instanceof UsageError)
33871
- hint = error.hint;
36346
+ hint2 = error.hint;
36347
+ else if (serverText(problem?.hint))
36348
+ hint2 = serverText(problem?.hint);
33872
36349
  else if (authFailure)
33873
- hint = authHint(source);
36350
+ hint2 = authHint(source);
33874
36351
  else if (status === 404)
33875
- hint = ctx.listCommand ? `Check the id; list existing ones with \`${ctx.listCommand}\`` : "Check the id.";
36352
+ hint2 = ctx.listCommand ? `Check the id; list existing ones with \`${ctx.listCommand}\`` : "Check the id.";
33876
36353
  else if (status === 403)
33877
- hint = "Check that your account or API key has permission to access this resource.";
36354
+ hint2 = "Check that your account or API key has permission to access this resource.";
33878
36355
  else if (status === 429)
33879
- hint = "Rate limited; retry later.";
36356
+ hint2 = "Rate limited; retry later.";
33880
36357
  else if (status !== undefined && status >= 500)
33881
- hint = `Server error; retry later.${request_id ? ` Request id: ${request_id}.` : ""}`;
33882
- return { kind: "error", code, message, hint, ...details !== undefined ? { details } : {}, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
36358
+ hint2 = `Server error; retry later.${request_id ? ` Request id: ${request_id}.` : ""}`;
36359
+ return { kind: "error", code, message, hint: hint2, ...details !== undefined ? { details } : {}, ...problem !== undefined ? { problem } : {}, env: ctx.env, ...authFailure ? { credential_source: source } : {}, ...status !== undefined ? { status } : {}, ...request_id ? { request_id } : {} };
33883
36360
  }
33884
36361
 
33885
36362
  // src/output/progress.ts
@@ -33909,7 +36386,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
33909
36386
  }
33910
36387
 
33911
36388
  // src/main.ts
33912
- var version = "0.2.1-dev.fcdebee";
36389
+ var version = "0.2.2-dev.3987a02";
33913
36390
  var commands = commandTree(operations);
33914
36391
  var manual = [...workflows.map((w) => w.words), [API_WORD]];
33915
36392
  function route(argv) {
@@ -33994,7 +36471,14 @@ var defaults = {
33994
36471
  var appOptions = {
33995
36472
  "app create": [{ name: "dir", type: "string", description: "Directory to create the project in (default: ./<name>)." }, { name: "template", type: "string", description: "Copy a local template directory instead of downloading the standard template." }, { name: "no-install", type: "boolean", description: "Skip installing dependencies." }],
33996
36473
  "app deploy": [{ name: "dir", type: "string", description: "Project directory (default: the nearest parent containing praxis.jsonc)." }, { name: "no-build", type: "boolean", description: "Publish the existing dist/ output without building." }],
33997
- "app rollback": [{ name: "dir", type: "string", description: "Project directory (default: the nearest parent containing praxis.jsonc)." }, { name: "to", type: "string", description: "Version id to deploy (default: the previous version)." }]
36474
+ "app rollback": [{ name: "dir", type: "string", description: "Project directory (default: the nearest parent containing praxis.jsonc)." }, { name: "to", type: "string", description: "Version id to deploy (default: the previous version)." }],
36475
+ "devops test run": [
36476
+ { name: "project", type: "string", description: "DevOps project id (dvp_…); default: the devops.project field of praxis.jsonc in the current directory." },
36477
+ { name: "remote", type: "boolean", description: "Run the cases on the Praxis cloud executor. Required; local execution does not exist yet." },
36478
+ { name: "no-wait", type: "boolean", description: "Return as soon as the run exists instead of waiting for a verdict." },
36479
+ { name: "repeat", type: "string", description: "How many times each selected case runs (default: 1)." },
36480
+ { name: "select", type: "string", repeated: true, description: "Narrow the selection; repeatable. tag:<tag> (a bare word reads as a tag), package:<path>, suite:<path> or file:<path>." }
36481
+ ]
33998
36482
  };
33999
36483
  async function main(argv, injected = {}) {
34000
36484
  const ports = { ...defaults, ...injected };
@@ -34127,7 +36611,7 @@ Examples:
34127
36611
  let owner = client2;
34128
36612
  for (const part of op.resource.split("."))
34129
36613
  owner = owner[part];
34130
- const result = await owner[op.method](opts);
36614
+ let result = await owner[op.method](opts);
34131
36615
  const name2 = `${op.resource}.${op.method}`;
34132
36616
  const list = (items) => {
34133
36617
  const view = clientList(items, op, flags.limit, ctx.mode);
@@ -34141,7 +36625,21 @@ Examples:
34141
36625
  const cursor = result instanceof Page ? result.next_cursor : record(result).next_cursor ?? record(result).nextToken;
34142
36626
  if (typeof cursor === "string" && cursor)
34143
36627
  ctx.nextCommand = nextPageCommand(selected.command, parsed, cursor);
34144
- if (result instanceof Page) {
36628
+ const pageToken = pageTokenField(op), token = pageToken?.sdkName ?? pageToken?.name;
36629
+ const firstPage = flags.all && !(result instanceof Page) && token ? pageOf(result) : undefined;
36630
+ if (flags.all && !(result instanceof Page) && token && !firstPage)
36631
+ throw new UsageError(`--all cannot find the list in ${op.resource}.${op.method}'s response; page with --${token.replace(/_/g, "-")} instead`);
36632
+ if (firstPage) {
36633
+ const items = [...firstPage.items];
36634
+ const seen = new Set;
36635
+ for (let next = firstPage.token;next && !seen.has(next); next = pageOf(result)?.token) {
36636
+ seen.add(next);
36637
+ result = await owner[op.method]({ ...opts, query: { ...opts.query, [token]: next } });
36638
+ items.push(...pageOf(result)?.items ?? []);
36639
+ }
36640
+ ctx.nextCommand = undefined;
36641
+ emit({ kind: "list", ...list(items), ...ctx.mode === "json" ? { raw: { data: items, next_page_token: null } } : {}, nextCursor: null, op: name2 });
36642
+ } else if (result instanceof Page) {
34145
36643
  if (flags.all) {
34146
36644
  const items = [];
34147
36645
  for await (const item of result)
@@ -34215,6 +36713,26 @@ Examples:
34215
36713
  await appRollback({ dir, to: parsed.flags.to?.[0] }, client2, appPorts);
34216
36714
  break;
34217
36715
  }
36716
+ case "devops test run": {
36717
+ return await devopsTestRun({
36718
+ project: parsed.flags.project?.[0],
36719
+ remote: Boolean(parsed.flags.remote),
36720
+ wait: !parsed.flags["no-wait"],
36721
+ repeat: parsed.flags.repeat?.[0],
36722
+ select: parsed.flags.select
36723
+ }, async () => await auth.client(org), config.env, {
36724
+ git: (args, cwd) => ports.spawnCapture("git", args, { cwd }),
36725
+ readFile: ports.readFile,
36726
+ wait: ports.wait,
36727
+ mode: ctx.mode,
36728
+ emit,
36729
+ human: (text) => {
36730
+ if (ctx.mode === "human")
36731
+ emit({ kind: "message", channel: "stdout", text });
36732
+ },
36733
+ cwd: ports.cwd
36734
+ });
36735
+ }
34218
36736
  case "api": {
34219
36737
  const method = parsed.positional[0];
34220
36738
  if (!HTTP_METHOD.test(method))
@@ -34237,7 +36755,7 @@ Examples:
34237
36755
  }
34238
36756
  }
34239
36757
  if (true)
34240
- process.exit(await main(process.argv.slice(2)));
36758
+ process.exitCode = await main(process.argv.slice(2));
34241
36759
  export {
34242
36760
  main
34243
36761
  };