create-byan-agent 2.23.0 → 2.26.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/CHANGELOG.md +230 -0
- package/README.md +9 -12
- package/install/bin/create-byan-agent-v2.js +29 -169
- package/install/lib/agent-generator.js +5 -5
- package/install/lib/byan-web-integration.js +1 -1
- package/install/lib/claude-native-setup.js +1 -1
- package/install/lib/phase2-chat.js +3 -10
- package/install/lib/platforms/claude-code.js +2 -2
- package/install/lib/platforms/index.js +0 -2
- package/install/lib/project-agents-generator.js +3 -3
- package/install/lib/staging-consent.js +3 -3
- package/install/lib/subagent-generator.js +3 -3
- package/install/lib/yanstaller/agent-launcher.js +1 -27
- package/install/lib/yanstaller/detector.js +4 -4
- package/install/lib/yanstaller/installer.js +0 -2
- package/install/lib/yanstaller/interviewer.js +1 -1
- package/install/lib/yanstaller/platform-selector.js +1 -13
- package/install/package.json +1 -1
- package/install/src/byan-v2/context/session-state.js +2 -2
- package/install/src/byan-v2/index.js +2 -6
- package/install/src/byan-v2/orchestrator/generation-state.js +4 -4
- package/install/src/webui/api.js +0 -2
- package/install/src/webui/chat/bridge.js +1 -13
- package/install/src/webui/chat/cli-detector.js +0 -23
- package/install/src/webui/public/app.js +1 -3
- package/install/src/webui/public/chat.html +0 -2
- package/install/src/webui/public/chat.js +0 -1
- package/install/src/webui/public/index.html +2 -2
- package/install/templates/.claude/CLAUDE.md +13 -2
- package/install/templates/.claude/agents/bmad-byan.md +1 -1
- package/install/templates/.claude/hooks/autobench-stop-guard.js +286 -0
- package/install/templates/.claude/hooks/drain-advisory.js +85 -0
- package/install/templates/.claude/hooks/fact-check-absolutes.js +1 -61
- package/install/templates/.claude/hooks/fact-check-claims.js +69 -0
- package/install/templates/.claude/hooks/fd-response-check.js +37 -46
- package/install/templates/.claude/hooks/inject-soul.js +64 -25
- package/install/templates/.claude/hooks/leantime-fd-sync.js +216 -0
- package/install/templates/.claude/hooks/lib/autobench-config.json +81 -0
- package/install/templates/.claude/hooks/lib/autobench-fc-enrich.js +251 -0
- package/install/templates/.claude/hooks/lib/autobench-ledger-report.js +253 -0
- package/install/templates/.claude/hooks/lib/autobench-runtime.js +199 -0
- package/install/templates/.claude/hooks/lib/fact-check-core.js +69 -0
- package/install/templates/.claude/hooks/lib/failure-detector.js +18 -4
- package/install/templates/.claude/hooks/lib/transcript-read.js +137 -0
- package/install/templates/.claude/hooks/soul-memory-check.js +49 -25
- package/install/templates/.claude/hooks/soul-memory-triggers.js +27 -8
- package/install/templates/.claude/hooks/stage-to-byan.js +25 -7
- package/install/templates/.claude/hooks/strict-stop-guard.js +4 -16
- package/install/templates/.claude/rules/benchmark.md +251 -0
- package/install/templates/.claude/rules/byan-agents.md +0 -1
- package/install/templates/.claude/rules/byan-api.md +64 -0
- package/install/templates/.claude/rules/fact-check.md +1 -1
- package/install/templates/.claude/rules/strict-mode.md +10 -9
- package/install/templates/.claude/settings.json +16 -0
- package/install/templates/.claude/skills/byan-benchmark/SKILL.md +159 -0
- package/install/templates/.claude/skills/byan-byan/SKILL.md +73 -12
- package/install/templates/.claude/skills/byan-fact-check/SKILL.md +1 -1
- package/install/templates/.claude/skills/byan-hermes-dispatch/SKILL.md +5 -6
- package/install/templates/.claude/skills/byan-insight/SKILL.md +56 -0
- package/install/templates/.claude/skills/byan-orchestrate/SKILL.md +11 -3
- package/install/templates/.claude/skills/byan-strict/SKILL.md +4 -1
- package/install/templates/.claude/workflows/INDEX.md +2 -1
- package/install/templates/.claude/workflows/byan-benchmark.js +328 -0
- package/install/templates/.claude/workflows/check-implementation-readiness.js +1 -1
- package/install/templates/_byan/_config/agent-manifest.csv +1 -1
- package/install/templates/_byan/_config/autobench.yaml +510 -0
- package/install/templates/_byan/_config/strict-mode.yaml +9 -3
- package/install/templates/_byan/_config/workflow-manifest.csv +1 -0
- package/install/templates/_byan/agent/byan/byan.md +1 -3
- package/install/templates/_byan/agent/byan-flat/byan.md +1 -3
- package/install/templates/_byan/agent/byan-test/byan-test.md +2 -2
- package/install/templates/_byan/agent/byan-test-flat/byan-test.md +2 -2
- package/install/templates/_byan/agent/byan.optimized/byan.optimized.md +2 -2
- package/install/templates/_byan/agent/byan.optimized-v2/byan.optimized-v2.md +2 -2
- package/install/templates/_byan/agent/claude/claude.md +0 -2
- package/install/templates/_byan/agent/codex/codex.md +0 -2
- package/install/templates/_byan/agent/rachid/rachid.md +2 -10
- package/install/templates/_byan/agent/rachid-flat/rachid.md +2 -11
- package/install/templates/_byan/agent/turbo-whisper/turbo-whisper.md +2 -5
- package/install/templates/_byan/agent/turbo-whisper-integration/turbo-whisper-integration.md +5 -13
- package/install/templates/_byan/agent/yanstaller/yanstaller.md +2 -24
- package/install/templates/_byan/config.yaml +0 -1
- package/install/templates/_byan/core/activation/soul-activation.md +3 -3
- package/install/templates/_byan/mcp/byan-mcp-server/bin/byan-insight-digest.js +31 -0
- package/install/templates/_byan/mcp/byan-mcp-server/bin/byan-sync-rules.js +20 -4
- package/install/templates/_byan/mcp/byan-mcp-server/lib/advisory-autofeed.js +96 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/index-generator.js +1 -1
- package/install/templates/_byan/mcp/byan-mcp-server/lib/insight-harvest.js +220 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/kanban.js +6 -3
- package/install/templates/_byan/mcp/byan-mcp-server/lib/leantime-fd-core.js +205 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/leantime-sync.js +415 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/outcome-buffer.js +64 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/precommit-gate.js +1 -1
- package/install/templates/_byan/mcp/byan-mcp-server/lib/strict-activation.js +1 -1
- package/install/templates/_byan/mcp/byan-mcp-server/lib/strict-mode.js +8 -0
- package/install/templates/_byan/mcp/byan-mcp-server/lib/sync-rules.js +172 -23
- package/install/templates/_byan/mcp/byan-mcp-server/lib/workflows-generator.js +1 -0
- package/install/templates/_byan/mcp/byan-mcp-server/server.js +262 -81
- package/install/templates/_byan/worker/launchers/README.md +4 -24
- package/install/templates/_byan/worker/workers.md +8 -9
- package/install/templates/_byan/workflow/simple/bmb/byan-benchmark/workflow.md +86 -0
- package/install/templates/_byan/workflow/simple/byan/feature-workflow.md +2 -2
- package/install/templates/docs/leantime-integration.md +160 -0
- package/package.json +3 -7
- package/src/byan-v2/context/session-state.js +2 -2
- package/src/byan-v2/generation/mantra-validator.js +3 -3
- package/src/byan-v2/index.js +1 -5
- package/src/byan-v2/integration/voice-integration.js +1 -1
- package/src/byan-v2/orchestrator/generation-state.js +4 -4
- package/src/loadbalancer/loadbalancer.js +1 -1
- package/src/staging/staging.js +20 -6
- package/install/bin/build-copilot-stubs.js +0 -138
- package/install/lib/platforms/copilot-cli.js +0 -123
- package/install/lib/platforms/vscode.js +0 -51
- package/install/src/byan-v2/context/copilot-context.js +0 -79
- package/install/src/webui/chat/copilot-adapter.js +0 -68
- package/install/templates/.claude/agents/bmad-marc.md +0 -25
- package/install/templates/.claude/skills/byan-marc/SKILL.md +0 -20
- package/install/templates/.github/agents/bmad-agent-bmad-master.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmb-agent-builder.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmb-module-builder.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-analyst.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-architect.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-dev.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-pm.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-quinn.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-sm.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-tech-writer.md +0 -16
- package/install/templates/.github/agents/bmad-agent-bmm-ux-designer.md +0 -16
- package/install/templates/.github/agents/bmad-agent-byan-test.md +0 -33
- package/install/templates/.github/agents/bmad-agent-byan-v2.md +0 -44
- package/install/templates/.github/agents/bmad-agent-byan.md +0 -1062
- package/install/templates/.github/agents/bmad-agent-carmack.md +0 -14
- package/install/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +0 -16
- package/install/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +0 -16
- package/install/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +0 -16
- package/install/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +0 -16
- package/install/templates/.github/agents/bmad-agent-cis-presentation-master.md +0 -16
- package/install/templates/.github/agents/bmad-agent-cis-storyteller.md +0 -16
- package/install/templates/.github/agents/bmad-agent-claude.md +0 -49
- package/install/templates/.github/agents/bmad-agent-codex.md +0 -49
- package/install/templates/.github/agents/bmad-agent-drawio.md +0 -45
- package/install/templates/.github/agents/bmad-agent-fact-checker.md +0 -16
- package/install/templates/.github/agents/bmad-agent-forgeron.md +0 -15
- package/install/templates/.github/agents/bmad-agent-jimmy.md +0 -15
- package/install/templates/.github/agents/bmad-agent-marc.md +0 -49
- package/install/templates/.github/agents/bmad-agent-mike.md +0 -15
- package/install/templates/.github/agents/bmad-agent-patnote.md +0 -49
- package/install/templates/.github/agents/bmad-agent-rachid.md +0 -48
- package/install/templates/.github/agents/bmad-agent-skeptic.md +0 -16
- package/install/templates/.github/agents/bmad-agent-tao.md +0 -14
- package/install/templates/.github/agents/bmad-agent-tea-tea.md +0 -16
- package/install/templates/.github/agents/bmad-agent-test-dynamic.md +0 -22
- package/install/templates/.github/agents/bmad-agent-yanstaller-interview.md +0 -50
- package/install/templates/.github/agents/bmad-agent-yanstaller-phase2.md +0 -189
- package/install/templates/.github/agents/bmad-agent-yanstaller.md +0 -350
- package/install/templates/.github/agents/expert-merise-agile.md +0 -178
- package/install/templates/.github/agents/franck.md +0 -379
- package/install/templates/.github/agents/hermes.md +0 -575
- package/install/templates/.github/extensions/byan-staging/extension.mjs +0 -169
- package/install/templates/.github/extensions/byan-staging/package.json +0 -8
- package/install/templates/_byan/agent/marc/marc-soul.md +0 -47
- package/install/templates/_byan/agent/marc/marc-tao.md +0 -77
- package/install/templates/_byan/agent/marc/marc.md +0 -324
- package/install/templates/_byan/agent/marc-flat/marc.md +0 -387
- package/install/templates/_byan/mcp/byan-mcp-server/lib/copilot.js +0 -148
- package/install/templates/_byan/worker/launchers/launch-yanstaller-copilot.md +0 -173
- package/install/templates/workers/cost-optimizer.js +0 -169
- package/src/byan-v2/context/copilot-context.js +0 -79
- package/src/core/dispatcher/execution-router.js +0 -66
|
@@ -113,8 +113,6 @@ async function copyAgentFile(agentName, targetPath) {
|
|
|
113
113
|
*/
|
|
114
114
|
async function generateStub(agentName, platform, targetPath) {
|
|
115
115
|
// TODO: Generate stub based on platform
|
|
116
|
-
// - Copilot CLI: .github/agents/{agentName}.md with YAML frontmatter
|
|
117
|
-
// - VSCode: Same as Copilot CLI
|
|
118
116
|
// - Claude Code: MCP config JSON
|
|
119
117
|
// - Codex: .codex/prompts/{agentName}.md
|
|
120
118
|
}
|
|
@@ -14,7 +14,7 @@ const platforms = require('../platforms');
|
|
|
14
14
|
/**
|
|
15
15
|
* @typedef {Object} PlatformChoice
|
|
16
16
|
* @property {string} name - Display name
|
|
17
|
-
* @property {string} id - Platform ID ('
|
|
17
|
+
* @property {string} id - Platform ID ('claude' | 'codex')
|
|
18
18
|
* @property {boolean} detected - Is platform installed?
|
|
19
19
|
* @property {string} [path] - Installation path if detected
|
|
20
20
|
* @property {boolean} native - Native integration available?
|
|
@@ -29,12 +29,6 @@ const platforms = require('../platforms');
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
const PLATFORM_INFO = {
|
|
32
|
-
'copilot-cli': {
|
|
33
|
-
displayName: 'GitHub Copilot CLI',
|
|
34
|
-
native: true,
|
|
35
|
-
specialist: 'marc',
|
|
36
|
-
icon: '🤖'
|
|
37
|
-
},
|
|
38
32
|
'claude': {
|
|
39
33
|
displayName: 'Claude Code',
|
|
40
34
|
native: true,
|
|
@@ -46,12 +40,6 @@ const PLATFORM_INFO = {
|
|
|
46
40
|
native: true, // NOW NATIVE!
|
|
47
41
|
specialist: 'codex',
|
|
48
42
|
icon: '📝'
|
|
49
|
-
},
|
|
50
|
-
'vscode': {
|
|
51
|
-
displayName: 'VS Code',
|
|
52
|
-
native: false,
|
|
53
|
-
specialist: null,
|
|
54
|
-
icon: '💻'
|
|
55
43
|
}
|
|
56
44
|
};
|
|
57
45
|
|
package/install/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-byan-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "BYAN v2.2.2 - Intelligent AI agent installer with multi-platform native support (GitHub Copilot CLI, Claude Code, Codex/OpenCode)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-byan-agent": "bin/create-byan-agent-v2.js"
|
|
@@ -52,17 +52,13 @@ class ByanV2 {
|
|
|
52
52
|
low: 30,
|
|
53
53
|
medium: 60
|
|
54
54
|
},
|
|
55
|
-
outputDir: './
|
|
56
|
-
env: customConfig.env ||
|
|
55
|
+
outputDir: './_byan-output/bmb-creations',
|
|
56
|
+
env: customConfig.env || 'standalone'
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
return { ...defaults, ...customConfig };
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
isCopilotContext() {
|
|
63
|
-
return this.config.env === 'copilot' || process.env.GITHUB_COPILOT === 'true';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
62
|
async startSession() {
|
|
67
63
|
this.logger.info('Starting BYAN session', {
|
|
68
64
|
event: 'session_start',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GenerationState - Story 4.4
|
|
3
|
-
* Generates agent profile in BMAD
|
|
4
|
-
*
|
|
3
|
+
* Generates agent profile in BMAD format
|
|
4
|
+
*
|
|
5
5
|
* Format:
|
|
6
6
|
* - YAML frontmatter (name, description)
|
|
7
7
|
* - XML structure (<agent>, <persona>, <menu>, <capabilities>)
|
|
8
|
-
* -
|
|
8
|
+
* - Saved under the _byan/agent/ layout
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
const Logger = require('../observability/logger');
|
|
@@ -178,7 +178,7 @@ class GenerationState {
|
|
|
178
178
|
*/
|
|
179
179
|
getDefaultSavePath() {
|
|
180
180
|
const name = this.sessionState.agentProfileDraft?.name || 'agent';
|
|
181
|
-
return
|
|
181
|
+
return `_byan/agent/${name}/${name}.md`;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
package/install/src/webui/api.js
CHANGED
|
@@ -82,8 +82,6 @@ function isByanInstalled(projectRoot) {
|
|
|
82
82
|
function detectPlatforms(projectRoot) {
|
|
83
83
|
const found = [];
|
|
84
84
|
const checks = [
|
|
85
|
-
{ name: 'copilot-cli', path: '.github/agents' },
|
|
86
|
-
{ name: 'vscode', path: '.vscode' },
|
|
87
85
|
{ name: 'claude', path: '.claude' },
|
|
88
86
|
{ name: 'codex', path: '.codex/prompts' }
|
|
89
87
|
];
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* Each CLI adapter extends Bridge and implements: start(), send(), stop()
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const fs = require('fs');
|
|
7
|
-
const path = require('path');
|
|
8
6
|
const layoutResolver = require('../../../../src/byan-v2/lib/layout-resolver');
|
|
9
7
|
|
|
10
8
|
class Bridge {
|
|
@@ -27,13 +25,7 @@ class Bridge {
|
|
|
27
25
|
resolveAgent(agentName) {
|
|
28
26
|
if (!agentName) return null;
|
|
29
27
|
|
|
30
|
-
//
|
|
31
|
-
const githubStub = path.join(this.projectRoot, '.github', 'agents', `bmad-agent-${agentName}.md`);
|
|
32
|
-
try {
|
|
33
|
-
if (fs.existsSync(githubStub)) return githubStub;
|
|
34
|
-
} catch { /* ignore */ }
|
|
35
|
-
|
|
36
|
-
// Then the layout resolver: Gen3 _byan/agent/<name>/ first, Gen2 flat +
|
|
28
|
+
// Layout resolver: Gen3 _byan/agent/<name>/ first, Gen2 flat +
|
|
37
29
|
// per-module, Gen1 _bmad/ fallback.
|
|
38
30
|
const hit = layoutResolver.resolveAgent(agentName, { projectRoot: this.projectRoot });
|
|
39
31
|
return hit ? hit.path : null;
|
|
@@ -66,10 +58,6 @@ function createBridge(cliName, options) {
|
|
|
66
58
|
const ClaudeAdapter = require('./claude-adapter');
|
|
67
59
|
return new ClaudeAdapter(options);
|
|
68
60
|
}
|
|
69
|
-
case 'copilot': {
|
|
70
|
-
const CopilotAdapter = require('./copilot-adapter');
|
|
71
|
-
return new CopilotAdapter(options);
|
|
72
|
-
}
|
|
73
61
|
case 'codex': {
|
|
74
62
|
const CodexAdapter = require('./codex-adapter');
|
|
75
63
|
return new CodexAdapter(options);
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
const { execFile } = require('child_process');
|
|
6
6
|
const fs = require('fs');
|
|
7
|
-
const path = require('path');
|
|
8
7
|
const layoutResolver = require('../../../../src/byan-v2/lib/layout-resolver');
|
|
9
8
|
|
|
10
9
|
const CLI_DEFINITIONS = [
|
|
11
10
|
{ name: 'claude', command: 'claude', versionArg: '--version' },
|
|
12
|
-
{ name: 'copilot', command: 'copilot', versionArg: '--version' },
|
|
13
11
|
{ name: 'codex', command: 'codex', versionArg: '--version' },
|
|
14
12
|
];
|
|
15
13
|
|
|
@@ -95,15 +93,6 @@ function parseFrontmatter(content) {
|
|
|
95
93
|
return fm;
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
function scanDir(dirPath) {
|
|
99
|
-
try {
|
|
100
|
-
if (!fs.existsSync(dirPath)) return [];
|
|
101
|
-
return fs.readdirSync(dirPath).filter((f) => f.endsWith('.md'));
|
|
102
|
-
} catch {
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
96
|
// Map a resolver layout (+ rel) to the legacy source label, so API responses
|
|
108
97
|
// stay stable: Gen2 flat / Gen3 -> 'byan', Gen2 per-module -> 'bmad-<mod>'.
|
|
109
98
|
function sourceForLayout(layout, rel) {
|
|
@@ -136,18 +125,6 @@ async function detectAgents(projectRoot) {
|
|
|
136
125
|
});
|
|
137
126
|
};
|
|
138
127
|
|
|
139
|
-
// Copilot stubs (.github/agents) — flat scan, with the bmad-agent- prefix.
|
|
140
|
-
// Listed first so a copilot stub wins the dedup, preserving prior priority.
|
|
141
|
-
const githubDir = path.join(projectRoot, '.github', 'agents');
|
|
142
|
-
for (const file of scanDir(githubDir)) {
|
|
143
|
-
const id = file
|
|
144
|
-
.replace(/\.md$/, '')
|
|
145
|
-
.replace(/^bmad-agent-/, '')
|
|
146
|
-
.replace(/\.backup\.\d+.*$/, '')
|
|
147
|
-
.replace(/\.optimized.*$/, '');
|
|
148
|
-
pushAgent(id, 'copilot', path.join(githubDir, file));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
128
|
// _byan agents via the layout resolver: Gen3 _byan/agent/<name>/ first, then
|
|
152
129
|
// Gen2 flat _byan/agents/ and per-module _byan/<module>/agents/ (deduped).
|
|
153
130
|
for (const a of layoutResolver.listAgents({ projectRoot })) {
|
|
@@ -130,7 +130,7 @@ class ByanApp {
|
|
|
130
130
|
);
|
|
131
131
|
html += this.detectionRow(true, 'Operating System', this.status.detection?.os || navigator.platform);
|
|
132
132
|
|
|
133
|
-
const platformNames = { '
|
|
133
|
+
const platformNames = { 'claude': 'Claude Code', 'codex': 'Codex' };
|
|
134
134
|
const detectedPlatforms = this.status.detection?.platforms || [];
|
|
135
135
|
if (detectedPlatforms.length > 0) {
|
|
136
136
|
for (const p of detectedPlatforms) {
|
|
@@ -191,8 +191,6 @@ class ByanApp {
|
|
|
191
191
|
];
|
|
192
192
|
|
|
193
193
|
const platformOptions = [
|
|
194
|
-
{ id: 'copilot-cli', label: 'GitHub Copilot CLI' },
|
|
195
|
-
{ id: 'vscode', label: 'VSCode Extension' },
|
|
196
194
|
{ id: 'claude', label: 'Claude Code' },
|
|
197
195
|
{ id: 'codex', label: 'Codex / OpenCode' }
|
|
198
196
|
];
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
</div>
|
|
22
22
|
<select id="cli-select" class="cli-select" aria-label="Select CLI backend">
|
|
23
23
|
<option value="claude">Claude Code</option>
|
|
24
|
-
<option value="copilot">GitHub Copilot</option>
|
|
25
24
|
<option value="codex">Codex</option>
|
|
26
25
|
</select>
|
|
27
26
|
<select id="model-select" class="model-select" aria-label="Select model">
|
|
@@ -183,7 +182,6 @@
|
|
|
183
182
|
<select id="setting-cli">
|
|
184
183
|
<option value="auto">Auto-detect</option>
|
|
185
184
|
<option value="claude">Claude Code</option>
|
|
186
|
-
<option value="copilot">GitHub Copilot</option>
|
|
187
185
|
<option value="codex">OpenCode/Codex</option>
|
|
188
186
|
</select>
|
|
189
187
|
</div>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class="step-content">
|
|
33
33
|
<h2>Welcome to BYAN</h2>
|
|
34
34
|
<p class="lead">Intelligent AI agent platform with multi-platform support.<br>
|
|
35
|
-
|
|
35
|
+
Claude Code and Codex.</p>
|
|
36
36
|
<div class="feature-grid">
|
|
37
37
|
<div class="feature-card">
|
|
38
38
|
<div class="feature-icon" aria-hidden="true">◆</div>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<div class="feature-card">
|
|
43
43
|
<div class="feature-icon" aria-hidden="true">◈</div>
|
|
44
44
|
<h3>Multi-Platform</h3>
|
|
45
|
-
<p>Install agents across
|
|
45
|
+
<p>Install agents across Claude Code and Codex simultaneously.</p>
|
|
46
46
|
</div>
|
|
47
47
|
<div class="feature-card">
|
|
48
48
|
<div class="feature-icon" aria-hidden="true">▸</div>
|
|
@@ -27,7 +27,6 @@ Voir @.claude/rules/hermes-dispatcher.md pour les commandes Hermes.
|
|
|
27
27
|
.claude/ # Integration Claude Code
|
|
28
28
|
CLAUDE.md # Ce fichier (instructions projet)
|
|
29
29
|
rules/ # Regles modulaires par domaine
|
|
30
|
-
.github/agents/ # Agents Copilot CLI (si installe)
|
|
31
30
|
```
|
|
32
31
|
|
|
33
32
|
## Regles de Code
|
|
@@ -99,7 +98,7 @@ Dans BYAN: tapez `[FC]` pour le sous-menu fact-check.
|
|
|
99
98
|
|
|
100
99
|
Mode d'enforcement anti-downgrade : empeche l'agent de livrer moins que demande
|
|
101
100
|
(MVP au lieu de prod, stub au lieu de feature, template bacle). Fonctionne sur
|
|
102
|
-
les
|
|
101
|
+
les 2 plateformes (Claude Code, Codex).
|
|
103
102
|
|
|
104
103
|
Protocole : lock du scope -> build complet -> self-verify >= 3 passes -> complete
|
|
105
104
|
(jeton d'audit). Le commit est bloque tant que la verification n'est pas acquise.
|
|
@@ -111,3 +110,15 @@ Protocole : lock du scope -> build complet -> self-verify >= 3 passes -> complet
|
|
|
111
110
|
- Persistance : sessions poussees vers l'API byan_web (autorite ; local = miroir/fallback offline) via `lib/strict-sync.js` ; migration `033` + `routes/strict-sessions.js` cote byan_web
|
|
112
111
|
|
|
113
112
|
Detail complet : voir @.claude/rules/strict-mode.md
|
|
113
|
+
|
|
114
|
+
<!-- BYAN-AUTOBENCH:BEGIN (Generated by byan-sync-rules from _byan/_config/autobench.yaml. Do not hand-edit.) -->
|
|
115
|
+
## BYAN Auto-Benchmark
|
|
116
|
+
|
|
117
|
+
Before asking the user to choose between options, benchmark the fork: render
|
|
118
|
+
ONE compact table (Option | <= 4 criteria | Niv + a best-first reco line) when
|
|
119
|
+
both gates hold (>= 2 non-substitutable options diverging on >= 1 weighted
|
|
120
|
+
criterion). Emit the marker verbatim before the table:
|
|
121
|
+
`<!-- BYAN-BENCH:done g1=<#options> g2=<#divergent-criteria> scope=<internal|external> conf=<assertive|lean> -->`.
|
|
122
|
+
A confirm, a destructive prompt, or an obvious default is not a fork — emit
|
|
123
|
+
`<!-- BYAN-BENCH:skip reason=.. -->` instead. Full doctrine: see @.claude/rules/benchmark.md
|
|
124
|
+
<!-- BYAN-AUTOBENCH:END -->
|
|
@@ -120,7 +120,7 @@ Meta-Agent Creator + Intelligent Interviewer + Brainstorming Expert
|
|
|
120
120
|
- Systematically apply 64 mantras to ensure quality and best practices
|
|
121
121
|
- Perform MCD ⇄ MCT validation to ensure data-treatment coherence
|
|
122
122
|
- Evaluate consequences of actions using 10-dimension checklist
|
|
123
|
-
- Generate agents for
|
|
123
|
+
- Generate agents for Claude Code, Codex
|
|
124
124
|
- Support incremental agent evolution sprint-by-sprint
|
|
125
125
|
- Apply TDD principles at conceptual level
|
|
126
126
|
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Stop hook — BYAN Auto-Benchmark end-of-turn guard.
|
|
4
|
+
*
|
|
5
|
+
* Goal : when the assistant's finished message presents a CHOICE between
|
|
6
|
+
* options (a fork) but did NOT emit a BYAN-BENCH marker, the agent skipped the
|
|
7
|
+
* benchmark doctrine. The hook blocks ONCE to force exactly one regeneration in
|
|
8
|
+
* which the agent re-presents the fork as the compact benchmark table and emits
|
|
9
|
+
* the marker. It never loops : a block-token keyed on the message content makes
|
|
10
|
+
* the second pass non-blocking by construction.
|
|
11
|
+
*
|
|
12
|
+
* Shipped DISARMED (approach C) : the hook observes and ledgers every turn but
|
|
13
|
+
* does not block until explicitly armed (enforcement.armed in the config —
|
|
14
|
+
* config-only, set via the YAML + byan-sync-rules, no loose flag file). Day one
|
|
15
|
+
* is zero noise / zero latency; the net is pre-built but inert until the user
|
|
16
|
+
* opts in. A disarmed turn that WOULD have fired is recorded as
|
|
17
|
+
* observed-disarmed-fork so arming later is an informed decision.
|
|
18
|
+
*
|
|
19
|
+
* Detection is ARTIFACT-primary with a regex fallback. The decision order :
|
|
20
|
+
* 1. MARKER : a BYAN-BENCH:done|skip marker -> satisfied (the agent already
|
|
21
|
+
* benchmarked, or deliberately skipped a degenerate fork).
|
|
22
|
+
* 2. NEVER : y/n confirms and destructive prompts are exempt — we never
|
|
23
|
+
* benchmark "proceed?" or "rm -rf".
|
|
24
|
+
* 3. ESCAPE : the session flag (.byan-autobench/off) or the cross-session
|
|
25
|
+
* config opt-out suppresses all blocking.
|
|
26
|
+
* 4. DISARMED : not armed -> observe + ledger, never block (the default).
|
|
27
|
+
* 5. BLOCKED : a block-token for this turn already exists -> the regen pass,
|
|
28
|
+
* do not block again.
|
|
29
|
+
* 6. FORK : a fork is present when an AskUserQuestion tool_use artifact is
|
|
30
|
+
* in the finished turn (the unambiguous, primary signal). The
|
|
31
|
+
* choice-language regex is only a LAST-RESORT fallback for
|
|
32
|
+
* inline-prose forks that never called the tool.
|
|
33
|
+
*
|
|
34
|
+
* Honest ceiling (GH #28273) : the Stop hook is REACTIVE. It cannot intercept
|
|
35
|
+
* before the message is displayed; it can only force a regeneration after the
|
|
36
|
+
* fact. The proactive half is the doctrine the agent self-applies. This hook is
|
|
37
|
+
* the safety net, not a pre-display filter.
|
|
38
|
+
*
|
|
39
|
+
* Non-blocking on any IO/parse error : the hook never traps a turn it cannot
|
|
40
|
+
* read. Every invocation appends one fire/miss line to the ledger.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
'use strict';
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
loadAutobenchConfig,
|
|
47
|
+
escapeHatchActive,
|
|
48
|
+
isArmed,
|
|
49
|
+
readBlockToken,
|
|
50
|
+
writeBlockToken,
|
|
51
|
+
appendLedger,
|
|
52
|
+
extractLastAssistantText,
|
|
53
|
+
extractLastAssistantContent,
|
|
54
|
+
hasChoiceArtifact,
|
|
55
|
+
turnHash,
|
|
56
|
+
readStdin,
|
|
57
|
+
parseJson,
|
|
58
|
+
} = require('./lib/autobench-runtime');
|
|
59
|
+
|
|
60
|
+
// Reconstruct a RegExp from a {source, flags} config pair. Returns null on a
|
|
61
|
+
// malformed pattern so a single bad config entry never throws the whole hook.
|
|
62
|
+
function compileRegex(spec) {
|
|
63
|
+
if (!spec || typeof spec.source !== 'string') return null;
|
|
64
|
+
try {
|
|
65
|
+
return new RegExp(spec.source, spec.flags || '');
|
|
66
|
+
} catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function countMatches(text, re) {
|
|
72
|
+
if (!re) return 0;
|
|
73
|
+
// A global regex is required to count; clone with the g flag if absent.
|
|
74
|
+
const g = re.flags.includes('g') ? re : new RegExp(re.source, re.flags + 'g');
|
|
75
|
+
const m = text.match(g);
|
|
76
|
+
return m ? m.length : 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function anyRegexMatches(text, specs) {
|
|
80
|
+
if (!Array.isArray(specs)) return false;
|
|
81
|
+
return specs.some((spec) => {
|
|
82
|
+
const re = compileRegex(spec);
|
|
83
|
+
return Boolean(re) && re.test(text);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Evaluate the choice-language signals with their per-signal thresholds.
|
|
88
|
+
// A signal fires when : (min_matches present -> >= that many matches) OR
|
|
89
|
+
// (requires_candidates present -> the signal matches AND >= N candidate tokens
|
|
90
|
+
// co-occur) OR (a plain match otherwise).
|
|
91
|
+
function hasChoiceLanguage(text, config) {
|
|
92
|
+
const specs = (config && config.choice_language) || [];
|
|
93
|
+
const candidateRe = compileRegex(config && config.candidate_token);
|
|
94
|
+
const candidateCount = candidateRe ? countMatches(text, candidateRe) : 0;
|
|
95
|
+
|
|
96
|
+
return specs.some((spec) => {
|
|
97
|
+
const re = compileRegex(spec);
|
|
98
|
+
if (!re) return false;
|
|
99
|
+
|
|
100
|
+
if (typeof spec.min_matches === 'number') {
|
|
101
|
+
return countMatches(text, re) >= spec.min_matches;
|
|
102
|
+
}
|
|
103
|
+
if (typeof spec.requires_candidates === 'number') {
|
|
104
|
+
return re.test(text) && candidateCount >= spec.requires_candidates;
|
|
105
|
+
}
|
|
106
|
+
return re.test(text);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function hasMarker(text, config) {
|
|
111
|
+
const spec = config && config.marker_patterns && config.marker_patterns.any;
|
|
112
|
+
const re = compileRegex(spec);
|
|
113
|
+
return Boolean(re) && re.test(text);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function hasNeverListed(text, config) {
|
|
117
|
+
return anyRegexMatches(text, config && config.never_list);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Parse the marker fields (g1/g2/scope) for the ledger. Best-effort : a marker
|
|
121
|
+
// without fields still satisfies; the fields only enrich the audit trail.
|
|
122
|
+
function readMarkerFields(text, config) {
|
|
123
|
+
const fields = (config && config.marker_fields) || {};
|
|
124
|
+
const out = {};
|
|
125
|
+
const g1 = compileRegex(fields.g1);
|
|
126
|
+
const g2 = compileRegex(fields.g2);
|
|
127
|
+
const scope = compileRegex(fields.scope);
|
|
128
|
+
let m;
|
|
129
|
+
if (g1 && (m = text.match(g1))) out.g1 = Number(m[1]);
|
|
130
|
+
if (g2 && (m = text.match(g2))) out.g2 = Number(m[1]);
|
|
131
|
+
if (scope && (m = text.match(scope))) out.scope = m[1];
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function markerKind(text, config) {
|
|
136
|
+
const mp = (config && config.marker_patterns) || {};
|
|
137
|
+
const doneRe = compileRegex(mp.done);
|
|
138
|
+
const skipRe = compileRegex(mp.skip);
|
|
139
|
+
if (doneRe && doneRe.test(text)) return 'done';
|
|
140
|
+
if (skipRe && skipRe.test(text)) return 'skip';
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Pure decision. No IO, no clock — fully unit-testable.
|
|
146
|
+
*
|
|
147
|
+
* Inputs : lastAssistantText (the finished prose), artifact (true when an
|
|
148
|
+
* AskUserQuestion tool_use was in the finished turn — the caller computes this
|
|
149
|
+
* from the raw content so the decision stays pure), armed (the enforcement gate),
|
|
150
|
+
* config, escapeHatch, blocked.
|
|
151
|
+
*
|
|
152
|
+
* Detection is ARTIFACT-primary : a real fork is present when the artifact is
|
|
153
|
+
* there OR, as a last-resort fallback, when the choice-language regex matches
|
|
154
|
+
* inline prose. block is true IFF a fork is present AND no marker AND not
|
|
155
|
+
* never-listed AND escape-hatch inactive AND ARMED AND not already blocked.
|
|
156
|
+
*
|
|
157
|
+
* Returns { block, reason?, ledger } where ledger is the audit record.
|
|
158
|
+
*/
|
|
159
|
+
function decideBench({ lastAssistantText, artifact, armed, config, escapeHatch, blocked }) {
|
|
160
|
+
const text = lastAssistantText || '';
|
|
161
|
+
|
|
162
|
+
const marker = hasMarker(text, config);
|
|
163
|
+
const neverHit = hasNeverListed(text, config);
|
|
164
|
+
const choiceLang = hasChoiceLanguage(text, config);
|
|
165
|
+
const hasArtifact = artifact === true;
|
|
166
|
+
// ARTIFACT-primary : the structural AskUserQuestion tool_use is the unambiguous
|
|
167
|
+
// fork signal. The lexical regex is only the fallback for prose forks that
|
|
168
|
+
// never called the tool.
|
|
169
|
+
const fork = hasArtifact || choiceLang;
|
|
170
|
+
const detection = hasArtifact ? 'artifact' : choiceLang ? 'regex-fallback' : null;
|
|
171
|
+
const armedOn = armed === true;
|
|
172
|
+
|
|
173
|
+
const ledger = { neverHit, choiceLang, artifact: hasArtifact, marker, detection, armed: armedOn };
|
|
174
|
+
|
|
175
|
+
if (marker) {
|
|
176
|
+
const kind = markerKind(text, config);
|
|
177
|
+
Object.assign(ledger, readMarkerFields(text, config));
|
|
178
|
+
ledger.event = kind === 'skip' ? 'satisfied-skip' : 'satisfied-marker';
|
|
179
|
+
return { block: false, ledger };
|
|
180
|
+
}
|
|
181
|
+
if (neverHit) {
|
|
182
|
+
ledger.event = 'satisfied-never';
|
|
183
|
+
return { block: false, ledger };
|
|
184
|
+
}
|
|
185
|
+
if (escapeHatch) {
|
|
186
|
+
ledger.event = 'satisfied-escape';
|
|
187
|
+
return { block: false, ledger };
|
|
188
|
+
}
|
|
189
|
+
if (!armedOn) {
|
|
190
|
+
// DISARMED by default (approach C) : never block. Record whether a fork WOULD
|
|
191
|
+
// have fired, so arming later is data-informed, not a blind flip.
|
|
192
|
+
ledger.event = fork ? 'observed-disarmed-fork' : 'observed-disarmed';
|
|
193
|
+
return { block: false, ledger };
|
|
194
|
+
}
|
|
195
|
+
if (blocked) {
|
|
196
|
+
// The regen pass : we already blocked this exact content once.
|
|
197
|
+
ledger.event = 'satisfied-already-blocked';
|
|
198
|
+
return { block: false, ledger };
|
|
199
|
+
}
|
|
200
|
+
if (!fork) {
|
|
201
|
+
ledger.event = 'no-choice';
|
|
202
|
+
return { block: false, ledger };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// A genuine miss while ARMED : the agent offered a fork without benchmarking it.
|
|
206
|
+
const reason =
|
|
207
|
+
(config && config.banners && config.banners.stop_block) ||
|
|
208
|
+
'Auto-benchmark: you presented a choice without a BYAN-BENCH marker. Re-present it as the compact benchmark table and emit the marker.';
|
|
209
|
+
ledger.event = 'fired-block';
|
|
210
|
+
return { block: true, reason, ledger };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (require.main === module) {
|
|
214
|
+
(async () => {
|
|
215
|
+
// Wrap everything : the hook must NEVER trap a turn it cannot read.
|
|
216
|
+
try {
|
|
217
|
+
const config = loadAutobenchConfig();
|
|
218
|
+
const payload = parseJson(await readStdin());
|
|
219
|
+
const lastAssistantText = extractLastAssistantText(payload);
|
|
220
|
+
// ARTIFACT-primary signal : read the RAW last-assistant content (the block
|
|
221
|
+
// array extractLastAssistantText flattens away) so the structural
|
|
222
|
+
// AskUserQuestion tool_use is visible to the decision.
|
|
223
|
+
const artifact = hasChoiceArtifact(extractLastAssistantContent(payload));
|
|
224
|
+
|
|
225
|
+
const hash = turnHash(lastAssistantText);
|
|
226
|
+
const escapeHatch = escapeHatchActive(config);
|
|
227
|
+
const armed = isArmed(config);
|
|
228
|
+
// Loop-guard : the content-hash block token is primary; stop_hook_active is
|
|
229
|
+
// an additional belt from the runtime (a prior Stop hook already blocked
|
|
230
|
+
// this turn), so we never depend on it alone.
|
|
231
|
+
const blocked = readBlockToken(hash) || payload.stop_hook_active === true;
|
|
232
|
+
|
|
233
|
+
const decision = decideBench({ lastAssistantText, artifact, armed, config, escapeHatch, blocked });
|
|
234
|
+
|
|
235
|
+
// Audit trail : one JSONL line per invocation. turnHash is content-only;
|
|
236
|
+
// any timestamp/session comes from the environment, kept out of the pure
|
|
237
|
+
// decision so it stays deterministic.
|
|
238
|
+
appendLedger(
|
|
239
|
+
{
|
|
240
|
+
turnHash: hash,
|
|
241
|
+
event: decision.ledger.event,
|
|
242
|
+
g1: decision.ledger.g1,
|
|
243
|
+
g2: decision.ledger.g2,
|
|
244
|
+
scope: decision.ledger.scope,
|
|
245
|
+
neverHit: decision.ledger.neverHit,
|
|
246
|
+
choiceLang: decision.ledger.choiceLang,
|
|
247
|
+
artifact: decision.ledger.artifact,
|
|
248
|
+
detection: decision.ledger.detection,
|
|
249
|
+
armed: decision.ledger.armed,
|
|
250
|
+
marker: decision.ledger.marker,
|
|
251
|
+
ts: process.env.BYAN_HOOK_TS || undefined,
|
|
252
|
+
session: process.env.CLAUDE_SESSION_ID || undefined,
|
|
253
|
+
},
|
|
254
|
+
config
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
if (!decision.block) {
|
|
258
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
259
|
+
process.exit(0);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Block-once : write the token BEFORE emitting the block so the
|
|
263
|
+
// regenerated turn (same content if the agent fails to fix) is exempt.
|
|
264
|
+
writeBlockToken(hash);
|
|
265
|
+
process.stdout.write(
|
|
266
|
+
JSON.stringify({ decision: 'block', reason: decision.reason, systemMessage: decision.reason })
|
|
267
|
+
);
|
|
268
|
+
process.exit(2);
|
|
269
|
+
} catch {
|
|
270
|
+
// Last-resort net : on any unexpected failure, let the turn end.
|
|
271
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
272
|
+
process.exit(0);
|
|
273
|
+
}
|
|
274
|
+
})();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
module.exports = {
|
|
278
|
+
decideBench,
|
|
279
|
+
hasChoiceLanguage,
|
|
280
|
+
hasMarker,
|
|
281
|
+
hasNeverListed,
|
|
282
|
+
markerKind,
|
|
283
|
+
readMarkerFields,
|
|
284
|
+
compileRegex,
|
|
285
|
+
countMatches,
|
|
286
|
+
};
|