@liduchuan/atlas-loop 0.1.0 → 0.1.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 +38 -20
- package/SKILL.md +9 -7
- package/assets/viewer-shell.html +851 -325
- package/bin/atlas-loop.mjs +16 -10
- package/package.json +14 -2
- package/references/schema.md +11 -11
- package/scripts/build_atlas.mjs +1 -1
- package/template/app.jsx +1339 -0
- package/template/build-shell.mjs +82 -0
- package/template/dev-server.mjs +177 -0
- package/template/sample-data.json +253 -0
- package/template/styles.css +1188 -0
package/bin/atlas-loop.mjs
CHANGED
|
@@ -11,29 +11,31 @@ const PKG_ROOT = path.resolve(__dirname, '..');
|
|
|
11
11
|
function readVersion() {
|
|
12
12
|
try {
|
|
13
13
|
const pkg = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf8'));
|
|
14
|
-
return pkg.version || '0.1.
|
|
14
|
+
return pkg.version || '0.1.1';
|
|
15
15
|
} catch (_) {
|
|
16
|
-
return '0.1.
|
|
16
|
+
return '0.1.1';
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function printHelp() {
|
|
21
|
-
console.log(
|
|
21
|
+
console.log(`Atlas Loop (@liduchuan/atlas-loop v${readVersion()})
|
|
22
22
|
|
|
23
23
|
Usage:
|
|
24
24
|
npx @liduchuan/atlas-loop install [--dir <skills-dir>]
|
|
25
|
+
npx @liduchuan/atlas-loop dev [--port 5179] [--data <graph-data.json>]
|
|
25
26
|
npx @liduchuan/atlas-loop build --data <graph-data.json> [--out <output.html>]
|
|
26
27
|
npx @liduchuan/atlas-loop verify --html <output.html>
|
|
27
28
|
|
|
28
29
|
Commands:
|
|
29
30
|
install Copy the atlas-loop skill into an Agent skills directory (default: ~/.agents/skills/atlas-loop)
|
|
31
|
+
dev Launch the local live-reload runtime for template & style debugging
|
|
30
32
|
build Validate AtlasGraphData JSON and synthesize a standalone offline HTML learning map
|
|
31
33
|
verify Run headless Playwright verification against a generated HTML learning map
|
|
32
34
|
`);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
function copySkillFiles(destDir) {
|
|
36
|
-
const items = ['SKILL.md', 'assets', 'references', 'scripts'];
|
|
38
|
+
const items = ['SKILL.md', 'assets', 'references', 'scripts', 'template'];
|
|
37
39
|
fs.mkdirSync(destDir, { recursive: true });
|
|
38
40
|
for (const name of items) {
|
|
39
41
|
const src = path.join(PKG_ROOT, name);
|
|
@@ -54,9 +56,9 @@ function resolveInstallDir(args) {
|
|
|
54
56
|
return path.join(os.homedir(), '.agents', 'skills', 'atlas-loop');
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
function
|
|
58
|
-
const
|
|
59
|
-
const res = spawnSync(process.execPath, [
|
|
59
|
+
function runNodeFile(relFilePath, forwardArgs) {
|
|
60
|
+
const fullPath = path.join(PKG_ROOT, relFilePath);
|
|
61
|
+
const res = spawnSync(process.execPath, [fullPath, ...forwardArgs], { stdio: 'inherit' });
|
|
60
62
|
process.exit(res.status ?? 1);
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -76,16 +78,20 @@ if (cmd === '-v' || cmd === '--version' || cmd === 'version') {
|
|
|
76
78
|
if (cmd === 'install') {
|
|
77
79
|
const dest = resolveInstallDir(argv.slice(1));
|
|
78
80
|
copySkillFiles(dest);
|
|
79
|
-
console.log(`Installed
|
|
81
|
+
console.log(`Installed Atlas Loop skill to: ${dest}`);
|
|
80
82
|
process.exit(0);
|
|
81
83
|
}
|
|
82
84
|
|
|
85
|
+
if (cmd === 'dev') {
|
|
86
|
+
runNodeFile(path.join('template', 'dev-server.mjs'), argv.slice(1));
|
|
87
|
+
}
|
|
88
|
+
|
|
83
89
|
if (cmd === 'build') {
|
|
84
|
-
|
|
90
|
+
runNodeFile(path.join('scripts', 'build_atlas.mjs'), argv.slice(1));
|
|
85
91
|
}
|
|
86
92
|
|
|
87
93
|
if (cmd === 'verify') {
|
|
88
|
-
|
|
94
|
+
runNodeFile(path.join('scripts', 'verify_atlas.mjs'), argv.slice(1));
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
console.error(`Unknown command: ${cmd}\n`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liduchuan/atlas-loop",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Universal recursive learning-map Agent Skill
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Atlas Loop — Universal recursive learning-map Agent Skill that dissects any unfamiliar subject into a standalone offline interactive HTML atlas with per-node deep-dive and recursive sub-atlas prompts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "liduchuan",
|
|
@@ -16,12 +16,17 @@
|
|
|
16
16
|
"bin": {
|
|
17
17
|
"atlas-loop": "bin/atlas-loop.mjs"
|
|
18
18
|
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "node template/dev-server.mjs",
|
|
21
|
+
"build:shell": "node template/build-shell.mjs"
|
|
22
|
+
},
|
|
19
23
|
"files": [
|
|
20
24
|
"SKILL.md",
|
|
21
25
|
"README.md",
|
|
22
26
|
"assets",
|
|
23
27
|
"references",
|
|
24
28
|
"scripts",
|
|
29
|
+
"template",
|
|
25
30
|
"bin"
|
|
26
31
|
],
|
|
27
32
|
"keywords": [
|
|
@@ -33,6 +38,13 @@
|
|
|
33
38
|
"react-flow",
|
|
34
39
|
"atlas-loop"
|
|
35
40
|
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@dagrejs/dagre": "^1.1.8",
|
|
43
|
+
"@xyflow/react": "^12.12.1",
|
|
44
|
+
"esbuild": "^0.25.0",
|
|
45
|
+
"react": "^18.3.1",
|
|
46
|
+
"react-dom": "^18.3.1"
|
|
47
|
+
},
|
|
36
48
|
"engines": {
|
|
37
49
|
"node": ">=18.0.0"
|
|
38
50
|
},
|
package/references/schema.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Atlas Loop Graph Data Schema (`AtlasGraphData` v2)
|
|
2
2
|
|
|
3
3
|
`scripts/build_atlas.mjs` consumes a UTF-8 JSON file matching this schema and injects it into `assets/viewer-shell.html` to produce a standalone, zero-CDN offline `.html` file.
|
|
4
4
|
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"askPrompts": [
|
|
33
33
|
{
|
|
34
34
|
"title": "Focused follow-up title",
|
|
35
|
-
"prompt": "Concrete, context-anchored deep-dive question (>= 20 chars)
|
|
35
|
+
"prompt": "Concrete, context-anchored deep-dive question (>= 20 chars)…"
|
|
36
36
|
}
|
|
37
37
|
],
|
|
38
|
-
"subAtlasPrompt": "
|
|
38
|
+
"subAtlasPrompt": "Use Atlas Loop to dissect \"<Stream Focus>\" in depth (L1+), with parentMapHtml set to \"<current-output.html>\"."
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
],
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"streamIds": ["stream-main"],
|
|
46
46
|
"role": "entry",
|
|
47
47
|
"title": "Node Title",
|
|
48
|
-
"summary": "Concise 1
|
|
48
|
+
"summary": "Concise 1–2 sentence explanation shown on canvas card and inspector",
|
|
49
49
|
"whyItMatters": "Why a learner must grasp this node",
|
|
50
50
|
"keyFactors": {
|
|
51
51
|
"inputs": "Preconditions, triggers, assumptions, or inputs",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"askPrompts": [
|
|
78
78
|
{
|
|
79
79
|
"title": "Specific Inquiry Angle",
|
|
80
|
-
"prompt": "Detailed prompt referencing exact concepts, mechanisms, or file/chapter anchors
|
|
80
|
+
"prompt": "Detailed prompt referencing exact concepts, mechanisms, or file/chapter anchors…"
|
|
81
81
|
}
|
|
82
82
|
],
|
|
83
|
-
"subAtlasPrompt": "Use
|
|
83
|
+
"subAtlasPrompt": "Use Atlas Loop to dissect \"<Node Focus>\" in depth (L1+), with parentMapHtml set to \"<current-output.html>\"."
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
],
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
|
|
100
100
|
1. **`meta.language` & `meta.uiLabels`**:
|
|
101
101
|
- Built-in dictionaries automatically localize the UI for `zh*` and `en*`.
|
|
102
|
-
- When `meta.language` is another language (e.g. `ja`, `ko`, `es`, `fr`, `de`), populate `meta.uiLabels` with localized strings for keys (`modelPrefix`, `backParent`, `levelOverview`, `levelSubPrefix`, `allStreams`, `searchPlaceholder`, `zoomIn`, `zoomOut`, `lock`, `unlock`, `fitView`, `reset`, `legend`, `scopeNotes`, `learningPath`, `expandDetail`, `collapseDetail`, `detailEdgeLabel`, `deepDiveModalTitle`, `tabAsk`, `tabRecursive`, `copyBtn`, `copiedBtn`, `openInEditor`, `whatItDoes`, `whyItMatters`, `inputsLabel`, `outputsLabel`, `mechanismsLabel`, `watchoutsLabel`, `anchorsLabel`, `openDeepDiveBtn`, `unverifiedTag`, `verifiedTag`, `close`, and `roles`).
|
|
102
|
+
- When `meta.language` is another language (e.g. `ja`, `ko`, `es`, `fr`, `de`), populate `meta.uiLabels` with localized strings for keys (`skipToCanvas`, `modelPrefix`, `backParent`, `levelOverview`, `levelSubPrefix`, `allStreams`, `searchLabel`, `searchPlaceholder`, `zoomIn`, `zoomOut`, `lock`, `unlock`, `fitView`, `reset`, `legend`, `scopeNotes`, `learningPath`, `expandDetail`, `collapseDetail`, `detailEdgeLabel`, `deepDiveModalTitle`, `tabAsk`, `tabRecursive`, `copyBtn`, `copiedBtn`, `openInEditor`, `whatItDoes`, `whyItMatters`, `inputsLabel`, `outputsLabel`, `mechanismsLabel`, `watchoutsLabel`, `anchorsLabel`, `openDeepDiveBtn`, `unverifiedTag`, `verifiedTag`, `close`, and `roles`).
|
|
103
103
|
2. **7 Universal Cognitive Roles (`node.role`)**:
|
|
104
104
|
- `entry`: Starting point, user action, core question, or trigger.
|
|
105
105
|
- `core`: Primary mechanism, processing step, or main argument.
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
- `outcome`: Final result, takeaway, or target state.
|
|
111
111
|
3. **Polymorphic `anchors` (Optional — Use What Fits the Subject)**:
|
|
112
112
|
- Formula / CLI command / mental checklist / quote (`snippet`):
|
|
113
|
-
`{ "kind": "snippet", "label": "Key Formula / Command", "content": "
|
|
113
|
+
`{ "kind": "snippet", "label": "Key Formula / Command", "content": "…" }`
|
|
114
114
|
- Web / documentation reference (`link`):
|
|
115
|
-
`{ "kind": "link", "label": "Official Guide", "url": "https
|
|
115
|
+
`{ "kind": "link", "label": "Official Guide", "url": "https://…" }`
|
|
116
116
|
- Book chapter / paper / factual citation (`source`):
|
|
117
|
-
`{ "kind": "source", "label": "Chapter 4, p.112", "citation": "
|
|
117
|
+
`{ "kind": "source", "label": "Chapter 4, p.112", "citation": "…" }`
|
|
118
118
|
- Local file jump (`editor` — **only when verified local files exist on disk**):
|
|
119
119
|
`{ "kind": "editor", "label": "Entry handler", "filePath": "src/app.ts", "absPath": "/abs/path/src/app.ts", "line": 42, "symbol": "runApp", "editor": "vscode" }`
|
|
120
|
-
(`build_atlas.mjs` verifies `absPath` and `line` exist on disk and computes the encoded `vscode://file
|
|
120
|
+
(`build_atlas.mjs` verifies `absPath` and `line` exist on disk and computes the encoded `vscode://file/…` or `zed://file/…` URI automatically.)
|
|
121
121
|
4. **Edge Labels**:
|
|
122
122
|
- Every top-level edge MUST carry a non-empty `label` explaining the causal link, sequence, or branch condition.
|
package/scripts/build_atlas.mjs
CHANGED
|
@@ -237,7 +237,7 @@ function main() {
|
|
|
237
237
|
|
|
238
238
|
const finalHtml = shellHtml
|
|
239
239
|
.replace('__ATLAS_HTML_LANG__', escapeHtml(meta.language || 'en'))
|
|
240
|
-
.replace('__ATLAS_HTML_TITLE__', escapeHtml(`${meta.title} —
|
|
240
|
+
.replace('__ATLAS_HTML_TITLE__', escapeHtml(`${meta.title} — Atlas Loop`))
|
|
241
241
|
.replace('__ATLAS_DATA_JSON__', () => safeJsonPayload);
|
|
242
242
|
|
|
243
243
|
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|