@mstar-harness/cli 0.5.0 → 0.5.2
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/dist/mstar-harness.js +40 -6
- package/package.json +1 -1
package/dist/mstar-harness.js
CHANGED
|
@@ -4585,13 +4585,35 @@ var codexAdapter = {
|
|
|
4585
4585
|
import fs4 from "node:fs";
|
|
4586
4586
|
import os3 from "node:os";
|
|
4587
4587
|
import path5 from "node:path";
|
|
4588
|
-
var CURSOR_PLUGIN_NAME = "
|
|
4588
|
+
var CURSOR_PLUGIN_NAME = "morning-star-harness";
|
|
4589
4589
|
var CURSOR_PLUGIN_MARKER = ".cursor-plugin/plugin.json";
|
|
4590
|
+
var CURSOR_PLUGIN_LINK = ".cursor/plugins/morning-star-harness";
|
|
4591
|
+
var CURSOR_AGENT_SMOKE_NAMES = ["fullstack-dev", "qc-specialist"];
|
|
4590
4592
|
function globalInstallPath() {
|
|
4591
4593
|
return path5.join(os3.homedir(), ".cursor", "plugins", "local", CURSOR_PLUGIN_NAME);
|
|
4592
4594
|
}
|
|
4593
4595
|
function projectInstallPath() {
|
|
4594
|
-
return path5.join(resolveProjectRoot(),
|
|
4596
|
+
return path5.join(resolveProjectRoot(), CURSOR_PLUGIN_LINK);
|
|
4597
|
+
}
|
|
4598
|
+
function validatePluginAgents() {
|
|
4599
|
+
const errors2 = [];
|
|
4600
|
+
const agentsDir = path5.join(HARNESS_REPO_PATH, "agents");
|
|
4601
|
+
if (!fs4.existsSync(agentsDir)) {
|
|
4602
|
+
errors2.push(`Missing plugin agents directory: ${agentsDir}`);
|
|
4603
|
+
return errors2;
|
|
4604
|
+
}
|
|
4605
|
+
for (const agentName of CURSOR_AGENT_SMOKE_NAMES) {
|
|
4606
|
+
const agentPath = path5.join(agentsDir, `${agentName}.md`);
|
|
4607
|
+
if (!fs4.existsSync(agentPath)) {
|
|
4608
|
+
errors2.push(`Missing plugin agent file: ${agentPath}`);
|
|
4609
|
+
continue;
|
|
4610
|
+
}
|
|
4611
|
+
const content = fs4.readFileSync(agentPath, "utf8");
|
|
4612
|
+
if (!/^---\nname:\s/m.test(content)) {
|
|
4613
|
+
errors2.push(`Plugin agent ${agentName}.md must use Cursor-first frontmatter (name, description, model before OpenCode fields).`);
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
return errors2;
|
|
4595
4617
|
}
|
|
4596
4618
|
function globalInit(dryRun) {
|
|
4597
4619
|
const location = globalInstallPath();
|
|
@@ -4604,7 +4626,7 @@ function projectInit(dryRun) {
|
|
|
4604
4626
|
const location = projectInstallPath();
|
|
4605
4627
|
const notes = ensureLocalHarnessRepo(dryRun);
|
|
4606
4628
|
notes.push(ensureSymlink(HARNESS_REPO_PATH, location, dryRun));
|
|
4607
|
-
notes.push(...appendGitignore(projectRoot, [
|
|
4629
|
+
notes.push(...appendGitignore(projectRoot, [CURSOR_PLUGIN_LINK], dryRun));
|
|
4608
4630
|
return { location, notes };
|
|
4609
4631
|
}
|
|
4610
4632
|
function globalDoctor() {
|
|
@@ -4615,6 +4637,7 @@ function globalDoctor() {
|
|
|
4615
4637
|
if (!fs4.existsSync(marker)) {
|
|
4616
4638
|
errors2.push(`Missing Cursor plugin marker file: ${marker}`);
|
|
4617
4639
|
}
|
|
4640
|
+
errors2.push(...validatePluginAgents());
|
|
4618
4641
|
return { location, errors: errors2 };
|
|
4619
4642
|
}
|
|
4620
4643
|
function projectDoctor() {
|
|
@@ -4628,9 +4651,10 @@ function projectDoctor() {
|
|
|
4628
4651
|
}
|
|
4629
4652
|
const gitignorePath = path5.join(projectRoot, ".gitignore");
|
|
4630
4653
|
const gitignore = fs4.existsSync(gitignorePath) ? fs4.readFileSync(gitignorePath, "utf8") : "";
|
|
4631
|
-
if (!gitignore.split(/\r?\n/).includes(
|
|
4632
|
-
errors2.push(
|
|
4654
|
+
if (!gitignore.split(/\r?\n/).includes(CURSOR_PLUGIN_LINK)) {
|
|
4655
|
+
errors2.push(`Missing .gitignore entry: ${CURSOR_PLUGIN_LINK}`);
|
|
4633
4656
|
}
|
|
4657
|
+
errors2.push(...validatePluginAgents());
|
|
4634
4658
|
return { location, errors: errors2 };
|
|
4635
4659
|
}
|
|
4636
4660
|
var cursorAdapter = {
|
|
@@ -4838,15 +4862,25 @@ async function pickTargetInteractive() {
|
|
|
4838
4862
|
choices: SUPPORTED_TARGETS.map((target) => ({ name: target, value: target }))
|
|
4839
4863
|
});
|
|
4840
4864
|
}
|
|
4865
|
+
var ASCII_ICONS = {
|
|
4866
|
+
checked: "(*)",
|
|
4867
|
+
unchecked: "( )",
|
|
4868
|
+
cursor: ">"
|
|
4869
|
+
};
|
|
4841
4870
|
async function pickModelsInteractive(params) {
|
|
4842
4871
|
const choices = params.models.map((model) => ({ name: model, value: model }));
|
|
4843
4872
|
if (params.single) {
|
|
4844
|
-
const picked = await dist_default5({
|
|
4873
|
+
const picked = await dist_default5({
|
|
4874
|
+
message: `${params.title} (${params.hint})`,
|
|
4875
|
+
choices,
|
|
4876
|
+
theme: { icon: { cursor: ASCII_ICONS.cursor } }
|
|
4877
|
+
});
|
|
4845
4878
|
return [picked];
|
|
4846
4879
|
}
|
|
4847
4880
|
return dist_default4({
|
|
4848
4881
|
message: `${params.title} (${params.hint})`,
|
|
4849
4882
|
choices,
|
|
4883
|
+
theme: { icon: ASCII_ICONS },
|
|
4850
4884
|
validate: (picked) => {
|
|
4851
4885
|
if (picked.length < 1)
|
|
4852
4886
|
return "Pick at least one model.";
|