@a3s-lab/code 0.6.0 → 0.7.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.
Files changed (52) hide show
  1. package/index.d.ts +87 -0
  2. package/index.darwin-arm64.node +0 -0
  3. package/index.darwin-x64.node +0 -0
  4. package/index.js +128 -0
  5. package/index.linux-arm64-gnu.node +0 -0
  6. package/index.linux-arm64-musl.node +0 -0
  7. package/index.linux-x64-gnu.node +0 -0
  8. package/index.linux-x64-musl.node +0 -0
  9. package/package.json +27 -34
  10. package/LICENSE +0 -21
  11. package/README.md +0 -764
  12. package/dist/chat.d.ts +0 -97
  13. package/dist/chat.d.ts.map +0 -1
  14. package/dist/chat.js +0 -179
  15. package/dist/chat.js.map +0 -1
  16. package/dist/client.d.ts +0 -1356
  17. package/dist/client.d.ts.map +0 -1
  18. package/dist/client.js +0 -1014
  19. package/dist/client.js.map +0 -1
  20. package/dist/config.d.ts +0 -106
  21. package/dist/config.d.ts.map +0 -1
  22. package/dist/config.js +0 -142
  23. package/dist/config.js.map +0 -1
  24. package/dist/generate.d.ts +0 -130
  25. package/dist/generate.d.ts.map +0 -1
  26. package/dist/generate.js +0 -283
  27. package/dist/generate.js.map +0 -1
  28. package/dist/index.d.ts +0 -54
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/index.js +0 -60
  31. package/dist/index.js.map +0 -1
  32. package/dist/message.d.ts +0 -157
  33. package/dist/message.d.ts.map +0 -1
  34. package/dist/message.js +0 -279
  35. package/dist/message.js.map +0 -1
  36. package/dist/openai-compat.d.ts +0 -186
  37. package/dist/openai-compat.d.ts.map +0 -1
  38. package/dist/openai-compat.js +0 -263
  39. package/dist/openai-compat.js.map +0 -1
  40. package/dist/provider.d.ts +0 -64
  41. package/dist/provider.d.ts.map +0 -1
  42. package/dist/provider.js +0 -60
  43. package/dist/provider.js.map +0 -1
  44. package/dist/session.d.ts +0 -573
  45. package/dist/session.d.ts.map +0 -1
  46. package/dist/session.js +0 -1153
  47. package/dist/session.js.map +0 -1
  48. package/dist/tool.d.ts +0 -106
  49. package/dist/tool.d.ts.map +0 -1
  50. package/dist/tool.js +0 -71
  51. package/dist/tool.js.map +0 -1
  52. package/proto/code_agent.proto +0 -1851
