@cohesivity/init 0.6.0 → 0.6.2

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.
Files changed (3) hide show
  1. package/README.md +29 -8
  2. package/bin/cli.js +17 -8
  3. 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.0",
73
+ "version": "2.1.2",
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.0.tar.gz"
80
+ "archive": "cohesivity-portable-2.1.2.tar.gz"
78
81
  }
79
82
  ]
80
83
  }
81
84
  ```
82
85
 
83
- The required artifact keys are `claude`, `portable`, `codex`, `gemini`, and
84
- `antigravity`. Extraction rejects absolute paths, traversal, links, duplicate paths,
85
- special files, malformed headers, oversized content, and archives without an
86
- end marker. Staged portable installs replace the previous directory atomically,
87
- with rollback if the commit fails.
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.2 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,22 @@ 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.2 status projection pin
158
+
159
+ Version 0.6.2 pins Cohesivity plugin 2.1.2. Its local `tenant_status` tool
160
+ preserves the Management API's bounded `resource_name` and scalar `status`
161
+ while continuing to exclude credentials, connection details, provider
162
+ metadata, URLs, and arbitrary nested input.
163
+
164
+ ## 0.6.1 verification fixes
165
+
166
+ Version 0.6.1 accepts an immutable manifest when Node has transparently decoded
167
+ its gzip transfer and the decoded bytes match the size and SHA-256 pins. It
168
+ still rejects decoded oversize, size mismatch, and hash mismatch, pins the final
169
+ Cohesivity plugin 2.1.1 manifest, and makes `--help` identify the exact
170
+ CLI/package version.
150
171
 
151
172
  ## Verifying the release
152
173
 
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.2';
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/621beb765f34ea082ad8a9ff59488cd432aa0099/artifacts/v2.1.0/install-manifest.v1.json',
88
+ manifestUrl: 'https://raw.githubusercontent.com/cohesivity-org/cohesivity-plugin/bdd58ad560102689ac0cc7680ae2aa5b2273b3c5/artifacts/v2.1.2/install-manifest.v1.json',
89
89
  manifestBytes: 9610,
90
- manifestSha256: '403ecc59865f752fdc7f647104d6006588be834a1e285c94f2f70e18144e34cd',
90
+ manifestSha256: '2c289bb82a650e2f0fa46e11978e635ab4f2e9eb2b3c75656f1ef571a83b0d1b',
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 claimed = res.headers?.get?.('content-length');
401
- if (claimed !== null && claimed !== undefined && /^\d+$/.test(claimed) && Number(claimed) !== expectedBytes) {
402
- throw new Error(`${label} Content-Length ${claimed} does not match pinned ${expectedBytes}`);
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.from(await res.arrayBuffer());
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.0",
3
+ "version": "0.6.2",
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": {