@pluno/product-agent-web 0.1.162 → 0.1.163
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/index.d.ts +1 -0
- package/dist/product-agent-sdk.js +29 -20
- package/dist/product-agent-widget.js +29 -20
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -228,6 +228,7 @@ export declare class PlunoProductAgent {
|
|
|
228
228
|
private readonly transportIdentity;
|
|
229
229
|
private retryAttemptsByClientMessageId;
|
|
230
230
|
private retryTimersByClientMessageId;
|
|
231
|
+
private readonly reportedHealthSignalKeys;
|
|
231
232
|
private readonly clientMessageIdsByUserMessageItemId;
|
|
232
233
|
private readonly backgroundSessionIds;
|
|
233
234
|
private readonly backgroundClientMessageIds;
|
|
@@ -415,6 +415,7 @@ class xt {
|
|
|
415
415
|
transportIdentity;
|
|
416
416
|
retryAttemptsByClientMessageId = {};
|
|
417
417
|
retryTimersByClientMessageId = {};
|
|
418
|
+
reportedHealthSignalKeys = /* @__PURE__ */ new Set();
|
|
418
419
|
clientMessageIdsByUserMessageItemId = /* @__PURE__ */ new Map();
|
|
419
420
|
backgroundSessionIds = /* @__PURE__ */ new Set();
|
|
420
421
|
backgroundClientMessageIds = /* @__PURE__ */ new Set();
|
|
@@ -944,27 +945,35 @@ class xt {
|
|
|
944
945
|
}
|
|
945
946
|
}
|
|
946
947
|
reportHealthSignal(e, s = {}) {
|
|
947
|
-
if (!
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}));
|
|
962
|
-
} catch (n) {
|
|
963
|
-
M("web-sdk.agent", "Pluno health signal send failed", {
|
|
948
|
+
if (!this.socket || this.socket.readyState !== WebSocket.OPEN)
|
|
949
|
+
return;
|
|
950
|
+
const n = s.clientMessageId ?? this.activeResponseRunId;
|
|
951
|
+
if (n) {
|
|
952
|
+
const r = `${e}:${n}`;
|
|
953
|
+
if (this.reportedHealthSignalKeys.has(r))
|
|
954
|
+
return;
|
|
955
|
+
this.reportedHealthSignalKeys.add(r);
|
|
956
|
+
}
|
|
957
|
+
try {
|
|
958
|
+
this.socket.send(JSON.stringify({
|
|
959
|
+
type: "runtime.health",
|
|
960
|
+
signal: {
|
|
961
|
+
id: crypto.randomUUID(),
|
|
964
962
|
name: e,
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
963
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
964
|
+
source: "web_sdk",
|
|
965
|
+
entrySurface: this.options.entrySurface,
|
|
966
|
+
...this.state.sessionId ? { sessionId: this.state.sessionId } : {},
|
|
967
|
+
...this.activeResponseRunId ? { runId: this.activeResponseRunId } : {},
|
|
968
|
+
...s
|
|
969
|
+
}
|
|
970
|
+
}));
|
|
971
|
+
} catch (r) {
|
|
972
|
+
M("web-sdk.agent", "Pluno health signal send failed", {
|
|
973
|
+
name: e,
|
|
974
|
+
message: r instanceof Error ? r.message : String(r)
|
|
975
|
+
});
|
|
976
|
+
}
|
|
968
977
|
}
|
|
969
978
|
requestTransientStarterPrompts() {
|
|
970
979
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
|
@@ -533,6 +533,7 @@ class ko {
|
|
|
533
533
|
transportIdentity;
|
|
534
534
|
retryAttemptsByClientMessageId = {};
|
|
535
535
|
retryTimersByClientMessageId = {};
|
|
536
|
+
reportedHealthSignalKeys = /* @__PURE__ */ new Set();
|
|
536
537
|
clientMessageIdsByUserMessageItemId = /* @__PURE__ */ new Map();
|
|
537
538
|
backgroundSessionIds = /* @__PURE__ */ new Set();
|
|
538
539
|
backgroundClientMessageIds = /* @__PURE__ */ new Set();
|
|
@@ -1062,27 +1063,35 @@ class ko {
|
|
|
1062
1063
|
}
|
|
1063
1064
|
}
|
|
1064
1065
|
reportHealthSignal(e, n = {}) {
|
|
1065
|
-
if (!
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
}));
|
|
1080
|
-
} catch (i) {
|
|
1081
|
-
X("web-sdk.agent", "Pluno health signal send failed", {
|
|
1066
|
+
if (!this.socket || this.socket.readyState !== WebSocket.OPEN)
|
|
1067
|
+
return;
|
|
1068
|
+
const i = n.clientMessageId ?? this.activeResponseRunId;
|
|
1069
|
+
if (i) {
|
|
1070
|
+
const o = `${e}:${i}`;
|
|
1071
|
+
if (this.reportedHealthSignalKeys.has(o))
|
|
1072
|
+
return;
|
|
1073
|
+
this.reportedHealthSignalKeys.add(o);
|
|
1074
|
+
}
|
|
1075
|
+
try {
|
|
1076
|
+
this.socket.send(JSON.stringify({
|
|
1077
|
+
type: "runtime.health",
|
|
1078
|
+
signal: {
|
|
1079
|
+
id: crypto.randomUUID(),
|
|
1082
1080
|
name: e,
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1081
|
+
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1082
|
+
source: "web_sdk",
|
|
1083
|
+
entrySurface: this.options.entrySurface,
|
|
1084
|
+
...this.state.sessionId ? { sessionId: this.state.sessionId } : {},
|
|
1085
|
+
...this.activeResponseRunId ? { runId: this.activeResponseRunId } : {},
|
|
1086
|
+
...n
|
|
1087
|
+
}
|
|
1088
|
+
}));
|
|
1089
|
+
} catch (o) {
|
|
1090
|
+
X("web-sdk.agent", "Pluno health signal send failed", {
|
|
1091
|
+
name: e,
|
|
1092
|
+
message: o instanceof Error ? o.message : String(o)
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1086
1095
|
}
|
|
1087
1096
|
requestTransientStarterPrompts() {
|
|
1088
1097
|
if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
|
package/package.json
CHANGED