@dosu/cli 0.38.0 → 0.39.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/bin/dosu.js +26 -2
- 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.
|
|
4762
|
+
var VERSION = "0.39.0", INSTALL_CHANNEL = "npm";
|
|
4763
4763
|
|
|
4764
4764
|
// src/debug/logger.ts
|
|
4765
4765
|
import {
|
|
@@ -15033,6 +15033,7 @@ init_commander();
|
|
|
15033
15033
|
init_config();
|
|
15034
15034
|
init_logger();
|
|
15035
15035
|
init_prompts();
|
|
15036
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
15036
15037
|
import { existsSync as existsSync11, readFileSync as readFileSync11 } from "node:fs";
|
|
15037
15038
|
import { basename } from "node:path";
|
|
15038
15039
|
|
|
@@ -15111,6 +15112,27 @@ function errMsg(err) {
|
|
|
15111
15112
|
function repoSlug(cwd) {
|
|
15112
15113
|
return cwd ? basename(cwd) : undefined;
|
|
15113
15114
|
}
|
|
15115
|
+
function gitContext(cwd) {
|
|
15116
|
+
if (!cwd)
|
|
15117
|
+
return {};
|
|
15118
|
+
const run2 = (args) => {
|
|
15119
|
+
try {
|
|
15120
|
+
const out = execFileSync2("git", args, {
|
|
15121
|
+
cwd,
|
|
15122
|
+
timeout: 1500,
|
|
15123
|
+
encoding: "utf8",
|
|
15124
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
15125
|
+
});
|
|
15126
|
+
return out.toString().trim() || undefined;
|
|
15127
|
+
} catch {
|
|
15128
|
+
return;
|
|
15129
|
+
}
|
|
15130
|
+
};
|
|
15131
|
+
const repo = run2(["remote", "get-url", "origin"]);
|
|
15132
|
+
if (!repo)
|
|
15133
|
+
return {};
|
|
15134
|
+
return { repo, branch: run2(["branch", "--show-current"]) };
|
|
15135
|
+
}
|
|
15114
15136
|
async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGENT) {
|
|
15115
15137
|
const sessionId = input.session_id;
|
|
15116
15138
|
if (!sessionId)
|
|
@@ -15135,6 +15157,7 @@ async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGEN
|
|
|
15135
15157
|
logger.debug("hooks", "submit skipped reason=not-configured");
|
|
15136
15158
|
return;
|
|
15137
15159
|
}
|
|
15160
|
+
const git = gitContext(input.cwd);
|
|
15138
15161
|
const tc = await Promise.resolve().then(() => (init_ticket_client(), exports_ticket_client));
|
|
15139
15162
|
const startedAt = Date.now();
|
|
15140
15163
|
let resp;
|
|
@@ -15145,7 +15168,8 @@ async function runUserPromptSubmit(input, now = Date.now(), agent = DEFAULT_AGEN
|
|
|
15145
15168
|
session_id: sessionId,
|
|
15146
15169
|
turn_id: turnId,
|
|
15147
15170
|
prompt,
|
|
15148
|
-
repo: repoSlug(input.cwd)
|
|
15171
|
+
repo: git.repo ?? repoSlug(input.cwd),
|
|
15172
|
+
branch: git.branch
|
|
15149
15173
|
});
|
|
15150
15174
|
} catch (err) {
|
|
15151
15175
|
logger.warn("hooks", `error event=user-prompt-submit reason=${errMsg(err)}`);
|