@pluno/product-agent-web 0.1.315 → 0.1.317

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.
Files changed (49) hide show
  1. package/README.md +4 -0
  2. package/dist/adapters/web/accountPresentation.d.ts +3 -3
  3. package/dist/adapters/web/directoryAdapters.d.ts +0 -1
  4. package/dist/adapters/web/featureHttp.d.ts +6 -22
  5. package/dist/adapters/web/featureLifecycle.d.ts +2 -15
  6. package/dist/adapters/web/featureOwner.d.ts +5 -6
  7. package/dist/adapters/web/featurePresentation.d.ts +4 -4
  8. package/dist/core/account/contracts.d.ts +6 -18
  9. package/dist/core/account/selectors.d.ts +2 -2
  10. package/dist/core/account/state.d.ts +1 -1
  11. package/dist/core/conversation/deliveryContracts.d.ts +1 -1
  12. package/dist/core/features/contracts.d.ts +37 -338
  13. package/dist/core/features/reducer.d.ts +5 -7
  14. package/dist/core/features/selectors.d.ts +1 -1
  15. package/dist/core/features/state.d.ts +1 -1
  16. package/dist/core/index.d.ts +0 -2
  17. package/dist/core/interactions/actions.d.ts +7 -7
  18. package/dist/core/interactions/contracts.d.ts +8 -121
  19. package/dist/core/interactions/selectors.d.ts +5 -25
  20. package/dist/core/interactions/state.d.ts +1 -1
  21. package/dist/core/kernel/capabilities.d.ts +0 -14
  22. package/dist/core/model-selection/selectors.d.ts +1 -1
  23. package/dist/core/session-directory/contracts.d.ts +0 -1
  24. package/dist/index.d.ts +2 -37
  25. package/dist/operationTiming.d.ts +1 -1
  26. package/dist/product-agent-runtime.cjs +1 -1
  27. package/dist/product-agent-runtime.js +221 -274
  28. package/dist/product-agent-sdk.js +4717 -6136
  29. package/dist/product-agent-widget.js +5994 -8146
  30. package/dist/public/operationRoutes.d.ts +0 -3
  31. package/dist/runtime/composition.d.ts +3 -8
  32. package/dist/runtime/modelSelection.d.ts +1 -1
  33. package/dist/runtime.d.ts +1 -1
  34. package/dist/runtimeClient.d.ts +0 -6
  35. package/dist/runtimeState.d.ts +0 -10
  36. package/dist/shareCard.d.ts +0 -25
  37. package/dist/widget.d.ts +2 -28
  38. package/package.json +2 -3
  39. package/dist/activeUsersCounter.d.ts +0 -4
  40. package/dist/adapters/web/activeUsers.d.ts +0 -4
  41. package/dist/adapters/web/deviceHints.d.ts +0 -2
  42. package/dist/adapters/web/localPreferences.d.ts +0 -17
  43. package/dist/core/account/reducer.d.ts +0 -2
  44. package/dist/core/active-users/reducer.d.ts +0 -47
  45. package/dist/core/features/appearance.d.ts +0 -10
  46. package/dist/core/interactions/preferenceOpenings.d.ts +0 -22
  47. package/dist/core/interactions/reducer.d.ts +0 -6
  48. package/dist/featureActionFeedback.d.ts +0 -19
  49. package/dist/modelSelection.d.ts +0 -62
