@arcbridge/adapters 0.4.1 → 0.4.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/dist/index.d.ts +7 -1
- package/dist/index.js +183 -166
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,12 @@ declare class GeminiAdapter implements PlatformAdapter {
|
|
|
34
34
|
generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
declare class OpenCodeAdapter implements PlatformAdapter {
|
|
38
|
+
platform: string;
|
|
39
|
+
generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void;
|
|
40
|
+
generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
declare function getAdapter(platform: string): PlatformAdapter;
|
|
38
44
|
|
|
39
|
-
export { type AdapterOptions, ClaudeAdapter, CodexAdapter, CopilotAdapter, GeminiAdapter, type PlatformAdapter, getAdapter };
|
|
45
|
+
export { type AdapterOptions, ClaudeAdapter, CodexAdapter, CopilotAdapter, GeminiAdapter, OpenCodeAdapter, type PlatformAdapter, getAdapter };
|
package/dist/index.js
CHANGED
|
@@ -289,7 +289,7 @@ var CopilotAdapter = class {
|
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
// src/codex/codex-adapter.ts
|
|
292
|
-
import { writeFileSync as
|
|
292
|
+
import { writeFileSync as writeFileSync5, existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
293
293
|
import { join as join4 } from "path";
|
|
294
294
|
|
|
295
295
|
// src/shared/skills.ts
|
|
@@ -328,37 +328,63 @@ Run the full review suite before completing a phase gate.
|
|
|
328
328
|
4. **Role checks** \u2014 optionally run \`arcbridge_run_role_check\` with specific roles (security-reviewer, quality-guardian)
|
|
329
329
|
5. **Complete phase** \u2014 if all checks pass, run \`arcbridge_complete_phase\` to validate gates and transition
|
|
330
330
|
`;
|
|
331
|
-
function generateSkills(targetDir, force = false) {
|
|
332
|
-
const
|
|
333
|
-
const syncPath = join3(
|
|
331
|
+
function generateSkills(targetDir, force = false, skillsDir) {
|
|
332
|
+
const dir = skillsDir ?? join3(targetDir, ".agents", "skills");
|
|
333
|
+
const syncPath = join3(dir, "arcbridge-sync", "SKILL.md");
|
|
334
334
|
if (force || !existsSync2(syncPath)) {
|
|
335
|
-
mkdirSync3(join3(
|
|
335
|
+
mkdirSync3(join3(dir, "arcbridge-sync"), { recursive: true });
|
|
336
336
|
writeFileSync3(syncPath, SYNC_SKILL, "utf-8");
|
|
337
337
|
}
|
|
338
|
-
const reviewPath = join3(
|
|
338
|
+
const reviewPath = join3(dir, "arcbridge-review", "SKILL.md");
|
|
339
339
|
if (force || !existsSync2(reviewPath)) {
|
|
340
|
-
mkdirSync3(join3(
|
|
340
|
+
mkdirSync3(join3(dir, "arcbridge-review"), { recursive: true });
|
|
341
341
|
writeFileSync3(reviewPath, REVIEW_SKILL, "utf-8");
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
// src/
|
|
346
|
-
|
|
345
|
+
// src/shared/marker-merge.ts
|
|
346
|
+
import { writeFileSync as writeFileSync4, existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
347
|
+
var MARKER = "<!-- arcbridge-generated -->";
|
|
348
|
+
function writeWithMarkerMerge(filePath, content) {
|
|
349
|
+
if (existsSync3(filePath)) {
|
|
350
|
+
const existing = readFileSync2(filePath, "utf-8");
|
|
351
|
+
const markerIndex = existing.indexOf(MARKER);
|
|
352
|
+
if (markerIndex >= 0) {
|
|
353
|
+
const userContent = existing.slice(0, markerIndex).trimEnd();
|
|
354
|
+
const prefix = userContent ? `${userContent}
|
|
355
|
+
|
|
356
|
+
` : "";
|
|
357
|
+
writeFileSync4(filePath, `${prefix}${MARKER}
|
|
358
|
+
|
|
359
|
+
${content}`, "utf-8");
|
|
360
|
+
} else {
|
|
361
|
+
const existingTrimmed = existing.trimEnd();
|
|
362
|
+
const prefix = existingTrimmed ? `${existingTrimmed}
|
|
363
|
+
|
|
364
|
+
` : "";
|
|
365
|
+
writeFileSync4(filePath, `${prefix}${MARKER}
|
|
366
|
+
|
|
367
|
+
${content}`, "utf-8");
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
writeFileSync4(filePath, `${MARKER}
|
|
371
|
+
|
|
372
|
+
${content}`, "utf-8");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// src/shared/instructions.ts
|
|
377
|
+
function generateInstructions(config, options) {
|
|
347
378
|
const lines = [
|
|
348
379
|
`# ${config.project_name}`,
|
|
349
380
|
"",
|
|
350
381
|
`> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,
|
|
351
|
-
""
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
"[mcp_servers.arcbridge]",
|
|
358
|
-
'command = "npx"',
|
|
359
|
-
'args = ["-y", "@arcbridge/mcp-server"]',
|
|
360
|
-
"```",
|
|
361
|
-
"",
|
|
382
|
+
""
|
|
383
|
+
];
|
|
384
|
+
if (options?.prefix) {
|
|
385
|
+
lines.push(...options.prefix);
|
|
386
|
+
}
|
|
387
|
+
lines.push(
|
|
362
388
|
"## Project Overview",
|
|
363
389
|
"",
|
|
364
390
|
`- **Type:** ${config.project_type}`,
|
|
@@ -408,7 +434,7 @@ function generateAgentsMd(config) {
|
|
|
408
434
|
"Activate the **phase-manager** role, then: `arcbridge_complete_phase`",
|
|
409
435
|
'\u2014 validates three gates: all tasks done, no critical drift, must-have quality scenarios (priority = "must") not failing.',
|
|
410
436
|
""
|
|
411
|
-
|
|
437
|
+
);
|
|
412
438
|
if (config.project_type === "nextjs-app-router" || config.project_type === "react-vite") {
|
|
413
439
|
lines.push(
|
|
414
440
|
"## React & Next.js Analysis",
|
|
@@ -419,53 +445,48 @@ function generateAgentsMd(config) {
|
|
|
419
445
|
""
|
|
420
446
|
);
|
|
421
447
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
"Activate roles with `arcbridge_activate_role` to get specialized context.",
|
|
426
|
-
"Roles are defined in `.arcbridge/agents/`.",
|
|
427
|
-
"",
|
|
428
|
-
"*Role table is appended below after agent configs are generated.*",
|
|
429
|
-
""
|
|
430
|
-
);
|
|
448
|
+
if (options?.suffix) {
|
|
449
|
+
lines.push(...options.suffix);
|
|
450
|
+
}
|
|
431
451
|
return lines.join("\n");
|
|
432
452
|
}
|
|
453
|
+
|
|
454
|
+
// src/codex/codex-adapter.ts
|
|
455
|
+
function generateAgentsMd(config) {
|
|
456
|
+
return generateInstructions(config, {
|
|
457
|
+
prefix: [
|
|
458
|
+
"## Codex MCP Setup",
|
|
459
|
+
"",
|
|
460
|
+
"Add this to your `~/.codex/config.toml` (one-time setup):",
|
|
461
|
+
"",
|
|
462
|
+
"```toml",
|
|
463
|
+
"[mcp_servers.arcbridge]",
|
|
464
|
+
'command = "npx"',
|
|
465
|
+
'args = ["-y", "@arcbridge/mcp-server"]',
|
|
466
|
+
"```",
|
|
467
|
+
""
|
|
468
|
+
],
|
|
469
|
+
suffix: [
|
|
470
|
+
"## Agent Roles",
|
|
471
|
+
"",
|
|
472
|
+
"Activate roles with `arcbridge_activate_role` to get specialized context.",
|
|
473
|
+
"Roles are defined in `.arcbridge/agents/`.",
|
|
474
|
+
"",
|
|
475
|
+
"*Role table is appended below after agent configs are generated.*",
|
|
476
|
+
""
|
|
477
|
+
]
|
|
478
|
+
});
|
|
479
|
+
}
|
|
433
480
|
var CodexAdapter = class {
|
|
434
481
|
platform = "codex";
|
|
435
482
|
generateProjectConfig(targetDir, config) {
|
|
436
483
|
const agentsMdContent = generateAgentsMd(config);
|
|
437
|
-
|
|
438
|
-
const marker = "<!-- arcbridge-generated -->";
|
|
439
|
-
if (existsSync3(agentsMdPath)) {
|
|
440
|
-
const existing = readFileSync2(agentsMdPath, "utf-8");
|
|
441
|
-
const markerIndex = existing.indexOf(marker);
|
|
442
|
-
if (markerIndex >= 0) {
|
|
443
|
-
const userContent = existing.slice(0, markerIndex).trimEnd();
|
|
444
|
-
const prefix = userContent ? `${userContent}
|
|
445
|
-
|
|
446
|
-
` : "";
|
|
447
|
-
writeFileSync4(agentsMdPath, `${prefix}${marker}
|
|
448
|
-
|
|
449
|
-
${agentsMdContent}`, "utf-8");
|
|
450
|
-
} else {
|
|
451
|
-
const existingTrimmed = existing.trimEnd();
|
|
452
|
-
const prefix = existingTrimmed ? `${existingTrimmed}
|
|
453
|
-
|
|
454
|
-
` : "";
|
|
455
|
-
writeFileSync4(agentsMdPath, `${prefix}${marker}
|
|
456
|
-
|
|
457
|
-
${agentsMdContent}`, "utf-8");
|
|
458
|
-
}
|
|
459
|
-
} else {
|
|
460
|
-
writeFileSync4(agentsMdPath, `${marker}
|
|
461
|
-
|
|
462
|
-
${agentsMdContent}`, "utf-8");
|
|
463
|
-
}
|
|
484
|
+
writeWithMarkerMerge(join4(targetDir, "AGENTS.md"), agentsMdContent);
|
|
464
485
|
}
|
|
465
486
|
generateAgentConfigs(targetDir, roles, options) {
|
|
466
487
|
const agentsMdPath = join4(targetDir, "AGENTS.md");
|
|
467
|
-
if (
|
|
468
|
-
let content =
|
|
488
|
+
if (existsSync4(agentsMdPath)) {
|
|
489
|
+
let content = readFileSync3(agentsMdPath, "utf-8");
|
|
469
490
|
const roleTable = [
|
|
470
491
|
"| Role | Description |",
|
|
471
492
|
"|------|-------------|",
|
|
@@ -483,111 +504,15 @@ ${agentsMdContent}`, "utf-8");
|
|
|
483
504
|
${roleTable}
|
|
484
505
|
`;
|
|
485
506
|
}
|
|
486
|
-
|
|
507
|
+
writeFileSync5(agentsMdPath, content, "utf-8");
|
|
487
508
|
}
|
|
488
509
|
generateSkills(targetDir, options?.force);
|
|
489
510
|
}
|
|
490
511
|
};
|
|
491
512
|
|
|
492
513
|
// src/gemini/gemini-adapter.ts
|
|
493
|
-
import { mkdirSync as mkdirSync4, writeFileSync as
|
|
514
|
+
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync6, existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
494
515
|
import { join as join5 } from "path";
|
|
495
|
-
var MARKER = "<!-- arcbridge-generated -->";
|
|
496
|
-
function writeWithMarkerMerge(filePath, content) {
|
|
497
|
-
if (existsSync4(filePath)) {
|
|
498
|
-
const existing = readFileSync3(filePath, "utf-8");
|
|
499
|
-
const markerIndex = existing.indexOf(MARKER);
|
|
500
|
-
if (markerIndex >= 0) {
|
|
501
|
-
const userContent = existing.slice(0, markerIndex).trimEnd();
|
|
502
|
-
const prefix = userContent ? `${userContent}
|
|
503
|
-
|
|
504
|
-
` : "";
|
|
505
|
-
writeFileSync5(filePath, `${prefix}${MARKER}
|
|
506
|
-
|
|
507
|
-
${content}`, "utf-8");
|
|
508
|
-
} else {
|
|
509
|
-
const existingTrimmed = existing.trimEnd();
|
|
510
|
-
const prefix = existingTrimmed ? `${existingTrimmed}
|
|
511
|
-
|
|
512
|
-
` : "";
|
|
513
|
-
writeFileSync5(filePath, `${prefix}${MARKER}
|
|
514
|
-
|
|
515
|
-
${content}`, "utf-8");
|
|
516
|
-
}
|
|
517
|
-
} else {
|
|
518
|
-
writeFileSync5(filePath, `${MARKER}
|
|
519
|
-
|
|
520
|
-
${content}`, "utf-8");
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
function generateStyleguide(config) {
|
|
524
|
-
const lines = [
|
|
525
|
-
`# ${config.project_name}`,
|
|
526
|
-
"",
|
|
527
|
-
`> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,
|
|
528
|
-
"",
|
|
529
|
-
"## Project Overview",
|
|
530
|
-
"",
|
|
531
|
-
`- **Type:** ${config.project_type}`,
|
|
532
|
-
`- **Quality Priorities:** ${config.quality_priorities.join(", ")}`,
|
|
533
|
-
"",
|
|
534
|
-
"## How to Work in This Project",
|
|
535
|
-
"",
|
|
536
|
-
"This project follows the **Plan \u2192 Build \u2192 Sync \u2192 Review** convention using ArcBridge.",
|
|
537
|
-
"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**",
|
|
538
|
-
"",
|
|
539
|
-
"### Before Starting Any Work",
|
|
540
|
-
"",
|
|
541
|
-
"1. Check project status: `arcbridge_get_project_status`",
|
|
542
|
-
"2. Review current tasks: `arcbridge_get_current_tasks`",
|
|
543
|
-
"3. Activate the appropriate role: `arcbridge_activate_role`",
|
|
544
|
-
"",
|
|
545
|
-
"### When Planning or Refining Architecture",
|
|
546
|
-
"",
|
|
547
|
-
'Activate the **architect** role: `arcbridge_activate_role({ role: "architect" })`',
|
|
548
|
-
"",
|
|
549
|
-
"- `arcbridge_get_building_blocks` \u2014 view architecture decomposition",
|
|
550
|
-
"- `arcbridge_get_quality_scenarios` \u2014 view quality requirements",
|
|
551
|
-
"- `arcbridge_get_open_questions` \u2014 find architectural gaps",
|
|
552
|
-
"- `arcbridge_propose_arc42_update` \u2014 propose doc updates from code changes",
|
|
553
|
-
"",
|
|
554
|
-
"### When Implementing Features",
|
|
555
|
-
"",
|
|
556
|
-
'Activate the **implementer** role: `arcbridge_activate_role({ role: "implementer" })`',
|
|
557
|
-
"",
|
|
558
|
-
"- `arcbridge_get_guidance` \u2014 context-aware guidance for the file/block you're working on",
|
|
559
|
-
"- `arcbridge_get_current_tasks` \u2014 check expected tasks in the current phase",
|
|
560
|
-
"- `arcbridge_search_symbols` / `arcbridge_get_symbol` \u2014 understand existing code",
|
|
561
|
-
"- `arcbridge_get_dependency_graph` \u2014 check module dependencies",
|
|
562
|
-
"- `arcbridge_update_task` \u2014 mark tasks as in-progress or done",
|
|
563
|
-
"- `arcbridge_reindex` \u2014 re-index after significant code changes",
|
|
564
|
-
"",
|
|
565
|
-
"### After Implementing (Phase Boundary Review)",
|
|
566
|
-
"",
|
|
567
|
-
"Before completing a phase:",
|
|
568
|
-
"",
|
|
569
|
-
"1. **Drift check:** `arcbridge_check_drift` \u2014 catch undeclared dependencies",
|
|
570
|
-
"2. **Verify scenarios:** `arcbridge_verify_scenarios` \u2014 run linked quality tests",
|
|
571
|
-
"3. **Practice review:** `arcbridge_get_practice_review` \u2014 review across 5 dimensions",
|
|
572
|
-
"",
|
|
573
|
-
"### Completing a Phase",
|
|
574
|
-
"",
|
|
575
|
-
"Activate the **phase-manager** role, then: `arcbridge_complete_phase`",
|
|
576
|
-
'\u2014 validates three gates: all tasks done, no critical drift, must-have quality scenarios (priority = "must") not failing.',
|
|
577
|
-
""
|
|
578
|
-
];
|
|
579
|
-
if (config.project_type === "nextjs-app-router" || config.project_type === "react-vite") {
|
|
580
|
-
lines.push(
|
|
581
|
-
"## React & Next.js Analysis",
|
|
582
|
-
"",
|
|
583
|
-
"- `arcbridge_get_component_graph` \u2014 component hierarchy, props, state, context",
|
|
584
|
-
"- `arcbridge_get_route_map` \u2014 Next.js route tree (pages, layouts, API routes)",
|
|
585
|
-
"- `arcbridge_get_boundary_analysis` \u2014 server/client boundary analysis",
|
|
586
|
-
""
|
|
587
|
-
);
|
|
588
|
-
}
|
|
589
|
-
return lines.join("\n");
|
|
590
|
-
}
|
|
591
516
|
function generateSettingsJson() {
|
|
592
517
|
const settings = {
|
|
593
518
|
mcpServers: {
|
|
@@ -639,33 +564,123 @@ var GeminiAdapter = class {
|
|
|
639
564
|
const geminiDir = join5(targetDir, ".gemini");
|
|
640
565
|
mkdirSync4(geminiDir, { recursive: true });
|
|
641
566
|
const settingsPath = join5(geminiDir, "settings.json");
|
|
642
|
-
if (!
|
|
643
|
-
|
|
567
|
+
if (!existsSync5(settingsPath)) {
|
|
568
|
+
writeFileSync6(settingsPath, generateSettingsJson(), "utf-8");
|
|
644
569
|
} else {
|
|
645
570
|
try {
|
|
646
|
-
const existing = JSON.parse(
|
|
571
|
+
const existing = JSON.parse(readFileSync4(settingsPath, "utf-8"));
|
|
647
572
|
if (!existing.mcpServers?.arcbridge) {
|
|
648
573
|
existing.mcpServers = existing.mcpServers ?? {};
|
|
649
574
|
existing.mcpServers.arcbridge = {
|
|
650
575
|
command: "npx",
|
|
651
576
|
args: ["-y", "@arcbridge/mcp-server"]
|
|
652
577
|
};
|
|
653
|
-
|
|
578
|
+
writeFileSync6(settingsPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
|
|
654
579
|
}
|
|
655
580
|
} catch {
|
|
656
581
|
}
|
|
657
582
|
}
|
|
658
|
-
const
|
|
659
|
-
writeWithMarkerMerge(join5(geminiDir, "styleguide.md"),
|
|
660
|
-
writeWithMarkerMerge(join5(targetDir, "GEMINI.md"),
|
|
583
|
+
const instructionsContent = generateInstructions(config);
|
|
584
|
+
writeWithMarkerMerge(join5(geminiDir, "styleguide.md"), instructionsContent);
|
|
585
|
+
writeWithMarkerMerge(join5(targetDir, "GEMINI.md"), instructionsContent);
|
|
661
586
|
}
|
|
662
587
|
generateAgentConfigs(targetDir, roles, options) {
|
|
663
588
|
const agentsDir = join5(targetDir, ".gemini", "agents");
|
|
664
589
|
mkdirSync4(agentsDir, { recursive: true });
|
|
665
590
|
for (const role of roles) {
|
|
666
591
|
const content = generateAgentFile3(role);
|
|
667
|
-
|
|
592
|
+
writeFileSync6(join5(agentsDir, `${role.role_id}.md`), content, "utf-8");
|
|
593
|
+
}
|
|
594
|
+
generateSkills(targetDir, options?.force);
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
// src/opencode/opencode-adapter.ts
|
|
599
|
+
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync7, existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
|
|
600
|
+
import { join as join6 } from "path";
|
|
601
|
+
function generateOpenCodeJson() {
|
|
602
|
+
const config = {
|
|
603
|
+
$schema: "https://opencode.ai/config.json",
|
|
604
|
+
instructions: ["OPENCODE.md"],
|
|
605
|
+
mcp: {
|
|
606
|
+
arcbridge: {
|
|
607
|
+
type: "local",
|
|
608
|
+
command: ["npx", "-y", "@arcbridge/mcp-server"]
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
return JSON.stringify(config, null, 2) + "\n";
|
|
613
|
+
}
|
|
614
|
+
function yamlQuote2(value) {
|
|
615
|
+
if (/[:#{}&*!|>'"%@`\n]/.test(value) || value !== value.trim()) {
|
|
616
|
+
return JSON.stringify(value);
|
|
617
|
+
}
|
|
618
|
+
return value;
|
|
619
|
+
}
|
|
620
|
+
function generateAgentFile4(role) {
|
|
621
|
+
const lines = [
|
|
622
|
+
"---",
|
|
623
|
+
`description: ${yamlQuote2(role.description)}`
|
|
624
|
+
];
|
|
625
|
+
lines.push(`mode: subagent`);
|
|
626
|
+
if (role.read_only) {
|
|
627
|
+
lines.push("permission:");
|
|
628
|
+
lines.push(" edit: deny");
|
|
629
|
+
lines.push(" write: deny");
|
|
630
|
+
}
|
|
631
|
+
lines.push("---", "");
|
|
632
|
+
lines.push(role.system_prompt, "");
|
|
633
|
+
return lines.join("\n");
|
|
634
|
+
}
|
|
635
|
+
var OpenCodeAdapter = class {
|
|
636
|
+
platform = "opencode";
|
|
637
|
+
generateProjectConfig(targetDir, config) {
|
|
638
|
+
const configPath = join6(targetDir, "opencode.json");
|
|
639
|
+
if (!existsSync6(configPath)) {
|
|
640
|
+
writeFileSync7(configPath, generateOpenCodeJson(), "utf-8");
|
|
641
|
+
} else {
|
|
642
|
+
try {
|
|
643
|
+
const existing = JSON.parse(readFileSync5(configPath, "utf-8"));
|
|
644
|
+
let changed = false;
|
|
645
|
+
if (!existing.$schema) {
|
|
646
|
+
existing.$schema = "https://opencode.ai/config.json";
|
|
647
|
+
changed = true;
|
|
648
|
+
}
|
|
649
|
+
const instructions = existing.instructions;
|
|
650
|
+
if (!Array.isArray(instructions)) {
|
|
651
|
+
existing.instructions = ["OPENCODE.md"];
|
|
652
|
+
changed = true;
|
|
653
|
+
} else if (!instructions.includes("OPENCODE.md")) {
|
|
654
|
+
instructions.push("OPENCODE.md");
|
|
655
|
+
changed = true;
|
|
656
|
+
}
|
|
657
|
+
const mcp = existing.mcp;
|
|
658
|
+
const mcpObj = typeof mcp === "object" && mcp !== null && !Array.isArray(mcp) ? mcp : {};
|
|
659
|
+
if (!mcpObj.arcbridge) {
|
|
660
|
+
mcpObj.arcbridge = {
|
|
661
|
+
type: "local",
|
|
662
|
+
command: ["npx", "-y", "@arcbridge/mcp-server"]
|
|
663
|
+
};
|
|
664
|
+
existing.mcp = mcpObj;
|
|
665
|
+
changed = true;
|
|
666
|
+
}
|
|
667
|
+
if (changed) {
|
|
668
|
+
writeFileSync7(configPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
|
|
669
|
+
}
|
|
670
|
+
} catch {
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
const instructionsContent = generateInstructions(config);
|
|
674
|
+
writeWithMarkerMerge(join6(targetDir, "OPENCODE.md"), instructionsContent);
|
|
675
|
+
}
|
|
676
|
+
generateAgentConfigs(targetDir, roles, options) {
|
|
677
|
+
const agentsDir = join6(targetDir, ".opencode", "agents");
|
|
678
|
+
mkdirSync5(agentsDir, { recursive: true });
|
|
679
|
+
for (const role of roles) {
|
|
680
|
+
const content = generateAgentFile4(role);
|
|
681
|
+
writeFileSync7(join6(agentsDir, `${role.role_id}.md`), content, "utf-8");
|
|
668
682
|
}
|
|
683
|
+
generateSkills(targetDir, options?.force, join6(targetDir, ".opencode", "skills"));
|
|
669
684
|
generateSkills(targetDir, options?.force);
|
|
670
685
|
}
|
|
671
686
|
};
|
|
@@ -675,7 +690,8 @@ var adapters = {
|
|
|
675
690
|
claude: () => new ClaudeAdapter(),
|
|
676
691
|
copilot: () => new CopilotAdapter(),
|
|
677
692
|
codex: () => new CodexAdapter(),
|
|
678
|
-
gemini: () => new GeminiAdapter()
|
|
693
|
+
gemini: () => new GeminiAdapter(),
|
|
694
|
+
opencode: () => new OpenCodeAdapter()
|
|
679
695
|
};
|
|
680
696
|
function getAdapter(platform) {
|
|
681
697
|
const factory = adapters[platform];
|
|
@@ -691,6 +707,7 @@ export {
|
|
|
691
707
|
CodexAdapter,
|
|
692
708
|
CopilotAdapter,
|
|
693
709
|
GeminiAdapter,
|
|
710
|
+
OpenCodeAdapter,
|
|
694
711
|
getAdapter
|
|
695
712
|
};
|
|
696
713
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/claude/claude-adapter.ts","../src/copilot/copilot-adapter.ts","../src/codex/codex-adapter.ts","../src/shared/skills.ts","../src/gemini/gemini-adapter.ts","../src/index.ts"],"sourcesContent":["import { mkdirSync, writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter } from \"../types.js\";\n\nfunction generateClaudeMd(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name}`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Project Overview\",\n \"\",\n `- **Type:** ${config.project_type}`,\n `- **Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## How to Work in This Project\",\n \"\",\n \"This project follows the **Plan → Build → Sync → Review** convention using ArcBridge.\",\n \"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**\",\n \"\",\n \"### Before Starting Any Work\",\n \"\",\n \"1. Check project status: `arcbridge_get_project_status`\",\n \"2. Review current tasks: `arcbridge_get_current_tasks`\",\n \"3. Activate the appropriate role (see below): `arcbridge_activate_role`\",\n \"\",\n \"### When Planning or Refining Architecture\",\n \"\",\n \"Activate the **architect** role: `arcbridge_activate_role({ role: \\\"architect\\\" })`\",\n \"\",\n \"Then use:\",\n \"- `arcbridge_get_building_blocks` — view current architecture decomposition\",\n \"- `arcbridge_get_quality_scenarios` — view quality requirements\",\n \"- `arcbridge_get_open_questions` — find architectural gaps to resolve\",\n \"- `arcbridge_propose_arc42_update` — propose doc updates from recent code changes\",\n \"\",\n \"### When Implementing Features\",\n \"\",\n \"Activate the **implementer** role: `arcbridge_activate_role({ role: \\\"implementer\\\" })`\",\n \"\",\n \"Then use:\",\n \"- `arcbridge_get_guidance` — get context-aware guidance for the file/block you're working on\",\n \"- `arcbridge_get_current_tasks` — check what tasks are expected in the current phase\",\n \"- `arcbridge_search_symbols` / `arcbridge_get_symbol` — understand existing code\",\n \"- `arcbridge_get_dependency_graph` — check module dependencies before adding new ones\",\n \"- `arcbridge_update_task` — mark tasks as in-progress or done as you complete them\",\n \"- `arcbridge_reindex` — re-index after significant code changes\",\n \"\",\n \"### After Implementing (Phase Boundary Review)\",\n \"\",\n \"Before completing a phase, consult the review roles. Not every role is needed every phase — use this guide:\",\n \"\",\n \"| Role | When to consult | How |\",\n \"|------|----------------|-----|\",\n \"| **code-reviewer** | Every phase | `arcbridge_activate_role({ role: \\\"code-reviewer\\\" })` then `arcbridge_get_practice_review` |\",\n \"| **security-reviewer** | Phases with auth, uploads, API routes, user input | `arcbridge_activate_role({ role: \\\"security-reviewer\\\" })` then `arcbridge_run_role_check` |\",\n \"| **quality-guardian** | Every 2nd phase, or when quality scenarios are linked | `arcbridge_activate_role({ role: \\\"quality-guardian\\\" })` then `arcbridge_get_practice_review` |\",\n \"| **architect** | When drift is detected or architecture evolved significantly | `arcbridge_activate_role({ role: \\\"architect\\\" })` then `arcbridge_check_drift` |\",\n \"\",\n \"Then run the standard checks:\",\n \"\",\n \"1. **Drift check:** `arcbridge_check_drift` — catch undeclared dependencies and missing modules\",\n \"2. **Verify scenarios:** `arcbridge_verify_scenarios` — run linked tests for quality scenarios\",\n \"\",\n \"### Completing a Phase\",\n \"\",\n \"Activate the **phase-manager** role: `arcbridge_activate_role({ role: \\\"phase-manager\\\" })`\",\n \"\",\n \"Then: `arcbridge_complete_phase` — validates three gates: all tasks done, no critical drift, must-have quality scenarios not failing.\",\n \"\",\n ];\n\n // Add React/Next.js section only for relevant project types\n if (config.project_type === \"nextjs-app-router\" || config.project_type === \"react-vite\") {\n lines.push(\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — view component hierarchy, props, state, and context usage\",\n \"- `arcbridge_get_route_map` — view Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — analyze server/client boundaries and detect violations\",\n \"\",\n );\n }\n\n lines.push(\n \"## Agent Roles\",\n \"\",\n \"Activate roles with `arcbridge_activate_role` to get specialized context and tool guidance:\",\n \"\",\n \"| Role | When to Use |\",\n \"|------|-------------|\",\n \"| `architect` | Defining building blocks, reviewing dependencies, creating ADRs |\",\n \"| `implementer` | Writing code within the established architecture |\",\n \"| `security-reviewer` | Auditing auth, input validation, client/server boundaries |\",\n \"| `quality-guardian` | Reviewing test coverage, quality scenarios, quality gates |\",\n \"| `phase-manager` | Completing phases, managing task transitions |\",\n \"| `code-reviewer` | Reviewing code for correctness, patterns, edge cases |\",\n \"| `onboarding` | Understanding the project (for new developers) |\",\n \"\",\n \"Roles are defined in `.arcbridge/agents/` and `.claude/agents/`.\",\n \"\",\n );\n\n return lines.join(\"\\n\");\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n `# ${role.name}`,\n \"\",\n role.description,\n \"\",\n \"## Tools\",\n \"\",\n ...role.required_tools.map((t) => `- ${t}`),\n \"\",\n ];\n\n if (role.denied_tools.length > 0) {\n lines.push(\"## Denied Tools\", \"\", ...role.denied_tools.map((t) => `- ${t}`), \"\");\n }\n\n if (role.read_only) {\n lines.push(\"## Access\", \"\", \"This role is **read-only**.\", \"\");\n }\n\n if (role.quality_focus.length > 0) {\n lines.push(\n \"## Quality Focus\",\n \"\",\n ...role.quality_focus.map((q) => `- ${q}`),\n \"\",\n );\n }\n\n lines.push(\"## Instructions\", \"\", role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class ClaudeAdapter implements PlatformAdapter {\n platform = \"claude\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const arcbridgeContent = generateClaudeMd(config);\n const claudeMdPath = join(targetDir, \"CLAUDE.md\");\n const marker = \"<!-- arcbridge-generated -->\";\n\n if (existsSync(claudeMdPath)) {\n const existing = readFileSync(claudeMdPath, \"utf-8\");\n\n // Detect where ArcBridge content starts: marker from current version,\n // or the generated heading from older versions (before marker was added)\n const markerIndex = existing.indexOf(marker);\n const legacyIndex = existing.indexOf(\"## ArcBridge Workflow\");\n const splitIndex = markerIndex >= 0 ? markerIndex : legacyIndex;\n\n if (splitIndex >= 0) {\n // Replace everything from the ArcBridge section onwards\n const userContent = existing.slice(0, splitIndex).trimEnd();\n writeFileSync(claudeMdPath, `${userContent}\\n\\n${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n } else {\n // No existing ArcBridge content — append\n writeFileSync(claudeMdPath, `${existing.trimEnd()}\\n\\n${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n }\n } else {\n writeFileSync(claudeMdPath, `${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n }\n\n // Generate .mcp.json if it doesn't already exist\n const mcpJsonPath = join(targetDir, \".mcp.json\");\n if (!existsSync(mcpJsonPath)) {\n const mcpConfig = {\n mcpServers: {\n arcbridge: {\n command: \"npx\",\n args: [\"@arcbridge/mcp-server\"],\n },\n },\n };\n writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2) + \"\\n\", \"utf-8\");\n } else {\n // If .mcp.json exists, add arcbridge server if not already present\n try {\n const existing = JSON.parse(readFileSync(mcpJsonPath, \"utf-8\")) as {\n mcpServers?: Record<string, unknown>;\n };\n if (!existing.mcpServers?.arcbridge) {\n existing.mcpServers = existing.mcpServers ?? {};\n existing.mcpServers.arcbridge = {\n command: \"npx\",\n args: [\"@arcbridge/mcp-server\"],\n };\n writeFileSync(mcpJsonPath, JSON.stringify(existing, null, 2) + \"\\n\", \"utf-8\");\n }\n } catch {\n // If we can't parse existing .mcp.json, leave it alone\n }\n }\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[]): void {\n const agentsDir = join(targetDir, \".claude\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n }\n}\n","import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter } from \"../types.js\";\n\nfunction generateCopilotInstructions(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name} - Copilot Instructions`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Project Context\",\n \"\",\n `This is a ${config.project_type} project.`,\n \"\",\n `**Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## Architecture\",\n \"\",\n \"Architecture documentation is in `.arcbridge/arc42/`.\",\n \"Quality scenarios are in `.arcbridge/arc42/10-quality-scenarios.yaml`.\",\n \"Phase plan is in `.arcbridge/plan/`.\",\n \"\",\n \"## Code Intelligence\",\n \"\",\n \"Use ArcBridge MCP tools to explore the codebase:\",\n \"- `arcbridge_search_symbols` — Search for functions, classes, types\",\n \"- `arcbridge_get_symbol` — Get full details on a symbol\",\n \"- `arcbridge_get_dependency_graph` — Analyze module dependencies\",\n \"- `arcbridge_reindex` — Re-index after code changes\",\n \"\",\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — View component hierarchy, props, state, and context\",\n \"- `arcbridge_get_route_map` — View Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — Analyze server/client boundaries\",\n \"\",\n \"## Architecture Bridge\",\n \"\",\n \"- `arcbridge_check_drift` — Detect architecture drift and boundary violations\",\n \"- `arcbridge_get_guidance` — Get context-aware guidance for code changes\",\n \"- `arcbridge_get_open_questions` — Surface architectural gaps\",\n \"- `arcbridge_propose_arc42_update` — Generate arc42 update proposals from code changes\",\n \"- `arcbridge_get_practice_review` — Review recent changes across 5 practice dimensions\",\n \"\",\n \"## Conventions\",\n \"\",\n \"- Follow existing patterns in the codebase\",\n \"- Stay within building block boundaries\",\n \"- Write tests for new functionality\",\n \"- Check quality scenarios before submitting changes\",\n \"\",\n ];\n\n return lines.join(\"\\n\");\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n `# ${role.name}`,\n \"\",\n role.description,\n \"\",\n ];\n\n if (role.read_only) {\n lines.push(\"**Access:** Read-only\", \"\");\n }\n\n if (role.quality_focus.length > 0) {\n lines.push(\n \"## Quality Focus\",\n \"\",\n ...role.quality_focus.map((q) => `- ${q}`),\n \"\",\n );\n }\n\n lines.push(\"## Instructions\", \"\", role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class CopilotAdapter implements PlatformAdapter {\n platform = \"copilot\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const githubDir = join(targetDir, \".github\");\n mkdirSync(githubDir, { recursive: true });\n\n const content = generateCopilotInstructions(config);\n writeFileSync(\n join(githubDir, \"copilot-instructions.md\"),\n content,\n \"utf-8\",\n );\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[]): void {\n const agentsDir = join(targetDir, \".github\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n }\n}\n","import { writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter, AdapterOptions } from \"../types.js\";\nimport { generateSkills } from \"../shared/skills.js\";\n\nfunction generateAgentsMd(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name}`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Codex MCP Setup\",\n \"\",\n \"Add this to your `~/.codex/config.toml` (one-time setup):\",\n \"\",\n \"```toml\",\n \"[mcp_servers.arcbridge]\",\n 'command = \"npx\"',\n 'args = [\"-y\", \"@arcbridge/mcp-server\"]',\n \"```\",\n \"\",\n \"## Project Overview\",\n \"\",\n `- **Type:** ${config.project_type}`,\n `- **Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## How to Work in This Project\",\n \"\",\n \"This project follows the **Plan → Build → Sync → Review** convention using ArcBridge.\",\n \"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**\",\n \"\",\n \"### Before Starting Any Work\",\n \"\",\n \"1. Check project status: `arcbridge_get_project_status`\",\n \"2. Review current tasks: `arcbridge_get_current_tasks`\",\n \"3. Activate the appropriate role: `arcbridge_activate_role`\",\n \"\",\n \"### When Planning or Refining Architecture\",\n \"\",\n \"Activate the **architect** role: `arcbridge_activate_role({ role: \\\"architect\\\" })`\",\n \"\",\n \"- `arcbridge_get_building_blocks` — view architecture decomposition\",\n \"- `arcbridge_get_quality_scenarios` — view quality requirements\",\n \"- `arcbridge_get_open_questions` — find architectural gaps\",\n \"- `arcbridge_propose_arc42_update` — propose doc updates from code changes\",\n \"\",\n \"### When Implementing Features\",\n \"\",\n \"Activate the **implementer** role: `arcbridge_activate_role({ role: \\\"implementer\\\" })`\",\n \"\",\n \"- `arcbridge_get_guidance` — context-aware guidance for the file/block you're working on\",\n \"- `arcbridge_get_current_tasks` — check expected tasks in the current phase\",\n \"- `arcbridge_search_symbols` / `arcbridge_get_symbol` — understand existing code\",\n \"- `arcbridge_get_dependency_graph` — check module dependencies\",\n \"- `arcbridge_update_task` — mark tasks as in-progress or done\",\n \"- `arcbridge_reindex` — re-index after significant code changes\",\n \"\",\n \"### After Implementing (Phase Boundary Review)\",\n \"\",\n \"Before completing a phase:\",\n \"\",\n \"1. **Drift check:** `arcbridge_check_drift` — catch undeclared dependencies\",\n \"2. **Verify scenarios:** `arcbridge_verify_scenarios` — run linked quality tests\",\n \"3. **Practice review:** `arcbridge_get_practice_review` — review across 5 dimensions\",\n \"\",\n \"### Completing a Phase\",\n \"\",\n \"Activate the **phase-manager** role, then: `arcbridge_complete_phase`\",\n \"— validates three gates: all tasks done, no critical drift, must-have quality scenarios (priority = \\\"must\\\") not failing.\",\n \"\",\n ];\n\n // Add React/Next.js section only for relevant project types\n if (config.project_type === \"nextjs-app-router\" || config.project_type === \"react-vite\") {\n lines.push(\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — component hierarchy, props, state, context\",\n \"- `arcbridge_get_route_map` — Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — server/client boundary analysis\",\n \"\",\n );\n }\n\n lines.push(\n \"## Agent Roles\",\n \"\",\n \"Activate roles with `arcbridge_activate_role` to get specialized context.\",\n \"Roles are defined in `.arcbridge/agents/`.\",\n \"\",\n \"*Role table is appended below after agent configs are generated.*\",\n \"\",\n );\n\n return lines.join(\"\\n\");\n}\n\nexport class CodexAdapter implements PlatformAdapter {\n platform = \"codex\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const agentsMdContent = generateAgentsMd(config);\n const agentsMdPath = join(targetDir, \"AGENTS.md\");\n const marker = \"<!-- arcbridge-generated -->\";\n\n if (existsSync(agentsMdPath)) {\n const existing = readFileSync(agentsMdPath, \"utf-8\");\n const markerIndex = existing.indexOf(marker);\n\n if (markerIndex >= 0) {\n // Replace everything from the marker onwards\n const userContent = existing.slice(0, markerIndex).trimEnd();\n const prefix = userContent ? `${userContent}\\n\\n` : \"\";\n writeFileSync(agentsMdPath, `${prefix}${marker}\\n\\n${agentsMdContent}`, \"utf-8\");\n } else {\n // No existing ArcBridge content — append\n const existingTrimmed = existing.trimEnd();\n const prefix = existingTrimmed ? `${existingTrimmed}\\n\\n` : \"\";\n writeFileSync(agentsMdPath, `${prefix}${marker}\\n\\n${agentsMdContent}`, \"utf-8\");\n }\n } else {\n writeFileSync(agentsMdPath, `${marker}\\n\\n${agentsMdContent}`, \"utf-8\");\n }\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void {\n // Append dynamic role table to AGENTS.md (replaces placeholder)\n const agentsMdPath = join(targetDir, \"AGENTS.md\");\n if (existsSync(agentsMdPath)) {\n let content = readFileSync(agentsMdPath, \"utf-8\");\n const roleTable = [\n \"| Role | Description |\",\n \"|------|-------------|\",\n ...roles.map((r) => `| \\`${r.role_id}\\` | ${r.description} |`),\n \"\",\n ].join(\"\\n\");\n\n const placeholder = \"*Role table is appended below after agent configs are generated.*\";\n if (content.includes(placeholder)) {\n content = content.replace(placeholder, roleTable);\n } else {\n // Fallback: append role table at the end if placeholder was removed\n content = `${content.trimEnd()}\\n\\n## Agent Roles\\n\\n${roleTable}\\n`;\n }\n writeFileSync(agentsMdPath, content, \"utf-8\");\n }\n\n // Generate missing skills (shared with Gemini adapter — only writes if not present)\n generateSkills(targetDir, options?.force);\n }\n}\n","import { mkdirSync, writeFileSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst SYNC_SKILL = `---\nname: arcbridge-sync\ndescription: Run the ArcBridge sync loop — reindex code, detect architecture drift, and update task statuses. Use after significant code changes or before completing a phase.\n---\n\n# ArcBridge Sync\n\nRun the full sync loop to keep architecture docs and task statuses in sync with code changes.\n\n## Steps\n\n1. **Reindex** — \\`arcbridge_reindex\\` to update the symbol index with recent code changes\n2. **Check drift** — \\`arcbridge_check_drift\\` to detect undeclared dependencies and missing modules\n3. **Review tasks** — \\`arcbridge_get_current_tasks\\` to see if any tasks can be inferred as done\n4. **Propose updates** — \\`arcbridge_propose_arc42_update\\` to generate documentation update proposals\n`;\n\nconst REVIEW_SKILL = `---\nname: arcbridge-review\ndescription: Run ArcBridge phase boundary reviews — drift check, quality scenario verification, and practice review across 5 dimensions. Use before completing a phase.\n---\n\n# ArcBridge Phase Review\n\nRun the full review suite before completing a phase gate.\n\n## Steps\n\n1. **Drift check** — \\`arcbridge_check_drift\\` to catch undeclared dependencies and boundary violations\n2. **Verify scenarios** — \\`arcbridge_verify_scenarios\\` to run linked tests for quality scenarios\n3. **Practice review** — \\`arcbridge_get_practice_review\\` to review changes across architecture, security, testing, docs, and complexity\n4. **Role checks** — optionally run \\`arcbridge_run_role_check\\` with specific roles (security-reviewer, quality-guardian)\n5. **Complete phase** — if all checks pass, run \\`arcbridge_complete_phase\\` to validate gates and transition\n`;\n\n/**\n * Generate ArcBridge skills under .agents/skills/.\n * By default, only writes skills that don't already exist — preserves existing content.\n * Pass force=true to overwrite existing skills (e.g., after template updates).\n * Shared between Codex and Gemini adapters.\n */\nexport function generateSkills(targetDir: string, force = false): void {\n const skillsDir = join(targetDir, \".agents\", \"skills\");\n\n const syncPath = join(skillsDir, \"arcbridge-sync\", \"SKILL.md\");\n if (force || !existsSync(syncPath)) {\n mkdirSync(join(skillsDir, \"arcbridge-sync\"), { recursive: true });\n writeFileSync(syncPath, SYNC_SKILL, \"utf-8\");\n }\n\n const reviewPath = join(skillsDir, \"arcbridge-review\", \"SKILL.md\");\n if (force || !existsSync(reviewPath)) {\n mkdirSync(join(skillsDir, \"arcbridge-review\"), { recursive: true });\n writeFileSync(reviewPath, REVIEW_SKILL, \"utf-8\");\n }\n}\n","import { mkdirSync, writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter, AdapterOptions } from \"../types.js\";\nimport { generateSkills } from \"../shared/skills.js\";\n\nconst MARKER = \"<!-- arcbridge-generated -->\";\n\n/** Write content to a file with marker-based merge (preserves user content above marker) */\nfunction writeWithMarkerMerge(filePath: string, content: string): void {\n if (existsSync(filePath)) {\n const existing = readFileSync(filePath, \"utf-8\");\n const markerIndex = existing.indexOf(MARKER);\n\n if (markerIndex >= 0) {\n const userContent = existing.slice(0, markerIndex).trimEnd();\n const prefix = userContent ? `${userContent}\\n\\n` : \"\";\n writeFileSync(filePath, `${prefix}${MARKER}\\n\\n${content}`, \"utf-8\");\n } else {\n const existingTrimmed = existing.trimEnd();\n const prefix = existingTrimmed ? `${existingTrimmed}\\n\\n` : \"\";\n writeFileSync(filePath, `${prefix}${MARKER}\\n\\n${content}`, \"utf-8\");\n }\n } else {\n writeFileSync(filePath, `${MARKER}\\n\\n${content}`, \"utf-8\");\n }\n}\n\nfunction generateStyleguide(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name}`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Project Overview\",\n \"\",\n `- **Type:** ${config.project_type}`,\n `- **Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## How to Work in This Project\",\n \"\",\n \"This project follows the **Plan → Build → Sync → Review** convention using ArcBridge.\",\n \"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**\",\n \"\",\n \"### Before Starting Any Work\",\n \"\",\n \"1. Check project status: `arcbridge_get_project_status`\",\n \"2. Review current tasks: `arcbridge_get_current_tasks`\",\n \"3. Activate the appropriate role: `arcbridge_activate_role`\",\n \"\",\n \"### When Planning or Refining Architecture\",\n \"\",\n \"Activate the **architect** role: `arcbridge_activate_role({ role: \\\"architect\\\" })`\",\n \"\",\n \"- `arcbridge_get_building_blocks` — view architecture decomposition\",\n \"- `arcbridge_get_quality_scenarios` — view quality requirements\",\n \"- `arcbridge_get_open_questions` — find architectural gaps\",\n \"- `arcbridge_propose_arc42_update` — propose doc updates from code changes\",\n \"\",\n \"### When Implementing Features\",\n \"\",\n \"Activate the **implementer** role: `arcbridge_activate_role({ role: \\\"implementer\\\" })`\",\n \"\",\n \"- `arcbridge_get_guidance` — context-aware guidance for the file/block you're working on\",\n \"- `arcbridge_get_current_tasks` — check expected tasks in the current phase\",\n \"- `arcbridge_search_symbols` / `arcbridge_get_symbol` — understand existing code\",\n \"- `arcbridge_get_dependency_graph` — check module dependencies\",\n \"- `arcbridge_update_task` — mark tasks as in-progress or done\",\n \"- `arcbridge_reindex` — re-index after significant code changes\",\n \"\",\n \"### After Implementing (Phase Boundary Review)\",\n \"\",\n \"Before completing a phase:\",\n \"\",\n \"1. **Drift check:** `arcbridge_check_drift` — catch undeclared dependencies\",\n \"2. **Verify scenarios:** `arcbridge_verify_scenarios` — run linked quality tests\",\n \"3. **Practice review:** `arcbridge_get_practice_review` — review across 5 dimensions\",\n \"\",\n \"### Completing a Phase\",\n \"\",\n \"Activate the **phase-manager** role, then: `arcbridge_complete_phase`\",\n \"— validates three gates: all tasks done, no critical drift, must-have quality scenarios (priority = \\\"must\\\") not failing.\",\n \"\",\n ];\n\n if (config.project_type === \"nextjs-app-router\" || config.project_type === \"react-vite\") {\n lines.push(\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — component hierarchy, props, state, context\",\n \"- `arcbridge_get_route_map` — Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — server/client boundary analysis\",\n \"\",\n );\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction generateSettingsJson(): string {\n const settings = {\n mcpServers: {\n arcbridge: {\n command: \"npx\",\n args: [\"-y\", \"@arcbridge/mcp-server\"],\n },\n },\n };\n return JSON.stringify(settings, null, 2) + \"\\n\";\n}\n\nfunction yamlQuote(value: string): string {\n // Quote if value contains YAML-significant characters\n if (/[:#{}&*!|>'\"%@`\\n]/.test(value) || value !== value.trim()) {\n return JSON.stringify(value);\n }\n return value;\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n \"---\",\n `name: ${role.role_id}`,\n `description: ${yamlQuote(role.description)}`,\n ];\n\n // Build tools allowlist from role's required_tools (respects read_only constraint)\n const tools: string[] = role.required_tools.map(\n (tool) => `mcp_*_${tool}`,\n );\n if (role.read_only) {\n tools.push(\"read_file\", \"grep_search\", \"list_directory\");\n }\n if (tools.length > 0) {\n lines.push(\"tools:\");\n for (const tool of tools) {\n lines.push(` - ${tool}`);\n }\n }\n\n const suggestedModel = role.model_preferences?.suggested_models?.gemini?.trim();\n if (suggestedModel) {\n lines.push(`model: ${yamlQuote(suggestedModel)}`);\n } else if (role.model_preferences.reasoning_depth === \"high\") {\n lines.push(\"model: gemini-2.5-pro\");\n }\n\n lines.push(\"---\", \"\");\n lines.push(role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class GeminiAdapter implements PlatformAdapter {\n platform = \"gemini\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const geminiDir = join(targetDir, \".gemini\");\n mkdirSync(geminiDir, { recursive: true });\n\n // Generate .gemini/settings.json (MCP config)\n const settingsPath = join(geminiDir, \"settings.json\");\n if (!existsSync(settingsPath)) {\n writeFileSync(settingsPath, generateSettingsJson(), \"utf-8\");\n } else {\n // Add arcbridge MCP server if not already present\n try {\n const existing = JSON.parse(readFileSync(settingsPath, \"utf-8\")) as {\n mcpServers?: Record<string, unknown>;\n };\n if (!existing.mcpServers?.arcbridge) {\n existing.mcpServers = existing.mcpServers ?? {};\n existing.mcpServers.arcbridge = {\n command: \"npx\",\n args: [\"-y\", \"@arcbridge/mcp-server\"],\n };\n writeFileSync(settingsPath, JSON.stringify(existing, null, 2) + \"\\n\", \"utf-8\");\n }\n } catch {\n // Can't parse existing settings.json — leave it alone\n }\n }\n\n // Generate .gemini/styleguide.md and GEMINI.md (same content)\n const styleguideContent = generateStyleguide(config);\n writeWithMarkerMerge(join(geminiDir, \"styleguide.md\"), styleguideContent);\n writeWithMarkerMerge(join(targetDir, \"GEMINI.md\"), styleguideContent);\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void {\n // Generate .gemini/agents/*.md (Gemini subagents mapped from ArcBridge roles)\n const agentsDir = join(targetDir, \".gemini\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n\n // Generate missing skills (shared with Codex adapter — only writes if not present)\n generateSkills(targetDir, options?.force);\n }\n}\n","export type { PlatformAdapter, AdapterOptions } from \"./types.js\";\nexport { ClaudeAdapter } from \"./claude/claude-adapter.js\";\nexport { CopilotAdapter } from \"./copilot/copilot-adapter.js\";\nexport { CodexAdapter } from \"./codex/codex-adapter.js\";\nexport { GeminiAdapter } from \"./gemini/gemini-adapter.js\";\n\nimport type { PlatformAdapter } from \"./types.js\";\nimport { ClaudeAdapter } from \"./claude/claude-adapter.js\";\nimport { CopilotAdapter } from \"./copilot/copilot-adapter.js\";\nimport { CodexAdapter } from \"./codex/codex-adapter.js\";\nimport { GeminiAdapter } from \"./gemini/gemini-adapter.js\";\n\nconst adapters: Record<string, () => PlatformAdapter> = {\n claude: () => new ClaudeAdapter(),\n copilot: () => new CopilotAdapter(),\n codex: () => new CodexAdapter(),\n gemini: () => new GeminiAdapter(),\n};\n\nexport function getAdapter(platform: string): PlatformAdapter {\n const factory = adapters[platform];\n if (!factory) {\n throw new Error(\n `Unknown platform: ${platform}. Available: ${Object.keys(adapters).join(\", \")}`,\n );\n }\n return factory();\n}\n"],"mappings":";AAAA,SAAS,WAAW,eAAe,YAAY,oBAAoB;AACnE,SAAS,YAAY;AAIrB,SAAS,iBAAiB,QAAiC;AACzD,QAAM,QAAkB;AAAA,IACtB,KAAK,OAAO,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,OAAO,YAAY;AAAA,IAClC,6BAA6B,OAAO,mBAAmB,KAAK,IAAI,CAAC;AAAA,IACjE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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AAO;AAAA,IACvE;AAGA,mBAAe,WAAW,SAAS,KAAK;AAAA,EAC1C;AACF;;;AC9LA,IAAM,WAAkD;AAAA,EACtD,QAAQ,MAAM,IAAI,cAAc;AAAA,EAChC,SAAS,MAAM,IAAI,eAAe;AAAA,EAClC,OAAO,MAAM,IAAI,aAAa;AAAA,EAC9B,QAAQ,MAAM,IAAI,cAAc;AAClC;AAEO,SAAS,WAAW,UAAmC;AAC5D,QAAM,UAAU,SAAS,QAAQ;AACjC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,qBAAqB,QAAQ,gBAAgB,OAAO,KAAK,QAAQ,EAAE,KAAK,IAAI,CAAC;AAAA,IAC/E;AAAA,EACF;AACA,SAAO,QAAQ;AACjB;","names":["mkdirSync","writeFileSync","join","generateAgentFile","writeFileSync","existsSync","readFileSync","join","mkdirSync","writeFileSync","existsSync","join","join","existsSync","readFileSync","writeFileSync","mkdirSync","writeFileSync","existsSync","readFileSync","join","existsSync","readFileSync","writeFileSync","generateAgentFile","join","mkdirSync"]}
|
|
1
|
+
{"version":3,"sources":["../src/claude/claude-adapter.ts","../src/copilot/copilot-adapter.ts","../src/codex/codex-adapter.ts","../src/shared/skills.ts","../src/shared/marker-merge.ts","../src/shared/instructions.ts","../src/gemini/gemini-adapter.ts","../src/opencode/opencode-adapter.ts","../src/index.ts"],"sourcesContent":["import { mkdirSync, writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter } from \"../types.js\";\n\nfunction generateClaudeMd(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name}`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Project Overview\",\n \"\",\n `- **Type:** ${config.project_type}`,\n `- **Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## How to Work in This Project\",\n \"\",\n \"This project follows the **Plan → Build → Sync → Review** convention using ArcBridge.\",\n \"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**\",\n \"\",\n \"### Before Starting Any Work\",\n \"\",\n \"1. Check project status: `arcbridge_get_project_status`\",\n \"2. Review current tasks: `arcbridge_get_current_tasks`\",\n \"3. Activate the appropriate role (see below): `arcbridge_activate_role`\",\n \"\",\n \"### When Planning or Refining Architecture\",\n \"\",\n \"Activate the **architect** role: `arcbridge_activate_role({ role: \\\"architect\\\" })`\",\n \"\",\n \"Then use:\",\n \"- `arcbridge_get_building_blocks` — view current architecture decomposition\",\n \"- `arcbridge_get_quality_scenarios` — view quality requirements\",\n \"- `arcbridge_get_open_questions` — find architectural gaps to resolve\",\n \"- `arcbridge_propose_arc42_update` — propose doc updates from recent code changes\",\n \"\",\n \"### When Implementing Features\",\n \"\",\n \"Activate the **implementer** role: `arcbridge_activate_role({ role: \\\"implementer\\\" })`\",\n \"\",\n \"Then use:\",\n \"- `arcbridge_get_guidance` — get context-aware guidance for the file/block you're working on\",\n \"- `arcbridge_get_current_tasks` — check what tasks are expected in the current phase\",\n \"- `arcbridge_search_symbols` / `arcbridge_get_symbol` — understand existing code\",\n \"- `arcbridge_get_dependency_graph` — check module dependencies before adding new ones\",\n \"- `arcbridge_update_task` — mark tasks as in-progress or done as you complete them\",\n \"- `arcbridge_reindex` — re-index after significant code changes\",\n \"\",\n \"### After Implementing (Phase Boundary Review)\",\n \"\",\n \"Before completing a phase, consult the review roles. Not every role is needed every phase — use this guide:\",\n \"\",\n \"| Role | When to consult | How |\",\n \"|------|----------------|-----|\",\n \"| **code-reviewer** | Every phase | `arcbridge_activate_role({ role: \\\"code-reviewer\\\" })` then `arcbridge_get_practice_review` |\",\n \"| **security-reviewer** | Phases with auth, uploads, API routes, user input | `arcbridge_activate_role({ role: \\\"security-reviewer\\\" })` then `arcbridge_run_role_check` |\",\n \"| **quality-guardian** | Every 2nd phase, or when quality scenarios are linked | `arcbridge_activate_role({ role: \\\"quality-guardian\\\" })` then `arcbridge_get_practice_review` |\",\n \"| **architect** | When drift is detected or architecture evolved significantly | `arcbridge_activate_role({ role: \\\"architect\\\" })` then `arcbridge_check_drift` |\",\n \"\",\n \"Then run the standard checks:\",\n \"\",\n \"1. **Drift check:** `arcbridge_check_drift` — catch undeclared dependencies and missing modules\",\n \"2. **Verify scenarios:** `arcbridge_verify_scenarios` — run linked tests for quality scenarios\",\n \"\",\n \"### Completing a Phase\",\n \"\",\n \"Activate the **phase-manager** role: `arcbridge_activate_role({ role: \\\"phase-manager\\\" })`\",\n \"\",\n \"Then: `arcbridge_complete_phase` — validates three gates: all tasks done, no critical drift, must-have quality scenarios not failing.\",\n \"\",\n ];\n\n // Add React/Next.js section only for relevant project types\n if (config.project_type === \"nextjs-app-router\" || config.project_type === \"react-vite\") {\n lines.push(\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — view component hierarchy, props, state, and context usage\",\n \"- `arcbridge_get_route_map` — view Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — analyze server/client boundaries and detect violations\",\n \"\",\n );\n }\n\n lines.push(\n \"## Agent Roles\",\n \"\",\n \"Activate roles with `arcbridge_activate_role` to get specialized context and tool guidance:\",\n \"\",\n \"| Role | When to Use |\",\n \"|------|-------------|\",\n \"| `architect` | Defining building blocks, reviewing dependencies, creating ADRs |\",\n \"| `implementer` | Writing code within the established architecture |\",\n \"| `security-reviewer` | Auditing auth, input validation, client/server boundaries |\",\n \"| `quality-guardian` | Reviewing test coverage, quality scenarios, quality gates |\",\n \"| `phase-manager` | Completing phases, managing task transitions |\",\n \"| `code-reviewer` | Reviewing code for correctness, patterns, edge cases |\",\n \"| `onboarding` | Understanding the project (for new developers) |\",\n \"\",\n \"Roles are defined in `.arcbridge/agents/` and `.claude/agents/`.\",\n \"\",\n );\n\n return lines.join(\"\\n\");\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n `# ${role.name}`,\n \"\",\n role.description,\n \"\",\n \"## Tools\",\n \"\",\n ...role.required_tools.map((t) => `- ${t}`),\n \"\",\n ];\n\n if (role.denied_tools.length > 0) {\n lines.push(\"## Denied Tools\", \"\", ...role.denied_tools.map((t) => `- ${t}`), \"\");\n }\n\n if (role.read_only) {\n lines.push(\"## Access\", \"\", \"This role is **read-only**.\", \"\");\n }\n\n if (role.quality_focus.length > 0) {\n lines.push(\n \"## Quality Focus\",\n \"\",\n ...role.quality_focus.map((q) => `- ${q}`),\n \"\",\n );\n }\n\n lines.push(\"## Instructions\", \"\", role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class ClaudeAdapter implements PlatformAdapter {\n platform = \"claude\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const arcbridgeContent = generateClaudeMd(config);\n const claudeMdPath = join(targetDir, \"CLAUDE.md\");\n const marker = \"<!-- arcbridge-generated -->\";\n\n if (existsSync(claudeMdPath)) {\n const existing = readFileSync(claudeMdPath, \"utf-8\");\n\n // Detect where ArcBridge content starts: marker from current version,\n // or the generated heading from older versions (before marker was added)\n const markerIndex = existing.indexOf(marker);\n const legacyIndex = existing.indexOf(\"## ArcBridge Workflow\");\n const splitIndex = markerIndex >= 0 ? markerIndex : legacyIndex;\n\n if (splitIndex >= 0) {\n // Replace everything from the ArcBridge section onwards\n const userContent = existing.slice(0, splitIndex).trimEnd();\n writeFileSync(claudeMdPath, `${userContent}\\n\\n${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n } else {\n // No existing ArcBridge content — append\n writeFileSync(claudeMdPath, `${existing.trimEnd()}\\n\\n${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n }\n } else {\n writeFileSync(claudeMdPath, `${marker}\\n\\n${arcbridgeContent}`, \"utf-8\");\n }\n\n // Generate .mcp.json if it doesn't already exist\n const mcpJsonPath = join(targetDir, \".mcp.json\");\n if (!existsSync(mcpJsonPath)) {\n const mcpConfig = {\n mcpServers: {\n arcbridge: {\n command: \"npx\",\n args: [\"@arcbridge/mcp-server\"],\n },\n },\n };\n writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2) + \"\\n\", \"utf-8\");\n } else {\n // If .mcp.json exists, add arcbridge server if not already present\n try {\n const existing = JSON.parse(readFileSync(mcpJsonPath, \"utf-8\")) as {\n mcpServers?: Record<string, unknown>;\n };\n if (!existing.mcpServers?.arcbridge) {\n existing.mcpServers = existing.mcpServers ?? {};\n existing.mcpServers.arcbridge = {\n command: \"npx\",\n args: [\"@arcbridge/mcp-server\"],\n };\n writeFileSync(mcpJsonPath, JSON.stringify(existing, null, 2) + \"\\n\", \"utf-8\");\n }\n } catch {\n // If we can't parse existing .mcp.json, leave it alone\n }\n }\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[]): void {\n const agentsDir = join(targetDir, \".claude\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n }\n}\n","import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter } from \"../types.js\";\n\nfunction generateCopilotInstructions(config: ArcBridgeConfig): string {\n const lines: string[] = [\n `# ${config.project_name} - Copilot Instructions`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n \"## Project Context\",\n \"\",\n `This is a ${config.project_type} project.`,\n \"\",\n `**Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## Architecture\",\n \"\",\n \"Architecture documentation is in `.arcbridge/arc42/`.\",\n \"Quality scenarios are in `.arcbridge/arc42/10-quality-scenarios.yaml`.\",\n \"Phase plan is in `.arcbridge/plan/`.\",\n \"\",\n \"## Code Intelligence\",\n \"\",\n \"Use ArcBridge MCP tools to explore the codebase:\",\n \"- `arcbridge_search_symbols` — Search for functions, classes, types\",\n \"- `arcbridge_get_symbol` — Get full details on a symbol\",\n \"- `arcbridge_get_dependency_graph` — Analyze module dependencies\",\n \"- `arcbridge_reindex` — Re-index after code changes\",\n \"\",\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — View component hierarchy, props, state, and context\",\n \"- `arcbridge_get_route_map` — View Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — Analyze server/client boundaries\",\n \"\",\n \"## Architecture Bridge\",\n \"\",\n \"- `arcbridge_check_drift` — Detect architecture drift and boundary violations\",\n \"- `arcbridge_get_guidance` — Get context-aware guidance for code changes\",\n \"- `arcbridge_get_open_questions` — Surface architectural gaps\",\n \"- `arcbridge_propose_arc42_update` — Generate arc42 update proposals from code changes\",\n \"- `arcbridge_get_practice_review` — Review recent changes across 5 practice dimensions\",\n \"\",\n \"## Conventions\",\n \"\",\n \"- Follow existing patterns in the codebase\",\n \"- Stay within building block boundaries\",\n \"- Write tests for new functionality\",\n \"- Check quality scenarios before submitting changes\",\n \"\",\n ];\n\n return lines.join(\"\\n\");\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n `# ${role.name}`,\n \"\",\n role.description,\n \"\",\n ];\n\n if (role.read_only) {\n lines.push(\"**Access:** Read-only\", \"\");\n }\n\n if (role.quality_focus.length > 0) {\n lines.push(\n \"## Quality Focus\",\n \"\",\n ...role.quality_focus.map((q) => `- ${q}`),\n \"\",\n );\n }\n\n lines.push(\"## Instructions\", \"\", role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class CopilotAdapter implements PlatformAdapter {\n platform = \"copilot\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const githubDir = join(targetDir, \".github\");\n mkdirSync(githubDir, { recursive: true });\n\n const content = generateCopilotInstructions(config);\n writeFileSync(\n join(githubDir, \"copilot-instructions.md\"),\n content,\n \"utf-8\",\n );\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[]): void {\n const agentsDir = join(targetDir, \".github\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n }\n}\n","import { writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter, AdapterOptions } from \"../types.js\";\nimport { generateSkills } from \"../shared/skills.js\";\nimport { writeWithMarkerMerge } from \"../shared/marker-merge.js\";\nimport { generateInstructions } from \"../shared/instructions.js\";\n\nfunction generateAgentsMd(config: ArcBridgeConfig): string {\n return generateInstructions(config, {\n prefix: [\n \"## Codex MCP Setup\",\n \"\",\n \"Add this to your `~/.codex/config.toml` (one-time setup):\",\n \"\",\n \"```toml\",\n \"[mcp_servers.arcbridge]\",\n 'command = \"npx\"',\n 'args = [\"-y\", \"@arcbridge/mcp-server\"]',\n \"```\",\n \"\",\n ],\n suffix: [\n \"## Agent Roles\",\n \"\",\n \"Activate roles with `arcbridge_activate_role` to get specialized context.\",\n \"Roles are defined in `.arcbridge/agents/`.\",\n \"\",\n \"*Role table is appended below after agent configs are generated.*\",\n \"\",\n ],\n });\n}\n\nexport class CodexAdapter implements PlatformAdapter {\n platform = \"codex\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const agentsMdContent = generateAgentsMd(config);\n writeWithMarkerMerge(join(targetDir, \"AGENTS.md\"), agentsMdContent);\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void {\n // Append dynamic role table to AGENTS.md (replaces placeholder)\n const agentsMdPath = join(targetDir, \"AGENTS.md\");\n if (existsSync(agentsMdPath)) {\n let content = readFileSync(agentsMdPath, \"utf-8\");\n const roleTable = [\n \"| Role | Description |\",\n \"|------|-------------|\",\n ...roles.map((r) => `| \\`${r.role_id}\\` | ${r.description} |`),\n \"\",\n ].join(\"\\n\");\n\n const placeholder = \"*Role table is appended below after agent configs are generated.*\";\n if (content.includes(placeholder)) {\n content = content.replace(placeholder, roleTable);\n } else {\n // Fallback: append role table at the end if placeholder was removed\n content = `${content.trimEnd()}\\n\\n## Agent Roles\\n\\n${roleTable}\\n`;\n }\n writeFileSync(agentsMdPath, content, \"utf-8\");\n }\n\n // Generate missing skills (shared with Gemini adapter — only writes if not present)\n generateSkills(targetDir, options?.force);\n }\n}\n","import { mkdirSync, writeFileSync, existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nexport const SYNC_SKILL = `---\nname: arcbridge-sync\ndescription: Run the ArcBridge sync loop — reindex code, detect architecture drift, and update task statuses. Use after significant code changes or before completing a phase.\n---\n\n# ArcBridge Sync\n\nRun the full sync loop to keep architecture docs and task statuses in sync with code changes.\n\n## Steps\n\n1. **Reindex** — \\`arcbridge_reindex\\` to update the symbol index with recent code changes\n2. **Check drift** — \\`arcbridge_check_drift\\` to detect undeclared dependencies and missing modules\n3. **Review tasks** — \\`arcbridge_get_current_tasks\\` to see if any tasks can be inferred as done\n4. **Propose updates** — \\`arcbridge_propose_arc42_update\\` to generate documentation update proposals\n`;\n\nexport const REVIEW_SKILL = `---\nname: arcbridge-review\ndescription: Run ArcBridge phase boundary reviews — drift check, quality scenario verification, and practice review across 5 dimensions. Use before completing a phase.\n---\n\n# ArcBridge Phase Review\n\nRun the full review suite before completing a phase gate.\n\n## Steps\n\n1. **Drift check** — \\`arcbridge_check_drift\\` to catch undeclared dependencies and boundary violations\n2. **Verify scenarios** — \\`arcbridge_verify_scenarios\\` to run linked tests for quality scenarios\n3. **Practice review** — \\`arcbridge_get_practice_review\\` to review changes across architecture, security, testing, docs, and complexity\n4. **Role checks** — optionally run \\`arcbridge_run_role_check\\` with specific roles (security-reviewer, quality-guardian)\n5. **Complete phase** — if all checks pass, run \\`arcbridge_complete_phase\\` to validate gates and transition\n`;\n\n/**\n * Generate ArcBridge skills under a skills directory.\n * By default writes to `.agents/skills/` (shared convention for Codex/Gemini/OpenCode).\n * Pass a custom skillsDir to write to a platform-specific location (e.g. `.opencode/skills/`).\n * Only writes skills that don't already exist — preserves existing content.\n * Pass force=true to overwrite existing skills (e.g., after template updates).\n */\nexport function generateSkills(targetDir: string, force = false, skillsDir?: string): void {\n const dir = skillsDir ?? join(targetDir, \".agents\", \"skills\");\n\n const syncPath = join(dir, \"arcbridge-sync\", \"SKILL.md\");\n if (force || !existsSync(syncPath)) {\n mkdirSync(join(dir, \"arcbridge-sync\"), { recursive: true });\n writeFileSync(syncPath, SYNC_SKILL, \"utf-8\");\n }\n\n const reviewPath = join(dir, \"arcbridge-review\", \"SKILL.md\");\n if (force || !existsSync(reviewPath)) {\n mkdirSync(join(dir, \"arcbridge-review\"), { recursive: true });\n writeFileSync(reviewPath, REVIEW_SKILL, \"utf-8\");\n }\n}\n","import { writeFileSync, existsSync, readFileSync } from \"node:fs\";\n\nexport const MARKER = \"<!-- arcbridge-generated -->\";\n\n/**\n * Write content to a file with marker-based merge.\n * Preserves any user content above the marker, replaces everything from the marker onwards.\n * If the file has no marker, appends after existing content.\n * If the file doesn't exist, creates it with the marker.\n */\nexport function writeWithMarkerMerge(filePath: string, content: string): void {\n if (existsSync(filePath)) {\n const existing = readFileSync(filePath, \"utf-8\");\n const markerIndex = existing.indexOf(MARKER);\n\n if (markerIndex >= 0) {\n const userContent = existing.slice(0, markerIndex).trimEnd();\n const prefix = userContent ? `${userContent}\\n\\n` : \"\";\n writeFileSync(filePath, `${prefix}${MARKER}\\n\\n${content}`, \"utf-8\");\n } else {\n const existingTrimmed = existing.trimEnd();\n const prefix = existingTrimmed ? `${existingTrimmed}\\n\\n` : \"\";\n writeFileSync(filePath, `${prefix}${MARKER}\\n\\n${content}`, \"utf-8\");\n }\n } else {\n writeFileSync(filePath, `${MARKER}\\n\\n${content}`, \"utf-8\");\n }\n}\n","import type { ArcBridgeConfig } from \"@arcbridge/core\";\n\nexport interface InstructionOptions {\n /** Lines to prepend before the shared workflow section (after project overview) */\n prefix?: string[];\n /** Lines to append after the shared workflow section */\n suffix?: string[];\n}\n\n/**\n * Generate the shared ArcBridge workflow instructions.\n * Used by Gemini, OpenCode, and Codex adapters. Claude uses its own\n * variant with platform-specific wording.\n */\nexport function generateInstructions(config: ArcBridgeConfig, options?: InstructionOptions): string {\n const lines: string[] = [\n `# ${config.project_name}`,\n \"\",\n `> Auto-generated by ArcBridge. Edit .arcbridge/ files to update.`,\n \"\",\n ];\n\n if (options?.prefix) {\n lines.push(...options.prefix);\n }\n\n lines.push(\n \"## Project Overview\",\n \"\",\n `- **Type:** ${config.project_type}`,\n `- **Quality Priorities:** ${config.quality_priorities.join(\", \")}`,\n \"\",\n \"## How to Work in This Project\",\n \"\",\n \"This project follows the **Plan → Build → Sync → Review** convention using ArcBridge.\",\n \"ArcBridge provides MCP tools that give you architectural awareness. **Use them throughout your work.**\",\n \"\",\n \"### Before Starting Any Work\",\n \"\",\n \"1. Check project status: `arcbridge_get_project_status`\",\n \"2. Review current tasks: `arcbridge_get_current_tasks`\",\n \"3. Activate the appropriate role: `arcbridge_activate_role`\",\n \"\",\n \"### When Planning or Refining Architecture\",\n \"\",\n \"Activate the **architect** role: `arcbridge_activate_role({ role: \\\"architect\\\" })`\",\n \"\",\n \"- `arcbridge_get_building_blocks` — view architecture decomposition\",\n \"- `arcbridge_get_quality_scenarios` — view quality requirements\",\n \"- `arcbridge_get_open_questions` — find architectural gaps\",\n \"- `arcbridge_propose_arc42_update` — propose doc updates from code changes\",\n \"\",\n \"### When Implementing Features\",\n \"\",\n \"Activate the **implementer** role: `arcbridge_activate_role({ role: \\\"implementer\\\" })`\",\n \"\",\n \"- `arcbridge_get_guidance` — context-aware guidance for the file/block you're working on\",\n \"- `arcbridge_get_current_tasks` — check expected tasks in the current phase\",\n \"- `arcbridge_search_symbols` / `arcbridge_get_symbol` — understand existing code\",\n \"- `arcbridge_get_dependency_graph` — check module dependencies\",\n \"- `arcbridge_update_task` — mark tasks as in-progress or done\",\n \"- `arcbridge_reindex` — re-index after significant code changes\",\n \"\",\n \"### After Implementing (Phase Boundary Review)\",\n \"\",\n \"Before completing a phase:\",\n \"\",\n \"1. **Drift check:** `arcbridge_check_drift` — catch undeclared dependencies\",\n \"2. **Verify scenarios:** `arcbridge_verify_scenarios` — run linked quality tests\",\n \"3. **Practice review:** `arcbridge_get_practice_review` — review across 5 dimensions\",\n \"\",\n \"### Completing a Phase\",\n \"\",\n \"Activate the **phase-manager** role, then: `arcbridge_complete_phase`\",\n \"— validates three gates: all tasks done, no critical drift, must-have quality scenarios (priority = \\\"must\\\") not failing.\",\n \"\",\n );\n\n if (config.project_type === \"nextjs-app-router\" || config.project_type === \"react-vite\") {\n lines.push(\n \"## React & Next.js Analysis\",\n \"\",\n \"- `arcbridge_get_component_graph` — component hierarchy, props, state, context\",\n \"- `arcbridge_get_route_map` — Next.js route tree (pages, layouts, API routes)\",\n \"- `arcbridge_get_boundary_analysis` — server/client boundary analysis\",\n \"\",\n );\n }\n\n if (options?.suffix) {\n lines.push(...options.suffix);\n }\n\n return lines.join(\"\\n\");\n}\n","import { mkdirSync, writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter, AdapterOptions } from \"../types.js\";\nimport { generateSkills } from \"../shared/skills.js\";\nimport { writeWithMarkerMerge } from \"../shared/marker-merge.js\";\nimport { generateInstructions } from \"../shared/instructions.js\";\n\nfunction generateSettingsJson(): string {\n const settings = {\n mcpServers: {\n arcbridge: {\n command: \"npx\",\n args: [\"-y\", \"@arcbridge/mcp-server\"],\n },\n },\n };\n return JSON.stringify(settings, null, 2) + \"\\n\";\n}\n\nfunction yamlQuote(value: string): string {\n // Quote if value contains YAML-significant characters\n if (/[:#{}&*!|>'\"%@`\\n]/.test(value) || value !== value.trim()) {\n return JSON.stringify(value);\n }\n return value;\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n \"---\",\n `name: ${role.role_id}`,\n `description: ${yamlQuote(role.description)}`,\n ];\n\n // Build tools allowlist from role's required_tools (respects read_only constraint)\n const tools: string[] = role.required_tools.map(\n (tool) => `mcp_*_${tool}`,\n );\n if (role.read_only) {\n tools.push(\"read_file\", \"grep_search\", \"list_directory\");\n }\n if (tools.length > 0) {\n lines.push(\"tools:\");\n for (const tool of tools) {\n lines.push(` - ${tool}`);\n }\n }\n\n const suggestedModel = role.model_preferences?.suggested_models?.gemini?.trim();\n if (suggestedModel) {\n lines.push(`model: ${yamlQuote(suggestedModel)}`);\n } else if (role.model_preferences.reasoning_depth === \"high\") {\n lines.push(\"model: gemini-2.5-pro\");\n }\n\n lines.push(\"---\", \"\");\n lines.push(role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class GeminiAdapter implements PlatformAdapter {\n platform = \"gemini\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n const geminiDir = join(targetDir, \".gemini\");\n mkdirSync(geminiDir, { recursive: true });\n\n // Generate .gemini/settings.json (MCP config)\n const settingsPath = join(geminiDir, \"settings.json\");\n if (!existsSync(settingsPath)) {\n writeFileSync(settingsPath, generateSettingsJson(), \"utf-8\");\n } else {\n // Add arcbridge MCP server if not already present\n try {\n const existing = JSON.parse(readFileSync(settingsPath, \"utf-8\")) as {\n mcpServers?: Record<string, unknown>;\n };\n if (!existing.mcpServers?.arcbridge) {\n existing.mcpServers = existing.mcpServers ?? {};\n existing.mcpServers.arcbridge = {\n command: \"npx\",\n args: [\"-y\", \"@arcbridge/mcp-server\"],\n };\n writeFileSync(settingsPath, JSON.stringify(existing, null, 2) + \"\\n\", \"utf-8\");\n }\n } catch {\n // Can't parse existing settings.json — leave it alone\n }\n }\n\n // Generate .gemini/styleguide.md and GEMINI.md (same content)\n const instructionsContent = generateInstructions(config);\n writeWithMarkerMerge(join(geminiDir, \"styleguide.md\"), instructionsContent);\n writeWithMarkerMerge(join(targetDir, \"GEMINI.md\"), instructionsContent);\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void {\n // Generate .gemini/agents/*.md (Gemini subagents mapped from ArcBridge roles)\n const agentsDir = join(targetDir, \".gemini\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n\n // Generate missing skills (shared with Codex adapter — only writes if not present)\n generateSkills(targetDir, options?.force);\n }\n}\n","import { mkdirSync, writeFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AgentRole, ArcBridgeConfig } from \"@arcbridge/core\";\nimport type { PlatformAdapter, AdapterOptions } from \"../types.js\";\nimport { generateSkills } from \"../shared/skills.js\";\nimport { writeWithMarkerMerge } from \"../shared/marker-merge.js\";\nimport { generateInstructions } from \"../shared/instructions.js\";\n\nfunction generateOpenCodeJson(): string {\n const config = {\n $schema: \"https://opencode.ai/config.json\",\n instructions: [\"OPENCODE.md\"],\n mcp: {\n arcbridge: {\n type: \"local\",\n command: [\"npx\", \"-y\", \"@arcbridge/mcp-server\"],\n },\n },\n };\n return JSON.stringify(config, null, 2) + \"\\n\";\n}\n\nfunction yamlQuote(value: string): string {\n if (/[:#{}&*!|>'\"%@`\\n]/.test(value) || value !== value.trim()) {\n return JSON.stringify(value);\n }\n return value;\n}\n\nfunction generateAgentFile(role: AgentRole): string {\n const lines: string[] = [\n \"---\",\n `description: ${yamlQuote(role.description)}`,\n ];\n\n // All ArcBridge roles are invokable via @mention, so they use subagent mode\n lines.push(`mode: subagent`);\n\n // Tool permissions — deny write/edit for read-only roles\n if (role.read_only) {\n lines.push(\"permission:\");\n lines.push(\" edit: deny\");\n lines.push(\" write: deny\");\n }\n\n lines.push(\"---\", \"\");\n lines.push(role.system_prompt, \"\");\n\n return lines.join(\"\\n\");\n}\n\nexport class OpenCodeAdapter implements PlatformAdapter {\n platform = \"opencode\";\n\n generateProjectConfig(targetDir: string, config: ArcBridgeConfig): void {\n // Generate opencode.json (MCP config)\n const configPath = join(targetDir, \"opencode.json\");\n if (!existsSync(configPath)) {\n writeFileSync(configPath, generateOpenCodeJson(), \"utf-8\");\n } else {\n // Merge arcbridge config into existing opencode.json without overwriting user settings\n try {\n const existing = JSON.parse(readFileSync(configPath, \"utf-8\")) as Record<string, unknown>;\n let changed = false;\n\n // Ensure $schema is set\n if (!existing.$schema) {\n existing.$schema = \"https://opencode.ai/config.json\";\n changed = true;\n }\n\n // Ensure instructions array includes OPENCODE.md\n const instructions = existing.instructions as string[] | undefined;\n if (!Array.isArray(instructions)) {\n existing.instructions = [\"OPENCODE.md\"];\n changed = true;\n } else if (!instructions.includes(\"OPENCODE.md\")) {\n instructions.push(\"OPENCODE.md\");\n changed = true;\n }\n\n // Ensure mcp.arcbridge is present (reset mcp if it's not a plain object)\n const mcp = existing.mcp;\n const mcpObj: Record<string, unknown> =\n typeof mcp === \"object\" && mcp !== null && !Array.isArray(mcp)\n ? (mcp as Record<string, unknown>)\n : {};\n if (!mcpObj.arcbridge) {\n mcpObj.arcbridge = {\n type: \"local\",\n command: [\"npx\", \"-y\", \"@arcbridge/mcp-server\"],\n };\n existing.mcp = mcpObj;\n changed = true;\n }\n\n if (changed) {\n writeFileSync(configPath, JSON.stringify(existing, null, 2) + \"\\n\", \"utf-8\");\n }\n } catch {\n // Can't parse existing opencode.json — leave it alone\n }\n }\n\n // Generate OPENCODE.md (project instructions — opencode reads AGENTS.md by default,\n // but we use OPENCODE.md + the instructions config field to avoid colliding with Codex)\n const instructionsContent = generateInstructions(config);\n writeWithMarkerMerge(join(targetDir, \"OPENCODE.md\"), instructionsContent);\n }\n\n generateAgentConfigs(targetDir: string, roles: AgentRole[], options?: AdapterOptions): void {\n // Generate .opencode/agents/*.md (OpenCode subagents mapped from ArcBridge roles)\n const agentsDir = join(targetDir, \".opencode\", \"agents\");\n mkdirSync(agentsDir, { recursive: true });\n\n for (const role of roles) {\n const content = generateAgentFile(role);\n writeFileSync(join(agentsDir, `${role.role_id}.md`), content, \"utf-8\");\n }\n\n // Generate skills under .opencode/skills/ (OpenCode loads from .opencode/skills/*/SKILL.md)\n generateSkills(targetDir, options?.force, join(targetDir, \".opencode\", \"skills\"));\n\n // Also generate shared .agents/skills/ (OpenCode loads these too)\n generateSkills(targetDir, options?.force);\n }\n}\n","export type { PlatformAdapter, AdapterOptions } from \"./types.js\";\nexport { ClaudeAdapter } from \"./claude/claude-adapter.js\";\nexport { CopilotAdapter } from \"./copilot/copilot-adapter.js\";\nexport { CodexAdapter } from \"./codex/codex-adapter.js\";\nexport { GeminiAdapter } from \"./gemini/gemini-adapter.js\";\nexport { OpenCodeAdapter } from \"./opencode/opencode-adapter.js\";\n\nimport type { PlatformAdapter } from \"./types.js\";\nimport { ClaudeAdapter } from \"./claude/claude-adapter.js\";\nimport { CopilotAdapter } from \"./copilot/copilot-adapter.js\";\nimport { CodexAdapter } from \"./codex/codex-adapter.js\";\nimport { GeminiAdapter } from \"./gemini/gemini-adapter.js\";\nimport { OpenCodeAdapter } from \"./opencode/opencode-adapter.js\";\n\nconst adapters: Record<string, () => PlatformAdapter> = {\n claude: () => new ClaudeAdapter(),\n copilot: () => new CopilotAdapter(),\n codex: () => new CodexAdapter(),\n gemini: () => new GeminiAdapter(),\n opencode: () => new OpenCodeAdapter(),\n};\n\nexport function getAdapter(platform: string): PlatformAdapter {\n const factory = adapters[platform];\n if (!factory) {\n throw new Error(\n `Unknown platform: ${platform}. Available: ${Object.keys(adapters).join(\", \")}`,\n );\n }\n return factory();\n}\n"],"mappings":";AAAA,SAAS,WAAW,eAAe,YAAY,oBAAoB;AACnE,SAAS,YAAY;AAIrB,SAAS,iBAAiB,QAAiC;AACzD,QAAM,QAAkB;AAAA,IACtB,KAAK,OAAO,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,OAAO,YAAY;AA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,QAAQ;AACvD,IAAAI,WAAU,WAAW,EAAE,WAAW,KAAK,CAAC;AAExC,eAAW,QAAQ,OAAO;AACxB,YAAM,UAAUL,mBAAkB,IAAI;AACtC,MAAAG,eAAcF,MAAK,WAAW,GAAG,KAAK,OAAO,KAAK,GAAG,SAAS,OAAO;AAAA,IACvE;AAGA,mBAAe,WAAW,SAAS,OAAOA,MAAK,WAAW,aAAa,QAAQ,CAAC;AAGhF,mBAAe,WAAW,SAAS,KAAK;AAAA,EAC1C;AACF;;;AChHA,IAAM,WAAkD;AAAA,EACtD,QAAQ,MAAM,IAAI,cAAc;AAAA,EAChC,SAAS,MAAM,IAAI,eAAe;AAAA,EAClC,OAAO,MAAM,IAAI,aAAa;AAAA,EAC9B,QAAQ,MAAM,IAAI,cAAc;AAAA,EAChC,UAAU,MAAM,IAAI,gBAAgB;AACtC;AAEO,SAAS,WAAW,UAAmC;AAC5D,QAAM,UAAU,SAAS,QAAQ;AACjC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,qBAAqB,QAAQ,gBAAgB,OAAO,KAAK,QAAQ,EAAE,KAAK,IAAI,CAAC;AAAA,IAC/E;AAAA,EACF;AACA,SAAO,QAAQ;AACjB;","names":["mkdirSync","writeFileSync","join","generateAgentFile","writeFileSync","existsSync","readFileSync","join","mkdirSync","writeFileSync","existsSync","join","writeFileSync","existsSync","readFileSync","join","existsSync","readFileSync","writeFileSync","mkdirSync","writeFileSync","existsSync","readFileSync","join","generateAgentFile","join","mkdirSync","existsSync","writeFileSync","readFileSync","mkdirSync","writeFileSync","existsSync","readFileSync","join","yamlQuote","generateAgentFile","join","existsSync","writeFileSync","readFileSync","mkdirSync"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcbridge/adapters",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Platform adapters for ArcBridge — Claude Code and GitHub Copilot config generators",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcbridge/core": "0.4.
|
|
35
|
+
"@arcbridge/core": "0.4.2"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=22.16.0"
|