@mano8/astro-prompt-m8 0.1.0-alpha.1

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.
Files changed (163) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +116 -0
  3. package/dist/src/integration.d.ts +42 -0
  4. package/dist/src/integration.d.ts.map +1 -0
  5. package/dist/src/integration.js +86 -0
  6. package/dist/src/integration.js.map +1 -0
  7. package/dist/src/lib/csp.d.ts +25 -0
  8. package/dist/src/lib/csp.d.ts.map +1 -0
  9. package/dist/src/lib/csp.js +53 -0
  10. package/dist/src/lib/csp.js.map +1 -0
  11. package/dist/src/middleware.d.ts +4 -0
  12. package/dist/src/middleware.d.ts.map +1 -0
  13. package/dist/src/middleware.js +24 -0
  14. package/dist/src/middleware.js.map +1 -0
  15. package/dist/src/runtime/api/admin.d.ts +15 -0
  16. package/dist/src/runtime/api/admin.d.ts.map +1 -0
  17. package/dist/src/runtime/api/admin.js +39 -0
  18. package/dist/src/runtime/api/admin.js.map +1 -0
  19. package/dist/src/runtime/api/blocks.d.ts +24 -0
  20. package/dist/src/runtime/api/blocks.d.ts.map +1 -0
  21. package/dist/src/runtime/api/blocks.js +74 -0
  22. package/dist/src/runtime/api/blocks.js.map +1 -0
  23. package/dist/src/runtime/api/categories.d.ts +7 -0
  24. package/dist/src/runtime/api/categories.d.ts.map +1 -0
  25. package/dist/src/runtime/api/categories.js +49 -0
  26. package/dist/src/runtime/api/categories.js.map +1 -0
  27. package/dist/src/runtime/api/dashboard.d.ts +6 -0
  28. package/dist/src/runtime/api/dashboard.d.ts.map +1 -0
  29. package/dist/src/runtime/api/dashboard.js +21 -0
  30. package/dist/src/runtime/api/dashboard.js.map +1 -0
  31. package/dist/src/runtime/api/index.d.ts +46 -0
  32. package/dist/src/runtime/api/index.d.ts.map +1 -0
  33. package/dist/src/runtime/api/index.js +48 -0
  34. package/dist/src/runtime/api/index.js.map +1 -0
  35. package/dist/src/runtime/api/internal.server.d.ts +18 -0
  36. package/dist/src/runtime/api/internal.server.d.ts.map +1 -0
  37. package/dist/src/runtime/api/internal.server.js +43 -0
  38. package/dist/src/runtime/api/internal.server.js.map +1 -0
  39. package/dist/src/runtime/api/templates.d.ts +14 -0
  40. package/dist/src/runtime/api/templates.d.ts.map +1 -0
  41. package/dist/src/runtime/api/templates.js +108 -0
  42. package/dist/src/runtime/api/templates.js.map +1 -0
  43. package/dist/src/runtime/authAdapter.d.ts +48 -0
  44. package/dist/src/runtime/authAdapter.d.ts.map +1 -0
  45. package/dist/src/runtime/authAdapter.js +62 -0
  46. package/dist/src/runtime/authAdapter.js.map +1 -0
  47. package/dist/src/runtime/client.d.ts +24 -0
  48. package/dist/src/runtime/client.d.ts.map +1 -0
  49. package/dist/src/runtime/client.js +85 -0
  50. package/dist/src/runtime/client.js.map +1 -0
  51. package/dist/src/runtime/compatibility.d.ts +32 -0
  52. package/dist/src/runtime/compatibility.d.ts.map +1 -0
  53. package/dist/src/runtime/compatibility.js +97 -0
  54. package/dist/src/runtime/compatibility.js.map +1 -0
  55. package/dist/src/runtime/config.d.ts +16 -0
  56. package/dist/src/runtime/config.d.ts.map +1 -0
  57. package/dist/src/runtime/config.js +22 -0
  58. package/dist/src/runtime/config.js.map +1 -0
  59. package/dist/src/runtime/errors.d.ts +23 -0
  60. package/dist/src/runtime/errors.d.ts.map +1 -0
  61. package/dist/src/runtime/errors.js +50 -0
  62. package/dist/src/runtime/errors.js.map +1 -0
  63. package/dist/src/runtime/hooks/index.d.ts +9 -0
  64. package/dist/src/runtime/hooks/index.d.ts.map +1 -0
  65. package/dist/src/runtime/hooks/index.js +9 -0
  66. package/dist/src/runtime/hooks/index.js.map +1 -0
  67. package/dist/src/runtime/hooks/useComposePrompt.d.ts +13 -0
  68. package/dist/src/runtime/hooks/useComposePrompt.d.ts.map +1 -0
  69. package/dist/src/runtime/hooks/useComposePrompt.js +17 -0
  70. package/dist/src/runtime/hooks/useComposePrompt.js.map +1 -0
  71. package/dist/src/runtime/hooks/usePromptAdmin.d.ts +10 -0
  72. package/dist/src/runtime/hooks/usePromptAdmin.d.ts.map +1 -0
  73. package/dist/src/runtime/hooks/usePromptAdmin.js +33 -0
  74. package/dist/src/runtime/hooks/usePromptAdmin.js.map +1 -0
  75. package/dist/src/runtime/hooks/usePromptBlock.d.ts +18 -0
  76. package/dist/src/runtime/hooks/usePromptBlock.d.ts.map +1 -0
  77. package/dist/src/runtime/hooks/usePromptBlock.js +25 -0
  78. package/dist/src/runtime/hooks/usePromptBlock.js.map +1 -0
  79. package/dist/src/runtime/hooks/usePromptBlocks.d.ts +22 -0
  80. package/dist/src/runtime/hooks/usePromptBlocks.d.ts.map +1 -0
  81. package/dist/src/runtime/hooks/usePromptBlocks.js +53 -0
  82. package/dist/src/runtime/hooks/usePromptBlocks.js.map +1 -0
  83. package/dist/src/runtime/hooks/usePromptCategories.d.ts +20 -0
  84. package/dist/src/runtime/hooks/usePromptCategories.d.ts.map +1 -0
  85. package/dist/src/runtime/hooks/usePromptCategories.js +53 -0
  86. package/dist/src/runtime/hooks/usePromptCategories.js.map +1 -0
  87. package/dist/src/runtime/hooks/usePromptDashboard.d.ts +13 -0
  88. package/dist/src/runtime/hooks/usePromptDashboard.d.ts.map +1 -0
  89. package/dist/src/runtime/hooks/usePromptDashboard.js +11 -0
  90. package/dist/src/runtime/hooks/usePromptDashboard.js.map +1 -0
  91. package/dist/src/runtime/hooks/usePromptTemplate.d.ts +33 -0
  92. package/dist/src/runtime/hooks/usePromptTemplate.d.ts.map +1 -0
  93. package/dist/src/runtime/hooks/usePromptTemplate.js +43 -0
  94. package/dist/src/runtime/hooks/usePromptTemplate.js.map +1 -0
  95. package/dist/src/runtime/hooks/usePromptTemplates.d.ts +37 -0
  96. package/dist/src/runtime/hooks/usePromptTemplates.d.ts.map +1 -0
  97. package/dist/src/runtime/hooks/usePromptTemplates.js +106 -0
  98. package/dist/src/runtime/hooks/usePromptTemplates.js.map +1 -0
  99. package/dist/src/runtime/listParams.d.ts +27 -0
  100. package/dist/src/runtime/listParams.d.ts.map +1 -0
  101. package/dist/src/runtime/listParams.js +67 -0
  102. package/dist/src/runtime/listParams.js.map +1 -0
  103. package/dist/src/runtime/queryKeys.d.ts +25 -0
  104. package/dist/src/runtime/queryKeys.d.ts.map +1 -0
  105. package/dist/src/runtime/queryKeys.js +29 -0
  106. package/dist/src/runtime/queryKeys.js.map +1 -0
  107. package/dist/src/runtime/react/AdminPromptPanel.d.ts +21 -0
  108. package/dist/src/runtime/react/AdminPromptPanel.d.ts.map +1 -0
  109. package/dist/src/runtime/react/AdminPromptPanel.js +53 -0
  110. package/dist/src/runtime/react/AdminPromptPanel.js.map +1 -0
  111. package/dist/src/runtime/react/PromptBlockLibrary.d.ts +36 -0
  112. package/dist/src/runtime/react/PromptBlockLibrary.d.ts.map +1 -0
  113. package/dist/src/runtime/react/PromptBlockLibrary.js +122 -0
  114. package/dist/src/runtime/react/PromptBlockLibrary.js.map +1 -0
  115. package/dist/src/runtime/react/PromptComposer.d.ts +24 -0
  116. package/dist/src/runtime/react/PromptComposer.d.ts.map +1 -0
  117. package/dist/src/runtime/react/PromptComposer.js +48 -0
  118. package/dist/src/runtime/react/PromptComposer.js.map +1 -0
  119. package/dist/src/runtime/react/PromptProvider.d.ts +16 -0
  120. package/dist/src/runtime/react/PromptProvider.d.ts.map +1 -0
  121. package/dist/src/runtime/react/PromptProvider.js +79 -0
  122. package/dist/src/runtime/react/PromptProvider.js.map +1 -0
  123. package/dist/src/runtime/react/PromptQueryProvider.d.ts +8 -0
  124. package/dist/src/runtime/react/PromptQueryProvider.d.ts.map +1 -0
  125. package/dist/src/runtime/react/PromptQueryProvider.js +11 -0
  126. package/dist/src/runtime/react/PromptQueryProvider.js.map +1 -0
  127. package/dist/src/runtime/react/PromptTemplateEditor.d.ts +36 -0
  128. package/dist/src/runtime/react/PromptTemplateEditor.d.ts.map +1 -0
  129. package/dist/src/runtime/react/PromptTemplateEditor.js +141 -0
  130. package/dist/src/runtime/react/PromptTemplateEditor.js.map +1 -0
  131. package/dist/src/runtime/react/RequireSuperuser.d.ts +7 -0
  132. package/dist/src/runtime/react/RequireSuperuser.d.ts.map +1 -0
  133. package/dist/src/runtime/react/RequireSuperuser.js +10 -0
  134. package/dist/src/runtime/react/RequireSuperuser.js.map +1 -0
  135. package/dist/src/runtime/react/default-ui/index.d.ts +17 -0
  136. package/dist/src/runtime/react/default-ui/index.d.ts.map +1 -0
  137. package/dist/src/runtime/react/default-ui/index.js +23 -0
  138. package/dist/src/runtime/react/default-ui/index.js.map +1 -0
  139. package/dist/src/runtime/react/index.d.ts +8 -0
  140. package/dist/src/runtime/react/index.d.ts.map +1 -0
  141. package/dist/src/runtime/react/index.js +8 -0
  142. package/dist/src/runtime/react/index.js.map +1 -0
  143. package/dist/src/runtime/routes.d.ts +17 -0
  144. package/dist/src/runtime/routes.d.ts.map +1 -0
  145. package/dist/src/runtime/routes.js +33 -0
  146. package/dist/src/runtime/routes.js.map +1 -0
  147. package/dist/src/runtime/schemas.d.ts +286 -0
  148. package/dist/src/runtime/schemas.d.ts.map +1 -0
  149. package/dist/src/runtime/schemas.js +172 -0
  150. package/dist/src/runtime/schemas.js.map +1 -0
  151. package/package.json +99 -0
  152. package/registry/r/admin-prompt-dashboard.json +23 -0
  153. package/registry/r/prompt-block-editor.json +20 -0
  154. package/registry/r/prompt-dashboard-overview.json +22 -0
  155. package/registry/r/prompt-maintenance-panel.json +23 -0
  156. package/registry/r/prompt-template-editor.json +20 -0
  157. package/registry/r/registry.json +37 -0
  158. package/registry.json +86 -0
  159. package/src/routes/admin/prompts.astro +11 -0
  160. package/src/routes/blocks.astro +11 -0
  161. package/src/routes/composer.astro +12 -0
  162. package/src/routes/templates.astro +11 -0
  163. package/src/scaffold/styles/prompt.css +9 -0
