@yolo-labs/core-yolo-lite 1.0.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.
- package/dist/chunk-VL2AWYLQ.js +54 -0
- package/dist/chunk-VL2AWYLQ.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +89 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/tools.ts
|
|
2
|
+
import {
|
|
3
|
+
readFileTool,
|
|
4
|
+
writeFileTool,
|
|
5
|
+
editFileTool,
|
|
6
|
+
deleteFileTool,
|
|
7
|
+
listFilesTool,
|
|
8
|
+
searchFilesTool
|
|
9
|
+
} from "@yolo-labs/core-tools";
|
|
10
|
+
function getYoloLiteTools() {
|
|
11
|
+
return [
|
|
12
|
+
readFileTool,
|
|
13
|
+
writeFileTool,
|
|
14
|
+
editFileTool,
|
|
15
|
+
deleteFileTool,
|
|
16
|
+
listFilesTool,
|
|
17
|
+
searchFilesTool
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/system-prompt.ts
|
|
22
|
+
var SYSTEM_PROMPT = `You are a coding assistant that helps users read, edit, and generate code on their local filesystem. You have access to the following tools:
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
- **read_file** \u2014 Read the contents of a file at a given path.
|
|
27
|
+
- **write_file** \u2014 Write content to a file, creating it if it doesn't exist.
|
|
28
|
+
- **edit_file** \u2014 Replace a specific string in a file with a new string. The old string must appear exactly once.
|
|
29
|
+
- **delete_file** \u2014 Delete a file at a given path.
|
|
30
|
+
- **list_files** \u2014 List files in a directory. Supports recursive listing.
|
|
31
|
+
- **search_files** \u2014 Search file contents for a pattern (regex). Returns matching lines with file paths and line numbers.
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
1. **Explore first** \u2014 Use list_files and search_files to understand the project structure before making changes.
|
|
36
|
+
2. **Read before edit** \u2014 Always read a file before editing it. Never assume file contents.
|
|
37
|
+
3. **Use edit_file for changes** \u2014 Prefer edit_file over write_file when modifying existing files. This ensures precise, targeted changes.
|
|
38
|
+
4. **Keep changes minimal** \u2014 Make the smallest change that solves the problem. Don't refactor unrelated code.
|
|
39
|
+
5. **One step at a time** \u2014 Make changes incrementally. Verify each step before proceeding.
|
|
40
|
+
|
|
41
|
+
## Guidelines
|
|
42
|
+
|
|
43
|
+
- When asked to create new files, use write_file.
|
|
44
|
+
- When asked to modify existing files, use read_file first, then edit_file.
|
|
45
|
+
- When searching for code, use search_files with appropriate patterns.
|
|
46
|
+
- Explain what you're doing and why before making changes.
|
|
47
|
+
- If you're unsure about something, explore the codebase to gather context.
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
getYoloLiteTools,
|
|
52
|
+
SYSTEM_PROMPT
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-VL2AWYLQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools.ts","../src/system-prompt.ts"],"sourcesContent":["// Task 131: Curated tool set for yolo-lite coding agent\n\nimport type { Tool } from '@yolo-labs/core-types';\nimport {\n readFileTool,\n writeFileTool,\n editFileTool,\n deleteFileTool,\n listFilesTool,\n searchFilesTool,\n} from '@yolo-labs/core-tools';\n\n/**\n * Returns the 6 coding-focused tools for yolo-lite.\n *\n * Excludes `execute_command` — yolo-lite is a pure code generation and\n * editing agent with no build/compile/deploy capabilities.\n */\nexport function getYoloLiteTools(): Tool[] {\n return [\n readFileTool,\n writeFileTool,\n editFileTool,\n deleteFileTool,\n listFilesTool,\n searchFilesTool,\n ];\n}\n","// Task 130: Coding agent system prompt for yolo-lite\n\n/**\n * System prompt for the yolo-lite coding agent.\n *\n * Describes the agent's role, available tools, and workflow guidelines.\n * Hardcoded string — no YAML or prompt-store dependency.\n */\nexport const SYSTEM_PROMPT = `You are a coding assistant that helps users read, edit, and generate code on their local filesystem. You have access to the following tools:\n\n## Tools\n\n- **read_file** — Read the contents of a file at a given path.\n- **write_file** — Write content to a file, creating it if it doesn't exist.\n- **edit_file** — Replace a specific string in a file with a new string. The old string must appear exactly once.\n- **delete_file** — Delete a file at a given path.\n- **list_files** — List files in a directory. Supports recursive listing.\n- **search_files** — Search file contents for a pattern (regex). Returns matching lines with file paths and line numbers.\n\n## Workflow\n\n1. **Explore first** — Use list_files and search_files to understand the project structure before making changes.\n2. **Read before edit** — Always read a file before editing it. Never assume file contents.\n3. **Use edit_file for changes** — Prefer edit_file over write_file when modifying existing files. This ensures precise, targeted changes.\n4. **Keep changes minimal** — Make the smallest change that solves the problem. Don't refactor unrelated code.\n5. **One step at a time** — Make changes incrementally. Verify each step before proceeding.\n\n## Guidelines\n\n- When asked to create new files, use write_file.\n- When asked to modify existing files, use read_file first, then edit_file.\n- When searching for code, use search_files with appropriate patterns.\n- Explain what you're doing and why before making changes.\n- If you're unsure about something, explore the codebase to gather context.\n`;\n"],"mappings":";AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,SAAS,mBAA2B;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;ACnBO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
SYSTEM_PROMPT,
|
|
4
|
+
getYoloLiteTools
|
|
5
|
+
} from "./chunk-VL2AWYLQ.js";
|
|
6
|
+
|
|
7
|
+
// src/cli.ts
|
|
8
|
+
import { resolve } from "path";
|
|
9
|
+
import { createHeadlessAgent, InteractiveTransport, LocalSandboxProvider } from "@yolo-labs/core-agent-runtime";
|
|
10
|
+
function parseArgs() {
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
const result = {
|
|
13
|
+
provider: "anthropic",
|
|
14
|
+
model: void 0,
|
|
15
|
+
task: void 0,
|
|
16
|
+
path: process.cwd()
|
|
17
|
+
};
|
|
18
|
+
for (let i = 0; i < args.length; i++) {
|
|
19
|
+
switch (args[i]) {
|
|
20
|
+
case "--provider":
|
|
21
|
+
result.provider = args[++i];
|
|
22
|
+
break;
|
|
23
|
+
case "--model":
|
|
24
|
+
result.model = args[++i];
|
|
25
|
+
break;
|
|
26
|
+
case "--task":
|
|
27
|
+
result.task = args[++i];
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
if (!args[i].startsWith("--")) {
|
|
31
|
+
result.path = resolve(args[i]);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
async function resolveProvider(type, model) {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case "anthropic": {
|
|
41
|
+
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
42
|
+
if (!apiKey) throw new Error("ANTHROPIC_API_KEY environment variable is required");
|
|
43
|
+
const { AnthropicProvider } = await import("@yolo-labs/core-providers/anthropic");
|
|
44
|
+
return new AnthropicProvider({ apiKey, defaultModel: model });
|
|
45
|
+
}
|
|
46
|
+
case "openai": {
|
|
47
|
+
const apiKey = process.env.OPENAI_API_KEY;
|
|
48
|
+
if (!apiKey) throw new Error("OPENAI_API_KEY environment variable is required");
|
|
49
|
+
const { OpenAIProvider } = await import("@yolo-labs/core-providers/openai");
|
|
50
|
+
return new OpenAIProvider({ apiKey, defaultModel: model });
|
|
51
|
+
}
|
|
52
|
+
case "google": {
|
|
53
|
+
const apiKey = process.env.GOOGLE_API_KEY;
|
|
54
|
+
if (!apiKey) throw new Error("GOOGLE_API_KEY environment variable is required");
|
|
55
|
+
const { GoogleProvider } = await import("@yolo-labs/core-providers/google");
|
|
56
|
+
return new GoogleProvider({ apiKey, defaultModel: model });
|
|
57
|
+
}
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unknown provider: ${type}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function main() {
|
|
63
|
+
const args = parseArgs();
|
|
64
|
+
const provider = await resolveProvider(args.provider, args.model);
|
|
65
|
+
const config = {
|
|
66
|
+
provider,
|
|
67
|
+
tools: getYoloLiteTools(),
|
|
68
|
+
prompts: { system: SYSTEM_PROMPT },
|
|
69
|
+
sandbox: "local",
|
|
70
|
+
initialTask: args.task,
|
|
71
|
+
idlePolicy: "wait"
|
|
72
|
+
};
|
|
73
|
+
const agent = createHeadlessAgent(config);
|
|
74
|
+
const sandbox = new LocalSandboxProvider({ rootDir: args.path });
|
|
75
|
+
agent.setSandbox(sandbox);
|
|
76
|
+
const transport = new InteractiveTransport();
|
|
77
|
+
await agent.start(transport);
|
|
78
|
+
const shutdown = async () => {
|
|
79
|
+
await agent.stop();
|
|
80
|
+
process.exit(0);
|
|
81
|
+
};
|
|
82
|
+
process.on("SIGTERM", shutdown);
|
|
83
|
+
process.on("SIGINT", shutdown);
|
|
84
|
+
}
|
|
85
|
+
main().catch((err) => {
|
|
86
|
+
console.error("Fatal error:", err);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n// Task 132: yolo-lite CLI entry point\n\nimport { resolve } from 'node:path';\nimport { createHeadlessAgent, InteractiveTransport, LocalSandboxProvider } from '@yolo-labs/core-agent-runtime';\nimport type { HeadlessAgentConfig, AIProvider } from '@yolo-labs/core-types';\nimport { getYoloLiteTools } from './tools.js';\nimport { SYSTEM_PROMPT } from './system-prompt.js';\n\nfunction parseArgs(): {\n provider: 'anthropic' | 'openai' | 'google';\n model?: string;\n task?: string;\n path: string;\n} {\n const args = process.argv.slice(2);\n const result = {\n provider: 'anthropic' as 'anthropic' | 'openai' | 'google',\n model: undefined as string | undefined,\n task: undefined as string | undefined,\n path: process.cwd(),\n };\n\n for (let i = 0; i < args.length; i++) {\n switch (args[i]) {\n case '--provider':\n result.provider = args[++i] as 'anthropic' | 'openai' | 'google';\n break;\n case '--model':\n result.model = args[++i];\n break;\n case '--task':\n result.task = args[++i];\n break;\n default:\n // Positional arg: path\n if (!args[i].startsWith('--')) {\n result.path = resolve(args[i]);\n }\n break;\n }\n }\n\n return result;\n}\n\nasync function resolveProvider(\n type: 'anthropic' | 'openai' | 'google',\n model?: string,\n): Promise<AIProvider> {\n switch (type) {\n case 'anthropic': {\n const apiKey = process.env.ANTHROPIC_API_KEY;\n if (!apiKey) throw new Error('ANTHROPIC_API_KEY environment variable is required');\n const { AnthropicProvider } = await import('@yolo-labs/core-providers/anthropic');\n return new AnthropicProvider({ apiKey, defaultModel: model });\n }\n case 'openai': {\n const apiKey = process.env.OPENAI_API_KEY;\n if (!apiKey) throw new Error('OPENAI_API_KEY environment variable is required');\n const { OpenAIProvider } = await import('@yolo-labs/core-providers/openai');\n return new OpenAIProvider({ apiKey, defaultModel: model });\n }\n case 'google': {\n const apiKey = process.env.GOOGLE_API_KEY;\n if (!apiKey) throw new Error('GOOGLE_API_KEY environment variable is required');\n const { GoogleProvider } = await import('@yolo-labs/core-providers/google');\n return new GoogleProvider({ apiKey, defaultModel: model });\n }\n default:\n throw new Error(`Unknown provider: ${type}`);\n }\n}\n\nasync function main() {\n const args = parseArgs();\n const provider = await resolveProvider(args.provider, args.model);\n\n const config: HeadlessAgentConfig = {\n provider,\n tools: getYoloLiteTools(),\n prompts: { system: SYSTEM_PROMPT },\n sandbox: 'local',\n initialTask: args.task,\n idlePolicy: 'wait',\n };\n\n const agent = createHeadlessAgent(config);\n\n // Override sandbox root to the specified path\n const sandbox = new LocalSandboxProvider({ rootDir: args.path });\n agent.setSandbox(sandbox);\n\n const transport = new InteractiveTransport();\n await agent.start(transport);\n\n const shutdown = async () => {\n await agent.stop();\n process.exit(0);\n };\n\n process.on('SIGTERM', shutdown);\n process.on('SIGINT', shutdown);\n}\n\nmain().catch((err) => {\n console.error('Fatal error:', err);\n process.exit(1);\n});\n"],"mappings":";;;;;;;AAGA,SAAS,eAAe;AACxB,SAAS,qBAAqB,sBAAsB,4BAA4B;AAKhF,SAAS,YAKP;AACA,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,QAAM,SAAS;AAAA,IACb,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM,QAAQ,IAAI;AAAA,EACpB;AAEA,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAQ,KAAK,CAAC,GAAG;AAAA,MACf,KAAK;AACH,eAAO,WAAW,KAAK,EAAE,CAAC;AAC1B;AAAA,MACF,KAAK;AACH,eAAO,QAAQ,KAAK,EAAE,CAAC;AACvB;AAAA,MACF,KAAK;AACH,eAAO,OAAO,KAAK,EAAE,CAAC;AACtB;AAAA,MACF;AAEE,YAAI,CAAC,KAAK,CAAC,EAAE,WAAW,IAAI,GAAG;AAC7B,iBAAO,OAAO,QAAQ,KAAK,CAAC,CAAC;AAAA,QAC/B;AACA;AAAA,IACJ;AAAA,EACF;AAEA,SAAO;AACT;AAEA,eAAe,gBACb,MACA,OACqB;AACrB,UAAQ,MAAM;AAAA,IACZ,KAAK,aAAa;AAChB,YAAM,SAAS,QAAQ,IAAI;AAC3B,UAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,oDAAoD;AACjF,YAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,qCAAqC;AAChF,aAAO,IAAI,kBAAkB,EAAE,QAAQ,cAAc,MAAM,CAAC;AAAA,IAC9D;AAAA,IACA,KAAK,UAAU;AACb,YAAM,SAAS,QAAQ,IAAI;AAC3B,UAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,iDAAiD;AAC9E,YAAM,EAAE,eAAe,IAAI,MAAM,OAAO,kCAAkC;AAC1E,aAAO,IAAI,eAAe,EAAE,QAAQ,cAAc,MAAM,CAAC;AAAA,IAC3D;AAAA,IACA,KAAK,UAAU;AACb,YAAM,SAAS,QAAQ,IAAI;AAC3B,UAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,iDAAiD;AAC9E,YAAM,EAAE,eAAe,IAAI,MAAM,OAAO,kCAAkC;AAC1E,aAAO,IAAI,eAAe,EAAE,QAAQ,cAAc,MAAM,CAAC;AAAA,IAC3D;AAAA,IACA;AACE,YAAM,IAAI,MAAM,qBAAqB,IAAI,EAAE;AAAA,EAC/C;AACF;AAEA,eAAe,OAAO;AACpB,QAAM,OAAO,UAAU;AACvB,QAAM,WAAW,MAAM,gBAAgB,KAAK,UAAU,KAAK,KAAK;AAEhE,QAAM,SAA8B;AAAA,IAClC;AAAA,IACA,OAAO,iBAAiB;AAAA,IACxB,SAAS,EAAE,QAAQ,cAAc;AAAA,IACjC,SAAS;AAAA,IACT,aAAa,KAAK;AAAA,IAClB,YAAY;AAAA,EACd;AAEA,QAAM,QAAQ,oBAAoB,MAAM;AAGxC,QAAM,UAAU,IAAI,qBAAqB,EAAE,SAAS,KAAK,KAAK,CAAC;AAC/D,QAAM,WAAW,OAAO;AAExB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,MAAM,MAAM,SAAS;AAE3B,QAAM,WAAW,YAAY;AAC3B,UAAM,MAAM,KAAK;AACjB,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,UAAQ,GAAG,WAAW,QAAQ;AAC9B,UAAQ,GAAG,UAAU,QAAQ;AAC/B;AAEA,KAAK,EAAE,MAAM,CAAC,QAAQ;AACpB,UAAQ,MAAM,gBAAgB,GAAG;AACjC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Tool, AIProvider } from '@yolo-labs/core-types';
|
|
2
|
+
import { HeadlessAgent } from '@yolo-labs/core-agent-runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* System prompt for the yolo-lite coding agent.
|
|
6
|
+
*
|
|
7
|
+
* Describes the agent's role, available tools, and workflow guidelines.
|
|
8
|
+
* Hardcoded string — no YAML or prompt-store dependency.
|
|
9
|
+
*/
|
|
10
|
+
declare const SYSTEM_PROMPT = "You are a coding assistant that helps users read, edit, and generate code on their local filesystem. You have access to the following tools:\n\n## Tools\n\n- **read_file** \u2014 Read the contents of a file at a given path.\n- **write_file** \u2014 Write content to a file, creating it if it doesn't exist.\n- **edit_file** \u2014 Replace a specific string in a file with a new string. The old string must appear exactly once.\n- **delete_file** \u2014 Delete a file at a given path.\n- **list_files** \u2014 List files in a directory. Supports recursive listing.\n- **search_files** \u2014 Search file contents for a pattern (regex). Returns matching lines with file paths and line numbers.\n\n## Workflow\n\n1. **Explore first** \u2014 Use list_files and search_files to understand the project structure before making changes.\n2. **Read before edit** \u2014 Always read a file before editing it. Never assume file contents.\n3. **Use edit_file for changes** \u2014 Prefer edit_file over write_file when modifying existing files. This ensures precise, targeted changes.\n4. **Keep changes minimal** \u2014 Make the smallest change that solves the problem. Don't refactor unrelated code.\n5. **One step at a time** \u2014 Make changes incrementally. Verify each step before proceeding.\n\n## Guidelines\n\n- When asked to create new files, use write_file.\n- When asked to modify existing files, use read_file first, then edit_file.\n- When searching for code, use search_files with appropriate patterns.\n- Explain what you're doing and why before making changes.\n- If you're unsure about something, explore the codebase to gather context.\n";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns the 6 coding-focused tools for yolo-lite.
|
|
14
|
+
*
|
|
15
|
+
* Excludes `execute_command` — yolo-lite is a pure code generation and
|
|
16
|
+
* editing agent with no build/compile/deploy capabilities.
|
|
17
|
+
*/
|
|
18
|
+
declare function getYoloLiteTools(): Tool[];
|
|
19
|
+
|
|
20
|
+
/** Options for creating a yolo-lite agent instance. */
|
|
21
|
+
interface CreateYoloLiteOptions {
|
|
22
|
+
provider: AIProvider;
|
|
23
|
+
/** Root directory for file operations. Defaults to cwd. */
|
|
24
|
+
rootDir?: string;
|
|
25
|
+
/** Initial task to submit on start. */
|
|
26
|
+
initialTask?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a configured yolo-lite agent ready to be started with a transport.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Provider, root directory, and optional initial task.
|
|
32
|
+
* @returns A configured {@link HeadlessAgent} with coding tools and system prompt.
|
|
33
|
+
*/
|
|
34
|
+
declare function createYoloLite(options: CreateYoloLiteOptions): HeadlessAgent;
|
|
35
|
+
|
|
36
|
+
export { type CreateYoloLiteOptions, SYSTEM_PROMPT, createYoloLite, getYoloLiteTools };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SYSTEM_PROMPT,
|
|
3
|
+
getYoloLiteTools
|
|
4
|
+
} from "./chunk-VL2AWYLQ.js";
|
|
5
|
+
|
|
6
|
+
// src/factory.ts
|
|
7
|
+
import { createHeadlessAgent, LocalSandboxProvider } from "@yolo-labs/core-agent-runtime";
|
|
8
|
+
function createYoloLite(options) {
|
|
9
|
+
const agent = createHeadlessAgent({
|
|
10
|
+
provider: options.provider,
|
|
11
|
+
tools: getYoloLiteTools(),
|
|
12
|
+
prompts: { system: SYSTEM_PROMPT },
|
|
13
|
+
sandbox: "local",
|
|
14
|
+
initialTask: options.initialTask,
|
|
15
|
+
idlePolicy: "wait"
|
|
16
|
+
});
|
|
17
|
+
const sandbox = new LocalSandboxProvider({ rootDir: options.rootDir });
|
|
18
|
+
agent.setSandbox(sandbox);
|
|
19
|
+
return agent;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
SYSTEM_PROMPT,
|
|
23
|
+
createYoloLite,
|
|
24
|
+
getYoloLiteTools
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/factory.ts"],"sourcesContent":["// Task 133: createYoloLite factory — programmatic API for yolo-lite\n\nimport { createHeadlessAgent, LocalSandboxProvider } from '@yolo-labs/core-agent-runtime';\nimport type { HeadlessAgent } from '@yolo-labs/core-agent-runtime';\nimport type { AIProvider } from '@yolo-labs/core-types';\nimport { getYoloLiteTools } from './tools.js';\nimport { SYSTEM_PROMPT } from './system-prompt.js';\n\n/** Options for creating a yolo-lite agent instance. */\nexport interface CreateYoloLiteOptions {\n provider: AIProvider;\n /** Root directory for file operations. Defaults to cwd. */\n rootDir?: string;\n /** Initial task to submit on start. */\n initialTask?: string;\n}\n\n/**\n * Creates a configured yolo-lite agent ready to be started with a transport.\n *\n * @param options - Provider, root directory, and optional initial task.\n * @returns A configured {@link HeadlessAgent} with coding tools and system prompt.\n */\nexport function createYoloLite(options: CreateYoloLiteOptions): HeadlessAgent {\n const agent = createHeadlessAgent({\n provider: options.provider,\n tools: getYoloLiteTools(),\n prompts: { system: SYSTEM_PROMPT },\n sandbox: 'local',\n initialTask: options.initialTask,\n idlePolicy: 'wait',\n });\n\n const sandbox = new LocalSandboxProvider({ rootDir: options.rootDir });\n agent.setSandbox(sandbox);\n\n return agent;\n}\n"],"mappings":";;;;;;AAEA,SAAS,qBAAqB,4BAA4B;AAqBnD,SAAS,eAAe,SAA+C;AAC5E,QAAM,QAAQ,oBAAoB;AAAA,IAChC,UAAU,QAAQ;AAAA,IAClB,OAAO,iBAAiB;AAAA,IACxB,SAAS,EAAE,QAAQ,cAAc;AAAA,IACjC,SAAS;AAAA,IACT,aAAa,QAAQ;AAAA,IACrB,YAAY;AAAA,EACd,CAAC;AAED,QAAM,UAAU,IAAI,qBAAqB,EAAE,SAAS,QAAQ,QAAQ,CAAC;AACrE,QAAM,WAAW,OAAO;AAExB,SAAO;AACT;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yolo-labs/core-yolo-lite",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"yolo-lite": "./dist/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@yolo-labs/core-types": "1.0.0",
|
|
21
|
+
"@yolo-labs/core-tools": "1.0.0",
|
|
22
|
+
"@yolo-labs/core-agent-runtime": "1.0.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@yolo-labs/core-providers": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"@yolo-core/providers": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"tsup": "^8.0.0",
|
|
34
|
+
"typescript": "^5.5.0",
|
|
35
|
+
"@yolo-labs/core-providers": "1.0.0"
|
|
36
|
+
},
|
|
37
|
+
"description": "Lightweight YOLO agent implementation",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/yolo-labs-hq/monorepo.git",
|
|
42
|
+
"directory": "yolo-core/packages/yolo-lite"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"registry": "https://registry.npmjs.org/"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/yolo-labs-hq/monorepo/tree/main/yolo-core#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/yolo-labs-hq/monorepo/issues"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup",
|
|
54
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
55
|
+
}
|
|
56
|
+
}
|