@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.
- package/README.md +4 -0
- package/dist/adapters/web/accountPresentation.d.ts +3 -3
- package/dist/adapters/web/directoryAdapters.d.ts +0 -1
- package/dist/adapters/web/featureHttp.d.ts +6 -22
- package/dist/adapters/web/featureLifecycle.d.ts +2 -15
- package/dist/adapters/web/featureOwner.d.ts +5 -6
- package/dist/adapters/web/featurePresentation.d.ts +4 -4
- package/dist/core/account/contracts.d.ts +6 -18
- package/dist/core/account/selectors.d.ts +2 -2
- package/dist/core/account/state.d.ts +1 -1
- package/dist/core/conversation/deliveryContracts.d.ts +1 -1
- package/dist/core/features/contracts.d.ts +37 -338
- package/dist/core/features/reducer.d.ts +5 -7
- package/dist/core/features/selectors.d.ts +1 -1
- package/dist/core/features/state.d.ts +1 -1
- package/dist/core/index.d.ts +0 -2
- package/dist/core/interactions/actions.d.ts +7 -7
- package/dist/core/interactions/contracts.d.ts +8 -121
- package/dist/core/interactions/selectors.d.ts +5 -25
- package/dist/core/interactions/state.d.ts +1 -1
- package/dist/core/kernel/capabilities.d.ts +0 -14
- package/dist/core/model-selection/selectors.d.ts +1 -1
- package/dist/core/session-directory/contracts.d.ts +0 -1
- package/dist/index.d.ts +2 -37
- package/dist/operationTiming.d.ts +1 -1
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +221 -274
- package/dist/product-agent-sdk.js +4717 -6136
- package/dist/product-agent-widget.js +5994 -8146
- package/dist/public/operationRoutes.d.ts +0 -3
- package/dist/runtime/composition.d.ts +3 -8
- package/dist/runtime/modelSelection.d.ts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtimeClient.d.ts +0 -6
- package/dist/runtimeState.d.ts +0 -10
- package/dist/shareCard.d.ts +0 -25
- package/dist/widget.d.ts +2 -28
- package/package.json +2 -3
- package/dist/activeUsersCounter.d.ts +0 -4
- package/dist/adapters/web/activeUsers.d.ts +0 -4
- package/dist/adapters/web/deviceHints.d.ts +0 -2
- package/dist/adapters/web/localPreferences.d.ts +0 -17
- package/dist/core/account/reducer.d.ts +0 -2
- package/dist/core/active-users/reducer.d.ts +0 -47
- package/dist/core/features/appearance.d.ts +0 -10
- package/dist/core/interactions/preferenceOpenings.d.ts +0 -22
- package/dist/core/interactions/reducer.d.ts +0 -6
- package/dist/featureActionFeedback.d.ts +0 -19
- package/dist/modelSelection.d.ts +0 -62
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Stack-agnostic browser SDK and default widget for embedding Product Agent into customer webapps.
|
|
4
4
|
|
|
5
|
+
## Personal retirement compatibility
|
|
6
|
+
|
|
7
|
+
SDK 0.1.317 removes the retired personal model catalog, permission adapters, personal channel connection handler, sharing helpers, and personal composer admission helpers. Personal initialization and widget configuration reject before credential or storage access. Embedded widget handles, custom UI, authentication, attachments, history, Stop, and accepted routing remain supported. `refreshAccount` and `recordPromptPresented` accept old calls without restoring personal feature state. Historical interaction payloads are decoded without enabling personal controls.
|
|
8
|
+
|
|
5
9
|
## Install
|
|
6
10
|
|
|
7
11
|
```bash
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PAAccountData, PAAccountState } from
|
|
2
|
-
import type { ProductAgentAccountProjection } from
|
|
3
|
-
export declare function accountData(presentation: ProductAgentAccountProjection, user: PAAccountData[
|
|
1
|
+
import type { PAAccountData, PAAccountState } from "../../core/account/contracts";
|
|
2
|
+
import type { ProductAgentAccountProjection } from "../../core/account/presentation";
|
|
3
|
+
export declare function accountData(presentation: ProductAgentAccountProjection, user: PAAccountData["user"], communityId: string | null): PAAccountData;
|
|
4
4
|
export declare function projectAccount(state: PAAccountState, sessionId?: string | null): ProductAgentAccountProjection | null;
|
|
@@ -32,7 +32,6 @@ export declare function createDirectoryPorts(options: AuthorityBoundary & {
|
|
|
32
32
|
pageUrl: () => string;
|
|
33
33
|
now: () => number;
|
|
34
34
|
onError?: (error: unknown) => void;
|
|
35
|
-
onPersonalModel?: (model: string) => void;
|
|
36
35
|
}): PADirectoryPorts;
|
|
37
36
|
type RecoveryHandle = Pick<ProductAgentSessionRecoveryPoller<unknown>, 'start' | 'stop' | 'refresh'>;
|
|
38
37
|
export type PADirectoryRecoveryHandles = {
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { PAFeatureResult, PAStage7Ports, PAFeatureQuery } from '../../core/features/contracts';
|
|
5
|
-
import type { PAPreferencePrompt, PAPreferencePrompts, PAUserDecision } from '../../core/interactions/contracts';
|
|
6
|
-
export declare function decodeFeaturePreferences(value: unknown): PAFeaturePreferences;
|
|
7
|
-
export declare function decodePreferencePrompt(value: unknown): PAPreferencePrompt;
|
|
8
|
-
export declare function decodePreferencePrompts(value: unknown): PAPreferencePrompts;
|
|
9
|
-
export declare function decodeUserDecision(value: unknown): PAUserDecision;
|
|
1
|
+
import type { ProductAgentHttpTransport } from "./backendHttp";
|
|
2
|
+
import type { PAAccountData, PAFeatureAuthority } from "../../core/account/contracts";
|
|
3
|
+
import type { PAFeatureResult, PAStage7Ports, PAFeatureQuery } from "../../core/features/contracts";
|
|
10
4
|
export type PAFeatureHttpOptions = Readonly<{
|
|
11
|
-
http: Pick<ProductAgentHttpTransport,
|
|
12
|
-
preferenceStorage?: LocalPreferenceStorage;
|
|
5
|
+
http: Pick<ProductAgentHttpTransport, "request">;
|
|
13
6
|
now: () => number;
|
|
14
7
|
authority: () => PAFeatureAuthority | null;
|
|
15
|
-
onContextStatusRead?: (event: Readonly<{
|
|
16
|
-
requestId: string;
|
|
17
|
-
origin: string;
|
|
18
|
-
trigger: string;
|
|
19
|
-
phase: 'started' | 'ready' | 'failed';
|
|
20
|
-
code?: string;
|
|
21
|
-
retryable?: boolean;
|
|
22
|
-
}>) => void;
|
|
23
|
-
sampleStyle?: (page: import('../../core/features/contracts').PAFeaturePage) => Promise<import('../../core/features/contracts').PAOriginAppearance>;
|
|
24
8
|
readAccount: (authority: PAFeatureAuthority) => Promise<PAAccountData>;
|
|
25
9
|
embedded: Readonly<{
|
|
26
10
|
appearance: (query: Extract<PAFeatureQuery, {
|
|
27
|
-
kind:
|
|
11
|
+
kind: "appearance";
|
|
28
12
|
}>) => Promise<PAFeatureResult>;
|
|
29
13
|
feedback: (message: string) => Promise<boolean>;
|
|
30
14
|
}>;
|
|
31
15
|
}>;
|
|
32
|
-
export declare function createFeatureHttpPorts(options: PAFeatureHttpOptions): Pick<PAStage7Ports,
|
|
16
|
+
export declare function createFeatureHttpPorts(options: PAFeatureHttpOptions): Pick<PAStage7Ports, "stage7.query" | "stage7.mutate">;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PAFeatureAuthority } from '../../core/account/contracts';
|
|
3
|
-
import type { PAStage7Ports } from '../../core/features/contracts';
|
|
4
|
-
import type { PAFeatureName, PADeviceFact } from '../../core/interactions/contracts';
|
|
1
|
+
import type { PAStage7Ports } from "../../core/features/contracts";
|
|
5
2
|
export declare function createFeatureScheduler(now: () => number): Readonly<{
|
|
6
|
-
wait: PAStage7Ports[
|
|
3
|
+
wait: PAStage7Ports["stage7.wait"];
|
|
7
4
|
dispose: () => void;
|
|
8
5
|
}>;
|
|
9
|
-
export type PAFeatureDeviceAdapter = Readonly<{
|
|
10
|
-
authority: () => PAFeatureAuthority | null;
|
|
11
|
-
enabled: (feature: PAFeatureName) => boolean;
|
|
12
|
-
now: () => number;
|
|
13
|
-
check: (authority: PAFeatureAuthority, feature: PAFeatureName) => Promise<PADeviceFact>;
|
|
14
|
-
allow: (authority: PAFeatureAuthority, feature: PAFeatureName, requestId: string) => Promise<PADeviceFact>;
|
|
15
|
-
postpone: (authority: PAFeatureAuthority, feature: PAFeatureName, requestId: string) => Promise<PADeviceFact>;
|
|
16
|
-
}>;
|
|
17
|
-
export declare function createFeatureDevicePort(adapter: PAFeatureDeviceAdapter): PAStage7Ports['stage7.device'];
|
|
18
|
-
export declare function observeFeatureWork(runtime: PAClientRuntime, now: () => number): () => void;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import type { PAClientRuntime } from
|
|
2
|
-
import type { PAFeatureAuthority } from
|
|
3
|
-
import type { PAFeatureMutation, PAFeatureQuery, PAFeatureResult, PAStage7Command } from
|
|
1
|
+
import type { PAClientRuntime } from "../../runtime/composition";
|
|
2
|
+
import type { PAFeatureAuthority } from "../../core/account/contracts";
|
|
3
|
+
import type { PAFeatureMutation, PAFeatureQuery, PAFeatureResult, PAStage7Command } from "../../core/features/contracts";
|
|
4
4
|
export declare function initializeFeatureOwner(runtime: PAClientRuntime, authority: PAFeatureAuthority, now: number): Promise<void>;
|
|
5
5
|
export declare function featureQuery(runtime: PAClientRuntime, query: PAFeatureQuery, options?: {
|
|
6
6
|
force?: boolean;
|
|
7
7
|
}): Promise<PAFeatureResult>;
|
|
8
8
|
export declare function featureMutation(runtime: PAClientRuntime, mutation: PAFeatureMutation, requestId?: string): Promise<PAFeatureResult>;
|
|
9
|
-
export declare function observeContextRun(runtime: PAClientRuntime, runId: string, signal: AbortSignal, timeoutMs: number): Promise<import('../../core/features/contracts').PAContextStatus | null>;
|
|
10
9
|
export type FeatureAction = Omit<Extract<PAStage7Command, {
|
|
11
|
-
type:
|
|
12
|
-
}>,
|
|
10
|
+
type: "stage7.act";
|
|
11
|
+
}>, "type" | "authority" | "now" | "requestId" | "sourceVersion"> & {
|
|
13
12
|
expectedSourceVersion?: number | null;
|
|
14
13
|
};
|
|
15
14
|
export declare function featureAction(runtime: PAClientRuntime, action: FeatureAction, newRequestId?: string): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PAStage7Slices } from
|
|
2
|
-
import type { PAConversationState } from
|
|
3
|
-
import type { PADirectoryState } from
|
|
4
|
-
import type { ProductAgentInteraction } from
|
|
1
|
+
import type { PAStage7Slices } from "../../core/features/contracts";
|
|
2
|
+
import type { PAConversationState } from "../../core/conversation/contracts";
|
|
3
|
+
import type { PADirectoryState } from "../../core/session-directory/contracts";
|
|
4
|
+
import type { ProductAgentInteraction } from "../../runtimeState";
|
|
5
5
|
export declare function projectFeatureInteractions(state: PAStage7Slices, conversation: PAConversationState, directory: PADirectoryState, clientScopeId: string): readonly ProductAgentInteraction[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ProductAgentAccountProjection, ProductAgentSubmissionGate } from
|
|
2
|
-
import type { PAClientCapabilityProfile, PAOperation } from
|
|
3
|
-
import type { PAQueryState } from
|
|
1
|
+
import type { ProductAgentAccountProjection, ProductAgentSubmissionGate } from "./presentation";
|
|
2
|
+
import type { PAClientCapabilityProfile, PAOperation } from "../kernel/capabilities";
|
|
3
|
+
import type { PAQueryState } from "../kernel/state";
|
|
4
4
|
export type PAFeatureAuthority = Readonly<{
|
|
5
5
|
authorityId: string;
|
|
6
6
|
generation: number;
|
|
@@ -10,18 +10,8 @@ export type PAFeatureAuthority = Readonly<{
|
|
|
10
10
|
profile: PAClientCapabilityProfile;
|
|
11
11
|
interactionAdapters?: Readonly<{
|
|
12
12
|
integrationAuth: boolean;
|
|
13
|
-
personalChannel: boolean;
|
|
14
13
|
}>;
|
|
15
14
|
}>;
|
|
16
|
-
export type PAFeaturePreferences = Readonly<{
|
|
17
|
-
taskNotificationsEnabled: boolean | null;
|
|
18
|
-
tabGroupingEnabled: boolean | null;
|
|
19
|
-
preferencesVersion: number;
|
|
20
|
-
scribbleStyleEnabled: boolean | null;
|
|
21
|
-
blockedOrigins: readonly string[];
|
|
22
|
-
personalInstructions: string | null;
|
|
23
|
-
securityPolicyVersion?: number;
|
|
24
|
-
}>;
|
|
25
15
|
export type PAAccountData = Readonly<{
|
|
26
16
|
presentation?: ProductAgentAccountProjection;
|
|
27
17
|
referralLink?: string;
|
|
@@ -37,20 +27,18 @@ export type PAAccountData = Readonly<{
|
|
|
37
27
|
workspaceName: string | null;
|
|
38
28
|
credits: number | null;
|
|
39
29
|
usage: number | null;
|
|
40
|
-
billing:
|
|
30
|
+
billing: "available" | "required" | "exhausted" | "unknown";
|
|
41
31
|
submissionAllowed: boolean;
|
|
42
32
|
hostedBrowserEligible: boolean | null;
|
|
43
33
|
}>;
|
|
44
34
|
export type PAAccountState = Readonly<{
|
|
45
35
|
authority: PAFeatureAuthority | null;
|
|
46
36
|
refusal: ProductAgentSubmissionGate | null;
|
|
47
|
-
paidFallbackBySession: Readonly<Record<string, boolean>>;
|
|
48
37
|
query: PAQueryState<string, PAAccountData>;
|
|
49
|
-
preferences: PAFeaturePreferences | null;
|
|
50
38
|
}>;
|
|
51
39
|
export type PAAccessDecision = Readonly<{
|
|
52
40
|
operation: PAOperation;
|
|
53
41
|
allowed: boolean;
|
|
54
|
-
reason:
|
|
55
|
-
recovery:
|
|
42
|
+
reason: "allowed" | "capability" | "authentication" | "workspace" | "billing" | "unavailable" | "blocked_origin" | "device";
|
|
43
|
+
recovery: "none" | "login" | "select_workspace" | "billing" | "refresh" | "settings";
|
|
56
44
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type PAOperation } from
|
|
2
|
-
import type { PAAccessDecision, PAAccountState } from
|
|
1
|
+
import { type PAOperation } from "../kernel/capabilities";
|
|
2
|
+
import type { PAAccessDecision, PAAccountState } from "./contracts";
|
|
3
3
|
export declare function selectAccountAccess(state: PAAccountState, operation: PAOperation, origin?: string | null, deviceAvailable?: boolean): PAAccessDecision;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PAAccountState, PAFeatureAuthority } from
|
|
1
|
+
import type { PAAccountState, PAFeatureAuthority } from "./contracts";
|
|
2
2
|
export declare function createAccountState(authority?: PAFeatureAuthority | null): PAAccountState;
|
|
@@ -14,7 +14,7 @@ export type PAUploadedAttachment = Readonly<{
|
|
|
14
14
|
}>;
|
|
15
15
|
export type PAConversationWireCommand = Readonly<{
|
|
16
16
|
request_id: string;
|
|
17
|
-
type: "chat.user_message" | "chat.retry_last_user_message" | "run.stop" | "attachment.upload_completed" | "
|
|
17
|
+
type: "chat.user_message" | "chat.retry_last_user_message" | "run.stop" | "attachment.upload_completed" | "session.reset";
|
|
18
18
|
payload: PAJsonObject;
|
|
19
19
|
}>;
|
|
20
20
|
export type PAConversationDelivery = Readonly<{
|