@grisaiaevy/crafting-agent 0.0.1
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/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/image/api.d.ts +3 -0
- package/dist/image/api.js +23 -0
- package/dist/image/api.js.map +1 -0
- package/dist/image/index.d.ts +2 -0
- package/dist/image/index.js +19 -0
- package/dist/image/index.js.map +1 -0
- package/dist/image/types.d.ts +8 -0
- package/dist/image/types.js +3 -0
- package/dist/image/types.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/index.d.ts +1 -0
- package/dist/logger/index.js +7 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/logger/logger.d.ts +3 -0
- package/dist/logger/logger.js +23 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/prompt/index.d.ts +2 -0
- package/dist/prompt/index.js +6 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/prompt.d.ts +2 -0
- package/dist/prompt/prompt.js +68 -0
- package/dist/prompt/prompt.js.map +1 -0
- package/dist/providers/doubao.d.ts +10 -0
- package/dist/providers/doubao.js +76 -0
- package/dist/providers/doubao.js.map +1 -0
- package/dist/providers/google.d.ts +12 -0
- package/dist/providers/google.js +70 -0
- package/dist/providers/google.js.map +1 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/providers/index.js +23 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/message_converer.d.ts +4 -0
- package/dist/providers/message_converer.js +206 -0
- package/dist/providers/message_converer.js.map +1 -0
- package/dist/providers/minimax.d.ts +10 -0
- package/dist/providers/minimax.js +120 -0
- package/dist/providers/minimax.js.map +1 -0
- package/dist/providers/openrouter.d.ts +17 -0
- package/dist/providers/openrouter.js +178 -0
- package/dist/providers/openrouter.js.map +1 -0
- package/dist/providers/stream.d.ts +1 -0
- package/dist/providers/stream.js +18 -0
- package/dist/providers/stream.js.map +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +6 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/task-storage.d.ts +13 -0
- package/dist/storage/task-storage.js +7 -0
- package/dist/storage/task-storage.js.map +1 -0
- package/dist/task/converter.d.ts +4 -0
- package/dist/task/converter.js +66 -0
- package/dist/task/converter.js.map +1 -0
- package/dist/task/index.d.ts +5 -0
- package/dist/task/index.js +11 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/task_executor.d.ts +22 -0
- package/dist/task/task_executor.js +216 -0
- package/dist/task/task_executor.js.map +1 -0
- package/dist/task/types.d.ts +1 -0
- package/dist/task/types.js +18 -0
- package/dist/task/types.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.js +23 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/replace_content.d.ts +9 -0
- package/dist/tools/replace_content.js +72 -0
- package/dist/tools/replace_content.js.map +1 -0
- package/dist/tools/tool_converter.d.ts +3 -0
- package/dist/tools/tool_converter.js +59 -0
- package/dist/tools/tool_converter.js.map +1 -0
- package/dist/tools/types.d.ts +1 -0
- package/dist/tools/types.js +18 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/update_todo_list.d.ts +13 -0
- package/dist/tools/update_todo_list.js +80 -0
- package/dist/tools/update_todo_list.js.map +1 -0
- package/dist/tools/web_search.d.ts +9 -0
- package/dist/tools/web_search.js +44 -0
- package/dist/tools/web_search.js.map +1 -0
- package/dist/tools/write_content.d.ts +9 -0
- package/dist/tools/write_content.js +49 -0
- package/dist/tools/write_content.js.map +1 -0
- package/dist/types/common.d.ts +14 -0
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/context.d.ts +10 -0
- package/dist/types/context.js +3 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/prompt.d.ts +5 -0
- package/dist/types/prompt.js +3 -0
- package/dist/types/prompt.js.map +1 -0
- package/dist/types/provider.d.ts +14 -0
- package/dist/types/provider.js +372 -0
- package/dist/types/provider.js.map +1 -0
- package/dist/types/stream.d.ts +59 -0
- package/dist/types/stream.js +3 -0
- package/dist/types/stream.js.map +1 -0
- package/dist/types/task.d.ts +46 -0
- package/dist/types/task.js +3 -0
- package/dist/types/task.js.map +1 -0
- package/dist/types/tools.d.ts +36 -0
- package/dist/types/tools.js +30 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/utils/fetch_html.d.ts +1 -0
- package/dist/utils/fetch_html.js +24 -0
- package/dist/utils/fetch_html.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TodoToolHandler = exports.TodoTool = void 0;
|
|
4
|
+
exports.formatReminderSection = formatReminderSection;
|
|
5
|
+
exports.TodoTool = {
|
|
6
|
+
type: 'function',
|
|
7
|
+
function: {
|
|
8
|
+
name: 'update_todo_list',
|
|
9
|
+
description: 'Replace the entire TODO list with an updated checklist reflecting the current state. Always provide the full list; the system will overwrite the previous one. This tool is designed for step-by-step task tracking, allowing you to confirm completion of each step before updating, update multiple task statuses at once (e.g., mark one as completed and start the next), and dynamically add new todos discovered during long or complex tasks.\n\nChecklist Format:\n- Use a single-level markdown checklist (no nesting or subtasks)\n- List todos in the intended execution order\n- Status options: [ ] (pending), [x] (completed), [-] (in progress)\n\nCore Principles:\n- Before updating, always confirm which todos have been completed\n- You may update multiple statuses in a single update\n- Add new actionable items as they\'re discovered\n- Only mark a task as completed when fully accomplished\n- Keep all unfinished tasks unless explicitly instructed to remove\n\nExample: Initial task list\n{ "todos": "[x] Analyze requirements\\n[x] Design architecture\\n[-] Implement core logic\\n[ ] Write tests\\n[ ] Update documentation" }\n\nExample: After completing implementation\n{ "todos": "[x] Analyze requirements\\n[x] Design architecture\\n[x] Implement core logic\\n[-] Write tests\\n[ ] Update documentation\\n[ ] Add performance benchmarks" }\n\nWhen to Use:\n- Task involves multiple steps or requires ongoing tracking\n- Need to update status of several todos at once\n- New actionable items are discovered during execution\n- Task is complex and benefits from stepwise progress tracking\n\nWhen NOT to Use:\n- Only a single, trivial task\n- Task can be completed in one or two simple steps\n- Request is purely conversational or informational',
|
|
10
|
+
parameters: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
content: { type: 'string', description: 'Full markdown checklist in execution order, using [ ] for pending, [x] for completed, and [-] for in progress' },
|
|
14
|
+
},
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
class TodoToolHandler {
|
|
20
|
+
tool() {
|
|
21
|
+
return exports.TodoTool;
|
|
22
|
+
}
|
|
23
|
+
async execute(toolCall, context) {
|
|
24
|
+
return 'Todo item added';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.TodoToolHandler = TodoToolHandler;
|
|
28
|
+
function formatReminderSection(todoList) {
|
|
29
|
+
if (!todoList || todoList.length === 0) {
|
|
30
|
+
return "You have not created a todo list yet. Create one with `update_todo_list` if your task is complicated or involves multiple steps.";
|
|
31
|
+
}
|
|
32
|
+
const statusMap = {
|
|
33
|
+
pending: "Pending",
|
|
34
|
+
in_progress: "In Progress",
|
|
35
|
+
completed: "Completed",
|
|
36
|
+
};
|
|
37
|
+
const lines = [
|
|
38
|
+
"====",
|
|
39
|
+
"",
|
|
40
|
+
"REMINDERS",
|
|
41
|
+
"",
|
|
42
|
+
"Below is your current list of reminders for this task. Keep them updated as you progress.",
|
|
43
|
+
"",
|
|
44
|
+
];
|
|
45
|
+
lines.push("| # | Content | Status |");
|
|
46
|
+
lines.push("|---|---------|--------|");
|
|
47
|
+
todoList.forEach((item, idx) => {
|
|
48
|
+
const escapedContent = item.content.replace(/\\/g, "\\\\").replace(/\|/g, "\\|");
|
|
49
|
+
lines.push(`| ${idx + 1} | ${escapedContent} | ${statusMap[item.status] || item.status} |`);
|
|
50
|
+
});
|
|
51
|
+
lines.push("");
|
|
52
|
+
lines.push("", "IMPORTANT: When task status changes, remember to call the `update_todo_list` tool to update your progress.", "");
|
|
53
|
+
return lines.join("\n");
|
|
54
|
+
}
|
|
55
|
+
// export function parseMarkdownChecklist(md: string): TodoItem[] {
|
|
56
|
+
// if (typeof md !== "string") return []
|
|
57
|
+
// const lines = md
|
|
58
|
+
// .split(/\r?\n/)
|
|
59
|
+
// .map((l) => l.trim())
|
|
60
|
+
// .filter(Boolean)
|
|
61
|
+
// const todos: TodoItem[] = []
|
|
62
|
+
// for (const line of lines) {
|
|
63
|
+
// const match = line.match(/^(?:-\s*)?\[\s*([ xX\-~])\s*\]\s+(.+)$/)
|
|
64
|
+
// if (!match) continue
|
|
65
|
+
// let status: string = "pending"
|
|
66
|
+
// if (match[1] === "x" || match[1] === "X") status = "completed"
|
|
67
|
+
// else if (match[1] === "-" || match[1] === "~") status = "in_progress"
|
|
68
|
+
// const id = crypto
|
|
69
|
+
// .createHash("md5")
|
|
70
|
+
// .update(match[2] + status)
|
|
71
|
+
// .digest("hex")
|
|
72
|
+
// todos.push({
|
|
73
|
+
// id,
|
|
74
|
+
// content: match[2],
|
|
75
|
+
// status,
|
|
76
|
+
// })
|
|
77
|
+
// }
|
|
78
|
+
// return todos
|
|
79
|
+
// }
|
|
80
|
+
//# sourceMappingURL=update_todo_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_todo_list.js","sourceRoot":"","sources":["../../src/tools/update_todo_list.ts"],"names":[],"mappings":";;;AAkCA,sDAgCC;AA/DY,QAAA,QAAQ,GAAe;IAChC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,ktDAAktD;QAC/tD,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+GAA+G,EAAE;aAC5J;YACD,QAAQ,EAAE,IAAI;SACjB;KACJ;CACJ,CAAA;AAED,MAAa,eAAe;IACxB,IAAI;QACA,OAAO,gBAAQ,CAAA;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA2B,EAAE,OAAoB;QAC3D,OAAO,iBAAiB,CAAA;IAC5B,CAAC;CACJ;AARD,0CAQC;AAQD,SAAgB,qBAAqB,CAAC,QAAqB;IACvD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,kIAAkI,CAAA;IAC7I,CAAC;IACD,MAAM,SAAS,GAA2B;QACtC,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,aAAa;QAC1B,SAAS,EAAE,WAAW;KACzB,CAAA;IACD,MAAM,KAAK,GAAa;QACpB,MAAM;QACN,EAAE;QACF,WAAW;QACX,EAAE;QACF,2FAA2F;QAC3F,EAAE;KACL,CAAA;IAED,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;IACtC,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAChF,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,cAAc,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;IAC/F,CAAC,CAAC,CAAA;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,KAAK,CAAC,IAAI,CACN,EAAE,EACF,4GAA4G,EAC5G,EAAE,CACL,CAAA;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED,mEAAmE;AACnE,4CAA4C;AAC5C,uBAAuB;AACvB,0BAA0B;AAC1B,gCAAgC;AAChC,2BAA2B;AAC3B,mCAAmC;AACnC,kCAAkC;AAClC,6EAA6E;AAC7E,+BAA+B;AAC/B,yCAAyC;AACzC,yEAAyE;AACzE,gFAAgF;AAChF,4BAA4B;AAC5B,iCAAiC;AACjC,yCAAyC;AACzC,6BAA6B;AAC7B,uBAAuB;AACvB,kBAAkB;AAClB,iCAAiC;AACjC,sBAAsB;AACtB,aAAa;AACb,QAAQ;AACR,mBAAmB;AACnB,IAAI"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatCompletionTool as OpenAITool } from 'openai/resources/chat/completions';
|
|
2
|
+
import { ToolHandler, ApiStreamToolCall, TaskContext } from '../types';
|
|
3
|
+
export declare const WebSearchTool: OpenAITool;
|
|
4
|
+
export declare class WebSearchToolHandler implements ToolHandler {
|
|
5
|
+
private context;
|
|
6
|
+
tool(): OpenAITool;
|
|
7
|
+
setContext(context: TaskContext): void;
|
|
8
|
+
execute(tool: ApiStreamToolCall, context?: TaskContext): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebSearchToolHandler = exports.WebSearchTool = void 0;
|
|
4
|
+
exports.WebSearchTool = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
function: {
|
|
7
|
+
name: 'web_search',
|
|
8
|
+
description: 'Search the web for information',
|
|
9
|
+
parameters: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
querys: { type: 'array', items: { type: 'string' }, description: 'The querys to search for' },
|
|
13
|
+
},
|
|
14
|
+
required: ['querys'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
class WebSearchToolHandler {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.context = null;
|
|
21
|
+
}
|
|
22
|
+
tool() {
|
|
23
|
+
return exports.WebSearchTool;
|
|
24
|
+
}
|
|
25
|
+
setContext(context) {
|
|
26
|
+
this.context = context;
|
|
27
|
+
}
|
|
28
|
+
async execute(tool, context) {
|
|
29
|
+
const ctx = context || this.context;
|
|
30
|
+
if (!ctx || !ctx.variables?.workspacePath) {
|
|
31
|
+
throw new Error('Tool context (cwd) is required for file operations');
|
|
32
|
+
}
|
|
33
|
+
return `内容搜索结果
|
|
34
|
+
百度百科:
|
|
35
|
+
陨石,也称“陨星”,指流星体从行星际空间穿越过大气层而陨落到行星、卫星或小行星表面后残存的固态天然物体。 [17]
|
|
36
|
+
太空中的流星体以极高的速度通过大气层,其产生的高温足以熔融其表面,同时燃烧并发出强光。如果它们的体积较小,穿越大气层时就燃烧完了,就是流星;如果它们的体积较大(直径约10米以上),穿越大气层后还有一部分没燃烧完,残留的部分落在地面上,就是陨石。
|
|
37
|
+
流星体进入大气层前的体积越大,下落过程中伴随产生的现象就越强烈。目前认为,几乎所有的陨石都来源于小行星带。小行星带是位于火星和木星轨道之间,聚集有无数小天体的区域。当小行星之间的碰撞改变了彼此的轨道,或者碰撞产生了碎片时,它们就会离开原有轨道,有些飞向地球,落在地球表面,成为陨石。
|
|
38
|
+
根据其成分,陨石大致可以分为三类:一类是与地球上的岩石外观和成分都很相似的石陨石,一类是含有一部分铁的石铁陨石,一类是以铁为主要成分的铁陨石(也称为陨铁)。 [17]
|
|
39
|
+
2025年6月23日消息,黔东南州山林中有块重达一吨的钻石陨石被发现。
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.WebSearchToolHandler = WebSearchToolHandler;
|
|
44
|
+
//# sourceMappingURL=web_search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web_search.js","sourceRoot":"","sources":["../../src/tools/web_search.ts"],"names":[],"mappings":";;;AAGa,QAAA,aAAa,GAAe;IACrC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,gCAAgC;QAC7C,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE;aAChG;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACvB;KACJ;CACJ,CAAA;AAED,MAAa,oBAAoB;IAAjC;QAEY,YAAO,GAAuB,IAAI,CAAA;IAwB9C,CAAC;IAtBG,IAAI;QACA,OAAO,qBAAa,CAAA;IACxB,CAAC;IAED,UAAU,CAAC,OAAoB;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IAC1B,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAuB,EAAE,OAAqB;QACxD,MAAM,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;QACzE,CAAC;QACD,OAAO;;;;;;;CAOd,CAAA;IACG,CAAC;CACJ;AA1BD,oDA0BC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatCompletionTool as OpenAITool } from 'openai/resources/chat/completions';
|
|
2
|
+
import { ToolHandler, ApiStreamToolCall, TaskContext } from '../types';
|
|
3
|
+
export declare const WriteContentTool: OpenAITool;
|
|
4
|
+
export default class WriteContentToolHandler implements ToolHandler {
|
|
5
|
+
private context;
|
|
6
|
+
tool(): OpenAITool;
|
|
7
|
+
setContext(context: TaskContext): void;
|
|
8
|
+
execute(tool: ApiStreamToolCall, context?: TaskContext): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteContentTool = void 0;
|
|
4
|
+
exports.WriteContentTool = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
function: {
|
|
7
|
+
name: 'write_content',
|
|
8
|
+
description: '请求写入内容。直接返回提供的内容,不进行文件操作。',
|
|
9
|
+
parameters: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
content: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: '要写入的内容。将原样返回此内容。',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['content'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
class WriteContentToolHandler {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.context = null;
|
|
24
|
+
}
|
|
25
|
+
tool() {
|
|
26
|
+
return exports.WriteContentTool;
|
|
27
|
+
}
|
|
28
|
+
setContext(context) {
|
|
29
|
+
this.context = context;
|
|
30
|
+
}
|
|
31
|
+
async execute(tool, context) {
|
|
32
|
+
let args = tool.function.arguments;
|
|
33
|
+
if (typeof args === 'string') {
|
|
34
|
+
try {
|
|
35
|
+
args = JSON.parse(args);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
throw new Error(`Failed to parse tool arguments: ${error}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const parameters = args;
|
|
42
|
+
if (parameters.content === undefined || parameters.content === null) {
|
|
43
|
+
throw new Error('content parameter is required');
|
|
44
|
+
}
|
|
45
|
+
return parameters.content;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = WriteContentToolHandler;
|
|
49
|
+
//# sourceMappingURL=write_content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_content.js","sourceRoot":"","sources":["../../src/tools/write_content.ts"],"names":[],"mappings":";;;AAIa,QAAA,gBAAgB,GAAe;IAC1C,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,2BAA2B;QAC7B,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,kBAAkB;iBACrB;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;KACF;CACF,CAAA;AAED,MAAqB,uBAAuB;IAA5C;QACU,YAAO,GAAuB,IAAI,CAAA;IAiC5C,CAAC;IA/BC,IAAI;QACF,OAAO,wBAAgB,CAAA;IACzB,CAAC;IAED,UAAU,CAAC,OAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,IAAuB,EACvB,OAAqB;QAErB,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAA;QAClC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACzB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAA;YAC7D,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAAG,IAElB,CAAA;QAED,IAAI,UAAU,CAAC,OAAO,KAAK,SAAS,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACpE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;QAClD,CAAC;QAED,OAAO,UAAU,CAAC,OAAO,CAAA;IAC3B,CAAC;CACF;AAlCD,0CAkCC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ProviderConfig {
|
|
2
|
+
provider?: 'minimax' | 'doubao' | 'openrouter' | 'google';
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
modelName?: string;
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ModelConfig {
|
|
9
|
+
agentModel?: ProviderConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface UserInstruction {
|
|
12
|
+
type?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModelConfig } from './common';
|
|
2
|
+
import { ISystemPromptBuilder } from './prompt';
|
|
3
|
+
import { ToolHandler } from './tools';
|
|
4
|
+
export interface TaskContext {
|
|
5
|
+
modelConfig?: ModelConfig;
|
|
6
|
+
variables?: Record<string, string>;
|
|
7
|
+
systemPromptBuilder?: ISystemPromptBuilder;
|
|
8
|
+
tools?: ToolHandler[];
|
|
9
|
+
workspacePath?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
__exportStar(require("./task"), exports);
|
|
19
|
+
__exportStar(require("./stream"), exports);
|
|
20
|
+
__exportStar(require("./tools"), exports);
|
|
21
|
+
__exportStar(require("./prompt"), exports);
|
|
22
|
+
__exportStar(require("./context"), exports);
|
|
23
|
+
__exportStar(require("./provider"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,yCAAsB;AACtB,2CAAwB;AACxB,0CAAuB;AACvB,2CAAwB;AACxB,4CAAyB;AACzB,6CAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ServiceOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
endpoint: string;
|
|
5
|
+
models: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ImageServiceOption {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
models: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const serviceOptions: ServiceOption[];
|
|
14
|
+
export declare const imageServiceOptions: ImageServiceOption[];
|