taskmonkey-cli 0.9.0 → 0.10.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/package.json +1 -1
- package/skills/gitignore +1 -0
- package/src/commands/pull.js +65 -6
- package/.tmrc +0 -7
package/package.json
CHANGED
package/skills/gitignore
CHANGED
package/src/commands/pull.js
CHANGED
|
@@ -38,21 +38,35 @@ export async function pull() {
|
|
|
38
38
|
|
|
39
39
|
// Write docs if available
|
|
40
40
|
if (docs?.files) {
|
|
41
|
-
const docsDir = join(config._configDir, 'docs');
|
|
42
|
-
mkdirSync(docsDir, { recursive: true });
|
|
43
41
|
for (const [name, content] of Object.entries(docs.files)) {
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// shared/ files go to shared/, docs go to docs/
|
|
43
|
+
const targetDir = name.startsWith('shared/')
|
|
44
|
+
? join(config._configDir, 'shared')
|
|
45
|
+
: join(config._configDir, 'docs');
|
|
46
|
+
const fileName = name.startsWith('shared/') ? name.substring(7) : name;
|
|
47
|
+
mkdirSync(targetDir, { recursive: true });
|
|
48
|
+
writeFileSync(join(targetDir, fileName), content);
|
|
49
|
+
console.log(chalk.gray(` ${name.startsWith('shared/') ? 'shared' : 'docs'}/${fileName}`));
|
|
46
50
|
written++;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
// Create CLAUDE.md if it doesn't exist
|
|
54
|
+
// Create CLAUDE.md if it doesn't exist, otherwise append missing notice blocks.
|
|
55
|
+
// Each block is identified by a marker line so we never duplicate content.
|
|
51
56
|
const claudeMdPath = join(config._configDir, 'CLAUDE.md');
|
|
52
57
|
if (!existsSync(claudeMdPath)) {
|
|
53
58
|
writeFileSync(claudeMdPath, generateClaudeMd(config.tenant));
|
|
54
59
|
console.log(chalk.cyan(` CLAUDE.md (created)`));
|
|
55
60
|
written++;
|
|
61
|
+
} else {
|
|
62
|
+
const existing = readFileSync(claudeMdPath, 'utf8');
|
|
63
|
+
const cmsMarker = '<!-- tm:cms-docs-notice -->';
|
|
64
|
+
if (!existing.includes(cmsMarker)) {
|
|
65
|
+
const block = `\n\n${cmsMarker}\n## CMS-Wissen (Datenbank)\n\nIm Ordner \`docs/cms/\` liegen Wissens-Dokumentationen für die wichtigsten CMS:\n\n- \`contao.md\` — Contao 4.x/5.x (vollständig)\n- \`wordpress.md\` — WordPress (Core, vollständig)\n- \`typo3.md\`, \`drupal.md\`, \`joomla.md\` — Stubs\n\nWenn dein Tenant eines dieser CMS einsetzt, lies die passende Datei und kopiere die nötigen Tabellen-/Pattern-Sektionen direkt in das System-Prompt oder den passenden Monkey-Task-Prompt. Die Dateien werden **nicht** automatisch geladen.\n`;
|
|
66
|
+
writeFileSync(claudeMdPath, existing + block);
|
|
67
|
+
console.log(chalk.cyan(` CLAUDE.md (updated: cms-docs notice)`));
|
|
68
|
+
written++;
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
|
|
58
72
|
// Create AGENTS.md (for Codex, Copilot, etc.) if it doesn't exist
|
|
@@ -414,7 +428,32 @@ Key konvertieren: \`ssh-keygen -p -m PEM -P "passphrase" -N "" -f key\`
|
|
|
414
428
|
|
|
415
429
|
Siehe \`docs/DatabaseGateway.md\` für Troubleshooting und vollständige Feld-Referenz.
|
|
416
430
|
|
|
417
|
-
|
|
431
|
+
## CMS-Wissen (Datenbank)
|
|
432
|
+
|
|
433
|
+
Im Ordner \`docs/cms/\` liegen Wissens-Dokumentationen für die wichtigsten CMS:
|
|
434
|
+
|
|
435
|
+
- \`contao.md\` — Contao 4.x/5.x (vollständig)
|
|
436
|
+
- \`wordpress.md\` — WordPress (Core, vollständig)
|
|
437
|
+
- \`typo3.md\` — Stub
|
|
438
|
+
- \`drupal.md\` — Stub
|
|
439
|
+
- \`joomla.md\` — Stub
|
|
440
|
+
|
|
441
|
+
**Wenn dein Tenant eines dieser CMS einsetzt:**
|
|
442
|
+
|
|
443
|
+
1. Lies die passende \`docs/cms/<cms>.md\` Datei
|
|
444
|
+
2. Identifiziere die Tabellen, Felder und Patterns, die der konkrete Use-Case braucht
|
|
445
|
+
3. **Kopiere die nötigen Abschnitte direkt in das Tenant-Prompt** —
|
|
446
|
+
meist nach \`prompts/system.php\` oder \`monkey_tasks/<task>.prompt\`
|
|
447
|
+
4. Kürze: nicht alle Tabellen müssen rein, nur was wirklich gebraucht wird
|
|
448
|
+
|
|
449
|
+
Die Dateien werden **nicht** automatisch in den Prompt geladen. Sie sind reine
|
|
450
|
+
Doku — du entscheidest, was für deinen Tenant relevant ist.
|
|
451
|
+
|
|
452
|
+
> **Niemals raten**: Wenn du einen Stub ergänzt, hole dir das Schema aus einer
|
|
453
|
+
> echten Installation (\`SHOW CREATE TABLE\`) und teste alle SQL-Patterns gegen
|
|
454
|
+
> eine reale Datenbank.
|
|
455
|
+
|
|
456
|
+
Siehe \`docs/DatabaseGateway.md\` für die Database-Gateway-Dokumentation.
|
|
418
457
|
|
|
419
458
|
## Conversation Tests
|
|
420
459
|
|
|
@@ -448,6 +487,26 @@ Optimieren: \`tm optimize-prompt\`
|
|
|
448
487
|
- Handler-Signatur: \`function(array \\$results, array \\$args, array \\$ctx): array\`
|
|
449
488
|
- Immer \`['success' => true/false]\` im Return-Array
|
|
450
489
|
- \`\\$ctx['tool']('name', \\$args)\` für verschachtelte Tool-Aufrufe
|
|
490
|
+
|
|
491
|
+
## SICHERHEITSREGELN FÜR HANDLER-CODE
|
|
492
|
+
|
|
493
|
+
Handler-Code wird auf dem Server validiert. Folgende Funktionen sind **VERBOTEN**:
|
|
494
|
+
|
|
495
|
+
**Shell/Code-Ausführung:** \`shell_exec\`, \`exec\`, \`system\`, \`passthru\`, \`eval\`, \`assert\`
|
|
496
|
+
**Dateisystem direkt:** \`file_get_contents\`, \`file_put_contents\`, \`fopen\`, \`unlink\`, \`glob\`, \`scandir\`
|
|
497
|
+
**Netzwerk direkt:** \`curl_init\`, \`fsockopen\`, \`new Cake\\Http\\Client\`
|
|
498
|
+
**Includes:** \`include\`, \`require\`, \`include_once\`, \`require_once\`
|
|
499
|
+
**Datenbank direkt:** \`new PDO\`, \`new mysqli\`, \`Configure::read('Tenants.')\`
|
|
500
|
+
**Backticks:** \\\`command\\\`
|
|
501
|
+
|
|
502
|
+
**Stattdessen nutzen:**
|
|
503
|
+
- \`\\$ctx['tool']('toolName', \\$args)\` — für API-Calls, DB-Zugriff, alles externe
|
|
504
|
+
- \`\\$ctx['tmp_path']\` — für temporäre Dateien (tenant-isoliert)
|
|
505
|
+
- \`\\$ctx['log_path']\` — für Log-Dateien (tenant-isoliert)
|
|
506
|
+
- \`\\$ctx['tool']('logMessage', ['message' => '...'])\` — zum Loggen/Debuggen
|
|
507
|
+
|
|
508
|
+
**Warum?** Jeder Handler läuft im Server-Kontext. Direkter Dateizugriff könnte andere Tenants lesen.
|
|
509
|
+
Alle externen Operationen MÜSSEN über \`\\$ctx['tool']()\` laufen — das ist tenant-isoliert und geloggt.
|
|
451
510
|
`;
|
|
452
511
|
}
|
|
453
512
|
|
package/.tmrc
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": "https://gpt.meco-media.com",
|
|
3
|
-
"tenant": "bloomify",
|
|
4
|
-
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJtZWNvZ3B0Iiwic3ViIjoiYzAyZWYyMjItMDU1MC00OTgwLTg0ODYtNzIzOTJmZDI2ZjY5IiwiZW1haWwiOiJtYXJjdXMuZ29lZGVAbWVjby1tZWRpYS5jb20iLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NzUxNTY4NDksImV4cCI6MTc3NTI0MzI0OX0.bpfHNBOuq1un8Psc89Xevn-Ibo4YVAYNNwDRYe6fb4A",
|
|
5
|
-
"refresh_token": "5c9eb7bacec249d2aacb57402f3f5fedee2faf2796d721be6c02970653e9186b",
|
|
6
|
-
"tenant_path": "."
|
|
7
|
-
}
|