feat(phase-2): Theia HTTP sync via sync-server on port 3001
- theia-exec.ts: primary path is now HTTP sync (syncRepoToTheia) via sync-server.js running inside Theia on port 3001 — no docker socket needed - syncRepoToTheia(giteaRepo): POST /sync → Theia git-pulls latest committed code - isTheiaSyncAvailable(): health check before attempting sync - docker exec path preserved for future use when socket is mounted - agent-session-runner: use syncRepoToTheia after auto-commit - server.ts: log both docker exec + HTTP sync status at startup Made-with: Cursor
This commit is contained in:
@@ -17,7 +17,7 @@ import { createLLM, toOAITools, LLMMessage } from './llm';
|
||||
import { AgentConfig } from './agents';
|
||||
import { executeTool, ToolContext } from './tools';
|
||||
import { resolvePrompt } from './prompts/loader';
|
||||
import { isTheiaAvailable, theiaExec, syncToTheia, getTheiaContainer } from './theia-exec';
|
||||
import { isTheiaAvailable, theiaExec, syncRepoToTheia, isTheiaSyncAvailable } from './theia-exec';
|
||||
|
||||
const MAX_TURNS = 60;
|
||||
|
||||
@@ -116,12 +116,12 @@ async function autoCommitAndDeploy(
|
||||
const giteaToken = process.env.GITEA_API_TOKEN || '';
|
||||
|
||||
try {
|
||||
// Sync files into Theia so "Open in Theia" shows the agent's work
|
||||
if (isTheiaAvailable() && opts.theiaWorkspaceSubdir) {
|
||||
await emit({ ts: now(), type: 'info', text: `Syncing files to Theia…` });
|
||||
const syncResult = await syncToTheia(repoRoot, opts.theiaWorkspaceSubdir);
|
||||
// Sync files into Theia via the sync-server so "Open in Theia" shows latest code
|
||||
if (opts.giteaRepo && await isTheiaSyncAvailable()) {
|
||||
await emit({ ts: now(), type: 'info', text: `Syncing to Theia…` });
|
||||
const syncResult = await syncRepoToTheia(opts.giteaRepo);
|
||||
if (syncResult.ok) {
|
||||
await emit({ ts: now(), type: 'info', text: '✓ Files available in Theia — open theia.vibnai.com to inspect.' });
|
||||
await emit({ ts: now(), type: 'info', text: `✓ Theia synced (${syncResult.action}) — open theia.vibnai.com to inspect.` });
|
||||
} else {
|
||||
console.warn('[session-runner] Theia sync failed:', syncResult.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user