@vibes.diy/call-ai-v2 2.0.0-dev-cli-j → 2.0.0-dev-cli-l
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/data-stream.d.ts +6 -6
- package/delta-stream.d.ts +21 -21
- package/package.json +2 -2
- package/prompt-type.d.ts +0 -109
- package/prompt-type.js +0 -35
- package/prompt-type.js.map +1 -1
- package/sse-stream.d.ts +7 -7
package/data-stream.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export declare const DataStreamMsg: import("arktype/internal/variants/object.ts"
|
|
|
42
42
|
json: unknown;
|
|
43
43
|
dataLineNr: number;
|
|
44
44
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
45
|
+
} | {
|
|
46
|
+
type: "data.error";
|
|
47
|
+
streamId: string;
|
|
48
|
+
message: string;
|
|
49
|
+
dataLineNr: number;
|
|
50
|
+
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
45
51
|
} | {
|
|
46
52
|
type: "data.end";
|
|
47
53
|
streamId: string;
|
|
@@ -54,12 +60,6 @@ export declare const DataStreamMsg: import("arktype/internal/variants/object.ts"
|
|
|
54
60
|
dataLineNr: number;
|
|
55
61
|
};
|
|
56
62
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
57
|
-
} | {
|
|
58
|
-
type: "data.error";
|
|
59
|
-
streamId: string;
|
|
60
|
-
message: string;
|
|
61
|
-
dataLineNr: number;
|
|
62
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
63
63
|
}, {}>;
|
|
64
64
|
export type DataBeginMsg = typeof DataBeginMsg.infer;
|
|
65
65
|
export type DataLineMsg = typeof DataLineMsg.infer;
|
package/delta-stream.d.ts
CHANGED
|
@@ -81,27 +81,6 @@ export declare const DeltaStreamMsg: import("arktype/internal/variants/object.ts
|
|
|
81
81
|
deltaSeq: number;
|
|
82
82
|
choiceSeq: number;
|
|
83
83
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
84
|
-
} | {
|
|
85
|
-
type: "delta.end";
|
|
86
|
-
streamId: string;
|
|
87
|
-
finishReasons: string[];
|
|
88
|
-
usages: {
|
|
89
|
-
prompt_tokens: number;
|
|
90
|
-
completion_tokens: number;
|
|
91
|
-
total_tokens: number;
|
|
92
|
-
}[];
|
|
93
|
-
totalDeltas: number;
|
|
94
|
-
totalChars: number;
|
|
95
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
96
|
-
} | {
|
|
97
|
-
type: "delta.stats";
|
|
98
|
-
streamId: string;
|
|
99
|
-
stats: {
|
|
100
|
-
deltaSeq: number;
|
|
101
|
-
deltaUsages: number;
|
|
102
|
-
totalChars: number;
|
|
103
|
-
};
|
|
104
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
105
84
|
} | {
|
|
106
85
|
type: "delta.usage";
|
|
107
86
|
streamId: string;
|
|
@@ -128,6 +107,27 @@ export declare const DeltaStreamMsg: import("arktype/internal/variants/object.ts
|
|
|
128
107
|
deltaSeq: number;
|
|
129
108
|
index: number;
|
|
130
109
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
110
|
+
} | {
|
|
111
|
+
type: "delta.end";
|
|
112
|
+
streamId: string;
|
|
113
|
+
finishReasons: string[];
|
|
114
|
+
usages: {
|
|
115
|
+
prompt_tokens: number;
|
|
116
|
+
completion_tokens: number;
|
|
117
|
+
total_tokens: number;
|
|
118
|
+
}[];
|
|
119
|
+
totalDeltas: number;
|
|
120
|
+
totalChars: number;
|
|
121
|
+
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
122
|
+
} | {
|
|
123
|
+
type: "delta.stats";
|
|
124
|
+
streamId: string;
|
|
125
|
+
stats: {
|
|
126
|
+
deltaSeq: number;
|
|
127
|
+
deltaUsages: number;
|
|
128
|
+
totalChars: number;
|
|
129
|
+
};
|
|
130
|
+
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
131
131
|
}, {}>;
|
|
132
132
|
export type DeltaBeginMsg = typeof DeltaBeginMsg.infer;
|
|
133
133
|
export type DeltaLineMsg = typeof DeltaLineMsg.infer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/call-ai-v2",
|
|
3
|
-
"version": "2.0.0-dev-cli-
|
|
3
|
+
"version": "2.0.0-dev-cli-l",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "AFL",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@adviser/cement": "~0.5.34",
|
|
18
|
-
"@fireproof/core-runtime": "~0.24.
|
|
18
|
+
"@fireproof/core-runtime": "~0.24.16",
|
|
19
19
|
"arktype": "~2.2.0",
|
|
20
20
|
"cmd-ts": "~0.15.0",
|
|
21
21
|
"mime": "~4.1.0",
|
package/prompt-type.d.ts
CHANGED
|
@@ -36,112 +36,3 @@ export type LLMRequest = typeof LLMRequest.infer;
|
|
|
36
36
|
export declare const isMessageRole: (msg: unknown) => msg is MessageRole;
|
|
37
37
|
export declare const isChatMessage: (msg: unknown) => msg is ChatMessage;
|
|
38
38
|
export declare const isLLMRequest: (msg: unknown) => msg is LLMRequest;
|
|
39
|
-
export declare const PromptBase: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
40
|
-
streamId: string;
|
|
41
|
-
chatId: string;
|
|
42
|
-
seq: number;
|
|
43
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
44
|
-
}, {}>;
|
|
45
|
-
export declare const PromptReq: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
46
|
-
streamId: string;
|
|
47
|
-
chatId: string;
|
|
48
|
-
seq: number;
|
|
49
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
50
|
-
type: "prompt.req";
|
|
51
|
-
request: {
|
|
52
|
-
model?: string | undefined;
|
|
53
|
-
messages: {
|
|
54
|
-
role: "assistant" | "system" | "user";
|
|
55
|
-
content: {
|
|
56
|
-
type: "text";
|
|
57
|
-
text: string;
|
|
58
|
-
}[];
|
|
59
|
-
}[];
|
|
60
|
-
stream?: boolean | undefined;
|
|
61
|
-
temperature?: number | undefined;
|
|
62
|
-
max_tokens?: number | undefined;
|
|
63
|
-
top_p?: number | undefined;
|
|
64
|
-
logprobs?: boolean | undefined;
|
|
65
|
-
top_logsprobs?: number | undefined;
|
|
66
|
-
frequency_penalty?: number | undefined;
|
|
67
|
-
presence_penalty?: number | undefined;
|
|
68
|
-
stop?: string | string[] | undefined;
|
|
69
|
-
};
|
|
70
|
-
}, {}>;
|
|
71
|
-
export type PromptReq = typeof PromptReq.infer;
|
|
72
|
-
export declare function isPromptReq(msg: unknown): msg is PromptReq;
|
|
73
|
-
export declare const PromptBlockBegin: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
74
|
-
streamId: string;
|
|
75
|
-
chatId: string;
|
|
76
|
-
seq: number;
|
|
77
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
78
|
-
type: "prompt.block-begin";
|
|
79
|
-
}, {}>;
|
|
80
|
-
export type PromptBlockBegin = typeof PromptBlockBegin.infer;
|
|
81
|
-
export declare const PromptError: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
82
|
-
streamId: string;
|
|
83
|
-
chatId: string;
|
|
84
|
-
seq: number;
|
|
85
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
86
|
-
type: "prompt.error";
|
|
87
|
-
error: string;
|
|
88
|
-
}, {}>;
|
|
89
|
-
export type PromptError = typeof PromptError.infer;
|
|
90
|
-
export declare function isPromptError(msg: unknown): msg is PromptError;
|
|
91
|
-
export declare const PromptBlockEnd: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
92
|
-
streamId: string;
|
|
93
|
-
chatId: string;
|
|
94
|
-
seq: number;
|
|
95
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
96
|
-
type: "prompt.block-end";
|
|
97
|
-
}, {}>;
|
|
98
|
-
export type PromptBlockEnd = typeof PromptBlockEnd.infer;
|
|
99
|
-
export declare const PromptMsgs: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
100
|
-
streamId: string;
|
|
101
|
-
chatId: string;
|
|
102
|
-
seq: number;
|
|
103
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
104
|
-
type: "prompt.req";
|
|
105
|
-
request: {
|
|
106
|
-
model?: string | undefined;
|
|
107
|
-
messages: {
|
|
108
|
-
role: "assistant" | "system" | "user";
|
|
109
|
-
content: {
|
|
110
|
-
type: "text";
|
|
111
|
-
text: string;
|
|
112
|
-
}[];
|
|
113
|
-
}[];
|
|
114
|
-
stream?: boolean | undefined;
|
|
115
|
-
temperature?: number | undefined;
|
|
116
|
-
max_tokens?: number | undefined;
|
|
117
|
-
top_p?: number | undefined;
|
|
118
|
-
logprobs?: boolean | undefined;
|
|
119
|
-
top_logsprobs?: number | undefined;
|
|
120
|
-
frequency_penalty?: number | undefined;
|
|
121
|
-
presence_penalty?: number | undefined;
|
|
122
|
-
stop?: string | string[] | undefined;
|
|
123
|
-
};
|
|
124
|
-
} | {
|
|
125
|
-
streamId: string;
|
|
126
|
-
chatId: string;
|
|
127
|
-
seq: number;
|
|
128
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
129
|
-
type: "prompt.block-begin";
|
|
130
|
-
} | {
|
|
131
|
-
streamId: string;
|
|
132
|
-
chatId: string;
|
|
133
|
-
seq: number;
|
|
134
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
135
|
-
type: "prompt.error";
|
|
136
|
-
error: string;
|
|
137
|
-
} | {
|
|
138
|
-
streamId: string;
|
|
139
|
-
chatId: string;
|
|
140
|
-
seq: number;
|
|
141
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
142
|
-
type: "prompt.block-end";
|
|
143
|
-
}, {}>;
|
|
144
|
-
export type PromptMsgs = typeof PromptMsgs.infer;
|
|
145
|
-
export declare const isPromptMsg: (msg: unknown) => msg is PromptMsgs;
|
|
146
|
-
export declare function isPromptBlockBegin(msg: unknown): msg is PromptBlockBegin;
|
|
147
|
-
export declare function isPromptBlockEnd(msg: unknown): msg is PromptBlockEnd;
|
package/prompt-type.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type } from "arktype";
|
|
2
|
-
import { CoercedDate } from "./types.js";
|
|
3
2
|
export const MessageRole = type("'system' | 'user' | 'assistant'");
|
|
4
3
|
export const TextContent = type({
|
|
5
4
|
type: "'text'",
|
|
@@ -25,38 +24,4 @@ export const LLMRequest = type({
|
|
|
25
24
|
export const isMessageRole = (msg) => !(MessageRole(msg) instanceof type.errors);
|
|
26
25
|
export const isChatMessage = (msg) => !(ChatMessage(msg) instanceof type.errors);
|
|
27
26
|
export const isLLMRequest = (msg) => !(LLMRequest(msg) instanceof type.errors);
|
|
28
|
-
export const PromptBase = type({
|
|
29
|
-
streamId: "string",
|
|
30
|
-
chatId: "string",
|
|
31
|
-
seq: "number",
|
|
32
|
-
timestamp: CoercedDate,
|
|
33
|
-
});
|
|
34
|
-
export const PromptReq = type({
|
|
35
|
-
type: "'prompt.req'",
|
|
36
|
-
request: LLMRequest,
|
|
37
|
-
}).and(PromptBase);
|
|
38
|
-
export function isPromptReq(msg) {
|
|
39
|
-
return !(PromptReq(msg) instanceof type.errors);
|
|
40
|
-
}
|
|
41
|
-
export const PromptBlockBegin = type({
|
|
42
|
-
type: "'prompt.block-begin'",
|
|
43
|
-
}).and(PromptBase);
|
|
44
|
-
export const PromptError = type({
|
|
45
|
-
type: "'prompt.error'",
|
|
46
|
-
error: "string",
|
|
47
|
-
}).and(PromptBase);
|
|
48
|
-
export function isPromptError(msg) {
|
|
49
|
-
return !(PromptError(msg) instanceof type.errors);
|
|
50
|
-
}
|
|
51
|
-
export const PromptBlockEnd = type({
|
|
52
|
-
type: "'prompt.block-end'",
|
|
53
|
-
}).and(PromptBase);
|
|
54
|
-
export const PromptMsgs = PromptBlockBegin.or(PromptBlockEnd).or(PromptReq).or(PromptError);
|
|
55
|
-
export const isPromptMsg = (msg) => !(PromptMsgs(msg) instanceof type.errors);
|
|
56
|
-
export function isPromptBlockBegin(msg) {
|
|
57
|
-
return !(PromptBlockBegin(msg) instanceof type.errors);
|
|
58
|
-
}
|
|
59
|
-
export function isPromptBlockEnd(msg) {
|
|
60
|
-
return !(PromptBlockEnd(msg) instanceof type.errors);
|
|
61
|
-
}
|
|
62
27
|
//# sourceMappingURL=prompt-type.js.map
|
package/prompt-type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-type.js","sourceRoot":"","sources":["../jsr/prompt-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-type.js","sourceRoot":"","sources":["../jsr/prompt-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,iCAAiC,CAAC,CAAC;AAGnE,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE;CAC7B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;IAC7B,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,SAAS;IACtB,gBAAgB,EAAE,QAAQ;IAC1B,oBAAoB,EAAE,QAAQ;IAC9B,mBAAmB,EAAE,QAAQ;IAC7B,OAAO,EAAE,mBAAmB;CAC7B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAY,EAAsB,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,CAAC;AAE9G,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAY,EAAsB,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,CAAC;AAE9G,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAY,EAAqB,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,CAAC"}
|
package/sse-stream.d.ts
CHANGED
|
@@ -158,13 +158,6 @@ export declare const SseStreamMsg: import("arktype/internal/variants/object.ts")
|
|
|
158
158
|
};
|
|
159
159
|
chunkNr: number;
|
|
160
160
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
161
|
-
} | {
|
|
162
|
-
type: "sse.error";
|
|
163
|
-
streamId: string;
|
|
164
|
-
error: string;
|
|
165
|
-
json: unknown;
|
|
166
|
-
errorNr: number;
|
|
167
|
-
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
168
161
|
} | {
|
|
169
162
|
type: "sse.end";
|
|
170
163
|
streamId: string;
|
|
@@ -176,6 +169,13 @@ export declare const SseStreamMsg: import("arktype/internal/variants/object.ts")
|
|
|
176
169
|
totalChunks: number;
|
|
177
170
|
totalErrors: number;
|
|
178
171
|
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
172
|
+
} | {
|
|
173
|
+
type: "sse.error";
|
|
174
|
+
streamId: string;
|
|
175
|
+
error: string;
|
|
176
|
+
json: unknown;
|
|
177
|
+
errorNr: number;
|
|
178
|
+
timestamp: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
|
|
179
179
|
} | {
|
|
180
180
|
type: "sse.stats";
|
|
181
181
|
streamId: string;
|