@vybestack/llxprt-code-core 0.5.0-nightly.251125.6be1c4fa2 → 0.5.0-nightly.251125.8cac021f2

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.
Files changed (69) hide show
  1. package/dist/src/config/config.d.ts +3 -14
  2. package/dist/src/config/config.js +2 -36
  3. package/dist/src/config/config.js.map +1 -1
  4. package/dist/src/core/client.d.ts +0 -2
  5. package/dist/src/core/client.js +0 -5
  6. package/dist/src/core/client.js.map +1 -1
  7. package/dist/src/core/geminiChat.d.ts +1 -8
  8. package/dist/src/core/geminiChat.js +14 -14
  9. package/dist/src/core/geminiChat.js.map +1 -1
  10. package/dist/src/ide/ide-client.js +3 -3
  11. package/dist/src/index.d.ts +0 -2
  12. package/dist/src/index.js +0 -7
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/runtime/createAgentRuntimeContext.js +7 -8
  15. package/dist/src/runtime/createAgentRuntimeContext.js.map +1 -1
  16. package/dist/src/services/shellExecutionService.d.ts +3 -46
  17. package/dist/src/services/shellExecutionService.js +49 -189
  18. package/dist/src/services/shellExecutionService.js.map +1 -1
  19. package/dist/src/telemetry/constants.d.ts +0 -8
  20. package/dist/src/telemetry/constants.js +0 -8
  21. package/dist/src/telemetry/constants.js.map +1 -1
  22. package/dist/src/telemetry/loggers.d.ts +1 -9
  23. package/dist/src/telemetry/loggers.js +2 -154
  24. package/dist/src/telemetry/loggers.js.map +1 -1
  25. package/dist/src/telemetry/metrics.d.ts +0 -5
  26. package/dist/src/telemetry/metrics.js +0 -4
  27. package/dist/src/telemetry/metrics.js.map +1 -1
  28. package/dist/src/telemetry/types.d.ts +0 -61
  29. package/dist/src/telemetry/types.js +0 -92
  30. package/dist/src/telemetry/types.js.map +1 -1
  31. package/dist/src/test-utils/config.js +0 -14
  32. package/dist/src/test-utils/config.js.map +1 -1
  33. package/dist/src/tools/mcp-client.d.ts +2 -3
  34. package/dist/src/tools/mcp-client.js +30 -28
  35. package/dist/src/tools/mcp-client.js.map +1 -1
  36. package/dist/src/tools/shell.js +3 -8
  37. package/dist/src/tools/shell.js.map +1 -1
  38. package/dist/src/tools/tools.d.ts +1 -2
  39. package/dist/src/tools/tools.js.map +1 -1
  40. package/dist/src/utils/memoryDiscovery.d.ts +0 -1
  41. package/dist/src/utils/memoryDiscovery.js +1 -2
  42. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  43. package/dist/src/utils/retry.js +11 -11
  44. package/dist/src/utils/retry.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/src/agents/codebase-investigator.d.ts +0 -46
  47. package/dist/src/agents/codebase-investigator.js +0 -136
  48. package/dist/src/agents/codebase-investigator.js.map +0 -1
  49. package/dist/src/agents/executor.d.ts +0 -92
  50. package/dist/src/agents/executor.js +0 -624
  51. package/dist/src/agents/executor.js.map +0 -1
  52. package/dist/src/agents/invocation.d.ts +0 -45
  53. package/dist/src/agents/invocation.js +0 -106
  54. package/dist/src/agents/invocation.js.map +0 -1
  55. package/dist/src/agents/registry.d.ts +0 -36
  56. package/dist/src/agents/registry.js +0 -61
  57. package/dist/src/agents/registry.js.map +0 -1
  58. package/dist/src/agents/types.d.ts +0 -145
  59. package/dist/src/agents/types.js +0 -17
  60. package/dist/src/agents/types.js.map +0 -1
  61. package/dist/src/agents/utils.d.ts +0 -15
  62. package/dist/src/agents/utils.js +0 -27
  63. package/dist/src/agents/utils.js.map +0 -1
  64. package/dist/src/storage/sessionTypes.d.ts +0 -27
  65. package/dist/src/storage/sessionTypes.js +0 -10
  66. package/dist/src/storage/sessionTypes.js.map +0 -1
  67. package/dist/src/utils/terminalSerializer.d.ts +0 -28
  68. package/dist/src/utils/terminalSerializer.js +0 -418
  69. package/dist/src/utils/terminalSerializer.js.map +0 -1
