@dosu/cli 0.37.0 → 0.37.1
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/bin/dosu.js +12 -4
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4759,7 +4759,7 @@ var init_dist4 = __esm(() => {
|
|
|
4759
4759
|
function getVersionString() {
|
|
4760
4760
|
return `v${VERSION}`;
|
|
4761
4761
|
}
|
|
4762
|
-
var VERSION = "0.37.
|
|
4762
|
+
var VERSION = "0.37.1", INSTALL_CHANNEL = "npm";
|
|
4763
4763
|
|
|
4764
4764
|
// src/debug/logger.ts
|
|
4765
4765
|
import {
|
|
@@ -15066,6 +15066,11 @@ function saveState(state) {
|
|
|
15066
15066
|
writeFileSync5(file, JSON.stringify(state, null, 2), { mode: 384 });
|
|
15067
15067
|
} catch {}
|
|
15068
15068
|
}
|
|
15069
|
+
function clearState(sessionId) {
|
|
15070
|
+
try {
|
|
15071
|
+
rmSync2(stateFile(sessionId), { force: true });
|
|
15072
|
+
} catch {}
|
|
15073
|
+
}
|
|
15069
15074
|
|
|
15070
15075
|
// src/commands/hooks.ts
|
|
15071
15076
|
var COOLDOWN_DEFAULT_MS = 3000;
|
|
@@ -15117,11 +15122,14 @@ async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGEN
|
|
|
15117
15122
|
logger.debug("hooks", "submit skipped reason=own-stop-envelope");
|
|
15118
15123
|
return;
|
|
15119
15124
|
}
|
|
15125
|
+
const turnId = input.turn_id ?? String(now);
|
|
15120
15126
|
const existing = loadState(sessionId);
|
|
15121
|
-
if (existing && existing.status === "pending" && now <= existing.expiresAt) {
|
|
15127
|
+
if (existing && existing.status === "pending" && now <= existing.expiresAt && input.turn_id !== undefined && existing.turnId === turnId) {
|
|
15122
15128
|
logger.debug("hooks", `submit sid=${sid8(sessionId)} reuse tid=${existing.ticketId}`);
|
|
15123
15129
|
return;
|
|
15124
15130
|
}
|
|
15131
|
+
if (existing)
|
|
15132
|
+
clearState(sessionId);
|
|
15125
15133
|
const cfg = loadConfig();
|
|
15126
15134
|
if (!cfg.active_account?.target?.api_key || !cfg.active_account?.target?.deployment_id) {
|
|
15127
15135
|
logger.debug("hooks", "submit skipped reason=not-configured");
|
|
@@ -15135,7 +15143,7 @@ async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGEN
|
|
|
15135
15143
|
deployment_id: cfg.active_account?.target?.deployment_id,
|
|
15136
15144
|
agent,
|
|
15137
15145
|
session_id: sessionId,
|
|
15138
|
-
turn_id:
|
|
15146
|
+
turn_id: turnId,
|
|
15139
15147
|
prompt,
|
|
15140
15148
|
repo: repoSlug(input.cwd)
|
|
15141
15149
|
});
|
|
@@ -15146,7 +15154,7 @@ async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGEN
|
|
|
15146
15154
|
saveState({
|
|
15147
15155
|
ticketId: resp.ticket_id,
|
|
15148
15156
|
sessionId,
|
|
15149
|
-
turnId
|
|
15157
|
+
turnId,
|
|
15150
15158
|
status: "pending",
|
|
15151
15159
|
createdAt: now,
|
|
15152
15160
|
expiresAt: now + ttlMs()
|