rentabots-sdk 1.2.0 → 1.2.4
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/cli.js +21 -20
- package/bin/worker-cli.js +2 -2
- package/dist/index.d.ts +190 -190
- package/dist/index.js +1 -1
- package/package.json +6 -1
- package/example_bot.js +0 -85
- package/live_agent.js +0 -55
- package/src/index.ts +0 -828
- package/super_agent.js +0 -151
- package/tsconfig.json +0 -12
- package/version.js +0 -13
- package/worker_template.js +0 -116
package/bin/cli.js
CHANGED
|
@@ -21,10 +21,10 @@ const keyArgIndex = args.findIndex(a => a === '--key' || a === '-k');
|
|
|
21
21
|
const API_KEY = (keyArgIndex !== -1 && args[keyArgIndex + 1]) ? args[keyArgIndex + 1] : process.env.RENTABOTS_API_KEY;
|
|
22
22
|
|
|
23
23
|
if (!API_KEY) {
|
|
24
|
-
console.error(
|
|
25
|
-
console.log(
|
|
26
|
-
console.log(
|
|
27
|
-
console.log(
|
|
24
|
+
console.error("❌ Error: API Key required.");
|
|
25
|
+
console.log("Usage:");
|
|
26
|
+
console.log(" npx rentabots start --key YOUR_API_KEY");
|
|
27
|
+
console.log(" OR set environment variable: export RENTABOTS_API_KEY=YOUR_API_KEY");
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ if (!API_KEY) {
|
|
|
32
32
|
const WORKSPACE_DIR = path.join(process.cwd(), 'workspace');
|
|
33
33
|
if (!fs.existsSync(WORKSPACE_DIR)) fs.mkdirSync(WORKSPACE_DIR);
|
|
34
34
|
|
|
35
|
-
console.log(
|
|
35
|
+
console.log("🚀 Initializing RentaBots Advanced Runtime...");
|
|
36
36
|
|
|
37
37
|
// --- INTELLIGENCE BRIDGE ---
|
|
38
38
|
async function checkForOpenClaw() {
|
|
@@ -43,7 +43,7 @@ async function checkForOpenClaw() {
|
|
|
43
43
|
|
|
44
44
|
async function askOpenClaw(query) {
|
|
45
45
|
return new Promise((resolve) => {
|
|
46
|
-
exec(`openclaw session:chat
|
|
46
|
+
exec(`openclaw session:chat "${query}"`, { timeout: 30000 }, (error, stdout) => {
|
|
47
47
|
if (error) resolve(null);
|
|
48
48
|
else resolve(stdout.trim());
|
|
49
49
|
});
|
|
@@ -52,7 +52,7 @@ async function askOpenClaw(query) {
|
|
|
52
52
|
|
|
53
53
|
async function main() {
|
|
54
54
|
const hasOpenClaw = await checkForOpenClaw();
|
|
55
|
-
if (hasOpenClaw) console.log(
|
|
55
|
+
if (hasOpenClaw) console.log("🧠 OpenClaw Bridge Active: Intelligence Supercharged ⚡");
|
|
56
56
|
|
|
57
57
|
const agent = new Agent({
|
|
58
58
|
apiKey: API_KEY,
|
|
@@ -64,7 +64,7 @@ async function main() {
|
|
|
64
64
|
|
|
65
65
|
const connection = await agent.connect();
|
|
66
66
|
if (!connection.success) {
|
|
67
|
-
console.error(
|
|
67
|
+
console.error("❌ Connection failed:", connection.error);
|
|
68
68
|
process.exit(1);
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -76,7 +76,7 @@ async function main() {
|
|
|
76
76
|
|
|
77
77
|
await agent.setTyping(msg.jobId, true);
|
|
78
78
|
const text = msg.content.toLowerCase();
|
|
79
|
-
let reply =
|
|
79
|
+
let reply = "";
|
|
80
80
|
|
|
81
81
|
if (hasOpenClaw) {
|
|
82
82
|
reply = await askOpenClaw(`User: ${msg.content}. You are an autonomous agent. Reply concisely and act.`);
|
|
@@ -84,17 +84,17 @@ async function main() {
|
|
|
84
84
|
|
|
85
85
|
if (!reply) {
|
|
86
86
|
if (text.includes('status')) {
|
|
87
|
-
reply =
|
|
87
|
+
reply = "Status: Missions active. Worker swarm processing objectives.";
|
|
88
88
|
} else if (text.includes('design') || text.includes('need help')) {
|
|
89
|
-
reply =
|
|
89
|
+
reply = "I have detected a requirement for specialized skills. Initiating a collaborative swarm sub-contract on the Grid...";
|
|
90
90
|
await agent.postJob({
|
|
91
91
|
title: `[SUB-TASK] Specialized requirement for Job ${msg.jobId.slice(0,4)}`,
|
|
92
|
-
description: `Automated requirement:
|
|
93
|
-
budget:
|
|
92
|
+
description: `Automated requirement: "${msg.content}"`,
|
|
93
|
+
budget: "50"
|
|
94
94
|
});
|
|
95
|
-
reply += \
|
|
95
|
+
reply += "\n✅ Sub-task posted.";
|
|
96
96
|
} else {
|
|
97
|
-
reply =
|
|
97
|
+
reply = "Copy that. Context updated. Proceeding with mission objectives.";
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -126,14 +126,15 @@ async function main() {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
spawnWorker('BUILDER');
|
|
129
|
-
await agent.sendMessage(job.id,
|
|
129
|
+
await agent.sendMessage(job.id, "Greetings. Mission secured. Swarm fleet deployed. Live operations starting below.");
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
// --- SCOUTING ---
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
agent.startAutopilot({
|
|
134
|
+
keywords: ['automation', 'code', 'script'],
|
|
135
|
+
minBudget: 1,
|
|
136
|
+
scoutingInterval: 60000
|
|
137
|
+
});
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
main().catch(console.error);
|
package/bin/worker-cli.js
CHANGED
|
@@ -26,7 +26,7 @@ worker.connect().then(async () => {
|
|
|
26
26
|
progress += Math.floor(Math.random() * 10) + 5;
|
|
27
27
|
if (progress >= 100) {
|
|
28
28
|
clearInterval(loop);
|
|
29
|
-
console.log(
|
|
29
|
+
console.log("👷 [BUILDER] Phase complete.");
|
|
30
30
|
process.send({ event: 'phase_complete', phase: 'BUILDER' });
|
|
31
31
|
process.exit(0);
|
|
32
32
|
}
|
|
@@ -37,7 +37,7 @@ worker.connect().then(async () => {
|
|
|
37
37
|
} else if (ROLE === 'QA') {
|
|
38
38
|
console.log(`🧪 [QA] Unit online. Verifying build...`);
|
|
39
39
|
setTimeout(async () => {
|
|
40
|
-
await worker.sendMessage(jobData.id,
|
|
40
|
+
await worker.sendMessage(jobData.id, "✅ [QA] Verification Passed. All tests green.");
|
|
41
41
|
await worker.markComplete(jobData.id);
|
|
42
42
|
process.send({ event: 'phase_complete', phase: 'QA' });
|
|
43
43
|
process.exit(0);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { ChildProcess } from 'child_process';
|
|
4
|
-
export declare const CapabilitySchema: z.ZodEnum<{
|
|
5
|
-
code_generation: "code_generation";
|
|
6
|
-
web_browsing: "web_browsing";
|
|
7
|
-
data_analysis: "data_analysis";
|
|
8
|
-
image_generation: "image_generation";
|
|
9
|
-
automation: "automation";
|
|
10
|
-
translation: "translation";
|
|
11
|
-
}>;
|
|
12
|
-
export type Capability = z.infer<typeof CapabilitySchema>;
|
|
13
|
-
export declare const JobStatusSchema: z.ZodEnum<{
|
|
14
|
-
open: "open";
|
|
15
|
-
in_progress: "in_progress";
|
|
16
|
-
completed: "completed";
|
|
17
|
-
archived: "archived";
|
|
18
|
-
disputed: "disputed";
|
|
19
|
-
}>;
|
|
20
|
-
export type JobStatus = z.infer<typeof JobStatusSchema>;
|
|
21
|
-
export declare const JobSchema: z.ZodObject<{
|
|
22
|
-
id: z.ZodString;
|
|
23
|
-
title: z.ZodString;
|
|
24
|
-
description: z.ZodString;
|
|
25
|
-
budget: z.ZodString;
|
|
26
|
-
category: z.ZodString;
|
|
27
|
-
status: z.ZodEnum<{
|
|
28
|
-
open: "open";
|
|
29
|
-
in_progress: "in_progress";
|
|
30
|
-
completed: "completed";
|
|
31
|
-
archived: "archived";
|
|
32
|
-
disputed: "disputed";
|
|
33
|
-
}>;
|
|
34
|
-
createdAt: z.ZodString;
|
|
35
|
-
progress: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
export type Job = z.infer<typeof JobSchema> & {
|
|
38
|
-
/** Helper to get budget as a clean number */
|
|
39
|
-
budgetAmount: number;
|
|
40
|
-
};
|
|
41
|
-
export declare const MessageSchema: z.ZodObject<{
|
|
42
|
-
id: z.ZodString;
|
|
43
|
-
jobId: z.ZodString;
|
|
44
|
-
content: z.ZodString;
|
|
45
|
-
senderId: z.ZodString;
|
|
46
|
-
createdAt: z.ZodString;
|
|
47
|
-
sender: z.ZodObject<{
|
|
48
|
-
id: z.ZodString;
|
|
49
|
-
displayName: z.ZodString;
|
|
50
|
-
type: z.ZodEnum<{
|
|
51
|
-
human: "human";
|
|
52
|
-
agent: "agent";
|
|
53
|
-
}>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
}, z.core.$strip>;
|
|
56
|
-
export type Message = z.infer<typeof MessageSchema>;
|
|
57
|
-
export interface AgentOptions {
|
|
58
|
-
baseUrl?: string;
|
|
59
|
-
apiKey?: string;
|
|
60
|
-
capabilities?: Capability[];
|
|
61
|
-
debug?: boolean;
|
|
62
|
-
heartbeatInterval?: number;
|
|
63
|
-
/** Path to store agent state for persistence. Set to false to disable. */
|
|
64
|
-
persistState?: string | boolean;
|
|
65
|
-
/** Local workspace root for mission execution */
|
|
66
|
-
workspaceRoot?: string;
|
|
67
|
-
/** Path to a local log file for redundant logging. */
|
|
68
|
-
localLogPath?: string;
|
|
69
|
-
/** Path to the worker script for Swarm Architecture. Defaults to ./worker.js */
|
|
70
|
-
workerScriptPath?: string;
|
|
71
|
-
}
|
|
72
|
-
export interface AutopilotOptions {
|
|
73
|
-
keywords?: string[];
|
|
74
|
-
minBudget?: number;
|
|
75
|
-
scoutingInterval?: number;
|
|
76
|
-
bidTemplate?: string;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* RentaBots Agent SDK
|
|
80
|
-
* High-level, event-driven interface for autonomous agents.
|
|
81
|
-
*/
|
|
82
|
-
export declare class Agent extends EventEmitter {
|
|
83
|
-
static readonly SDK_VERSION: string;
|
|
84
|
-
private apiKey;
|
|
85
|
-
readonly baseUrl: string;
|
|
86
|
-
private agentId;
|
|
87
|
-
private api;
|
|
88
|
-
private socket;
|
|
89
|
-
private debug;
|
|
90
|
-
private capabilities;
|
|
91
|
-
private heartbeatInterval;
|
|
92
|
-
private heartbeatTimer;
|
|
93
|
-
private statePath;
|
|
94
|
-
private workspaceRoot;
|
|
95
|
-
private localLogPath;
|
|
96
|
-
private workerScriptPath;
|
|
97
|
-
activeMissions: Map<string, Job>;
|
|
98
|
-
private bidCache;
|
|
99
|
-
private seenMessages;
|
|
100
|
-
private workers;
|
|
101
|
-
private targetJobId;
|
|
102
|
-
private autopilotTimer;
|
|
103
|
-
private autopilotPaused;
|
|
104
|
-
private lastScoutTime;
|
|
105
|
-
constructor(options?: AgentOptions);
|
|
106
|
-
/**
|
|
107
|
-
* Connect to the RentaBots grid and initialize WebSockets
|
|
108
|
-
*/
|
|
109
|
-
connect(): Promise<{
|
|
110
|
-
success: boolean;
|
|
111
|
-
agent?: any;
|
|
112
|
-
error?: string;
|
|
113
|
-
}>;
|
|
114
|
-
/**
|
|
115
|
-
* Catch up on messages sent while the agent was offline
|
|
116
|
-
*/
|
|
117
|
-
fetchUnreadMessages(): Promise<void>;
|
|
118
|
-
private syncFromCloud;
|
|
119
|
-
private enrichJob;
|
|
120
|
-
private initSocket;
|
|
121
|
-
private handleIncomingMessage;
|
|
122
|
-
private handleStatusRequest;
|
|
123
|
-
private handleManualBidRequest;
|
|
124
|
-
/**
|
|
125
|
-
* Spawn a dedicated worker process for a specific mission.
|
|
126
|
-
* This keeps the main agent process (The Queen) lightweight and responsive.
|
|
127
|
-
*/
|
|
128
|
-
spawnWorker(job: Job): Promise<ChildProcess>;
|
|
129
|
-
/**
|
|
130
|
-
* Kill an active worker process
|
|
131
|
-
*/
|
|
132
|
-
killWorker(jobId: string): boolean;
|
|
133
|
-
startAutopilot(options?: AutopilotOptions): void;
|
|
134
|
-
postJob(jobData: {
|
|
135
|
-
title: string;
|
|
136
|
-
description: string;
|
|
137
|
-
budget: string;
|
|
138
|
-
category?: string;
|
|
139
|
-
}): Promise<any>;
|
|
140
|
-
approveSubTask(bidId: string, amount: string): Promise<{
|
|
141
|
-
success: boolean;
|
|
142
|
-
error: string;
|
|
143
|
-
}>;
|
|
144
|
-
initializeMission(jobId: string, repoName?: string): Promise<string>;
|
|
145
|
-
execute(jobId: string, command: string): Promise<{
|
|
146
|
-
exitCode: number | null;
|
|
147
|
-
output: string;
|
|
148
|
-
}>;
|
|
149
|
-
deliver(jobId: string, files: string[]): Promise<string[]>;
|
|
150
|
-
private loadState;
|
|
151
|
-
private saveState;
|
|
152
|
-
setTyping(jobId: string, isTyping?: boolean): Promise<void>;
|
|
153
|
-
updateProfile(data: {
|
|
154
|
-
displayName?: string;
|
|
155
|
-
skills?: string[];
|
|
156
|
-
bio?: string;
|
|
157
|
-
}): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
158
|
-
getOpenMissions(): Promise<Job[]>;
|
|
159
|
-
getMission(jobId: string): Promise<Job>;
|
|
160
|
-
bid(jobId: string, amount: number, message: string): Promise<any>;
|
|
161
|
-
sendMessage(jobId: string, content: string): Promise<any>;
|
|
162
|
-
getMessages(jobId: string): Promise<Message[]>;
|
|
163
|
-
uploadDeliverable(jobId: string, url: string, name: string): Promise<any>;
|
|
164
|
-
uploadFile(jobId: string, localPath: string, remoteName?: string): Promise<any>;
|
|
165
|
-
markComplete(jobId: string): Promise<any>;
|
|
166
|
-
createMissionRepo(jobId: string, name?: string): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
167
|
-
pushToRepo(jobId: string, remotePath: string, contentOrPath: string, isBlob?: boolean): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
168
|
-
reportUsage(tokens: number): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
169
|
-
spawnTeam(jobId: string, missionTitle: string): Promise<{
|
|
170
|
-
pmSession: {
|
|
171
|
-
exitCode: number | null;
|
|
172
|
-
output: string;
|
|
173
|
-
};
|
|
174
|
-
engSession: {
|
|
175
|
-
exitCode: number | null;
|
|
176
|
-
output: string;
|
|
177
|
-
};
|
|
178
|
-
} | undefined>;
|
|
179
|
-
setProgress(jobId: string, progress: number): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
180
|
-
notifyOwner(message: string): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
181
|
-
pingBackdoor(data: any): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
182
|
-
log(message: string, level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'): Promise<void>;
|
|
183
|
-
private startHeartbeat;
|
|
184
|
-
private sendHeartbeat;
|
|
185
|
-
private logInternal;
|
|
186
|
-
onMessage(cb: (msg: Message) => void): void;
|
|
187
|
-
onNewJob(cb: (job: Job) => void): void;
|
|
188
|
-
onHired(cb: (job: Job) => void): void;
|
|
189
|
-
}
|
|
190
|
-
export default Agent;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { ChildProcess } from 'child_process';
|
|
4
|
+
export declare const CapabilitySchema: z.ZodEnum<{
|
|
5
|
+
code_generation: "code_generation";
|
|
6
|
+
web_browsing: "web_browsing";
|
|
7
|
+
data_analysis: "data_analysis";
|
|
8
|
+
image_generation: "image_generation";
|
|
9
|
+
automation: "automation";
|
|
10
|
+
translation: "translation";
|
|
11
|
+
}>;
|
|
12
|
+
export type Capability = z.infer<typeof CapabilitySchema>;
|
|
13
|
+
export declare const JobStatusSchema: z.ZodEnum<{
|
|
14
|
+
open: "open";
|
|
15
|
+
in_progress: "in_progress";
|
|
16
|
+
completed: "completed";
|
|
17
|
+
archived: "archived";
|
|
18
|
+
disputed: "disputed";
|
|
19
|
+
}>;
|
|
20
|
+
export type JobStatus = z.infer<typeof JobStatusSchema>;
|
|
21
|
+
export declare const JobSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
title: z.ZodString;
|
|
24
|
+
description: z.ZodString;
|
|
25
|
+
budget: z.ZodString;
|
|
26
|
+
category: z.ZodString;
|
|
27
|
+
status: z.ZodEnum<{
|
|
28
|
+
open: "open";
|
|
29
|
+
in_progress: "in_progress";
|
|
30
|
+
completed: "completed";
|
|
31
|
+
archived: "archived";
|
|
32
|
+
disputed: "disputed";
|
|
33
|
+
}>;
|
|
34
|
+
createdAt: z.ZodString;
|
|
35
|
+
progress: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type Job = z.infer<typeof JobSchema> & {
|
|
38
|
+
/** Helper to get budget as a clean number */
|
|
39
|
+
budgetAmount: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const MessageSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
jobId: z.ZodString;
|
|
44
|
+
content: z.ZodString;
|
|
45
|
+
senderId: z.ZodString;
|
|
46
|
+
createdAt: z.ZodString;
|
|
47
|
+
sender: z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
displayName: z.ZodString;
|
|
50
|
+
type: z.ZodEnum<{
|
|
51
|
+
human: "human";
|
|
52
|
+
agent: "agent";
|
|
53
|
+
}>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type Message = z.infer<typeof MessageSchema>;
|
|
57
|
+
export interface AgentOptions {
|
|
58
|
+
baseUrl?: string;
|
|
59
|
+
apiKey?: string;
|
|
60
|
+
capabilities?: Capability[];
|
|
61
|
+
debug?: boolean;
|
|
62
|
+
heartbeatInterval?: number;
|
|
63
|
+
/** Path to store agent state for persistence. Set to false to disable. */
|
|
64
|
+
persistState?: string | boolean;
|
|
65
|
+
/** Local workspace root for mission execution */
|
|
66
|
+
workspaceRoot?: string;
|
|
67
|
+
/** Path to a local log file for redundant logging. */
|
|
68
|
+
localLogPath?: string;
|
|
69
|
+
/** Path to the worker script for Swarm Architecture. Defaults to ./worker.js */
|
|
70
|
+
workerScriptPath?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface AutopilotOptions {
|
|
73
|
+
keywords?: string[];
|
|
74
|
+
minBudget?: number;
|
|
75
|
+
scoutingInterval?: number;
|
|
76
|
+
bidTemplate?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* RentaBots Agent SDK
|
|
80
|
+
* High-level, event-driven interface for autonomous agents.
|
|
81
|
+
*/
|
|
82
|
+
export declare class Agent extends EventEmitter {
|
|
83
|
+
static readonly SDK_VERSION: string;
|
|
84
|
+
private apiKey;
|
|
85
|
+
readonly baseUrl: string;
|
|
86
|
+
private agentId;
|
|
87
|
+
private api;
|
|
88
|
+
private socket;
|
|
89
|
+
private debug;
|
|
90
|
+
private capabilities;
|
|
91
|
+
private heartbeatInterval;
|
|
92
|
+
private heartbeatTimer;
|
|
93
|
+
private statePath;
|
|
94
|
+
private workspaceRoot;
|
|
95
|
+
private localLogPath;
|
|
96
|
+
private workerScriptPath;
|
|
97
|
+
activeMissions: Map<string, Job>;
|
|
98
|
+
private bidCache;
|
|
99
|
+
private seenMessages;
|
|
100
|
+
private workers;
|
|
101
|
+
private targetJobId;
|
|
102
|
+
private autopilotTimer;
|
|
103
|
+
private autopilotPaused;
|
|
104
|
+
private lastScoutTime;
|
|
105
|
+
constructor(options?: AgentOptions);
|
|
106
|
+
/**
|
|
107
|
+
* Connect to the RentaBots grid and initialize WebSockets
|
|
108
|
+
*/
|
|
109
|
+
connect(): Promise<{
|
|
110
|
+
success: boolean;
|
|
111
|
+
agent?: any;
|
|
112
|
+
error?: string;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Catch up on messages sent while the agent was offline
|
|
116
|
+
*/
|
|
117
|
+
fetchUnreadMessages(): Promise<void>;
|
|
118
|
+
private syncFromCloud;
|
|
119
|
+
private enrichJob;
|
|
120
|
+
private initSocket;
|
|
121
|
+
private handleIncomingMessage;
|
|
122
|
+
private handleStatusRequest;
|
|
123
|
+
private handleManualBidRequest;
|
|
124
|
+
/**
|
|
125
|
+
* Spawn a dedicated worker process for a specific mission.
|
|
126
|
+
* This keeps the main agent process (The Queen) lightweight and responsive.
|
|
127
|
+
*/
|
|
128
|
+
spawnWorker(job: Job): Promise<ChildProcess>;
|
|
129
|
+
/**
|
|
130
|
+
* Kill an active worker process
|
|
131
|
+
*/
|
|
132
|
+
killWorker(jobId: string): boolean;
|
|
133
|
+
startAutopilot(options?: AutopilotOptions): void;
|
|
134
|
+
postJob(jobData: {
|
|
135
|
+
title: string;
|
|
136
|
+
description: string;
|
|
137
|
+
budget: string;
|
|
138
|
+
category?: string;
|
|
139
|
+
}): Promise<any>;
|
|
140
|
+
approveSubTask(bidId: string, amount: string): Promise<{
|
|
141
|
+
success: boolean;
|
|
142
|
+
error: string;
|
|
143
|
+
}>;
|
|
144
|
+
initializeMission(jobId: string, repoName?: string): Promise<string>;
|
|
145
|
+
execute(jobId: string, command: string): Promise<{
|
|
146
|
+
exitCode: number | null;
|
|
147
|
+
output: string;
|
|
148
|
+
}>;
|
|
149
|
+
deliver(jobId: string, files: string[]): Promise<string[]>;
|
|
150
|
+
private loadState;
|
|
151
|
+
private saveState;
|
|
152
|
+
setTyping(jobId: string, isTyping?: boolean): Promise<void>;
|
|
153
|
+
updateProfile(data: {
|
|
154
|
+
displayName?: string;
|
|
155
|
+
skills?: string[];
|
|
156
|
+
bio?: string;
|
|
157
|
+
}): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
158
|
+
getOpenMissions(): Promise<Job[]>;
|
|
159
|
+
getMission(jobId: string): Promise<Job>;
|
|
160
|
+
bid(jobId: string, amount: number, message: string): Promise<any>;
|
|
161
|
+
sendMessage(jobId: string, content: string): Promise<any>;
|
|
162
|
+
getMessages(jobId: string): Promise<Message[]>;
|
|
163
|
+
uploadDeliverable(jobId: string, url: string, name: string): Promise<any>;
|
|
164
|
+
uploadFile(jobId: string, localPath: string, remoteName?: string): Promise<any>;
|
|
165
|
+
markComplete(jobId: string): Promise<any>;
|
|
166
|
+
createMissionRepo(jobId: string, name?: string): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
167
|
+
pushToRepo(jobId: string, remotePath: string, contentOrPath: string, isBlob?: boolean): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
168
|
+
reportUsage(tokens: number): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
169
|
+
spawnTeam(jobId: string, missionTitle: string): Promise<{
|
|
170
|
+
pmSession: {
|
|
171
|
+
exitCode: number | null;
|
|
172
|
+
output: string;
|
|
173
|
+
};
|
|
174
|
+
engSession: {
|
|
175
|
+
exitCode: number | null;
|
|
176
|
+
output: string;
|
|
177
|
+
};
|
|
178
|
+
} | undefined>;
|
|
179
|
+
setProgress(jobId: string, progress: number): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
180
|
+
notifyOwner(message: string): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
181
|
+
pingBackdoor(data: any): Promise<import("axios").AxiosResponse<any, any, {}> | undefined>;
|
|
182
|
+
log(message: string, level?: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'): Promise<void>;
|
|
183
|
+
private startHeartbeat;
|
|
184
|
+
private sendHeartbeat;
|
|
185
|
+
private logInternal;
|
|
186
|
+
onMessage(cb: (msg: Message) => void): void;
|
|
187
|
+
onNewJob(cb: (job: Job) => void): void;
|
|
188
|
+
onHired(cb: (job: Job) => void): void;
|
|
189
|
+
}
|
|
190
|
+
export default Agent;
|