codai-sdk 0.65.0 → 0.66.0
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/index.d.ts +373 -5
- package/dist/index.js +58 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2549,7 +2549,7 @@ type paths$1 = {
|
|
|
2549
2549
|
};
|
|
2550
2550
|
/**
|
|
2551
2551
|
* List pending prompts
|
|
2552
|
-
* @description Your prompts, soonest `not_before` first (prompts without one lead), then newest. `status=due` returns open prompts whose `not_before` is empty or already passed; `all` returns every status.
|
|
2552
|
+
* @description Your prompts, soonest `not_before` first (prompts without one lead), then newest. `status=due` returns open prompts whose `not_before` is empty or already passed; `all` returns every status. Optional filters, combined with AND, are `tag`, `priority_min`, `q` and `templates` (templates are hidden by default); `sort` + `order` change the order.
|
|
2553
2553
|
*/
|
|
2554
2554
|
readonly get: operations$1['listPrompts'];
|
|
2555
2555
|
readonly put?: never;
|
|
@@ -2592,6 +2592,49 @@ type paths$1 = {
|
|
|
2592
2592
|
readonly patch: operations$1['updatePrompt'];
|
|
2593
2593
|
readonly trace?: never;
|
|
2594
2594
|
};
|
|
2595
|
+
readonly '/v1/prompts/{id}/events': {
|
|
2596
|
+
readonly parameters: {
|
|
2597
|
+
readonly query?: never;
|
|
2598
|
+
readonly header?: never;
|
|
2599
|
+
readonly path?: never;
|
|
2600
|
+
readonly cookie?: never;
|
|
2601
|
+
};
|
|
2602
|
+
/**
|
|
2603
|
+
* Prompt history
|
|
2604
|
+
* @description What happened to the prompt, newest first (at most 200 events): created, edited (with the changed keys),
|
|
2605
|
+
* status changes, launches, recurrences, chain steps and verifications.
|
|
2606
|
+
*/
|
|
2607
|
+
readonly get: operations$1['listPromptEvents'];
|
|
2608
|
+
readonly put?: never;
|
|
2609
|
+
readonly post?: never;
|
|
2610
|
+
readonly delete?: never;
|
|
2611
|
+
readonly options?: never;
|
|
2612
|
+
readonly head?: never;
|
|
2613
|
+
readonly patch?: never;
|
|
2614
|
+
readonly trace?: never;
|
|
2615
|
+
};
|
|
2616
|
+
readonly '/v1/prompts/{id}/instantiate': {
|
|
2617
|
+
readonly parameters: {
|
|
2618
|
+
readonly query?: never;
|
|
2619
|
+
readonly header?: never;
|
|
2620
|
+
readonly path?: never;
|
|
2621
|
+
readonly cookie?: never;
|
|
2622
|
+
};
|
|
2623
|
+
readonly get?: never;
|
|
2624
|
+
readonly put?: never;
|
|
2625
|
+
/**
|
|
2626
|
+
* Create a prompt from a template
|
|
2627
|
+
* @description Creates a new `open` copy of the prompt (usually a template, `is_template: true`) with the same text, tags,
|
|
2628
|
+
* priority, recurrence, chain and launch preset; the copy is never a template and records the source in
|
|
2629
|
+
* `origin.template_id`. Works on any of your prompts.
|
|
2630
|
+
*/
|
|
2631
|
+
readonly post: operations$1['instantiatePrompt'];
|
|
2632
|
+
readonly delete?: never;
|
|
2633
|
+
readonly options?: never;
|
|
2634
|
+
readonly head?: never;
|
|
2635
|
+
readonly patch?: never;
|
|
2636
|
+
readonly trace?: never;
|
|
2637
|
+
};
|
|
2595
2638
|
readonly '/v1/prompts/{id}/launch': {
|
|
2596
2639
|
readonly parameters: {
|
|
2597
2640
|
readonly query?: never;
|
|
@@ -2657,6 +2700,53 @@ type paths$1 = {
|
|
|
2657
2700
|
readonly patch?: never;
|
|
2658
2701
|
readonly trace?: never;
|
|
2659
2702
|
};
|
|
2703
|
+
readonly '/v1/prompts/bulk': {
|
|
2704
|
+
readonly parameters: {
|
|
2705
|
+
readonly query?: never;
|
|
2706
|
+
readonly header?: never;
|
|
2707
|
+
readonly path?: never;
|
|
2708
|
+
readonly cookie?: never;
|
|
2709
|
+
};
|
|
2710
|
+
readonly get?: never;
|
|
2711
|
+
readonly put?: never;
|
|
2712
|
+
/**
|
|
2713
|
+
* Apply one action to many prompts
|
|
2714
|
+
* @description Applies `action` to up to 200 of your prompts: `done` / `dismiss` close them (stamping `done_at`),
|
|
2715
|
+
* `delete` removes them, `snooze` sets `not_before` and re-arms the due reminder, `tag` / `untag` add or
|
|
2716
|
+
* remove `tags`, `priority` sets `priority`. Ids that are not yours are ignored. `done` also advances each
|
|
2717
|
+
* prompt's `next_prompt_id` chain. Every change is published on the prompt stream and logged in the history.
|
|
2718
|
+
*/
|
|
2719
|
+
readonly post: operations$1['bulkPrompts'];
|
|
2720
|
+
readonly delete?: never;
|
|
2721
|
+
readonly options?: never;
|
|
2722
|
+
readonly head?: never;
|
|
2723
|
+
readonly patch?: never;
|
|
2724
|
+
readonly trace?: never;
|
|
2725
|
+
};
|
|
2726
|
+
readonly '/v1/prompts/export': {
|
|
2727
|
+
readonly parameters: {
|
|
2728
|
+
readonly query?: never;
|
|
2729
|
+
readonly header?: never;
|
|
2730
|
+
readonly path?: never;
|
|
2731
|
+
readonly cookie?: never;
|
|
2732
|
+
};
|
|
2733
|
+
/**
|
|
2734
|
+
* Export prompts as CSV or Markdown
|
|
2735
|
+
* @description Downloads your prompts with the same filters as `GET /v1/prompts` (but `status` defaults to `all`, up to
|
|
2736
|
+
* 5 000 rows). `format=csv` is RFC 4180 CSV (CRLF line breaks) with the columns `title, status, priority, tags,
|
|
2737
|
+
* source, repo, created_at, not_before, prompt` (tags space-separated); `format=md` is one Markdown section per
|
|
2738
|
+
* prompt with its metadata and the prompt text in a code fence. Sent as an attachment
|
|
2739
|
+
* (`prompts-YYYY-MM-DD.csv` / `.md`).
|
|
2740
|
+
*/
|
|
2741
|
+
readonly get: operations$1['exportPrompts'];
|
|
2742
|
+
readonly put?: never;
|
|
2743
|
+
readonly post?: never;
|
|
2744
|
+
readonly delete?: never;
|
|
2745
|
+
readonly options?: never;
|
|
2746
|
+
readonly head?: never;
|
|
2747
|
+
readonly patch?: never;
|
|
2748
|
+
readonly trace?: never;
|
|
2749
|
+
};
|
|
2660
2750
|
readonly '/v1/prompts/stream': {
|
|
2661
2751
|
readonly parameters: {
|
|
2662
2752
|
readonly query?: never;
|
|
@@ -3725,6 +3815,8 @@ type paths$1 = {
|
|
|
3725
3815
|
* only knows the server id, opens the session. Set `e2e: true` when payloads are
|
|
3726
3816
|
* end-to-end encrypted client-side (`payload: { hide: base64 }`); the server never
|
|
3727
3817
|
* inspects payloads either way.
|
|
3818
|
+
* With `stub: true` the session is a title-only mirror (listed, but no events yet) until the executor
|
|
3819
|
+
* appends its first events; viewers ask for the transcript with a `hydrate` control.
|
|
3728
3820
|
*/
|
|
3729
3821
|
readonly post: operations$1['createSession'];
|
|
3730
3822
|
readonly delete?: never;
|
|
@@ -3795,6 +3887,7 @@ type paths$1 = {
|
|
|
3795
3887
|
* (`payload: { control: {...}, applied: false }`, `client_event_id: control:<id>`) and
|
|
3796
3888
|
* pushed to subscribers as a `control` frame, then answered `202`. This endpoint has
|
|
3797
3889
|
* no device target — use `POST …/dispatch` to aim a `send` at one device and wake it.
|
|
3890
|
+
* `send`, `hydrate`, `answer`, `approve` and `deny` are accepted only from the session owner.
|
|
3798
3891
|
*/
|
|
3799
3892
|
readonly post: operations$1['submitSessionControl'];
|
|
3800
3893
|
readonly delete?: never;
|
|
@@ -12952,6 +13045,10 @@ type components$1 = {
|
|
|
12952
13045
|
readonly head_sha: string | null;
|
|
12953
13046
|
/** Format: uuid */
|
|
12954
13047
|
readonly id: string;
|
|
13048
|
+
/** @description Template prompts are hidden from the default list and never notified or auto-run. */
|
|
13049
|
+
readonly is_template: boolean;
|
|
13050
|
+
/** @description Launch preset, or `null`. */
|
|
13051
|
+
readonly launch: components$1['schemas']['PromptLaunchConfig'] | null;
|
|
12955
13052
|
/** Format: date-time */
|
|
12956
13053
|
readonly launched_at: string | null;
|
|
12957
13054
|
/** @description Session id or key the prompt was sent in. */
|
|
@@ -12960,6 +13057,11 @@ type components$1 = {
|
|
|
12960
13057
|
readonly match_score: number | null;
|
|
12961
13058
|
/** @description Turn id of that chat turn. */
|
|
12962
13059
|
readonly match_turn_id: string | null;
|
|
13060
|
+
/**
|
|
13061
|
+
* Format: uuid
|
|
13062
|
+
* @description Prompt opened when this one becomes `done`.
|
|
13063
|
+
*/
|
|
13064
|
+
readonly next_prompt_id: string | null;
|
|
12963
13065
|
/**
|
|
12964
13066
|
* Format: date-time
|
|
12965
13067
|
* @description The prompt is due from this moment on.
|
|
@@ -12973,7 +13075,11 @@ type components$1 = {
|
|
|
12973
13075
|
readonly origin: {
|
|
12974
13076
|
readonly [key: string]: unknown;
|
|
12975
13077
|
};
|
|
13078
|
+
/** @description 0 none, 1 low, 2 normal, 3 high. */
|
|
13079
|
+
readonly priority: number;
|
|
12976
13080
|
readonly prompt: string;
|
|
13081
|
+
/** @description Repeat rule, or `null`. */
|
|
13082
|
+
readonly recurrence: components$1['schemas']['PromptRecurrence'] | null;
|
|
12977
13083
|
readonly repo: string | null;
|
|
12978
13084
|
/** @description Last verification report, or `null`. */
|
|
12979
13085
|
readonly report: components$1['schemas']['PromptReport'] | null;
|
|
@@ -12991,6 +13097,8 @@ type components$1 = {
|
|
|
12991
13097
|
readonly sent_at: string | null;
|
|
12992
13098
|
readonly source: components$1['schemas']['PromptSource'];
|
|
12993
13099
|
readonly status: components$1['schemas']['PromptStatus'];
|
|
13100
|
+
/** @description Lowercased, deduplicated tags (max 20). */
|
|
13101
|
+
readonly tags: readonly string[];
|
|
12994
13102
|
/** Format: uuid */
|
|
12995
13103
|
readonly target_device_id: string | null;
|
|
12996
13104
|
/** @description Defaults to the first line of the prompt (max 120 chars). */
|
|
@@ -13004,6 +13112,17 @@ type components$1 = {
|
|
|
13004
13112
|
*/
|
|
13005
13113
|
readonly verified_at: string | null;
|
|
13006
13114
|
};
|
|
13115
|
+
readonly PromptBulkRequest: {
|
|
13116
|
+
/** @enum {string} */
|
|
13117
|
+
readonly action: 'done' | 'dismiss' | 'delete' | 'snooze' | 'tag' | 'untag' | 'priority';
|
|
13118
|
+
readonly ids: readonly string[];
|
|
13119
|
+
/** @description Required for `snooze`: ISO datetime with offset, or `YYYY-MM-DD` (07:00 UTC). */
|
|
13120
|
+
readonly not_before?: string;
|
|
13121
|
+
/** @description Required for `priority`. */
|
|
13122
|
+
readonly priority?: number;
|
|
13123
|
+
/** @description Required (non-empty) for `tag` / `untag`. */
|
|
13124
|
+
readonly tags?: readonly string[];
|
|
13125
|
+
};
|
|
13007
13126
|
readonly PromptCreate: {
|
|
13008
13127
|
/**
|
|
13009
13128
|
* @description Launch automatically when due.
|
|
@@ -13012,15 +13131,30 @@ type components$1 = {
|
|
|
13012
13131
|
readonly auto_run?: boolean;
|
|
13013
13132
|
/** @description Stable key of the goal; a new prompt supersedes older open ones with the same key. */
|
|
13014
13133
|
readonly goal_key?: string;
|
|
13134
|
+
/** @description A template is hidden from the default list, never notified or auto-run; use `POST /v1/prompts/{id}/instantiate`. */
|
|
13135
|
+
readonly is_template?: boolean;
|
|
13136
|
+
/** @description Launch preset, or `null`. */
|
|
13137
|
+
readonly launch?: components$1['schemas']['PromptLaunchConfig'] | null;
|
|
13138
|
+
/**
|
|
13139
|
+
* Format: uuid
|
|
13140
|
+
* @description One of your prompts to open when this one becomes `done` (a template is instantiated instead). Cannot be the prompt itself.
|
|
13141
|
+
*/
|
|
13142
|
+
readonly next_prompt_id?: string | null;
|
|
13015
13143
|
/** @description ISO datetime with offset, or `YYYY-MM-DD` (07:00 UTC). `null` = due immediately. */
|
|
13016
13144
|
readonly not_before?: string | null;
|
|
13017
13145
|
/** @description Free-form capture metadata (session, transcript, host). */
|
|
13018
13146
|
readonly origin?: {
|
|
13019
13147
|
readonly [key: string]: unknown;
|
|
13020
13148
|
};
|
|
13149
|
+
/** @description 0 none, 1 low, 2 normal, 3 high. */
|
|
13150
|
+
readonly priority?: number;
|
|
13021
13151
|
readonly prompt: string;
|
|
13152
|
+
/** @description Repeat rule, or `null` for none. */
|
|
13153
|
+
readonly recurrence?: components$1['schemas']['PromptRecurrence'] | null;
|
|
13022
13154
|
readonly repo?: string;
|
|
13023
13155
|
readonly source?: components$1['schemas']['PromptSource'];
|
|
13156
|
+
/** @description Tags; trimmed, lowercased and deduplicated. */
|
|
13157
|
+
readonly tags?: readonly string[];
|
|
13024
13158
|
/** Format: uuid */
|
|
13025
13159
|
readonly target_device_id?: string | null;
|
|
13026
13160
|
readonly title?: string;
|
|
@@ -13032,17 +13166,66 @@ type components$1 = {
|
|
|
13032
13166
|
/** @description Older open prompts with the same `goal_key` now `superseded`. */
|
|
13033
13167
|
readonly superseded: number;
|
|
13034
13168
|
};
|
|
13169
|
+
/** @description One history entry of a prompt. */
|
|
13170
|
+
readonly PromptEvent: {
|
|
13171
|
+
/** Format: date-time */
|
|
13172
|
+
readonly created_at: string;
|
|
13173
|
+
/** @description Kind-specific details (e.g. `from` / `to` for status, `keys` for edits). */
|
|
13174
|
+
readonly detail: {
|
|
13175
|
+
readonly [key: string]: unknown;
|
|
13176
|
+
};
|
|
13177
|
+
/** @enum {string} */
|
|
13178
|
+
readonly kind: 'created' | 'edited' | 'status' | 'launched' | 'recurred' | 'chained' | 'verified';
|
|
13179
|
+
};
|
|
13180
|
+
/** @description Preset used when the prompt is launched. */
|
|
13181
|
+
readonly PromptLaunchConfig: {
|
|
13182
|
+
/** @description Agent to run it with. */
|
|
13183
|
+
readonly agent?: string;
|
|
13184
|
+
/** @description Working folder. */
|
|
13185
|
+
readonly folder?: string;
|
|
13186
|
+
/** @description Model to use. */
|
|
13187
|
+
readonly model?: string;
|
|
13188
|
+
};
|
|
13035
13189
|
readonly PromptPatch: {
|
|
13036
13190
|
readonly auto_run?: boolean;
|
|
13191
|
+
/** @description A template is hidden from the default list, never notified or auto-run; use `POST /v1/prompts/{id}/instantiate`. */
|
|
13192
|
+
readonly is_template?: boolean;
|
|
13193
|
+
/** @description Launch preset, or `null`. */
|
|
13194
|
+
readonly launch?: components$1['schemas']['PromptLaunchConfig'] | null;
|
|
13195
|
+
/**
|
|
13196
|
+
* Format: uuid
|
|
13197
|
+
* @description One of your prompts to open when this one becomes `done` (a template is instantiated instead). Cannot be the prompt itself.
|
|
13198
|
+
*/
|
|
13199
|
+
readonly next_prompt_id?: string | null;
|
|
13037
13200
|
/** @description ISO datetime with offset, or `YYYY-MM-DD` (07:00 UTC). `null` = due immediately. */
|
|
13038
13201
|
readonly not_before?: string | null;
|
|
13202
|
+
/** @description 0 none, 1 low, 2 normal, 3 high. */
|
|
13203
|
+
readonly priority?: number;
|
|
13039
13204
|
readonly prompt?: string;
|
|
13205
|
+
/** @description Repeat rule, or `null` for none. */
|
|
13206
|
+
readonly recurrence?: components$1['schemas']['PromptRecurrence'] | null;
|
|
13040
13207
|
readonly status?: components$1['schemas']['PromptStatus'];
|
|
13208
|
+
/** @description Tags; trimmed, lowercased and deduplicated. */
|
|
13209
|
+
readonly tags?: readonly string[];
|
|
13041
13210
|
/** Format: uuid */
|
|
13042
13211
|
readonly target_device_id?: string | null;
|
|
13043
13212
|
readonly title?: string;
|
|
13044
13213
|
readonly tracker?: string | null;
|
|
13045
13214
|
};
|
|
13215
|
+
/**
|
|
13216
|
+
* @description `{ every: day | week | month, at?: HH:MM }` (UTC): once the prompt left `open`, its next occurrence is created
|
|
13217
|
+
* as a new `open` prompt due at the next slot (months keep the day, clamped to the month end).
|
|
13218
|
+
* `{ on: session_end }`: the prompt is reopened when the session it ran in (or was captured from) ends a turn.
|
|
13219
|
+
*/
|
|
13220
|
+
readonly PromptRecurrence: {
|
|
13221
|
+
/** @description Time of day, HH:MM UTC. */
|
|
13222
|
+
readonly at?: string;
|
|
13223
|
+
/** @enum {string} */
|
|
13224
|
+
readonly every: 'day' | 'week' | 'month';
|
|
13225
|
+
} | {
|
|
13226
|
+
/** @enum {string} */
|
|
13227
|
+
readonly on: 'session_end';
|
|
13228
|
+
};
|
|
13046
13229
|
/** @description LLM verification report of a prompt. */
|
|
13047
13230
|
readonly PromptReport: {
|
|
13048
13231
|
/** Format: date-time */
|
|
@@ -13921,6 +14104,8 @@ type components$1 = {
|
|
|
13921
14104
|
* @example desktop-2026-09-23-main
|
|
13922
14105
|
*/
|
|
13923
14106
|
readonly session_key: string;
|
|
14107
|
+
/** @description Title-only mirror without events yet; cleared by the first appended event batch. */
|
|
14108
|
+
readonly stub: boolean;
|
|
13924
14109
|
readonly title: string | null;
|
|
13925
14110
|
};
|
|
13926
14111
|
/** SessionControl */
|
|
@@ -13957,10 +14142,10 @@ type components$1 = {
|
|
|
13957
14142
|
readonly seq: number | null;
|
|
13958
14143
|
};
|
|
13959
14144
|
/**
|
|
13960
|
-
* @description Kind of control a non-executor can send to the executor.
|
|
14145
|
+
* @description Kind of control a non-executor can send to the executor. `hydrate` asks the executor to upload the transcript of a stub session (session owner only, like `send`).
|
|
13961
14146
|
* @enum {string}
|
|
13962
14147
|
*/
|
|
13963
|
-
readonly SessionControlKind: 'send' | 'answer' | 'approve' | 'deny' | 'cancel' | 'steer' | 'inject' | 'pause' | 'resume';
|
|
14148
|
+
readonly SessionControlKind: 'send' | 'answer' | 'approve' | 'deny' | 'cancel' | 'steer' | 'inject' | 'pause' | 'resume' | 'hydrate';
|
|
13964
14149
|
readonly SessionControlRequest: {
|
|
13965
14150
|
/** @description Id of the question being answered / approved / denied. */
|
|
13966
14151
|
readonly ask_id?: string;
|
|
@@ -13985,6 +14170,11 @@ type components$1 = {
|
|
|
13985
14170
|
* @example desktop-2026-09-23-main
|
|
13986
14171
|
*/
|
|
13987
14172
|
readonly session_key?: string;
|
|
14173
|
+
/**
|
|
14174
|
+
* @description Create a title-only stub (no events yet); viewers request the transcript with a `hydrate` control.
|
|
14175
|
+
* @default false
|
|
14176
|
+
*/
|
|
14177
|
+
readonly stub?: boolean;
|
|
13988
14178
|
readonly title?: string;
|
|
13989
14179
|
};
|
|
13990
14180
|
readonly SessionDetail: components$1['schemas']['Session'] & {
|
|
@@ -22518,8 +22708,20 @@ interface operations$1 {
|
|
|
22518
22708
|
readonly query?: {
|
|
22519
22709
|
/** @description Maximum rows (1–200). */
|
|
22520
22710
|
readonly limit?: number;
|
|
22711
|
+
/** @description Sort direction. Default `desc`, except `asc` for `sort=not_before` (empty dates last). */
|
|
22712
|
+
readonly order?: 'asc' | 'desc';
|
|
22713
|
+
/** @description Only prompts with `priority` at least this value (0–3). */
|
|
22714
|
+
readonly priority_min?: number;
|
|
22715
|
+
/** @description Case-insensitive text search in the title, the prompt text and `origin.session_title`. */
|
|
22716
|
+
readonly q?: string;
|
|
22717
|
+
/** @description Sort key. Without it: soonest `not_before` first (prompts without one lead), then newest. */
|
|
22718
|
+
readonly sort?: 'created' | 'updated' | 'priority' | 'not_before';
|
|
22521
22719
|
/** @description Filter: a prompt status, `active` (open, launched, sent or answered), `due` or `all`. */
|
|
22522
22720
|
readonly status?: 'open' | 'due' | 'all' | 'launched' | 'done' | 'dismissed' | 'superseded' | 'active' | 'sent' | 'answered' | 'verified';
|
|
22721
|
+
/** @description Tag filter, repeatable or a comma list; every tag must be present (AND). Matched lowercased. */
|
|
22722
|
+
readonly tag?: readonly string[];
|
|
22723
|
+
/** @description `exclude` (default) hides templates, `only` returns just templates. */
|
|
22724
|
+
readonly templates?: 'only' | 'exclude';
|
|
22523
22725
|
};
|
|
22524
22726
|
readonly header?: {
|
|
22525
22727
|
/** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
|
|
@@ -22678,6 +22880,66 @@ interface operations$1 {
|
|
|
22678
22880
|
readonly 404: components$1['responses']['NotFound'];
|
|
22679
22881
|
};
|
|
22680
22882
|
};
|
|
22883
|
+
readonly listPromptEvents: {
|
|
22884
|
+
readonly parameters: {
|
|
22885
|
+
readonly query?: never;
|
|
22886
|
+
readonly header?: {
|
|
22887
|
+
/** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
|
|
22888
|
+
readonly 'x-request-id'?: components$1['parameters']['RequestId'];
|
|
22889
|
+
};
|
|
22890
|
+
readonly path: {
|
|
22891
|
+
/** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
|
|
22892
|
+
readonly id: string;
|
|
22893
|
+
};
|
|
22894
|
+
readonly cookie?: never;
|
|
22895
|
+
};
|
|
22896
|
+
readonly requestBody?: never;
|
|
22897
|
+
readonly responses: {
|
|
22898
|
+
/** @description The history events. */
|
|
22899
|
+
readonly 200: {
|
|
22900
|
+
headers: {
|
|
22901
|
+
readonly [name: string]: unknown;
|
|
22902
|
+
};
|
|
22903
|
+
content: {
|
|
22904
|
+
readonly 'application/json': {
|
|
22905
|
+
readonly events: readonly components$1['schemas']['PromptEvent'][];
|
|
22906
|
+
};
|
|
22907
|
+
};
|
|
22908
|
+
};
|
|
22909
|
+
readonly 401: components$1['responses']['Unauthorized'];
|
|
22910
|
+
readonly 402: components$1['responses']['PaymentRequired'];
|
|
22911
|
+
readonly 404: components$1['responses']['NotFound'];
|
|
22912
|
+
};
|
|
22913
|
+
};
|
|
22914
|
+
readonly instantiatePrompt: {
|
|
22915
|
+
readonly parameters: {
|
|
22916
|
+
readonly query?: never;
|
|
22917
|
+
readonly header?: {
|
|
22918
|
+
/** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
|
|
22919
|
+
readonly 'x-request-id'?: components$1['parameters']['RequestId'];
|
|
22920
|
+
};
|
|
22921
|
+
readonly path: {
|
|
22922
|
+
/** @description Pending prompt id (uuid). A foreign or malformed id is 404. */
|
|
22923
|
+
readonly id: string;
|
|
22924
|
+
};
|
|
22925
|
+
readonly cookie?: never;
|
|
22926
|
+
};
|
|
22927
|
+
readonly requestBody?: never;
|
|
22928
|
+
readonly responses: {
|
|
22929
|
+
/** @description The new prompt. */
|
|
22930
|
+
readonly 201: {
|
|
22931
|
+
headers: {
|
|
22932
|
+
readonly [name: string]: unknown;
|
|
22933
|
+
};
|
|
22934
|
+
content: {
|
|
22935
|
+
readonly 'application/json': components$1['schemas']['Prompt'];
|
|
22936
|
+
};
|
|
22937
|
+
};
|
|
22938
|
+
readonly 401: components$1['responses']['Unauthorized'];
|
|
22939
|
+
readonly 402: components$1['responses']['PaymentRequired'];
|
|
22940
|
+
readonly 404: components$1['responses']['NotFound'];
|
|
22941
|
+
};
|
|
22942
|
+
};
|
|
22681
22943
|
readonly launchPrompt: {
|
|
22682
22944
|
readonly parameters: {
|
|
22683
22945
|
readonly query?: never;
|
|
@@ -22834,6 +23096,84 @@ interface operations$1 {
|
|
|
22834
23096
|
};
|
|
22835
23097
|
};
|
|
22836
23098
|
};
|
|
23099
|
+
readonly bulkPrompts: {
|
|
23100
|
+
readonly parameters: {
|
|
23101
|
+
readonly query?: never;
|
|
23102
|
+
readonly header?: {
|
|
23103
|
+
/** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
|
|
23104
|
+
readonly 'x-request-id'?: components$1['parameters']['RequestId'];
|
|
23105
|
+
};
|
|
23106
|
+
readonly path?: never;
|
|
23107
|
+
readonly cookie?: never;
|
|
23108
|
+
};
|
|
23109
|
+
readonly requestBody: {
|
|
23110
|
+
readonly content: {
|
|
23111
|
+
readonly 'application/json': components$1['schemas']['PromptBulkRequest'];
|
|
23112
|
+
};
|
|
23113
|
+
};
|
|
23114
|
+
readonly responses: {
|
|
23115
|
+
/** @description How many prompts were changed (or deleted). */
|
|
23116
|
+
readonly 200: {
|
|
23117
|
+
headers: {
|
|
23118
|
+
readonly [name: string]: unknown;
|
|
23119
|
+
};
|
|
23120
|
+
content: {
|
|
23121
|
+
readonly 'application/json': {
|
|
23122
|
+
readonly updated: number;
|
|
23123
|
+
};
|
|
23124
|
+
};
|
|
23125
|
+
};
|
|
23126
|
+
readonly 400: components$1['responses']['BadRequest'];
|
|
23127
|
+
readonly 401: components$1['responses']['Unauthorized'];
|
|
23128
|
+
readonly 402: components$1['responses']['PaymentRequired'];
|
|
23129
|
+
};
|
|
23130
|
+
};
|
|
23131
|
+
readonly exportPrompts: {
|
|
23132
|
+
readonly parameters: {
|
|
23133
|
+
readonly query?: {
|
|
23134
|
+
/** @description Output format. */
|
|
23135
|
+
readonly format?: 'csv' | 'md';
|
|
23136
|
+
/** @description Maximum rows (1–5000). */
|
|
23137
|
+
readonly limit?: number;
|
|
23138
|
+
/** @description Sort direction. Default `desc`, except `asc` for `sort=not_before` (empty dates last). */
|
|
23139
|
+
readonly order?: 'asc' | 'desc';
|
|
23140
|
+
/** @description Only prompts with `priority` at least this value (0–3). */
|
|
23141
|
+
readonly priority_min?: number;
|
|
23142
|
+
/** @description Case-insensitive text search in the title, the prompt text and `origin.session_title`. */
|
|
23143
|
+
readonly q?: string;
|
|
23144
|
+
/** @description Sort key. Without it: soonest `not_before` first (prompts without one lead), then newest. */
|
|
23145
|
+
readonly sort?: 'created' | 'updated' | 'priority' | 'not_before';
|
|
23146
|
+
/** @description Same values as for the list; default `all`. */
|
|
23147
|
+
readonly status?: 'open' | 'due' | 'all' | 'launched' | 'done' | 'dismissed' | 'superseded' | 'active' | 'sent' | 'answered' | 'verified';
|
|
23148
|
+
/** @description Tag filter, repeatable or a comma list; every tag must be present (AND). Matched lowercased. */
|
|
23149
|
+
readonly tag?: readonly string[];
|
|
23150
|
+
/** @description `exclude` (default) hides templates, `only` returns just templates. */
|
|
23151
|
+
readonly templates?: 'only' | 'exclude';
|
|
23152
|
+
};
|
|
23153
|
+
readonly header?: {
|
|
23154
|
+
/** @description Client correlation id; echoed back as `x-codai-trace-id` and persisted on the usage row. */
|
|
23155
|
+
readonly 'x-request-id'?: components$1['parameters']['RequestId'];
|
|
23156
|
+
};
|
|
23157
|
+
readonly path?: never;
|
|
23158
|
+
readonly cookie?: never;
|
|
23159
|
+
};
|
|
23160
|
+
readonly requestBody?: never;
|
|
23161
|
+
readonly responses: {
|
|
23162
|
+
/** @description The export file. */
|
|
23163
|
+
readonly 200: {
|
|
23164
|
+
headers: {
|
|
23165
|
+
readonly [name: string]: unknown;
|
|
23166
|
+
};
|
|
23167
|
+
content: {
|
|
23168
|
+
readonly 'text/csv': string;
|
|
23169
|
+
readonly 'text/markdown': string;
|
|
23170
|
+
};
|
|
23171
|
+
};
|
|
23172
|
+
readonly 400: components$1['responses']['BadRequest'];
|
|
23173
|
+
readonly 401: components$1['responses']['Unauthorized'];
|
|
23174
|
+
readonly 402: components$1['responses']['PaymentRequired'];
|
|
23175
|
+
};
|
|
23176
|
+
};
|
|
22837
23177
|
readonly streamPrompts: {
|
|
22838
23178
|
readonly parameters: {
|
|
22839
23179
|
readonly query?: never;
|
|
@@ -36857,11 +37197,21 @@ export declare class Notifications {
|
|
|
36857
37197
|
}
|
|
36858
37198
|
//#endregion
|
|
36859
37199
|
//#region src/resources/prompts.d.ts
|
|
37200
|
+
/** PR-07 recurrence: repeat every day/week/month (at HH:MM UTC), or reopen when the run session ends. */
|
|
37201
|
+
export type PromptRecurrence = Mutable<Schema<'PromptRecurrence'>>;
|
|
37202
|
+
/** PR-07 launch preset applied when the prompt is started. */
|
|
37203
|
+
export type PromptLaunchConfig = Mutable<Schema<'PromptLaunchConfig'>>;
|
|
36860
37204
|
export type Prompt = Schema<'Prompt'>;
|
|
37205
|
+
/** PR-04 / PR-07 organise fields (present on every prompt row). */
|
|
37206
|
+
export type PromptOrganizeFields = Pick<Prompt, 'tags' | 'priority' | 'recurrence' | 'next_prompt_id' | 'launch' | 'is_template'>;
|
|
36861
37207
|
export type PromptStatus = Schema<'PromptStatus'>;
|
|
36862
37208
|
export type PromptSource = Schema<'PromptSource'>;
|
|
36863
37209
|
export type PromptList = Reply<'listPrompts'>;
|
|
36864
|
-
export
|
|
37210
|
+
/** PR-04 list / export filters; `tag` also accepts one string (a single tag or a comma list). AND semantics. */
|
|
37211
|
+
export type PromptListFilters = Omit<Mutable<QueryOf<'listPrompts'>>, 'tag' | 'status' | 'limit'> & {
|
|
37212
|
+
tag?: string | string[];
|
|
37213
|
+
};
|
|
37214
|
+
export type PromptListQuery = Omit<Mutable<QueryOf<'listPrompts'>>, 'tag'> & PromptListFilters;
|
|
36865
37215
|
export type PromptCreateRequest = Mutable<Body<'createPrompt'>>;
|
|
36866
37216
|
export type PromptCreated = Reply<'createPrompt'>;
|
|
36867
37217
|
export type PromptPatch = Mutable<Body<'updatePrompt'>>;
|
|
@@ -36874,6 +37224,13 @@ export type PromptVerifyRequest = Mutable<Body<'verifyPrompt'>>;
|
|
|
36874
37224
|
export type PromptVerified = Reply<'verifyPrompt'>;
|
|
36875
37225
|
export type PromptVerifyManyRequest = Mutable<Body<'verifyPrompts'>>;
|
|
36876
37226
|
export type PromptVerifyManyResult = Reply<'verifyPrompts'>;
|
|
37227
|
+
/** PR-05 `POST /v1/prompts/bulk`. */
|
|
37228
|
+
export type PromptBulkRequest = Mutable<Body<'bulkPrompts'>>;
|
|
37229
|
+
export type PromptBulkResult = Reply<'bulkPrompts'>;
|
|
37230
|
+
export type PromptHistoryEvent = Schema<'PromptEvent'>;
|
|
37231
|
+
export type PromptEventKind = PromptHistoryEvent['kind'];
|
|
37232
|
+
export type PromptEventList = Reply<'listPromptEvents'>;
|
|
37233
|
+
export type PromptExportQuery = Omit<Mutable<QueryOf<'exportPrompts'>>, 'tag'> & PromptListFilters;
|
|
36877
37234
|
/** One `event: prompt` frame of `GET /v1/prompts/stream`. */
|
|
36878
37235
|
export interface PromptStreamEvent {
|
|
36879
37236
|
op: 'upsert' | 'delete';
|
|
@@ -36889,7 +37246,10 @@ type CallOpts$10 = {
|
|
|
36889
37246
|
export declare class Prompts {
|
|
36890
37247
|
private readonly http;
|
|
36891
37248
|
constructor(http: HttpClient);
|
|
36892
|
-
/**
|
|
37249
|
+
/**
|
|
37250
|
+
* `GET /v1/prompts?status=&limit=&tag=&priority_min=&q=&templates=&sort=&order=` — default `open`, templates
|
|
37251
|
+
* excluded; `due` = open and `not_before` empty or passed; several tags = AND.
|
|
37252
|
+
*/
|
|
36893
37253
|
list(query?: PromptListQuery, opts?: CallOpts$10): Promise<PromptList>;
|
|
36894
37254
|
/** `POST /v1/prompts` — idempotent on the text (`created: false` for a duplicate); `goal_key` supersedes older open ones. */
|
|
36895
37255
|
create(body: PromptCreateRequest, opts?: CallOpts$10): Promise<PromptCreated>;
|
|
@@ -36910,6 +37270,14 @@ export declare class Prompts {
|
|
|
36910
37270
|
verify(id: string, body?: PromptVerifyRequest, opts?: CallOpts$10): Promise<PromptVerified>;
|
|
36911
37271
|
/** `POST /v1/prompts/verify` — transcript-only verification of up to 20 prompts, sequentially. */
|
|
36912
37272
|
verifyMany(body: PromptVerifyManyRequest, opts?: CallOpts$10): Promise<PromptVerifyManyResult>;
|
|
37273
|
+
/** `POST /v1/prompts/bulk` — one action over up to 200 of your prompts → `{ updated }`. */
|
|
37274
|
+
bulk(body: PromptBulkRequest, opts?: CallOpts$10): Promise<PromptBulkResult>;
|
|
37275
|
+
/** `GET /v1/prompts/{id}/events` — history, newest first (max 200). */
|
|
37276
|
+
events(id: string, opts?: CallOpts$10): Promise<PromptEventList>;
|
|
37277
|
+
/** `POST /v1/prompts/{id}/instantiate` — open copy of a template (201). */
|
|
37278
|
+
instantiate(id: string, opts?: CallOpts$10): Promise<Prompt>;
|
|
37279
|
+
/** `GET /v1/prompts/export?format=csv|md` — list filters apply (status defaults to `all`); returns the document text. */
|
|
37280
|
+
exportPrompts(query?: PromptExportQuery, opts?: CallOpts$10): Promise<string>;
|
|
36913
37281
|
/** `GET /v1/prompts/stream` — live `prompt` events (keepalive comments are skipped). Closed by the server after 6 h. */
|
|
36914
37282
|
stream(opts?: CallOpts$10): AsyncGenerator<PromptStreamEvent, void, undefined>;
|
|
36915
37283
|
}
|
package/dist/index.js
CHANGED
|
@@ -4743,18 +4743,31 @@ var Notifications = class {
|
|
|
4743
4743
|
//#region src/resources/prompts.ts
|
|
4744
4744
|
/** `/v1/prompts/*` — pending prompts: ready-to-paste prompts left for a future chat (handoffs, follow-ups). */
|
|
4745
4745
|
const one$3 = (id, suffix = "") => `/v1/prompts/${encodeURIComponent(id)}${suffix}`;
|
|
4746
|
+
function filterQuery(q) {
|
|
4747
|
+
const tag = Array.isArray(q.tag) ? q.tag.join(",") : q.tag;
|
|
4748
|
+
return {
|
|
4749
|
+
status: q.status,
|
|
4750
|
+
limit: q.limit,
|
|
4751
|
+
tag: tag || void 0,
|
|
4752
|
+
priority_min: q.priority_min,
|
|
4753
|
+
q: q.q,
|
|
4754
|
+
templates: q.templates,
|
|
4755
|
+
sort: q.sort,
|
|
4756
|
+
order: q.order
|
|
4757
|
+
};
|
|
4758
|
+
}
|
|
4746
4759
|
var Prompts = class {
|
|
4747
4760
|
http;
|
|
4748
4761
|
constructor(http) {
|
|
4749
4762
|
this.http = http;
|
|
4750
4763
|
}
|
|
4751
|
-
/**
|
|
4764
|
+
/**
|
|
4765
|
+
* `GET /v1/prompts?status=&limit=&tag=&priority_min=&q=&templates=&sort=&order=` — default `open`, templates
|
|
4766
|
+
* excluded; `due` = open and `not_before` empty or passed; several tags = AND.
|
|
4767
|
+
*/
|
|
4752
4768
|
list(query = {}, opts = {}) {
|
|
4753
4769
|
return this.http.json("/v1/prompts", {
|
|
4754
|
-
query:
|
|
4755
|
-
status: query.status,
|
|
4756
|
-
limit: query.limit
|
|
4757
|
-
},
|
|
4770
|
+
query: filterQuery(query),
|
|
4758
4771
|
ext: opts.ext,
|
|
4759
4772
|
signal: opts.signal
|
|
4760
4773
|
});
|
|
@@ -4834,6 +4847,42 @@ var Prompts = class {
|
|
|
4834
4847
|
noRetry: true
|
|
4835
4848
|
});
|
|
4836
4849
|
}
|
|
4850
|
+
/** `POST /v1/prompts/bulk` — one action over up to 200 of your prompts → `{ updated }`. */
|
|
4851
|
+
bulk(body, opts = {}) {
|
|
4852
|
+
return this.http.json("/v1/prompts/bulk", {
|
|
4853
|
+
method: "POST",
|
|
4854
|
+
body,
|
|
4855
|
+
ext: opts.ext,
|
|
4856
|
+
signal: opts.signal
|
|
4857
|
+
});
|
|
4858
|
+
}
|
|
4859
|
+
/** `GET /v1/prompts/{id}/events` — history, newest first (max 200). */
|
|
4860
|
+
events(id, opts = {}) {
|
|
4861
|
+
return this.http.json(one$3(id, "/events"), {
|
|
4862
|
+
ext: opts.ext,
|
|
4863
|
+
signal: opts.signal
|
|
4864
|
+
});
|
|
4865
|
+
}
|
|
4866
|
+
/** `POST /v1/prompts/{id}/instantiate` — open copy of a template (201). */
|
|
4867
|
+
instantiate(id, opts = {}) {
|
|
4868
|
+
return this.http.json(one$3(id, "/instantiate"), {
|
|
4869
|
+
method: "POST",
|
|
4870
|
+
ext: opts.ext,
|
|
4871
|
+
signal: opts.signal,
|
|
4872
|
+
noRetry: true
|
|
4873
|
+
});
|
|
4874
|
+
}
|
|
4875
|
+
/** `GET /v1/prompts/export?format=csv|md` — list filters apply (status defaults to `all`); returns the document text. */
|
|
4876
|
+
async exportPrompts(query = {}, opts = {}) {
|
|
4877
|
+
return (await this.http.request("/v1/prompts/export", {
|
|
4878
|
+
query: {
|
|
4879
|
+
...filterQuery(query),
|
|
4880
|
+
format: query.format ?? "csv"
|
|
4881
|
+
},
|
|
4882
|
+
ext: opts.ext,
|
|
4883
|
+
signal: opts.signal
|
|
4884
|
+
})).text();
|
|
4885
|
+
}
|
|
4837
4886
|
/** `GET /v1/prompts/stream` — live `prompt` events (keepalive comments are skipped). Closed by the server after 6 h. */
|
|
4838
4887
|
async *stream(opts = {}) {
|
|
4839
4888
|
const frames = this.http.sse("/v1/prompts/stream", {
|
|
@@ -6399,6 +6448,10 @@ const OPERATION_METHODS = {
|
|
|
6399
6448
|
verifyPrompt: "prompts.verify",
|
|
6400
6449
|
verifyPrompts: "prompts.verifyMany",
|
|
6401
6450
|
streamPrompts: "prompts.stream",
|
|
6451
|
+
exportPrompts: "prompts.exportPrompts",
|
|
6452
|
+
bulkPrompts: "prompts.bulk",
|
|
6453
|
+
listPromptEvents: "prompts.events",
|
|
6454
|
+
instantiatePrompt: "prompts.instantiate",
|
|
6402
6455
|
listTranscripts: "transcripts.list",
|
|
6403
6456
|
createTranscript: "transcripts.create",
|
|
6404
6457
|
getTranscriptUsage: "transcripts.usage",
|