@cadraos/sdk 0.3.8 → 0.3.10
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/board-host/index.d.cts +74 -6
- package/dist/board-host/index.d.ts +74 -6
- package/dist/board-host/server/index.d.cts +81 -6
- package/dist/board-host/server/index.d.ts +81 -6
- package/dist/chat/index.cjs +2 -47
- package/dist/chat/index.cjs.map +1 -1
- package/dist/chat/index.d.cts +8 -9
- package/dist/chat/index.d.ts +8 -9
- package/dist/chat/index.js +2 -47
- package/dist/chat/index.js.map +1 -1
- package/dist/index.cjs +0 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +0 -43
- package/dist/index.js.map +1 -1
- package/dist/kanban/engine/index.cjs +113 -31
- package/dist/kanban/engine/index.cjs.map +1 -1
- package/dist/kanban/engine/index.d.cts +112 -6
- package/dist/kanban/engine/index.d.ts +112 -6
- package/dist/kanban/engine/index.js +113 -31
- package/dist/kanban/engine/index.js.map +1 -1
- package/dist/kanban/index.cjs +807 -158
- package/dist/kanban/index.cjs.map +1 -1
- package/dist/kanban/index.d.cts +382 -11
- package/dist/kanban/index.d.ts +382 -11
- package/dist/kanban/index.js +802 -159
- package/dist/kanban/index.js.map +1 -1
- package/dist/teams/index.cjs +0 -43
- package/dist/teams/index.cjs.map +1 -1
- package/dist/teams/index.d.cts +7 -0
- package/dist/teams/index.d.ts +7 -0
- package/dist/teams/index.js +0 -43
- package/dist/teams/index.js.map +1 -1
- package/package.json +1 -1
package/dist/chat/index.d.cts
CHANGED
|
@@ -1624,14 +1624,6 @@ interface AgentChatProps {
|
|
|
1624
1624
|
onClarification?: (data: ClarificationData) => void;
|
|
1625
1625
|
/** Initial messages to populate the chat */
|
|
1626
1626
|
initialMessages?: ChatMessage$1[];
|
|
1627
|
-
/**
|
|
1628
|
-
* Extra messages MERGED into the rendered list by timestamp on every render
|
|
1629
|
-
* (interleaved chronologically, deduped by id). Use for durable turns that
|
|
1630
|
-
* arrive out-of-band on a separate delivery plane — e.g. human-operator /
|
|
1631
|
-
* system replies in a webchat handoff — so they don't dock at the bottom.
|
|
1632
|
-
* Unlike `initialMessages`, these are NOT seeded into internal state.
|
|
1633
|
-
*/
|
|
1634
|
-
injectedMessages?: ChatMessage$1[];
|
|
1635
1627
|
/** Placeholder text for the input */
|
|
1636
1628
|
placeholder?: string;
|
|
1637
1629
|
/** Welcome message shown when chat is empty */
|
|
@@ -1795,7 +1787,7 @@ interface AgentChatProps {
|
|
|
1795
1787
|
* />
|
|
1796
1788
|
* ```
|
|
1797
1789
|
*/
|
|
1798
|
-
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady,
|
|
1790
|
+
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1799
1791
|
|
|
1800
1792
|
/**
|
|
1801
1793
|
* Retry utility with exponential backoff
|
|
@@ -3825,6 +3817,13 @@ interface KanbanCard {
|
|
|
3825
3817
|
executionId?: string;
|
|
3826
3818
|
/** Summary of the card's current/last run, if any. */
|
|
3827
3819
|
run?: KanbanRunSummary;
|
|
3820
|
+
/**
|
|
3821
|
+
* When this card next becomes DUE on a scheduled lane (ISO string) — maps to
|
|
3822
|
+
* `agentic_card.next_due_at` (spec §3a / STORY-003/004). Drives the board's
|
|
3823
|
+
* ⧗ "due" chip: `next_due_at ≤ now` → due (the next sweep will pick it up).
|
|
3824
|
+
* OPTIONAL — absent → no due chip (today's render).
|
|
3825
|
+
*/
|
|
3826
|
+
nextDueAt?: string;
|
|
3828
3827
|
/** Who created the card. */
|
|
3829
3828
|
createdBy?: string;
|
|
3830
3829
|
/** When the card was created (ISO string). */
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1624,14 +1624,6 @@ interface AgentChatProps {
|
|
|
1624
1624
|
onClarification?: (data: ClarificationData) => void;
|
|
1625
1625
|
/** Initial messages to populate the chat */
|
|
1626
1626
|
initialMessages?: ChatMessage$1[];
|
|
1627
|
-
/**
|
|
1628
|
-
* Extra messages MERGED into the rendered list by timestamp on every render
|
|
1629
|
-
* (interleaved chronologically, deduped by id). Use for durable turns that
|
|
1630
|
-
* arrive out-of-band on a separate delivery plane — e.g. human-operator /
|
|
1631
|
-
* system replies in a webchat handoff — so they don't dock at the bottom.
|
|
1632
|
-
* Unlike `initialMessages`, these are NOT seeded into internal state.
|
|
1633
|
-
*/
|
|
1634
|
-
injectedMessages?: ChatMessage$1[];
|
|
1635
1627
|
/** Placeholder text for the input */
|
|
1636
1628
|
placeholder?: string;
|
|
1637
1629
|
/** Welcome message shown when chat is empty */
|
|
@@ -1795,7 +1787,7 @@ interface AgentChatProps {
|
|
|
1795
1787
|
* />
|
|
1796
1788
|
* ```
|
|
1797
1789
|
*/
|
|
1798
|
-
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady,
|
|
1790
|
+
declare function AgentChat({ agentId, teamId, sessionId, adapter, onMessage, onError, onSessionCreated, onSessionStart, onToolCall, onToolResult, onClarification, initialMessages, placeholder, welcomeMessage, renderWelcome, maxHeight, className, theme, layout, enableAttachments, enableMarkdown, showToolCalls, toolCallVerbosity, markdownComponents, markdownUrlTransform, markdownContentTransform, onImageClick, hideHeader, renderAboveInput, renderBelowMessages, renderMessage, renderToolCall, messageVariant, showThinking, showDelegation, showImages, pollingInterval, pollingEnabled, onDelegation, onAttachmentsReady, hideAvatars, agentName, hideHeaderWhileEmpty, hideTypingIndicator, onInputChange, onInputControlReady, }: AgentChatProps): react_jsx_runtime.JSX.Element;
|
|
1799
1791
|
|
|
1800
1792
|
/**
|
|
1801
1793
|
* Retry utility with exponential backoff
|
|
@@ -3825,6 +3817,13 @@ interface KanbanCard {
|
|
|
3825
3817
|
executionId?: string;
|
|
3826
3818
|
/** Summary of the card's current/last run, if any. */
|
|
3827
3819
|
run?: KanbanRunSummary;
|
|
3820
|
+
/**
|
|
3821
|
+
* When this card next becomes DUE on a scheduled lane (ISO string) — maps to
|
|
3822
|
+
* `agentic_card.next_due_at` (spec §3a / STORY-003/004). Drives the board's
|
|
3823
|
+
* ⧗ "due" chip: `next_due_at ≤ now` → due (the next sweep will pick it up).
|
|
3824
|
+
* OPTIONAL — absent → no due chip (today's render).
|
|
3825
|
+
*/
|
|
3826
|
+
nextDueAt?: string;
|
|
3828
3827
|
/** Who created the card. */
|
|
3829
3828
|
createdBy?: string;
|
|
3830
3829
|
/** When the card was created (ISO string). */
|
package/dist/chat/index.js
CHANGED
|
@@ -682,15 +682,6 @@ var ExecutionStreamControllerImpl = class {
|
|
|
682
682
|
sseClient = null;
|
|
683
683
|
status = "connecting";
|
|
684
684
|
reconnectAttempts = 0;
|
|
685
|
-
// CAD-39 / webchat dual-plane create-connect race. `hasConnected` flips true on
|
|
686
|
-
// the first successful SSE open; `notFoundRetries` bounds retries of a 404
|
|
687
|
-
// encountered BEFORE we ever connect (the run row is persisted slightly AFTER
|
|
688
|
-
// the client opens the stream — the norm on the webchat path where msg-api owns
|
|
689
|
-
// the executionId and cadra persists the agent_executions row via an async
|
|
690
|
-
// worker callback). See handleConnectionError.
|
|
691
|
-
hasConnected = false;
|
|
692
|
-
notFoundRetries = 0;
|
|
693
|
-
maxConnectRaceRetries = 3;
|
|
694
685
|
seenEventIds = /* @__PURE__ */ new Set();
|
|
695
686
|
_lastEventId = null;
|
|
696
687
|
activityTimeoutId = null;
|
|
@@ -830,8 +821,6 @@ var ExecutionStreamControllerImpl = class {
|
|
|
830
821
|
if (connected) {
|
|
831
822
|
this.status = "connected";
|
|
832
823
|
this.reconnectAttempts = 0;
|
|
833
|
-
this.hasConnected = true;
|
|
834
|
-
this.notFoundRetries = 0;
|
|
835
824
|
this.resetActivityTimeout();
|
|
836
825
|
}
|
|
837
826
|
this.emit("connectionChange", { connected, usingFallback: false });
|
|
@@ -1121,38 +1110,6 @@ var ExecutionStreamControllerImpl = class {
|
|
|
1121
1110
|
return;
|
|
1122
1111
|
}
|
|
1123
1112
|
const msg = error instanceof Error ? error.message : String(error);
|
|
1124
|
-
const isNotFound = /\b404\b/.test(msg);
|
|
1125
|
-
const isAuthFailure = /\b40[13]\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg);
|
|
1126
|
-
if (isNotFound && !isAuthFailure && !this.hasConnected) {
|
|
1127
|
-
if (this.notFoundRetries < this.maxConnectRaceRetries) {
|
|
1128
|
-
this.notFoundRetries++;
|
|
1129
|
-
this.status = "reconnecting";
|
|
1130
|
-
const delay = Math.min(
|
|
1131
|
-
this.config.reconnectBaseDelayMs * this.notFoundRetries,
|
|
1132
|
-
this.config.reconnectMaxDelayMs
|
|
1133
|
-
);
|
|
1134
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1135
|
-
if (this.status === "closed") {
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
try {
|
|
1139
|
-
await this.connectSSE();
|
|
1140
|
-
} catch (retryError) {
|
|
1141
|
-
await this.handleConnectionError(retryError);
|
|
1142
|
-
}
|
|
1143
|
-
return;
|
|
1144
|
-
}
|
|
1145
|
-
if (this.pollingEnabled) {
|
|
1146
|
-
if (this.sseClient) {
|
|
1147
|
-
this.sseClient.disconnect();
|
|
1148
|
-
this.sseClient = null;
|
|
1149
|
-
}
|
|
1150
|
-
this.status = "fallback_polling";
|
|
1151
|
-
this.emit("connectionChange", { connected: false, usingFallback: true });
|
|
1152
|
-
this.startPolling();
|
|
1153
|
-
return;
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
1113
|
if (/\b4\d\d\b/.test(msg) || /INVALID_API_KEY|INVALID_REQUEST/.test(msg)) {
|
|
1157
1114
|
if (this.sseClient) {
|
|
1158
1115
|
this.sseClient.disconnect();
|
|
@@ -8630,8 +8587,7 @@ function AgentChat({
|
|
|
8630
8587
|
hideHeaderWhileEmpty = false,
|
|
8631
8588
|
hideTypingIndicator = false,
|
|
8632
8589
|
onInputChange,
|
|
8633
|
-
onInputControlReady
|
|
8634
|
-
injectedMessages
|
|
8590
|
+
onInputControlReady
|
|
8635
8591
|
}) {
|
|
8636
8592
|
const {
|
|
8637
8593
|
messages,
|
|
@@ -8695,9 +8651,8 @@ function AgentChat({
|
|
|
8695
8651
|
},
|
|
8696
8652
|
[enableAttachments, attachments, sendMessage]
|
|
8697
8653
|
);
|
|
8698
|
-
const renderedMessages = injectedMessages && injectedMessages.length > 0 ? [...messages, ...injectedMessages].filter((m, i, arr) => arr.findIndex((x) => x.id === m.id) === i).sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime()) : messages;
|
|
8699
8654
|
const messageListProps = {
|
|
8700
|
-
messages
|
|
8655
|
+
messages,
|
|
8701
8656
|
welcomeMessage: hideHeader ? void 0 : welcomeMessage,
|
|
8702
8657
|
renderWelcome: hideHeader ? void 0 : renderWelcome,
|
|
8703
8658
|
isLoading,
|