create-byan-agent 2.4.1 → 2.4.3
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/CHANGELOG.md +42 -0
- package/install/bin/create-byan-agent-v2.js +91 -41
- package/install/lib/phase2-chat.js +16 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [2.4.3] - 2026-02-11
|
|
11
|
+
|
|
12
|
+
### 🐛 Fixed - Codex Trusted Directory + Auth Loop
|
|
13
|
+
|
|
14
|
+
**Codex Fix:** Added `--skip-git-repo-check` to `codex exec` command to allow Phase 2 chat when not inside a trusted git repository.
|
|
15
|
+
|
|
16
|
+
**Auth Flow Improvement:** Replaced simple version check with real authentication verification:
|
|
17
|
+
- **Copilot**: `gh auth status` (actual login check)
|
|
18
|
+
- **Claude**: `claude -p "reply OK" --max-turns 1` (real API call)
|
|
19
|
+
- **Codex**: version check (no auth status command available)
|
|
20
|
+
|
|
21
|
+
If not authenticated, user gets 3 choices: Retry (loop), Auto mode (skip AI chat), or Cancel. No more silent bypass.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## [2.4.2] - 2026-02-11
|
|
26
|
+
|
|
27
|
+
### 🐛 Fixed - Claude Phase 2 System Prompt Separation
|
|
28
|
+
|
|
29
|
+
**Problem:** On Windows 11, Claude Code Phase 2 chat responded with generic "How can I help you today?" instead of acting as Yanstaller persona.
|
|
30
|
+
|
|
31
|
+
**Root Cause:** `claude -p "entire_blob"` treats the argument as a user query, not system instructions. The entire system context (Hermes docs, agent catalog, conversation history, instructions) was passed as `-p` argument. Claude ignored it and responded with its default greeting.
|
|
32
|
+
|
|
33
|
+
**Fix:** Split system prompt from user message using proper Claude Code CLI flags:
|
|
34
|
+
- System context → `--append-system-prompt-file` (temp file, auto-cleaned)
|
|
35
|
+
- User message → `-p` (just the actual user query)
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
// Before (broken): everything as -p argument
|
|
39
|
+
runCliCommand('claude', ['-p', fullPrompt], projectRoot);
|
|
40
|
+
|
|
41
|
+
// After (fixed): proper separation
|
|
42
|
+
runCliCommand('claude', [
|
|
43
|
+
'-p', message, // user query only
|
|
44
|
+
'--append-system-prompt-file', tmpFile // system context in file
|
|
45
|
+
], projectRoot);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Impact:** Claude Code Phase 2 now correctly receives Yanstaller persona, Hermes knowledge, and conversation history as system instructions while treating user input as the actual query.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
10
52
|
## [2.4.0] - 2026-02-11
|
|
11
53
|
|
|
12
54
|
### ✨ Added - Claude Code Native Agent Integration
|
|
@@ -684,52 +684,102 @@ async function install() {
|
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
//
|
|
687
|
+
// Verify authentication for selected platform
|
|
688
688
|
if (selectedPlatform && installMode === 'custom') {
|
|
689
689
|
console.log('');
|
|
690
690
|
console.log(chalk.gray('🔐 Vérification de l\'authentification...'));
|
|
691
691
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
692
|
+
let isAuthenticated = false;
|
|
693
|
+
|
|
694
|
+
while (!isAuthenticated) {
|
|
695
|
+
try {
|
|
696
|
+
let authCheckCmd, authCheckArgs, loginInstructions;
|
|
697
|
+
const isWindows = process.platform === 'win32';
|
|
698
|
+
const spawnOpts = { encoding: 'utf8', timeout: 15000, stdio: 'pipe' };
|
|
699
|
+
if (isWindows) spawnOpts.shell = true;
|
|
700
|
+
|
|
701
|
+
if (selectedPlatform === 'copilot') {
|
|
702
|
+
// gh auth status returns non-zero if not logged in
|
|
703
|
+
authCheckCmd = 'gh';
|
|
704
|
+
authCheckArgs = ['auth', 'status'];
|
|
705
|
+
loginInstructions = [
|
|
706
|
+
`${chalk.cyan('gh auth login')}`
|
|
707
|
+
];
|
|
708
|
+
} else if (selectedPlatform === 'codex') {
|
|
709
|
+
// codex --version as basic check (no auth status command available)
|
|
710
|
+
authCheckCmd = 'codex';
|
|
711
|
+
authCheckArgs = ['--version'];
|
|
712
|
+
loginInstructions = [
|
|
713
|
+
`${chalk.cyan('codex login')}`
|
|
714
|
+
];
|
|
715
|
+
} else if (selectedPlatform === 'claude') {
|
|
716
|
+
// claude --version checks install; auth errors surface during -p calls
|
|
717
|
+
// Use 'claude -p "test" --max-turns 1' for real auth check
|
|
718
|
+
authCheckCmd = 'claude';
|
|
719
|
+
authCheckArgs = ['-p', 'reply OK', '--max-turns', '1'];
|
|
720
|
+
loginInstructions = [
|
|
721
|
+
`${chalk.cyan('claude login')}`,
|
|
722
|
+
`${chalk.gray('ou:')} ${chalk.cyan('export ANTHROPIC_API_KEY=sk-ant-...')}`,
|
|
723
|
+
`${chalk.gray('ou dans Claude Code:')} ${chalk.cyan('/login')}`
|
|
724
|
+
];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const res = spawnSync(authCheckCmd, authCheckArgs, spawnOpts);
|
|
728
|
+
|
|
729
|
+
if (res.error) throw res.error;
|
|
730
|
+
if (res.status !== 0) {
|
|
731
|
+
const stderr = (res.stderr || '').toString().trim();
|
|
732
|
+
throw new Error(stderr || `${selectedPlatform} returned exit code ${res.status}`);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
isAuthenticated = true;
|
|
736
|
+
console.log(chalk.green(`✓ ${selectedPlatform} authentifié et disponible`));
|
|
737
|
+
|
|
738
|
+
} catch (error) {
|
|
739
|
+
console.log('');
|
|
740
|
+
console.log(chalk.yellow(`⚠️ ${selectedPlatform} n'est pas authentifié ou non disponible`));
|
|
741
|
+
console.log(chalk.gray(` Erreur: ${(error.message || '').substring(0, 120)}`));
|
|
742
|
+
console.log('');
|
|
743
|
+
console.log(chalk.bold(' Pour vous connecter:'));
|
|
744
|
+
|
|
745
|
+
let loginInstructions;
|
|
746
|
+
if (selectedPlatform === 'copilot') {
|
|
747
|
+
loginInstructions = [`${chalk.cyan('gh auth login')}`];
|
|
748
|
+
} else if (selectedPlatform === 'codex') {
|
|
749
|
+
loginInstructions = [`${chalk.cyan('codex login')}`];
|
|
750
|
+
} else if (selectedPlatform === 'claude') {
|
|
751
|
+
loginInstructions = [
|
|
752
|
+
`${chalk.cyan('claude login')}`,
|
|
753
|
+
`${chalk.gray('ou:')} ${chalk.cyan('export ANTHROPIC_API_KEY=sk-ant-...')}`,
|
|
754
|
+
`${chalk.gray('ou dans Claude Code:')} ${chalk.cyan('/login')}`
|
|
755
|
+
];
|
|
756
|
+
}
|
|
757
|
+
loginInstructions.forEach((inst, i) => console.log(` ${i + 1}. ${inst}`));
|
|
758
|
+
console.log('');
|
|
759
|
+
|
|
760
|
+
const { authAction } = await inquirer.prompt([{
|
|
761
|
+
type: 'list',
|
|
762
|
+
name: 'authAction',
|
|
763
|
+
message: 'Que souhaitez-vous faire?',
|
|
764
|
+
choices: [
|
|
765
|
+
{ name: '🔄 Réessayer (après connexion dans un autre terminal)', value: 'retry' },
|
|
766
|
+
{ name: '⚡ Continuer en mode AUTO (sans conversation IA)', value: 'auto' },
|
|
767
|
+
{ name: '❌ Annuler l\'installation', value: 'cancel' }
|
|
768
|
+
]
|
|
769
|
+
}]);
|
|
770
|
+
|
|
771
|
+
if (authAction === 'retry') {
|
|
772
|
+
console.log(chalk.gray('\n🔐 Nouvelle vérification...'));
|
|
773
|
+
continue;
|
|
774
|
+
} else if (authAction === 'auto') {
|
|
775
|
+
installMode = 'auto';
|
|
776
|
+
selectedPlatform = null;
|
|
777
|
+
isAuthenticated = true; // exit loop
|
|
778
|
+
} else {
|
|
779
|
+
console.log(chalk.red('Installation annulée. Connectez-vous d\'abord à votre plateforme IA.'));
|
|
780
|
+
process.exit(1);
|
|
781
|
+
}
|
|
729
782
|
}
|
|
730
|
-
|
|
731
|
-
installMode = 'auto';
|
|
732
|
-
selectedPlatform = null;
|
|
733
783
|
}
|
|
734
784
|
}
|
|
735
785
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const { spawnSync } = require('child_process');
|
|
9
9
|
const path = require('path');
|
|
10
|
+
const os = require('os');
|
|
10
11
|
const fs = require('fs-extra');
|
|
11
12
|
const inquirer = require('inquirer');
|
|
12
13
|
const chalk = require('chalk');
|
|
@@ -193,9 +194,22 @@ Continue la conversation pour comprendre le projet et personnaliser les agents.`
|
|
|
193
194
|
result = runCliCommand('copilot', ['-p', fullPrompt, '-s'], projectRoot);
|
|
194
195
|
} else if (selectedPlatform === 'codex') {
|
|
195
196
|
// Codex takes prompt as argument to exec command
|
|
196
|
-
|
|
197
|
+
// --skip-git-repo-check needed when not in a trusted git repo
|
|
198
|
+
result = runCliCommand('codex', ['exec', '--skip-git-repo-check', fullPrompt], projectRoot);
|
|
197
199
|
} else if (selectedPlatform === 'claude') {
|
|
198
|
-
|
|
200
|
+
// Claude: separate system prompt from user query
|
|
201
|
+
// -p treats arg as user query; system context goes via --append-system-prompt-file
|
|
202
|
+
const claudeSystemCtx = `${systemContext}\n\n## Historique de conversation:\n${conversationHistory}\n\n## Instructions:\nRéponds de manière concise et naturelle. Si l'utilisateur dit "finaliser", génère le JSON de configuration.\nContinue la conversation pour comprendre le projet et personnaliser les agents.`;
|
|
203
|
+
const tmpFile = path.join(os.tmpdir(), `byan-claude-ctx-${Date.now()}.txt`);
|
|
204
|
+
fs.writeFileSync(tmpFile, claudeSystemCtx, 'utf8');
|
|
205
|
+
try {
|
|
206
|
+
result = runCliCommand('claude', [
|
|
207
|
+
'-p', message,
|
|
208
|
+
'--append-system-prompt-file', tmpFile
|
|
209
|
+
], projectRoot);
|
|
210
|
+
} finally {
|
|
211
|
+
try { fs.unlinkSync(tmpFile); } catch(e) {}
|
|
212
|
+
}
|
|
199
213
|
} else {
|
|
200
214
|
throw new Error(`Platform not supported: ${selectedPlatform}`);
|
|
201
215
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-byan-agent",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "BYAN v2.3.2 - Intelligent AI agent ecosystem with Hermes universal dispatcher + Multi-platform support (Copilot CLI, Claude, Codex) + Automatic LLM cost optimization (87.5% savings) + Node 12+ compatible",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|