@magic-spells/constellation 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 (190) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +147 -0
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.js +127 -0
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/core/extract.d.ts +9 -0
  7. package/dist/core/extract.js +56 -0
  8. package/dist/core/extract.js.map +1 -0
  9. package/dist/core/handles.d.ts +13 -0
  10. package/dist/core/handles.js +45 -0
  11. package/dist/core/handles.js.map +1 -0
  12. package/dist/core/index.d.ts +8 -0
  13. package/dist/core/index.js +9 -0
  14. package/dist/core/index.js.map +1 -0
  15. package/dist/core/indexer.d.ts +3 -0
  16. package/dist/core/indexer.js +209 -0
  17. package/dist/core/indexer.js.map +1 -0
  18. package/dist/core/lint.d.ts +9 -0
  19. package/dist/core/lint.js +19 -0
  20. package/dist/core/lint.js.map +1 -0
  21. package/dist/core/parse.d.ts +7 -0
  22. package/dist/core/parse.js +19 -0
  23. package/dist/core/parse.js.map +1 -0
  24. package/dist/core/resolve.d.ts +12 -0
  25. package/dist/core/resolve.js +57 -0
  26. package/dist/core/resolve.js.map +1 -0
  27. package/dist/core/scaffold.d.ts +3 -0
  28. package/dist/core/scaffold.js +36 -0
  29. package/dist/core/scaffold.js.map +1 -0
  30. package/dist/core/types.d.ts +50 -0
  31. package/dist/core/types.js +5 -0
  32. package/dist/core/types.js.map +1 -0
  33. package/dist/core/validate.d.ts +6 -0
  34. package/dist/core/validate.js +64 -0
  35. package/dist/core/validate.js.map +1 -0
  36. package/dist/core/writer.d.ts +34 -0
  37. package/dist/core/writer.js +170 -0
  38. package/dist/core/writer.js.map +1 -0
  39. package/dist/mcp/git.d.ts +34 -0
  40. package/dist/mcp/git.js +172 -0
  41. package/dist/mcp/git.js.map +1 -0
  42. package/dist/mcp/search.d.ts +11 -0
  43. package/dist/mcp/search.js +52 -0
  44. package/dist/mcp/search.js.map +1 -0
  45. package/dist/mcp/server.d.ts +7 -0
  46. package/dist/mcp/server.js +684 -0
  47. package/dist/mcp/server.js.map +1 -0
  48. package/dist/serve/server.d.ts +12 -0
  49. package/dist/serve/server.js +281 -0
  50. package/dist/serve/server.js.map +1 -0
  51. package/docs/001-file-format.md +222 -0
  52. package/docs/002-mcp.md +109 -0
  53. package/examples/constellation/agent/AGENT-CODE-STYLE.md +14 -0
  54. package/examples/constellation/api/API-TICKETS.md +24 -0
  55. package/examples/constellation/component/COMPONENT-TICKET-CARD.md +16 -0
  56. package/examples/constellation/datatype/DATATYPE-CREATE-TICKET-INPUT.md +15 -0
  57. package/examples/constellation/datatype/DATATYPE-TICKET.md +20 -0
  58. package/examples/constellation/db/DB-TICKETS.md +21 -0
  59. package/examples/constellation/diagram/DIAGRAM-SYSTEM-OVERVIEW.md +19 -0
  60. package/examples/constellation/doc/DOC-TICKET-LIFECYCLE.md +22 -0
  61. package/examples/constellation/event/EVENT-TICKET-CREATED.md +13 -0
  62. package/examples/constellation/external/EXTERNAL-EMAIL-PROVIDER.md +13 -0
  63. package/examples/constellation/file/FILE-TICKETS-ROUTE.md +12 -0
  64. package/examples/constellation/flow/FLOW-CREATE-TICKET.md +16 -0
  65. package/examples/constellation/job/JOB-AUTO-ASSIGN.md +15 -0
  66. package/examples/constellation/page/PAGE-INBOX.md +19 -0
  67. package/examples/constellation/plan.md +23 -0
  68. package/examples/constellation/role/ROLE-SUPPORT-AGENT.md +12 -0
  69. package/examples/constellation/state/STATE-TICKET.md +31 -0
  70. package/examples/constellation/test/TEST-CREATE-TICKET.md +17 -0
  71. package/package.json +80 -0
  72. package/schemas/agent.json +21 -0
  73. package/schemas/api.json +47 -0
  74. package/schemas/card.json +37 -0
  75. package/schemas/component.json +40 -0
  76. package/schemas/datatype.json +8 -0
  77. package/schemas/db.json +51 -0
  78. package/schemas/diagram.json +95 -0
  79. package/schemas/doc.json +8 -0
  80. package/schemas/event.json +28 -0
  81. package/schemas/external.json +24 -0
  82. package/schemas/file.json +22 -0
  83. package/schemas/flow.json +20 -0
  84. package/schemas/job.json +25 -0
  85. package/schemas/page.json +36 -0
  86. package/schemas/plan.json +13 -0
  87. package/schemas/role.json +18 -0
  88. package/schemas/state.json +35 -0
  89. package/schemas/test.json +13 -0
  90. package/skill/SKILL.md +105 -0
  91. package/skill/types/agent.md +26 -0
  92. package/skill/types/api.md +38 -0
  93. package/skill/types/component.md +30 -0
  94. package/skill/types/datatype.md +26 -0
  95. package/skill/types/db.md +33 -0
  96. package/skill/types/diagram.md +32 -0
  97. package/skill/types/doc.md +23 -0
  98. package/skill/types/event.md +31 -0
  99. package/skill/types/external.md +30 -0
  100. package/skill/types/file.md +28 -0
  101. package/skill/types/flow.md +29 -0
  102. package/skill/types/job.md +27 -0
  103. package/skill/types/page.md +28 -0
  104. package/skill/types/plan.md +37 -0
  105. package/skill/types/role.md +25 -0
  106. package/skill/types/state.md +38 -0
  107. package/skill/types/test.md +28 -0
  108. package/viewer/dist/assets/arc-Kj6pF3JI.js +1 -0
  109. package/viewer/dist/assets/architecture-7EHR7CIX-CGfWeim3.js +1 -0
  110. package/viewer/dist/assets/architectureDiagram-3BPJPVTR-C5bZdErB.js +36 -0
  111. package/viewer/dist/assets/array-BifhSqXX.js +1 -0
  112. package/viewer/dist/assets/blockDiagram-GPEHLZMM-C1Q6l6fE.js +132 -0
  113. package/viewer/dist/assets/c4Diagram-AAUBKEIU-BmM6Tmtq.js +10 -0
  114. package/viewer/dist/assets/channel-19IdUS_c.js +1 -0
  115. package/viewer/dist/assets/chunk-2J33WTMH-z09tLTpZ.js +1 -0
  116. package/viewer/dist/assets/chunk-3OPIFGDE-BynpXh1r.js +62 -0
  117. package/viewer/dist/assets/chunk-4BX2VUAB-CDOVuPyG.js +1 -0
  118. package/viewer/dist/assets/chunk-55IACEB6-nBwigOgn.js +1 -0
  119. package/viewer/dist/assets/chunk-5ZQYHXKU-Bxe5xIy_.js +2 -0
  120. package/viewer/dist/assets/chunk-727SXJPM-DZmTgL68.js +206 -0
  121. package/viewer/dist/assets/chunk-AQP2D5EJ-B7wr_Owx.js +231 -0
  122. package/viewer/dist/assets/chunk-BSJP7CBP-DbAKfVCK.js +1 -0
  123. package/viewer/dist/assets/chunk-CSCIHK7Q-C0rsBwqP.js +124 -0
  124. package/viewer/dist/assets/chunk-FMBD7UC4-BAtzt0wv.js +15 -0
  125. package/viewer/dist/assets/chunk-KSCS5N6A-CXXwf52I.js +10 -0
  126. package/viewer/dist/assets/chunk-L5ZTLDWV-DS4vRI1U.js +1 -0
  127. package/viewer/dist/assets/chunk-LZXEDZCA-CclT9MXr.js +2 -0
  128. package/viewer/dist/assets/chunk-ND2GUHAM-CUSnPl8t.js +1 -0
  129. package/viewer/dist/assets/chunk-NNHCCRGN-DlpIbxXb.js +159 -0
  130. package/viewer/dist/assets/chunk-NZK2D7GU-Dh986nJk.js +1 -0
  131. package/viewer/dist/assets/chunk-O5CBEL6O-JAEZ_pS6.js +70 -0
  132. package/viewer/dist/assets/chunk-QZHKN3VN-BKc_Kg2Z.js +1 -0
  133. package/viewer/dist/assets/chunk-WU5MYG2G-9ssTSMzt.js +1 -0
  134. package/viewer/dist/assets/chunk-XPW4576I-BwMZI0gv.js +32 -0
  135. package/viewer/dist/assets/classDiagram-4FO5ZUOK-DXv85WFd.js +1 -0
  136. package/viewer/dist/assets/classDiagram-v2-Q7XG4LA2-DXv85WFd.js +1 -0
  137. package/viewer/dist/assets/cose-bilkent-S5V4N54A-NGC7gYHM.js +1 -0
  138. package/viewer/dist/assets/cytoscape.esm-h6BdjjI9.js +321 -0
  139. package/viewer/dist/assets/dagre-BM42HDAG-RD63uyvd.js +4 -0
  140. package/viewer/dist/assets/dagre-Bx709z4p.js +1 -0
  141. package/viewer/dist/assets/defaultLocale-C8Fc0cco.js +1 -0
  142. package/viewer/dist/assets/diagram-2AECGRRQ-hwnqqCcb.js +43 -0
  143. package/viewer/dist/assets/diagram-5GNKFQAL-q8EaoZSG.js +10 -0
  144. package/viewer/dist/assets/diagram-KO2AKTUF-D4_5Qf-l.js +3 -0
  145. package/viewer/dist/assets/diagram-LMA3HP47-D8pwekFs.js +24 -0
  146. package/viewer/dist/assets/diagram-OG6HWLK6-D9KinIWZ.js +24 -0
  147. package/viewer/dist/assets/dist-CFOOgrqc.js +1 -0
  148. package/viewer/dist/assets/erDiagram-TEJ5UH35-D0Wfq250.js +85 -0
  149. package/viewer/dist/assets/eventmodeling-FCH6USID-D3KRSuC1.js +1 -0
  150. package/viewer/dist/assets/flowDiagram-I6XJVG4X-Y2DY-Ze2.js +162 -0
  151. package/viewer/dist/assets/ganttDiagram-6RSMTGT7-BnqkeLVw.js +292 -0
  152. package/viewer/dist/assets/gitGraph-WXDBUCRP-Cft7usRT.js +1 -0
  153. package/viewer/dist/assets/gitGraphDiagram-PVQCEYII-D-cYtraK.js +106 -0
  154. package/viewer/dist/assets/graphlib-B8gBHxth.js +1 -0
  155. package/viewer/dist/assets/index-CDR-riG2.css +2 -0
  156. package/viewer/dist/assets/index-DRPsTWe2.js +98 -0
  157. package/viewer/dist/assets/info-J43DQDTF-Djc8Bx3F.js +1 -0
  158. package/viewer/dist/assets/infoDiagram-5YYISTIA-D-ehtyyJ.js +2 -0
  159. package/viewer/dist/assets/init-D6jRqBbL.js +1 -0
  160. package/viewer/dist/assets/ishikawaDiagram-YF4QCWOH-Ct3f6bH-.js +70 -0
  161. package/viewer/dist/assets/journeyDiagram-JHISSGLW-DXlULEmi.js +139 -0
  162. package/viewer/dist/assets/kanban-definition-UN3LZRKU-3vE9h-R7.js +89 -0
  163. package/viewer/dist/assets/katex-Vhh-h91d.js +257 -0
  164. package/viewer/dist/assets/line-B8MygbLB.js +1 -0
  165. package/viewer/dist/assets/linear-CfMuM0B3.js +1 -0
  166. package/viewer/dist/assets/mermaid-parser.core-DzlZTbbh.js +4 -0
  167. package/viewer/dist/assets/mermaid.core-IM-sPiyq.js +9 -0
  168. package/viewer/dist/assets/mindmap-definition-RKZ34NQL-CMnpAq1T.js +96 -0
  169. package/viewer/dist/assets/ordinal-hYBb2elL.js +1 -0
  170. package/viewer/dist/assets/packet-YPE3B663-D44AzgHh.js +1 -0
  171. package/viewer/dist/assets/path-BWPyau1x.js +1 -0
  172. package/viewer/dist/assets/pie-LRSECV5Y-DL8AVJH_.js +1 -0
  173. package/viewer/dist/assets/pieDiagram-4H26LBE5-FvKK5jd7.js +30 -0
  174. package/viewer/dist/assets/quadrantDiagram-W4KKPZXB-CmjSkU8c.js +7 -0
  175. package/viewer/dist/assets/radar-GUYGQ44K-BvfZTVyH.js +1 -0
  176. package/viewer/dist/assets/requirementDiagram-4Y6WPE33-BOjca3VH.js +84 -0
  177. package/viewer/dist/assets/rough.esm-CSKSodPl.js +1 -0
  178. package/viewer/dist/assets/sankeyDiagram-5OEKKPKP-ANcjfNix.js +40 -0
  179. package/viewer/dist/assets/sequenceDiagram-3UESZ5HK-BLQ9AL7I.js +162 -0
  180. package/viewer/dist/assets/src-CAMdANUp.js +1 -0
  181. package/viewer/dist/assets/stateDiagram-AJRCARHV-D6CriBS6.js +1 -0
  182. package/viewer/dist/assets/stateDiagram-v2-BHNVJYJU-DcTp66RQ.js +1 -0
  183. package/viewer/dist/assets/timeline-definition-PNZ67QCA-BNhWZ_DL.js +120 -0
  184. package/viewer/dist/assets/treeView-BLDUP644-CY6Ph5Pu.js +1 -0
  185. package/viewer/dist/assets/treemap-LRROVOQU-DChSA_Qx.js +1 -0
  186. package/viewer/dist/assets/vennDiagram-CIIHVFJN-C01WznAC.js +34 -0
  187. package/viewer/dist/assets/wardley-L42UT6IY-BJ8uNoJu.js +1 -0
  188. package/viewer/dist/assets/wardleyDiagram-YWT4CUSO-DwDEzlVm.js +78 -0
  189. package/viewer/dist/assets/xychartDiagram-2RQKCTM6-BCvIDwU0.js +7 -0
  190. package/viewer/dist/index.html +20 -0
