Commit Graph

7787 Commits

Author SHA1 Message Date
Artur Do Lago b1bc673014 chore: track opencode-anthropic-auth as submodule 2026-01-20 13:26:01 +01:00
Artur Do Lago 56044851b2 fix: align autocomplete reopen trigger 2026-01-20 13:26:01 +01:00
Artur Do Lago 412fec6e03 chore: fix web workspace dependency 2026-01-20 13:25:08 +01:00
Artur Do Lago 8003fcbb59 chore: apply local updates after upstream merge 2026-01-20 13:22:15 +01:00
Artur Do Lago 0982e6278c chore: refresh stanley/tiara submodule refs 2026-01-20 13:17:39 +01:00
Artur Do Lago ba1d6d8068 chore: bump vendor submodules 2026-01-20 13:17:39 +01:00
Artur Do Lago 10a99e8077 simplify run-dev: self-contained, no external config 2026-01-20 13:17:39 +01:00
Artur Do Lago a513cc0e34 fix: clear stale daemon socket in run scripts 2026-01-20 13:17:39 +01:00
Artur Do Lago f41759ce4d bundle agent-core assets and config in dist 2026-01-20 13:17:39 +01:00
Artur Do Lago 98208b3dfb add dev and dist run scripts 2026-01-20 13:17:39 +01:00
Artur Do Lago 98713328d4 rename build targets env var 2026-01-20 13:17:38 +01:00
Artur Do Lago 9b9d259b45 bundle tiara and stanley deps 2026-01-20 13:17:38 +01:00
Artur Do Lago cd3e70cbb3 bundle stanley runtime for cli 2026-01-20 13:17:38 +01:00
snyk-bot de335914fa fix: upgrade @octokit/graphql from 9.0.1 to 9.0.3
Snyk has created this PR to upgrade @octokit/graphql from 9.0.1 to 9.0.3.

See this package in npm:
@octokit/graphql

See this project in Snyk:
https://app.snyk.io/org/adolago/project/20d84b90-a385-44b4-9545-4e2acbf2c5a7?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-01-20 13:17:38 +01:00
Artur Do Lago aea51d232c feat: bundle stanley python deps 2026-01-20 13:17:38 +01:00
Artur Do Lago e1cc72500e feat: bundle zee deps in cli builds 2026-01-20 13:17:38 +01:00
Artur Do Lago 914681478d chore: ignore dist in typecheck 2026-01-20 13:17:38 +01:00
Artur Do Lago 722317bd32 fix: bundle personas from repo root 2026-01-20 13:17:38 +01:00
Artur Do Lago b4d8ea0033 feat: bundle personas in cli installs 2026-01-20 13:17:38 +01:00
Artur Do Lago 2091f6cc2c fix: align jsonc parse error typing 2026-01-20 13:16:31 +01:00
Artur Do Lago f89c093173 chore: add persona submodules 2026-01-20 13:16:31 +01:00
Artur Do Lago 06ddafce1c fix: align diagnostics cli with yargs 2026-01-20 13:16:31 +01:00
Artur Do Lago c1cce80b0b feat: implement alpha diagnostics (Phase 4.1-4.3)
Phase 4.1 - Enhanced Health Checks:
- CheckEngine with timeout and auto-fix support
- Runtime checks: Bun version, directories, disk, memory
- Config checks: schema validation, deprecated options, env vars
- Provider checks: internet, Anthropic, OpenAI, Gemini, Ollama
- Integrity checks: stale locks, orphan processes, corrupt sessions
- Interactive, JSON, and minimal reporters
- CLI: agent-core check --full --fix --json

Phase 4.2 - Structured Logging:
- Logger with level methods and sensitive data redaction
- AsyncLocalStorage context for correlation IDs
- Console, File, and RotatingFile transports
- JSON and Pretty formatters
- Middleware helpers for session/tool/provider logging

