@teaflask/assistant 0.8.0 → 0.9.0
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/components/assistant-transcript.js +1 -7
- package/dist/components/attachment-chips.js +11 -5
- package/dist/components/composer.js +5 -6
- package/dist/components/message-list.js +2 -1
- package/dist/components/open-minted-url.js +12 -0
- package/dist/components/primitives/button.js +3 -0
- package/dist/components/tool-call-rows.js +1 -8
- package/dist/components/tool-row.js +1 -2
- package/dist/components/tool-view-slot.js +0 -1
- package/dist/components/tool-views/view-dom.d.ts +3 -4
- package/dist/components/tool-views/view-dom.js +1 -4
- package/dist/components/transcript-follow.js +12 -0
- package/dist/components/use-child-replay-stream.js +9 -2
- package/dist/components/use-transcript.d.ts +3 -2
- package/dist/components/user-message.js +26 -1
- package/dist/contract/events.d.ts +1 -0
- package/dist/contract/events.js +1 -0
- package/dist/contract/threads.d.ts +0 -5
- package/dist/contract/threads.js +0 -1
- package/dist/core/composer-policy.d.ts +1 -2
- package/dist/core/composer-policy.js +0 -2
- package/dist/core/connection-epoch.d.ts +1 -5
- package/dist/core/connection-epoch.js +23 -11
- package/dist/core/conversation-store.js +0 -1
- package/dist/core/epoch-sync.js +1 -1
- package/dist/core/error-copy.js +9 -1
- package/dist/core/long-message.js +22 -0
- package/dist/core/message-copy.js +1 -0
- package/dist/core/tool-call-display.d.ts +1 -7
- package/dist/core/tool-call-presentation.js +0 -3
- package/dist/core/tool-outcome.js +0 -1
- package/dist/core/tool-view.d.ts +2 -7
- package/dist/core/transcript-rows.d.ts +0 -6
- package/dist/core/transcript-rows.js +0 -3
- package/dist/core/withdrawn-anchors.d.ts +11 -0
- package/dist/core/withdrawn-anchors.js +76 -0
- package/dist/generated/models/apiErrorCode.d.ts +3 -0
- package/dist/generated/models/apiErrorCode.js +3 -0
- package/dist/generated/models/assistantStreamMarkerName.d.ts +1 -0
- package/dist/generated/models/assistantStreamMarkerName.js +1 -0
- package/dist/generated/models/index.d.ts +1 -0
- package/dist/generated/models/index.js +1 -0
- package/dist/generated/models/replyWithdrawnMarker.d.ts +4 -0
- package/dist/generated/models/replyWithdrawnMarker.js +1 -0
- package/dist/generated/models/servingErrorCode.d.ts +5 -4
- package/dist/generated/models/servingErrorCode.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/styles.css +1 -1
- package/dist/transport/replay-stream-agent.js +4 -0
- package/dist/transport/stream-resume.d.ts +4 -2
- package/dist/transport/stream-resume.js +4 -4
- package/package.json +1 -1
- package/dist/core/tool-offload-anchors.js +0 -7
package/dist/core/error-copy.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ServingApiError } from "../transport/serving-error.js";
|
|
2
|
+
import { MESSAGE_TOO_LONG_SENTENCE } from "./message-copy.js";
|
|
2
3
|
import { STOP_NOT_DELIVERED_SENTENCE } from "./stop-copy.js";
|
|
3
4
|
const GENERIC_FAILURE_SENTENCE = "Something went wrong sending that. Please try again.";
|
|
4
5
|
export function userSentenceFor(error) {
|
|
5
6
|
if (!(error instanceof ServingApiError)) {
|
|
6
7
|
return GENERIC_FAILURE_SENTENCE;
|
|
7
8
|
}
|
|
9
|
+
if (_isAMessageTooLong(error)) {
|
|
10
|
+
return MESSAGE_TOO_LONG_SENTENCE;
|
|
11
|
+
}
|
|
8
12
|
switch (error.code) {
|
|
9
13
|
case "ASSISTANT_THREAD_BUSY":
|
|
10
14
|
return ("The assistant is already answering — possibly in another tab. " +
|
|
@@ -20,7 +24,7 @@ export function userSentenceFor(error) {
|
|
|
20
24
|
case "NOT_FOUND":
|
|
21
25
|
return "That conversation isn't available.";
|
|
22
26
|
case "VALIDATION_ERROR":
|
|
23
|
-
return "That message couldn't be sent.
|
|
27
|
+
return "That message couldn't be sent. Check it and try again.";
|
|
24
28
|
default:
|
|
25
29
|
return error.message;
|
|
26
30
|
}
|
|
@@ -37,6 +41,10 @@ export function failureSentenceOf(error) {
|
|
|
37
41
|
}
|
|
38
42
|
return "Something went wrong. Try again.";
|
|
39
43
|
}
|
|
44
|
+
function _isAMessageTooLong(error) {
|
|
45
|
+
return (error.code === "MESSAGE_TOO_LONG" ||
|
|
46
|
+
(error.status === 413 && error.code === "UNKNOWN"));
|
|
47
|
+
}
|
|
40
48
|
function _rateLimitedSentence(retryAfterSeconds) {
|
|
41
49
|
if (retryAfterSeconds !== null && retryAfterSeconds > 0) {
|
|
42
50
|
return `You're sending messages too quickly. Try again in ${String(retryAfterSeconds)} seconds.`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const LONG_MESSAGE_COLLAPSE_FROM = 20_000;
|
|
2
|
+
const PREVIEW_CHARS = 600;
|
|
3
|
+
const WORD_BREAK_WINDOW = 120;
|
|
4
|
+
export function longMessagePreviewOf(text) {
|
|
5
|
+
if (text.length <= LONG_MESSAGE_COLLAPSE_FROM) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return text.slice(0, _previewEndOf(text)).trimEnd();
|
|
9
|
+
}
|
|
10
|
+
function _previewEndOf(text) {
|
|
11
|
+
const windowStart = PREVIEW_CHARS - WORD_BREAK_WINDOW;
|
|
12
|
+
const lastBreak = text.slice(windowStart, PREVIEW_CHARS).search(/\s\S*$/);
|
|
13
|
+
if (lastBreak >= 0) {
|
|
14
|
+
return windowStart + lastBreak;
|
|
15
|
+
}
|
|
16
|
+
return _isLowSurrogate(text.charCodeAt(PREVIEW_CHARS))
|
|
17
|
+
? PREVIEW_CHARS - 1
|
|
18
|
+
: PREVIEW_CHARS;
|
|
19
|
+
}
|
|
20
|
+
function _isLowSurrogate(code) {
|
|
21
|
+
return code >= 0xdc00 && code <= 0xdfff;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MESSAGE_TOO_LONG_SENTENCE = "This message is too long to answer. Please shorten it or split it into smaller messages.";
|
|
@@ -63,15 +63,9 @@ export interface ToolCallViewModel {
|
|
|
63
63
|
argsText?: string;
|
|
64
64
|
/**
|
|
65
65
|
* The raw result text. Undefined until the call finishes, and withheld for
|
|
66
|
-
* calls that failed, were not approved, didn't run
|
|
67
|
-
* their result replaced by a preview.
|
|
66
|
+
* calls that failed, were not approved, didn't run or were declined.
|
|
68
67
|
*/
|
|
69
68
|
output?: string;
|
|
70
|
-
/**
|
|
71
|
-
* True when the result was too large for the agent and was replaced by a
|
|
72
|
-
* shortened preview. `output` is then withheld.
|
|
73
|
-
*/
|
|
74
|
-
offloaded?: boolean;
|
|
75
69
|
/** Why the call failed, set when it failed. */
|
|
76
70
|
errorText?: string;
|
|
77
71
|
/**
|
package/dist/core/tool-view.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ export interface ToolViewCall<TArgs = Record<string, unknown>, TResult = unknown
|
|
|
40
40
|
result?: TResult;
|
|
41
41
|
/**
|
|
42
42
|
* The raw result text as recorded. Undefined until the call finishes, and
|
|
43
|
-
* withheld for calls that failed, were not approved, didn't run
|
|
44
|
-
* declined
|
|
43
|
+
* withheld for calls that failed, were not approved, didn't run or were
|
|
44
|
+
* declined.
|
|
45
45
|
*/
|
|
46
46
|
resultText?: string;
|
|
47
47
|
/**
|
|
@@ -50,11 +50,6 @@ export interface ToolViewCall<TArgs = Record<string, unknown>, TResult = unknown
|
|
|
50
50
|
* complete.
|
|
51
51
|
*/
|
|
52
52
|
truncated?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* True when the result was too large for the agent and was replaced by a
|
|
55
|
-
* shortened preview. The tool's real output is not available to the view.
|
|
56
|
-
*/
|
|
57
|
-
offloaded?: boolean;
|
|
58
53
|
/**
|
|
59
54
|
* Why the call failed, set when it failed. Use humanFailureSentenceOf to
|
|
60
55
|
* get a sentence fit for the user, and actionFailureOf to read an action's
|
|
@@ -110,12 +110,6 @@ export interface ToolCallRow {
|
|
|
110
110
|
* arrives.
|
|
111
111
|
*/
|
|
112
112
|
result?: string;
|
|
113
|
-
/**
|
|
114
|
-
* True when the tool's output was too large and `result` holds a shortened
|
|
115
|
-
* stand-in rather than the actual output; show a "result shortened" note
|
|
116
|
-
* instead of the content.
|
|
117
|
-
*/
|
|
118
|
-
offloaded: boolean;
|
|
119
113
|
/** Why the call failed. Present only when state is output-error. */
|
|
120
114
|
errorText?: string;
|
|
121
115
|
/**
|
|
@@ -21,7 +21,6 @@ export function transcriptRowsOf(messages, anchors, running, metaByMessageId = N
|
|
|
21
21
|
errors: anchors.toolErrorAnchors,
|
|
22
22
|
refusals: anchors.toolRefusalAnchors,
|
|
23
23
|
cancels: anchors.toolCancelAnchors,
|
|
24
|
-
offloads: anchors.toolOffloadAnchors,
|
|
25
24
|
decisions: anchors.toolDecisionAnchors ?? EMPTY_TOOL_DECISION_ANCHORS,
|
|
26
25
|
denials: anchors.toolDenialAnchors ?? EMPTY_TOOL_DENIAL_ANCHORS,
|
|
27
26
|
displays: anchors.toolCallDisplayAnchors,
|
|
@@ -112,7 +111,6 @@ function _pushMessageRows(rows, message, results, context) {
|
|
|
112
111
|
state,
|
|
113
112
|
argsText: toolCall.function.arguments,
|
|
114
113
|
result,
|
|
115
|
-
offloaded: context.offloads.has(toolCall.id),
|
|
116
114
|
errorText: errorTextOf(recordedError, result),
|
|
117
115
|
...(state === "refused" ? { refusalText: recordedRefusal } : {}),
|
|
118
116
|
display: context.displays.get(toolCall.id),
|
|
@@ -239,7 +237,6 @@ export function transcriptBlocksOf(messages, anchors, running, metaByMessageId =
|
|
|
239
237
|
errors: anchors.toolErrorAnchors,
|
|
240
238
|
refusals: anchors.toolRefusalAnchors,
|
|
241
239
|
cancels: anchors.toolCancelAnchors,
|
|
242
|
-
offloads: anchors.toolOffloadAnchors,
|
|
243
240
|
decisions: anchors.toolDecisionAnchors ?? EMPTY_TOOL_DECISION_ANCHORS,
|
|
244
241
|
denials: anchors.toolDenialAnchors ?? EMPTY_TOOL_DENIAL_ANCHORS,
|
|
245
242
|
displays: anchors.toolCallDisplayAnchors,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentSubscriber } from "@ag-ui/client";
|
|
2
|
+
import type { Message } from "@ag-ui/core";
|
|
3
|
+
import type { ReplyWithdrawnMarker } from "../generated/models/index.js";
|
|
4
|
+
export interface WithdrawnReplies {
|
|
5
|
+
messageIds: ReadonlySet<string>;
|
|
6
|
+
toolCallIds: ReadonlySet<string>;
|
|
7
|
+
}
|
|
8
|
+
export declare const EMPTY_WITHDRAWN_REPLIES: WithdrawnReplies;
|
|
9
|
+
export declare function withRepliesWithdrawn(previous: WithdrawnReplies, marker: ReplyWithdrawnMarker): WithdrawnReplies;
|
|
10
|
+
export declare function withdrawnReplyRecorder(onWithdrawn: (marker: ReplyWithdrawnMarker) => void): AgentSubscriber;
|
|
11
|
+
export declare function withoutWithdrawnReplies(messages: readonly Message[], withdrawn: WithdrawnReplies): readonly Message[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { REPLY_WITHDRAWN_EVENT_NAME } from "../contract/events.js";
|
|
2
|
+
export const EMPTY_WITHDRAWN_REPLIES = {
|
|
3
|
+
messageIds: new Set(),
|
|
4
|
+
toolCallIds: new Set(),
|
|
5
|
+
};
|
|
6
|
+
function _withdrawnRepliesOf(name, value) {
|
|
7
|
+
if (name !== REPLY_WITHDRAWN_EVENT_NAME ||
|
|
8
|
+
typeof value !== "object" ||
|
|
9
|
+
value === null) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const record = value;
|
|
13
|
+
return {
|
|
14
|
+
messageIds: _idsIn(record.messageIds),
|
|
15
|
+
toolCallIds: _idsIn(record.toolCallIds),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function _idsIn(field) {
|
|
19
|
+
if (!Array.isArray(field)) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
return field.filter((id) => typeof id === "string" && id !== "");
|
|
23
|
+
}
|
|
24
|
+
export function withRepliesWithdrawn(previous, marker) {
|
|
25
|
+
const messageIds = _withIds(previous.messageIds, marker.messageIds);
|
|
26
|
+
const toolCallIds = _withIds(previous.toolCallIds, marker.toolCallIds);
|
|
27
|
+
if (messageIds === previous.messageIds &&
|
|
28
|
+
toolCallIds === previous.toolCallIds) {
|
|
29
|
+
return previous;
|
|
30
|
+
}
|
|
31
|
+
return { messageIds, toolCallIds };
|
|
32
|
+
}
|
|
33
|
+
function _withIds(previous, ids) {
|
|
34
|
+
if (ids.every((id) => previous.has(id))) {
|
|
35
|
+
return previous;
|
|
36
|
+
}
|
|
37
|
+
return new Set([...previous, ...ids]);
|
|
38
|
+
}
|
|
39
|
+
export function withdrawnReplyRecorder(onWithdrawn) {
|
|
40
|
+
return {
|
|
41
|
+
onCustomEvent({ event }) {
|
|
42
|
+
const marker = _withdrawnRepliesOf(event.name, event.value);
|
|
43
|
+
if (marker !== null) {
|
|
44
|
+
onWithdrawn(marker);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function withoutWithdrawnReplies(messages, withdrawn) {
|
|
50
|
+
if (_nothingIsWithdrawn(withdrawn)) {
|
|
51
|
+
return messages;
|
|
52
|
+
}
|
|
53
|
+
return messages.flatMap((message) => _visiblePartOf(message, withdrawn));
|
|
54
|
+
}
|
|
55
|
+
function _nothingIsWithdrawn(withdrawn) {
|
|
56
|
+
return withdrawn.messageIds.size === 0 && withdrawn.toolCallIds.size === 0;
|
|
57
|
+
}
|
|
58
|
+
function _visiblePartOf(message, withdrawn) {
|
|
59
|
+
if (withdrawn.messageIds.has(message.id)) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
if (message.role === "tool") {
|
|
63
|
+
return withdrawn.toolCallIds.has(message.toolCallId) ? [] : [message];
|
|
64
|
+
}
|
|
65
|
+
if (message.role !== "assistant" || message.toolCalls === undefined) {
|
|
66
|
+
return [message];
|
|
67
|
+
}
|
|
68
|
+
const toolCalls = message.toolCalls.filter((toolCall) => !withdrawn.toolCallIds.has(toolCall.id));
|
|
69
|
+
if (toolCalls.length === message.toolCalls.length) {
|
|
70
|
+
return [message];
|
|
71
|
+
}
|
|
72
|
+
if (toolCalls.length === 0 && !message.content) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return [{ ...message, toolCalls }];
|
|
76
|
+
}
|
|
@@ -22,6 +22,7 @@ export declare const ApiErrorCode: {
|
|
|
22
22
|
readonly DOC_REVISION_NOT_PUBLISHABLE: "DOC_REVISION_NOT_PUBLISHABLE";
|
|
23
23
|
readonly DOC_REVISION_NOT_DISCARDABLE: "DOC_REVISION_NOT_DISCARDABLE";
|
|
24
24
|
readonly DOC_PROPOSAL_STALE: "DOC_PROPOSAL_STALE";
|
|
25
|
+
readonly REVISION_STALE: "REVISION_STALE";
|
|
25
26
|
readonly DOC_LIMIT_REACHED: "DOC_LIMIT_REACHED";
|
|
26
27
|
readonly HELP_SITE_CONFIG_INVALID: "HELP_SITE_CONFIG_INVALID";
|
|
27
28
|
readonly HELP_SITE_NEVER_PUBLISHED: "HELP_SITE_NEVER_PUBLISHED";
|
|
@@ -115,6 +116,7 @@ export declare const ApiErrorCode: {
|
|
|
115
116
|
readonly WORK_CREDIT_REQUEST_PENDING: "WORK_CREDIT_REQUEST_PENDING";
|
|
116
117
|
readonly JOIN_REQUEST_ALREADY_MEMBER: "JOIN_REQUEST_ALREADY_MEMBER";
|
|
117
118
|
readonly JOIN_REQUEST_ALREADY_PENDING: "JOIN_REQUEST_ALREADY_PENDING";
|
|
119
|
+
readonly LAST_OWNER: "LAST_OWNER";
|
|
118
120
|
readonly ORGANIZATION_DOMAIN_DNS_CLAIMED: "ORGANIZATION_DOMAIN_DNS_CLAIMED";
|
|
119
121
|
readonly EMAIL_DOMAIN_NOT_CLAIMABLE: "EMAIL_DOMAIN_NOT_CLAIMABLE";
|
|
120
122
|
readonly EMAIL_DOMAIN_REVOKED: "EMAIL_DOMAIN_REVOKED";
|
|
@@ -150,6 +152,7 @@ export declare const ApiErrorCode: {
|
|
|
150
152
|
readonly MCP_CAPABILITIES_INVALID: "MCP_CAPABILITIES_INVALID";
|
|
151
153
|
readonly MCP_AUTHORIZATION_SERVER_UNAVAILABLE: "MCP_AUTHORIZATION_SERVER_UNAVAILABLE";
|
|
152
154
|
readonly MCP_CONNECTION_CONFLICT: "MCP_CONNECTION_CONFLICT";
|
|
155
|
+
readonly MESSAGE_TOO_LONG: "MESSAGE_TOO_LONG";
|
|
153
156
|
readonly DEMO_ERROR: "DEMO_ERROR";
|
|
154
157
|
readonly HTTP_ERROR: "HTTP_ERROR";
|
|
155
158
|
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
@@ -21,6 +21,7 @@ export const ApiErrorCode = {
|
|
|
21
21
|
DOC_REVISION_NOT_PUBLISHABLE: "DOC_REVISION_NOT_PUBLISHABLE",
|
|
22
22
|
DOC_REVISION_NOT_DISCARDABLE: "DOC_REVISION_NOT_DISCARDABLE",
|
|
23
23
|
DOC_PROPOSAL_STALE: "DOC_PROPOSAL_STALE",
|
|
24
|
+
REVISION_STALE: "REVISION_STALE",
|
|
24
25
|
DOC_LIMIT_REACHED: "DOC_LIMIT_REACHED",
|
|
25
26
|
HELP_SITE_CONFIG_INVALID: "HELP_SITE_CONFIG_INVALID",
|
|
26
27
|
HELP_SITE_NEVER_PUBLISHED: "HELP_SITE_NEVER_PUBLISHED",
|
|
@@ -114,6 +115,7 @@ export const ApiErrorCode = {
|
|
|
114
115
|
WORK_CREDIT_REQUEST_PENDING: "WORK_CREDIT_REQUEST_PENDING",
|
|
115
116
|
JOIN_REQUEST_ALREADY_MEMBER: "JOIN_REQUEST_ALREADY_MEMBER",
|
|
116
117
|
JOIN_REQUEST_ALREADY_PENDING: "JOIN_REQUEST_ALREADY_PENDING",
|
|
118
|
+
LAST_OWNER: "LAST_OWNER",
|
|
117
119
|
ORGANIZATION_DOMAIN_DNS_CLAIMED: "ORGANIZATION_DOMAIN_DNS_CLAIMED",
|
|
118
120
|
EMAIL_DOMAIN_NOT_CLAIMABLE: "EMAIL_DOMAIN_NOT_CLAIMABLE",
|
|
119
121
|
EMAIL_DOMAIN_REVOKED: "EMAIL_DOMAIN_REVOKED",
|
|
@@ -149,6 +151,7 @@ export const ApiErrorCode = {
|
|
|
149
151
|
MCP_CAPABILITIES_INVALID: "MCP_CAPABILITIES_INVALID",
|
|
150
152
|
MCP_AUTHORIZATION_SERVER_UNAVAILABLE: "MCP_AUTHORIZATION_SERVER_UNAVAILABLE",
|
|
151
153
|
MCP_CONNECTION_CONFLICT: "MCP_CONNECTION_CONFLICT",
|
|
154
|
+
MESSAGE_TOO_LONG: "MESSAGE_TOO_LONG",
|
|
152
155
|
DEMO_ERROR: "DEMO_ERROR",
|
|
153
156
|
HTTP_ERROR: "HTTP_ERROR",
|
|
154
157
|
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
@@ -83,6 +83,7 @@ export * from "./readPageResult.js";
|
|
|
83
83
|
export * from "./reasoningMessage.js";
|
|
84
84
|
export * from "./reasoningMessageMetadata.js";
|
|
85
85
|
export * from "./refusedField.js";
|
|
86
|
+
export * from "./replyWithdrawnMarker.js";
|
|
86
87
|
export * from "./resolvedLanding.js";
|
|
87
88
|
export * from "./resolvedLandingCard.js";
|
|
88
89
|
export * from "./resolveServingTurnApprovalRequest.js";
|
|
@@ -83,6 +83,7 @@ export * from "./readPageResult.js";
|
|
|
83
83
|
export * from "./reasoningMessage.js";
|
|
84
84
|
export * from "./reasoningMessageMetadata.js";
|
|
85
85
|
export * from "./refusedField.js";
|
|
86
|
+
export * from "./replyWithdrawnMarker.js";
|
|
86
87
|
export * from "./resolvedLanding.js";
|
|
87
88
|
export * from "./resolvedLandingCard.js";
|
|
88
89
|
export * from "./resolveServingTurnApprovalRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* integration; RATE_LIMITED and ORCHESTRATION_UNAVAILABLE clear on retry;
|
|
5
5
|
* ASSISTANT_SIGN_IN_REQUIRED means the assistant only serves signed-in users;
|
|
6
6
|
* ASSISTANT_UNFUNDED means your Teaflask organization has no funds to pay for
|
|
7
|
-
* replies;
|
|
8
|
-
* ChatGPT plan.
|
|
7
|
+
* replies; MESSAGE_TOO_LONG means a message was over the 4 MB size limit; the
|
|
8
|
+
* SUBSCRIPTION_ codes come from a user connecting their own ChatGPT plan.
|
|
9
9
|
*/
|
|
10
10
|
export type ServingErrorCode = (typeof ServingErrorCode)[keyof typeof ServingErrorCode];
|
|
11
11
|
/**
|
|
@@ -14,8 +14,8 @@ export type ServingErrorCode = (typeof ServingErrorCode)[keyof typeof ServingErr
|
|
|
14
14
|
* integration; RATE_LIMITED and ORCHESTRATION_UNAVAILABLE clear on retry;
|
|
15
15
|
* ASSISTANT_SIGN_IN_REQUIRED means the assistant only serves signed-in users;
|
|
16
16
|
* ASSISTANT_UNFUNDED means your Teaflask organization has no funds to pay for
|
|
17
|
-
* replies;
|
|
18
|
-
* ChatGPT plan.
|
|
17
|
+
* replies; MESSAGE_TOO_LONG means a message was over the 4 MB size limit; the
|
|
18
|
+
* SUBSCRIPTION_ codes come from a user connecting their own ChatGPT plan.
|
|
19
19
|
*/
|
|
20
20
|
export declare const ServingErrorCode: {
|
|
21
21
|
readonly PUBLISHABLE_KEY_INVALID: "PUBLISHABLE_KEY_INVALID";
|
|
@@ -45,6 +45,7 @@ export declare const ServingErrorCode: {
|
|
|
45
45
|
readonly SUBSCRIPTION_CANNOT_PAY: "SUBSCRIPTION_CANNOT_PAY";
|
|
46
46
|
readonly SUBSCRIPTION_PLAN_UNSERVABLE: "SUBSCRIPTION_PLAN_UNSERVABLE";
|
|
47
47
|
readonly ASSISTANT_CONFIGURATION_UNRUNNABLE: "ASSISTANT_CONFIGURATION_UNRUNNABLE";
|
|
48
|
+
readonly MESSAGE_TOO_LONG: "MESSAGE_TOO_LONG";
|
|
48
49
|
readonly ORCHESTRATION_UNAVAILABLE: "ORCHESTRATION_UNAVAILABLE";
|
|
49
50
|
readonly FEEDBACK_DISABLED: "FEEDBACK_DISABLED";
|
|
50
51
|
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
@@ -26,6 +26,7 @@ export const ServingErrorCode = {
|
|
|
26
26
|
SUBSCRIPTION_CANNOT_PAY: "SUBSCRIPTION_CANNOT_PAY",
|
|
27
27
|
SUBSCRIPTION_PLAN_UNSERVABLE: "SUBSCRIPTION_PLAN_UNSERVABLE",
|
|
28
28
|
ASSISTANT_CONFIGURATION_UNRUNNABLE: "ASSISTANT_CONFIGURATION_UNRUNNABLE",
|
|
29
|
+
MESSAGE_TOO_LONG: "MESSAGE_TOO_LONG",
|
|
29
30
|
ORCHESTRATION_UNAVAILABLE: "ORCHESTRATION_UNAVAILABLE",
|
|
30
31
|
FEEDBACK_DISABLED: "FEEDBACK_DISABLED",
|
|
31
32
|
INTERNAL_ERROR: "INTERNAL_ERROR",
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { resetAssistant } from "./persistence/stored-thread.js";
|
|
|
11
11
|
export { ServingApiError } from "./transport/serving-error.js";
|
|
12
12
|
export type { ActionIntent, ActionIntentAction, ActionIntentGraphQL, ActionsAdapter, CookiesActionsAdapter, HeadersActionsAdapter, RequestActionsAdapter, } from "./contract/actions-adapter.js";
|
|
13
13
|
export type { ServingErrorCode, ServingErrorCodeOnTheWire, } from "./contract/errors.js";
|
|
14
|
-
export {
|
|
14
|
+
export type { ServingAssistantThread, TurnStatus } from "./contract/threads.js";
|
|
15
15
|
export { activeFoldElapsedOf, settledFoldDurationOf, type BlockTiming, type SegmentDuration, } from "./core/segment-timing.js";
|
|
16
16
|
export type { MemoryUpdated } from "./core/memory-provenance-anchors.js";
|
|
17
17
|
export type { ApprovalSubmitDropReason, ApprovalSubmitTelemetryEvent, AssistantTelemetryEvent, StreamFailedTelemetryEvent, StreamFailureClass, } from "./contract/telemetry.js";
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export { AssistantPalette, } from "./components/assistant-palette.js";
|
|
|
5
5
|
export { useAssistantActivity } from "./components/use-assistant-activity.js";
|
|
6
6
|
export { resetAssistant } from "./persistence/stored-thread.js";
|
|
7
7
|
export { ServingApiError } from "./transport/serving-error.js";
|
|
8
|
-
export { ASSISTANT_MESSAGE_MAX_CHARS, } from "./contract/threads.js";
|
|
9
8
|
export { activeFoldElapsedOf, settledFoldDurationOf, } from "./core/segment-timing.js";
|
|
10
9
|
export { TOOL_CALL_ICONS, toolCallPresentationOf, } from "./core/tool-call-presentation.js";
|
|
11
10
|
export { actionToolName, actionToolViews, resolvedToolViewsOf, } from "./core/tool-view.js";
|