dsh-plugin-inspector 0.6.0 → 0.7.0
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/README.md +10 -8
- package/lib/attestation.js +374 -0
- package/lib/checks/tier-a.js +41 -0
- package/lib/checks/tier-b.js +51 -27
- package/lib/checks/tier-c.js +146 -18
- package/lib/index.js +2 -1
- package/lib/inspect.js +7 -2
- package/lib/knowledge.js +38 -9
- package/lib/npm.js +58 -5
- package/lib/registry.js +54 -0
- package/lib/report.js +58 -7
- package/lib/syntax.js +135 -0
- package/lib/types/attestation.d.ts +173 -0
- package/lib/types/checks/input.d.ts +7 -0
- package/lib/types/checks/tier-c.d.ts +5 -3
- package/lib/types/index.d.ts +2 -1
- package/lib/types/inspect.d.ts +5 -2
- package/lib/types/knowledge.d.ts +23 -3
- package/lib/types/model.d.ts +13 -1
- package/lib/types/npm.d.ts +12 -2
- package/lib/types/registry.d.ts +40 -0
- package/lib/types/syntax.d.ts +51 -0
- package/package.json +2 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Readings of a syntax tree that both capability detection and readability
|
|
3
|
+
* detection need, and that must agree between them.
|
|
4
|
+
*
|
|
5
|
+
* Tier B matches a name; Tier C reports the names it could not match. If the
|
|
6
|
+
* two disagree about which expressions are constant, a package gets both a
|
|
7
|
+
* finding and a degrade for the same site, or neither. They agree because they
|
|
8
|
+
* ask the same function.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here evaluates anything. {@link foldConstantString} reads literals
|
|
11
|
+
* out of an already-parsed tree and concatenates them; it never constructs a
|
|
12
|
+
* function, and it never touches an identifier's value.
|
|
13
|
+
* @module dsh-plugin-inspector/syntax
|
|
14
|
+
*/
|
|
15
|
+
import ts from 'typescript';
|
|
16
|
+
/**
|
|
17
|
+
* The text a constant string expression holds, or `null` when the expression is
|
|
18
|
+
* not constant.
|
|
19
|
+
*
|
|
20
|
+
* Four forms, chosen because each one is a spelling of a name that a reader
|
|
21
|
+
* sees and a name-matching check does not: a literal, a `+` chain of them, a
|
|
22
|
+
* template whose every span is one, and `[…].join(…)` over an array of them.
|
|
23
|
+
* Anything reaching an identifier, a property, or any other call answers
|
|
24
|
+
* `null` — resolving those is value tracking, which this tool does not do and
|
|
25
|
+
* which Tier C exists to admit.
|
|
26
|
+
* @param node - the expression, or `undefined` for a missing argument.
|
|
27
|
+
* @returns the text, or `null`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function foldConstantString(node: ts.Node | undefined): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* The Node API that hands back a builtin module without `require` and without
|
|
32
|
+
* an `import` declaration, added in Node 22.3.
|
|
33
|
+
*
|
|
34
|
+
* It reaches the same modules the harness sandbox's `require` trap covers,
|
|
35
|
+
* from a call that sandbox never sees: the sandbox leaves
|
|
36
|
+
* `process` `undefined`, so inside it this expression throws, and a mounted
|
|
37
|
+
* bundle layer is not inside it.
|
|
38
|
+
* @see https://nodejs.org/api/process.html#processgetbuiltinmoduleid
|
|
39
|
+
*/
|
|
40
|
+
export declare const BUILTIN_MODULE_GETTER = "getBuiltinModule";
|
|
41
|
+
/**
|
|
42
|
+
* Whether a call is `process.getBuiltinModule(…)`.
|
|
43
|
+
*
|
|
44
|
+
* The receiver is required. `getBuiltinModule` pulled off `process` and bound
|
|
45
|
+
* to a bare name is not this — it is a detached member, which Tier C reports as
|
|
46
|
+
* dispatch it cannot follow.
|
|
47
|
+
* @param node - the call expression.
|
|
48
|
+
* @returns true when the call loads a builtin through `process`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isBuiltinModuleGetter(node: ts.CallExpression): boolean;
|
|
51
|
+
//# sourceMappingURL=syntax.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-inspector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Know what a DeepSeek Harness plugin does before you install it — static pre-install analysis of a plugin directory or tarball",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ivan Tyshchenko",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"test:coverage": "vitest run --config vitest.config.ts --coverage",
|
|
58
58
|
"inspect": "node --experimental-strip-types src/cli.ts",
|
|
59
59
|
"sweep": "node --experimental-strip-types scripts/ecosystem-sweep.ts",
|
|
60
|
+
"sync": "node --experimental-strip-types scripts/harness-sync.ts",
|
|
60
61
|
"test:e2e": "pnpm run build && vitest run --config vitest.e2e.config.ts"
|
|
61
62
|
}
|
|
62
63
|
}
|