@serviceme/devtools-cli 0.0.3 → 0.0.5

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.
@@ -9580,6 +9580,26 @@ function normalizeServicemeError(error, fallbackCode = "internal_error") {
9580
9580
  retryable: isRetryableErrorCode(fallbackCode)
9581
9581
  };
9582
9582
  }
9583
+ function terminateCommandProcess(child) {
9584
+ if (child.killed) {
9585
+ return;
9586
+ }
9587
+ if (process.platform === "win32" && child.pid) {
9588
+ const killProcess = child_process.spawn(
9589
+ "taskkill",
9590
+ ["/pid", String(child.pid), "/T", "/F"],
9591
+ {
9592
+ stdio: "ignore",
9593
+ windowsHide: true
9594
+ }
9595
+ );
9596
+ killProcess.once("error", () => {
9597
+ child.kill();
9598
+ });
9599
+ return;
9600
+ }
9601
+ child.kill("SIGTERM");
9602
+ }
9583
9603
  async function runCommand(command, options2 = {}) {
9584
9604
  return new Promise((resolve, reject) => {
9585
9605
  const child = child_process.spawn(command, options2.args ?? [], {
@@ -9640,7 +9660,7 @@ async function runCommand(command, options2 = {}) {
9640
9660
  if (options2.timeoutMs) {
9641
9661
  timeoutId = setTimeout(() => {
9642
9662
  finish(() => {
9643
- child.kill("SIGTERM");
9663
+ terminateCommandProcess(child);
9644
9664
  const error = new Error(
9645
9665
  `Command timed out after ${String(options2.timeoutMs)}ms.`
9646
9666
  );
@@ -10065,7 +10085,7 @@ var OpenCodeManager = class {
10065
10085
  __toESM(require_yauzl());
10066
10086
 
10067
10087
  // src/version.ts
10068
- var SERVICEME_CLI_VERSION = "0.0.3";
10088
+ var SERVICEME_CLI_VERSION = "0.0.5";
10069
10089
 
10070
10090
  // src/bridge/ndjson.ts
10071
10091
  function writeBridgeMessage(message) {
package/dist/cli.js CHANGED
@@ -9622,8 +9622,6 @@ var DEFAULT_JSON_SORT_OPTIONS = {
9622
9622
  };
9623
9623
 
9624
9624
  // ../../packages/serviceme-protocol/src/metadata.ts
9625
- var SERVICEME_CLI_NAME = "serviceme";
9626
- var SERVICEME_CLI_VERSION = "0.0.1";
9627
9625
  var SERVICEME_CLI_CAPABILITIES = {
9628
9626
  bridge: true,
9629
9627
  opencode: 1,
@@ -9672,6 +9670,26 @@ function getStringFlag(parsed, name) {
9672
9670
  const value = parsed.flags.get(name);
9673
9671
  return typeof value === "string" ? value : void 0;
9674
9672
  }
9673
+ function terminateCommandProcess(child) {
9674
+ if (child.killed) {
9675
+ return;
9676
+ }
9677
+ if (process.platform === "win32" && child.pid) {
9678
+ const killProcess = child_process.spawn(
9679
+ "taskkill",
9680
+ ["/pid", String(child.pid), "/T", "/F"],
9681
+ {
9682
+ stdio: "ignore",
9683
+ windowsHide: true
9684
+ }
9685
+ );
9686
+ killProcess.once("error", () => {
9687
+ child.kill();
9688
+ });
9689
+ return;
9690
+ }
9691
+ child.kill("SIGTERM");
9692
+ }
9675
9693
  async function runCommand(command, options2 = {}) {
9676
9694
  return new Promise((resolve, reject) => {
9677
9695
  const child = child_process.spawn(command, options2.args ?? [], {
@@ -9732,7 +9750,7 @@ async function runCommand(command, options2 = {}) {
9732
9750
  if (options2.timeoutMs) {
9733
9751
  timeoutId = setTimeout(() => {
9734
9752
  finish(() => {
9735
- child.kill("SIGTERM");
9753
+ terminateCommandProcess(child);
9736
9754
  const error = new Error(
9737
9755
  `Command timed out after ${String(options2.timeoutMs)}ms.`
9738
9756
  );
@@ -11794,12 +11812,17 @@ var ProjectTools = class {
11794
11812
  );
11795
11813
  let updatedCount = 0;
11796
11814
  if (isWindows) {
11797
- for (const scriptPath of scripts.filter((script) => script.endsWith(".ps1"))) {
11815
+ for (const scriptPath of scripts.filter(
11816
+ (script) => script.endsWith(".ps1")
11817
+ )) {
11798
11818
  try {
11799
- await runCommand(`powershell -Command "Unblock-File -Path '${scriptPath}'"`, {
11800
- cwd: workspacePath,
11801
- shell: true
11802
- });
11819
+ await runCommand(
11820
+ `powershell -Command "Unblock-File -Path '${scriptPath}'"`,
11821
+ {
11822
+ cwd: workspacePath,
11823
+ shell: true
11824
+ }
11825
+ );
11803
11826
  updatedCount += 1;
11804
11827
  } catch {
11805
11828
  }
@@ -11881,7 +11904,9 @@ var ProjectTools = class {
11881
11904
  if (directoryNames.length === 1) {
11882
11905
  return directoryNames[0] ?? null;
11883
11906
  }
11884
- const exactMatch = directoryNames.find((directoryName) => directoryName === expectedDirName);
11907
+ const exactMatch = directoryNames.find(
11908
+ (directoryName) => directoryName === expectedDirName
11909
+ );
11885
11910
  if (exactMatch) {
11886
11911
  return exactMatch;
11887
11912
  }
@@ -11913,7 +11938,8 @@ function createProjectTools() {
11913
11938
  }
11914
11939
 
11915
11940
  // src/version.ts
11916
- var SERVICEME_CLI_VERSION2 = "0.0.3";
11941
+ var SERVICEME_CLI_NAME = "serviceme";
11942
+ var SERVICEME_CLI_VERSION = "0.0.5";
11917
11943
 
11918
11944
  // src/bridge/ndjson.ts
11919
11945
  function writeBridgeMessage(message) {
@@ -11985,7 +12011,7 @@ var BridgeServer = class {
11985
12011
  this.handshakeCompleted = true;
11986
12012
  }
11987
12013
  this.writeSuccess(helloRequest.id, {
11988
- cliVersion: SERVICEME_CLI_VERSION2,
12014
+ cliVersion: SERVICEME_CLI_VERSION,
11989
12015
  protocolVersion: SERVICEME_PROTOCOL_VERSION,
11990
12016
  capabilities: CAPABILITIES,
11991
12017
  pid: process.pid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serviceme/devtools-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Unified SERVICEME CLI for automation, project scaffolding, and bridge-based tooling.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "@types/node": "^24",
43
43
  "tsup": "^8.5.1",
44
44
  "typescript": "^5.9.3",
45
- "@serviceme/devtools-core": "0.0.3",
46
- "@serviceme/devtools-protocol": "0.0.3"
45
+ "@serviceme/devtools-core": "0.0.5",
46
+ "@serviceme/devtools-protocol": "0.0.5"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsup --config tsup.config.ts",