cognetivy 0.1.4 → 0.1.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.
package/README.md CHANGED
@@ -1,95 +1,108 @@
1
- # cognetivy
1
+ # Cognetivy
2
2
 
3
- **Workflow and reasoning state for AI coding assistants.** Define workflows, track runs and events, store structured artifacts — no LLMs inside, just the state layer that Cursor, Claude Code, OpenClaw (and other MCP clients) can read and write.
3
+ ![Cognetivy Studio: workflow canvas, run details, and data collected](studio_example.jpg)
4
4
 
5
- - **Local workspace** one `.cognetivy/` per project; config in `~/.config/cognetivy` or `.cognetivy/config.json`.
6
- - **MCP server** — expose workflow, runs, artifacts, and skills to your editor/agent.
7
- - **Studio** — read-only browser UI for workflow, runs, and artifacts.
8
- - **Skills** — install and manage SKILL.md-based skills for **Cursor**, **Claude Code**, and **OpenClaw** from one place.
5
+ Cognetivy is an open-source state layer for AI-assisted development: define workflows, track runs and events, and store structured collections in a local `.cognetivy/` workspace. No LLMs inside - just the data and tools your editor's agent uses via [Skills](https://agentskills.io/) and [MCP](https://agentskills.io/). Works with **Cursor**, **Claude Code**, **OpenClaw**, and other MCP-compatible clients.
6
+
7
+ ## Requirements
8
+
9
+ - **Node.js** ≥ 18
10
+ - A project directory (or an empty folder) to create a workspace in
11
+ - A coding agent (Cursor, Claude Code, OpenClaw, etc.) working on that directory
9
12
 
10
13
  ---
11
14
 
12
15
  ## Install
13
16
 
17
+ Run once with npx (no global install):
18
+
19
+ ```bash
20
+ npx cognetivy
21
+ ```
22
+
23
+ Or install globally for use from any directory and for MCP:
24
+
14
25
  ```bash
15
26
  npm install -g cognetivy
16
27
  ```
17
28
 
18
29
  ---
19
30
 
20
- ## Quick start
31
+ ## Step-by-step
32
+
33
+ ### Step 1 - Run cognetivy
34
+
35
+ Open a terminal in your project folder (or an empty folder) and run, an installer will open in the terminal:
21
36
 
22
37
  ```bash
23
- cognetivy init
24
- cognetivy studio
38
+ npx cognetivy
25
39
  ```
26
40
 
27
- `init` creates `.cognetivy/` and can install skills into Cursor / Claude Code / OpenClaw. `studio` opens the read-only UI in your browser.
41
+ ---
28
42
 
29
- **Essential commands:**
43
+ ### Step 2 - Use the installer
30
44
 
31
- | Command | What it does |
32
- |--------|----------------|
33
- | `cognetivy init` | Create workspace (and optionally install skills) |
34
- | `cognetivy workflow get` | Show current workflow |
35
- | `cognetivy run start --input <json>` | Start a run |
36
- | `cognetivy studio` | Open Studio UI |
37
- | `cognetivy mcp` | Start MCP server (for Cursor / Claude Code / OpenClaw) |
45
+ 1. In the installer, choose your coding agent (Claude Code, Cursor, OpenClaw, etc.)
46
+ 2. Cognetivy will create a `.cognetivy/` workspace in the current folder.
47
+ 3. Cognetivy will install its skills into the workspace.
38
48
 
39
49
  ---
40
50
 
41
- ## For Cursor, Claude Code, and OpenClaw
51
+ ### Step 3 - Studio opens
42
52
 
43
- **MCP** So the AI can read/write workflow, runs, and artifacts:
53
+ When the installer finishes, Cognetivy Studio opens in your browser.
44
54
 
45
- 1. Install: `npm install -g cognetivy`
46
- 2. Add MCP server (Cursor: **Settings → Tools & MCP → Add new**):
47
- - **Command:** `cognetivy`
48
- - **Args:** `mcp` (or `mcp`, `--workspace`, `/path/to/project` if needed)
49
- 3. Restart the editor. Cognetivy tools will show up in chat.
55
+ - You’ll see the read-only UI: workflow, runs, and collections.
50
56
 
51
- **Skills** — Install SKILL.md skills into each environment:
57
+ ---
52
58
 
53
- - **Cursor:** `cognetivy install cursor` (installs to `.cursor/skills`)
54
- - **Claude Code:** `cognetivy install claude`
55
- - **OpenClaw:** `cognetivy install openclaw`
56
- - **Project-only:** `cognetivy install workspace` (installs to `.cognetivy/skills`)
59
+ ### Step 4 - Ask your agent to create a workflow and run it
57
60
 
