@enactprotocol/shared 1.2.0 → 1.2.1

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.
@@ -5,7 +5,7 @@ import { DaggerExecutionProvider } from "./DaggerExecutionProvider.js";
5
5
  import { resolveToolEnvironmentVariables } from "../utils/env-loader.js";
6
6
  import logger from "../exec/logger.js";
7
7
  import yaml from "yaml";
8
- import { CryptoUtils, KeyManager, SigningService } from "@enactprotocol/security";
8
+ import { CryptoUtils, KeyManager, SecurityConfigManager, SigningService } from "@enactprotocol/security";
9
9
  export class EnactCore {
10
10
  constructor(options = {}) {
11
11
  this.options = {
@@ -277,7 +277,6 @@ export class EnactCore {
277
277
  const documentForVerification = {
278
278
  command: tool.command
279
279
  };
280
- // IGNORE DATABASE SIGNATURES - USE HARDCODED WORKING VALUES FOR TESTING
281
280
  const referenceSignature = {
282
281
  signature: tool.signatures[0].value,
283
282
  publicKey: tool.signatures[0].signer,
@@ -321,8 +320,16 @@ export class EnactCore {
321
320
  validateToolStructure(tool);
322
321
  // Validate inputs
323
322
  const validatedInputs = validateInputs(tool, inputs);
323
+ const config = SecurityConfigManager.loadConfig();
324
+ if (options.isLocalFile && config.allowLocalUnsigned) {
325
+ logger.warn(`Executing local file without signature verification: ${tool.name} (you can disallow in your security config)`);
326
+ }
327
+ if (options.dangerouslySkipVerification) {
328
+ logger.warn(`Skipping signature verification for tool: ${tool.name} because of dangerouslySkipVerification option`);
329
+ }
330
+ const skipVerification = (options.isLocalFile && config.allowLocalUnsigned) || Boolean(options.dangerouslySkipVerification);
324
331
  // Verify tool signatures (unless explicitly skipped)
325
- await this.verifyTool(tool, options.dangerouslySkipVerification);
332
+ await this.verifyTool(tool, skipVerification);
326
333
  // Resolve environment variables
327
334
  const { resolved: envVars } = await resolveToolEnvironmentVariables(tool.name, tool.env || {});
328
335
  // Execute the tool via the execution provider
@@ -250,7 +250,7 @@ loadDotenv();
250
250
  */
251
251
  export function getWebServerUrl() {
252
252
  // For now, default to localhost:5555 as that's the standard port
253
- // When running via MCP (npx -p enact-cli enact-mcp), the web server is automatically started
253
+ // When running via MCP (npx -p @enactprotocol/cli enact-mcp), the web server is automatically started
254
254
  // TODO: In the future, we could check if the server is actually responding or get the port dynamically
255
255
  return "http://localhost:5555";
256
256
  }
@@ -65,7 +65,7 @@ ${pc.bold("More Help:")}
65
65
  */
66
66
  export function showVersion() {
67
67
  const version = getVersion();
68
- console.error(`enact-cli v${version}`);
68
+ console.error(`@enactprotocol/cli v${version}`);
69
69
  }
70
70
  /**
71
71
  * Show help for the auth command
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enactprotocol/shared",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Shared utilities and core functionality for Enact Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@ import logger from "../exec/logger.js";
17
17
  import yaml from "yaml";
18
18
  import fs from "fs";
19
19
  import path from "path";
20
- import { CryptoUtils, KeyManager, SigningService } from "@enactprotocol/security";
20
+ import { CryptoUtils, KeyManager, SecurityConfigManager, SigningService } from "@enactprotocol/security";
21
21
 
22
22
  export interface EnactCoreOptions {
23
23
  apiUrl?: string;
@@ -406,7 +406,6 @@ private async verifyTool(tool: EnactTool, dangerouslySkipVerification: boolean =
406
406
  command: tool.command
407
407
  };
408
408
 
409
- // IGNORE DATABASE SIGNATURES - USE HARDCODED WORKING VALUES FOR TESTING
410
409
  const referenceSignature = {
411
410
  signature: tool.signatures[0].value,
412
411
  publicKey: tool.signatures[0].signer,
@@ -474,9 +473,17 @@ private async verifyTool(tool: EnactTool, dangerouslySkipVerification: boolean =
474
473
 
475
474
  // Validate inputs
476
475
  const validatedInputs = validateInputs(tool, inputs);
477
-
476
+ const config = SecurityConfigManager.loadConfig();
477
+
478
+ if( options.isLocalFile && config.allowLocalUnsigned){
479
+ logger.warn(`Executing local file without signature verification: ${tool.name} (you can disallow in your security config)`);
480
+ }
481
+ if( options.dangerouslySkipVerification) {
482
+ logger.warn(`Skipping signature verification for tool: ${tool.name} because of dangerouslySkipVerification option`);
483
+ }
484
+ const skipVerification = (options.isLocalFile && config.allowLocalUnsigned) || Boolean(options.dangerouslySkipVerification);
478
485
  // Verify tool signatures (unless explicitly skipped)
479
- await this.verifyTool(tool, options.dangerouslySkipVerification);
486
+ await this.verifyTool(tool, skipVerification);
480
487
 
481
488
  // Resolve environment variables
482
489
  const { resolved: envVars } =
@@ -344,7 +344,7 @@ loadDotenv();
344
344
  */
345
345
  export function getWebServerUrl(): string | null {
346
346
  // For now, default to localhost:5555 as that's the standard port
347
- // When running via MCP (npx -p enact-cli enact-mcp), the web server is automatically started
347
+ // When running via MCP (npx -p @enactprotocol/cli enact-mcp), the web server is automatically started
348
348
  // TODO: In the future, we could check if the server is actually responding or get the port dynamically
349
349
  return "http://localhost:5555";
350
350
  }
package/src/utils/help.ts CHANGED
@@ -67,7 +67,7 @@ ${pc.bold("More Help:")}
67
67
  */
68
68
  export function showVersion(): void {
69
69
  const version = getVersion();
70
- console.error(`enact-cli v${version}`);
70
+ console.error(`@enactprotocol/cli v${version}`);
71
71
  }
72
72
 
73
73
  /**