mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-12-04 00:15:41 -08:00
Sync upstream v3.2.4: slim install refs, a crash-safe installer, Change project restarts the agent (v3.2.4)
AI Assisted
This commit is contained in:
1 parent
50319aa332
commit
f997a82c4d
45 files changed
+7851
-306
No files matched your search
Generated
+2
-2
@@ -957,7 +957,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "fake-agent"
|
||||
version = "3.2.3"
|
||||
version = "3.2.4"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"terminal_size",
|
||||
@@ -2647,7 +2647,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
|
||||
|
||||
[[package]]
|
||||
name = "plan2code-app"
|
||||
version = "3.2.3"
|
||||
version = "3.2.4"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"libc",
|
||||
|
||||
@@ -92,8 +92,9 @@ file directly after checking it against the release's checksum list.
|
||||
- [ ] **Change project** in the top bar's project menu, with an agent running: it asks first, then the folder
|
||||
picker (Choose a folder, then recent folders) opens; canceling the picker leaves the running agent and its project untouched
|
||||
- [ ] Start the app with no arguments: it shows the folder picker, not the last project; a recent folder opens in one click
|
||||
- [ ] Change project, pick a different folder: the old agent and console stop, the new folder opens
|
||||
on the launch card (or the checklist, if its own first run has not passed yet)
|
||||
- [ ] Change project, pick a different folder: the old agent and console stop, and the same agent starts in the new folder
|
||||
on the same model and mode, with its dashboard showing (the launch card, or the checklist if its own
|
||||
first run has not passed yet, only when no agent was in use)
|
||||
- [ ] Reload the window (or navigate away and back) while an agent is running: the terminal redraws
|
||||
from where it was, not blank, and the dashboard reconnects to the same session
|
||||
- [ ] When the app and the installed skills differ in version, the bar's right end offers **Update
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "fake-agent"
|
||||
version = "3.2.3"
|
||||
version = "3.2.4"
|
||||
description = "A stand-in agent program for the Plan2Code app's tests"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "plan2code-app",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "plan2code-app",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.4",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.12.4",
|
||||
"@xterm/addon-fit": "0.11.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plan2code-app",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.4",
|
||||
"private": true,
|
||||
"description": "Plan2Code desktop app (Tauri). Separate from the repo root so the root and the web console stay dependency-free.",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "plan2code-app"
|
||||
version = "3.2.3"
|
||||
version = "3.2.4"
|
||||
description = "Plan2Code desktop app"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Plan2Code",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.4",
|
||||
"identifier": "com.plan2code.desktop",
|
||||
"build": {
|
||||
"frontendDist": "../ui",
|
||||
|
||||
+36
-4
@@ -2101,7 +2101,7 @@ function afterProjectKnown() {
|
||||
// tears the old project's agent and console down before the new one is
|
||||
// remembered, so nothing from it carries over. Cancel (or Escape) leaves
|
||||
// the current project as it was; the folder already open is not listed.
|
||||
async function doChangeProject() {
|
||||
async function doChangeProject(prior = null) {
|
||||
try {
|
||||
const dir = await showFolderPicker({ dialog: true });
|
||||
if (!dir) {
|
||||
@@ -2117,13 +2117,45 @@ async function doChangeProject() {
|
||||
restarting = false;
|
||||
currentUrl = null;
|
||||
frameReady = false;
|
||||
afterProjectKnown();
|
||||
// An agent was in use: start the same one (agent, model, effort and
|
||||
// permission mode) in the new folder, rather than leaving the launch card
|
||||
// and an empty terminal. Nothing to carry over: the launch card as before.
|
||||
if (prior) await startPriorAgent(prior);
|
||||
else afterProjectKnown();
|
||||
} catch (error) {
|
||||
showErrorState(error, 'switch project', 'Try again', doChangeProject);
|
||||
showErrorState(error, 'switch project', 'Try again', () => doChangeProject(prior));
|
||||
}
|
||||
}
|
||||
|
||||
// What the agent in use was started with, kept before a project switch tears
|
||||
// it down: null when none was started (a bare start), or its kind is unknown.
|
||||
function priorAgentSettings() {
|
||||
if (!agent.kind || (agent.state !== 'running' && agent.state !== 'ended')) return null;
|
||||
return {
|
||||
kind: agent.kind,
|
||||
model: agent.model || null,
|
||||
effort: agent.effort || null,
|
||||
mode: agent.mode === 'bypass' ? 'bypass' : 'checked',
|
||||
};
|
||||
}
|
||||
|
||||
async function startPriorAgent({ kind, model, effort, mode }) {
|
||||
launchAgentEl.value = kind;
|
||||
setAgentStatus('');
|
||||
beginWait('Starting the agent in the new project...');
|
||||
const { cols, rows } = terminal.size();
|
||||
try {
|
||||
await invoke('agent_start', { kind, model, effort, mode, cols, rows });
|
||||
terminal.focus();
|
||||
} catch (error) {
|
||||
endWait();
|
||||
setAgentError(error, 'start the agent');
|
||||
showLaunchCard();
|
||||
}
|
||||
}
|
||||
|
||||
async function changeProject() {
|
||||
const prior = priorAgentSettings();
|
||||
if (agentActive()) {
|
||||
const yes = await confirmModal({
|
||||
title: 'Stop the running agent and switch to a different project?',
|
||||
@@ -2133,7 +2165,7 @@ async function changeProject() {
|
||||
});
|
||||
if (!yes) return;
|
||||
}
|
||||
doChangeProject();
|
||||
doChangeProject(prior);
|
||||
}
|
||||
|
||||
changeProjectBtn.onclick = () => {
|
||||
|
||||
Reference in new issue
Block a user