@sudocode-ai/types 0.1.18-dev.0 → 0.1.19
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/package.json +1 -1
- package/src/agents.d.ts +72 -2
- package/src/index.d.ts +99 -1
- package/src/voice.d.ts +5 -1
package/package.json
CHANGED
package/src/agents.d.ts
CHANGED
|
@@ -26,8 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Agent types supported for execution
|
|
29
|
+
*
|
|
30
|
+
* ACP-native agents: claude-code, codex, gemini, opencode
|
|
31
|
+
* Legacy agents (via shim): copilot, cursor
|
|
29
32
|
*/
|
|
30
|
-
export type AgentType = "claude-code" | "codex" | "copilot" | "cursor";
|
|
33
|
+
export type AgentType = "claude-code" | "codex" | "gemini" | "opencode" | "copilot" | "cursor";
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Execution modes supported by agents
|
|
@@ -35,6 +38,21 @@ export type AgentType = "claude-code" | "codex" | "copilot" | "cursor";
|
|
|
35
38
|
*/
|
|
36
39
|
export type ExecutionMode = "structured" | "interactive" | "hybrid";
|
|
37
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Configuration for automatic context compaction
|
|
43
|
+
*
|
|
44
|
+
* When enabled, the agent will automatically compact context when
|
|
45
|
+
* the token count exceeds the specified threshold.
|
|
46
|
+
*/
|
|
47
|
+
export interface CompactionConfig {
|
|
48
|
+
/** Whether auto-compaction is enabled */
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
/** Token threshold to trigger compaction (default: 100000) */
|
|
51
|
+
contextTokenThreshold?: number;
|
|
52
|
+
/** Custom instructions for the compaction summary */
|
|
53
|
+
customInstructions?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
38
56
|
/**
|
|
39
57
|
* Base configuration options that all agents should support
|
|
40
58
|
* Aligns with BaseAgentConfig from agent-execution-engine
|
|
@@ -156,6 +174,18 @@ export interface ClaudeCodeConfig extends BaseAgentConfig {
|
|
|
156
174
|
* the executor will use the bundled hook script from agent-execution-engine.
|
|
157
175
|
*/
|
|
158
176
|
directoryGuardHookPath?: string;
|
|
177
|
+
|
|
178
|
+
// === Compaction Configuration ===
|
|
179
|
+
/**
|
|
180
|
+
* Auto-compaction configuration for managing context tokens
|
|
181
|
+
*
|
|
182
|
+
* When enabled, the agent will automatically compact context when
|
|
183
|
+
* the token count exceeds the specified threshold. This helps prevent
|
|
184
|
+
* errors in long conversations.
|
|
185
|
+
*
|
|
186
|
+
* @default { enabled: false }
|
|
187
|
+
*/
|
|
188
|
+
compaction?: CompactionConfig;
|
|
159
189
|
}
|
|
160
190
|
|
|
161
191
|
/**
|
|
@@ -268,6 +298,44 @@ export interface CursorConfig extends BaseAgentConfig {
|
|
|
268
298
|
prompt?: string;
|
|
269
299
|
}
|
|
270
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Google Gemini Code Assist configuration
|
|
303
|
+
*/
|
|
304
|
+
export interface GeminiConfig extends BaseAgentConfig {
|
|
305
|
+
/** Path to gemini CLI executable */
|
|
306
|
+
geminiPath?: string;
|
|
307
|
+
/** Model to use (e.g., 'gemini-2.0-flash', 'gemini-2.0-pro') */
|
|
308
|
+
model?: string;
|
|
309
|
+
/** Maximum idle time before cleanup */
|
|
310
|
+
idleTimeout?: number;
|
|
311
|
+
/** Retry configuration for failed spawns */
|
|
312
|
+
retry?: {
|
|
313
|
+
maxAttempts: number;
|
|
314
|
+
backoffMs: number;
|
|
315
|
+
};
|
|
316
|
+
/** Prompt to send to Gemini */
|
|
317
|
+
prompt?: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Opencode configuration
|
|
322
|
+
*/
|
|
323
|
+
export interface OpencodeConfig extends BaseAgentConfig {
|
|
324
|
+
/** Path to opencode CLI executable */
|
|
325
|
+
opencodePath?: string;
|
|
326
|
+
/** Model to use */
|
|
327
|
+
model?: string;
|
|
328
|
+
/** Maximum idle time before cleanup */
|
|
329
|
+
idleTimeout?: number;
|
|
330
|
+
/** Retry configuration for failed spawns */
|
|
331
|
+
retry?: {
|
|
332
|
+
maxAttempts: number;
|
|
333
|
+
backoffMs: number;
|
|
334
|
+
};
|
|
335
|
+
/** Prompt to send to Opencode */
|
|
336
|
+
prompt?: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
271
339
|
/**
|
|
272
340
|
* Discriminated union of all agent configurations
|
|
273
341
|
*/
|
|
@@ -275,4 +343,6 @@ export type AgentConfig =
|
|
|
275
343
|
| ClaudeCodeConfig
|
|
276
344
|
| CodexConfig
|
|
277
345
|
| CopilotConfig
|
|
278
|
-
| CursorConfig
|
|
346
|
+
| CursorConfig
|
|
347
|
+
| GeminiConfig
|
|
348
|
+
| OpencodeConfig;
|
package/src/index.d.ts
CHANGED
|
@@ -286,6 +286,67 @@ export interface EditorConfig {
|
|
|
286
286
|
customCommand?: string;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Deployment configuration for remote development environments
|
|
291
|
+
*/
|
|
292
|
+
export interface DeployConfig {
|
|
293
|
+
/** Deployment provider (currently only Codespaces supported) */
|
|
294
|
+
provider: 'codespaces';
|
|
295
|
+
/** Default branch to deploy from (optional) */
|
|
296
|
+
defaultBranch?: string;
|
|
297
|
+
/** Port number for the server (default: 3000) */
|
|
298
|
+
port: number;
|
|
299
|
+
/** Idle timeout in minutes before auto-shutdown */
|
|
300
|
+
idleTimeout: number;
|
|
301
|
+
/** Keep-alive duration in hours before auto-cleanup */
|
|
302
|
+
keepAliveHours: number;
|
|
303
|
+
/** Machine type/size (e.g., 'basicLinux32gb', 'premiumLinux') */
|
|
304
|
+
machine: string;
|
|
305
|
+
/** Retention period in days before cleanup */
|
|
306
|
+
retentionPeriod: number;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* GitHub Codespaces provider configuration
|
|
311
|
+
*/
|
|
312
|
+
export interface CodespacesProviderConfig {
|
|
313
|
+
/** Default branch to spawn from (optional) */
|
|
314
|
+
defaultBranch?: string;
|
|
315
|
+
/** Port number for the server (default: 3000) */
|
|
316
|
+
port: number;
|
|
317
|
+
/** Idle timeout in minutes before auto-shutdown */
|
|
318
|
+
idleTimeout: number;
|
|
319
|
+
/** Keep-alive duration in hours before auto-cleanup */
|
|
320
|
+
keepAliveHours: number;
|
|
321
|
+
/** Machine type/size (e.g., 'basicLinux32gb', 'premiumLinux') */
|
|
322
|
+
machine: string;
|
|
323
|
+
/** Retention period in days before cleanup */
|
|
324
|
+
retentionPeriod: number;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Coder provider configuration (future support)
|
|
329
|
+
*/
|
|
330
|
+
export interface CoderProviderConfig {
|
|
331
|
+
// Future coder configuration
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Spawn configuration for remote development environments
|
|
336
|
+
* Supports multiple provider configurations
|
|
337
|
+
*/
|
|
338
|
+
export interface SpawnConfig {
|
|
339
|
+
/** Configuration version */
|
|
340
|
+
version: string;
|
|
341
|
+
/** Provider-specific configurations */
|
|
342
|
+
providers: {
|
|
343
|
+
/** GitHub Codespaces configuration (optional) */
|
|
344
|
+
codespaces?: CodespacesProviderConfig;
|
|
345
|
+
/** Coder configuration (optional, future support) */
|
|
346
|
+
coder?: CoderProviderConfig;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
289
350
|
/**
|
|
290
351
|
* Config metadata file structure (.sudocode/config.json)
|
|
291
352
|
*/
|
|
@@ -322,7 +383,7 @@ export type {
|
|
|
322
383
|
*/
|
|
323
384
|
export type ExecutionStatus =
|
|
324
385
|
| "preparing" // Template being prepared
|
|
325
|
-
| "pending" // Created, not yet started
|
|
386
|
+
| "pending" // Created, not yet started / Persistent session waiting for next prompt
|
|
326
387
|
| "running" // Agent executing
|
|
327
388
|
| "paused" // Execution paused (awaiting follow-up)
|
|
328
389
|
| "completed" // Successfully finished
|
|
@@ -330,6 +391,43 @@ export type ExecutionStatus =
|
|
|
330
391
|
| "cancelled" // User cancelled
|
|
331
392
|
| "stopped"; // User stopped (legacy alias for cancelled)
|
|
332
393
|
|
|
394
|
+
/**
|
|
395
|
+
* Session persistence mode for executions
|
|
396
|
+
*
|
|
397
|
+
* - "discrete": Default behavior - one prompt per execution, process terminates after completion
|
|
398
|
+
* - "persistent": Toad-style - process stays alive, multiple prompts to same session
|
|
399
|
+
*/
|
|
400
|
+
export type SessionMode = "discrete" | "persistent";
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Configuration for how a persistent session ends
|
|
404
|
+
*
|
|
405
|
+
* Multiple options can be enabled simultaneously. The session ends when any
|
|
406
|
+
* configured condition is met.
|
|
407
|
+
*/
|
|
408
|
+
export interface SessionEndModeConfig {
|
|
409
|
+
/** End on explicit user action (default: true) */
|
|
410
|
+
explicit?: boolean;
|
|
411
|
+
/** End after idle timeout in milliseconds (0 = disabled, default: 0) */
|
|
412
|
+
idleTimeoutMs?: number;
|
|
413
|
+
/** Pause on agent completion signal, resumable (default: false) */
|
|
414
|
+
pauseOnCompletion?: boolean;
|
|
415
|
+
/** End when WebSocket connection drops (default: false) */
|
|
416
|
+
endOnDisconnect?: boolean;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Session configuration for execution
|
|
421
|
+
*
|
|
422
|
+
* Controls how the agent session lifecycle is managed during execution.
|
|
423
|
+
*/
|
|
424
|
+
export interface ExecutionSessionConfig {
|
|
425
|
+
/** Session persistence mode (default: "discrete") */
|
|
426
|
+
sessionMode?: SessionMode;
|
|
427
|
+
/** How the persistent session ends (only applies when sessionMode: "persistent") */
|
|
428
|
+
sessionEndMode?: SessionEndModeConfig;
|
|
429
|
+
}
|
|
430
|
+
|
|
333
431
|
/**
|
|
334
432
|
* Represents a single agent run on an issue
|
|
335
433
|
* Tracks the full lifecycle of a coding agent execution
|
package/src/voice.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type TTSProvider = "browser" | "kokoro" | "openai";
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
export interface VoiceSettingsConfig {
|
|
47
|
-
/** Whether voice features are enabled (default:
|
|
47
|
+
/** Whether voice features are enabled (default: false) */
|
|
48
48
|
enabled?: boolean;
|
|
49
49
|
/** Speech-to-text settings */
|
|
50
50
|
stt?: {
|
|
@@ -82,6 +82,10 @@ export interface VoiceSettingsConfig {
|
|
|
82
82
|
narrateToolResults?: boolean;
|
|
83
83
|
/** Whether to narrate assistant messages (default: true) */
|
|
84
84
|
narrateAssistantMessages?: boolean;
|
|
85
|
+
/** Whether to only narrate explicit speak tool calls (default: false)
|
|
86
|
+
* When true, ignores narrateToolUse, narrateToolResults, and narrateAssistantMessages
|
|
87
|
+
* and only narrates when the agent explicitly calls the speak tool */
|
|
88
|
+
narrateSpeakOnly?: boolean;
|
|
85
89
|
};
|
|
86
90
|
}
|
|
87
91
|
|