Commit Graph
9 Commits
Author SHA1 Message Date
Chris Scott b625acfc0c chore(lint): replace ESLint with Oxlint and clear anti-slop findings 2026-11-13 01:13:34 -05:00
Chris Scott e0331b43bf feat(secrets): repository secrets and variables injected into agent shells and terminals
Add a GitHub Actions-style store for secrets and variables so tests can read
credentials from the environment without .env files in the repo.

- secrets table keyed by kind, repo (NULL for global) and environment;
  secrets are encrypted with encryptSecret and write-only, variables are plain
  text. Names follow GitHub's rules and reject Manager-reserved names.
- Global (/api/secrets, /api/variables) and repo
  (/api/repos/:id/secrets|variables) routes.
- The trusted .ocm/project.json gains environment and env fields that map
  names to ${{ secrets.X }} / ${{ vars.X }} expressions. Both are part of the
  trust hash; files without them hash as before, so existing trust survives.
- RepoEnvService.resolveForDirectory resolves the repo and approved mapping
  for any directory, including worktrees outside the repo folder, with
  environment > repo > global precedence. It never throws.
- /api/internal/shell-env replaces /git-credentials/gh-env and feeds the
  ocm-gh-env plugin, the sandbox shell plan and TerminalService.create.
- The plugin masks injected secret values as *** in completed tool results.
- The sandbox shell plan is now the only source of the guest environment: the
  plugin pins OCM_SANDBOX_FORWARD_ENV and the shim forwards only those names.
2026-10-23 22:59:57 -04:00
Chris Scott b13707b5b3 Merge forge/terminal-dev-loop into beta
feat: integrated terminal, project actions and dev server preview (OM-17, OM-18, OM-19)

Integration with #380 and #379:
- Adopt the git-config identity model: drop the branch's identity stubs
  (getShellEnv, getAssignedGitIdentityEnv, repo identity ids, duplicate
  createGitService and getMainCheckoutPath); terminals receive only the
  GitHub token env and take their commit identity from git config.
- Add RepoWorkspaceService as the single owner of OpenCode workspace
  side effects: worktree setup commands on create and terminal cleanup on
  remove, used by the workspace routes, the session launcher (ocm tool and
  multi-run) and multi-run discard, with one worktree-sibling matcher.
- Run repo-delete terminal cleanup inside the worktree branch deletion
  flow.
- Combine the CreateWorktreeDialog tests and update docs for the identity
  model and setup command coverage.
2026-10-03 23:50:10 -04:00
Chris Scott c60a9b35f2 fix(terminal-dev-loop): address branch review findings
Security:
- Reject same-site and cross-site state-changing requests on cookie-authenticated routes unless the origin is trusted
- Drop Manager and ocm_preview Set-Cookie headers from preview responses
- Show and hash the full executable content of .ocm/project.json at trust time
- Restrict action URLs to http(s) and refuse symlinked repo config paths
- Keep the preview start redirect on the gateway origin

Lifecycle:
- Stop terminals in OpenCode workspace siblings when a repo is deleted
- Report preview as unavailable instead of crashing when the gateway port cannot be bound

Performance:
- Skip branch lookups when validating terminal and project-config directories
- Stop the /proc scan once all listening sockets are mapped and pause port polling while a preview is open
- Close slow WebSocket clients with 1013 so they reconnect with replay
- Lazy-load the xterm terminal view and skip unchanged resize requests
- Request uncompressed responses from preview targets

Cleanup:
- Share one repo directory resolver, trusted-origins parser, cookie prefix, WebSocket frame forwarder, header filter, icon map and dialog-param helper
- Remove unused props, options and exports

Docs: update terminal, preview, project actions, sandboxing, internal API and environment pages
2026-10-03 10:00:33 -04:00
Chris Scott 16b91ccf02 loop: terminal-dev-loop completed after 30 iterations 2026-10-03 04:29:40 -04:00
Chris Scott a383e57bc5 section 16: Phase 16: Documentation, container ports and full repository checks 2026-10-03 04:07:44 -04:00
Chris Scott d6aeafeae9 section 8: Phase 8: Run and stop project actions with URL templates 2026-10-03 02:09:54 -04:00
Chris Scott 852797a897 section 7: Phase 7: Committed repo file, trust and move between personal and repo 2026-10-03 02:00:46 -04:00
Chris Scott e83b979730 section 6: Phase 6: Project configuration schemas and personal action storage 2026-10-03 01:47:04 -04:00