wave-code 0.18.4 → 0.18.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp/agent.d.ts.map +1 -1
- package/dist/acp/agent.js +13 -0
- package/dist/utils/worktree.d.ts.map +1 -1
- package/dist/utils/worktree.js +10 -10
- package/package.json +2 -2
- package/src/acp/agent.ts +14 -0
- package/src/utils/worktree.ts +29 -19
package/dist/acp/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/acp/agent.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,KAAK,KAAK,IAAI,QAAQ,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAUzB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EAQpC,MAAM,0BAA0B,CAAC;AAwBlC,qBAAa,YAAa,YAAW,QAAQ;IAC3C,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,UAAU,CAAsB;IACxC,OAAO,CAAC,SAAS,CAA6B;gBAElC,UAAU,EAAE,mBAAmB;IAI3C,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,uBAAuB;YAmCjB,gBAAgB;IASxB,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAyBzC,YAAY,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAI5C,WAAW;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/acp/agent.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,KAAK,KAA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qB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5D,sBAAsB,CAC1B,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,8BAA8B,CAAC;IAuBpC,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IA+DtD,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IASvD,OAAO,CAAC,kBAAkB;YA2BZ,iBAAiB;YAsEjB,gBAAgB;YAyDhB,uBAAuB;IAmNrC,OAAO,CAAC,cAAc;IA6FtB,OAAO,CAAC,gBAAgB;IAmCxB,OAAO,CAAC,WAAW;YAmBL,yBAAyB;IAoIvC,OAAO,CAAC,eAAe;CAgTxB"}
|
package/dist/acp/agent.js
CHANGED
|
@@ -136,6 +136,7 @@ export class WaveAcpAgent {
|
|
|
136
136
|
onMcpServersChange: (servers) => callbacks.onMcpServersChange?.(servers),
|
|
137
137
|
onSessionIdChange: (newSessionId) => callbacks.onSessionIdChange?.(newSessionId),
|
|
138
138
|
onLatestTotalTokensChange: (tokens) => callbacks.onLatestTotalTokensChange?.(tokens),
|
|
139
|
+
onLoadingChange: (loading) => callbacks.onLoadingChange?.(loading),
|
|
139
140
|
},
|
|
140
141
|
});
|
|
141
142
|
agentRef.instance = agent;
|
|
@@ -1066,6 +1067,18 @@ export class WaveAcpAgent {
|
|
|
1066
1067
|
},
|
|
1067
1068
|
});
|
|
1068
1069
|
},
|
|
1070
|
+
onLoadingChange: (loading) => {
|
|
1071
|
+
if (!loading) {
|
|
1072
|
+
this.connection.sessionUpdate({
|
|
1073
|
+
sessionId: sessionRef.id,
|
|
1074
|
+
update: {
|
|
1075
|
+
sessionUpdate: "agent_message_chunk",
|
|
1076
|
+
content: { type: "text", text: "" },
|
|
1077
|
+
_meta: { endOfTurn: true },
|
|
1078
|
+
},
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1069
1082
|
},
|
|
1070
1083
|
sessionRef,
|
|
1071
1084
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/utils/worktree.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/utils/worktree.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,CAiIzE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAiE7D"}
|
package/dist/utils/worktree.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import { getDefaultRemoteBranch, getGitMainRepoRoot } from "wave-agent-sdk";
|
|
@@ -33,7 +33,7 @@ export function createWorktree(name, cwd) {
|
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
35
|
// Create worktree and branch
|
|
36
|
-
|
|
36
|
+
execFileSync("git", ["worktree", "add", "-b", branchName, worktreePath, baseBranch], {
|
|
37
37
|
cwd: repoRoot,
|
|
38
38
|
stdio: ["ignore", "pipe", "pipe"],
|
|
39
39
|
});
|
|
@@ -52,7 +52,7 @@ export function createWorktree(name, cwd) {
|
|
|
52
52
|
if (stderr.includes("already exists")) {
|
|
53
53
|
// If branch already exists, try to add worktree without -b
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
execFileSync("git", ["worktree", "add", worktreePath, branchName], {
|
|
56
56
|
cwd: repoRoot,
|
|
57
57
|
stdio: ["ignore", "pipe", "pipe"],
|
|
58
58
|
});
|
|
@@ -75,11 +75,11 @@ export function createWorktree(name, cwd) {
|
|
|
75
75
|
// Base branch not fetched yet — try fetching then retrying
|
|
76
76
|
const branchNameOnly = baseBranch.split("/").pop();
|
|
77
77
|
try {
|
|
78
|
-
|
|
78
|
+
execFileSync("git", ["fetch", "origin", branchNameOnly], {
|
|
79
79
|
cwd: repoRoot,
|
|
80
80
|
stdio: ["ignore", "pipe", "pipe"],
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
execFileSync("git", ["worktree", "add", "-b", branchName, worktreePath, baseBranch], {
|
|
83
83
|
cwd: repoRoot,
|
|
84
84
|
stdio: ["ignore", "pipe", "pipe"],
|
|
85
85
|
});
|
|
@@ -96,7 +96,7 @@ export function createWorktree(name, cwd) {
|
|
|
96
96
|
catch {
|
|
97
97
|
// Fetch or retry failed — fall back to HEAD
|
|
98
98
|
try {
|
|
99
|
-
|
|
99
|
+
execFileSync("git", ["worktree", "add", "-b", branchName, worktreePath, "HEAD"], {
|
|
100
100
|
cwd: repoRoot,
|
|
101
101
|
stdio: ["ignore", "pipe", "pipe"],
|
|
102
102
|
});
|
|
@@ -128,7 +128,7 @@ export function removeWorktree(session) {
|
|
|
128
128
|
// Get current branch in worktree before removing it
|
|
129
129
|
let currentBranch;
|
|
130
130
|
try {
|
|
131
|
-
currentBranch =
|
|
131
|
+
currentBranch = execFileSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], {
|
|
132
132
|
cwd: session.path,
|
|
133
133
|
encoding: "utf8",
|
|
134
134
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -138,13 +138,13 @@ export function removeWorktree(session) {
|
|
|
138
138
|
// Ignore errors getting current branch
|
|
139
139
|
}
|
|
140
140
|
// Remove worktree
|
|
141
|
-
|
|
141
|
+
execFileSync("git", ["worktree", "remove", "--force", session.path], {
|
|
142
142
|
cwd: repoRoot,
|
|
143
143
|
stdio: ["ignore", "pipe", "pipe"],
|
|
144
144
|
});
|
|
145
145
|
// Delete original branch
|
|
146
146
|
try {
|
|
147
|
-
|
|
147
|
+
execFileSync("git", ["branch", "-D", session.branch], {
|
|
148
148
|
cwd: repoRoot,
|
|
149
149
|
stdio: ["ignore", "pipe", "pipe"],
|
|
150
150
|
});
|
|
@@ -162,7 +162,7 @@ export function removeWorktree(session) {
|
|
|
162
162
|
currentBranch !== "main" &&
|
|
163
163
|
currentBranch !== "master") {
|
|
164
164
|
try {
|
|
165
|
-
|
|
165
|
+
execFileSync("git", ["branch", "-D", currentBranch], {
|
|
166
166
|
cwd: repoRoot,
|
|
167
167
|
stdio: ["ignore", "pipe", "pipe"],
|
|
168
168
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-code",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
4
4
|
"description": "CLI-based code assistant powered by AI, built with React and Ink",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"semver": "^7.7.4",
|
|
43
43
|
"yargs": "^17.7.2",
|
|
44
44
|
"zod": "^3.23.8",
|
|
45
|
-
"wave-agent-sdk": "0.18.
|
|
45
|
+
"wave-agent-sdk": "0.18.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react": "^19.1.8",
|
package/src/acp/agent.ts
CHANGED
|
@@ -245,6 +245,8 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
245
245
|
callbacks.onSessionIdChange?.(newSessionId),
|
|
246
246
|
onLatestTotalTokensChange: (tokens: number) =>
|
|
247
247
|
callbacks.onLatestTotalTokensChange?.(tokens),
|
|
248
|
+
onLoadingChange: (loading: boolean) =>
|
|
249
|
+
callbacks.onLoadingChange?.(loading),
|
|
248
250
|
},
|
|
249
251
|
});
|
|
250
252
|
|
|
@@ -1398,6 +1400,18 @@ export class WaveAcpAgent implements AcpAgent {
|
|
|
1398
1400
|
},
|
|
1399
1401
|
});
|
|
1400
1402
|
},
|
|
1403
|
+
onLoadingChange: (loading: boolean) => {
|
|
1404
|
+
if (!loading) {
|
|
1405
|
+
this.connection.sessionUpdate({
|
|
1406
|
+
sessionId: sessionRef.id as AcpSessionId,
|
|
1407
|
+
update: {
|
|
1408
|
+
sessionUpdate: "agent_message_chunk",
|
|
1409
|
+
content: { type: "text", text: "" },
|
|
1410
|
+
_meta: { endOfTurn: true },
|
|
1411
|
+
},
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1401
1415
|
},
|
|
1402
1416
|
sessionRef,
|
|
1403
1417
|
};
|
package/src/utils/worktree.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import { getDefaultRemoteBranch, getGitMainRepoRoot } from "wave-agent-sdk";
|
|
@@ -47,8 +47,9 @@ export function createWorktree(name: string, cwd: string): WorktreeSession {
|
|
|
47
47
|
|
|
48
48
|
try {
|
|
49
49
|
// Create worktree and branch
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
execFileSync(
|
|
51
|
+
"git",
|
|
52
|
+
["worktree", "add", "-b", branchName, worktreePath, baseBranch],
|
|
52
53
|
{
|
|
53
54
|
cwd: repoRoot,
|
|
54
55
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -69,7 +70,7 @@ export function createWorktree(name: string, cwd: string): WorktreeSession {
|
|
|
69
70
|
if (stderr.includes("already exists")) {
|
|
70
71
|
// If branch already exists, try to add worktree without -b
|
|
71
72
|
try {
|
|
72
|
-
|
|
73
|
+
execFileSync("git", ["worktree", "add", worktreePath, branchName], {
|
|
73
74
|
cwd: repoRoot,
|
|
74
75
|
stdio: ["ignore", "pipe", "pipe"],
|
|
75
76
|
});
|
|
@@ -95,12 +96,13 @@ export function createWorktree(name: string, cwd: string): WorktreeSession {
|
|
|
95
96
|
// Base branch not fetched yet — try fetching then retrying
|
|
96
97
|
const branchNameOnly = baseBranch.split("/").pop()!;
|
|
97
98
|
try {
|
|
98
|
-
|
|
99
|
+
execFileSync("git", ["fetch", "origin", branchNameOnly], {
|
|
99
100
|
cwd: repoRoot,
|
|
100
101
|
stdio: ["ignore", "pipe", "pipe"],
|
|
101
102
|
});
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
execFileSync(
|
|
104
|
+
"git",
|
|
105
|
+
["worktree", "add", "-b", branchName, worktreePath, baseBranch],
|
|
104
106
|
{
|
|
105
107
|
cwd: repoRoot,
|
|
106
108
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -118,10 +120,14 @@ export function createWorktree(name: string, cwd: string): WorktreeSession {
|
|
|
118
120
|
} catch {
|
|
119
121
|
// Fetch or retry failed — fall back to HEAD
|
|
120
122
|
try {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
execFileSync(
|
|
124
|
+
"git",
|
|
125
|
+
["worktree", "add", "-b", branchName, worktreePath, "HEAD"],
|
|
126
|
+
{
|
|
127
|
+
cwd: repoRoot,
|
|
128
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
129
|
+
},
|
|
130
|
+
);
|
|
125
131
|
return {
|
|
126
132
|
name,
|
|
127
133
|
path: worktreePath,
|
|
@@ -155,24 +161,28 @@ export function removeWorktree(session: WorktreeSession): void {
|
|
|
155
161
|
// Get current branch in worktree before removing it
|
|
156
162
|
let currentBranch: string | undefined;
|
|
157
163
|
try {
|
|
158
|
-
currentBranch =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
currentBranch = execFileSync(
|
|
165
|
+
"git",
|
|
166
|
+
["rev-parse", "--abbrev-ref", "HEAD"],
|
|
167
|
+
{
|
|
168
|
+
cwd: session.path,
|
|
169
|
+
encoding: "utf8",
|
|
170
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
171
|
+
},
|
|
172
|
+
).trim();
|
|
163
173
|
} catch {
|
|
164
174
|
// Ignore errors getting current branch
|
|
165
175
|
}
|
|
166
176
|
|
|
167
177
|
// Remove worktree
|
|
168
|
-
|
|
178
|
+
execFileSync("git", ["worktree", "remove", "--force", session.path], {
|
|
169
179
|
cwd: repoRoot,
|
|
170
180
|
stdio: ["ignore", "pipe", "pipe"],
|
|
171
181
|
});
|
|
172
182
|
|
|
173
183
|
// Delete original branch
|
|
174
184
|
try {
|
|
175
|
-
|
|
185
|
+
execFileSync("git", ["branch", "-D", session.branch], {
|
|
176
186
|
cwd: repoRoot,
|
|
177
187
|
stdio: ["ignore", "pipe", "pipe"],
|
|
178
188
|
});
|
|
@@ -195,7 +205,7 @@ export function removeWorktree(session: WorktreeSession): void {
|
|
|
195
205
|
currentBranch !== "master"
|
|
196
206
|
) {
|
|
197
207
|
try {
|
|
198
|
-
|
|
208
|
+
execFileSync("git", ["branch", "-D", currentBranch], {
|
|
199
209
|
cwd: repoRoot,
|
|
200
210
|
stdio: ["ignore", "pipe", "pipe"],
|
|
201
211
|
});
|