@happyvertical/smrt-prompts 0.51.21 → 0.51.29
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/AGENTS.md +34 -1
- package/README.md +148 -2
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/cache.d.ts +33 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/collections/PromptOverrideCollection.d.ts +45 -0
- package/dist/collections/PromptOverrideCollection.d.ts.map +1 -0
- package/dist/index.d.ts +12 -174
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +298 -30
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +117 -28
- package/dist/models/PromptOverride.d.ts +32 -0
- package/dist/models/PromptOverride.d.ts.map +1 -0
- package/dist/prompt-override-service.d.ts +56 -0
- package/dist/prompt-override-service.d.ts.map +1 -0
- package/dist/prompt-registry.d.ts +13 -0
- package/dist/prompt-registry.d.ts.map +1 -0
- package/dist/prompt-resolver.d.ts +3 -0
- package/dist/prompt-resolver.d.ts.map +1 -0
- package/dist/prompt-settings.d.ts +188 -0
- package/dist/prompt-settings.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +108 -248
- package/dist/svelte/components/PromptSettingsPanel.svelte +353 -0
- package/dist/svelte/components/PromptSettingsPanel.svelte.d.ts +52 -0
- package/dist/svelte/components/PromptSettingsPanel.svelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +17 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +14 -0
- package/dist/svelte/types.d.ts +75 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +42 -0
- package/dist/types.d.ts +107 -110
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +29 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +27 -8
package/dist/types.d.ts
CHANGED
|
@@ -1,111 +1,108 @@
|
|
|
1
|
-
import { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare interface PromptAIInput {
|
|
10
|
-
profile?: string | null;
|
|
11
|
-
model?: string | null;
|
|
12
|
-
params?: PromptParams | null;
|
|
13
|
-
temperature?: number;
|
|
14
|
-
maxTokens?: number;
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export declare interface PromptCacheValue {
|
|
19
|
-
key: string;
|
|
20
|
-
template: string;
|
|
21
|
-
ai: NormalizedPromptAI;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export declare interface PromptConfigOverrideInput {
|
|
25
|
-
template?: string | null;
|
|
26
|
-
profile?: string | null;
|
|
27
|
-
model?: string | null;
|
|
28
|
-
params?: PromptParams | null;
|
|
29
|
-
ai?: PromptAIInput | null;
|
|
30
|
-
temperature?: number;
|
|
31
|
-
maxTokens?: number;
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare interface PromptDefinition {
|
|
36
|
-
key: string;
|
|
37
|
-
template: string;
|
|
38
|
-
ai: NormalizedPromptAI;
|
|
39
|
-
editable: PromptEditableConfig;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export declare interface PromptDefinitionInput {
|
|
43
|
-
key: string;
|
|
44
|
-
template: string;
|
|
45
|
-
ai?: PromptAIInput;
|
|
46
|
-
editable?: Partial<PromptEditableConfig>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export declare interface PromptEditableConfig {
|
|
50
|
-
template: boolean;
|
|
51
|
-
profile: boolean;
|
|
52
|
-
model: boolean;
|
|
53
|
-
params: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export declare interface PromptLayer {
|
|
57
|
-
template?: string | null;
|
|
58
|
-
profile?: string | null;
|
|
59
|
-
model?: string | null;
|
|
60
|
-
params?: PromptParams | null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export declare interface PromptPackageConfig {
|
|
64
|
-
profiles?: Record<string, PromptProfileConfig>;
|
|
65
|
-
prompts?: Record<string, PromptConfigOverrideInput>;
|
|
66
|
-
allowedProfileNames?: string[];
|
|
67
|
-
allowedModels?: string[];
|
|
68
|
-
[key: string]: unknown;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export declare type PromptParams = Record<string, unknown>;
|
|
72
|
-
|
|
73
|
-
export declare interface PromptProfileConfig {
|
|
74
|
-
provider: string;
|
|
75
|
-
model: string;
|
|
76
|
-
params?: PromptParams | null;
|
|
77
|
-
temperature?: number;
|
|
78
|
-
maxTokens?: number;
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export declare interface ResolvedPrompt {
|
|
83
|
-
key: string;
|
|
84
|
-
template: string;
|
|
85
|
-
text: string;
|
|
86
|
-
ai: ResolvedPromptAI;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export declare interface ResolvedPromptAI extends PromptParams {
|
|
90
|
-
profile?: string;
|
|
91
|
-
provider?: string;
|
|
92
|
-
model?: string;
|
|
93
|
-
allowedModels?: string[];
|
|
94
|
-
params: PromptParams;
|
|
95
|
-
temperature?: number;
|
|
96
|
-
maxTokens?: number;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export declare interface ResolvePromptOptions {
|
|
100
|
-
db?: SmrtClassOptions['db'];
|
|
101
|
-
tenantId?: string | null;
|
|
102
|
-
variables?: Record<string, unknown>;
|
|
103
|
-
override?: PromptConfigOverrideInput;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export { }
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
declare global {
|
|
110
|
-
var __smrtPromptRegistry: Map<string, PromptDefinition> | undefined;
|
|
1
|
+
import { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
export type PromptParams = Record<string, unknown>;
|
|
3
|
+
export interface PromptEditableConfig {
|
|
4
|
+
template: boolean;
|
|
5
|
+
profile: boolean;
|
|
6
|
+
model: boolean;
|
|
7
|
+
params: boolean;
|
|
111
8
|
}
|
|
9
|
+
export interface PromptAIInput {
|
|
10
|
+
profile?: string | null;
|
|
11
|
+
model?: string | null;
|
|
12
|
+
params?: PromptParams | null;
|
|
13
|
+
temperature?: number;
|
|
14
|
+
maxTokens?: number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface PromptDefinitionInput {
|
|
18
|
+
key: string;
|
|
19
|
+
template: string;
|
|
20
|
+
/** Human-readable description shown by a management screen; defaults to `''`. */
|
|
21
|
+
description?: string;
|
|
22
|
+
ai?: PromptAIInput;
|
|
23
|
+
editable?: Partial<PromptEditableConfig>;
|
|
24
|
+
}
|
|
25
|
+
export interface PromptDefinition {
|
|
26
|
+
key: string;
|
|
27
|
+
template: string;
|
|
28
|
+
description: string;
|
|
29
|
+
ai: NormalizedPromptAI;
|
|
30
|
+
editable: PromptEditableConfig;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The two scopes a stored {@link PromptOverride} row may target: the
|
|
34
|
+
* app-wide default (`tenantId` is `null`) or one tenant.
|
|
35
|
+
*/
|
|
36
|
+
export type PromptOverrideScopeType = 'app' | 'tenant';
|
|
37
|
+
/**
|
|
38
|
+
* Canonical scope id for the app-wide override scope, mirroring
|
|
39
|
+
* `GLOBAL_FEATURE_SCOPE_ID` in `@happyvertical/smrt-features` (#3013). The
|
|
40
|
+
* resolver and the write-authorization path both key off this exact value —
|
|
41
|
+
* `PromptOverride` itself stores the app scope as `tenantId: null`, not this
|
|
42
|
+
* string, so this constant only ever appears at the scope-request boundary
|
|
43
|
+
* (`PromptOverrideService`, `PromptSettingsService`).
|
|
44
|
+
*/
|
|
45
|
+
export declare const APP_PROMPT_SCOPE_ID = "__app__";
|
|
46
|
+
export interface PromptProfileConfig {
|
|
47
|
+
provider: string;
|
|
48
|
+
model: string;
|
|
49
|
+
params?: PromptParams | null;
|
|
50
|
+
temperature?: number;
|
|
51
|
+
maxTokens?: number;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface PromptConfigOverrideInput {
|
|
55
|
+
template?: string | null;
|
|
56
|
+
profile?: string | null;
|
|
57
|
+
model?: string | null;
|
|
58
|
+
params?: PromptParams | null;
|
|
59
|
+
ai?: PromptAIInput | null;
|
|
60
|
+
temperature?: number;
|
|
61
|
+
maxTokens?: number;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
export interface PromptPackageConfig {
|
|
65
|
+
profiles?: Record<string, PromptProfileConfig>;
|
|
66
|
+
prompts?: Record<string, PromptConfigOverrideInput>;
|
|
67
|
+
allowedProfileNames?: string[];
|
|
68
|
+
allowedModels?: string[];
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
export interface PromptLayer {
|
|
72
|
+
template?: string | null;
|
|
73
|
+
profile?: string | null;
|
|
74
|
+
model?: string | null;
|
|
75
|
+
params?: PromptParams | null;
|
|
76
|
+
}
|
|
77
|
+
export interface NormalizedPromptAI {
|
|
78
|
+
profile?: string;
|
|
79
|
+
model?: string;
|
|
80
|
+
params: PromptParams;
|
|
81
|
+
}
|
|
82
|
+
export interface ResolvedPromptAI extends PromptParams {
|
|
83
|
+
profile?: string;
|
|
84
|
+
provider?: string;
|
|
85
|
+
model?: string;
|
|
86
|
+
allowedModels?: string[];
|
|
87
|
+
params: PromptParams;
|
|
88
|
+
temperature?: number;
|
|
89
|
+
maxTokens?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ResolvedPrompt {
|
|
92
|
+
key: string;
|
|
93
|
+
template: string;
|
|
94
|
+
text: string;
|
|
95
|
+
ai: ResolvedPromptAI;
|
|
96
|
+
}
|
|
97
|
+
export interface ResolvePromptOptions {
|
|
98
|
+
db?: SmrtClassOptions['db'];
|
|
99
|
+
tenantId?: string | null;
|
|
100
|
+
variables?: Record<string, unknown>;
|
|
101
|
+
override?: PromptConfigOverrideInput;
|
|
102
|
+
}
|
|
103
|
+
export interface PromptCacheValue {
|
|
104
|
+
key: string;
|
|
105
|
+
template: string;
|
|
106
|
+
ai: NormalizedPromptAI;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,C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+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { SmrtClassOptions } from '@happyvertical/smrt-core';\n\nexport type PromptParams = Record<string, unknown>;\n\nexport interface PromptEditableConfig {\n template: boolean;\n profile: boolean;\n model: boolean;\n params: boolean;\n}\n\nexport interface PromptAIInput {\n profile?: string | null;\n model?: string | null;\n params?: PromptParams | null;\n temperature?: number;\n maxTokens?: number;\n [key: string]: unknown;\n}\n\nexport interface PromptDefinitionInput {\n key: string;\n template: string;\n /** Human-readable description shown by a management screen; defaults to `''`. */\n description?: string;\n ai?: PromptAIInput;\n editable?: Partial<PromptEditableConfig>;\n}\n\nexport interface PromptDefinition {\n key: string;\n template: string;\n description: string;\n ai: NormalizedPromptAI;\n editable: PromptEditableConfig;\n}\n\n/**\n * The two scopes a stored {@link PromptOverride} row may target: the\n * app-wide default (`tenantId` is `null`) or one tenant.\n */\nexport type PromptOverrideScopeType = 'app' | 'tenant';\n\n/**\n * Canonical scope id for the app-wide override scope, mirroring\n * `GLOBAL_FEATURE_SCOPE_ID` in `@happyvertical/smrt-features` (#3013). The\n * resolver and the write-authorization path both key off this exact value —\n * `PromptOverride` itself stores the app scope as `tenantId: null`, not this\n * string, so this constant only ever appears at the scope-request boundary\n * (`PromptOverrideService`, `PromptSettingsService`).\n */\nexport const APP_PROMPT_SCOPE_ID = '__app__';\n\nexport interface PromptProfileConfig {\n provider: string;\n model: string;\n params?: PromptParams | null;\n temperature?: number;\n maxTokens?: number;\n [key: string]: unknown;\n}\n\nexport interface PromptConfigOverrideInput {\n template?: string | null;\n profile?: string | null;\n model?: string | null;\n params?: PromptParams | null;\n ai?: PromptAIInput | null;\n temperature?: number;\n maxTokens?: number;\n [key: string]: unknown;\n}\n\nexport interface PromptPackageConfig {\n profiles?: Record<string, PromptProfileConfig>;\n prompts?: Record<string, PromptConfigOverrideInput>;\n allowedProfileNames?: string[];\n allowedModels?: string[];\n [key: string]: unknown;\n}\n\nexport interface PromptLayer {\n template?: string | null;\n profile?: string | null;\n model?: string | null;\n params?: PromptParams | null;\n}\n\nexport interface NormalizedPromptAI {\n profile?: string;\n model?: string;\n params: PromptParams;\n}\n\nexport interface ResolvedPromptAI extends PromptParams {\n profile?: string;\n provider?: string;\n model?: string;\n allowedModels?: string[];\n params: PromptParams;\n temperature?: number;\n maxTokens?: number;\n}\n\nexport interface ResolvedPrompt {\n key: string;\n template: string;\n text: string;\n ai: ResolvedPromptAI;\n}\n\nexport interface ResolvePromptOptions {\n db?: SmrtClassOptions['db'];\n tenantId?: string | null;\n variables?: Record<string, unknown>;\n override?: PromptConfigOverrideInput;\n}\n\nexport interface PromptCacheValue {\n key: string;\n template: string;\n ai: NormalizedPromptAI;\n}\n"],"mappings":";AAmDO,IAAM,sBAAsB"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NormalizedPromptAI, PromptConfigOverrideInput, PromptDefinitionInput, PromptEditableConfig, PromptLayer, PromptPackageConfig, PromptParams, PromptProfileConfig, ResolvedPromptAI } from './types.js';
|
|
2
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
3
|
+
export declare function normalizeEditableConfig(editable?: Partial<PromptEditableConfig>): PromptEditableConfig;
|
|
4
|
+
export declare function sanitizePromptParams(params: PromptParams | null | undefined): PromptParams;
|
|
5
|
+
export declare function mergePromptParams(...paramLayers: Array<PromptParams | null | undefined>): PromptParams;
|
|
6
|
+
export declare function normalizePromptDefinitionInput(input: PromptDefinitionInput): {
|
|
7
|
+
key: string;
|
|
8
|
+
template: string;
|
|
9
|
+
description: string;
|
|
10
|
+
ai: NormalizedPromptAI;
|
|
11
|
+
editable: PromptEditableConfig;
|
|
12
|
+
};
|
|
13
|
+
export declare function normalizePromptLayer(input?: PromptConfigOverrideInput | null): PromptLayer;
|
|
14
|
+
export declare function mergePromptLayers(...layers: Array<PromptLayer | null | undefined>): {
|
|
15
|
+
template: string;
|
|
16
|
+
ai: NormalizedPromptAI;
|
|
17
|
+
};
|
|
18
|
+
export declare function normalizeProfileConfig(profile: PromptProfileConfig): {
|
|
19
|
+
provider: string;
|
|
20
|
+
model: string;
|
|
21
|
+
params: PromptParams;
|
|
22
|
+
};
|
|
23
|
+
export declare function validateProfileName(profileName: string, config: PromptPackageConfig): void;
|
|
24
|
+
export declare function validateModelName(modelName: string, config: PromptPackageConfig): void;
|
|
25
|
+
export declare function buildResolvedAI(ai: NormalizedPromptAI, config: PromptPackageConfig): ResolvedPromptAI;
|
|
26
|
+
export declare function renderPromptTemplate(template: string, variables?: Record<string, unknown>): string;
|
|
27
|
+
export declare function parsePromptParams(raw: string | null | undefined): PromptParams;
|
|
28
|
+
export declare function serializePromptParams(params: PromptParams | null | undefined): string | null;
|
|
29
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAElB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAuCpB,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElC;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACvC,oBAAoB,CAOtB;AA0CD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACtC,YAAY,CAYd;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,WAAW,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC,GACrD,YAAY,CAcd;AAqBD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,qBAAqB,GAAG;IAC5E,GA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
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-prompts",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.29",
|
|
4
4
|
"description": "Typed prompt registry, override resolution, and tenant-aware prompt settings for SMRT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,22 +15,41 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
|
+
"./svelte": {
|
|
19
|
+
"types": "./dist/svelte/index.d.ts",
|
|
20
|
+
"svelte": "./dist/svelte/index.js",
|
|
21
|
+
"import": "./dist/svelte/index.js"
|
|
22
|
+
},
|
|
18
23
|
"./manifest": "./dist/manifest.json",
|
|
19
24
|
"./manifest.json": "./dist/manifest.json"
|
|
20
25
|
},
|
|
21
26
|
"dependencies": {
|
|
22
|
-
"@happyvertical/smrt-config": "0.51.
|
|
23
|
-
"@happyvertical/smrt-core": "0.51.
|
|
24
|
-
"@happyvertical/smrt-tenancy": "0.51.
|
|
25
|
-
"@happyvertical/
|
|
27
|
+
"@happyvertical/smrt-config": "0.51.29",
|
|
28
|
+
"@happyvertical/smrt-core": "0.51.29",
|
|
29
|
+
"@happyvertical/smrt-tenancy": "0.51.29",
|
|
30
|
+
"@happyvertical/smrt-ui": "0.51.29",
|
|
31
|
+
"@happyvertical/sql": "^0.90.0"
|
|
26
32
|
},
|
|
27
33
|
"devDependencies": {
|
|
28
|
-
"@happyvertical/smrt-vitest": "0.51.
|
|
34
|
+
"@happyvertical/smrt-vitest": "0.51.29",
|
|
35
|
+
"@sveltejs/package": "^2.5.8",
|
|
36
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
29
37
|
"@types/node": "24.13.6",
|
|
38
|
+
"jsdom": "^29.1.1",
|
|
39
|
+
"svelte": "^5.57.1",
|
|
40
|
+
"svelte-check": "^4.7.6",
|
|
30
41
|
"typescript": "5.9.3",
|
|
31
42
|
"vite": "8.1.4",
|
|
32
43
|
"vitest": "4.1.10"
|
|
33
44
|
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"svelte": "^5.57.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependenciesMeta": {
|
|
49
|
+
"svelte": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
34
53
|
"keywords": [
|
|
35
54
|
"smrt",
|
|
36
55
|
"prompts",
|
|
@@ -50,13 +69,13 @@
|
|
|
50
69
|
"directory": "packages/prompts"
|
|
51
70
|
},
|
|
52
71
|
"scripts": {
|
|
53
|
-
"build": "vite build --mode library",
|
|
72
|
+
"build": "vite build --mode library && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json && node ../../scripts/prune-svelte-package-artifacts.js dist/svelte",
|
|
54
73
|
"build:watch": "vite build --mode library --watch",
|
|
55
74
|
"clean": "rm -rf dist",
|
|
56
75
|
"dev": "vite dev",
|
|
57
76
|
"test": "vitest run",
|
|
58
77
|
"test:watch": "vitest",
|
|
59
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
78
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && node ../../scripts/svelte-check-a11y.mjs --tsconfig ./tsconfig.svelte.json",
|
|
60
79
|
"verify:pack": "node ../../scripts/verify-package-types-exports.js ."
|
|
61
80
|
}
|
|
62
81
|
}
|