@nesso-how/relation-types 0.1.0-alpha.16
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/dist/index.d.ts +17 -0
- package/dist/index.js +35 -0
- package/package.json +24 -0
- package/src/index.ts +76 -0
- package/tsconfig.json +13 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type EdgeCategory = 'taxonomic' | 'structural' | 'causal' | 'dependency' | 'temporal' | 'opposition' | 'similarity';
|
|
2
|
+
export type EdgeTypeName = 'is-a' | 'instance-of' | 'subtype-of' | 'part-of' | 'made-of' | 'contains' | 'causes' | 'produces' | 'enables' | 'prevents' | 'triggers' | 'inhibits' | 'requires' | 'uses' | 'used-for' | 'precedes' | 'occurs-in' | 'contrasts-with' | 'opposite-of' | 'similar-to' | 'analogous-to';
|
|
3
|
+
export type GlyphKind = 'triangle-up' | 'circle-dot' | 'diamond' | 'diamond-open' | 'hash' | 'arrow-right' | 'asterisk' | 'key' | 'block' | 'spark' | 'anchor' | 'tool' | 'chevron-r' | 'ring' | 'tilde' | 'x' | 'minus' | 'flag' | 'approx' | 'arrows-lr';
|
|
4
|
+
export interface EdgeTypeDef {
|
|
5
|
+
cat: EdgeCategory;
|
|
6
|
+
line: 'solid' | 'dashed' | 'dotted' | 'double' | 'wavy';
|
|
7
|
+
glyph: GlyphKind;
|
|
8
|
+
symmetric: boolean;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
/** Canonical category labels and prompts. */
|
|
12
|
+
export declare const RELATION_CATEGORY_META: Record<EdgeCategory, {
|
|
13
|
+
label: string;
|
|
14
|
+
subtitle: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const RELATION_TYPES: Record<EdgeTypeName, EdgeTypeDef>;
|
|
17
|
+
export declare const RELATION_TYPE_VALUES: EdgeTypeName[];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/** Canonical category labels and prompts. */
|
|
3
|
+
export const RELATION_CATEGORY_META = {
|
|
4
|
+
taxonomic: { label: 'Taxonomic', subtitle: 'What kind of thing?' },
|
|
5
|
+
structural: { label: 'Structural', subtitle: "What's it made of?" },
|
|
6
|
+
causal: { label: 'Causal', subtitle: 'What does it do?' },
|
|
7
|
+
dependency: { label: 'Dependency', subtitle: 'What does it need?' },
|
|
8
|
+
temporal: { label: 'Temporal', subtitle: 'When? Where?' },
|
|
9
|
+
opposition: { label: 'Opposition', subtitle: 'What does it contrast with?' },
|
|
10
|
+
similarity: { label: 'Similarity', subtitle: 'What is it like?' },
|
|
11
|
+
};
|
|
12
|
+
export const RELATION_TYPES = {
|
|
13
|
+
'is-a': { cat: 'taxonomic', line: 'solid', glyph: 'triangle-up', symmetric: false, label: 'is a' },
|
|
14
|
+
'instance-of': { cat: 'taxonomic', line: 'solid', glyph: 'circle-dot', symmetric: false, label: 'instance of' },
|
|
15
|
+
'subtype-of': { cat: 'taxonomic', line: 'double', glyph: 'triangle-up', symmetric: false, label: 'subtype of' },
|
|
16
|
+
'part-of': { cat: 'structural', line: 'solid', glyph: 'diamond', symmetric: false, label: 'part of' },
|
|
17
|
+
'made-of': { cat: 'structural', line: 'dashed', glyph: 'hash', symmetric: false, label: 'made of' },
|
|
18
|
+
'contains': { cat: 'structural', line: 'solid', glyph: 'diamond-open', symmetric: false, label: 'contains' },
|
|
19
|
+
'causes': { cat: 'causal', line: 'solid', glyph: 'arrow-right', symmetric: false, label: 'causes' },
|
|
20
|
+
'produces': { cat: 'causal', line: 'solid', glyph: 'asterisk', symmetric: false, label: 'produces' },
|
|
21
|
+
'enables': { cat: 'causal', line: 'dotted', glyph: 'key', symmetric: false, label: 'enables' },
|
|
22
|
+
'prevents': { cat: 'causal', line: 'dotted', glyph: 'block', symmetric: false, label: 'prevents' },
|
|
23
|
+
'triggers': { cat: 'causal', line: 'solid', glyph: 'spark', symmetric: false, label: 'triggers' },
|
|
24
|
+
'inhibits': { cat: 'causal', line: 'dotted', glyph: 'minus', symmetric: false, label: 'inhibits' },
|
|
25
|
+
'requires': { cat: 'dependency', line: 'solid', glyph: 'anchor', symmetric: false, label: 'requires' },
|
|
26
|
+
'uses': { cat: 'dependency', line: 'dashed', glyph: 'tool', symmetric: false, label: 'uses' },
|
|
27
|
+
'used-for': { cat: 'dependency', line: 'dashed', glyph: 'flag', symmetric: false, label: 'used for' },
|
|
28
|
+
'precedes': { cat: 'temporal', line: 'solid', glyph: 'chevron-r', symmetric: false, label: 'precedes' },
|
|
29
|
+
'occurs-in': { cat: 'temporal', line: 'dotted', glyph: 'ring', symmetric: false, label: 'occurs in' },
|
|
30
|
+
'contrasts-with': { cat: 'opposition', line: 'wavy', glyph: 'tilde', symmetric: true, label: 'contrasts with' },
|
|
31
|
+
'opposite-of': { cat: 'opposition', line: 'double', glyph: 'x', symmetric: true, label: 'opposite of' },
|
|
32
|
+
'similar-to': { cat: 'similarity', line: 'dashed', glyph: 'approx', symmetric: true, label: 'similar to' },
|
|
33
|
+
'analogous-to': { cat: 'similarity', line: 'dotted', glyph: 'arrows-lr', symmetric: true, label: 'analogous to' },
|
|
34
|
+
};
|
|
35
|
+
export const RELATION_TYPE_VALUES = Object.keys(RELATION_TYPES);
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nesso-how/relation-types",
|
|
3
|
+
"version": "0.1.0-alpha.16",
|
|
4
|
+
"description": "Nesso semantic relation type definitions — shared across app and MCP",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"prepublishOnly": "pnpm build",
|
|
19
|
+
"dev": "tsc --watch"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "~5.8.3"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
export type EdgeCategory =
|
|
4
|
+
| 'taxonomic'
|
|
5
|
+
| 'structural'
|
|
6
|
+
| 'causal'
|
|
7
|
+
| 'dependency'
|
|
8
|
+
| 'temporal'
|
|
9
|
+
| 'opposition'
|
|
10
|
+
| 'similarity'
|
|
11
|
+
|
|
12
|
+
export type EdgeTypeName =
|
|
13
|
+
| 'is-a' | 'instance-of' | 'subtype-of'
|
|
14
|
+
| 'part-of' | 'made-of' | 'contains'
|
|
15
|
+
| 'causes' | 'produces' | 'enables' | 'prevents' | 'triggers' | 'inhibits'
|
|
16
|
+
| 'requires' | 'uses' | 'used-for'
|
|
17
|
+
| 'precedes' | 'occurs-in'
|
|
18
|
+
| 'contrasts-with' | 'opposite-of'
|
|
19
|
+
| 'similar-to' | 'analogous-to'
|
|
20
|
+
|
|
21
|
+
export type GlyphKind =
|
|
22
|
+
| 'triangle-up' | 'circle-dot' | 'diamond' | 'diamond-open' | 'hash'
|
|
23
|
+
| 'arrow-right' | 'asterisk' | 'key' | 'block' | 'spark'
|
|
24
|
+
| 'anchor' | 'tool' | 'chevron-r' | 'ring' | 'tilde' | 'x'
|
|
25
|
+
| 'minus' | 'flag' | 'approx' | 'arrows-lr'
|
|
26
|
+
|
|
27
|
+
export interface EdgeTypeDef {
|
|
28
|
+
cat: EdgeCategory
|
|
29
|
+
line: 'solid' | 'dashed' | 'dotted' | 'double' | 'wavy'
|
|
30
|
+
glyph: GlyphKind
|
|
31
|
+
symmetric: boolean
|
|
32
|
+
label: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Canonical category labels and prompts. */
|
|
36
|
+
export const RELATION_CATEGORY_META: Record<EdgeCategory, { label: string; subtitle: string }> = {
|
|
37
|
+
taxonomic: { label: 'Taxonomic', subtitle: 'What kind of thing?' },
|
|
38
|
+
structural: { label: 'Structural', subtitle: "What's it made of?" },
|
|
39
|
+
causal: { label: 'Causal', subtitle: 'What does it do?' },
|
|
40
|
+
dependency: { label: 'Dependency', subtitle: 'What does it need?' },
|
|
41
|
+
temporal: { label: 'Temporal', subtitle: 'When? Where?' },
|
|
42
|
+
opposition: { label: 'Opposition', subtitle: 'What does it contrast with?' },
|
|
43
|
+
similarity: { label: 'Similarity', subtitle: 'What is it like?' },
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const RELATION_TYPES: Record<EdgeTypeName, EdgeTypeDef> = {
|
|
47
|
+
'is-a': { cat: 'taxonomic', line: 'solid', glyph: 'triangle-up', symmetric: false, label: 'is a' },
|
|
48
|
+
'instance-of': { cat: 'taxonomic', line: 'solid', glyph: 'circle-dot', symmetric: false, label: 'instance of' },
|
|
49
|
+
'subtype-of': { cat: 'taxonomic', line: 'double', glyph: 'triangle-up', symmetric: false, label: 'subtype of' },
|
|
50
|
+
|
|
51
|
+
'part-of': { cat: 'structural', line: 'solid', glyph: 'diamond', symmetric: false, label: 'part of' },
|
|
52
|
+
'made-of': { cat: 'structural', line: 'dashed', glyph: 'hash', symmetric: false, label: 'made of' },
|
|
53
|
+
'contains': { cat: 'structural', line: 'solid', glyph: 'diamond-open', symmetric: false, label: 'contains' },
|
|
54
|
+
|
|
55
|
+
'causes': { cat: 'causal', line: 'solid', glyph: 'arrow-right', symmetric: false, label: 'causes' },
|
|
56
|
+
'produces': { cat: 'causal', line: 'solid', glyph: 'asterisk', symmetric: false, label: 'produces' },
|
|
57
|
+
'enables': { cat: 'causal', line: 'dotted', glyph: 'key', symmetric: false, label: 'enables' },
|
|
58
|
+
'prevents': { cat: 'causal', line: 'dotted', glyph: 'block', symmetric: false, label: 'prevents' },
|
|
59
|
+
'triggers': { cat: 'causal', line: 'solid', glyph: 'spark', symmetric: false, label: 'triggers' },
|
|
60
|
+
'inhibits': { cat: 'causal', line: 'dotted', glyph: 'minus', symmetric: false, label: 'inhibits' },
|
|
61
|
+
|
|
62
|
+
'requires': { cat: 'dependency', line: 'solid', glyph: 'anchor', symmetric: false, label: 'requires' },
|
|
63
|
+
'uses': { cat: 'dependency', line: 'dashed', glyph: 'tool', symmetric: false, label: 'uses' },
|
|
64
|
+
'used-for': { cat: 'dependency', line: 'dashed', glyph: 'flag', symmetric: false, label: 'used for' },
|
|
65
|
+
|
|
66
|
+
'precedes': { cat: 'temporal', line: 'solid', glyph: 'chevron-r', symmetric: false, label: 'precedes' },
|
|
67
|
+
'occurs-in': { cat: 'temporal', line: 'dotted', glyph: 'ring', symmetric: false, label: 'occurs in' },
|
|
68
|
+
|
|
69
|
+
'contrasts-with': { cat: 'opposition', line: 'wavy', glyph: 'tilde', symmetric: true, label: 'contrasts with' },
|
|
70
|
+
'opposite-of': { cat: 'opposition', line: 'double', glyph: 'x', symmetric: true, label: 'opposite of' },
|
|
71
|
+
|
|
72
|
+
'similar-to': { cat: 'similarity', line: 'dashed', glyph: 'approx', symmetric: true, label: 'similar to' },
|
|
73
|
+
'analogous-to': { cat: 'similarity', line: 'dotted', glyph: 'arrows-lr', symmetric: true, label: 'analogous to' },
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const RELATION_TYPE_VALUES = Object.keys(RELATION_TYPES) as EdgeTypeName[]
|
package/tsconfig.json
ADDED