@docyrus/docyrus 0.0.44 → 0.0.45
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/agent-loader.js +30 -21
- package/agent-loader.js.map +2 -2
- package/main.js +1 -1
- package/main.js.map +1 -1
- package/package.json +1 -1
package/agent-loader.js
CHANGED
|
@@ -2869,18 +2869,35 @@ async function main() {
|
|
|
2869
2869
|
});
|
|
2870
2870
|
await resourceLoader.reload();
|
|
2871
2871
|
spinner.update("Creating session...");
|
|
2872
|
-
const
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2872
|
+
const tools = buildTools(request.profile, cwd, pi);
|
|
2873
|
+
const createRuntime = async (options) => {
|
|
2874
|
+
const created = await pi.createAgentSession({
|
|
2875
|
+
cwd: options.cwd,
|
|
2876
|
+
agentDir: options.agentDir,
|
|
2877
|
+
authStorage,
|
|
2878
|
+
modelRegistry,
|
|
2879
|
+
resourceLoader,
|
|
2880
|
+
settingsManager,
|
|
2881
|
+
sessionManager: options.sessionManager,
|
|
2882
|
+
tools,
|
|
2883
|
+
model: requestedModel,
|
|
2884
|
+
thinkingLevel: request.thinking,
|
|
2885
|
+
sessionStartEvent: options.sessionStartEvent
|
|
2886
|
+
});
|
|
2887
|
+
return {
|
|
2888
|
+
...created,
|
|
2889
|
+
services: {
|
|
2890
|
+
cwd: options.cwd,
|
|
2891
|
+
agentDir: options.agentDir,
|
|
2892
|
+
authStorage,
|
|
2893
|
+
modelRegistry,
|
|
2894
|
+
resourceLoader,
|
|
2895
|
+
settingsManager
|
|
2896
|
+
}
|
|
2897
|
+
};
|
|
2898
|
+
};
|
|
2899
|
+
const initialResult = await createRuntime({ cwd, agentDir, sessionManager });
|
|
2900
|
+
const { session, modelFallbackMessage, extensionsResult } = initialResult;
|
|
2884
2901
|
if (hasPackagedMcpAdapter) {
|
|
2885
2902
|
extensionsResult.runtime.flagValues.set("mcp-config", mcpConfigPath);
|
|
2886
2903
|
}
|
|
@@ -2892,15 +2909,7 @@ async function main() {
|
|
|
2892
2909
|
if (pipedStdin !== void 0 && !request.print) {
|
|
2893
2910
|
request.print = true;
|
|
2894
2911
|
}
|
|
2895
|
-
const runtime = new pi.AgentSessionRuntime(session,
|
|
2896
|
-
cwd,
|
|
2897
|
-
agentDir,
|
|
2898
|
-
authStorage,
|
|
2899
|
-
modelRegistry,
|
|
2900
|
-
resourceLoader,
|
|
2901
|
-
settingsManager,
|
|
2902
|
-
sessionManager
|
|
2903
|
-
});
|
|
2912
|
+
const runtime = new pi.AgentSessionRuntime(session, initialResult.services, createRuntime);
|
|
2904
2913
|
if (request.print || pipedStdin !== void 0) {
|
|
2905
2914
|
if (!session.model) {
|
|
2906
2915
|
throw new Error(`No models available.
|