Commit Graph

27 Commits

Author SHA1 Message Date
64df986a5f Thread exec and mailer_send through ctx instead of importing directly
- actions.mjs no longer imports exec from helpers; uses ctx.exec instead
- index.mjs builds ctx via make_ctx(), which injects dry-run stubs for
  exec and mailer_send when --dry-run is active
- Handlers now run fully (including permission checks) in dry-run mode;
  only the actual side effects are stubbed out

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:58:00 +00:00
3841c5418a Bump version to 1.1.0
Adds email support (send-email, set-mail-permission, get-mail-permissions),
--dry-run flag, and --mail-perms persistence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.1.0
2026-03-17 22:46:56 +00:00
9668bae220 Add --dry-run flag to server
When active, action invocations are logged (action name, caller, params)
but no handler is executed. Applies to both auto-accept and approved queue
entries. Startup message confirms the mode is active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:41:09 +00:00
19e57f4e3e Update README to match current implementation
- Add send-email, set-mail-permission, get-mail-permissions to actions table
- Document --mail-perms flag and CONDUIT_MAIL_PERMS env var
- Correct CONDUIT_ROOT description (informational only, not path resolution)
- Add ctx argument to "adding actions" example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:39:14 +00:00
d2d9905a82 Remove package-lock.json from repo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:37:14 +00:00
b1ccbfef41 Implement email support with per-user permission model (closes #2)
New modules:
- server/mailer.mjs: nodemailer transport wrapper
- server/mail_perms.mjs: runtime permission store, persisted to disk

New actions:
- send-email: checks (caller, to, topic) permission before sending
- set-mail-permission: grant/revoke permissions, gated by canApprove
- get-mail-permissions: list current permissions

Handler signature extended to handler(params, ctx) where ctx carries
caller, users, mail_perm_store and mailer_send. Existing handlers
ignore ctx so the change is backwards-compatible.

SMTP config lives in secrets.json under optional 'smtp' key.
Mail permissions path via --mail-perms or CONDUIT_MAIL_PERMS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 22:34:26 +00:00
5fb9d3ce07 Suppress GET /queue logs unless --verbose
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:36:59 +00:00
f2d32a3faa Add request logging, simplify queue output, bump to v1.0.0
Each request logs timestamp, method, path and user. Queue entries log
a single line on enqueue and on resolve. Drop the verbose approve/deny
curl instructions from queue output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.0.0
2026-03-07 21:34:35 +00:00
62d2480cd4 Add --url flag to ccc-client and ccc-queue
Overrides CONDUIT_URL env var. Resolved through load_client_config and
threaded into create_conduit_client as base_url parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:20:59 +00:00
0d1e25019e Change default bind address to 127.0.0.1
Safer default — network exposure requires explicit --bind or CONDUIT_BIND.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:18:38 +00:00
fa4a7a99f8 Add --bind argument to server
Defaults to 0.0.0.0, can also be set via CONDUIT_BIND env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:18:11 +00:00
412e322a69 Fix tags not rendering in list box
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:13:50 +00:00
507eb7584d Fix ccc-queue triggering client main() on import
Move resolve_queue_item into conduit.mjs factory and have ccc-queue
import from there instead of index.mjs, which auto-executes main().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:12:05 +00:00
ca7ae930cc Add .npmignore, add install instructions to README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:04:37 +00:00
50f49c366a Fixed broken box drawing 2026-03-07 22:01:20 +01:00
c45d196702 Rewrite README to reflect current state
Covers keygen workflow, auth model, all three binaries, env vars,
action registry, path resolution, and security notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:00:22 +00:00
81ad722e84 Add ccc-keygen for secrets file generation
--create <names>  generates secrets.json with random 32-byte hex secrets
--filter <names>  extracts a subset of users into filtered-secrets.json
--input/--output  override default file paths

Removes hardcoded user/agent assumptions from secrets.example.json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:59:25 +00:00
e8bbcb293f Add ccc-server/client/queue bins and blessed queue TUI
- bin/ccc-server, ccc-client, ccc-queue wired up via package.json bin
- client/config.mjs: shared secrets/user resolution from CLI args or
  CCC_SECRETS/CCC_USER env vars
- ccc-queue: blessed TUI with two-pane layout (list + detail), polls
  every 2s, y/n to approve/deny selected item, r to refresh, q to quit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:49:12 +00:00
0a3ab14053 Replace key=value args with JSON payload in client
Remaining args after --secrets/--user are space-joined and parsed as
JSON, so the full action payload is expressed directly rather than
through a custom key=value scheme.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:40:56 +00:00
4b064f1bf8 Switch exec to fire-and-forget spawn, drop awaits
spawnSync was blocking the event loop until the subprocess exited, so
opening a browser would freeze the server until it closed. Replace with
spawn + unref (detached, stdio ignored) and remove the now-pointless
awaits and async keywords from action handlers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:38:04 +00:00
0568026e7c Validate URL protocol in open-browser action
Parse the URL and reject anything that isn't http/https before passing
to xdg-open, blocking file://, javascript:// and other schemes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:36:26 +00:00
b83ae686c4 Adjusted action list, removed open-directory for now 2026-03-07 21:35:23 +01:00
2bf658dc5f Implement resolve_path using VOLUME_MAPPING array
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:27:17 +00:00
ac82501b48 Replace trivial resolve_path with volume map
Maps container paths to host paths using the docker-compose volume layout
(/workspace -> CONDUIT_HOST_WORKSPACE, /home/claude -> CONDUIT_HOST_HOME).
Relative paths resolve against CONTAINER_PATH. Paths outside all known
volumes throw rather than silently pass through.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:23:27 +00:00
67c1c3f9a4 Add HMAC auth, user permissions, snake_case rename
Each request is signed with HMAC-SHA256 over timestamp+body using a
per-user secret loaded from a --secrets file (never env vars or git).
Users have a canApprove list controlling who may approve queued actions.
Queue entries track submitted_by for permission checks on approve/deny.

Also renames all identifiers to snake_case throughout the codebase.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:18:41 +00:00
f02e2a746d 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>
2026-03-07 20:06:29 +00:00
5a557a642a Initial commit
Supervised action bridge between Claude Code and the host system.
Server accepts structured action requests, applies per-action policies
(auto-accept/auto-deny/queue), and executes approved actions via typed
handlers. Client provides CLI and module interfaces for calling the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:01:54 +00:00