@sylix/coworker 1.1.4 → 1.2.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/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +183 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/SettingsManager.d.ts +25 -0
- package/dist/config/SettingsManager.d.ts.map +1 -0
- package/dist/config/SettingsManager.js +96 -0
- package/dist/config/SettingsManager.js.map +1 -0
- package/dist/core/CoWorkerAgent.d.ts +52 -0
- package/dist/core/CoWorkerAgent.d.ts.map +1 -0
- package/dist/core/CoWorkerAgent.js +308 -0
- package/dist/core/CoWorkerAgent.js.map +1 -0
- package/dist/mcp/MCPClientManager.d.ts +30 -0
- package/dist/mcp/MCPClientManager.d.ts.map +1 -0
- package/dist/mcp/MCPClientManager.js +100 -0
- package/dist/mcp/MCPClientManager.js.map +1 -0
- package/dist/permissions/PermissionInterceptor.d.ts +21 -0
- package/dist/permissions/PermissionInterceptor.d.ts.map +1 -0
- package/dist/permissions/PermissionInterceptor.js +104 -0
- package/dist/permissions/PermissionInterceptor.js.map +1 -0
- package/dist/session/SessionManager.d.ts +38 -0
- package/dist/session/SessionManager.d.ts.map +1 -0
- package/dist/session/SessionManager.js +129 -0
- package/dist/session/SessionManager.js.map +1 -0
- package/dist/skills/HookAndSkillManager.d.ts +37 -0
- package/dist/skills/HookAndSkillManager.d.ts.map +1 -0
- package/dist/skills/HookAndSkillManager.js +141 -0
- package/dist/skills/HookAndSkillManager.js.map +1 -0
- package/dist/task/TaskEngine.d.ts +29 -0
- package/dist/task/TaskEngine.d.ts.map +1 -0
- package/dist/task/TaskEngine.js +117 -0
- package/dist/task/TaskEngine.js.map +1 -0
- package/dist/tools/CronManager.d.ts +22 -0
- package/dist/tools/CronManager.d.ts.map +1 -0
- package/dist/tools/CronManager.js +44 -0
- package/dist/tools/CronManager.js.map +1 -0
- package/dist/tools/NativeTools.d.ts +33 -0
- package/dist/tools/NativeTools.d.ts.map +1 -0
- package/dist/tools/NativeTools.js +175 -0
- package/dist/tools/NativeTools.js.map +1 -0
- package/dist/tools/Schemas.d.ts +365 -0
- package/dist/tools/Schemas.d.ts.map +1 -0
- package/dist/tools/Schemas.js +177 -0
- package/dist/tools/Schemas.js.map +1 -0
- package/dist/ui/InkUI.d.ts +2 -0
- package/dist/ui/InkUI.d.ts.map +1 -0
- package/dist/ui/InkUI.js +11 -0
- package/dist/ui/InkUI.js.map +1 -0
- package/package.json +18 -8
- package/dist/agents/runner.d.ts +0 -19
- package/dist/agents/runner.d.ts.map +0 -1
- package/dist/agents/runner.js +0 -170
- package/dist/agents/runner.js.map +0 -1
- package/dist/api/sylix.d.ts +0 -53
- package/dist/api/sylix.d.ts.map +0 -1
- package/dist/api/sylix.js +0 -237
- package/dist/api/sylix.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -369
- package/dist/cli.js.map +0 -1
- package/dist/commands/ask.d.ts +0 -2
- package/dist/commands/ask.d.ts.map +0 -1
- package/dist/commands/ask.js +0 -55
- package/dist/commands/ask.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -8
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -479
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/commit.d.ts +0 -2
- package/dist/commands/commit.d.ts.map +0 -1
- package/dist/commands/commit.js +0 -163
- package/dist/commands/commit.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -101
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/edit.d.ts +0 -2
- package/dist/commands/edit.d.ts.map +0 -1
- package/dist/commands/edit.js +0 -112
- package/dist/commands/edit.js.map +0 -1
- package/dist/commands/explain.d.ts +0 -2
- package/dist/commands/explain.d.ts.map +0 -1
- package/dist/commands/explain.js +0 -99
- package/dist/commands/explain.js.map +0 -1
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -151
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/review.d.ts +0 -2
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js +0 -137
- package/dist/commands/review.js.map +0 -1
- package/dist/commands/run.d.ts +0 -2
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -136
- package/dist/commands/run.js.map +0 -1
- package/dist/config/settings.d.ts +0 -33
- package/dist/config/settings.d.ts.map +0 -1
- package/dist/config/settings.js +0 -72
- package/dist/config/settings.js.map +0 -1
- package/dist/context/reader.d.ts +0 -24
- package/dist/context/reader.d.ts.map +0 -1
- package/dist/context/reader.js +0 -209
- package/dist/context/reader.js.map +0 -1
- package/dist/hooks/engine.d.ts +0 -9
- package/dist/hooks/engine.d.ts.map +0 -1
- package/dist/hooks/engine.js +0 -85
- package/dist/hooks/engine.js.map +0 -1
- package/dist/mcp/client.d.ts +0 -15
- package/dist/mcp/client.d.ts.map +0 -1
- package/dist/mcp/client.js +0 -211
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -46
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -196
- package/dist/mcp/transport.js.map +0 -1
- package/dist/memory/loader.d.ts +0 -41
- package/dist/memory/loader.d.ts.map +0 -1
- package/dist/memory/loader.js +0 -249
- package/dist/memory/loader.js.map +0 -1
- package/dist/permissions/manager.d.ts +0 -7
- package/dist/permissions/manager.d.ts.map +0 -1
- package/dist/permissions/manager.js +0 -125
- package/dist/permissions/manager.js.map +0 -1
- package/dist/scripts/postinstall.d.ts +0 -7
- package/dist/scripts/postinstall.d.ts.map +0 -1
- package/dist/scripts/postinstall.js +0 -23
- package/dist/scripts/postinstall.js.map +0 -1
- package/dist/session/memory.d.ts +0 -6
- package/dist/session/memory.d.ts.map +0 -1
- package/dist/session/memory.js +0 -81
- package/dist/session/memory.js.map +0 -1
- package/dist/session/store.d.ts +0 -19
- package/dist/session/store.d.ts.map +0 -1
- package/dist/session/store.js +0 -94
- package/dist/session/store.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -2
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -40
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/chrome.d.ts +0 -10
- package/dist/tools/chrome.d.ts.map +0 -1
- package/dist/tools/chrome.js +0 -228
- package/dist/tools/chrome.js.map +0 -1
- package/dist/tools/edit.d.ts +0 -2
- package/dist/tools/edit.d.ts.map +0 -1
- package/dist/tools/edit.js +0 -67
- package/dist/tools/edit.js.map +0 -1
- package/dist/tools/glob.d.ts +0 -10
- package/dist/tools/glob.d.ts.map +0 -1
- package/dist/tools/glob.js +0 -245
- package/dist/tools/glob.js.map +0 -1
- package/dist/tools/grep.d.ts +0 -10
- package/dist/tools/grep.d.ts.map +0 -1
- package/dist/tools/grep.js +0 -252
- package/dist/tools/grep.js.map +0 -1
- package/dist/tools/ls.d.ts +0 -2
- package/dist/tools/ls.d.ts.map +0 -1
- package/dist/tools/ls.js +0 -75
- package/dist/tools/ls.js.map +0 -1
- package/dist/tools/read.d.ts +0 -2
- package/dist/tools/read.d.ts.map +0 -1
- package/dist/tools/read.js +0 -72
- package/dist/tools/read.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -3
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -281
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/schema.json +0 -508
- package/dist/tools/task.d.ts +0 -11
- package/dist/tools/task.d.ts.map +0 -1
- package/dist/tools/task.js +0 -118
- package/dist/tools/task.js.map +0 -1
- package/dist/tools/web.d.ts +0 -3
- package/dist/tools/web.d.ts.map +0 -1
- package/dist/tools/web.js +0 -113
- package/dist/tools/web.js.map +0 -1
- package/dist/tools/write.d.ts +0 -18
- package/dist/tools/write.d.ts.map +0 -1
- package/dist/tools/write.js +0 -122
- package/dist/tools/write.js.map +0 -1
- package/dist/utils/output.d.ts +0 -62
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -487
- package/dist/utils/output.js.map +0 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoWorkerToolSchemas = void 0;
|
|
4
|
+
exports.CoWorkerToolSchemas = [
|
|
5
|
+
{
|
|
6
|
+
type: 'function',
|
|
7
|
+
function: {
|
|
8
|
+
name: 'executeWrite',
|
|
9
|
+
description: 'Creates or securely overwrites a file at the specified path natively.',
|
|
10
|
+
parameters: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
filePath: { type: 'string', description: 'Absolute or relative path to the file.' },
|
|
14
|
+
content: { type: 'string', description: 'The complete content to write into the file.' }
|
|
15
|
+
},
|
|
16
|
+
required: ['filePath', 'content']
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'function',
|
|
22
|
+
function: {
|
|
23
|
+
name: 'executeGlob',
|
|
24
|
+
description: 'Performs a fast native recursive directory search for files matching a pattern, automatically ignoring node_modules and .git.',
|
|
25
|
+
parameters: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
pattern: { type: 'string', description: 'Wildcard pattern like *.ts or src/**/*.js' },
|
|
29
|
+
dir: { type: 'string', description: 'The directory to search within. Defaults to current working directory.' }
|
|
30
|
+
},
|
|
31
|
+
required: ['pattern']
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'function',
|
|
37
|
+
function: {
|
|
38
|
+
name: 'executeGrep',
|
|
39
|
+
description: 'Searches for a regex pattern specifically inside a list of provided file paths.',
|
|
40
|
+
parameters: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
regexQuery: { type: 'string', description: 'The regular expression string to match.' },
|
|
44
|
+
filesToSearch: { type: 'array', items: { type: 'string' }, description: 'Array of file paths to scan.' }
|
|
45
|
+
},
|
|
46
|
+
required: ['regexQuery', 'filesToSearch']
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'function',
|
|
52
|
+
function: {
|
|
53
|
+
name: 'executeWebSearch',
|
|
54
|
+
description: 'Searches the internet for information, documentation, or news using duckduckgo.',
|
|
55
|
+
parameters: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
query: { type: 'string', description: 'The search query.' }
|
|
59
|
+
},
|
|
60
|
+
required: ['query']
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'function',
|
|
66
|
+
function: {
|
|
67
|
+
name: 'executeWebFetch',
|
|
68
|
+
description: 'Downloads and parses the text content of a specific web URL.',
|
|
69
|
+
parameters: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
url: { type: 'string', description: 'The complete URI to fetch.' }
|
|
73
|
+
},
|
|
74
|
+
required: ['url']
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'function',
|
|
80
|
+
function: {
|
|
81
|
+
name: 'executeAskUserQuestion',
|
|
82
|
+
description: 'Pauses swarms and prompts the human developer for input or clarification.',
|
|
83
|
+
parameters: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
question: { type: 'string', description: 'The exact question to ask the user.' }
|
|
87
|
+
},
|
|
88
|
+
required: ['question']
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'function',
|
|
94
|
+
function: {
|
|
95
|
+
name: 'taskCreate',
|
|
96
|
+
description: 'Creates a tracked objective with blockers/dependencies tracked in session memory.',
|
|
97
|
+
parameters: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {
|
|
100
|
+
description: { type: 'string', description: 'Goal or checklist item details.' },
|
|
101
|
+
dependencies: { type: 'array', items: { type: 'string' }, description: 'Array of existing task IDs blocking this one.' }
|
|
102
|
+
},
|
|
103
|
+
required: ['description']
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'function',
|
|
109
|
+
function: {
|
|
110
|
+
name: 'taskUpdate',
|
|
111
|
+
description: 'Updates a tracked task status.',
|
|
112
|
+
parameters: {
|
|
113
|
+
type: 'object',
|
|
114
|
+
properties: {
|
|
115
|
+
taskId: { type: 'string' },
|
|
116
|
+
state: { type: 'string', enum: ['pending', 'in_progress', 'blocked', 'completed'] },
|
|
117
|
+
notes: { type: 'string', description: 'Any context or blockers preventing progress.' }
|
|
118
|
+
},
|
|
119
|
+
required: ['taskId', 'state']
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: 'function',
|
|
125
|
+
function: {
|
|
126
|
+
name: 'cronCreate',
|
|
127
|
+
description: 'Schedules a recurring background check or task. Example: check server status every 5 mins.',
|
|
128
|
+
parameters: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
description: { type: 'string', description: 'What to check or do.' },
|
|
132
|
+
intervalMinutes: { type: 'number', description: 'Frequency in minutes.' }
|
|
133
|
+
},
|
|
134
|
+
required: ['description', 'intervalMinutes']
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: 'function',
|
|
140
|
+
function: {
|
|
141
|
+
name: 'cronList',
|
|
142
|
+
description: 'Lists all currently active scheduled recurring background tasks.',
|
|
143
|
+
parameters: { type: 'object', properties: {} }
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'function',
|
|
148
|
+
function: {
|
|
149
|
+
name: 'cronDelete',
|
|
150
|
+
description: 'Cancels a specific recurring background task.',
|
|
151
|
+
parameters: {
|
|
152
|
+
type: 'object',
|
|
153
|
+
properties: {
|
|
154
|
+
cronId: { type: 'string' }
|
|
155
|
+
},
|
|
156
|
+
required: ['cronId']
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: 'function',
|
|
162
|
+
function: {
|
|
163
|
+
name: 'enterPlanMode',
|
|
164
|
+
description: 'Temporarily revokes your ability to use mutation tools (bash, write) allowing you to safely brainstorm and analyze architecture.',
|
|
165
|
+
parameters: { type: 'object', properties: {} }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'function',
|
|
170
|
+
function: {
|
|
171
|
+
name: 'exitPlanMode',
|
|
172
|
+
description: 'Restores your ability to execute mutation tools (bash, write) after brainstorming is complete.',
|
|
173
|
+
parameters: { type: 'object', properties: {} }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
//# sourceMappingURL=Schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Schemas.js","sourceRoot":"","sources":["../../src/tools/Schemas.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,uEAAuE;YACpF,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;oBACnF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;iBACzF;gBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;aAClC;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,QA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UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;SAC/C;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InkUI.d.ts","sourceRoot":"","sources":["../../src/ui/InkUI.tsx"],"names":[],"mappings":"AACA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,QAK3D"}
|
package/dist/ui/InkUI.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderCoWorkerUI = renderCoWorkerUI;
|
|
4
|
+
// InkUI stub - UI disabled due to incompatible ink version
|
|
5
|
+
function renderCoWorkerUI(agent, prompt) {
|
|
6
|
+
console.log('CoWorker CLI ready. Use --print flag for one-shot mode.');
|
|
7
|
+
if (prompt) {
|
|
8
|
+
console.log(`Running prompt: ${prompt}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=InkUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InkUI.js","sourceRoot":"","sources":["../../src/ui/InkUI.tsx"],"names":[],"mappings":";;AACA,4CAKC;AAND,2DAA2D;AAC3D,SAAgB,gBAAgB,CAAC,KAAU,EAAE,MAAe;IAC1D,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylix/coworker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "CoWorker by Sylix - AI-powered CLI coding assistant",
|
|
5
|
-
"main": "dist/cli.js",
|
|
5
|
+
"main": "dist/cli/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"coworker": "./dist/cli.js"
|
|
7
|
+
"coworker": "./dist/cli/index.js"
|
|
8
8
|
},
|
|
9
9
|
"preferGlobal": true,
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.0.0"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc
|
|
15
|
-
"dev": "ts-node src/cli.ts",
|
|
16
|
-
"start": "node dist/cli.js",
|
|
17
|
-
"postinstall": "node dist/scripts/postinstall.js || true",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"dev": "ts-node src/cli/index.ts",
|
|
16
|
+
"start": "node dist/cli/index.js",
|
|
18
17
|
"prepublishOnly": "npm run build"
|
|
19
18
|
},
|
|
20
19
|
"files": [
|
|
@@ -37,17 +36,28 @@
|
|
|
37
36
|
"chalk": "^4.1.2",
|
|
38
37
|
"commander": "^11.1.0",
|
|
39
38
|
"dotenv": "^16.3.1",
|
|
39
|
+
"duck-duck-scrape": "^2.2.7",
|
|
40
40
|
"fs-extra": "^11.2.0",
|
|
41
41
|
"highlight.js": "^11.9.0",
|
|
42
|
+
"ink": "^6.8.0",
|
|
43
|
+
"ink-spinner": "^5.0.0",
|
|
44
|
+
"node-fetch": "^3.3.2",
|
|
42
45
|
"open": "^10.1.0",
|
|
43
46
|
"ora": "^5.4.1",
|
|
44
47
|
"playwright": "^1.58.2",
|
|
45
|
-
"prompts": "^2.4.2"
|
|
48
|
+
"prompts": "^2.4.2",
|
|
49
|
+
"react": "^19.2.4",
|
|
50
|
+
"react-dom": "^19.2.4",
|
|
51
|
+
"ws": "^8.20.0"
|
|
46
52
|
},
|
|
47
53
|
"devDependencies": {
|
|
48
54
|
"@types/fs-extra": "^11.0.4",
|
|
55
|
+
"@types/ink": "^0.5.2",
|
|
49
56
|
"@types/node": "^20.10.0",
|
|
50
57
|
"@types/prompts": "^2.4.9",
|
|
58
|
+
"@types/react": "^19.2.14",
|
|
59
|
+
"@types/react-dom": "^19.2.3",
|
|
60
|
+
"@types/ws": "^8.18.1",
|
|
51
61
|
"ts-node": "^10.9.2",
|
|
52
62
|
"typescript": "^5.3.2"
|
|
53
63
|
}
|
package/dist/agents/runner.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface AgentDefinition {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
systemPrompt: string;
|
|
5
|
-
allowedTools: string[];
|
|
6
|
-
maxTurns: number;
|
|
7
|
-
}
|
|
8
|
-
interface AgentResult {
|
|
9
|
-
agentName: string;
|
|
10
|
-
success: boolean;
|
|
11
|
-
output: string;
|
|
12
|
-
turns: number;
|
|
13
|
-
}
|
|
14
|
-
export declare function loadAgentDefinition(agentPath: string): Promise<AgentDefinition | null>;
|
|
15
|
-
export declare function listAgents(): Promise<AgentDefinition[]>;
|
|
16
|
-
export declare function runAgent(agentDef: AgentDefinition, userPrompt: string, parentContext?: string): Promise<AgentResult>;
|
|
17
|
-
export declare function runAgentByName(name: string, prompt: string, context?: string): Promise<string>;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/agents/runner.ts"],"names":[],"mappings":"AAYA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAID,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAO5F;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAqB7D;AA8CD,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,WAAW,CAAC,CAkFtB;AAID,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
|
package/dist/agents/runner.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.loadAgentDefinition = loadAgentDefinition;
|
|
7
|
-
exports.listAgents = listAgents;
|
|
8
|
-
exports.runAgent = runAgent;
|
|
9
|
-
exports.runAgentByName = runAgentByName;
|
|
10
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const sylix_1 = require("../api/sylix");
|
|
13
|
-
const registry_1 = require("../tools/registry");
|
|
14
|
-
const output_1 = require("../utils/output");
|
|
15
|
-
// ─── Load Agent Definitions ───
|
|
16
|
-
async function loadAgentDefinition(agentPath) {
|
|
17
|
-
try {
|
|
18
|
-
const content = await fs_extra_1.default.readFile(agentPath, 'utf8');
|
|
19
|
-
return parseAgentMd(content, path_1.default.basename(agentPath, '.md'));
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async function listAgents() {
|
|
26
|
-
const agentDirs = [
|
|
27
|
-
path_1.default.join(process.cwd(), '.coworker', 'agents'),
|
|
28
|
-
path_1.default.join(process.cwd(), '.agents'),
|
|
29
|
-
];
|
|
30
|
-
const agents = [];
|
|
31
|
-
for (const dir of agentDirs) {
|
|
32
|
-
if (await fs_extra_1.default.pathExists(dir)) {
|
|
33
|
-
const files = await fs_extra_1.default.readdir(dir);
|
|
34
|
-
for (const file of files) {
|
|
35
|
-
if (file.endsWith('.md')) {
|
|
36
|
-
const def = await loadAgentDefinition(path_1.default.join(dir, file));
|
|
37
|
-
if (def)
|
|
38
|
-
agents.push(def);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return agents;
|
|
44
|
-
}
|
|
45
|
-
// ─── Parse Agent .md File ───
|
|
46
|
-
function parseAgentMd(content, fallbackName) {
|
|
47
|
-
const lines = content.split('\n');
|
|
48
|
-
let name = fallbackName;
|
|
49
|
-
let description = '';
|
|
50
|
-
let systemPrompt = '';
|
|
51
|
-
let allowedTools = [];
|
|
52
|
-
let maxTurns = 10;
|
|
53
|
-
// Parse YAML frontmatter
|
|
54
|
-
if (lines[0]?.trim() === '---') {
|
|
55
|
-
const endIdx = lines.indexOf('---', 1);
|
|
56
|
-
if (endIdx > 0) {
|
|
57
|
-
const frontmatter = lines.slice(1, endIdx).join('\n');
|
|
58
|
-
const nameMatch = frontmatter.match(/^name:\s*(.+)$/m);
|
|
59
|
-
if (nameMatch)
|
|
60
|
-
name = nameMatch[1].trim();
|
|
61
|
-
const descMatch = frontmatter.match(/^description:\s*(.+)$/m);
|
|
62
|
-
if (descMatch)
|
|
63
|
-
description = descMatch[1].trim();
|
|
64
|
-
const toolsMatch = frontmatter.match(/^allowed_tools:\s*\[([^\]]*)\]/m);
|
|
65
|
-
if (toolsMatch) {
|
|
66
|
-
allowedTools = toolsMatch[1].split(',').map(t => t.trim().replace(/['"]/g, ''));
|
|
67
|
-
}
|
|
68
|
-
const turnsMatch = frontmatter.match(/^max_turns:\s*(\d+)/m);
|
|
69
|
-
if (turnsMatch)
|
|
70
|
-
maxTurns = parseInt(turnsMatch[1], 10);
|
|
71
|
-
// Everything after frontmatter is the system prompt
|
|
72
|
-
systemPrompt = lines.slice(endIdx + 1).join('\n').trim();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
// No frontmatter — entire content is the system prompt
|
|
77
|
-
systemPrompt = content;
|
|
78
|
-
}
|
|
79
|
-
return { name, description, systemPrompt, allowedTools, maxTurns };
|
|
80
|
-
}
|
|
81
|
-
// ─── Execute Subagent ───
|
|
82
|
-
async function runAgent(agentDef, userPrompt, parentContext) {
|
|
83
|
-
const messages = [];
|
|
84
|
-
// Build system prompt
|
|
85
|
-
let system = agentDef.systemPrompt;
|
|
86
|
-
if (parentContext) {
|
|
87
|
-
system += `\n\n# Context from parent conversation:\n${parentContext}`;
|
|
88
|
-
}
|
|
89
|
-
if (agentDef.allowedTools.length > 0) {
|
|
90
|
-
system += `\n\nYou have access to the following tools: ${agentDef.allowedTools.join(', ')}. Do not use any other tools.`;
|
|
91
|
-
}
|
|
92
|
-
messages.push({ role: 'system', content: system });
|
|
93
|
-
messages.push({ role: 'user', content: userPrompt });
|
|
94
|
-
let totalTurns = 0;
|
|
95
|
-
let finalOutput = '';
|
|
96
|
-
console.log(output_1.theme.dim(` [Agent: ${agentDef.name}] Starting with prompt: "${userPrompt.substring(0, 80)}..."`));
|
|
97
|
-
for (let turn = 0; turn < agentDef.maxTurns; turn++) {
|
|
98
|
-
totalTurns++;
|
|
99
|
-
try {
|
|
100
|
-
const res = await (0, sylix_1.chat)(messages, (chunk) => {
|
|
101
|
-
// Silent — subagents don't stream to stdout
|
|
102
|
-
});
|
|
103
|
-
if (res.content) {
|
|
104
|
-
finalOutput = res.content;
|
|
105
|
-
messages.push({ role: 'assistant', content: res.content });
|
|
106
|
-
}
|
|
107
|
-
if (res.tool_calls && res.tool_calls.length > 0) {
|
|
108
|
-
messages.push({ role: 'assistant', tool_calls: res.tool_calls });
|
|
109
|
-
for (const tc of res.tool_calls) {
|
|
110
|
-
const toolName = tc.function.name;
|
|
111
|
-
// Check if tool is allowed
|
|
112
|
-
if (agentDef.allowedTools.length > 0 && !agentDef.allowedTools.includes(toolName)) {
|
|
113
|
-
messages.push({
|
|
114
|
-
role: 'tool',
|
|
115
|
-
name: toolName,
|
|
116
|
-
tool_call_id: tc.id,
|
|
117
|
-
content: `Error: Tool "${toolName}" is not allowed for this agent. Allowed: ${agentDef.allowedTools.join(', ')}`
|
|
118
|
-
});
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const result = await (0, registry_1.handleToolCall)(tc);
|
|
122
|
-
messages.push({
|
|
123
|
-
role: 'tool',
|
|
124
|
-
name: toolName,
|
|
125
|
-
tool_call_id: tc.id,
|
|
126
|
-
content: result
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
// Continue the loop for the next turn
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
// No tool calls → agent is done
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
catch (err) {
|
|
137
|
-
console.error(output_1.theme.error(` [Agent: ${agentDef.name}] Error on turn ${turn + 1}: ${err.message}`));
|
|
138
|
-
return {
|
|
139
|
-
agentName: agentDef.name,
|
|
140
|
-
success: false,
|
|
141
|
-
output: `Agent error: ${err.message}`,
|
|
142
|
-
turns: totalTurns
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
console.log(output_1.theme.dim(` [Agent: ${agentDef.name}] Completed in ${totalTurns} turns`));
|
|
147
|
-
return {
|
|
148
|
-
agentName: agentDef.name,
|
|
149
|
-
success: true,
|
|
150
|
-
output: finalOutput,
|
|
151
|
-
turns: totalTurns
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
// ─── Run Agent by Name ───
|
|
155
|
-
async function runAgentByName(name, prompt, context) {
|
|
156
|
-
const agents = await listAgents();
|
|
157
|
-
const agent = agents.find(a => a.name.toLowerCase() === name.toLowerCase());
|
|
158
|
-
if (!agent) {
|
|
159
|
-
const available = agents.map(a => a.name).join(', ');
|
|
160
|
-
return `Agent "${name}" not found. Available agents: ${available || '(none — create .coworker/agents/*.md)'}`;
|
|
161
|
-
}
|
|
162
|
-
const result = await runAgent(agent, prompt, context);
|
|
163
|
-
if (result.success) {
|
|
164
|
-
return `[Agent: ${result.agentName} completed in ${result.turns} turns]\n\n${result.output}`;
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
return `[Agent: ${result.agentName} failed]\n\n${result.output}`;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=runner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/agents/runner.ts"],"names":[],"mappings":";;;;;AA6BA,kDAOC;AAED,gCAqBC;AA8CD,4BAsFC;AAID,wCAoBC;AAvND,wDAA0B;AAC1B,gDAAwB;AACxB,wCAAiD;AACjD,gDAAmD;AACnD,4CAAwC;AAuBxC,iCAAiC;AAE1B,KAAK,UAAU,mBAAmB,CAAC,SAAiB;IACzD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,YAAY,CAAC,OAAO,EAAE,cAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,UAAU;IAC9B,MAAM,SAAS,GAAG;QAChB,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC;QAC/C,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC;KACpC,CAAC;IAEF,MAAM,MAAM,GAAsB,EAAE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S,eAAe,MAAM,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;AACH,CAAC"}
|
package/dist/api/sylix.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export interface SylixConfig {
|
|
2
|
-
baseUrl: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
defaultModel?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ChatMessage {
|
|
7
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
8
|
-
content?: string;
|
|
9
|
-
name?: string;
|
|
10
|
-
tool_call_id?: string;
|
|
11
|
-
tool_calls?: {
|
|
12
|
-
id: string;
|
|
13
|
-
type: 'function';
|
|
14
|
-
function: {
|
|
15
|
-
name: string;
|
|
16
|
-
arguments: string;
|
|
17
|
-
};
|
|
18
|
-
}[];
|
|
19
|
-
}
|
|
20
|
-
export interface ChatRequest {
|
|
21
|
-
messages: ChatMessage[];
|
|
22
|
-
stream?: boolean;
|
|
23
|
-
model?: string;
|
|
24
|
-
tools?: any[];
|
|
25
|
-
tool_choice?: 'auto' | 'none';
|
|
26
|
-
}
|
|
27
|
-
export interface ChatResponse {
|
|
28
|
-
content: string;
|
|
29
|
-
tool_calls?: {
|
|
30
|
-
id: string;
|
|
31
|
-
type: 'function';
|
|
32
|
-
function: {
|
|
33
|
-
name: string;
|
|
34
|
-
arguments: string;
|
|
35
|
-
};
|
|
36
|
-
}[];
|
|
37
|
-
}
|
|
38
|
-
export interface StreamChunk {
|
|
39
|
-
content: string;
|
|
40
|
-
done: boolean;
|
|
41
|
-
}
|
|
42
|
-
export interface StreamChunk {
|
|
43
|
-
content: string;
|
|
44
|
-
done: boolean;
|
|
45
|
-
}
|
|
46
|
-
export declare function ensureConfigDir(): Promise<void>;
|
|
47
|
-
export declare function loadConfig(): Promise<SylixConfig | null>;
|
|
48
|
-
export declare function saveConfig(config: SylixConfig): Promise<void>;
|
|
49
|
-
export declare function getConfig(): Promise<SylixConfig>;
|
|
50
|
-
export declare function getConfigPath(): string;
|
|
51
|
-
export declare function chat(messages: ChatMessage[], onChunk?: (chunk: string) => void, model?: string): Promise<ChatResponse>;
|
|
52
|
-
export declare function chatNonStreaming(messages: ChatMessage[], model?: string): Promise<string>;
|
|
53
|
-
//# sourceMappingURL=sylix.d.ts.map
|
package/dist/api/sylix.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sylix.d.ts","sourceRoot":"","sources":["../../src/api/sylix.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,UAAU,CAAC;QACjB,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,EAAE,CAAC;CACL;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,UAAU,CAAC;QACjB,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM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