@zerotal/ai 1.7.3 → 1.7.5
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/api-surface.md +2 -75
- package/package.json +5 -4
package/api-surface.md
CHANGED
|
@@ -83,21 +83,6 @@ class AiGenerated = {
|
|
|
83
83
|
readonly preview: string
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
class AiGenerationJob = {
|
|
87
|
-
new (request: AiRequest, options: AiQueueOptions): AiGenerationJob
|
|
88
|
-
static fromPayload: (data: Record<string, unknown>) => AiGenerationJob
|
|
89
|
-
_chain: SerializedJob[] | undefined
|
|
90
|
-
batchId: string | undefined
|
|
91
|
-
className: string
|
|
92
|
-
debounceKey: () => string
|
|
93
|
-
handle: () => Promise<void>
|
|
94
|
-
payload: () => Record<string, unknown>
|
|
95
|
-
readonly debounce?: number
|
|
96
|
-
readonly maxAttempts: number
|
|
97
|
-
readonly queue: string
|
|
98
|
-
readonly retryDelay: number
|
|
99
|
-
}
|
|
100
|
-
|
|
101
86
|
class AiManager = {
|
|
102
87
|
new (config: AiConfigShape): AiManager
|
|
103
88
|
agent: (request: AiAgentRequest) => Promise<AiAgentResult>
|
|
@@ -181,34 +166,6 @@ class AiSchemaError = {
|
|
|
181
166
|
readonly status: number
|
|
182
167
|
}
|
|
183
168
|
|
|
184
|
-
class AiSpendCommand = {
|
|
185
|
-
new (): AiSpendCommand
|
|
186
|
-
static args: ArgDef[]
|
|
187
|
-
static commandName: string
|
|
188
|
-
static description: string
|
|
189
|
-
static flags: FlagDef[]
|
|
190
|
-
static needsApp: boolean
|
|
191
|
-
_readLine: () => Promise<string>
|
|
192
|
-
_writer: OutputWriter
|
|
193
|
-
app: unknown
|
|
194
|
-
args: Record<string, string>
|
|
195
|
-
ask: (question: string, defaultValue?: string) => Promise<string>
|
|
196
|
-
choice: (question: string, options: string[]) => Promise<string>
|
|
197
|
-
confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
|
|
198
|
-
dim: (msg: string) => void
|
|
199
|
-
error: (msg: string) => void
|
|
200
|
-
flags: Record<string, string | number | boolean>
|
|
201
|
-
info: (msg: string) => void
|
|
202
|
-
line: (msg: string) => void
|
|
203
|
-
newLine: () => void
|
|
204
|
-
run: () => Promise<void>
|
|
205
|
-
secret: (question: string) => Promise<string>
|
|
206
|
-
section: (title: string) => void
|
|
207
|
-
table: (rows: [string, string][], indent?: number) => void
|
|
208
|
-
warn: (msg: string) => void
|
|
209
|
-
write: (msg: string) => void
|
|
210
|
-
}
|
|
211
|
-
|
|
212
169
|
class AiSpendLimitError = {
|
|
213
170
|
new (message: string, context?: Record<string, unknown>): AiSpendLimitError
|
|
214
171
|
readonly code: string
|
|
@@ -216,34 +173,6 @@ class AiSpendLimitError = {
|
|
|
216
173
|
readonly status: number
|
|
217
174
|
}
|
|
218
175
|
|
|
219
|
-
class AiTestCommand = {
|
|
220
|
-
new (): AiTestCommand
|
|
221
|
-
static args: ArgDef[]
|
|
222
|
-
static commandName: string
|
|
223
|
-
static description: string
|
|
224
|
-
static flags: FlagDef[]
|
|
225
|
-
static needsApp: boolean
|
|
226
|
-
_readLine: () => Promise<string>
|
|
227
|
-
_writer: OutputWriter
|
|
228
|
-
app: unknown
|
|
229
|
-
args: Record<string, string>
|
|
230
|
-
ask: (question: string, defaultValue?: string) => Promise<string>
|
|
231
|
-
choice: (question: string, options: string[]) => Promise<string>
|
|
232
|
-
confirm: (question: string, defaultValue?: boolean) => Promise<boolean>
|
|
233
|
-
dim: (msg: string) => void
|
|
234
|
-
error: (msg: string) => void
|
|
235
|
-
flags: Record<string, string | number | boolean>
|
|
236
|
-
info: (msg: string) => void
|
|
237
|
-
line: (msg: string) => void
|
|
238
|
-
newLine: () => void
|
|
239
|
-
run: () => Promise<void>
|
|
240
|
-
secret: (question: string) => Promise<string>
|
|
241
|
-
section: (title: string) => void
|
|
242
|
-
table: (rows: [string, string][], indent?: number) => void
|
|
243
|
-
warn: (msg: string) => void
|
|
244
|
-
write: (msg: string) => void
|
|
245
|
-
}
|
|
246
|
-
|
|
247
176
|
class AiToolCalled = {
|
|
248
177
|
new (driver: string, tool: string, step: number, durationMs: number, ok: boolean, error?: string | undefined): AiToolCalled
|
|
249
178
|
readonly driver: string
|
|
@@ -342,8 +271,6 @@ function toSchema = (input: SchemaInput) => Schema
|
|
|
342
271
|
|
|
343
272
|
function translateSchema = (input: SchemaInput) => JsonSchema
|
|
344
273
|
|
|
345
|
-
function validateAiConfig = (config: AiConfigShape) => void
|
|
346
|
-
|
|
347
274
|
interface AgentOptions = {
|
|
348
275
|
maxResumes: number
|
|
349
276
|
maxSteps: number
|
|
@@ -605,7 +532,7 @@ interface OpenAiConfigShape = {
|
|
|
605
532
|
|
|
606
533
|
type AiConfigInput = { default?: string | undefined; drivers?: DeepPartial<{ anthropic?: AnthropicConfigShape; openai?: OpenAiConfigShape; ollama?: OllamaConfigShape; }> | undefined; embeddings?: DeepPartial<EmbeddingsConfigShape> | undefined; limits?: DeepPartial<AiLimitsConfigShape> | undefined; redact?: boolean | undefined; agent?: DeepPartial<AiAgentConfigShape> | undefined;}
|
|
607
534
|
|
|
608
|
-
type AiEffort = '
|
|
535
|
+
type AiEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max'
|
|
609
536
|
|
|
610
537
|
type AiProviderOptions = { [x: string]: Record<string, unknown>;}
|
|
611
538
|
|
|
@@ -615,6 +542,6 @@ type AiRole = 'user' | 'assistant'
|
|
|
615
542
|
|
|
616
543
|
type AiStopReason = 'end_turn' | 'max_tokens' | 'tool_use' | 'pause_turn' | 'refusal' | 'stop_sequence' | 'unknown'
|
|
617
544
|
|
|
618
|
-
type AiStreamChunk = {
|
|
545
|
+
type AiStreamChunk = { type: 'text'; text: string } | { type: 'thinking'; text: string } | { type: 'tool_call'; call: AiToolCall } | { type: 'done'; response: AiResponse }
|
|
619
546
|
|
|
620
547
|
type SchemaInput = { [x: string]: FieldRuleDefinition | FieldRule;}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/ai",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "experimental",
|
|
6
|
+
"maturityReview": "1.9.0",
|
|
6
7
|
"private": false,
|
|
7
8
|
"type": "module",
|
|
8
9
|
"main": "./src/index.ts",
|
|
@@ -30,9 +31,9 @@
|
|
|
30
31
|
"typecheck": "tsc --noEmit"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@zerotal/core": "1.7.
|
|
34
|
-
"@zerotal/validator": "1.7.
|
|
35
|
-
"@zerotal/queue": "1.7.
|
|
34
|
+
"@zerotal/core": "1.7.5",
|
|
35
|
+
"@zerotal/validator": "1.7.5",
|
|
36
|
+
"@zerotal/queue": "1.7.5"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@anthropic-ai/sdk": ">=0.70.0"
|