@@ -0,0 +1,141 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { usePromptBlocks } from "../hooks/usePromptBlocks.js";
4
+ import { usePromptTemplates } from "../hooks/usePromptTemplates.js";
5
+ import { useComposePrompt } from "../hooks/useComposePrompt.js";
6
+ const DEFAULT_LABELS = {
7
+ title: "Prompt templates",
8
+ subtitle: "Compose reusable templates from prompt blocks.",
9
+ create: "New template",
10
+ name: "Name",
11
+ description: "Description",
12
+ publicLabel: "Public",
13
+ save: "Save",
14
+ cancel: "Cancel",
15
+ loading: "Loading…",
16
+ empty: "No templates yet.",
17
+ error: "Could not load templates.",
18
+ edit: "Edit",
19
+ deleteLabel: "Delete",
20
+ confirmDelete: "Delete this template and its blocks?",
21
+ blocks: "Blocks",
22
+ addBlock: "Add block",
23
+ noBlocksAvailable: "All blocks already attached, or no blocks exist.",
24
+ removeBlock: "Remove",
25
+ moveUp: "Up",
26
+ moveDown: "Down",
27
+ compose: "Compose",
28
+ composeLabel: "Compose this template",
29
+ composed: "Composed prompt",
30
+ composing: "Composing…",
31
+ composingError: "Could not compose template.",
32
+ dynamicFor: "Dynamic content for",
33
+ dynamicPlaceholder: "Optional dynamic content for this block…",
34
+ noDynamic: "This template has no dynamic blocks."
35
+ };
36
+ const EMPTY_DRAFT = { name: "", description: "", is_public: false };
37
+ export function PromptTemplateEditor({ labels }) {
38
+ const t = { ...DEFAULT_LABELS, ...labels };
39
+ const templates = usePromptTemplates();
40
+ const blocks = usePromptBlocks();
41
+ const [draft, setDraft] = React.useState(null);
42
+ const [expandedId, setExpandedId] = React.useState(null);
43
+ const [composeError, setComposeError] = React.useState(null);
44
+ const [composerId, setComposerId] = React.useState(null);
45
+ const [composerDynamic, setComposerDynamic] = React.useState({});
46
+ const { compose, composeMutation } = useComposePrompt();
47
+ React.useEffect(() => {
48
+ void templates.refresh();
49
+ void blocks.refresh();
50
+ }, [templates.refresh, blocks.refresh]);
51
+ const selectedTemplate = templates.data?.data.find((tpl) => tpl.id === expandedId) ?? null;
52
+ const startCreate = () => {
53
+ setDraft({ ...EMPTY_DRAFT });
54
+ };
55
+ const startEdit = (template) => {
56
+ setDraft({
57
+ id: template.id,
58
+ name: template.name,
59
+ description: template.description ?? "",
60
+ is_public: template.is_public
61
+ });
62
+ setExpandedId(template.id);
63
+ };
64
+ const save = async () => {
65
+ if (!draft)
66
+ return;
67
+ const body = {
68
+ name: draft.name,
69
+ description: draft.description || null,
70
+ is_public: draft.is_public
71
+ };
72
+ if (draft.id !== undefined) {
73
+ await templates.updateMutation.mutateAsync({ templateId: draft.id, body });
74
+ }
75
+ else {
76
+ await templates.createMutation.mutateAsync(body);
77
+ }
78
+ setDraft(null);
79
+ };
80
+ const remove = async (id) => {
81
+ if (!window.confirm(t.confirmDelete))
82
+ return;
83
+ await templates.deleteMutation.mutateAsync(id);
84
+ if (expandedId === id)
85
+ setExpandedId(null);
86
+ };
87
+ const availableToAdd = (templateId) => {
88
+ const tpl = templates.data?.data.find((item) => item.id === templateId);
89
+ const used = new Set((tpl?.blocks ?? []).map((b) => b.block_id));
90
+ return (blocks.data?.data ?? []).filter((b) => !used.has(b.id));
91
+ };
92
+ return (_jsxs("section", { className: "not-content space-y-6", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "text-xl font-semibold tracking-tight", children: t.title }), _jsx("p", { className: "text-sm text-muted-foreground", children: t.subtitle })] }), _jsx("button", { type: "button", className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", onClick: startCreate, children: t.create })] }), draft ? (_jsxs("form", { className: "space-y-3 rounded-md border bg-card p-4", onSubmit: (e) => {
93
+ e.preventDefault();
94
+ void save();
95
+ }, children: [_jsxs("label", { className: "block space-y-1 text-sm", children: [_jsx("span", { className: "font-medium", children: t.name }), _jsx("input", { className: "w-full rounded-md border bg-background px-3 py-2", value: draft.name, onChange: (e) => setDraft({ ...draft, name: e.target.value }), required: true })] }), _jsxs("label", { className: "block space-y-1 text-sm", children: [_jsx("span", { className: "font-medium", children: t.description }), _jsx("input", { className: "w-full rounded-md border bg-background px-3 py-2", value: draft.description, onChange: (e) => setDraft({ ...draft, description: e.target.value }) })] }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "checkbox", checked: draft.is_public, onChange: (e) => setDraft({ ...draft, is_public: e.target.checked }) }), _jsx("span", { className: "font-medium", children: t.publicLabel })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "submit", className: "rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50", disabled: templates.createMutation.isPending || templates.updateMutation.isPending, children: t.save }), _jsx("button", { type: "button", className: "rounded-md border px-4 py-2 text-sm font-medium", onClick: () => setDraft(null), children: t.cancel })] })] })) : null, templates.loading && !templates.data ? (_jsx("p", { className: "text-sm", children: t.loading })) : null, templates.error && !templates.data ? (_jsx("p", { role: "alert", className: "text-sm text-destructive", children: t.error })) : null, _jsxs("ul", { className: "divide-y rounded-md border", children: [(templates.data?.data ?? []).map((tpl) => {
96
+ const open = expandedId === tpl.id;
97
+ const canAdd = availableToAdd(tpl.id);
98
+ return (_jsxs("li", { className: "p-4", children: [_jsxs("div", { className: "flex flex-wrap items-baseline justify-between gap-2", children: [_jsxs("div", { className: "space-y-0.5", children: [_jsx("h3", { className: "text-sm font-semibold", children: tpl.name }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [tpl.blocks.length, " \u00B7 ", tpl.is_public ? t.publicLabel : ""] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", className: "rounded-md border px-3 py-1 text-xs font-medium", onClick: () => setExpandedId(open ? null : tpl.id), children: t.edit }), _jsx("button", { type: "button", className: "rounded-md border px-3 py-1 text-xs font-medium text-destructive", disabled: templates.deleteMutation.isPending, onClick: () => void remove(tpl.id), children: t.deleteLabel })] })] }), open ? (_jsxs("div", { className: "mt-4 space-y-4", children: [tpl.blocks.length > 0 ? (_jsx("ol", { className: "space-y-2", children: tpl.blocks.map((block, index) => (_jsxs("li", { className: "flex items-start gap-2 rounded-md border p-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("button", { type: "button", className: "rounded border px-2 py-0.5 text-xs disabled:opacity-50", disabled: index === 0 || templates.setPositionMutation.isPending, onClick: () => templates.setPositionMutation.mutate({
99
+ templateId: tpl.id,
100
+ blockId: block.block_id,
101
+ position: block.position - 1
102
+ }), children: t.moveUp }), _jsx("button", { type: "button", className: "rounded border px-2 py-0.5 text-xs disabled:opacity-50", disabled: index === tpl.blocks.length - 1 ||
103
+ templates.setPositionMutation.isPending, onClick: () => templates.setPositionMutation.mutate({
104
+ templateId: tpl.id,
105
+ blockId: block.block_id,
106
+ position: block.position + 1
107
+ }), children: t.moveDown })] }), _jsxs("div", { className: "flex-1 space-y-0.5", children: [_jsx("p", { className: "text-sm font-medium", children: block.name }), _jsxs("p", { className: "text-xs text-muted-foreground", children: [block.type, " \u00B7 position ", block.position] }), _jsx("pre", { className: "whitespace-pre-wrap text-xs text-muted-foreground", children: block.content })] }), _jsx("button", { type: "button", className: "rounded-md border px-2 py-1 text-xs font-medium text-destructive disabled:opacity-50", disabled: templates.removeBlockMutation.isPending, onClick: () => templates.removeBlockMutation.mutate({
108
+ templateId: tpl.id,
109
+ blockId: block.block_id
110
+ }), children: t.removeBlock })] }, block.id))) })) : (_jsx("p", { className: "text-xs text-muted-foreground", children: t.noBlocksAvailable })), _jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-sm font-medium", children: t.addBlock }), canAdd.length ? (_jsx("ul", { className: "flex flex-wrap gap-2", children: canAdd.map((block) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "rounded-md border px-3 py-1 text-xs font-medium disabled:opacity-50", disabled: templates.addBlockMutation.isPending, onClick: () => templates.addBlockMutation.mutate({
111
+ templateId: tpl.id,
112
+ blockId: block.id,
113
+ position: 0
114
+ }), children: ["+ ", block.name] }) }, block.id))) })) : (_jsx("p", { className: "text-xs text-muted-foreground", children: t.noBlocksAvailable }))] }), _jsxs("div", { className: "space-y-2 border-t pt-3", children: [_jsx("h4", { className: "text-sm font-medium", children: t.composeLabel }), _jsx(ComposeInline, { templateId: tpl.id, blocks: tpl.blocks, t: t, composing: composerId === tpl.id, onStart: () => {
115
+ setComposerId(tpl.id);
116
+ setComposeError(null);
117
+ setComposerDynamic({});
118
+ }, onField: (blockId, value) => setComposerDynamic((current) => ({ ...current, [blockId]: value })), fields: composerDynamic, onCompose: async () => {
119
+ try {
120
+ await compose(tpl.id, tpl.blocks
121
+ .filter((b) => b.is_dynamic && (composerDynamic[b.block_id] ?? "").trim() !== "")
122
+ .map((b) => ({
123
+ id: b.block_id,
124
+ content: composerDynamic[b.block_id] ?? ""
125
+ })));
126
+ }
127
+ catch {
128
+ setComposeError(t.composingError);
129
+ }
130
+ }, composeResult: composerId === tpl.id ? composeMutation.data?.content ?? null : null, error: composerId === tpl.id ? composeError : null, busy: composerId === tpl.id && composeMutation.isPending })] })] })) : null] }, tpl.id));
131
+ }), (templates.data?.data ?? []).length === 0 && !templates.loading && !templates.error ? (_jsx("li", { className: "p-6 text-center text-sm text-muted-foreground", children: t.empty })) : null] })] }));
132
+ }
133
+ function ComposeInline({ templateId, blocks, t, composing, onStart, onField, fields, onCompose, composeResult, error, busy }) {
134
+ const dynamic = blocks.filter((b) => b.is_dynamic);
135
+ void templateId;
136
+ if (!composing) {
137
+ return (_jsx("button", { type: "button", className: "rounded-md bg-primary px-3 py-1 text-sm font-medium text-primary-foreground", onClick: onStart, children: t.compose }));
138
+ }
139
+ return (_jsxs("div", { className: "space-y-3", children: [dynamic.length === 0 ? (_jsx("p", { className: "text-xs text-muted-foreground", children: t.noDynamic })) : (dynamic.map((b) => (_jsxs("label", { className: "block space-y-1 text-sm", children: [_jsxs("span", { className: "font-medium", children: [t.dynamicFor, ": ", b.name] }), _jsx("textarea", { className: "w-full rounded-md border bg-background px-3 py-2", rows: 2, value: fields[b.block_id] ?? "", placeholder: t.dynamicPlaceholder, onChange: (e) => onField(b.block_id, e.target.value) })] }, b.block_id)))), _jsx("button", { type: "button", className: "rounded-md bg-primary px-3 py-1 text-sm font-medium text-primary-foreground disabled:opacity-50", disabled: busy, onClick: onCompose, children: busy ? t.composing : t.compose }), error ? (_jsx("p", { role: "alert", className: "text-xs text-destructive", children: error })) : null, composeResult ? (_jsx("pre", { className: "whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs", children: composeResult })) : null] }));
140
+ }
141
+ //# sourceMappingURL=PromptTemplateEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptTemplateEditor.js","sourceRoot":"","sources":["../../../../src/runtime/react/PromptTemplateEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAkChE,MAAM,cAAc,GAA+B;IACjD,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,gDAAgD;IAC1D,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,QAAQ;IACrB,aAAa,EAAE,sCAAsC;IACrD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,WAAW;IACrB,iBAAiB,EAAE,kDAAkD;IACrE,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,uBAAuB;IACrC,QAAQ,EAAE,iBAAiB;IAC3B,SAAS,EAAE,YAAY;IACvB,cAAc,EAAE,6BA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ACjD,KAAK,GACJ,CACL,CAAC,CAAC,CAAC,IAAI,EACP,aAAa,CAAC,CAAC,CAAC,CACf,cAAK,SAAS,EAAC,+DAA+D,YAC3E,aAAa,GACV,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ /** Render children only when the auth adapter reports a superuser. */
3
+ export declare function RequireSuperuser({ children, fallback }: {
4
+ children: ReactNode;
5
+ fallback?: ReactNode;
6
+ }): import("react").JSX.Element | null;
7
+ //# sourceMappingURL=RequireSuperuser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequireSuperuser.d.ts","sourceRoot":"","sources":["../../../../src/runtime/react/RequireSuperuser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAe,EAChB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,sCAIA"}
@@ -0,0 +1,10 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { usePromptContext } from "./PromptProvider.js";
3
+ /** Render children only when the auth adapter reports a superuser. */
4
+ export function RequireSuperuser({ children, fallback = null }) {
5
+ const { isSuperuser, loading } = usePromptContext();
6
+ if (loading)
7
+ return null;
8
+ return _jsx(_Fragment, { children: isSuperuser ? children : fallback });
9
+ }
10
+ //# sourceMappingURL=RequireSuperuser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequireSuperuser.js","sourceRoot":"","sources":["../../../../src/runtime/react/RequireSuperuser.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,GAAG,IAAI,EAIhB;IACC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACpD,IAAI,OAAO;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,4BAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAI,CAAC;AAClD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PromptRuntimeConfig } from "../../config.js";
2
+ type ViewConfig = Partial<PromptRuntimeConfig>;
3
+ export declare function BlocksView({ config }: {
4
+ config?: ViewConfig;
5
+ }): import("react").JSX.Element;
6
+ export declare function TemplatesView({ config }: {
7
+ config?: ViewConfig;
8
+ }): import("react").JSX.Element;
9
+ export declare function ComposerView({ config, templateId }: {
10
+ config?: ViewConfig;
11
+ templateId?: number;
12
+ }): import("react").JSX.Element;
13
+ export declare function AdminPromptView({ config }: {
14
+ config?: ViewConfig;
15
+ }): import("react").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/react/default-ui/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,KAAK,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAU/C,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,+BAM7D;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,+BAMhE;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,+BAMhG;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,+BAMlE"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PromptProvider } from "../PromptProvider.js";
3
+ import { PromptQueryProvider } from "../PromptQueryProvider.js";
4
+ import { AdminPromptPanel } from "../AdminPromptPanel.js";
5
+ import { PromptBlockLibrary } from "../PromptBlockLibrary.js";
6
+ import { PromptTemplateEditor } from "../PromptTemplateEditor.js";
7
+ import { PromptComposer } from "../PromptComposer.js";
8
+ function Shell({ config, children }) {
9
+ return (_jsx(PromptQueryProvider, { children: _jsx(PromptProvider, { config: config, children: children }) }));
10
+ }
11
+ export function BlocksView({ config }) {
12
+ return (_jsx(Shell, { config: config, children: _jsx(PromptBlockLibrary, {}) }));
13
+ }
14
+ export function TemplatesView({ config }) {
15
+ return (_jsx(Shell, { config: config, children: _jsx(PromptTemplateEditor, {}) }));
16
+ }
17
+ export function ComposerView({ config, templateId }) {
18
+ return (_jsx(Shell, { config: config, children: _jsx(PromptComposer, { templateId: templateId }) }));
19
+ }
20
+ export function AdminPromptView({ config }) {
21
+ return (_jsx(Shell, { config: config, children: _jsx(AdminPromptPanel, {}) }));
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/runtime/react/default-ui/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,SAAS,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAgD;IAC/E,OAAO,CACL,KAAC,mBAAmB,cAClB,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,YAAG,QAAQ,GAAkB,GACvC,CACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAA2B;IAC5D,OAAO,CACL,KAAC,KAAK,IAAC,MAAM,EAAE,MAAM,YACnB,KAAC,kBAAkB,KAAG,GAChB,CACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAA2B;IAC/D,OAAO,CACL,KAAC,KAAK,IAAC,MAAM,EAAE,MAAM,YACnB,KAAC,oBAAoB,KAAG,GAClB,CACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,EAAgD;IAC/F,OAAO,CACL,KAAC,KAAK,IAAC,MAAM,EAAE,MAAM,YACnB,KAAC,cAAc,IAAC,UAAU,EAAE,UAAU,GAAI,GACpC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAE,MAAM,EAA2B;IACjE,OAAO,CACL,KAAC,KAAK,IAAC,MAAM,EAAE,MAAM,YACnB,KAAC,gBAAgB,KAAG,GACd,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { PromptQueryProvider, type PromptQueryProviderProps } from "./PromptQueryProvider.js";
2
+ export { PromptProvider, usePromptContext, type PromptContextValue } from "./PromptProvider.js";
3
+ export { RequireSuperuser } from "./RequireSuperuser.js";
4
+ export { PromptBlockLibrary } from "./PromptBlockLibrary.js";
5
+ export { PromptTemplateEditor } from "./PromptTemplateEditor.js";
6
+ export { PromptComposer } from "./PromptComposer.js";
7
+ export { AdminPromptPanel } from "./AdminPromptPanel.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/runtime/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { PromptQueryProvider } from "./PromptQueryProvider.js";
2
+ export { PromptProvider, usePromptContext } from "./PromptProvider.js";
3
+ export { RequireSuperuser } from "./RequireSuperuser.js";
4
+ export { PromptBlockLibrary } from "./PromptBlockLibrary.js";
5
+ export { PromptTemplateEditor } from "./PromptTemplateEditor.js";
6
+ export { PromptComposer } from "./PromptComposer.js";
7
+ export { AdminPromptPanel } from "./AdminPromptPanel.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/runtime/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiC,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAA2B,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type PromptRouteFragments = {
2
+ base?: string;
3
+ blocks?: string | false;
4
+ templates?: string | false;
5
+ composer?: string | false;
6
+ admin?: string | false;
7
+ };
8
+ export type BuiltPromptRoutes = {
9
+ blocks?: string;
10
+ templates?: string;
11
+ composer?: string;
12
+ admin?: string;
13
+ };
14
+ export declare function buildPromptRoutes(routes?: PromptRouteFragments): BuiltPromptRoutes;
15
+ export declare function routeForLocale(pattern: string, locale?: string): string;
16
+ export declare function promptRedirect(routes: BuiltPromptRoutes, page: keyof BuiltPromptRoutes, locale?: string): string;
17
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/runtime/routes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAeF,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,oBAAyB,GAAG,iBAAiB,CAStF;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIvE;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,MAAM,iBAAiB,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAIR"}
@@ -0,0 +1,33 @@
1
+ const DEFAULT_FRAGMENTS = {
2
+ base: "",
3
+ blocks: "/prompt/blocks",
4
+ templates: "/prompt/templates",
5
+ composer: "/prompt/composer",
6
+ admin: "/admin/prompts"
7
+ };
8
+ function joinRoute(base, fragment) {
9
+ const value = `/${[base, fragment].join("/")}`.replace(/\/+/g, "/");
10
+ return value === "/" ? "/" : value.replace(/\/$/, "");
11
+ }
12
+ export function buildPromptRoutes(routes = {}) {
13
+ const merged = { ...DEFAULT_FRAGMENTS, ...routes };
14
+ const base = merged.base ?? "";
15
+ return {
16
+ blocks: merged.blocks === false ? undefined : joinRoute(base, merged.blocks),
17
+ templates: merged.templates === false ? undefined : joinRoute(base, merged.templates),
18
+ composer: merged.composer === false ? undefined : joinRoute(base, merged.composer),
19
+ admin: merged.admin === false ? undefined : joinRoute(base, merged.admin)
20
+ };
21
+ }
22
+ export function routeForLocale(pattern, locale) {
23
+ return locale
24
+ ? pattern.replace("[locale]", locale)
25
+ : pattern.replace("/:locale", "").replace("[locale]", "");
26
+ }
27
+ export function promptRedirect(routes, page, locale) {
28
+ const route = routes[page];
29
+ if (!route)
30
+ return "/";
31
+ return routeForLocale(route, locale);
32
+ }
33
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/runtime/routes.ts"],"names":[],"mappings":"AAeA,MAAM,iBAAiB,GAAoE;IACzF,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,kBAAkB;IAC5B,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,SAAS,SAAS,CAAC,IAAY,EAAE,QAAgB;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,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,EACzB,IAA6B,EAC7B,MAAe;IAEf,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC;IACvB,OAAO,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,286 @@
1
+ import { z } from "zod";
2
+ export declare const PromptBlockTypeSchema: z.ZodEnum<{
3
+ format: "format";
4
+ role: "role";
5
+ task: "task";
6
+ context: "context";
7
+ instruction: "instruction";
8
+ example: "example";
9
+ }>;
10
+ export type PromptBlockType = z.infer<typeof PromptBlockTypeSchema>;
11
+ export declare const CategoryTypeSchema: z.ZodEnum<{
12
+ prompt_block: "prompt_block";
13
+ prompt_template: "prompt_template";
14
+ }>;
15
+ export type CategoryType = z.infer<typeof CategoryTypeSchema>;
16
+ export declare const ResponseMessageSchema: z.ZodObject<{
17
+ success: z.ZodBoolean;
18
+ msg: z.ZodString;
19
+ }, z.core.$strict>;
20
+ export type ResponseMessage = z.infer<typeof ResponseMessageSchema>;
21
+ export declare const ResponseModelBaseSchema: z.ZodObject<{
22
+ success: z.ZodBoolean;
23
+ data: z.ZodUnknown;
24
+ }, z.core.$strict>;
25
+ export type ResponseModelBase = z.infer<typeof ResponseModelBaseSchema>;
26
+ export declare const ResponseModelOrMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
27
+ success: z.ZodBoolean;
28
+ data: z.ZodUnknown;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ success: z.ZodBoolean;
31
+ msg: z.ZodString;
32
+ }, z.core.$strict>]>;
33
+ export type ResponseModelOrMessage = z.infer<typeof ResponseModelOrMessageSchema>;
34
+ export declare const PromptBlockPublicSchema: z.ZodObject<{
35
+ id: z.ZodNumber;
36
+ name: z.ZodString;
37
+ slug: z.ZodString;
38
+ description: z.ZodNullable<z.ZodString>;
39
+ content: z.ZodString;
40
+ type: z.ZodEnum<{
41
+ format: "format";
42
+ role: "role";
43
+ task: "task";
44
+ context: "context";
45
+ instruction: "instruction";
46
+ example: "example";
47
+ }>;
48
+ is_dynamic: z.ZodBoolean;
49
+ is_public: z.ZodBoolean;
50
+ owner_id: z.ZodString;
51
+ }, z.core.$strict>;
52
+ export type PromptBlockPublic = z.infer<typeof PromptBlockPublicSchema>;
53
+ export declare const PromptBlockCreateSchema: z.ZodObject<{
54
+ name: z.ZodString;
55
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ content: z.ZodString;
57
+ type: z.ZodEnum<{
58
+ format: "format";
59
+ role: "role";
60
+ task: "task";
61
+ context: "context";
62
+ instruction: "instruction";
63
+ example: "example";
64
+ }>;
65
+ is_dynamic: z.ZodOptional<z.ZodBoolean>;
66
+ is_public: z.ZodOptional<z.ZodBoolean>;
67
+ slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ }, z.core.$strict>;
69
+ export type PromptBlockCreate = z.infer<typeof PromptBlockCreateSchema>;
70
+ export declare const PromptBlockUpdateSchema: z.ZodObject<{
71
+ name: z.ZodString;
72
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ content: z.ZodString;
74
+ type: z.ZodEnum<{
75
+ format: "format";
76
+ role: "role";
77
+ task: "task";
78
+ context: "context";
79
+ instruction: "instruction";
80
+ example: "example";
81
+ }>;
82
+ is_dynamic: z.ZodOptional<z.ZodBoolean>;
83
+ is_public: z.ZodOptional<z.ZodBoolean>;
84
+ slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ }, z.core.$strict>;
86
+ export type PromptBlockUpdate = z.infer<typeof PromptBlockUpdateSchema>;
87
+ export declare const PromptBlocksPublicSchema: z.ZodObject<{
88
+ data: z.ZodArray<z.ZodObject<{
89
+ id: z.ZodNumber;
90
+ name: z.ZodString;
91
+ slug: z.ZodString;
92
+ description: z.ZodNullable<z.ZodString>;
93
+ content: z.ZodString;
94
+ type: z.ZodEnum<{
95
+ format: "format";
96
+ role: "role";
97
+ task: "task";
98
+ context: "context";
99
+ instruction: "instruction";
100
+ example: "example";
101
+ }>;
102
+ is_dynamic: z.ZodBoolean;
103
+ is_public: z.ZodBoolean;
104
+ owner_id: z.ZodString;
105
+ }, z.core.$strict>>;
106
+ count: z.ZodNumber;
107
+ }, z.core.$strict>;
108
+ export type PromptBlocksPublic = z.infer<typeof PromptBlocksPublicSchema>;
109
+ export declare const TemplateBlockPublicSchema: z.ZodObject<{
110
+ id: z.ZodNumber;
111
+ block_id: z.ZodNumber;
112
+ template_id: z.ZodNumber;
113
+ name: z.ZodString;
114
+ slug: z.ZodString;
115
+ description: z.ZodNullable<z.ZodString>;
116
+ content: z.ZodString;
117
+ type: z.ZodEnum<{
118
+ format: "format";
119
+ role: "role";
120
+ task: "task";
121
+ context: "context";
122
+ instruction: "instruction";
123
+ example: "example";
124
+ }>;
125
+ is_dynamic: z.ZodBoolean;
126
+ is_public: z.ZodBoolean;
127
+ position: z.ZodNumber;
128
+ }, z.core.$strict>;
129
+ export type TemplateBlockPublic = z.infer<typeof TemplateBlockPublicSchema>;
130
+ export declare const PromptTemplatePublicSchema: z.ZodObject<{
131
+ id: z.ZodNumber;
132
+ name: z.ZodString;
133
+ slug: z.ZodString;
134
+ description: z.ZodNullable<z.ZodString>;
135
+ is_public: z.ZodBoolean;
136
+ blocks: z.ZodArray<z.ZodObject<{
137
+ id: z.ZodNumber;
138
+ block_id: z.ZodNumber;
139
+ template_id: z.ZodNumber;
140
+ name: z.ZodString;
141
+ slug: z.ZodString;
142
+ description: z.ZodNullable<z.ZodString>;
143
+ content: z.ZodString;
144
+ type: z.ZodEnum<{
145
+ format: "format";
146
+ role: "role";
147
+ task: "task";
148
+ context: "context";
149
+ instruction: "instruction";
150
+ example: "example";
151
+ }>;
152
+ is_dynamic: z.ZodBoolean;
153
+ is_public: z.ZodBoolean;
154
+ position: z.ZodNumber;
155
+ }, z.core.$strict>>;
156
+ }, z.core.$strict>;
157
+ export type PromptTemplatePublic = z.infer<typeof PromptTemplatePublicSchema>;
158
+ export declare const PromptTemplateCreateSchema: z.ZodObject<{
159
+ name: z.ZodString;
160
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ is_public: z.ZodOptional<z.ZodBoolean>;
162
+ slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
+ }, z.core.$strict>;
164
+ export type PromptTemplateCreate = z.infer<typeof PromptTemplateCreateSchema>;
165
+ export declare const PromptTemplateUpdateSchema: z.ZodObject<{
166
+ name: z.ZodString;
167
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ is_public: z.ZodOptional<z.ZodBoolean>;
169
+ slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
+ }, z.core.$strict>;
171
+ export type PromptTemplateUpdate = z.infer<typeof PromptTemplateUpdateSchema>;
172
+ export declare const PromptTemplatesPublicSchema: z.ZodObject<{
173
+ data: z.ZodArray<z.ZodObject<{
174
+ id: z.ZodNumber;
175
+ name: z.ZodString;
176
+ slug: z.ZodString;
177
+ description: z.ZodNullable<z.ZodString>;
178
+ is_public: z.ZodBoolean;
179
+ blocks: z.ZodArray<z.ZodObject<{
180
+ id: z.ZodNumber;
181
+ block_id: z.ZodNumber;
182
+ template_id: z.ZodNumber;
183
+ name: z.ZodString;
184
+ slug: z.ZodString;
185
+ description: z.ZodNullable<z.ZodString>;
186
+ content: z.ZodString;
187
+ type: z.ZodEnum<{
188
+ format: "format";
189
+ role: "role";
190
+ task: "task";
191
+ context: "context";
192
+ instruction: "instruction";
193
+ example: "example";
194
+ }>;
195
+ is_dynamic: z.ZodBoolean;
196
+ is_public: z.ZodBoolean;
197
+ position: z.ZodNumber;
198
+ }, z.core.$strict>>;
199
+ }, z.core.$strict>>;
200
+ count: z.ZodNumber;
201
+ }, z.core.$strict>;
202
+ export type PromptTemplatesPublic = z.infer<typeof PromptTemplatesPublicSchema>;
203
+ export declare const DynamicBlockSchema: z.ZodObject<{
204
+ id: z.ZodNumber;
205
+ content: z.ZodString;
206
+ }, z.core.$strict>;
207
+ export type DynamicBlock = z.infer<typeof DynamicBlockSchema>;
208
+ export declare const ComposedPromptSchema: z.ZodObject<{
209
+ content: z.ZodString;
210
+ }, z.core.$strict>;
211
+ export type ComposedPrompt = z.infer<typeof ComposedPromptSchema>;
212
+ export declare const CategoryPublicSchema: z.ZodObject<{
213
+ id: z.ZodNumber;
214
+ name: z.ZodString;
215
+ slug: z.ZodString;
216
+ type: z.ZodEnum<{
217
+ prompt_block: "prompt_block";
218
+ prompt_template: "prompt_template";
219
+ }>;
220
+ owner_id: z.ZodString;
221
+ }, z.core.$strict>;
222
+ export type CategoryPublic = z.infer<typeof CategoryPublicSchema>;
223
+ export declare const CategoriesPublicSchema: z.ZodObject<{
224
+ data: z.ZodArray<z.ZodObject<{
225
+ id: z.ZodNumber;
226
+ name: z.ZodString;
227
+ slug: z.ZodString;
228
+ type: z.ZodEnum<{
229
+ prompt_block: "prompt_block";
230
+ prompt_template: "prompt_template";
231
+ }>;
232
+ owner_id: z.ZodString;
233
+ }, z.core.$strict>>;
234
+ count: z.ZodNumber;
235
+ }, z.core.$strict>;
236
+ export type CategoriesPublic = z.infer<typeof CategoriesPublicSchema>;
237
+ export declare const CategoryCreateSchema: z.ZodObject<{
238
+ name: z.ZodString;
239
+ }, z.core.$strict>;
240
+ export type CategoryCreate = z.infer<typeof CategoryCreateSchema>;
241
+ export declare const CategoryUpdateSchema: z.ZodObject<{
242
+ name: z.ZodString;
243
+ }, z.core.$strict>;
244
+ export type CategoryUpdate = z.infer<typeof CategoryUpdateSchema>;
245
+ export declare const ActivityCounterSchema: z.ZodObject<{
246
+ model: z.ZodString;
247
+ updated: z.ZodNumber;
248
+ added: z.ZodNumber;
249
+ }, z.core.$strict>;
250
+ export type ActivityCounter = z.infer<typeof ActivityCounterSchema>;
251
+ export declare const ActivityStatsSchema: z.ZodObject<{
252
+ min: z.ZodNumber;
253
+ max: z.ZodNumber;
254
+ activity: z.ZodArray<z.ZodObject<{
255
+ model: z.ZodString;
256
+ updated: z.ZodNumber;
257
+ added: z.ZodNumber;
258
+ }, z.core.$strict>>;
259
+ }, z.core.$strict>;
260
+ export type ActivityStats = z.infer<typeof ActivityStatsSchema>;
261
+ export declare const UsersActivitySchema: z.ZodObject<{
262
+ nb_users: z.ZodNumber;
263
+ activity: z.ZodObject<{
264
+ min: z.ZodNumber;
265
+ max: z.ZodNumber;
266
+ activity: z.ZodArray<z.ZodObject<{
267
+ model: z.ZodString;
268
+ updated: z.ZodNumber;
269
+ added: z.ZodNumber;
270
+ }, z.core.$strict>>;
271
+ }, z.core.$strict>;
272
+ }, z.core.$strict>;
273
+ export type UsersActivity = z.infer<typeof UsersActivitySchema>;
274
+ export type PromptBlockListParams = {
275
+ skip?: number;
276
+ limit?: number;
277
+ };
278
+ export type PromptTemplateListParams = {
279
+ skip?: number;
280
+ limit?: number;
281
+ };
282
+ export type CategoryListParams = {
283
+ skip?: number;
284
+ limit?: number;
285
+ };
286
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/runtime/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,qBAAqB;;;;;;;EAOhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB;;;EAA8C,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,qBAAqB;;;kBAKvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,uBAAuB;;;kBAKzB,CAAC;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAA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