@devboxer/cli 0.2.0 → 0.3.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/dist/index.js +54 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -153,5 +153,5 @@ The MCP server acts as a bridge between Claude Code and DevBoxer, allowing you t
|
|
|
153
153
|
|
|
154
154
|
## Support
|
|
155
155
|
|
|
156
|
-
- **Documentation**: [https://
|
|
156
|
+
- **Documentation**: [https://www.devboxer.com/docs](https://www.devboxer.com/docs)
|
|
157
157
|
- **Website**: [https://devboxer.com](https://devboxer.com)
|
package/dist/index.js
CHANGED
|
@@ -524,7 +524,7 @@ async function saveSessionData(sessionId, cwdWithHyphens, jsonl) {
|
|
|
524
524
|
await fs2.writeFile(jsonlPath, jsonlContent);
|
|
525
525
|
return jsonlPath;
|
|
526
526
|
}
|
|
527
|
-
async function processSessionData(data, setProcessingStatus, onComplete) {
|
|
527
|
+
async function processSessionData(data, setProcessingStatus, onComplete, sessionOnly) {
|
|
528
528
|
try {
|
|
529
529
|
setProcessingStatus("Finding git repository root...");
|
|
530
530
|
const { gitRoot, error: gitError } = await findGitRoot();
|
|
@@ -533,7 +533,7 @@ async function processSessionData(data, setProcessingStatus, onComplete) {
|
|
|
533
533
|
}
|
|
534
534
|
process.chdir(gitRoot);
|
|
535
535
|
setProcessingStatus(`Changed to git root: ${gitRoot}`);
|
|
536
|
-
if (data.branchName) {
|
|
536
|
+
if (data.branchName && !sessionOnly) {
|
|
537
537
|
setProcessingStatus(
|
|
538
538
|
`Pulling latest version of branch: ${data.branchName}`
|
|
539
539
|
);
|
|
@@ -541,22 +541,37 @@ async function processSessionData(data, setProcessingStatus, onComplete) {
|
|
|
541
541
|
data.branchName
|
|
542
542
|
);
|
|
543
543
|
if (!success) {
|
|
544
|
-
|
|
544
|
+
if (!data.hasChanges) {
|
|
545
|
+
setProcessingStatus(
|
|
546
|
+
`\u2139 This is a plan-only session with no code changes`
|
|
547
|
+
);
|
|
548
|
+
setProcessingStatus(
|
|
549
|
+
` Pulling conversation history only (skipping git checkout)`
|
|
550
|
+
);
|
|
551
|
+
} else {
|
|
552
|
+
return { success: false, error: branchError };
|
|
553
|
+
}
|
|
554
|
+
} else {
|
|
555
|
+
setProcessingStatus(
|
|
556
|
+
`Successfully switched to branch: ${data.branchName}`
|
|
557
|
+
);
|
|
545
558
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
);
|
|
559
|
+
} else if (sessionOnly && data.branchName) {
|
|
560
|
+
setProcessingStatus(`Skipping git operations (--session-only mode)`);
|
|
549
561
|
}
|
|
550
562
|
const cwd = process.cwd();
|
|
551
563
|
const cwdWithHyphens = cwd.replace(/\//g, "-");
|
|
552
564
|
setProcessingStatus(`Project directory: ${cwdWithHyphens}`);
|
|
553
|
-
|
|
565
|
+
const hasJsonl = !!(data.jsonl && data.jsonl.length > 0);
|
|
566
|
+
if (hasJsonl) {
|
|
554
567
|
const jsonlPath = await saveSessionData(
|
|
555
568
|
data.sessionId,
|
|
556
569
|
cwdWithHyphens,
|
|
557
570
|
data.jsonl
|
|
558
571
|
);
|
|
559
572
|
setProcessingStatus(`Saved session data to: ${jsonlPath}`);
|
|
573
|
+
} else {
|
|
574
|
+
setProcessingStatus(`No conversation history available for this session`);
|
|
560
575
|
}
|
|
561
576
|
setProcessingStatus(`Session ready: ${data.sessionId}`);
|
|
562
577
|
setTimeout(() => {
|
|
@@ -566,7 +581,8 @@ async function processSessionData(data, setProcessingStatus, onComplete) {
|
|
|
566
581
|
success: true,
|
|
567
582
|
gitRoot,
|
|
568
583
|
cwdWithHyphens,
|
|
569
|
-
sessionId: data.sessionId
|
|
584
|
+
sessionId: data.sessionId,
|
|
585
|
+
hasJsonl
|
|
570
586
|
};
|
|
571
587
|
} catch (err) {
|
|
572
588
|
return {
|
|
@@ -577,7 +593,8 @@ async function processSessionData(data, setProcessingStatus, onComplete) {
|
|
|
577
593
|
}
|
|
578
594
|
function PullCommand({
|
|
579
595
|
threadId,
|
|
580
|
-
resume
|
|
596
|
+
resume,
|
|
597
|
+
sessionOnly
|
|
581
598
|
}) {
|
|
582
599
|
const [selectedThreadId, setSelectedThreadId] = useState3(
|
|
583
600
|
threadId
|
|
@@ -588,6 +605,7 @@ function PullCommand({
|
|
|
588
605
|
const [completedSessionId, setCompletedSessionId] = useState3(
|
|
589
606
|
null
|
|
590
607
|
);
|
|
608
|
+
const [jsonlAvailable, setJsonlAvailable] = useState3(true);
|
|
591
609
|
const repoQuery = useCurrentGitHubRepo();
|
|
592
610
|
const currentRepo = repoQuery.data;
|
|
593
611
|
const {
|
|
@@ -605,20 +623,23 @@ function PullCommand({
|
|
|
605
623
|
(sessionId) => {
|
|
606
624
|
setCompletedSessionId(sessionId);
|
|
607
625
|
setIsProcessing(false);
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
launchClaude(sessionId);
|
|
611
|
-
}, 100);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
626
|
+
},
|
|
627
|
+
sessionOnly
|
|
614
628
|
);
|
|
615
|
-
if (
|
|
629
|
+
if (result.success) {
|
|
630
|
+
setJsonlAvailable(!!result.hasJsonl);
|
|
631
|
+
if (resume && result.hasJsonl && result.sessionId) {
|
|
632
|
+
setTimeout(() => {
|
|
633
|
+
launchClaude(result.sessionId);
|
|
634
|
+
}, 1100);
|
|
635
|
+
}
|
|
636
|
+
} else {
|
|
616
637
|
setProcessingError(result.error || "Unknown error during processing");
|
|
617
638
|
setIsProcessing(false);
|
|
618
639
|
}
|
|
619
640
|
};
|
|
620
641
|
process2();
|
|
621
|
-
}, [sessionData, resume]);
|
|
642
|
+
}, [sessionData, resume, sessionOnly]);
|
|
622
643
|
const handleThreadSelect = (threadId2) => {
|
|
623
644
|
setSelectedThreadId(threadId2);
|
|
624
645
|
};
|
|
@@ -634,7 +655,7 @@ function PullCommand({
|
|
|
634
655
|
if (sessionFetchError) {
|
|
635
656
|
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Error:", " ", sessionFetchError instanceof Error ? sessionFetchError.message : String(sessionFetchError)));
|
|
636
657
|
}
|
|
637
|
-
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Box3, null, isLoading ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Text3, null, /* @__PURE__ */ React3.createElement(Spinner2, { type: "dots" })), /* @__PURE__ */ React3.createElement(Text3, null, " Fetching session for task ", selectedThreadId, "...")) : sessionData ? /* @__PURE__ */ React3.createElement(Text3, { color: "green" }, "\u2713 Session fetched successfully") : /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Error: No session data")), sessionData && !isLoading && /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Name")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.name)), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Branch")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.branchName || "N/A")), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Repository")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.githubRepoFullName || "N/A")), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "PR Number")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.githubPRNumber ? `#${sessionData.githubPRNumber}` : "N/A"))), processingError && /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Error: ", processingError)), completedSessionId ? /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Text3, null, " "), resume ? /* @__PURE__ */ React3.createElement(Text3, { color: "green" }, "Launching Claude...") : sessionData?.agent === "claudeCode" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Text3, { color: "yellow" }, "To continue this session, run:"), /* @__PURE__ */ React3.createElement(
|
|
658
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Box3, null, isLoading ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Text3, null, /* @__PURE__ */ React3.createElement(Spinner2, { type: "dots" })), /* @__PURE__ */ React3.createElement(Text3, null, " Fetching session for task ", selectedThreadId, "...")) : sessionData ? /* @__PURE__ */ React3.createElement(Text3, { color: "green" }, "\u2713 Session fetched successfully") : /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Error: No session data")), sessionData && !isLoading && /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Name")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.name)), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Branch")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.branchName || "N/A")), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "Repository")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.githubRepoFullName || "N/A")), /* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "PR Number")), /* @__PURE__ */ React3.createElement(Text3, null, sessionData.githubPRNumber ? `#${sessionData.githubPRNumber}` : "N/A"))), processingError && /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Error: ", processingError)), completedSessionId ? /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(Text3, null, " "), resume && !jsonlAvailable ? /* @__PURE__ */ React3.createElement(Text3, { color: "yellow" }, "No conversation history available \u2014 cannot resume session") : resume && jsonlAvailable ? /* @__PURE__ */ React3.createElement(Text3, { color: "green" }, "Launching Claude...") : sessionData?.agent === "claudeCode" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Text3, { color: "yellow" }, "To continue this session, run:"), /* @__PURE__ */ React3.createElement(
|
|
638
659
|
Box3,
|
|
639
660
|
{
|
|
640
661
|
marginLeft: 2,
|
|
@@ -795,7 +816,7 @@ import updateNotifier from "update-notifier";
|
|
|
795
816
|
// package.json
|
|
796
817
|
var package_default = {
|
|
797
818
|
name: "@devboxer/cli",
|
|
798
|
-
version: "0.
|
|
819
|
+
version: "0.3.1",
|
|
799
820
|
type: "module",
|
|
800
821
|
bin: {
|
|
801
822
|
devboxer: "./dist/index.js"
|
|
@@ -1147,11 +1168,20 @@ program.command("auth [apiKey]").description("Authenticate with your DevBoxer AP
|
|
|
1147
1168
|
/* @__PURE__ */ React9.createElement(QueryProvider, null, /* @__PURE__ */ React9.createElement(RootLayout, null, /* @__PURE__ */ React9.createElement(AuthCommand, { apiKey })))
|
|
1148
1169
|
);
|
|
1149
1170
|
});
|
|
1150
|
-
program.command("pull [threadId]").description("Fetch session data for a task").option("-r, --resume", "Automatically launch Claude after pulling").
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1171
|
+
program.command("pull [threadId]").description("Fetch session data for a task").option("-r, --resume", "Automatically launch Claude after pulling").option("-s, --session-only", "Skip git operations, only pull session data").action(
|
|
1172
|
+
(threadId, options) => {
|
|
1173
|
+
render(
|
|
1174
|
+
/* @__PURE__ */ React9.createElement(QueryProvider, null, /* @__PURE__ */ React9.createElement(RootLayout, null, /* @__PURE__ */ React9.createElement(
|
|
1175
|
+
PullCommand,
|
|
1176
|
+
{
|
|
1177
|
+
threadId,
|
|
1178
|
+
resume: options.resume,
|
|
1179
|
+
sessionOnly: options.sessionOnly
|
|
1180
|
+
}
|
|
1181
|
+
)))
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
);
|
|
1155
1185
|
var CLI_MODEL_OPTIONS = [
|
|
1156
1186
|
"amp",
|
|
1157
1187
|
"haiku",
|