@almadar/patterns 1.0.1 → 1.0.9
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/{src → dist}/component-mapping.json +1 -1
- package/{src → dist}/event-contracts.json +1 -1
- package/dist/index.d.ts +71 -8
- package/dist/index.js +98 -6
- package/dist/index.js.map +1 -1
- package/{src → dist}/patterns-registry.json +14 -3
- package/dist/registry.json +23563 -0
- package/package.json +7 -8
- /package/{src → dist}/integrators-registry.json +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var version$3 = "1.0.0";
|
|
2
|
-
var exportedAt$3 = "2026-02-
|
|
2
|
+
var exportedAt$3 = "2026-02-07T17:56:09.988Z";
|
|
3
3
|
var patterns = {
|
|
4
4
|
"entity-table": {
|
|
5
5
|
type: "entity-table",
|
|
@@ -21291,8 +21291,7 @@ var patterns = {
|
|
|
21291
21291
|
types: [
|
|
21292
21292
|
"array"
|
|
21293
21293
|
],
|
|
21294
|
-
description: "Array of tiles to render"
|
|
21295
|
-
required: true
|
|
21294
|
+
description: "Array of tiles to render (optional when entity is provided)"
|
|
21296
21295
|
},
|
|
21297
21296
|
units: {
|
|
21298
21297
|
types: [
|
|
@@ -21306,6 +21305,18 @@ var patterns = {
|
|
|
21306
21305
|
],
|
|
21307
21306
|
description: "Array of features (resources, portals, etc.)"
|
|
21308
21307
|
},
|
|
21308
|
+
entity: {
|
|
21309
|
+
types: [
|
|
21310
|
+
"array"
|
|
21311
|
+
],
|
|
21312
|
+
description: "Raw Orbital entity data array. When provided, the component maps entity fields to tiles/units/features internally based on entityRole."
|
|
21313
|
+
},
|
|
21314
|
+
entityRole: {
|
|
21315
|
+
types: [
|
|
21316
|
+
"string"
|
|
21317
|
+
],
|
|
21318
|
+
description: "How to interpret entity data: - 'tiles': generate tiles from entity data - 'units': generate units from entity data - 'both': generate both tiles and features from entity data"
|
|
21319
|
+
},
|
|
21309
21320
|
selectedUnitId: {
|
|
21310
21321
|
types: [
|
|
21311
21322
|
"string"
|
|
@@ -24093,7 +24104,7 @@ var integratorsRegistry = {
|
|
|
24093
24104
|
};
|
|
24094
24105
|
|
|
24095
24106
|
var version$1 = "1.0.0";
|
|
24096
|
-
var exportedAt$1 = "2026-02-
|
|
24107
|
+
var exportedAt$1 = "2026-02-07T17:56:09.988Z";
|
|
24097
24108
|
var mappings = {
|
|
24098
24109
|
"page-header": {
|
|
24099
24110
|
component: "PageHeader",
|
|
@@ -26187,7 +26198,7 @@ var componentMapping = {
|
|
|
26187
26198
|
};
|
|
26188
26199
|
|
|
26189
26200
|
var version = "1.0.0";
|
|
26190
|
-
var exportedAt = "2026-02-
|
|
26201
|
+
var exportedAt = "2026-02-07T17:56:09.988Z";
|
|
26191
26202
|
var contracts = {
|
|
26192
26203
|
form: {
|
|
26193
26204
|
emits: [
|
|
@@ -35170,6 +35181,44 @@ declare const PATTERN_TYPES: PatternType[];
|
|
|
35170
35181
|
*/
|
|
35171
35182
|
declare function isValidPatternType(type: string): type is PatternType;
|
|
35172
35183
|
|
|
35184
|
+
/**
|
|
35185
|
+
* Prompt Helpers for @almadar/patterns
|
|
35186
|
+
*
|
|
35187
|
+
* Helper functions for generating prompts/documentation from pattern registry.
|
|
35188
|
+
* Used by @almadar/skills package and other tools.
|
|
35189
|
+
*
|
|
35190
|
+
* @packageDocumentation
|
|
35191
|
+
*/
|
|
35192
|
+
|
|
35193
|
+
/**
|
|
35194
|
+
* Get patterns grouped by category.
|
|
35195
|
+
* Categories are derived from pattern registry metadata.
|
|
35196
|
+
*/
|
|
35197
|
+
declare function getPatternsGroupedByCategory(): Record<string, PatternType[]>;
|
|
35198
|
+
/**
|
|
35199
|
+
* Get compact pattern props reference table.
|
|
35200
|
+
* Generates markdown table of pattern names and their key props.
|
|
35201
|
+
*/
|
|
35202
|
+
declare function getPatternPropsCompact(): string;
|
|
35203
|
+
/**
|
|
35204
|
+
* Get pattern action props reference.
|
|
35205
|
+
* Lists patterns that have action/event props (buttons, forms, etc.).
|
|
35206
|
+
*/
|
|
35207
|
+
declare function getPatternActionsRef(): string;
|
|
35208
|
+
/**
|
|
35209
|
+
* Generate pattern description from metadata.
|
|
35210
|
+
* Auto-generates human-readable description from pattern props schema.
|
|
35211
|
+
*/
|
|
35212
|
+
declare function generatePatternDescription(patternType: string): string;
|
|
35213
|
+
/**
|
|
35214
|
+
* Get all pattern types as array.
|
|
35215
|
+
*/
|
|
35216
|
+
declare function getAllPatternTypes(): PatternType[];
|
|
35217
|
+
/**
|
|
35218
|
+
* Get pattern metadata for a specific pattern.
|
|
35219
|
+
*/
|
|
35220
|
+
declare function getPatternMetadata(patternType: string): any;
|
|
35221
|
+
|
|
35173
35222
|
declare const registry: {
|
|
35174
35223
|
version: string;
|
|
35175
35224
|
exportedAt: string;
|
|
@@ -49622,7 +49671,6 @@ declare const registry: {
|
|
|
49622
49671
|
tiles: {
|
|
49623
49672
|
types: string[];
|
|
49624
49673
|
description: string;
|
|
49625
|
-
required: boolean;
|
|
49626
49674
|
};
|
|
49627
49675
|
units: {
|
|
49628
49676
|
types: string[];
|
|
@@ -49632,6 +49680,14 @@ declare const registry: {
|
|
|
49632
49680
|
types: string[];
|
|
49633
49681
|
description: string;
|
|
49634
49682
|
};
|
|
49683
|
+
entity: {
|
|
49684
|
+
types: string[];
|
|
49685
|
+
description: string;
|
|
49686
|
+
};
|
|
49687
|
+
entityRole: {
|
|
49688
|
+
types: string[];
|
|
49689
|
+
description: string;
|
|
49690
|
+
};
|
|
49635
49691
|
selectedUnitId: {
|
|
49636
49692
|
types: string[];
|
|
49637
49693
|
description: string;
|
|
@@ -65608,7 +65664,6 @@ declare const PATTERN_REGISTRY: {
|
|
|
65608
65664
|
tiles: {
|
|
65609
65665
|
types: string[];
|
|
65610
65666
|
description: string;
|
|
65611
|
-
required: boolean;
|
|
65612
65667
|
};
|
|
65613
65668
|
units: {
|
|
65614
65669
|
types: string[];
|
|
@@ -65618,6 +65673,14 @@ declare const PATTERN_REGISTRY: {
|
|
|
65618
65673
|
types: string[];
|
|
65619
65674
|
description: string;
|
|
65620
65675
|
};
|
|
65676
|
+
entity: {
|
|
65677
|
+
types: string[];
|
|
65678
|
+
description: string;
|
|
65679
|
+
};
|
|
65680
|
+
entityRole: {
|
|
65681
|
+
types: string[];
|
|
65682
|
+
description: string;
|
|
65683
|
+
};
|
|
65621
65684
|
selectedUnitId: {
|
|
65622
65685
|
types: string[];
|
|
65623
65686
|
description: string;
|
|
@@ -72433,4 +72496,4 @@ declare function getComponentForPattern(patternType: string): any;
|
|
|
72433
72496
|
*/
|
|
72434
72497
|
declare function isEntityAwarePattern(patternType: string): boolean;
|
|
72435
72498
|
|
|
72436
|
-
export { type AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, type PatternConfig, type PatternProps, type PatternPropsMap, type PatternType, componentMapping, eventContracts, getComponentForPattern, getPatternDefinition, integratorsRegistry, isEntityAwarePattern, isValidPatternType, patternsRegistry, registry };
|
|
72499
|
+
export { type AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, type PatternConfig, type PatternProps, type PatternPropsMap, type PatternType, componentMapping, eventContracts, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integratorsRegistry, isEntityAwarePattern, isValidPatternType, patternsRegistry, registry };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/patterns-registry.json
|
|
2
2
|
var patterns_registry_default = {
|
|
3
3
|
version: "1.0.0",
|
|
4
|
-
exportedAt: "2026-02-
|
|
4
|
+
exportedAt: "2026-02-07T17:56:09.988Z",
|
|
5
5
|
patterns: {
|
|
6
6
|
"entity-table": {
|
|
7
7
|
type: "entity-table",
|
|
@@ -21266,8 +21266,7 @@ var patterns_registry_default = {
|
|
|
21266
21266
|
types: [
|
|
21267
21267
|
"array"
|
|
21268
21268
|
],
|
|
21269
|
-
description: "Array of tiles to render"
|
|
21270
|
-
required: true
|
|
21269
|
+
description: "Array of tiles to render (optional when entity is provided)"
|
|
21271
21270
|
},
|
|
21272
21271
|
units: {
|
|
21273
21272
|
types: [
|
|
@@ -21281,6 +21280,18 @@ var patterns_registry_default = {
|
|
|
21281
21280
|
],
|
|
21282
21281
|
description: "Array of features (resources, portals, etc.)"
|
|
21283
21282
|
},
|
|
21283
|
+
entity: {
|
|
21284
|
+
types: [
|
|
21285
|
+
"array"
|
|
21286
|
+
],
|
|
21287
|
+
description: "Raw Orbital entity data array. When provided, the component maps entity fields to tiles/units/features internally based on entityRole."
|
|
21288
|
+
},
|
|
21289
|
+
entityRole: {
|
|
21290
|
+
types: [
|
|
21291
|
+
"string"
|
|
21292
|
+
],
|
|
21293
|
+
description: "How to interpret entity data: - 'tiles': generate tiles from entity data - 'units': generate units from entity data - 'both': generate both tiles and features from entity data"
|
|
21294
|
+
},
|
|
21284
21295
|
selectedUnitId: {
|
|
21285
21296
|
types: [
|
|
21286
21297
|
"string"
|
|
@@ -24057,7 +24068,7 @@ var integrators_registry_default = {
|
|
|
24057
24068
|
// src/component-mapping.json
|
|
24058
24069
|
var component_mapping_default = {
|
|
24059
24070
|
version: "1.0.0",
|
|
24060
|
-
exportedAt: "2026-02-
|
|
24071
|
+
exportedAt: "2026-02-07T17:56:09.988Z",
|
|
24061
24072
|
mappings: {
|
|
24062
24073
|
"page-header": {
|
|
24063
24074
|
component: "PageHeader",
|
|
@@ -26149,7 +26160,7 @@ var component_mapping_default = {
|
|
|
26149
26160
|
// src/event-contracts.json
|
|
26150
26161
|
var event_contracts_default = {
|
|
26151
26162
|
version: "1.0.0",
|
|
26152
|
-
exportedAt: "2026-02-
|
|
26163
|
+
exportedAt: "2026-02-07T17:56:09.988Z",
|
|
26153
26164
|
contracts: {
|
|
26154
26165
|
form: {
|
|
26155
26166
|
emits: [
|
|
@@ -31766,6 +31777,87 @@ function isValidPatternType(type) {
|
|
|
31766
31777
|
return PATTERN_TYPES.includes(type);
|
|
31767
31778
|
}
|
|
31768
31779
|
|
|
31780
|
+
// src/helpers/prompt-helpers.ts
|
|
31781
|
+
function getPatternsGroupedByCategory() {
|
|
31782
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31783
|
+
const grouped = {};
|
|
31784
|
+
for (const [patternName, patternDef] of Object.entries(patterns)) {
|
|
31785
|
+
const category = patternDef.category || "uncategorized";
|
|
31786
|
+
if (!grouped[category]) {
|
|
31787
|
+
grouped[category] = [];
|
|
31788
|
+
}
|
|
31789
|
+
grouped[category].push(patternName);
|
|
31790
|
+
}
|
|
31791
|
+
return grouped;
|
|
31792
|
+
}
|
|
31793
|
+
function getPatternPropsCompact() {
|
|
31794
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31795
|
+
const lines = [
|
|
31796
|
+
"| Pattern | Key Props |",
|
|
31797
|
+
"|---------|-----------|"
|
|
31798
|
+
];
|
|
31799
|
+
for (const [patternName, patternDef] of Object.entries(patterns)) {
|
|
31800
|
+
const propsSchema = patternDef.propsSchema || {};
|
|
31801
|
+
const requiredProps = Object.keys(propsSchema).filter(
|
|
31802
|
+
(key) => propsSchema[key]?.required === true
|
|
31803
|
+
);
|
|
31804
|
+
const keyProps = requiredProps.length > 0 ? requiredProps.join(", ") : Object.keys(propsSchema).slice(0, 3).join(", ");
|
|
31805
|
+
lines.push(`| ${patternName} | ${keyProps} |`);
|
|
31806
|
+
}
|
|
31807
|
+
return lines.join("\n");
|
|
31808
|
+
}
|
|
31809
|
+
function getPatternActionsRef() {
|
|
31810
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31811
|
+
const lines = [
|
|
31812
|
+
"## Pattern Action Props",
|
|
31813
|
+
"",
|
|
31814
|
+
"| Pattern | Action Props | Notes |",
|
|
31815
|
+
"|---------|-------------|-------|"
|
|
31816
|
+
];
|
|
31817
|
+
for (const [patternName, patternDef] of Object.entries(patterns)) {
|
|
31818
|
+
const propsSchema = patternDef.propsSchema || {};
|
|
31819
|
+
const actionProps = [];
|
|
31820
|
+
for (const [propName, propDef] of Object.entries(propsSchema)) {
|
|
31821
|
+
if (propName.includes("action") || propName.includes("Action") || propName.includes("event") || propName.includes("Event") || propName === "onSubmit" || propName === "onClick") {
|
|
31822
|
+
actionProps.push(propName);
|
|
31823
|
+
}
|
|
31824
|
+
}
|
|
31825
|
+
if (actionProps.length > 0) {
|
|
31826
|
+
const notes = patternDef.description || "";
|
|
31827
|
+
lines.push(`| ${patternName} | ${actionProps.join(", ")} | ${notes.slice(0, 50)} |`);
|
|
31828
|
+
}
|
|
31829
|
+
}
|
|
31830
|
+
return lines.join("\n");
|
|
31831
|
+
}
|
|
31832
|
+
function generatePatternDescription(patternType) {
|
|
31833
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31834
|
+
const patternDef = patterns[patternType];
|
|
31835
|
+
if (!patternDef) {
|
|
31836
|
+
return patternType;
|
|
31837
|
+
}
|
|
31838
|
+
const desc = patternDef.description;
|
|
31839
|
+
if (desc) {
|
|
31840
|
+
return desc;
|
|
31841
|
+
}
|
|
31842
|
+
const propsSchema = patternDef.propsSchema || {};
|
|
31843
|
+
const propCount = Object.keys(propsSchema).length;
|
|
31844
|
+
const requiredProps = Object.keys(propsSchema).filter(
|
|
31845
|
+
(key) => propsSchema[key]?.required === true
|
|
31846
|
+
);
|
|
31847
|
+
if (requiredProps.length > 0) {
|
|
31848
|
+
return `${patternType} (requires: ${requiredProps.join(", ")})`;
|
|
31849
|
+
}
|
|
31850
|
+
return `${patternType} (${propCount} props)`;
|
|
31851
|
+
}
|
|
31852
|
+
function getAllPatternTypes() {
|
|
31853
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31854
|
+
return Object.keys(patterns);
|
|
31855
|
+
}
|
|
31856
|
+
function getPatternMetadata(patternType) {
|
|
31857
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
31858
|
+
return patterns[patternType] || null;
|
|
31859
|
+
}
|
|
31860
|
+
|
|
31769
31861
|
// src/index.ts
|
|
31770
31862
|
var registry = patterns_registry_default;
|
|
31771
31863
|
var PATTERN_REGISTRY = patterns_registry_default;
|
|
@@ -31789,6 +31881,6 @@ function isEntityAwarePattern(patternType) {
|
|
|
31789
31881
|
return hasEntityProp && hasDataProp;
|
|
31790
31882
|
}
|
|
31791
31883
|
|
|
31792
|
-
export { COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, component_mapping_default as componentMapping, event_contracts_default as eventContracts, getComponentForPattern, getPatternDefinition, integrators_registry_default as integratorsRegistry, isEntityAwarePattern, isValidPatternType, patterns_registry_default as patternsRegistry, registry };
|
|
31884
|
+
export { COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, component_mapping_default as componentMapping, event_contracts_default as eventContracts, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integrators_registry_default as integratorsRegistry, isEntityAwarePattern, isValidPatternType, patterns_registry_default as patternsRegistry, registry };
|
|
31793
31885
|
//# sourceMappingURL=index.js.map
|
|
31794
31886
|
//# sourceMappingURL=index.js.map
|