Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/processor-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: npm ci

- name: Run mock coverage validator
run: npx ts-node tests/validators/processor-mock-validator.ts
run: node tests/validators/processor-mock-validator.cjs

processor-tests:
name: Processor Tests
Expand Down
9 changes: 0 additions & 9 deletions .opencode/state

This file was deleted.

2 changes: 1 addition & 1 deletion context-ses_3170a9e73ffe2B39JnQl1AKuxh.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sessionId":"ses_3170a9e73ffe2B39JnQl1AKuxh","userMessage":"do not publish we have a new pr inbound","timestamp":"2026-03-28T00:50:45.706Z"}
{"sessionId":"ses_3170a9e73ffe2B39JnQl1AKuxh","userMessage":"Failing (pre-existing CI infra issues):\n- Lint Processor Tests - eslint-plugin-vitest missing in CI\n- Validate Processor Mock Coverage - ts-node .ts issue fix","timestamp":"2026-03-28T02:17:52.074Z"}
154 changes: 154 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"@typescript-eslint/parser": "^6.15.0",
"@vitest/coverage-v8": "^4.0.18",
"eslint": "^8.57.1",
"eslint-plugin-vitest": "^0.5.4",
"express": "^5.2.1",
"vitest": "^4.0.18",
"ws": "^8.20.0"
Expand Down
57 changes: 46 additions & 11 deletions scripts/node/postinstall.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,13 @@ if (fs.existsSync(scriptsSource)) {
}

// Detect if we're in a consumer environment (installed via npm)
// Check both the target directory and current working directory
// Check for strray-ai package manifest instead of string-matching directory paths
const cwd = process.cwd();
const isConsumerEnvironment = !targetDir.includes("dev/stringray") && !targetDir.includes("stringray");
const isConsumerEnvironment = fs.existsSync(
path.join(targetDir, 'node_modules', 'strray-ai', 'package.json')
) || fs.existsSync(
path.join(cwd, 'node_modules', 'strray-ai', 'package.json')
);

