Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
node_modules/
node_modules_mac/
node_modules_cont/
package-lock.json

# Build outputs
dist/
Expand Down
2 changes: 1 addition & 1 deletion backend/src/bolt/BoltService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// Cache storage
private inventoryCache: CacheEntry<Node[]> | null = null;
private factsCache: Map<string, CacheEntry<Facts>> = new Map();
private factsCache = new Map<string, CacheEntry<Facts>>();

constructor(
boltProjectPath: string,
Expand Down Expand Up @@ -344,7 +344,7 @@
public async getInventory(): Promise<Node[]> {
// Check cache first
if (this.isCacheValid(this.inventoryCache, this.inventoryTtl)) {
return this.inventoryCache!.data;

Check failure on line 347 in backend/src/bolt/BoltService.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

Forbidden non-null assertion
}

try {
Expand Down Expand Up @@ -511,7 +511,7 @@
// Check cache first
const cachedFacts = this.factsCache.get(nodeId);
if (this.isCacheValid(cachedFacts ?? null, this.factsTtl)) {
return cachedFacts!.data;

Check failure on line 514 in backend/src/bolt/BoltService.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

Forbidden non-null assertion
}

const args = [
Expand Down
6 changes: 3 additions & 3 deletions backend/src/routes/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
boltService: BoltService,
executionRepository: ExecutionRepository,
commandWhitelistService: CommandWhitelistService,
streamingManager?: import("../services/StreamingExecutionManager").StreamingExecutionManager,

Check failure on line 29 in backend/src/routes/commands.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

`import()` type annotations are forbidden
): Router {
const router = Router();

Expand Down Expand Up @@ -93,9 +93,9 @@
try {
// Set up streaming callback if expert mode is enabled and streaming manager is available
const streamingCallback = expertMode && streamingManager ? {
onCommand: (cmd: string) => streamingManager.emitCommand(executionId, cmd),
onStdout: (chunk: string) => streamingManager.emitStdout(executionId, chunk),
onStderr: (chunk: string) => streamingManager.emitStderr(executionId, chunk),
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },

Check failure on line 96 in backend/src/routes/commands.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

Missing return type on function
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },

Check failure on line 97 in backend/src/routes/commands.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

Missing return type on function
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },

Check failure on line 98 in backend/src/routes/commands.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

Missing return type on function
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
} : undefined;

const result = await boltService.runCommand(nodeId, command, streamingCallback);
Expand Down
10 changes: 5 additions & 5 deletions backend/src/routes/packages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Router, type Request, type Response } from "express";
import { z } from "zod";
import { BoltService } from "../bolt/BoltService";
import { ExecutionRepository } from "../database/ExecutionRepository";
import type { BoltService } from "../bolt/BoltService";
import type { ExecutionRepository } from "../database/ExecutionRepository";
import { asyncHandler } from "./asyncHandler";

/**
Expand Down Expand Up @@ -42,7 +42,7 @@
boltService: BoltService,
executionRepository: ExecutionRepository,
packageTasks: PackageTaskConfig[],
streamingManager?: import("../services/StreamingExecutionManager").StreamingExecutionManager,

Check failure on line 45 in backend/src/routes/packages.ts

View workflow job for this annotation

GitHub Actions / lint-and-test (20.x)

`import()` type annotations are forbidden
): Router {
const router = Router();

Expand Down Expand Up @@ -111,9 +111,9 @@
try {
// Set up streaming callback if expert mode is enabled and streaming manager is available
const streamingCallback = expertMode && streamingManager ? {
onCommand: (cmd: string) => streamingManager.emitCommand(executionId, cmd),
onStdout: (chunk: string) => streamingManager.emitStdout(executionId, chunk),
onStderr: (chunk: string) => streamingManager.emitStderr(executionId, chunk),
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
} : undefined;

// Execute package installation task with parameter mapping
Expand Down
6 changes: 3 additions & 3 deletions backend/src/routes/puppet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export function createPuppetRouter(
try {
// Set up streaming callback if expert mode is enabled and streaming manager is available
const streamingCallback = expertMode && streamingManager ? {
onCommand: (cmd: string) => streamingManager.emitCommand(executionId, cmd),
onStdout: (chunk: string) => streamingManager.emitStdout(executionId, chunk),
onStderr: (chunk: string) => streamingManager.emitStderr(executionId, chunk),
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent arrow function syntax for streaming callbacks. In tasks.ts, the callbacks use explicit return type annotations and are formatted across multiple lines (e.g., onCommand: (cmd: string): void => { ... }), while in this file they're inline with braces but no return type. Consider standardizing the pattern across all route files for consistency.

Suggested change
onCommand: (cmd: string) => { streamingManager.emitCommand(executionId, cmd); },
onStdout: (chunk: string) => { streamingManager.emitStdout(executionId, chunk); },
onStderr: (chunk: string) => { streamingManager.emitStderr(executionId, chunk); },
onCommand: (cmd: string): void => {
streamingManager.emitCommand(executionId, cmd);
},
onStdout: (chunk: string): void => {
streamingManager.emitStdout(executionId, chunk);
},
onStderr: (chunk: string): void => {
streamingManager.emitStderr(executionId, chunk);
},

Copilot uses AI. Check for mistakes.
} : undefined;

const result = await boltService.runPuppetAgent(nodeId, config, streamingCallback);
Expand Down
6 changes: 3 additions & 3 deletions backend/src/services/ExecutionQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export class ExecutionQueueFullError extends Error {
export class ExecutionQueue {
private readonly limit: number;
private readonly maxQueueSize: number;
private runningExecutions: Set<string> = new Set();
private queuedExecutions: Map<string, QueuedExecution> = new Map();
private waitingPromises: Map<string, { resolve: () => void; reject: (error: Error) => void }> = new Map();
private runningExecutions = new Set<string>();
private queuedExecutions = new Map<string, QueuedExecution>();
private waitingPromises = new Map<string, { resolve: () => void; reject: (error: Error) => void }>();

constructor(limit = 5, maxQueueSize = 50) {
this.limit = limit;
Expand Down
5 changes: 3 additions & 2 deletions backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"module": "commonjs",
"lib": ["ES2022"],
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
Expand All @@ -25,6 +26,6 @@
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules", "dist"]
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "test"]
}
Loading
Loading