@cubos/agent-sdk 0.0.1151166 → 0.0.1152175
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/admin/agents.d.ts +19 -19
- package/dist/admin/ai-providers.d.ts +10 -10
- package/dist/admin/channels.d.ts +24 -0
- package/dist/admin/client-tools.d.ts +2 -2
- package/dist/admin/conversations.d.ts +42 -36
- package/dist/admin/cost-metrics.d.ts +61 -0
- package/dist/admin/global.d.ts +5 -5
- package/dist/admin/index.d.ts +3 -0
- package/dist/admin/knowledge-bases.d.ts +3 -3
- package/dist/admin/task-templates.d.ts +6 -6
- package/dist/admin/users.d.ts +2 -2
- package/dist/generated/schema.d.ts +720 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.js +51 -12
- package/dist/index.js.map +8 -7
- package/dist/mapping.d.ts +3 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/admin/agents.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
29
29
|
created_at: string;
|
|
30
30
|
description: string;
|
|
31
31
|
display_name: string;
|
|
32
|
-
embedding_model:
|
|
32
|
+
embedding_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
33
33
|
embedding_model_dimensions: number | null;
|
|
34
34
|
error_fallback_message: string | null;
|
|
35
35
|
feature_code_execution: boolean;
|
|
@@ -44,7 +44,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
44
44
|
feature_workspace?: boolean;
|
|
45
45
|
filesystem_shared_prefixes: string[];
|
|
46
46
|
filesystem_ttl_turns: number | null;
|
|
47
|
-
guardrail_model:
|
|
47
|
+
guardrail_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
48
48
|
guardrail_prompt: string | null;
|
|
49
49
|
guardrail_reasoning_level: string | null;
|
|
50
50
|
id: string;
|
|
@@ -52,16 +52,16 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
52
52
|
max_messages_per_turn: number;
|
|
53
53
|
max_turns: number;
|
|
54
54
|
model: import("../generated/schema.js").components["schemas"]["AiProviderModel"];
|
|
55
|
-
nap_model:
|
|
55
|
+
nap_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
56
56
|
nap_reasoning_level: string | null;
|
|
57
57
|
onboarding_md: string;
|
|
58
58
|
reasoning_level: string | null;
|
|
59
59
|
slug: string;
|
|
60
60
|
soul_md: string;
|
|
61
|
-
stt_model:
|
|
61
|
+
stt_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
62
62
|
updated_at: string;
|
|
63
|
-
vision_model:
|
|
64
|
-
websearch_model:
|
|
63
|
+
vision_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
64
|
+
websearch_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
65
65
|
workspace_ttl_turns: number | null;
|
|
66
66
|
}>;
|
|
67
67
|
create: (input: Schemas["CreateAgentInput"]) => Promise<{
|
|
@@ -74,7 +74,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
74
74
|
created_at: string;
|
|
75
75
|
description: string;
|
|
76
76
|
display_name: string;
|
|
77
|
-
embedding_model:
|
|
77
|
+
embedding_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
78
78
|
embedding_model_dimensions: number | null;
|
|
79
79
|
error_fallback_message: string | null;
|
|
80
80
|
feature_code_execution: boolean;
|
|
@@ -89,7 +89,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
89
89
|
feature_workspace?: boolean;
|
|
90
90
|
filesystem_shared_prefixes: string[];
|
|
91
91
|
filesystem_ttl_turns: number | null;
|
|
92
|
-
guardrail_model:
|
|
92
|
+
guardrail_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
93
93
|
guardrail_prompt: string | null;
|
|
94
94
|
guardrail_reasoning_level: string | null;
|
|
95
95
|
id: string;
|
|
@@ -97,16 +97,16 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
97
97
|
max_messages_per_turn: number;
|
|
98
98
|
max_turns: number;
|
|
99
99
|
model: import("../generated/schema.js").components["schemas"]["AiProviderModel"];
|
|
100
|
-
nap_model:
|
|
100
|
+
nap_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
101
101
|
nap_reasoning_level: string | null;
|
|
102
102
|
onboarding_md: string;
|
|
103
103
|
reasoning_level: string | null;
|
|
104
104
|
slug: string;
|
|
105
105
|
soul_md: string;
|
|
106
|
-
stt_model:
|
|
106
|
+
stt_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
107
107
|
updated_at: string;
|
|
108
|
-
vision_model:
|
|
109
|
-
websearch_model:
|
|
108
|
+
vision_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
109
|
+
websearch_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
110
110
|
workspace_ttl_turns: number | null;
|
|
111
111
|
}>;
|
|
112
112
|
update: (currentSlug: string, input: Schemas["UpdateAgentInput"]) => Promise<{
|
|
@@ -119,7 +119,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
119
119
|
created_at: string;
|
|
120
120
|
description: string;
|
|
121
121
|
display_name: string;
|
|
122
|
-
embedding_model:
|
|
122
|
+
embedding_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
123
123
|
embedding_model_dimensions: number | null;
|
|
124
124
|
error_fallback_message: string | null;
|
|
125
125
|
feature_code_execution: boolean;
|
|
@@ -134,7 +134,7 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
134
134
|
feature_workspace?: boolean;
|
|
135
135
|
filesystem_shared_prefixes: string[];
|
|
136
136
|
filesystem_ttl_turns: number | null;
|
|
137
|
-
guardrail_model:
|
|
137
|
+
guardrail_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
138
138
|
guardrail_prompt: string | null;
|
|
139
139
|
guardrail_reasoning_level: string | null;
|
|
140
140
|
id: string;
|
|
@@ -142,21 +142,21 @@ export declare function agentsApi(t: Transport, tenantSlug: string): {
|
|
|
142
142
|
max_messages_per_turn: number;
|
|
143
143
|
max_turns: number;
|
|
144
144
|
model: import("../generated/schema.js").components["schemas"]["AiProviderModel"];
|
|
145
|
-
nap_model:
|
|
145
|
+
nap_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
146
146
|
nap_reasoning_level: string | null;
|
|
147
147
|
onboarding_md: string;
|
|
148
148
|
reasoning_level: string | null;
|
|
149
149
|
slug: string;
|
|
150
150
|
soul_md: string;
|
|
151
|
-
stt_model:
|
|
151
|
+
stt_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
152
152
|
updated_at: string;
|
|
153
|
-
vision_model:
|
|
154
|
-
websearch_model:
|
|
153
|
+
vision_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
154
|
+
websearch_model: import("../generated/schema.js").components["schemas"]["AiProviderModel"] | null;
|
|
155
155
|
workspace_ttl_turns: number | null;
|
|
156
156
|
}>;
|
|
157
157
|
delete: (slug: string) => Promise<void>;
|
|
158
158
|
countTokens: (slug: string, input: Schemas["DraftAgentConfig"], signal?: AbortSignal) => Promise<{
|
|
159
|
-
breakdown:
|
|
159
|
+
breakdown: import("../generated/schema.js").components["schemas"]["Breakdown"] | null;
|
|
160
160
|
context_window_tokens: number | null;
|
|
161
161
|
contributions: {
|
|
162
162
|
[key: string]: number;
|
|
@@ -29,8 +29,8 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
29
29
|
plugin: string;
|
|
30
30
|
shared: boolean;
|
|
31
31
|
slug: string;
|
|
32
|
-
|
|
33
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
32
|
+
token_sku_classes: {
|
|
33
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
34
34
|
};
|
|
35
35
|
type: string;
|
|
36
36
|
}[]>;
|
|
@@ -49,8 +49,8 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
49
49
|
plugin: string;
|
|
50
50
|
shared: boolean;
|
|
51
51
|
slug: string;
|
|
52
|
-
|
|
53
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
52
|
+
token_sku_classes: {
|
|
53
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
54
54
|
};
|
|
55
55
|
type: string;
|
|
56
56
|
}>;
|
|
@@ -69,8 +69,8 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
69
69
|
plugin: string;
|
|
70
70
|
shared: boolean;
|
|
71
71
|
slug: string;
|
|
72
|
-
|
|
73
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
72
|
+
token_sku_classes: {
|
|
73
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
74
74
|
};
|
|
75
75
|
type: string;
|
|
76
76
|
}>;
|
|
@@ -89,8 +89,8 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
89
89
|
plugin: string;
|
|
90
90
|
shared: boolean;
|
|
91
91
|
slug: string;
|
|
92
|
-
|
|
93
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
92
|
+
token_sku_classes: {
|
|
93
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
94
94
|
};
|
|
95
95
|
type: string;
|
|
96
96
|
}>;
|
|
@@ -119,7 +119,7 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
119
119
|
[key: string]: number;
|
|
120
120
|
};
|
|
121
121
|
pricing_skus: import("../generated/schema.js").components["schemas"]["SkuDisplayDto"][];
|
|
122
|
-
reasoning_options:
|
|
122
|
+
reasoning_options: import("../generated/schema.js").components["schemas"]["ReasoningOptions"] | null;
|
|
123
123
|
}[]>;
|
|
124
124
|
/** Re-probes the upstream catalog. 409 while another reconcile is running. */
|
|
125
125
|
refreshModels: (slug: string) => Promise<{
|
|
@@ -146,7 +146,7 @@ export declare function aiProvidersApi(t: Transport, tenantSlug: string): {
|
|
|
146
146
|
[key: string]: number;
|
|
147
147
|
};
|
|
148
148
|
pricing_skus: import("../generated/schema.js").components["schemas"]["SkuDisplayDto"][];
|
|
149
|
-
reasoning_options:
|
|
149
|
+
reasoning_options: import("../generated/schema.js").components["schemas"]["ReasoningOptions"] | null;
|
|
150
150
|
}[]>;
|
|
151
151
|
updateModel: (slug: string, modelId: string, input: Schemas["UpdateProviderModelInput"]) => Promise<void>;
|
|
152
152
|
};
|
package/dist/admin/channels.d.ts
CHANGED
|
@@ -249,6 +249,30 @@ export declare function channelsApi(t: Transport, tenantSlug: string): {
|
|
|
249
249
|
preview: string | null;
|
|
250
250
|
source: string;
|
|
251
251
|
}[]>;
|
|
252
|
+
/** One summary per channel of what it has not sent: pending messages,
|
|
253
|
+
* whether anything is trying to send them, and what it gave up on in the
|
|
254
|
+
* last `days` days (default 7). */
|
|
255
|
+
outboxReport: (query?: {
|
|
256
|
+
days?: number;
|
|
257
|
+
}, signal?: AbortSignal) => Promise<{
|
|
258
|
+
channels: import("../generated/schema.js").components["schemas"]["ChannelOutboxSummary"][];
|
|
259
|
+
failed_window_days: number;
|
|
260
|
+
retry_window_seconds: number;
|
|
261
|
+
}>;
|
|
262
|
+
/** The channel's outbox summary plus a page of its unsent messages, newest
|
|
263
|
+
* first. Pass the previous page's `next_before` as `before`. */
|
|
264
|
+
outbox: (slug: string, query?: {
|
|
265
|
+
status?: "pending" | "failed" | "all";
|
|
266
|
+
days?: number;
|
|
267
|
+
before?: string;
|
|
268
|
+
limit?: number;
|
|
269
|
+
}, signal?: AbortSignal) => Promise<{
|
|
270
|
+
failed_window_days: number;
|
|
271
|
+
items: import("../generated/schema.js").components["schemas"]["OutboxItem"][];
|
|
272
|
+
next_before: string | null;
|
|
273
|
+
retry_window_seconds: number;
|
|
274
|
+
summary: import("../generated/schema.js").components["schemas"]["ChannelOutboxSummary"];
|
|
275
|
+
}>;
|
|
252
276
|
pairWhatsapp: (slug: string, input: Schemas["WhatsappPairInput"]) => Promise<{
|
|
253
277
|
pair_code: string | null;
|
|
254
278
|
pair_code_expires_at: string | null;
|
|
@@ -22,7 +22,7 @@ export declare function clientToolsApi(t: Transport, tenantSlug: string): {
|
|
|
22
22
|
idempotent_hint: boolean | null;
|
|
23
23
|
input_schema: import("../generated/schema.js").components["schemas"]["Value"];
|
|
24
24
|
name: string;
|
|
25
|
-
output_schema:
|
|
25
|
+
output_schema: import("../generated/schema.js").components["schemas"]["Value"] | null;
|
|
26
26
|
read_only_hint: boolean | null;
|
|
27
27
|
timeout_seconds: number;
|
|
28
28
|
updated_at: string;
|
|
@@ -38,7 +38,7 @@ export declare function clientToolsApi(t: Transport, tenantSlug: string): {
|
|
|
38
38
|
idempotent_hint: boolean | null;
|
|
39
39
|
input_schema: import("../generated/schema.js").components["schemas"]["Value"];
|
|
40
40
|
name: string;
|
|
41
|
-
output_schema:
|
|
41
|
+
output_schema: import("../generated/schema.js").components["schemas"]["Value"] | null;
|
|
42
42
|
read_only_hint: boolean | null;
|
|
43
43
|
timeout_seconds: number;
|
|
44
44
|
updated_at: string;
|
|
@@ -15,9 +15,9 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
15
15
|
origin?: string;
|
|
16
16
|
user_id?: string;
|
|
17
17
|
}, signal?: AbortSignal) => Promise<{
|
|
18
|
-
agent:
|
|
18
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
19
19
|
archived_at: string | null;
|
|
20
|
-
channel:
|
|
20
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
21
21
|
created_at: string;
|
|
22
22
|
generated_title: string | null;
|
|
23
23
|
has_pending_turn: boolean;
|
|
@@ -29,19 +29,19 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
29
29
|
metadata: Record<string, unknown>;
|
|
30
30
|
next_retry_at: string | null;
|
|
31
31
|
origin: string;
|
|
32
|
-
parent_conversation:
|
|
32
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
33
33
|
retry_count: number;
|
|
34
34
|
title: string | null;
|
|
35
35
|
total_cost_usd: number;
|
|
36
36
|
updated_at: string;
|
|
37
|
-
user:
|
|
37
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
38
38
|
user_identifier: string | null;
|
|
39
39
|
user_identifier_label: string | null;
|
|
40
40
|
}[]>;
|
|
41
41
|
get: (id: string, signal?: AbortSignal) => Promise<{
|
|
42
|
-
agent:
|
|
42
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
43
43
|
archived_at: string | null;
|
|
44
|
-
channel:
|
|
44
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
45
45
|
created_at: string;
|
|
46
46
|
generated_title: string | null;
|
|
47
47
|
has_pending_turn: boolean;
|
|
@@ -53,19 +53,19 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
53
53
|
metadata: Record<string, unknown>;
|
|
54
54
|
next_retry_at: string | null;
|
|
55
55
|
origin: string;
|
|
56
|
-
parent_conversation:
|
|
56
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
57
57
|
retry_count: number;
|
|
58
58
|
title: string | null;
|
|
59
59
|
total_cost_usd: number;
|
|
60
60
|
updated_at: string;
|
|
61
|
-
user:
|
|
61
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
62
62
|
user_identifier: string | null;
|
|
63
63
|
user_identifier_label: string | null;
|
|
64
64
|
}>;
|
|
65
65
|
create: (input: Schemas["CreateConversationInput"]) => Promise<{
|
|
66
|
-
agent:
|
|
66
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
67
67
|
archived_at: string | null;
|
|
68
|
-
channel:
|
|
68
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
69
69
|
created_at: string;
|
|
70
70
|
generated_title: string | null;
|
|
71
71
|
has_pending_turn: boolean;
|
|
@@ -77,19 +77,19 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
77
77
|
metadata: Record<string, unknown>;
|
|
78
78
|
next_retry_at: string | null;
|
|
79
79
|
origin: string;
|
|
80
|
-
parent_conversation:
|
|
80
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
81
81
|
retry_count: number;
|
|
82
82
|
title: string | null;
|
|
83
83
|
total_cost_usd: number;
|
|
84
84
|
updated_at: string;
|
|
85
|
-
user:
|
|
85
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
86
86
|
user_identifier: string | null;
|
|
87
87
|
user_identifier_label: string | null;
|
|
88
88
|
}>;
|
|
89
89
|
update: (id: string, input: Schemas["UpdateConversationInput"]) => Promise<{
|
|
90
|
-
agent:
|
|
90
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
91
91
|
archived_at: string | null;
|
|
92
|
-
channel:
|
|
92
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
93
93
|
created_at: string;
|
|
94
94
|
generated_title: string | null;
|
|
95
95
|
has_pending_turn: boolean;
|
|
@@ -101,19 +101,19 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
101
101
|
metadata: Record<string, unknown>;
|
|
102
102
|
next_retry_at: string | null;
|
|
103
103
|
origin: string;
|
|
104
|
-
parent_conversation:
|
|
104
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
105
105
|
retry_count: number;
|
|
106
106
|
title: string | null;
|
|
107
107
|
total_cost_usd: number;
|
|
108
108
|
updated_at: string;
|
|
109
|
-
user:
|
|
109
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
110
110
|
user_identifier: string | null;
|
|
111
111
|
user_identifier_label: string | null;
|
|
112
112
|
}>;
|
|
113
113
|
archive: (id: string) => Promise<{
|
|
114
|
-
agent:
|
|
114
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
115
115
|
archived_at: string | null;
|
|
116
|
-
channel:
|
|
116
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
117
117
|
created_at: string;
|
|
118
118
|
generated_title: string | null;
|
|
119
119
|
has_pending_turn: boolean;
|
|
@@ -125,20 +125,20 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
125
125
|
metadata: Record<string, unknown>;
|
|
126
126
|
next_retry_at: string | null;
|
|
127
127
|
origin: string;
|
|
128
|
-
parent_conversation:
|
|
128
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
129
129
|
retry_count: number;
|
|
130
130
|
title: string | null;
|
|
131
131
|
total_cost_usd: number;
|
|
132
132
|
updated_at: string;
|
|
133
|
-
user:
|
|
133
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
134
134
|
user_identifier: string | null;
|
|
135
135
|
user_identifier_label: string | null;
|
|
136
136
|
}>;
|
|
137
137
|
/** Clears the backoff and re-dispatches a conversation stuck after failures. */
|
|
138
138
|
retryNow: (id: string) => Promise<{
|
|
139
|
-
agent:
|
|
139
|
+
agent: import("../generated/schema.js").components["schemas"]["AgentRef"] | null;
|
|
140
140
|
archived_at: string | null;
|
|
141
|
-
channel:
|
|
141
|
+
channel: import("../generated/schema.js").components["schemas"]["ChannelRef"] | null;
|
|
142
142
|
created_at: string;
|
|
143
143
|
generated_title: string | null;
|
|
144
144
|
has_pending_turn: boolean;
|
|
@@ -150,12 +150,12 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
150
150
|
metadata: Record<string, unknown>;
|
|
151
151
|
next_retry_at: string | null;
|
|
152
152
|
origin: string;
|
|
153
|
-
parent_conversation:
|
|
153
|
+
parent_conversation: import("../generated/schema.js").components["schemas"]["ConversationRef"] | null;
|
|
154
154
|
retry_count: number;
|
|
155
155
|
title: string | null;
|
|
156
156
|
total_cost_usd: number;
|
|
157
157
|
updated_at: string;
|
|
158
|
-
user:
|
|
158
|
+
user: import("../generated/schema.js").components["schemas"]["UserRef"] | null;
|
|
159
159
|
user_identifier: string | null;
|
|
160
160
|
user_identifier_label: string | null;
|
|
161
161
|
}>;
|
|
@@ -177,12 +177,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
177
177
|
error: string | null;
|
|
178
178
|
id: string;
|
|
179
179
|
injected_by_conversation_id: string | null;
|
|
180
|
-
llm_call_data:
|
|
180
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
181
181
|
model: string | null;
|
|
182
182
|
parent_tool_call_id: string | null;
|
|
183
|
-
provider:
|
|
183
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
184
184
|
read_at: string | null;
|
|
185
185
|
result?: unknown;
|
|
186
|
+
sent_at: string | null;
|
|
186
187
|
seq: number;
|
|
187
188
|
sub_conversation_id: string | null;
|
|
188
189
|
tentative: boolean;
|
|
@@ -208,12 +209,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
208
209
|
error: string | null;
|
|
209
210
|
id: string;
|
|
210
211
|
injected_by_conversation_id: string | null;
|
|
211
|
-
llm_call_data:
|
|
212
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
212
213
|
model: string | null;
|
|
213
214
|
parent_tool_call_id: string | null;
|
|
214
|
-
provider:
|
|
215
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
215
216
|
read_at: string | null;
|
|
216
217
|
result?: unknown;
|
|
218
|
+
sent_at: string | null;
|
|
217
219
|
seq: number;
|
|
218
220
|
sub_conversation_id: string | null;
|
|
219
221
|
tentative: boolean;
|
|
@@ -238,12 +240,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
238
240
|
error: string | null;
|
|
239
241
|
id: string;
|
|
240
242
|
injected_by_conversation_id: string | null;
|
|
241
|
-
llm_call_data:
|
|
243
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
242
244
|
model: string | null;
|
|
243
245
|
parent_tool_call_id: string | null;
|
|
244
|
-
provider:
|
|
246
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
245
247
|
read_at: string | null;
|
|
246
248
|
result?: unknown;
|
|
249
|
+
sent_at: string | null;
|
|
247
250
|
seq: number;
|
|
248
251
|
sub_conversation_id: string | null;
|
|
249
252
|
tentative: boolean;
|
|
@@ -273,12 +276,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
273
276
|
error: string | null;
|
|
274
277
|
id: string;
|
|
275
278
|
injected_by_conversation_id: string | null;
|
|
276
|
-
llm_call_data:
|
|
279
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
277
280
|
model: string | null;
|
|
278
281
|
parent_tool_call_id: string | null;
|
|
279
|
-
provider:
|
|
282
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
280
283
|
read_at: string | null;
|
|
281
284
|
result?: unknown;
|
|
285
|
+
sent_at: string | null;
|
|
282
286
|
seq: number;
|
|
283
287
|
sub_conversation_id: string | null;
|
|
284
288
|
tentative: boolean;
|
|
@@ -310,12 +314,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
310
314
|
error: string | null;
|
|
311
315
|
id: string;
|
|
312
316
|
injected_by_conversation_id: string | null;
|
|
313
|
-
llm_call_data:
|
|
317
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
314
318
|
model: string | null;
|
|
315
319
|
parent_tool_call_id: string | null;
|
|
316
|
-
provider:
|
|
320
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
317
321
|
read_at: string | null;
|
|
318
322
|
result?: unknown;
|
|
323
|
+
sent_at: string | null;
|
|
319
324
|
seq: number;
|
|
320
325
|
sub_conversation_id: string | null;
|
|
321
326
|
tentative: boolean;
|
|
@@ -339,12 +344,13 @@ export declare function conversationsAdminApi(t: Transport, tenantSlug: string):
|
|
|
339
344
|
error: string | null;
|
|
340
345
|
id: string;
|
|
341
346
|
injected_by_conversation_id: string | null;
|
|
342
|
-
llm_call_data:
|
|
347
|
+
llm_call_data: import("../generated/schema.js").components["schemas"]["LlmCallData"] | null;
|
|
343
348
|
model: string | null;
|
|
344
349
|
parent_tool_call_id: string | null;
|
|
345
|
-
provider:
|
|
350
|
+
provider: import("../generated/schema.js").components["schemas"]["ProviderRef"] | null;
|
|
346
351
|
read_at: string | null;
|
|
347
352
|
result?: unknown;
|
|
353
|
+
sent_at: string | null;
|
|
348
354
|
seq: number;
|
|
349
355
|
sub_conversation_id: string | null;
|
|
350
356
|
tentative: boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Transport } from "../http.js";
|
|
2
|
+
import type { Schemas } from "../schemas.js";
|
|
3
|
+
export type CostMetrics = Schemas["CostMetrics"];
|
|
4
|
+
export type CostDimension = Schemas["CostDimension"];
|
|
5
|
+
export type CostGranularity = Schemas["CostGranularity"];
|
|
6
|
+
/** Filter value selecting the spend where a dimension is empty — no user, no
|
|
7
|
+
* agent, no provider. Pass `null` in a filter list and it is sent as this. */
|
|
8
|
+
export declare const COST_NONE = "__none__";
|
|
9
|
+
export interface CostMetricsQuery {
|
|
10
|
+
/** Inclusive start. Defaults to 30 days before `to`. */
|
|
11
|
+
from?: Date | string;
|
|
12
|
+
/** Exclusive end. Defaults to now. */
|
|
13
|
+
to?: Date | string;
|
|
14
|
+
granularity?: CostGranularity;
|
|
15
|
+
/** IANA zone the buckets are cut in. Defaults to UTC. */
|
|
16
|
+
timezone?: string;
|
|
17
|
+
groupBy?: CostDimension[];
|
|
18
|
+
/** Per dimension, the values to keep; `null` keeps the spend with none.
|
|
19
|
+
* `tenant` only applies to the whole-instance route. */
|
|
20
|
+
filters?: Partial<Record<CostDimension, (string | null)[]>>;
|
|
21
|
+
}
|
|
22
|
+
/** Spend over time across the whole instance. Root only. */
|
|
23
|
+
export declare function instanceCostMetricsApi(t: Transport): {
|
|
24
|
+
get: (query?: CostMetricsQuery, signal?: AbortSignal) => Promise<{
|
|
25
|
+
backfill_cutover: string | null;
|
|
26
|
+
backfill_pending: boolean;
|
|
27
|
+
buckets: string[];
|
|
28
|
+
facets: import("../generated/schema.js").components["schemas"]["CostFacets"];
|
|
29
|
+
from: string;
|
|
30
|
+
granularity: import("../generated/schema.js").components["schemas"]["CostGranularity"];
|
|
31
|
+
group_by: import("../generated/schema.js").components["schemas"]["CostDimension"][];
|
|
32
|
+
groups: import("../generated/schema.js").components["schemas"]["CostGroup"][];
|
|
33
|
+
groups_truncated: boolean;
|
|
34
|
+
labels: import("../generated/schema.js").components["schemas"]["CostLabels"];
|
|
35
|
+
series: import("../generated/schema.js").components["schemas"]["CostSeriesPoint"][];
|
|
36
|
+
timezone: string;
|
|
37
|
+
to: string;
|
|
38
|
+
totals: import("../generated/schema.js").components["schemas"]["CostMeasures"];
|
|
39
|
+
unclassified_tokens: number;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
/** One tenant's spend over time. Needs `conversations:read`. */
|
|
43
|
+
export declare function costMetricsApi(t: Transport, tenantSlug: string): {
|
|
44
|
+
get: (query?: CostMetricsQuery, signal?: AbortSignal) => Promise<{
|
|
45
|
+
backfill_cutover: string | null;
|
|
46
|
+
backfill_pending: boolean;
|
|
47
|
+
buckets: string[];
|
|
48
|
+
facets: import("../generated/schema.js").components["schemas"]["CostFacets"];
|
|
49
|
+
from: string;
|
|
50
|
+
granularity: import("../generated/schema.js").components["schemas"]["CostGranularity"];
|
|
51
|
+
group_by: import("../generated/schema.js").components["schemas"]["CostDimension"][];
|
|
52
|
+
groups: import("../generated/schema.js").components["schemas"]["CostGroup"][];
|
|
53
|
+
groups_truncated: boolean;
|
|
54
|
+
labels: import("../generated/schema.js").components["schemas"]["CostLabels"];
|
|
55
|
+
series: import("../generated/schema.js").components["schemas"]["CostSeriesPoint"][];
|
|
56
|
+
timezone: string;
|
|
57
|
+
to: string;
|
|
58
|
+
totals: import("../generated/schema.js").components["schemas"]["CostMeasures"];
|
|
59
|
+
unclassified_tokens: number;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
package/dist/admin/global.d.ts
CHANGED
|
@@ -90,8 +90,8 @@ export declare function sharedProvidersApi(t: Transport): {
|
|
|
90
90
|
plugin: string;
|
|
91
91
|
shared: boolean;
|
|
92
92
|
slug: string;
|
|
93
|
-
|
|
94
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
93
|
+
token_sku_classes: {
|
|
94
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
95
95
|
};
|
|
96
96
|
type: string;
|
|
97
97
|
}>;
|
|
@@ -110,8 +110,8 @@ export declare function sharedProvidersApi(t: Transport): {
|
|
|
110
110
|
plugin: string;
|
|
111
111
|
shared: boolean;
|
|
112
112
|
slug: string;
|
|
113
|
-
|
|
114
|
-
[key: string]: import("../generated/schema.js").components["schemas"]["
|
|
113
|
+
token_sku_classes: {
|
|
114
|
+
[key: string]: import("../generated/schema.js").components["schemas"]["SkuClass"];
|
|
115
115
|
};
|
|
116
116
|
type: string;
|
|
117
117
|
}>;
|
|
@@ -140,7 +140,7 @@ export declare function sharedProvidersApi(t: Transport): {
|
|
|
140
140
|
[key: string]: number;
|
|
141
141
|
};
|
|
142
142
|
pricing_skus: import("../generated/schema.js").components["schemas"]["SkuDisplayDto"][];
|
|
143
|
-
reasoning_options:
|
|
143
|
+
reasoning_options: import("../generated/schema.js").components["schemas"]["ReasoningOptions"] | null;
|
|
144
144
|
}[]>;
|
|
145
145
|
updateModel: (slug: string, modelId: string, input: Schemas["UpdateProviderModelInput"]) => Promise<void>;
|
|
146
146
|
};
|
package/dist/admin/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { channelsApi } from "./channels.js";
|
|
|
7
7
|
import { clientToolsApi } from "./client-tools.js";
|
|
8
8
|
import { componentLibrariesApi } from "./component-libraries.js";
|
|
9
9
|
import { conversationsAdminApi } from "./conversations.js";
|
|
10
|
+
import { costMetricsApi, instanceCostMetricsApi } from "./cost-metrics.js";
|
|
10
11
|
import { apiKeysApi, pluginsApi, sharedProvidersApi, tenantsApi } from "./global.js";
|
|
11
12
|
import { knowledgeBasesApi } from "./knowledge-bases.js";
|
|
12
13
|
import { mcpsApi } from "./mcps.js";
|
|
@@ -45,6 +46,7 @@ export interface TenantScope {
|
|
|
45
46
|
backgroundTasks: ReturnType<typeof backgroundTasksApi>;
|
|
46
47
|
conversations: ReturnType<typeof conversationsAdminApi>;
|
|
47
48
|
clientTools: ReturnType<typeof clientToolsApi>;
|
|
49
|
+
costMetrics: ReturnType<typeof costMetricsApi>;
|
|
48
50
|
}
|
|
49
51
|
export interface AdminClient {
|
|
50
52
|
health(signal?: AbortSignal): Promise<Schemas["Health"]>;
|
|
@@ -53,6 +55,7 @@ export interface AdminClient {
|
|
|
53
55
|
apiKeys: ReturnType<typeof apiKeysApi>;
|
|
54
56
|
sharedProviders: ReturnType<typeof sharedProvidersApi>;
|
|
55
57
|
plugins: ReturnType<typeof pluginsApi>;
|
|
58
|
+
costMetrics: ReturnType<typeof instanceCostMetricsApi>;
|
|
56
59
|
tenant(slug: string): TenantScope;
|
|
57
60
|
/** Escape hatch for a route the SDK hasn't wrapped yet. Paths are absolute
|
|
58
61
|
* (`/api/v1/…`) and auth is applied for you. */
|
|
@@ -20,7 +20,7 @@ export declare function knowledgeBasesApi(t: Transport, tenantSlug: string): {
|
|
|
20
20
|
curate_requested: boolean;
|
|
21
21
|
display_name: string;
|
|
22
22
|
id: string;
|
|
23
|
-
last_run:
|
|
23
|
+
last_run: import("../generated/schema.js").components["schemas"]["CurationRun"] | null;
|
|
24
24
|
nap_agent_slug: string | null;
|
|
25
25
|
nap_last_run_at: string | null;
|
|
26
26
|
oldest_pending_at: string | null;
|
|
@@ -35,7 +35,7 @@ export declare function knowledgeBasesApi(t: Transport, tenantSlug: string): {
|
|
|
35
35
|
curate_requested: boolean;
|
|
36
36
|
display_name: string;
|
|
37
37
|
id: string;
|
|
38
|
-
last_run:
|
|
38
|
+
last_run: import("../generated/schema.js").components["schemas"]["CurationRun"] | null;
|
|
39
39
|
nap_agent_slug: string | null;
|
|
40
40
|
nap_last_run_at: string | null;
|
|
41
41
|
oldest_pending_at: string | null;
|
|
@@ -50,7 +50,7 @@ export declare function knowledgeBasesApi(t: Transport, tenantSlug: string): {
|
|
|
50
50
|
curate_requested: boolean;
|
|
51
51
|
display_name: string;
|
|
52
52
|
id: string;
|
|
53
|
-
last_run:
|
|
53
|
+
last_run: import("../generated/schema.js").components["schemas"]["CurationRun"] | null;
|
|
54
54
|
nap_agent_slug: string | null;
|
|
55
55
|
nap_last_run_at: string | null;
|
|
56
56
|
oldest_pending_at: string | null;
|