@paymanai/payman-typescript-ask-sdk 1.2.10 → 1.2.11
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.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -2
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +28 -1
- package/dist/index.native.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.js
CHANGED
|
@@ -194,6 +194,14 @@ function getEventMessage(event) {
|
|
|
194
194
|
return eventType;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
+
function workingPhaseDetailForDisplay(raw) {
|
|
198
|
+
const t = raw.trim();
|
|
199
|
+
if (!t) return "";
|
|
200
|
+
if (/^Identified\s+\d+\s+tasks?\s+to\s+execute\.?$/i.test(t)) {
|
|
201
|
+
return "";
|
|
202
|
+
}
|
|
203
|
+
return t;
|
|
204
|
+
}
|
|
197
205
|
function extractResponseContent(response) {
|
|
198
206
|
if (typeof response === "string") {
|
|
199
207
|
return response;
|
|
@@ -529,6 +537,12 @@ function buildFormattedThinking(steps, allThinkingText) {
|
|
|
529
537
|
parts.push("**Planning**");
|
|
530
538
|
if (step.message) parts.push(step.message);
|
|
531
539
|
break;
|
|
540
|
+
case "WORKING": {
|
|
541
|
+
const detail = workingPhaseDetailForDisplay(step.message || "");
|
|
542
|
+
parts.push("**Working**");
|
|
543
|
+
if (detail) parts.push(detail);
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
532
546
|
case "INTENT_STARTED": {
|
|
533
547
|
let label = step.message || "Processing";
|
|
534
548
|
const started = label.match(/^(.+?)\s+started$/i);
|
|
@@ -1523,7 +1537,19 @@ function processStreamEventV2(event, state) {
|
|
|
1523
1537
|
break;
|
|
1524
1538
|
}
|
|
1525
1539
|
case "ORCHESTRATOR_COMPLETED": {
|
|
1526
|
-
|
|
1540
|
+
const workingDetail = workingPhaseDetailForDisplay(message);
|
|
1541
|
+
if (workingDetail) {
|
|
1542
|
+
addThinkingLine(state, "**Working**", workingDetail);
|
|
1543
|
+
} else {
|
|
1544
|
+
addThinkingHeader(state, "**Working**");
|
|
1545
|
+
}
|
|
1546
|
+
state.steps.push({
|
|
1547
|
+
id: `step-${state.stepCounter++}`,
|
|
1548
|
+
eventType: "WORKING",
|
|
1549
|
+
message: workingDetail,
|
|
1550
|
+
status: "completed",
|
|
1551
|
+
timestamp: Date.now()
|
|
1552
|
+
});
|
|
1527
1553
|
const step = state.steps.find((s) => s.eventType === "ORCHESTRATOR_THINKING" && s.status === "in_progress");
|
|
1528
1554
|
if (step) {
|
|
1529
1555
|
step.status = "completed";
|
|
@@ -2434,5 +2460,6 @@ exports.submitUserAction = submitUserAction;
|
|
|
2434
2460
|
exports.useChat = useChat;
|
|
2435
2461
|
exports.useChatV2 = useChatV2;
|
|
2436
2462
|
exports.useVoice = useVoice;
|
|
2463
|
+
exports.workingPhaseDetailForDisplay = workingPhaseDetailForDisplay;
|
|
2437
2464
|
//# sourceMappingURL=index.native.js.map
|
|
2438
2465
|
//# sourceMappingURL=index.native.js.map
|