@aiwg/cli 2026.7.17 → 2026.7.18
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 +9 -8
- package/dist/src/artifacts/cli.js +25 -1
- package/dist/src/resources/web-release.js +5 -1
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Joe Magly
|
|
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
|
@@ -4,20 +4,21 @@ Lightweight AIWG CLI for signed, versioned resources from
|
|
|
4
4
|
[`releases.aiwg.io`](https://releases.aiwg.io/).
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
npm install --global @aiwg/cli
|
|
7
|
+
npm install --global @aiwg/cli
|
|
8
8
|
|
|
9
|
-
aiwg discover "architecture evolution"
|
|
10
|
-
|
|
11
|
-
--aiwg-version canary
|
|
9
|
+
aiwg discover "architecture evolution"
|
|
10
|
+
aiwg show skill architecture-evolution
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
## Release status
|
|
15
14
|
|
|
16
15
|
This package follows AIWG CalVer in exact lockstep with the `aiwg` package.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
It selects the signed `stable` web channel automatically when no resource
|
|
17
|
+
flags are supplied. Operators can still select an exact version or another
|
|
18
|
+
channel with `--aiwg-version`, force local resources with
|
|
19
|
+
`--resource-source local`, use verified caching, and perform warm offline
|
|
20
|
+
reads. The larger `aiwg` package remains the local/full distribution while
|
|
21
|
+
web parity is completed for mutating commands such as `use` and `regenerate`.
|
|
21
22
|
|
|
22
23
|
Resource bundles and precomputed indices are distributed by the release host,
|
|
23
24
|
not as additional npm packages.
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
* @tests @test/unit/artifacts/cli.test.ts
|
|
18
18
|
*/
|
|
19
19
|
import path from 'node:path';
|
|
20
|
+
import { readFileSync } from 'node:fs';
|
|
21
|
+
import { fileURLToPath } from 'node:url';
|
|
20
22
|
import { GRAPH_CONFIGS, OPERATIONAL_DISCOVERY_TYPES, OPERATIONAL_SHOW_TYPES, isOperationalShowType, loadUserGraphConfigs, loadGlobalGraphConfigs, orderedGraphEntries, } from './types.js';
|
|
21
23
|
import { SUPPORTED_VIEWS } from './corpus-views/renderers.js';
|
|
22
24
|
import { parseResourceSelector, readVerifiedRegularFile, } from '../resources/web-release.js';
|
|
25
|
+
import { findPackageRoot } from '../cli/find-package-root.js';
|
|
23
26
|
const MAX_RESOURCE_TRUST_ROOT_BYTES = 64 * 1024;
|
|
24
27
|
function webReleaseOptionsFromEnvironment() {
|
|
25
28
|
const baseUrl = process.env.AIWG_RESOURCE_BASE_URL;
|
|
@@ -82,6 +85,27 @@ function parseBackendFlag(args) {
|
|
|
82
85
|
function parseSearchBackendFlag(args) {
|
|
83
86
|
return parseBackendFlag(args) ?? 'fortemi-core';
|
|
84
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* The full `aiwg` package owns a local corpus, while `@aiwg/cli` intentionally
|
|
90
|
+
* ships only executable code and embedded runtime metadata. Select web
|
|
91
|
+
* resources automatically for the lightweight distribution so a normal
|
|
92
|
+
* `aiwg discover` / `aiwg show` invocation works immediately after install.
|
|
93
|
+
*
|
|
94
|
+
* Resolve from this module rather than process.argv so the exported API gets
|
|
95
|
+
* the same package-aware default as the npm binary.
|
|
96
|
+
*/
|
|
97
|
+
function defaultResourceSource() {
|
|
98
|
+
const packageRoot = findPackageRoot(path.dirname(fileURLToPath(import.meta.url)));
|
|
99
|
+
if (!packageRoot)
|
|
100
|
+
return 'local';
|
|
101
|
+
try {
|
|
102
|
+
const manifest = JSON.parse(readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
103
|
+
return manifest.name === '@aiwg/cli' ? 'web' : 'local';
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return 'local';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
85
109
|
function parseResourceSourceFlag(args) {
|
|
86
110
|
const indices = args
|
|
87
111
|
.map((arg, index) => arg === '--resource-source' ? index : -1)
|
|
@@ -91,7 +115,7 @@ function parseResourceSourceFlag(args) {
|
|
|
91
115
|
process.exit(1);
|
|
92
116
|
}
|
|
93
117
|
if (indices.length === 0)
|
|
94
|
-
return
|
|
118
|
+
return defaultResourceSource();
|
|
95
119
|
const value = args[indices[0] + 1];
|
|
96
120
|
if (value === 'local' || value === 'web' || value === 'auto')
|
|
97
121
|
return value;
|
|
@@ -23,7 +23,11 @@ const MAX_SIGNATURE_BYTES = 64 * 1024;
|
|
|
23
23
|
const MAX_COMPLETION_MARKER_BYTES = 4 * 1024;
|
|
24
24
|
const MAX_CHANNEL_CACHE_CANDIDATES = 128;
|
|
25
25
|
const MAX_RELEASE_CACHE_CANDIDATES = 32;
|
|
26
|
-
|
|
26
|
+
// A cold lightweight-CLI install downloads the signed release manifest
|
|
27
|
+
// (~2 MiB) and Fortemi export (~11 MiB today). Fifteen seconds proved too
|
|
28
|
+
// aggressive on otherwise healthy container and remote-network paths. Keep a
|
|
29
|
+
// finite total-request bound, but allow normal first-run transfer variance.
|
|
30
|
+
const RESOURCE_FETCH_TIMEOUT_MS = 60_000;
|
|
27
31
|
function isRecord(value) {
|
|
28
32
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiwg/cli",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.18",
|
|
4
4
|
"description": "Lightweight AIWG CLI for signed, versioned web-backed resources.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"./package.json": "./package.json"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
|
+
"LICENSE",
|
|
26
27
|
"bin/",
|
|
27
28
|
"dist/src/",
|
|
28
29
|
"!dist/**/*.d.ts",
|