@leji-org/leji 1.0.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.
Files changed (68) hide show
  1. package/README.md +36 -0
  2. package/assets-manifest.json +25 -0
  3. package/cli.json +82 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +4 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/conformance.d.ts +24 -0
  8. package/dist/commands/conformance.js +111 -0
  9. package/dist/commands/conformance.js.map +1 -0
  10. package/dist/commands/docs.d.ts +32 -0
  11. package/dist/commands/docs.js +196 -0
  12. package/dist/commands/docs.js.map +1 -0
  13. package/dist/commands/freshness.d.ts +21 -0
  14. package/dist/commands/freshness.js +41 -0
  15. package/dist/commands/freshness.js.map +1 -0
  16. package/dist/commands/indexgen.d.ts +55 -0
  17. package/dist/commands/indexgen.js +256 -0
  18. package/dist/commands/indexgen.js.map +1 -0
  19. package/dist/commands/init.d.ts +28 -0
  20. package/dist/commands/init.js +378 -0
  21. package/dist/commands/init.js.map +1 -0
  22. package/dist/commands/validate.d.ts +25 -0
  23. package/dist/commands/validate.js +359 -0
  24. package/dist/commands/validate.js.map +1 -0
  25. package/dist/index.d.ts +17 -0
  26. package/dist/index.js +324 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/lib/findings.d.ts +17 -0
  29. package/dist/lib/findings.js +29 -0
  30. package/dist/lib/findings.js.map +1 -0
  31. package/dist/lib/frontmatter.d.ts +14 -0
  32. package/dist/lib/frontmatter.js +28 -0
  33. package/dist/lib/frontmatter.js.map +1 -0
  34. package/dist/lib/fsx.d.ts +21 -0
  35. package/dist/lib/fsx.js +100 -0
  36. package/dist/lib/fsx.js.map +1 -0
  37. package/dist/lib/git.d.ts +10 -0
  38. package/dist/lib/git.js +55 -0
  39. package/dist/lib/git.js.map +1 -0
  40. package/dist/lib/layer.d.ts +32 -0
  41. package/dist/lib/layer.js +138 -0
  42. package/dist/lib/layer.js.map +1 -0
  43. package/dist/lib/manifest.d.ts +62 -0
  44. package/dist/lib/manifest.js +54 -0
  45. package/dist/lib/manifest.js.map +1 -0
  46. package/dist/lib/schemas.d.ts +38 -0
  47. package/dist/lib/schemas.js +57 -0
  48. package/dist/lib/schemas.js.map +1 -0
  49. package/package.json +61 -0
  50. package/schemas/README.md +3 -0
  51. package/schemas/agent-profile.schema.json +129 -0
  52. package/schemas/context-changelog.schema.json +150 -0
  53. package/schemas/context-index.schema.json +137 -0
  54. package/schemas/context-manifest.schema.json +253 -0
  55. package/schemas/decision-record.schema.json +84 -0
  56. package/templates/README.md +5 -0
  57. package/templates/agent-profile.md +25 -0
  58. package/templates/agents/core.md +27 -0
  59. package/templates/boot-profile.md +39 -0
  60. package/templates/decision-record.md +28 -0
  61. package/templates/docs-viewer-assets/PROVENANCE.txt +18 -0
  62. package/templates/docs-viewer-assets/docsify-sidebar-collapse.min.css +24 -0
  63. package/templates/docs-viewer-assets/docsify-sidebar-collapse.min.js +149 -0
  64. package/templates/docs-viewer-assets/docsify.min.js +1 -0
  65. package/templates/docs-viewer-assets/search.min.js +314 -0
  66. package/templates/docs-viewer-assets/vue.css +1063 -0
  67. package/templates/docs-viewer.html +63 -0
  68. package/templates/leji.json +56 -0
