@cohesivity/init 0.6.0 → 0.6.1
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 +22 -8
- package/bin/cli.js +17 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,29 +62,35 @@ and existing project pointers follow the same flow as plain init.
|
|
|
62
62
|
Plugin delivery begins with one immutable, pinned manifest. The installer
|
|
63
63
|
checks the manifest's exact byte size and SHA-256 before parsing it, then checks
|
|
64
64
|
the exact byte size and SHA-256 of every selected artifact before extraction.
|
|
65
|
+
These checks apply to the decoded response bytes: HTTP transfer `Content-Length`
|
|
66
|
+
can describe compressed bytes and is not used as a decoded-size claim. Reads
|
|
67
|
+
stop as soon as decoded content exceeds its pin, before hashing or parsing.
|
|
65
68
|
The manifest schema is:
|
|
66
69
|
|
|
67
70
|
```json
|
|
68
71
|
{
|
|
69
72
|
"schema_version": 1,
|
|
70
|
-
"version": "2.1.
|
|
73
|
+
"version": "2.1.1",
|
|
71
74
|
"packages": [
|
|
72
75
|
{
|
|
73
76
|
"client": "portable",
|
|
74
77
|
"immutable_url": "https://immutable.example/portable.tar.gz",
|
|
75
78
|
"size": 1234,
|
|
76
79
|
"sha256": "64 lowercase hexadecimal characters",
|
|
77
|
-
"archive": "cohesivity-portable-2.1.
|
|
80
|
+
"archive": "cohesivity-portable-2.1.1.tar.gz"
|
|
78
81
|
}
|
|
79
82
|
]
|
|
80
83
|
}
|
|
81
84
|
```
|
|
82
85
|
|
|
83
|
-
The
|
|
84
|
-
`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
The installer maps Claude to `claude`; Cursor, OpenClaw, and Hermes to
|
|
87
|
+
`portable`; Codex to `codex`; Gemini to `gemini`; and Antigravity to
|
|
88
|
+
`antigravity`. The 2.1.1 manifest also carries the direct `openai` package,
|
|
89
|
+
which this marketplace-based Codex installer does not select. Extraction
|
|
90
|
+
rejects absolute paths, traversal, links, duplicate paths, special files,
|
|
91
|
+
malformed headers, oversized content, and archives without an end marker.
|
|
92
|
+
Staged portable installs replace the previous directory atomically, with
|
|
93
|
+
rollback if the commit fails.
|
|
88
94
|
|
|
89
95
|
The immutable manifest commit, byte size, and SHA-256 are isolated in the
|
|
90
96
|
`PLUGIN_RELEASE` block in `bin/cli.js`. Tests use the
|
|
@@ -146,7 +152,15 @@ server-issued, and not derived from hardware or user data. Delete
|
|
|
146
152
|
| `--no-plugin` | install only the canonical standalone skill; add no plugin or MCP |
|
|
147
153
|
| `--dry-run` | print exact actions with zero side effects |
|
|
148
154
|
| `--base <url>` | API base for tenant bootstrap (default `https://cohesivity.ai`) |
|
|
149
|
-
| `-h`, `--help` | show command help |
|
|
155
|
+
| `-h`, `--help` | show command help and the exact package version |
|
|
156
|
+
|
|
157
|
+
## 0.6.1 verification fixes
|
|
158
|
+
|
|
159
|
+
Version 0.6.1 accepts an immutable manifest when Node has transparently decoded
|
|
160
|
+
its gzip transfer and the decoded bytes match the size and SHA-256 pins. It
|
|
161
|
+
still rejects decoded oversize, size mismatch, and hash mismatch, pins the final
|
|
162
|
+
Cohesivity plugin 2.1.1 manifest, and makes `--help` identify the exact
|
|
163
|
+
CLI/package version.
|
|
150
164
|
|
|
151
165
|
## Verifying the release
|
|
152
166
|
|
package/bin/cli.js
CHANGED
|
@@ -44,6 +44,7 @@ import { gunzipSync } from 'node:zlib';
|
|
|
44
44
|
const argv = process.argv.slice(2);
|
|
45
45
|
const has = (f) => argv.includes(f);
|
|
46
46
|
const flag = (f) => { const i = argv.indexOf(f); return i >= 0 ? argv[i + 1] : undefined; };
|
|
47
|
+
const PKG_VERSION = '0.6.1';
|
|
47
48
|
|
|
48
49
|
function validateArgs() {
|
|
49
50
|
const switches = new Set(['--dry-run', '--no-plugin', '--no-branding', '--help', '-h']);
|
|
@@ -61,7 +62,6 @@ function validateArgs() {
|
|
|
61
62
|
if (has('--help') || has('-h')) { help(); process.exit(0); }
|
|
62
63
|
|
|
63
64
|
// ── config ──────────────────────────────────────────────────────────────────
|
|
64
|
-
const PKG_VERSION = '0.6.0';
|
|
65
65
|
const BASE = (flag('--base') || process.env.COHESIVITY_BASE || 'https://cohesivity.ai').replace(/\/+$/, '');
|
|
66
66
|
const MCP_URL = 'https://cohesivity.ai/mcp/manage';
|
|
67
67
|
|
|
@@ -85,9 +85,9 @@ const SKILL_URL = `https://raw.githubusercontent.com/cohesivity-org/cohesivity-s
|
|
|
85
85
|
// after publishing a new two-commit artifact manifest from cohesivity-plugin.
|
|
86
86
|
// Tests inject a complete pin with COHESIVITY_PLUGIN_MANIFEST_PIN.
|
|
87
87
|
const PLUGIN_RELEASE = Object.freeze({
|
|
88
|
-
manifestUrl: 'https://raw.githubusercontent.com/cohesivity-org/cohesivity-plugin/
|
|
88
|
+
manifestUrl: 'https://raw.githubusercontent.com/cohesivity-org/cohesivity-plugin/e30d49df188184b9ee4b477210a3a4fdcca47f85/artifacts/v2.1.1/install-manifest.v1.json',
|
|
89
89
|
manifestBytes: 9610,
|
|
90
|
-
manifestSha256: '
|
|
90
|
+
manifestSha256: 'a6be8cac99534be83e52b3c97a93bea5667c3458737eebc8d5c4bd5c44f953bb',
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
const ARTIFACT_KEYS = Object.freeze({
|
|
@@ -397,11 +397,20 @@ function validatePin(url, bytes, sha256, label, injected, maximumBytes) {
|
|
|
397
397
|
async function fetchVerified(url, expectedBytes, expectedSha256, label) {
|
|
398
398
|
const res = await fetch(url, { headers: { 'User-Agent': UA } });
|
|
399
399
|
if (!res.ok) throw new Error(`${label} returned HTTP ${res.status}`);
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
const chunks = [];
|
|
401
|
+
let length = 0;
|
|
402
|
+
const reader = res.body.getReader();
|
|
403
|
+
while (true) {
|
|
404
|
+
const { done, value } = await reader.read();
|
|
405
|
+
if (done) break;
|
|
406
|
+
length += value.byteLength;
|
|
407
|
+
if (length > expectedBytes) {
|
|
408
|
+
try { await reader.cancel(); } catch {}
|
|
409
|
+
throw new Error(`${label} byte size ${length} exceeds pinned ${expectedBytes}`);
|
|
410
|
+
}
|
|
411
|
+
chunks.push(Buffer.from(value));
|
|
403
412
|
}
|
|
404
|
-
const bytes = Buffer.
|
|
413
|
+
const bytes = Buffer.concat(chunks, length);
|
|
405
414
|
if (bytes.length !== expectedBytes) throw new Error(`${label} byte size ${bytes.length} does not match pinned ${expectedBytes}`);
|
|
406
415
|
const digest = createHash('sha256').update(bytes).digest('hex');
|
|
407
416
|
if (digest !== expectedSha256) throw new Error(`${label} SHA-256 does not match its pin`);
|
|
@@ -830,7 +839,7 @@ function versionOf(md) {
|
|
|
830
839
|
|
|
831
840
|
function help() {
|
|
832
841
|
console.log(`
|
|
833
|
-
@cohesivity/init: set up Cohesivity in this project.
|
|
842
|
+
@cohesivity/init v${PKG_VERSION}: set up Cohesivity in this project.
|
|
834
843
|
|
|
835
844
|
Usage:
|
|
836
845
|
npx @cohesivity/init [options]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cohesivity/init",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Set up Cohesivity in a project: install the agent skill, create a managed backend tenant, write the project config. Run with `npx @cohesivity/init`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|