mistagent 0.1.3 → 0.1.5
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 +204 -0
- package/dist/src/api/chat.d.ts +1 -1
- package/dist/src/api/chat.d.ts.map +1 -1
- package/dist/src/api/chat.js +7 -1
- package/dist/src/api/chat.js.map +1 -1
- package/dist/src/api/tunnel.d.ts +19 -0
- package/dist/src/api/tunnel.d.ts.map +1 -0
- package/dist/src/api/tunnel.js +16 -0
- package/dist/src/api/tunnel.js.map +1 -0
- package/dist/src/components/Composer.d.ts.map +1 -1
- package/dist/src/components/Composer.js +9 -5
- package/dist/src/components/Composer.js.map +1 -1
- package/dist/src/components/Header.js +5 -5
- package/dist/src/components/Header.js.map +1 -1
- package/dist/src/contexts/ChatContext.d.ts +3 -0
- package/dist/src/contexts/ChatContext.d.ts.map +1 -1
- package/dist/src/contexts/ChatContext.js +5 -0
- package/dist/src/contexts/ChatContext.js.map +1 -1
- package/dist/src/contexts/ModelContext.d.ts.map +1 -1
- package/dist/src/contexts/ModelContext.js +7 -7
- package/dist/src/contexts/ModelContext.js.map +1 -1
- package/dist/src/hooks/useChat.d.ts.map +1 -1
- package/dist/src/hooks/useChat.js +28 -2
- package/dist/src/hooks/useChat.js.map +1 -1
- package/dist/src/hooks/useSlashCommand.d.ts.map +1 -1
- package/dist/src/hooks/useSlashCommand.js +84 -70
- package/dist/src/hooks/useSlashCommand.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +48 -19
- package/dist/src/main.js.map +1 -1
- package/dist/src/types/api.d.ts +7 -0
- package/dist/src/types/api.d.ts.map +1 -1
- package/dist/src/utils/config.d.ts +7 -1
- package/dist/src/utils/config.d.ts.map +1 -1
- package/dist/src/utils/config.js +30 -1
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/constants.d.ts +2 -1
- package/dist/src/utils/constants.d.ts.map +1 -1
- package/dist/src/utils/constants.js +28 -8
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/fileTunnel.d.ts +26 -0
- package/dist/src/utils/fileTunnel.d.ts.map +1 -0
- package/dist/src/utils/fileTunnel.js +156 -0
- package/dist/src/utils/fileTunnel.js.map +1 -0
- package/package.json +15 -13
- package/dist/src/api/commands.d.ts +0 -8
- package/dist/src/api/commands.d.ts.map +0 -1
- package/dist/src/api/commands.js +0 -13
- package/dist/src/api/commands.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,sDAAsD;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kCAAkC;IAClC,kCAAkC;IAClC,kCAAkC;IAClC,kCAAkC;IAClC,kCAAkC;IAClC,kCAAkC;CACnC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAEzD,+CAA+C;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,iCAAiC;AACjC,MAAM,oBAAoB,GAAG;IAC3B,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,yCAAyC;AACzC,MAAM,qBAAqB,GAAG;IAC5B,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,cAAc;IACzB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,cAAc;IACzB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,QAAQ,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC;A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CAAC;AAEF,MAAM,qBAAqB,GAAG;IAC5B,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,gBAAgB;IAC3B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,QAAQ,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAC9E,CAAC;AAED,oCAAoC;AACpC,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAEpD,uEAAuE;AACvE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;CAClC,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,QAAQ;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa;IACb,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;IACd,YAAY;IACZ,cAAc;IACd,iBAAiB;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Tool Tunneling - 本地文件操作执行器
|
|
3
|
+
*
|
|
4
|
+
* 当后端发送 tool_execute_request SSE 事件时,
|
|
5
|
+
* 在客户端本地执行文件操作并回传结果。
|
|
6
|
+
*/
|
|
7
|
+
export interface TunnelRequest {
|
|
8
|
+
request_id: string;
|
|
9
|
+
tool_name: string;
|
|
10
|
+
args: Record<string, string>;
|
|
11
|
+
thread_id: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TunnelResult {
|
|
14
|
+
request_id: string;
|
|
15
|
+
success: boolean;
|
|
16
|
+
result: string;
|
|
17
|
+
error: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 在本地执行文件操作
|
|
21
|
+
*
|
|
22
|
+
* 根据 tool_name 分发到对应的 fs 操作。
|
|
23
|
+
* 工具名称和参数与 LangChain FileManagementToolkit 保持一致。
|
|
24
|
+
*/
|
|
25
|
+
export declare function executeFileOperation(req: TunnelRequest): Promise<TunnelResult>;
|
|
26
|
+
//# sourceMappingURL=fileTunnel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileTunnel.d.ts","sourceRoot":"","sources":["../../../src/utils/fileTunnel.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,YAAY,CAAC,CAmHvB"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Tool Tunneling - 本地文件操作执行器
|
|
3
|
+
*
|
|
4
|
+
* 当后端发送 tool_execute_request SSE 事件时,
|
|
5
|
+
* 在客户端本地执行文件操作并回传结果。
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* 在本地执行文件操作
|
|
11
|
+
*
|
|
12
|
+
* 根据 tool_name 分发到对应的 fs 操作。
|
|
13
|
+
* 工具名称和参数与 LangChain FileManagementToolkit 保持一致。
|
|
14
|
+
*/
|
|
15
|
+
export async function executeFileOperation(req) {
|
|
16
|
+
try {
|
|
17
|
+
let result;
|
|
18
|
+
switch (req.tool_name) {
|
|
19
|
+
case 'read_file': {
|
|
20
|
+
const filePath = req.args.file_path;
|
|
21
|
+
if (!filePath) {
|
|
22
|
+
return fail(req, 'Missing required argument: file_path');
|
|
23
|
+
}
|
|
24
|
+
result = fs.readFileSync(filePath, 'utf-8');
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case 'write_file': {
|
|
28
|
+
const filePath = req.args.file_path;
|
|
29
|
+
const text = req.args.text ?? '';
|
|
30
|
+
if (!filePath) {
|
|
31
|
+
return fail(req, 'Missing required argument: file_path');
|
|
32
|
+
}
|
|
33
|
+
// 确保目录存在
|
|
34
|
+
const dir = path.dirname(filePath);
|
|
35
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
36
|
+
fs.writeFileSync(filePath, text, 'utf-8');
|
|
37
|
+
result = `File written successfully to ${filePath}`;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case 'list_directory': {
|
|
41
|
+
const dirPath = req.args.dir_path || req.args.input || '.';
|
|
42
|
+
if (!fs.existsSync(dirPath)) {
|
|
43
|
+
return fail(req, `Directory not found: ${dirPath}`);
|
|
44
|
+
}
|
|
45
|
+
const entries = fs.readdirSync(dirPath);
|
|
46
|
+
result = entries.join('\n');
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case 'copy_file': {
|
|
50
|
+
const src = req.args.source_path;
|
|
51
|
+
const dst = req.args.destination_path;
|
|
52
|
+
if (!src || !dst) {
|
|
53
|
+
return fail(req, 'Missing required arguments: source_path, destination_path');
|
|
54
|
+
}
|
|
55
|
+
// 确保目标目录存在
|
|
56
|
+
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
|
57
|
+
fs.copyFileSync(src, dst);
|
|
58
|
+
result = `Copied ${src} to ${dst}`;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 'move_file': {
|
|
62
|
+
const src = req.args.source_path;
|
|
63
|
+
const dst = req.args.destination_path;
|
|
64
|
+
if (!src || !dst) {
|
|
65
|
+
return fail(req, 'Missing required arguments: source_path, destination_path');
|
|
66
|
+
}
|
|
67
|
+
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
|
68
|
+
fs.renameSync(src, dst);
|
|
69
|
+
result = `Moved ${src} to ${dst}`;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case 'file_delete': {
|
|
73
|
+
const filePath = req.args.file_path;
|
|
74
|
+
if (!filePath) {
|
|
75
|
+
return fail(req, 'Missing required argument: file_path');
|
|
76
|
+
}
|
|
77
|
+
if (!fs.existsSync(filePath)) {
|
|
78
|
+
return fail(req, `File not found: ${filePath}`);
|
|
79
|
+
}
|
|
80
|
+
fs.unlinkSync(filePath);
|
|
81
|
+
result = `Deleted ${filePath}`;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'file_search': {
|
|
85
|
+
const pattern = req.args.pattern || req.args.input || '';
|
|
86
|
+
const dirPath = req.args.dir_path || '.';
|
|
87
|
+
if (!pattern) {
|
|
88
|
+
return fail(req, 'Missing required argument: pattern');
|
|
89
|
+
}
|
|
90
|
+
const matches = searchFiles(dirPath, pattern);
|
|
91
|
+
result = matches.length > 0 ? matches.join('\n') : 'No files found';
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 'bash_shell_run': {
|
|
95
|
+
const command = req.args.command;
|
|
96
|
+
if (!command) {
|
|
97
|
+
return fail(req, 'Missing required argument: command');
|
|
98
|
+
}
|
|
99
|
+
const { execSync } = await import('node:child_process');
|
|
100
|
+
result = execSync(command, {
|
|
101
|
+
encoding: 'utf-8',
|
|
102
|
+
timeout: 60_000,
|
|
103
|
+
cwd: process.cwd(),
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
return fail(req, `Unknown tool: ${req.tool_name}`);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
request_id: req.request_id,
|
|
112
|
+
success: true,
|
|
113
|
+
result,
|
|
114
|
+
error: '',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
119
|
+
return fail(req, errorMsg);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function fail(req, error) {
|
|
123
|
+
return {
|
|
124
|
+
request_id: req.request_id,
|
|
125
|
+
success: false,
|
|
126
|
+
result: '',
|
|
127
|
+
error,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 递归搜索匹配模式的文件
|
|
132
|
+
*/
|
|
133
|
+
function searchFiles(dir, pattern, maxDepth = 5, depth = 0) {
|
|
134
|
+
if (depth > maxDepth)
|
|
135
|
+
return [];
|
|
136
|
+
const results = [];
|
|
137
|
+
try {
|
|
138
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
139
|
+
for (const entry of entries) {
|
|
140
|
+
const fullPath = path.join(dir, entry.name);
|
|
141
|
+
if (entry.name.includes(pattern)) {
|
|
142
|
+
results.push(fullPath);
|
|
143
|
+
}
|
|
144
|
+
if (entry.isDirectory() &&
|
|
145
|
+
!entry.name.startsWith('.') &&
|
|
146
|
+
entry.name !== 'node_modules') {
|
|
147
|
+
results.push(...searchFiles(fullPath, pattern, maxDepth, depth + 1));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
/* permission error or inaccessible directory, skip */
|
|
153
|
+
}
|
|
154
|
+
return results;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=fileTunnel.js.map
|
|
@@ -0,0 +1 @@
|
|
|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AACH,SAAS,WAAW,CAClB,GAAW,EACX,OAAe,EACf,QAAQ,GAAG,CAAC,EACZ,KAAK,GAAG,CAAC;IAET,IAAI,KAAK,GAAG,QAAQ;QAAE,OAAO,EAAE,CAAC;IAChC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC;YACD,IACE,KAAK,CAAC,WAAW,EAAE;gBACnB,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAC3B,KAAK,CAAC,IAAI,KAAK,cAAc,EAC7B,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,sDAAsD;IACxD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mistagent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "MistAgent - Terminal AI Assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,25 +28,25 @@
|
|
|
28
28
|
"typecheck": "tsc --noEmit"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"
|
|
32
|
-
"ink": "^6.0.0",
|
|
33
|
-
"ink-text-input": "^6.0.0",
|
|
34
|
-
"ink-spinner": "^5.0.0",
|
|
31
|
+
"archiver": "^7.0.1",
|
|
35
32
|
"chalk": "^5.4.1",
|
|
36
|
-
"
|
|
37
|
-
"marked": "^15.0.0",
|
|
38
|
-
"marked-terminal": "^7.3.0",
|
|
33
|
+
"cli-spinners": "^3.2.0",
|
|
39
34
|
"eventsource-parser": "^3.0.0",
|
|
40
35
|
"figures": "^6.1.0",
|
|
41
|
-
"cli-spinners": "^3.2.0",
|
|
42
|
-
"string-width": "^7.2.0",
|
|
43
36
|
"glob": "^11.0.0",
|
|
44
37
|
"graphology": "^0.25.4",
|
|
45
38
|
"graphology-indices": "^0.17.0",
|
|
46
39
|
"graphology-utils": "^2.3.0",
|
|
40
|
+
"ink": "^6.0.0",
|
|
41
|
+
"ink-spinner": "^5.0.0",
|
|
42
|
+
"ink-text-input": "^6.0.0",
|
|
47
43
|
"lru-cache": "^11.0.0",
|
|
44
|
+
"marked": "^15.0.0",
|
|
45
|
+
"marked-terminal": "^7.3.0",
|
|
48
46
|
"mnemonist": "^0.39.0",
|
|
49
47
|
"pandemonium": "^2.4.0",
|
|
48
|
+
"react": "^19.2.0",
|
|
49
|
+
"string-width": "^7.2.0",
|
|
50
50
|
"tree-sitter": "^0.21.0",
|
|
51
51
|
"tree-sitter-c": "^0.21.0",
|
|
52
52
|
"tree-sitter-c-sharp": "^0.21.0",
|
|
@@ -57,14 +57,16 @@
|
|
|
57
57
|
"tree-sitter-python": "^0.21.0",
|
|
58
58
|
"tree-sitter-rust": "^0.21.0",
|
|
59
59
|
"tree-sitter-solidity": "1.2.9",
|
|
60
|
-
"tree-sitter-typescript": "^0.21.0"
|
|
60
|
+
"tree-sitter-typescript": "^0.21.0",
|
|
61
|
+
"yargs": "^17.7.2"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
64
|
+
"@types/archiver": "^7.0.0",
|
|
63
65
|
"@types/node": "^20.11.24",
|
|
64
66
|
"@types/react": "^19.2.0",
|
|
65
67
|
"@types/yargs": "^17.0.32",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
+
"tsx": "^4.19.0",
|
|
69
|
+
"typescript": "^5.7.0"
|
|
68
70
|
},
|
|
69
71
|
"engines": {
|
|
70
72
|
"node": ">=20"
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CommandDef, CommandResponse } from '../types/api.js';
|
|
2
|
-
export declare const commandsApi: {
|
|
3
|
-
list(): Promise<{
|
|
4
|
-
commands: CommandDef[];
|
|
5
|
-
}>;
|
|
6
|
-
execute(command: string, threadId?: string | null): Promise<CommandResponse>;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/api/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,eAAO,MAAM,WAAW;YACd,OAAO,CAAC;QAAE,QAAQ,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;qBAKhC,MAAM,aACJ,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,eAAe,CAAC;CAM5B,CAAC"}
|
package/dist/src/api/commands.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getClient } from './client.js';
|
|
2
|
-
export const commandsApi = {
|
|
3
|
-
list() {
|
|
4
|
-
return getClient().get('/api/v1/commands');
|
|
5
|
-
},
|
|
6
|
-
execute(command, threadId) {
|
|
7
|
-
return getClient().post('/api/v1/command', {
|
|
8
|
-
command,
|
|
9
|
-
...(threadId ? { thread_id: threadId } : {}),
|
|
10
|
-
});
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=commands.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/api/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI;QACF,OAAO,SAAS,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CACL,OAAe,EACf,QAAwB;QAExB,OAAO,SAAS,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;YACzC,OAAO;YACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|