pulse-coder-engine 0.0.1-alpha.6 → 0.0.1-alpha.8
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/built-in/index.cjs +12 -8
- package/dist/built-in/index.cjs.map +1 -1
- package/dist/built-in/index.d.cts +1 -1
- package/dist/built-in/index.d.ts +1 -1
- package/dist/built-in/index.js +12 -8
- package/dist/built-in/index.js.map +1 -1
- package/dist/{index-BkkQyz2L.d.cts → index-Dh5B8P2t.d.cts} +3 -17
- package/dist/{index-BkkQyz2L.d.ts → index-Dh5B8P2t.d.ts} +3 -17
- package/dist/index.cjs +36 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +36 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/built-in/index.js
CHANGED
|
@@ -617,6 +617,13 @@ var builtInPlanModePlugin = {
|
|
|
617
617
|
async initialize(context) {
|
|
618
618
|
const service = new BuiltInPlanModeService(context.logger, context.events, "executing");
|
|
619
619
|
context.registerRunHook("plan-mode", ({ context: runContext, tools, systemPrompt, hooks }) => {
|
|
620
|
+
const mode = service.getMode();
|
|
621
|
+
if (mode === "executing") {
|
|
622
|
+
return {
|
|
623
|
+
systemPrompt,
|
|
624
|
+
hooks
|
|
625
|
+
};
|
|
626
|
+
}
|
|
620
627
|
const transition = service.processContextMessages(runContext.messages);
|
|
621
628
|
const append = service.buildPromptAppend(Object.keys(tools), transition);
|
|
622
629
|
const finalSystemPrompt = appendSystemPrompt(systemPrompt, append);
|
|
@@ -837,9 +844,10 @@ var streamTextAI = (messages, tools, options) => {
|
|
|
837
844
|
const provider = options?.provider ?? CoderAI;
|
|
838
845
|
const model = options?.model ?? DEFAULT_MODEL;
|
|
839
846
|
const wrappedTools = options?.toolExecutionContext ? wrapToolsWithContext(tools, options.toolExecutionContext) : tools;
|
|
847
|
+
const finalSystemPrompt = resolveSystemPrompt(options?.systemPrompt);
|
|
840
848
|
return streamText({
|
|
841
849
|
model: provider(model),
|
|
842
|
-
system:
|
|
850
|
+
system: finalSystemPrompt,
|
|
843
851
|
messages,
|
|
844
852
|
tools: wrappedTools,
|
|
845
853
|
providerOptions,
|
|
@@ -1646,20 +1654,15 @@ var SubAgentPlugin = class {
|
|
|
1646
1654
|
async initialize(context) {
|
|
1647
1655
|
try {
|
|
1648
1656
|
const configs = await this.configLoader.loadAgentConfigs();
|
|
1649
|
-
const tools = this.getAvailableTools(context);
|
|
1650
1657
|
for (const config of configs) {
|
|
1651
|
-
this.registerAgentTool(context, config
|
|
1658
|
+
this.registerAgentTool(context, config);
|
|
1652
1659
|
}
|
|
1653
1660
|
context.logger.info(`SubAgentPlugin loaded ${configs.length} agents.`);
|
|
1654
1661
|
} catch (error) {
|
|
1655
1662
|
context.logger.error("Failed to initialize SubAgentPlugin", error);
|
|
1656
1663
|
}
|
|
1657
1664
|
}
|
|
1658
|
-
|
|
1659
|
-
const allTools = {};
|
|
1660
|
-
return BuiltinToolsMap;
|
|
1661
|
-
}
|
|
1662
|
-
registerAgentTool(context, config, tools) {
|
|
1665
|
+
registerAgentTool(context, config) {
|
|
1663
1666
|
const toolName = `${config.name}_agent`;
|
|
1664
1667
|
const tool2 = {
|
|
1665
1668
|
description: config.description,
|
|
@@ -1668,6 +1671,7 @@ var SubAgentPlugin = class {
|
|
|
1668
1671
|
context: z10.any().optional().describe("\u4EFB\u52A1\u4E0A\u4E0B\u6587\u4FE1\u606F")
|
|
1669
1672
|
}),
|
|
1670
1673
|
execute: async ({ task, context: taskContext }) => {
|
|
1674
|
+
const tools = { ...BuiltinToolsMap, ...context.getTools() };
|
|
1671
1675
|
try {
|
|
1672
1676
|
context.logger.info(`Running agent ${config.name}: ${task}`);
|
|
1673
1677
|
const result = await this.agentRunner.runAgent(config, task, taskContext, tools);
|