@@ -0,0 +1,26 @@
1
+ # DATATYPE cards (`DATATYPE-`, `datatype/`)
2
+
3
+ No structured fields. The type declaration lives in the body as a fenced code
4
+ block (` ```ts `, ` ```sql `, …) — readable, diffable, and copy-pasteable into code.
5
+
6
+ Example — `constellation/datatype/DATATYPE-TICKET.md`:
7
+
8
+ ````markdown
9
+ ---
10
+ name: Ticket
11
+ status: built
12
+ connections:
13
+ - DB-TICKETS
14
+ ---
15
+
16
+ The canonical ticket shape, returned by every ticket endpoint.
17
+
18
+ ```ts
19
+ interface Ticket {
20
+ id: string;
21
+ subject: string;
22
+ status: 'open' | 'assigned' | 'resolved' | 'closed';
23
+ created_at: string; // ISO 8601
24
+ }
25
+ ```
26
+ ````
@@ -0,0 +1,33 @@
1
+ # DB cards (`DB-`, `db/`)
2
+
3
+ One card per table/collection. Suggested `kind`: `sql-table`, `document-collection`,
4
+ `kv`, `time-series`, `graph`.
5
+
6
+ | Field | Type | Notes |
7
+ |---|---|---|
8
+ | `table_name` | string | physical name |
9
+ | `columns` | array | `{ name, sql_type?, primary_key?, not_null?, unique?, default? }` |
10
+ | `indexes` | array | `{ name?, columns?, unique? }` |
11
+ | `foreign_keys` | array | `{ columns?, references_table?, references_columns?, on_delete? }` |
12
+
13
+ Example — `constellation/db/DB-TICKETS.md`:
14
+
15
+ ```markdown
16
+ ---
17
+ name: tickets table
18
+ kind: sql-table
19
+ status: built
20
+ table_name: tickets
21
+ columns:
22
+ - { name: id, sql_type: UUID, primary_key: true, default: gen_random_uuid() }
23
+ - { name: subject, sql_type: TEXT, not_null: true }
24
+ - { name: status, sql_type: TEXT, not_null: true, default: "'open'" }
25
+ indexes:
26
+ - { name: tickets_status_idx, columns: [status] }
27
+ connections:
28
+ - DATATYPE-TICKET
29
+ ---
30
+
31
+ One row per ticket. `status` values mirror [[STATE-TICKET]]; rows are never
32
+ deleted, only moved to `closed`.
33
+ ```
@@ -0,0 +1,32 @@
1
+ # DIAGRAM cards (`DIAGRAM-`, `diagram/`)
2
+
3
+ Architecture diagrams, three tiers — always prefer the cheapest that works:
4
+
5
+ 1. **Don't author at all**: node neighborhoods can be rendered from the real
6
+ connection graph on demand. Only author a diagram for *conceptual* views.
7
+ 2. **Mermaid in the body** (the default): use **handles as Mermaid node IDs** so
8
+ the diagram joins the graph automatically.
9
+ 3. **Pinned layout** (rare): structured `nodes`/`edges`/`phases` frontmatter with
10
+ explicit positions — see `schemas/diagram.json`. Only when layout carries meaning;
11
+ positions make noisy diffs.
12
+
13
+ Example — `constellation/diagram/DIAGRAM-SYSTEM-OVERVIEW.md`:
14
+
15
+ ````markdown
16
+ ---
17
+ name: System overview
18
+ status: built
19
+ ---
20
+
21
+ # System overview
22
+
23
+ ```mermaid
24
+ flowchart LR
25
+ PAGE-INBOX --> API-TICKETS
26
+ API-TICKETS --> DB-TICKETS
27
+ API-TICKETS --> EVENT-TICKET-CREATED
28
+ EVENT-TICKET-CREATED --> JOB-AUTO-ASSIGN
29
+ ```
30
+
31
+ Intake is synchronous down the left edge; everything after the event is async.
32
+ ````
@@ -0,0 +1,23 @@
1
+ # DOC cards (`DOC-`, `doc/`)
2
+
3
+ No structured fields — DOC cards are prose. Suggested `kind`: `guide`, `rule`,
4
+ `decision`, `meta`. Decisions (ADRs) get one DOC card each (`kind: decision`),
5
+ never a section in `plan.md`.
6
+
7
+ Example — `constellation/doc/DOC-TICKET-LIFECYCLE.md`:
8
+
9
+ ```markdown
10
+ ---
11
+ name: How tickets move through the system
12
+ kind: guide
13
+ status: built
14
+ ---
15
+
16
+ # Ticket lifecycle
17
+
18
+ A ticket is born when the public form posts to [[API-TICKETS]] — the whole
19
+ sequence is [[FLOW-CREATE-TICKET]]. From there it walks [[STATE-TICKET]].
20
+
21
+ Invariant the code must never break: state transitions happen only in the API
22
+ layer. Nothing writes the `status` column directly.
23
+ ```
@@ -0,0 +1,31 @@
1
+ # EVENT cards (`EVENT-`, `event/`)
2
+
3
+ One card per domain event. `emitter` and `payload_schema` are handles and connect
4
+ automatically.
5
+
6
+ | Field | Type | Notes |
7
+ |---|---|---|
8
+ | `emitter` | handle | card that emits this event |
9
+ | `payload_schema` | handle | DATATYPE of the payload |
10
+ | `delivery_semantics` | enum | `at-least-once` \| `at-most-once` \| `exactly-once` |
11
+ | `ordering` | enum | `per-aggregate` \| `total` \| `none` |
12
+ | `idempotency_key_field` | string | payload field consumers dedupe on |
13
+ | `version` | integer | ≥ 1 |
14
+
15
+ Example — `constellation/event/EVENT-TICKET-CREATED.md`:
16
+
17
+ ```markdown
18
+ ---
19
+ name: Ticket created
20
+ status: built
21
+ emitter: API-TICKETS
22
+ payload_schema: DATATYPE-TICKET
23
+ delivery_semantics: at-least-once
24
+ ordering: none
25
+ idempotency_key_field: id
26
+ version: 1
27
+ ---
28
+
29
+ Fired after a ticket row is committed. Consumers must dedupe on the ticket `id`.
30
+ Currently the only consumer is [[JOB-AUTO-ASSIGN]].
31
+ ```
@@ -0,0 +1,30 @@
1
+ # EXTERNAL cards (`EXTERNAL-`, `external/`)
2
+
3
+ One card per external service. Suggested `kind`: `saas-vendor`, `cloud-infra`,
4
+ `external-microservice`, `hardware-peripheral`.
5
+
6
+ | Field | Type | Notes |
7
+ |---|---|---|
8
+ | `vendor` | string | e.g. `Stripe`, `Postmark` |
9
+ | `purpose` | string | what it's used for |
10
+ | `docs_url` | string | |
11
+ | `status_url` | string | |
12
+ | `credentials_envs` | string[] | env var **names** only — never values |
13
+
14
+ Example — `constellation/external/EXTERNAL-EMAIL-PROVIDER.md`:
15
+
16
+ ```markdown
17
+ ---
18
+ name: Email provider
19
+ kind: saas-vendor
20
+ status: built
21
+ vendor: Postmark
22
+ purpose: Transactional email (ticket confirmations, assignment notices)
23
+ docs_url: https://postmarkapp.com/developer
24
+ credentials_envs:
25
+ - POSTMARK_SERVER_TOKEN
26
+ ---
27
+
28
+ All outbound email goes through Postmark. This app only sends template IDs and
29
+ variables, never raw HTML.
30
+ ```
@@ -0,0 +1,28 @@
1
+ # FILE cards (`FILE-`, `file/`)
2
+
3
+ Reference from the plan to a real source file. `path` is the only required field
4
+ in the entire format. Create FILE cards for load-bearing files (entry points,
5
+ route tables, core modules) — not for every file in the repo.
6
+
7
+ | Field | Type | Notes |
8
+ |---|---|---|
9
+ | `path` | string | **required** — relative to repo root |
10
+ | `language` | string | `typescript`, `python`, … |
11
+ | `summary` | string | one line |
12
+
13
+ Example — `constellation/file/FILE-TICKETS-ROUTE.md`:
14
+
15
+ ```markdown
16
+ ---
17
+ name: tickets route handler
18
+ status: built
19
+ path: src/api/tickets.ts
20
+ language: typescript
21
+ summary: Express route handlers for the tickets API
22
+ connections:
23
+ - API-TICKETS
24
+ ---
25
+
26
+ Implements [[API-TICKETS]]. Validation lives here; persistence is in the
27
+ repository module it imports.
28
+ ```
@@ -0,0 +1,29 @@
1
+ # FLOW cards (`FLOW-`, `flow/`)
2
+
3
+ A FLOW is a linear narrative: numbered steps in the **body**, with nested list
4
+ items for error/edge branches. If it genuinely branches, it's a Mermaid flowchart
5
+ or actually a STATE card. Steps never go in frontmatter.
6
+
7
+ | Field | Type | Notes |
8
+ |---|---|---|
9
+ | `triggers` | array | `{ kind: cron\|event\|manual, schedule?, event? (handle) }` |
10
+
11
+ Example — `constellation/flow/FLOW-CREATE-TICKET.md`:
12
+
13
+ ```markdown
14
+ ---
15
+ name: Create ticket
16
+ status: built
17
+ triggers:
18
+ - { kind: manual }
19
+ ---
20
+
21
+ # Create ticket
22
+
23
+ 1. Requester submits the public ticket form
24
+ 2. [[API-TICKETS]] POST validates the body against [[DATATYPE-CREATE-TICKET-INPUT]]
25
+ - invalid → 422 with per-field errors
26
+ 3. Row inserted into [[DB-TICKETS]] with status `open`
27
+ 4. [[EVENT-TICKET-CREATED]] fires
28
+ 5. [[JOB-AUTO-ASSIGN]] picks an agent
29
+ ```
@@ -0,0 +1,27 @@
1
+ # JOB cards (`JOB-`, `job/`)
2
+
3
+ One card per background/scheduled/queued task.
4
+
5
+ | Field | Type | Notes |
6
+ |---|---|---|
7
+ | `trigger` | enum | `cron` \| `queue` \| `event` \| `manual` |
8
+ | `schedule` | string | cron expression when `trigger: cron` |
9
+ | `flow` | handle | FLOW this job executes, if any |
10
+ | `max_retries` | integer | ≥ 0 |
11
+ | `idempotency_key` | string | what makes runs idempotent |
12
+
13
+ Example — `constellation/job/JOB-AUTO-ASSIGN.md`:
14
+
15
+ ```markdown
16
+ ---
17
+ name: Auto-assign tickets
18
+ status: planned
19
+ trigger: event
20
+ max_retries: 3
21
+ connections:
22
+ - EVENT-TICKET-CREATED
23
+ ---
24
+
25
+ Listens for [[EVENT-TICKET-CREATED]], picks the agent with the fewest open
26
+ tickets, writes the assignment to [[DB-TICKETS]]. Idempotent per ticket `id`.
27
+ ```
@@ -0,0 +1,28 @@
1
+ # PAGE cards (`PAGE-`, `page/`)
2
+
3
+ One card per route/screen. Route fields are flat (no nested `route` object).
4
+
5
+ | Field | Type | Notes |
6
+ |---|---|---|
7
+ | `route` | string | URL pattern, e.g. `/inbox/:ticket_id?` |
8
+ | `parent` | handle | parent PAGE (layout/shell) this nests under |
9
+ | `path_params` | array | `{ name, type?, required? }` |
10
+ | `query_params` | array | same shape |
11
+
12
+ Example — `constellation/page/PAGE-INBOX.md`:
13
+
14
+ ```markdown
15
+ ---
16
+ name: Inbox
17
+ status: building
18
+ route: /inbox/:ticket_id?
19
+ path_params:
20
+ - { name: ticket_id, type: string, required: false }
21
+ connections:
22
+ - API-TICKETS
23
+ - COMPONENT-TICKET-CARD
24
+ ---
25
+
26
+ The agent-facing ticket list. Loads tickets from [[API-TICKETS]] and renders each
27
+ as a [[COMPONENT-TICKET-CARD]].
28
+ ```
@@ -0,0 +1,37 @@
1
+ # PLAN cards (`PLAN-`, `plan/` — and `plan.md` at the root)
2
+
3
+ `constellation/plan.md` is the card `PLAN-PROJECT`: the short, living summary of
4
+ where the project stands. Scoped plans (`PLAN-FRONTEND`) live in `plan/`.
5
+
6
+ Keep it **short**. Three rules:
7
+
8
+ - Decisions go in DOC cards (`kind: decision`), one file each — not in the plan.
9
+ - Per-card status lives on the cards (`status:`), not in plan checklists.
10
+ - Edit the relevant section; never bulk-rewrite the file (it's shared state).
11
+
12
+ | Field | Type | Notes |
13
+ |---|---|---|
14
+ | `scope` | string | area for scoped plans, e.g. `frontend`; omit for `plan.md` |
15
+
16
+ Example — `constellation/plan.md`:
17
+
18
+ ```markdown
19
+ ---
20
+ name: Project plan
21
+ ---
22
+
23
+ # Project Plan
24
+
25
+ ## Current state
26
+
27
+ - Core ticket loop specced: [[FLOW-CREATE-TICKET]], [[API-TICKETS]], [[DB-TICKETS]]
28
+ - Auto-assignment ([[JOB-AUTO-ASSIGN]]) planned, not built
29
+
30
+ ## Conventions
31
+
32
+ - All ticket payloads use [[DATATYPE-TICKET]]; never inline ticket shapes.
33
+
34
+ ## Last synced
35
+
36
+ Code last reconciled against plan commit `<sha>` (maintained by the sync agent).
37
+ ```
@@ -0,0 +1,25 @@
1
+ # ROLE cards (`ROLE-`, `role/`)
2
+
3
+ One card per role or permission group.
4
+
5
+ | Field | Type | Notes |
6
+ |---|---|---|
7
+ | `permissions` | string[] | conventionally `resource:action` |
8
+ | `issued_by` | string | `app`, `org`, `tenant`, `os`, … |
9
+
10
+ Example — `constellation/role/ROLE-SUPPORT-AGENT.md`:
11
+
12
+ ```markdown
13
+ ---
14
+ name: Support agent
15
+ status: built
16
+ permissions:
17
+ - tickets:read
18
+ - tickets:write
19
+ - tickets:assign
20
+ issued_by: app
21
+ ---
22
+
23
+ A human agent working the inbox. Cannot delete tickets — nothing can; see
24
+ [[DB-TICKETS]].
25
+ ```
@@ -0,0 +1,38 @@
1
+ # STATE cards (`STATE-`, `state/`)
2
+
3
+ One card per state machine. Prefer a ` ```mermaid stateDiagram-v2 ` block in the
4
+ body; the structured frontmatter fields are optional, for tooling that needs them.
5
+
6
+ | Field | Type | Notes |
7
+ |---|---|---|
8
+ | `states` | array | `{ name, initial?, terminal? }` |
9
+ | `transitions` | array | `{ from, to, event? (handle), guard?, action? }` |
10
+
11
+ Example — `constellation/state/STATE-TICKET.md`:
12
+
13
+ ````markdown
14
+ ---
15
+ name: Ticket lifecycle
16
+ status: built
17
+ states:
18
+ - { name: open, initial: true }
19
+ - { name: assigned }
20
+ - { name: resolved }
21
+ - { name: closed, terminal: true }
22
+ transitions:
23
+ - { from: open, to: assigned, action: notify assignee }
24
+ - { from: resolved, to: closed, guard: requester confirms or 7 days pass }
25
+ connections:
26
+ - DB-TICKETS
27
+ ---
28
+
29
+ ```mermaid
30
+ stateDiagram-v2
31
+ [*] --> open
32
+ open --> assigned: agent assigned
33
+ assigned --> resolved: agent resolves
34
+ resolved --> closed: confirmed / 7 days
35
+ ```
36
+
37
+ Transitions are enforced in the API layer, never by direct column updates.
38
+ ````
@@ -0,0 +1,28 @@
1
+ # TEST cards (`TEST-`, `test/`)
2
+
3
+ One card per meaningful test spec (a suite or scenario, not every assertion).
4
+ The category goes in the reserved `kind`: `unit`, `integration`, `e2e`. Connect
5
+ the card to what it covers.
6
+
7
+ | Field | Type | Notes |
8
+ |---|---|---|
9
+ | `framework` | string | `vitest`, `jest`, `pytest`, `playwright`, … |
10
+
11
+ Example — `constellation/test/TEST-CREATE-TICKET.md`:
12
+
13
+ ```markdown
14
+ ---
15
+ name: Create ticket — integration
16
+ kind: integration
17
+ status: verified
18
+ framework: vitest
19
+ connections:
20
+ - API-TICKETS
21
+ - FLOW-CREATE-TICKET
22
+ ---
23
+
24
+ Covers the full [[FLOW-CREATE-TICKET]] happy path plus the 422 branch:
25
+
26
+ - valid input → 201, row in [[DB-TICKETS]], event emitted
27
+ - missing subject → 422, no row, no event
28
+ ```
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-CFOOgrqc.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import"./chunk-NNHCCRGN-DlpIbxXb.js";import{x as e}from"./mermaid-parser.core-DzlZTbbh.js";export{e as createArchitectureServices};