@@ -0,0 +1,39 @@
1
+ # Boot Profile
2
+
3
+ <!-- The agent-agnostic entrypoint of this context layer. Every agent host loads this file;
4
+ every person can start here. Keep it a map and a posture, not a knowledge base. -->
5
+
6
+ ## Identity
7
+
8
+ <One paragraph: what this repository/product is, who it serves, what stage it is at.>
9
+
10
+ ## Loading
11
+
12
+ Read before any task (keep this set small; it is paid on every task):
13
+
14
+ - `docs/system/invariants.md`: the constraints every change lives with
15
+
16
+ Load by task type (only the slice the task needs):
17
+
18
+ - <task type> → <paths or category>
19
+ - <task type> → <paths or category>
20
+
21
+ The generated map at `docs/context-index.json` routes you to the right slice. Decision records declare the paths and categories they govern; load the decisions that touch your task, not the whole `docs/decisions/` directory.
22
+
23
+ ## Posture
24
+
25
+ - Proceed without asking when: <defaults>
26
+ - Stop and ask when: <escalation triggers>
27
+ - Never: <hard lines>
28
+
29
+ Role-specific posture lives in `docs/agents/` (start with `core.md`).
30
+
31
+ ## Maintenance
32
+
33
+ If a task surfaces missing or wrong context, fix it in the same change set. Every context layer change rides review; people approve.
34
+
35
+ When you change anything in this context layer:
36
+
37
+ - Append an entry to `docs/context-changelog.json`: id, date, type, one-line summary, affected paths.
38
+ - Decisions get a record in `docs/decisions/`; copy the shape of an existing one.
39
+ - Regenerate `docs/context-index.json` when files are added, moved, or retitled.
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: <stable-kebab-id>
3
+ title: <Decision title>
4
+ status: accepted
5
+ date: <YYYY-MM-DD>
6
+ deciders:
7
+ - <name>
8
+ affectedCategories:
9
+ - system
10
+ ---
11
+
12
+ # <Decision title>
13
+
14
+ ## Context
15
+
16
+ <What situation forced a decision. The constraints that were live at the time.>
17
+
18
+ ## Decision
19
+
20
+ <What was decided, stated plainly.>
21
+
22
+ ## Consequences
23
+
24
+ <What this makes easier, what it makes harder, what it commits the team to.>
25
+
26
+ ## Alternatives
27
+
28
+ <What was considered and not taken, and why. Rejected options recorded here are re-litigation insurance.>
@@ -0,0 +1,18 @@
1
+ Vendored, CDN-free assets for the `leji docs` viewer. Do not edit by hand.
2
+
3
+ docsify.min.js, vue.css
4
+ From docsify@4.13.1 (npm). Update: npm pack docsify@<version>, copy
5
+ lib/docsify.min.js and themes/vue.css here, bump the version in
6
+ templates/docs-viewer.html's comment, run npm run assets.
7
+ NOTE: vue.css carries an appended "Leji brand theme" block at the end
8
+ (palette + sidebar + search + footer; typography stays theme-default).
9
+ Re-apply it after replacing the file.
10
+
11
+ search.min.js
12
+ Docsify full-text search plugin. Powers the sidebar search box.
13
+
14
+ docsify-sidebar-collapse.min.js, docsify-sidebar-collapse.min.css
15
+ docsify-sidebar-collapse plugin. Collapsible sidebar groups with a ▶/▼
16
+ triangle and auto-expansion of the active document's trail.
17
+
18
+ This note is documentation only; the SDKs never copy it into a user's output.
@@ -0,0 +1,24 @@
1
+ .sidebar-nav li {
2
+ position: relative;
3
+ margin: 0;
4
+ cursor: pointer;
5
+ }
6
+ .sidebar-nav ul:not(.app-sub-sidebar) > li:not(.file)::before {
7
+ content: "";
8
+ display: block;
9
+ position: absolute;
10
+ top: 11px;
11
+ left: -12px;
12
+ height: 6px;
13
+ width: 6px;
14
+ border-right: 1px solid #505d6b;
15
+ border-bottom: 1px solid #505d6b;
16
+ transform: rotate(-45deg);
17
+ transition: transform 0.1s;
18
+ }
19
+ .sidebar-nav ul:not(.app-sub-sidebar) > li.open::before {
20
+ transform: rotate(45deg);
21
+ }
22
+ .sidebar-nav ul:not(.app-sub-sidebar) > li.collapse::before {
23
+ transform: rotate(-45deg);
24
+ }
@@ -0,0 +1,149 @@
1
+ !(function (e) {
2
+ ("object" != typeof exports || "undefined" == typeof module) && "function" == typeof define && define.amd
3
+ ? define(e)
4
+ : e();
5
+ })(function () {
6
+ "use strict";
7
+ function e(e, n) {
8
+ var t,
9
+ a = (n = void 0 === n ? {} : n).insertAt;
10
+ e &&
11
+ "undefined" != typeof document &&
12
+ ((t = document.head || document.getElementsByTagName("head")[0]),
13
+ ((n = document.createElement("style")).type = "text/css"),
14
+ "top" === a && t.firstChild ? t.insertBefore(n, t.firstChild) : t.appendChild(n),
15
+ n.styleSheet ? (n.styleSheet.cssText = e) : n.appendChild(document.createTextNode(e)));
16
+ }
17
+ var t;
18
+ function a(e) {
19
+ e && null != t && ((e = e.getBoundingClientRect().top), document.querySelector(".sidebar").scrollBy(0, e - t));
20
+ }
21
+ function n() {
22
+ requestAnimationFrame(function () {
23
+ var e = document.querySelector(".app-sub-sidebar > .active");
24
+ if (e)
25
+ for (
26
+ e.parentNode.parentNode.querySelectorAll(".app-sub-sidebar").forEach(function (e) {
27
+ return e.classList.remove("open");
28
+ });
29
+ e.parentNode.classList.contains("app-sub-sidebar") && !e.parentNode.classList.contains("open");
30
+ )
31
+ (e.parentNode.classList.add("open"), (e = e.parentNode));
32
+ });
33
+ }
34
+ function o(e) {
35
+ t = e.target.getBoundingClientRect().top;
36
+ var n = d(e.target, "LI", 2);
37
+ n &&
38
+ (n.classList.contains("open")
39
+ ? (n.classList.remove("open"),
40
+ setTimeout(function () {
41
+ n.classList.add("collapse");
42
+ }, 0))
43
+ : ((function (e) {
44
+ if (e)
45
+ for (e.classList.remove("open", "active"); e && "sidebar-nav" !== e.className && e.parentNode; )
46
+ (("LI" !== e.parentNode.tagName && "app-sub-sidebar" !== e.parentNode.className) ||
47
+ e.parentNode.classList.remove("open"),
48
+ (e = e.parentNode));
49
+ })(s()),
50
+ i(n),
51
+ setTimeout(function () {
52
+ n.classList.remove("collapse");
53
+ }, 0)),
54
+ a(n));
55
+ }
56
+ function s() {
57
+ var e = document.querySelector(".sidebar-nav .active");
58
+ return (
59
+ e ||
60
+ ((e = d(
61
+ document.querySelector(
62
+ '.sidebar-nav a[href="'.concat(decodeURIComponent(location.hash).replace(/ /gi, "%20"), '"]')
63
+ ),
64
+ "LI",
65
+ 2
66
+ )) &&
67
+ e.classList.add("active")),
68
+ e
69
+ );
70
+ }
71
+ function i(e) {
72
+ if (e)
73
+ for (e.classList.add("open", "active"); e && "sidebar-nav" !== e.className && e.parentNode; )
74
+ (("LI" !== e.parentNode.tagName && "app-sub-sidebar" !== e.parentNode.className) ||
75
+ e.parentNode.classList.add("open"),
76
+ (e = e.parentNode));
77
+ }
78
+ function d(e, n, t) {
79
+ if (e && e.tagName === n) return e;
80
+ for (var a = 0; e; ) {
81
+ if (t < ++a) return;
82
+ if (e.parentNode.tagName === n) return e.parentNode;
83
+ e = e.parentNode;
84
+ }
85
+ }
86
+ (e(
87
+ ".sidebar-nav > ul > li ul {\n display: none;\n}\n\n.app-sub-sidebar {\n display: none;\n}\n\n.app-sub-sidebar.open {\n display: block;\n}\n\n.sidebar-nav .open > ul:not(.app-sub-sidebar),\n.sidebar-nav .active:not(.collapse) > ul {\n display: block;\n}\n\n/* 抖动 */\n.sidebar-nav li.open:not(.collapse) > ul {\n display: block;\n}\n\n.active + ul.app-sub-sidebar {\n display: block;\n}\n"
88
+ ),
89
+ document.addEventListener("scroll", n));
90
+ e(
91
+ "@media screen and (max-width: 768px) {\n /* 移动端适配 */\n .markdown-section {\n max-width: none;\n padding: 16px;\n }\n /* 改变原来按钮热区大小 */\n .sidebar-toggle {\n padding: 0 0 10px 10px;\n }\n /* my pin */\n .sidebar-pin {\n appearance: none;\n outline: none;\n position: fixed;\n bottom: 0;\n border: none;\n width: 40px;\n height: 40px;\n background: transparent;\n }\n}\n"
92
+ );
93
+ var r,
94
+ c = "DOCSIFY_SIDEBAR_PIN_FLAG";
95
+ function l() {
96
+ var e = "true" === (e = localStorage.getItem(c));
97
+ (localStorage.setItem(c, !e),
98
+ e
99
+ ? ((document.querySelector(".sidebar").style.transform = "translateX(0)"),
100
+ (document.querySelector(".content").style.transform = "translateX(0)"))
101
+ : ((document.querySelector(".sidebar").style.transform = "translateX(300px)"),
102
+ (document.querySelector(".content").style.transform = "translateX(300px)")));
103
+ }
104
+ (768 < document.documentElement.clientWidth ||
105
+ (localStorage.setItem(c, !1),
106
+ (r = document.createElement("button")).classList.add("sidebar-pin"),
107
+ (r.onclick = l),
108
+ document.body.append(r),
109
+ window.addEventListener("load", function () {
110
+ var n = document.querySelector(".content");
111
+ document.body.onclick = n.onclick = function (e) {
112
+ (e.target !== document.body && e.currentTarget !== n) || ("true" === localStorage.getItem(c) && l());
113
+ };
114
+ })),
115
+ (function () {
116
+ if (window.$docsify) {
117
+ for (var e = arguments.length, n = new Array(e), t = 0; t < e; t++) n[t] = arguments[t];
118
+ $docsify.plugins = n.concat($docsify.plugins || []);
119
+ } else console.error("这是一个docsify插件,请先引用docsify库!");
120
+ })(function (e, n) {
121
+ (e.doneEach(function (e, n) {
122
+ var t = s();
123
+ (i(t),
124
+ document.querySelectorAll(".sidebar-nav li").forEach(function (e) {
125
+ e.querySelector("ul:not(.app-sub-sidebar)") ? e.classList.add("folder") : e.classList.add("file");
126
+ }),
127
+ (function n(e, t) {
128
+ e &&
129
+ e.childNodes &&
130
+ e.childNodes.forEach(function (e) {
131
+ e.classList &&
132
+ e.classList.contains("folder") &&
133
+ (e.classList.add("level-".concat(t)),
134
+ window.$docsify &&
135
+ window.$docsify.sidebarDisplayLevel &&
136
+ "number" == typeof window.$docsify.sidebarDisplayLevel &&
137
+ t <= window.$docsify.sidebarDisplayLevel &&
138
+ e.classList.add("open"),
139
+ e && 1 < e.childNodes.length && n(e.childNodes[1], t + 1));
140
+ });
141
+ })(document.querySelector(".sidebar-nav > ul"), 1),
142
+ a(t),
143
+ n(e));
144
+ }),
145
+ e.ready(function () {
146
+ document.querySelector(".sidebar-nav").addEventListener("click", o);
147
+ }));
148
+ }));
149
+ });