@aqaf/cli 0.0.0-stage → 1.1.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/LICENSE +21 -0
- package/README.md +43 -2
- package/bin/aqaf.js +12 -0
- package/index.js +32 -0
- package/package.json +50 -4
- package/vendor/aqaf/__init__.py +2 -0
- package/vendor/aqaf/__main__.py +3 -0
- package/vendor/aqaf/cli.py +583 -0
- package/vendor/aqaf/data/catalog.json +562 -0
- package/vendor/aqaf/data/packs/automation.json +16 -0
- package/vendor/aqaf/data/packs/mobile.json +13 -0
- package/vendor/aqaf/data/packs/systems.json +17 -0
- package/vendor/aqaf/data/packs/web.json +16 -0
- package/vendor/aqaf/data/profiles/ai_pipeline.json +39 -0
- package/vendor/aqaf/data/profiles/android.json +34 -0
- package/vendor/aqaf/data/profiles/api_backend.json +44 -0
- package/vendor/aqaf/data/profiles/browser_extension.json +29 -0
- package/vendor/aqaf/data/profiles/cli_automation.json +34 -0
- package/vendor/aqaf/data/profiles/desktop_utility.json +39 -0
- package/vendor/aqaf/data/profiles/embedded_iot.json +34 -0
- package/vendor/aqaf/data/profiles/google_apps_script.json +34 -0
- package/vendor/aqaf/data/profiles/mcp_agent_server.json +34 -0
- package/vendor/aqaf/data/profiles/multirepo_system.json +29 -0
- package/vendor/aqaf/data/profiles/npm_library.json +39 -0
- package/vendor/aqaf/data/profiles/rust_app.json +34 -0
- package/vendor/aqaf/data/profiles/saas_or_web_app.json +44 -0
- package/vendor/aqaf/data/profiles/scraper_data_pipeline.json +39 -0
- package/vendor/aqaf/data/profiles/swift_app.json +34 -0
- package/vendor/aqaf/data/profiles/tauri_electron.json +34 -0
- package/vendor/aqaf/data/profiles/unknown_or_general_app.json +25 -0
- package/vendor/aqaf/data/profiles/windows_client_server.json +34 -0
- package/vendor/aqaf/data/profiles/wordpress_plugin.json +39 -0
- package/vendor/aqaf/data/source_registry.json +302 -0
- package/vendor/aqaf/registry.py +124 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AQAF contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aqaf/cli — npm distribution (release candidate / not published)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package exposes the **same Python AQAF analyzer** to JS/TS projects, not a second independent scoring implementation. Requires **Node 18+ and Python 3.9+**. No `postinstall` scripts, network calls or execution of target project code. Never run the analyzer on an untrusted repository via arbitrary user hooks: AQAF only reads data.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install ./aqaf-cli-1.1.0.tgz
|
|
7
|
+
npx aqaf . --format json
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Programmatic Node API:
|
|
11
|
+
|
|
12
|
+
```js
|
|
13
|
+
const { scan } = require('@aqaf/cli');
|
|
14
|
+
const report = scan(process.cwd(), { pack: 'web', profile: 'npm_library' });
|
|
15
|
+
console.log(report.findings);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For a Windows terminal with multiple Python installations set `AQAF_PYTHON`. Package name `@aqaf/cli` is provisional, requires ownership of npm scope. Publish only after name availability, license, package integrity, CI and authority checks.
|
|
19
|
+
|
|
20
|
+
## Owner release preparation
|
|
21
|
+
|
|
22
|
+
The candidate declares public access and the npm registry in `publishConfig`.
|
|
23
|
+
This is configuration, not proof of scope ownership or publication. Repository,
|
|
24
|
+
issue tracker and homepage metadata point to the AQAF project.
|
|
25
|
+
|
|
26
|
+
Build with fresh canonical Python files (Python 3.11+ and npm required):
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
python3 support/aqaf-build/scripts/aqaf_release.py --repo . verify
|
|
30
|
+
python3 support/aqaf-build/scripts/aqaf_release.py --repo . build --targets npm --out /tmp/aqaf-npm-candidate
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run these commands from the owner repository root with a fresh external output
|
|
34
|
+
directory. The helper writes a tarball, checksums and provenance without
|
|
35
|
+
publishing. Test the exact tarball in an isolated consumer before release.
|
|
36
|
+
Owner tasks and approval gates live in `.tasks/001-npm-preparation.md`,
|
|
37
|
+
`.tasks/002-npm-publication.md` and `.tasks/003-chocolatey-release.md`.
|
|
38
|
+
|
|
39
|
+
`make npm-build PYTHON=python3 NPM_OUT=/tmp/aqaf-npm-candidate` additionally runs
|
|
40
|
+
the packaged-consumer validator from `scripts/release/check_npm_candidate.py`.
|
|
41
|
+
To recheck an existing trusted candidate, pass its exact `.tgz` path to that
|
|
42
|
+
script. It never uploads and does not need npm registry credentials. The active
|
|
43
|
+
build-only npm candidate workflow tests Linux/macOS/Windows with Node 18/24 and
|
|
44
|
+
Python 3.9/3.12; configuration alone is not proof those jobs have passed.
|
package/bin/aqaf.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const { invoke } = require('../index');
|
|
4
|
+
try {
|
|
5
|
+
const result = invoke(process.argv.slice(2));
|
|
6
|
+
if (result.stdout) process.stdout.write(result.stdout);
|
|
7
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
8
|
+
process.exitCode = result.status == null ? 1 : result.status;
|
|
9
|
+
} catch (error) {
|
|
10
|
+
console.error('AQAF:', error.message);
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const vendor = path.join(__dirname, 'vendor');
|
|
5
|
+
|
|
6
|
+
function invoke(args, opts = {}) {
|
|
7
|
+
if (!Array.isArray(args) || args.some(v => typeof v !== 'string')) throw new TypeError('args must be an array of strings');
|
|
8
|
+
const pythonCandidates = opts.python ? [opts.python] : process.env.AQAF_PYTHON ? [process.env.AQAF_PYTHON] : (process.platform === 'win32' ? ['py', 'python', 'python3'] : ['python3','python']);
|
|
9
|
+
for (const command of pythonCandidates) {
|
|
10
|
+
const pre = command === 'py' ? ['-3'] : [];
|
|
11
|
+
const env = { ...process.env, ...(opts.env || {}), PYTHONPATH: [vendor, process.env.PYTHONPATH].filter(Boolean).join(path.delimiter) };
|
|
12
|
+
const result = spawnSync(command, [...pre, '-m', 'aqaf', ...args], {
|
|
13
|
+
cwd: opts.cwd || process.cwd(), env, encoding: 'utf8', maxBuffer: 32 * 1024 * 1024,
|
|
14
|
+
stdio: opts.stdio || 'pipe', windowsHide: true
|
|
15
|
+
});
|
|
16
|
+
if (result.error && result.error.code === 'ENOENT') continue;
|
|
17
|
+
if (result.error) throw result.error;
|
|
18
|
+
return { status: result.status, stdout: result.stdout, stderr: result.stderr };
|
|
19
|
+
}
|
|
20
|
+
throw new Error('AQAF npm distribution requires Python 3.9+ on PATH. Set AQAF_PYTHON to an absolute Python executable.');
|
|
21
|
+
}
|
|
22
|
+
function scan(repo, options = {}) {
|
|
23
|
+
const argv = [repo, '--format', 'json', '--output', '-'];
|
|
24
|
+
if (options.profile) argv.push('--profile', options.profile);
|
|
25
|
+
if (options.pack) argv.push('--pack', options.pack);
|
|
26
|
+
for (const capability of (options.capabilities || [])) argv.push('--capability', capability);
|
|
27
|
+
if (options.profileDir) argv.push('--profile-dir', options.profileDir);
|
|
28
|
+
const result = invoke(argv, options);
|
|
29
|
+
if (result.status !== 0) throw new Error(`AQAF scan failed (${result.status}): ${result.stderr}`);
|
|
30
|
+
return JSON.parse(result.stdout);
|
|
31
|
+
}
|
|
32
|
+
module.exports = { invoke, scan };
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aqaf/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Local-first architecture assessment, Node.js distribution wrapper around the bundled AQAF Python engine",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"aqaf": "./bin/aqaf.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"vendor/",
|
|
16
|
+
"index.js",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"os": [
|
|
25
|
+
"darwin",
|
|
26
|
+
"linux",
|
|
27
|
+
"win32"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"architecture",
|
|
31
|
+
"codex",
|
|
32
|
+
"code-review",
|
|
33
|
+
"analysis",
|
|
34
|
+
"software-quality"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"test": "node --test test/*.test.js"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/focsd/aqaf.git",
|
|
42
|
+
"directory": "distribution/npm"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://aqaf.focsd.com",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/focsd/aqaf/issues"
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public",
|
|
50
|
+
"registry": "https://registry.npmjs.org/"
|
|
51
|
+
}
|
|
52
|
+
}
|