58
- List and manage skills: `cognetivy skills list`, `cognetivy skills info <name>`, `cognetivy skills install`, `cognetivy skills update`.
61
+ In another chat window, ask your agent to create a workflow and run it.
59
62
 
60
- ---
63
+ - "Create a workflow with three nodes: one that gathers requirements, one that writes a plan, and one that writes a summary. Save it as the current workflow."
64
+ - "Start a run for the current workflow with input with the topic 'user onboarding'."
61
65
 
62
- ## More commands
66
+ ## Connect your agent (MCP)
63
67
 
64
- - **Workflow:** `workflow set --file <path>`
65
- - **Runs:** `run status --run <id>`, `run set-name --run <id> --name "..."`
66
- - **Events:** `event append --run <id> [--file <path>]`
67
- - **Nodes:** `node start`, `node complete` (for step lifecycle)
68
- - **Mutations:** `mutate propose --patch <path> --reason "..."`, `mutate apply <id>`
69
- - **Artifacts:** `artifact-schema get/set`, `artifact list/get/set/append`
70
- - **Studio API only:** `cognetivy studio --api-only` (for dev with Vite)
68
+ Cognetivy works best with **agent skills**, but you can connect via **MCP** so cognetivy tools appear in chat.
71
69
 
72
- ---
70
+ ### Cursor
73
71
 
74
- ## Development
72
+ 1. Open **Settings** → **Tools & MCP** (or **Features** → **MCP**).
73
+ 2. Click **Add new MCP server**.
74
+ 3. Set **Name** to `cognetivy`.
75
+ 4. Set **Command** to `cognetivy` (or the full path if not on PATH).
76
+ 5. Set **Arguments** to `mcp`. If your project root is not the folder that contains `.cognetivy/`, add `--workspace` and the path to that folder (e.g. `--workspace ./example-usage`).
77
+ 6. Save and restart Cursor.
75
78
 
76
- ```bash
77
- cd cli && npm install && npm run build && npm test
78
- ```
79
+ Cognetivy tools (workflow, run, event, collection, node, etc.) will then be available in chat.
79
80
 
80
- Embed Studio in the CLI build: `npm run build:full`.
81
+ **Optional config file:** You can instead add the server to `~/.cursor/mcp.json` (or your project’s `.cursor/mcp.json`):
81
82
 