@@ -26,7 +26,6 @@ export declare const PA_COMPATIBILITY_OPERATION_ROUTES: {
26
26
  readonly "runtimeClient.getState": "projection";
27
27
  readonly "runtimeClient.connect": "engine_command";
28
28
  readonly "runtimeClient.destroy": "platform_shell";
29
- readonly "runtimeClient.warmup": "engine_command";
30
29
  readonly "runtimeClient.recordWidgetLifecycle": "platform_shell";
31
30
  readonly "runtimeClient.recordPromptPresented": "engine_command";
32
31
  readonly "runtimeClient.sendMessage": "engine_command";
@@ -57,7 +56,6 @@ export declare const PA_COMPATIBILITY_OPERATION_ROUTES: {
57
56
  readonly "sessionEngine.connect": "engine_command";
58
57
  readonly "sessionEngine.disconnect": "engine_command";
59
58
  readonly "sessionEngine.destroy": "platform_shell";
60
- readonly "sessionEngine.warmup": "engine_command";
61
59
  readonly "sessionEngine.recordWidgetLifecycle": "platform_shell";
62
60
  readonly "sessionEngine.recordPromptPresented": "engine_command";
63
61
  readonly "sessionEngine.reportOperationTiming": "platform_shell";
@@ -87,7 +85,6 @@ export declare const PA_COMPATIBILITY_OPERATION_ROUTES: {
87
85
  readonly "sessionEngine.refreshAccount": "engine_query";
88
86
  readonly "sessionEngine.loadSession": "engine_command";
89
87
  readonly "runtime.connect": "engine_command";
90
- readonly "runtime.warmup": "engine_command";
91
88
  readonly "runtime.widget_lifecycle": "platform_shell";
92
89
  readonly "runtime.prompt_presented": "engine_command";
93
90
  readonly "runtime.report_operation_timing": "platform_shell";
@@ -1,6 +1,4 @@
1
1
  import type { PAStage7Slices, PAStage7Command, PAStage7Effects, PAStage7Ports } from '../core/features/contracts';
2
- import { type PAActiveUsersState, type PAActiveUsersCommand, type PAActiveUsersEffects } from "../core/active-users/reducer";
3
- import type { PAEffectHandlers } from "../core/kernel/effects";
4
2
  import { type PAModelSelectionState } from "../core/model-selection/state";
5
3
  import type { PAModelCommand } from "../core/model-selection/commands";
6
4
  import type { PAModelEvent } from "../core/model-selection/events";
@@ -13,7 +11,6 @@ export type PASliceOwner = "legacy" | "core";
13
11
  export declare const PA_SLICE_OWNERSHIP: Readonly<{
14
12
  readonly modelSelection: "core";
15
13
  readonly directory: "core";
16
- readonly activeUsers: "core";
17
14
  readonly conversation: "core";
18
15
  readonly account: "core";
19
16
  readonly interactions: "core";
@@ -29,23 +26,21 @@ export type PAClientSlices = PAStage7Slices & Readonly<{
29
26
  modelSelection: PAModelSelectionState;
30
27
  directory: PADirectoryState;
31
28
  conversation: PAConversationState;
32
- activeUsers: PAActiveUsersState;
33
29
  }>;
34
- export type PAClientCommand = PAStage7Command | PAModelCommand | PADirectoryCommand | PAConversationCommand | PAActiveUsersCommand;
30
+ export type PAClientCommand = PAStage7Command | PAModelCommand | PADirectoryCommand | PAConversationCommand;
35
31
  export type PAClientEvent = PAModelEvent | PADirectoryEvent | PAConversationEvent;
36
- type PAClientEffects = PAStage7Effects & PADirectoryEffects & PAConversationEffects & PAActiveUsersEffects;
32
+ type PAClientEffects = PAStage7Effects & PADirectoryEffects & PAConversationEffects;
37
33
  export type PAClientProjection = PAStage7Slices & Readonly<{
38
34
  modelSelection: PAModelSelectionState;
39
35
  directory: PADirectoryProjection;
40
36
  conversation: ReturnType<typeof selectConversation>;
41
- activeUsers: PAActiveUsersState;
42
37
  }>;
43
38
  export declare class PAClientRuntime {
44
39
  readonly engine: PAEngine<PAEngineState<PAClientSlices>, PAClientCommand, PAClientEvent, PAClientEffects, PAClientProjection>;
45
40
  private readonly disposeListeners;
46
41
  private conversationPorts;
47
42
  private featurePorts;
48
- constructor(directoryPorts?: PADirectoryPorts, conversationPorts?: Partial<PAConversationPorts>, activeUsersPorts?: PAEffectHandlers<PAActiveUsersEffects>, stage7Ports?: Partial<PAStage7Ports>);
43
+ constructor(directoryPorts?: PADirectoryPorts, conversationPorts?: Partial<PAConversationPorts>, stage7Ports?: Partial<PAStage7Ports>);
49
44
  private disposed;
50
45
  installConversationPorts(ports: PAConversationPorts): void;
51
46
  installFeaturePorts(ports: Partial<PAStage7Ports>): void;
@@ -8,7 +8,7 @@ export declare const getRuntimeModelScope: (runtime: PAClientRuntime, clientScop
8
8
  selectedModel?: PAProductAgentModel;
9
9
  submissions: Readonly<Record<string, import("../core/model-selection/state").PAModelSubmission>>;
10
10
  }>;
11
- export declare const getRuntimeModel: (runtime: PAClientRuntime, clientScopeId: PAClientScopeId) => "gpt-6-sol" | "gpt-6-luna" | "deepseek/deepseek-v4-flash" | "anthropic/claude-opus-5.5" | "gpt-5.6-sol" | "gpt-5.6-terra" | "anthropic/claude-sonnet-5" | "anthropic/claude-opus-5" | "deepseek/deepseek-chat-v3.1" | "gpt-5.4-nano" | "gpt-5.4-mini" | "gpt-5.4" | "gpt-5.6-luna" | "gpt-6.1-sol" | undefined;
11
+ export declare const getRuntimeModel: (runtime: PAClientRuntime, clientScopeId: PAClientScopeId) => "anthropic/claude-opus-5" | "anthropic/claude-opus-5.5" | "anthropic/claude-sonnet-5" | "deepseek/deepseek-chat-v3.1" | "deepseek/deepseek-v4-flash" | "gpt-5.4-nano" | "gpt-5.4-mini" | "gpt-5.4" | "gpt-5.6-luna" | "gpt-5.6-terra" | "gpt-5.6-sol" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | undefined;
12
12
  export declare function captureRequestedModel(runtime: PAClientRuntime, clientScopeId: PAClientScopeId, clientMessageId: string, requestedModel?: PAProductAgentModel | null): PAProductAgentModel | undefined;
13
13
  export declare function acceptModelRouting(runtime: PAClientRuntime, clientScopeId: PAClientScopeId, sessionId: string, clientMessageId: string, value: unknown, updatedAt?: string): void;
14
14
  export declare function hydrateModelRouting(runtime: PAClientRuntime, clientScopeId: PAClientScopeId, sessionId: string, turns: unknown): void;
package/dist/runtime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { createProductAgentQueryState, mergeProductAgentEntityPages, normalizeProductAgentEntityPage, ProductAgentQueryController, reconcileProductAgentSubmissionGate, resolveProductAgentComposerAction, canSubmitPersonalProductAgentMessage, isProductAgentAuthReconnectError, PRODUCT_AGENT_AUTH_RECONNECTING_ERROR_MESSAGE, resolveProductAgentBillingPresentation, resolveProductAgentWidgetPresentation, hasProductAgentPaidCreditFallback, selectProductAgentQueryEntities, } from "./runtimeState";
1
+ export { createProductAgentQueryState, mergeProductAgentEntityPages, normalizeProductAgentEntityPage, ProductAgentQueryController, reconcileProductAgentSubmissionGate, resolveProductAgentComposerAction, isProductAgentAuthReconnectError, PRODUCT_AGENT_AUTH_RECONNECTING_ERROR_MESSAGE, resolveProductAgentBillingPresentation, resolveProductAgentWidgetPresentation, selectProductAgentQueryEntities, } from "./runtimeState";
2
2
  export type { ProductAgentAuthProjection, ProductAgentSubmissionContext, ProductAgentComposerAction, ProductAgentEntity, ProductAgentEntityPage, ProductAgentEntityQueryData, ProductAgentInteraction, ProductAgentInteractionAction, ProductAgentInteractionPresentation, ProductAgentInteractionScope, ProductAgentInteractionStatus, ProductAgentPromptAction, ProductAgentPromptDecision, ProductAgentPromptDecisionScope, ProductAgentQueryLoadMode, ProductAgentQueryState, ProductAgentQueryStatus, ProductAgentSafeUser, ProductAgentSafeWorkspace, ProductAgentSubmissionGate, ProductAgentWidgetPresentation, } from "./runtimeState";
3
3
  export { ProductAgentSessionHistoryManager } from "./sessionHistoryState";
4
4
  export type { ProductAgentSessionHistoryEntity, ProductAgentSessionHistoryLoader, ProductAgentSessionHistoryPage, } from "./sessionHistoryState";
@@ -33,10 +33,6 @@ export type ProductAgentRuntimeCommand = {
33
33
  uiInvariant?: UiInvariantEvidence;
34
34
  reason: string;
35
35
  clientMessageId?: string;
36
- } | {
37
- type: "runtime.warmup";
38
- reason: "panel_open" | "extension_install" | "composer_input";
39
- requestedModel?: ProductAgentModel;
40
36
  } | {
41
37
  type: "runtime.widget_lifecycle";
42
38
  action: ProductAgentWidgetLifecycleAction;
@@ -139,7 +135,6 @@ export type ProductAgentRuntimeClient = {
139
135
  reportResponseVisibility?(observation: ResponseVisibilityObservation): void;
140
136
  reportInvalidStateTransition?(reason: string, clientMessageId?: string, uiInvariant?: UiInvariantEvidence): void;
141
137
  reportDisplayedError?(reason: string, errorFingerprint: string, displayedMessage?: string, renderedError?: RenderedErrorEvidence, historyRefreshFailure?: HistoryRefreshFailure): void;
142
- warmup(reason?: "panel_open" | "extension_install" | "composer_input", requestedModel?: ProductAgentModel): void;
143
138
  recordPromptPresented?(feature: "notifications" | "tab_grouping", openingGeneration: number): void;
144
139
  recordWidgetLifecycle(action: ProductAgentWidgetLifecycleAction, trigger: ProductAgentWidgetLifecycleTrigger): void;
145
140
  sendMessage(content: string, options?: {
@@ -222,7 +217,6 @@ export declare class ProductAgentRemoteRuntimeClient implements ProductAgentRunt
222
217
  updateProjection(state: ProductAgentState, model?: ProductAgentModel, sessionHistoryState?: ProductAgentQueryState<ProductAgentEntityQueryData<ProductAgentSessionHistoryEntry>>, interactions?: readonly ProductAgentInteraction[], account?: ProductAgentAccountProjection | null): void;
223
218
  connect(): Promise<void>;
224
219
  destroy(): void;
225
- warmup(reason?: "panel_open" | "extension_install" | "composer_input", requestedModel?: ProductAgentModel): Promise<void>;
226
220
  recordPromptPresented(feature: "notifications" | "tab_grouping", openingGeneration: number): void;
227
221
  recordWidgetLifecycle(action: ProductAgentWidgetLifecycleAction, trigger: ProductAgentWidgetLifecycleTrigger): void;
228
222
  reportOperationTiming(timing: OperationTiming): void;
@@ -103,7 +103,6 @@ export declare function resolveProductAgentWidgetPresentation(input: {
103
103
  open: boolean;
104
104
  }): ProductAgentWidgetPresentation;
105
105
  export { reconcileProductAgentSubmissionGate } from './core/account/presentation';
106
- export declare function hasProductAgentPaidCreditFallback(metadata: unknown): boolean;
107
106
  export type ProductAgentBillingPresentation = {
108
107
  state: "hidden";
109
108
  } | {
@@ -121,15 +120,6 @@ export type ProductAgentSubmissionContext = {
121
120
  currentPageResolved: boolean;
122
121
  isWebsiteBlocked: boolean;
123
122
  };
124
- export declare function canSubmitPersonalProductAgentMessage(input: {
125
- submissionAllowed: boolean;
126
- isAuthenticated: boolean;
127
- hasWorkspace: boolean;
128
- isWebsiteBlocked: boolean;
129
- isCurrentPageResolved: boolean;
130
- isSubmitting: boolean;
131
- hasPendingMessage: boolean;
132
- }): boolean;
133
123
  export type ProductAgentComposerAction = {
134
124
  action: "send" | "stop";
135
125
  disabled: boolean;
@@ -1,27 +1,2 @@
1
- export type ProductAgentShareMessage = {
2
- id: string;
3
- role: "user" | "assistant" | "tool" | "system";
4
- content: string;
5
- toolName?: string;
6
- callId?: string;
7
- sharePromptAllowed?: boolean;
8
- };
9
- export type ProductAgentShareSessionItem = {
10
- id: string;
11
- data: unknown;
12
- };
13
- export type ProductAgentShareCandidate = {
14
- variant?: ProductAgentSharePromptVariant;
15
- id: string;
16
- userPrompt: string;
17
- assistantAnswer: string;
18
- };
19
- export type ProductAgentSharePromptVariant = "referral" | "social";
20
1
  export declare const SUGGEST_SHARE_ON_SOCIALS_TOOL_NAME = "suggest_share_on_socials";
21
- export declare function findShareCandidateForAssistantMessage(messages: ProductAgentShareMessage[], assistantMessageId: string): ProductAgentShareCandidate | null;
22
- export declare function findSuggestedShareCandidate(items: ProductAgentShareSessionItem[]): ProductAgentShareCandidate | null;
23
- export declare function findSuggestedShareCandidateForMessages(messages: ProductAgentShareMessage[]): ProductAgentShareCandidate | null;
24
2
  export declare function getSharePromptAllowedFromOutput(output: unknown): boolean | null;
25
- export declare function getSharePromptVariant(candidateId: string): ProductAgentSharePromptVariant;
26
- export declare function redactPublicShareText(text: string): string;
27
- export declare function stripMarkdownToPlainText(text: string): string;
package/dist/widget.d.ts CHANGED
@@ -1,7 +1,4 @@
1
- import { ProductAgentTokenProviderError, type ProductAgentAttachment, type ProductAgentIntegrationAuthRequest, type ProductAgentPersonalChannelConnectionRequest, type ProductAgentInitOptions, type ProductAgentModel, type ProductAgentRuntimeAdapters, type ProductAgentRuntimeClient, type ProductAgentWidgetLifecycleTrigger } from "./index";
2
- import { type PersonalProductAgentModel } from "./modelSelection";
3
- import { type ProductAgentShareCandidate } from "./shareCard";
4
- import { type ActiveUsersCounterValue } from "./activeUsersCounter";
1
+ import { ProductAgentTokenProviderError, type ProductAgentAttachment, type ProductAgentIntegrationAuthRequest, type ProductAgentInitOptions, type ProductAgentModel, type ProductAgentRuntimeAdapters, type ProductAgentRuntimeClient, type ProductAgentWidgetLifecycleTrigger } from "./index";
5
2
  import { type ProductAgentInteraction, type ProductAgentAccountProjection } from "./runtimeState";
6
3
  export { ProductAgentTokenProviderError };
7
4
  export type ProductAgentWidgetOptions = {
@@ -15,7 +12,6 @@ export type ProductAgentWidgetOptions = {
15
12
  metadata?: Record<string, unknown> | (() => Record<string, unknown> | undefined);
16
13
  productVariant?: ProductAgentInitOptions["productVariant"];
17
14
  model?: ProductAgentModel;
18
- onModelChange?: (model: PersonalProductAgentModel) => void | Promise<void>;
19
15
  entrySurface?: ProductAgentInitOptions["entrySurface"];
20
16
  launcherLabel?: string;
21
17
  accentColor?: string;
@@ -48,11 +44,9 @@ export type ProductAgentWidgetOptions = {
48
44
  signupButtonLabel?: string;
49
45
  signupUrl?: string;
50
46
  onSignupClick?: () => void;
51
- referralLinkLoader?: () => Promise<string>;
52
47
  billingStatus?: ProductAgentWidgetBillingStatus | null;
53
48
  billingStatusLoader?: () => Promise<ProductAgentWidgetBillingStatus | null>;
54
49
  runtimeAdapters?: ProductAgentRuntimeAdapters;
55
- activeUsersLoader?: () => Promise<ActiveUsersCounterValue>;
56
50
  socialPostRewardsUrl?: string;
57
51
  extensionRuntime?: {
58
52
  ownerId: string;
@@ -65,30 +59,10 @@ export type ProductAgentWidgetOptions = {
65
59
  showLauncherMinimizeButton?: boolean;
66
60
  };
67
61
  export type ProductAgentIntegrationAuthStatus = "pending" | "completed" | "cancelled" | "expired";
68
- export type ProductAgentWidgetMorningReport = {
69
- opening: string;
70
- prompts: string[];
71
- };
72
- export type ProductAgentWidgetProactiveSuggestion = {
73
- id: string;
74
- interactionId: string;
75
- genericQuestion: string;
76
- question: string;
77
- };
78
- export type ProductAgentWidgetRuntimeInteraction = ProductAgentInteraction<"social_share", {
79
- candidate: ProductAgentShareCandidate;
80
- }> | ProductAgentInteraction<"task_notifications", {
81
- enabled: boolean;
82
- }> | ProductAgentInteraction<"tab_group_permission", {
83
- permissionNeeded: boolean;
84
- }> | ProductAgentInteraction<"proactive_suggestion", {
85
- suggestion: ProductAgentWidgetProactiveSuggestion;
86
- }> | ProductAgentInteraction<"morning_report", ProductAgentWidgetMorningReport> | ProductAgentInteraction<"integration_connection", {
62
+ export type ProductAgentWidgetRuntimeInteraction = ProductAgentInteraction<"integration_connection", {
87
63
  request: ProductAgentIntegrationAuthRequest;
88
64
  status: ProductAgentIntegrationAuthStatus | "checking" | "error";
89
65
  error?: string | null;
90
- }> | ProductAgentInteraction<"personal_channel_connection", {
91
- request: ProductAgentPersonalChannelConnectionRequest;
92
66
  }>;
93
67
  export type ProductAgentWidgetBillingStatus = ProductAgentAccountProjection;
94
68
  export type ProductAgentWidgetHandle = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluno/product-agent-web",
3
- "version": "0.1.315",
3
+ "version": "0.1.317",
4
4
  "description": "Browser SDK and default widget for embedding Pluno Product Agent into customer web apps.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -25,9 +25,8 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "build": "vite build --mode sdk && vite build --mode widget && vite build --mode runtime && tsc --emitDeclarationOnly",
28
- "check": "tsc --noEmit && npm run check:core && npm run check:architecture-reference",
28
+ "check": "tsc --noEmit && npm run check:core",
29
29
  "check:core": "tsc -p tsconfig.core.json && node scripts/check-core-boundaries.mjs",
30
- "check:architecture-reference": "tsc --noEmit --strict --target ES2020 --module ESNext --moduleResolution Bundler --lib ES2020,DOM ../spec/product-agent/client-core-architecture-reference.d.ts",
31
30
  "check:public-api": "node scripts/check-public-api-compatibility.mjs",
32
31
  "test": "vitest run",
33
32
  "verify:package": "node scripts/verify-package-contents.mjs && node scripts/verify-declaration-freshness.mjs",
@@ -1,4 +0,0 @@
1
- export type ActiveUsersCounterValue = {
2
- count: number;
3
- refreshAfterMs: number;
4
- };
@@ -1,4 +0,0 @@
1
- import type { PAEffectHandlers } from "../../core/kernel/effects";
2
- import type { PAActiveUsersEffects } from "../../core/active-users/reducer";
3
- export declare function createActiveUsersPorts(load: () => Promise<number>, random?: () => number, displayRandom?: () => number): PAEffectHandlers<PAActiveUsersEffects>;
4
- export declare function fetchActiveUsersCount(backendUrl: string, fetcher?: (input: URL, init?: RequestInit) => Promise<Response>): Promise<number>;
@@ -1,2 +0,0 @@
1
- export declare function readDeviceHints(storage: Storage): Record<string, boolean>;
2
- export declare function dismissDeviceHint(storage: Storage, id: string): void;
@@ -1,17 +0,0 @@
1
- import type { PAFeatureAuthority, PAFeaturePreferences } from '../../core/account/contracts';
2
- import type { PAFeatureMutation, PAStage7Ports } from '../../core/features/contracts';
3
- type LocalMutation = Extract<PAFeatureMutation, {
4
- kind: 'preference' | 'scribblePreference';
5
- }>;
6
- export type LocalPreferenceRecord = Readonly<{
7
- value: PAFeaturePreferences;
8
- pending: readonly LocalMutation[];
9
- }>;
10
- export type LocalPreferenceStorage = Readonly<{
11
- exclusive?: <T>(kind: 'local' | 'sync', work: () => Promise<T>) => Promise<T>;
12
- load: (userId: string) => Promise<LocalPreferenceRecord | null>;
13
- save: (userId: string, record: LocalPreferenceRecord) => Promise<void>;
14
- }>;
15
- type Ports = Pick<PAStage7Ports, 'stage7.query' | 'stage7.mutate'>;
16
- export declare function withLocalPreferences(ports: Ports, storage: LocalPreferenceStorage, current: () => PAFeatureAuthority | null, now: () => number): Ports;
17
- export {};
@@ -1,2 +0,0 @@
1
- import type { PAAccountState, PAFeaturePreferences } from './contracts';
2
- export declare function mergeFeaturePreferences(state: PAAccountState, value: PAFeaturePreferences): PAAccountState;
@@ -1,47 +0,0 @@
1
- import { type PAQueryState } from "../kernel/state";
2
- import type { PAEffect, PAEffectResultEvent } from "../kernel/effects";
3
- export declare const ACTIVE_USERS_POLL_MS = 10000;
4
- export declare const ACTIVE_USERS_DISPLAY_MS = 3000;
5
- export type PAActiveUsersState = Readonly<{
6
- authenticated: boolean;
7
- generation: number;
8
- sequence: number;
9
- displaySequence: number;
10
- backendCount: number | null;
11
- query: PAQueryState<"activeUsers", number>;
12
- }>;
13
- export type PAActiveUsersCommand = Readonly<{
14
- type: "activeUsers.authenticate";
15
- authenticated: boolean;
16
- }>;
17
- export type PAActiveUsersEffects = {
18
- "activeUsers.load": {
19
- input: {
20
- generation: number;
21
- };
22
- output: {
23
- count: number;
24
- updatedAt: number;
25
- offset: number;
26
- };
27
- };
28
- "activeUsers.displayWait": {
29
- input: {
30
- milliseconds: number;
31
- };
32
- output: {
33
- offset: number;
34
- };
35
- };
36
- "activeUsers.wait": {
37
- input: {
38
- milliseconds: number;
39
- };
40
- output: null;
41
- };
42
- };
43
- export declare function createActiveUsersState(): PAActiveUsersState;
44
- export declare function reduceActiveUsers(state: PAActiveUsersState, event: PAActiveUsersCommand | PAEffectResultEvent<PAActiveUsersEffects>): {
45
- state: PAActiveUsersState;
46
- effects: PAEffect<PAActiveUsersEffects>[];
47
- };
@@ -1,10 +0,0 @@
1
- import type { PAFeatureAuthority } from '../account/contracts';
2
- import type { PAEffect } from '../kernel/effects';
3
- import { type PAFeatureQuery, type PAFeatureState, type PAStage7Effects, type PAStage7Input } from './contracts';
4
- export declare function isAppearanceOperation(operation: {
5
- kind: string;
6
- }): boolean;
7
- export declare function reduceAppearance(initial: PAFeatureState, authority: PAFeatureAuthority, input: PAStage7Input, queryKey: (query: PAFeatureQuery) => string): {
8
- state: PAFeatureState;
9
- effects: readonly PAEffect<PAStage7Effects>[];
10
- };
@@ -1,22 +0,0 @@
1
- import type { PAStage7Slices } from '../features/contracts';
2
- import type { PAConversationState } from '../conversation/contracts';
3
- import type { PADirectoryState } from '../session-directory/contracts';
4
- import type { PAFeatureName } from './contracts';
5
- export type PAPreferenceOpening = Readonly<{
6
- sessionId: string | null;
7
- generation: number;
8
- openedAt: number;
9
- awaitingBaseline: boolean;
10
- ignoredTurns: readonly string[];
11
- turns: Readonly<Record<string, Readonly<{
12
- startedAt: number;
13
- active: boolean;
14
- notifications: boolean;
15
- tab_grouping: boolean;
16
- notificationsSuppressed?: boolean;
17
- tab_groupingSuppressed?: boolean;
18
- }>>>;
19
- shown: Readonly<Partial<Record<PAFeatureName, string>>>;
20
- }>;
21
- export declare function observePreferenceOpenings(state: PAStage7Slices, conversation: PAConversationState, directory: PADirectoryState, now: number): PAStage7Slices;
22
- export declare function preferenceTurn(state: PAStage7Slices, scope: string, feature: PAFeatureName): string | null;
@@ -1,6 +0,0 @@
1
- import type { PAInteractionState, PAPreferencePrompts, PAUserDecision, PAUserDecisionInput } from './contracts';
2
- export declare function userDecisionKey(input: PAUserDecisionInput): string;
3
- export declare function assertCategoryAction(input: PAUserDecisionInput): void;
4
- export declare function mergeUserDecisions(state: PAInteractionState, decisions: readonly PAUserDecision[]): PAInteractionState;
5
- export declare function mergePreferencePrompts(state: PAInteractionState, value: PAPreferencePrompts): PAInteractionState;
6
- export declare function decisionSuppresses(decision: PAUserDecision | undefined, now: number): boolean;
@@ -1,19 +0,0 @@
1
- import type { ProductAgentInteraction } from './runtimeState';
2
- type Card = Pick<ProductAgentInteraction, 'id' | 'revision' | 'sourceVersion' | 'payload'>;
3
- type Feedback = {
4
- action: string | null;
5
- error: string | null;
6
- observedError: unknown;
7
- timer?: ReturnType<typeof setTimeout>;
8
- };
9
- export declare function featureActionFeedbackKey(scope: string, card: Card): string;
10
- export declare function createFeatureActionFeedback(changed: () => void): {
11
- sync(cards: readonly {
12
- key: string;
13
- card: Card;
14
- }[]): boolean;
15
- get(key: string): Feedback | undefined;
16
- run(key: string, action: string, work: () => Promise<unknown>): Promise<void>;
17
- dispose(): void;
18
- };
19
- export {};
@@ -1,62 +0,0 @@
1
- export declare const PERSONAL_PRODUCT_AGENT_MODELS: readonly [{
2
- readonly value: "gpt-6-sol";
3
- readonly label: "gpt-6-sol";
4
- readonly price: "$$";
5
- }, {
6
- readonly value: "gpt-6-luna";
7
- readonly label: "gpt-6-luna";
8
- readonly price: "$";
9
- }, {
10
- readonly value: "deepseek/deepseek-v4-flash";
11
- readonly label: "DeepSeek V4 Flash";
12
- readonly price: "$";
13
- }, {
14
- readonly value: "anthropic/claude-opus-5.5";
15
- readonly label: "Claude Opus 5.5";
16
- readonly price: "$$$";
17
- }];
18
- export type PersonalProductAgentModel = (typeof PERSONAL_PRODUCT_AGENT_MODELS)[number]["value"];
19
- export declare function groupPersonalProductAgentModels<T>(models: readonly T[]): {
20
- primary: readonly T[];
21
- more: readonly T[];
22
- };
23
- export declare const PERSONAL_PRODUCT_AGENT_PRIMARY_MODELS: readonly ({
24
- readonly value: "gpt-6-sol";
25
- readonly label: "gpt-6-sol";
26
- readonly price: "$$";
27
- } | {
28
- readonly value: "gpt-6-luna";
29
- readonly label: "gpt-6-luna";
30
- readonly price: "$";
31
- } | {
32
- readonly value: "deepseek/deepseek-v4-flash";
33
- readonly label: "DeepSeek V4 Flash";
34
- readonly price: "$";
35
- } | {
36
- readonly value: "anthropic/claude-opus-5.5";
37
- readonly label: "Claude Opus 5.5";
38
- readonly price: "$$$";
39
- })[];
40
- export declare const PERSONAL_PRODUCT_AGENT_MORE_MODELS: readonly ({
41
- readonly value: "gpt-6-sol";
42
- readonly label: "gpt-6-sol";
43
- readonly price: "$$";
44
- } | {
45
- readonly value: "gpt-6-luna";
46
- readonly label: "gpt-6-luna";
47
- readonly price: "$";
48
- } | {
49
- readonly value: "deepseek/deepseek-v4-flash";
50
- readonly label: "DeepSeek V4 Flash";
51
- readonly price: "$";
52
- } | {
53
- readonly value: "anthropic/claude-opus-5.5";
54
- readonly label: "Claude Opus 5.5";
55
- readonly price: "$$$";
56
- })[];
57
- export declare const isPersonalProductAgentModel: (value: unknown) => value is PersonalProductAgentModel;
58
- export declare const getPersonalProductAgentModelMenuLabel: (model: {
59
- value: string;
60
- label: string;
61
- }) => string;
62
- export declare const resolvePersonalProductAgentNextModel: (model: string | undefined) => PersonalProductAgentModel | undefined;