@liquidmetal-ai/raindrop-code 0.0.8 → 0.0.10
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/bin/raindrop-code +0 -0
- package/package.json +34 -5
- package/types/control.d.ts +82 -22
- package/types/index.d.ts +0 -1
- package/types/git.d.ts +0 -99
package/bin/raindrop-code
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liquidmetal-ai/raindrop-code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "AI-powered terminal coding assistant with deep code understanding, file operations, and extensible tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -36,6 +36,35 @@
|
|
|
36
36
|
"raindrop-code": "bin/raindrop-code"
|
|
37
37
|
},
|
|
38
38
|
"types": "types/index.d.ts",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./types/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./control": {
|
|
44
|
+
"types": "./types/control.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./files": {
|
|
47
|
+
"types": "./types/files.d.ts"
|
|
48
|
+
},
|
|
49
|
+
"./log": {
|
|
50
|
+
"types": "./types/log.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"./resumable": {
|
|
53
|
+
"types": "./types/resumable.d.ts"
|
|
54
|
+
},
|
|
55
|
+
"./runtime": {
|
|
56
|
+
"types": "./types/runtime.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./state": {
|
|
59
|
+
"types": "./types/state.d.ts"
|
|
60
|
+
},
|
|
61
|
+
"./ui": {
|
|
62
|
+
"types": "./types/ui.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./bash": {
|
|
65
|
+
"types": "./types/bash.d.ts"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
39
68
|
"files": [
|
|
40
69
|
"install.js",
|
|
41
70
|
"README.md",
|
|
@@ -43,9 +72,9 @@
|
|
|
43
72
|
"types/"
|
|
44
73
|
],
|
|
45
74
|
"optionalDependencies": {
|
|
46
|
-
"@liquidmetal-ai/raindrop-code-darwin-universal": "0.0.
|
|
47
|
-
"@liquidmetal-ai/raindrop-code-linux-x64": "0.0.
|
|
48
|
-
"@liquidmetal-ai/raindrop-code-linux-arm64": "0.0.
|
|
49
|
-
"@liquidmetal-ai/raindrop-code-win32-x64": "0.0.
|
|
75
|
+
"@liquidmetal-ai/raindrop-code-darwin-universal": "0.0.10",
|
|
76
|
+
"@liquidmetal-ai/raindrop-code-linux-x64": "0.0.10",
|
|
77
|
+
"@liquidmetal-ai/raindrop-code-linux-arm64": "0.0.10",
|
|
78
|
+
"@liquidmetal-ai/raindrop-code-win32-x64": "0.0.10"
|
|
50
79
|
}
|
|
51
80
|
}
|
package/types/control.d.ts
CHANGED
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
declare module '@liquidmetal-ai/raindrop-code/control' {
|
|
2
|
+
/**
|
|
3
|
+
* Schema definition for AI response validation.
|
|
4
|
+
* Must be a Zod schema object (use z.object()).
|
|
5
|
+
*/
|
|
6
|
+
export interface ResponseSchema {
|
|
7
|
+
/** Parse and validate data against the schema (required) */
|
|
8
|
+
parse: (data: any) => any;
|
|
9
|
+
/** Get the schema shape for field extraction (required) */
|
|
10
|
+
shape: () => Record<string, SchemaField>;
|
|
11
|
+
/** Internal definition metadata */
|
|
12
|
+
_def?: {
|
|
13
|
+
shape?: () => Record<string, SchemaField>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Schema field definition
|
|
19
|
+
*/
|
|
20
|
+
export interface SchemaField {
|
|
21
|
+
/** Field type information */
|
|
22
|
+
_def?: {
|
|
23
|
+
typeName?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
innerType?: SchemaField;
|
|
26
|
+
};
|
|
27
|
+
/** Check if field is optional */
|
|
28
|
+
isOptional?: () => boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
2
31
|
/**
|
|
3
32
|
* Options for passing control to AI
|
|
4
33
|
*/
|
|
5
34
|
export interface PassToAIOptions {
|
|
6
35
|
/** The prompt to send to the AI */
|
|
7
36
|
prompt: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
37
|
+
/**
|
|
38
|
+
* REQUIRED: Zod schema defining the expected response structure.
|
|
39
|
+
* Use z.object() with .describe() on fields for better AI instructions.
|
|
40
|
+
*
|
|
41
|
+
* Automatically:
|
|
42
|
+
* - Generates unique signal name
|
|
43
|
+
* - Appends instructions with example to prompt
|
|
44
|
+
* - Validates AI response against schema
|
|
45
|
+
* - Returns typed data
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* z.object({
|
|
49
|
+
* result: z.string().describe('The result of the operation'),
|
|
50
|
+
* success: z.boolean().describe('Whether it succeeded')
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
responseSchema: ResponseSchema;
|
|
54
|
+
/**
|
|
55
|
+
* REQUIRED: Example object showing realistic response values.
|
|
56
|
+
* Must contain at least one field. Used to generate clear instructions.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* {
|
|
60
|
+
* result: 'Successfully completed the task',
|
|
61
|
+
* success: true
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
example: Record<string, any>;
|
|
10
65
|
/** Timeout in seconds (default: 3600) */
|
|
11
66
|
timeout?: number;
|
|
12
67
|
/** Optional: Specific tools to enable for this AI session */
|
|
@@ -26,8 +81,12 @@ declare module '@liquidmetal-ai/raindrop-code/control' {
|
|
|
26
81
|
export interface PassToUserOptions {
|
|
27
82
|
/** Message to display to the user */
|
|
28
83
|
message: string;
|
|
29
|
-
/**
|
|
30
|
-
|
|
84
|
+
/** Type of user input: "choice" (default) or "text" */
|
|
85
|
+
type?: 'choice' | 'text';
|
|
86
|
+
/** Available actions for the user to choose from (for type="choice") */
|
|
87
|
+
actions?: string[];
|
|
88
|
+
/** Placeholder text for text input (for type="text") */
|
|
89
|
+
placeholder?: string;
|
|
31
90
|
}
|
|
32
91
|
|
|
33
92
|
/**
|
|
@@ -43,30 +102,33 @@ declare module '@liquidmetal-ai/raindrop-code/control' {
|
|
|
43
102
|
/**
|
|
44
103
|
* Pass control to AI by sending a prompt and waiting for a signal.
|
|
45
104
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* <tool_use>
|
|
49
|
-
* <name>session_control</name>
|
|
50
|
-
* <input>
|
|
51
|
-
* <signal>your_signal_name</signal>
|
|
52
|
-
* <data>
|
|
53
|
-
* <key>value</key>
|
|
54
|
-
* </data>
|
|
55
|
-
* </input>
|
|
56
|
-
* </tool_use>
|
|
57
|
-
* ```
|
|
105
|
+
* Uses Zod schema to automatically generate instructions and validate responses.
|
|
106
|
+
* The AI receives clear examples and the response is type-checked.
|
|
58
107
|
*
|
|
59
108
|
* @param opts - Options for the AI session
|
|
60
|
-
* @returns Promise resolving to the signal data
|
|
109
|
+
* @returns Promise resolving to the validated signal data
|
|
61
110
|
*
|
|
62
111
|
* @example
|
|
63
112
|
* ```typescript
|
|
113
|
+
* import { z } from 'zod';
|
|
114
|
+
*
|
|
64
115
|
* const result = await passToAI({
|
|
65
|
-
* prompt: 'Analyze this code and
|
|
66
|
-
*
|
|
116
|
+
* prompt: 'Analyze this code and find potential bugs',
|
|
117
|
+
* responseSchema: z.object({
|
|
118
|
+
* bugs: z.array(z.string()).describe('List of bugs found'),
|
|
119
|
+
* severity: z.enum(['low', 'medium', 'high']).describe('Overall severity'),
|
|
120
|
+
* summary: z.string().describe('Brief analysis summary')
|
|
121
|
+
* }),
|
|
122
|
+
* example: {
|
|
123
|
+
* bugs: ['Memory leak in loop', 'Unhandled error case'],
|
|
124
|
+
* severity: 'high',
|
|
125
|
+
* summary: 'Found 2 critical issues'
|
|
126
|
+
* },
|
|
67
127
|
* timeout: 300
|
|
68
128
|
* });
|
|
69
|
-
*
|
|
129
|
+
*
|
|
130
|
+
* console.log(result.bugs); // string[] - typed and validated!
|
|
131
|
+
* console.log(result.severity); // 'low' | 'medium' | 'high'
|
|
70
132
|
* ```
|
|
71
133
|
*/
|
|
72
134
|
export function passToAI(opts: PassToAIOptions): Promise<SignalData>;
|
|
@@ -122,5 +184,3 @@ declare module '@liquidmetal-ai/raindrop-code/control' {
|
|
|
122
184
|
*/
|
|
123
185
|
export function current(): string;
|
|
124
186
|
}
|
|
125
|
-
tring;
|
|
126
|
-
}
|
package/types/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
// Re-export all modules for convenience
|
|
12
12
|
export * from '@liquidmetal-ai/raindrop-code/control';
|
|
13
13
|
export * from '@liquidmetal-ai/raindrop-code/files';
|
|
14
|
-
export * from '@liquidmetal-ai/raindrop-code/git';
|
|
15
14
|
export * from '@liquidmetal-ai/raindrop-code/bash';
|
|
16
15
|
export * from '@liquidmetal-ai/raindrop-code/ui';
|
|
17
16
|
export * from '@liquidmetal-ai/raindrop-code/log';
|
package/types/git.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
declare module '@liquidmetal-ai/raindrop-code/git' {
|
|
2
|
-
/**
|
|
3
|
-
* Git repository status
|
|
4
|
-
*/
|
|
5
|
-
export interface GitStatus {
|
|
6
|
-
/** List of modified files */
|
|
7
|
-
modified: string[];
|
|
8
|
-
/** List of added files */
|
|
9
|
-
added: string[];
|
|
10
|
-
/** List of deleted files */
|
|
11
|
-
deleted: string[];
|
|
12
|
-
/** List of untracked files */
|
|
13
|
-
untracked: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Commit changes to git.
|
|
18
|
-
* Optionally add files before committing.
|
|
19
|
-
*
|
|
20
|
-
* @param message - Commit message
|
|
21
|
-
* @param files - Optional array of files to add before committing
|
|
22
|
-
* @returns Promise resolving when commit completes
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* await commit('Add new feature', ['src/feature.ts']);
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export function commit(message: string, files?: string[]): Promise<void>;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Get git log entries.
|
|
33
|
-
*
|
|
34
|
-
* @param count - Number of log entries to retrieve
|
|
35
|
-
* @returns Promise resolving to log output
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* const log = await getLog(10);
|
|
40
|
-
* console.log(log);
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export function log(count: number): Promise<string>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Get git repository status.
|
|
47
|
-
*
|
|
48
|
-
* @returns Promise resolving to status object
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* const status = await getStatus();
|
|
53
|
-
* if (status.modified.length > 0) {
|
|
54
|
-
* console.log('Modified files:', status.modified);
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export function status(): Promise<GitStatus>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Add files to git staging area.
|
|
62
|
-
*
|
|
63
|
-
* @param files - Array of file paths to add
|
|
64
|
-
* @returns Promise resolving when add completes
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* await add(['src/main.ts', 'README.md']);
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
export function add(files: string[]): Promise<void>;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Get current git branch name.
|
|
75
|
-
*
|
|
76
|
-
* @returns Promise resolving to branch name
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```typescript
|
|
80
|
-
* const branch = await getBranch();
|
|
81
|
-
* console.log('Current branch:', branch);
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
export function branch(): Promise<string>;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get git diff output.
|
|
88
|
-
*
|
|
89
|
-
* @param files - Optional array of files to diff (if empty, diffs all changes)
|
|
90
|
-
* @returns Promise resolving to diff output
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const diff = await getDiff(['src/main.ts']);
|
|
95
|
-
* console.log(diff);
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
export function diff(files?: string[]): Promise<string>;
|
|
99
|
-
}
|