@xpert-ai/contracts 3.19.0 → 3.21.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/index.cjs.js +425 -20
- package/index.esm.js +372 -22
- package/package.json +5 -2
- package/src/agent/ai-model.d.ts +1 -0
- package/src/agent/token.d.ts +4 -0
- package/src/ai/agent-output-delivery.model.d.ts +31 -0
- package/src/ai/agent-runtime.model.d.ts +53 -0
- package/src/ai/ai-model.model.d.ts +3 -0
- package/src/ai/assistant-binding.model.d.ts +3 -0
- package/src/ai/assistant-configuration.model.d.ts +31 -0
- package/src/ai/bosi.model.d.ts +73 -0
- package/src/ai/chat-group-entity.model.d.ts +93 -0
- package/src/ai/chat-group.model.d.ts +298 -0
- package/src/ai/chat-message-envelope.model.d.ts +55 -0
- package/src/ai/chat-message.model.d.ts +10 -0
- package/src/ai/chat.model.d.ts +26 -0
- package/src/ai/conversation-entry.model.d.ts +18 -0
- package/src/ai/execution-activity.model.d.ts +547 -0
- package/src/ai/index.d.ts +11 -0
- package/src/ai/mcp-capability.model.d.ts +5 -1
- package/src/ai/membership.model.d.ts +5 -0
- package/src/ai/model-execution.model.d.ts +265 -0
- package/src/ai/model-gateway.model.d.ts +15 -3
- package/src/ai/model-usage.model.d.ts +19 -0
- package/src/ai/project-task-graph.model.d.ts +12 -0
- package/src/ai/project-task-runtime.model.d.ts +1106 -0
- package/src/ai/project-task-type.model.d.ts +13 -0
- package/src/ai/prompt-workflow.model.d.ts +4 -0
- package/src/ai/realtime-voice.model.d.ts +90 -0
- package/src/ai/realtime-voice.transport.d.ts +54 -0
- package/src/ai/resource-card.d.ts +2 -0
- package/src/ai/sandbox-terminal.model.d.ts +1 -0
- package/src/ai/thread-activity.model.d.ts +14 -0
- package/src/ai/xpert-agent-execution.model.d.ts +4 -0
- package/src/ai/xpert-project.model.d.ts +21 -0
- package/src/ai/xpert-template.model.d.ts +23 -5
- package/src/ai/xpert-tool-mcp.model.d.ts +6 -0
- package/src/ai/xpert.model.d.ts +7 -2
- package/src/api-key.model.d.ts +37 -2
- package/src/default-agent-plugins.d.ts +19 -0
- package/src/i18n.model.d.ts +1 -0
- package/src/index.d.ts +5 -0
- package/src/plugin-application.d.ts +256 -0
- package/src/plugin-management.d.ts +112 -0
- package/src/plugin.d.ts +3 -319
- package/src/runtime-control.d.ts +13 -0
- package/src/secret-token.model.d.ts +8 -1
- package/src/setup-plugins.d.ts +75 -0
- package/src/types.d.ts +4 -0
- package/src/view-extension/model.d.ts +22 -1
- package/src/view-extension/workbench.d.ts +6 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelExecutionUsageContext } from './model-execution.model';
|
|
1
2
|
import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from '../base-entity.model';
|
|
2
3
|
import { IUser } from '../user.model';
|
|
3
4
|
import { AiModelTypeEnum } from '../agent';
|
|
@@ -170,6 +171,8 @@ export interface IMembershipPointLedger extends IBasePerTenantEntityModel {
|
|
|
170
171
|
reason?: string | null;
|
|
171
172
|
accessSource?: ModelAccessSourceEnum | null;
|
|
172
173
|
modelGrantId?: string | null;
|
|
174
|
+
/** Execution attribution for this points entry; absent for non-execution or historical records. */
|
|
175
|
+
executionContext?: ModelExecutionUsageContext | null;
|
|
173
176
|
usageChannel?: ModelGatewayUsageChannelEnum | null;
|
|
174
177
|
gatewayRequestId?: string | null;
|
|
175
178
|
gatewayApiKeyId?: string | null;
|
|
@@ -212,6 +215,8 @@ export interface IMembershipPointLedger extends IBasePerTenantEntityModel {
|
|
|
212
215
|
exchangeRate?: number | null;
|
|
213
216
|
}
|
|
214
217
|
export interface IMembershipMe {
|
|
218
|
+
/** Model consumption in the current cycle, including unbilled/unlimited use. Independent of quota deductions. */
|
|
219
|
+
consumedPoints?: number;
|
|
215
220
|
membership: IUserMembership;
|
|
216
221
|
plan: IMembershipPlan;
|
|
217
222
|
personalPointsOnly: boolean;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
import type { AiModelTypeEnum } from '../agent';
|
|
3
|
+
import type { ModelFeature } from './ai-model.model';
|
|
4
|
+
/** Entry point and execution location are independent dimensions. */
|
|
5
|
+
export type ModelExecutionEntry = 'cli' | 'agent_runtime' | 'shell';
|
|
6
|
+
export type ModelExecutionProtocol = 'openai_chat' | 'openai_responses' | 'anthropic_messages' | 'openai_responses_chat' | 'anthropic_messages_chat';
|
|
7
|
+
export type ModelExecutionEnvironment = {
|
|
8
|
+
type: 'computer' | 'sandbox';
|
|
9
|
+
environmentId: string;
|
|
10
|
+
instanceId: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'remote';
|
|
13
|
+
bindingId: string;
|
|
14
|
+
revision: string;
|
|
15
|
+
};
|
|
16
|
+
export type ModelExecutionSource = {
|
|
17
|
+
type: 'cli_session';
|
|
18
|
+
cliSessionId: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'agent_invocation';
|
|
21
|
+
invocationId: string;
|
|
22
|
+
bindingId: string;
|
|
23
|
+
bindingRevision: string;
|
|
24
|
+
}
|
|
25
|
+
/** One CLI child, not the containing shell; IDs and revision are resolved by the trusted host. */
|
|
26
|
+
| {
|
|
27
|
+
type: 'shell_execution';
|
|
28
|
+
executionId: string;
|
|
29
|
+
shellExecutionId: string;
|
|
30
|
+
parentExecutionId: string;
|
|
31
|
+
generation: number;
|
|
32
|
+
profileRevision: string;
|
|
33
|
+
};
|
|
34
|
+
/** Exhaustive attribution shared by queries, ledger export and UI. */
|
|
35
|
+
export declare function modelExecutionEntry(source: ModelExecutionSource): ModelExecutionEntry;
|
|
36
|
+
export declare function modelExecutionSourceId(source: ModelExecutionSource): string;
|
|
37
|
+
export interface ModelExecutionModel {
|
|
38
|
+
id: string;
|
|
39
|
+
copilotId: string;
|
|
40
|
+
providerScopeId: string;
|
|
41
|
+
providerOrganizationId: string | null;
|
|
42
|
+
provider: string;
|
|
43
|
+
model: string;
|
|
44
|
+
modelType: AiModelTypeEnum.LLM;
|
|
45
|
+
capabilities: ModelFeature[];
|
|
46
|
+
/** Provider catalog context window; a CLI hint, not an execution policy limit. */
|
|
47
|
+
contextWindow?: number;
|
|
48
|
+
/** Provider catalog maximum output; a CLI hint, never an additional execution cap. */
|
|
49
|
+
outputTokenLimit?: number;
|
|
50
|
+
protocols: ModelExecutionProtocol[];
|
|
51
|
+
}
|
|
52
|
+
export interface ModelExecutionContext {
|
|
53
|
+
tenantId: string;
|
|
54
|
+
runtimeOrganizationId: string;
|
|
55
|
+
actorUserId: string;
|
|
56
|
+
billableUserId: string;
|
|
57
|
+
xpertId: string;
|
|
58
|
+
/** Display snapshot; historical grants may only have the immutable ID. */
|
|
59
|
+
assistantName?: string;
|
|
60
|
+
assistantVersion: string;
|
|
61
|
+
conversationId: string;
|
|
62
|
+
threadId?: string;
|
|
63
|
+
source: ModelExecutionSource;
|
|
64
|
+
environment: ModelExecutionEnvironment;
|
|
65
|
+
tool: {
|
|
66
|
+
id: string;
|
|
67
|
+
version: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Money limits require proven provider-specific bounds; v1 admits token budgets only. */
|
|
71
|
+
export interface ModelExecutionLimits {
|
|
72
|
+
/** Optional execution budgets; omitted uses the platform’s normal billing/quota. */
|
|
73
|
+
tokenBudget?: number;
|
|
74
|
+
userTokenBudget?: number;
|
|
75
|
+
maxConcurrentRequests: number;
|
|
76
|
+
requestsPerMinute: number;
|
|
77
|
+
/** Maximum silence while waiting for provider data; active streams reset this timer. */
|
|
78
|
+
requestIdleSeconds?: number;
|
|
79
|
+
leaseSeconds: number;
|
|
80
|
+
maxDurationSeconds: number;
|
|
81
|
+
}
|
|
82
|
+
/** CLI tool approvals inside the already authorized Computer environment. */
|
|
83
|
+
export type CliPermissionMode = 'allow' | 'restricted';
|
|
84
|
+
/** Resolved execution policy; default enablement does not bypass model, tool or budget checks. */
|
|
85
|
+
export type ModelExecutionPolicy = {
|
|
86
|
+
/** @deprecated Compatibility field, always true; no longer a tenant opt-in switch. */
|
|
87
|
+
enabled: true;
|
|
88
|
+
gatewayBaseUrl: string;
|
|
89
|
+
/** Separately gated until each native protocol has passed real-model acceptance. */
|
|
90
|
+
nativeProtocols?: Array<'openai_responses' | 'anthropic_messages'>;
|
|
91
|
+
/** Explicit, limited Chat Completions translations; never advertised as native support. */
|
|
92
|
+
chatBridgeProtocols?: Array<'openai_responses' | 'anthropic_messages'>;
|
|
93
|
+
limits: ModelExecutionLimits;
|
|
94
|
+
/** Applies to background Coding invocations; evidence-only reviews remain restricted. */
|
|
95
|
+
cliPermissions?: {
|
|
96
|
+
defaultMode: CliPermissionMode;
|
|
97
|
+
overrides: Record<string, CliPermissionMode>;
|
|
98
|
+
};
|
|
99
|
+
/** Only installed, registered profiles qualify; IDs alone never authorize execution. */
|
|
100
|
+
tools: Array<{
|
|
101
|
+
id: string;
|
|
102
|
+
version: string;
|
|
103
|
+
executable: string;
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
106
|
+
export type CliSessionStatus = 'starting' | 'running' | 'stopping' | 'exited' | 'unknown';
|
|
107
|
+
/** Guest executable/version probe result; unknown means the installation could not be confirmed. */
|
|
108
|
+
export type ComputerCliInstallation = 'installed' | 'missing' | 'version_mismatch' | 'unknown';
|
|
109
|
+
export declare const MODEL_EXECUTION_POLICY_SETTING = "modelExecutionPolicy";
|
|
110
|
+
/** Authorized Computer tool inventory; installation, model support and managed execution are independent. */
|
|
111
|
+
export interface ComputerCliToolsView {
|
|
112
|
+
/** A conversation is required to resolve the Assistant's available models. */
|
|
113
|
+
state: 'ready' | 'conversation_required';
|
|
114
|
+
tools: Array<{
|
|
115
|
+
/** Policy-approved executable identifier and pinned version. */
|
|
116
|
+
id: string;
|
|
117
|
+
version: string;
|
|
118
|
+
/** Installed at the required version and compatible with the selected model. */
|
|
119
|
+
available: boolean;
|
|
120
|
+
/** Probe of the current container; unknown must not be treated as installed. */
|
|
121
|
+
installation: ComputerCliInstallation;
|
|
122
|
+
/** The Assistant's selected model supports this tool's approved protocol. */
|
|
123
|
+
modelCompatible: boolean;
|
|
124
|
+
/** A registered background runtime supports this tool, version and Computer environment. */
|
|
125
|
+
managed: boolean;
|
|
126
|
+
}>;
|
|
127
|
+
/** Current launch defaults; existing sessions retain their own issuance snapshot. */
|
|
128
|
+
launch?: {
|
|
129
|
+
assistant: string;
|
|
130
|
+
model: string;
|
|
131
|
+
/** Server-resolved path inside the mounted Computer workspace. */
|
|
132
|
+
workingDirectory: string;
|
|
133
|
+
/** Maximum token budget for a newly issued session. */
|
|
134
|
+
tokenBudget?: number;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** Owned interactive CLI session summary; excludes execution credentials and Docker connection details. */
|
|
138
|
+
export interface CliSessionView {
|
|
139
|
+
/** Session identity, distinct from a model call or desktop control ticket. */
|
|
140
|
+
id: string;
|
|
141
|
+
/** Immutable conversation and Assistant bindings. */
|
|
142
|
+
conversationId: string;
|
|
143
|
+
xpertId: string;
|
|
144
|
+
/** Policy-approved tool/version recorded at creation. */
|
|
145
|
+
tool: {
|
|
146
|
+
id: string;
|
|
147
|
+
version: string;
|
|
148
|
+
};
|
|
149
|
+
/** Host-observed lifecycle; unknown never implies completion or permission to relaunch. */
|
|
150
|
+
status: CliSessionStatus;
|
|
151
|
+
/** Platform model identifier captured at issuance; empty if no grant was issued. */
|
|
152
|
+
defaultModelId: string;
|
|
153
|
+
/** Original Assistant display snapshot; historical records may fall back to its ID. */
|
|
154
|
+
assistantName: string;
|
|
155
|
+
/** Original default model name; empty if no grant was issued. */
|
|
156
|
+
model: string;
|
|
157
|
+
/** Server-resolved session workspace path inside Computer. */
|
|
158
|
+
workingDirectory: string;
|
|
159
|
+
/** Explicit session budget; omitted when none is configured. */
|
|
160
|
+
tokenBudget?: number;
|
|
161
|
+
/** Recorded actual tokens across this grant's attempts, excluding estimates. */
|
|
162
|
+
usedTokens: number;
|
|
163
|
+
/** Tokens still reserved for attempts whose usage is not confirmed. */
|
|
164
|
+
reservedTokens: number;
|
|
165
|
+
/** ISO absolute execution deadline, not the renewable lease expiry; creation time without a grant. */
|
|
166
|
+
expiresAt: string;
|
|
167
|
+
/** Supervisor exit code when observed; null or absent if not known. */
|
|
168
|
+
exitCode?: number | null;
|
|
169
|
+
}
|
|
170
|
+
/** Attribution snapshot persisted with execution usage; contains no authorization credentials. */
|
|
171
|
+
export interface ModelExecutionUsageContext {
|
|
172
|
+
/** CLI or managed runtime entry point, independent of the execution environment. */
|
|
173
|
+
entry: ModelExecutionEntry;
|
|
174
|
+
/** Bound execution location and instance/revision, not the model provider's location. */
|
|
175
|
+
environment: ModelExecutionEnvironment;
|
|
176
|
+
/** User who initiated the execution. */
|
|
177
|
+
actorUserId: string;
|
|
178
|
+
/** User whose quota is charged; currently required to match actorUserId. */
|
|
179
|
+
billableUserId: string;
|
|
180
|
+
/** Assistant version captured when the execution grant was issued. */
|
|
181
|
+
assistantVersion: string;
|
|
182
|
+
/** Conversation to which this execution's usage is attributed. */
|
|
183
|
+
conversationId: string;
|
|
184
|
+
/** Owning CLI session or managed invocation, distinct from an individual model call. */
|
|
185
|
+
source: ModelExecutionSource;
|
|
186
|
+
/** Execution authorization ID; distinct from a model-access grant ID. */
|
|
187
|
+
grantId: string;
|
|
188
|
+
/** Platform ID for the logical model call. */
|
|
189
|
+
callId: string;
|
|
190
|
+
/** Upstream attempt ID, also used as the ledger requestId for idempotent delivery. */
|
|
191
|
+
attemptId: string;
|
|
192
|
+
/** Optional upstream request reference for reconciliation; not the ledger idempotency key. */
|
|
193
|
+
providerRequestId?: string;
|
|
194
|
+
/** Calling tool and version captured in the execution grant. */
|
|
195
|
+
tool: {
|
|
196
|
+
id: string;
|
|
197
|
+
version: string;
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/** Informational estimates only; never substitute for provider usage when settling execution charges. */
|
|
201
|
+
export interface ModelExecutionUsageEstimate {
|
|
202
|
+
/** Estimated input count, validated as a non-negative integer. */
|
|
203
|
+
inputTokens: number;
|
|
204
|
+
/** Estimated output count, validated as a non-negative integer. */
|
|
205
|
+
outputTokens: number;
|
|
206
|
+
/** inputTokens + outputTokens; cache and reasoning counts must not be added again. */
|
|
207
|
+
totalTokens: number;
|
|
208
|
+
}
|
|
209
|
+
/** Filters for the current user's execution attempts in the selected organization. */
|
|
210
|
+
export interface ModelExecutionCallQuery {
|
|
211
|
+
entry?: ModelExecutionEntry;
|
|
212
|
+
status?: import('./model-gateway.model').ModelGatewayCallStatusEnum;
|
|
213
|
+
assistantId?: string;
|
|
214
|
+
conversationId?: string;
|
|
215
|
+
/** CLI session ID or managed invocation ID, not a model call/attempt ID. */
|
|
216
|
+
executionId?: string;
|
|
217
|
+
tool?: string;
|
|
218
|
+
model?: string;
|
|
219
|
+
environment?: ModelExecutionEnvironment['type'];
|
|
220
|
+
usageSource?: import('./model-gateway.model').ModelGatewayUsageSourceEnum;
|
|
221
|
+
/** pending means no authoritative pricing fact is available yet, not a zero charge. */
|
|
222
|
+
pricingStatus?: 'priced' | 'free' | 'unpriced' | 'pending';
|
|
223
|
+
/** Inclusive ISO 8601 timestamp bounds, including a timezone offset. */
|
|
224
|
+
startedAfter?: string;
|
|
225
|
+
startedBefore?: string;
|
|
226
|
+
}
|
|
227
|
+
/** Filter choices from the current user's executions in the selected organization. */
|
|
228
|
+
export interface ModelExecutionCallOptions {
|
|
229
|
+
assistants: Array<{
|
|
230
|
+
id: string;
|
|
231
|
+
name: string;
|
|
232
|
+
}>;
|
|
233
|
+
models: string[];
|
|
234
|
+
tools: string[];
|
|
235
|
+
}
|
|
236
|
+
/** Personal attempt receipt. Raw token usage and provider prices remain in administrative ledgers. */
|
|
237
|
+
export interface ModelExecutionCallView {
|
|
238
|
+
id: string;
|
|
239
|
+
callId: string;
|
|
240
|
+
attemptId: string;
|
|
241
|
+
context: ModelExecutionContext;
|
|
242
|
+
modelId: string;
|
|
243
|
+
model: string;
|
|
244
|
+
status: import('./model-gateway.model').ModelGatewayCallStatusEnum;
|
|
245
|
+
usageSource: import('./model-gateway.model').ModelGatewayUsageSourceEnum;
|
|
246
|
+
/** Model consumption points, independent of balance deductions; null means settlement or pricing is unresolved. */
|
|
247
|
+
points: number | null;
|
|
248
|
+
pricingStatus: 'priced' | 'free' | 'unpriced' | 'pending';
|
|
249
|
+
startedAt: string;
|
|
250
|
+
completedAt: string | null;
|
|
251
|
+
/** Actual usage was delivered to the ledger; zero-usage reviews create no usage entry. */
|
|
252
|
+
delivered: boolean;
|
|
253
|
+
}
|
|
254
|
+
/** Explicit model policy source in a Runtime binding; independent of the calling Agent identity. */
|
|
255
|
+
export declare const agentRuntimeModelSourceSchema: z.ZodObject<{
|
|
256
|
+
type: z.ZodLiteral<"assistant">;
|
|
257
|
+
xpertId: z.ZodString;
|
|
258
|
+
}, "strict", z.ZodTypeAny, {
|
|
259
|
+
type?: "assistant";
|
|
260
|
+
xpertId?: string;
|
|
261
|
+
}, {
|
|
262
|
+
type?: "assistant";
|
|
263
|
+
xpertId?: string;
|
|
264
|
+
}>;
|
|
265
|
+
export type AgentRuntimeModelSource = z.output<typeof agentRuntimeModelSourceSchema>;
|
|
@@ -26,7 +26,13 @@ export declare enum ModelGatewayUsageSourceEnum {
|
|
|
26
26
|
}
|
|
27
27
|
export declare enum ModelGatewayUsageChannelEnum {
|
|
28
28
|
Xpert = "xpert",
|
|
29
|
-
ExternalApi = "external_api"
|
|
29
|
+
ExternalApi = "external_api",
|
|
30
|
+
/** Managed agent invocation usage, regardless of where the runtime executes. */
|
|
31
|
+
AgentRuntime = "agent_runtime",
|
|
32
|
+
/** User-launched CLI session usage, separate from managed invocations. */
|
|
33
|
+
Cli = "cli",
|
|
34
|
+
/** CLI child launched by an Assistant shell execution. */
|
|
35
|
+
Shell = "shell"
|
|
30
36
|
}
|
|
31
37
|
export declare const MODEL_GATEWAY_REQUESTS_PER_MINUTE_SETTING = "modelGatewayRequestsPerMinute";
|
|
32
38
|
export declare const DEFAULT_MODEL_GATEWAY_REQUESTS_PER_MINUTE = 60;
|
|
@@ -81,8 +87,14 @@ export interface IModelGatewayCall extends IBasePerTenantAndOrganizationEntityMo
|
|
|
81
87
|
requestId: string;
|
|
82
88
|
userId: string;
|
|
83
89
|
userName?: string | null;
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
/** Authorization path, not the usage channel; persisted rows default to external_api for legacy calls. */
|
|
91
|
+
source?: 'external_api' | 'execution_grant';
|
|
92
|
+
/** Required for execution_grant calls; null for external_api calls. */
|
|
93
|
+
grantId?: string | null;
|
|
94
|
+
/** External API key ID; null when authorized by an execution grant. */
|
|
95
|
+
apiKeyId: string | null;
|
|
96
|
+
/** Model publication record ID; null for execution grants that bind models directly. */
|
|
97
|
+
publicationId: string | null;
|
|
86
98
|
externalModelId: string;
|
|
87
99
|
provider: string;
|
|
88
100
|
model: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ModelExecutionUsageContext, ModelExecutionEnvironment } from './model-execution.model';
|
|
2
|
+
import type { ModelGatewayUsageChannelEnum } from './model-gateway.model';
|
|
3
|
+
import type { TTokenUsage } from '../agent/token';
|
|
1
4
|
import type { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
5
|
import type { AiModelTypeEnum } from '../agent';
|
|
3
6
|
import type { LLMPriceAuthority, LLMPriceBreakdownItem, ModelPriceDailyTimeWindow } from './ai-model.model';
|
|
@@ -100,6 +103,14 @@ export type ModelUsageReportResult = {
|
|
|
100
103
|
ledgerIds: string[];
|
|
101
104
|
};
|
|
102
105
|
export interface IModelUsageLedger extends IBasePerTenantAndOrganizationEntityModel {
|
|
106
|
+
/** Assistant attributed to this usage; absent when no assistant context is available. */
|
|
107
|
+
xpertId?: string | null;
|
|
108
|
+
/** Product entry channel for usage attribution; historical entries may omit it. */
|
|
109
|
+
usageChannel?: ModelGatewayUsageChannelEnum | null;
|
|
110
|
+
/** Execution snapshot shared with the points ledger; absent for non-execution or historical usage. */
|
|
111
|
+
executionContext?: ModelExecutionUsageContext | null;
|
|
112
|
+
/** Cache counts are subsets of input, and reasoning of output; never add them to totalTokens again. */
|
|
113
|
+
tokenDetails?: Pick<TTokenUsage, 'cacheReadInputTokens' | 'cacheWriteInputTokens' | 'reasoningTokens'> | null;
|
|
103
114
|
requestId: string;
|
|
104
115
|
revision: number;
|
|
105
116
|
userId?: string | null;
|
|
@@ -160,6 +171,14 @@ export interface IModelChargeLedger extends IBasePerTenantAndOrganizationEntityM
|
|
|
160
171
|
exchangeRate?: number | null;
|
|
161
172
|
}
|
|
162
173
|
export type ModelUsageLedgerQuery = {
|
|
174
|
+
/** These dimensions further narrow the existing tenant, organization and user scope. */
|
|
175
|
+
usageChannel?: ModelGatewayUsageChannelEnum;
|
|
176
|
+
environmentType?: ModelExecutionEnvironment['type'];
|
|
177
|
+
assistantId?: string;
|
|
178
|
+
conversationId?: string;
|
|
179
|
+
/** CLI session ID or managed invocation ID. */
|
|
180
|
+
executionId?: string;
|
|
181
|
+
tool?: string;
|
|
163
182
|
start?: string;
|
|
164
183
|
end?: string;
|
|
165
184
|
provider?: string;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import type { TXpertProjectTaskStatus, IXpertProjectTaskExecution } from './xpert-project.model';
|
|
2
2
|
import type { TAvatar } from '../types';
|
|
3
|
+
import type { ProjectTaskTypePresentation } from './project-task-type.model';
|
|
3
4
|
/** Stable logical work identity. Attempts and conversations never substitute for a task. */
|
|
4
5
|
export interface ProjectTaskNode {
|
|
5
6
|
id: string;
|
|
6
7
|
title: string;
|
|
7
8
|
status: TXpertProjectTaskStatus;
|
|
9
|
+
/** Measured completion percentage (0–100); null/omitted means unknown. Independent of status. */
|
|
10
|
+
progress?: number | null;
|
|
8
11
|
kind: 'task' | 'summary' | 'milestone';
|
|
12
|
+
/** Business classification, independent of hierarchy, status and assignee. */
|
|
13
|
+
taskType?: string | null;
|
|
14
|
+
/** Resolved by the owning provider's registration; unknown types have no presentation. */
|
|
15
|
+
presentation?: ProjectTaskTypePresentation | null;
|
|
16
|
+
/** Latest implementation executor; reviews do not replace it. */
|
|
17
|
+
executor?: {
|
|
18
|
+
provider: string;
|
|
19
|
+
toolId?: string;
|
|
20
|
+
} | null;
|
|
9
21
|
parentTaskId: string | null;
|
|
10
22
|
predecessorIds: string[];
|
|
11
23
|
providerKey: string | null;
|