@tdsoft-tech/aikit 0.1.11 → 0.1.13

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.
@@ -995,7 +995,8 @@ var ConfigSchema = z.object({
995
995
  context7: z.boolean().default(false),
996
996
  githubGrep: z.boolean().default(false),
997
997
  gkg: z.boolean().default(false)
998
- }).optional()
998
+ }).optional(),
999
+ mode: z.string().default("build").optional()
999
1000
  });
1000
1001
  var Config = class {
1001
1002
  config;
@@ -1029,6 +1030,9 @@ var Config = class {
1029
1030
  get antiHallucination() {
1030
1031
  return this.config.antiHallucination;
1031
1032
  }
1033
+ get mode() {
1034
+ return this.config.mode;
1035
+ }
1032
1036
  get configPath() {
1033
1037
  return this.config.configPath;
1034
1038
  }
@@ -1500,6 +1504,51 @@ For diagrams:
1500
1504
  - Map to code structure
1501
1505
  - Note data flow`,
1502
1506
  delegatesTo: []
1507
+ },
1508
+ {
1509
+ name: "one-shot",
1510
+ displayName: "@one-shot",
1511
+ description: "End-to-end autonomous task execution (beta)",
1512
+ useWhen: "Complete tasks autonomously from start to finish with minimal intervention",
1513
+ capabilities: [
1514
+ "Gather requirements interactively",
1515
+ "Create detailed implementation plans",
1516
+ "Execute tasks with dynamic agent selection",
1517
+ "Run quality gates until all pass",
1518
+ "Multi-level verification",
1519
+ "Auto-recovery from failures",
1520
+ "Generate completion proof"
1521
+ ],
1522
+ systemPrompt: `You are the one-shot agent. Your role is to execute tasks autonomously from start to finish.
1523
+
1524
+ ## Workflow Phases
1525
+
1526
+ 1. **REQUIREMENTS**: Gather task type, scope, dependencies, success criteria
1527
+ 2. **PLANNING**: Create detailed plan with @planner, recommend skills/tools
1528
+ 3. **COMPLEXITY**: Auto-split large tasks (>30min, >10 files, >500 lines)
1529
+ 4. **EXECUTION**: Execute with parallel tasks, dynamic agent delegation
1530
+ 5. **TESTING**: Run quality gates (typecheck, test, lint, build) until all pass
1531
+ 6. **VERIFICATION**: Multi-level verification (gates + manual + deployment)
1532
+ 7. **COMPLETION**: Generate proof, update tracking, collect feedback
1533
+
1534
+ ## Quality Gates (Must ALL Pass)
1535
+ - npm run typecheck - No type errors
1536
+ - npm run test - All tests pass
1537
+ - npm run lint - No linting errors
1538
+ - npm run build - Build succeeds
1539
+
1540
+ ## Error Recovery (3 Levels)
1541
+ - Level 1: Auto-fix (type errors, lint --fix)
1542
+ - Level 2: Alternative approach via @review
1543
+ - Level 3: User intervention + follow-up task creation
1544
+
1545
+ ## Best Practices
1546
+ - Use for straightforward tasks first
1547
+ - Consider /plan + /implement for complex features
1548
+ - Review changes before final approval
1549
+
1550
+ \u26A0\uFE0F This mode is experimental. Start with simpler tasks.`,
1551
+ delegatesTo: ["planner", "build", "review", "scout", "explore", "vision"]
1503
1552
  }
1504
1553
  ];
1505
1554
  var AgentManager = class {
@@ -3405,6 +3454,8 @@ var AiKitMcpServer = class {
3405
3454
  commandRunner;
3406
3455
  toolRegistry;
3407
3456
  toolConfigManager;
3457
+ currentMode = "build";
3458
+ // Default mode
3408
3459
  constructor() {
3409
3460
  const capabilities = {
3410
3461
  tools: {}
@@ -3511,6 +3562,38 @@ var AiKitMcpServer = class {
3511
3562
  }
3512
3563
  });
3513
3564
  }
3565
+ tools.push({
3566
+ name: "get_current_mode",
3567
+ description: "Get the current AIKit mode (plan, build, one-shot)",
3568
+ inputSchema: {
3569
+ type: "object",
3570
+ properties: {},
3571
+ required: []
3572
+ }
3573
+ });
3574
+ tools.push({
3575
+ name: "set_mode",
3576
+ description: "Set the AIKit mode (plan, build, one-shot)",
3577
+ inputSchema: {
3578
+ type: "object",
3579
+ properties: {
3580
+ mode: {
3581
+ type: "string",
3582
+ description: "Mode to set (plan, build, one-shot)",
3583
+ required: true
3584
+ }
3585
+ }
3586
+ }
3587
+ });
3588
+ tools.push({
3589
+ name: "list_modes",
3590
+ description: "List available AIKit modes",
3591
+ inputSchema: {
3592
+ type: "object",
3593
+ properties: {},
3594
+ required: []
3595
+ }
3596
+ });
3514
3597
  } catch (error) {
3515
3598
  logger.error(`Failed to list tools: ${error}`);
3516
3599
  }
@@ -3552,6 +3635,23 @@ Reasoning: ${decision.reason}`;
3552
3635
  } catch (error) {
3553
3636
  result = `Error executing tool ${toolName}: ${error instanceof Error ? error.message : String(error)}`;
3554
3637
  }
3638
+ } else if (name === "get_current_mode") {
3639
+ const modeInfo = this.getModeInfo(this.currentMode);
3640
+ result = `Current mode: ${modeInfo}`;
3641
+ } else if (name === "set_mode") {
3642
+ const mode = args?.mode;
3643
+ const validModes = ["plan", "build", "one-shot"];
3644
+ if (!mode || !validModes.includes(mode)) {
3645
+ result = `Invalid mode. Available modes: ${validModes.join(", ")}`;
3646
+ } else {
3647
+ this.currentMode = mode;
3648
+ const modeInfo = this.getModeInfo(mode);
3649
+ result = `Mode set to: ${modeInfo}`;
3650
+ logger.info(`Mode changed to: ${mode}`);
3651
+ }
3652
+ } else if (name === "list_modes") {
3653
+ const modes = this.getAllModesInfo();
3654
+ result = modes;
3555
3655
  } else {
3556
3656
  result = `Unknown tool: ${name}`;
3557
3657
  }