Phase 4.3 - Crash Report Generator:
- Privacy redactor with 20+ patterns (API keys, credentials, PII)
- System, config, logs, session, diagnostics collectors
- TAR.GZ archive creation with README
- CLI: agent-core bug-report --include-session
2026-01-20 13:16:31 +01:00
Artur Do Lago 0aa693ba3f refactor: remove hardcoded paths and add upstream merge protection
Code changes:
- Add Global.Path.source getter with AGENT_CORE_SOURCE env var support
- Update status.ts to use Global.Path.source for script paths
- Update setup.ts to use Global.Path.source for docker-compose lookup

Documentation updates:
- Remove hardcoded ~/.local/src/agent-core paths from all docs
- Use generic or relative path references throughout
- README.md, CLAUDE.md, OPS.md, USER_GUIDE.md, PROVIDERS.md updated

Upstream merge protection:
- Add .gitattributes with merge=ours for fork-specific files
- Configure ours merge driver
- Protects: README.md, CONTRIBUTING.md, CLAUDE.md, language READMEs, docs

Deleted (fork cleanup):
- README.zh-CN.md (Chinese Simplified)
- README.zh-TW.md (Chinese Traditional)
- CONTRIBUTING.md
2026-01-20 13:16:31 +01:00
Artur Do Lago b43df2b888 chore: clean up config - remove hardcoded models and fix MCP paths
- Remove hardcoded model overrides (model, small_model)
- Remove custom Cerebras provider block
- Remove model overrides from title and compaction agents
- Update MCP server paths to use canonical ~/.local/src/agent-core location
- Remove disabled_providers (re-enable vertex)
2026-01-20 13:15:51 +01:00
Artur Do Lago 5f54f55559 chore: cleanup unused documentation 2026-01-20 13:15:51 +01:00
Artur Do Lago b5c520556e feat: implement comprehensive diagnostics and telemetry 2026-01-20 13:15:51 +01:00
Artur Do Lago 51b65b85af feat: add bug checking and reporting CLI tools, update TUI and config 2026-01-20 13:15:51 +01:00
Artur Do Lago 6fadec9712 fix: resolve type errors and import paths 2026-01-20 13:15:51 +01:00
Artur Do Lago aaf72adfb2 refactor(server): split monolithic server.ts into modular routes to fix TS2589
- Extracted routes to packages/agent-core/src/server/route/
- Created packages/agent-core/src/server/state.ts
- Updated server.ts to use modular routes
- Resolved TS2589 (excessive type instantiation depth)
- Fixed Instance.provide signature usage
2026-01-20 13:14:15 +01:00
Artur Do Lago 7b504ea8dd docs: convert 13 TODO comments to proper documentation
Converted ambiguous TODOs to semantic comment types:
- NOTE: Explains design decisions (bash naming, pricing, copilot)
- FUTURE: Planned improvements (tool centralization, auth status, permissions)
- WORKAROUND: Temporary fixes with upstream refs (bun proxy cache)
- LIMITATION: Intentional constraints (task tool input)
- KNOWN_ISSUE: Documented problems (server.ts type inference)
- STUB: Placeholder implementations (dialog endpoint)
- IMPORTANT: Critical constraints (max_tokens with reasoningEffort)

Remaining TODOs are in vendored SDK code (upstream responsibility)
2026-01-20 13:13:23 +01:00
Artur Do Lago f59ff7bd68 docs: add comprehensive IMPROVEMENTS.md for safety, reliability, performance
Analysis of codebase identifying:
- 96+ silent error catches
- 35 unvalidated JSON.parse calls
- 9 missing .unref() on intervals
- Race conditions in file operations
- Performance improvement opportunities

