@staff0rd/assist 0.1158.3 → 0.1160.0
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/agent/advice/ask.md +1 -1
- package/agent/commands/ask.md +6 -3
- package/dist/.build-files +99 -97
- package/dist/{addActivity-GJKYQUDU.js → addActivity-TNE2FRPB.js} +3 -2
- package/dist/{addPhase-MDRHOLLJ.js → addPhase-V4Z636NN.js} +6 -5
- package/dist/{advise-T7BSKEAE.js → advise-RTJV7NU2.js} +4 -3
- package/dist/{ask-ZZRX33YD.js → ask-7JXPMU2X.js} +38 -3
- package/dist/{askCheck-H3DETZR5.js → askCheck-3JCSRRAQ.js} +49 -21
- package/dist/{askDesign-W3NGNG2S.js → askDesign-Q4HBBLJD.js} +5 -4
- package/dist/{askQuestion-5RDETJHR.js → askQuestion-QXVDXZZY.js} +2 -2
- package/dist/{branch-I7ZQIMGP.js → branch-LSX2L22U.js} +4 -3
- package/dist/built-version +1 -1
- package/dist/{chunk-7MEMTAOZ.js → chunk-25PQYD5B.js} +2 -2
- package/dist/{chunk-XVRHFHDU.js → chunk-4X2UUOFH.js} +1 -1
- package/dist/{chunk-4ONI7QEW.js → chunk-5AJWUYA3.js} +1 -1
- package/dist/{chunk-GGQW6CYV.js → chunk-5THMDW42.js} +1 -1
- package/dist/chunk-6MNX5ZMQ.js +6 -0
- package/dist/{chunk-PTBA2F2T.js → chunk-6ZECLGYV.js} +13 -2
- package/dist/{chunk-KUT55SV3.js → chunk-7I2Q27D6.js} +7 -7
- package/dist/{chunk-UA4OXH7W.js → chunk-7M657DAU.js} +45 -5
- package/dist/{chunk-EGGBKXWO.js → chunk-7MIAK3SD.js} +2 -2
- package/dist/{chunk-LFRSZIAS.js → chunk-7NZOH4LN.js} +1 -1
- package/dist/{chunk-56ZMG6X3.js → chunk-C4247LMI.js} +1 -1
- package/dist/{chunk-KI7RHWH5.js → chunk-C5YM3YO4.js} +3 -4
- package/dist/{chunk-YGWBV3ZA.js → chunk-C6AKA3GY.js} +2 -2
- package/dist/{chunk-TECUUDTX.js → chunk-CKJ4SDVJ.js} +1 -1
- package/dist/{chunk-KP3UKYJH.js → chunk-D2337HWD.js} +1 -1
- package/dist/{chunk-CJUZTNRQ.js → chunk-EOALZG4Y.js} +1 -1
- package/dist/chunk-F7QYFJB2.js +17 -0
- package/dist/{chunk-SJFPJC5E.js → chunk-GMXZUWBU.js} +1 -1
- package/dist/{chunk-OXYGWLAI.js → chunk-I3XPML6O.js} +7 -7
- package/dist/{chunk-DE3RLRXT.js → chunk-JR3LZHBZ.js} +1 -1
- package/dist/{chunk-TR4N3VFY.js → chunk-JVJOXBO2.js} +3 -3
- package/dist/{chunk-ZFJMFM5O.js → chunk-K5K7LATN.js} +1 -1
- package/dist/{chunk-HW2SAZBU.js → chunk-K5MYLLFM.js} +2 -2
- package/dist/{chunk-2EZN7YYI.js → chunk-L3RJER2C.js} +1 -1
- package/dist/{chunk-Q2KKGXWP.js → chunk-L4PVKBXS.js} +1 -1
- package/dist/{chunk-WGP5D6FO.js → chunk-LO4K3OUQ.js} +1 -1
- package/dist/{chunk-LGBMLYGM.js → chunk-LYQWAGLE.js} +1 -1
- package/dist/{chunk-6UE44FWN.js → chunk-MG4IJB47.js} +1 -1
- package/dist/{chunk-MK7SONKM.js → chunk-MOQ2IEPI.js} +1 -1
- package/dist/{chunk-DUX7IRKZ.js → chunk-MSPCQ5L7.js} +1 -1
- package/dist/{chunk-NJUF5XRJ.js → chunk-O7X46AAU.js} +1 -1
- package/dist/{chunk-TEYQMP4G.js → chunk-OLFUSXO3.js} +1 -1
- package/dist/{chunk-GOQK3KCL.js → chunk-OTYBOGWB.js} +1 -1
- package/dist/{chunk-I3Y7QGJK.js → chunk-Q4CX4OJJ.js} +1 -1
- package/dist/{chunk-Y2R6PKDY.js → chunk-QSUS3RLF.js} +3 -1
- package/dist/{chunk-FHXKQAS6.js → chunk-S55TRXFP.js} +2 -2
- package/dist/{chunk-7FUE2JFB.js → chunk-SQKNRK6D.js} +1 -1
- package/dist/{chunk-OTWBV35D.js → chunk-SUO2246Y.js} +1 -1
- package/dist/{chunk-DYGEMDS7.js → chunk-TESRDGY7.js} +1 -1
- package/dist/{chunk-BEM3VQZO.js → chunk-VEMNENJ2.js} +1 -1
- package/dist/{chunk-BAHQJHYD.js → chunk-VWVLMTH2.js} +4 -0
- package/dist/chunk-VXIZ5DUA.js +6 -0
- package/dist/{chunk-VWO3F27D.js → chunk-VYOVPMBH.js} +1 -1
- package/dist/{chunk-LWZM6ZRA.js → chunk-XDQFHWGO.js} +5 -5
- package/dist/{chunk-3KGQGR3G.js → chunk-YHZUTP5K.js} +1 -1
- package/dist/{cliHook-KMT5IJUY.js → cliHook-XFH6QLH7.js} +6 -5
- package/dist/{cliHookCheck-JFVC6WQH.js → cliHookCheck-QXSRKVUJ.js} +3 -2
- package/dist/{codexHook-XWDAZ43I.js → codexHook-KGR76TSJ.js} +8 -7
- package/dist/commands/extension/extension/content.js +1 -1
- package/dist/commands/extension/extension/docs.js +7 -7
- package/dist/commands/sessions/web/bundle.js +456 -454
- package/dist/{comment-CADYMIUH.js → comment-2T2VC3NL.js} +4 -4
- package/dist/{commentIssue-2VMPDQ74.js → commentIssue-KOQ5PSTG.js} +3 -3
- package/dist/{commit-N6MTYEKD.js → commit-DXTHQVIK.js} +4 -3
- package/dist/{createIssue-J6QLUACO.js → createIssue-EE5W4LLB.js} +2 -2
- package/dist/{doctorNodes-ZXFL27JJ.js → doctorNodes-HBQW5L3M.js} +3 -3
- package/dist/{done-WE33GZ5X.js → done-MQBZZSGP.js} +5 -4
- package/dist/{edit-XOU2IWSF.js → edit-OBXC5Z6J.js} +2 -2
- package/dist/{editHook-5GWY5EIZ.js → editHook-PIDVOHE3.js} +6 -5
- package/dist/{editIssue-6I3BU4YO.js → editIssue-CR4SFOIS.js} +2 -2
- package/dist/{editIssueComment-OLT3MQDH.js → editIssueComment-SVTPJ6CU.js} +3 -3
- package/dist/{fixConflict-LF5WDGBK.js → fixConflict-2DB66U4A.js} +5 -4
- package/dist/index.js +61 -61
- package/dist/{launchMode-ZZXHF4WH.js → launchMode-4TWOI76X.js} +16 -15
- package/dist/{list-MC26ZBCC.js → list-QFKV7MEU.js} +6 -5
- package/dist/{next-A4E3QIUK.js → next-TJGY3KDH.js} +15 -14
- package/dist/{piHook-4HACLM4E.js → piHook-7QDAYTIX.js} +6 -5
- package/dist/{postSlackMessage-IPJ2HPKC.js → postSlackMessage-MH6BMLGC.js} +3 -3
- package/dist/{propose-LY5FMT3N.js → propose-JF27BF42.js} +7 -6
- package/dist/{raise-AWHJN5PS.js → raise-5YMRZJLP.js} +2 -2
- package/dist/{refine-75FHRJJQ.js → refine-DPA5BYQI.js} +17 -16
- package/dist/{reply-QXSMUPXO.js → reply-RF5XWST2.js} +3 -3
- package/dist/{restartNode-56PDCYFC.js → restartNode-I3C4XEWU.js} +5 -5
- package/dist/{review-FI2UAR4P.js → review-GXVALUWY.js} +7 -6
- package/dist/{reviewPrComments-NYNOC6FH.js → reviewPrComments-CICNPWVX.js} +5 -4
- package/dist/{rewindPhase-3NINBE4W.js → rewindPhase-DDTS4N6S.js} +9 -8
- package/dist/{rulesAdd-QI27Q4JE.js → rulesAdd-2PHHDPJ3.js} +3 -3
- package/dist/{run-CA6UYDF2.js → run-6AHR53L7.js} +13 -12
- package/dist/{run-5SGSUDJT.js → run-BDQCSTCF.js} +13 -12
- package/dist/{runDaemon-RUAINOEF.js → runDaemon-FE3XZEUT.js} +182 -45
- package/dist/{runExtract-VK32OSQH.js → runExtract-43B4PDWU.js} +2 -2
- package/dist/{runRefine-UW2KCMCF.js → runRefine-ZNMBCAAN.js} +17 -16
- package/dist/{scan-5GEMMH6B.js → scan-NKKHHGL2.js} +3 -2
- package/dist/{schemaConfirm-AVGQ24CV.js → schemaConfirm-6NZ3JBDT.js} +3 -2
- package/dist/{schemaUnlock-WAM3TR4W.js → schemaUnlock-N53NXNUF.js} +3 -2
- package/dist/{search-GC2UGMTN.js → search-X52HVMA3.js} +6 -5
- package/dist/{show-PSV25MMZ.js → show-N2KOJIBG.js} +4 -3
- package/dist/{show-CQXKSP6N.js → show-PR4OSVLY.js} +4 -3
- package/dist/{signExtension-6MLSAPEG.js → signExtension-WUVAF67T.js} +1 -1
- package/dist/{slack-4ZPQ5C5L.js → slack-4YK2TTH5.js} +3 -3
- package/dist/{updateNode-EEL2KZ2J.js → updateNode-PZMQ2BSE.js} +5 -5
- package/dist/{updatePlan-3VKXJHRM.js → updatePlan-IOSLPULZ.js} +7 -6
- package/dist/{web-W6KOT2ZE.js → web-H4GKNDJW.js} +17 -16
- package/dist/{web-Z5FCXQWU.js → web-T44LOGKB.js} +17 -16
- package/dist/{wontfix-PHYW2KQ7.js → wontfix-62MHC5KB.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-5PKWV3WT.js +0 -8
|
@@ -3,23 +3,24 @@ import {
|
|
|
3
3
|
adviceHookPayload,
|
|
4
4
|
composeAdvice,
|
|
5
5
|
selectAdvice
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6ZECLGYV.js";
|
|
7
7
|
import {
|
|
8
8
|
loadAdviceFragments
|
|
9
9
|
} from "./chunk-P7FVAGFQ.js";
|
|
10
10
|
import {
|
|
11
11
|
readStdin
|
|
12
12
|
} from "./chunk-NGYZK6AF.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-K5K7LATN.js";
|
|
14
14
|
import "./chunk-MELBVXKL.js";
|
|
15
15
|
import "./chunk-OGJ6AZK4.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-7M657DAU.js";
|
|
17
17
|
import "./chunk-MRUIXQXS.js";
|
|
18
18
|
import "./chunk-HO7RNI6V.js";
|
|
19
19
|
import "./chunk-DIAC4XYA.js";
|
|
20
20
|
import "./chunk-UU77KEL6.js";
|
|
21
21
|
import "./chunk-W7TRZLEM.js";
|
|
22
22
|
import "./chunk-P26XSDFU.js";
|
|
23
|
+
import "./chunk-VXIZ5DUA.js";
|
|
23
24
|
import "./chunk-IBPSXDUB.js";
|
|
24
25
|
import "./chunk-DUNO7WBT.js";
|
|
25
26
|
import "./chunk-G44QYJ57.js";
|
|
@@ -1,20 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deferredRunEnv
|
|
3
|
+
} from "./chunk-6MNX5ZMQ.js";
|
|
1
4
|
import {
|
|
2
5
|
printApprovedComments
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TESRDGY7.js";
|
|
4
7
|
import {
|
|
5
8
|
awaitPreviewApproval
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-C5YM3YO4.js";
|
|
10
|
+
import "./chunk-VWVLMTH2.js";
|
|
8
11
|
import {
|
|
9
12
|
readBodyArgument
|
|
10
13
|
} from "./chunk-K4T24UGW.js";
|
|
11
14
|
import "./chunk-54QTHCXV.js";
|
|
15
|
+
import {
|
|
16
|
+
requestDaemonReply
|
|
17
|
+
} from "./chunk-OFLEIPAR.js";
|
|
12
18
|
import "./chunk-2EW62DM5.js";
|
|
19
|
+
import {
|
|
20
|
+
sdkAgentEnv
|
|
21
|
+
} from "./chunk-VXIZ5DUA.js";
|
|
13
22
|
import "./chunk-ZH6HKQOY.js";
|
|
14
23
|
import "./chunk-ELF4PBZX.js";
|
|
15
24
|
|
|
16
25
|
// src/commands/ask.ts
|
|
17
26
|
import { randomUUID } from "crypto";
|
|
27
|
+
|
|
28
|
+
// src/commands/sessions/shared/deferToDaemon.ts
|
|
29
|
+
async function deferToDaemon(stdin) {
|
|
30
|
+
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
31
|
+
if (!sessionId || process.env[sdkAgentEnv] !== "1" || process.env[deferredRunEnv] === "1")
|
|
32
|
+
return false;
|
|
33
|
+
const reply = await requestDaemonReply(
|
|
34
|
+
{
|
|
35
|
+
type: "defer-command",
|
|
36
|
+
sessionId,
|
|
37
|
+
argv: process.argv.slice(2),
|
|
38
|
+
stdin,
|
|
39
|
+
cwd: process.cwd(),
|
|
40
|
+
env: process.env
|
|
41
|
+
},
|
|
42
|
+
"defer-command-result"
|
|
43
|
+
);
|
|
44
|
+
if (!reply?.accepted) return false;
|
|
45
|
+
console.log(
|
|
46
|
+
"The preview is open in the session's web preview pane. End your turn now and do nothing else: the user's decision will arrive as your next message."
|
|
47
|
+
);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/commands/ask.ts
|
|
18
52
|
async function ask(options) {
|
|
19
53
|
const body = await readBodyArgument(options.body);
|
|
20
54
|
if (body.trim().length === 0) {
|
|
@@ -26,6 +60,7 @@ async function ask(options) {
|
|
|
26
60
|
console.log(body);
|
|
27
61
|
return;
|
|
28
62
|
}
|
|
63
|
+
if (await deferToDaemon(options.body === "-" ? body : void 0)) return;
|
|
29
64
|
const decision = await awaitPreviewApproval(
|
|
30
65
|
options.title,
|
|
31
66
|
{
|
|
@@ -15,18 +15,18 @@ import {
|
|
|
15
15
|
} from "./chunk-C5U44UI7.js";
|
|
16
16
|
import {
|
|
17
17
|
awaitPreviewApproval
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-C5YM3YO4.js";
|
|
19
|
+
import "./chunk-VWVLMTH2.js";
|
|
20
20
|
import "./chunk-54QTHCXV.js";
|
|
21
21
|
import {
|
|
22
22
|
resolveRewindPlan
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-K5MYLLFM.js";
|
|
24
24
|
import {
|
|
25
25
|
buildReviewPhase
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-MSPCQ5L7.js";
|
|
27
|
+
import "./chunk-L3RJER2C.js";
|
|
28
|
+
import "./chunk-SQKNRK6D.js";
|
|
29
|
+
import "./chunk-MG4IJB47.js";
|
|
30
30
|
import {
|
|
31
31
|
getReady,
|
|
32
32
|
serializeManualChecks
|
|
@@ -49,16 +49,17 @@ import "./chunk-LMUTL44M.js";
|
|
|
49
49
|
import "./chunk-6NDXAN45.js";
|
|
50
50
|
import {
|
|
51
51
|
previewAnswerWaitBlocker
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-K5K7LATN.js";
|
|
53
53
|
import "./chunk-MELBVXKL.js";
|
|
54
54
|
import "./chunk-OGJ6AZK4.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-7M657DAU.js";
|
|
56
56
|
import "./chunk-MRUIXQXS.js";
|
|
57
57
|
import "./chunk-HO7RNI6V.js";
|
|
58
58
|
import "./chunk-DIAC4XYA.js";
|
|
59
59
|
import "./chunk-UU77KEL6.js";
|
|
60
60
|
import "./chunk-W7TRZLEM.js";
|
|
61
61
|
import "./chunk-P26XSDFU.js";
|
|
62
|
+
import "./chunk-VXIZ5DUA.js";
|
|
62
63
|
import {
|
|
63
64
|
askQuestionEnabled
|
|
64
65
|
} from "./chunk-IBPSXDUB.js";
|
|
@@ -174,7 +175,20 @@ function formatCheckDismissal(answers) {
|
|
|
174
175
|
Note: ${note}` : line;
|
|
175
176
|
}
|
|
176
177
|
|
|
177
|
-
// src/commands/askCheck/
|
|
178
|
+
// src/commands/askCheck/stepProse.ts
|
|
179
|
+
function stepProse(step) {
|
|
180
|
+
return step.replace(/`[^`]+`/g, "");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// src/commands/askCheck/unbacktickedCommands.ts
|
|
184
|
+
var commandPattern = /https?:\/\/\S+|www\.\S+|(?<=^|\s)--?[a-z][\w-]*/gi;
|
|
185
|
+
var linkTarget = /\]\([^)]*\)/g;
|
|
186
|
+
function unbacktickedCommands(step) {
|
|
187
|
+
const prose = stepProse(step).replace(linkTarget, "]");
|
|
188
|
+
return prose.match(commandPattern) ?? [];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/commands/askCheck/rejectInvalidCheck.ts
|
|
178
192
|
var MAX_TITLE = 60;
|
|
179
193
|
var MAX_STEPS = 4;
|
|
180
194
|
var MAX_STEP = 90;
|
|
@@ -191,22 +205,36 @@ function checkLimitViolations(check) {
|
|
|
191
205
|
...overLength("title", check.title, MAX_TITLE),
|
|
192
206
|
...overCount("steps", check.steps, MAX_STEPS),
|
|
193
207
|
...check.steps.flatMap(
|
|
194
|
-
(step, i) => overLength(`steps[${i + 1}]`, step, MAX_STEP)
|
|
208
|
+
(step, i) => overLength(`steps[${i + 1}]`, stepProse(step), MAX_STEP)
|
|
195
209
|
),
|
|
196
210
|
...overCount("before", check.before ?? [], MAX_BEFORE),
|
|
197
211
|
...overLength("changed", check.changed ?? "", MAX_CHANGED)
|
|
198
212
|
];
|
|
199
213
|
}
|
|
200
|
-
function
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
function commandViolations(check) {
|
|
215
|
+
return check.steps.flatMap((step, i) => {
|
|
216
|
+
const commands = unbacktickedCommands(step);
|
|
217
|
+
return commands.length > 0 ? [`- steps[${i + 1}]: ${commands.join(", ")}`] : [];
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function section(heading, violations, advice) {
|
|
221
|
+
return violations.length > 0 ? [heading, ...violations, advice] : [];
|
|
222
|
+
}
|
|
223
|
+
function rejectInvalidCheck(check) {
|
|
224
|
+
const errors = [
|
|
225
|
+
...section(
|
|
226
|
+
"Error: the check is over its limits (backticked code is not counted):",
|
|
227
|
+
checkLimitViolations(check),
|
|
207
228
|
"Shorten these fields and re-run assist ask-check."
|
|
208
|
-
|
|
209
|
-
|
|
229
|
+
),
|
|
230
|
+
...section(
|
|
231
|
+
"Error: these steps hold a command, URL or flag outside backticks:",
|
|
232
|
+
commandViolations(check),
|
|
233
|
+
"Wrap each whole command in backticks (`like this`) so the user can copy it, and re-run assist ask-check."
|
|
234
|
+
)
|
|
235
|
+
];
|
|
236
|
+
if (errors.length === 0) return;
|
|
237
|
+
console.error(errors.join("\n"));
|
|
210
238
|
process.exit(1);
|
|
211
239
|
}
|
|
212
240
|
|
|
@@ -265,7 +293,7 @@ async function askCheck(options) {
|
|
|
265
293
|
askCheckInputSchema,
|
|
266
294
|
"manual check"
|
|
267
295
|
);
|
|
268
|
-
|
|
296
|
+
rejectInvalidCheck(check);
|
|
269
297
|
const sessionId = await requireCheckSession();
|
|
270
298
|
const bump = await resolveCheckBump(options.check);
|
|
271
299
|
const decision = await awaitPreviewApproval(
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printApprovedComments
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TESRDGY7.js";
|
|
4
4
|
import {
|
|
5
5
|
isLiveDaemonSession
|
|
6
6
|
} from "./chunk-C5U44UI7.js";
|
|
7
7
|
import {
|
|
8
8
|
awaitPreviewApproval
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-C5YM3YO4.js";
|
|
10
|
+
import "./chunk-VWVLMTH2.js";
|
|
11
11
|
import {
|
|
12
12
|
readBodyArgument
|
|
13
13
|
} from "./chunk-K4T24UGW.js";
|
|
@@ -21,13 +21,14 @@ import {
|
|
|
21
21
|
import "./chunk-OGJ6AZK4.js";
|
|
22
22
|
import {
|
|
23
23
|
harnessAdapter
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7M657DAU.js";
|
|
25
25
|
import "./chunk-MRUIXQXS.js";
|
|
26
26
|
import "./chunk-HO7RNI6V.js";
|
|
27
27
|
import "./chunk-DIAC4XYA.js";
|
|
28
28
|
import "./chunk-UU77KEL6.js";
|
|
29
29
|
import "./chunk-W7TRZLEM.js";
|
|
30
30
|
import "./chunk-P26XSDFU.js";
|
|
31
|
+
import "./chunk-VXIZ5DUA.js";
|
|
31
32
|
import "./chunk-DUNO7WBT.js";
|
|
32
33
|
import {
|
|
33
34
|
activeHarness
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
} from "./chunk-C5U44UI7.js";
|
|
10
10
|
import {
|
|
11
11
|
awaitPreviewApproval
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-C5YM3YO4.js";
|
|
13
|
+
import "./chunk-VWVLMTH2.js";
|
|
14
14
|
import "./chunk-54QTHCXV.js";
|
|
15
15
|
import "./chunk-OFLEIPAR.js";
|
|
16
16
|
import "./chunk-2EW62DM5.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createBranch,
|
|
3
3
|
generateBranchSlug,
|
|
4
4
|
isConciseSlug
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-MOQ2IEPI.js";
|
|
6
|
+
import "./chunk-VEMNENJ2.js";
|
|
7
7
|
import "./chunk-OZNYQOQK.js";
|
|
8
8
|
import "./chunk-ORSRBZ2X.js";
|
|
9
9
|
import "./chunk-PCF66ALO.js";
|
|
@@ -18,13 +18,14 @@ import "./chunk-LMUTL44M.js";
|
|
|
18
18
|
import "./chunk-6NDXAN45.js";
|
|
19
19
|
import "./chunk-MELBVXKL.js";
|
|
20
20
|
import "./chunk-OGJ6AZK4.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-7M657DAU.js";
|
|
22
22
|
import "./chunk-MRUIXQXS.js";
|
|
23
23
|
import "./chunk-HO7RNI6V.js";
|
|
24
24
|
import "./chunk-DIAC4XYA.js";
|
|
25
25
|
import "./chunk-UU77KEL6.js";
|
|
26
26
|
import "./chunk-W7TRZLEM.js";
|
|
27
27
|
import "./chunk-P26XSDFU.js";
|
|
28
|
+
import "./chunk-VXIZ5DUA.js";
|
|
28
29
|
import "./chunk-DUNO7WBT.js";
|
|
29
30
|
import "./chunk-D7UZLH36.js";
|
|
30
31
|
import "./chunk-EW2ZM2PC.js";
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.1160.0
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isApprovedRead,
|
|
14
14
|
resolvePermission,
|
|
15
15
|
splitCompound
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L4PVKBXS.js";
|
|
17
17
|
import {
|
|
18
18
|
DOCS_LOCK_REASON,
|
|
19
19
|
SCHEMA_LOCK_REASON,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isSchemaPath,
|
|
24
24
|
isSchemaRelativePath,
|
|
25
25
|
mentionsDocsPath
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5THMDW42.js";
|
|
27
27
|
import {
|
|
28
28
|
isLiveDaemonSession
|
|
29
29
|
} from "./chunk-C5U44UI7.js";
|
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-P7FVAGFQ.js";
|
|
4
4
|
import {
|
|
5
5
|
previewAnswerWaitBlocker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K5K7LATN.js";
|
|
7
|
+
import {
|
|
8
|
+
sdkAgentEnv
|
|
9
|
+
} from "./chunk-VXIZ5DUA.js";
|
|
7
10
|
import {
|
|
8
11
|
askQuestionEnabled
|
|
9
12
|
} from "./chunk-IBPSXDUB.js";
|
|
@@ -21,10 +24,17 @@ function adviceContextFor(cwd, env = process.env) {
|
|
|
21
24
|
config: loadConfigFrom(cwd),
|
|
22
25
|
rootDir: findConfigUp(cwd)?.rootDir ?? cwd,
|
|
23
26
|
assistSession: env.ASSIST_SESSION === "1",
|
|
24
|
-
previewAnswerWait: previewAnswerWaitBlocker() === void 0
|
|
27
|
+
previewAnswerWait: previewAnswerWaitBlocker() === void 0,
|
|
28
|
+
sdkSession: env[sdkAgentEnv] === "1"
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
|
|
32
|
+
// src/commands/advise/previewWaitAdvice.ts
|
|
33
|
+
var previewWaitAdvice = {
|
|
34
|
+
previewWait: ({ sdkSession }) => sdkSession ? "in the foreground. It returns at once; then end your turn and do nothing else \u2014 when the user decides, the command's output and exit code arrive as your next message" : "as a background task, doing no other work until it returns. It blocks until the user decides",
|
|
35
|
+
previewRevise: ({ sdkSession }) => sdkSession ? "To revise a still-pending preview, re-run it; the earlier one is superseded and delivers nothing." : "To revise a still-pending preview, re-run it directly without stopping the earlier task; that task then exits 0 as superseded \u2014 ignore its result."
|
|
36
|
+
};
|
|
37
|
+
|
|
28
38
|
// src/commands/advise/verifyRunCommandNames.ts
|
|
29
39
|
function verifyRunCommandNames({
|
|
30
40
|
config,
|
|
@@ -35,6 +45,7 @@ function verifyRunCommandNames({
|
|
|
35
45
|
|
|
36
46
|
// src/commands/advise/renderAdviceBody.ts
|
|
37
47
|
var adviceVariables = {
|
|
48
|
+
...previewWaitAdvice,
|
|
38
49
|
verifyCommands: (context) => verifyRunCommandNames(context).map((name) => `\`${name}\``).join(", ")
|
|
39
50
|
};
|
|
40
51
|
var adviceOverrides = {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveLinkTarget,
|
|
12
12
|
usageWindowKey,
|
|
13
13
|
watcherLogPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YHZUTP5K.js";
|
|
15
15
|
import {
|
|
16
16
|
readLogTail
|
|
17
17
|
} from "./chunk-JNCFHWBK.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-3NPVVAAT.js";
|
|
27
27
|
import {
|
|
28
28
|
firstBrokenHop
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JR3LZHBZ.js";
|
|
30
30
|
import {
|
|
31
31
|
TRACE_HEADER,
|
|
32
32
|
newTraceId
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
ASSIST_VERSION,
|
|
36
36
|
PROTOCOL_VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-LO4K3OUQ.js";
|
|
38
38
|
import {
|
|
39
39
|
queryNodes
|
|
40
40
|
} from "./chunk-OD7CMDGZ.js";
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
} from "./chunk-UJBW7FVI.js";
|
|
80
80
|
import {
|
|
81
81
|
targetConversationEvents
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-S55TRXFP.js";
|
|
83
83
|
import {
|
|
84
84
|
configEntryLayers,
|
|
85
85
|
ghFailure,
|
|
@@ -228,7 +228,7 @@ import {
|
|
|
228
228
|
} from "./chunk-AOTNNZPH.js";
|
|
229
229
|
import {
|
|
230
230
|
rewindItemToPhase
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-SUO2246Y.js";
|
|
232
232
|
import {
|
|
233
233
|
loadBacklogSummaries,
|
|
234
234
|
searchBacklogSummaries
|
|
@@ -255,7 +255,7 @@ import {
|
|
|
255
255
|
} from "./chunk-IZBQH3LW.js";
|
|
256
256
|
import {
|
|
257
257
|
resolveRewindPlan
|
|
258
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-K5MYLLFM.js";
|
|
259
259
|
import {
|
|
260
260
|
deleteItem,
|
|
261
261
|
getOrigin,
|
|
@@ -304,7 +304,7 @@ import {
|
|
|
304
304
|
discoverSessionJsonlPaths,
|
|
305
305
|
harnessAdapter,
|
|
306
306
|
parseSessionFile
|
|
307
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-7M657DAU.js";
|
|
308
308
|
import {
|
|
309
309
|
harnessLabel
|
|
310
310
|
} from "./chunk-DUNO7WBT.js";
|
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
MANAGED_BLOCK_END,
|
|
21
21
|
assistCodexHookKeys
|
|
22
22
|
} from "./chunk-P26XSDFU.js";
|
|
23
|
+
import {
|
|
24
|
+
sdkAgentEnv
|
|
25
|
+
} from "./chunk-VXIZ5DUA.js";
|
|
23
26
|
import {
|
|
24
27
|
harnessLabel,
|
|
25
28
|
resolveHarness
|
|
@@ -745,6 +748,14 @@ function lastDecisiveIndex(events) {
|
|
|
745
748
|
return -1;
|
|
746
749
|
}
|
|
747
750
|
|
|
751
|
+
// src/commands/sessions/shared/parseRestartNudge.ts
|
|
752
|
+
var RESTART_NUDGE = /^\s*<assist-restart killed="(\d+)">[\s\S]*<\/assist-restart>\s*$/;
|
|
753
|
+
function parseRestartNudge(text) {
|
|
754
|
+
if (typeof text !== "string") return null;
|
|
755
|
+
const match = RESTART_NUDGE.exec(text);
|
|
756
|
+
return match ? Number(match[1]) : null;
|
|
757
|
+
}
|
|
758
|
+
|
|
748
759
|
// src/commands/sessions/shared/normalizeUser.ts
|
|
749
760
|
var INTERRUPT_PREFIX = "[Request interrupted";
|
|
750
761
|
var TASK_NOTIFICATION = "<task-notification>";
|
|
@@ -777,6 +788,8 @@ function asRecord2(value) {
|
|
|
777
788
|
}
|
|
778
789
|
function normalizeUserText(text) {
|
|
779
790
|
if (isInterruptText(text)) return { kind: "interrupt" };
|
|
791
|
+
const killed = parseRestartNudge(text);
|
|
792
|
+
if (killed !== null) return { kind: "restart", killed };
|
|
780
793
|
if (typeof text === "string" && text.trimStart().startsWith(TASK_NOTIFICATION))
|
|
781
794
|
return { kind: "taskNotification" };
|
|
782
795
|
return { kind: "user" };
|
|
@@ -855,7 +868,7 @@ function deriveTranscriptStatus(entries, opts2 = {}) {
|
|
|
855
868
|
if (lastIdx === -1) return null;
|
|
856
869
|
const ev = events[lastIdx];
|
|
857
870
|
if (ev.kind === "interrupt") return "waiting";
|
|
858
|
-
if (ev.kind === "user") return "running";
|
|
871
|
+
if (ev.kind === "user" || ev.kind === "restart") return "running";
|
|
859
872
|
if (ev.kind === "toolResult" || ev.kind === "taskNotification") return null;
|
|
860
873
|
if (ev.stopReason != null && TURN_END_STOP_REASONS.has(ev.stopReason))
|
|
861
874
|
return "waiting";
|
|
@@ -904,7 +917,7 @@ function renderUserPrompt(entry, maxLength = MAX_LENGTH) {
|
|
|
904
917
|
if (entry.isSidechain || entry.isMeta) return void 0;
|
|
905
918
|
if (entry.type !== "user" || isTaskNotification(entry)) return void 0;
|
|
906
919
|
const raw = promptTextOrNull(entry);
|
|
907
|
-
if (raw === null) return void 0;
|
|
920
|
+
if (raw === null || parseRestartNudge(raw) !== null) return void 0;
|
|
908
921
|
const message2 = renderPrompt(raw);
|
|
909
922
|
return message2 ? cap(message2, maxLength) : void 0;
|
|
910
923
|
}
|
|
@@ -1048,8 +1061,12 @@ function userEvents(entry, at) {
|
|
|
1048
1061
|
const events = [];
|
|
1049
1062
|
const text = renderUserPrompt(entry, Number.POSITIVE_INFINITY);
|
|
1050
1063
|
if (text) events.push({ kind: "message", role: "user", text, at });
|
|
1051
|
-
else
|
|
1052
|
-
|
|
1064
|
+
else {
|
|
1065
|
+
const normalized = normalizeUser(entry);
|
|
1066
|
+
if (normalized.kind === "interrupt") events.push({ kind: "interrupt", at });
|
|
1067
|
+
if (normalized.kind === "restart")
|
|
1068
|
+
events.push({ kind: "restart", killed: normalized.killed, at });
|
|
1069
|
+
}
|
|
1053
1070
|
for (const block of claudeContentBlocksOf(contentOf(entry))) {
|
|
1054
1071
|
if (block.type !== "tool_result" || block.is_error) continue;
|
|
1055
1072
|
const body = resultText(block.content).trim();
|
|
@@ -3432,6 +3449,11 @@ function sdkSessionHandle(label) {
|
|
|
3432
3449
|
onEvent: (listener) => listeners.push(listener),
|
|
3433
3450
|
send: (text) => turn ? turn.send(text) : unbound("message"),
|
|
3434
3451
|
interrupt: () => turn ? turn.interrupt() : unbound("interrupt"),
|
|
3452
|
+
dequeue: (index, text) => {
|
|
3453
|
+
if (turn) return turn.dequeue(index, text);
|
|
3454
|
+
unbound("dequeue");
|
|
3455
|
+
return false;
|
|
3456
|
+
},
|
|
3435
3457
|
stopTask: (taskId) => turn ? turn.stopTask(taskId) : Promise.reject(new Error("query not started"))
|
|
3436
3458
|
};
|
|
3437
3459
|
return {
|
|
@@ -3530,6 +3552,19 @@ function createSdkMessageQueue(label, control, push) {
|
|
|
3530
3552
|
`${label} sdk message queued behind running turn (${queued.length} queued): ${quoteForLog(text)}`
|
|
3531
3553
|
);
|
|
3532
3554
|
},
|
|
3555
|
+
remove: (index, text) => {
|
|
3556
|
+
if (queued[index] !== text) {
|
|
3557
|
+
daemonLog(
|
|
3558
|
+
`${label} sdk dequeue ignored: no queued message ${index} matching ${quoteForLog(text)} (${queued.length} queued; already sent or changed)`
|
|
3559
|
+
);
|
|
3560
|
+
return false;
|
|
3561
|
+
}
|
|
3562
|
+
publish(queued.filter((_, i) => i !== index));
|
|
3563
|
+
daemonLog(
|
|
3564
|
+
`${label} sdk queued message ${index} removed (${queued.length} queued): ${quoteForLog(text)}`
|
|
3565
|
+
);
|
|
3566
|
+
return true;
|
|
3567
|
+
},
|
|
3533
3568
|
flush: () => {
|
|
3534
3569
|
if (!queued.length) return false;
|
|
3535
3570
|
daemonLog(`${label} sdk sending ${queued.length} queued message(s)`);
|
|
@@ -3840,6 +3875,7 @@ function createSdkTurnTracker(label, control, push) {
|
|
|
3840
3875
|
control.emit({ kind: "pending", texts: [text] });
|
|
3841
3876
|
setStatus("running");
|
|
3842
3877
|
},
|
|
3878
|
+
dequeue: queue.remove,
|
|
3843
3879
|
interrupt: (request) => interrupt.request(busy, request)
|
|
3844
3880
|
};
|
|
3845
3881
|
}
|
|
@@ -4063,7 +4099,8 @@ function workflowQueryEnv(base, sessionId, launcherEnv2) {
|
|
|
4063
4099
|
const env = {
|
|
4064
4100
|
...sessionChildEnv(base, sessionId),
|
|
4065
4101
|
// why: claude turns the Artifact tool off for SDK-driven runs unless this opts back in
|
|
4066
|
-
CLAUDE_CODE_ARTIFACT: base.CLAUDE_CODE_ARTIFACT ?? "1"
|
|
4102
|
+
CLAUDE_CODE_ARTIFACT: base.CLAUDE_CODE_ARTIFACT ?? "1",
|
|
4103
|
+
[sdkAgentEnv]: "1"
|
|
4067
4104
|
};
|
|
4068
4105
|
if (!launcherEnv2) return env;
|
|
4069
4106
|
const { ASSIST_ACTIVITY_ID: _activityId, ...rest } = env;
|
|
@@ -4148,6 +4185,7 @@ async function startSdkQuery(opts2, abort, control, turn, prompt) {
|
|
|
4148
4185
|
if (opts2.resumeId) awaitResume(label, messages, control);
|
|
4149
4186
|
control.bind({
|
|
4150
4187
|
send: turn.send,
|
|
4188
|
+
dequeue: turn.dequeue,
|
|
4151
4189
|
interrupt: () => turn.interrupt(async () => {
|
|
4152
4190
|
await messages.interrupt();
|
|
4153
4191
|
}),
|
|
@@ -4185,6 +4223,7 @@ import { createInterface as createInterface2 } from "readline";
|
|
|
4185
4223
|
// src/shared/harnessAdapters/launcherEnv.ts
|
|
4186
4224
|
var OWNED_BY_DAEMON = /* @__PURE__ */ new Set([
|
|
4187
4225
|
"ASSIST_ACTIVITY_ID",
|
|
4226
|
+
"ASSIST_SDK_AGENT",
|
|
4188
4227
|
"ASSIST_SDK_SESSION",
|
|
4189
4228
|
"ASSIST_SESSION",
|
|
4190
4229
|
"ASSIST_SESSION_ID"
|
|
@@ -4323,6 +4362,7 @@ export {
|
|
|
4323
4362
|
withoutResumeSession,
|
|
4324
4363
|
readTranscriptTail,
|
|
4325
4364
|
readTranscriptTailSync,
|
|
4365
|
+
parseRestartNudge,
|
|
4326
4366
|
emptyScanUsage,
|
|
4327
4367
|
scanUsageTokens,
|
|
4328
4368
|
reviewerLabel,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-WQF27PEJ.js";
|
|
4
4
|
import {
|
|
5
5
|
resumeNudge
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7NZOH4LN.js";
|
|
7
7
|
import {
|
|
8
8
|
HARNESS_SPAWN_FAILED,
|
|
9
9
|
awaitHarness
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-NWNODYLQ.js";
|
|
20
20
|
import {
|
|
21
21
|
harnessAdapter
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7M657DAU.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/launchPrSkill.ts
|
|
25
25
|
import chalk from "chalk";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
supersededPreviewMessage,
|
|
2
3
|
toAttachments
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VWVLMTH2.js";
|
|
4
5
|
import {
|
|
5
6
|
readSocketLines
|
|
6
7
|
} from "./chunk-2EW62DM5.js";
|
|
@@ -213,9 +214,7 @@ async function awaitPreviewApproval(subject, request, options = {}) {
|
|
|
213
214
|
exitNoPreview(error);
|
|
214
215
|
}
|
|
215
216
|
if (outcome === "superseded") {
|
|
216
|
-
console.log(
|
|
217
|
-
"Superseded by a newer preview \u2014 no decision; ignore this result."
|
|
218
|
-
);
|
|
217
|
+
console.log(supersededPreviewMessage);
|
|
219
218
|
process.exit(0);
|
|
220
219
|
}
|
|
221
220
|
if (outcome.body !== void 0) options.saveEditedBody?.(outcome.body);
|