Rename .js to .mjs, extract helpers module

Move resolvePath and exec out of index.mjs into server/helpers.mjs so
actions can import them directly rather than receiving them as arguments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 20:06:29 +00:00
parent 5a557a642a
commit f02e2a746d
7 changed files with 43 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
// Conduit client module — import this when using conduit programmatically.
// Designed for use by Claude or other tools that want to call conduit actions.
const BASE_URL = process.env.CONDUIT_URL || "http://localhost:3333";
const BASE_URL = process.env.CONDUIT_URL || "http://localhost:3015";
export async function callAction(action, params = {}) {
const res = await fetch(`${BASE_URL}/action`, {

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env node
// Conduit client — thin CLI wrapper for Claude to call the conduit server.
// Usage:
// node client/index.js <action> [key=value ...]
// node client/index.js list-actions
// node client/index.js edit-file filename=/workspace/foo.js
// node client/index.mjs <action> [key=value ...]
// node client/index.mjs list-actions
// node client/index.mjs edit-file filename=/workspace/foo.js
const BASE_URL = process.env.CONDUIT_URL || "http://localhost:3333";
const BASE_URL = process.env.CONDUIT_URL || "http://localhost:3015";
async function callAction(action, params = {}) {
const res = await fetch(`${BASE_URL}/action`, {