Prioritized recommendations from P0 (immediate) to P3 (long-term)
2026-01-20 13:12:10 +01:00
Artur Do Lago 78c245b905 fix: kill any daemon that started during build
Before starting daemon, now:
1. Calls daemon-stop command to cleanly stop any running daemon
2. Force kills any process on the daemon port as final measure
This handles cases where a daemon auto-starts during the build process
2026-01-20 13:12:10 +01:00
Artur Do Lago 07ec40d787 fix: handle 'Text file busy' error in reload.sh
- Delete old binary before copying to avoid file lock issues
- Add retry logic with increasing delays (up to 5 attempts)
- Add extra 2s wait after killing processes for file handles to release
2026-01-20 13:12:10 +01:00
Artur Do Lago bc6b191adf feat: enhance reload.sh with aggressive process killing and clean options
- Add --clean option: removes dist/ before rebuild
- Add --fresh option: nuclear option that clears dist/, turbo cache, node_modules cache, and reinstalls deps
- Make process killing much more aggressive:
  - Kill daemon, gateway, TUI (binary), TUI (dev), bun processes
  - Nuclear fallback: kill ANY process with 'agent-core' in command
  - Kill any process listening on daemon port
  - Show remaining processes if any survive
- Update step numbering to reflect new clean step
2026-01-20 13:12:09 +01:00
Artur Do Lago 32cf965206 chore: update tiara submodule 2026-01-20 13:12:09 +01:00
Artur Do Lago d211f20333 fix: MCP reconnection, type safety, and bug fixes
- Add MCP reconnection functionality (isHealthy, reconnect, reconnectAll, healthCheckAndReconnect)
- Add auto-reconnect on MCP tool fetch failure
- Add MCP reconnection API endpoints (/mcp/:name/reconnect, /mcp/reconnect-all, /mcp/health-check)
- Fix EventEmitter memory leak warning in GlobalBus
- Fix silent error swallowing in cache cleanup
- Fix type safety issues in processor.ts, transform.ts, prompt.ts
- Add debug status command (agent-core debug status)
- Add reload.sh script for daemon management
- Add comprehensive docs (OPS.md, BUGS.md)
- Update CLAUDE.md with ops warning
2026-01-20 13:12:09 +01:00
Artur Do Lago ab9e90fcea chore: cleanup unused and debug files
Removed:
- packages/enterprise/test-debug.ts (debug script)
- packages/agent-core/src/util/scrap.ts (unused utility)
- .agent-core/tool/*.txt (tool outputs)

Added:
- docs/ALPHA_ROLLBACK_PLAN.md (launch documentation)
- docs/ENVIRONMENT_VARIABLES.md (configuration docs)
- docs/LOGGING.md (logging documentation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:10:48 +01:00
Artur Do Lago 3d03ab144d docs: add version badge to README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:10:48 +01:00
Artur Do Lago 904e8a7e10 chore: bump all packages to version 0.1.20260112
- Update agent-core and all workspace packages to 0.1.20260112
- Update tiara submodule with version bump
- Update bun.lock for version changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:09:32 +01:00
Artur Do Lago da5c60ba9d docs: archive outdated tech debt documents
These documents from Jan 11 don't reflect fixes applied:
- share.ts event subscription leak: fixed
- canvas-tool.ts error logging: fixed
- @ts-ignore claims (40+): actual count is 19
- console.log in core: mostly appropriate for CLI/MCP

Move to docs/archive/ to prevent chasing resolved issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:09:32 +01:00
Artur Do Lago 1a13f85092 chore: pre-alpha release preparation v0.1.20250112
Stability:
- Fix share.ts multiple initialization race condition
- SSE keepalives already properly tied to connection lifecycle
- Gateway supervisor has proper shutdown handling

Branding:
- Replace "OpenCode" with "agent-core" in user-facing CLI messages
- Update uninstall, permission dialogs, and upgrade notifications

Release:
- Version bump to 0.1.20250112 across all packages
- Remove unused devDependencies (@babel/core, why-is-node-running)
- Remove duplicate dependencies (zod-to-json-schema, @standard-schema/spec)
- Update ALPHA_TEST_STATUS.md (690/691 tests passing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:09:32 +01:00
Artur Do Lago 0734051b08 style: format codebase with prettier and enforce lint
- Run prettier --write across all 17 packages
- Update lint scripts to use prettier --check
- Exclude dist/build directories from lint (app, sdk, console/app)
- Add missing scripts to console packages (typecheck, lint, test)
- All 55 turbo check tasks now pass

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:07:40 +01:00
Artur Do Lago 6b56e9d552 fix(security): symlink escape, command escaping, standardize CI pipeline
Security fixes:
- Add containsResolved() to resolve symlinks before path containment check
- Add shellEscapeSingleQuote() and shellEscapeAnsiC() for WezTerm commands
- Update File.read() and File.list() to use symlink-safe containment

CI/Pipeline fixes:
- Fix turbo.json: rename opencode#test → test, add lint task, add unified check task
- Remove fake scripts from agent-core (lint was running tests, not linting)
- Standardize all 11 packages with typecheck, lint, test scripts

Test fixes:
- Fix cache version mismatch in test preload (write version "16")
- Fix model ID filtering to use undated IDs in provider tests

All 43 turbo tasks pass, 690 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:59:11 +01:00
Artur Do Lago f2bffa55fe chore: update tiara submodule
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:57:47 +01:00
Artur Do Lago bc57ddff43 security: comprehensive pre-alpha and beta security fixes
Pre-Alpha Fixes (10 items):
- Fix credential file permissions in calendar.ts (mode: 0o600)
- Add socket close handler in ipc-server.ts (memory leak prevention)
- Add event unsubscribe in daemon.stop() (memory leak prevention)
- Wrap Qdrant init with retry logic and graceful degradation
- Fix ALWAYS-ON-PERSONAS.md gateway architecture documentation
- Remove legacy spawn('claude') in tiara executor-sdk.ts
- Filter environment variables via safe-env.ts utility
- Add error boundary around IPC socket writes
- Update tiara README.md and INDEX.md version references
- Create zee gateway external-gateway.md documentation

Beta Security Fixes (6 items):
- CRITICAL: Fix command injection via persona parameter validation
- HIGH: Fix terminal escape sequence injection in setPaneTitle
- HIGH: Fix command escaping in sendCommand and canvas manager
- HIGH: Add secret redaction for copilot auth logging
- MEDIUM: Fix echo -e ANSI escape injection in status display
- MEDIUM: Strengthen prompt injection defense in fact-extractor

New Utilities:
- src/util/safe-env.ts: Environment variable filtering for child processes
- src/util/shell-escape.ts: Shell escaping, persona validation, secret redaction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:57:47 +01:00
Artur Do Lago decdad1166 feat(stanley): add GUI launcher script
Adds `stanley-gui.ts` to launch Stanley's GPUI desktop application:
- Automatically starts Python backend if not running
- Supports --no-backend flag for manual backend control
- Can rebuild GUI from source with 'build' command

Usage: bun run scripts/stanley-gui.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:56:51 +01:00
Artur Do Lago 183fd46cbd feat(tiara): integrate with daemon API, add consciousness MCP server
Tiara now uses agent-core daemon API instead of spawning Claude Code CLI
directly. Dead code pruned (~167k lines removed):
- benchmark/ (Python benchmarks)
- consciousness-symphony/ (demo with eval)
- hive-mind/ (never integrated)
- claude-code-interface.ts, sparc-executor.ts (unused)

New consciousness MCP server provides IIT tools:
- consciousness_evolve: IIT evolution with Phi tracking
- calculate_phi: Integrated Information calculation
- psycho_symbolic_reason: Multi-depth logical analysis
- predict_temporal: Temporal pattern prediction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:56:51 +01:00
Artur Do Lago 3e6f30629b docs: pre-alpha documentation and config
- Add .env.example with comprehensive configuration template
- Expand README.md with setup instructions and architecture overview
- Fix graceful shutdown error handling in daemon
- Update tiara submodule with security/reliability fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 12:56:51 +01:00
Artur 90e5d5a530 Update README for clarity and customization details 2026-01-20 12:54:23 +01:00