@meshmakers/octo-ai-console 3.5.780 → 3.5.800
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.
|
@@ -1,194 +1,192 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { EnvironmentProviders, InjectionToken } from "@angular/core";
|
|
6
|
+
import { Observable, ReplaySubject, Subject } from "rxjs";
|
|
5
7
|
/**
|
|
6
8
|
* Status names emitted by the adapter's session lifecycle (RtSessionStatusEnum in C#).
|
|
7
9
|
* Wire format is the enum name so the UI does not need to know the underlying integer
|
|
8
10
|
* mapping — this union mirrors the values currently emitted on the wire.
|
|
9
11
|
*/
|
|
10
|
-
type AiSessionStatus = 'Queued' | 'Running' | 'Paused' | 'Completed' | 'Failed' | 'Cancelled' | 'QuotaBlocked' | 'RateLimited';
|
|
12
|
+
export type AiSessionStatus = 'Queued' | 'Running' | 'Paused' | 'Completed' | 'Failed' | 'Cancelled' | 'QuotaBlocked' | 'RateLimited';
|
|
11
13
|
/**
|
|
12
14
|
* Job kinds classify the prompt-template family + tool-policy track. Mirrors
|
|
13
15
|
* RtJobKindEnum in System.Ai-3. Phase-1 default is `DataModel`.
|
|
14
16
|
*/
|
|
15
|
-
type AiJobKind = 'DataModel' | 'Application' | 'Deployment' | 'Investigation';
|
|
17
|
+
export type AiJobKind = 'DataModel' | 'Application' | 'Deployment' | 'Investigation';
|
|
16
18
|
/**
|
|
17
19
|
* Wire shape returned from every adapter session endpoint. Mirrors
|
|
18
20
|
* `SessionResponse` on the C# side (src/AiServices/TenantApi/v1/Models).
|
|
19
21
|
*/
|
|
20
|
-
interface AiSessionDto {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
export interface AiSessionDto {
|
|
23
|
+
readonly sessionRtId: string;
|
|
24
|
+
readonly jobRtId: string;
|
|
25
|
+
readonly goalSummary: string;
|
|
26
|
+
readonly status: AiSessionStatus;
|
|
27
|
+
readonly startedAt: string;
|
|
28
|
+
readonly completedAt?: string | null;
|
|
29
|
+
readonly tokensConsumed: number;
|
|
30
|
+
readonly ownerUserId: string;
|
|
31
|
+
/**
|
|
32
|
+
* Per-session preview URL (#4136) — present on sessions whose worker pod
|
|
33
|
+
* has the preview-deploy sidecar enabled AND the agent's
|
|
34
|
+
* `npm run build:prod` has emitted a dist under the convention path
|
|
35
|
+
* (`/workspaces/preview/{sessionRtId}/dist`). The server composes the URL
|
|
36
|
+
* via `AiWorkspaceOptions.PreviewUrlPattern`; absent / empty when the
|
|
37
|
+
* feature is off or no build is ready yet.
|
|
38
|
+
*/
|
|
39
|
+
readonly previewUrl?: string | null;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
42
|
* Quota gate decision snapshot as observed at the moment a session was created (or
|
|
41
43
|
* polled). Mirrors `QuotaSnapshot` server-side. `decision` is the enum name; useful
|
|
42
44
|
* values are `Admit` / `Queue` / `BlockMonthlyCap` etc.
|
|
43
45
|
*/
|
|
44
|
-
interface AiQuotaSnapshotDto {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
export interface AiQuotaSnapshotDto {
|
|
47
|
+
readonly decision: string;
|
|
48
|
+
readonly concurrentJobsCap: number;
|
|
49
|
+
readonly maxSessionsQueuedCap: number;
|
|
50
|
+
readonly currentActive: number;
|
|
51
|
+
readonly currentQueued: number;
|
|
52
|
+
readonly queuePosition: number;
|
|
51
53
|
}
|
|
52
54
|
/**
|
|
53
55
|
* Body for `POST /{tenantId}/v1/sessions`. The owning user is taken from the JWT
|
|
54
56
|
* subject claim — clients never send a user id on the request.
|
|
55
57
|
*/
|
|
56
|
-
interface CreateSessionRequestDto {
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
export interface CreateSessionRequestDto {
|
|
59
|
+
readonly goal: string;
|
|
60
|
+
readonly jobKind?: AiJobKind;
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
63
|
* Response for `POST /{tenantId}/v1/sessions`. Carries the freshly persisted
|
|
62
64
|
* session plus the quota decision so the UI can render a "Running" pill or a
|
|
63
65
|
* "Queued (3 / 10)" pill without a second round-trip.
|
|
64
66
|
*/
|
|
65
|
-
interface CreateSessionResponseDto {
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
export interface CreateSessionResponseDto {
|
|
68
|
+
readonly session: AiSessionDto;
|
|
69
|
+
readonly quota: AiQuotaSnapshotDto;
|
|
68
70
|
}
|
|
69
|
-
|
|
70
71
|
/**
|
|
71
72
|
* Event kinds emitted as stream-json lines by the Claude Code worker (and synthetic
|
|
72
73
|
* lines from the orchestrator). Mirrors `RtAiSessionEventKindEnum` in System.Ai-3.
|
|
73
74
|
*/
|
|
74
|
-
type AiSessionEventKind = 'Message' | 'ToolCall' | 'ToolResult' | 'StatusChange' | 'Hook' | 'Error';
|
|
75
|
+
export type AiSessionEventKind = 'Message' | 'ToolCall' | 'ToolResult' | 'StatusChange' | 'Hook' | 'Error';
|
|
75
76
|
/**
|
|
76
77
|
* Payload pushed by the adapter's SignalR `OnSessionEventAsync` callback. Mirrors
|
|
77
78
|
* `SessionEventEnvelope` on the C# side.
|
|
78
79
|
*/
|
|
79
|
-
interface AiSessionEventDto {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
export interface AiSessionEventDto {
|
|
81
|
+
readonly sessionId: string;
|
|
82
|
+
readonly kind: AiSessionEventKind;
|
|
83
|
+
readonly sequence: number;
|
|
84
|
+
readonly payload: string;
|
|
85
|
+
readonly actorRef: string;
|
|
86
|
+
readonly at: string;
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* Payload pushed by `OnSessionStatusChangedAsync`. Mirrors
|
|
89
90
|
* `SessionStatusChangedEnvelope` on the C# side.
|
|
90
91
|
*/
|
|
91
|
-
interface AiSessionStatusChangedDto {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
export interface AiSessionStatusChangedDto {
|
|
93
|
+
readonly sessionId: string;
|
|
94
|
+
readonly newStatus: AiSessionStatus;
|
|
95
|
+
readonly reason?: string | null;
|
|
96
|
+
readonly at: string;
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
99
|
* Decoded tool-call lifted from an `AiSessionEvent` payload. Owned by the UI
|
|
99
100
|
* because the adapter wire format is a stream-json string and the components
|
|
100
101
|
* render structured fields.
|
|
101
102
|
*/
|
|
102
|
-
interface AiToolCallDto {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
export interface AiToolCallDto {
|
|
104
|
+
readonly sessionId: string;
|
|
105
|
+
readonly callId: string;
|
|
106
|
+
readonly toolName: string;
|
|
107
|
+
readonly arguments: unknown;
|
|
108
|
+
readonly result?: unknown;
|
|
109
|
+
readonly status: 'Pending' | 'Approved' | 'Rejected' | 'Succeeded' | 'Failed';
|
|
110
|
+
readonly startedAt: string;
|
|
111
|
+
readonly completedAt?: string | null;
|
|
112
|
+
readonly durationMs?: number | null;
|
|
112
113
|
}
|
|
113
|
-
|
|
114
114
|
/**
|
|
115
115
|
* Approval outcome — mirrors the `ApprovalOutcome` enum the adapter writes back
|
|
116
116
|
* after the user decides. The hub serialises the enum name on the wire.
|
|
117
117
|
*/
|
|
118
|
-
type AiApprovalOutcome = 'Approved' | 'Rejected';
|
|
118
|
+
export type AiApprovalOutcome = 'Approved' | 'Rejected';
|
|
119
119
|
/**
|
|
120
120
|
* Why the approval gate fired. Mirrors `RtApprovalReasonEnum` in System.Ai-3.
|
|
121
121
|
* The strings match the C# enum value names verbatim — the adapter serialises
|
|
122
122
|
* the enum name, not its integer value, on the wire.
|
|
123
123
|
*/
|
|
124
|
-
type AiApprovalReason = 'HighRiskTool' | 'PerToolOverride' | 'PolicyDenied' | 'TenantOverride' | 'TimeoutResume';
|
|
124
|
+
export type AiApprovalReason = 'HighRiskTool' | 'PerToolOverride' | 'PolicyDenied' | 'TenantOverride' | 'TimeoutResume';
|
|
125
125
|
/**
|
|
126
126
|
* Payload pushed by `OnApprovalRequestedAsync`. Mirrors
|
|
127
127
|
* `ApprovalRequestedEnvelope` on the C# side.
|
|
128
128
|
*/
|
|
129
|
-
interface AiApprovalRequestedDto {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
export interface AiApprovalRequestedDto {
|
|
130
|
+
readonly requestId: string;
|
|
131
|
+
readonly sessionId: string;
|
|
132
|
+
readonly toolName: string;
|
|
133
|
+
readonly payload: string;
|
|
134
|
+
readonly reason: AiApprovalReason | string;
|
|
135
|
+
readonly at: string;
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Payload pushed by `OnApprovalDecidedAsync`. Mirrors `ApprovalDecidedEnvelope`
|
|
139
139
|
* on the C# side. Fanned to every connection so a UI in a sibling browser tab
|
|
140
140
|
* dismisses its modal too.
|
|
141
141
|
*/
|
|
142
|
-
interface AiApprovalDecidedDto {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
export interface AiApprovalDecidedDto {
|
|
143
|
+
readonly requestId: string;
|
|
144
|
+
readonly outcome: AiApprovalOutcome;
|
|
145
|
+
readonly comment?: string | null;
|
|
146
|
+
readonly decidedBy: string;
|
|
147
|
+
readonly at: string;
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* Body for `POST /{tenantId}/v1/sessions/{sessionId}/approvals/{requestId}`.
|
|
151
151
|
* The UI sends the user's decision; the server fans out
|
|
152
152
|
* `OnApprovalDecidedAsync` to every connection.
|
|
153
153
|
*/
|
|
154
|
-
interface AiApprovalDecisionDto {
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
export interface AiApprovalDecisionDto {
|
|
155
|
+
readonly outcome: AiApprovalOutcome;
|
|
156
|
+
readonly comment?: string;
|
|
157
157
|
}
|
|
158
|
-
|
|
159
158
|
/**
|
|
160
159
|
* Severity of a quota warning. `Warning` fires at 80% of the daily-tokens cap,
|
|
161
160
|
* `Critical` fires at 100%. Mirrors the C# discriminator string.
|
|
162
161
|
*/
|
|
163
|
-
type AiQuotaSeverity = 'Warning' | 'Critical';
|
|
162
|
+
export type AiQuotaSeverity = 'Warning' | 'Critical';
|
|
164
163
|
/**
|
|
165
164
|
* Payload pushed by the adapter's `OnQuotaWarningAsync` SignalR callback.
|
|
166
165
|
* Broadcast to every connection for the tenant when the daily-tokens budget
|
|
167
166
|
* crosses 80% or 100%. UI renders a banner with the embedded numbers.
|
|
168
167
|
*/
|
|
169
|
-
interface AiQuotaWarningDto {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
export interface AiQuotaWarningDto {
|
|
169
|
+
readonly severity: AiQuotaSeverity;
|
|
170
|
+
readonly thresholdPercent: number;
|
|
171
|
+
readonly tokensConsumed: number;
|
|
172
|
+
readonly tokensPerDayCap: number;
|
|
173
|
+
readonly at: string;
|
|
175
174
|
}
|
|
176
|
-
|
|
177
175
|
/**
|
|
178
176
|
* Scopes a one-time credential-registration ticket authorises. Mirrors
|
|
179
177
|
* `RtTicketScopeEnum` in System.Ai-3 (C# side: enum members
|
|
180
178
|
* `CredentialRegister`, `DevSshKeyRegister`).
|
|
181
179
|
*/
|
|
182
|
-
type AiCredentialTicketScope = 'CredentialRegister' | 'DevSshKeyRegister';
|
|
180
|
+
export type AiCredentialTicketScope = 'CredentialRegister' | 'DevSshKeyRegister';
|
|
183
181
|
/**
|
|
184
182
|
* Body for `POST /{tenantId}/v1/credentials/tickets`. The admin in Refinery
|
|
185
183
|
* Studio fills this in to mint a one-time code the developer / operator
|
|
186
184
|
* redeems from their own machine (#4133). `ttlMinutes` is clamped server-side
|
|
187
185
|
* to 60 minutes; omitting it defaults to 5 minutes.
|
|
188
186
|
*/
|
|
189
|
-
interface IssueAiCredentialTicketRequestDto {
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
export interface IssueAiCredentialTicketRequestDto {
|
|
188
|
+
readonly scope: AiCredentialTicketScope;
|
|
189
|
+
readonly ttlMinutes?: number;
|
|
192
190
|
}
|
|
193
191
|
/**
|
|
194
192
|
* Wire shape returned from `POST /{tenantId}/v1/credentials/tickets`. The
|
|
@@ -196,48 +194,46 @@ interface IssueAiCredentialTicketRequestDto {
|
|
|
196
194
|
* the server stores only the SHA-256 hash, so a future GET cannot re-derive
|
|
197
195
|
* it (#4133, concept §10).
|
|
198
196
|
*/
|
|
199
|
-
interface IssueAiCredentialTicketResponseDto {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
export interface IssueAiCredentialTicketResponseDto {
|
|
198
|
+
readonly rtId: string;
|
|
199
|
+
readonly code: string;
|
|
200
|
+
readonly expiresAt: string;
|
|
201
|
+
readonly scope: AiCredentialTicketScope;
|
|
204
202
|
}
|
|
205
|
-
|
|
206
203
|
/**
|
|
207
204
|
* Body for `POST /{tenantId}/v1/credentials/github-pat`. The plaintext token is
|
|
208
205
|
* validated against GitHub's `/user` endpoint before encryption — a refused
|
|
209
206
|
* token comes back as HTTP 422 + `error: 'github_refused_token'`.
|
|
210
207
|
*/
|
|
211
|
-
interface RegisterAiGitHubPatRequestDto {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
export interface RegisterAiGitHubPatRequestDto {
|
|
209
|
+
/** Operator-supplied label so PATs are tellable apart in the list view. */
|
|
210
|
+
readonly name: string;
|
|
211
|
+
/** Plaintext token. Never persisted client-side; cleared from the form on submit. */
|
|
212
|
+
readonly token: string;
|
|
213
|
+
/** Free-form scope hint — purely informational. */
|
|
214
|
+
readonly scope?: string;
|
|
218
215
|
}
|
|
219
216
|
/**
|
|
220
217
|
* Wire shape returned by `GET /{tenantId}/v1/credentials/github-pat`. Carries
|
|
221
218
|
* neither the plaintext token nor the encrypted ciphertext — only enough to
|
|
222
219
|
* render a row + offer Revoke.
|
|
223
220
|
*/
|
|
224
|
-
interface AiGitHubPatDto {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
|
|
221
|
+
export interface AiGitHubPatDto {
|
|
222
|
+
/** Binding rtId — pass to delete. */
|
|
223
|
+
readonly rtId: string;
|
|
224
|
+
/** Operator-supplied label from registration. */
|
|
225
|
+
readonly name: string;
|
|
226
|
+
/** Operator-supplied free-form scope hint. */
|
|
227
|
+
readonly scope: string;
|
|
228
|
+
/** Last four characters of the plaintext token preceded by "…" (e.g. "…ABCD"). */
|
|
229
|
+
readonly maskedTail: string;
|
|
230
|
+
/**
|
|
231
|
+
* GitHub login the token authenticated as during registration. Null when the
|
|
232
|
+
* binding's ciphertext is unreadable (rotation gone wrong) — UI should hint
|
|
233
|
+
* "revoke and re-register" in that case.
|
|
234
|
+
*/
|
|
235
|
+
readonly gitHubLogin?: string | null;
|
|
236
|
+
}
|
|
241
237
|
/**
|
|
242
238
|
* Wire shape returned by `GET /{tenantId}/v1/app-templates` (#4145). Each entry
|
|
243
239
|
* is one option in the Studio's "New App from Template" wizard. The wizard
|
|
@@ -247,79 +243,78 @@ interface AiGitHubPatDto {
|
|
|
247
243
|
* (`src/AiServices/TenantApi/v1/Models/AppTemplateResponse.cs`). The JSON is
|
|
248
244
|
* camel-cased on the wire; the C# DTO is PascalCased server-side.
|
|
249
245
|
*/
|
|
250
|
-
interface AiAppTemplateDto {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
246
|
+
export interface AiAppTemplateDto {
|
|
247
|
+
/** Stable identifier the wizard echoes on submit (`crud-list`, `dashboard`, `form-only`). */
|
|
248
|
+
readonly id: string;
|
|
249
|
+
/** Display name for the template picker. */
|
|
250
|
+
readonly name: string;
|
|
251
|
+
/** One-paragraph description shown next to the picker entry. */
|
|
252
|
+
readonly description: string;
|
|
253
|
+
/**
|
|
254
|
+
* JobKind enum key the adapter expects when the wizard POSTs the session.
|
|
255
|
+
* The wire is the CK enum key as string — see `AiJobKind` for the values
|
|
256
|
+
* the adapter currently emits. Today every Phase-1 template uses
|
|
257
|
+
* `Application`.
|
|
258
|
+
*/
|
|
259
|
+
readonly jobKind: AiJobKind;
|
|
260
|
+
/**
|
|
261
|
+
* Handlebars-style template the wizard interpolates with operator inputs
|
|
262
|
+
* (e.g. `{{projectName}}`, `{{primaryEntity}}`). The rendered text is what
|
|
263
|
+
* goes onto `CreateSessionRequestDto.goal` — the adapter never interpolates,
|
|
264
|
+
* so the operator sees the final Goal in the wizard before submit.
|
|
265
|
+
*/
|
|
266
|
+
readonly goalTemplate: string;
|
|
267
|
+
/**
|
|
268
|
+
* Names of the placeholders the wizard must collect before enabling Submit.
|
|
269
|
+
* Drives the form's required-field gate without the wizard having to parse
|
|
270
|
+
* `goalTemplate`.
|
|
271
|
+
*/
|
|
272
|
+
readonly requiredPlaceholders: readonly string[];
|
|
277
273
|
}
|
|
278
274
|
/**
|
|
279
275
|
* The shape the wizard emits on Submit. The host page is expected to render
|
|
280
276
|
* `goal` (interpolated from the picked template) into a
|
|
281
277
|
* `CreateSessionRequestDto` and call `createSession` on the adapter client.
|
|
282
278
|
*/
|
|
283
|
-
interface AiNewAppSubmission {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
279
|
+
export interface AiNewAppSubmission {
|
|
280
|
+
readonly templateId: string;
|
|
281
|
+
readonly jobKind: AiJobKind;
|
|
282
|
+
readonly projectName: string;
|
|
283
|
+
readonly primaryEntity: string;
|
|
284
|
+
/** The fully interpolated Goal string — what the wizard would POST on submit. */
|
|
285
|
+
readonly goal: string;
|
|
290
286
|
}
|
|
291
|
-
|
|
292
287
|
/**
|
|
293
288
|
* Configuration the host application supplies via {@link provideOctoAiConsole}.
|
|
294
289
|
* Every field is required so the library never falls back to a hard-coded URL or
|
|
295
290
|
* tenant id — host apps that wire the library through their own DI container can
|
|
296
291
|
* surface placeholders explicitly instead.
|
|
297
292
|
*/
|
|
298
|
-
interface AiAdapterOptions {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
293
|
+
export interface AiAdapterOptions {
|
|
294
|
+
/**
|
|
295
|
+
* Absolute base URL of the AI Adapter REST API, e.g. `https://ai.acme.cloud`.
|
|
296
|
+
* Must NOT include a trailing slash. The library appends
|
|
297
|
+
* `/{tenantId}/v1/sessions...` itself.
|
|
298
|
+
*/
|
|
299
|
+
readonly baseUrl: string;
|
|
300
|
+
/**
|
|
301
|
+
* Tenant whose sessions the host wants to surface. The library renders the
|
|
302
|
+
* tenant id into every REST URL. Host apps that have multiple tenants must
|
|
303
|
+
* compose the provider with the tenant id from their routing context.
|
|
304
|
+
*/
|
|
305
|
+
readonly tenantId: string;
|
|
306
|
+
/**
|
|
307
|
+
* SignalR hub path, relative to the base URL, e.g. `/hubs/ai`. Used by
|
|
308
|
+
* `AiSessionStreamService` to connect when a host calls
|
|
309
|
+
* `streamSession(sessionId)`.
|
|
310
|
+
*/
|
|
311
|
+
readonly hubPath: string;
|
|
317
312
|
}
|
|
318
313
|
/**
|
|
319
314
|
* DI token the services in this library read at construction time.
|
|
320
315
|
* Provided by {@link provideOctoAiConsole}.
|
|
321
316
|
*/
|
|
322
|
-
declare const AI_ADAPTER_OPTIONS: InjectionToken<AiAdapterOptions>;
|
|
317
|
+
export declare const AI_ADAPTER_OPTIONS: InjectionToken<AiAdapterOptions>;
|
|
323
318
|
/**
|
|
324
319
|
* Minimal subset of the `@microsoft/signalr` `HubConnection` surface the library
|
|
325
320
|
* exercises. The interface stays in the public API so host apps can supply
|
|
@@ -329,25 +324,25 @@ declare const AI_ADAPTER_OPTIONS: InjectionToken<AiAdapterOptions>;
|
|
|
329
324
|
* structural lets the library stay agnostic of the `@microsoft/signalr` major
|
|
330
325
|
* version line the host has installed.
|
|
331
326
|
*/
|
|
332
|
-
interface AiHubConnectionLike {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
327
|
+
export interface AiHubConnectionLike {
|
|
328
|
+
on(methodName: string, handler: (payload: unknown) => void): void;
|
|
329
|
+
start(): Promise<void>;
|
|
330
|
+
stop(): Promise<void>;
|
|
331
|
+
invoke<T = unknown>(methodName: string, ...args: unknown[]): Promise<T>;
|
|
332
|
+
onreconnected(handler: (connectionId?: string) => void): void;
|
|
338
333
|
}
|
|
339
334
|
/**
|
|
340
335
|
* Builds a hub connection against the resolved URL. Return null when streaming
|
|
341
336
|
* is not wired in this deployment yet — the stream service then quietly skips
|
|
342
337
|
* the live channel and behaves exactly like the Phase-1 stub.
|
|
343
338
|
*/
|
|
344
|
-
type AiSessionStreamConnectionFactory = (hubUrl: string) => AiHubConnectionLike | null;
|
|
339
|
+
export type AiSessionStreamConnectionFactory = (hubUrl: string) => AiHubConnectionLike | null;
|
|
345
340
|
/**
|
|
346
341
|
* Optional DI token a host application provides to enable the live SignalR
|
|
347
342
|
* channel on {@link AiSessionStreamService}. When absent, the service degrades
|
|
348
343
|
* to REST-only backfill.
|
|
349
344
|
*/
|
|
350
|
-
declare const AI_SESSION_STREAM_CONNECTION_FACTORY: InjectionToken<AiSessionStreamConnectionFactory>;
|
|
345
|
+
export declare const AI_SESSION_STREAM_CONNECTION_FACTORY: InjectionToken<AiSessionStreamConnectionFactory>;
|
|
351
346
|
/**
|
|
352
347
|
* Composable provider that surfaces the library's adapter configuration to the
|
|
353
348
|
* Angular DI container. Host applications call this once in `app.config.ts`:
|
|
@@ -362,8 +357,7 @@ declare const AI_SESSION_STREAM_CONNECTION_FACTORY: InjectionToken<AiSessionStre
|
|
|
362
357
|
* ]
|
|
363
358
|
* ```
|
|
364
359
|
*/
|
|
365
|
-
declare function provideOctoAiConsole(options: AiAdapterOptions): EnvironmentProviders;
|
|
366
|
-
|
|
360
|
+
export declare function provideOctoAiConsole(options: AiAdapterOptions): EnvironmentProviders;
|
|
367
361
|
/**
|
|
368
362
|
* Typed REST client for the AI Adapter's session endpoints. Every method maps
|
|
369
363
|
* 1:1 to a controller route on the C# side
|
|
@@ -384,126 +378,125 @@ declare function provideOctoAiConsole(options: AiAdapterOptions): EnvironmentPro
|
|
|
384
378
|
* inject this service pick up the route-level provider via the element
|
|
385
379
|
* injector hierarchy.
|
|
386
380
|
*/
|
|
387
|
-
declare class AiAdapterClientService {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
381
|
+
export declare class AiAdapterClientService {
|
|
382
|
+
private readonly http;
|
|
383
|
+
private readonly options;
|
|
384
|
+
/**
|
|
385
|
+
* `GET /{tenantId}/v1/sessions` — list all sessions for the configured tenant.
|
|
386
|
+
* Optional `status` filter narrows to one lifecycle state when present.
|
|
387
|
+
*/
|
|
388
|
+
listSessions(status?: string): Observable<AiSessionDto[]>;
|
|
389
|
+
/** `GET /{tenantId}/v1/sessions/{sessionId}` — single session by rtId. */
|
|
390
|
+
getSession(sessionId: string): Observable<AiSessionDto>;
|
|
391
|
+
/**
|
|
392
|
+
* `POST /{tenantId}/v1/sessions` — start a new session. Returns the persisted
|
|
393
|
+
* session plus the quota gate's decision so the caller can render either a
|
|
394
|
+
* "Running" pill or a "Queued (n)" pill without a second round-trip.
|
|
395
|
+
*/
|
|
396
|
+
createSession(request: CreateSessionRequestDto): Observable<CreateSessionResponseDto>;
|
|
397
|
+
/**
|
|
398
|
+
* `POST /{tenantId}/v1/sessions/{sessionId}/cancel` — request graceful
|
|
399
|
+
* cancellation; the orchestrator transitions the session to `Cancelled`
|
|
400
|
+
* once the worker has acknowledged.
|
|
401
|
+
*/
|
|
402
|
+
cancelSession(sessionId: string): Observable<AiSessionDto>;
|
|
403
|
+
/**
|
|
404
|
+
* `DELETE /{tenantId}/v1/sessions/{sessionId}` — hard-delete a terminal
|
|
405
|
+
* session. The server refuses non-terminal sessions with HTTP 409 and the
|
|
406
|
+
* <code>invalid_state_transition</code> error code, so callers should cancel
|
|
407
|
+
* first when the session is still in flight. 204 on success; the response
|
|
408
|
+
* has no body.
|
|
409
|
+
*/
|
|
410
|
+
deleteSession(sessionId: string): Observable<void>;
|
|
411
|
+
/**
|
|
412
|
+
* `POST /{tenantId}/v1/sessions/{sessionId}/messages` — append a follow-up
|
|
413
|
+
* user turn to a `Completed` session. The adapter re-materialises the
|
|
414
|
+
* workspace (fresh credential snapshot), recovers Claude's session id from
|
|
415
|
+
* the persisted `system/init` event of the original turn, and spawns
|
|
416
|
+
* <code>claude --resume <id></code> so the conversation context
|
|
417
|
+
* carries over. The next turn's events stream on the same SignalR channel
|
|
418
|
+
* as the prior turn — there is no separate subscription to set up.
|
|
419
|
+
*
|
|
420
|
+
* Server response is 202 with the updated session DTO (status flipped back
|
|
421
|
+
* to `Running`); the caller can use the returned status to drive an
|
|
422
|
+
* optimistic UI update. Non-Completed sessions return 409 with
|
|
423
|
+
* <code>invalid_state_transition</code>; a session whose first turn died
|
|
424
|
+
* before claude emitted init returns 409 with
|
|
425
|
+
* <code>claude_session_id_not_captured</code>.
|
|
426
|
+
*/
|
|
427
|
+
sendMessage(sessionId: string, text: string): Observable<AiSessionDto>;
|
|
428
|
+
/**
|
|
429
|
+
* `GET /{tenantId}/v1/sessions/{sessionId}/events?sinceSequence=N` — replay
|
|
430
|
+
* persisted events for a session. UI uses this on reconnect to backfill any
|
|
431
|
+
* events SignalR missed while disconnected (drives the resume-from-sequence
|
|
432
|
+
* path in {@link AiSessionStreamService}).
|
|
433
|
+
*/
|
|
434
|
+
listEvents(sessionId: string, sinceSequence?: number): Observable<AiSessionEventDto[]>;
|
|
435
|
+
/**
|
|
436
|
+
* `POST /{tenantId}/v1/sessions/{sessionId}/approvals/{requestId}` — submit
|
|
437
|
+
* the user's decision on a paused approval gate. Server fans
|
|
438
|
+
* `OnApprovalDecidedAsync` to every connection on the session.
|
|
439
|
+
*/
|
|
440
|
+
decideApproval(sessionId: string, requestId: string, decision: AiApprovalDecisionDto): Observable<void>;
|
|
441
|
+
/**
|
|
442
|
+
* `POST /{tenantId}/v1/credentials/tickets` — mint a one-time credential-
|
|
443
|
+
* registration ticket (#4133). The admin sees the plaintext code once in
|
|
444
|
+
* the response; the server stores only the SHA-256 hash. The matching
|
|
445
|
+
* redemption call (`POST /v1/credentials/tickets/redeem`) is anonymous and
|
|
446
|
+
* NOT in this client because the redeemer is by design a different person
|
|
447
|
+
* on a different machine — they use the bastion CLI, not the Studio.
|
|
448
|
+
*/
|
|
449
|
+
issueCredentialTicket(request: IssueAiCredentialTicketRequestDto): Observable<IssueAiCredentialTicketResponseDto>;
|
|
450
|
+
/**
|
|
451
|
+
* `POST /{tenantId}/v1/credentials/github-pat` — register a GitHub Personal
|
|
452
|
+
* Access Token (#4124). The adapter validates the token against GitHub's
|
|
453
|
+
* `/user` endpoint before encryption; a refused token surfaces as HTTP 422
|
|
454
|
+
* with `error: 'github_refused_token'`. The response is intentionally minimal
|
|
455
|
+
* (`{ rtId }`); the host re-fetches the list so the rendering path stays
|
|
456
|
+
* shared with refresh.
|
|
457
|
+
*/
|
|
458
|
+
registerGitHubPat(request: RegisterAiGitHubPatRequestDto): Observable<{
|
|
459
|
+
rtId: string;
|
|
460
|
+
}>;
|
|
461
|
+
/**
|
|
462
|
+
* `GET /{tenantId}/v1/credentials/github-pat` — list registered PATs with a
|
|
463
|
+
* masked tail + GitHub login. Plaintext never crosses the wire.
|
|
464
|
+
*/
|
|
465
|
+
listGitHubPats(): Observable<AiGitHubPatDto[]>;
|
|
466
|
+
/**
|
|
467
|
+
* `DELETE /{tenantId}/v1/credentials/github-pat/{rtId}` — revoke a PAT. The
|
|
468
|
+
* ciphertext is deleted, not soft-tombstoned. Returns void on 204.
|
|
469
|
+
*/
|
|
470
|
+
deleteGitHubPat(rtId: string): Observable<void>;
|
|
471
|
+
/**
|
|
472
|
+
* `GET /{tenantId}/v1/app-templates` — list the Custom-App templates the
|
|
473
|
+
* adapter exposes for the wizard (#4145). Phase-1 returns the same three
|
|
474
|
+
* static entries for every tenant; the wire shape is stable so per-tenant
|
|
475
|
+
* overrides can ride it without an SPA bump.
|
|
476
|
+
*/
|
|
477
|
+
getAppTemplates(): Observable<AiAppTemplateDto[]>;
|
|
478
|
+
private tenantBase;
|
|
479
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiAdapterClientService, never>;
|
|
480
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
481
|
+
}
|
|
489
482
|
/**
|
|
490
483
|
* One open SignalR connection's worth of streams. Sessions get one
|
|
491
484
|
* `SessionStream` per `streamSession()` call; closing the returned subscription
|
|
492
485
|
* tears the connection down.
|
|
493
486
|
*/
|
|
494
|
-
interface AiSessionStream {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
487
|
+
export interface AiSessionStream {
|
|
488
|
+
/** Stream-json lines plus orchestrator markers, ordered by `sequence`. */
|
|
489
|
+
readonly events$: Observable<AiSessionEventDto>;
|
|
490
|
+
/** Lifecycle transitions for the session. */
|
|
491
|
+
readonly statusChanges$: Observable<AiSessionStatusChangedDto>;
|
|
492
|
+
/** Approval gate fired — UI opens the modal. */
|
|
493
|
+
readonly approvalsRequested$: Observable<AiApprovalRequestedDto>;
|
|
494
|
+
/** Approval resolved — UI dismisses the modal in every tab. */
|
|
495
|
+
readonly approvalsDecided$: Observable<AiApprovalDecidedDto>;
|
|
496
|
+
/** Tenant-wide quota threshold crossed — UI renders a banner. */
|
|
497
|
+
readonly quotaWarnings$: Observable<AiQuotaWarningDto>;
|
|
498
|
+
/** Tear down the underlying SignalR connection and complete all observables. */
|
|
499
|
+
disconnect(): void;
|
|
507
500
|
}
|
|
508
501
|
/**
|
|
509
502
|
* Internal wrapper around the SignalR connection. The library does not pin a
|
|
@@ -523,43 +516,42 @@ interface AiSessionStream {
|
|
|
523
516
|
* rationale: `AI_ADAPTER_OPTIONS` is a per-route token, the root injector
|
|
524
517
|
* cannot resolve it. Element-level injection picks up the route-level provider.
|
|
525
518
|
*/
|
|
526
|
-
declare class AiSessionStreamService {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
519
|
+
export declare class AiSessionStreamService {
|
|
520
|
+
private readonly options;
|
|
521
|
+
private readonly client;
|
|
522
|
+
private readonly connectionFactory;
|
|
523
|
+
/**
|
|
524
|
+
* Open a streaming session. Returns the per-stream subjects and a
|
|
525
|
+
* `disconnect()` closer. When the host has provided an
|
|
526
|
+
* {@link AI_SESSION_STREAM_CONNECTION_FACTORY}, a live SignalR connection is
|
|
527
|
+
* built against {@link hubUrl} and the five hub callbacks
|
|
528
|
+
* (`OnSessionEventAsync`, `OnSessionStatusChangedAsync`,
|
|
529
|
+
* `OnApprovalRequestedAsync`, `OnApprovalDecidedAsync`, `OnQuotaWarningAsync`)
|
|
530
|
+
* are routed into the matching subject. Without a factory, the service
|
|
531
|
+
* degrades to REST-only backfill — the original Phase-1 stub contract.
|
|
532
|
+
*
|
|
533
|
+
* Tracking the highest sequence we've emitted lets the host reconnect after a
|
|
534
|
+
* network blip by passing `sinceSequence` to {@link replay} (the SignalR
|
|
535
|
+
* `onreconnected` hook fires that with the highest seen sequence).
|
|
536
|
+
*/
|
|
537
|
+
streamSession(sessionId: string): AiSessionStream;
|
|
538
|
+
/**
|
|
539
|
+
* Backfill missing events from a known sequence number and push them into
|
|
540
|
+
* the host's existing stream. Used by a SignalR `onreconnected` hook the
|
|
541
|
+
* host wires up.
|
|
542
|
+
*/
|
|
543
|
+
replay(sessionId: string, sinceSequence: number, sink: Subject<AiSessionEventDto> | ReplaySubject<AiSessionEventDto>): void;
|
|
544
|
+
/**
|
|
545
|
+
* Tenant-scoped hub URL. Composition matches the AI Adapter's hub map —
|
|
546
|
+
* `app.MapHub<AiHub>("/{tenantId:tenantId}/aiHub")` — so the host's
|
|
547
|
+
* `hubPath` is appended after the tenant segment. Host apps that mount the
|
|
548
|
+
* hub at a different relative path override `hubPath` via
|
|
549
|
+
* `AI_ADAPTER_OPTIONS`.
|
|
550
|
+
*/
|
|
551
|
+
get hubUrl(): string;
|
|
552
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiSessionStreamService, never>;
|
|
553
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
554
|
+
}
|
|
563
555
|
/**
|
|
564
556
|
* List view of an AI Adapter tenant's sessions. The host owns data fetching —
|
|
565
557
|
* the component takes the array as an input signal and emits the rtId on
|
|
@@ -572,30 +564,44 @@ declare class AiSessionStreamService {
|
|
|
572
564
|
* status, so a Running session never offers Delete and a Completed session
|
|
573
565
|
* never offers Cancel.
|
|
574
566
|
*/
|
|
575
|
-
declare class AiSessionListComponent {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
567
|
+
export declare class AiSessionListComponent {
|
|
568
|
+
readonly sessions: import("@angular/core").InputSignal<AiSessionDto[]>;
|
|
569
|
+
readonly selectedSessionId: import("@angular/core").InputSignal<string | null>;
|
|
570
|
+
readonly sessionSelected: import("@angular/core").OutputEmitterRef<string>;
|
|
571
|
+
readonly cancelRequested: import("@angular/core").OutputEmitterRef<string>;
|
|
572
|
+
readonly deleteRequested: import("@angular/core").OutputEmitterRef<string>;
|
|
573
|
+
protected readonly orderedSessions: import("@angular/core").Signal<AiSessionDto[]>;
|
|
574
|
+
/**
|
|
575
|
+
* Terminal status set, kept in sync with the C# `AiAgentSessionService.IsTerminal`
|
|
576
|
+
* predicate. Delete is gated to this set; Cancel is gated to its complement.
|
|
577
|
+
* If the wire enum grows a new terminal kind, both predicates must be
|
|
578
|
+
* updated here AND on the server.
|
|
579
|
+
*/
|
|
580
|
+
private static readonly TERMINAL_STATUSES;
|
|
581
|
+
protected canCancel(status: AiSessionStatus): boolean;
|
|
582
|
+
protected canDelete(status: AiSessionStatus): boolean;
|
|
583
|
+
protected onSelect(sessionRtId: string): void;
|
|
584
|
+
protected onCancel(sessionRtId: string, event: MouseEvent): void;
|
|
585
|
+
protected onDelete(sessionRtId: string, event: MouseEvent): void;
|
|
586
|
+
protected age(startedAt: string): string;
|
|
587
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiSessionListComponent, never>;
|
|
588
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiSessionListComponent, "mm-ai-session-list", never, {
|
|
589
|
+
"sessions": {
|
|
590
|
+
"alias": "sessions";
|
|
591
|
+
"required": true;
|
|
592
|
+
"isSignal": true;
|
|
593
|
+
};
|
|
594
|
+
"selectedSessionId": {
|
|
595
|
+
"alias": "selectedSessionId";
|
|
596
|
+
"required": false;
|
|
597
|
+
"isSignal": true;
|
|
598
|
+
};
|
|
599
|
+
}, {
|
|
600
|
+
"sessionSelected": "sessionSelected";
|
|
601
|
+
"cancelRequested": "cancelRequested";
|
|
602
|
+
"deleteRequested": "deleteRequested";
|
|
603
|
+
}, never, never, true, never>;
|
|
604
|
+
}
|
|
599
605
|
/**
|
|
600
606
|
* Token-usage summary extracted from an `assistant` or `result` payload.
|
|
601
607
|
* Fields beyond `input` / `output` are optional because the upstream worker
|
|
@@ -603,10 +609,10 @@ declare class AiSessionListComponent {
|
|
|
603
609
|
* cache-only turns.
|
|
604
610
|
*/
|
|
605
611
|
interface ParsedTokenUsage {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
612
|
+
readonly input: number;
|
|
613
|
+
readonly output: number;
|
|
614
|
+
readonly cacheRead?: number;
|
|
615
|
+
readonly cacheCreation?: number;
|
|
610
616
|
}
|
|
611
617
|
/**
|
|
612
618
|
* A single content fragment inside an assistant event. The worker emits a
|
|
@@ -615,13 +621,13 @@ interface ParsedTokenUsage {
|
|
|
615
621
|
* the conversational flow intact (text → "I'll run X" → tool_use card).
|
|
616
622
|
*/
|
|
617
623
|
type ParsedAssistantPart = {
|
|
618
|
-
|
|
619
|
-
|
|
624
|
+
readonly type: 'text';
|
|
625
|
+
readonly text: string;
|
|
620
626
|
} | {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
627
|
+
readonly type: 'tool_use';
|
|
628
|
+
readonly id: string;
|
|
629
|
+
readonly toolName: string;
|
|
630
|
+
readonly input: unknown;
|
|
625
631
|
};
|
|
626
632
|
/**
|
|
627
633
|
* Discriminated union the chat-stream renders on. The component switches over
|
|
@@ -632,49 +638,48 @@ type ParsedAssistantPart = {
|
|
|
632
638
|
* stream-json") can surface it on demand without re-parsing.
|
|
633
639
|
*/
|
|
634
640
|
type ParsedView = {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
641
|
+
readonly kind: 'system';
|
|
642
|
+
readonly subKind: 'init' | 'hook' | 'rate-limit' | 'other';
|
|
643
|
+
readonly summary: string;
|
|
644
|
+
readonly raw: unknown;
|
|
639
645
|
} | {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
646
|
+
readonly kind: 'assistant';
|
|
647
|
+
readonly parts: readonly ParsedAssistantPart[];
|
|
648
|
+
readonly model: string | null;
|
|
649
|
+
readonly usage: ParsedTokenUsage | null;
|
|
650
|
+
readonly raw: unknown;
|
|
645
651
|
} | {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
652
|
+
readonly kind: 'tool-result';
|
|
653
|
+
readonly toolUseId: string;
|
|
654
|
+
readonly content: string;
|
|
655
|
+
readonly isError: boolean;
|
|
656
|
+
readonly raw: unknown;
|
|
651
657
|
} | {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
readonly kind: 'result';
|
|
659
|
+
readonly text: string;
|
|
660
|
+
readonly durationMs: number;
|
|
661
|
+
readonly usage: ParsedTokenUsage | null;
|
|
662
|
+
readonly costUsd: number | null;
|
|
663
|
+
readonly reason: string;
|
|
664
|
+
readonly isError: boolean;
|
|
665
|
+
readonly raw: unknown;
|
|
660
666
|
} | {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
readonly kind: 'status-change';
|
|
668
|
+
readonly status: string;
|
|
669
|
+
readonly raw: unknown;
|
|
664
670
|
} | {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
671
|
+
readonly kind: 'unknown';
|
|
672
|
+
readonly summary: string;
|
|
673
|
+
readonly raw: unknown;
|
|
668
674
|
};
|
|
669
675
|
/**
|
|
670
676
|
* Result of one parse step — wraps the source event so the renderer can still
|
|
671
677
|
* carry `sequence` / `at` / `actorRef` through to the template.
|
|
672
678
|
*/
|
|
673
679
|
interface ParsedEvent {
|
|
674
|
-
|
|
675
|
-
|
|
680
|
+
readonly event: AiSessionEventDto;
|
|
681
|
+
readonly view: ParsedView;
|
|
676
682
|
}
|
|
677
|
-
|
|
678
683
|
/**
|
|
679
684
|
* Read-only transcript of a session, derived from the events stream.
|
|
680
685
|
*
|
|
@@ -689,56 +694,66 @@ interface ParsedEvent {
|
|
|
689
694
|
* line breaks via `white-space: pre-wrap`. Picking a renderer (markdown-it vs
|
|
690
695
|
* marked) is gated on a CSP review and a markdown-corpus regression test.
|
|
691
696
|
*/
|
|
692
|
-
declare class AiChatStreamComponent {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
697
|
+
export declare class AiChatStreamComponent {
|
|
698
|
+
readonly events: import("@angular/core").InputSignal<AiSessionEventDto[]>;
|
|
699
|
+
/**
|
|
700
|
+
* Sorted + parsed. Recomputes whenever the input signal changes; the sort
|
|
701
|
+
* is stable so live appends from SignalR keep prior render positions.
|
|
702
|
+
*/
|
|
703
|
+
protected readonly parsedEvents: import("@angular/core").Signal<ParsedEvent[]>;
|
|
704
|
+
/**
|
|
705
|
+
* Per-event "show raw JSON" toggle. Keyed by sequence so live appends
|
|
706
|
+
* don't flicker existing toggles closed. A `Set<number>` rather than a
|
|
707
|
+
* record so add / delete avoids `keyof` shenanigans.
|
|
708
|
+
*/
|
|
709
|
+
private readonly expandedSet;
|
|
710
|
+
protected isExpanded(sequence: number): boolean;
|
|
711
|
+
protected toggleRaw(sequence: number): void;
|
|
712
|
+
/**
|
|
713
|
+
* `HH:MM:SS` formatter — full ISO is too noisy in a 30-event transcript.
|
|
714
|
+
* Returns the input unchanged if parsing fails so we don't pretend events
|
|
715
|
+
* we can't read are recent.
|
|
716
|
+
*/
|
|
717
|
+
protected formatTime(iso: string): string;
|
|
718
|
+
/** Compact "1234 tok" for the assistant header. */
|
|
719
|
+
protected formatTokenCount(n: number): string;
|
|
720
|
+
/** Duration in either `ms` (sub-second) or `s.SS`. */
|
|
721
|
+
protected formatDuration(ms: number): string;
|
|
722
|
+
/** Cost in EUR-style decimals; null + zero collapse to a dash. */
|
|
723
|
+
protected formatCost(usd: number | null | undefined): string;
|
|
724
|
+
/** Pretty-print arbitrary tool_use input or raw blocks for the expandable detail panel. */
|
|
725
|
+
protected formatRaw(value: unknown): string;
|
|
726
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiChatStreamComponent, never>;
|
|
727
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiChatStreamComponent, "mm-ai-chat-stream", never, {
|
|
728
|
+
"events": {
|
|
729
|
+
"alias": "events";
|
|
730
|
+
"required": true;
|
|
731
|
+
"isSignal": true;
|
|
732
|
+
};
|
|
733
|
+
}, {}, never, never, true, never>;
|
|
734
|
+
}
|
|
725
735
|
/**
|
|
726
736
|
* Expandable card surface for one tool invocation in a session transcript.
|
|
727
737
|
* Click the header to toggle arguments + result; the body is rendered as
|
|
728
738
|
* pretty-printed JSON so the host doesn't need its own json formatter.
|
|
729
739
|
*/
|
|
730
|
-
declare class AiToolCallComponent {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
+
export declare class AiToolCallComponent {
|
|
741
|
+
readonly call: import("@angular/core").InputSignal<AiToolCallDto>;
|
|
742
|
+
protected readonly expanded: import("@angular/core").WritableSignal<boolean>;
|
|
743
|
+
protected readonly statusVariant: import("@angular/core").Signal<"failed" | "succeeded" | "rejected" | "pending">;
|
|
744
|
+
protected readonly argumentsJson: import("@angular/core").Signal<string>;
|
|
745
|
+
protected readonly resultJson: import("@angular/core").Signal<string | null>;
|
|
746
|
+
protected toggleExpanded(): void;
|
|
747
|
+
private format;
|
|
748
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiToolCallComponent, never>;
|
|
749
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiToolCallComponent, "mm-ai-tool-call", never, {
|
|
750
|
+
"call": {
|
|
751
|
+
"alias": "call";
|
|
752
|
+
"required": true;
|
|
753
|
+
"isSignal": true;
|
|
754
|
+
};
|
|
755
|
+
}, {}, never, never, true, never>;
|
|
740
756
|
}
|
|
741
|
-
|
|
742
757
|
/**
|
|
743
758
|
* Approval modal. The host opens it when a `AiApprovalRequestedDto` arrives on
|
|
744
759
|
* the SignalR stream, fills the `request` input, and listens for the `decide`
|
|
@@ -749,54 +764,87 @@ declare class AiToolCallComponent {
|
|
|
749
764
|
* the library doesn't pull in a positioning dependency (CDK overlay, Kendo
|
|
750
765
|
* window, ng-bootstrap, …) — each host shop already has one.
|
|
751
766
|
*/
|
|
752
|
-
declare class AiApprovalModalComponent {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
767
|
+
export declare class AiApprovalModalComponent {
|
|
768
|
+
readonly request: import("@angular/core").InputSignal<AiApprovalRequestedDto>;
|
|
769
|
+
readonly decide: import("@angular/core").OutputEmitterRef<AiApprovalDecisionDto>;
|
|
770
|
+
readonly dismiss: import("@angular/core").OutputEmitterRef<void>;
|
|
771
|
+
protected readonly comment: import("@angular/core").WritableSignal<string>;
|
|
772
|
+
protected readonly prettyPayload: import("@angular/core").Signal<string>;
|
|
773
|
+
protected approve(): void;
|
|
774
|
+
protected reject(): void;
|
|
775
|
+
protected onDismiss(): void;
|
|
776
|
+
private commentOrUndefined;
|
|
777
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiApprovalModalComponent, never>;
|
|
778
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiApprovalModalComponent, "mm-ai-approval-modal", never, {
|
|
779
|
+
"request": {
|
|
780
|
+
"alias": "request";
|
|
781
|
+
"required": true;
|
|
782
|
+
"isSignal": true;
|
|
783
|
+
};
|
|
784
|
+
}, {
|
|
785
|
+
"decide": "decide";
|
|
786
|
+
"dismiss": "dismiss";
|
|
787
|
+
}, never, never, true, never>;
|
|
788
|
+
}
|
|
766
789
|
/**
|
|
767
790
|
* Two-bar usage indicator (daily + monthly) with threshold colour state.
|
|
768
791
|
* Inputs are unit-agnostic counts and caps; the component does not parse the
|
|
769
792
|
* tenant's `AiQuotaLimit` itself — the host is expected to feed numbers the
|
|
770
793
|
* adapter already aggregated.
|
|
771
794
|
*/
|
|
772
|
-
declare class AiQuotaIndicatorComponent {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
795
|
+
export declare class AiQuotaIndicatorComponent {
|
|
796
|
+
readonly dailyConsumed: import("@angular/core").InputSignal<number>;
|
|
797
|
+
readonly dailyCap: import("@angular/core").InputSignal<number>;
|
|
798
|
+
readonly monthlyConsumed: import("@angular/core").InputSignal<number | null>;
|
|
799
|
+
readonly monthlyCap: import("@angular/core").InputSignal<number | null>;
|
|
800
|
+
protected readonly dailyPercent: import("@angular/core").Signal<number>;
|
|
801
|
+
protected readonly monthlyPercent: import("@angular/core").Signal<number | null>;
|
|
802
|
+
protected readonly dailyState: import("@angular/core").Signal<"ok" | "warning" | "critical">;
|
|
803
|
+
protected readonly monthlyState: import("@angular/core").Signal<"ok" | "warning" | "critical" | null>;
|
|
804
|
+
private percent;
|
|
805
|
+
private toState;
|
|
806
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiQuotaIndicatorComponent, never>;
|
|
807
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiQuotaIndicatorComponent, "mm-ai-quota-indicator", never, {
|
|
808
|
+
"dailyConsumed": {
|
|
809
|
+
"alias": "dailyConsumed";
|
|
810
|
+
"required": true;
|
|
811
|
+
"isSignal": true;
|
|
812
|
+
};
|
|
813
|
+
"dailyCap": {
|
|
814
|
+
"alias": "dailyCap";
|
|
815
|
+
"required": true;
|
|
816
|
+
"isSignal": true;
|
|
817
|
+
};
|
|
818
|
+
"monthlyConsumed": {
|
|
819
|
+
"alias": "monthlyConsumed";
|
|
820
|
+
"required": false;
|
|
821
|
+
"isSignal": true;
|
|
822
|
+
};
|
|
823
|
+
"monthlyCap": {
|
|
824
|
+
"alias": "monthlyCap";
|
|
825
|
+
"required": false;
|
|
826
|
+
"isSignal": true;
|
|
827
|
+
};
|
|
828
|
+
}, {}, never, never, true, never>;
|
|
829
|
+
}
|
|
787
830
|
/**
|
|
788
831
|
* Status pill that mirrors the eight values `AiSessionStatus` carries on the
|
|
789
832
|
* wire. The component is purely visual — it takes a status string in and emits
|
|
790
833
|
* a CSS class + display label that the host's stylesheet can theme via the
|
|
791
834
|
* `--mm-ai-status-*` custom properties.
|
|
792
835
|
*/
|
|
793
|
-
declare class AiJobStatusBadgeComponent {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
836
|
+
export declare class AiJobStatusBadgeComponent {
|
|
837
|
+
readonly status: import("@angular/core").InputSignal<AiSessionStatus>;
|
|
838
|
+
protected readonly variant: import("@angular/core").Signal<"running" | "queued" | "paused" | "completed" | "failed" | "blocked">;
|
|
839
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiJobStatusBadgeComponent, never>;
|
|
840
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiJobStatusBadgeComponent, "mm-ai-job-status-badge", never, {
|
|
841
|
+
"status": {
|
|
842
|
+
"alias": "status";
|
|
843
|
+
"required": true;
|
|
844
|
+
"isSignal": true;
|
|
845
|
+
};
|
|
846
|
+
}, {}, never, never, true, never>;
|
|
798
847
|
}
|
|
799
|
-
|
|
800
848
|
/**
|
|
801
849
|
* Self-service credential-ticket issuer (#4133, concept §10). Admin picks a
|
|
802
850
|
* scope + TTL, hits **Issue ticket**, copies the displayed code, hands it to
|
|
@@ -808,29 +856,28 @@ declare class AiJobStatusBadgeComponent {
|
|
|
808
856
|
* defaults so the host (Refinery Studio LCARS, demo-app, etc.) can override
|
|
809
857
|
* them via `--mm-ai-ticket-*` variables without touching the component.
|
|
810
858
|
*/
|
|
811
|
-
declare class AiCredentialTicketIssueComponent {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
|
|
859
|
+
export declare class AiCredentialTicketIssueComponent {
|
|
860
|
+
private readonly client;
|
|
861
|
+
protected readonly scope: import("@angular/core").WritableSignal<AiCredentialTicketScope>;
|
|
862
|
+
protected readonly ttlMinutes: import("@angular/core").WritableSignal<number>;
|
|
863
|
+
protected readonly issuing: import("@angular/core").WritableSignal<boolean>;
|
|
864
|
+
protected readonly issued: import("@angular/core").WritableSignal<IssueAiCredentialTicketResponseDto | null>;
|
|
865
|
+
protected readonly error: import("@angular/core").WritableSignal<string | null>;
|
|
866
|
+
protected readonly copied: import("@angular/core").WritableSignal<boolean>;
|
|
867
|
+
/** Available scope choices — kept in sync with `AiCredentialTicketScope`. */
|
|
868
|
+
protected readonly scopes: readonly {
|
|
869
|
+
value: AiCredentialTicketScope;
|
|
870
|
+
label: string;
|
|
871
|
+
hint: string;
|
|
872
|
+
}[];
|
|
873
|
+
protected onIssue(): void;
|
|
874
|
+
protected onCopy(): void;
|
|
875
|
+
protected onClear(): void;
|
|
876
|
+
private normalizedTtl;
|
|
877
|
+
private formatError;
|
|
878
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiCredentialTicketIssueComponent, never>;
|
|
879
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiCredentialTicketIssueComponent, "mm-ai-credential-ticket-issue", never, {}, {}, never, never, true, never>;
|
|
880
|
+
}
|
|
834
881
|
/**
|
|
835
882
|
* "New App from Template" wizard (#4145). Presentation-only — the host fetches
|
|
836
883
|
* the template catalogue via {@link AiAdapterClientService.getAppTemplates},
|
|
@@ -847,43 +894,55 @@ declare class AiCredentialTicketIssueComponent {
|
|
|
847
894
|
* overkill. If a future template needs richer rendering, switch this to
|
|
848
895
|
* `handlebars.precompile`-at-build-time and re-evaluate.
|
|
849
896
|
*/
|
|
850
|
-
declare class AiNewAppDialogComponent {
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
897
|
+
export declare class AiNewAppDialogComponent {
|
|
898
|
+
/** Available templates from the adapter — typically 3 in Phase 1. */
|
|
899
|
+
readonly templates: import("@angular/core").InputSignal<readonly AiAppTemplateDto[]>;
|
|
900
|
+
/** Tenant name shown in the dialog header so the operator confirms the scope. */
|
|
901
|
+
readonly tenantName: import("@angular/core").InputSignal<string>;
|
|
902
|
+
/**
|
|
903
|
+
* Emitted on Submit with the fully interpolated Goal + the picked template id.
|
|
904
|
+
* Named `confirmed` (not `submit`) because Angular flags native-event collisions
|
|
905
|
+
* — `submit` is a DOM event and triggers `@angular-eslint/no-output-native`.
|
|
906
|
+
*/
|
|
907
|
+
readonly confirmed: import("@angular/core").OutputEmitterRef<AiNewAppSubmission>;
|
|
908
|
+
/**
|
|
909
|
+
* Emitted on Cancel / dismiss. The host hides the wizard on this signal.
|
|
910
|
+
* Named `cancelled` for the same reason `confirmed` is not `submit`.
|
|
911
|
+
*/
|
|
912
|
+
readonly cancelled: import("@angular/core").OutputEmitterRef<void>;
|
|
913
|
+
/** rtId-style id of the picked template, or empty until the operator picks one. */
|
|
914
|
+
protected readonly selectedTemplateId: import("@angular/core").WritableSignal<string>;
|
|
915
|
+
protected readonly projectName: import("@angular/core").WritableSignal<string>;
|
|
916
|
+
protected readonly primaryEntity: import("@angular/core").WritableSignal<string>;
|
|
917
|
+
protected readonly selectedTemplate: import("@angular/core").Signal<AiAppTemplateDto | null>;
|
|
918
|
+
/**
|
|
919
|
+
* Rendered Goal string the operator sees in the preview block. Stays empty
|
|
920
|
+
* until a template is picked AND every required placeholder has a value, so
|
|
921
|
+
* the operator never sees a half-interpolated string.
|
|
922
|
+
*/
|
|
923
|
+
protected readonly renderedGoal: import("@angular/core").Signal<string>;
|
|
924
|
+
/** True when every placeholder the picked template declares has a non-empty value. */
|
|
925
|
+
protected readonly allRequiredFilled: import("@angular/core").Signal<boolean>;
|
|
926
|
+
protected onSubmit(): void;
|
|
927
|
+
protected onCancel(): void;
|
|
928
|
+
/** Read the signal that backs the named placeholder, or `null` if unknown. */
|
|
929
|
+
private valueFor;
|
|
930
|
+
private interpolate;
|
|
931
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AiNewAppDialogComponent, never>;
|
|
932
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AiNewAppDialogComponent, "mm-ai-new-app-dialog", never, {
|
|
933
|
+
"templates": {
|
|
934
|
+
"alias": "templates";
|
|
935
|
+
"required": true;
|
|
936
|
+
"isSignal": true;
|
|
937
|
+
};
|
|
938
|
+
"tenantName": {
|
|
939
|
+
"alias": "tenantName";
|
|
940
|
+
"required": false;
|
|
941
|
+
"isSignal": true;
|
|
942
|
+
};
|
|
943
|
+
}, {
|
|
944
|
+
"confirmed": "confirmed";
|
|
945
|
+
"cancelled": "cancelled";
|
|
946
|
+
}, never, never, true, never>;
|
|
947
|
+
}
|
|
948
|
+
export {};
|