@skhema/method 0.1.1 → 0.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/LICENSE +21 -0
- package/README.md +84 -27
- package/dist/definitions.d.ts +1 -2
- package/dist/definitions.js +680 -461
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/registry.d.ts +19 -19
- package/dist/registry.js +13 -12
- package/dist/types.d.ts +14 -17
- package/dist/types.js +0 -1
- package/dist/validate.d.ts +1 -2
- package/dist/validate.js +44 -43
- package/dist/vocabulary/components.d.ts +32 -0
- package/dist/vocabulary/components.js +27 -0
- package/dist/vocabulary/elements.d.ts +102 -0
- package/dist/vocabulary/elements.js +97 -0
- package/dist/vocabulary/index.d.ts +4 -0
- package/dist/vocabulary/index.js +4 -0
- package/dist/vocabulary/mapping.d.ts +130 -0
- package/dist/vocabulary/mapping.js +85 -0
- package/dist/vocabulary/utils.d.ts +14 -0
- package/dist/vocabulary/utils.js +54 -0
- package/package.json +56 -10
- package/dist/definitions.d.ts.map +0 -1
- package/dist/definitions.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Skhema
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,36 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @skhema/method
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
The complete, public **Skhema method** as one installable artifact: the
|
|
4
|
+
canonical vocabulary of strategic components and element types, the curated
|
|
5
|
+
definitions that make each element buildable (slots, expected moods, examples,
|
|
6
|
+
relationships), and a structural validator — with **zero runtime
|
|
7
|
+
dependencies**. Validate your own strategy artifacts without the platform.
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
redefine canonical component values, element values, labels, acronyms, or
|
|
8
|
-
component-element mapping.
|
|
9
|
+
## Install
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
```sh
|
|
12
|
+
npm i @skhema/method
|
|
13
|
+
```
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
- expected moods
|
|
14
|
-
- method slot definitions
|
|
15
|
-
- required vs optional slots
|
|
16
|
-
- labels, descriptions, examples
|
|
17
|
-
- valid element relationships
|
|
18
|
-
- extension points for future/custom method variants
|
|
15
|
+
Requires Node ≥ 18. ESM only.
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
building, parsing, slot replacement, graph ingestion, and reasoning.
|
|
17
|
+
## The vocabulary
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
`@skhema/method/vocabulary` is the identity layer of the method: the 5
|
|
20
|
+
strategic components, the 19 element types, and the mapping between them. It is
|
|
21
|
+
the same vocabulary that renders in Skhema embeds and API payloads.
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
COMPONENT_TYPES,
|
|
26
|
+
ELEMENT_TYPES,
|
|
27
|
+
SKHEMA_MAPPING,
|
|
28
|
+
getElementsForComponent,
|
|
29
|
+
isValidElementValue,
|
|
30
|
+
} from '@skhema/method/vocabulary'
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
ELEMENT_TYPES.KEY_CHALLENGE
|
|
33
|
+
// { value: 'key_challenge', label: 'Key Challenge', acronym: 'CHL' }
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
getElementsForComponent(COMPONENT_TYPES.DIAGNOSIS.value).map((e) => e.value)
|
|
36
|
+
// ['key_challenge', 'supporting_fact', 'impact']
|
|
37
|
+
|
|
38
|
+
isValidElementValue('experiment') // true
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Stability: additive-only
|
|
42
|
+
|
|
43
|
+
Within a major version, the vocabulary only grows. Existing component and
|
|
44
|
+
element values, labels, and acronyms are never renamed or removed; new entries
|
|
45
|
+
may be added in minor releases. You can persist vocabulary values in your own
|
|
46
|
+
systems and trust them across upgrades.
|
|
47
|
+
|
|
48
|
+
## The definitions
|
|
49
|
+
|
|
50
|
+
The package root adds the definitions layer — what each element _is_ and what
|
|
51
|
+
a well-formed one contains — and re-exports the vocabulary, so a full consumer
|
|
52
|
+
needs one import.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import {
|
|
56
|
+
getElementDefinition,
|
|
57
|
+
getRequiredMethodSlots,
|
|
58
|
+
listElementRelationships,
|
|
59
|
+
validateMethodSpec,
|
|
60
|
+
} from '@skhema/method'
|
|
61
|
+
|
|
62
|
+
const challenge = getElementDefinition('key_challenge')
|
|
63
|
+
challenge?.expectedMood // 'indicative'
|
|
64
|
+
challenge?.examples[0] // a worked example of a well-formed key challenge
|
|
65
|
+
|
|
66
|
+
getRequiredMethodSlots('key_challenge').map((slot) => slot.id)
|
|
67
|
+
// the semantic slots a complete key challenge must fill
|
|
68
|
+
|
|
69
|
+
// Relationships describe how elements connect across a strategy.
|
|
70
|
+
listElementRelationships().find(
|
|
71
|
+
(r) => r.source === 'key_challenge' && r.target === 'solution'
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
// The spec validates itself — the same check runs in this package's CI.
|
|
75
|
+
validateMethodSpec() // [] when the shipped definitions are internally consistent
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Some historical element-type names are kept as aliases so older artifacts keep
|
|
79
|
+
resolving: `associated_impact` → `impact`, `solution_alternative` → `solution`.
|
|
80
|
+
`getElementDefinition` accepts either form.
|
|
81
|
+
|
|
82
|
+
## Which package do I want?
|
|
83
|
+
|
|
84
|
+
| Package | Purpose |
|
|
85
|
+
| --------------------------- | --------------------------------------------------------------------------------------- |
|
|
86
|
+
| **`@skhema/method`** (this) | The method itself — vocabulary, definitions, validation. No network, no account needed. |
|
|
87
|
+
| `@skhema/sdk` | Typed client for the Skhema Public API (`api.skhema.com/v1`). |
|
|
88
|
+
| `@skhema/cli` | The same API as a terminal command (`skhema`), plus agent onboarding. |
|
|
89
|
+
| `@skhema/embed` | Render Skhema elements on your own site. |
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/dist/definitions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementDefinition, ElementRelationshipDefinition } from
|
|
1
|
+
import type { ElementDefinition, ElementRelationshipDefinition } from './types.js';
|
|
2
2
|
export declare const componentDefinitions: readonly [{
|
|
3
3
|
readonly type: "diagnosis";
|
|
4
4
|
readonly label: "Diagnosis";
|
|
@@ -27,4 +27,3 @@ export declare const componentDefinitions: readonly [{
|
|
|
27
27
|
}];
|
|
28
28
|
export declare const elementDefinitions: readonly [ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition, ElementDefinition];
|
|
29
29
|
export declare const elementRelationshipDefinitions: readonly [ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition, ElementRelationshipDefinition];
|
|
30
|
-
//# sourceMappingURL=definitions.d.ts.map
|