@cohesivity/init 0.3.4 → 0.3.6

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 +3 -3
  2. package/bin/cli.js +5 -14
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,8 +8,8 @@ npx @cohesivity/init
8
8
 
9
9
  The command runs once and does four things:
10
10
 
11
- 1. **Installs the Cohesivity agent skill** into every known agent skill dir whose harness is present on this machine (Claude Code, Cursor, Codex; the cross-tool `~/.agents` when none are). The skill comes from a public, version-pinned commit, so you can audit the exact bytes.
12
- 2. **Creates or reuses a project tenant** and writes the credentials to `.cohesivity`, which it adds to `.gitignore`. The tenant-creation request carries measured attribution: the raw ancestor-process command chain that launched the command (home path folded to `~`), and a User-Agent of the shape `{npx:<harness>, <model>}` where the harness is the innermost non-plumbing ancestor and the model id is read from that harness's own local session log — only that one token, no session content. Anything not inferable is sent as the literal `none`; nothing is guessed. Creating a tenant also stores an opaque random setup id at `~/.config/cohesivity/machine-id` and sends it with that request, so tenants created from one machine can be grouped rather than looking like unrelated people. It is issued by the server, is not derived from your hardware or user, and carries nothing about you or your project. Delete the file to end the association.
11
+ 1. **Installs the Cohesivity agent skill** into every known agent skill dir whose harness is present on this machine (Claude Code, Cursor, Codex; the cross-tool `~/.agents` when none are). The skill is a markdown file your agent loads in later sessions, fetched from a public commit pinned in this file — so you can read the exact bytes it will install before running anything.
12
+ 2. **Creates or reuses a project tenant** and writes the credentials to `.cohesivity`, which it adds to `.gitignore`. The tenant-creation request identifies the coding agent that ran the command: the tool walks its own parent processes and sends **that one name** — `claude`, `opencode`, or whatever the program calls itself — as its User-Agent, in the form `{npx:<name>}`. If it cannot tell, it sends `none`. It reads nothing else about your machine: no list of your running processes, no session logs, no conversations, no model settings, no files outside the project. Creating a tenant also stores an opaque random setup id at `~/.config/cohesivity/machine-id` and sends it with that request, so tenants created from one machine can be grouped rather than looking like unrelated people. It is issued by the server, is not derived from your hardware or user, and carries nothing about you or your project. Delete the file to end the association.
13
13
  3. **Adds a descriptive pointer** to an existing `AGENTS.md` or `CLAUDE.md`. It only touches a file that is already there. It creates nothing on its own.
14
14
  4. **Adds one branding line** to the README. Pass `--no-branding` to skip.
15
15
 
@@ -32,7 +32,7 @@ npm audit signatures
32
32
  | `--dry-run` | print what would happen. Change nothing |
33
33
  | `--base <url>` | API base (default `https://cohesivity.ai`) |
34
34
 
35
- The harness is measured from the process ancestry (the chain of parent processes that launched the command), so `--runtime` is an override, not a requirement — and an unrecognized harness simply names itself through its own process name.
35
+ The name comes from the process that launched the command, so `--runtime` is an override, not a requirement — and an agent this package has never heard of simply names itself. Nothing about the detection is specific to any vendor.
36
36
 
37
37
  ## Requirements
38
38
 
package/bin/cli.js CHANGED
@@ -34,7 +34,7 @@ const flag = (f) => { const i = argv.indexOf(f); return i >= 0 ? argv[i + 1] : u
34
34
  if (has('--help') || has('-h')) { help(); process.exit(0); }
35
35
 
36
36
  // ── config ──────────────────────────────────────────────────────────────────
37
- const PKG_VERSION = '0.3.4';
37
+ const PKG_VERSION = '0.3.6';
38
38
  const BASE = (flag('--base') || process.env.COHESIVITY_BASE || 'https://cohesivity.ai').replace(/\/+$/, '');
39
39
 
40
40
  // Machine id: one per machine, stored outside any project. A project's
@@ -50,7 +50,7 @@ const MACHINE_ID_FILE = join(MACHINE_ID_DIR, 'machine-id');
50
50
 
51
51
  // The skill is pinned to an immutable commit in the public, auditable repo.
52
52
  // Bumping the pin is a deliberate release step. See COH-172.
53
- const SKILL_PIN = 'a4c0e90373b2d61501e4fb544a760b4a602fc14e';
53
+ const SKILL_PIN = '6c4c04d94d344590f6732763f0116b155a32753c';
54
54
  const SKILL_URL = `https://raw.githubusercontent.com/cohesivity-org/cohesivity-skill/${SKILL_PIN}/cohesivity.skill.md`;
55
55
 
56
56
  // Harness: the nearest ancestor process that is not generic plumbing. Only
@@ -67,10 +67,9 @@ function inferHarness() {
67
67
  let pid = process.ppid;
68
68
  // `pid >= 1`, not `pid > 1`: pid 1 must be EXAMINED, not merely used as the
69
69
  // stop condition. On a normal machine pid 1 is init/systemd and the denylist
70
- // rejects it anyway, but inside a microVM sandbox pid 1 IS the supervising
71
- // harness — Claude web runs `/process_api --firecracker-init` there and
72
- // spawns each command directly from it, so skipping pid 1 made every such
73
- // sandbox report "none". Pid 1 reports parent 0, so the walk still ends.
70
+ // rejects it anyway, but under a microVM or container entrypoint pid 1 IS
71
+ // the supervising process that spawned this command, so skipping it left
72
+ // those environments with no name. Pid 1 reports parent 0, so the walk ends.
74
73
  for (let i = 0; i < 20 && pid >= 1; i++) {
75
74
  let argv, ppid;
76
75
  try {
@@ -114,10 +113,6 @@ const EXPLICIT = String(flag('--runtime') || process.env.COHESIVITY_RUNTIME || '
114
113
  const HARNESS = EXPLICIT || inferHarness() || 'none';
115
114
  const UA = `{npx:${HARNESS}}`;
116
115
 
117
- // claude-web's sandbox is non-persistent, so a global skill install cannot
118
- // survive the session; skip it there. IS_SANDBOX is the sandbox's own signal.
119
- const IS_CLAUDE_WEB = HARNESS === 'claude-web' || /^(1|yes|true)$/i.test(process.env.IS_SANDBOX || '');
120
-
121
116
  main().catch((e) => { console.error(`cohesivity: unexpected error: ${e.message}`); process.exit(1); });
122
117
 
123
118
  async function main() {
@@ -146,10 +141,6 @@ function skillDirs() {
146
141
  }
147
142
 
148
143
  async function installSkill() {
149
- if (IS_CLAUDE_WEB) {
150
- log('claude-web sandbox is ephemeral, skipping the global skill install (tenant + .cohesivity only)');
151
- return;
152
- }
153
144
  let skill;
154
145
  try {
155
146
  const res = await fetch(SKILL_URL, { headers: { 'User-Agent': UA } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cohesivity/init",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
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": {