@yaks/design 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +61 -2
- package/_dist/mod.d.ts +10 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/tools.d.ts +5 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/vocab.d.ts +6 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/deno.json +1 -0
- package/mod.js +10 -0
- package/mod.js.map +1 -0
- package/mod.ts +11 -0
- package/package.json +25 -4
- package/tools.js +66 -0
- package/tools.js.map +1 -0
- package/tools.ts +54 -0
- package/vocab.js +16 -0
- package/vocab.js.map +1 -0
- package/vocab.json +159 -0
- package/vocab.ts +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Jeff Peterson
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @yaks/design
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Defines graph components and tools for design proposals, reviews, and accepted
|
|
4
|
+
architecture documentation. The proposal text is a `doc{title, body}` component
|
|
5
|
+
from [@yaks/doc](../doc) on the same entity (a record identified by
|
|
6
|
+
`entity.eid`).
|
|
7
|
+
|
|
8
|
+
- `design{}` marks a proposal.
|
|
9
|
+
- `review{verdict}` — approved, rejected, or changes requested.
|
|
10
|
+
- `architecture{}` marks a description of the current system architecture. It
|
|
11
|
+
declares `governed: true`, so [@yaks/project](../project)'s health check
|
|
12
|
+
reports it if no project can reach it through filing or containment
|
|
13
|
+
relationships.
|
|
14
|
+
|
|
15
|
+
Who proposed it and who decided are [@yaks/kernel](../kernel)'s `proposed` and
|
|
16
|
+
`decided` components — anything can be proposed.
|
|
17
|
+
|
|
18
|
+
## Exports and setup
|
|
19
|
+
|
|
20
|
+
The root import exports `designDoc`, the JSON Schema document.
|
|
21
|
+
`@yaks/design/vocab` exports that document and `docs: [designDoc]`.
|
|
22
|
+
`@yaks/design/tools` exports `runs()`, the tool implementation factory. There is
|
|
23
|
+
no database or duty in this package.
|
|
24
|
+
|
|
25
|
+
For the commands below, use a [yak configuration](../cli/README.md) that loads
|
|
26
|
+
`@yaks/design`, `@yaks/doc`, `@yaks/kernel`, and `@yaks/alias`; load
|
|
27
|
+
`@yaks/project` as well to file a proposal under a project. The CLI loads the
|
|
28
|
+
vocabulary and tool implementations from their subpath exports.
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
yak design new 'Use an append-only audit log' 'Record each committed change.'
|
|
32
|
+
# Use the proposal id returned by the first command:
|
|
33
|
+
yak design decide <proposal-id> approved
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Tools
|
|
37
|
+
|
|
38
|
+
- `design new <title> [body]` — creates a `design{}` component and a
|
|
39
|
+
`doc{title, body}` beside it. The `design` kind's rule adds `proposed`, so a
|
|
40
|
+
`design{}` written through any door is put forward the same way.
|
|
41
|
+
- `design decide <design> [verdict]` — writes `decided{verdict}`, defaulting to
|
|
42
|
+
`approved`; the other decision value is `declined`. This is distinct from the
|
|
43
|
+
three review verdicts above. It does not automatically add `architecture`.
|
|
44
|
+
|
|
45
|
+
The caller is the decider by default. Pass `by` when recording a person's
|
|
46
|
+
explicit decision; the caller remains the writer used for authorization and the
|
|
47
|
+
journal, and `decided.via` keeps the calling session:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
yak design decide <proposal-id> approved --by Jeff
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The MCP call takes the same arguments:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{ "design": "D-12", "verdict": "approved", "by": "Jeff" }
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Compatibility
|
|
60
|
+
|
|
61
|
+
Deno and Node — a JSON document plus two tool implementations, with no runtime
|
|
62
|
+
calls.
|
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What was proposed and what was decided: a `design` is a proposal written down
|
|
3
|
+
* so it can be argued with, a `review` is somebody's verdict on one, and an
|
|
4
|
+
* `architecture` is the description that stands afterwards. The components
|
|
5
|
+
* recording who proposed and who decided are [@yaks/kernel](../kernel)'s,
|
|
6
|
+
* because anything can be proposed.
|
|
7
|
+
*
|
|
8
|
+
* Components only: a vocabulary document, no machinery.
|
|
9
|
+
*/ export { designDoc } from "./vocab.js";
|
|
10
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;CAQC,GAED,SAAS,SAAS,qBAAoB"}
|
package/_dist/tools.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Runs } from "@yaks/graph/tools";
|
|
2
|
+
/** The implementations behind the tools ./vocab.json declares. A factory, like
|
|
3
|
+
* every such module, although this one needs nothing from the server: each
|
|
4
|
+
* implementation reads what it needs from the call it is handed. */ export declare let runs: () => Runs;
|
|
5
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AAoBA,cAAc,IAAI,iCAAsC;AAUxD;;kEAEkE,GAClE,OAAO,YAAI,YAAW,KAoBpB"}
|
package/_dist/vocab.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
/** The design vocabulary, in the form `loadVocab` accepts. */ export declare let designDoc: VocabDoc;
|
|
3
|
+
/** What this package is: its manifest's description, the one place it is
|
|
4
|
+
* written, which a host stamps on each document here. */ export declare let description: string;
|
|
5
|
+
/** Every document this plugin declares. */ export declare let docs: VocabDoc[];
|
|
6
|
+
//# sourceMappingURL=vocab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.d.ts","sources":["../vocab.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,2BAAgC;AAItD,4DAA4D,GAC5D,OAAO,YAAI,WAAW,SAA0B;AAEhD;uDACuD,GACvD,OAAO,YAAI,aAAa,MAAM,CAAuB;AAErD,yCAAyC,GACzC,OAAO,YAAI,MAAM,WAAwB"}
|
package/deno.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"publish":{"exclude":["**/*_test.ts"]},"name":"@yaks/design","version":"0.2.36","license":"Apache-2.0","description":"A proposal, the review it gets, and the architecture that stands once it is decided.","exports":{".":"./mod.ts","./vocab":"./vocab.ts","./tools":"./tools.ts"},"imports":{"@yaks/design":"./mod.ts","@yaks/design/vocab":"./vocab.ts","@yaks/design/tools":"./tools.ts"}}
|
package/mod.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What was proposed and what was decided: a `design` is a proposal written down
|
|
3
|
+
* so it can be argued with, a `review` is somebody's verdict on one, and an
|
|
4
|
+
* `architecture` is the description that stands afterwards. The components
|
|
5
|
+
* recording who proposed and who decided are [@yaks/kernel](../kernel)'s,
|
|
6
|
+
* because anything can be proposed.
|
|
7
|
+
*
|
|
8
|
+
* Components only: a vocabulary document, no machinery.
|
|
9
|
+
*/ export { designDoc } from "./vocab.js";
|
|
10
|
+
//# sourceMappingURL=mod.js.map
|
package/mod.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sources":["./mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;CAQC,GAED,SAAS,SAAS,qBAAoB"}
|
package/mod.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What was proposed and what was decided: a `design` is a proposal written down
|
|
3
|
+
* so it can be argued with, a `review` is somebody's verdict on one, and an
|
|
4
|
+
* `architecture` is the description that stands afterwards. The components
|
|
5
|
+
* recording who proposed and who decided are [@yaks/kernel](../kernel)'s,
|
|
6
|
+
* because anything can be proposed.
|
|
7
|
+
*
|
|
8
|
+
* Components only: a vocabulary document, no machinery.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export { designDoc } from './vocab.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaks/design",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.36",
|
|
4
|
+
"homepage": "https://jsr.io/@yaks/design",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./_dist/mod.d.ts",
|
|
9
|
+
"default": "./mod.js"
|
|
10
|
+
},
|
|
11
|
+
"./vocab": {
|
|
12
|
+
"types": "./_dist/vocab.d.ts",
|
|
13
|
+
"default": "./vocab.js"
|
|
14
|
+
},
|
|
15
|
+
"./tools": {
|
|
16
|
+
"types": "./_dist/tools.d.ts",
|
|
17
|
+
"default": "./tools.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@yaks/graph": "0.2.36",
|
|
23
|
+
"@yaks/vocab": "0.2.36"
|
|
24
|
+
},
|
|
25
|
+
"description": "A proposal, the review it gets, and the architecture that stands once it is decided.",
|
|
26
|
+
"repository": "https://github.com/yak-sh/yak.git"
|
|
27
|
+
}
|
package/tools.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// The two tools this package implements: the module a server imports at
|
|
2
|
+
// `@yaks/design/tools` to get the implementations behind the `tool: true`
|
|
3
|
+
// declarations in ./vocab.json. They are the two halves of a decision: writing
|
|
4
|
+
// a proposal down, and settling it.
|
|
5
|
+
//
|
|
6
|
+
// Both write components that do not belong to this package, and that is the
|
|
7
|
+
// point. A proposal is `design{}` for what it is, @yaks/doc's
|
|
8
|
+
// `doc{title, body}` for its text, and @yaks/kernel's `proposed` and
|
|
9
|
+
// `decided` for its lifecycle — anything can be proposed, so those two belong
|
|
10
|
+
// to the kernel. The `design` kind (./vocab.json) adds `proposed` to a design
|
|
11
|
+
// that lacks it, so the tool writes only the design and its words. A tool
|
|
12
|
+
// returns bundles, which are plain data, so naming another package's
|
|
13
|
+
// component costs no import, and a server that composes neither package
|
|
14
|
+
// refuses the write, naming the component it does not know.
|
|
15
|
+
//
|
|
16
|
+
// A named decider records that person's explicit decision through the kernel's
|
|
17
|
+
// request. The caller remains the writer used for authorization and journaling.
|
|
18
|
+
import { argsOf } from "@yaks/graph/call";
|
|
19
|
+
// The text a person reads. A body nobody supplied is omitted rather than
|
|
20
|
+
// written as an empty string — a design is written to be argued with, and the
|
|
21
|
+
// argument may arrive after the title.
|
|
22
|
+
let docIn = (args)=>({
|
|
23
|
+
title: String(args.title ?? '').trim(),
|
|
24
|
+
...args.body == null ? {} : {
|
|
25
|
+
body: String(args.body)
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
/** The implementations behind the tools ./vocab.json declares. A factory, like
|
|
29
|
+
* every such module, although this one needs nothing from the server: each
|
|
30
|
+
* implementation reads what it needs from the call it is handed. */ export let runs = ()=>({
|
|
31
|
+
design_new: (call)=>{
|
|
32
|
+
let args = argsOf(call);
|
|
33
|
+
let project = args.project == null ? undefined : String(args.project);
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
entity: {
|
|
37
|
+
eid: '$design'
|
|
38
|
+
},
|
|
39
|
+
design: {},
|
|
40
|
+
doc: docIn(args),
|
|
41
|
+
...project ? {
|
|
42
|
+
filed: {
|
|
43
|
+
project
|
|
44
|
+
}
|
|
45
|
+
} : {}
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
},
|
|
49
|
+
design_decide: (call)=>{
|
|
50
|
+
let args = argsOf(call);
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
entity: {
|
|
54
|
+
eid: String(args.design)
|
|
55
|
+
},
|
|
56
|
+
decided: {
|
|
57
|
+
verdict: String(args.verdict)
|
|
58
|
+
},
|
|
59
|
+
...args.by ? {
|
|
60
|
+
$decider: String(args.by)
|
|
61
|
+
} : {}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=tools.js.map
|
package/tools.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sources":["./tools.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,0EAA0E;AAC1E,+EAA+E;AAC/E,oCAAoC;AACpC,EAAE;AACF,4EAA4E;AAC5E,8DAA8D;AAC9D,qEAAqE;AACrE,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,qEAAqE;AACrE,wEAAwE;AACxE,4DAA4D;AAC5D,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAGhF,SAAS,MAAM,gCAAqC;AAGpD,yEAAyE;AACzE,8EAA8E;AAC9E,uCAAuC;AACvC,IAAI,QAAQ,CAAC,OAAwC,CAAC;IACpD,OAAO,OAAO,KAAK,KAAK,IAAI,IAAI,IAAI;IACpC,GAAI,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI;MAAE,MAAM,OAAO,KAAK,IAAI;IAAE,CAAC;EAC1D,CAAC;AAED;;kEAEkE,GAClE,OAAO,IAAI,OAAO,IAAY,CAAC;IAC7B,YAAY,CAAC;MACX,IAAI,OAAO,OAAO;MAClB,IAAI,UAAU,KAAK,OAAO,IAAI,OAAO,YAAY,OAAO,KAAK,OAAO;MACpE,OAAO;QAAC;UACN,QAAQ;YAAE,KAAK;UAAU;UACzB,QAAQ,CAAC;UACT,KAAK,MAAM;UACX,GAAI,UAAU;YAAE,OAAO;cAAE;YAAQ;UAAE,IAAI,CAAC,CAAC;QAC3C;OAAE;IACJ;IAEA,eAAe,CAAC;MACd,IAAI,OAAO,OAAO;MAClB,OAAO;QAAC;UACN,QAAQ;YAAE,KAAK,OAAO,KAAK,MAAM;UAAE;UACnC,SAAS;YAAE,SAAS,OAAO,KAAK,OAAO;UAAE;UACzC,GAAI,KAAK,EAAE,GAAG;YAAE,UAAU,OAAO,KAAK,EAAE;UAAE,IAAI,CAAC,CAAC;QAClD;OAAE;IACJ;EACF,CAAC,EAAC"}
|
package/tools.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// The two tools this package implements: the module a server imports at
|
|
2
|
+
// `@yaks/design/tools` to get the implementations behind the `tool: true`
|
|
3
|
+
// declarations in ./vocab.json. They are the two halves of a decision: writing
|
|
4
|
+
// a proposal down, and settling it.
|
|
5
|
+
//
|
|
6
|
+
// Both write components that do not belong to this package, and that is the
|
|
7
|
+
// point. A proposal is `design{}` for what it is, @yaks/doc's
|
|
8
|
+
// `doc{title, body}` for its text, and @yaks/kernel's `proposed` and
|
|
9
|
+
// `decided` for its lifecycle — anything can be proposed, so those two belong
|
|
10
|
+
// to the kernel. The `design` kind (./vocab.json) adds `proposed` to a design
|
|
11
|
+
// that lacks it, so the tool writes only the design and its words. A tool
|
|
12
|
+
// returns bundles, which are plain data, so naming another package's
|
|
13
|
+
// component costs no import, and a server that composes neither package
|
|
14
|
+
// refuses the write, naming the component it does not know.
|
|
15
|
+
//
|
|
16
|
+
// A named decider records that person's explicit decision through the kernel's
|
|
17
|
+
// request. The caller remains the writer used for authorization and journaling.
|
|
18
|
+
|
|
19
|
+
import type { Bundle, Comp } from 'jsr:@yaks/graph@0.2.36'
|
|
20
|
+
import { argsOf } from '@yaks/graph/call'
|
|
21
|
+
import type { Runs } from 'jsr:@yaks/graph@0.2.36/tools'
|
|
22
|
+
|
|
23
|
+
// The text a person reads. A body nobody supplied is omitted rather than
|
|
24
|
+
// written as an empty string — a design is written to be argued with, and the
|
|
25
|
+
// argument may arrive after the title.
|
|
26
|
+
let docIn = (args: Record<string, unknown>): Comp => ({
|
|
27
|
+
title: String(args.title ?? '').trim(),
|
|
28
|
+
...(args.body == null ? {} : { body: String(args.body) }),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
/** The implementations behind the tools ./vocab.json declares. A factory, like
|
|
32
|
+
* every such module, although this one needs nothing from the server: each
|
|
33
|
+
* implementation reads what it needs from the call it is handed. */
|
|
34
|
+
export let runs = (): Runs => ({
|
|
35
|
+
design_new: (call): Bundle[] => {
|
|
36
|
+
let args = argsOf(call)
|
|
37
|
+
let project = args.project == null ? undefined : String(args.project)
|
|
38
|
+
return [{
|
|
39
|
+
entity: { eid: '$design' },
|
|
40
|
+
design: {},
|
|
41
|
+
doc: docIn(args),
|
|
42
|
+
...(project ? { filed: { project } } : {}),
|
|
43
|
+
}]
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
design_decide: (call): Bundle[] => {
|
|
47
|
+
let args = argsOf(call)
|
|
48
|
+
return [{
|
|
49
|
+
entity: { eid: String(args.design) },
|
|
50
|
+
decided: { verdict: String(args.verdict) },
|
|
51
|
+
...(args.by ? { $decider: String(args.by) } : {}),
|
|
52
|
+
}]
|
|
53
|
+
},
|
|
54
|
+
})
|
package/vocab.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// The component and tool declarations, and nothing else: the module a server or
|
|
2
|
+
// a browser page imports at `@yaks/design/vocab`. It reaches no storage, no SQL
|
|
3
|
+
// and no runtime, so a browser tab loading this vocabulary loads nothing else.
|
|
4
|
+
import doc from './vocab.json' with {
|
|
5
|
+
type: 'json'
|
|
6
|
+
};
|
|
7
|
+
import manifest from './package.json' with {
|
|
8
|
+
type: 'json'
|
|
9
|
+
};
|
|
10
|
+
/** The design vocabulary, in the form `loadVocab` accepts. */ export let designDoc = doc;
|
|
11
|
+
/** What this package is: its manifest's description, the one place it is
|
|
12
|
+
* written, which a host stamps on each document here. */ export let description = manifest.description;
|
|
13
|
+
/** Every document this plugin declares. */ export let docs = [
|
|
14
|
+
designDoc
|
|
15
|
+
];
|
|
16
|
+
//# sourceMappingURL=vocab.js.map
|
package/vocab.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.js","sources":["./vocab.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,+EAA+E;AAG/E,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AACpD,OAAO,cAAc,sBAAsB;EAAE,MAAM;AAAO,EAAC;AAE3D,4DAA4D,GAC5D,OAAO,IAAI,YAAsB,IAAe;AAEhD;uDACuD,GACvD,OAAO,IAAI,cAAsB,SAAS,WAAW,CAAA;AAErD,yCAAyC,GACzC,OAAO,IAAI,OAAmB;EAAC;CAAU,CAAA"}
|
package/vocab.json
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "urn:uuid:68b721f5-b82c-4693-89e8-a0fc0b6aa772",
|
|
3
|
+
"$vocabulary": {
|
|
4
|
+
"https://yak.sh/vocab/core": true,
|
|
5
|
+
"https://yak.sh/vocab/id": true,
|
|
6
|
+
"https://yak.sh/vocab/kernel": true
|
|
7
|
+
},
|
|
8
|
+
"title": "design",
|
|
9
|
+
"$defs": {
|
|
10
|
+
"architecture": {
|
|
11
|
+
"$id": "urn:uuid:599f930c-1ae0-4700-b894-0fb002f6ef63",
|
|
12
|
+
"component": true,
|
|
13
|
+
"type": "object",
|
|
14
|
+
"governed": true,
|
|
15
|
+
"properties": {},
|
|
16
|
+
"description": "what stands: the structure a system has, rather than one being proposed"
|
|
17
|
+
},
|
|
18
|
+
"design": {
|
|
19
|
+
"$id": "urn:uuid:2a5d32ca-5235-40d5-906d-fb27c380863f",
|
|
20
|
+
"component": true,
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {},
|
|
23
|
+
"description": "a change being proposed; what it is, is written in the doc beside it. `proposed` and `decided` carry its lifecycle"
|
|
24
|
+
},
|
|
25
|
+
"design_new": {
|
|
26
|
+
"tool": true,
|
|
27
|
+
"destructive": false,
|
|
28
|
+
"noun": "design",
|
|
29
|
+
"verb": "new",
|
|
30
|
+
"title": "Propose a design",
|
|
31
|
+
"description": "File a proposal, stamped as caller. Returns applied bundles.",
|
|
32
|
+
"input": {
|
|
33
|
+
"title": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "One-line proposal title."
|
|
36
|
+
},
|
|
37
|
+
"body": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Markdown proposal covering the problem, current behavior, proposed changes, and relevant operating costs. Use numbered lists for steps and bullets for grouped items.",
|
|
40
|
+
"short": "b"
|
|
41
|
+
},
|
|
42
|
+
"project": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"ref": "project",
|
|
45
|
+
"description": "Project id or name.",
|
|
46
|
+
"short": "p"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"required": [
|
|
50
|
+
"title"
|
|
51
|
+
],
|
|
52
|
+
"positional": [
|
|
53
|
+
"title",
|
|
54
|
+
"body"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"design_decide": {
|
|
58
|
+
"tool": true,
|
|
59
|
+
"destructive": false,
|
|
60
|
+
"noun": "design",
|
|
61
|
+
"verb": "decide",
|
|
62
|
+
"title": "Decide a design",
|
|
63
|
+
"description": "Record approval or decline. by records a person's explicit decision; otherwise the caller decides. Returns applied bundles.",
|
|
64
|
+
"input": {
|
|
65
|
+
"design": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"ref": "design",
|
|
68
|
+
"description": "Design id or name."
|
|
69
|
+
},
|
|
70
|
+
"verdict": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"enum": [
|
|
73
|
+
"approved",
|
|
74
|
+
"declined"
|
|
75
|
+
],
|
|
76
|
+
"default": "approved",
|
|
77
|
+
"description": "Decision (default approved)."
|
|
78
|
+
},
|
|
79
|
+
"by": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"ref": "entity",
|
|
82
|
+
"description": "Person whose explicit decision is recorded."
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"required": [
|
|
86
|
+
"design"
|
|
87
|
+
],
|
|
88
|
+
"idempotent": true,
|
|
89
|
+
"positional": [
|
|
90
|
+
"design",
|
|
91
|
+
"verdict"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"review": {
|
|
95
|
+
"$id": "urn:uuid:fe63fe0e-71a4-409e-9eae-77e34099a649",
|
|
96
|
+
"component": true,
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"verdict": {
|
|
100
|
+
"$id": "urn:uuid:99fa3f9e-69e1-4b7b-bde4-628283ecd0b0",
|
|
101
|
+
"type": "string",
|
|
102
|
+
"enum": [
|
|
103
|
+
"approved",
|
|
104
|
+
"rejected",
|
|
105
|
+
"changes_requested"
|
|
106
|
+
],
|
|
107
|
+
"aliases": {
|
|
108
|
+
"approve": "approved",
|
|
109
|
+
"reject": "rejected",
|
|
110
|
+
"changes": "changes_requested"
|
|
111
|
+
},
|
|
112
|
+
"description": "approved, rejected, or approved once these changes are made"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"description": "one person's assessment of a design: the verdict, and the comment beside it"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"kinds": {
|
|
119
|
+
"design": {
|
|
120
|
+
"$id": "urn:uuid:2a5d32ca-5235-40d5-906d-fb27c380863f",
|
|
121
|
+
"description": "a change being proposed; what it is, is written in the doc beside it. `proposed` and `decided` carry its lifecycle",
|
|
122
|
+
"with": {
|
|
123
|
+
"doc": true,
|
|
124
|
+
"proposed": {}
|
|
125
|
+
},
|
|
126
|
+
"prefix": "D",
|
|
127
|
+
"examples": [
|
|
128
|
+
{
|
|
129
|
+
"design": {},
|
|
130
|
+
"doc": {
|
|
131
|
+
"title": "Kinds are named shapes",
|
|
132
|
+
"body": "What makes each kind, declared once in vocab.json"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"review": {
|
|
138
|
+
"$id": "urn:uuid:fe63fe0e-71a4-409e-9eae-77e34099a649",
|
|
139
|
+
"description": "one person's assessment of a design: the verdict, and the comment beside it",
|
|
140
|
+
"with": {
|
|
141
|
+
"comment": true,
|
|
142
|
+
"doc": true
|
|
143
|
+
},
|
|
144
|
+
"examples": [
|
|
145
|
+
{
|
|
146
|
+
"review": {
|
|
147
|
+
"verdict": "approved"
|
|
148
|
+
},
|
|
149
|
+
"comment": {
|
|
150
|
+
"target": "4f9a2c7e-81b3-4d6a-b0c5-3e7d9f1a2b48"
|
|
151
|
+
},
|
|
152
|
+
"doc": {
|
|
153
|
+
"body": "Ship it"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
package/vocab.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// The component and tool declarations, and nothing else: the module a server or
|
|
2
|
+
// a browser page imports at `@yaks/design/vocab`. It reaches no storage, no SQL
|
|
3
|
+
// and no runtime, so a browser tab loading this vocabulary loads nothing else.
|
|
4
|
+
|
|
5
|
+
import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
|
|
6
|
+
import doc from './vocab.json' with { type: 'json' }
|
|
7
|
+
import manifest from './package.json' with { type: 'json' }
|
|
8
|
+
|
|
9
|
+
/** The design vocabulary, in the form `loadVocab` accepts. */
|
|
10
|
+
export let designDoc: VocabDoc = doc as VocabDoc
|
|
11
|
+
|
|
12
|
+
/** What this package is: its manifest's description, the one place it is
|
|
13
|
+
* written, which a host stamps on each document here. */
|
|
14
|
+
export let description: string = manifest.description
|
|
15
|
+
|
|
16
|
+
/** Every document this plugin declares. */
|
|
17
|
+
export let docs: VocabDoc[] = [designDoc]
|