@dosu/cli 0.37.0-alpha.5 → 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/README.md +1 -1
- package/bin/dosu.js +15 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ Or right-click the binary, select "Open", and click "Open" in the dialog.
|
|
|
92
92
|
| `dosu setup` | Run the setup wizard (auth → deployment → detect tools → configure) |
|
|
93
93
|
| `dosu login` | Authenticate with Dosu via browser OAuth |
|
|
94
94
|
| `dosu logout` | Clear saved credentials |
|
|
95
|
-
| `dosu status
|
|
95
|
+
| `dosu status` | Show current authentication and MCP status |
|
|
96
96
|
| `dosu mcp list` | List supported AI tools |
|
|
97
97
|
| `dosu mcp add <tool>` | Add the Dosu MCP server to a specific tool |
|
|
98
98
|
| `dosu logs` | View or manage debug logs (`--tail`, `--clear`) |
|
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 {
|
|
@@ -13632,7 +13632,7 @@ async function runAgentSetup(opts) {
|
|
|
13632
13632
|
}
|
|
13633
13633
|
emitStep({
|
|
13634
13634
|
step: "done",
|
|
13635
|
-
agent_next_steps: `Dosu is configured for ${provider.name()}. Tell the user setup is complete and they can ask their agent a Dosu question. Run 'dosu status
|
|
13635
|
+
agent_next_steps: `Dosu is configured for ${provider.name()}. Tell the user setup is complete and they can ask their agent a Dosu question. Run 'dosu status' to verify.`
|
|
13636
13636
|
});
|
|
13637
13637
|
return 0;
|
|
13638
13638
|
}
|
|
@@ -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()
|
|
@@ -16921,45 +16929,14 @@ Run 'dosu --help' to see available commands.`;
|
|
|
16921
16929
|
saveConfig(cfg);
|
|
16922
16930
|
console.log("Successfully logged out.");
|
|
16923
16931
|
});
|
|
16924
|
-
program2.command("status").description("Show current authentication and MCP status").
|
|
16932
|
+
program2.command("status").description("Show current authentication and MCP status").action(async () => {
|
|
16925
16933
|
const cfg = loadConfig();
|
|
16926
|
-
const mode = cfg.mode === MODE_OSS ? "oss" : "cloud";
|
|
16927
16934
|
if (!isAuthenticated(cfg)) {
|
|
16928
|
-
if (opts.json) {
|
|
16929
|
-
console.log(JSON.stringify({
|
|
16930
|
-
authenticated: false,
|
|
16931
|
-
session_status: "missing",
|
|
16932
|
-
mode,
|
|
16933
|
-
mcp: {
|
|
16934
|
-
status: "not_configured",
|
|
16935
|
-
deployment_id: null,
|
|
16936
|
-
deployment_name: null
|
|
16937
|
-
}
|
|
16938
|
-
}, null, 2));
|
|
16939
|
-
return;
|
|
16940
|
-
}
|
|
16941
16935
|
console.log("Status: Not logged in");
|
|
16942
16936
|
console.log("Run 'dosu login' to authenticate.");
|
|
16943
16937
|
return;
|
|
16944
16938
|
}
|
|
16945
|
-
|
|
16946
|
-
if (opts.json) {
|
|
16947
|
-
const deploymentId = cfg.active_account.target?.deployment_id ?? null;
|
|
16948
|
-
const deploymentName = cfg.active_account.target?.deployment_name ?? null;
|
|
16949
|
-
const mcpStatus = cfg.mode === MODE_OSS ? "public_libraries" : deploymentId ? "configured" : "not_configured";
|
|
16950
|
-
console.log(JSON.stringify({
|
|
16951
|
-
authenticated: sessionStatus === "valid",
|
|
16952
|
-
session_status: sessionStatus,
|
|
16953
|
-
mode,
|
|
16954
|
-
mcp: {
|
|
16955
|
-
status: mcpStatus,
|
|
16956
|
-
deployment_id: deploymentId,
|
|
16957
|
-
deployment_name: deploymentName
|
|
16958
|
-
}
|
|
16959
|
-
}, null, 2));
|
|
16960
|
-
return;
|
|
16961
|
-
}
|
|
16962
|
-
if (sessionStatus === "expired") {
|
|
16939
|
+
if (isTokenExpired(cfg) && !await ensureFreshSession(cfg)) {
|
|
16963
16940
|
console.log("Status: Token expired");
|
|
16964
16941
|
console.log("Run 'dosu login' to re-authenticate.");
|
|
16965
16942
|
} else {
|