@aisystemresources/emdee 0.1.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 (82) hide show
  1. package/README.md +85 -0
  2. package/bin/emdee.js +196 -0
  3. package/package.json +78 -0
  4. package/src/cli/read-commands.ts +64 -0
  5. package/src/core/indexer.ts +346 -0
  6. package/src/core/parseEdges.ts +106 -0
  7. package/src/core/resolveLink.ts +136 -0
  8. package/src/core/siblings.ts +65 -0
  9. package/src/core/syncDocEdges.ts +427 -0
  10. package/src/lib/cache/bust.ts +44 -0
  11. package/src/lib/cache/invalidation.ts +28 -0
  12. package/src/lib/mcp/activity.ts +254 -0
  13. package/src/lib/mcp/tools/add_association.ts +311 -0
  14. package/src/lib/mcp/tools/append_doc.ts +70 -0
  15. package/src/lib/mcp/tools/append_section.ts +121 -0
  16. package/src/lib/mcp/tools/create_child.ts +319 -0
  17. package/src/lib/mcp/tools/delete_doc.ts +68 -0
  18. package/src/lib/mcp/tools/distill_doc.ts +262 -0
  19. package/src/lib/mcp/tools/filename.ts +63 -0
  20. package/src/lib/mcp/tools/get_context.ts +227 -0
  21. package/src/lib/mcp/tools/get_doc.ts +91 -0
  22. package/src/lib/mcp/tools/get_image.ts +62 -0
  23. package/src/lib/mcp/tools/get_neighbors.ts +96 -0
  24. package/src/lib/mcp/tools/get_summary.ts +18 -0
  25. package/src/lib/mcp/tools/index.ts +26 -0
  26. package/src/lib/mcp/tools/lint.ts +552 -0
  27. package/src/lib/mcp/tools/lint_doc.ts +76 -0
  28. package/src/lib/mcp/tools/lint_gate.ts +49 -0
  29. package/src/lib/mcp/tools/list_docs.ts +18 -0
  30. package/src/lib/mcp/tools/list_summary_drift.ts +95 -0
  31. package/src/lib/mcp/tools/materialize_subgroup.ts +274 -0
  32. package/src/lib/mcp/tools/move_doc.ts +439 -0
  33. package/src/lib/mcp/tools/patch_preamble.ts +145 -0
  34. package/src/lib/mcp/tools/patch_section.ts +113 -0
  35. package/src/lib/mcp/tools/read_doc_section.ts +70 -0
  36. package/src/lib/mcp/tools/rename_doc.ts +167 -0
  37. package/src/lib/mcp/tools/restore_doc.ts +41 -0
  38. package/src/lib/mcp/tools/search.ts +36 -0
  39. package/src/lib/mcp/tools/sections.ts +130 -0
  40. package/src/lib/mcp/tools/split_doc.ts +129 -0
  41. package/src/lib/mcp/tools/trash_doc.ts +116 -0
  42. package/src/lib/mcp/tools/types.ts +7 -0
  43. package/src/lib/mcp/tools/upload_image.ts +77 -0
  44. package/src/lib/mcp/tools/validate_args.ts +36 -0
  45. package/src/lib/mcp/tools/vault.ts +430 -0
  46. package/src/lib/mcp/tools/write_doc.ts +81 -0
  47. package/src/lib/mcp/tools/write_doc_preview.ts +59 -0
  48. package/src/lib/owner/identity.ts +65 -0
  49. package/src/lib/storage/FilesystemStorage.ts +88 -0
  50. package/src/lib/storage/SupabaseStorage.ts +358 -0
  51. package/src/lib/storage/VaultStorage.ts +35 -0
  52. package/src/lib/storage/index.ts +41 -0
  53. package/src/lib/supabase/admin.ts +16 -0
  54. package/src/lib/supabase/client.ts +8 -0
  55. package/src/lib/supabase/oauth.ts +296 -0
  56. package/src/lib/supabase/server.ts +22 -0
  57. package/src/lib/system-nodes.ts +68 -0
  58. package/src/lib/trash/state.ts +88 -0
  59. package/src/mcp/server.ts +380 -0
  60. package/templates/types/CONCEPT.md +21 -0
  61. package/templates/types/HACKATHON.md +28 -0
  62. package/templates/types/NOVEL/CHARACTERS.md +29 -0
  63. package/templates/types/NOVEL/DRAFT.md +15 -0
  64. package/templates/types/NOVEL/EDITS.md +19 -0
  65. package/templates/types/NOVEL/INBOX.md +15 -0
  66. package/templates/types/NOVEL/INSTRUCTIONS.md +32 -0
  67. package/templates/types/NOVEL/LEARNINGS.md +9 -0
  68. package/templates/types/NOVEL/OUTBOX.md +15 -0
  69. package/templates/types/NOVEL/PLOT.md +27 -0
  70. package/templates/types/NOVEL/WORLDBUILDING.md +23 -0
  71. package/templates/types/NOVEL.md +32 -0
  72. package/templates/types/PERSON.md +27 -0
  73. package/templates/types/PROJECT/BRAND.md +23 -0
  74. package/templates/types/PROJECT/BUILD.md +9 -0
  75. package/templates/types/PROJECT/IDEAS.md +11 -0
  76. package/templates/types/PROJECT/INBOX.md +15 -0
  77. package/templates/types/PROJECT/INSTRUCTIONS.md +23 -0
  78. package/templates/types/PROJECT/LEARNINGS.md +9 -0
  79. package/templates/types/PROJECT/LOGS.md +9 -0
  80. package/templates/types/PROJECT/OUTBOX.md +15 -0
  81. package/templates/types/PROJECT/SPRINT.md +56 -0
  82. package/templates/types/PROJECT.md +26 -0
