@paymanai/payman-ask-sdk 1.2.5 → 1.2.7
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.js +39 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -218,7 +218,7 @@ function ThinkingBlock({ text }) {
|
|
|
218
218
|
{
|
|
219
219
|
type: "button",
|
|
220
220
|
onClick: () => setIsOpen((prev) => !prev),
|
|
221
|
-
className: "inline-flex items-center gap-1 text-[10px]
|
|
221
|
+
className: "inline-flex items-center gap-1 text-[10px] payman-agent-thinking-toggle transition-colors",
|
|
222
222
|
"aria-expanded": isOpen,
|
|
223
223
|
"aria-label": isOpen ? "Collapse thought process" : "Expand thought process",
|
|
224
224
|
children: [
|
|
@@ -243,7 +243,7 @@ function ThinkingBlock({ text }) {
|
|
|
243
243
|
exit: { height: 0, opacity: 0 },
|
|
244
244
|
transition: { duration: 0.2, ease: "easeInOut" },
|
|
245
245
|
className: "overflow-hidden",
|
|
246
|
-
children: /* @__PURE__ */ jsx("div", { className: "mt-1
|
|
246
|
+
children: /* @__PURE__ */ jsx("div", { className: "mt-1 payman-agent-thinking-block rounded-md p-2 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsx("p", { className: "m-0 text-xs payman-agent-thinking-block-text whitespace-pre-wrap leading-relaxed", children: text }) })
|
|
247
247
|
}
|
|
248
248
|
) })
|
|
249
249
|
] });
|
|
@@ -343,19 +343,19 @@ function AgentMessage({
|
|
|
343
343
|
className: cn(
|
|
344
344
|
"text-xs leading-relaxed min-w-0 break-words",
|
|
345
345
|
isCurrentlyExecuting && "shimmer-text font-medium",
|
|
346
|
-
!isCurrentlyExecuting && step.status === "error" && "
|
|
347
|
-
!isCurrentlyExecuting && step.eventType === "USER_ACTION_SUCCESS" && "
|
|
348
|
-
!isCurrentlyExecuting && step.status === "completed" && "
|
|
349
|
-
!isCurrentlyExecuting && step.status === "pending" && "
|
|
350
|
-
!isCurrentlyExecuting && step.status === "in_progress" && "
|
|
346
|
+
!isCurrentlyExecuting && step.status === "error" && "payman-agent-step-text--error",
|
|
347
|
+
!isCurrentlyExecuting && step.eventType === "USER_ACTION_SUCCESS" && "payman-agent-step-text--success",
|
|
348
|
+
!isCurrentlyExecuting && step.status === "completed" && "payman-agent-step-text--completed",
|
|
349
|
+
!isCurrentlyExecuting && step.status === "pending" && "payman-agent-step-text--pending",
|
|
350
|
+
!isCurrentlyExecuting && step.status === "in_progress" && "payman-agent-step-text--in-progress"
|
|
351
351
|
),
|
|
352
352
|
children: step.message
|
|
353
353
|
}
|
|
354
354
|
)
|
|
355
355
|
] }),
|
|
356
|
-
hasTime && /* @__PURE__ */ jsx("div", { className: "pl-[22px] mt-1", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md
|
|
357
|
-
/* @__PURE__ */ jsx(Clock, { className: "h-2.5 w-2.5
|
|
358
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono
|
|
356
|
+
hasTime && /* @__PURE__ */ jsx("div", { className: "pl-[22px] mt-1", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md payman-agent-step-time leading-none", children: [
|
|
357
|
+
/* @__PURE__ */ jsx(Clock, { className: "h-2.5 w-2.5 shrink-0 payman-agent-step-time-icon" }),
|
|
358
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-mono payman-agent-step-time-text", children: formatElapsedTime(step.elapsedMs) })
|
|
359
359
|
] }) })
|
|
360
360
|
] }, step.id);
|
|
361
361
|
}) })
|
|
@@ -409,42 +409,20 @@ function AgentMessage({
|
|
|
409
409
|
layout === "centered" ? "max-w-[85%]" : showAvatar ? "max-w-[85%]" : "max-w-[80%]"
|
|
410
410
|
),
|
|
411
411
|
children: [
|
|
412
|
-
message.userActionResult && /* @__PURE__ */ jsx("div", { className: "mb-2", children: message.userActionResult === "approved" ? /* @__PURE__ */ jsxs(
|
|
413
|
-
"
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
border: "1px solid var(--payman-agent-approved-border, var(--payman-success, #059669))"
|
|
420
|
-
},
|
|
421
|
-
children: [
|
|
422
|
-
/* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5 shrink-0", strokeWidth: 2.5 }),
|
|
423
|
-
"Verified"
|
|
424
|
-
]
|
|
425
|
-
}
|
|
426
|
-
) : /* @__PURE__ */ jsxs(
|
|
427
|
-
"span",
|
|
428
|
-
{
|
|
429
|
-
className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-semibold rounded-full payman-agent-rejected shrink-0",
|
|
430
|
-
style: {
|
|
431
|
-
background: "var(--payman-agent-rejected-bg, var(--payman-error-light, #fef2f2))",
|
|
432
|
-
color: "var(--payman-agent-rejected-text, var(--payman-error-dark, #b91c1c))",
|
|
433
|
-
border: "1px solid var(--payman-agent-rejected-border, var(--payman-destructive, #dc2626))"
|
|
434
|
-
},
|
|
435
|
-
children: [
|
|
436
|
-
/* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5 shrink-0", strokeWidth: 2.5 }),
|
|
437
|
-
"Rejected"
|
|
438
|
-
]
|
|
439
|
-
}
|
|
440
|
-
) }),
|
|
412
|
+
message.userActionResult && /* @__PURE__ */ jsx("div", { className: "mb-2", children: message.userActionResult === "approved" ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-semibold rounded-full payman-agent-approved shrink-0", children: [
|
|
413
|
+
/* @__PURE__ */ jsx(Check, { className: "w-3.5 h-3.5 shrink-0", strokeWidth: 2.5 }),
|
|
414
|
+
"Verified"
|
|
415
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-semibold rounded-full payman-agent-rejected shrink-0", children: [
|
|
416
|
+
/* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5 shrink-0", strokeWidth: 2.5 }),
|
|
417
|
+
"Rejected"
|
|
418
|
+
] }) }),
|
|
441
419
|
/* @__PURE__ */ jsxs(
|
|
442
420
|
"div",
|
|
443
421
|
{
|
|
444
422
|
className: cn(
|
|
445
423
|
"overflow-hidden w-full min-w-0 px-4 py-3 rounded-2xl rounded-tl-md transition-all duration-200",
|
|
446
424
|
layout === "centered" ? cn(
|
|
447
|
-
"payman-agent-bubble payman-agent-bubble--centered
|
|
425
|
+
"payman-agent-bubble payman-agent-bubble--centered",
|
|
448
426
|
isStreaming && "streaming",
|
|
449
427
|
isError && "error"
|
|
450
428
|
) : cn(
|
|
@@ -457,7 +435,7 @@ function AgentMessage({
|
|
|
457
435
|
"p",
|
|
458
436
|
{
|
|
459
437
|
className: cn(
|
|
460
|
-
"text-sm font-semibold mb-1 leading-none
|
|
438
|
+
"text-sm font-semibold mb-1 leading-none payman-agent-name",
|
|
461
439
|
isStreaming && !content && "animate-pulse"
|
|
462
440
|
),
|
|
463
441
|
children: isStreaming && !content ? "Thought Process" : agentName
|
|
@@ -471,23 +449,23 @@ function AgentMessage({
|
|
|
471
449
|
showAgentName && "mt-1"
|
|
472
450
|
),
|
|
473
451
|
children: isStreaming && !content ? (
|
|
474
|
-
//
|
|
475
|
-
activeThinkingText ? /* @__PURE__ */ jsxs("div", { className: "flex gap-
|
|
476
|
-
/* @__PURE__ */ jsx(
|
|
477
|
-
/* @__PURE__ */ jsxs("span", { className: "text-sm leading-relaxed min-w-0 break-words
|
|
452
|
+
// Streaming without content — show thinking/step indicator
|
|
453
|
+
activeThinkingText ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-start", children: [
|
|
454
|
+
/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mt-0.5 payman-agent-thinking-spinner animate-spin shrink-0" }),
|
|
455
|
+
/* @__PURE__ */ jsxs("span", { className: "text-sm leading-relaxed min-w-0 break-words payman-agent-thinking-text whitespace-pre-wrap flex-1", children: [
|
|
478
456
|
activeThinkingText,
|
|
479
|
-
/* @__PURE__ */ jsx("span", { className: "inline-block w-0.5 h-3.5
|
|
457
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block w-0.5 h-3.5 payman-agent-thinking-cursor animate-pulse ml-0.5 align-text-bottom" })
|
|
480
458
|
] })
|
|
481
459
|
] }) : currentStep ? /* @__PURE__ */ jsxs("div", { className: "flex gap-1.5 items-start", children: [
|
|
482
|
-
/* @__PURE__ */ jsx("div", { className: "mt-
|
|
483
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm leading-relaxed min-w-0 break-words shimmer-text font-medium", children: currentStep.message })
|
|
484
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "flex
|
|
485
|
-
|
|
486
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm
|
|
460
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 shrink-0", children: renderStepIcon(currentStep, true) }),
|
|
461
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm leading-relaxed min-w-0 break-words shimmer-text font-medium flex-1", children: currentStep.message })
|
|
462
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex gap-2.5 items-start", children: [
|
|
463
|
+
/* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 mt-0.5 payman-agent-thinking-spinner animate-spin shrink-0" }),
|
|
464
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm payman-agent-thinking-text flex-1", children: currentMessage || "Thinking..." })
|
|
487
465
|
] })
|
|
488
|
-
) : isCancelled && !content ? /* @__PURE__ */ jsxs("div", { className: "flex
|
|
489
|
-
/* @__PURE__ */ jsx(X, { className: "w-4 h-4 payman-agent-cancelled-icon
|
|
490
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm payman-agent-cancelled-text italic", children: currentMessage || "Request was stopped." })
|
|
466
|
+
) : isCancelled && !content ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2.5 items-start", children: [
|
|
467
|
+
/* @__PURE__ */ jsx(X, { className: "w-4 h-4 mt-0.5 payman-agent-cancelled-icon shrink-0" }),
|
|
468
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm payman-agent-cancelled-text italic flex-1", children: currentMessage || "Request was stopped." })
|
|
491
469
|
] }) : /* @__PURE__ */ jsx(
|
|
492
470
|
"div",
|
|
493
471
|
{
|
|
@@ -556,7 +534,7 @@ function markdownComponents(_isError) {
|
|
|
556
534
|
p: ({ children }) => /* @__PURE__ */ jsx("p", { className: "mb-3 last:mb-0 text-sm leading-relaxed", children }),
|
|
557
535
|
code: ({ className: codeClassName, children }) => {
|
|
558
536
|
const isInline = !codeClassName;
|
|
559
|
-
return isInline ? /* @__PURE__ */ jsx("code", { className: "px-1.5 py-0.5 rounded-md text-xs font-mono break-all", children }) : /* @__PURE__ */ jsx("code", { className: "block p-3 rounded-lg text-xs font-mono overflow-x-auto my-2 whitespace-pre", children });
|
|
537
|
+
return isInline ? /* @__PURE__ */ jsx("code", { className: "px-1.5 py-0.5 rounded-md text-xs font-mono break-all payman-agent-code-inline", children }) : /* @__PURE__ */ jsx("code", { className: "block p-3 rounded-lg text-xs font-mono overflow-x-auto my-2 whitespace-pre payman-agent-code-block", children });
|
|
560
538
|
},
|
|
561
539
|
pre: ({ children }) => /* @__PURE__ */ jsx("pre", { className: "my-2 overflow-x-auto max-w-full rounded-lg", children }),
|
|
562
540
|
ul: ({ children }) => /* @__PURE__ */ jsx("ul", { className: "list-disc ml-4 mb-3 space-y-1 text-sm", children }),
|
|
@@ -567,22 +545,22 @@ function markdownComponents(_isError) {
|
|
|
567
545
|
h3: ({ children }) => /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold mb-1 mt-2 first:mt-0", children }),
|
|
568
546
|
strong: ({ children }) => /* @__PURE__ */ jsx("strong", { className: "font-semibold", children }),
|
|
569
547
|
em: ({ children }) => /* @__PURE__ */ jsx("em", { className: "italic", children }),
|
|
570
|
-
blockquote: ({ children }) => /* @__PURE__ */ jsx("blockquote", { className: "pl-4 my-2 italic", children }),
|
|
571
|
-
hr: () => /* @__PURE__ */ jsx("hr", { className: "my-4" }),
|
|
548
|
+
blockquote: ({ children }) => /* @__PURE__ */ jsx("blockquote", { className: "pl-4 my-2 italic payman-agent-blockquote", children }),
|
|
549
|
+
hr: () => /* @__PURE__ */ jsx("hr", { className: "my-4 payman-agent-hr" }),
|
|
572
550
|
a: ({ href, children }) => /* @__PURE__ */ jsx(
|
|
573
551
|
"a",
|
|
574
552
|
{
|
|
575
553
|
href,
|
|
576
554
|
target: "_blank",
|
|
577
555
|
rel: "noopener noreferrer",
|
|
578
|
-
className: "underline underline-offset-2 decoration-1",
|
|
556
|
+
className: "underline underline-offset-2 decoration-1 payman-agent-link",
|
|
579
557
|
children
|
|
580
558
|
}
|
|
581
559
|
),
|
|
582
|
-
table: ({ children }) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-x-auto my-4 -mx-1", children: /* @__PURE__ */ jsx("table", { className: "min-w-full caption-bottom text-sm
|
|
583
|
-
thead: ({ children }) => /* @__PURE__ */ jsx("thead", { className: "[&_tr]:border-b", children }),
|
|
560
|
+
table: ({ children }) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-x-auto my-4 -mx-1", children: /* @__PURE__ */ jsx("table", { className: "min-w-full caption-bottom text-sm rounded-lg overflow-hidden payman-agent-table", children }) }),
|
|
561
|
+
thead: ({ children }) => /* @__PURE__ */ jsx("thead", { className: "[&_tr]:border-b payman-agent-thead", children }),
|
|
584
562
|
tbody: ({ children }) => /* @__PURE__ */ jsx("tbody", { className: "[&_tr:last-child]:border-0", children }),
|
|
585
|
-
tr: ({ children }) => /* @__PURE__ */ jsx("tr", { className: "border-b transition-colors", children }),
|
|
563
|
+
tr: ({ children }) => /* @__PURE__ */ jsx("tr", { className: "border-b transition-colors payman-agent-tr", children }),
|
|
586
564
|
th: ({ children }) => /* @__PURE__ */ jsx("th", { className: "h-10 px-3 text-left align-middle font-medium whitespace-nowrap text-xs", children }),
|
|
587
565
|
td: ({ children }) => /* @__PURE__ */ jsx("td", { className: "p-3 align-middle text-sm", children })
|
|
588
566
|
};
|