@takesix/mcp 0.0.0-stage → 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.
@@ -0,0 +1,154 @@
1
+ <!-- Copied from takesix-core/FORMAT.md: keep in sync when the format changes. -->
2
+
3
+ # takesix format 1.0
4
+
5
+ A takesix document describes a diagram as a tree of **blocks**. One screen
6
+ shows one level of the tree, and **a level never holds more than 6 blocks**.
7
+ Opening a block shows its children, again at most 6. **Links** connect blocks,
8
+ on the same level or across levels.
9
+
10
+ The format is plain JSON. A machine-readable definition is the JSON Schema in the takesix-core repository
11
+ (`schema/takesix-1.0.schema.json`). Some rules
12
+ cannot be expressed in JSON Schema (unique ids, link endpoints); those are
13
+ listed below and checked by `validateDocument()` in `@takesix/core` and by
14
+ `scripts/takesix.mjs validate` in this skill.
15
+
16
+ ## Example
17
+
18
+ ```json
19
+ {
20
+ "$schema": "https://raw.githubusercontent.com/vvapnik/takesix-core/main/schema/takesix-1.0.schema.json",
21
+ "takesix": "1.0",
22
+ "title": "Online shop",
23
+ "blocks": [
24
+ { "id": "web", "icon": "🖥", "title": "Web app", "description": "React SPA" },
25
+ {
26
+ "id": "api",
27
+ "title": "API",
28
+ "description": "Public HTTP API",
29
+ "children": [
30
+ { "id": "auth", "title": "Auth", "size": "S" },
31
+ { "id": "orders", "title": "Orders", "size": "L", "details": "Handles **checkout** and refunds." }
32
+ ]
33
+ },
34
+ { "id": "db", "title": "Database" }
35
+ ],
36
+ "links": [
37
+ { "id": "l1", "from": "web", "to": "api", "label": "REST" },
38
+ { "id": "l2", "from": "orders", "to": "db", "label": "SQL" }
39
+ ]
40
+ }
41
+ ```
42
+
43
+ ## Document
44
+
45
+ | Field | Type | Required | Meaning |
46
+ |---|---|---|---|
47
+ | `takesix` | string | yes | Format version, `"1.0"`. |
48
+ | `title` | string | yes | Non-empty. |
49
+ | `blocks` | Block[] | yes | Top level, at most 6. |
50
+ | `links` | Link[] | | All links of the document. |
51
+ | `description` | string | | |
52
+ | `meta` | object | | Extension data, see below. |
53
+ | `$schema` | string | | Schema URL for editors. |
54
+
55
+ ## Block
56
+
57
+ | Field | Type | Required | Meaning |
58
+ |---|---|---|---|
59
+ | `id` | string | yes | Non-empty, unique across the whole document. |
60
+ | `title` | string | yes | Non-empty. Shown on the card. |
61
+ | `description` | string | | Short plain text shown on the card. |
62
+ | `details` | string | | Long Markdown text shown in the details panel. |
63
+ | `icon` | string | | An emoji or a single character. |
64
+ | `size` | Size | | Width on its level, `"M"` when absent. |
65
+ | `children` | Block[] | | At most 6. |
66
+ | `meta` | object | | Extension data. |
67
+
68
+ **Ids are permanent.** Links, comments and collaborative editing refer to
69
+ blocks by id, so tools must never rename or reuse an id. Any non-empty string
70
+ works; short readable slugs (`"orders-db"`) are easiest to hand-edit.
71
+
72
+ ## Link
73
+
74
+ | Field | Type | Required | Meaning |
75
+ |---|---|---|---|
76
+ | `from` | string | yes | Id of a block. |
77
+ | `to` | string | yes | Id of another block. |
78
+ | `id` | string | | Unique among links. Editors always set it. |
79
+ | `label` | string | | Short text drawn on the arrow. |
80
+ | `description` | string | | Longer explanation. |
81
+ | `direction` | `"forward"` \| `"both"` \| `"none"` | | Defaults to `"forward"` (from → to). |
82
+ | `meta` | object | | Extension data. |
83
+
84
+ ### How links appear on screen
85
+
86
+ Links may join blocks on any levels. On the screen of a given level, each
87
+ endpoint is replaced by its ancestor on that level:
88
+
89
+ - `orders → db` from the example appears on the top level as **api → db**,
90
+ because `orders` lives inside `api`.
91
+ - A link is hidden on a level when both endpoints fall into the same block
92
+ there, or when an endpoint is outside the opened block.
93
+ - Several links between the same two blocks merge into one arrow. Opposite
94
+ one-way links merge into a two-way arrow.
95
+
96
+ A link between a block and its own ancestor or descendant is never visible on
97
+ any level. It is allowed in files (validators warn about it) but editors do
98
+ not create such links.
99
+
100
+ ## Size
101
+
102
+ There are no layouts to choose from: a level is a flow of blocks, left to
103
+ right, wrapping to the next row. Each block sets its own width:
104
+
105
+ | Size | Width |
106
+ |---|---|
107
+ | `"S"` | a third |
108
+ | `"M"` | a half (default) |
109
+ | `"L"` | two thirds |
110
+ | `"F"` | the full width |
111
+
112
+ Three `S` blocks make a row of tiles, six `F` blocks make a list, `L` + `S`
113
+ or `M` + `M` fill a row. Blocks keep their order; a block that does not fit
114
+ the rest of a row starts the next one.
115
+
116
+ ## Validation rules
117
+
118
+ Errors (the document is rejected):
119
+
120
+ - missing required field, wrong type, empty `id` or `title`;
121
+ - more than 6 blocks on one level;
122
+ - duplicate block id, duplicate link id;
123
+ - link endpoint that is not a block id;
124
+ - link from a block to itself;
125
+ - unknown `size` or `direction` value;
126
+ - version with a major number other than `1`.
127
+
128
+ Warnings (the document is accepted):
129
+
130
+ - unknown field (likely a typo; use `meta` for extension data);
131
+ - link that can never be visible (see above).
132
+
133
+ The JSON Schema is stricter about unknown fields than `validateDocument()`:
134
+ it rejects them, which helps catch typos when a document is generated.
135
+
136
+ ## Extension data
137
+
138
+ Put tool-specific data in `meta` on the document, a block or a link. Tools
139
+ must keep `meta` they do not understand. Prefix keys with your tool name to
140
+ avoid clashes, e.g. `{ "meta": { "confluence.pageId": "123" } }`.
141
+
142
+ ## Versioning
143
+
144
+ `takesix` is `"<major>.<minor>"`. A minor release only adds optional fields,
145
+ so a 1.0 reader can open a 1.x document (it will warn about the new fields).
146
+ A new major version means a breaking change; readers reject majors they do not
147
+ know.
148
+
149
+ ## Legacy format
150
+
151
+ The original takesix app stored a bare array of entities with per-entity
152
+ `connections` (same-level target ids). `parseDocument()` detects that shape
153
+ and converts it: entities become blocks, each connection becomes a link with
154
+ id `"<from>-><to>"`.