yarramate 1.1.0 → 1.3.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.
- package/catalogues/core-enrichment.yaml +225 -2
- package/dist/adapters/visual/session-server.js +16 -1
- package/dist/adapters/visual/view-identity.d.ts +1 -1
- package/dist/adapters/visual/view-identity.js +61 -3
- package/dist/adapters/visual/wire.d.ts +30 -0
- package/dist/adapters/visual/workspace-model.d.ts +23 -3
- package/dist/adapters/visual/workspace-model.js +52 -2
- package/dist/ask-command.js +29 -13
- package/dist/cli-support.d.ts +1 -1
- package/dist/cli-support.js +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +26 -5
- package/dist/concept-drafting.d.ts +13 -2
- package/dist/concept-drafting.js +15 -3
- package/dist/design-command.js +83 -2
- package/dist/evidence.js +25 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/interrogate-command.d.ts +28 -1
- package/dist/interrogate-command.js +24 -4
- package/dist/interrogation-entry.d.ts +1 -1
- package/dist/layout-direction.d.ts +14 -0
- package/dist/layout-direction.js +5 -0
- package/dist/projection.d.ts +22 -6
- package/dist/projection.js +23 -2
- package/dist/relationship-drafting.d.ts +21 -2
- package/dist/relationship-drafting.js +33 -3
- package/dist/subject-references.js +5 -0
- package/dist/visual-app/assets/index-C3i9SxTe.js +394 -0
- package/dist/visual-app/assets/index-Rkq6smL2.css +1 -0
- package/dist/visual-app/index.html +2 -2
- package/dist/visual-app-lib/editor.js +28464 -26953
- package/dist/visual-app-lib/styles.css +1 -1
- package/dist/visual-app-lib/types/adapters/visual/view-identity.d.ts +1 -1
- package/dist/visual-app-lib/types/adapters/visual/wire.d.ts +30 -0
- package/dist/visual-app-lib/types/adapters/visual/workspace-model.d.ts +23 -3
- package/dist/visual-app-lib/types/concept-drafting.d.ts +13 -2
- package/dist/visual-app-lib/types/interrogate-command.d.ts +190 -0
- package/dist/visual-app-lib/types/layout-direction.d.ts +14 -0
- package/dist/visual-app-lib/types/projection.d.ts +22 -6
- package/dist/visual-app-lib/types/relationship-drafting.d.ts +21 -2
- package/dist/visual-app-lib/types/subject-identity.d.ts +34 -0
- package/dist/visual-app-lib/types/visual-app/App.d.ts +27 -2
- package/dist/visual-app-lib/types/visual-app/badges.d.ts +1 -0
- package/dist/visual-app-lib/types/visual-app/connection-panel.d.ts +9 -1
- package/dist/visual-app-lib/types/visual-app/context-menu-model.d.ts +15 -6
- package/dist/visual-app-lib/types/visual-app/graph-canvas.d.ts +77 -6
- package/dist/visual-app-lib/types/visual-app/kind-palette.d.ts +37 -0
- package/dist/visual-app-lib/types/visual-app/mount.d.ts +73 -2
- package/dist/visual-app-lib/types/visual-app/open-questions.d.ts +15 -0
- package/dist/visual-app-lib/types/visual-app/query-fields.d.ts +3 -2
- package/dist/visual-app-lib/types/visual-app/query-panel.d.ts +8 -1
- package/dist/visual-app-lib/types/visual-app/save-view.d.ts +11 -5
- package/dist/visual-app-lib/types/visual-app/shipped-catalogue.d.ts +10 -0
- package/dist/visual-app-lib/types/visual-app/state.d.ts +15 -4
- package/dist/visual-app-lib/types/visual-app/subject-draft-panel.d.ts +13 -1
- package/dist/visual-app-lib/types/visual-app/subject-filter.d.ts +35 -0
- package/dist/visual-app-lib/types/visual-app/subject-form.d.ts +8 -0
- package/dist/visual-app-lib/types/visual-app/view-tree-model.d.ts +42 -9
- package/dist/visual-app-lib/types/visual-app/view-tree.d.ts +11 -2
- package/dist/visual-app-lib/types/visual-app/workspace-state.d.ts +81 -11
- package/docs/CONSUMING-YARRAMATE.md +51 -0
- package/package.json +1 -1
- package/schema/yarramate-design-step.schema.json +395 -1
- package/schema/yarramate-interrogation-report.schema.json +488 -23
- package/schema/yarramate-projection.schema.json +9 -0
- package/schema/yarramate-question-catalogue.schema.json +13 -0
- package/skills/yarramate-architecture/SKILL.md +10 -1
- package/dist/visual-app/assets/index-CcmfL3oY.js +0 -394
- package/dist/visual-app/assets/index-DLutIWES.css +0 -1
|
@@ -33,8 +33,16 @@ export declare const connectableKinds: (graph: CanvasGraph, fromId: string, toId
|
|
|
33
33
|
* relationship kind is a single lowercase word. A collision takes a numeric
|
|
34
34
|
* suffix rather than a hash, because the id is authored text a human will read
|
|
35
35
|
* in a diff.
|
|
36
|
+
*
|
|
37
|
+
* `reserved` carries ids the graph does not know yet: a staged-but-uncommitted
|
|
38
|
+
* draft never enters the rendered graph, so without it a second relationship
|
|
39
|
+
* between the same pair re-proposed the identical id and the editor's
|
|
40
|
+
* replace-by-target staging silently swallowed the first (#306). The schema
|
|
41
|
+
* places no uniqueness on the (from, kind, to) triple - parallel relationships
|
|
42
|
+
* with distinct ids compile cleanly - so the id proposal is the only place the
|
|
43
|
+
* collision can be stepped past.
|
|
36
44
|
*/
|
|
37
|
-
export declare const proposeRelationshipId: (graph: CanvasGraph, fromId: string, kind: RelationshipKind, toId: string) => string;
|
|
45
|
+
export declare const proposeRelationshipId: (graph: CanvasGraph, fromId: string, kind: RelationshipKind, toId: string, reserved?: Iterable<string>) => string;
|
|
38
46
|
/**
|
|
39
47
|
* The operation that lands a drafted relationship, or `null` when the draft is
|
|
40
48
|
* one the table does not permit.
|
|
@@ -47,5 +55,16 @@ export declare const proposeRelationshipId: (graph: CanvasGraph, fromId: string,
|
|
|
47
55
|
* relationship has to live somewhere, both endpoints are equally defensible,
|
|
48
56
|
* and the source is where a reader looking for what this thing does would go
|
|
49
57
|
* first.
|
|
58
|
+
*
|
|
59
|
+
* A caller holding drafts the graph has not landed yet - an editor with a
|
|
60
|
+
* pending changeset - passes their ids as `reserved`, so a second parallel
|
|
61
|
+
* relationship steps to `-2` instead of colliding with the first (#306).
|
|
62
|
+
*/
|
|
63
|
+
export declare const draftRelationship: (graph: CanvasGraph, fromId: string, kind: RelationshipKind, toId: string, reserved?: Iterable<string>) => YarramateOperation | null;
|
|
64
|
+
/**
|
|
65
|
+
* The ids a pending changeset already claims, for `proposeRelationshipId`'s
|
|
66
|
+
* `reserved` parameter. Every operation that names a subject id reserves it -
|
|
67
|
+
* an update's id is already in the graph and reserving it twice is harmless,
|
|
68
|
+
* while an add's id is exactly the one the graph cannot know yet.
|
|
50
69
|
*/
|
|
51
|
-
export declare const
|
|
70
|
+
export declare const stagedSubjectIds: (operations: readonly YarramateOperation[]) => readonly string[];
|
|
@@ -45,11 +45,20 @@ export const connectableKinds = (graph, fromId, toId) => {
|
|
|
45
45
|
* relationship kind is a single lowercase word. A collision takes a numeric
|
|
46
46
|
* suffix rather than a hash, because the id is authored text a human will read
|
|
47
47
|
* in a diff.
|
|
48
|
+
*
|
|
49
|
+
* `reserved` carries ids the graph does not know yet: a staged-but-uncommitted
|
|
50
|
+
* draft never enters the rendered graph, so without it a second relationship
|
|
51
|
+
* between the same pair re-proposed the identical id and the editor's
|
|
52
|
+
* replace-by-target staging silently swallowed the first (#306). The schema
|
|
53
|
+
* places no uniqueness on the (from, kind, to) triple - parallel relationships
|
|
54
|
+
* with distinct ids compile cleanly - so the id proposal is the only place the
|
|
55
|
+
* collision can be stepped past.
|
|
48
56
|
*/
|
|
49
|
-
export const proposeRelationshipId = (graph, fromId, kind, toId) => {
|
|
57
|
+
export const proposeRelationshipId = (graph, fromId, kind, toId, reserved = []) => {
|
|
50
58
|
const taken = new Set([
|
|
51
59
|
...graph.nodes.map((node) => node.id),
|
|
52
60
|
...graph.edges.map((edge) => edge.id),
|
|
61
|
+
...reserved,
|
|
53
62
|
]);
|
|
54
63
|
const base = `${fromId}-${kind}-${toId}`;
|
|
55
64
|
if (!taken.has(base))
|
|
@@ -72,8 +81,12 @@ export const proposeRelationshipId = (graph, fromId, kind, toId) => {
|
|
|
72
81
|
* relationship has to live somewhere, both endpoints are equally defensible,
|
|
73
82
|
* and the source is where a reader looking for what this thing does would go
|
|
74
83
|
* first.
|
|
84
|
+
*
|
|
85
|
+
* A caller holding drafts the graph has not landed yet - an editor with a
|
|
86
|
+
* pending changeset - passes their ids as `reserved`, so a second parallel
|
|
87
|
+
* relationship steps to `-2` instead of colliding with the first (#306).
|
|
75
88
|
*/
|
|
76
|
-
export const draftRelationship = (graph, fromId, kind, toId) => {
|
|
89
|
+
export const draftRelationship = (graph, fromId, kind, toId, reserved = []) => {
|
|
77
90
|
if (!connectableKinds(graph, fromId, toId).includes(kind))
|
|
78
91
|
return null;
|
|
79
92
|
const from = graph.nodes.find((node) => node.id === fromId);
|
|
@@ -83,10 +96,27 @@ export const draftRelationship = (graph, fromId, kind, toId) => {
|
|
|
83
96
|
op: 'add-relationship',
|
|
84
97
|
document: from.document,
|
|
85
98
|
relationship: {
|
|
86
|
-
id: proposeRelationshipId(graph, fromId, kind, toId),
|
|
99
|
+
id: proposeRelationshipId(graph, fromId, kind, toId, reserved),
|
|
87
100
|
kind,
|
|
88
101
|
from: fromId,
|
|
89
102
|
to: toId,
|
|
90
103
|
},
|
|
91
104
|
};
|
|
92
105
|
};
|
|
106
|
+
/**
|
|
107
|
+
* The ids a pending changeset already claims, for `proposeRelationshipId`'s
|
|
108
|
+
* `reserved` parameter. Every operation that names a subject id reserves it -
|
|
109
|
+
* an update's id is already in the graph and reserving it twice is harmless,
|
|
110
|
+
* while an add's id is exactly the one the graph cannot know yet.
|
|
111
|
+
*/
|
|
112
|
+
export const stagedSubjectIds = (operations) => operations.flatMap((op) => {
|
|
113
|
+
// A staged rename claims the id it moves to as well as the one it leaves.
|
|
114
|
+
const renamedTo = op.op === 'rename-concept' || op.op === 'rename-relationship'
|
|
115
|
+
? [op.to]
|
|
116
|
+
: [];
|
|
117
|
+
if ('relationship' in op)
|
|
118
|
+
return [op.relationship.id, ...renamedTo];
|
|
119
|
+
if ('concept' in op)
|
|
120
|
+
return [op.concept.id, ...renamedTo];
|
|
121
|
+
return renamedTo;
|
|
122
|
+
});
|
|
@@ -56,6 +56,11 @@ export const SUBJECT_REFERENCE_POSITIONS = [
|
|
|
56
56
|
path: ['query', 'subjects', '*'],
|
|
57
57
|
form: 'qualified',
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
group: 'projection',
|
|
61
|
+
path: ['query', 'exclude', '*'],
|
|
62
|
+
form: 'qualified',
|
|
63
|
+
},
|
|
59
64
|
{ group: 'projection', path: ['query', 'owners', '*'], form: 'qualified' },
|
|
60
65
|
{
|
|
61
66
|
group: 'projection',
|