@apilift/cli 1.10.2 → 1.10.3
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/apilift-capture-server.js +51 -69
- package/dist/apilift-collector.js +18 -0
- package/dist/apilift.js +583 -467
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/skills/discover/references/html-forms-navigation.md +1 -1
- package/dist/plugin/skills/discover/references/operation-contract.md +1 -1
- package/package.json +3 -2
|
@@ -19876,58 +19876,48 @@ var extensionPageMessageSchema = external_exports.discriminatedUnion("operation"
|
|
|
19876
19876
|
]);
|
|
19877
19877
|
|
|
19878
19878
|
// src/capture-server/windows-owner.ts
|
|
19879
|
-
import {
|
|
19880
|
-
var
|
|
19881
|
-
var
|
|
19882
|
-
|
|
19883
|
-
|
|
19884
|
-
|
|
19885
|
-
|
|
19886
|
-
|
|
19887
|
-
|
|
19888
|
-
|
|
19889
|
-
|
|
19890
|
-
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
}
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
19908
|
-
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19913
|
-
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
|
|
19917
|
-
|
|
19918
|
-
|
|
19919
|
-
|
|
19920
|
-
|
|
19921
|
-
Atomics.store(state, 0, 1);
|
|
19922
|
-
worker.postMessage({ id: id2, pid });
|
|
19923
|
-
const result = Atomics.wait(state, 0, 1, Math.min(4e3, remaining));
|
|
19924
|
-
const status = Atomics.load(state, 0);
|
|
19925
|
-
if (status === 2) return Atomics.load(state, 2) === id2 && Number.isFinite(value[0]) && value[0] > 0 && isAlive() ? value[0] : null;
|
|
19926
|
-
if (result !== "timed-out" || status !== 1) break;
|
|
19927
|
-
}
|
|
19928
|
-
void worker.terminate();
|
|
19929
|
-
worker = void 0;
|
|
19930
|
-
return null;
|
|
19879
|
+
import { createRequire as createNativeRequire } from "node:module";
|
|
19880
|
+
var requireNative = createNativeRequire(import.meta.url);
|
|
19881
|
+
var queryAndSynchronize = 1052672;
|
|
19882
|
+
var waitTimeout = 258;
|
|
19883
|
+
var unixEpochFileTime = 116444736000000000n;
|
|
19884
|
+
var cachedApi;
|
|
19885
|
+
function windowsProcessApi() {
|
|
19886
|
+
if (cachedApi) return cachedApi;
|
|
19887
|
+
const koffi = requireNative("koffi");
|
|
19888
|
+
const kernel = koffi.load("kernel32.dll");
|
|
19889
|
+
const open2 = kernel.func("void * __stdcall OpenProcess(uint32_t access, int inherit, uint32_t pid)");
|
|
19890
|
+
const times = kernel.func("int __stdcall GetProcessTimes(void *process, void *created, void *exited, void *kernel, void *user)");
|
|
19891
|
+
const wait = kernel.func("uint32_t __stdcall WaitForSingleObject(void *handle, uint32_t milliseconds)");
|
|
19892
|
+
const close = kernel.func("int __stdcall CloseHandle(void *handle)");
|
|
19893
|
+
cachedApi = {
|
|
19894
|
+
open: (pid) => open2(queryAndSynchronize, 0, pid),
|
|
19895
|
+
query(handle) {
|
|
19896
|
+
const values = Buffer.alloc(32);
|
|
19897
|
+
if (!times(handle, values.subarray(0, 8), values.subarray(8, 16), values.subarray(16, 24), values.subarray(24))) return null;
|
|
19898
|
+
return { created: values.readBigUInt64LE(), running: wait(handle, 0) === waitTimeout };
|
|
19899
|
+
},
|
|
19900
|
+
close
|
|
19901
|
+
};
|
|
19902
|
+
return cachedApi;
|
|
19903
|
+
}
|
|
19904
|
+
function windowsProcessStart(pid, load = windowsProcessApi) {
|
|
19905
|
+
if (!Number.isInteger(pid) || pid <= 0 || pid > 4294967295) return null;
|
|
19906
|
+
try {
|
|
19907
|
+
const api = load();
|
|
19908
|
+
const handle = api.open(pid);
|
|
19909
|
+
if (!handle) return null;
|
|
19910
|
+
try {
|
|
19911
|
+
const info = api.query(handle);
|
|
19912
|
+
if (!info?.running || info.created <= unixEpochFileTime) return null;
|
|
19913
|
+
const created = Number((info.created - unixEpochFileTime) / 10000n);
|
|
19914
|
+
return Number.isSafeInteger(created) ? created : null;
|
|
19915
|
+
} finally {
|
|
19916
|
+
api.close(handle);
|
|
19917
|
+
}
|
|
19918
|
+
} catch {
|
|
19919
|
+
return null;
|
|
19920
|
+
}
|
|
19931
19921
|
}
|
|
19932
19922
|
|
|
19933
19923
|
// src/capture-server/store.ts
|
|
@@ -19983,9 +19973,6 @@ function inspectOwner(pid, expectedStartedAt, probe) {
|
|
|
19983
19973
|
const alive = probe.alive ?? pidAlive;
|
|
19984
19974
|
const inspect = probe.inspect ?? inspectProcess;
|
|
19985
19975
|
const platform2 = probe.platform ?? process.platform;
|
|
19986
|
-
const now = probe.now ?? Date.now;
|
|
19987
|
-
const started = now();
|
|
19988
|
-
const windows = platform2 === "win32";
|
|
19989
19976
|
if (platform2 === "linux") {
|
|
19990
19977
|
try {
|
|
19991
19978
|
const read = probe.read ?? ((path) => readFileSync2(path, "utf8"));
|
|
@@ -19999,23 +19986,18 @@ function inspectOwner(pid, expectedStartedAt, probe) {
|
|
|
19999
19986
|
return false;
|
|
20000
19987
|
}
|
|
20001
19988
|
}
|
|
20002
|
-
if (
|
|
20003
|
-
const observed =
|
|
19989
|
+
if (platform2 === "win32") {
|
|
19990
|
+
const observed = (probe.readWindows ?? windowsProcessStart)(pid);
|
|
20004
19991
|
return observed !== null && Math.abs(observed - expectedStartedAt) <= 5e3;
|
|
20005
19992
|
}
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
const
|
|
20009
|
-
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
return Number.isFinite(observed) && Math.abs(observed - expectedStartedAt) <= 5e3;
|
|
20014
|
-
} catch (error62) {
|
|
20015
|
-
if (!windows || error62.code !== "ETIMEDOUT") return false;
|
|
20016
|
-
}
|
|
19993
|
+
if (!alive(pid)) return false;
|
|
19994
|
+
try {
|
|
19995
|
+
const raw = inspect("ps", ["-o", "lstart=", "-p", String(pid)], 2e3);
|
|
19996
|
+
const observed = Date.parse(`${raw.trim()} UTC`);
|
|
19997
|
+
return Number.isFinite(observed) && Math.abs(observed - expectedStartedAt) <= 5e3;
|
|
19998
|
+
} catch {
|
|
19999
|
+
return false;
|
|
20017
20000
|
}
|
|
20018
|
-
return false;
|
|
20019
20001
|
}
|
|
20020
20002
|
var CaptureStore = class {
|
|
20021
20003
|
constructor(root, clock = Date.now, alive = ownerProcessAlive) {
|
|
@@ -29231,6 +29231,13 @@ var init_essential_output = __esm({
|
|
|
29231
29231
|
}
|
|
29232
29232
|
});
|
|
29233
29233
|
|
|
29234
|
+
// ../../packages/core/dist/definitions/html-response-authoring.js
|
|
29235
|
+
var init_html_response_authoring = __esm({
|
|
29236
|
+
"../../packages/core/dist/definitions/html-response-authoring.js"() {
|
|
29237
|
+
"use strict";
|
|
29238
|
+
}
|
|
29239
|
+
});
|
|
29240
|
+
|
|
29234
29241
|
// ../../packages/core/dist/definitions/categories.js
|
|
29235
29242
|
var labels, descriptions, categories;
|
|
29236
29243
|
var init_categories = __esm({
|
|
@@ -29269,6 +29276,7 @@ var init_definitions = __esm({
|
|
|
29269
29276
|
init_rules();
|
|
29270
29277
|
init_analysis();
|
|
29271
29278
|
init_metadata();
|
|
29279
|
+
init_html_response_authoring();
|
|
29272
29280
|
init_categories();
|
|
29273
29281
|
init_credential_contract();
|
|
29274
29282
|
}
|
|
@@ -172905,6 +172913,15 @@ var init_file_artifacts = __esm({
|
|
|
172905
172913
|
}
|
|
172906
172914
|
});
|
|
172907
172915
|
|
|
172916
|
+
// src/execution/response-framing.ts
|
|
172917
|
+
var maxInspectionBytes;
|
|
172918
|
+
var init_response_framing = __esm({
|
|
172919
|
+
"src/execution/response-framing.ts"() {
|
|
172920
|
+
"use strict";
|
|
172921
|
+
maxInspectionBytes = 4 * 1024 * 1024;
|
|
172922
|
+
}
|
|
172923
|
+
});
|
|
172924
|
+
|
|
172908
172925
|
// src/execution/web-response.ts
|
|
172909
172926
|
var init_web_response = __esm({
|
|
172910
172927
|
"src/execution/web-response.ts"() {
|
|
@@ -172912,6 +172929,7 @@ var init_web_response = __esm({
|
|
|
172912
172929
|
init_file_artifacts();
|
|
172913
172930
|
init_slim();
|
|
172914
172931
|
init_definitions();
|
|
172932
|
+
init_response_framing();
|
|
172915
172933
|
init_html_secrets();
|
|
172916
172934
|
}
|
|
172917
172935
|
});
|