@google/gemini-cli-core 0.10.0-preview.3 → 0.11.0-nightly.20251021.e72c00cf
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/README.md +9 -0
- package/dist/google-gemini-cli-core-0.11.0-nightly.20251020.a96f0659.tgz +0 -0
- package/dist/src/agents/codebase-investigator.js +2 -5
- package/dist/src/agents/codebase-investigator.js.map +1 -1
- package/dist/src/agents/executor.js +6 -13
- package/dist/src/agents/executor.js.map +1 -1
- package/dist/src/agents/executor.test.js +36 -31
- package/dist/src/agents/executor.test.js.map +1 -1
- package/dist/src/code_assist/converter.d.ts +1 -0
- package/dist/src/code_assist/converter.js +1 -0
- package/dist/src/code_assist/converter.js.map +1 -1
- package/dist/src/code_assist/converter.test.js +19 -0
- package/dist/src/code_assist/converter.test.js.map +1 -1
- package/dist/src/config/config.d.ts +6 -8
- package/dist/src/config/config.js +14 -17
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +0 -4
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.d.ts +2 -1
- package/dist/src/confirmation-bus/message-bus.js +7 -1
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/types.d.ts +12 -2
- package/dist/src/confirmation-bus/types.js +1 -0
- package/dist/src/confirmation-bus/types.js.map +1 -1
- package/dist/src/core/client.test.js +0 -1
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/coreToolScheduler.d.ts +7 -0
- package/dist/src/core/coreToolScheduler.js +46 -10
- package/dist/src/core/coreToolScheduler.js.map +1 -1
- package/dist/src/core/coreToolScheduler.test.js +124 -3
- package/dist/src/core/coreToolScheduler.test.js.map +1 -1
- package/dist/src/core/geminiChat.js +1 -0
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/nonInteractiveToolExecutor.test.js +3 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -1
- package/dist/src/core/prompts.js +13 -20
- package/dist/src/core/prompts.js.map +1 -1
- package/dist/src/core/turn.d.ts +2 -0
- package/dist/src/core/turn.js +3 -1
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +48 -0
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/stream-json-formatter.d.ts +32 -0
- package/dist/src/output/stream-json-formatter.js +52 -0
- package/dist/src/output/stream-json-formatter.js.map +1 -0
- package/dist/src/output/stream-json-formatter.test.js +479 -0
- package/dist/src/output/stream-json-formatter.test.js.map +1 -0
- package/dist/src/output/types.d.ts +63 -1
- package/dist/src/output/types.js +11 -0
- package/dist/src/output/types.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +30 -21
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +16 -11
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/telemetry/activity-monitor.d.ts +116 -0
- package/dist/src/telemetry/activity-monitor.js +208 -0
- package/dist/src/telemetry/activity-monitor.js.map +1 -0
- package/dist/src/telemetry/activity-monitor.test.d.ts +6 -0
- package/dist/src/telemetry/activity-monitor.test.js +248 -0
- package/dist/src/telemetry/activity-monitor.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +7 -7
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +3 -10
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +2 -1
- package/dist/src/telemetry/index.js +2 -1
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +0 -1
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/tools/edit.js +5 -5
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +0 -1
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/glob.d.ts +3 -2
- package/dist/src/tools/glob.js +6 -6
- package/dist/src/tools/glob.js.map +1 -1
- package/dist/src/tools/grep.d.ts +3 -2
- package/dist/src/tools/grep.js +16 -10
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/ls.d.ts +3 -2
- package/dist/src/tools/ls.js +8 -7
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.d.ts +2 -9
- package/dist/src/tools/mcp-client-manager.js +6 -14
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +16 -6
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/memoryTool.d.ts +1 -1
- package/dist/src/tools/memoryTool.js +3 -2
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/message-bus-integration.test.js +14 -1
- package/dist/src/tools/message-bus-integration.test.js.map +1 -1
- package/dist/src/tools/read-file.d.ts +4 -3
- package/dist/src/tools/read-file.js +9 -8
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-many-files.d.ts +4 -3
- package/dist/src/tools/read-many-files.js +11 -8
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +3 -2
- package/dist/src/tools/ripGrep.js +45 -16
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +106 -60
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +1 -1
- package/dist/src/tools/shell.js +21 -57
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +61 -8
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/smart-edit.js +4 -4
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/smart-edit.test.js +0 -1
- package/dist/src/tools/smart-edit.test.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +8 -0
- package/dist/src/tools/tool-names.js +8 -5
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-registry.js +1 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tools.d.ts +15 -9
- package/dist/src/tools/tools.js +51 -38
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/web-fetch.d.ts +4 -3
- package/dist/src/tools/web-fetch.js +45 -20
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/web-fetch.test.js +261 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -1
- package/dist/src/tools/web-search.d.ts +4 -3
- package/dist/src/tools/web-search.js +8 -6
- package/dist/src/tools/web-search.js.map +1 -1
- package/dist/src/tools/write-file.d.ts +1 -1
- package/dist/src/tools/write-file.js +1 -1
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +0 -1
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/tools/write-todos.d.ts +2 -7
- package/dist/src/tools/write-todos.js +1 -1
- package/dist/src/tools/write-todos.js.map +1 -1
- package/dist/src/tools/write-todos.test.js +2 -2
- package/dist/src/tools/write-todos.test.js.map +1 -1
- package/dist/src/utils/debugLogger.d.ts +25 -0
- package/dist/src/utils/debugLogger.js +33 -0
- package/dist/src/utils/debugLogger.js.map +1 -0
- package/dist/src/utils/debugLogger.test.d.ts +6 -0
- package/dist/src/utils/debugLogger.test.js +67 -0
- package/dist/src/utils/debugLogger.test.js.map +1 -0
- package/dist/src/utils/delay.d.ts +16 -0
- package/dist/src/utils/delay.js +43 -0
- package/dist/src/utils/delay.js.map +1 -0
- package/dist/src/utils/delay.test.d.ts +6 -0
- package/dist/src/utils/delay.test.js +88 -0
- package/dist/src/utils/delay.test.js.map +1 -0
- package/dist/src/utils/editCorrector.js +5 -9
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +3 -5
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/editor.js +33 -38
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/environmentContext.js +0 -33
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +0 -34
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/fetch.d.ts +1 -0
- package/dist/src/utils/fetch.js +9 -0
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fileUtils.d.ts +4 -0
- package/dist/src/utils/fileUtils.js +31 -0
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/fileUtils.test.js +12 -1
- package/dist/src/utils/fileUtils.test.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.js +7 -6
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.test.js +30 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +2 -1
- package/dist/src/utils/memoryDiscovery.js +9 -9
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +39 -17
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/retry.d.ts +1 -0
- package/dist/src/utils/retry.js +14 -12
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +17 -0
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/safeJsonStringify.d.ts +4 -4
- package/dist/src/utils/safeJsonStringify.js +31 -7
- package/dist/src/utils/safeJsonStringify.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +14 -2
- package/dist/src/utils/shell-utils.js +353 -136
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +154 -60
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/tool-utils.d.ts +2 -2
- package/dist/src/utils/tool-utils.js +14 -5
- package/dist/src/utils/tool-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/dist/google-gemini-cli-core-0.10.0-preview.2.tgz +0 -0
- package/dist/src/core/subagent.d.ts +0 -236
- package/dist/src/core/subagent.js +0 -482
- package/dist/src/core/subagent.js.map +0 -1
- package/dist/src/core/subagent.test.js +0 -556
- package/dist/src/core/subagent.test.js.map +0 -1
- /package/dist/src/{core/subagent.test.d.ts → output/stream-json-formatter.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/gemini-cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-nightly.20251021.e72c00cf",
|
|
4
4
|
"description": "Gemini CLI Core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@google/
|
|
23
|
+
"@google-cloud/logging": "^11.2.1",
|
|
24
24
|
"@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.21.0",
|
|
25
25
|
"@google-cloud/opentelemetry-cloud-trace-exporter": "^3.0.0",
|
|
26
|
-
"@google
|
|
26
|
+
"@google/genai": "1.16.0",
|
|
27
27
|
"@joshua.litt/get-ripgrep": "^0.0.2",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
|
29
29
|
"@opentelemetry/api": "^1.9.0",
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
"shell-quote": "^1.8.3",
|
|
62
62
|
"simple-git": "^3.28.0",
|
|
63
63
|
"strip-ansi": "^7.1.0",
|
|
64
|
+
"tree-sitter-bash": "^0.25.0",
|
|
64
65
|
"undici": "^7.10.0",
|
|
66
|
+
"web-tree-sitter": "^0.25.10",
|
|
65
67
|
"ws": "^8.18.0"
|
|
66
68
|
},
|
|
67
69
|
"optionalDependencies": {
|
|
Binary file
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import type { AnyDeclarativeTool } from '../tools/tools.js';
|
|
7
|
-
import type { Config } from '../config/config.js';
|
|
8
|
-
import type { Content, FunctionDeclaration } from '@google/genai';
|
|
9
|
-
/**
|
|
10
|
-
* @fileoverview Defines the configuration interfaces for a subagent.
|
|
11
|
-
*
|
|
12
|
-
* These interfaces specify the structure for defining the subagent's prompt,
|
|
13
|
-
* the model parameters, and the execution settings.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Describes the possible termination modes for a subagent.
|
|
17
|
-
* This enum provides a clear indication of why a subagent's execution might have ended.
|
|
18
|
-
*/
|
|
19
|
-
export declare enum SubagentTerminateMode {
|
|
20
|
-
/**
|
|
21
|
-
* Indicates that the subagent's execution terminated due to an unrecoverable error.
|
|
22
|
-
*/
|
|
23
|
-
ERROR = "ERROR",
|
|
24
|
-
/**
|
|
25
|
-
* Indicates that the subagent's execution terminated because it exceeded the maximum allowed working time.
|
|
26
|
-
*/
|
|
27
|
-
TIMEOUT = "TIMEOUT",
|
|
28
|
-
/**
|
|
29
|
-
* Indicates that the subagent's execution successfully completed all its defined goals.
|
|
30
|
-
*/
|
|
31
|
-
GOAL = "GOAL",
|
|
32
|
-
/**
|
|
33
|
-
* Indicates that the subagent's execution terminated because it exceeded the maximum number of turns.
|
|
34
|
-
*/
|
|
35
|
-
MAX_TURNS = "MAX_TURNS"
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Represents the output structure of a subagent's execution.
|
|
39
|
-
* This interface defines the data that a subagent will return upon completion,
|
|
40
|
-
* including any emitted variables and the reason for its termination.
|
|
41
|
-
*/
|
|
42
|
-
export interface OutputObject {
|
|
43
|
-
/**
|
|
44
|
-
* A record of key-value pairs representing variables emitted by the subagent
|
|
45
|
-
* during its execution. These variables can be used by the calling agent.
|
|
46
|
-
*/
|
|
47
|
-
emitted_vars: Record<string, string>;
|
|
48
|
-
/**
|
|
49
|
-
* The reason for the subagent's termination, indicating whether it completed
|
|
50
|
-
* successfully, timed out, or encountered an error.
|
|
51
|
-
*/
|
|
52
|
-
terminate_reason: SubagentTerminateMode;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Configures the initial prompt for the subagent.
|
|
56
|
-
*/
|
|
57
|
-
export interface PromptConfig {
|
|
58
|
-
/**
|
|
59
|
-
* A single system prompt string that defines the subagent's persona and instructions.
|
|
60
|
-
* Note: You should use either `systemPrompt` or `initialMessages`, but not both.
|
|
61
|
-
*/
|
|
62
|
-
systemPrompt?: string;
|
|
63
|
-
/**
|
|
64
|
-
* An array of user/model content pairs to seed the chat history for few-shot prompting.
|
|
65
|
-
* Note: You should use either `systemPrompt` or `initialMessages`, but not both.
|
|
66
|
-
*/
|
|
67
|
-
initialMessages?: Content[];
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Configures the tools available to the subagent during its execution.
|
|
71
|
-
*/
|
|
72
|
-
export interface ToolConfig {
|
|
73
|
-
/**
|
|
74
|
-
* A list of tool names (from the tool registry), full function declarations,
|
|
75
|
-
* or BaseTool instances that the subagent is permitted to use.
|
|
76
|
-
*/
|
|
77
|
-
tools: Array<string | FunctionDeclaration | AnyDeclarativeTool>;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Configures the expected outputs for the subagent.
|
|
81
|
-
*/
|
|
82
|
-
export interface OutputConfig {
|
|
83
|
-
/**
|
|
84
|
-
* A record describing the variables the subagent is expected to emit.
|
|
85
|
-
* The subagent will be prompted to generate these values before terminating.
|
|
86
|
-
*/
|
|
87
|
-
outputs: Record<string, string>;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Configures the generative model parameters for the subagent.
|
|
91
|
-
* This interface specifies the model to be used and its associated generation settings,
|
|
92
|
-
* such as temperature and top-p values, which influence the creativity and diversity of the model's output.
|
|
93
|
-
*/
|
|
94
|
-
export interface ModelConfig {
|
|
95
|
-
/**
|
|
96
|
-
* The name or identifier of the model to be used (e.g., 'gemini-2.5-pro').
|
|
97
|
-
*
|
|
98
|
-
* TODO: In the future, this needs to support 'auto' or some other string to support routing use cases.
|
|
99
|
-
*/
|
|
100
|
-
model: string;
|
|
101
|
-
/**
|
|
102
|
-
* The temperature for the model's sampling process.
|
|
103
|
-
*/
|
|
104
|
-
temp: number;
|
|
105
|
-
/**
|
|
106
|
-
* The top-p value for nucleus sampling.
|
|
107
|
-
*/
|
|
108
|
-
top_p: number;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Configures the execution environment and constraints for the subagent.
|
|
112
|
-
* This interface defines parameters that control the subagent's runtime behavior,
|
|
113
|
-
* such as maximum execution time, to prevent infinite loops or excessive resource consumption.
|
|
114
|
-
*
|
|
115
|
-
* TODO: Consider adding max_tokens as a form of budgeting.
|
|
116
|
-
*/
|
|
117
|
-
export interface RunConfig {
|
|
118
|
-
/** The maximum execution time for the subagent in minutes. */
|
|
119
|
-
max_time_minutes: number;
|
|
120
|
-
/**
|
|
121
|
-
* The maximum number of conversational turns (a user message + model response)
|
|
122
|
-
* before the execution is terminated. Helps prevent infinite loops.
|
|
123
|
-
*/
|
|
124
|
-
max_turns?: number;
|
|
125
|
-
}
|
|
126
|
-
export interface SubAgentOptions {
|
|
127
|
-
toolConfig?: ToolConfig;
|
|
128
|
-
outputConfig?: OutputConfig;
|
|
129
|
-
onMessage?: (message: string) => void;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Manages the runtime context state for the subagent.
|
|
133
|
-
* This class provides a mechanism to store and retrieve key-value pairs
|
|
134
|
-
* that represent the dynamic state and variables accessible to the subagent
|
|
135
|
-
* during its execution.
|
|
136
|
-
*/
|
|
137
|
-
export declare class ContextState {
|
|
138
|
-
private state;
|
|
139
|
-
/**
|
|
140
|
-
* Retrieves a value from the context state.
|
|
141
|
-
*
|
|
142
|
-
* @param key - The key of the value to retrieve.
|
|
143
|
-
* @returns The value associated with the key, or undefined if the key is not found.
|
|
144
|
-
*/
|
|
145
|
-
get(key: string): unknown;
|
|
146
|
-
/**
|
|
147
|
-
* Sets a value in the context state.
|
|
148
|
-
*
|
|
149
|
-
* @param key - The key to set the value under.
|
|
150
|
-
* @param value - The value to set.
|
|
151
|
-
*/
|
|
152
|
-
set(key: string, value: unknown): void;
|
|
153
|
-
/**
|
|
154
|
-
* Retrieves all keys in the context state.
|
|
155
|
-
*
|
|
156
|
-
* @returns An array of all keys in the context state.
|
|
157
|
-
*/
|
|
158
|
-
get_keys(): string[];
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Represents the scope and execution environment for a subagent.
|
|
162
|
-
* This class orchestrates the subagent's lifecycle, managing its chat interactions,
|
|
163
|
-
* runtime context, and the collection of its outputs.
|
|
164
|
-
*/
|
|
165
|
-
export declare class SubAgentScope {
|
|
166
|
-
readonly name: string;
|
|
167
|
-
readonly runtimeContext: Config;
|
|
168
|
-
private readonly promptConfig;
|
|
169
|
-
private readonly modelConfig;
|
|
170
|
-
private readonly runConfig;
|
|
171
|
-
output: OutputObject;
|
|
172
|
-
private readonly subagentId;
|
|
173
|
-
private readonly toolConfig?;
|
|
174
|
-
private readonly outputConfig?;
|
|
175
|
-
private readonly onMessage?;
|
|
176
|
-
private readonly toolRegistry;
|
|
177
|
-
/**
|
|
178
|
-
* Constructs a new SubAgentScope instance.
|
|
179
|
-
* @param name - The name for the subagent, used for logging and identification.
|
|
180
|
-
* @param runtimeContext - The shared runtime configuration and services.
|
|
181
|
-
* @param promptConfig - Configuration for the subagent's prompt and behavior.
|
|
182
|
-
* @param modelConfig - Configuration for the generative model parameters.
|
|
183
|
-
* @param runConfig - Configuration for the subagent's execution environment.
|
|
184
|
-
* @param options - Optional configurations for the subagent.
|
|
185
|
-
*/
|
|
186
|
-
private constructor();
|
|
187
|
-
/**
|
|
188
|
-
* Creates and validates a new SubAgentScope instance.
|
|
189
|
-
* This factory method ensures that all tools provided in the prompt configuration
|
|
190
|
-
* are valid for non-interactive use before creating the subagent instance.
|
|
191
|
-
* @param name - The name of the subagent.
|
|
192
|
-
* @param runtimeContext - The shared runtime configuration and services.
|
|
193
|
-
* @param promptConfig - Configuration for the subagent's prompt and behavior.
|
|
194
|
-
* @param modelConfig - Configuration for the generative model parameters.
|
|
195
|
-
* @param runConfig - Configuration for the subagent's execution environment.
|
|
196
|
-
* @param options - Optional configurations for the subagent.
|
|
197
|
-
* @returns A promise that resolves to a valid SubAgentScope instance.
|
|
198
|
-
* @throws {Error} If any tool requires user confirmation.
|
|
199
|
-
*/
|
|
200
|
-
static create(name: string, runtimeContext: Config, promptConfig: PromptConfig, modelConfig: ModelConfig, runConfig: RunConfig, options?: SubAgentOptions): Promise<SubAgentScope>;
|
|
201
|
-
/**
|
|
202
|
-
* Runs the subagent in a non-interactive mode.
|
|
203
|
-
* This method orchestrates the subagent's execution loop, including prompt templating,
|
|
204
|
-
* tool execution, and termination conditions.
|
|
205
|
-
* @param {ContextState} context - The current context state containing variables for prompt templating.
|
|
206
|
-
* @returns {Promise<void>} A promise that resolves when the subagent has completed its execution.
|
|
207
|
-
*/
|
|
208
|
-
runNonInteractive(context: ContextState): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Processes a list of function calls, executing each one and collecting their responses.
|
|
211
|
-
* This method iterates through the provided function calls, executes them using the
|
|
212
|
-
* `executeToolCall` function (or handles `self.emitvalue` internally), and aggregates
|
|
213
|
-
* their results. It also manages error reporting for failed tool executions.
|
|
214
|
-
* @param {FunctionCall[]} functionCalls - An array of `FunctionCall` objects to process.
|
|
215
|
-
* @param {ToolRegistry} toolRegistry - The tool registry to look up and execute tools.
|
|
216
|
-
* @param {AbortController} abortController - An `AbortController` to signal cancellation of tool executions.
|
|
217
|
-
* @returns {Promise<Content[]>} A promise that resolves to an array of `Content` parts representing the tool responses,
|
|
218
|
-
* which are then used to update the chat history.
|
|
219
|
-
*/
|
|
220
|
-
private processFunctionCalls;
|
|
221
|
-
private createChatObject;
|
|
222
|
-
/**
|
|
223
|
-
* Returns an array of FunctionDeclaration objects for tools that are local to the subagent's scope.
|
|
224
|
-
* Currently, this includes the `self.emitvalue` tool for emitting variables.
|
|
225
|
-
* @returns An array of `FunctionDeclaration` objects.
|
|
226
|
-
*/
|
|
227
|
-
private getScopeLocalFuncDefs;
|
|
228
|
-
/**
|
|
229
|
-
* Builds the system prompt for the chat based on the provided configurations.
|
|
230
|
-
* It templates the base system prompt and appends instructions for emitting
|
|
231
|
-
* variables if an `OutputConfig` is provided.
|
|
232
|
-
* @param {ContextState} context - The context for templating.
|
|
233
|
-
* @returns {string} The complete system prompt.
|
|
234
|
-
*/
|
|
235
|
-
private buildChatSystemPrompt;
|
|
236
|
-
}
|