@@ -1,45 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { Config } from '../config/config.js';
7
- import { BaseToolInvocation, type ToolResult } from '../tools/tools.js';
8
- import type { AgentDefinition, AgentInputs } from './types.js';
9
- import type { MessageBus } from '../confirmation-bus/message-bus.js';
10
- import { type z } from 'zod';
11
- /**
12
- * Represents a validated, executable instance of a subagent tool.
13
- *
14
- * This class orchestrates the execution of a defined agent by:
15
- * 1. Initializing the {@link AgentExecutor}.
16
- * 2. Running the agent's execution loop.
17
- * 3. Bridging the agent's streaming activity (e.g., thoughts) to the tool's
18
- * live output stream.
19
- * 4. Formatting the final result into a {@link ToolResult}.
20
- */
21
- export declare class SubagentInvocation<TOutput extends z.ZodTypeAny> extends BaseToolInvocation<AgentInputs, ToolResult> {
22
- private readonly definition;
23
- private readonly config;
24
- /**
25
- * @param params The validated input parameters for the agent.
26
- * @param definition The definition object that configures the agent.
27
- * @param config The global runtime configuration.
28
- * @param messageBus Optional message bus for policy enforcement.
29
- */
30
- constructor(params: AgentInputs, definition: AgentDefinition<TOutput>, config: Config, messageBus?: MessageBus);
31
- /**
32
- * Returns a concise, human-readable description of the invocation.
33
- * Used for logging and display purposes.
34
- */
35
- getDescription(): string;
36
- /**
37
- * Executes the subagent.
38
- *
39
- * @param signal An `AbortSignal` to cancel the agent's execution.
40
- * @param updateOutput A callback to stream intermediate output, such as the
41
- * agent's thoughts, to the user interface.
42
- * @returns A `Promise` that resolves with the final `ToolResult`.
43
- */
44
- execute(signal: AbortSignal, updateOutput?: (output: string) => void): Promise<ToolResult>;
45
- }
@@ -1,106 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import { AgentExecutor } from './executor.js';
7
- import { BaseToolInvocation } from '../tools/tools.js';
8
- import { ToolErrorType } from '../tools/tool-error.js';
9
- const INPUT_PREVIEW_MAX_LENGTH = 50;
10
- const DESCRIPTION_MAX_LENGTH = 200;
11
- /**
12
- * Represents a validated, executable instance of a subagent tool.
13
- *
14
- * This class orchestrates the execution of a defined agent by:
15
- * 1. Initializing the {@link AgentExecutor}.
16
- * 2. Running the agent's execution loop.
17
- * 3. Bridging the agent's streaming activity (e.g., thoughts) to the tool's
18
- * live output stream.
19
- * 4. Formatting the final result into a {@link ToolResult}.
20
- */
21
- export class SubagentInvocation extends BaseToolInvocation {
22
- definition;
23
- config;
24
- /**
25
- * @param params The validated input parameters for the agent.
26
- * @param definition The definition object that configures the agent.
27
- * @param config The global runtime configuration.
28
- * @param messageBus Optional message bus for policy enforcement.
29
- */
30
- constructor(params, definition, config, messageBus) {
31
- super(params, messageBus);
32
- this.definition = definition;
33
- this.config = config;
34
- }
35
- /**
36
- * Returns a concise, human-readable description of the invocation.
37
- * Used for logging and display purposes.
38
- */
39
- getDescription() {
40
- const inputSummary = Object.entries(this.params)
41
- .map(([key, value]) => {
42
- const stringValue = typeof value === 'object' && value !== null
43
- ? JSON.stringify(value)
44
- : String(value);
45
- return `${key}: ${stringValue.slice(0, INPUT_PREVIEW_MAX_LENGTH)}`;
46
- })
47
- .join(', ');
48
- const description = `Running subagent '${this.definition.name}' with inputs: { ${inputSummary} }`;
49
- return description.slice(0, DESCRIPTION_MAX_LENGTH);
50
- }
51
- /**
52
- * Executes the subagent.
53
- *
54
- * @param signal An `AbortSignal` to cancel the agent's execution.
55
- * @param updateOutput A callback to stream intermediate output, such as the
56
- * agent's thoughts, to the user interface.
57
- * @returns A `Promise` that resolves with the final `ToolResult`.
58
- */
59
- async execute(signal, updateOutput) {
60
- try {
61
- if (updateOutput) {
62
- updateOutput('Subagent starting...\n');
63
- }
64
- // Create an activity callback to bridge the executor's events to the
65
- // tool's streaming output.
66
- const onActivity = (activity) => {
67
- if (!updateOutput)
68
- return;
69
- if (activity.type === 'THOUGHT_CHUNK' &&
70
- typeof activity.data['text'] === 'string') {
71
- updateOutput(`🤖💭 ${activity.data['text']}`);
72
- }
73
- };
74
- const executor = await AgentExecutor.create(this.definition, this.config, onActivity);
75
- const output = await executor.run(this.params, signal);
76
- const resultContent = `Subagent '${this.definition.name}' finished.
77
- Termination Reason: ${output.terminate_reason}
78
- Result:
79
- ${output.result}`;
80
- const displayContent = `
81
- Subagent ${this.definition.name} Finished
82
-
83
- Termination Reason:\n ${output.terminate_reason}
84
-
85
- Result:
86
- ${output.result}
87
- `;
88
- return {
89
- llmContent: [{ text: resultContent }],
90
- returnDisplay: displayContent,
91
- };
92
- }
93
- catch (error) {
94
- const errorMessage = error instanceof Error ? error.message : String(error);
95
- return {
96
- llmContent: `Subagent '${this.definition.name}' failed. Error: ${errorMessage}`,
97
- returnDisplay: `Subagent Failed: ${this.definition.name}\nError: ${errorMessage}`,
98
- error: {
99
- message: errorMessage,
100
- type: ToolErrorType.EXECUTION_FAILED,
101
- },
102
- };
103
- }
104
- }
105
- }
106
- //# sourceMappingURL=invocation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invocation.js","sourceRoot":"","sources":["../../../src/agents/invocation.ts"],"names":[],"mappings":"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"}
@@ -1,36 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { Config } from '../config/config.js';
7
- import type { AgentDefinition } from './types.js';
8
- import type { z } from 'zod';
9
- /**
10
- * Manages the discovery, loading, validation, and registration of
11
- * AgentDefinitions.
12
- */
13
- export declare class AgentRegistry {
14
- private readonly config;
15
- private readonly agents;
16
- constructor(config: Config);
17
- /**
18
- * Discovers and loads agents.
19
- */
20
- initialize(): Promise<void>;
21
- private loadBuiltInAgents;
22
- /**
23
- * Registers an agent definition. If an agent with the same name exists,
24
- * it will be overwritten, respecting the precedence established by the
25
- * initialization order.
26
- */
27
- protected registerAgent<TOutput extends z.ZodTypeAny>(definition: AgentDefinition<TOutput>): void;
28
- /**
29
- * Retrieves an agent definition by name.
30
- */
31
- getDefinition(name: string): AgentDefinition | undefined;
32
- /**
33
- * Returns all active agent definitions.
34
- */
35
- getAllDefinitions(): AgentDefinition[];
36
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Manages the discovery, loading, validation, and registration of
8
- * AgentDefinitions.
9
- */
10
- export class AgentRegistry {
11
- config;
12
- // Using unknown output type for the internal map to handle generic variance correctly
13
- // Callers will cast to specific types as needed
14
- agents = new Map();
15
- constructor(config) {
16
- this.config = config;
17
- }
18
- /**
19
- * Discovers and loads agents.
20
- */
21
- async initialize() {
22
- this.loadBuiltInAgents();
23
- if (this.config.getDebugMode()) {
24
- console.log(`[AgentRegistry] Initialized with ${this.agents.size} agents.`);
25
- }
26
- }
27
- loadBuiltInAgents() {
28
- // No built-in agents registered - CodebaseInvestigatorAgent was removed
29
- // because it hardcodes DEFAULT_GEMINI_MODEL, violating multi-provider support
30
- }
31
- /**
32
- * Registers an agent definition. If an agent with the same name exists,
33
- * it will be overwritten, respecting the precedence established by the
34
- * initialization order.
35
- */
36
- registerAgent(definition) {
37
- // Basic validation
38
- if (!definition.name || !definition.description) {
39
- console.warn(`[AgentRegistry] Skipping invalid agent definition. Missing name or description.`);
40
- return;
41
- }
42
- if (this.agents.has(definition.name) && this.config.getDebugMode()) {
43
- console.log(`[AgentRegistry] Overriding agent '${definition.name}'`);
44
- }
45
- // Cast to default AgentDefinition type for storage - callers will cast back as needed
46
- this.agents.set(definition.name, definition);
47
- }
48
- /**
49
- * Retrieves an agent definition by name.
50
- */
51
- getDefinition(name) {
52
- return this.agents.get(name);
53
- }
54
- /**
55
- * Returns all active agent definitions.
56
- */
57
- getAllDefinitions() {
58
- return Array.from(this.agents.values());
59
- }
60
- }
61
- //# sourceMappingURL=registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/agents/registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,MAAM,OAAO,aAAa;IAKK;IAJ7B,sFAAsF;IACtF,gDAAgD;IAC/B,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAC;IAE7D,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEzB,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CACT,oCAAoC,IAAI,CAAC,MAAM,CAAC,IAAI,UAAU,CAC/D,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,iBAAiB;QACvB,wEAAwE;QACxE,8EAA8E;IAChF,CAAC;IAED;;;;OAIG;IACO,aAAa,CACrB,UAAoC;QAEpC,mBAAmB;QACnB,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;YAChD,OAAO,CAAC,IAAI,CACV,iFAAiF,CAClF,CAAC;YACF,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,qCAAqC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;QACvE,CAAC;QAED,sFAAsF;QACtF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAwC,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -1,145 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * @fileoverview Defines the core configuration interfaces and types for the agent architecture.
8
- */
9
- import type { Content, FunctionDeclaration } from '@google/genai';
10
- import type { AnyDeclarativeTool } from '../tools/tools.js';
11
- import { type z } from 'zod';
12
- /**
13
- * Describes the possible termination modes for an agent.
14
- */
15
- export declare enum AgentTerminateMode {
16
- ERROR = "ERROR",
17
- TIMEOUT = "TIMEOUT",
18
- GOAL = "GOAL",
19
- MAX_TURNS = "MAX_TURNS",
20
- ABORTED = "ABORTED"
21
- }
22
- /**
23
- * Represents the output structure of an agent's execution.
24
- */
25
- export interface OutputObject {
26
- result: string;
27
- terminate_reason: AgentTerminateMode;
28
- }
29
- /**
30
- * Represents the validated input parameters passed to an agent upon invocation.
31
- * Used primarily for templating the system prompt. (Replaces ContextState)
32
- */
33
- export type AgentInputs = Record<string, unknown>;
34
- /**
35
- * Structured events emitted during subagent execution for user observability.
36
- */
37
- export interface SubagentActivityEvent {
38
- isSubagentActivityEvent: true;
39
- agentName: string;
40
- type: 'TOOL_CALL_START' | 'TOOL_CALL_END' | 'THOUGHT_CHUNK' | 'ERROR';
41
- data: Record<string, unknown>;
42
- }
43
- /**
44
- * The definition for an agent.
45
- * @template TOutput The specific Zod schema for the agent's final output object.
46
- */
47
- export interface AgentDefinition<TOutput extends z.ZodTypeAny = z.ZodUnknown> {
48
- /** Unique identifier for the agent. */
49
- name: string;
50
- displayName?: string;
51
- description: string;
52
- promptConfig: PromptConfig;
53
- modelConfig: ModelConfig;
54
- runConfig: RunConfig;
55
- toolConfig?: ToolConfig;
56
- outputConfig?: OutputConfig<TOutput>;
57
- inputConfig: InputConfig;
58
- /**
59
- * An optional function to process the raw output from the agent's final tool
60
- * call into a string format.
61
- *
62
- * @param output The raw output value from the `complete_task` tool, now strongly typed with TOutput.
63
- * @returns A string representation of the final output.
64
- */
65
- processOutput?: (output: z.infer<TOutput>) => string;
66
- }
67
- /**
68
- * Configures the initial prompt for the agent.
69
- */
70
- export interface PromptConfig {
71
- /**
72
- * A single system prompt string. Supports templating using `${input_name}` syntax.
73
- */
74
- systemPrompt?: string;
75
- /**
76
- * An array of user/model content pairs for few-shot prompting.
77
- */
78
- initialMessages?: Content[];
79
- /**
80
- * The specific task or question to trigger the agent's execution loop.
81
- * This is sent as the first user message, distinct from the systemPrompt (identity/rules)
82
- * and initialMessages (history/few-shots). Supports templating.
83
- * If not provided, a generic "Get Started!" message is used.
84
- */
85
- query?: string;
86
- }
87
- /**
88
- * Configures the tools available to the agent during its execution.
89
- */
90
- export interface ToolConfig {
91
- tools: Array<string | FunctionDeclaration | AnyDeclarativeTool>;
92
- }
93
- /**
94
- * Configures the expected inputs (parameters) for the agent.
95
- */
96
- export interface InputConfig {
97
- /**
98
- * Defines the parameters the agent accepts.
99
- * This is vital for generating the tool wrapper schema.
100
- */
101
- inputs: Record<string, {
102
- description: string;
103
- type: 'string' | 'number' | 'boolean' | 'integer' | 'string[]' | 'number[]';
104
- required: boolean;
105
- }>;
106
- }
107
- /**
108
- * Configures the expected outputs for the agent.
109
- */
110
- export interface OutputConfig<T extends z.ZodTypeAny> {
111
- /**
112
- * The name of the final result parameter. This will be the name of the
113
- * argument in the `submit_final_output` tool (e.g., "report", "answer").
114
- */
115
- outputName: string;
116
- /**
117
- * A description of the expected output. This will be used as the description
118
- * for the tool argument.
119
- */
120
- description: string;
121
- /**
122
- * Optional JSON schema for the output. If provided, it will be used as the
123
- * schema for the tool's argument, allowing for structured output enforcement.
124
- * Defaults to { type: 'string' }.
125
- */
126
- schema: T;
127
- }
128
- /**
129
- * Configures the generative model parameters for the agent.
130
- */
131
- export interface ModelConfig {
132
- model: string;
133
- temp: number;
134
- top_p: number;
135
- thinkingBudget?: number;
136
- }
137
- /**
138
- * Configures the execution environment and constraints for the agent.
139
- */
140
- export interface RunConfig {
141
- /** The maximum execution time for the agent in minutes. */
142
- max_time_minutes: number;
143
- /** The maximum number of conversational turns. */
144
- max_turns?: number;
145
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Describes the possible termination modes for an agent.
8
- */
9
- export var AgentTerminateMode;
10
- (function (AgentTerminateMode) {
11
- AgentTerminateMode["ERROR"] = "ERROR";
12
- AgentTerminateMode["TIMEOUT"] = "TIMEOUT";
13
- AgentTerminateMode["GOAL"] = "GOAL";
14
- AgentTerminateMode["MAX_TURNS"] = "MAX_TURNS";
15
- AgentTerminateMode["ABORTED"] = "ABORTED";
16
- })(AgentTerminateMode || (AgentTerminateMode = {}));
17
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;GAEG;AACH,MAAM,CAAN,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,6CAAuB,CAAA;IACvB,yCAAmB,CAAA;AACrB,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B"}
@@ -1,15 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { AgentInputs } from './types.js';
7
- /**
8
- * Simple template string replacement for agent prompts.
9
- * Replaces ${key} placeholders with values from the inputs object.
10
- *
11
- * @param template The template string with ${key} placeholders
12
- * @param inputs The input values to substitute
13
- * @returns The template with placeholders replaced
14
- */
15
- export declare function templateString(template: string, inputs: AgentInputs): string;
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Simple template string replacement for agent prompts.
8
- * Replaces ${key} placeholders with values from the inputs object.
9
- *
10
- * @param template The template string with ${key} placeholders
11
- * @param inputs The input values to substitute
12
- * @returns The template with placeholders replaced
13
- */
14
- export function templateString(template, inputs) {
15
- const placeholderRegex = /\$\{(\w+)\}/g;
16
- // First, find all unique keys required by the template.
17
- const requiredKeys = new Set(Array.from(template.matchAll(placeholderRegex), (match) => match[1]));
18
- // Check if all required keys exist in the inputs.
19
- const inputKeys = new Set(Object.keys(inputs));
20
- const missingKeys = Array.from(requiredKeys).filter((key) => !inputKeys.has(key));
21
- if (missingKeys.length > 0) {
22
- throw new Error(`Missing input values for the following keys: ${missingKeys.join(', ')}`);
23
- }
24
- // Perform the replacement using a replacer function.
25
- return template.replace(placeholderRegex, (_match, key) => String(inputs[key]));
26
- }
27
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/agents/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,MAAmB;IAClE,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAExC,wDAAwD;IACxD,MAAM,YAAY,GAAG,IAAI,GAAG,CAC1B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrE,CAAC;IAEF,kDAAkD;IAClD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CACjD,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAC7B,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,gDAAgD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzE,CAAC;IACJ,CAAC;IAED,qDAAqD;IACrD,OAAO,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CACxD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CACpB,CAAC;AACJ,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Vybestack LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Session file naming prefix
8
- */
9
- export declare const SESSION_FILE_PREFIX = "session-";
10
- /**
11
- * Base message record structure (minimal for session cleanup purposes)
12
- */
13
- export interface BaseMessageRecord {
14
- timestamp: string;
15
- role: 'user' | 'model';
16
- }
17
- /**
18
- * Conversation record structure (minimal for session cleanup purposes)
19
- */
20
- export interface ConversationRecord {
21
- id: string;
22
- sessionId: string;
23
- timestamp: string;
24
- startTime: string;
25
- lastUpdated?: string;
26
- messages: BaseMessageRecord[];
27
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Vybestack LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- /**
7
- * Session file naming prefix
8
- */
9
- export const SESSION_FILE_PREFIX = 'session-';
10
- //# sourceMappingURL=sessionTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sessionTypes.js","sourceRoot":"","sources":["../../../src/storage/sessionTypes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import type { Terminal } from '@xterm/headless';
7
- export interface AnsiToken {
8
- text: string;
9
- bold: boolean;
10
- italic: boolean;
11
- underline: boolean;
12
- dim: boolean;
13
- inverse: boolean;
14
- fg: string;
15
- bg: string;
16
- }
17
- export type AnsiLine = AnsiToken[];
18
- export type AnsiOutput = AnsiLine[];
19
- export declare const enum ColorMode {
20
- DEFAULT = 0,
21
- PALETTE = 1,
22
- RGB = 2
23
- }
24
- export declare function serializeTerminalToObject(terminal: Terminal, options?: {
25
- defaultFg?: string;
26
- defaultBg?: string;
27
- }): AnsiOutput;
28
- export declare function convertColorToHex(color: number, colorMode: ColorMode, defaultColor: string): string;