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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ignite",
"version": "0.6.1",
"version": "0.7.1",
"private": true,
"description": "Secure JS/TS code execution in Docker with sandboxing for AI agents, untrusted code, and microservices",
"workspaces": [
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ignite/cli",
"version": "0.6.0",
"version": "0.7.1",
"type": "module",
"bin": {
"ignite": "./dist/index.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import { resolve } from 'node:path';
import { loadService, executeService, runPreflight, createReport, formatReportAsText, getImageName, buildServiceImage, parseAuditFromOutput, formatSecurityAudit, DEFAULT_POLICY, isValidRuntime, loadPolicyFile } from '@ignite/core';
import { logger, ConfigError } from '@ignite/shared';

Expand Down Expand Up @@ -60,7 +60,7 @@ export async function runCommand(servicePath: string, options: RunOptions): Prom
: undefined;

if (options.auditOutput && audit) {
const outputPath = join(process.cwd(), options.auditOutput);
const outputPath = resolve(process.cwd(), options.auditOutput);
await writeFile(outputPath, JSON.stringify(audit, null, 2));
logger.success(`Audit saved to ${outputPath}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const program = new Command();
program
.name('ignite')
.description('Secure sandbox for AI-generated code, untrusted scripts, and JS/TS execution')
.version('0.6.0');
.version('0.7.1');

program
.command('init <name>')
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ignite/core",
"version": "0.6.0",
"version": "0.7.1",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
27 changes: 27 additions & 0 deletions packages/core/src/service/load-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ function validateServiceConfig(config: unknown): ServiceValidation {
failRatio: 'positive',
});

const memoryConfig = pf['memory'] as Record<string, unknown> | undefined;
const warnRatio = memoryConfig?.['warnRatio'];
const failRatio = memoryConfig?.['failRatio'];
if (typeof warnRatio === 'number' && typeof failRatio === 'number') {
if (warnRatio >= failRatio) {
errors.push('preflight.memory.warnRatio must be less than preflight.memory.failRatio');
}
}

validatePreflightSection(pf['dependencies'], 'preflight.dependencies', errors, {
warnCount: 'positive',
infoCount: 'positive',
Expand All @@ -137,11 +146,29 @@ function validateServiceConfig(config: unknown): ServiceValidation {
failMb: 'positive',
});

const imageConfig = pf['image'] as Record<string, unknown> | undefined;
const warnMb = imageConfig?.['warnMb'];
const failMb = imageConfig?.['failMb'];
if (typeof warnMb === 'number' && typeof failMb === 'number') {
if (warnMb >= failMb) {
errors.push('preflight.image.warnMb must be less than preflight.image.failMb');
}
}

validatePreflightSection(pf['timeout'], 'preflight.timeout', errors, {
minMs: 'positive',
maxMs: 'positive',
coldStartBufferMs: 'positive',
});

const timeoutConfig = pf['timeout'] as Record<string, unknown> | undefined;
const minMs = timeoutConfig?.['minMs'];
const maxMs = timeoutConfig?.['maxMs'];
if (typeof minMs === 'number' && typeof maxMs === 'number') {
if (minMs >= maxMs) {
errors.push('preflight.timeout.minMs must be less than preflight.timeout.maxMs');
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ignite/http",
"version": "0.6.0",
"version": "0.7.1",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ignite/shared",
"version": "0.6.0",
"version": "0.7.1",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down