@suss/adapter-python 0.3.2-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/grammar/NOTICE ADDED
@@ -0,0 +1,28 @@
1
+ tree-sitter-python.wasm in this directory is built from the
2
+ tree-sitter-python grammar, version 0.23.6:
3
+
4
+ https://github.com/tree-sitter/tree-sitter-python
5
+
6
+ Its license, reproduced in full:
7
+
8
+ The MIT License (MIT)
9
+
10
+ Copyright (c) 2016 Max Brunsfeld
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # grammar/
2
+
3
+ `tree-sitter-python.wasm` is the compiled Python grammar for
4
+ [web-tree-sitter](https://www.npmjs.com/package/web-tree-sitter). It is
5
+ a checked-in binary asset, not a build output: `src/parser.ts` loads it
6
+ by path at run time (`Language.load(...)`), so the file has to exist on
7
+ disk next to the compiled adapter, the same way `web-tree-sitter` ships
8
+ its own core `.wasm` next to its JS.
9
+
10
+ The adapter depends only on `web-tree-sitter` (pure WASM, no native
11
+ bindings, no install script). It does not depend on the
12
+ `tree-sitter-python` npm package, because that package's `install`
13
+ script runs `node-gyp-build` to load a native binding, which is
14
+ unnecessary here and the kind of native-toolchain surface the
15
+ language-adapters proposal rules out. This file is the one part of
16
+ that package v0 actually needs, taken out on its own.
17
+
18
+ Provenance, so a grammar bump is a deliberate, checkable act:
19
+
20
+ - Source: `tree-sitter-python` npm package, version `0.23.6`.
21
+ - File: `tree-sitter-python.wasm` from the package root (built by that
22
+ package's own `tree-sitter build --wasm`, published pre-built).
23
+ - SHA-256: `8c93692fb368e288a5824cee55773c9b3602804f513bda48c97661e52e9c2da2`.
24
+
25
+ tree-sitter-python is MIT-licensed. [`NOTICE`](./NOTICE) in this
26
+ directory reproduces its copyright and permission notice in full, and
27
+ ships in the published tarball alongside the `.wasm` file (both live
28
+ under `grammar/`, which the package's `files` field includes), so the
29
+ attribution its license requires travels with the binary it covers.
30
+
31
+ To pick up a newer grammar: `npm pack tree-sitter-python@<version>`,
32
+ extract it, copy `tree-sitter-python.wasm` here, update the version and
33
+ hash above, check `NOTICE` still matches that version's `LICENSE` file,
34
+ and re-run the adapter's test suite. A grammar change that renames or
35
+ restructures a node type used in `src/ast.ts` will fail loudly there.
36
+ The fuzzer's parse-failure-rate reporting (per the language-adapters
37
+ proposal) is the longer-term signal for when a bump is worth doing.
Binary file
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@suss/adapter-python",
3
+ "version": "0.3.2-0",
4
+ "type": "module",
5
+ "description": "Python language adapter for suss — parses source with tree-sitter (WASM), resolves names with a lexical binder, and emits raw extractions for the suss pipeline.",
6
+ "keywords": [
7
+ "suss",
8
+ "behavioral-summary",
9
+ "static-analysis",
10
+ "python",
11
+ "tree-sitter",
12
+ "ast"
13
+ ],
14
+ "license": "Apache-2.0",
15
+ "author": "Nimbus Cloud AI LLC",
16
+ "homepage": "https://github.com/nimbuscloud-ai/suss/tree/main/packages/adapter/python#readme",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/nimbuscloud-ai/suss.git",
20
+ "directory": "packages/adapter/python"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/nimbuscloud-ai/suss/issues"
24
+ },
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "grammar",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "scripts": {
42
+ "build": "tsup",
43
+ "test": "vitest run",
44
+ "test:coverage": "vitest run --coverage",
45
+ "lint": "biome check .",
46
+ "lint:fix": "biome check --write .",
47
+ "typecheck": "tsc --noEmit"
48
+ },
49
+ "dependencies": {
50
+ "@suss/behavioral-ir": "0.3.2",
51
+ "@suss/datalog": "0.3.2",
52
+ "@suss/extractor": "0.3.2",
53
+ "web-tree-sitter": "^0.26.11"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "*",
57
+ "tsup": "*",
58
+ "typescript": "*",
59
+ "vitest": "*"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ }
64
+ }