dreamteamer 0.32.0 → 0.33.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 +4 -2
- package/collections/agents.collection.yaml +41 -32
- package/collections/collections.collection.yaml +68 -230
- package/collections/command-bindings.collection.yaml +37 -43
- package/collections/commands.collection.yaml +50 -35
- package/collections/mixins.collection.yaml +49 -0
- package/collections/modules.collection.yaml +76 -122
- package/collections/repos.collection.yaml +53 -56
- package/collections/skills.collection.yaml +32 -21
- package/collections/ui-views.collection.yaml +57 -46
- package/mixins/docs.mixin.yaml +21 -0
- package/mixins/entity.mixin.yaml +22 -0
- package/package.json +5 -3
- package/scripts/migrate-descriptors-v2.mjs +795 -0
- package/skills/using-dreamteamer/SKILL.md +27 -24
- package/skills/using-dreamteamer/references/agents.md +1 -1
- package/skills/using-dreamteamer/references/before-you-build.md +1 -5
- package/skills/using-dreamteamer/references/collections.md +450 -348
- package/skills/using-dreamteamer/references/commands.md +49 -35
- package/skills/using-dreamteamer/references/data-modeling.md +342 -319
- package/skills/using-dreamteamer/references/extensions.md +8 -5
- package/skills/using-dreamteamer/references/getting-started.md +6 -4
- package/skills/using-dreamteamer/references/records.md +43 -34
- package/skills/using-dreamteamer/references/skills.md +4 -3
- package/skills/using-dreamteamer/references/ui-components.md +30 -32
- package/skills/using-dreamteamer/references/ui-views.md +122 -124
- package/src/api.d.ts +22 -2
- package/src/api.js +16 -1
- package/src/check.js +55 -40
- package/src/checkout.js +14 -13
- package/src/cli.js +118 -71
- package/src/collections-cli.js +136 -144
- package/src/commit.js +9 -8
- package/src/compile-collections.js +346 -0
- package/src/compile.js +232 -1068
- package/src/descriptor-v2.js +165 -0
- package/src/descriptor.js +90 -0
- package/src/doctor.js +57 -0
- package/src/events.js +11 -10
- package/src/extensions.js +48 -10
- package/src/field-values.js +7 -6
- package/src/fields.js +254 -0
- package/src/filter.js +45 -1
- package/src/fractional-index.js +2 -2
- package/src/harnesses.js +80 -52
- package/src/history.js +3 -3
- package/src/init.js +74 -46
- package/src/namespace.js +23 -9
- package/src/placement.js +26 -16
- package/src/presentation.js +153 -299
- package/src/record-commands.js +12 -12
- package/src/records-api.d.ts +106 -7
- package/src/records-api.js +2 -1
- package/src/records.js +20 -14
- package/src/ref.js +3 -39
- package/src/relations.js +23 -24
- package/src/runtime.js +12 -35
- package/src/schema-ops.js +1181 -1275
- package/src/store.js +212 -82
- package/src/template.js +100 -24
- package/src/temporal.js +11 -3
- package/src/views.js +176 -0
- package/src/workspace.js +14 -0
- package/src/yaml.js +66 -5
- package/collection-templates/docs.collection-template.yaml +0 -17
- package/collection-templates/entity.collection-template.yaml +0 -20
- package/collections/collection-templates.collection.yaml +0 -20
|
@@ -4,12 +4,13 @@ Core is records plus the workspace compiler. Anything with a lifecycle of its ow
|
|
|
4
4
|
Docker host, a behaviour-test runner, an exporter to one vendor — is an **extension**: code the engine
|
|
5
5
|
calls, which a workspace has when it wants that capability and does without otherwise.
|
|
6
6
|
|
|
7
|
-
The verbs
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
The verbs core does not ship live in packages: `prove` in `@dreamteamer/proofs`, `land` and
|
|
8
|
+
`worktree` in `@dreamteamer/worktrees`, `serve` in `@dreamteamer/http`, `notebooklm` in
|
|
9
|
+
`@dreamteamer/notebooklm`, and the container verbs in the global `dt-docker` bin. Typed without the
|
|
10
|
+
package, each exits 2 and prints its install line.
|
|
11
11
|
|
|
12
|
-
`dt status` lists the extensions this workspace loaded,
|
|
12
|
+
`dt status` lists the extensions this workspace loaded, `dt help` appends each one's usage, and
|
|
13
|
+
`dt doctor` shows what works on this machine — the engine's rows, then each extension's checks.
|
|
13
14
|
|
|
14
15
|
## how a workspace turns one on
|
|
15
16
|
|
|
@@ -47,6 +48,8 @@ never disagree with the one the operator ran. It returns a contribution; every k
|
|
|
47
48
|
| `harnesses` | `{ <id>: (ctx) → { blocks: { <file>: text }, summary } }` | a harness adapter writing managed blocks into user-owned files |
|
|
48
49
|
| `orientation` | a string | one paragraph appended to every orientation block |
|
|
49
50
|
| `hooks` | `{ <ClaudeHookEvent>: '<dt verb args>' }` | merged into `dt install --print-adapters` |
|
|
51
|
+
| `check` | `({ root, ws, dt }) → [{ file, message }]` | `dt check` reports each as a violation after the schema's, attributed to the extension; a throw is a violation too |
|
|
52
|
+
| `doctor` | `({ root, ws, dt }) → [{ label, state: ok\|warn\|bad, detail?, fix? }]` | `dt doctor` renders the rows as one capability named after the extension: READY, DEGRADED (a warn) or UNAVAILABLE (a bad), each fix on its row |
|
|
50
53
|
|
|
51
54
|
The `draft` is data only: the staged entries, the final merged descriptors, the modules, declared var
|
|
52
55
|
and env key NAMES, and the previous manifest. No writer, no Store, no environment values — an analysis
|
|
@@ -31,9 +31,11 @@ npx dreamteamer check # should report 0 violations over the starter collec
|
|
|
31
31
|
|
|
32
32
|
`init` writes the `dreamteamer` block into `package.json` (the workspace manifest —
|
|
33
33
|
`collections.md`), a workspace module at `modules/default/` with a starter `notes` collection,
|
|
34
|
-
|
|
35
|
-
harness folders, and the
|
|
36
|
-
|
|
34
|
+
`.env.example`, and a `.gitignore` covering the build output. `compile` is what makes it real: the
|
|
35
|
+
runtime under `.dreamteamer/`, the harness folders, and the root `CLAUDE.md`/`AGENTS.md`/`GEMINI.md`
|
|
36
|
+
whose orientation block every future agent session reads — which is how the next session finds
|
|
37
|
+
this skill without being told. Those three files are compiled, never committed; the workspace's
|
|
38
|
+
own rules go in `DREAMTEAMER.md`, which compile copies into them.
|
|
37
39
|
|
|
38
40
|
## git, in plain words
|
|
39
41
|
|
|
@@ -108,7 +110,7 @@ prefers. Nothing about the code moves; `check` and `compile` read only what desc
|
|
|
108
110
|
| modeling the whole domain up front | one collection used tomorrow beats five perfect ones — widening is always safe later (`data-modeling.md` Part IX) |
|
|
109
111
|
| test data in the seed records | real records are what catch the model's mistakes |
|
|
110
112
|
| skipping git as "too technical" | one local command, no account — and it is the history, the undo and the publish step |
|
|
111
|
-
| inventing ids by hand | `
|
|
113
|
+
| inventing ids by hand | `ids.from` owns identity — pass `--id` only when the operator named one |
|
|
112
114
|
| hand-writing the first descriptor | `dt add collections` is compile-gated and publishes itself; hand-written sources owe `dt compile` |
|
|
113
115
|
| rewriting existing files to fit a guessed schema | describe reality, compile, `check` — then decide which violations are worth fixing in the data |
|
|
114
116
|
| waiting for a UI before starting | the CLI and the records are the complete system; any surface renders them later, unchanged |
|
|
@@ -23,11 +23,12 @@ the verbs and flags are `dt help`'s job; what to know *about* them:
|
|
|
23
23
|
in one `--where`** — its operator grammar is enumerated in `dt help`, and it is
|
|
24
24
|
the same one views and gates use — e.g.
|
|
25
25
|
`dt list health/prescriptions --where '{"_and":[{"patient":{"_eq":"health/patients/dana-levi"}},{"status":{"_eq":"active"}}]}'`.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
collection of
|
|
26
|
+
`$today` and `$now` are the two value tokens (`{"date":{"_lte":"$today"}}`); any other `$word`
|
|
27
|
+
is refused. `--filter` and `--sort` refuse a field the collection lacks, but inside `--where`
|
|
28
|
+
⚠ an unknown field or a dangling ref **narrows to nothing** rather than erroring.
|
|
29
|
+
- ⚠ **there is no `@me` and no `users` collection.** when a person is needed, read
|
|
30
|
+
`git config user.name`; filter on a person only when this workspace ships its own collection of
|
|
31
|
+
people.
|
|
31
32
|
- `dt values <collection> <field>` is a field's *actual* vocabulary — what a proposal, a filter
|
|
32
33
|
or a validator should offer as choices.
|
|
33
34
|
- `--json` works on every record and reporting verb (`resolve` excepted) — use it whenever
|
|
@@ -38,29 +39,35 @@ the verbs and flags are `dt help`'s job; what to know *about* them:
|
|
|
38
39
|
## writing through the CLI
|
|
39
40
|
|
|
40
41
|
- **validation is hard and includes unknown fields.** a typo'd key (`--assinee`), a dangling ref,
|
|
41
|
-
a bad enum value (the error echoes what it got), an id missing `
|
|
42
|
+
a bad enum value (the error echoes what it got), an id missing `ids.pattern` — rejected with
|
|
42
43
|
nothing written. a rejected write leaves no partial state.
|
|
43
44
|
- **a write puts the record on disk; `dt commit` publishes it** — committing is workspace policy
|
|
44
|
-
(`
|
|
45
|
-
- `set <collection>/<id> <field>=` with an empty value **removes** the field; the
|
|
45
|
+
(`auto_commit` in `package.json`, default off), never part of the write.
|
|
46
|
+
- `set <collection>/<id> <field>=` with an empty value **removes** the field; the body field is
|
|
46
47
|
set like any other field.
|
|
48
|
+
- **some fields refuse every writer**, naming why: a generated mirror (set the owner's field
|
|
49
|
+
instead), `created` (the engine stamps it at add), and `id` / `last_modified` (computed on read).
|
|
50
|
+
a `unique` value another record holds is refused too, naming that record.
|
|
47
51
|
- an **array field** takes a comma-separated value (`--tags a,b`, `tags=a,b`) — or the flag/pair
|
|
48
52
|
**repeated**, one element per sighting (`--tags a --tags b`), which is how a value that itself
|
|
49
|
-
contains a comma gets written. ⚠ repeating a **scalar** field is refused, naming it
|
|
50
|
-
keep the last value silently, so the first one never reached disk.
|
|
53
|
+
contains a comma gets written. ⚠ repeating a **scalar** field is refused, naming it.
|
|
51
54
|
- ids generate from the record's own creation-time values — pass `--id` only when the operator
|
|
52
|
-
named one.
|
|
55
|
+
named one, or when the generated id collides (the refusal names the record holding it).
|
|
56
|
+
- a `type: position` field is the collection's manual order: `dt reorder <collection>/<id>
|
|
57
|
+
--after|--before <id> | --top | --bottom`, never a hand-set value.
|
|
53
58
|
|
|
54
59
|
## before writing anything
|
|
55
60
|
|
|
56
|
-
read the compiled descriptor: `.dreamteamer/collections/<collection>.collection.yaml`. it
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
read the compiled descriptor: `.dreamteamer/collections/<collection>.collection.yaml`. it holds
|
|
62
|
+
what the author wrote — `fields` (each with its `type`, `required`, `enum`, `description`…),
|
|
63
|
+
`storage`, `ids` (`from` + `pattern`), `record_title`, `display` — and a `compiled:` block with
|
|
64
|
+
what compile decided: `defaults` (every value it supplied), `fields` (resolved, the injected `id`,
|
|
65
|
+
`created` and `last_modified` included) and `json_schema` (what the validator runs). the field
|
|
66
|
+
vocabulary is `collections.md`.
|
|
60
67
|
|
|
61
|
-
the
|
|
62
|
-
carries its conventions, an `examples:`
|
|
63
|
-
|
|
68
|
+
the descriptor is the CONTRACT, and it is required to be sufficient: each field's `description`
|
|
69
|
+
carries its conventions, an `examples:` list carries a canonical value where the shape is
|
|
70
|
+
non-obvious, and
|
|
64
71
|
`dt values` shows a vocabulary's real spread. so **with a sufficient schema, do not open sibling
|
|
65
72
|
records for shape** — the descriptor answers faster than a peek, the validator rejects a wrong
|
|
66
73
|
write before disk, and a sibling is a bet on whichever record you grabbed being representative
|
|
@@ -83,13 +90,14 @@ the same breath, so the next writer needs no peek. then:
|
|
|
83
90
|
- put the file where the id says: the id IS its path inside `storage.path`, minus suffix and
|
|
84
91
|
extension (folder-shape records are a folder named `<id>` holding the descriptor's `entry`).
|
|
85
92
|
the id template is evaluated ONCE, at creation, and never re-derived — a later edit to a field
|
|
86
|
-
it named does not move the record — and the result must satisfy `
|
|
93
|
+
it named does not move the record — and the result must satisfy `ids.pattern`.
|
|
87
94
|
- **materialize defaults explicitly** — write `status: todo` even though it's the schema default;
|
|
88
|
-
a file should be legible without its schema.
|
|
95
|
+
a file should be legible without its schema. leave `created` out: a hand-written record reads
|
|
96
|
+
it from the commit that added the file (or from its id, when `ids.from` names `created`).
|
|
89
97
|
- `dt check` is the only validation a hand-write gets. run it before you commit.
|
|
90
98
|
|
|
91
|
-
example — `data/tasks/2026-07-25--fix-login-flow.task.md` (`md
|
|
92
|
-
fields, the body is the single `
|
|
99
|
+
example — `data/tasks/2026-07-25--fix-login-flow.task.md` (`format: md`: frontmatter holds the
|
|
100
|
+
fields, the body is the single `body: true` field):
|
|
93
101
|
|
|
94
102
|
```markdown
|
|
95
103
|
---
|
|
@@ -103,8 +111,8 @@ Users report the login button does nothing on mobile.
|
|
|
103
111
|
|
|
104
112
|
## namespaced collections
|
|
105
113
|
|
|
106
|
-
a collection may be scoped under a namespace
|
|
107
|
-
|
|
114
|
+
a collection may be scoped under a namespace its module declares (`dreamteamer.namespaces` in
|
|
115
|
+
the module's `package.json`). working with its records is unchanged except that the QUALIFIED name
|
|
108
116
|
is the collection's name everywhere: `health/doctors/dana-levi` is the collection `health/doctors`
|
|
109
117
|
and the id `dana-levi` — a reference splits at the end of the **declared** prefix, never at the
|
|
110
118
|
first slash. the default namespace has no prefix (`tasks/kickoff`, exactly as always), and an
|
|
@@ -114,7 +122,9 @@ undeclared prefix reads as a nested id and dangles — `dt check` says so. decla
|
|
|
114
122
|
## records stored under another record — the folder follows the owner
|
|
115
123
|
|
|
116
124
|
a collection may declare `storage.under` (`collections.md`): a meeting with a `company` lives in
|
|
117
|
-
that company's folder, one without stays in `data/meetings/`.
|
|
125
|
+
that company's folder, one without stays in `data/meetings/`. with `under.id: nested` the id
|
|
126
|
+
begins with the parent's and changing the parent is a `dt rename`, not a `dt set`; the rest of
|
|
127
|
+
this section is the default, independent id. working with it is unchanged in
|
|
118
128
|
every way that names a record — `list` is the whole collection, `get`/`set`/`rm`/`rename` take
|
|
119
129
|
`meetings/<id>` wherever the file sits, references never carry a folder — and different in one:
|
|
120
130
|
**the owner field moves the file.** `dt set meetings/<id> company=companies/harbor` relocates the
|
|
@@ -130,9 +140,8 @@ the declaration is removed or its path changed: `dt relocate <collection> --to-r
|
|
|
130
140
|
|
|
131
141
|
## two-way relations — the mirror is generated, and read-only
|
|
132
142
|
|
|
133
|
-
a
|
|
134
|
-
|
|
135
|
-
side. so **never set or hand-edit a mirror** — `dt set` refuses it, and a hand-edit is what
|
|
143
|
+
a field on the TARGET collection may declare `mirror_of: <owner field>`: it is GENERATED, and
|
|
144
|
+
the store maintains its value in the same write as every change to the owning side. so **never set or hand-edit a mirror** — `dt set` refuses it, and a hand-edit is what
|
|
136
145
|
`check` reports as `<field>: stale`; write the owning side's reference and the mirror follows.
|
|
137
146
|
`dt relations` lists every pair (owner.field → target.mirror, cardinality, on-delete) and
|
|
138
147
|
`dt relations rebuild <collection>` recomputes mirror values from the owning side — the repair
|
|
@@ -158,8 +167,8 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
|
|
|
158
167
|
- **an attached FILE follows the filing convention**: a files folder is named after the
|
|
159
168
|
collection or field that indexes it, and the path below it is the record id —
|
|
160
169
|
`${env:FILES_FOLDER}/visit-recordings/<record id>.m4a` needs no lookup table. a collection
|
|
161
|
-
whose records ARE files (`
|
|
162
|
-
`dt add <collection> --from <path>`, never with field flags: the fields derive from the file.
|
|
170
|
+
whose records ARE files (`format: binary` — icons, images) is written with
|
|
171
|
+
`dt add <collection> <id> --from <path>`, never with field flags: the fields derive from the file.
|
|
163
172
|
- ⚠ **templates are ordinary data — write them literally.** `get`, `list`, `check` and every
|
|
164
173
|
harness read the template verbatim; nothing substitutes until resolve is called.
|
|
165
174
|
|
|
@@ -167,7 +176,7 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
|
|
|
167
176
|
|
|
168
177
|
- **commit when a logical change is complete.** an uncommitted write is invisible to `dt changes` and to every
|
|
169
178
|
other CLONE — while a session SHARING this tree sees it immediately, which is why the sweep
|
|
170
|
-
rules below exist — `
|
|
179
|
+
rules below exist — `auto_commit` off makes the commit a deliberate act, not a
|
|
171
180
|
forbidden one, and publishing what the operator asked you to write needs scope, not permission.
|
|
172
181
|
`dt status` says what is pending.
|
|
173
182
|
- **records are `dt commit`'s to publish; sources are git's.** a module source change (a
|
|
@@ -189,7 +198,7 @@ source_file: ${env:FILES_FOLDER}/2026/q3.pdf
|
|
|
189
198
|
own owner is dirty from someone else: scope to the pair rather than publish half of anyone's
|
|
190
199
|
work. the COLLECTION form publishes exactly what it names and prints the partners it left
|
|
191
200
|
pending — HEAD then fails `dt check` until they land.
|
|
192
|
-
- **one commit per REPO.** a module can own its records (`
|
|
201
|
+
- **one commit per REPO.** a module can own its records (`owns_data` in its package.json), and
|
|
193
202
|
git has no cross-repo commit — a rename whose inbound refs live in another repo is TWO commits;
|
|
194
203
|
`dt commit` prints both.
|
|
195
204
|
- when git is used directly (hand-edited markdown bodies), stage the specific files — never
|
|
@@ -216,7 +225,7 @@ every inbound reference; `dt rename` moves the file and rewrites
|
|
|
216
225
|
every inbound ref in the same WRITE — `dt commit` then publishes the whole rename together (the
|
|
217
226
|
entanglement guard prints the set to name). **never
|
|
218
227
|
delete a referenced record** — `rm` refuses while anything points at it, unless that field
|
|
219
|
-
declares `
|
|
228
|
+
declares `on_delete: set-null`, which clears it instead; retarget first. **a changed title
|
|
220
229
|
never changes the id.** **one logical change, one commit** — a bulk import is ONE change, not
|
|
221
230
|
two hundred.
|
|
222
231
|
|
|
@@ -231,7 +240,7 @@ two hundred.
|
|
|
231
240
|
| `--force` to get past an `rm` refusal | it leaves inbound refs dangling — retarget them first (unless the refusal named a *prose* mention, which isn't a real reference) |
|
|
232
241
|
| omitting schema defaults from a hand-written file | the file stops being legible without the schema |
|
|
233
242
|
| unquoted `due: 2026-07-28` in hand-written YAML | dreamteamer parses CORE_SCHEMA so it stays a string *here*, but a default-schema YAML reader turns it into a timestamp — quote dates |
|
|
234
|
-
| setting a generated mirror | refused by `set`; a hand-edit goes stale — write the owning side |
|
|
243
|
+
| setting a generated mirror, or `created` | refused by `set`; a hand-edit of a mirror goes stale — write the owning side |
|
|
235
244
|
| CLI-editing a skill / agent / command / collection | system sources — edit the module file, then `dt compile` |
|
|
236
245
|
| resolving a template by hand | `dt resolve` is the only substitution point |
|
|
237
246
|
|
|
@@ -32,7 +32,8 @@ duplicate beside it is worse than the gap.
|
|
|
32
32
|
|
|
33
33
|
- **One-off fixes** — just do them. A narrative of how you solved something once is a story, not a
|
|
34
34
|
skill; keep the *technique* if it generalizes, drop the episode.
|
|
35
|
-
- **Workspace conventions** — `
|
|
35
|
+
- **Workspace conventions** — `DREAMTEAMER.md` is compiled into every harness's instruction file,
|
|
36
|
+
loaded always, and needs no trigger; a convention in a
|
|
36
37
|
skill is a convention a session might not load.
|
|
37
38
|
- **Anything a validator can enforce** — automate it and save prose for judgment calls. A regex in
|
|
38
39
|
`check` never gets skimmed past; a sentence does.
|
|
@@ -44,9 +45,9 @@ duplicate beside it is worse than the gap.
|
|
|
44
45
|
|
|
45
46
|
How a skill is found differs by harness, and both routes run through the same line. claude-code
|
|
46
47
|
discovers skills natively — the harness reads each description and offers the skill when it
|
|
47
|
-
matches. Every other harness gets the descriptions compiled into the
|
|
48
|
+
matches. Every other harness gets the descriptions compiled into the generated orientation block
|
|
48
49
|
(`AGENTS.md`, `GEMINI.md`, `.cursor/rules/…`) as a trigger index. Two consequences: the description
|
|
49
|
-
travels into
|
|
50
|
+
travels into every harness file (one line, third person, nothing sensitive), and it is the **only**
|
|
50
51
|
thing any session sees before deciding to load.
|
|
51
52
|
|
|
52
53
|
So the description states **when to load** — symptoms, situations, verbs — and never what the skill
|
|
@@ -11,9 +11,9 @@ you climb only as far as the job forces you:
|
|
|
11
11
|
|
|
12
12
|
| you want | try first |
|
|
13
13
|
|---|---|
|
|
14
|
-
| a different control for a field | the **descriptor** — shape drives the control (`data-modeling.md` Part VII: enum → dropdown,
|
|
15
|
-
| a different arrangement of a collection | a **ui-view**
|
|
16
|
-
| the same layout, tuned |
|
|
14
|
+
| a different control for a field | the **descriptor** — shape drives the control (`data-modeling.md` Part VII: enum → dropdown, `many` → chips, `body: true` → the page), and a field's `display.editor` / `display.viewer` names a registered one |
|
|
15
|
+
| a different arrangement of a collection | `display.list.layout` — on the collection, or a **ui-view** (`ui-views.md`) |
|
|
16
|
+
| the same layout, tuned | `display.list.options` |
|
|
17
17
|
| a rendering or editing behaviour nothing registered has | **component code** — this reference |
|
|
18
18
|
|
|
19
19
|
| the question | read |
|
|
@@ -28,10 +28,10 @@ you climb only as far as the job forces you:
|
|
|
28
28
|
|
|
29
29
|
| registry | what it holds | bound by |
|
|
30
30
|
|---|---|---|
|
|
31
|
-
| `edits` | field editors, **and whole-record Edit pages** (`scope: 'record'`) | a field's
|
|
32
|
-
| `views` | field read-renderers, and whole-record View pages | a field's
|
|
33
|
-
| `lists` | collection browse arrangements (table, cards, kanban, …) | a
|
|
34
|
-
| `apps` | routed subtrees + a nav icon (mounted under `/a/<id>`) | registration alone; a `page
|
|
31
|
+
| `edits` | field editors, **and whole-record Edit pages** (`scope: 'record'`) | a field's `display.editor`, else its type's kind default |
|
|
32
|
+
| `views` | field read-renderers, and whole-record View pages | a field's `display.viewer`, else its type's kind default; `display.record.layout` for a record page |
|
|
33
|
+
| `lists` | collection browse arrangements (table, cards, kanban, …) | `display.list.layout`, on a collection or a ui-view |
|
|
34
|
+
| `apps` | routed subtrees + a nav icon (mounted under `/a/<id>`) | registration alone; a `scope: page` ui-view can name one |
|
|
35
35
|
| `panels`, `operations` | dashboard panels, flow operations | registration alone |
|
|
36
36
|
|
|
37
37
|
"A record page is an Edit/View too": the built-in record pages (`form`, `doc`, `properties`,
|
|
@@ -41,14 +41,14 @@ reference implementation for everything on this page.
|
|
|
41
41
|
|
|
42
42
|
## resolution — how the surface picks a component
|
|
43
43
|
|
|
44
|
-
For a **field**, the chain is: the
|
|
45
|
-
**kind default** for the field's wire type
|
|
46
|
-
worth internalizing:
|
|
44
|
+
For a **field**, the chain is: the `editor`/`viewer` on the field's presentation row (its
|
|
45
|
+
`display.editor`/`display.viewer`, when authored) → the **kind default** for the field's wire type
|
|
46
|
+
and role → the ultimate fallback (`input` / `text`). Two facts worth internalizing:
|
|
47
47
|
|
|
48
|
-
- **The
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
- **The row carries the authored type name, `role` and `many`** (`data-modeling.md` §29), and the
|
|
49
|
+
surface picks the control from them — so most fields need no id at all: change the *shape* and
|
|
50
|
+
every surface follows. Name an id in `display` only for a field whose shape genuinely cannot say it
|
|
51
|
+
(a location drawn as a map pin).
|
|
52
52
|
- **The kind-default maps are module-extensible**: `registerKindDefault('view', 'geometry', 'map')`
|
|
53
53
|
makes your component the default for a wire type across the whole workspace without touching
|
|
54
54
|
core resolution.
|
|
@@ -56,19 +56,18 @@ worth internalizing:
|
|
|
56
56
|
Every miss in the chain **degrades with a reported reason, never a blank** — the same posture as
|
|
57
57
|
everything else on this page.
|
|
58
58
|
|
|
59
|
-
For a **collection browse**,
|
|
60
|
-
`table`). For a **record page**,
|
|
61
|
-
`
|
|
59
|
+
For a **collection browse**, `display.list.layout` names a List id (unregistered → visible degrade
|
|
60
|
+
to `table`). For a **record page**, `display.record.layout` names a record-scoped Edit/View
|
|
61
|
+
(default `page`).
|
|
62
62
|
|
|
63
|
-
So a module has
|
|
64
|
-
for a
|
|
65
|
-
|
|
63
|
+
So a module has four binding surfaces: `display.list.layout` for a browse, `display.record.layout`
|
|
64
|
+
for a record page, a field's `display.editor`/`viewer`, and `registerKindDefault` for all fields of
|
|
65
|
+
a wire type.
|
|
66
66
|
|
|
67
67
|
## the module contract
|
|
68
68
|
|
|
69
69
|
A module ships a browser entry — `ui/app.js` (plain JS, host-provided Vue) or a built
|
|
70
|
-
`ui/dist/app.js` (which wins when both exist; `studio/` is the
|
|
71
|
-
accepted). Compile stages it to `.dreamteamer/ui/<shortName>/app.js` — shortName is the package
|
|
70
|
+
`ui/dist/app.js` (which wins when both exist; a `studio/` folder is read the same way). Compile stages it to `.dreamteamer/ui/<shortName>/app.js` — shortName is the package
|
|
72
71
|
name made url-safe (`@a/crm` → `a--crm`; a collision fails compile) — and the surface
|
|
73
72
|
dynamic-imports every staged entry at boot. The **default export** is a register function:
|
|
74
73
|
|
|
@@ -87,7 +86,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
|
|
|
87
86
|
`import { useRouter } from 'vue-router'` — only Vue itself is host-exposed. Use it for
|
|
88
87
|
programmatic navigation.
|
|
89
88
|
- **`registerApp` routes mount under `/a/<id>`** — a module route `path: 'board'` resolves at
|
|
90
|
-
`/a/<id>/board`, `path: ''` is the app index. A `page
|
|
89
|
+
`/a/<id>/board`, `path: ''` is the app index. A `scope: page` ui-view renders the app's **first
|
|
91
90
|
declared route**, so list the index first.
|
|
92
91
|
- A UI bundle **is** a module contribution: a module that ships only a layout is a legitimate
|
|
93
92
|
module.
|
|
@@ -95,7 +94,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
|
|
|
95
94
|
## design rules — the sharp edges
|
|
96
95
|
|
|
97
96
|
- **Give every entry an explicit, stable `id`.** That string is the entire binding surface — every
|
|
98
|
-
|
|
97
|
+
`display.*.layout`, `display.editor`/`viewer` and kind default names it. Renaming it breaks all of them, silently.
|
|
99
98
|
- **`types` advertises picker candidacy — it never sets a default.** A non-empty `types` array
|
|
100
99
|
offers your Edit/View in the field designer's picker for those wire types; the *actual* kind
|
|
101
100
|
defaults live in one place — the kind-default maps, changed only by `registerKindDefault` (or by
|
|
@@ -114,7 +113,7 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
|
|
|
114
113
|
- **Failures are isolated, not surfaced.** A module whose entry fails to import or throws while
|
|
115
114
|
registering is caught, warned and skipped — the surface still loads, your component just never
|
|
116
115
|
appears. **Read the browser console**; nothing else will tell you. (The visible symptom
|
|
117
|
-
elsewhere: a `page` ui-view rendering its "not registered" placeholder.)
|
|
116
|
+
elsewhere: a `scope: page` ui-view rendering its "not registered" placeholder.)
|
|
118
117
|
- ⚠ **Portalled UI cannot rely on scoped CSS.** Menus, popovers and dialogs are teleported outside
|
|
119
118
|
the component subtree, so a scoped rule looks correct in the source and is simply absent at
|
|
120
119
|
runtime — the failure mode is invisible chrome, not an error. Define those styles globally.
|
|
@@ -128,26 +127,25 @@ export default ({ registerEdit, registerView, registerList, registerApp, registe
|
|
|
128
127
|
|
|
129
128
|
1. **Write** the component in the module's `ui/` tree.
|
|
130
129
|
2. **Register** it in that module's `app.js` with a stable `id`. Plain-JS `app.js` needs no build;
|
|
131
|
-
a module wanting a toolchain builds to `ui/dist/app.js` itself.
|
|
132
|
-
is needed
|
|
133
|
-
unregistered ids degrade visibly instead. Decision 195.)
|
|
130
|
+
a module wanting a toolchain builds to `ui/dist/app.js` itself. No `package.json` declaration
|
|
131
|
+
is needed; an unregistered id degrades visibly.
|
|
134
132
|
3. **Compile** — that stages the bundle into the runtime.
|
|
135
133
|
4. **Look at it in the real surface** — reload the window so boot re-imports the staged bundle,
|
|
136
134
|
and open the console before deciding it "didn't work".
|
|
137
|
-
5. **Bind it** — a
|
|
138
|
-
this step touches
|
|
135
|
+
5. **Bind it** — a `display.*.layout`, a field's `display.editor`/`viewer`, or a
|
|
136
|
+
`registerKindDefault` call. Only this step touches sources.
|
|
139
137
|
|
|
140
138
|
## common mistakes
|
|
141
139
|
|
|
142
140
|
| mistake | reality |
|
|
143
141
|
|---|---|
|
|
144
142
|
| looking for a ui-components collection | there isn't one; this is code |
|
|
145
|
-
| naming a widget in a
|
|
143
|
+
| naming a widget in `display.editor` where a shape would say it | the shape reaches every surface; an id reaches only surfaces that registered it |
|
|
146
144
|
| bundling Vue | two copies; reactivity dies silently |
|
|
147
145
|
| assuming a registration error is reported | swallowed by fault isolation — read the console |
|
|
148
146
|
| `types: ['string']` on a bespoke widget | it is offered in the picker for every string field — candidacy, not default; defaults change only via `registerKindDefault` |
|
|
149
147
|
| omitting `id`, or renaming it later | the id is the binding surface; every record naming it breaks |
|
|
150
148
|
| reusing a core layout id | silently shadows the built-in with no warning |
|
|
151
|
-
| declaring layouts in `package.json` |
|
|
149
|
+
| declaring layouts in `package.json` | registration in `app.js` is the whole mechanism |
|
|
152
150
|
| binding before building | the id does not exist yet; the view degrades to `table` |
|
|
153
151
|
| scoped CSS on a menu or dialog | portalled outside the subtree — style those globally |
|