pupt-lib 1.3.0 → 1.3.2
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/dist/components/ask/Choice.d.ts +155 -0
- package/dist/components/ask/Choice.d.ts.map +1 -0
- package/dist/components/ask/Confirm.d.ts +61 -0
- package/dist/components/ask/Confirm.d.ts.map +1 -0
- package/dist/components/ask/Date.d.ts +78 -0
- package/dist/components/ask/Date.d.ts.map +1 -0
- package/dist/components/ask/Editor.d.ts +66 -0
- package/dist/components/ask/Editor.d.ts.map +1 -0
- package/dist/components/ask/File.d.ts +84 -0
- package/dist/components/ask/File.d.ts.map +1 -0
- package/dist/components/ask/Label.d.ts +27 -0
- package/dist/components/ask/Label.d.ts.map +1 -0
- package/dist/components/ask/MultiSelect.d.ts +147 -0
- package/dist/components/ask/MultiSelect.d.ts.map +1 -0
- package/dist/components/ask/Number.d.ts +72 -0
- package/dist/components/ask/Number.d.ts.map +1 -0
- package/dist/components/ask/Option.d.ts +28 -0
- package/dist/components/ask/Option.d.ts.map +1 -0
- package/dist/components/ask/Path.d.ts +72 -0
- package/dist/components/ask/Path.d.ts.map +1 -0
- package/dist/components/ask/Rating.d.ts +78 -0
- package/dist/components/ask/Rating.d.ts.map +1 -0
- package/dist/components/ask/ReviewFile.d.ts +78 -0
- package/dist/components/ask/ReviewFile.d.ts.map +1 -0
- package/dist/components/ask/Secret.d.ts +66 -0
- package/dist/components/ask/Secret.d.ts.map +1 -0
- package/dist/components/ask/Select.d.ts +135 -0
- package/dist/components/ask/Select.d.ts.map +1 -0
- package/dist/components/ask/Text.d.ts +66 -0
- package/dist/components/ask/Text.d.ts.map +1 -0
- package/dist/components/ask/index.d.ts +34 -0
- package/dist/components/ask/index.d.ts.map +1 -0
- package/dist/components/ask/utils.d.ts +26 -0
- package/dist/components/ask/utils.d.ts.map +1 -0
- package/dist/components/control/ForEach.d.ts +31 -0
- package/dist/components/control/ForEach.d.ts.map +1 -0
- package/dist/components/control/If.d.ts +35 -0
- package/dist/components/control/If.d.ts.map +1 -0
- package/dist/components/control/index.d.ts +3 -0
- package/dist/components/control/index.d.ts.map +1 -0
- package/dist/components/data/Code.d.ts +30 -0
- package/dist/components/data/Code.d.ts.map +1 -0
- package/dist/components/data/Data.d.ts +30 -0
- package/dist/components/data/Data.d.ts.map +1 -0
- package/dist/components/data/File.d.ts +37 -0
- package/dist/components/data/File.d.ts.map +1 -0
- package/dist/components/data/Json.d.ts +24 -0
- package/dist/components/data/Json.d.ts.map +1 -0
- package/dist/components/data/Xml.d.ts +24 -0
- package/dist/components/data/Xml.d.ts.map +1 -0
- package/dist/components/data/index.d.ts +6 -0
- package/dist/components/data/index.d.ts.map +1 -0
- package/dist/components/examples/Example.d.ts +16 -0
- package/dist/components/examples/Example.d.ts.map +1 -0
- package/dist/components/examples/ExampleInput.d.ts +12 -0
- package/dist/components/examples/ExampleInput.d.ts.map +1 -0
- package/dist/components/examples/ExampleOutput.d.ts +12 -0
- package/dist/components/examples/ExampleOutput.d.ts.map +1 -0
- package/dist/components/examples/Examples.d.ts +12 -0
- package/dist/components/examples/Examples.d.ts.map +1 -0
- package/dist/components/examples/NegativeExample.d.ts +24 -0
- package/dist/components/examples/NegativeExample.d.ts.map +1 -0
- package/dist/components/examples/index.d.ts +6 -0
- package/dist/components/examples/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/manifest.d.ts +15 -0
- package/dist/components/manifest.d.ts.map +1 -0
- package/dist/components/meta/Uses.d.ts +97 -0
- package/dist/components/meta/Uses.d.ts.map +1 -0
- package/dist/components/meta/index.d.ts +2 -0
- package/dist/components/meta/index.d.ts.map +1 -0
- package/dist/components/post-execution/OpenUrl.d.ts +28 -0
- package/dist/components/post-execution/OpenUrl.d.ts.map +1 -0
- package/dist/components/post-execution/PostExecution.d.ts +12 -0
- package/dist/components/post-execution/PostExecution.d.ts.map +1 -0
- package/dist/components/post-execution/ReviewFile.d.ts +29 -0
- package/dist/components/post-execution/ReviewFile.d.ts.map +1 -0
- package/dist/components/post-execution/RunCommand.d.ts +34 -0
- package/dist/components/post-execution/RunCommand.d.ts.map +1 -0
- package/dist/components/post-execution/index.d.ts +5 -0
- package/dist/components/post-execution/index.d.ts.map +1 -0
- package/dist/components/presets/constraint-presets.d.ts +13 -0
- package/dist/components/presets/constraint-presets.d.ts.map +1 -0
- package/dist/components/presets/default-constraints.d.ts +6 -0
- package/dist/components/presets/default-constraints.d.ts.map +1 -0
- package/dist/components/presets/guardrail-presets.d.ts +22 -0
- package/dist/components/presets/guardrail-presets.d.ts.map +1 -0
- package/dist/components/presets/index.d.ts +13 -0
- package/dist/components/presets/index.d.ts.map +1 -0
- package/dist/components/presets/provider-adaptations.d.ts +30 -0
- package/dist/components/presets/provider-adaptations.d.ts.map +1 -0
- package/dist/components/presets/role-presets.d.ts +19 -0
- package/dist/components/presets/role-presets.d.ts.map +1 -0
- package/dist/components/presets/steps-presets.d.ts +12 -0
- package/dist/components/presets/steps-presets.d.ts.map +1 -0
- package/dist/components/presets/task-presets.d.ts +14 -0
- package/dist/components/presets/task-presets.d.ts.map +1 -0
- package/dist/components/reasoning/ChainOfThought.d.ts +36 -0
- package/dist/components/reasoning/ChainOfThought.d.ts.map +1 -0
- package/dist/components/reasoning/Step.d.ts +24 -0
- package/dist/components/reasoning/Step.d.ts.map +1 -0
- package/dist/components/reasoning/Steps.d.ts +69 -0
- package/dist/components/reasoning/Steps.d.ts.map +1 -0
- package/dist/components/reasoning/index.d.ts +4 -0
- package/dist/components/reasoning/index.d.ts.map +1 -0
- package/dist/components/structural/Audience.d.ts +55 -0
- package/dist/components/structural/Audience.d.ts.map +1 -0
- package/dist/components/structural/Constraint.d.ts +49 -0
- package/dist/components/structural/Constraint.d.ts.map +1 -0
- package/dist/components/structural/Constraints.d.ts +50 -0
- package/dist/components/structural/Constraints.d.ts.map +1 -0
- package/dist/components/structural/Context.d.ts +72 -0
- package/dist/components/structural/Context.d.ts.map +1 -0
- package/dist/components/structural/Contexts.d.ts +36 -0
- package/dist/components/structural/Contexts.d.ts.map +1 -0
- package/dist/components/structural/Criterion.d.ts +36 -0
- package/dist/components/structural/Criterion.d.ts.map +1 -0
- package/dist/components/structural/EdgeCases.d.ts +46 -0
- package/dist/components/structural/EdgeCases.d.ts.map +1 -0
- package/dist/components/structural/Fallback.d.ts +43 -0
- package/dist/components/structural/Fallback.d.ts.map +1 -0
- package/dist/components/structural/Fallbacks.d.ts +46 -0
- package/dist/components/structural/Fallbacks.d.ts.map +1 -0
- package/dist/components/structural/Format.d.ts +79 -0
- package/dist/components/structural/Format.d.ts.map +1 -0
- package/dist/components/structural/Guardrails.d.ts +63 -0
- package/dist/components/structural/Guardrails.d.ts.map +1 -0
- package/dist/components/structural/Objective.d.ts +42 -0
- package/dist/components/structural/Objective.d.ts.map +1 -0
- package/dist/components/structural/Prompt.d.ts +243 -0
- package/dist/components/structural/Prompt.d.ts.map +1 -0
- package/dist/components/structural/Reference.d.ts +50 -0
- package/dist/components/structural/Reference.d.ts.map +1 -0
- package/dist/components/structural/References.d.ts +123 -0
- package/dist/components/structural/References.d.ts.map +1 -0
- package/dist/components/structural/Role.d.ts +74 -0
- package/dist/components/structural/Role.d.ts.map +1 -0
- package/dist/components/structural/Section.d.ts +30 -0
- package/dist/components/structural/Section.d.ts.map +1 -0
- package/dist/components/structural/Specialization.d.ts +36 -0
- package/dist/components/structural/Specialization.d.ts.map +1 -0
- package/dist/components/structural/Style.d.ts +43 -0
- package/dist/components/structural/Style.d.ts.map +1 -0
- package/dist/components/structural/SuccessCriteria.d.ts +96 -0
- package/dist/components/structural/SuccessCriteria.d.ts.map +1 -0
- package/dist/components/structural/Task.d.ts +60 -0
- package/dist/components/structural/Task.d.ts.map +1 -0
- package/dist/components/structural/Tone.d.ts +61 -0
- package/dist/components/structural/Tone.d.ts.map +1 -0
- package/dist/components/structural/When.d.ts +44 -0
- package/dist/components/structural/When.d.ts.map +1 -0
- package/dist/components/structural/WhenUncertain.d.ts +30 -0
- package/dist/components/structural/WhenUncertain.d.ts.map +1 -0
- package/dist/components/structural/index.d.ts +25 -0
- package/dist/components/structural/index.d.ts.map +1 -0
- package/dist/components/utility/Cwd.d.ts +10 -0
- package/dist/components/utility/Cwd.d.ts.map +1 -0
- package/dist/components/utility/DateTime.d.ts +22 -0
- package/dist/components/utility/DateTime.d.ts.map +1 -0
- package/dist/components/utility/Hostname.d.ts +10 -0
- package/dist/components/utility/Hostname.d.ts.map +1 -0
- package/dist/components/utility/Timestamp.d.ts +10 -0
- package/dist/components/utility/Timestamp.d.ts.map +1 -0
- package/dist/components/utility/UUID.d.ts +10 -0
- package/dist/components/utility/UUID.d.ts.map +1 -0
- package/dist/components/utility/Username.d.ts +10 -0
- package/dist/components/utility/Username.d.ts.map +1 -0
- package/dist/components/utility/index.d.ts +7 -0
- package/dist/components/utility/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/src/api.d.ts +38 -0
- package/dist/src/api.d.ts.map +1 -0
- package/dist/src/component.d.ts +112 -0
- package/dist/src/component.d.ts.map +1 -0
- package/dist/src/create-prompt.d.ts +118 -0
- package/dist/src/create-prompt.d.ts.map +1 -0
- package/dist/src/index.d.ts +39 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/jsx-runtime/index.d.ts +29 -0
- package/dist/src/jsx-runtime/index.d.ts.map +1 -0
- package/dist/src/jsx-runtime/jsx-dev-runtime.d.ts +26 -0
- package/dist/src/jsx-runtime/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/src/render.d.ts +19 -0
- package/dist/src/render.d.ts.map +1 -0
- package/dist/src/services/babel-plugins/index.d.ts +3 -0
- package/dist/src/services/babel-plugins/index.d.ts.map +1 -0
- package/dist/src/services/babel-plugins/name-hoisting.d.ts +8 -0
- package/dist/src/services/babel-plugins/name-hoisting.d.ts.map +1 -0
- package/dist/src/services/babel-plugins/uses-to-import.d.ts +16 -0
- package/dist/src/services/babel-plugins/uses-to-import.d.ts.map +1 -0
- package/dist/src/services/browser-support.d.ts +185 -0
- package/dist/src/services/browser-support.d.ts.map +1 -0
- package/dist/src/services/component-discovery.d.ts +42 -0
- package/dist/src/services/component-discovery.d.ts.map +1 -0
- package/dist/src/services/file-search-engine.d.ts +162 -0
- package/dist/src/services/file-search-engine.d.ts.map +1 -0
- package/dist/src/services/formula-parser.d.ts +9 -0
- package/dist/src/services/formula-parser.d.ts.map +1 -0
- package/dist/src/services/input-iterator.d.ts +54 -0
- package/dist/src/services/input-iterator.d.ts.map +1 -0
- package/dist/src/services/module-evaluator.d.ts +38 -0
- package/dist/src/services/module-evaluator.d.ts.map +1 -0
- package/dist/src/services/module-loader.d.ts +92 -0
- package/dist/src/services/module-loader.d.ts.map +1 -0
- package/dist/src/services/preprocessor.d.ts +39 -0
- package/dist/src/services/preprocessor.d.ts.map +1 -0
- package/dist/src/services/prop-validator.d.ts +21 -0
- package/dist/src/services/prop-validator.d.ts.map +1 -0
- package/dist/src/services/search-engine.d.ts +10 -0
- package/dist/src/services/search-engine.d.ts.map +1 -0
- package/dist/src/services/transformer.d.ts +19 -0
- package/dist/src/services/transformer.d.ts.map +1 -0
- package/dist/{index.d.ts → src/types/context.d.ts} +425 -458
- package/dist/src/types/context.d.ts.map +1 -0
- package/dist/src/types/element.d.ts +47 -0
- package/dist/src/types/element.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +10 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/input.d.ts +51 -0
- package/dist/src/types/input.d.ts.map +1 -0
- package/dist/src/types/module.d.ts +61 -0
- package/dist/src/types/module.d.ts.map +1 -0
- package/dist/src/types/render.d.ts +82 -0
- package/dist/src/types/render.d.ts.map +1 -0
- package/dist/src/types/search.d.ts +59 -0
- package/dist/src/types/search.d.ts.map +1 -0
- package/dist/src/types/symbols.d.ts +9 -0
- package/dist/src/types/symbols.d.ts.map +1 -0
- package/dist/src/utils/children.d.ts +29 -0
- package/dist/src/utils/children.d.ts.map +1 -0
- package/dist/src/utils/delimiter.d.ts +13 -0
- package/dist/src/utils/delimiter.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/jsx-dev-runtime.d.ts +0 -483
- package/dist/jsx-runtime/index.d.ts +0 -2
- package/dist/jsx-runtime/jsx-dev-runtime.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
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,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACtC,kBAAkB,CAUpB;AAgDD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAqCnD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/types/element.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,WAAW,GACX,QAAQ,EAAE,CAAC;AAEf;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACX,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACjD,CAAC,UAAU,SAAS,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,KAAK,QAAQ,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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, PromptConfig, EnvironmentContext, RenderContext, } from './context';
|
|
5
|
+
export { LLM_PROVIDERS, inferProviderFromModel, DEFAULT_ENVIRONMENT, createEnvironment, createRuntimeConfig, ensureRuntimeCacheReady, llmConfigSchema, outputConfigSchema, codeConfigSchema, userConfigSchema, runtimeConfigSchema, promptConfigSchema, environmentContextSchema, } from './context';
|
|
6
|
+
export type { RenderOptions, RenderResult, RenderSuccess, RenderFailure, RenderError, PostExecutionAction, ReviewFileAction, OpenUrlAction, RunCommandAction, } from './render';
|
|
7
|
+
export type { InputRequirement, ValidationResult, ValidationError, } from './input';
|
|
8
|
+
export type { SearchablePrompt, SearchOptions, SearchResult, SearchResultMatch, SearchEngineConfig, } from './search';
|
|
9
|
+
export type { PuptConfig, PuptLibrary, DiscoveredPrompt, LibraryLoadResult, PuptInitConfig, } from './module';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,YAAY,EACZ,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,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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: Array<{
|
|
39
|
+
field: string;
|
|
40
|
+
message: string;
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Validation error details
|
|
45
|
+
*/
|
|
46
|
+
export interface ValidationError {
|
|
47
|
+
field: string;
|
|
48
|
+
message: string;
|
|
49
|
+
code: string;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,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AAC;CACd"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { EnvironmentContext } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* Options for rendering a prompt
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderOptions {
|
|
6
|
+
trim?: boolean;
|
|
7
|
+
inputs?: Map<string, unknown> | Record<string, unknown>;
|
|
8
|
+
env?: EnvironmentContext;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A validation or runtime error encountered during rendering
|
|
12
|
+
*/
|
|
13
|
+
export interface RenderError {
|
|
14
|
+
/** Component class name or registry name, e.g. "Section" */
|
|
15
|
+
component: string;
|
|
16
|
+
/** The specific prop that failed validation, or null for cross-field/runtime errors */
|
|
17
|
+
prop: string | null;
|
|
18
|
+
/** Human-readable error message */
|
|
19
|
+
message: string;
|
|
20
|
+
/** Error code (Zod issue code or 'runtime_error' / 'missing_schema') */
|
|
21
|
+
code: string;
|
|
22
|
+
/** Path within the props object */
|
|
23
|
+
path: (string | number)[];
|
|
24
|
+
/** The value that was received */
|
|
25
|
+
received?: unknown;
|
|
26
|
+
/** The expected type or constraint */
|
|
27
|
+
expected?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Successful render result — no validation errors (may contain non-fatal warnings)
|
|
31
|
+
*/
|
|
32
|
+
export interface RenderSuccess {
|
|
33
|
+
ok: true;
|
|
34
|
+
text: string;
|
|
35
|
+
/** Non-fatal validation warnings (code: 'validation_warning') */
|
|
36
|
+
errors?: RenderError[];
|
|
37
|
+
postExecution: PostExecutionAction[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Failed render result — contains validation errors and best-effort output
|
|
41
|
+
*/
|
|
42
|
+
export interface RenderFailure {
|
|
43
|
+
ok: false;
|
|
44
|
+
/** Best-effort rendered output (children rendered as fallback for invalid components) */
|
|
45
|
+
text: string;
|
|
46
|
+
errors: RenderError[];
|
|
47
|
+
postExecution: PostExecutionAction[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Result of rendering a prompt — discriminated union on `ok`
|
|
51
|
+
*/
|
|
52
|
+
export type RenderResult = RenderSuccess | RenderFailure;
|
|
53
|
+
/**
|
|
54
|
+
* Actions to be executed after the LLM response
|
|
55
|
+
*/
|
|
56
|
+
export type PostExecutionAction = ReviewFileAction | OpenUrlAction | RunCommandAction;
|
|
57
|
+
/**
|
|
58
|
+
* Action to open a file for review in an editor
|
|
59
|
+
*/
|
|
60
|
+
export interface ReviewFileAction {
|
|
61
|
+
type: 'reviewFile';
|
|
62
|
+
file: string;
|
|
63
|
+
editor?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Action to open a URL in a browser
|
|
67
|
+
*/
|
|
68
|
+
export interface OpenUrlAction {
|
|
69
|
+
type: 'openUrl';
|
|
70
|
+
url: string;
|
|
71
|
+
browser?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Action to execute a shell command
|
|
75
|
+
*/
|
|
76
|
+
export interface RunCommandAction {
|
|
77
|
+
type: 'runCommand';
|
|
78
|
+
command: string;
|
|
79
|
+
cwd?: string;
|
|
80
|
+
env?: Record<string, string>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=render.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Aa,GAAG,aAAa,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,gBAAgB,GAChB,aAAa,GACb,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A prompt that can be indexed and searched
|
|
3
|
+
*/
|
|
4
|
+
export interface SearchablePrompt {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
tags: string[];
|
|
8
|
+
library: string;
|
|
9
|
+
content?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for searching prompts
|
|
13
|
+
*/
|
|
14
|
+
export interface SearchOptions {
|
|
15
|
+
query?: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
library?: string;
|
|
18
|
+
limit?: number;
|
|
19
|
+
offset?: number;
|
|
20
|
+
fuzzy?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A single search result with score
|
|
24
|
+
*/
|
|
25
|
+
export interface SearchResult {
|
|
26
|
+
prompt: SearchablePrompt;
|
|
27
|
+
score: number;
|
|
28
|
+
matches: SearchResultMatch[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A match within a search result
|
|
32
|
+
*/
|
|
33
|
+
export interface SearchResultMatch {
|
|
34
|
+
field: string;
|
|
35
|
+
indices: number[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for the search engine
|
|
39
|
+
*/
|
|
40
|
+
export interface SearchEngineConfig {
|
|
41
|
+
/** Minimum score threshold for results (default: 0.3) */
|
|
42
|
+
threshold?: number;
|
|
43
|
+
/** Field weights for scoring (default: name=3, tags=2, description=1.5, content=1) */
|
|
44
|
+
weights?: {
|
|
45
|
+
name?: number;
|
|
46
|
+
description?: number;
|
|
47
|
+
tags?: number;
|
|
48
|
+
content?: number;
|
|
49
|
+
};
|
|
50
|
+
/** Enable fuzzy matching for typo tolerance (default: true) */
|
|
51
|
+
fuzzy?: boolean;
|
|
52
|
+
/** Fuzzy tolerance level 0-1 (default: 0.2 = 20% typo tolerance) */
|
|
53
|
+
fuzziness?: number;
|
|
54
|
+
/** Enable prefix matching - "ref" matches "refactoring" (default: true) */
|
|
55
|
+
prefix?: boolean;
|
|
56
|
+
/** How to combine multiple search terms: 'AND' or 'OR' (default: 'AND') */
|
|
57
|
+
combineWith?: 'AND' | 'OR';
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/types/search.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Symbol for element type */
|
|
2
|
+
export declare const TYPE: unique symbol;
|
|
3
|
+
/** Symbol for element props */
|
|
4
|
+
export declare const PROPS: unique symbol;
|
|
5
|
+
/** Symbol for element children */
|
|
6
|
+
export declare const CHILDREN: unique symbol;
|
|
7
|
+
/** Marker for identifying deferred references (used in future phases) */
|
|
8
|
+
export declare const DEFERRED_REF: unique symbol;
|
|
9
|
+
//# sourceMappingURL=symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../../src/types/symbols.ts"],"names":[],"mappings":"AAEA,8BAA8B;AAC9B,eAAO,MAAM,IAAI,eAA0B,CAAC;AAE5C,+BAA+B;AAC/B,eAAO,MAAM,KAAK,eAA2B,CAAC;AAE9C,kCAAkC;AAClC,eAAO,MAAM,QAAQ,eAA8B,CAAC;AAEpD,yEAAyE;AACzE,eAAO,MAAM,YAAY,eAAiC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PuptNode, PuptElement, ComponentType } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a PuptElement matches a given type (class reference or string name).
|
|
4
|
+
*
|
|
5
|
+
* @param element - The element to check
|
|
6
|
+
* @param type - A component class/function reference, or a string name
|
|
7
|
+
* @returns true if the element matches the given type
|
|
8
|
+
*/
|
|
9
|
+
export declare function isElementOfType(element: PuptElement, type: ComponentType | string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Find all children that match a given type.
|
|
12
|
+
* Searches through Fragments transparently.
|
|
13
|
+
*
|
|
14
|
+
* @param children - The children to search (PuptNode - can be array, element, string, etc.)
|
|
15
|
+
* @param type - A component class/function reference, or a string name
|
|
16
|
+
* @returns Array of matching PuptElements
|
|
17
|
+
*/
|
|
18
|
+
export declare function findChildrenOfType(children: PuptNode, type: ComponentType | string): PuptElement[];
|
|
19
|
+
/**
|
|
20
|
+
* Partition children into two groups: those matching the type and the rest.
|
|
21
|
+
* Unlike findChildrenOfType, this does not unwrap Fragments - it operates
|
|
22
|
+
* on the direct children array.
|
|
23
|
+
*
|
|
24
|
+
* @param children - Array of children to partition
|
|
25
|
+
* @param type - A component class/function reference, or a string name
|
|
26
|
+
* @returns Tuple of [matching elements, non-matching nodes]
|
|
27
|
+
*/
|
|
28
|
+
export declare function partitionChildren(children: PuptNode[], type: ComponentType | string): [PuptElement[], PuptNode[]];
|
|
29
|
+
//# sourceMappingURL=children.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../src/utils/children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKrE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,aAAa,GAAG,MAAM,GAC3B,OAAO,CAaT;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,aAAa,GAAG,MAAM,GAC3B,WAAW,EAAE,CAIf;AA2CD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,EAAE,EACpB,IAAI,EAAE,aAAa,GAAG,MAAM,GAC3B,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,CAa7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PuptNode } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Wrap content with a delimiter (XML tags, markdown header, or none).
|
|
4
|
+
* This is the shared utility that replaces the duplicated switch(delimiter)
|
|
5
|
+
* logic across structural components.
|
|
6
|
+
*
|
|
7
|
+
* @param content - The content to wrap (string or array of PuptNode)
|
|
8
|
+
* @param tag - The tag/heading name to use
|
|
9
|
+
* @param delimiter - The delimiter style: 'xml', 'markdown', or 'none'
|
|
10
|
+
* @returns The wrapped content as a PuptNode
|
|
11
|
+
*/
|
|
12
|
+
export declare function wrapWithDelimiter(content: PuptNode, tag: string, delimiter: 'xml' | 'markdown' | 'none'): PuptNode;
|
|
13
|
+
//# sourceMappingURL=delimiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delimiter.d.ts","sourceRoot":"","sources":["../../../src/utils/delimiter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,QAAQ,EACjB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,KAAK,GAAG,UAAU,GAAG,MAAM,GACrC,QAAQ,CASV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pupt-lib",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "TypeScript library for creating AI prompts using JSX syntax",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"type": "module",
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
39
|
-
"types": "./dist/index.d.ts",
|
|
39
|
+
"types": "./dist/src/index.d.ts",
|
|
40
40
|
"import": "./dist/index.js"
|
|
41
41
|
},
|
|
42
42
|
"./jsx-runtime": {
|
|
43
|
-
"types": "./dist/jsx-runtime/index.d.ts",
|
|
43
|
+
"types": "./dist/src/jsx-runtime/index.d.ts",
|
|
44
44
|
"import": "./dist/jsx-runtime/index.js"
|
|
45
45
|
},
|
|
46
46
|
"./jsx-dev-runtime": {
|
|
47
|
-
"types": "./dist/jsx-runtime/jsx-dev-runtime.d.ts",
|
|
47
|
+
"types": "./dist/src/jsx-runtime/jsx-dev-runtime.d.ts",
|
|
48
48
|
"import": "./dist/jsx-runtime/jsx-dev-runtime.js"
|
|
49
49
|
}
|
|
50
50
|
},
|