taskmonkey-cli 0.5.0 → 0.5.2
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/package.json +1 -1
- package/src/commands/chat.js +17 -7
- package/src/commands/pull.js +26 -0
package/package.json
CHANGED
package/src/commands/chat.js
CHANGED
|
@@ -15,7 +15,8 @@ export async function chat(options) {
|
|
|
15
15
|
const task = options.task || null;
|
|
16
16
|
const isPublic = options.public || false;
|
|
17
17
|
|
|
18
|
-
// Validate task exists
|
|
18
|
+
// Validate task exists and get chatId from server
|
|
19
|
+
let chatId;
|
|
19
20
|
if (task && !isPublic) {
|
|
20
21
|
try {
|
|
21
22
|
const client = createClient();
|
|
@@ -30,16 +31,25 @@ export async function chat(options) {
|
|
|
30
31
|
}
|
|
31
32
|
process.exit(1);
|
|
32
33
|
}
|
|
34
|
+
// Use the chatId from server (has correct userId)
|
|
35
|
+
chatId = found.chat_id;
|
|
36
|
+
} catch {
|
|
37
|
+
chatId = `task_${task}_cli_${Date.now()}`;
|
|
38
|
+
}
|
|
39
|
+
} else if (isPublic) {
|
|
40
|
+
chatId = `public_cli_${Date.now()}`;
|
|
41
|
+
} else {
|
|
42
|
+
// Unified: get chatId from server too
|
|
43
|
+
try {
|
|
44
|
+
const client = createClient();
|
|
45
|
+
const tasksResult = await client.get('/api/tasks');
|
|
46
|
+
const unified = (tasksResult.tasks || []).find(t => t.is_unified);
|
|
47
|
+
chatId = unified?.chat_id || `unified_cli_${Date.now()}`;
|
|
33
48
|
} catch {
|
|
34
|
-
|
|
49
|
+
chatId = `unified_cli_${Date.now()}`;
|
|
35
50
|
}
|
|
36
51
|
}
|
|
37
52
|
|
|
38
|
-
let chatId;
|
|
39
|
-
if (task) chatId = `task_${task}_cli_${Date.now()}`;
|
|
40
|
-
else if (isPublic) chatId = `public_cli_${Date.now()}`;
|
|
41
|
-
else chatId = `unified_cli_${Date.now()}`;
|
|
42
|
-
|
|
43
53
|
const label = task ? `(${task})` : isPublic ? '(public)' : '(unified)';
|
|
44
54
|
console.log(chalk.cyan('💬 Chat'), chalk.gray(label));
|
|
45
55
|
console.log(chalk.gray(' Empty line to quit.\n'));
|
package/src/commands/pull.js
CHANGED
|
@@ -338,6 +338,32 @@ Jeder Handler bekommt einen Kontext mit:
|
|
|
338
338
|
\\GuzzleHttp\\Client // Alternative HTTP-Library
|
|
339
339
|
\`\`\`
|
|
340
340
|
|
|
341
|
+
## Database Gateway (Remote-SQL)
|
|
342
|
+
|
|
343
|
+
Für Zugriff auf externe Datenbanken (Contao, WordPress, etc.) gibt es das Database Gateway System.
|
|
344
|
+
Der Server hat SSH-Zugang zu Remote-Servern und deployt ein temporäres PHP-Gateway.
|
|
345
|
+
|
|
346
|
+
**Workflow in einem Tool/Prompt:**
|
|
347
|
+
1. \`deployGateway\` mit \`project\` und optional \`allow_write: true\`
|
|
348
|
+
2. \`executeQuery\` / \`listTables\` / \`describeTable\`
|
|
349
|
+
3. \`removeGateway\` am Ende
|
|
350
|
+
|
|
351
|
+
**Projekte konfigurieren:** \`database_connections.php\`
|
|
352
|
+
\`\`\`php
|
|
353
|
+
'database_connections' => [
|
|
354
|
+
'meine_website' => [
|
|
355
|
+
'host' => 'server.example.com',
|
|
356
|
+
'user' => 'ssh-user',
|
|
357
|
+
'port' => 22,
|
|
358
|
+
'key' => '~/.ssh/id_rsa', // Auf dem Server, nicht lokal!
|
|
359
|
+
'web_root' => '/var/www/html',
|
|
360
|
+
'cms' => 'contao',
|
|
361
|
+
],
|
|
362
|
+
],
|
|
363
|
+
\`\`\`
|
|
364
|
+
|
|
365
|
+
Siehe \`docs/DatabaseGateway.md\` für die vollständige Dokumentation inkl. SQL-Beispiele und CMS-Tabellen.
|
|
366
|
+
|
|
341
367
|
## Conversation Tests
|
|
342
368
|
|
|
343
369
|
Definiere Tests um Prompt-Änderungen automatisch zu validieren:
|