@agent-smith/server 0.0.7 → 0.0.9
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/README.md +349 -0
- package/dist/callbacks.d.ts +4 -0
- package/dist/callbacks.js +182 -0
- package/dist/routes/agent_settings.d.ts +4 -0
- package/dist/routes/agent_settings.js +20 -0
- package/dist/routes/agents.js +24 -4
- package/dist/routes/apps.js +3 -3
- package/dist/routes/backends.js +2 -2
- package/dist/routes/conf.js +3 -3
- package/dist/routes/folders.js +3 -4
- package/dist/routes/index.js +6 -4
- package/dist/routes/models.d.ts +5 -2
- package/dist/routes/models.js +64 -27
- package/dist/routes/plugins.js +6 -6
- package/dist/routes/settings.d.ts +3 -0
- package/dist/routes/settings.js +20 -0
- package/dist/routes/state.js +3 -3
- package/dist/routes/templates.d.ts +3 -0
- package/dist/routes/templates.js +18 -0
- package/dist/routes/tools.js +3 -3
- package/dist/routes/workflows.js +1 -1
- package/dist/routes/workspace.d.ts +5 -0
- package/dist/routes/workspace.js +50 -0
- package/dist/server/router.d.ts +4 -1
- package/dist/server/router.js +6 -4
- package/dist/server/server.js +49 -204
- package/dist/utils.d.ts +7 -1
- package/dist/utils.js +17 -3
- package/package.json +5 -6
- package/dist/routes/task_settings.d.ts +0 -4
- package/dist/routes/task_settings.js +0 -21
- package/dist/routes/tasks.d.ts +0 -4
- package/dist/routes/tasks.js +0 -24
package/dist/server/server.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { executeAgent, executeWorkflow } from '@agent-smith/core';
|
|
3
|
+
import cors from '@koa/cors';
|
|
3
4
|
import Koa from 'koa';
|
|
4
5
|
import bodyParser from "koa-bodyparser";
|
|
5
|
-
import cors from '@koa/cors';
|
|
6
|
-
import { useRouter } from './router.js';
|
|
7
|
-
import websockify from 'koa-websocket';
|
|
8
6
|
import route from 'koa-route';
|
|
9
7
|
import serve from "koa-static";
|
|
10
|
-
import
|
|
8
|
+
import websockify from 'koa-websocket';
|
|
9
|
+
import { buildCallbacks } from "../callbacks.js";
|
|
10
|
+
import { useRouter } from './router.js';
|
|
11
11
|
/* import { argv } from 'process';
|
|
12
12
|
|
|
13
13
|
let env = "production";
|
|
@@ -35,22 +35,11 @@ app.use(cors({
|
|
|
35
35
|
app.ws.use((ctx, next) => {
|
|
36
36
|
return next();
|
|
37
37
|
});
|
|
38
|
-
function createAwaiter() {
|
|
39
|
-
let resolveFn;
|
|
40
|
-
let rejectFn;
|
|
41
|
-
const promise = new Promise((resolve, reject) => {
|
|
42
|
-
resolveFn = resolve;
|
|
43
|
-
rejectFn = reject;
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
promise,
|
|
47
|
-
resolve: resolveFn,
|
|
48
|
-
reject: rejectFn
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
38
|
function runserver(routes, staticDir) {
|
|
39
|
+
//state.init();
|
|
52
40
|
const router = useRouter(routes);
|
|
53
|
-
|
|
41
|
+
//console.log(router.apiRouter.stack.map(i => i.path));
|
|
42
|
+
//console.log(router.baseRouter.stack.map(i => i.path));
|
|
54
43
|
const confirmToolCalls = {};
|
|
55
44
|
app.ws.use(route.all('/ws', function (ctx) {
|
|
56
45
|
//ctx.websocket.send('Hello World');
|
|
@@ -75,6 +64,7 @@ function runserver(routes, staticDir) {
|
|
|
75
64
|
if (!(msg.payload.id in confirmToolCalls)) {
|
|
76
65
|
const rsm = {
|
|
77
66
|
type: "error",
|
|
67
|
+
from: "server",
|
|
78
68
|
msg: `can not confirm tool call: unknown tool id ${msg.payload.id}`,
|
|
79
69
|
};
|
|
80
70
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
@@ -96,173 +86,17 @@ function runserver(routes, staticDir) {
|
|
|
96
86
|
if (!msg?.payload) {
|
|
97
87
|
const rsm = {
|
|
98
88
|
type: "error",
|
|
89
|
+
from: "server",
|
|
99
90
|
msg: "provide a payload",
|
|
100
91
|
};
|
|
101
92
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
102
93
|
return;
|
|
103
94
|
}
|
|
104
|
-
|
|
105
|
-
if (msg.feature == "
|
|
106
|
-
|
|
107
|
-
msg.options.onToken = (t) => {
|
|
108
|
-
buf += t;
|
|
109
|
-
process.stdout.write(t);
|
|
110
|
-
};
|
|
111
|
-
msg.options.onTurnEnd = (ht) => {
|
|
112
|
-
const rsm = {
|
|
113
|
-
type: "turnend",
|
|
114
|
-
msg: JSON.stringify(ht),
|
|
115
|
-
};
|
|
116
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
117
|
-
};
|
|
118
|
-
msg.options.onAssistant = (txt) => {
|
|
119
|
-
const rsm = {
|
|
120
|
-
type: "assistant",
|
|
121
|
-
msg: txt,
|
|
122
|
-
};
|
|
123
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
124
|
-
};
|
|
125
|
-
msg.options.onThink = (txt) => {
|
|
126
|
-
const rsm = {
|
|
127
|
-
type: "think",
|
|
128
|
-
msg: txt,
|
|
129
|
-
};
|
|
130
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
131
|
-
};
|
|
95
|
+
// ---------- task -------------
|
|
96
|
+
if (msg.feature == "agent") {
|
|
97
|
+
buildCallbacks(msg, ctx, confirmToolCalls);
|
|
132
98
|
try {
|
|
133
|
-
|
|
134
|
-
const rsm = {
|
|
135
|
-
type: "token",
|
|
136
|
-
msg: buf,
|
|
137
|
-
};
|
|
138
|
-
if (buf !== "") {
|
|
139
|
-
// model is loading if no buffer
|
|
140
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
141
|
-
}
|
|
142
|
-
buf = "";
|
|
143
|
-
}, sendTokensInterval);
|
|
144
|
-
const res = await executeTask(msg.command, msg.payload, msg.options);
|
|
145
|
-
//setTimeout(() => {
|
|
146
|
-
clearInterval(it);
|
|
147
|
-
//}, sendTokensInterval);
|
|
148
|
-
//console.dir(res, { depth: 3 });
|
|
149
|
-
let r;
|
|
150
|
-
if (res.template.id == "none") {
|
|
151
|
-
r = { assistant: res.answer.text };
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
r = res.template.history.pop();
|
|
155
|
-
}
|
|
156
|
-
const rsm = {
|
|
157
|
-
type: "finalresult",
|
|
158
|
-
msg: JSON.stringify(r),
|
|
159
|
-
};
|
|
160
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
161
|
-
}
|
|
162
|
-
catch (e) {
|
|
163
|
-
const rsm = {
|
|
164
|
-
type: "error",
|
|
165
|
-
msg: `${e}`,
|
|
166
|
-
};
|
|
167
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else if (msg.feature == "agent") {
|
|
171
|
-
msg.options.onToolsTurnStart = (tcs) => {
|
|
172
|
-
const rsm = {
|
|
173
|
-
type: "toolsturnstart",
|
|
174
|
-
msg: JSON.stringify(tcs),
|
|
175
|
-
};
|
|
176
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
177
|
-
};
|
|
178
|
-
msg.options.onToolsTurnEnd = (tr) => {
|
|
179
|
-
const rsm = {
|
|
180
|
-
type: "toolsturnend",
|
|
181
|
-
msg: JSON.stringify(tr),
|
|
182
|
-
};
|
|
183
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
184
|
-
};
|
|
185
|
-
msg.options.onTurnEnd = (ht) => {
|
|
186
|
-
const rsm = {
|
|
187
|
-
type: "turnend",
|
|
188
|
-
msg: JSON.stringify(ht),
|
|
189
|
-
};
|
|
190
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
191
|
-
};
|
|
192
|
-
msg.options.onAssistant = (txt) => {
|
|
193
|
-
const rsm = {
|
|
194
|
-
type: "assistant",
|
|
195
|
-
msg: txt,
|
|
196
|
-
};
|
|
197
|
-
//console.log("SRV ON ASSISTANT", txt);
|
|
198
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
199
|
-
};
|
|
200
|
-
msg.options.onThink = (txt) => {
|
|
201
|
-
const rsm = {
|
|
202
|
-
type: "think",
|
|
203
|
-
msg: txt,
|
|
204
|
-
};
|
|
205
|
-
//console.log("SRV ON THINK", txt);
|
|
206
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
207
|
-
};
|
|
208
|
-
msg.options.onToolCall = (tc) => {
|
|
209
|
-
if (!tc?.id) {
|
|
210
|
-
tc.id = crypto.randomUUID();
|
|
211
|
-
}
|
|
212
|
-
const rsm = {
|
|
213
|
-
type: "toolcall",
|
|
214
|
-
msg: JSON.stringify(tc),
|
|
215
|
-
};
|
|
216
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
217
|
-
console.log("\n⚒️ ", color.bold(msg.command), "=>", `${color.yellowBright(tc.name)}`, tc.arguments);
|
|
218
|
-
};
|
|
219
|
-
msg.options.onToolCallEnd = (id, tr) => {
|
|
220
|
-
let toolResData;
|
|
221
|
-
if (typeof tr == 'object') {
|
|
222
|
-
if (tr?.answer?.text) {
|
|
223
|
-
// comes from an inference task
|
|
224
|
-
toolResData = tr.answer.text;
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
toolResData = JSON.stringify(tr);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
toolResData = tr.toString();
|
|
232
|
-
}
|
|
233
|
-
const rsm = {
|
|
234
|
-
type: "toolcallend",
|
|
235
|
-
msg: `${id}<|xtool_call_id|>` + toolResData,
|
|
236
|
-
};
|
|
237
|
-
//console.log("TOOL CALL END", toolResData);
|
|
238
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
239
|
-
};
|
|
240
|
-
msg.options.confirmToolUsage = async (tc) => {
|
|
241
|
-
if (!tc?.id) {
|
|
242
|
-
tc.id = crypto.randomUUID();
|
|
243
|
-
}
|
|
244
|
-
const rsm = {
|
|
245
|
-
type: "toolcallconfirm",
|
|
246
|
-
msg: JSON.stringify(tc),
|
|
247
|
-
};
|
|
248
|
-
const { promise, resolve } = createAwaiter();
|
|
249
|
-
confirmToolCalls[tc.id] = resolve;
|
|
250
|
-
ctx.websocket.send(JSON.stringify(rsm));
|
|
251
|
-
const res = await promise;
|
|
252
|
-
return res;
|
|
253
|
-
};
|
|
254
|
-
msg.options.isAgent = true;
|
|
255
|
-
try {
|
|
256
|
-
//let buf = "";
|
|
257
|
-
msg.options.onToken = (t) => {
|
|
258
|
-
const rsm2 = {
|
|
259
|
-
type: "token",
|
|
260
|
-
msg: t,
|
|
261
|
-
};
|
|
262
|
-
ctx.websocket.send(JSON.stringify(rsm2));
|
|
263
|
-
//buf += t;
|
|
264
|
-
process.stdout.write(t);
|
|
265
|
-
};
|
|
99
|
+
//let buf = "";
|
|
266
100
|
/*const it = setInterval(() => {
|
|
267
101
|
if (buf == "") { return };
|
|
268
102
|
const rsm: WsRawServerMsg = {
|
|
@@ -272,21 +106,23 @@ function runserver(routes, staticDir) {
|
|
|
272
106
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
273
107
|
buf = "";
|
|
274
108
|
}, sendTokensInterval);*/
|
|
275
|
-
|
|
109
|
+
//console.log("AGENT SRV EXEC", msg);
|
|
110
|
+
await executeAgent(msg.command, msg.payload, msg.options);
|
|
276
111
|
//setTimeout(() => {
|
|
277
112
|
//clearInterval(it);
|
|
278
113
|
//}, sendTokensInterval);
|
|
279
|
-
const ht = JSON.stringify(res.template.history.pop());
|
|
280
114
|
//console.log("FINAL MSG", ht)
|
|
281
|
-
const rsm = {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
115
|
+
/*const rsm: WsRawServerMsg = {
|
|
116
|
+
type: "finalresult",
|
|
117
|
+
from: "server",
|
|
118
|
+
msg: JSON.stringify(res),
|
|
119
|
+
}
|
|
120
|
+
ctx.websocket.send(JSON.stringify(rsm));*/
|
|
286
121
|
}
|
|
287
122
|
catch (e) {
|
|
288
123
|
const rsm = {
|
|
289
124
|
type: "error",
|
|
125
|
+
from: "server",
|
|
290
126
|
msg: `${e}`
|
|
291
127
|
};
|
|
292
128
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
@@ -295,15 +131,17 @@ function runserver(routes, staticDir) {
|
|
|
295
131
|
else if (msg.feature == "workflow") {
|
|
296
132
|
try {
|
|
297
133
|
const res = await executeWorkflow(msg.command, msg.payload, msg.options);
|
|
298
|
-
const rsm = {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
134
|
+
/*const rsm: WsRawServerMsg = {
|
|
135
|
+
type: "finalresult",
|
|
136
|
+
from: "server",
|
|
137
|
+
msg: res,
|
|
138
|
+
}
|
|
139
|
+
ctx.websocket.send(JSON.stringify(rsm));*/
|
|
303
140
|
}
|
|
304
141
|
catch (e) {
|
|
305
142
|
const rsm = {
|
|
306
143
|
type: "error",
|
|
144
|
+
from: "server",
|
|
307
145
|
msg: `${e}`
|
|
308
146
|
};
|
|
309
147
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
@@ -320,6 +158,7 @@ function runserver(routes, staticDir) {
|
|
|
320
158
|
else {
|
|
321
159
|
const rsm = {
|
|
322
160
|
type: "error",
|
|
161
|
+
from: "server",
|
|
323
162
|
msg: "command type " + msg.feature + " not supported"
|
|
324
163
|
};
|
|
325
164
|
ctx.websocket.send(JSON.stringify(rsm));
|
|
@@ -332,20 +171,26 @@ function runserver(routes, staticDir) {
|
|
|
332
171
|
app.use(serve(staticDir));
|
|
333
172
|
}
|
|
334
173
|
app.use(logger);
|
|
335
|
-
|
|
174
|
+
const { baseRouter, apiRouter } = router;
|
|
175
|
+
app
|
|
176
|
+
.use(baseRouter.routes()).use(baseRouter.allowedMethods())
|
|
177
|
+
.use(apiRouter.routes()).use(apiRouter.allowedMethods());
|
|
336
178
|
// 404 middleware - runs after router
|
|
337
|
-
app.use((ctx) => {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
179
|
+
/*app.use((ctx) => {
|
|
180
|
+
if (!ctx.matched || ctx.matched.length === 0) {
|
|
181
|
+
ctx.redirect('/')
|
|
182
|
+
ctx.status = 301
|
|
183
|
+
|
|
184
|
+
/*ctx.status = 404;
|
|
185
|
+
//console.log("404 ROUTE", ctx);
|
|
186
|
+
ctx.body = {
|
|
187
|
+
error: 'Not Found',
|
|
188
|
+
path: ctx.path
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});*/
|
|
347
192
|
app.listen(5184, () => {
|
|
348
|
-
console.log('Please open url localhost:5184 in a browser');
|
|
193
|
+
console.log('Please open url http://localhost:5184 in a browser');
|
|
349
194
|
});
|
|
350
195
|
}
|
|
351
196
|
export { runserver };
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,4 +4,10 @@ declare function getConfig(): {
|
|
|
4
4
|
conf: ConfigFile;
|
|
5
5
|
path: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
declare function createAwaiter<T>(): {
|
|
8
|
+
promise: Promise<T>;
|
|
9
|
+
resolve: (value: T) => void;
|
|
10
|
+
reject: (reason?: any) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const excludedTaskTypes: string[];
|
|
13
|
+
export { getConfig, createAwaiter, excludedTaskTypes, };
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { db,
|
|
1
|
+
import { db, conf } from "@agent-smith/core";
|
|
2
2
|
function getConfig() {
|
|
3
3
|
const fp = db.readFilePaths();
|
|
4
4
|
let confFilePath = "";
|
|
@@ -12,7 +12,21 @@ function getConfig() {
|
|
|
12
12
|
if (confFilePath == "") {
|
|
13
13
|
return { found: false, conf: {}, path: "" };
|
|
14
14
|
}
|
|
15
|
-
const c = readConf(confFilePath);
|
|
15
|
+
const c = conf.readConf(confFilePath);
|
|
16
16
|
return { found: c.found, conf: c.data, path: confFilePath };
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
function createAwaiter() {
|
|
19
|
+
let resolveFn;
|
|
20
|
+
let rejectFn;
|
|
21
|
+
const promise = new Promise((resolve, reject) => {
|
|
22
|
+
resolveFn = resolve;
|
|
23
|
+
rejectFn = reject;
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
promise,
|
|
27
|
+
resolve: resolveFn,
|
|
28
|
+
reject: rejectFn
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const excludedTaskTypes = ["app", "workflow", "terminal"];
|
|
32
|
+
export { getConfig, createAwaiter, excludedTaskTypes, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-smith/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Agent Smith Nodejs server",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@agent-smith/
|
|
13
|
+
"@agent-smith/core": "^0.0.1",
|
|
14
14
|
"@koa/cors": "^5.0.0",
|
|
15
15
|
"@koa/router": "^15.4.0",
|
|
16
16
|
"ansi-colors": "^4.1.3",
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"yaml": "^2.8.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agent-smith/types": "^0.0.
|
|
26
|
-
"@locallm/types": "^0.7.1",
|
|
25
|
+
"@agent-smith/types": "^0.0.5",
|
|
27
26
|
"@types/better-sqlite3": "^7.6.13",
|
|
28
27
|
"@types/koa": "^3.0.2",
|
|
29
28
|
"@types/koa__cors": "^5.0.1",
|
|
@@ -31,10 +30,10 @@
|
|
|
31
30
|
"@types/koa-route": "^3.2.9",
|
|
32
31
|
"@types/koa-static": "^4.0.4",
|
|
33
32
|
"@types/koa-websocket": "^5.0.11",
|
|
34
|
-
"@types/node": "^25.5.
|
|
33
|
+
"@types/node": "^25.5.2",
|
|
35
34
|
"ts-node": "^10.9.2",
|
|
36
35
|
"tslib": "2.8.1",
|
|
37
|
-
"typescript": "^
|
|
36
|
+
"typescript": "^6.0.2"
|
|
38
37
|
},
|
|
39
38
|
"preferGlobal": true,
|
|
40
39
|
"main": "./dist/main.js",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { db } from '@agent-smith/cli';
|
|
2
|
-
function getTaskSettingsCmd(r) {
|
|
3
|
-
r.get('/tasks/settings', async (ctx, next) => {
|
|
4
|
-
const ts = db.getTaskSettings();
|
|
5
|
-
ctx.body = ts;
|
|
6
|
-
ctx.status = 200;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
function updateTaskSettingsCmd(r) {
|
|
10
|
-
r.post('/tasks/settings/update', async (ctx, next) => {
|
|
11
|
-
const data = ctx.request.body;
|
|
12
|
-
//console.log("DATA", data);
|
|
13
|
-
const name = data.name;
|
|
14
|
-
const settings = data.settings;
|
|
15
|
-
const ts = db.upsertTaskSettings(name, settings);
|
|
16
|
-
db.getTaskSettings(true);
|
|
17
|
-
ctx.body = ts;
|
|
18
|
-
ctx.status = 200;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
export { getTaskSettingsCmd, updateTaskSettingsCmd, };
|
package/dist/routes/tasks.d.ts
DELETED
package/dist/routes/tasks.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { db, fs } from '@agent-smith/cli';
|
|
2
|
-
function getTasksRoute(r) {
|
|
3
|
-
r.get('/tasks', async (ctx, next) => {
|
|
4
|
-
const tasks = db.readFeaturesType("task");
|
|
5
|
-
ctx.body = tasks;
|
|
6
|
-
ctx.status = 200;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
function getTaskRoute(r) {
|
|
10
|
-
r.get('/task/:id', async (ctx, next) => {
|
|
11
|
-
//console.log(ctx.params.id)
|
|
12
|
-
const taskSpec = fs.openTaskSpec(ctx.params.id);
|
|
13
|
-
ctx.body = taskSpec.taskFileSpec;
|
|
14
|
-
ctx.status = 200;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function saveTasksRoute(r) {
|
|
18
|
-
r.post('/save', async (ctx, next) => {
|
|
19
|
-
//const payload = ctx.request.body;
|
|
20
|
-
ctx.body = "ok";
|
|
21
|
-
ctx.status = 200;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
export { getTasksRoute, getTaskRoute, };
|