package/dist/client.d.ts DELETED
@@ -1,1356 +0,0 @@
1
- /**
2
- * A3S Code Agent gRPC Client
3
- *
4
- * Full implementation of the CodeAgentService interface.
5
- */
6
- import { type OpenAIMessage, type OpenAIChatCompletion, type OpenAIChatCompletionChunk } from './openai-compat.js';
7
- import { Session as CodeSession } from './session.js';
8
- import type { SessionCreateOptions } from './session.js';
9
- export type HealthStatus = 'STATUS_UNKNOWN' | 'STATUS_HEALTHY' | 'STATUS_DEGRADED' | 'STATUS_UNHEALTHY';
10
- export type SessionState = 'SESSION_STATE_UNKNOWN' | 'SESSION_STATE_ACTIVE' | 'SESSION_STATE_PAUSED' | 'SESSION_STATE_COMPLETED' | 'SESSION_STATE_ERROR';
11
- export type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
12
- export type FinishReason = 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'error';
13
- export type ChunkType = 'content' | 'tool_call' | 'tool_result' | 'metadata' | 'done';
14
- export type EventType = 'EVENT_TYPE_UNKNOWN' | 'EVENT_TYPE_SESSION_CREATED' | 'EVENT_TYPE_SESSION_DESTROYED' | 'EVENT_TYPE_GENERATION_STARTED' | 'EVENT_TYPE_GENERATION_COMPLETED' | 'EVENT_TYPE_TOOL_CALLED' | 'EVENT_TYPE_TOOL_COMPLETED' | 'EVENT_TYPE_ERROR' | 'EVENT_TYPE_WARNING' | 'EVENT_TYPE_INFO' | 'EVENT_TYPE_CONFIRMATION_REQUIRED' | 'EVENT_TYPE_CONFIRMATION_RECEIVED' | 'EVENT_TYPE_CONFIRMATION_TIMEOUT' | 'EVENT_TYPE_EXTERNAL_TASK_PENDING' | 'EVENT_TYPE_EXTERNAL_TASK_COMPLETED' | 'EVENT_TYPE_PERMISSION_DENIED' | 'EVENT_TYPE_MEMORY_STORED' | 'EVENT_TYPE_MEMORY_RECALLED' | 'EVENT_TYPE_MEMORIES_SEARCHED' | 'EVENT_TYPE_MEMORY_CLEARED';
15
- export type SessionLaneType = 'SESSION_LANE_UNKNOWN' | 'SESSION_LANE_CONTROL' | 'SESSION_LANE_QUERY' | 'SESSION_LANE_EXECUTE' | 'SESSION_LANE_GENERATE';
16
- export type TimeoutActionType = 'TIMEOUT_ACTION_UNKNOWN' | 'TIMEOUT_ACTION_REJECT' | 'TIMEOUT_ACTION_AUTO_APPROVE';
17
- export type TaskHandlerModeType = 'TASK_HANDLER_MODE_UNKNOWN' | 'TASK_HANDLER_MODE_INTERNAL' | 'TASK_HANDLER_MODE_EXTERNAL' | 'TASK_HANDLER_MODE_HYBRID';
18
- export type PermissionDecision = 'PERMISSION_DECISION_UNKNOWN' | 'PERMISSION_DECISION_ALLOW' | 'PERMISSION_DECISION_DENY' | 'PERMISSION_DECISION_ASK';
19
- export type StorageTypeString = 'STORAGE_TYPE_UNSPECIFIED' | 'STORAGE_TYPE_MEMORY' | 'STORAGE_TYPE_FILE';
20
- export declare const StorageType: {
21
- readonly STORAGE_TYPE_UNSPECIFIED: 0;
22
- readonly STORAGE_TYPE_MEMORY: 1;
23
- readonly STORAGE_TYPE_FILE: 2;
24
- };
25
- export declare const SessionLane: {
26
- readonly SESSION_LANE_UNKNOWN: 0;
27
- readonly SESSION_LANE_CONTROL: 1;
28
- readonly SESSION_LANE_QUERY: 2;
29
- readonly SESSION_LANE_EXECUTE: 3;
30
- readonly SESSION_LANE_GENERATE: 4;
31
- };
32
- export declare const TimeoutAction: {
33
- readonly TIMEOUT_ACTION_UNKNOWN: 0;
34
- readonly TIMEOUT_ACTION_REJECT: 1;
35
- readonly TIMEOUT_ACTION_AUTO_APPROVE: 2;
36
- };
37
- export declare const TaskHandlerMode: {
38
- readonly TASK_HANDLER_MODE_UNKNOWN: 0;
39
- readonly TASK_HANDLER_MODE_INTERNAL: 1;
40
- readonly TASK_HANDLER_MODE_EXTERNAL: 2;
41
- readonly TASK_HANDLER_MODE_HYBRID: 3;
42
- };
43
- export interface HealthCheckResponse {
44
- status: HealthStatus;
45
- message: string;
46
- details: Record<string, string>;
47
- }
48
- export interface AgentInfo {
49
- name: string;
50
- version: string;
51
- description: string;
52
- author: string;
53
- license: string;
54
- homepage: string;
55
- }
56
- export interface ToolCapability {
57
- name: string;
58
- description: string;
59
- parameters: string[];
60
- async: boolean;
61
- }
62
- export interface ModelCapability {
63
- provider: string;
64
- model: string;
65
- features: string[];
66
- }
67
- export interface ResourceLimits {
68
- maxContextTokens: number;
69
- maxConcurrentSessions: number;
70
- maxToolsPerRequest: number;
71
- }
72
- export interface GetCapabilitiesResponse {
73
- info?: AgentInfo;
74
- features: string[];
75
- tools: ToolCapability[];
76
- models: ModelCapability[];
77
- limits?: ResourceLimits;
78
- metadata: Record<string, string>;
79
- }
80
- export interface InitializeResponse {
81
- success: boolean;
82
- message: string;
83
- info?: AgentInfo;
84
- }
85
- export interface ShutdownResponse {
86
- success: boolean;
87
- message: string;
88
- }
89
- export interface LLMConfig {
90
- provider: string;
91
- model: string;
92
- apiKey?: string;
93
- baseUrl?: string;
94
- temperature?: number;
95
- maxTokens?: number;
96
- }
97
- export interface SessionConfig {
98
- /** Session name. */
99
- name: string;
100
- /**
101
- * Working directory for per-session tool sandboxing.
102
- *
103
- * Each session gets its own workspace-scoped ToolContext on the server.
104
- * If empty, the server falls back to its default workspace directory.
105
- */
106
- workspace: string;
107
- llm?: LLMConfig;
108
- systemPrompt?: string;
109
- maxContextLength?: number;
110
- autoCompact?: boolean;
111
- storageType?: number;
112
- }
113
- export interface ContextUsage {
114
- totalTokens: number;
115
- promptTokens: number;
116
- completionTokens: number;
117
- messageCount: number;
118
- }
119
- export interface SessionInfo {
120
- sessionId: string;
121
- config?: SessionConfig;
122
- state: SessionState;
123
- contextUsage?: ContextUsage;
124
- createdAt: number;
125
- updatedAt: number;
126
- }
127
- /** @deprecated Use SessionInfo instead */
128
- export type Session = SessionInfo;
129
- export interface CreateSessionResponse {
130
- sessionId: string;
131
- session?: SessionInfo;
132
- }
133
- export interface DestroySessionResponse {
134
- success: boolean;
135
- }
136
- export interface RestoreSessionResponse {
137
- success: boolean;
138
- sessionId: string;
139
- message: string;
140
- }
141
- export interface ListSessionsResponse {
142
- sessions: SessionInfo[];
143
- }
144
- export interface GetSessionResponse {
145
- session?: SessionInfo;
146
- }
147
- export interface ConfigureSessionResponse {
148
- session?: SessionInfo;
149
- }
150
- export interface Message {
151
- role: MessageRole;
152
- content: string;
153
- metadata?: Record<string, string>;
154
- }
155
- export interface TextContent {
156
- text: string;
157
- }
158
- export interface ToolUseContent {
159
- id: string;
160
- name: string;
161
- arguments: string;
162
- }
163
- export interface ToolResultContent {
164
- toolUseId: string;
165
- content: string;
166
- isError: boolean;
167
- }
168
- export interface ContentBlock {
169
- text?: TextContent;
170
- toolUse?: ToolUseContent;
171
- toolResult?: ToolResultContent;
172
- }
173
- export interface ConversationMessage {
174
- id: string;
175
- role: string;
176
- content: ContentBlock[];
177
- timestamp: number;
178
- metadata: Record<string, string>;
179
- }
180
- export interface GetMessagesResponse {
181
- messages: ConversationMessage[];
182
- totalCount: number;
183
- hasMore: boolean;
184
- }
185
- export interface ToolResult {
186
- success: boolean;
187
- output: string;
188
- error: string;
189
- metadata: Record<string, string>;
190
- }
191
- export interface ToolCall {
192
- id: string;
193
- name: string;
194
- arguments: string;
195
- result?: ToolResult;
196
- }
197
- export interface Usage {
198
- promptTokens: number;
199
- completionTokens: number;
200
- totalTokens: number;
201
- }
202
- export interface GenerateResponse {
203
- sessionId: string;
204
- message?: Message;
205
- toolCalls: ToolCall[];
206
- usage?: Usage;
207
- finishReason: FinishReason;
208
- metadata: Record<string, string>;
209
- }
210
- export interface GenerateChunk {
211
- type: ChunkType;
212
- sessionId: string;
213
- content: string;
214
- toolCall?: ToolCall;
215
- toolResult?: ToolResult;
216
- metadata: Record<string, string>;
217
- finishReason?: FinishReason;
218
- }
219
- export interface GenerateStructuredResponse {
220
- sessionId: string;
221
- data: string;
222
- usage?: Usage;
223
- metadata: Record<string, string>;
224
- }
225
- export interface GenerateStructuredChunk {
226
- sessionId: string;
227
- data: string;
228
- done: boolean;
229
- }
230
- export type SkillKind = 'instruction' | 'tool' | 'agent';
231
- export interface Skill {
232
- name: string;
233
- description: string;
234
- allowedTools?: string;
235
- disableModelInvocation: boolean;
236
- content: string;
237
- metadata: Record<string, string>;
238
- kind: SkillKind;
239
- }
240
- export interface LoadSkillResponse {
241
- success: boolean;
242
- }
243
- export interface UnloadSkillResponse {
244
- success: boolean;
245
- }
246
- export interface ListSkillsResponse {
247
- skills: Skill[];
248
- }
249
- export interface GetSkillResponse {
250
- skills: Skill[];
251
- }
252
- export interface SkillSearchResult {
253
- name: string;
254
- description: string;
255
- url: string;
256
- stars: number;
257
- topics: string[];
258
- installSource: string;
259
- }
260
- export interface SearchSkillsResponse {
261
- results: SkillSearchResult[];
262
- totalCount: number;
263
- }
264
- export interface InstallSkillResponse {
265
- success: boolean;
266
- message: string;
267
- installedPath: string;
268
- skillName: string;
269
- }
270
- export interface GetContextUsageResponse {
271
- usage?: ContextUsage;
272
- }
273
- export interface CompactContextResponse {
274
- success: boolean;
275
- before?: ContextUsage;
276
- after?: ContextUsage;
277
- }
278
- export interface ClearContextResponse {
279
- success: boolean;
280
- }
281
- export interface AgentEvent {
282
- type: EventType;
283
- sessionId?: string;
284
- timestamp: number;
285
- message: string;
286
- data: Record<string, string>;
287
- }
288
- export interface CancelResponse {
289
- success: boolean;
290
- }
291
- export interface PauseResponse {
292
- success: boolean;
293
- }
294
- export interface ResumeResponse {
295
- success: boolean;
296
- }
297
- export interface ConfirmationPolicy {
298
- enabled: boolean;
299
- autoApproveTools: string[];
300
- requireConfirmTools: string[];
301
- defaultTimeoutMs: number;
302
- timeoutAction: TimeoutActionType;
303
- yoloLanes: SessionLaneType[];
304
- }
305
- export interface ConfirmToolExecutionResponse {
306
- success: boolean;
307
- error: string;
308
- }
309
- export interface SetConfirmationPolicyResponse {
310
- success: boolean;
311
- policy?: ConfirmationPolicy;
312
- }
313
- export interface GetConfirmationPolicyResponse {
314
- policy?: ConfirmationPolicy;
315
- }
316
- export interface LaneHandlerConfig {
317
- mode: TaskHandlerModeType;
318
- timeoutMs: number;
319
- }
320
- export interface ExternalTask {
321
- taskId: string;
322
- sessionId: string;
323
- lane: SessionLaneType;
324
- commandType: string;
325
- payload: string;
326
- timeoutMs: number;
327
- remainingMs: number;
328
- }
329
- export interface SetLaneHandlerResponse {
330
- success: boolean;
331
- config?: LaneHandlerConfig;
332
- }
333
- export interface GetLaneHandlerResponse {
334
- config?: LaneHandlerConfig;
335
- }
336
- export interface CompleteExternalTaskResponse {
337
- success: boolean;
338
- error: string;
339
- }
340
- export interface ListPendingExternalTasksResponse {
341
- tasks: ExternalTask[];
342
- }
343
- export interface PermissionRule {
344
- rule: string;
345
- }
346
- export interface PermissionPolicy {
347
- deny: PermissionRule[];
348
- allow: PermissionRule[];
349
- ask: PermissionRule[];
350
- defaultDecision: PermissionDecision;
351
- enabled: boolean;
352
- }
353
- export interface SetPermissionPolicyResponse {
354
- success: boolean;
355
- policy?: PermissionPolicy;
356
- }
357
- export interface GetPermissionPolicyResponse {
358
- policy?: PermissionPolicy;
359
- }
360
- export interface CheckPermissionResponse {
361
- decision: PermissionDecision;
362
- matchingRules: string[];
363
- }
364
- export interface AddPermissionRuleResponse {
365
- success: boolean;
366
- error: string;
367
- }
368
- export interface Todo {
369
- id: string;
370
- content: string;
371
- status: string;
372
- priority: string;
373
- }
374
- export interface GetTodosResponse {
375
- todos: Todo[];
376
- }
377
- export interface SetTodosResponse {
378
- success: boolean;
379
- todos: Todo[];
380
- }
381
- export interface ModelCostInfo {
382
- input: number;
383
- output: number;
384
- cacheRead: number;
385
- cacheWrite: number;
386
- }
387
- export interface ModelLimitInfo {
388
- context: number;
389
- output: number;
390
- }
391
- export interface ModelModalitiesInfo {
392
- input: string[];
393
- output: string[];
394
- }
395
- export interface ModelInfo {
396
- id: string;
397
- name: string;
398
- family: string;
399
- apiKey?: string;
400
- baseUrl?: string;
401
- attachment: boolean;
402
- reasoning: boolean;
403
- toolCall: boolean;
404
- temperature: boolean;
405
- releaseDate?: string;
406
- modalities?: ModelModalitiesInfo;
407
- cost?: ModelCostInfo;
408
- limit?: ModelLimitInfo;
409
- }
410
- export interface ProviderInfo {
411
- name: string;
412
- apiKey?: string;
413
- baseUrl?: string;
414
- models: ModelInfo[];
415
- }
416
- export interface ListProvidersResponse {
417
- providers: ProviderInfo[];
418
- defaultProvider?: string;
419
- defaultModel?: string;
420
- }
421
- export interface GetProviderResponse {
422
- provider?: ProviderInfo;
423
- }
424
- export interface AddProviderResponse {
425
- success: boolean;
426
- error: string;
427
- provider?: ProviderInfo;
428
- }
429
- export interface UpdateProviderResponse {
430
- success: boolean;
431
- error: string;
432
- provider?: ProviderInfo;
433
- }
434
- export interface RemoveProviderResponse {
435
- success: boolean;
436
- error: string;
437
- }
438
- export interface SetDefaultModelResponse {
439
- success: boolean;
440
- error: string;
441
- provider: string;
442
- model: string;
443
- }
444
- export interface GetDefaultModelResponse {
445
- provider?: string;
446
- model?: string;
447
- }
448
- export type Complexity = 'COMPLEXITY_UNKNOWN' | 'COMPLEXITY_SIMPLE' | 'COMPLEXITY_MEDIUM' | 'COMPLEXITY_COMPLEX' | 'COMPLEXITY_VERY_COMPLEX';
449
- export type StepStatus = 'STEP_STATUS_UNKNOWN' | 'STEP_STATUS_PENDING' | 'STEP_STATUS_IN_PROGRESS' | 'STEP_STATUS_COMPLETED' | 'STEP_STATUS_FAILED' | 'STEP_STATUS_SKIPPED';
450
- export interface PlanStep {
451
- id: string;
452
- description: string;
453
- tool?: string;
454
- dependencies: string[];
455
- status: StepStatus;
456
- successCriteria: string[];
457
- }
458
- export interface ExecutionPlan {
459
- goal: string;
460
- steps: PlanStep[];
461
- complexity: Complexity;
462
- requiredTools: string[];
463
- estimatedSteps: number;
464
- }
465
- export interface AgentGoal {
466
- description: string;
467
- successCriteria: string[];
468
- progress: number;
469
- achieved: boolean;
470
- createdAt: number;
471
- achievedAt?: number;
472
- }
473
- export interface CreatePlanResponse {
474
- plan?: ExecutionPlan;
475
- }
476
- export interface GetPlanResponse {
477
- plan?: ExecutionPlan;
478
- }
479
- export interface ExtractGoalResponse {
480
- goal?: AgentGoal;
481
- }
482
- export interface CheckGoalAchievementResponse {
483
- achieved: boolean;
484
- progress: number;
485
- remainingCriteria: string[];
486
- }
487
- export type MemoryType = 'MEMORY_TYPE_UNKNOWN' | 'MEMORY_TYPE_EPISODIC' | 'MEMORY_TYPE_SEMANTIC' | 'MEMORY_TYPE_PROCEDURAL' | 'MEMORY_TYPE_WORKING';
488
- export interface MemoryItem {
489
- id: string;
490
- content: string;
491
- timestamp: number;
492
- importance: number;
493
- tags: string[];
494
- memoryType: MemoryType;
495
- metadata: Record<string, string>;
496
- accessCount: number;
497
- lastAccessed?: number;
498
- }
499
- export interface MemoryStats {
500
- longTermCount: number;
501
- shortTermCount: number;
502
- workingCount: number;
503
- }
504
- export interface StoreMemoryResponse {
505
- success: boolean;
506
- memoryId: string;
507
- }
508
- export interface RetrieveMemoryResponse {
509
- memory?: MemoryItem;
510
- }
511
- export interface SearchMemoriesResponse {
512
- memories: MemoryItem[];
513
- totalCount: number;
514
- }
515
- export interface GetMemoryStatsResponse {
516
- stats?: MemoryStats;
517
- }
518
- export interface ClearMemoriesResponse {
519
- success: boolean;
520
- clearedCount: number;
521
- }
522
- export interface DeleteMemoryResponse {
523
- success: boolean;
524
- }
525
- export interface SummarizeMemoriesResponse {
526
- summary: string;
527
- memoryCount: number;
528
- stored: boolean;
529
- summaryMemoryId: string;
530
- }
531
- export interface McpStdioTransport {
532
- command: string;
533
- args: string[];
534
- }
535
- export interface McpHttpTransport {
536
- url: string;
537
- headers: Record<string, string>;
538
- }
539
- export interface McpTransport {
540
- stdio?: McpStdioTransport;
541
- http?: McpHttpTransport;
542
- }
543
- export interface McpServerConfig {
544
- name: string;
545
- transport: McpTransport;
546
- enabled: boolean;
547
- env: Record<string, string>;
548
- }
549
- export interface RegisterMcpServerResponse {
550
- success: boolean;
551
- message: string;
552
- }
553
- export interface ConnectMcpServerResponse {
554
- success: boolean;
555
- message: string;
556
- toolNames: string[];
557
- }
558
- export interface DisconnectMcpServerResponse {
559
- success: boolean;
560
- }
561
- export interface McpServerInfo {
562
- name: string;
563
- connected: boolean;
564
- enabled: boolean;
565
- toolCount: number;
566
- error?: string;
567
- }
568
- export interface ListMcpServersResponse {
569
- servers: McpServerInfo[];
570
- }
571
- export interface McpToolInfo {
572
- fullName: string;
573
- serverName: string;
574
- toolName: string;
575
- description: string;
576
- inputSchema: string;
577
- }
578
- export interface GetMcpToolsResponse {
579
- tools: McpToolInfo[];
580
- }
581
- export interface LspServerInfo {
582
- language: string;
583
- name: string;
584
- version?: string;
585
- running: boolean;
586
- }
587
- export interface LspPosition {
588
- line: number;
589
- character: number;
590
- }
591
- export interface LspRange {
592
- start: LspPosition;
593
- end: LspPosition;
594
- }
595
- export interface LspLocation {
596
- uri: string;
597
- range?: LspRange;
598
- }
599
- export interface LspSymbol {
600
- name: string;
601
- kind: string;
602
- location?: LspLocation;
603
- containerName?: string;
604
- }
605
- export interface LspDiagnostic {
606
- uri: string;
607
- range?: LspRange;
608
- severity: string;
609
- message: string;
610
- code?: string;
611
- source?: string;
612
- }
613
- export interface StartLspServerResponse {
614
- success: boolean;
615
- message: string;
616
- serverInfo?: LspServerInfo;
617
- }
618
- export interface StopLspServerResponse {
619
- success: boolean;
620
- }
621
- export interface ListLspServersResponse {
622
- servers: LspServerInfo[];
623
- }
624
- export interface LspHoverResponse {
625
- found: boolean;
626
- content: string;
627
- range?: LspRange;
628
- }
629
- export interface LspDefinitionResponse {
630
- locations: LspLocation[];
631
- }
632
- export interface LspReferencesResponse {
633
- locations: LspLocation[];
634
- }
635
- export interface LspSymbolsResponse {
636
- symbols: LspSymbol[];
637
- }
638
- export interface LspDiagnosticsResponse {
639
- diagnostics: LspDiagnostic[];
640
- }
641
- export type CronJobStatus = 'CRON_JOB_STATUS_UNKNOWN' | 'CRON_JOB_STATUS_ACTIVE' | 'CRON_JOB_STATUS_PAUSED' | 'CRON_JOB_STATUS_RUNNING';
642
- export type CronExecutionStatus = 'CRON_EXECUTION_STATUS_UNKNOWN' | 'CRON_EXECUTION_STATUS_SUCCESS' | 'CRON_EXECUTION_STATUS_FAILED' | 'CRON_EXECUTION_STATUS_TIMEOUT' | 'CRON_EXECUTION_STATUS_CANCELLED';
643
- export declare const CronJobStatusEnum: {
644
- readonly UNKNOWN: 0;
645
- readonly ACTIVE: 1;
646
- readonly PAUSED: 2;
647
- readonly RUNNING: 3;
648
- };
649
- export declare const CronExecutionStatusEnum: {
650
- readonly UNKNOWN: 0;
651
- readonly SUCCESS: 1;
652
- readonly FAILED: 2;
653
- readonly TIMEOUT: 3;
654
- readonly CANCELLED: 4;
655
- };
656
- export interface CronJob {
657
- id: string;
658
- name: string;
659
- schedule: string;
660
- command: string;
661
- status: CronJobStatus;
662
- timeoutMs: number;
663
- createdAt: number;
664
- updatedAt: number;
665
- lastRun?: number;
666
- nextRun?: number;
667
- runCount: number;
668
- failCount: number;
669
- workingDir?: string;
670
- }
671
- export interface CronExecution {
672
- id: string;
673
- jobId: string;
674
- status: CronExecutionStatus;
675
- startedAt: number;
676
- endedAt?: number;
677
- durationMs?: number;
678
- exitCode?: number;
679
- stdout: string;
680
- stderr: string;
681
- error?: string;
682
- }
683
- export interface ListCronJobsResponse {
684
- jobs: CronJob[];
685
- }
686
- export interface CreateCronJobResponse {
687
- success: boolean;
688
- job?: CronJob;
689
- error: string;
690
- }
691
- export interface GetCronJobResponse {
692
- job?: CronJob;
693
- }
694
- export interface UpdateCronJobResponse {
695
- success: boolean;
696
- job?: CronJob;
697
- error: string;
698
- }
699
- export interface PauseCronJobResponse {
700
- success: boolean;
701
- job?: CronJob;
702
- error: string;
703
- }
704
- export interface ResumeCronJobResponse {
705
- success: boolean;
706
- job?: CronJob;
707
- error: string;
708
- }
709
- export interface DeleteCronJobResponse {
710
- success: boolean;
711
- error: string;
712
- }
713
- export interface GetCronHistoryResponse {
714
- executions: CronExecution[];
715
- }
716
- export interface RunCronJobResponse {
717
- success: boolean;
718
- execution?: CronExecution;
719
- error: string;
720
- }
721
- export interface ParseCronScheduleResponse {
722
- success: boolean;
723
- cronExpression: string;
724
- description: string;
725
- error: string;
726
- }
727
- export interface ToolStats {
728
- toolName: string;
729
- callCount: number;
730
- successCount: number;
731
- failureCount: number;
732
- totalDurationMs: number;
733
- avgDurationMs: number;
734
- minDurationMs: number;
735
- maxDurationMs: number;
736
- }
737
- export interface GetToolMetricsResponse {
738
- tools: ToolStats[];
739
- totalCalls: number;
740
- totalDurationMs: number;
741
- }
742
- export interface ModelCostBreakdown {
743
- model: string;
744
- costUsd: number;
745
- promptTokens: number;
746
- completionTokens: number;
747
- callCount: number;
748
- }
749
- export interface DayCostBreakdown {
750
- date: string;
751
- costUsd: number;
752
- callCount: number;
753
- }
754
- export interface GetCostSummaryResponse {
755
- totalCostUsd: number;
756
- totalPromptTokens: number;
757
- totalCompletionTokens: number;
758
- totalTokens: number;
759
- callCount: number;
760
- byModel: ModelCostBreakdown[];
761
- byDay: DayCostBreakdown[];
762
- }
763
- export type AgenticStrategyType = 'AGENTIC_STRATEGY_AUTO' | 'AGENTIC_STRATEGY_DIRECT' | 'AGENTIC_STRATEGY_PLANNED' | 'AGENTIC_STRATEGY_ITERATIVE' | 'AGENTIC_STRATEGY_PARALLEL';
764
- export interface AgenticStep {
765
- stepIndex: number;
766
- text: string;
767
- toolCalls: ToolCall[];
768
- toolResults: ToolResult[];
769
- usage?: Usage;
770
- finishReason?: string;
771
- }
772
- export interface AgenticGenerateResponse {
773
- sessionId: string;
774
- text: string;
775
- steps: AgenticStep[];
776
- toolCalls: ToolCall[];
777
- usage?: Usage;
778
- finishReason: string;
779
- plan?: ExecutionPlan;
780
- }
781
- export interface AgenticGenerateEvent {
782
- type: string;
783
- sessionId: string;
784
- content?: string;
785
- toolCall?: ToolCall;
786
- toolResult?: ToolResult;
787
- toolCallId?: string;
788
- stepIndex?: number;
789
- stepText?: string;
790
- plan?: ExecutionPlan;
791
- confidence?: number;
792
- shouldRetry?: boolean;
793
- insight?: string;
794
- confirmationId?: string;
795
- toolName?: string;
796
- toolArgs?: string;
797
- timeoutMs?: number;
798
- approved?: boolean;
799
- agentName?: string;
800
- agentTask?: string;
801
- agentSessionId?: string;
802
- agentResult?: string;
803
- beforeTokens?: number;
804
- afterTokens?: number;
805
- externalTask?: ExternalTask;
806
- errorMessage?: string;
807
- recoverable?: boolean;
808
- finishReason?: string;
809
- usage?: Usage;
810
- }
811
- export interface DelegateResponse {
812
- sessionId: string;
813
- agentSessionId: string;
814
- text: string;
815
- steps: AgenticStep[];
816
- toolCalls: ToolCall[];
817
- usage?: Usage;
818
- finishReason: string;
819
- }
820
- export interface ProtoLaneStats {
821
- pending: number;
822
- active: number;
823
- external: number;
824
- completed: number;
825
- failed: number;
826
- }
827
- export interface GetQueueStatsResponse {
828
- control?: ProtoLaneStats;
829
- query?: ProtoLaneStats;
830
- execute?: ProtoLaneStats;
831
- generate?: ProtoLaneStats;
832
- deadLetters: number;
833
- }
834
- export interface LoadSkillsFromDirResponse {
835
- success: boolean;
836
- loadedSkills: string[];
837
- errors: string[];
838
- }
839
- export interface A3sClientOptions {
840
- /** gRPC server address (default: localhost:4088) */
841
- address?: string;
842
- /** Use TLS for connection */
843
- useTls?: boolean;
844
- /** Connection timeout in milliseconds */
845
- timeout?: number;
846
- /** Path to config directory containing config.json */
847
- configDir?: string;
848
- /** Path to config.json file */
849
- configPath?: string;
850
- }
851
- /**
852
- * A3S Code Agent gRPC Client
853
- *
854
- * Provides a TypeScript interface to all CodeAgentService RPCs.
855
- *
856
- * @example
857
- * ```typescript
858
- * // Create client with config directory
859
- * const client = new A3sClient({ configDir: '/path/to/a3s' });
860
- *
861
- * // Create client with config file
862
- * const client = new A3sClient({ configPath: '/path/to/config.json' });
863
- *
864
- * // Create client with explicit address
865
- * const client = new A3sClient({ address: 'localhost:4088' });
866
- * ```
867
- */
868
- export declare class A3sClient {
869
- private client;
870
- private address;
871
- private configDir?;
872
- constructor(options?: A3sClientOptions);
873
- /**
874
- * Get the config directory path
875
- */
876
- getConfigDir(): string | undefined;
877
- /**
878
- * Get the server address
879
- */
880
- getAddress(): string;
881
- /**
882
- * Close the client connection
883
- */
884
- close(): void;
885
- private promisify;
886
- /**
887
- * Check the health status of the agent
888
- */
889
- healthCheck(): Promise<HealthCheckResponse>;
890
- /**
891
- * Get agent capabilities
892
- */
893
- getCapabilities(): Promise<GetCapabilitiesResponse>;
894
- /**
895
- * Initialize the agent with workspace and environment
896
- */
897
- initialize(workspace: string, env?: Record<string, string>): Promise<InitializeResponse>;
898
- /**
899
- * Shutdown the agent
900
- */
901
- shutdown(): Promise<ShutdownResponse>;
902
- /**
903
- * Create a new session.
904
- *
905
- * Accepts either high-level options (with `model` from createProvider) or
906
- * low-level SessionConfig. Returns a Session object with send(),
907
- * sendStream(), generateText(), streamText(), etc.
908
- *
909
- * @example
910
- * ```typescript
911
- * // High-level (recommended)
912
- * const openai = createProvider({ name: 'openai', apiKey: 'sk-xxx' });
913
- * await using session = await client.createSession({
914
- * model: openai('gpt-4o'),
915
- * workspace: '/project',
916
- * system: 'You are a helpful assistant',
917
- * confirmation: { requireConfirmation: ['Bash', 'Write'] },
918
- * lanes: { execute: { mode: 'external', timeout: 120_000 } },
919
- * });
920
- * const { text } = await session.send('Refactor the auth module');
921
- * ```
922
- */
923
- createSession(options: SessionCreateOptions): Promise<CodeSession>;
924
- /**
925
- * Create a new session (low-level).
926
- * @deprecated Use the high-level overload with `model` instead.
927
- */
928
- createSession(config?: SessionConfig, sessionId?: string, initialContext?: Message[]): Promise<CreateSessionResponse>;
929
- /**
930
- * Destroy a session
931
- */
932
- destroySession(sessionId: string): Promise<DestroySessionResponse>;
933
- /**
934
- * Restore a persisted session from store by ID
935
- */
936
- restoreSession(sessionId: string): Promise<RestoreSessionResponse>;
937
- /**
938
- * List all sessions
939
- */
940
- listSessions(): Promise<ListSessionsResponse>;
941
- /**
942
- * Get a specific session
943
- */
944
- getSession(sessionId: string): Promise<GetSessionResponse>;
945
- /**
946
- * Configure a session
947
- */
948
- configureSession(sessionId: string, config: SessionConfig): Promise<ConfigureSessionResponse>;
949
- /**
950
- * Get messages from a session
951
- */
952
- getMessages(sessionId: string, limit?: number, offset?: number): Promise<GetMessagesResponse>;
953
- /**
954
- * Generate a response (unary)
955
- *
956
- * Supports both A3S and OpenAI message formats:
957
- * - A3S: { role: 'ROLE_USER', content: '...' }
958
- * - OpenAI: { role: 'user', content: '...' }
959
- */
960
- generate(sessionId: string, messages: (Message | OpenAIMessage)[]): Promise<GenerateResponse>;
961
- /**
962
- * Generate a response (streaming)
963
- *
964
- * Supports both A3S and OpenAI message formats.
965
- */
966
- streamGenerate(sessionId: string, messages: (Message | OpenAIMessage)[]): AsyncIterable<GenerateChunk>;
967
- /**
968
- * Generate structured output (unary)
969
- *
970
- * Supports both A3S and OpenAI message formats.
971
- */
972
- generateStructured(sessionId: string, messages: (Message | OpenAIMessage)[], schema: string): Promise<GenerateStructuredResponse>;
973
- /**
974
- * Generate structured output (streaming)
975
- *
976
- * Supports both A3S and OpenAI message formats.
977
- */
978
- streamGenerateStructured(sessionId: string, messages: (Message | OpenAIMessage)[], schema: string): AsyncIterable<GenerateStructuredChunk>;
979
- /**
980
- * Generate a response in OpenAI ChatCompletion format
981
- *
982
- * This method provides full OpenAI API compatibility.
983
- *
984
- * @example
985
- * ```typescript
986
- * const completion = await client.chatCompletion(sessionId, [
987
- * { role: 'user', content: 'Hello!' }
988
- * ]);
989
- * console.log(completion.choices[0].message.content);
990
- * ```
991
- */
992
- chatCompletion(sessionId: string, messages: OpenAIMessage[], options?: {
993
- model?: string;
994
- }): Promise<OpenAIChatCompletion>;
995
- /**
996
- * Stream a response in OpenAI ChatCompletionChunk format
997
- *
998
- * This method provides full OpenAI API compatibility for streaming.
999
- *
1000
- * @example
1001
- * ```typescript
1002
- * for await (const chunk of client.streamChatCompletion(sessionId, [
1003
- * { role: 'user', content: 'Hello!' }
1004
- * ])) {
1005
- * const content = chunk.choices[0].delta.content;
1006
- * if (content) process.stdout.write(content);
1007
- * }
1008
- * ```
1009
- */
1010
- streamChatCompletion(sessionId: string, messages: OpenAIMessage[], options?: {
1011
- model?: string;
1012
- }): AsyncIterable<OpenAIChatCompletionChunk>;
1013
- /**
1014
- * Load a skill into a session
1015
- */
1016
- loadSkill(sessionId: string, skillName: string, skillContent?: string): Promise<LoadSkillResponse>;
1017
- /**
1018
- * Unload a skill from a session
1019
- */
1020
- unloadSkill(sessionId: string, skillName: string): Promise<UnloadSkillResponse>;
1021
- /**
1022
- * List available skills
1023
- */
1024
- listSkills(sessionId?: string): Promise<ListSkillsResponse>;
1025
- /**
1026
- * Get skills by name or all skills
1027
- */
1028
- getSkill(name?: string): Promise<GetSkillResponse>;
1029
- /**
1030
- * Search for skills in the open skills ecosystem
1031
- *
1032
- * @param query - Search query (e.g., "react performance", "testing")
1033
- * @param limit - Maximum number of results (default 10)
1034
- */
1035
- searchSkills(query: string, limit?: number): Promise<SearchSkillsResponse>;
1036
- /**
1037
- * Install a skill from the skills ecosystem
1038
- *
1039
- * @param source - Skill source (e.g., "owner/repo" or "owner/repo@skill-name")
1040
- * @param global - Install globally (user-level) vs project-level
1041
- * @param sessionId - Optional session to load the skill into after install
1042
- */
1043
- installSkill(source: string, global?: boolean, sessionId?: string): Promise<InstallSkillResponse>;
1044
- /**
1045
- * Get context usage for a session
1046
- */
1047
- getContextUsage(sessionId: string): Promise<GetContextUsageResponse>;
1048
- /**
1049
- * Compact context for a session
1050
- */
1051
- compactContext(sessionId: string): Promise<CompactContextResponse>;
1052
- /**
1053
- * Clear context for a session
1054
- */
1055
- clearContext(sessionId: string): Promise<ClearContextResponse>;
1056
- /**
1057
- * Subscribe to agent events
1058
- */
1059
- subscribeEvents(sessionId?: string, eventTypes?: string[]): AsyncIterable<AgentEvent>;
1060
- /**
1061
- * Cancel an operation
1062
- */
1063
- cancel(sessionId: string, operationId?: string): Promise<CancelResponse>;
1064
- /**
1065
- * Pause a session
1066
- */
1067
- pause(sessionId: string): Promise<PauseResponse>;
1068
- /**
1069
- * Resume a session
1070
- */
1071
- resume(sessionId: string): Promise<ResumeResponse>;
1072
- /**
1073
- * Confirm or reject tool execution
1074
- */
1075
- confirmToolExecution(sessionId: string, toolId: string, approved: boolean, reason?: string): Promise<ConfirmToolExecutionResponse>;
1076
- /**
1077
- * Set confirmation policy for a session
1078
- */
1079
- setConfirmationPolicy(sessionId: string, policy: ConfirmationPolicy): Promise<SetConfirmationPolicyResponse>;
1080
- /**
1081
- * Get confirmation policy for a session
1082
- */
1083
- getConfirmationPolicy(sessionId: string): Promise<GetConfirmationPolicyResponse>;
1084
- /**
1085
- * Set lane handler configuration
1086
- */
1087
- setLaneHandler(sessionId: string, lane: SessionLaneType, config: LaneHandlerConfig): Promise<SetLaneHandlerResponse>;
1088
- /**
1089
- * Get lane handler configuration
1090
- */
1091
- getLaneHandler(sessionId: string, lane: SessionLaneType): Promise<GetLaneHandlerResponse>;
1092
- /**
1093
- * Complete an external task
1094
- */
1095
- completeExternalTask(sessionId: string, taskId: string, success: boolean, result?: string, error?: string): Promise<CompleteExternalTaskResponse>;
1096
- /**
1097
- * List pending external tasks
1098
- */
1099
- listPendingExternalTasks(sessionId: string): Promise<ListPendingExternalTasksResponse>;
1100
- /**
1101
- * Set permission policy for a session
1102
- */
1103
- setPermissionPolicy(sessionId: string, policy: PermissionPolicy): Promise<SetPermissionPolicyResponse>;
1104
- /**
1105
- * Get permission policy for a session
1106
- */
1107
- getPermissionPolicy(sessionId: string): Promise<GetPermissionPolicyResponse>;
1108
- /**
1109
- * Check permission for a tool call
1110
- */
1111
- checkPermission(sessionId: string, toolName: string, args: string): Promise<CheckPermissionResponse>;
1112
- /**
1113
- * Add a permission rule
1114
- */
1115
- addPermissionRule(sessionId: string, ruleType: 'allow' | 'deny' | 'ask', rule: string): Promise<AddPermissionRuleResponse>;
1116
- /**
1117
- * Get todos for a session
1118
- */
1119
- getTodos(sessionId: string): Promise<GetTodosResponse>;
1120
- /**
1121
- * Set todos for a session
1122
- */
1123
- setTodos(sessionId: string, todos: Todo[]): Promise<SetTodosResponse>;
1124
- /**
1125
- * List all providers
1126
- */
1127
- listProviders(): Promise<ListProvidersResponse>;
1128
- /**
1129
- * Get a specific provider
1130
- */
1131
- getProvider(name: string): Promise<GetProviderResponse>;
1132
- /**
1133
- * Add a new provider
1134
- */
1135
- addProvider(provider: ProviderInfo): Promise<AddProviderResponse>;
1136
- /**
1137
- * Update an existing provider
1138
- */
1139
- updateProvider(provider: ProviderInfo): Promise<UpdateProviderResponse>;
1140
- /**
1141
- * Remove a provider
1142
- */
1143
- removeProvider(name: string): Promise<RemoveProviderResponse>;
1144
- /**
1145
- * Set the default model
1146
- */
1147
- setDefaultModel(provider: string, model: string): Promise<SetDefaultModelResponse>;
1148
- /**
1149
- * Get the default model
1150
- */
1151
- getDefaultModel(): Promise<GetDefaultModelResponse>;
1152
- /**
1153
- * Create an execution plan
1154
- */
1155
- createPlan(sessionId: string, prompt: string, context?: string): Promise<CreatePlanResponse>;
1156
- /**
1157
- * Get an existing plan
1158
- */
1159
- getPlan(sessionId: string, planId: string): Promise<GetPlanResponse>;
1160
- /**
1161
- * Extract goal from prompt
1162
- */
1163
- extractGoal(sessionId: string, prompt: string): Promise<ExtractGoalResponse>;
1164
- /**
1165
- * Check if goal is achieved
1166
- */
1167
- checkGoalAchievement(sessionId: string, goal: AgentGoal, currentState: string): Promise<CheckGoalAchievementResponse>;
1168
- /**
1169
- * Store a memory item
1170
- */
1171
- storeMemory(sessionId: string, memory: MemoryItem): Promise<StoreMemoryResponse>;
1172
- /**
1173
- * Retrieve a memory by ID
1174
- */
1175
- retrieveMemory(sessionId: string, memoryId: string): Promise<RetrieveMemoryResponse>;
1176
- /**
1177
- * Search memories
1178
- */
1179
- searchMemories(sessionId: string, query?: string, tags?: string[], limit?: number, recentOnly?: boolean, minImportance?: number): Promise<SearchMemoriesResponse>;
1180
- /**
1181
- * Get memory statistics
1182
- */
1183
- getMemoryStats(sessionId: string): Promise<GetMemoryStatsResponse>;
1184
- /**
1185
- * Clear memories
1186
- */
1187
- clearMemories(sessionId: string, clearLongTerm?: boolean, clearShortTerm?: boolean, clearWorking?: boolean): Promise<ClearMemoriesResponse>;
1188
- /**
1189
- * Delete a specific memory by ID
1190
- */
1191
- deleteMemory(sessionId: string, memoryId: string): Promise<DeleteMemoryResponse>;
1192
- /**
1193
- * Summarize memories using LLM
1194
- */
1195
- summarizeMemories(sessionId: string, tags?: string[], limit?: number, recentHours?: number): Promise<SummarizeMemoriesResponse>;
1196
- /**
1197
- * Register an MCP server
1198
- */
1199
- registerMcpServer(config: McpServerConfig): Promise<RegisterMcpServerResponse>;
1200
- /**
1201
- * Connect to an MCP server
1202
- */
1203
- connectMcpServer(name: string): Promise<ConnectMcpServerResponse>;
1204
- /**
1205
- * Disconnect from an MCP server
1206
- */
1207
- disconnectMcpServer(name: string): Promise<DisconnectMcpServerResponse>;
1208
- /**
1209
- * List all MCP servers
1210
- */
1211
- listMcpServers(): Promise<ListMcpServersResponse>;
1212
- /**
1213
- * Get MCP tools
1214
- */
1215
- getMcpTools(serverName?: string): Promise<GetMcpToolsResponse>;
1216
- /**
1217
- * Start a language server for a specific language
1218
- */
1219
- startLspServer(language: string, rootUri?: string): Promise<StartLspServerResponse>;
1220
- /**
1221
- * Stop a running language server
1222
- */
1223
- stopLspServer(language: string): Promise<StopLspServerResponse>;
1224
- /**
1225
- * List all running language servers
1226
- */
1227
- listLspServers(): Promise<ListLspServersResponse>;
1228
- /**
1229
- * Get hover information at a specific position
1230
- */
1231
- lspHover(filePath: string, line: number, column: number): Promise<LspHoverResponse>;
1232
- /**
1233
- * Go to definition at a specific position
1234
- */
1235
- lspDefinition(filePath: string, line: number, column: number): Promise<LspDefinitionResponse>;
1236
- /**
1237
- * Find all references at a specific position
1238
- */
1239
- lspReferences(filePath: string, line: number, column: number, includeDeclaration?: boolean): Promise<LspReferencesResponse>;
1240
- /**
1241
- * Search for symbols in the workspace
1242
- */
1243
- lspSymbols(query: string, limit?: number): Promise<LspSymbolsResponse>;
1244
- /**
1245
- * Get diagnostics for a file
1246
- */
1247
- lspDiagnostics(filePath?: string): Promise<LspDiagnosticsResponse>;
1248
- /**
1249
- * List all cron jobs
1250
- */
1251
- listCronJobs(): Promise<ListCronJobsResponse>;
1252
- /**
1253
- * Create a new cron job
1254
- * @param name Job name
1255
- * @param schedule Schedule expression (cron syntax or natural language)
1256
- * @param command Command to execute
1257
- * @param timeoutMs Execution timeout in milliseconds (default: 60000)
1258
- */
1259
- createCronJob(name: string, schedule: string, command: string, timeoutMs?: number): Promise<CreateCronJobResponse>;
1260
- /**
1261
- * Get a cron job by ID or name
1262
- * @param id Job ID
1263
- * @param name Job name (alternative to ID)
1264
- */
1265
- getCronJob(id?: string, name?: string): Promise<GetCronJobResponse>;
1266
- /**
1267
- * Update a cron job
1268
- * @param id Job ID
1269
- * @param schedule New schedule expression
1270
- * @param command New command
1271
- * @param timeoutMs New timeout
1272
- */
1273
- updateCronJob(id: string, schedule?: string, command?: string, timeoutMs?: number): Promise<UpdateCronJobResponse>;
1274
- /**
1275
- * Pause a cron job
1276
- * @param id Job ID
1277
- */
1278
- pauseCronJob(id: string): Promise<PauseCronJobResponse>;
1279
- /**
1280
- * Resume a paused cron job
1281
- * @param id Job ID
1282
- */
1283
- resumeCronJob(id: string): Promise<ResumeCronJobResponse>;
1284
- /**
1285
- * Delete a cron job
1286
- * @param id Job ID
1287
- */
1288
- deleteCronJob(id: string): Promise<DeleteCronJobResponse>;
1289
- /**
1290
- * Get execution history for a cron job
1291
- * @param id Job ID
1292
- * @param limit Max records to return (default: 10)
1293
- */
1294
- getCronHistory(id: string, limit?: number): Promise<GetCronHistoryResponse>;
1295
- /**
1296
- * Manually run a cron job
1297
- * @param id Job ID
1298
- */
1299
- runCronJob(id: string): Promise<RunCronJobResponse>;
1300
- /**
1301
- * Parse natural language schedule to cron expression
1302
- * @param input Natural language or cron expression
1303
- */
1304
- parseCronSchedule(input: string): Promise<ParseCronScheduleResponse>;
1305
- getToolMetrics(sessionId?: string, toolName?: string): Promise<GetToolMetricsResponse>;
1306
- getCostSummary(options?: {
1307
- sessionId?: string;
1308
- model?: string;
1309
- startDate?: string;
1310
- endDate?: string;
1311
- }): Promise<GetCostSummaryResponse>;
1312
- /**
1313
- * Run the server-side AgenticLoop (non-streaming).
1314
- * The server executes the full loop: generate → tool call → execute → reflect → repeat.
1315
- */
1316
- agenticGenerate(sessionId: string, prompt: string, options?: {
1317
- strategy?: string;
1318
- maxSteps?: number;
1319
- reflection?: boolean;
1320
- planning?: boolean;
1321
- }): Promise<AgenticGenerateResponse>;
1322
- /**
1323
- * Stream the server-side AgenticLoop.
1324
- * Returns a stream of AgenticGenerateEvent for real-time UI updates.
1325
- */
1326
- streamAgenticGenerate(sessionId: string, prompt: string, options?: {
1327
- strategy?: string;
1328
- maxSteps?: number;
1329
- reflection?: boolean;
1330
- planning?: boolean;
1331
- }): AsyncIterable<AgenticGenerateEvent>;
1332
- /**
1333
- * Delegate a task to a built-in or custom subagent (non-streaming).
1334
- */
1335
- delegate(sessionId: string, agentName: string, task: string, options?: {
1336
- maxSteps?: number;
1337
- allowedTools?: string[];
1338
- }): Promise<DelegateResponse>;
1339
- /**
1340
- * Delegate a task to a subagent with streaming events.
1341
- */
1342
- streamDelegate(sessionId: string, agentName: string, task: string, options?: {
1343
- maxSteps?: number;
1344
- allowedTools?: string[];
1345
- }): AsyncIterable<AgenticGenerateEvent>;
1346
- /**
1347
- * Get per-lane queue statistics for a session.
1348
- */
1349
- getQueueStats(sessionId: string): Promise<GetQueueStatsResponse>;
1350
- /**
1351
- * Load all skills from a directory.
1352
- */
1353
- loadSkillsFromDir(sessionId: string, directory: string, recursive?: boolean): Promise<LoadSkillsFromDirResponse>;
1354
- private streamToAsyncIterable;
1355
- }
1356
- //# sourceMappingURL=client.d.ts.map