@pluno/product-agent-web 0.1.316 → 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 (35) hide show
  1. package/README.md +4 -0
  2. package/dist/adapters/web/accountPresentation.d.ts +3 -3
  3. package/dist/adapters/web/featureHttp.d.ts +6 -20
  4. package/dist/adapters/web/featureLifecycle.d.ts +2 -15
  5. package/dist/adapters/web/featureOwner.d.ts +5 -6
  6. package/dist/adapters/web/featurePresentation.d.ts +4 -4
  7. package/dist/core/account/contracts.d.ts +6 -18
  8. package/dist/core/account/selectors.d.ts +2 -2
  9. package/dist/core/account/state.d.ts +1 -1
  10. package/dist/core/features/contracts.d.ts +37 -338
  11. package/dist/core/features/reducer.d.ts +5 -7
  12. package/dist/core/features/selectors.d.ts +1 -1
  13. package/dist/core/features/state.d.ts +1 -1
  14. package/dist/core/index.d.ts +0 -2
  15. package/dist/core/interactions/actions.d.ts +7 -7
  16. package/dist/core/interactions/contracts.d.ts +8 -121
  17. package/dist/core/interactions/selectors.d.ts +5 -25
  18. package/dist/core/interactions/state.d.ts +1 -1
  19. package/dist/index.d.ts +1 -29
  20. package/dist/product-agent-runtime.cjs +1 -1
  21. package/dist/product-agent-runtime.js +221 -265
  22. package/dist/product-agent-sdk.js +4423 -5276
  23. package/dist/product-agent-widget.js +5075 -6569
  24. package/dist/runtime.d.ts +1 -1
  25. package/dist/runtimeState.d.ts +0 -10
  26. package/dist/shareCard.d.ts +0 -25
  27. package/dist/widget.d.ts +2 -26
  28. package/package.json +1 -1
  29. package/dist/adapters/web/deviceHints.d.ts +0 -2
  30. package/dist/core/account/reducer.d.ts +0 -2
  31. package/dist/core/features/appearance.d.ts +0 -10
  32. package/dist/core/interactions/preferenceOpenings.d.ts +0 -22
  33. package/dist/core/interactions/reducer.d.ts +0 -6
  34. package/dist/featureActionFeedback.d.ts +0 -19
  35. package/dist/modelSelection.d.ts +0 -62
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";
@@ -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,6 +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";
1
+ import { ProductAgentTokenProviderError, type ProductAgentAttachment, type ProductAgentIntegrationAuthRequest, type ProductAgentInitOptions, type ProductAgentModel, type ProductAgentRuntimeAdapters, type ProductAgentRuntimeClient, type ProductAgentWidgetLifecycleTrigger } from "./index";
4
2
  import { type ProductAgentInteraction, type ProductAgentAccountProjection } from "./runtimeState";
5
3
  export { ProductAgentTokenProviderError };
6
4
  export type ProductAgentWidgetOptions = {
@@ -14,7 +12,6 @@ export type ProductAgentWidgetOptions = {
14
12
  metadata?: Record<string, unknown> | (() => Record<string, unknown> | undefined);
15
13
  productVariant?: ProductAgentInitOptions["productVariant"];
16
14
  model?: ProductAgentModel;
17
- onModelChange?: (model: PersonalProductAgentModel) => void | Promise<void>;
18
15
  entrySurface?: ProductAgentInitOptions["entrySurface"];
19
16
  launcherLabel?: string;
20
17
  accentColor?: string;
@@ -47,7 +44,6 @@ export type ProductAgentWidgetOptions = {
47
44
  signupButtonLabel?: string;
48
45
  signupUrl?: string;
49
46
  onSignupClick?: () => void;
50
- referralLinkLoader?: () => Promise<string>;
51
47
  billingStatus?: ProductAgentWidgetBillingStatus | null;
52
48
  billingStatusLoader?: () => Promise<ProductAgentWidgetBillingStatus | null>;
53
49
  runtimeAdapters?: ProductAgentRuntimeAdapters;
@@ -63,30 +59,10 @@ export type ProductAgentWidgetOptions = {
63
59
  showLauncherMinimizeButton?: boolean;
64
60
  };
65
61
  export type ProductAgentIntegrationAuthStatus = "pending" | "completed" | "cancelled" | "expired";
66
- export type ProductAgentWidgetMorningReport = {
67
- opening: string;
68
- prompts: string[];
69
- };
70
- export type ProductAgentWidgetProactiveSuggestion = {
71
- id: string;
72
- interactionId: string;
73
- genericQuestion: string;
74
- question: string;
75
- };
76
- export type ProductAgentWidgetRuntimeInteraction = ProductAgentInteraction<"social_share", {
77
- candidate: ProductAgentShareCandidate;
78
- }> | ProductAgentInteraction<"task_notifications", {
79
- enabled: boolean;
80
- }> | ProductAgentInteraction<"tab_group_permission", {
81
- permissionNeeded: boolean;
82
- }> | ProductAgentInteraction<"proactive_suggestion", {
83
- suggestion: ProductAgentWidgetProactiveSuggestion;
84
- }> | ProductAgentInteraction<"morning_report", ProductAgentWidgetMorningReport> | ProductAgentInteraction<"integration_connection", {
62
+ export type ProductAgentWidgetRuntimeInteraction = ProductAgentInteraction<"integration_connection", {
85
63
  request: ProductAgentIntegrationAuthRequest;
86
64
  status: ProductAgentIntegrationAuthStatus | "checking" | "error";
87
65
  error?: string | null;
88
- }> | ProductAgentInteraction<"personal_channel_connection", {
89
- request: ProductAgentPersonalChannelConnectionRequest;
90
66
  }>;
91
67
  export type ProductAgentWidgetBillingStatus = ProductAgentAccountProjection;
92
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.316",
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",
@@ -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,2 +0,0 @@
1
- import type { PAAccountState, PAFeaturePreferences } from './contracts';
2
- export declare function mergeFeaturePreferences(state: PAAccountState, value: PAFeaturePreferences): PAAccountState;
@@ -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;