@apilift/cli 1.10.1 → 1.10.2-dev.1795029987.7f2a7bb77004d7fba7f6a2a7a5ec15e7b045017b

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.
@@ -20494,7 +20494,12 @@ var object2 = (value) => value && typeof value === "object" && !Array.isArray(va
20494
20494
  async function startCaptureServer(options) {
20495
20495
  const root = options.root;
20496
20496
  await mkdir(root, { recursive: true, mode: 448 });
20497
- const store = new CaptureStore(root, options.clock, options.alive);
20497
+ const brokerStartedAt = Math.trunc(Date.now() - process.uptime() * 1e3);
20498
+ const inspectOwner2 = options.alive ?? ownerProcessAlive;
20499
+ const store = new CaptureStore(root, options.clock, (pid, startedAt, fresh) => {
20500
+ if (pid === process.pid && startedAt === brokerStartedAt) return true;
20501
+ return inspectOwner2(pid, startedAt, fresh);
20502
+ });
20498
20503
  const token = randomBytes(32).toString("base64url");
20499
20504
  const setupLinks = /* @__PURE__ */ new Map();
20500
20505
  const clock = options.clock ?? Date.now;
@@ -20661,7 +20666,7 @@ async function startCaptureServer(options) {
20661
20666
  });
20662
20667
  const address = server.address();
20663
20668
  if (!address || typeof address === "string") throw new Error("Capture server did not bind a TCP port");
20664
- const receipt = { pid: process.pid, port: address.port, token, version: options.version, startedAt: new Date(Date.now() - process.uptime() * 1e3).toISOString() };
20669
+ const receipt = { pid: process.pid, port: address.port, token, version: options.version, startedAt: new Date(brokerStartedAt).toISOString() };
20665
20670
  const receiptPath = join3(root, "server.json");
20666
20671
  const temp = join3(root, `.server-${process.pid}-${randomBytes(4).toString("hex")}.json`);
20667
20672
  await writeFile(temp, JSON.stringify(receipt), { mode: 384 });
@@ -51667,8 +51667,11 @@ function parseInvocation(argv) {
51667
51667
  if (namedHelp || flagHelp) {
51668
51668
  const requested = namedHelp ? remaining.slice(1) : remaining.filter((token) => token !== "--help");
51669
51669
  const target = Object.entries(commandRegistry).filter(([, spec]) => spec.path.length > 0 && (namedHelp ? spec.path.length === requested.length : spec.path.length <= requested.length) && spec.path.every((part, index) => requested[index] === part)).sort((a, b2) => b2[1].path.length - a[1].path.length)[0];
51670
- if (!target) issues.push(`Unknown help command: ${requested.join(" ")}`);
51671
- return { ...issues.length ? {} : { invocation: { key: "helpCommands", helpTarget: target[0], ...base } }, issues };
51670
+ const group = !target && requested.length > 0 && Object.values(commandRegistry).some(
51671
+ (spec) => spec.path.length > requested.length && requested.every((part, index) => spec.path[index] === part)
51672
+ );
51673
+ if (!target && !group) issues.push(`Unknown help command: ${requested.join(" ")}`);
51674
+ return { ...issues.length ? {} : { invocation: { key: "helpCommands", ...target ? { helpTarget: target[0] } : { helpGroup: requested }, ...base } }, issues };
51672
51675
  }
51673
51676
  const selected = Object.entries(commandRegistry).filter(([, command2]) => command2.path.every((part, index) => remaining[index] === part)).sort((left, right) => right[1].path.length - left[1].path.length)[0];
51674
51677
  if (!selected) return { issues: [`Unknown command: ${remaining.slice(0, 2).join(" ")}`] };
package/dist/apilift.js CHANGED
@@ -31340,8 +31340,11 @@ function parseInvocation(argv) {
31340
31340
  if (namedHelp || flagHelp) {
31341
31341
  const requested = namedHelp ? remaining.slice(1) : remaining.filter((token) => token !== "--help");
31342
31342
  const target = Object.entries(commandRegistry).filter(([, spec]) => spec.path.length > 0 && (namedHelp ? spec.path.length === requested.length : spec.path.length <= requested.length) && spec.path.every((part, index2) => requested[index2] === part)).sort((a, b) => b[1].path.length - a[1].path.length)[0];
31343
- if (!target) issues.push(`Unknown help command: ${requested.join(" ")}`);
31344
- return { ...issues.length ? {} : { invocation: { key: "helpCommands", helpTarget: target[0], ...base2 } }, issues };
31343
+ const group = !target && requested.length > 0 && Object.values(commandRegistry).some(
31344
+ (spec) => spec.path.length > requested.length && requested.every((part, index2) => spec.path[index2] === part)
31345
+ );
31346
+ if (!target && !group) issues.push(`Unknown help command: ${requested.join(" ")}`);
31347
+ return { ...issues.length ? {} : { invocation: { key: "helpCommands", ...target ? { helpTarget: target[0] } : { helpGroup: requested }, ...base2 } }, issues };
31345
31348
  }
31346
31349
  const selected = Object.entries(commandRegistry).filter(([, command7]) => command7.path.every((part, index2) => remaining[index2] === part)).sort((left, right) => right[1].path.length - left[1].path.length)[0];
31347
31350
  if (!selected) return { issues: [`Unknown command: ${remaining.slice(0, 2).join(" ")}`] };
@@ -51719,7 +51722,7 @@ function commandHelp(identity3) {
51719
51722
  apilift apps release <app>
51720
51723
  apilift apps refresh <app> [--action <name>]
51721
51724
  apilift actions list <app> [--entity <name>] [--limit N] [--cursor C] [--all]
51722
- apilift actions search <app> <query> [--entity <name>] [--limit N] [--cursor C]
51725
+ apilift actions search <app> <query> [--entity <name>] [--limit 1..25] [--cursor C]
51723
51726
  apilift actions show <app> <action>... [--schema] [--input-template <file>] (1\u201310 actions)
51724
51727
  apilift run [--test] <app> <action> [action flags] [--input <JSON|@file|->] [--select <pointer>] [--output <file>] [--check] [--no-context]
51725
51728
  apilift --operation-id <id> run <app> <mutation> [action flags] [--input <JSON|@file|->]
@@ -51775,7 +51778,14 @@ async function handle(invocation, env, fetcher, pluginInstaller, hostRegistrar,
51775
51778
  if (invocation.key === "version") return result2(`${cliVersion}
51776
51779
  `);
51777
51780
  if (invocation.key === "root") return result2(rootHelp(Boolean(agentSession(env, invocation.sessionLabel))));
51778
- if (invocation.key === "helpCommands") return result2(invocation.helpTarget ? focusedCommandHelp(invocation.helpTarget) : commandHelp(Boolean(agentSession(env, invocation.sessionLabel))));
51781
+ if (invocation.key === "helpCommands") {
51782
+ if (invocation.helpGroup) {
51783
+ const group = invocation.helpGroup;
51784
+ const help = Object.entries(commandRegistry).filter(([, spec]) => group.every((part, index2) => spec.path[index2] === part)).map(([key2]) => focusedCommandHelp(key2)).join("");
51785
+ return result2(help);
51786
+ }
51787
+ return result2(invocation.helpTarget ? focusedCommandHelp(invocation.helpTarget) : commandHelp(Boolean(agentSession(env, invocation.sessionLabel))));
51788
+ }
51779
51789
  const prefix2 = commandPrefix(invocation.sessionLabel);
51780
51790
  const site = siteUrl(env);
51781
51791
  const session = agentSession(env, invocation.sessionLabel);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.10.1",
3
+ "version": "1.10.2-dev.1795029987.7f2a7bb77004d7fba7f6a2a7a5ec15e7b045017b",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.10.1",
3
+ "version": "1.10.2-dev.1795029987.7f2a7bb77004d7fba7f6a2a7a5ec15e7b045017b",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apilift/cli",
3
- "version": "1.10.1",
3
+ "version": "1.10.2-dev.1795029987.7f2a7bb77004d7fba7f6a2a7a5ec15e7b045017b",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "engines": {
38
38
  "node": ">=24.16.0 <27"
39
39
  },
40
- "gitHead": "19428f071655029e044d5fbd9815d9b8c298130e",
40
+ "gitHead": "7f2a7bb77004d7fba7f6a2a7a5ec15e7b045017b",
41
41
  "repository": {
42
42
  "type": "git",
43
43
  "url": "git+https://github.com/egor-sergeev/apilift.git",