82
- ### Publish a new version
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "cognetivy": {
87
+ "command": "cognetivy",
88
+ "args": ["mcp"]
89
+ }
90
+ }
91
+ }
92
+ ```
83
93
 
84
- From the `cli` directory, with a clean working tree:
94
+ Use `"args": ["mcp", "--workspace", "/path/to/folder/with/.cognetivy"]` if the workspace is not your current project root.
85
95
 
86
- ```bash
87
- npm run release # bump patch (0.1.3 → 0.1.4) and publish
88
- npm run release:minor # bump minor (0.1.3 → 0.2.0) and publish
89
- npm run release:major # bump major (0.1.3 → 1.0.0) and publish
90
- ```
96
+ ## Commands
91
97
 
92
- Then push the new commit and tag: `git push && git push --tags`.
98
+ | Command | Description |
99
+ |--------|-------------|
100
+ | `npx cognetivy` | Run installer and open Studio (first time) or open Studio |
101
+ | `cognetivy workflow get` | Print current workflow |
102
+ | `cognetivy run start --input <file>` | Start a run |
103
+ | `cognetivy studio` | Open Studio in the browser |
104
+ | `cognetivy mcp` | Start MCP server (for your editor) |
105
+ | `cognetivy install cursor` | Install skills into Cursor (`claude`, `openclaw`, `workspace` also supported) |
93
106
 
94
107
  ---
95
108
 
package/dist/cli.js CHANGED
@@ -51,7 +51,7 @@ async function launchStudio(workspacePath, port = STUDIO_DEFAULT_PORT) {
51
51
  }
52
52
  program
53
53
  .name("cognetivy")
54
- .description("Reasoning orchestration state workflow, runs, events, collections (no LLMs). Run with no command: init workspace if missing, then open Studio.")
54
+ .description("Reasoning orchestration state - workflow, runs, events, collections (no LLMs). Run with no command: init workspace if missing, then open Studio.")
55
55
  .version("0.1.0");
56
56
  program
57
57
  .command("init")
@@ -317,7 +317,7 @@ runCmd
317
317
  const nr = nodeResultByNodeId.get(node.id);
318
318
  nodesList.push({
319
319
  node_id: node.id,
320
- status: nr?.status ?? "",
320
+ status: nr?.status ?? "-",
321
321
  completed_at: nr?.completed_at,
322
322
  });
323
323
  }
@@ -443,7 +443,7 @@ collectionSchemaCmd
443
443
  });
444
444
  const collectionCmd = program
445
445
  .command("collection")
446
- .description("Structured collections per run (sources, ideas schema-backed)");
446
+ .description("Structured collections per run (sources, ideas - schema-backed)");
447
447
  collectionCmd
448
448
  .command("list")
449
449
  .description("List collection kinds that have data for a run")
package/dist/mcp.js CHANGED
@@ -146,7 +146,7 @@ const TOOLS = [
146
146
  },
147
147
  {
148
148
  name: "collection_set",
149
- description: "Replace all collections of a kind for a run. Items are validated against schema. If kind is unknown or validation fails, error includes schemause collection_schema_add_kind first. Use **Markdown** for long text fields (summaries, theses, descriptions, reasons) so Studio renders them as rich text.",
149
+ description: "Replace all collections of a kind for a run. Items are validated against schema. If kind is unknown or validation fails, error includes schema-use collection_schema_add_kind first. Use **Markdown** for long text fields (summaries, theses, descriptions, reasons) so Studio renders them as rich text.",
150
150
  inputSchema: {
151
151
  type: "object",
152
152
  properties: {
@@ -391,7 +391,7 @@ async function handleToolsCall(name, args, cwd) {
391
391
  const nr = nodeResultByNodeId.get(node.id);
392
392
  nodesList.push({
393
393
  node_id: node.id,
394
- status: nr?.status ?? "",
394
+ status: nr?.status ?? "-",
395
395
  completed_at: nr?.completed_at,
396
396
  });
397
397
  }
package/dist/skills.js CHANGED
@@ -335,11 +335,11 @@ Workflows, runs, node results, and schema-backed collections. Run commands from
335
335
  \`\`\`
336
336
  Capture \`run_id\` (first line) or \`COGNETIVY_RUN_ID=...\` (second line).
337
337
 
338
- 2. **Inspect workflow**: \`cognetivy workflow get\` note \`nodes[].id\`, \`input_collections\`, \`output_collections\`.
338
+ 2. **Inspect workflow**: \`cognetivy workflow get\` - note \`nodes[].id\`, \`input_collections\`, \`output_collections\`.
339
339
 
340
340
  3. **Schema**: \`cognetivy collection-schema get\`. Add missing kinds with \`collection-schema set\` so output collections exist.
341
341
 
342
- 4. **For each node:** Do the work, then **one call** \`node complete\`:
342
+ 4. **For each node:** Do the work, then **one call** - \`node complete\`:
343
343
  \`\`\`bash
344
344
  cognetivy node complete --run <run_id> --node <node_id> --status completed [--output "text" | --output-file path] [--collection-kind <kind>]
345
345
  \`\`\`
@@ -357,11 +357,11 @@ Workflows, runs, node results, and schema-backed collections. Run commands from
357
357
 
358
358
  ## Runs
359
359
 
360
- \`run start\` (prints \`run_id\`, seeds \`run_input\`), \`run status --run <id> [--json]\` (nodes + collection counts use to verify), \`run complete\`, \`run set-name\`.
360
+ \`run start\` (prints \`run_id\`, seeds \`run_input\`), \`run status --run <id> [--json]\` (nodes + collection counts - use to verify), \`run complete\`, \`run set-name\`.
361
361
 
362
362
  ## Events
363
363
 
364
- \`event append --run <run_id> [--file <path>]\` omit \`--file\` to read from stdin. Event JSON: \`type\`, \`data\` (for step events set \`data.step\` = node id). E.g. \`echo '{"type":"step_completed","data":{"step":"synthesize"}}' | cognetivy event append --run <run_id>\`.
364
+ \`event append --run <run_id> [--file <path>]\` - omit \`--file\` to read from stdin. Event JSON: \`type\`, \`data\` (for step events set \`data.step\` = node id). E.g. \`echo '{"type":"step_completed","data":{"step":"synthesize"}}' | cognetivy event append --run <run_id>\`.
365
365
 
366
366
  ## Node results
367
367
 
@@ -374,7 +374,7 @@ Usually covered by \`node complete\`. For inspect or when not using it: \`node-r
374
374
  \`collection-schema get\` / \`set --file\` (kinds + \`item_schema\`). \`collection list --run <id>\`, \`collection get --run <id> --kind <kind>\`. \`collection set\` / \`collection append\` need \`--node\` and \`--node-result\` (or use \`node complete --collection-kind\` which creates the result). Omit \`--file\` to read from stdin.
375
375
  - **Many items:** Prefer incremental \`collection append\` or \`node complete\` per item instead of one large \`collection set\`. Use Markdown in long text fields for Studio.
376
376
 
377
- **Payload:** Must match \`item_schema\` for the kind; do not include \`created_at\`, \`created_by_node_id\` cognetivy adds them.
377
+ **Payload:** Must match \`item_schema\` for the kind; do not include \`created_at\`, \`created_by_node_id\` - cognetivy adds them.
378
378
 
379
379
  ---
380
380
 
@@ -392,7 +392,7 @@ Usually covered by \`node complete\`. For inspect or when not using it: \`node-r
392
392
  ## Performance
393
393
 
394
394
  - **Smaller context:** Per-item extraction (e.g. per-video) over all-at-once when a node maps over a list.
395
- - **Parallel sub-agents:** For data-parallel nodes (e.g. 10 transcripts), spawning one agent per item in parallel can yield ~10x wall-clock speedup highest-leverage for map-over-list workflows.
395
+ - **Parallel sub-agents:** For data-parallel nodes (e.g. 10 transcripts), spawning one agent per item in parallel can yield ~10x wall-clock speedup - highest-leverage for map-over-list workflows.
396
396
  - **Structured output:** Future extensions may enforce "output must match this schema" so the agent skips manual schema-checking.
397
397
  `;
