lints step 1

This commit is contained in:
Your Name
2026-04-09 03:35:12 +00:00
parent 28bd094965
commit 8fd439678b
17 changed files with 60 additions and 24 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import type { ContextEventBus } from './eventBus.js';
import type { ContextTracer } from './tracer.js';
import type { ContextEnvironment } from './sidecar/environment.js';
import type { SidecarConfig } from './sidecar/types.js';
import { PipelineOrchestrator } from './sidecar/orchestrator.js';
import type { PipelineOrchestrator } from './sidecar/orchestrator.js';
import { HistoryObserver } from './historyObserver.js';
import { IrProjector } from './ir/projector.js';
+2 -2
View File
@@ -8,7 +8,7 @@ import type {
AgentChatHistory,
HistoryEvent,
} from '../core/agentChatHistory.js';
import { IrMapper } from './ir/mapper.js';
import type { IrMapper } from './ir/mapper.js';
import type { ContextTokenCalculator } from './utils/contextTokenCalculator.js';
import type { ContextEventBus } from './eventBus.js';
import type { ContextTracer } from './tracer.js';
@@ -48,7 +48,7 @@ export class HistoryObserver {
this.tokenCalculator,
);
const nodes: Array<ConcreteNode> = [];
const nodes: ConcreteNode[] = [];
for (const ep of pristineEpisodes) {
if (ep.concreteNodes) {
for (const child of ep.concreteNodes) {
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Content, Part } from '@google/genai';
import type { ConcreteNode } from './types.js';
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Part } from '@google/genai';
import type { IrNodeBehavior, IrNodeBehaviorRegistry } from './behaviorRegistry.js';
import type {
+5
View File
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Content, Part } from '@google/genai';
import type { ConcreteNode } from './types.js';
import type { IrSerializationWriter, IrNodeBehaviorRegistry } from './behaviorRegistry.js';
+5
View File
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type { Content } from '@google/genai';
import type { Episode, ConcreteNode } from './types.js';
import { toIr } from './toIr.js';
@@ -37,7 +37,7 @@ describe('BlobDegradationProcessor', () => {
const targets = [prompt];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -82,7 +82,7 @@ describe('BlobDegradationProcessor', () => {
const targets = [prompt];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -102,7 +102,7 @@ describe('BlobDegradationProcessor', () => {
const targets: any[] = [];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -46,7 +46,7 @@ describe('NodeDistillationProcessor', () => {
const targets = [prompt, thought, tool];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -99,7 +99,7 @@ describe('NodeDistillationProcessor', () => {
const targets = [prompt, thought];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -48,7 +48,7 @@ describe('NodeTruncationProcessor', () => {
const targets = [prompt, thought, yieldNode];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -80,9 +80,7 @@ describe('NodeTruncationProcessor', () => {
const mockTokenCalculator = new ContextTokenCalculator(1, env.behaviorRegistry) as any;
mockTokenCalculator.tokensToChars = vi.fn().mockReturnValue(100);
mockTokenCalculator.estimateTokensForString = vi.fn((text: string) => {
return text.length;
});
mockTokenCalculator.estimateTokensForString = vi.fn((text: string) => text.length);
mockTokenCalculator.estimateTokensForParts = vi.fn(() => 5);
mockTokenCalculator.getTokenCost = vi.fn(() => 5);
@@ -106,7 +104,7 @@ describe('NodeTruncationProcessor', () => {
const targets = [prompt, thought];
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets,
inbox: {} as any,
});
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { RollingSummaryProcessor } from './rollingSummaryProcessor.js';
import { createMockEnvironment, createDummyNode } from '../testing/contextTestUtils.js';
@@ -18,7 +18,7 @@ describe('StateSnapshotProcessor', () => {
const targets = [createDummyNode('ep1', 'USER_PROMPT')];
const inbox = new InboxSnapshotImpl([]);
const result = await processor.process({ buffer: {} as any as any, targets, inbox });
const result = await processor.process({ buffer: {} as any, targets, inbox });
expect(result).toBe(targets); // Strict equality
});
@@ -46,7 +46,7 @@ describe('StateSnapshotProcessor', () => {
}
]);
const result = await processor.process({ buffer: {} as any as any, targets, inbox });
const result = await processor.process({ buffer: {} as any, targets, inbox });
// Should remove A and B, insert Snapshot, keep C
expect(result.length).toBe(2);
@@ -78,7 +78,7 @@ describe('StateSnapshotProcessor', () => {
}
]);
const result = await processor.process({ buffer: {} as any as any, targets, inbox });
const result = await processor.process({ buffer: {} as any, targets, inbox });
// Because deficit is 0, and Inbox was rejected, nothing should change
expect(result.length).toBe(1);
@@ -96,7 +96,7 @@ describe('StateSnapshotProcessor', () => {
const targets = [nodeA, nodeB, nodeC];
const inbox = new InboxSnapshotImpl([]);
const result = await processor.process({ buffer: {} as any as any, targets, inbox });
const result = await processor.process({ buffer: {} as any, targets, inbox });
// Should synthesize a new snapshot synchronously
expect(env.llmClient.generateContent).toHaveBeenCalled();
@@ -31,7 +31,7 @@ describe('ToolMaskingProcessor', () => {
});
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets: [toolStep],
inbox: {} as any,
});
@@ -66,7 +66,7 @@ describe('ToolMaskingProcessor', () => {
});
const result = await processor.process({
buffer: {} as any as any,
buffer: {} as any,
targets: [toolStep],
inbox: {} as any,
});
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { ContextEnvironmentImpl } from './environmentImpl.js';
import { ContextTracer } from '../tracer.js';
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { LiveInbox, InboxSnapshotImpl } from './inbox.js';
import { DeterministicIdGenerator } from '../system/DeterministicIdGenerator.js';
@@ -8,7 +8,7 @@ import type { ConcreteNode } from '../ir/types.js';
import type {
ContextProcessor,
ContextWorker,
} from '../pipeline.js';
ContextWorkingBuffer } from '../pipeline.js';
import type { SidecarConfig, PipelineDef, PipelineTrigger } from './types.js';
import type {
ContextEnvironment,
@@ -18,13 +18,12 @@ import type {
import type { SidecarRegistry } from './registry.js';
import { debugLogger } from '../../utils/debugLogger.js';
import { InboxSnapshotImpl } from './inbox.js';
import type { ContextWorkingBuffer } from '../pipeline.js';
class ContextWorkingBufferImpl implements ContextWorkingBuffer {
private readonly nodesMap: Map<string, ConcreteNode>;
constructor(
public readonly nodes: readonly ConcreteNode[],
readonly nodes: readonly ConcreteNode[],
) {
this.nodesMap = new Map(nodes.map(n => [n.id, n]));
}
@@ -1,3 +1,8 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { SidecarRegistry } from './registry.js';
import type { ContextProcessorDef, ContextWorkerDef } from './registry.js';
@@ -21,9 +21,8 @@ import type { ConcreteNode, ToolExecution } from '../ir/types.js';
import type { ContextEnvironment } from '../sidecar/environment.js';
import type { Config } from '../../config/config.js';
import type { BaseLlmClient } from '../../core/baseLlmClient.js';
import type { Content } from '@google/genai';
import type { Content , GenerateContentResponse } from '@google/genai';
import type { GenerateContentResponse } from '@google/genai';
/**
* Creates a valid mock GenerateContentResponse with the provided text.