From 5d6671a1c3c5cb116297ac097fa95f3d6fe58806 Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Tue, 14 Apr 2026 09:38:51 -0500 Subject: [PATCH 1/2] Add conductor setup script for workspace initialization Replace inline npm install with a dedicated setup script that handles .env copying from the root repo, environment variable validation, and dependency installation. --- conductor.json | 28 +-------------- scripts/conductor-setup.sh | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 27 deletions(-) create mode 100755 scripts/conductor-setup.sh diff --git a/conductor.json b/conductor.json index 1c75bd2..8bb3930 100644 --- a/conductor.json +++ b/conductor.json @@ -1,31 +1,5 @@ { - "name": "Scope3 Agentic Client", - "description": "TypeScript client for Scope3 Agentic API using MCP protocol", - "version": "0.1.0", - "setup": { - "commands": [ - { - "command": "npm install", - "description": "Install dependencies and set up git hooks (Husky)" - } - ] - }, "scripts": { - "dev": { - "command": "npm run build -- --watch", - "description": "Build in watch mode for development" - }, - "test": { - "command": "npm test", - "description": "Run all tests" - }, - "type-check": { - "command": "npm run type-check", - "description": "Check TypeScript types without building" - }, - "update-schemas": { - "command": "npm run update-schemas", - "description": "Download latest OpenAPI spec and regenerate TypeScript types" - } + "setup": "./scripts/conductor-setup.sh" } } diff --git a/scripts/conductor-setup.sh b/scripts/conductor-setup.sh new file mode 100755 index 0000000..3d06b93 --- /dev/null +++ b/scripts/conductor-setup.sh @@ -0,0 +1,72 @@ +#!/bin/bash +set -e + +echo "Setting up Scope3 Agentic Client workspace..." + +# Find the git root directory (the actual repository root, not the workspace) +# Conductor provides CONDUCTOR_ROOT_PATH for the original repo location in newer versions +# Fall back to detecting from PWD or git for backward compatibility +if [ -n "$CONDUCTOR_ROOT_PATH" ]; then + GIT_ROOT="$CONDUCTOR_ROOT_PATH" +elif [[ "$PWD" == *"/.conductor/"* ]]; then + GIT_ROOT=$(echo "$PWD" | sed 's|\(.*\)/\.conductor/.*|\1|') +else + GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) + if [ -z "$GIT_ROOT" ]; then + echo "ERROR: Not inside a git repository" + exit 1 + fi +fi + +echo "Using repository root: $GIT_ROOT" + +# Copy .env file from root repository +echo "Copying .env from root repository..." +if [ -f "$GIT_ROOT/.env" ]; then + cp "$GIT_ROOT/.env" .env + echo ".env file copied successfully" +elif [ -f ".env.example" ]; then + echo "WARNING: .env file not found at $GIT_ROOT/.env" + echo "Copying .env.example as a starting point..." + cp .env.example .env + echo "Please update .env with your actual values" +else + echo "WARNING: No .env file found. Create one based on .env.example" +fi + +# Export environment variables for validation +if [ -f ".env" ]; then + echo "Loading environment variables..." + set -a + source .env + set +a +fi + +# Validate critical environment variables +MISSING_VARS=() + +if [ -z "$SCOPE3_API_KEY" ]; then + MISSING_VARS+=("SCOPE3_API_KEY") +fi + +if [ ${#MISSING_VARS[@]} -gt 0 ]; then + echo "" + echo "WARNING: Missing environment variables:" + for var in "${MISSING_VARS[@]}"; do + echo " - $var" + done + echo "" + echo "Please update .env with your actual values before running the client." +fi + +# Install dependencies +echo "Installing dependencies..." +npm install + +echo "" +echo "Workspace setup complete!" +echo "" +echo "Next steps:" +echo " - Ensure SCOPE3_API_KEY is set in .env" +echo " - Run 'npm run build' to compile TypeScript" +echo " - Run 'npm test' to run tests" From 856ffc87c09d2ab6620f267758fdc1828cba66b1 Mon Sep 17 00:00:00 2001 From: Ben Miner Date: Tue, 14 Apr 2026 09:53:16 -0500 Subject: [PATCH 2/2] Restore original conductor.json fields alongside setup script Keep name, description, version, setup commands, and script definitions from the original config while adding the setup script entry. --- conductor.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/conductor.json b/conductor.json index 8bb3930..50f0155 100644 --- a/conductor.json +++ b/conductor.json @@ -1,5 +1,32 @@ { + "name": "Scope3 Agentic Client", + "description": "TypeScript client for Scope3 Agentic API using MCP protocol", + "version": "0.1.0", + "setup": { + "commands": [ + { + "command": "npm install", + "description": "Install dependencies and set up git hooks (Husky)" + } + ] + }, "scripts": { + "dev": { + "command": "npm run build -- --watch", + "description": "Build in watch mode for development" + }, + "test": { + "command": "npm test", + "description": "Run all tests" + }, + "type-check": { + "command": "npm run type-check", + "description": "Check TypeScript types without building" + }, + "update-schemas": { + "command": "npm run update-schemas", + "description": "Download latest OpenAPI spec and regenerate TypeScript types" + }, "setup": "./scripts/conductor-setup.sh" } }