@pluno/product-agent-web 0.1.260 → 0.1.262
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/adapters/web/accountPresentation.d.ts +4 -0
- package/dist/adapters/web/contextHttpError.d.ts +1 -0
- package/dist/adapters/web/conversationAdapters.d.ts +3 -1
- package/dist/adapters/web/deviceHints.d.ts +2 -0
- package/dist/adapters/web/featureHttp.d.ts +30 -0
- package/dist/adapters/web/featureLifecycle.d.ts +18 -0
- package/dist/adapters/web/featureOwner.d.ts +15 -0
- package/dist/adapters/web/featurePresentation.d.ts +5 -0
- package/dist/core/account/contracts.d.ts +56 -0
- package/dist/core/account/presentation.d.ts +49 -0
- package/dist/core/account/reducer.d.ts +2 -0
- package/dist/core/account/selectors.d.ts +3 -0
- package/dist/core/account/state.d.ts +2 -0
- package/dist/core/conversation/contracts.d.ts +1 -5
- package/dist/core/conversation/delivery.d.ts +1 -0
- package/dist/core/conversation/reducer.d.ts +4 -2
- package/dist/core/features/appearance.d.ts +10 -0
- package/dist/core/features/contracts.d.ts +492 -0
- package/dist/core/features/reducer.d.ts +16 -0
- package/dist/core/features/selectors.d.ts +15 -0
- package/dist/core/features/state.d.ts +2 -0
- package/dist/core/features/uiFlightEvidence.d.ts +29 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/interactions/actions.d.ts +12 -0
- package/dist/core/interactions/contracts.d.ts +139 -0
- package/dist/core/interactions/preferenceOpenings.d.ts +22 -0
- package/dist/core/interactions/reducer.d.ts +6 -0
- package/dist/core/interactions/selectors.d.ts +25 -0
- package/dist/core/interactions/state.d.ts +2 -0
- package/dist/core/session-directory/membership.d.ts +3 -2
- package/dist/core/session-directory/reducer.d.ts +2 -1
- package/dist/index.d.ts +28 -16
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +34 -26
- package/dist/product-agent-sdk.js +6711 -5098
- package/dist/product-agent-widget.js +6804 -5403
- package/dist/public/operationRoutes.d.ts +4 -1
- package/dist/runtime/composition.d.ts +10 -7
- package/dist/runtimeClient.d.ts +15 -0
- package/dist/runtimeState.d.ts +7 -51
- package/dist/themeColors.d.ts +7 -0
- package/dist/uiFlightRecorder.d.ts +2 -29
- package/package.json +1 -1
- package/dist/adapters/web/conversationInteractionAdapter.d.ts +0 -11
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import type { UiFlightEvidence } from './uiFlightEvidence';
|
|
2
|
+
import type { PAAccountData, PAAccountState, PAFeatureAuthority, PAFeaturePreferences } from '../account/contracts';
|
|
3
|
+
import type { PAEffectHandlers, PAEffectResultEvent } from '../kernel/effects';
|
|
4
|
+
import type { PAQueryState, PARequestId } from '../kernel/state';
|
|
5
|
+
import type { PATransportedError } from '../protocol/errors';
|
|
6
|
+
import type { PAInteractionState, PAFeatureName, PAPreferencePrompt, PAPreferencePrompts, PAUserDecision, PAUserDecisionInput, PAInteractionProjection, PADeviceFact } from '../interactions/contracts';
|
|
7
|
+
export type PAFeaturePage = Readonly<{
|
|
8
|
+
clientScopeId: string;
|
|
9
|
+
origin: string;
|
|
10
|
+
pageUrl: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type PAContextStatus = Readonly<{
|
|
13
|
+
origin?: string;
|
|
14
|
+
latestRun?: Readonly<{
|
|
15
|
+
id: string;
|
|
16
|
+
status: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
completedAt: string | null;
|
|
19
|
+
error: string | null;
|
|
20
|
+
}> | null;
|
|
21
|
+
status: string;
|
|
22
|
+
runId: string | null;
|
|
23
|
+
updatedAt: string | null;
|
|
24
|
+
hasContext: boolean | null;
|
|
25
|
+
}>;
|
|
26
|
+
export type PAProactiveEventMatcher = Readonly<{
|
|
27
|
+
eventTypeRegex: string;
|
|
28
|
+
urlRegex: string;
|
|
29
|
+
targetRoleRegex?: string;
|
|
30
|
+
targetNameRegex?: string;
|
|
31
|
+
targetAncestorRegex?: string;
|
|
32
|
+
}>;
|
|
33
|
+
export type PAProactivePageMatcher = Readonly<{
|
|
34
|
+
urlRegex: string;
|
|
35
|
+
textRegex?: string;
|
|
36
|
+
roleRegex?: string;
|
|
37
|
+
nameRegex?: string;
|
|
38
|
+
}>;
|
|
39
|
+
export type PAProactiveSuggestion = Readonly<{
|
|
40
|
+
id: string;
|
|
41
|
+
suggestedQuery: string;
|
|
42
|
+
condition: Readonly<{
|
|
43
|
+
template: 'page_visit';
|
|
44
|
+
urlRegex: string;
|
|
45
|
+
}> | Readonly<{
|
|
46
|
+
template: 'semantic_interaction';
|
|
47
|
+
event: PAProactiveEventMatcher;
|
|
48
|
+
}> | Readonly<{
|
|
49
|
+
template: 'event_sequence';
|
|
50
|
+
steps: readonly PAProactiveEventMatcher[];
|
|
51
|
+
withinSeconds: number;
|
|
52
|
+
}> | Readonly<{
|
|
53
|
+
template: 'page_state_after_event';
|
|
54
|
+
event: PAProactiveEventMatcher;
|
|
55
|
+
state: PAProactivePageMatcher;
|
|
56
|
+
withinSeconds: number;
|
|
57
|
+
}>;
|
|
58
|
+
}>;
|
|
59
|
+
export type PAOriginAppearance = Readonly<{
|
|
60
|
+
accent: string;
|
|
61
|
+
colorScheme: 'light' | 'dark';
|
|
62
|
+
fontFamily: string;
|
|
63
|
+
scribbleStyle: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
export type PADeepFlowStep = Readonly<{
|
|
66
|
+
index: number;
|
|
67
|
+
kind: string;
|
|
68
|
+
title: string;
|
|
69
|
+
detail?: string | null;
|
|
70
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
71
|
+
linkedSessionId?: string | null;
|
|
72
|
+
linkedContextRefreshRunId?: string | null;
|
|
73
|
+
}>;
|
|
74
|
+
export type PADeepFlow = Readonly<{
|
|
75
|
+
id: string;
|
|
76
|
+
type: 'deep_exploration';
|
|
77
|
+
origin: string;
|
|
78
|
+
status: 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
79
|
+
currentStepIndex: number;
|
|
80
|
+
startedAt: string;
|
|
81
|
+
completedAt?: string | null;
|
|
82
|
+
error?: string | null;
|
|
83
|
+
detail?: string | null;
|
|
84
|
+
steps: readonly PADeepFlowStep[];
|
|
85
|
+
}>;
|
|
86
|
+
export type PAFeedbackContext = Readonly<{
|
|
87
|
+
communityId: string | null;
|
|
88
|
+
sessionId: string | null;
|
|
89
|
+
page: Readonly<{
|
|
90
|
+
url: string;
|
|
91
|
+
title: string;
|
|
92
|
+
origin: string;
|
|
93
|
+
tabId: number | null;
|
|
94
|
+
windowId: number | null;
|
|
95
|
+
plunoProductAgentUi: Readonly<{
|
|
96
|
+
surface: string;
|
|
97
|
+
description: string;
|
|
98
|
+
selectors: readonly Readonly<{
|
|
99
|
+
name: string;
|
|
100
|
+
selector: string;
|
|
101
|
+
description: string;
|
|
102
|
+
}>[];
|
|
103
|
+
}> | null;
|
|
104
|
+
}> | null;
|
|
105
|
+
extensionVersion: string | null;
|
|
106
|
+
extensionVersionStatus: string | null;
|
|
107
|
+
browserMode: string | null;
|
|
108
|
+
bridgeStatus: string | null;
|
|
109
|
+
sdkPreviewOpen: boolean | null;
|
|
110
|
+
}>;
|
|
111
|
+
export type PAFeatureQuery = Readonly<{
|
|
112
|
+
kind: 'account' | 'preferences' | 'preferencePrompts' | 'decisions' | 'userContext' | 'hostedEligibility' | 'userSuggestedTasks';
|
|
113
|
+
}> | (PAFeaturePage & Readonly<{
|
|
114
|
+
kind: 'starterPrompts';
|
|
115
|
+
includeUserSuggestions: boolean;
|
|
116
|
+
}>) | (PAFeaturePage & Readonly<{
|
|
117
|
+
kind: 'originContext';
|
|
118
|
+
trigger?: 'auth' | 'page' | 'manual' | 'poll';
|
|
119
|
+
}>) | (PAFeaturePage & Readonly<{
|
|
120
|
+
kind: 'appearance';
|
|
121
|
+
}>) | Readonly<{
|
|
122
|
+
kind: 'contextRun';
|
|
123
|
+
runId: string;
|
|
124
|
+
}>;
|
|
125
|
+
export type PAFeatureResult = Readonly<{
|
|
126
|
+
kind: 'account';
|
|
127
|
+
value: PAAccountData;
|
|
128
|
+
}> | Readonly<{
|
|
129
|
+
kind: 'preferences';
|
|
130
|
+
value: PAFeaturePreferences;
|
|
131
|
+
}> | Readonly<{
|
|
132
|
+
kind: 'preferencePrompts';
|
|
133
|
+
value: PAPreferencePrompts;
|
|
134
|
+
}> | Readonly<{
|
|
135
|
+
kind: 'preferencePrompt';
|
|
136
|
+
feature: PAFeatureName;
|
|
137
|
+
value: PAPreferencePrompt;
|
|
138
|
+
}> | Readonly<{
|
|
139
|
+
kind: 'decisions';
|
|
140
|
+
decisions: readonly PAUserDecision[];
|
|
141
|
+
}> | Readonly<{
|
|
142
|
+
kind: 'decision';
|
|
143
|
+
value: PAUserDecision;
|
|
144
|
+
}> | Readonly<{
|
|
145
|
+
kind: 'starterPrompts';
|
|
146
|
+
origin: string;
|
|
147
|
+
prompts: readonly string[];
|
|
148
|
+
runtimeHelpersJavascript?: string | null;
|
|
149
|
+
}> | Readonly<{
|
|
150
|
+
kind: 'userSuggestedTasks';
|
|
151
|
+
prompts: readonly string[];
|
|
152
|
+
morningReportOpening: string | null;
|
|
153
|
+
signupAt: string;
|
|
154
|
+
proactiveSuggestions: readonly PAProactiveSuggestion[];
|
|
155
|
+
}> | Readonly<{
|
|
156
|
+
kind: 'originContext' | 'userContext' | 'contextRun';
|
|
157
|
+
value: PAContextStatus;
|
|
158
|
+
}> | Readonly<{
|
|
159
|
+
kind: 'appearance';
|
|
160
|
+
origin: string;
|
|
161
|
+
value: PAOriginAppearance | null;
|
|
162
|
+
stored?: Readonly<{
|
|
163
|
+
createdAt: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
metadata: import('../protocol/json').PAJsonValue;
|
|
166
|
+
}>;
|
|
167
|
+
}> | Readonly<{
|
|
168
|
+
kind: 'hostedEligibility';
|
|
169
|
+
eligible: boolean;
|
|
170
|
+
}> | Readonly<{
|
|
171
|
+
kind: 'ack';
|
|
172
|
+
success: boolean;
|
|
173
|
+
}>;
|
|
174
|
+
export type PAFeatureMutation = Readonly<{
|
|
175
|
+
kind: 'preference';
|
|
176
|
+
feature: PAFeatureName;
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
}> | Readonly<{
|
|
179
|
+
kind: 'preferenceAcknowledge';
|
|
180
|
+
feature: PAFeatureName;
|
|
181
|
+
action: 'enable' | 'allow' | 'not_now' | 'dont_enable';
|
|
182
|
+
expectedRevision: number;
|
|
183
|
+
}> | Readonly<{
|
|
184
|
+
kind: 'preferenceSnooze';
|
|
185
|
+
feature: PAFeatureName;
|
|
186
|
+
expectedRevision: number;
|
|
187
|
+
}> | (Readonly<{
|
|
188
|
+
kind: 'decision';
|
|
189
|
+
}> & PAUserDecisionInput) | Readonly<{
|
|
190
|
+
kind: 'feedback';
|
|
191
|
+
message: string;
|
|
192
|
+
context: PAFeedbackContext;
|
|
193
|
+
}> | Readonly<{
|
|
194
|
+
kind: 'proactiveFeedback';
|
|
195
|
+
suggestionId: string;
|
|
196
|
+
suggestedQuery: string;
|
|
197
|
+
message: string;
|
|
198
|
+
context: PAFeedbackContext;
|
|
199
|
+
}> | Readonly<{
|
|
200
|
+
kind: 'targetFeedback';
|
|
201
|
+
targetId: string;
|
|
202
|
+
rating: 'positive' | 'negative';
|
|
203
|
+
comment?: string;
|
|
204
|
+
}> | Readonly<{
|
|
205
|
+
kind: 'report';
|
|
206
|
+
sessionId: string | null;
|
|
207
|
+
message: string;
|
|
208
|
+
context: PAFeedbackContext;
|
|
209
|
+
uiEvidence: readonly UiFlightEvidence[];
|
|
210
|
+
widgetEvidenceAvailable: boolean;
|
|
211
|
+
}> | Readonly<{
|
|
212
|
+
kind: 'generatePrompts';
|
|
213
|
+
page: PAFeaturePage;
|
|
214
|
+
includeUserSuggestions?: boolean;
|
|
215
|
+
htmlContent: string;
|
|
216
|
+
pageTitle: string;
|
|
217
|
+
}> | Readonly<{
|
|
218
|
+
kind: 'refreshContext';
|
|
219
|
+
origin: string;
|
|
220
|
+
communityId: string | null;
|
|
221
|
+
}> | Readonly<{
|
|
222
|
+
kind: 'refreshUserContext';
|
|
223
|
+
communityId: string | null;
|
|
224
|
+
}> | Readonly<{
|
|
225
|
+
kind: 'stopContext';
|
|
226
|
+
runId: string;
|
|
227
|
+
}> | Readonly<{
|
|
228
|
+
kind: 'sampleStyle';
|
|
229
|
+
origin: string;
|
|
230
|
+
page: PAFeaturePage;
|
|
231
|
+
}> | Readonly<{
|
|
232
|
+
kind: 'saveStyle';
|
|
233
|
+
origin: string;
|
|
234
|
+
value: PAOriginAppearance;
|
|
235
|
+
}> | Readonly<{
|
|
236
|
+
kind: 'deleteStyle';
|
|
237
|
+
origin: string;
|
|
238
|
+
}> | Readonly<{
|
|
239
|
+
kind: 'scribble';
|
|
240
|
+
origin: string;
|
|
241
|
+
enabled: boolean;
|
|
242
|
+
}> | Readonly<{
|
|
243
|
+
kind: 'scribblePreference';
|
|
244
|
+
enabled: boolean;
|
|
245
|
+
}> | Readonly<{
|
|
246
|
+
kind: 'personalInstructions';
|
|
247
|
+
value: string;
|
|
248
|
+
}> | Readonly<{
|
|
249
|
+
kind: 'blockedOrigins';
|
|
250
|
+
origins: readonly string[];
|
|
251
|
+
expectedSecurityVersion: number;
|
|
252
|
+
}>;
|
|
253
|
+
export type PAFeaturePending = Readonly<{
|
|
254
|
+
requestId: string;
|
|
255
|
+
effectId: string;
|
|
256
|
+
fingerprint: string;
|
|
257
|
+
key: string;
|
|
258
|
+
generation: number;
|
|
259
|
+
startedAt?: number;
|
|
260
|
+
operation: PAFeatureQuery | PAFeatureMutation;
|
|
261
|
+
mode: 'query' | 'mutation';
|
|
262
|
+
result: PAFeatureResult | null;
|
|
263
|
+
status: 'queued' | 'pending' | 'done' | 'error';
|
|
264
|
+
error: PATransportedError | null;
|
|
265
|
+
}>;
|
|
266
|
+
export type PAFeatureState = Readonly<{
|
|
267
|
+
localScribbleStyle: boolean | null;
|
|
268
|
+
appearanceEpochs: Readonly<Record<string, number>>;
|
|
269
|
+
appearanceQueries: Readonly<Record<string, PAFeaturePage & Readonly<{
|
|
270
|
+
kind: 'appearance';
|
|
271
|
+
}>>>;
|
|
272
|
+
originContextQueries: Readonly<Record<string, PAFeaturePage>>;
|
|
273
|
+
contextObservers: Readonly<Record<string, string>>;
|
|
274
|
+
contextReads: Readonly<Record<string, Readonly<{
|
|
275
|
+
settledAt: number;
|
|
276
|
+
failures: number;
|
|
277
|
+
}>>>;
|
|
278
|
+
contextRunOrigins: Readonly<Record<string, string>>;
|
|
279
|
+
polls: Readonly<Record<string, Readonly<{
|
|
280
|
+
query: PAFeatureQuery;
|
|
281
|
+
deadline: number;
|
|
282
|
+
}>>>;
|
|
283
|
+
queries: Readonly<Record<string, PAQueryState<string, PAFeatureResult>>>;
|
|
284
|
+
pending: Readonly<Record<string, PAFeaturePending>>;
|
|
285
|
+
queuedPreferences: Readonly<Partial<Record<PAFeatureName, Readonly<{
|
|
286
|
+
requestId: string;
|
|
287
|
+
enabled: boolean;
|
|
288
|
+
}>>>>;
|
|
289
|
+
desiredPreferences: Readonly<Partial<Record<PAFeatureName, boolean>>>;
|
|
290
|
+
refreshBatch: Readonly<{
|
|
291
|
+
pending: readonly string[];
|
|
292
|
+
failed: boolean;
|
|
293
|
+
}> | null;
|
|
294
|
+
refreshAt: number | null;
|
|
295
|
+
failures: number;
|
|
296
|
+
now: number;
|
|
297
|
+
timerId: string | null;
|
|
298
|
+
timerDeadline: number | null;
|
|
299
|
+
timerRevision: number;
|
|
300
|
+
refreshQueuedRequestId: string | null;
|
|
301
|
+
refreshRequired: boolean;
|
|
302
|
+
schedulerError: PATransportedError | null;
|
|
303
|
+
deepFlows: Readonly<Record<string, PADeepFlow>>;
|
|
304
|
+
}>;
|
|
305
|
+
export type PAStage7Slices = Readonly<{
|
|
306
|
+
account: PAAccountState;
|
|
307
|
+
features: PAFeatureState;
|
|
308
|
+
interactions: PAInteractionState;
|
|
309
|
+
}>;
|
|
310
|
+
type Scope = Readonly<{
|
|
311
|
+
authority: PAFeatureAuthority;
|
|
312
|
+
now: number;
|
|
313
|
+
}>;
|
|
314
|
+
export type PAStage7Command = (Scope & Readonly<{
|
|
315
|
+
type: 'stage7.initialize' | 'stage7.retire';
|
|
316
|
+
}>) | (Scope & Readonly<{
|
|
317
|
+
type: 'stage7.account_refusal';
|
|
318
|
+
code: string;
|
|
319
|
+
}>) | (Scope & Readonly<{
|
|
320
|
+
type: 'stage7.account_fallback';
|
|
321
|
+
sessionId: string;
|
|
322
|
+
enabled: boolean;
|
|
323
|
+
}>) | (Scope & Readonly<{
|
|
324
|
+
type: 'stage7.query';
|
|
325
|
+
requestId: string;
|
|
326
|
+
query: PAFeatureQuery;
|
|
327
|
+
force?: boolean;
|
|
328
|
+
}>) | (Scope & Readonly<{
|
|
329
|
+
type: 'stage7.context_observe';
|
|
330
|
+
clientScopeId: string;
|
|
331
|
+
origin: string | null;
|
|
332
|
+
}>) | (Scope & Readonly<{
|
|
333
|
+
type: 'stage7.mutate';
|
|
334
|
+
requestId: string;
|
|
335
|
+
mutation: PAFeatureMutation;
|
|
336
|
+
}>) | (Scope & Readonly<{
|
|
337
|
+
type: 'stage7.retry';
|
|
338
|
+
requestId: string;
|
|
339
|
+
}>) | (Scope & Readonly<{
|
|
340
|
+
type: 'stage7.reconcile';
|
|
341
|
+
requestId: string;
|
|
342
|
+
reason: 'startup' | 'wake' | 'reconnect' | 'settings' | 'periodic';
|
|
343
|
+
}>) | (Scope & Readonly<{
|
|
344
|
+
type: 'stage7.observe_work';
|
|
345
|
+
}>) | (Scope & Readonly<{
|
|
346
|
+
type: 'stage7.local_style';
|
|
347
|
+
enabled: boolean | null;
|
|
348
|
+
}>) | (Scope & Readonly<{
|
|
349
|
+
type: 'stage7.restore_prompt_openings';
|
|
350
|
+
checkpoint: Pick<PAInteractionState, 'openings' | 'openingGeneration' | 'closedScopes' | 'crossTabTurns' | 'promptActions'>;
|
|
351
|
+
}>) | (Scope & Readonly<{
|
|
352
|
+
type: 'stage7.prompt_view';
|
|
353
|
+
clientScopeId: string;
|
|
354
|
+
open: boolean;
|
|
355
|
+
}>) | (Scope & Readonly<{
|
|
356
|
+
type: 'stage7.prompt_shown';
|
|
357
|
+
clientScopeId: string;
|
|
358
|
+
feature: PAFeatureName;
|
|
359
|
+
openingGeneration: number;
|
|
360
|
+
}>) | (Scope & Readonly<{
|
|
361
|
+
type: 'stage7.bridge_ready';
|
|
362
|
+
ready: boolean;
|
|
363
|
+
error?: string | null;
|
|
364
|
+
}>) | (Scope & Readonly<{
|
|
365
|
+
type: 'stage7.cross_tab';
|
|
366
|
+
sessionId: string;
|
|
367
|
+
userMessageId: string;
|
|
368
|
+
}>) | (Scope & Readonly<{
|
|
369
|
+
type: 'stage7.permission';
|
|
370
|
+
requestId: string;
|
|
371
|
+
feature: PAFeatureName;
|
|
372
|
+
action: 'allow' | 'not_now';
|
|
373
|
+
settings: boolean;
|
|
374
|
+
}>) | (Scope & Readonly<{
|
|
375
|
+
type: 'stage7.device_fact';
|
|
376
|
+
feature: PAFeatureName;
|
|
377
|
+
fact: PADeviceFact;
|
|
378
|
+
}>) | (Scope & Readonly<{
|
|
379
|
+
type: 'stage7.act';
|
|
380
|
+
requestId: string;
|
|
381
|
+
clientScopeId: string;
|
|
382
|
+
interactionId: string;
|
|
383
|
+
action: 'copy' | 'share' | 'dismiss' | 'connect' | 'pair' | 'run' | 'edit' | 'feedback' | 'not_now' | 'never' | 'snooze' | 'enable' | 'dont_enable' | 'allow';
|
|
384
|
+
expectedRevision: number;
|
|
385
|
+
sourceVersion: number | null;
|
|
386
|
+
origin?: string | null;
|
|
387
|
+
feedback?: Readonly<{
|
|
388
|
+
message: string;
|
|
389
|
+
context: PAFeedbackContext;
|
|
390
|
+
}>;
|
|
391
|
+
taskIndex?: number;
|
|
392
|
+
sharePlatform?: 'linkedin' | 'x' | 'instagram';
|
|
393
|
+
}>) | (Scope & Readonly<{
|
|
394
|
+
type: 'stage7.retry_action';
|
|
395
|
+
requestId: string;
|
|
396
|
+
}>) | (Scope & Readonly<{
|
|
397
|
+
type: 'stage7.import_legacy_decisions';
|
|
398
|
+
decisions: readonly PAUserDecision[];
|
|
399
|
+
}>) | (Scope & Readonly<{
|
|
400
|
+
type: 'stage7.device_hints';
|
|
401
|
+
hints: Readonly<Record<string, boolean>>;
|
|
402
|
+
}>) | (Scope & Readonly<{
|
|
403
|
+
type: 'stage7.local_sharing';
|
|
404
|
+
decisions: PAInteractionState['localSharing'];
|
|
405
|
+
}>) | (Scope & Readonly<{
|
|
406
|
+
type: 'stage7.sources';
|
|
407
|
+
sources: readonly import('../conversation/display').PAConversationInteractionSource[];
|
|
408
|
+
}>) | (Scope & Readonly<{
|
|
409
|
+
type: 'stage7.welcome';
|
|
410
|
+
card: PAInteractionState['welcome'][string] & Readonly<{
|
|
411
|
+
category: 'proactive_suggestion';
|
|
412
|
+
}>;
|
|
413
|
+
}>) | (Scope & Readonly<{
|
|
414
|
+
type: 'stage7.morning';
|
|
415
|
+
retained?: boolean;
|
|
416
|
+
id: string;
|
|
417
|
+
text: string | null;
|
|
418
|
+
tasks: readonly string[];
|
|
419
|
+
signupAgeDays: number;
|
|
420
|
+
localHour: number;
|
|
421
|
+
localDate: string;
|
|
422
|
+
lastShownDate: string | null;
|
|
423
|
+
}>) | (Scope & Readonly<{
|
|
424
|
+
type: 'stage7.deep_flow';
|
|
425
|
+
clientScopeId: string;
|
|
426
|
+
expectedId: string | null;
|
|
427
|
+
flow: PADeepFlow | null;
|
|
428
|
+
}>);
|
|
429
|
+
export type PAStage7Effects = {
|
|
430
|
+
'stage7.platform': {
|
|
431
|
+
input: Readonly<{
|
|
432
|
+
authority: PAFeatureAuthority;
|
|
433
|
+
requestId: string;
|
|
434
|
+
operation: import('../interactions/contracts').PAInteractionPlatformOperation;
|
|
435
|
+
}>;
|
|
436
|
+
output: Readonly<{
|
|
437
|
+
revision: number;
|
|
438
|
+
completedAt: number;
|
|
439
|
+
}>;
|
|
440
|
+
};
|
|
441
|
+
'stage7.query': {
|
|
442
|
+
input: Readonly<{
|
|
443
|
+
authority: PAFeatureAuthority;
|
|
444
|
+
requestId: string;
|
|
445
|
+
query: PAFeatureQuery;
|
|
446
|
+
}>;
|
|
447
|
+
output: Readonly<{
|
|
448
|
+
data: PAFeatureResult;
|
|
449
|
+
completedAt: number;
|
|
450
|
+
}>;
|
|
451
|
+
};
|
|
452
|
+
'stage7.mutate': {
|
|
453
|
+
input: Readonly<{
|
|
454
|
+
authority: PAFeatureAuthority;
|
|
455
|
+
requestId: string;
|
|
456
|
+
mutation: PAFeatureMutation;
|
|
457
|
+
}>;
|
|
458
|
+
output: Readonly<{
|
|
459
|
+
data: PAFeatureResult;
|
|
460
|
+
completedAt: number;
|
|
461
|
+
}>;
|
|
462
|
+
};
|
|
463
|
+
'stage7.device': {
|
|
464
|
+
input: Readonly<{
|
|
465
|
+
authority: PAFeatureAuthority;
|
|
466
|
+
requestId: string;
|
|
467
|
+
feature: PAFeatureName;
|
|
468
|
+
action: 'check' | 'allow' | 'not_now';
|
|
469
|
+
now: number;
|
|
470
|
+
}>;
|
|
471
|
+
output: Readonly<{
|
|
472
|
+
fact: PADeviceFact;
|
|
473
|
+
completedAt: number;
|
|
474
|
+
}>;
|
|
475
|
+
};
|
|
476
|
+
'stage7.wait': {
|
|
477
|
+
input: Readonly<{
|
|
478
|
+
authority: PAFeatureAuthority;
|
|
479
|
+
deadline: number;
|
|
480
|
+
}>;
|
|
481
|
+
output: Readonly<{
|
|
482
|
+
now: number;
|
|
483
|
+
}>;
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
export type PAStage7Ports = PAEffectHandlers<PAStage7Effects>;
|
|
487
|
+
export type PAStage7Input = PAStage7Command | PAEffectResultEvent<PAStage7Effects>;
|
|
488
|
+
export type PAStage7Projection = PAStage7Slices & Readonly<{
|
|
489
|
+
cards: readonly PAInteractionProjection[];
|
|
490
|
+
}>;
|
|
491
|
+
export declare const asFeatureRequestId: (value: string) => PARequestId;
|
|
492
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PAConversationState } from '../conversation/contracts';
|
|
2
|
+
import type { PADirectoryState } from '../session-directory/contracts';
|
|
3
|
+
import type { PAEffect } from '../kernel/effects';
|
|
4
|
+
import type { PAFeatureName } from '../interactions/contracts';
|
|
5
|
+
import { type PAFeatureQuery, type PAFeatureMutation, type PAStage7Slices, type PAStage7Input, type PAStage7Effects } from './contracts';
|
|
6
|
+
import type { PAFeatureAuthority } from '../account/contracts';
|
|
7
|
+
export declare function featureQueryKey(authority: PAFeatureAuthority, query: PAFeatureQuery): string;
|
|
8
|
+
export declare function featurePreference(state: PAStage7Slices, feature: PAFeatureName): boolean | null;
|
|
9
|
+
export declare function assertFeatureOperation(authority: PAFeatureAuthority, operation: PAFeatureQuery | PAFeatureMutation): void;
|
|
10
|
+
export declare function reduceStage7(initial: PAStage7Slices, input: PAStage7Input, context: Readonly<{
|
|
11
|
+
conversation: PAConversationState;
|
|
12
|
+
directory: PADirectoryState;
|
|
13
|
+
}>): {
|
|
14
|
+
state: PAStage7Slices;
|
|
15
|
+
effects: readonly PAEffect<PAStage7Effects>[];
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PAFeatureQuery, PAStage7Slices } from './contracts';
|
|
2
|
+
export declare function selectFeatureQuery(state: PAStage7Slices, query: PAFeatureQuery): Readonly<{
|
|
3
|
+
key: string;
|
|
4
|
+
status: import("..").PAQueryStatus;
|
|
5
|
+
data: import("./contracts").PAFeatureResult | null;
|
|
6
|
+
cursor: string | null;
|
|
7
|
+
error: Readonly<{
|
|
8
|
+
code: import("..").PATransportedErrorCode;
|
|
9
|
+
message: string;
|
|
10
|
+
retryable: boolean;
|
|
11
|
+
details?: import("..").PAJsonObject;
|
|
12
|
+
}> | null;
|
|
13
|
+
requestId: import("..").PARequestId | null;
|
|
14
|
+
updatedAt: number | null;
|
|
15
|
+
}> | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type UiFlightRecord = {
|
|
2
|
+
sequence: number;
|
|
3
|
+
occurred_at: string;
|
|
4
|
+
monotonic_ms: number;
|
|
5
|
+
kind: "runtime" | "paint" | "click" | "submit" | "focus";
|
|
6
|
+
action: "new_chat" | "send" | "stop" | "retry" | null;
|
|
7
|
+
session_id: string | null;
|
|
8
|
+
run_id: string | null;
|
|
9
|
+
item_keys: string[];
|
|
10
|
+
item_count: number;
|
|
11
|
+
items_truncated: boolean;
|
|
12
|
+
thinking: boolean;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
welcome: boolean;
|
|
15
|
+
error: boolean;
|
|
16
|
+
connected: boolean;
|
|
17
|
+
visible: boolean;
|
|
18
|
+
output_length: number;
|
|
19
|
+
active_count: number;
|
|
20
|
+
terminal_count: number;
|
|
21
|
+
};
|
|
22
|
+
export type UiFlightEvidence = {
|
|
23
|
+
schema_version: 1;
|
|
24
|
+
surface: "extension_sidepanel" | "extension_widget" | "main_web_chat" | "embedded_widget";
|
|
25
|
+
recorder_id: string;
|
|
26
|
+
sdk_version: string;
|
|
27
|
+
dropped_records: number;
|
|
28
|
+
records: UiFlightRecord[];
|
|
29
|
+
};
|
package/dist/core/index.d.ts
CHANGED
|
@@ -23,3 +23,14 @@ export * from "./session-directory/state";
|
|
|
23
23
|
export * from "./session-directory/reducer";
|
|
24
24
|
export * from "./session-directory/selectors";
|
|
25
25
|
export * from "./session-directory/membership";
|
|
26
|
+
export * from './account/contracts';
|
|
27
|
+
export * from './account/state';
|
|
28
|
+
export * from './account/reducer';
|
|
29
|
+
export * from './account/selectors';
|
|
30
|
+
export * from './features/contracts';
|
|
31
|
+
export * from './features/state';
|
|
32
|
+
export * from './features/reducer';
|
|
33
|
+
export * from './features/selectors';
|
|
34
|
+
export * from './interactions/state';
|
|
35
|
+
export * from './interactions/reducer';
|
|
36
|
+
export * from './interactions/selectors';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PAStage7Slices, PAStage7Command, PAStage7Effects } from '../features/contracts';
|
|
2
|
+
import type { PAConversationState } from '../conversation/contracts';
|
|
3
|
+
import type { PADirectoryState } from '../session-directory/contracts';
|
|
4
|
+
import type { PAEffect, PAEffectResultEvent } from '../kernel/effects';
|
|
5
|
+
export type PAInteractionActionEvent = Extract<PAStage7Command, {
|
|
6
|
+
type: 'stage7.act' | 'stage7.retry_action';
|
|
7
|
+
}> | PAEffectResultEvent<Pick<PAStage7Effects, 'stage7.platform'>>;
|
|
8
|
+
export declare function reduceInteractionAction(initial: PAStage7Slices, input: PAInteractionActionEvent, conversation: PAConversationState, directory: PADirectoryState): {
|
|
9
|
+
state: PAStage7Slices;
|
|
10
|
+
effects: readonly PAEffect<PAStage7Effects>[];
|
|
11
|
+
command: PAStage7Command | null;
|
|
12
|
+
};
|