// Convert paths for consumer environment
if (isConsumerEnvironment) {
Expand All @@ -312,16 +316,47 @@ if (isConsumerEnvironment) {

// Convert MCP server paths only (not plugin paths - those are for npm packages)
// Note: MCP servers are in dist/mcps/ NOT dist/plugin/mcps/
const mainOpencodePath = path.join(targetDir, "opencode.json");
const mainOpencodePath = path.join(targetDir, "opencode.json");
if (fs.existsSync(mainOpencodePath)) {
let opencodeContent = fs.readFileSync(mainOpencodePath, "utf8");
// Convert MCP server paths (mcpServers use command array)
opencodeContent = opencodeContent.replace(
/"\.\.?\/dist\/mcps\//g,
'"node_modules/strray-ai/dist/mcps/'
);
fs.writeFileSync(mainOpencodePath, opencodeContent, "utf8");
console.log("✅ Updated MCP paths in opencode.json");
try {
const opencode = JSON.parse(fs.readFileSync(mainOpencodePath, "utf8"));
let modified = false;
// Convert MCP server paths in command arrays
if (opencode.mcpServers) {
for (const server of Object.values(opencode.mcpServers)) {
if (server.command && typeof server.command === 'string') {
const updated = server.command.replace(
/node_modules\/strray-ai\/dist\/mcps\//,
'node_modules/strray-ai/dist/mcps/'
);
// Normalize any relative dist paths to use node_modules
const normalized = updated.replace(
/^[.]{0,2}\/dist\/mcps\//,
'node_modules/strray-ai/dist/mcps/'
);
if (normalized !== server.command) {
server.command = normalized;
modified = true;
}
}
// Handle command arrays (some MCP configs use arrays)
if (Array.isArray(server.command)) {
server.command = server.command.map(arg =>
arg.replace(/^[.]{0,2}\/dist\/mcps\//, 'node_modules/strray-ai/dist/mcps/')
);
modified = true;
}
}
}
if (modified) {
fs.writeFileSync(mainOpencodePath, JSON.stringify(opencode, null, 2) + "\n", "utf8");
console.log("✅ Updated MCP paths in opencode.json");
} else {
console.log("ℹ️ No MCP path updates needed in opencode.json");
}
} catch (error) {
console.warn(`⚠️ Could not update opencode.json: ${error.message}`);
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/__tests__/agents/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ describe("Agent Types", () => {
description: "A test agent",
mode: "primary",
system: "You are a helpful assistant",
capabilities: ["read", "write"],
maxComplexity: 10,
enabled: true,
};

it("should accept minimal required configuration", () => {
Expand Down Expand Up @@ -112,6 +115,9 @@ describe("Agent Types", () => {
prompt_append: "Additional instructions",
disable: false,
color: "#ff0000",
capabilities: ["read", "write"],
maxComplexity: 10,
enabled: true,
};

expect(fullConfig.temperature).toBe(0.7);
Expand Down Expand Up @@ -154,6 +160,9 @@ describe("Agent Types", () => {
temperature: 0.5,
tools: { include: ["test"] },
permission: { edit: "allow" },
capabilities: ["read", "write"],
maxComplexity: 10,
enabled: true,
};

const serialized = JSON.stringify(config);
Expand Down Expand Up @@ -194,6 +203,9 @@ describe("Agent Types", () => {
prompt_append: "Additional context",
disable: false,
color: "#00ff00",
capabilities: ["read", "write", "execute"],
maxComplexity: 20,
enabled: true,
};

// TypeScript should enforce all these types at compile time
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/direct-processor-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ async function testPostProcessors(pm: ProcessorManager): Promise<void> {

const result = await pm.executePostProcessors(
"write",
{ filePath: "/test/file.ts" },
{ filePath: "/test/file.ts", operation: "write" },
preResults
);

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/integration/codex-enforcement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface CodexInjectorHook {
input: { tool: string; args?: Record<string, unknown> },
output: { output?: string; [key: string]: unknown },
sessionId: string,
) => { output?: string; [key: string]: unknown };
) => Promise<{ output?: string; [key: string]: unknown }>;
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/integration/e2e-orchestration-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe("E2E Orchestration Flow", () => {
expect(stateManager.get("processor:active")).toBe(true);

// Get processor manager from state
const pm = stateManager.get("processor:manager");
const pm = stateManager.get("processor:manager") as any;
expect(pm).toBeDefined();
expect(pm).toBe(processorManager);

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/integration/orchestration-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe("StringRay Framework - End-to-End Orchestration Integration", () => {
};

await expect(
mockEnvironment.executeToolWithOrchestration("failing-tool", {}),
mockEnvironment.executeToolWithOrchestration(),
).rejects.toThrow("Orchestration failed");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("Orchestrator Dependency Handling", () => {
expect(results.every((r) => r.success)).toBe(true);

// Verify execution order (task-1 before task-2 before task-3)
const taskOrder = results.map((r) => r.result.id);
const taskOrder = results.map((r) => r.result?.id);
expect(taskOrder.indexOf("task-1")).toBeLessThan(
taskOrder.indexOf("task-2"),
);
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/integration/processor-manager-reuse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe("ProcessorManager Reuse (Critical Regression)", () => {
// 2. Second tool execution - retrieves from state

// First execution - creates and registers
let pm = stateManager.get("processor:manager");
let pm: any = stateManager.get("processor:manager");
if (!pm) {
pm = new ProcessorManager(stateManager);
pm.registerProcessor({
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/job-correlation-test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Integration test for job correlation fix
// Tests that jobIds are properly included in activity logs

import { jobCorrelationManager } from "../job-correlation-manager.js";
import { generateJobId } from "../framework-logger.js";
import { jobCorrelationManager } from "../jobs/job-correlation-manager.js";
import { generateJobId } from "../core/framework-logger.js";

async function testJobCorrelation() {
console.log("🧪 Testing Job Correlation Fix...");
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/multi-agent-job-simulation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Multi-Agent Job Simulation - Complex Test Class Implementation
// This simulates a real-world multi-agent operation with job correlation

import { jobCorrelationManager } from "../job-correlation-manager.js";
import { jobCorrelationManager } from "../jobs/job-correlation-manager.js";

// Simulate complex enterprise test class
// Remove the import to fix compilation issues
Expand Down
Loading
Loading