398
398
  }
@@ -403,42 +403,42 @@ function getCognetivyReferenceContent() {
403
403
  Full command reference. Use from project root (directory containing \`.cognetivy/\`).
404
404
 
405
405
  ## workflow
406
- - \`cognetivy workflow list\` list workflows.
407
- - \`cognetivy workflow create --name <string> [--id <string>] [--description <string>]\` create a workflow (creates v1 and default schema).
408
- - \`cognetivy workflow select --workflow <workflow_id>\` select current workflow.
409
- - \`cognetivy workflow versions [--workflow <workflow_id>]\` list versions for a workflow.
410
- - \`cognetivy workflow get [--workflow <workflow_id>] [--version <version_id>]\` print a workflow version JSON.
411
- - \`cognetivy workflow set --file <path> [--workflow <workflow_id>] [--name <string>]\` set workflow version from JSON file (creates new version and sets it current).
406
+ - \`cognetivy workflow list\` - list workflows.
407
+ - \`cognetivy workflow create --name <string> [--id <string>] [--description <string>]\` - create a workflow (creates v1 and default schema).
408
+ - \`cognetivy workflow select --workflow <workflow_id>\` - select current workflow.
409
+ - \`cognetivy workflow versions [--workflow <workflow_id>]\` - list versions for a workflow.
410
+ - \`cognetivy workflow get [--workflow <workflow_id>] [--version <version_id>]\` - print a workflow version JSON.
411
+ - \`cognetivy workflow set --file <path> [--workflow <workflow_id>] [--name <string>]\` - set workflow version from JSON file (creates new version and sets it current).
412
412
 
413
413
  ## run
414
- - \`cognetivy run start --input <path> [--name <string>] ...\` start run; prints run_id (seeds run_input + __system__).
415
- - \`cognetivy run status --run <run_id> [--json]\` node completion + collection item counts.
414
+ - \`cognetivy run start --input <path> [--name <string>] ...\` - start run; prints run_id (seeds run_input + __system__).
415
+ - \`cognetivy run status --run <run_id> [--json]\` - node completion + collection item counts.
416
416
  - \`cognetivy run complete --run <run_id>\`, \`run set-name --run <run_id> --name <string>\`.
417
417
 
418
418
  ## node
419
- - \`cognetivy node start --run <run_id> --node <node_id>\` step_started + started node result; prints COGNETIVY_NODE_RESULT_ID.
420
- - \`cognetivy node complete --run <run_id> --node <node_id> --status completed [--output ...] [--collection-kind <kind>]\` node result + optional collection (omit --collection-file to read from stdin) + step_completed.
419
+ - \`cognetivy node start --run <run_id> --node <node_id>\` - step_started + started node result; prints COGNETIVY_NODE_RESULT_ID.
420
+ - \`cognetivy node complete --run <run_id> --node <node_id> --status completed [--output ...] [--collection-kind <kind>]\` - node result + optional collection (omit --collection-file to read from stdin) + step_completed.
421
421
 
422
422
  ## event
423
- - \`cognetivy event append --run <run_id> [--file <path>] [--by <string>]\` append event (omit --file to read from stdin). Step events: data.step = node id.
423
+ - \`cognetivy event append --run <run_id> [--file <path>] [--by <string>]\` - append event (omit --file to read from stdin). Step events: data.step = node id.
424
424
 
425
425
  ## collection-schema
426
- - \`cognetivy collection-schema get [--workflow <workflow_id>]\` print workflow-scoped schema (kinds, item_schema, references).
427
- - \`cognetivy collection-schema set --file <path> [--workflow <workflow_id>]\` set schema from JSON.
426
+ - \`cognetivy collection-schema get [--workflow <workflow_id>]\` - print workflow-scoped schema (kinds, item_schema, references).
427
+ - \`cognetivy collection-schema set --file <path> [--workflow <workflow_id>]\` - set schema from JSON.
428
428
 
429
429
  ## collection
430
- - \`cognetivy collection list --run <run_id>\` list kinds that have data for run.
431
- - \`cognetivy collection get --run <run_id> --kind <kind>\` get all items of kind.
432
- - \`cognetivy collection set --run <run_id> --kind <kind> [--file <path>] --node <node_id> --node-result <node_result_id>\` replace items (omit --file for stdin).
433
- - \`cognetivy collection append --run <run_id> --kind <kind> [--file <path>] --node <node_id> --node-result <node_result_id> [--id <id>]\` append one item (omit --file for stdin).
430
+ - \`cognetivy collection list --run <run_id>\` - list kinds that have data for run.
431
+ - \`cognetivy collection get --run <run_id> --kind <kind>\` - get all items of kind.
432
+ - \`cognetivy collection set --run <run_id> --kind <kind> [--file <path>] --node <node_id> --node-result <node_result_id>\` - replace items (omit --file for stdin).
433
+ - \`cognetivy collection append --run <run_id> --kind <kind> [--file <path>] --node <node_id> --node-result <node_result_id> [--id <id>]\` - append one item (omit --file for stdin).
434
434
 
435
435
  ## node-result
436
- - \`cognetivy node-result list --run <run_id>\` list node results for run.
437
- - \`cognetivy node-result get --run <run_id> --node <node_id>\` get node result.
438
- - \`cognetivy node-result set --run <run_id> --node <node_id> --status <started|completed|failed|needs_human> [--id <node_result_id>] [--output-file <path> | --output <string>]\` set node result.
436
+ - \`cognetivy node-result list --run <run_id>\` - list node results for run.
437
+ - \`cognetivy node-result get --run <run_id> --node <node_id>\` - get node result.
438
+ - \`cognetivy node-result set --run <run_id> --node <node_id> --status <started|completed|failed|needs_human> [--id <node_result_id>] [--output-file <path> | --output <string>]\` - set node result.
439
439
 
440
440
  ## studio
441
- - \`cognetivy studio [--workspace <path>] [--port <port>]\` open read-only Studio (workflow, runs, events, collections) in browser.
441
+ - \`cognetivy studio [--workspace <path>] [--port <port>]\` - open read-only Studio (workflow, runs, events, collections) in browser.
442
442
  `;
443
443
  }
444
444
  const REFERENCE_FILENAME = "REFERENCE.md";
@@ -98,7 +98,7 @@ async function handleApi(cwd, method, pathname, res, body, searchParams) {
98
98
  }
99
99
  const apiMatch = pathname.replace(/^\/api\/?/, "").split("/").filter(Boolean);
100
100
  try {
101
- // PATCH /api/runs/:id update run name
101
+ // PATCH /api/runs/:id - update run name
102
102
  if (method === "PATCH" && apiMatch[0] === "runs" && apiMatch.length === 2) {
103
103
  const runId = apiMatch[1];
104
104
  if (!(await runExists(runId, cwd))) {
package/dist/workspace.js CHANGED
@@ -14,7 +14,7 @@ export const EVENTS_DIR = "events";
14
14
  export const COLLECTIONS_DIR = "collections";
15
15
  export const NODE_RESULTS_DIR = "node-results";
16
16
  const GITIGNORE_SNIPPET = `
17
- # cognetivy ignore runtime data; commit workflows/*/versions/
17
+ # cognetivy - ignore runtime data; commit workflows/*/versions/
18
18
  .cognetivy/runs/
19
19
  .cognetivy/events/
20
20
  .cognetivy/collections/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognetivy",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Reasoning orchestration state: workflow structure, run logs, and versioned mutations",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,6 +46,7 @@
46
46
  },
47
47
  "files": [
48
48
  "dist",
49
- "README.md"
49
+ "README.md",
50
+ "studio_example.jpg"
50
51
  ]
51
52
  }
Binary file