@swmansion/argent 0.26.1-next.10 → 0.26.1-next.12

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.
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -1847,9 +1847,13 @@ async function terminatePid(pid, stillOurs) {
1847
1847
  }
1848
1848
  async function killToolServer(bundlePath) {
1849
1849
  const state2 = await readState(bundlePath);
1850
- if (!state2) return;
1851
- await terminatePid(state2.pid);
1850
+ if (!state2) return false;
1851
+ const stillOurs = () => couldBeOurToolServer(state2.pid, state2.bundlePath);
1852
+ const alive = isProcessAlive(state2.pid);
1853
+ if (alive && !stillOurs()) return false;
1854
+ if (alive) await terminatePid(state2.pid, stillOurs);
1852
1855
  await clearToolsServerState(bundlePath ?? state2.bundlePath);
1856
+ return alive;
1853
1857
  }
1854
1858
  var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => fs.existsSync(p)) ?? "ps";
1855
1859
  var PS_WIDTH_FLAGS = ["-ww"];
@@ -21877,7 +21881,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21877
21881
  var SESSION_ID2 = randomUUID5();
21878
21882
  function readCliVersion() {
21879
21883
  if (true) {
21880
- return "0.26.1-next.10";
21884
+ return "0.26.1-next.12";
21881
21885
  }
21882
21886
  return "0.0.0";
21883
21887
  }
@@ -24188,8 +24192,13 @@ async function stopCmd(paths) {
24188
24192
  Stop one with: kill <pid>`);
24189
24193
  return;
24190
24194
  }
24191
- await killToolServer(paths?.bundlePath);
24192
- console.log(`tool-server stopped (pid ${state2.pid}).`);
24195
+ if (await killToolServer(paths?.bundlePath)) {
24196
+ console.log(`tool-server stopped (pid ${state2.pid}).`);
24197
+ } else {
24198
+ console.log(
24199
+ `tool-server: not running (pid ${state2.pid} is gone or not an argent tool-server).`
24200
+ );
24201
+ }
24193
24202
  }
24194
24203
  function logsCmd(follow) {
24195
24204
  if (!fs11.existsSync(LOG_FILE2)) {
package/dist/client.d.ts CHANGED
@@ -28,8 +28,21 @@ export declare class ArgentToolError extends Error {
28
28
  issues?: readonly unknown[];
29
29
  });
30
30
  }
31
+ export interface ArgentFlag {
32
+ name: string;
33
+ description: string;
34
+ /** Effective state, as `argent flags` reports it. */
35
+ enabled: boolean;
36
+ }
37
+ /** Feature flags and their effective state: project overrides global, then the default. */
38
+ export declare function listFlags(): ArgentFlag[];
31
39
  export interface ArgentClient {
32
40
  listTools(): Promise<ArgentTool[]>;
33
41
  callTool<T = unknown>(name: string, args?: Record<string, unknown>, options?: CallToolOptions): Promise<ArgentToolResult<T>>;
42
+ /**
43
+ * Stop this install's local tool-server, like `argent server stop`. The next
44
+ * call starts a fresh one. Resolves false when none was running.
45
+ */
46
+ stopServer(): Promise<boolean>;
34
47
  }
35
48
  export declare function createArgentClient(): ArgentClient;