pulse-coder-engine 0.0.1-alpha.6 → 0.0.1-alpha.7

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.
@@ -660,6 +660,13 @@ var builtInPlanModePlugin = {
660
660
  async initialize(context) {
661
661
  const service = new BuiltInPlanModeService(context.logger, context.events, "executing");
662
662
  context.registerRunHook("plan-mode", ({ context: runContext, tools, systemPrompt, hooks }) => {
663
+ const mode = service.getMode();
664
+ if (mode === "executing") {
665
+ return {
666
+ systemPrompt,
667
+ hooks
668
+ };
669
+ }
663
670
  const transition = service.processContextMessages(runContext.messages);
664
671
  const append = service.buildPromptAppend(Object.keys(tools), transition);
665
672
  const finalSystemPrompt = appendSystemPrompt(systemPrompt, append);
@@ -880,9 +887,10 @@ var streamTextAI = (messages, tools, options) => {
880
887
  const provider = options?.provider ?? CoderAI;
881
888
  const model = options?.model ?? DEFAULT_MODEL;
882
889
  const wrappedTools = options?.toolExecutionContext ? wrapToolsWithContext(tools, options.toolExecutionContext) : tools;
890
+ const finalSystemPrompt = resolveSystemPrompt(options?.systemPrompt);
883
891
  return (0, import_ai.streamText)({
884
892
  model: provider(model),
885
- system: resolveSystemPrompt(options?.systemPrompt),
893
+ system: finalSystemPrompt,
886
894
  messages,
887
895
  tools: wrappedTools,
888
896
  providerOptions,
@@ -1689,20 +1697,15 @@ var SubAgentPlugin = class {
1689
1697
  async initialize(context) {
1690
1698
  try {
1691
1699
  const configs = await this.configLoader.loadAgentConfigs();
1692
- const tools = this.getAvailableTools(context);
1693
1700
  for (const config of configs) {
1694
- this.registerAgentTool(context, config, tools);
1701
+ this.registerAgentTool(context, config);
1695
1702
  }
1696
1703
  context.logger.info(`SubAgentPlugin loaded ${configs.length} agents.`);
1697
1704
  } catch (error) {
1698
1705
  context.logger.error("Failed to initialize SubAgentPlugin", error);
1699
1706
  }
1700
1707
  }
1701
- getAvailableTools(context) {
1702
- const allTools = {};
1703
- return BuiltinToolsMap;
1704
- }
1705
- registerAgentTool(context, config, tools) {
1708
+ registerAgentTool(context, config) {
1706
1709
  const toolName = `${config.name}_agent`;
1707
1710
  const tool2 = {
1708
1711
  description: config.description,
@@ -1711,6 +1714,7 @@ var SubAgentPlugin = class {
1711
1714
  context: import_zod10.z.any().optional().describe("\u4EFB\u52A1\u4E0A\u4E0B\u6587\u4FE1\u606F")
1712
1715
  }),
1713
1716
  execute: async ({ task, context: taskContext }) => {
1717
+ const tools = { ...BuiltinToolsMap, ...context.getTools() };
1714
1718
  try {
1715
1719
  context.logger.info(`Running agent ${config.name}: ${task}`);
1716
1720
  const result = await this.agentRunner.runAgent(config, task, taskContext, tools);