@cognivia/cli 0.2.0 → 0.3.0
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 +1 -0
- package/bin/cognivia.mjs +17 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ npm i -g @cognivia/cli
|
|
|
9
9
|
cognivia diagnose --demo # bundled sample data, no key
|
|
10
10
|
cognivia diagnose --input answers.json # your export
|
|
11
11
|
cognivia memory-state <learnerId> # hosted API (needs COGNIVIA_API_KEY)
|
|
12
|
+
cognivia report <learnerId> # a learner's stored state as a readable report
|
|
12
13
|
cognivia content items --input items.json # item -> misconception maps
|
|
13
14
|
cognivia content prerequisites --input pre.json # concept -> prerequisite maps
|
|
14
15
|
```
|
package/bin/cognivia.mjs
CHANGED
|
@@ -49,6 +49,7 @@ Usage:
|
|
|
49
49
|
cognivia diagnose --demo
|
|
50
50
|
cognivia diagnose --input answers.json [--json] [--out file]
|
|
51
51
|
cognivia report --input answers.json [--out report.txt]
|
|
52
|
+
cognivia report <learnerId> (hosted; needs a live key)
|
|
52
53
|
cognivia memory-state --input answers.json
|
|
53
54
|
cognivia memory-state <learnerId> (hosted; needs a live key)
|
|
54
55
|
cognivia content items --input items.json (upload item -> misconception maps)
|
|
@@ -63,8 +64,22 @@ Diagnostics are computed by @cognivia/core, the same engine behind the API, MCP
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
switch (cmd) {
|
|
66
|
-
case "diagnose":
|
|
67
67
|
case "report": {
|
|
68
|
+
// `cognivia report <learnerId>` renders a learner's stored memory state
|
|
69
|
+
// (hosted, needs a live key). Falls through to the attempts-based report.
|
|
70
|
+
const rid = args[1] && !args[1].startsWith("-") ? args[1] : null;
|
|
71
|
+
if (rid) {
|
|
72
|
+
if (!client.hasKey()) fail("report <learnerId> needs COGNIVIA_API_KEY (a live key).");
|
|
73
|
+
try {
|
|
74
|
+
const st = await client.memoryStateRemote(rid);
|
|
75
|
+
out(has("--json") ? JSON.stringify(st, null, 2) : client.renderMemoryState(st));
|
|
76
|
+
} catch (e) { fail("report: " + e.message); }
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
// no id → fall through to the attempts-based report below.
|
|
80
|
+
}
|
|
81
|
+
// eslint-disable-next-line no-fallthrough
|
|
82
|
+
case "diagnose": {
|
|
68
83
|
const attempts = loadAttempts();
|
|
69
84
|
// Use the hosted API when a key is set (unless --demo or --local); else compute locally.
|
|
70
85
|
const useRemote = !has("--demo") && (has("--remote") || (client.hasKey() && !has("--local")));
|
|
@@ -124,7 +139,7 @@ switch (cmd) {
|
|
|
124
139
|
}
|
|
125
140
|
case "--version":
|
|
126
141
|
case "-v":
|
|
127
|
-
console.log("cognivia/0.
|
|
142
|
+
console.log("cognivia/0.3.0 (core " + "0.3.0" + ")");
|
|
128
143
|
break;
|
|
129
144
|
case undefined:
|
|
130
145
|
case "help":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognivia/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Run Cognivia's learning diagnostics from the terminal. Point it at any learning or quiz app's answer export and get back the Learning Genome, per-item diagnosis, and a session report.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "cognivia": "bin/cognivia.mjs" },
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"homepage": "https://cognivia-platform.vercel.app/intelligence",
|
|
10
10
|
"repository": { "type": "git", "url": "git+https://github.com/Manik-Maurya/cognivia-platform.git", "directory": "packages/cli" },
|
|
11
11
|
"engines": { "node": ">=18" },
|
|
12
|
-
"dependencies": { "@cognivia/core": "^0.
|
|
12
|
+
"dependencies": { "@cognivia/core": "^0.3.0" },
|
|
13
13
|
"publishConfig": { "access": "public" },
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": "Manik Maurya"
|