@butlerbot/sdk 0.0.18-alpha.1 → 0.0.18-alpha.3

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.
@@ -0,0 +1,50 @@
1
+ import type { MessagePayload, ReasoningPayload, FilePayload, ToolPayload, ConvoStatusPayload, ResponseStatusPayload, BaseResponseMetadata, DisplayEntity } from "../../response/v5/ai_response_v5";
2
+ import type { ConversationMessage } from "./message_v4";
3
+ export type DialogueEntry = {
4
+ from: "user" | "assistant";
5
+ display?: DisplayEntity;
6
+ timestamp: number;
7
+ metadata?: BaseResponseMetadata;
8
+ } & ({
9
+ type: "message";
10
+ payload: MessagePayload;
11
+ } | {
12
+ type: "reasoning";
13
+ payload: ReasoningPayload;
14
+ } | {
15
+ type: "file";
16
+ payload: FilePayload;
17
+ } | {
18
+ type: "tool";
19
+ payload: ToolPayload;
20
+ } | {
21
+ type: "convo_status";
22
+ payload: ConvoStatusPayload;
23
+ } | {
24
+ type: "response_status";
25
+ payload: ResponseStatusPayload;
26
+ });
27
+ export type ConversationState = {
28
+ settings: {
29
+ model?: string;
30
+ title?: string;
31
+ system?: string;
32
+ location?: string;
33
+ locationInstructions?: string;
34
+ temperature?: number;
35
+ disableAutoTitle?: boolean;
36
+ };
37
+ summary?: {
38
+ shortSummary?: string;
39
+ longSummary?: string;
40
+ };
41
+ messages: ConversationMessage[];
42
+ dialogue: DialogueEntry[];
43
+ };
44
+ export interface ConversationV4 {
45
+ version: "4.0";
46
+ conversationId: string;
47
+ ownerUserId: string;
48
+ disableView?: boolean;
49
+ state: ConversationState;
50
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,85 @@
1
+ export type ConversationMessageContentText = {
2
+ type: "input_text";
3
+ text: string;
4
+ };
5
+ export type ConversationMessageContentOutputText = {
6
+ type: "output_text";
7
+ text: string;
8
+ };
9
+ export type ConversationMessageMeta = {
10
+ participantId?: string;
11
+ attributedUserId?: string;
12
+ summarized?: unknown;
13
+ timestamp?: number;
14
+ };
15
+ export type ConversationMessage = {
16
+ type: "user_message";
17
+ role: "user";
18
+ content: string | ConversationMessageContentText[];
19
+ ai4?: ConversationMessageMeta;
20
+ } | {
21
+ type: "system_message";
22
+ role: "system";
23
+ content: string;
24
+ ai4?: ConversationMessageMeta;
25
+ } | {
26
+ type: "assistant_message";
27
+ role: "assistant";
28
+ content: ConversationMessageContentOutputText[];
29
+ id: string;
30
+ ai4?: ConversationMessageMeta;
31
+ } | {
32
+ type: "function_call";
33
+ name: string;
34
+ arguments: string;
35
+ callId: string;
36
+ id?: string;
37
+ ai4?: ConversationMessageMeta;
38
+ } | {
39
+ type: "function_call_output";
40
+ callId: string;
41
+ output: string;
42
+ id?: string;
43
+ ai4?: ConversationMessageMeta;
44
+ } | {
45
+ type: "reasoning";
46
+ content: Array<{
47
+ text: string;
48
+ type?: string;
49
+ }>;
50
+ summary?: Array<{
51
+ text: string;
52
+ type?: string;
53
+ }>;
54
+ id: string;
55
+ ai4?: ConversationMessageMeta;
56
+ } | {
57
+ type: "web_search_call";
58
+ id: string;
59
+ status: string;
60
+ action: Record<string, unknown>;
61
+ ai4?: ConversationMessageMeta;
62
+ } | {
63
+ type: "file_search_call";
64
+ id: string;
65
+ queries: string[];
66
+ status: string;
67
+ ai4?: ConversationMessageMeta;
68
+ } | {
69
+ type: "image_generation_call";
70
+ id: string;
71
+ result?: string;
72
+ status: string;
73
+ image?: {
74
+ b64_json?: string;
75
+ url?: string;
76
+ media_type?: string;
77
+ };
78
+ ai4?: ConversationMessageMeta;
79
+ } | {
80
+ type: "server_tool_item";
81
+ id: string;
82
+ outputType: string;
83
+ output: Record<string, unknown>;
84
+ ai4?: ConversationMessageMeta;
85
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,3 @@
1
1
  export type { RequestFailResponseV5, RequestSuccessResponseV5, RequestResponseV5, } from "./dialogue_response_v5";
2
- export type { ConversationEvent, ConversationEventCallback, AIResponseV5, EngineTurnFinishReason, RoutingAttempt, RoutingMetadata, } from "./ai_response_v5";
2
+ export type { ConversationEvent, ConversationEventCallback, AIResponseV5, ResponseMetadata as ResponseMetadataV5, EngineTurnFinishReason, RoutingAttempt, RoutingMetadata, } from "./ai_response_v5";
3
3
  export type { TurnProgressEntryV5, } from "./turn_registry_v5";
@@ -1,9 +1,10 @@
1
1
  import { ConversationV1 } from "../conversation/v1/conversation_v1";
2
2
  import { ConversationV2 } from "../conversation/v2/conversation_v2";
3
3
  import { ConversationV3 } from "../conversation/v3/conversation_v3";
4
+ import { ConversationV4 } from "../conversation/v4/conversation_v4";
4
5
  export type ConversationStateResponse = {
5
6
  success: true;
6
- conversation: ConversationV1 | ConversationV2 | ConversationV3;
7
+ conversation: ConversationV1 | ConversationV2 | ConversationV3 | ConversationV4;
7
8
  } | {
8
9
  success: false;
9
10
  error: string;
@@ -1,4 +1,6 @@
1
1
  export * from "./response/v3";
2
2
  export * from "./response/v4";
3
3
  export * from "./response/v5";
4
+ export * from "./state/convo_state_response";
5
+ export * from "./conversation/v4/conversation_v4";
4
6
  export * from "./error";
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./response/v3"), exports);
18
18
  __exportStar(require("./response/v4"), exports);
19
19
  __exportStar(require("./response/v5"), exports);
20
+ __exportStar(require("./state/convo_state_response"), exports);
21
+ __exportStar(require("./conversation/v4/conversation_v4"), exports);
20
22
  __exportStar(require("./error"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@butlerbot/sdk",
3
- "version": "0.0.18-alpha.1",
3
+ "version": "0.0.18-alpha.3",
4
4
  "description": "The official ButlerBot SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",