pupt-lib 1.2.6 → 1.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/README.md +292 -256
- package/dist/index.d.ts +458 -29
- package/dist/index.js +2030 -360
- package/dist/jsx-dev-runtime.d.ts +483 -0
- package/dist/jsx-runtime/index.d.ts +2 -29
- package/dist/jsx-runtime/jsx-dev-runtime.d.ts +2 -26
- package/package.json +4 -4
- package/dist/api.d.ts +0 -38
- package/dist/api.d.ts.map +0 -1
- package/dist/component.d.ts +0 -83
- package/dist/component.d.ts.map +0 -1
- package/dist/components/ask/Choice.d.ts +0 -156
- package/dist/components/ask/Choice.d.ts.map +0 -1
- package/dist/components/ask/Confirm.d.ts +0 -62
- package/dist/components/ask/Confirm.d.ts.map +0 -1
- package/dist/components/ask/Date.d.ts +0 -79
- package/dist/components/ask/Date.d.ts.map +0 -1
- package/dist/components/ask/Editor.d.ts +0 -67
- package/dist/components/ask/Editor.d.ts.map +0 -1
- package/dist/components/ask/File.d.ts +0 -85
- package/dist/components/ask/File.d.ts.map +0 -1
- package/dist/components/ask/Label.d.ts +0 -28
- package/dist/components/ask/Label.d.ts.map +0 -1
- package/dist/components/ask/MultiSelect.d.ts +0 -148
- package/dist/components/ask/MultiSelect.d.ts.map +0 -1
- package/dist/components/ask/Number.d.ts +0 -73
- package/dist/components/ask/Number.d.ts.map +0 -1
- package/dist/components/ask/Option.d.ts +0 -29
- package/dist/components/ask/Option.d.ts.map +0 -1
- package/dist/components/ask/Path.d.ts +0 -73
- package/dist/components/ask/Path.d.ts.map +0 -1
- package/dist/components/ask/Rating.d.ts +0 -79
- package/dist/components/ask/Rating.d.ts.map +0 -1
- package/dist/components/ask/ReviewFile.d.ts +0 -79
- package/dist/components/ask/ReviewFile.d.ts.map +0 -1
- package/dist/components/ask/Secret.d.ts +0 -67
- package/dist/components/ask/Secret.d.ts.map +0 -1
- package/dist/components/ask/Select.d.ts +0 -136
- package/dist/components/ask/Select.d.ts.map +0 -1
- package/dist/components/ask/Text.d.ts +0 -67
- package/dist/components/ask/Text.d.ts.map +0 -1
- package/dist/components/ask/index.d.ts +0 -34
- package/dist/components/ask/index.d.ts.map +0 -1
- package/dist/components/ask/utils.d.ts +0 -26
- package/dist/components/ask/utils.d.ts.map +0 -1
- package/dist/components/control/ForEach.d.ts +0 -32
- package/dist/components/control/ForEach.d.ts.map +0 -1
- package/dist/components/control/If.d.ts +0 -24
- package/dist/components/control/If.d.ts.map +0 -1
- package/dist/components/data/Code.d.ts +0 -31
- package/dist/components/data/Code.d.ts.map +0 -1
- package/dist/components/data/Data.d.ts +0 -31
- package/dist/components/data/Data.d.ts.map +0 -1
- package/dist/components/data/File.d.ts +0 -37
- package/dist/components/data/File.d.ts.map +0 -1
- package/dist/components/data/Json.d.ts +0 -25
- package/dist/components/data/Json.d.ts.map +0 -1
- package/dist/components/data/Xml.d.ts +0 -25
- package/dist/components/data/Xml.d.ts.map +0 -1
- package/dist/components/data/index.d.ts +0 -6
- package/dist/components/data/index.d.ts.map +0 -1
- package/dist/components/examples/Example.d.ts +0 -17
- package/dist/components/examples/Example.d.ts.map +0 -1
- package/dist/components/examples/ExampleInput.d.ts +0 -13
- package/dist/components/examples/ExampleInput.d.ts.map +0 -1
- package/dist/components/examples/ExampleOutput.d.ts +0 -13
- package/dist/components/examples/ExampleOutput.d.ts.map +0 -1
- package/dist/components/examples/Examples.d.ts +0 -13
- package/dist/components/examples/Examples.d.ts.map +0 -1
- package/dist/components/examples/index.d.ts +0 -5
- package/dist/components/examples/index.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -11
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/meta/Uses.d.ts +0 -98
- package/dist/components/meta/Uses.d.ts.map +0 -1
- package/dist/components/meta/index.d.ts +0 -2
- package/dist/components/meta/index.d.ts.map +0 -1
- package/dist/components/post-execution/OpenUrl.d.ts +0 -29
- package/dist/components/post-execution/OpenUrl.d.ts.map +0 -1
- package/dist/components/post-execution/PostExecution.d.ts +0 -13
- package/dist/components/post-execution/PostExecution.d.ts.map +0 -1
- package/dist/components/post-execution/ReviewFile.d.ts +0 -29
- package/dist/components/post-execution/ReviewFile.d.ts.map +0 -1
- package/dist/components/post-execution/RunCommand.d.ts +0 -35
- package/dist/components/post-execution/RunCommand.d.ts.map +0 -1
- package/dist/components/post-execution/index.d.ts +0 -5
- package/dist/components/post-execution/index.d.ts.map +0 -1
- package/dist/components/reasoning/Step.d.ts +0 -25
- package/dist/components/reasoning/Step.d.ts.map +0 -1
- package/dist/components/reasoning/Steps.d.ts +0 -14
- package/dist/components/reasoning/Steps.d.ts.map +0 -1
- package/dist/components/reasoning/index.d.ts +0 -3
- package/dist/components/reasoning/index.d.ts.map +0 -1
- package/dist/components/structural/Audience.d.ts +0 -25
- package/dist/components/structural/Audience.d.ts.map +0 -1
- package/dist/components/structural/Constraint.d.ts +0 -31
- package/dist/components/structural/Constraint.d.ts.map +0 -1
- package/dist/components/structural/Context.d.ts +0 -25
- package/dist/components/structural/Context.d.ts.map +0 -1
- package/dist/components/structural/Criterion.d.ts +0 -13
- package/dist/components/structural/Criterion.d.ts.map +0 -1
- package/dist/components/structural/Format.d.ts +0 -37
- package/dist/components/structural/Format.d.ts.map +0 -1
- package/dist/components/structural/Prompt.d.ts +0 -43
- package/dist/components/structural/Prompt.d.ts.map +0 -1
- package/dist/components/structural/Role.d.ts +0 -37
- package/dist/components/structural/Role.d.ts.map +0 -1
- package/dist/components/structural/Section.d.ts +0 -31
- package/dist/components/structural/Section.d.ts.map +0 -1
- package/dist/components/structural/SuccessCriteria.d.ts +0 -25
- package/dist/components/structural/SuccessCriteria.d.ts.map +0 -1
- package/dist/components/structural/Task.d.ts +0 -25
- package/dist/components/structural/Task.d.ts.map +0 -1
- package/dist/components/structural/Tone.d.ts +0 -25
- package/dist/components/structural/Tone.d.ts.map +0 -1
- package/dist/components/structural/index.d.ts +0 -12
- package/dist/components/structural/index.d.ts.map +0 -1
- package/dist/components/utility/Cwd.d.ts +0 -11
- package/dist/components/utility/Cwd.d.ts.map +0 -1
- package/dist/components/utility/DateTime.d.ts +0 -23
- package/dist/components/utility/DateTime.d.ts.map +0 -1
- package/dist/components/utility/Hostname.d.ts +0 -11
- package/dist/components/utility/Hostname.d.ts.map +0 -1
- package/dist/components/utility/Timestamp.d.ts +0 -11
- package/dist/components/utility/Timestamp.d.ts.map +0 -1
- package/dist/components/utility/UUID.d.ts +0 -11
- package/dist/components/utility/UUID.d.ts.map +0 -1
- package/dist/components/utility/Username.d.ts +0 -11
- package/dist/components/utility/Username.d.ts.map +0 -1
- package/dist/components/utility/index.d.ts +0 -7
- package/dist/components/utility/index.d.ts.map +0 -1
- package/dist/create-prompt.d.ts +0 -118
- package/dist/create-prompt.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsx-runtime/index.d.ts.map +0 -1
- package/dist/jsx-runtime/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/render.d.ts +0 -19
- package/dist/render.d.ts.map +0 -1
- package/dist/services/babel-plugins/index.d.ts +0 -3
- package/dist/services/babel-plugins/index.d.ts.map +0 -1
- package/dist/services/babel-plugins/name-hoisting.d.ts +0 -8
- package/dist/services/babel-plugins/name-hoisting.d.ts.map +0 -1
- package/dist/services/babel-plugins/uses-to-import.d.ts +0 -16
- package/dist/services/babel-plugins/uses-to-import.d.ts.map +0 -1
- package/dist/services/browser-support.d.ts +0 -185
- package/dist/services/browser-support.d.ts.map +0 -1
- package/dist/services/file-search-engine.d.ts +0 -162
- package/dist/services/file-search-engine.d.ts.map +0 -1
- package/dist/services/formula-parser.d.ts +0 -9
- package/dist/services/formula-parser.d.ts.map +0 -1
- package/dist/services/input-iterator.d.ts +0 -54
- package/dist/services/input-iterator.d.ts.map +0 -1
- package/dist/services/module-evaluator.d.ts +0 -38
- package/dist/services/module-evaluator.d.ts.map +0 -1
- package/dist/services/module-loader.d.ts +0 -92
- package/dist/services/module-loader.d.ts.map +0 -1
- package/dist/services/preprocessor.d.ts +0 -52
- package/dist/services/preprocessor.d.ts.map +0 -1
- package/dist/services/prop-validator.d.ts +0 -21
- package/dist/services/prop-validator.d.ts.map +0 -1
- package/dist/services/search-engine.d.ts +0 -10
- package/dist/services/search-engine.d.ts.map +0 -1
- package/dist/services/transformer.d.ts +0 -38
- package/dist/services/transformer.d.ts.map +0 -1
- package/dist/types/component.d.ts +0 -30
- package/dist/types/component.d.ts.map +0 -1
- package/dist/types/context.d.ts +0 -341
- package/dist/types/context.d.ts.map +0 -1
- package/dist/types/element.d.ts +0 -47
- package/dist/types/element.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/input.d.ts +0 -61
- package/dist/types/input.d.ts.map +0 -1
- package/dist/types/module.d.ts +0 -61
- package/dist/types/module.d.ts.map +0 -1
- package/dist/types/render.d.ts +0 -92
- package/dist/types/render.d.ts.map +0 -1
- package/dist/types/search.d.ts +0 -59
- package/dist/types/search.d.ts.map +0 -1
- package/dist/types/symbols.d.ts +0 -9
- package/dist/types/symbols.d.ts.map +0 -1
package/dist/types/context.d.ts
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { PostExecutionAction, RenderError } from './render';
|
|
3
|
-
/**
|
|
4
|
-
* Ensure the Node.js runtime cache is initialized.
|
|
5
|
-
* In browser environments, this resolves immediately.
|
|
6
|
-
* In Node.js, this waits for the async initialization to complete.
|
|
7
|
-
*
|
|
8
|
-
* This is primarily useful for testing to ensure runtime values are available.
|
|
9
|
-
*/
|
|
10
|
-
export declare function ensureRuntimeCacheReady(): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Known LLM providers (model creators, not hosting platforms).
|
|
13
|
-
* Hosting platforms like AWS Bedrock and Azure are not included here
|
|
14
|
-
* because the provider represents who created the model, which determines
|
|
15
|
-
* the prompt optimization strategy.
|
|
16
|
-
*/
|
|
17
|
-
export declare const LLM_PROVIDERS: readonly ["anthropic", "openai", "google", "meta", "mistral", "deepseek", "xai", "cohere", "unspecified"];
|
|
18
|
-
export type LlmProvider = typeof LLM_PROVIDERS[number];
|
|
19
|
-
/**
|
|
20
|
-
* Infer the LLM provider from a model name/ID.
|
|
21
|
-
* Returns the provider if the model matches a known pattern, or null if unknown.
|
|
22
|
-
*/
|
|
23
|
-
export declare function inferProviderFromModel(model: string): LlmProvider | null;
|
|
24
|
-
/**
|
|
25
|
-
* Schema for LLM configuration.
|
|
26
|
-
* When a model is specified but provider is not, the provider is automatically
|
|
27
|
-
* inferred from the model name.
|
|
28
|
-
*/
|
|
29
|
-
export declare const llmConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
30
|
-
model: z.ZodDefault<z.ZodString>;
|
|
31
|
-
provider: z.ZodDefault<z.ZodEnum<["anthropic", "openai", "google", "meta", "mistral", "deepseek", "xai", "cohere", "unspecified"]>>;
|
|
32
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
model: string;
|
|
36
|
-
provider: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere";
|
|
37
|
-
maxTokens?: number | undefined;
|
|
38
|
-
temperature?: number | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
model?: string | undefined;
|
|
41
|
-
provider?: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere" | undefined;
|
|
42
|
-
maxTokens?: number | undefined;
|
|
43
|
-
temperature?: number | undefined;
|
|
44
|
-
}>, {
|
|
45
|
-
model: string;
|
|
46
|
-
provider: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere";
|
|
47
|
-
maxTokens?: number | undefined;
|
|
48
|
-
temperature?: number | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
model?: string | undefined;
|
|
51
|
-
provider?: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere" | undefined;
|
|
52
|
-
maxTokens?: number | undefined;
|
|
53
|
-
temperature?: number | undefined;
|
|
54
|
-
}>;
|
|
55
|
-
/**
|
|
56
|
-
* Schema for output configuration
|
|
57
|
-
*/
|
|
58
|
-
export declare const outputConfigSchema: z.ZodObject<{
|
|
59
|
-
format: z.ZodDefault<z.ZodEnum<["xml", "markdown", "json", "text", "unspecified"]>>;
|
|
60
|
-
trim: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
-
indent: z.ZodDefault<z.ZodString>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
format: "xml" | "markdown" | "json" | "text" | "unspecified";
|
|
64
|
-
trim: boolean;
|
|
65
|
-
indent: string;
|
|
66
|
-
}, {
|
|
67
|
-
format?: "xml" | "markdown" | "json" | "text" | "unspecified" | undefined;
|
|
68
|
-
trim?: boolean | undefined;
|
|
69
|
-
indent?: string | undefined;
|
|
70
|
-
}>;
|
|
71
|
-
/**
|
|
72
|
-
* Schema for code configuration
|
|
73
|
-
*/
|
|
74
|
-
export declare const codeConfigSchema: z.ZodObject<{
|
|
75
|
-
language: z.ZodDefault<z.ZodString>;
|
|
76
|
-
highlight: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
-
}, "strip", z.ZodTypeAny, {
|
|
78
|
-
language: string;
|
|
79
|
-
highlight?: boolean | undefined;
|
|
80
|
-
}, {
|
|
81
|
-
language?: string | undefined;
|
|
82
|
-
highlight?: boolean | undefined;
|
|
83
|
-
}>;
|
|
84
|
-
/**
|
|
85
|
-
* Schema for user/caller context configuration
|
|
86
|
-
*/
|
|
87
|
-
export declare const userConfigSchema: z.ZodObject<{
|
|
88
|
-
editor: z.ZodDefault<z.ZodString>;
|
|
89
|
-
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
editor: string;
|
|
91
|
-
}, {
|
|
92
|
-
editor?: string | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Schema for runtime configuration (auto-detected values)
|
|
96
|
-
*/
|
|
97
|
-
export declare const runtimeConfigSchema: z.ZodObject<{
|
|
98
|
-
hostname: z.ZodString;
|
|
99
|
-
username: z.ZodString;
|
|
100
|
-
cwd: z.ZodString;
|
|
101
|
-
platform: z.ZodString;
|
|
102
|
-
os: z.ZodString;
|
|
103
|
-
locale: z.ZodString;
|
|
104
|
-
timestamp: z.ZodNumber;
|
|
105
|
-
date: z.ZodString;
|
|
106
|
-
time: z.ZodString;
|
|
107
|
-
uuid: z.ZodString;
|
|
108
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
109
|
-
hostname: z.ZodString;
|
|
110
|
-
username: z.ZodString;
|
|
111
|
-
cwd: z.ZodString;
|
|
112
|
-
platform: z.ZodString;
|
|
113
|
-
os: z.ZodString;
|
|
114
|
-
locale: z.ZodString;
|
|
115
|
-
timestamp: z.ZodNumber;
|
|
116
|
-
date: z.ZodString;
|
|
117
|
-
time: z.ZodString;
|
|
118
|
-
uuid: z.ZodString;
|
|
119
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
120
|
-
hostname: z.ZodString;
|
|
121
|
-
username: z.ZodString;
|
|
122
|
-
cwd: z.ZodString;
|
|
123
|
-
platform: z.ZodString;
|
|
124
|
-
os: z.ZodString;
|
|
125
|
-
locale: z.ZodString;
|
|
126
|
-
timestamp: z.ZodNumber;
|
|
127
|
-
date: z.ZodString;
|
|
128
|
-
time: z.ZodString;
|
|
129
|
-
uuid: z.ZodString;
|
|
130
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
131
|
-
/**
|
|
132
|
-
* Schema for the full environment context
|
|
133
|
-
*/
|
|
134
|
-
export declare const environmentContextSchema: z.ZodObject<{
|
|
135
|
-
llm: z.ZodDefault<z.ZodEffects<z.ZodObject<{
|
|
136
|
-
model: z.ZodDefault<z.ZodString>;
|
|
137
|
-
provider: z.ZodDefault<z.ZodEnum<["anthropic", "openai", "google", "meta", "mistral", "deepseek", "xai", "cohere", "unspecified"]>>;
|
|
138
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
139
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
model: string;
|
|
142
|
-
provider: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere";
|
|
143
|
-
maxTokens?: number | undefined;
|
|
144
|
-
temperature?: number | undefined;
|
|
145
|
-
}, {
|
|
146
|
-
model?: string | undefined;
|
|
147
|
-
provider?: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere" | undefined;
|
|
148
|
-
maxTokens?: number | undefined;
|
|
149
|
-
temperature?: number | undefined;
|
|
150
|
-
}>, {
|
|
151
|
-
model: string;
|
|
152
|
-
provider: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere";
|
|
153
|
-
maxTokens?: number | undefined;
|
|
154
|
-
temperature?: number | undefined;
|
|
155
|
-
}, {
|
|
156
|
-
model?: string | undefined;
|
|
157
|
-
provider?: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere" | undefined;
|
|
158
|
-
maxTokens?: number | undefined;
|
|
159
|
-
temperature?: number | undefined;
|
|
160
|
-
}>>;
|
|
161
|
-
output: z.ZodDefault<z.ZodObject<{
|
|
162
|
-
format: z.ZodDefault<z.ZodEnum<["xml", "markdown", "json", "text", "unspecified"]>>;
|
|
163
|
-
trim: z.ZodDefault<z.ZodBoolean>;
|
|
164
|
-
indent: z.ZodDefault<z.ZodString>;
|
|
165
|
-
}, "strip", z.ZodTypeAny, {
|
|
166
|
-
format: "xml" | "markdown" | "json" | "text" | "unspecified";
|
|
167
|
-
trim: boolean;
|
|
168
|
-
indent: string;
|
|
169
|
-
}, {
|
|
170
|
-
format?: "xml" | "markdown" | "json" | "text" | "unspecified" | undefined;
|
|
171
|
-
trim?: boolean | undefined;
|
|
172
|
-
indent?: string | undefined;
|
|
173
|
-
}>>;
|
|
174
|
-
code: z.ZodDefault<z.ZodObject<{
|
|
175
|
-
language: z.ZodDefault<z.ZodString>;
|
|
176
|
-
highlight: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
-
}, "strip", z.ZodTypeAny, {
|
|
178
|
-
language: string;
|
|
179
|
-
highlight?: boolean | undefined;
|
|
180
|
-
}, {
|
|
181
|
-
language?: string | undefined;
|
|
182
|
-
highlight?: boolean | undefined;
|
|
183
|
-
}>>;
|
|
184
|
-
user: z.ZodDefault<z.ZodObject<{
|
|
185
|
-
editor: z.ZodDefault<z.ZodString>;
|
|
186
|
-
}, "strip", z.ZodTypeAny, {
|
|
187
|
-
editor: string;
|
|
188
|
-
}, {
|
|
189
|
-
editor?: string | undefined;
|
|
190
|
-
}>>;
|
|
191
|
-
runtime: z.ZodDefault<z.ZodObject<{
|
|
192
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
193
|
-
username: z.ZodOptional<z.ZodString>;
|
|
194
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
195
|
-
platform: z.ZodOptional<z.ZodString>;
|
|
196
|
-
os: z.ZodOptional<z.ZodString>;
|
|
197
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
198
|
-
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
199
|
-
date: z.ZodOptional<z.ZodString>;
|
|
200
|
-
time: z.ZodOptional<z.ZodString>;
|
|
201
|
-
uuid: z.ZodOptional<z.ZodString>;
|
|
202
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
203
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
204
|
-
username: z.ZodOptional<z.ZodString>;
|
|
205
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
206
|
-
platform: z.ZodOptional<z.ZodString>;
|
|
207
|
-
os: z.ZodOptional<z.ZodString>;
|
|
208
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
209
|
-
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
210
|
-
date: z.ZodOptional<z.ZodString>;
|
|
211
|
-
time: z.ZodOptional<z.ZodString>;
|
|
212
|
-
uuid: z.ZodOptional<z.ZodString>;
|
|
213
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
214
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
215
|
-
username: z.ZodOptional<z.ZodString>;
|
|
216
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
217
|
-
platform: z.ZodOptional<z.ZodString>;
|
|
218
|
-
os: z.ZodOptional<z.ZodString>;
|
|
219
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
220
|
-
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
221
|
-
date: z.ZodOptional<z.ZodString>;
|
|
222
|
-
time: z.ZodOptional<z.ZodString>;
|
|
223
|
-
uuid: z.ZodOptional<z.ZodString>;
|
|
224
|
-
}, z.ZodTypeAny, "passthrough">>>;
|
|
225
|
-
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
code: {
|
|
227
|
-
language: string;
|
|
228
|
-
highlight?: boolean | undefined;
|
|
229
|
-
};
|
|
230
|
-
llm: {
|
|
231
|
-
model: string;
|
|
232
|
-
provider: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere";
|
|
233
|
-
maxTokens?: number | undefined;
|
|
234
|
-
temperature?: number | undefined;
|
|
235
|
-
};
|
|
236
|
-
output: {
|
|
237
|
-
format: "xml" | "markdown" | "json" | "text" | "unspecified";
|
|
238
|
-
trim: boolean;
|
|
239
|
-
indent: string;
|
|
240
|
-
};
|
|
241
|
-
user: {
|
|
242
|
-
editor: string;
|
|
243
|
-
};
|
|
244
|
-
runtime: {
|
|
245
|
-
hostname?: string | undefined;
|
|
246
|
-
username?: string | undefined;
|
|
247
|
-
cwd?: string | undefined;
|
|
248
|
-
platform?: string | undefined;
|
|
249
|
-
os?: string | undefined;
|
|
250
|
-
locale?: string | undefined;
|
|
251
|
-
timestamp?: number | undefined;
|
|
252
|
-
date?: string | undefined;
|
|
253
|
-
time?: string | undefined;
|
|
254
|
-
uuid?: string | undefined;
|
|
255
|
-
} & {
|
|
256
|
-
[k: string]: unknown;
|
|
257
|
-
};
|
|
258
|
-
}, {
|
|
259
|
-
code?: {
|
|
260
|
-
language?: string | undefined;
|
|
261
|
-
highlight?: boolean | undefined;
|
|
262
|
-
} | undefined;
|
|
263
|
-
llm?: {
|
|
264
|
-
model?: string | undefined;
|
|
265
|
-
provider?: "unspecified" | "anthropic" | "openai" | "google" | "meta" | "mistral" | "deepseek" | "xai" | "cohere" | undefined;
|
|
266
|
-
maxTokens?: number | undefined;
|
|
267
|
-
temperature?: number | undefined;
|
|
268
|
-
} | undefined;
|
|
269
|
-
output?: {
|
|
270
|
-
format?: "xml" | "markdown" | "json" | "text" | "unspecified" | undefined;
|
|
271
|
-
trim?: boolean | undefined;
|
|
272
|
-
indent?: string | undefined;
|
|
273
|
-
} | undefined;
|
|
274
|
-
user?: {
|
|
275
|
-
editor?: string | undefined;
|
|
276
|
-
} | undefined;
|
|
277
|
-
runtime?: z.objectInputType<{
|
|
278
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
279
|
-
username: z.ZodOptional<z.ZodString>;
|
|
280
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
281
|
-
platform: z.ZodOptional<z.ZodString>;
|
|
282
|
-
os: z.ZodOptional<z.ZodString>;
|
|
283
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
284
|
-
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
285
|
-
date: z.ZodOptional<z.ZodString>;
|
|
286
|
-
time: z.ZodOptional<z.ZodString>;
|
|
287
|
-
uuid: z.ZodOptional<z.ZodString>;
|
|
288
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
289
|
-
}>;
|
|
290
|
-
/**
|
|
291
|
-
* LLM configuration for prompt rendering
|
|
292
|
-
*/
|
|
293
|
-
export type LlmConfig = z.infer<typeof llmConfigSchema>;
|
|
294
|
-
/**
|
|
295
|
-
* Output configuration for rendered prompts
|
|
296
|
-
*/
|
|
297
|
-
export type OutputConfig = z.infer<typeof outputConfigSchema>;
|
|
298
|
-
/**
|
|
299
|
-
* Code-related configuration
|
|
300
|
-
*/
|
|
301
|
-
export type CodeConfig = z.infer<typeof codeConfigSchema>;
|
|
302
|
-
/**
|
|
303
|
-
* User/caller context configuration
|
|
304
|
-
*/
|
|
305
|
-
export type UserConfig = z.infer<typeof userConfigSchema>;
|
|
306
|
-
/**
|
|
307
|
-
* Runtime configuration gathered from the environment
|
|
308
|
-
*/
|
|
309
|
-
export type RuntimeConfig = z.infer<typeof runtimeConfigSchema>;
|
|
310
|
-
/**
|
|
311
|
-
* Environment context containing all configuration
|
|
312
|
-
*/
|
|
313
|
-
export type EnvironmentContext = z.infer<typeof environmentContextSchema>;
|
|
314
|
-
/**
|
|
315
|
-
* Render context passed to components during rendering
|
|
316
|
-
*/
|
|
317
|
-
export interface RenderContext {
|
|
318
|
-
inputs: Map<string, unknown>;
|
|
319
|
-
env: EnvironmentContext;
|
|
320
|
-
postExecution: PostExecutionAction[];
|
|
321
|
-
errors: RenderError[];
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Default environment configuration
|
|
325
|
-
*/
|
|
326
|
-
export declare const DEFAULT_ENVIRONMENT: EnvironmentContext;
|
|
327
|
-
/**
|
|
328
|
-
* Create an environment context with optional overrides.
|
|
329
|
-
* Validates input against the schema.
|
|
330
|
-
*/
|
|
331
|
-
export declare function createEnvironment(overrides?: Partial<EnvironmentContext>): EnvironmentContext;
|
|
332
|
-
/**
|
|
333
|
-
* Create a runtime configuration from the current environment.
|
|
334
|
-
* Works in both Node.js and browser environments.
|
|
335
|
-
*
|
|
336
|
-
* In Node.js, system values (hostname, username, os) are loaded asynchronously
|
|
337
|
-
* via dynamic import to avoid bundling Node.js modules in browser builds.
|
|
338
|
-
* If the cache isn't ready on first call, defaults are used temporarily.
|
|
339
|
-
*/
|
|
340
|
-
export declare function createRuntimeConfig(): RuntimeConfig;
|
|
341
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAkEjE;;;;;;GAMG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ7D;AAYD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,2GAUhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEvD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA4BxE;AAMD;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWhB,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAMH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,GAAG,EAAE,kBAAkB,CAAC;IACxB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,kBAMjC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACtC,kBAAkB,CASpB;AAgDD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAqCnD"}
|
package/dist/types/element.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Component } from '../component';
|
|
2
|
-
import { TYPE, PROPS, CHILDREN, DEFERRED_REF } from './symbols';
|
|
3
|
-
/**
|
|
4
|
-
* PuptNode represents any valid child of a JSX element.
|
|
5
|
-
* Can be primitives, elements, or arrays of nodes.
|
|
6
|
-
*/
|
|
7
|
-
export type PuptNode = string | number | boolean | null | undefined | PuptElement | PuptNode[];
|
|
8
|
-
/**
|
|
9
|
-
* PuptElement represents a JSX element in the pupt-lib tree.
|
|
10
|
-
* Uses symbols for internal properties to prevent collision with property access.
|
|
11
|
-
*/
|
|
12
|
-
export interface PuptElement<P = Record<string, unknown>> {
|
|
13
|
-
[TYPE]: string | symbol | ComponentType<P>;
|
|
14
|
-
[PROPS]: P;
|
|
15
|
-
[CHILDREN]: PuptNode[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* DeferredRef represents a reference to a property on a resolved element value.
|
|
19
|
-
* This is used when accessing properties like `{github.stars}` on elements.
|
|
20
|
-
*/
|
|
21
|
-
export interface DeferredRef {
|
|
22
|
-
[DEFERRED_REF]: true;
|
|
23
|
-
element: PuptElement;
|
|
24
|
-
path: (string | number)[];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* ComponentType can be either a class component (extending Component)
|
|
28
|
-
* or a function component.
|
|
29
|
-
*/
|
|
30
|
-
export type ComponentType<P = Record<string, unknown>> = (new () => Component<P>) | ((props: P & {
|
|
31
|
-
children?: PuptNode;
|
|
32
|
-
}) => PuptNode);
|
|
33
|
-
/**
|
|
34
|
-
* Type guard to check if a value is a PuptElement.
|
|
35
|
-
*
|
|
36
|
-
* @param value - The value to check
|
|
37
|
-
* @returns true if the value is a PuptElement
|
|
38
|
-
*/
|
|
39
|
-
export declare function isPuptElement(value: unknown): value is PuptElement;
|
|
40
|
-
/**
|
|
41
|
-
* Type guard to check if a value is a DeferredRef.
|
|
42
|
-
*
|
|
43
|
-
* @param value - The value to check
|
|
44
|
-
* @returns true if the value is a DeferredRef
|
|
45
|
-
*/
|
|
46
|
-
export declare function isDeferredRef(value: unknown): value is DeferredRef;
|
|
47
|
-
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","source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 +0,0 @@
|
|
|
1
|
-
export { TYPE, PROPS, CHILDREN, DEFERRED_REF } from './symbols';
|
|
2
|
-
export type { PuptNode, PuptElement, ComponentType, DeferredRef, } from './element';
|
|
3
|
-
export { isPuptElement, isDeferredRef } from './element';
|
|
4
|
-
export type { LlmConfig, LlmProvider, OutputConfig, CodeConfig, UserConfig, RuntimeConfig, EnvironmentContext, RenderContext, } from './context';
|
|
5
|
-
export { LLM_PROVIDERS, inferProviderFromModel, DEFAULT_ENVIRONMENT, createEnvironment, createRuntimeConfig, ensureRuntimeCacheReady, llmConfigSchema, outputConfigSchema, codeConfigSchema, userConfigSchema, runtimeConfigSchema, environmentContextSchema, } from './context';
|
|
6
|
-
export type { RenderOptions, RenderResult, RenderSuccess, RenderFailure, RenderError, RenderMetadata, PostExecutionAction, ReviewFileAction, OpenUrlAction, RunCommandAction, } from './render';
|
|
7
|
-
export type { InputRequirement, ValidationResult, ValidationError, ValidationWarning, CollectedInputs, } from './input';
|
|
8
|
-
export type { ComponentProps, PromptProps, StructuralProps, CommonProps, } from './component';
|
|
9
|
-
export type { SearchablePrompt, SearchOptions, SearchResult, SearchResultMatch, SearchEngineConfig, } from './search';
|
|
10
|
-
export type { PuptConfig, PuptLibrary, DiscoveredPrompt, LibraryLoadResult, PuptInitConfig, } from './module';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGhE,YAAY,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGzD,YAAY,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EAEvB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,UAAU,CAAC"}
|
package/dist/types/input.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ZodSchema } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Describes a required input for a prompt
|
|
4
|
-
*/
|
|
5
|
-
export interface InputRequirement {
|
|
6
|
-
name: string;
|
|
7
|
-
label: string;
|
|
8
|
-
description: string;
|
|
9
|
-
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'select' | 'multiselect' | 'date' | 'secret' | 'file' | 'path' | 'rating';
|
|
10
|
-
required: boolean;
|
|
11
|
-
default?: unknown;
|
|
12
|
-
schema?: ZodSchema;
|
|
13
|
-
min?: number;
|
|
14
|
-
max?: number;
|
|
15
|
-
options?: Array<{
|
|
16
|
-
value: string;
|
|
17
|
-
label: string;
|
|
18
|
-
text?: string;
|
|
19
|
-
}>;
|
|
20
|
-
language?: string;
|
|
21
|
-
extensions?: string[];
|
|
22
|
-
multiple?: boolean;
|
|
23
|
-
mustExist?: boolean;
|
|
24
|
-
mustBeDirectory?: boolean;
|
|
25
|
-
includeContents?: boolean;
|
|
26
|
-
includeTime?: boolean;
|
|
27
|
-
minDate?: string;
|
|
28
|
-
maxDate?: string;
|
|
29
|
-
masked?: boolean;
|
|
30
|
-
labels?: Record<number, string>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Result of validating inputs against requirements
|
|
34
|
-
*/
|
|
35
|
-
export interface ValidationResult {
|
|
36
|
-
valid: boolean;
|
|
37
|
-
errors: ValidationError[];
|
|
38
|
-
warnings: ValidationWarning[];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Validation error details
|
|
42
|
-
*/
|
|
43
|
-
export interface ValidationError {
|
|
44
|
-
field: string;
|
|
45
|
-
message: string;
|
|
46
|
-
code: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Validation warning details
|
|
50
|
-
*/
|
|
51
|
-
export interface ValidationWarning {
|
|
52
|
-
field: string;
|
|
53
|
-
message: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Collected inputs from Ask components
|
|
57
|
-
*/
|
|
58
|
-
export interface CollectedInputs {
|
|
59
|
-
[key: string]: unknown;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/types/input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MA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,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/dist/types/module.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from './element';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for a pupt library
|
|
4
|
-
*/
|
|
5
|
-
export interface PuptConfig {
|
|
6
|
-
name: string;
|
|
7
|
-
version: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
author?: string;
|
|
10
|
-
license?: string;
|
|
11
|
-
prompts?: string[];
|
|
12
|
-
components?: string[];
|
|
13
|
-
dependencies?: Record<string, string>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A loaded pupt library
|
|
17
|
-
*/
|
|
18
|
-
export interface PuptLibrary {
|
|
19
|
-
config: PuptConfig;
|
|
20
|
-
prompts: Map<string, DiscoveredPrompt>;
|
|
21
|
-
components: Map<string, ComponentType>;
|
|
22
|
-
path: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* A discovered prompt from a library
|
|
26
|
-
*/
|
|
27
|
-
export interface DiscoveredPrompt {
|
|
28
|
-
name: string;
|
|
29
|
-
description: string;
|
|
30
|
-
path: string;
|
|
31
|
-
library: string;
|
|
32
|
-
tags: string[];
|
|
33
|
-
inputSchema?: Record<string, unknown>;
|
|
34
|
-
component: ComponentType;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Result of loading a library
|
|
38
|
-
*/
|
|
39
|
-
export interface LibraryLoadResult {
|
|
40
|
-
success: boolean;
|
|
41
|
-
library?: PuptLibrary;
|
|
42
|
-
errors?: string[];
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Configuration for initializing the Pupt class
|
|
46
|
-
*/
|
|
47
|
-
export interface PuptInitConfig {
|
|
48
|
-
modules?: string[];
|
|
49
|
-
searchConfig?: {
|
|
50
|
-
threshold?: number;
|
|
51
|
-
weights?: {
|
|
52
|
-
name?: number;
|
|
53
|
-
description?: number;
|
|
54
|
-
tags?: number;
|
|
55
|
-
content?: number;
|
|
56
|
-
};
|
|
57
|
-
fuzzy?: boolean;
|
|
58
|
-
fuzziness?: number;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/types/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
package/dist/types/render.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { EnvironmentContext } from './context';
|
|
2
|
-
/**
|
|
3
|
-
* Options for rendering a prompt
|
|
4
|
-
*/
|
|
5
|
-
export interface RenderOptions {
|
|
6
|
-
format?: 'xml' | 'markdown' | 'json' | 'text' | 'unspecified';
|
|
7
|
-
trim?: boolean;
|
|
8
|
-
indent?: string;
|
|
9
|
-
maxDepth?: number;
|
|
10
|
-
inputs?: Map<string, unknown> | Record<string, unknown>;
|
|
11
|
-
env?: EnvironmentContext;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* A validation or runtime error encountered during rendering
|
|
15
|
-
*/
|
|
16
|
-
export interface RenderError {
|
|
17
|
-
/** Component class name or registry name, e.g. "Section" */
|
|
18
|
-
component: string;
|
|
19
|
-
/** The specific prop that failed validation, or null for cross-field/runtime errors */
|
|
20
|
-
prop: string | null;
|
|
21
|
-
/** Human-readable error message */
|
|
22
|
-
message: string;
|
|
23
|
-
/** Error code (Zod issue code or 'runtime_error' / 'missing_schema') */
|
|
24
|
-
code: string;
|
|
25
|
-
/** Path within the props object */
|
|
26
|
-
path: (string | number)[];
|
|
27
|
-
/** The value that was received */
|
|
28
|
-
received?: unknown;
|
|
29
|
-
/** The expected type or constraint */
|
|
30
|
-
expected?: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Successful render result — no validation errors
|
|
34
|
-
*/
|
|
35
|
-
export interface RenderSuccess {
|
|
36
|
-
ok: true;
|
|
37
|
-
text: string;
|
|
38
|
-
postExecution: PostExecutionAction[];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Failed render result — contains validation errors and best-effort output
|
|
42
|
-
*/
|
|
43
|
-
export interface RenderFailure {
|
|
44
|
-
ok: false;
|
|
45
|
-
/** Best-effort rendered output (children rendered as fallback for invalid components) */
|
|
46
|
-
text: string;
|
|
47
|
-
errors: RenderError[];
|
|
48
|
-
postExecution: PostExecutionAction[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Result of rendering a prompt — discriminated union on `ok`
|
|
52
|
-
*/
|
|
53
|
-
export type RenderResult = RenderSuccess | RenderFailure;
|
|
54
|
-
/**
|
|
55
|
-
* Metadata collected during rendering
|
|
56
|
-
*/
|
|
57
|
-
export interface RenderMetadata {
|
|
58
|
-
componentCount: number;
|
|
59
|
-
depth: number;
|
|
60
|
-
renderTime: number;
|
|
61
|
-
warnings?: string[];
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Actions to be executed after the LLM response
|
|
65
|
-
*/
|
|
66
|
-
export type PostExecutionAction = ReviewFileAction | OpenUrlAction | RunCommandAction;
|
|
67
|
-
/**
|
|
68
|
-
* Action to open a file for review in an editor
|
|
69
|
-
*/
|
|
70
|
-
export interface ReviewFileAction {
|
|
71
|
-
type: 'reviewFile';
|
|
72
|
-
file: string;
|
|
73
|
-
editor?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Action to open a URL in a browser
|
|
77
|
-
*/
|
|
78
|
-
export interface OpenUrlAction {
|
|
79
|
-
type: 'openUrl';
|
|
80
|
-
url: string;
|
|
81
|
-
browser?: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Action to execute a shell command
|
|
85
|
-
*/
|
|
86
|
-
export interface RunCommandAction {
|
|
87
|
-
type: 'runCommand';
|
|
88
|
-
command: string;
|
|
89
|
-
cwd?: string;
|
|
90
|
-
env?: Record<string, string>;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/types/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,GAAG,CAAC,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,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