Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

611 B
Raw Blame
import process from 'node:process';
import { Context, Layer } from 'effect';

export interface NodeProcessShape {
  readonly cwd: string;
  readonly execPath: string;
  readonly platform: NodeJS.Platform;
  readonly arch: string;
}

// Service that wraps `node:process`, for testing purposes.
export class NodeProcess extends Context.Tag('services/NodeProcess')<
  NodeProcess,
  NodeProcessShape
>() {
  static readonly Default: Layer.Layer<NodeProcess> = Layer.sync(NodeProcess, () => ({
    cwd: process.cwd(),
    execPath: process.execPath,
    platform: process.platform,
    arch: process.arch,
  }));
}