@company-semantics/contracts 0.3.0 → 0.5.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/index.ts +2 -1
- package/package.json +1 -1
- package/system/diagram.ts +43 -9
- package/system/index.ts +7 -6
package/index.ts
CHANGED
|
@@ -31,10 +31,11 @@ export type {
|
|
|
31
31
|
SystemCapability,
|
|
32
32
|
SystemLayer,
|
|
33
33
|
SystemCapabilityManifest,
|
|
34
|
-
// Graph-based diagram spec
|
|
34
|
+
// Graph-based diagram spec (v0.4.0)
|
|
35
35
|
DiagramNodeKind,
|
|
36
36
|
DiagramEdgeRelation,
|
|
37
37
|
DiagramNode,
|
|
38
38
|
DiagramEdge,
|
|
39
39
|
DiagramSpec,
|
|
40
|
+
DiagramSnapshot,
|
|
40
41
|
} from './system/index.js'
|
package/package.json
CHANGED
package/system/diagram.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Diagram Specification Types
|
|
2
|
+
* Diagram Specification Types (v0.4.0)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Tree-based semantic model for system diagrams.
|
|
5
5
|
* These types define MEANING, not presentation.
|
|
6
6
|
*
|
|
7
7
|
* Key invariants:
|
|
8
8
|
* - No render hints — renderers decide presentation independently
|
|
9
|
-
* -
|
|
9
|
+
* - parentId creates hierarchy (tree structure), not edges
|
|
10
10
|
* - Graphs can be rendered as ASCII, SVG, canvas, or any future format
|
|
11
11
|
*
|
|
12
|
+
* v0.4.0 changes:
|
|
13
|
+
* - 'layer' kind renamed to 'group'
|
|
14
|
+
* - parentId replaces layer field for tree structure
|
|
15
|
+
* - order replaces orderInLayer
|
|
16
|
+
* - No 'contains' edges (hierarchy via parentId)
|
|
17
|
+
* - Added DiagramSnapshot for cross-repo distribution
|
|
18
|
+
*
|
|
12
19
|
* @see ../docs/LIVING_ASCII_DIAGRAM_SPEC.md
|
|
13
20
|
*/
|
|
14
21
|
|
|
@@ -17,12 +24,13 @@ import type { FeatureStatus } from './index.js'
|
|
|
17
24
|
/**
|
|
18
25
|
* The semantic role of a node in the diagram.
|
|
19
26
|
*/
|
|
20
|
-
export type DiagramNodeKind = '
|
|
27
|
+
export type DiagramNodeKind = 'group' | 'feature' | 'artifact'
|
|
21
28
|
|
|
22
29
|
/**
|
|
23
30
|
* The semantic relationship between nodes.
|
|
31
|
+
* Note: 'contains' removed in v0.4.0 — hierarchy now via parentId
|
|
24
32
|
*/
|
|
25
|
-
export type DiagramEdgeRelation = '
|
|
33
|
+
export type DiagramEdgeRelation = 'flows_to' | 'depends_on'
|
|
26
34
|
|
|
27
35
|
/**
|
|
28
36
|
* A node in the diagram graph.
|
|
@@ -35,12 +43,14 @@ export interface DiagramNode {
|
|
|
35
43
|
label: string
|
|
36
44
|
/** Semantic role */
|
|
37
45
|
kind: DiagramNodeKind
|
|
46
|
+
/** Parent node ID for tree hierarchy (replaces layer field) */
|
|
47
|
+
parentId?: string
|
|
48
|
+
/** Order within parent for pipeline semantics */
|
|
49
|
+
order?: number
|
|
50
|
+
/** Whether this node can receive focus in interactive renderers */
|
|
51
|
+
focusable?: boolean
|
|
38
52
|
/** Feature maturity status (only for 'feature' nodes) */
|
|
39
53
|
status?: FeatureStatus
|
|
40
|
-
/** Semantic grouping (not layout instruction) */
|
|
41
|
-
layer?: string
|
|
42
|
-
/** Order within layer for pipeline semantics */
|
|
43
|
-
orderInLayer?: number
|
|
44
54
|
}
|
|
45
55
|
|
|
46
56
|
/**
|
|
@@ -70,3 +80,27 @@ export interface DiagramSpec {
|
|
|
70
80
|
/** All edges connecting nodes */
|
|
71
81
|
edges: DiagramEdge[]
|
|
72
82
|
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Snapshot of a rendered diagram for cross-repo distribution.
|
|
86
|
+
*
|
|
87
|
+
* Backend generates this and pushes to site repo via CI.
|
|
88
|
+
* Includes pre-rendered ASCII so site doesn't need rendering logic.
|
|
89
|
+
*
|
|
90
|
+
* Invariant: The generator declares all write intent via generatedFiles[].
|
|
91
|
+
* CI will never infer or expand intent.
|
|
92
|
+
*/
|
|
93
|
+
export interface DiagramSnapshot {
|
|
94
|
+
/** Pre-rendered ASCII art */
|
|
95
|
+
ascii: string
|
|
96
|
+
/** Semantic nodes for interactive features */
|
|
97
|
+
nodes: DiagramNode[]
|
|
98
|
+
/** ISO timestamp when snapshot was generated */
|
|
99
|
+
generatedAt: string
|
|
100
|
+
/** Version of the source manifest (stringified for stability) */
|
|
101
|
+
manifestVersion: string
|
|
102
|
+
/** Schema version for forward compatibility */
|
|
103
|
+
specVersion: 'v1'
|
|
104
|
+
/** Files this snapshot will write (manifest-driven automation) */
|
|
105
|
+
generatedFiles: string[]
|
|
106
|
+
}
|
package/system/index.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* System Diagram Types
|
|
2
|
+
* System Diagram Types (v0.4.0)
|
|
3
3
|
*
|
|
4
4
|
* Schema for the Living ASCII System Diagram feature.
|
|
5
5
|
* These types define the contract between:
|
|
6
|
-
* - company-semantics (produces
|
|
7
|
-
* - company-semantics-site (
|
|
6
|
+
* - company-semantics-backend (produces DiagramSnapshot with pre-rendered ASCII)
|
|
7
|
+
* - company-semantics-site (displays snapshot, interactive features)
|
|
8
8
|
*
|
|
9
9
|
* Architecture:
|
|
10
|
-
* - Backend owns MEANING (
|
|
11
|
-
* - Client
|
|
12
|
-
* -
|
|
10
|
+
* - Backend owns MEANING and RENDERING (DiagramSnapshot with ASCII + nodes)
|
|
11
|
+
* - Client displays pre-rendered ASCII
|
|
12
|
+
* - Snapshots pushed via CI automation
|
|
13
13
|
*
|
|
14
14
|
* @see docs/LIVING_ASCII_DIAGRAM_SPEC.md
|
|
15
15
|
*/
|
|
@@ -71,4 +71,5 @@ export type {
|
|
|
71
71
|
DiagramNode,
|
|
72
72
|
DiagramEdge,
|
|
73
73
|
DiagramSpec,
|
|
74
|
+
DiagramSnapshot,
|
|
74
75
|
} from './diagram.js'
|