@@ -0,0 +1,27 @@
1
+ # PERSON-NAME
2
+
3
+ > One-line summary of who they are and how they relate to your work. Replace.
4
+
5
+ ## Child of
6
+
7
+ * [[PEOPLE]]
8
+
9
+ ## Associated with
10
+
11
+ * [[Project or person]] — relationship prose
12
+
13
+ ## Background
14
+
15
+ Who they are, what they do, how you know them. A few sentences to a couple of paragraphs.
16
+
17
+ ## Notes
18
+
19
+ * Free-form observations.
20
+
21
+ ## Interactions
22
+
23
+ * `[YYYY-MM-DD]` Brief description of an interaction. Append over time as you work with them.
24
+
25
+ ## Contact
26
+
27
+ * Email / Slack / etc.
@@ -0,0 +1,23 @@
1
+ # <PROJECT> — BRAND
2
+
3
+ > Brand and voice reference for [[<PROJECT>]] — tone, messaging style, colors, fonts. Mostly static; update when brand evolves.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Voice
10
+
11
+ <Brief description of the voice — firm/humorous/technical/etc. To be filled in.>
12
+
13
+ ## Messaging
14
+
15
+ <Key phrases, taglines, things to say / not say. To be filled in.>
16
+
17
+ ## Colors
18
+
19
+ <Hex codes for primary, secondary, accent. To be filled in.>
20
+
21
+ ## Typography
22
+
23
+ <Font choices for headings, body, monospace. To be filled in.>
@@ -0,0 +1,9 @@
1
+ # <PROJECT> — BUILD
2
+
3
+ > Current sprint and active threads for [[<PROJECT>]]. 3–7 items max — when they ship or go stale, they move to LOGS.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ * No active items yet.
@@ -0,0 +1,11 @@
1
+ # <PROJECT> — IDEAS
2
+
3
+ > Possibilities and future directions for [[<PROJECT>]] — things we might do, ideas we're sitting on. Promote to BUILD when they become active.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Open ideas
10
+
11
+ * (none yet)
@@ -0,0 +1,15 @@
1
+ # <PROJECT> — INBOX
2
+
3
+ > Incoming proposals from external agents — work being suggested into [[<PROJECT>]] by sibling projects. Triage here: accept and promote to [[BUILD]] or reject with a reason. Pull-side of cross-project coordination.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Open
10
+
11
+ * (none yet)
12
+
13
+ ## Triaged
14
+
15
+ * (none yet)
@@ -0,0 +1,23 @@
1
+ # <PROJECT> — INSTRUCTIONS
2
+
3
+ > Operating protocol for working inside [[<PROJECT>]]. This is the project-scoped entry point — when an agent starts a session on this project, read this first before touching BUILD, LOGS, or any other tier file. The role inside [[<PROJECT>]] is what [[MANE]] is to the vault overall.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Session start protocol
10
+
11
+ <How an agent should orient at the start of a session: which docs to read first, in what order, what state to check.>
12
+
13
+ ## Writing discipline
14
+
15
+ <Project-specific conventions for updating tier files. Patch-not-rewrite, version-guarding, attribution lines, etc.>
16
+
17
+ ## Communication conventions
18
+
19
+ <How agents inside this project communicate with each other and with external projects via [[INBOX]] / [[OUTBOX]].>
20
+
21
+ ## Roles
22
+
23
+ <If this project has multiple agent roles — chat vs code, PM vs eng — define them here. Else delete this section.>
@@ -0,0 +1,9 @@
1
+ # <PROJECT> — LEARNINGS
2
+
3
+ > Distilled wisdom from working on [[<PROJECT>]] — what works, what doesn't, anti-patterns. Dated entries, supersede explicitly. See [[INFO]] → Writing conventions → LEARNINGS authoring format for the entry shape and three-test filter.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ * (none yet)
@@ -0,0 +1,9 @@
1
+ # <PROJECT> — LOGS
2
+
3
+ > Append-only chronological record for [[<PROJECT>]]. Excluded from `get_doc` by default; fetch only when audit is needed.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ * (no entries yet)
@@ -0,0 +1,15 @@
1
+ # <PROJECT> — OUTBOX
2
+
3
+ > Proposals this project is sending to other projects. Push-side of cross-project coordination — the inverse of [[INBOX]]. State is decoupled from the receiver: each side reconciles independently, like git push/pull.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Open
10
+
11
+ * (none yet)
12
+
13
+ ## Shipped
14
+
15
+ * (none yet)
@@ -0,0 +1,56 @@
1
+ # <PROJECT> — SPRINT-NNN
2
+
3
+ > One-line summary of what this sprint ships and why. Replace.
4
+
5
+ ## Child of
6
+
7
+ * [[<PROJECT>]]
8
+
9
+ ## Why
10
+
11
+ 1–2 sentences. What problem this solves and why now. Without this, future readers can't judge what's load-bearing vs nice-to-have.
12
+
13
+ ## Scope
14
+
15
+ **In:**
16
+
17
+ * Bullets of what's included.
18
+
19
+ **Out:**
20
+
21
+ * Bullets of what's explicitly excluded — the boundary that prevents creep.
22
+
23
+ ## Acceptance criteria
24
+
25
+ * [ ] Measurable thing that must be true to call this shipped.
26
+ * [ ] Each criterion is a fact about the world, not a step.
27
+ * [ ] Pin them down concretely — "function X exists", "test Y passes", "doc Z contains section W".
28
+
29
+ ## Deliverables
30
+
31
+ * Concrete files, behaviors, or artifacts that will exist when done.
32
+ * Use exact paths where possible.
33
+
34
+ ## Risks / open questions
35
+
36
+ * What we don't know yet.
37
+ * What could go wrong.
38
+
39
+ ## Dependencies
40
+
41
+ * [[OTHER-SPRINT]] (if blocking; else delete this section).
42
+
43
+ — <author>, <YYYY-MM-DD> (spec)
44
+
45
+ <!--
46
+ Add the Close-out section when shipping:
47
+
48
+ ## Close-out
49
+
50
+ * What was actually built vs what was specced.
51
+ * Deviations + why.
52
+ * Blockers hit + how resolved.
53
+ * LEARNINGS candidates — anything that meets the three-test filter (reusable / non-obvious / has a directive).
54
+
55
+ — <author>, <YYYY-MM-DD> (close-out)
56
+ -->
@@ -0,0 +1,26 @@
1
+ # PROJECT-NAME
2
+
3
+ > One-line summary of what this project is and its current state. Replace.
4
+
5
+ ## Child of
6
+
7
+ * [[PROJECTS]]
8
+
9
+ ## Associated with
10
+
11
+ * [[Other Doc]] — relationship prose
12
+
13
+ ## CONTEXT
14
+
15
+ Stable background that doesn't fit in the summary — what this project is, why it exists, current stage. 1–3 paragraphs.
16
+
17
+ <!--
18
+ Tier files for this project live in docs/projects/PROJECT-NAME/:
19
+ - BUILD.md — current sprint
20
+ - LOGS.md — append-only history
21
+ - LEARNINGS.md — distilled wisdom
22
+ - BRAND.md — voice, colors, fonts (optional)
23
+ - IDEAS.md — future possibilities (optional)
24
+
25
+ The tier files declare `Child of [[PROJECT-NAME]]` so they nest under this project in the sidebar.
26
+ -->