@qwen-code/qwen-harness 0.1.1 → 0.1.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/entrypoint.js +27 -3
- package/dist/entrypoint.js.map +3 -3
- package/package.json +2 -2
package/dist/entrypoint.js
CHANGED
|
@@ -4813,6 +4813,20 @@ async function runToolComparisonHarness(name, args) {
|
|
|
4813
4813
|
);
|
|
4814
4814
|
}
|
|
4815
4815
|
|
|
4816
|
+
// src/runtime/pi-management.ts
|
|
4817
|
+
var PI_MANAGEMENT_COMMANDS = /* @__PURE__ */ new Set([
|
|
4818
|
+
"auth",
|
|
4819
|
+
"config",
|
|
4820
|
+
"install",
|
|
4821
|
+
"list",
|
|
4822
|
+
"remove",
|
|
4823
|
+
"uninstall",
|
|
4824
|
+
"update"
|
|
4825
|
+
]);
|
|
4826
|
+
function isPiManagementCommand(args) {
|
|
4827
|
+
return args[0] !== void 0 && PI_MANAGEMENT_COMMANDS.has(args[0]);
|
|
4828
|
+
}
|
|
4829
|
+
|
|
4816
4830
|
// src/harness_cli.ts
|
|
4817
4831
|
var harnessNames = [
|
|
4818
4832
|
"pi",
|
|
@@ -4825,6 +4839,12 @@ var harnessNames = [
|
|
|
4825
4839
|
"long-horizon-mea",
|
|
4826
4840
|
...toolComparisonHarnessNames
|
|
4827
4841
|
];
|
|
4842
|
+
function resolveHarnessInvocation(invocation) {
|
|
4843
|
+
if (isPiManagementCommand(invocation.args)) {
|
|
4844
|
+
return { kind: "pi-management", args: invocation.args };
|
|
4845
|
+
}
|
|
4846
|
+
return { kind: "harness", ...invocation };
|
|
4847
|
+
}
|
|
4828
4848
|
function parseHarnessName(value) {
|
|
4829
4849
|
const name = value?.trim().toLowerCase();
|
|
4830
4850
|
if (name && harnessNames.includes(name)) {
|
|
@@ -4922,12 +4942,16 @@ async function runEntrypoint(args) {
|
|
|
4922
4942
|
`);
|
|
4923
4943
|
return;
|
|
4924
4944
|
}
|
|
4925
|
-
const
|
|
4926
|
-
process.title = `pi-${name}`;
|
|
4945
|
+
const invocation = resolveHarnessInvocation(parseHarnessInvocation(args));
|
|
4946
|
+
process.title = invocation.kind === "pi-management" ? "pi-management" : `pi-${invocation.name}`;
|
|
4927
4947
|
process.env.PI_CODING_AGENT = "true";
|
|
4928
4948
|
process.env.AI_AGENT = "pi";
|
|
4929
4949
|
exposePackagedHarnessAsSubagentBinary();
|
|
4930
|
-
|
|
4950
|
+
if (invocation.kind === "pi-management") {
|
|
4951
|
+
await runHarnessMain(invocation.args);
|
|
4952
|
+
} else {
|
|
4953
|
+
await harnessRunners[invocation.name](invocation.args);
|
|
4954
|
+
}
|
|
4931
4955
|
} catch (error) {
|
|
4932
4956
|
process.stderr.write(
|
|
4933
4957
|
`${error instanceof Error ? error.message : String(error)}
|