@@ -3575,6 +3675,25 @@ Reasoning: ${decision.reason}`;
3575
3675
  };
3576
3676
  }
3577
3677
  }
3678
+ /**
3679
+ * Get mode information for display
3680
+ */
3681
+ getModeInfo(mode) {
3682
+ const modeDescriptions = {
3683
+ plan: { icon: "\u{1F4CB}", description: "Create detailed implementation plans" },
3684
+ build: { icon: "\u{1F527}", description: "Direct execution mode" },
3685
+ "one-shot": { icon: "\u{1F680}", description: "End-to-end autonomous execution" }
3686
+ };
3687
+ const info = modeDescriptions[mode] || modeDescriptions.build;
3688
+ return `${info.icon} ${mode.toUpperCase()} - ${info.description}`;
3689
+ }
3690
+ /**
3691
+ * Get all modes information
3692
+ */
3693
+ getAllModesInfo() {
3694
+ const modes = ["plan", "build", "one-shot"];
3695
+ return modes.map((mode) => this.getModeInfo(mode)).join("\n");
3696
+ }
3578
3697
  async initialize() {
3579
3698
  try {
3580
3699
  const config = await loadConfig();
@@ -3584,6 +3703,8 @@ Reasoning: ${decision.reason}`;
3584
3703
  this.toolRegistry = new ToolRegistry(config);
3585
3704
  this.toolConfigManager = new ToolConfigManager(config);
3586
3705
  this.toolRegistry.setToolConfigManager(this.toolConfigManager);
3706
+ this.currentMode = config.mode || "build";
3707
+ logger.info(`AIKit mode set to: ${this.currentMode}`);
3587
3708
  const figmaReady = await this.toolConfigManager.isToolReady("figma-analysis");
3588
3709
  if (figmaReady) {
3589
3710
  logger.info("Figma tool configured and ready");