diff --git a/kate/ollie_kate.cpp b/kate/ollie_kate.cpp index 8e30486..4dffef8 100644 --- a/kate/ollie_kate.cpp +++ b/kate/ollie_kate.cpp @@ -374,6 +374,11 @@ void OllieKateView::setupContextMenu(KTextEditor::View *view) connect(reviewDiffAction, &QAction::triggered, this, &OllieKateView::reviewDiff); } + auto *startAction = menu->addAction(QIcon::fromTheme(QStringLiteral("system-run")), + QStringLiteral("Ollie: Start Session")); + startAction->setObjectName(QStringLiteral("ollie_ctx_start")); + connect(startAction, &QAction::triggered, this, &OllieKateView::startSession); + if (!v->selection()) return; auto *explainAction = menu->addAction(QIcon::fromTheme(QStringLiteral("help-contents")), @@ -539,6 +544,17 @@ void OllieKateView::reviewDiff() m_9p->write(agentPath() + "/prompt", prompt.toUtf8()); } +void OllieKateView::startSession() +{ + ensureAgent(); + // Update cwd to current project + QString baseDir = projectBaseDir(); + if (!baseDir.isEmpty() && !m_agentId.isEmpty()) { + m_9p->write(agentPath() + "/ctl", ("cwd " + baseDir).toUtf8()); + } + updateStatusLabel(); +} + // --- Ghost Text --- void OllieKateView::setupGhostProvider() diff --git a/kate/ollie_kate.h b/kate/ollie_kate.h index ea127eb..4ad4922 100644 --- a/kate/ollie_kate.h +++ b/kate/ollie_kate.h @@ -75,6 +75,7 @@ private: void submitSelectionPrompt(const QString &action); void sendVerbatim(); void reviewDiff(); + void startSession(); // Agent management void ensureAgent();