@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 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
- # `@skhema/method`
1
+ # @skhema/method
2
2
 
3
- This package is the emerging public boundary for stable Skhema methodology
4
- definitions.
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
- Schema identity comes from `@skhema/types/schema`. This package should not
7
- redefine canonical component values, element values, labels, acronyms, or
8
- component-element mapping.
9
+ ## Install
9
10
 
10
- It should own:
11
+ ```sh
12
+ npm i @skhema/method
13
+ ```
11
14
 
12
- - component and element definitions
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
- `@skhema/intelligence` should consume these definitions for validation, prompt
21
- building, parsing, slot replacement, graph ingestion, and reasoning.
17
+ ## The vocabulary
22
18
 
23
- The current definitions are a first curated pass from:
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
- - `@skhema/types/schema`
26
- - `data/working/sk_variable_semantic_and_verb_slots_config.json`
27
- - `data/working/sk_variable_element_type_examples.json`
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
- Known normalization:
32
+ ELEMENT_TYPES.KEY_CHALLENGE
33
+ // { value: 'key_challenge', label: 'Key Challenge', acronym: 'CHL' }
30
34
 
31
- - The working files use `associated_impact`; the canonical element value in
32
- `@skhema/types/schema` is `impact`. The method package exposes `impact` and
33
- keeps `associated_impact` as an alias.
34
- - The working files use `solution_alternative`; the canonical element value in
35
- `@skhema/types/schema` is `solution`. The method package exposes `solution`
36
- and keeps `solution_alternative` as an alias.
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
@@ -1,4 +1,4 @@
1
- import type { ElementDefinition, ElementRelationshipDefinition } from "./types.js";
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