@codingfrees/uap-device-control 0.2.14 → 0.2.20
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/DISCLOSURE +6 -3
- package/README.md +1 -1
- package/dist/uap-device-control.mjs +10 -27
- package/package.json +1 -1
package/DISCLOSURE
CHANGED
|
@@ -9,6 +9,9 @@ authenticated device enrollment, origin-bound credentials, capability
|
|
|
9
9
|
restrictions, and elevated approval for sensitive operations. It must not
|
|
10
10
|
be used to access systems without authorization.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Public releases are submitted from a verified immutable source through
|
|
13
|
+
explicitly authorized npm Trusted Publishing (OIDC) in a GitHub-hosted
|
|
14
|
+
workflow. The npm account owner must approve the trusted-publisher setup
|
|
15
|
+
using the account security controls; the release operation requires an
|
|
16
|
+
explicit Product Releases confirmation and the GitHub production environment.
|
|
17
|
+
Successful publication is independently checked against the public registry.
|
package/README.md
CHANGED
|
@@ -120,7 +120,7 @@ Validate the exact release without publishing with `pnpm publish:public -- --dry
|
|
|
120
120
|
|
|
121
121
|
For `npm whoami` HTTP 401 in Linux/WSL, renew authentication locally using `npm login --registry=https://registry.npmjs.org/ --auth-type=web`, then confirm `npm whoami`. Do not paste credentials into issue reports or logs. npm versions are immutable: bump the package version and commit a clean tree before publishing.
|
|
122
122
|
|
|
123
|
-
The script requires clean package inputs, the persistent `contentPolicy` declaration and bundled `DISCLOSURE`, and an unused version. It builds and checks the package, then calls `npm stage publish`. The root `pnpm deploy:npm` entrypoint uses the same staging script. A maintainer must inspect and explicitly approve the stage
|
|
123
|
+
The script requires clean package inputs, the persistent `contentPolicy` declaration and bundled `DISCLOSURE`, and an unused version. It builds and checks the package, then calls `npm stage publish`. The root `pnpm deploy:npm` entrypoint uses the same staging script. A maintainer must inspect and explicitly approve the stage at https://www.npmjs.com/settings/codingfrees/staged-packages with 2FA before the version becomes publicly available; the script does not bypass npm identity checks or claim a staged version is published.
|
|
124
124
|
|
|
125
125
|
## UAP Downloads release candidates
|
|
126
126
|
|
|
@@ -9,31 +9,23 @@ import { createServer } from "node:http";
|
|
|
9
9
|
// ../../packages/web-crypto/src/index.ts
|
|
10
10
|
var encoder = new TextEncoder();
|
|
11
11
|
function randomBytes(length) {
|
|
12
|
-
if (!Number.isInteger(length) || length < 1 || length > 4096)
|
|
13
|
-
throw new TypeError("random byte length is invalid");
|
|
14
|
-
}
|
|
12
|
+
if (!Number.isInteger(length) || length < 1 || length > 4096) throw new TypeError("random byte length is invalid");
|
|
15
13
|
const bytes = new Uint8Array(length);
|
|
16
14
|
crypto.getRandomValues(bytes);
|
|
17
15
|
return bytes;
|
|
18
16
|
}
|
|
19
17
|
async function sha256Bytes(value) {
|
|
20
18
|
const input = typeof value === "string" ? encoder.encode(value) : value;
|
|
21
|
-
if (!isUint8Array(input))
|
|
22
|
-
throw new TypeError("SHA-256 input is invalid");
|
|
23
|
-
}
|
|
19
|
+
if (!isUint8Array(input)) throw new TypeError("SHA-256 input is invalid");
|
|
24
20
|
const digestInput = new Uint8Array(input.byteLength);
|
|
25
21
|
digestInput.set(input);
|
|
26
22
|
return new Uint8Array(await crypto.subtle.digest("SHA-256", digestInput.buffer));
|
|
27
23
|
}
|
|
28
24
|
function base64EncodeBytes(bytes) {
|
|
29
|
-
if (!isUint8Array(bytes))
|
|
30
|
-
throw new TypeError("base64 input is invalid");
|
|
31
|
-
}
|
|
25
|
+
if (!isUint8Array(bytes)) throw new TypeError("base64 input is invalid");
|
|
32
26
|
let binary = "";
|
|
33
27
|
const chunkSize = 32768;
|
|
34
|
-
for (let offset = 0; offset < bytes.length; offset += chunkSize)
|
|
35
|
-
binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));
|
|
36
|
-
}
|
|
28
|
+
for (let offset = 0; offset < bytes.length; offset += chunkSize) binary += String.fromCharCode(...bytes.subarray(offset, offset + chunkSize));
|
|
37
29
|
return btoa(binary);
|
|
38
30
|
}
|
|
39
31
|
function isUint8Array(value) {
|
|
@@ -825,7 +817,7 @@ import WebSocket from "ws";
|
|
|
825
817
|
// package.json
|
|
826
818
|
var package_default = {
|
|
827
819
|
name: "@codingfrees/uap-device-control",
|
|
828
|
-
version: "0.2.
|
|
820
|
+
version: "0.2.20",
|
|
829
821
|
description: "Cross-platform outbound UAP Device Control client",
|
|
830
822
|
contentPolicy: {
|
|
831
823
|
class: "dual-use"
|
|
@@ -1368,9 +1360,7 @@ var DeviceAgentEngine = class {
|
|
|
1368
1360
|
}
|
|
1369
1361
|
async #spawn(input, terminal, workspaceId) {
|
|
1370
1362
|
const executable = text2(input.executable ?? defaultShell(), 260, "executable");
|
|
1371
|
-
if (!this.#unrestricted && ![...this.#allowed].some((allowed) => path3.basename(executable).toLowerCase() === path3.basename(allowed).toLowerCase()))
|
|
1372
|
-
throw new TypeError("executable is not allowed: " + executable);
|
|
1373
|
-
}
|
|
1363
|
+
if (!this.#unrestricted && ![...this.#allowed].some((allowed) => path3.basename(executable).toLowerCase() === path3.basename(allowed).toLowerCase())) throw new TypeError("executable is not allowed: " + executable);
|
|
1374
1364
|
const args = Array.isArray(input.args) ? input.args.map((value) => text2(value, 8192, "argument")) : terminal ? [] : [text2(input.command ?? "", 8192, "command")];
|
|
1375
1365
|
if (args.length > 128 || JSON.stringify(args).length > 32768) throw new TypeError("command length limit exceeded");
|
|
1376
1366
|
const child = spawn(executable, args, { cwd: input.cwd === void 0 ? void 0 : this.#cwd(input.cwd), env: { ...process.env, ...environment(input.environment) }, shell: false, windowsHide: true });
|
|
@@ -1427,9 +1417,7 @@ var DeviceAgentEngine = class {
|
|
|
1427
1417
|
} catch {
|
|
1428
1418
|
throw new TypeError("cwd is unavailable");
|
|
1429
1419
|
}
|
|
1430
|
-
for (const root2 of this.#roots.values())
|
|
1431
|
-
if (inside(root2.path, candidate)) return candidate;
|
|
1432
|
-
}
|
|
1420
|
+
for (const root2 of this.#roots.values()) if (inside(root2.path, candidate)) return candidate;
|
|
1433
1421
|
if (this.#unrestricted) return candidate;
|
|
1434
1422
|
throw new TypeError("cwd escapes configured roots");
|
|
1435
1423
|
}
|
|
@@ -1518,9 +1506,7 @@ async function safeExisting(root2, relative) {
|
|
|
1518
1506
|
}
|
|
1519
1507
|
async function safeWritable(root2, relative) {
|
|
1520
1508
|
const lexical = path3.resolve(root2, relative);
|
|
1521
|
-
if (!inside(root2, lexical) || lexical === root2)
|
|
1522
|
-
throw new TypeError("relative path is invalid");
|
|
1523
|
-
}
|
|
1509
|
+
if (!inside(root2, lexical) || lexical === root2) throw new TypeError("relative path is invalid");
|
|
1524
1510
|
const parts = path3.relative(root2, lexical).split(path3.sep);
|
|
1525
1511
|
const leaf = parts.pop();
|
|
1526
1512
|
if (!leaf) throw new TypeError("relative path is invalid");
|
|
@@ -1554,9 +1540,8 @@ function isMissing(error) {
|
|
|
1554
1540
|
}
|
|
1555
1541
|
function safeRelative(value, empty) {
|
|
1556
1542
|
const result = String(value ?? "");
|
|
1557
|
-
if (!empty && !result || result.length > 1024 || path3.isAbsolute(result) || path3.win32.parse(result).root !== "" || result.split(/[\\/]/).some((part) => part === "..") || result.includes("\0"))
|
|
1543
|
+
if (!empty && !result || result.length > 1024 || path3.isAbsolute(result) || path3.win32.parse(result).root !== "" || result.split(/[\\/]/).some((part) => part === "..") || result.includes("\0"))
|
|
1558
1544
|
throw new TypeError("relative path is invalid");
|
|
1559
|
-
}
|
|
1560
1545
|
return result;
|
|
1561
1546
|
}
|
|
1562
1547
|
function decodeBase64(value, limit) {
|
|
@@ -1929,9 +1914,7 @@ async function createNativeServiceAdapter(options = {}) {
|
|
|
1929
1914
|
async control(name, operation) {
|
|
1930
1915
|
const normalizedName = serviceName2(name);
|
|
1931
1916
|
const normalizedOperation = serviceOperation2(operation);
|
|
1932
|
-
for (const [program, ...args] of await controlCommands(normalizedName, normalizedOperation))
|
|
1933
|
-
await invoke(run, [program, ...args], "service control");
|
|
1934
|
-
}
|
|
1917
|
+
for (const [program, ...args] of await controlCommands(normalizedName, normalizedOperation)) await invoke(run, [program, ...args], "service control");
|
|
1935
1918
|
return { name: normalizedName, operation: normalizedOperation, accepted: true };
|
|
1936
1919
|
}
|
|
1937
1920
|
};
|