spine-framework 0.3.124 → 0.3.126

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 (319) hide show
  1. package/.framework/cli/commands/agents.ts +35 -37
  2. package/.framework/cli/commands/auth.ts +35 -34
  3. package/.framework/cli/commands/create-app.ts +104 -40
  4. package/.framework/cli/commands/dev.ts +104 -69
  5. package/.framework/cli/commands/doctor.ts +179 -69
  6. package/.framework/cli/commands/generate.ts +83 -143
  7. package/.framework/cli/commands/init.ts +72 -34
  8. package/.framework/cli/commands/install-app.ts +260 -125
  9. package/.framework/cli/commands/items.ts +33 -44
  10. package/.framework/cli/commands/migrate.ts +122 -40
  11. package/.framework/cli/commands/migrations.ts +33 -40
  12. package/.framework/cli/commands/pipelines.ts +31 -39
  13. package/.framework/cli/commands/status.ts +47 -23
  14. package/.framework/cli/commands/system.ts +47 -37
  15. package/.framework/cli/commands/test.ts +112 -68
  16. package/.framework/cli/commands/validate-app.ts +215 -121
  17. package/.framework/cli/context.ts +112 -130
  18. package/.framework/cli/env-loader.ts +47 -18
  19. package/.framework/cli/index.ts +81 -42
  20. package/.framework/docs/runtime-types.md +1024 -0
  21. package/.framework/functions/_shared/agent-runner.ts +1296 -961
  22. package/.framework/functions/_shared/app-manifest.ts +82 -68
  23. package/.framework/functions/_shared/audit.ts +135 -83
  24. package/.framework/functions/_shared/{cil-state.ts → cil.ts} +158 -56
  25. package/.framework/functions/_shared/db.ts +80 -126
  26. package/.framework/functions/_shared/hash-api-key.ts +63 -0
  27. package/.framework/functions/_shared/index.ts +224 -335
  28. package/.framework/functions/_shared/kb.ts +319 -0
  29. package/.framework/functions/_shared/llm.ts +92 -0
  30. package/.framework/functions/_shared/logging.ts +288 -0
  31. package/.framework/functions/_shared/middleware.ts +329 -365
  32. package/.framework/functions/_shared/outcomes.ts +36 -0
  33. package/.framework/functions/_shared/permissions.ts +359 -643
  34. package/.framework/functions/_shared/pipeline-runner.ts +243 -316
  35. package/.framework/functions/_shared/principal.ts +376 -468
  36. package/.framework/functions/_shared/resolve-credentials.ts +102 -0
  37. package/.framework/functions/_shared/resolve-ids.ts +188 -16
  38. package/.framework/functions/_shared/retry-deliveries.ts +104 -0
  39. package/.framework/functions/_shared/schema-utils.ts +611 -373
  40. package/.framework/functions/_shared/testing.ts +207 -137
  41. package/.framework/functions/_shared/tracing.ts +276 -0
  42. package/.framework/functions/_shared/trigger-engine.ts +159 -211
  43. package/.framework/functions/_shared/webhook-registration.ts +95 -81
  44. package/.framework/functions/_shared/webhook-registry.ts +153 -75
  45. package/.framework/functions/account-nodes.ts +31 -53
  46. package/.framework/functions/adapters/generic-webhook-inbound.ts +56 -0
  47. package/.framework/functions/adapters/generic-webhook-outbound.ts +43 -0
  48. package/.framework/functions/adapters/openai-outbound.ts +40 -0
  49. package/.framework/functions/admin-data.ts +685 -537
  50. package/.framework/functions/admin-funnel.ts +31 -20
  51. package/.framework/functions/admin-install-funnel.ts +47 -28
  52. package/.framework/functions/admin-signals.ts +47 -29
  53. package/.framework/functions/ai-agents.ts +122 -147
  54. package/.framework/functions/ai-interactions.ts +180 -90
  55. package/.framework/functions/api-keys.ts +250 -192
  56. package/.framework/functions/apps.ts +203 -197
  57. package/.framework/functions/auth.ts +98 -91
  58. package/.framework/functions/cil-agent-ingest.ts +773 -0
  59. package/.framework/functions/cil-agent.ts +592 -0
  60. package/.framework/functions/cil-callmap.ts +1227 -0
  61. package/.framework/functions/cil-config.ts +583 -0
  62. package/.framework/functions/cil-context.ts +445 -0
  63. package/.framework/functions/cil-doc.ts +1752 -0
  64. package/.framework/functions/cil-embeddings.ts +1202 -0
  65. package/.framework/functions/cil-graph.ts +585 -0
  66. package/.framework/functions/cil-ingest.ts +2416 -0
  67. package/.framework/functions/cil-pipeline.ts +318 -0
  68. package/.framework/functions/cil-project.ts +499 -0
  69. package/.framework/functions/cil-validate.ts +469 -0
  70. package/.framework/functions/debug-auth.ts +73 -53
  71. package/.framework/functions/deliveries.ts +117 -0
  72. package/.framework/functions/embeddings.ts +528 -516
  73. package/.framework/functions/eval-harness.ts +158 -106
  74. package/.framework/functions/integration-outbound.ts +311 -0
  75. package/.framework/functions/integration-routes.ts +240 -466
  76. package/.framework/functions/integrations.ts +132 -140
  77. package/.framework/functions/invites.ts +401 -201
  78. package/.framework/functions/item-progress.ts +113 -53
  79. package/.framework/functions/kb.ts +28 -0
  80. package/.framework/functions/logs.ts +239 -222
  81. package/.framework/functions/observability.ts +308 -259
  82. package/.framework/functions/pipeline-executions.ts +179 -235
  83. package/.framework/functions/pipelines.ts +163 -205
  84. package/.framework/functions/prompt-configs.ts +109 -156
  85. package/.framework/functions/roles.ts +97 -147
  86. package/.framework/functions/system-cron.ts +132 -218
  87. package/.framework/functions/system.ts +112 -52
  88. package/.framework/functions/tests.ts +32 -28
  89. package/.framework/functions/timers.ts +162 -210
  90. package/.framework/functions/triggers.ts +282 -346
  91. package/.framework/functions/types.ts +283 -400
  92. package/.framework/migrations/001_core_schema.sql +630 -0
  93. package/.framework/migrations/002_core_rls_and_functions.sql +532 -0
  94. package/.framework/migrations/{003_system_data.sql → 003_core_system_data.sql} +26 -153
  95. package/.framework/migrations/004_core_rpc_and_broker.sql +421 -0
  96. package/.framework/migrations/005_core_observability.sql +598 -0
  97. package/.framework/migrations/006_security_hardening_rls.sql +97 -0
  98. package/.framework/migrations/007_kb_article_list.sql +237 -0
  99. package/.framework/migrations/008_items_target.sql +8 -0
  100. package/.framework/migrations/009_roles_slug_unique.sql +11 -0
  101. package/.framework/public/spine.config.json +91 -0
  102. package/.framework/scripts/app-install-cli.ts +112 -98
  103. package/.framework/src/App.tsx +67 -20
  104. package/.framework/src/apps/admin/index.tsx +97 -27
  105. package/.framework/src/components/AppWrapper.tsx +50 -11
  106. package/.framework/src/components/CustomAppLoader.tsx +131 -22
  107. package/.framework/src/components/admin/AdminListPage.tsx +75 -8
  108. package/.framework/src/components/admin/AdminSidebar.tsx +148 -36
  109. package/.framework/src/components/admin/AdminStatsCard.tsx +48 -29
  110. package/.framework/src/components/admin/PageInstructions.tsx +49 -0
  111. package/.framework/src/components/admin/SortableTableHeader.tsx +49 -2
  112. package/.framework/src/components/app-shell/GenericAppShell.tsx +69 -11
  113. package/.framework/src/components/app-shell/GenericDetailPage.tsx +55 -10
  114. package/.framework/src/components/app-shell/GenericListPage.tsx +76 -9
  115. package/.framework/src/components/app-sidebar.tsx +50 -3
  116. package/.framework/src/components/auth/ProtectedRoute.tsx +53 -45
  117. package/.framework/src/components/kb/KBArticleEditor.tsx +409 -0
  118. package/.framework/src/components/kb/KBArticleList.tsx +557 -0
  119. package/.framework/src/components/layout/AppShell.tsx +54 -16
  120. package/.framework/src/components/layout/Header.tsx +50 -38
  121. package/.framework/src/components/layout/Layout.tsx +48 -32
  122. package/.framework/src/components/layout/Sidebar.tsx +167 -16
  123. package/.framework/src/components/runtime/DataDetailHeader.tsx +33 -1
  124. package/.framework/src/components/runtime/DataDetailPage.tsx +289 -4
  125. package/.framework/src/components/runtime/DataFilters.tsx +78 -1
  126. package/.framework/src/components/runtime/DataHeader.tsx +32 -29
  127. package/.framework/src/components/runtime/DataListPage.tsx +161 -2
  128. package/.framework/src/components/runtime/DataStats.tsx +48 -1
  129. package/.framework/src/components/runtime/DataTable.tsx +153 -1
  130. package/.framework/src/components/runtime/SchemaDetailForm.tsx +77 -46
  131. package/.framework/src/components/runtime/index.ts +16 -9
  132. package/.framework/src/components/search-form.tsx +33 -1
  133. package/.framework/src/components/shared/AgentView.tsx +48 -51
  134. package/.framework/src/components/shared/FieldRenderer.tsx +84 -67
  135. package/.framework/src/components/shared/InviteManager.tsx +113 -52
  136. package/.framework/src/components/shared/MemberList.tsx +182 -0
  137. package/.framework/src/components/shared/SchemaFields.tsx +96 -78
  138. package/.framework/src/components/ui/DataTable.tsx +86 -56
  139. package/.framework/src/components/ui/Form.tsx +188 -109
  140. package/.framework/src/components/ui/ItemCard.tsx +86 -58
  141. package/.framework/src/components/ui/ItemListView.tsx +88 -61
  142. package/.framework/src/components/ui/LoadingSpinner.tsx +52 -27
  143. package/.framework/src/components/ui/Modal.tsx +81 -4
  144. package/.framework/src/components/ui/RichTextEditor.tsx +101 -9
  145. package/.framework/src/components/ui/accordion.tsx +97 -5
  146. package/.framework/src/components/ui/alert-dialog.tsx +225 -13
  147. package/.framework/src/components/ui/alert.tsx +113 -6
  148. package/.framework/src/components/ui/aspect-ratio.tsx +49 -2
  149. package/.framework/src/components/ui/avatar.tsx +129 -7
  150. package/.framework/src/components/ui/badge.tsx +65 -3
  151. package/.framework/src/components/ui/breadcrumb.tsx +145 -8
  152. package/.framework/src/components/ui/button-group.tsx +81 -4
  153. package/.framework/src/components/ui/button.tsx +49 -2
  154. package/.framework/src/components/ui/calendar.tsx +65 -3
  155. package/.framework/src/components/ui/card.tsx +145 -8
  156. package/.framework/src/components/ui/carousel.tsx +129 -7
  157. package/.framework/src/components/ui/chart.tsx +161 -10
  158. package/.framework/src/components/ui/checkbox.tsx +49 -2
  159. package/.framework/src/components/ui/collapsible.tsx +81 -5
  160. package/.framework/src/components/ui/combobox.tsx +305 -20
  161. package/.framework/src/components/ui/command.tsx +177 -11
  162. package/.framework/src/components/ui/context-menu.tsx +273 -17
  163. package/.framework/src/components/ui/dialog.tsx +209 -27
  164. package/.framework/src/components/ui/direction.tsx +64 -4
  165. package/.framework/src/components/ui/drawer.tsx +193 -12
  166. package/.framework/src/components/ui/dropdown-menu.tsx +273 -18
  167. package/.framework/src/components/ui/empty.tsx +145 -9
  168. package/.framework/src/components/ui/field.tsx +209 -14
  169. package/.framework/src/components/ui/hover-card.tsx +81 -4
  170. package/.framework/src/components/ui/input-group.tsx +162 -10
  171. package/.framework/src/components/ui/input-otp.tsx +98 -5
  172. package/.framework/src/components/ui/input.tsx +49 -2
  173. package/.framework/src/components/ui/item.tsx +225 -13
  174. package/.framework/src/components/ui/kbd.tsx +65 -3
  175. package/.framework/src/components/ui/label.tsx +49 -2
  176. package/.framework/src/components/ui/menubar.tsx +289 -17
  177. package/.framework/src/components/ui/native-select.tsx +97 -5
  178. package/.framework/src/components/ui/navigation-menu.tsx +177 -10
  179. package/.framework/src/components/ui/pagination.tsx +161 -9
  180. package/.framework/src/components/ui/popover.tsx +145 -8
  181. package/.framework/src/components/ui/progress.tsx +49 -2
  182. package/.framework/src/components/ui/radio-group.tsx +65 -3
  183. package/.framework/src/components/ui/resizable.tsx +82 -4
  184. package/.framework/src/components/ui/scroll-area.tsx +65 -3
  185. package/.framework/src/components/ui/select.tsx +193 -11
  186. package/.framework/src/components/ui/separator.tsx +49 -2
  187. package/.framework/src/components/ui/sheet.tsx +193 -11
  188. package/.framework/src/components/ui/sidebar.tsx +481 -38
  189. package/.framework/src/components/ui/skeleton.tsx +49 -2
  190. package/.framework/src/components/ui/slider.tsx +49 -2
  191. package/.framework/src/components/ui/sonner.tsx +49 -2
  192. package/.framework/src/components/ui/spinner.tsx +49 -2
  193. package/.framework/src/components/ui/switch.tsx +49 -2
  194. package/.framework/src/components/ui/table-primitives.tsx +160 -33
  195. package/.framework/src/components/ui/table.tsx +161 -9
  196. package/.framework/src/components/ui/tabs.tsx +113 -6
  197. package/.framework/src/components/ui/textarea.tsx +49 -2
  198. package/.framework/src/components/ui/toggle-group.tsx +81 -4
  199. package/.framework/src/components/ui/toggle.tsx +65 -3
  200. package/.framework/src/components/ui/tooltip.tsx +97 -5
  201. package/.framework/src/contexts/AppContext.tsx +129 -45
  202. package/.framework/src/contexts/AuthContext.tsx +187 -144
  203. package/.framework/src/hooks/use-mobile.ts +48 -2
  204. package/.framework/src/hooks/useApi.ts +208 -159
  205. package/.framework/src/hooks/useAppPath.ts +32 -23
  206. package/.framework/src/hooks/useApps.ts +51 -20
  207. package/.framework/src/hooks/useEntityList.ts +32 -78
  208. package/.framework/src/hooks/useEntityRecord.ts +35 -96
  209. package/.framework/src/hooks/useForm.ts +32 -92
  210. package/.framework/src/hooks/useListSchema.ts +49 -78
  211. package/.framework/src/hooks/useSchemaRecord.ts +114 -105
  212. package/.framework/src/lib/api.ts +195 -116
  213. package/.framework/src/lib/supabase.ts +98 -64
  214. package/.framework/src/lib/utils.ts +287 -151
  215. package/.framework/src/main.tsx +49 -3
  216. package/.framework/src/pages/DashboardPage.tsx +52 -29
  217. package/.framework/src/pages/NotFoundPage.tsx +32 -10
  218. package/.framework/src/pages/SetupPage.tsx +32 -12
  219. package/.framework/src/pages/admin/AIAgentDetailPage.tsx +119 -10
  220. package/.framework/src/pages/admin/AIAgentsPage.tsx +48 -19
  221. package/.framework/src/pages/admin/APIKeyDetailPage.tsx +187 -17
  222. package/.framework/src/pages/admin/APIKeysPage.tsx +98 -22
  223. package/.framework/src/pages/admin/AlertsConfigPage.tsx +113 -26
  224. package/.framework/src/pages/admin/AppDetailPage.tsx +125 -8
  225. package/.framework/src/pages/admin/AppsPage.tsx +49 -2
  226. package/.framework/src/pages/admin/DeliveriesPage.tsx +196 -0
  227. package/.framework/src/pages/admin/DesignedPage.tsx +32 -18
  228. package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +215 -484
  229. package/.framework/src/pages/admin/EmbeddingsPage.tsx +116 -319
  230. package/.framework/src/pages/admin/ExtendedShadcnTestPage.tsx +34 -9
  231. package/.framework/src/pages/admin/IncrementalShadcnTestPage.tsx +34 -9
  232. package/.framework/src/pages/admin/IntegratedDashboard.tsx +32 -16
  233. package/.framework/src/pages/admin/IntegrationDetailPage.tsx +183 -26
  234. package/.framework/src/pages/admin/IntegrationsPage.tsx +48 -19
  235. package/.framework/src/pages/admin/InvitesPage.tsx +48 -14
  236. package/.framework/src/pages/admin/LogsPage.tsx +422 -75
  237. package/.framework/src/pages/admin/MinimalShadcnTestPage.tsx +34 -9
  238. package/.framework/src/pages/admin/ObservabilityDashboard.tsx +113 -24
  239. package/.framework/src/pages/admin/PipelineDetailPage.tsx +206 -34
  240. package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +50 -17
  241. package/.framework/src/pages/admin/PipelinesPage.tsx +160 -21
  242. package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +378 -88
  243. package/.framework/src/pages/admin/PromptConfigsPage.tsx +125 -16
  244. package/.framework/src/pages/admin/ProperlyDesignedPage.tsx +49 -10
  245. package/.framework/src/pages/admin/RoleDetailPage.tsx +130 -10
  246. package/.framework/src/pages/admin/RolesPage.tsx +171 -18
  247. package/.framework/src/pages/admin/SelectTestPage.tsx +34 -9
  248. package/.framework/src/pages/admin/ShadcnTestPage.tsx +49 -11
  249. package/.framework/src/pages/admin/SimpleDashboard.tsx +49 -10
  250. package/.framework/src/pages/admin/TestRunDetailPage.tsx +49 -4
  251. package/.framework/src/pages/admin/TestingDashboard.tsx +98 -28
  252. package/.framework/src/pages/admin/TimerDetailPage.tsx +143 -33
  253. package/.framework/src/pages/admin/TimersPage.tsx +48 -20
  254. package/.framework/src/pages/admin/TriggerDetailPage.tsx +118 -30
  255. package/.framework/src/pages/admin/TriggersPage.tsx +64 -19
  256. package/.framework/src/pages/admin/TypeDetailPage.tsx +138 -15
  257. package/.framework/src/pages/admin/TypesPage.tsx +48 -20
  258. package/.framework/src/pages/admin/cil/CILAgentPage.tsx +465 -0
  259. package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +787 -0
  260. package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +699 -0
  261. package/.framework/src/pages/admin/cil/CILFileListPage.tsx +647 -0
  262. package/.framework/src/pages/admin/cil/CILGraphPage.tsx +616 -0
  263. package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +1402 -0
  264. package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +614 -0
  265. package/.framework/src/pages/admin/cil/CILSearchPage.tsx +571 -0
  266. package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +731 -0
  267. package/.framework/src/pages/admin/kb/KBAdminPage.tsx +64 -0
  268. package/.framework/src/pages/auth/AuthConfirmPage.tsx +52 -51
  269. package/.framework/src/pages/auth/ForgotPasswordPage.tsx +31 -22
  270. package/.framework/src/pages/auth/LoginPage.tsx +50 -23
  271. package/.framework/src/pages/auth/PendingApprovalPage.tsx +31 -15
  272. package/.framework/src/pages/auth/RegisterPage.tsx +281 -317
  273. package/.framework/src/pages/spine-framework/APIPage.tsx +33 -0
  274. package/.framework/src/pages/spine-framework/CLIPage.tsx +33 -0
  275. package/.framework/src/types/auth.ts +128 -71
  276. package/.framework/src/types/types.ts +373 -157
  277. package/custom/.devin/skills/spine-workbench-discovery/SKILL.md +39 -0
  278. package/custom/.devin/skills/spine-workbench-idea/SKILL.md +36 -0
  279. package/custom/.devin/skills/spine-workbench-implement/SKILL.md +46 -0
  280. package/custom/.devin/skills/spine-workbench-initiative/SKILL.md +28 -0
  281. package/custom/.devin/skills/spine-workbench-plan/SKILL.md +38 -0
  282. package/docs/README.md +9 -130
  283. package/netlify.toml +5 -2
  284. package/package.json +13 -25
  285. package/scripts/kb-ingest-docs.ts +203 -0
  286. package/spine.config.json +65 -4
  287. package/.framework/migrations/001_schema.sql +0 -425
  288. package/.framework/migrations/002_rls_and_functions.sql +0 -763
  289. package/.framework/migrations/004_enhancements.sql +0 -43
  290. package/.framework/migrations/005_auth_user_trigger.sql +0 -105
  291. package/.framework/migrations/006_fix_current_actor_id.sql +0 -21
  292. package/.framework/migrations/016_invites.sql +0 -27
  293. package/.framework/migrations/017_fix_get_account_apps.sql +0 -78
  294. package/.framework/migrations/018_apps_required_roles.sql +0 -17
  295. package/.framework/migrations/019_triggers_unique_constraint.sql +0 -13
  296. package/.framework/migrations/020_get_account_apps_role_filter.sql +0 -117
  297. package/.framework/migrations/021_app_domains.sql +0 -112
  298. package/.framework/migrations/022_route_prefix_domain_unique.sql +0 -21
  299. package/.framework/migrations/023_match_embeddings_rpc.sql +0 -78
  300. package/.framework/migrations/024_messages_account_id.sql +0 -9
  301. package/.framework/migrations/025_retype_threads_messages.sql +0 -240
  302. package/.framework/migrations/026_fix_rls_policies.sql +0 -47
  303. package/.framework/migrations/027_embedding_lifecycle.sql +0 -176
  304. package/.framework/migrations/028_fix_message_data_permissions.sql +0 -49
  305. package/.framework/migrations/029_tighten_support_triage_prompt.sql +0 -41
  306. package/.framework/migrations/030_messages_updated_by.sql +0 -6
  307. package/.framework/migrations/031_seed_upsert_constraints.sql +0 -35
  308. package/docs/APPS.md +0 -232
  309. package/docs/ARCHITECTURE.md +0 -246
  310. package/docs/INSTALL.md +0 -155
  311. package/docs/design-schema-spec.md +0 -1837
  312. package/docs/dev-guides/01-create-an-app.md +0 -183
  313. package/docs/dev-guides/02-create-a-function.md +0 -178
  314. package/docs/dev-guides/03-create-a-component.md +0 -178
  315. package/docs/dev-guides/04-webhook-handlers.md +0 -129
  316. package/docs/dev-guides/05-testing.md +0 -168
  317. package/docs/dev-guides/README.md +0 -40
  318. package/docs/npm-packages-plan.md +0 -288
  319. package/docs/spine-core--api-reference.md +0 -822
@@ -1,23 +1,29 @@
1
- /**
2
- * @module src/pages/admin/PromptConfigDetailPage
3
- * @audience installer
4
- * @layer frontend-page
5
- * @stability stable
6
- *
7
- * Create / view / edit page for a single LLM prompt configuration.
8
- * Route param: `id` (UUID). Exposes `system_prompt`, `model`,
9
- * `temperature`, `max_tokens`, `prompt_type`, `category`, and
10
- * `is_default` as editable fields.
11
- *
12
- * @seeAlso src/pages/admin/PromptConfigsPage.tsx
13
- */
14
1
 
2
+
3
+
4
+
5
+
6
+
7
+ // CIL[BEGIN chunk_id="promptconfigdetailpage_module_header_1783666257" type="module_header" identity="imports" parent="none"]
8
+ // CIL[DOC-MACRO purpose="Import React dependencies and UI components"]
9
+ // CIL[DOC-RESPONSIBILITY responsibility="Import all required modules for PromptConfigDetailPage component"]
10
+ // CIL[DOC-CONTEXT module="PromptConfigDetailPage" layer="ui" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/src/components/ui/dialog.tsx\",\".framework/src/components/ui/table-primitives.tsx\",\"\"]"]
11
+ // CIL[DOC-CONTRACT inputs="none" outputs="React hooks, UI components, utilities" errors="Import errors" side_effects="Module loading"]
12
+ // CIL[DOC-MICRO logic_summary="Imports React, router, UI components, icons, and utility functions" notable_decisions="[]"]
13
+ // CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
14
+ // CIL[DOC-STABILITY stability="stable"]
15
+ // CIL[DOC-AUDIENCE audience="developer"]
16
+ // CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/src/components/ui/dialog.tsx, .framework/src/components/ui/table-primitives.tsx, \" ."]
17
+ // CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
18
+ // CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
19
+ // CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
20
+ // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
21
+ // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
15
22
  import { useState, useEffect } from 'react'
16
23
  import { useParams, useNavigate } from 'react-router-dom'
17
24
  import { Button } from '../../components/ui/button'
18
25
  import { Input } from '../../components/ui/input'
19
26
  import { Textarea } from '../../components/ui/textarea'
20
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../components/ui/select'
21
27
  import { Checkbox } from '../../components/ui/checkbox'
22
28
  import { Label } from '../../components/ui/label'
23
29
  import { Card, CardContent, CardHeader, CardTitle } from '../../components/ui/card'
@@ -27,31 +33,66 @@ import { ArrowLeft, FileText, AlertCircle } from 'lucide-react'
27
33
  import { useApi } from '../../hooks/useApi'
28
34
  import { apiFetch } from '../../lib/api'
29
35
  import { formatDateTime } from '../../lib/utils'
30
-
36
+ import { PageInstructions } from '../../components/admin/PageInstructions'
37
+ // CIL[END chunk_id="promptconfigdetailpage_module_header_1783666257"]
38
+ // CIL[BEGIN chunk_id="promptconfigdetailpage_interfaces_1783666257" type="interfaces" identity="PromptConfig" parent="none"]
39
+ // CIL[DOC-MACRO purpose="Define prompt configuration data structure"]
40
+ // CIL[DOC-RESPONSIBILITY responsibility="Type definition for prompt configuration entities"]
41
+ // CIL[DOC-CONTEXT module="PromptConfigDetailPage" layer="types" related_files="[\".framework/src/pages/admin/IntegrationsPage.tsx\",\".framework/functions/_shared/schema-utils.ts\",\".framework/functions/_shared/principal.ts\",\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\"\"]"]
42
+ // CIL[DOC-CONTRACT inputs="none" outputs="PromptConfig interface, constants" errors="Type errors" side_effects="Type system"]
43
+ // CIL[DOC-MICRO logic_summary="Defines interface for prompt configs and prompt type options" notable_decisions="[]"]
44
+ // CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
45
+ // CIL[DOC-STABILITY stability="stable"]
46
+ // CIL[DOC-VECTOR type="context" content="Layer: types. Direct callers: 0. Direct calls: 0. Related files: .framework/src/pages/admin/IntegrationsPage.tsx, .framework/functions/_shared/schema-utils.ts, .framework/functions/_shared/principal.ts, custom/apps/cortex/functions/custom_cil-embeddings.ts, \" ."]
47
+ // CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
48
+ // CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
49
+ // CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
50
+ // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
51
+ // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
31
52
  interface PromptConfig {
32
53
  id: string
33
54
  name: string
34
- description?: string
35
- prompt_type: string
36
- category: string
37
- template: string
38
- variables: string[]
39
- model_config: Record<string, any>
40
- is_default: boolean
55
+ slug: string
56
+ description?: string | null
57
+ app_id?: string | null
58
+ account_id?: string
59
+ type_id?: string | null
60
+ system_prompt?: string | null
61
+ context_template?: string | null
62
+ model: string
63
+ temperature: number
64
+ max_tokens: number
65
+ is_multi_turn: boolean
66
+ max_history_messages: number
67
+ confidence_threshold?: number | null
68
+ escalation_action?: string | null
69
+ escalation_target?: string | null
70
+ output_mode?: string | null
71
+ output_field?: string | null
72
+ requires_review: boolean
73
+ knowledge_sources: any[]
74
+ available_tools: any[]
75
+ tool_constraints: Record<string, any>
76
+ metadata: Record<string, any>
41
77
  is_active: boolean
42
- metadata?: Record<string, any>
43
78
  created_at: string
44
79
  updated_at: string
45
80
  }
46
-
47
- const PROMPT_TYPES = [
48
- { value: 'system', label: 'System' },
49
- { value: 'user', label: 'User' },
50
- { value: 'assistant', label: 'Assistant' },
51
- { value: 'function', label: 'Function' },
52
- { value: 'general', label: 'General' }
53
- ]
54
-
81
+ // CIL[END chunk_id="promptconfigdetailpage_interfaces_1783666257"]
82
+ // CIL[BEGIN chunk_id="promptconfigdetailpage_function_promptconfigdetailpage_1783666257" type="function" identity="PromptConfigDetailPage" parent="none"]
83
+ // CIL[DOC-MACRO purpose="Main PromptConfigDetailPage component function"]
84
+ // CIL[DOC-RESPONSIBILITY responsibility="Render prompt configuration creation/editing interface"]
85
+ // CIL[DOC-CONTEXT module="PromptConfigDetailPage" layer="ui" related_files="[\".framework/src/components/ui/dialog.tsx\",\".framework/src/components/ui/table-primitives.tsx\",\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\"custom/apps/portal/pages/ContentPage.tsx\",\"\"]"]
86
+ // CIL[DOC-CONTRACT inputs="none" outputs="JSX element" errors="Render errors" side_effects="API calls, navigation"]
87
+ // CIL[DOC-MICRO logic_summary="Main component that handles prompt config CRUD operations and form management" notable_decisions="[]"]
88
+ // CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
89
+ // CIL[DOC-STABILITY stability="stable"]
90
+ // CIL[DOC-VECTOR type="context" content="Layer: ui. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, .framework/src/components/ui/table-primitives.tsx, custom/apps/cortex/functions/custom_cil-embeddings.ts, custom/apps/portal/pages/ContentPage.tsx, \" ."]
91
+ // CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
92
+ // CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
93
+ // CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
94
+ // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
95
+ // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
55
96
  export function PromptConfigDetailPage() {
56
97
  const { id } = useParams<{ id: string }>()
57
98
  const navigate = useNavigate()
@@ -59,13 +100,26 @@ export function PromptConfigDetailPage() {
59
100
 
60
101
  const [formData, setFormData] = useState({
61
102
  name: '',
103
+ slug: '',
62
104
  description: '',
63
- prompt_type: 'general',
64
- category: 'general',
65
- template: '',
66
- variables: '',
67
- model_config: '{}',
68
- is_default: false,
105
+ app_id: '',
106
+ system_prompt: '',
107
+ context_template: '',
108
+ model: 'gpt-4o',
109
+ temperature: 0.7,
110
+ max_tokens: 4000,
111
+ is_multi_turn: true,
112
+ max_history_messages: 20,
113
+ confidence_threshold: '' as number | string,
114
+ escalation_action: '',
115
+ escalation_target: '',
116
+ output_mode: '',
117
+ output_field: '',
118
+ requires_review: false,
119
+ knowledge_sources: JSON.stringify([], null, 2),
120
+ available_tools: JSON.stringify([], null, 2),
121
+ tool_constraints: JSON.stringify({}, null, 2),
122
+ metadata: JSON.stringify({}, null, 2),
69
123
  is_active: true
70
124
  })
71
125
  const [isSubmitting, setIsSubmitting] = useState(false)
@@ -85,14 +139,27 @@ export function PromptConfigDetailPage() {
85
139
  if (config) {
86
140
  setFormData({
87
141
  name: config.name || '',
142
+ slug: config.slug || '',
88
143
  description: config.description || '',
89
- prompt_type: config.prompt_type || 'general',
90
- category: config.category || 'general',
91
- template: config.template || '',
92
- variables: (config.variables || []).join(', '),
93
- model_config: JSON.stringify(config.model_config || {}, null, 2),
94
- is_default: config.is_default || false,
95
- is_active: config.is_active
144
+ app_id: config.app_id || '',
145
+ system_prompt: config.system_prompt || '',
146
+ context_template: config.context_template || '',
147
+ model: config.model || 'gpt-4o',
148
+ temperature: config.temperature ?? 0.7,
149
+ max_tokens: config.max_tokens ?? 4000,
150
+ is_multi_turn: config.is_multi_turn ?? true,
151
+ max_history_messages: config.max_history_messages ?? 20,
152
+ confidence_threshold: config.confidence_threshold ?? '',
153
+ escalation_action: config.escalation_action || '',
154
+ escalation_target: config.escalation_target || '',
155
+ output_mode: config.output_mode || '',
156
+ output_field: config.output_field || '',
157
+ requires_review: config.requires_review ?? false,
158
+ knowledge_sources: JSON.stringify(config.knowledge_sources || [], null, 2),
159
+ available_tools: JSON.stringify(config.available_tools || [], null, 2),
160
+ tool_constraints: JSON.stringify(config.tool_constraints || {}, null, 2),
161
+ metadata: JSON.stringify(config.metadata || {}, null, 2),
162
+ is_active: config.is_active ?? true
96
163
  })
97
164
  }
98
165
  }, [config])
@@ -101,11 +168,44 @@ export function PromptConfigDetailPage() {
101
168
  e.preventDefault()
102
169
  setIsSubmitting(true)
103
170
  try {
104
- const body = {
105
- ...formData,
106
- variables: formData.variables.split(',').map(v => v.trim()).filter(Boolean),
107
- model_config: JSON.parse(formData.model_config)
171
+ let parsedKnowledgeSources: any[]
172
+ let parsedAvailableTools: any[]
173
+ let parsedToolConstraints: Record<string, any>
174
+ let parsedMetadata: Record<string, any>
175
+ try {
176
+ parsedKnowledgeSources = JSON.parse(formData.knowledge_sources)
177
+ parsedAvailableTools = JSON.parse(formData.available_tools)
178
+ parsedToolConstraints = JSON.parse(formData.tool_constraints)
179
+ parsedMetadata = JSON.parse(formData.metadata)
180
+ } catch (err: any) {
181
+ throw new Error('Invalid JSON in one of the JSON fields: ' + err.message)
182
+ }
183
+
184
+ const body: Record<string, any> = {
185
+ name: formData.name,
186
+ slug: formData.slug,
187
+ description: formData.description || undefined,
188
+ app_id: formData.app_id || undefined,
189
+ system_prompt: formData.system_prompt || undefined,
190
+ context_template: formData.context_template || undefined,
191
+ model: formData.model || 'gpt-4o',
192
+ temperature: formData.temperature,
193
+ max_tokens: formData.max_tokens,
194
+ is_multi_turn: formData.is_multi_turn,
195
+ max_history_messages: formData.max_history_messages,
196
+ confidence_threshold: formData.confidence_threshold === '' ? undefined : Number(formData.confidence_threshold),
197
+ escalation_action: formData.escalation_action || undefined,
198
+ escalation_target: formData.escalation_target || undefined,
199
+ output_mode: formData.output_mode || undefined,
200
+ output_field: formData.output_field || undefined,
201
+ requires_review: formData.requires_review,
202
+ knowledge_sources: parsedKnowledgeSources,
203
+ available_tools: parsedAvailableTools,
204
+ tool_constraints: parsedToolConstraints,
205
+ metadata: parsedMetadata,
206
+ is_active: formData.is_active
108
207
  }
208
+
109
209
  const url = isCreateMode ? '/api/prompt-configs' : `/api/prompt-configs?id=${id}`
110
210
  const response = await apiFetch(url, {
111
211
  method: isCreateMode ? 'POST' : 'PATCH',
@@ -159,6 +259,56 @@ export function PromptConfigDetailPage() {
159
259
  </h1>
160
260
  </div>
161
261
 
262
+ <PageInstructions
263
+ description="Create and manage prompt configurations that define LLM behavior."
264
+ sections={[
265
+ { title: 'What this prompt config controls', content: 'A prompt config stores the prompt body, model settings, escalation rules, knowledge sources, available tools, tool constraints, and metadata that AI agents and chat interfaces use at runtime.' },
266
+ { title: 'Fields explained', content: <ul className="list-disc pl-4 space-y-1">
267
+ <li><strong>Name *</strong> — string, required. The display and lookup name.</li>
268
+ <li><strong>Slug *</strong> — string, required. The unique key callers use to select this config.</li>
269
+ <li><strong>Description</strong> — string, optional. Human-readable purpose.</li>
270
+ <li><strong>App ID</strong> — uuid, optional. Links this config to a specific app; editable only when creating.</li>
271
+ <li><strong>System Prompt</strong> — text. Optional base system instructions.</li>
272
+ <li><strong>Context Template</strong> — text. The prompt body; may include variable placeholders.</li>
273
+ <li><strong>Model</strong> — string, default gpt-4o. The model to use for this prompt.</li>
274
+ <li><strong>Temperature</strong> — number, default 0.7. Sampling temperature.</li>
275
+ <li><strong>Max Tokens</strong> — number, default 4000. Token limit for the response.</li>
276
+ <li><strong>Is Multi Turn</strong> — checkbox, default true. Whether the prompt supports conversation history.</li>
277
+ <li><strong>Max History Messages</strong> — number, default 20. Number of prior messages to include.</li>
278
+ <li><strong>Confidence Threshold</strong> — number, optional. Minimum confidence before taking action.</li>
279
+ <li><strong>Escalation Action / Target</strong> — strings, optional. Where to route low-confidence results.</li>
280
+ <li><strong>Output Mode / Field</strong> — strings, optional. How and where to emit the model output.</li>
281
+ <li><strong>Requires Review</strong> — checkbox, default false. Whether outputs need human review.</li>
282
+ <li><strong>Knowledge Sources</strong> — JSON array, default []. Data sources the prompt can draw from.</li>
283
+ <li><strong>Available Tools</strong> — JSON array, default []. Tool definitions the prompt can invoke.</li>
284
+ <li><strong>Tool Constraints</strong> — JSON object, default {}. Rules restricting tool use.</li>
285
+ <li><strong>Metadata</strong> — JSON object, default {}. Extra structured data attached to the config.</li>
286
+ <li><strong>Active</strong> — checkbox, default true. Inactive configs are not returned as candidates.</li>
287
+ </ul> },
288
+ { title: 'Options and values', content: <ul className="list-disc pl-4 space-y-1">
289
+ <li><strong>Model</strong> defaults to <em>gpt-4o</em> if left blank.</li>
290
+ <li><strong>Temperature</strong> can be any number; 0 is deterministic, higher values produce more random output.</li>
291
+ <li><strong>JSON fields</strong> must contain valid JSON. Arrays are expected for <em>Knowledge Sources</em> and <em>Available Tools</em>; objects are expected for <em>Tool Constraints</em> and <em>Metadata</em>.</li>
292
+ <li><strong>Active</strong>: when checked, callers can select this config by slug or default lookup.</li>
293
+ </ul> },
294
+ { title: 'Downstream impact', content: <ul className="list-disc pl-4 space-y-1">
295
+ <li>AI agents and pipelines look up prompts by slug. Missing or inactive configs break those calls.</li>
296
+ <li>Context Template variables must be supplied by callers; unresolved placeholders remain literal in the rendered text.</li>
297
+ <li>Malformed JSON in the JSON fields will prevent save and may break runtime callers expecting arrays or objects.</li>
298
+ </ul> },
299
+ { title: 'How to create, save, and validate', content: <ol className="list-decimal pl-4 space-y-1">
300
+ <li>In create mode, enter the required <em>Name</em> and <em>Slug</em>. Optionally set <em>App ID</em>.</li>
301
+ <li>Fill the <em>Context Template</em> prompt body, model defaults, and any optional escalation/output fields.</li>
302
+ <li>Paste valid JSON into the four JSON textareas. Click <strong>Create</strong> or <strong>Update</strong> to save.</li>
303
+ </ol> },
304
+ { title: 'Common mistakes', content: <ul className="list-disc pl-4 space-y-1">
305
+ <li>Leaving <em>Slug</em> empty or duplicating an existing slug.</li>
306
+ <li>Entering JSON arrays as a string or leaving a JSON field completely blank.</li>
307
+ <li>Setting <em>Max Tokens</em> or <em>Max History Messages</em> to 0 or non-numeric values.</li>
308
+ </ul> },
309
+ ]}
310
+ />
311
+
162
312
  <form onSubmit={handleSubmit} className="space-y-6">
163
313
  <Card>
164
314
  <CardHeader>
@@ -178,29 +328,29 @@ export function PromptConfigDetailPage() {
178
328
  />
179
329
  </div>
180
330
  <div className="space-y-2">
181
- <Label>Type</Label>
182
- <Select value={formData.prompt_type} onValueChange={(v) => setFormData({ ...formData, prompt_type: v })}>
183
- <SelectTrigger>
184
- <SelectValue />
185
- </SelectTrigger>
186
- <SelectContent>
187
- {PROMPT_TYPES.map(opt => <SelectItem key={opt.value} value={opt.value}>{opt.label}</SelectItem>)}
188
- </SelectContent>
189
- </Select>
190
- </div>
191
- <div className="space-y-2">
192
- <Label>Category</Label>
331
+ <Label>Slug *</Label>
193
332
  <Input
194
- value={formData.category}
195
- onChange={(e) => setFormData({ ...formData, category: e.target.value })}
333
+ value={formData.slug}
334
+ onChange={(e) => setFormData({ ...formData, slug: e.target.value })}
335
+ required
196
336
  />
197
337
  </div>
338
+ {isCreateMode && (
339
+ <div className="space-y-2">
340
+ <Label>App ID</Label>
341
+ <Input
342
+ value={formData.app_id}
343
+ onChange={(e) => setFormData({ ...formData, app_id: e.target.value })}
344
+ placeholder="00000000-0000-0000-0000-000000000000"
345
+ />
346
+ </div>
347
+ )}
198
348
  <div className="space-y-2">
199
- <Label>Variables</Label>
349
+ <Label>Model</Label>
200
350
  <Input
201
- value={formData.variables}
202
- onChange={(e) => setFormData({ ...formData, variables: e.target.value })}
203
- placeholder="var1, var2, var3"
351
+ value={formData.model}
352
+ onChange={(e) => setFormData({ ...formData, model: e.target.value })}
353
+ placeholder="gpt-4o"
204
354
  />
205
355
  </div>
206
356
  <div className="md:col-span-2 space-y-2">
@@ -217,31 +367,158 @@ export function PromptConfigDetailPage() {
217
367
 
218
368
  <Card>
219
369
  <CardHeader>
220
- <CardTitle>Template</CardTitle>
370
+ <CardTitle>Prompting</CardTitle>
371
+ </CardHeader>
372
+ <CardContent className="space-y-4">
373
+ <div className="space-y-2">
374
+ <Label>System Prompt</Label>
375
+ <Textarea
376
+ value={formData.system_prompt}
377
+ onChange={(e) => setFormData({ ...formData, system_prompt: e.target.value })}
378
+ className="font-mono text-sm"
379
+ rows={6}
380
+ placeholder="Enter optional system instructions"
381
+ />
382
+ </div>
383
+ <div className="space-y-2">
384
+ <Label>Context Template</Label>
385
+ <Textarea
386
+ value={formData.context_template}
387
+ onChange={(e) => setFormData({ ...formData, context_template: e.target.value })}
388
+ className="font-mono text-sm"
389
+ rows={10}
390
+ placeholder="Enter the prompt body with {{variable}} placeholders"
391
+ />
392
+ </div>
393
+ </CardContent>
394
+ </Card>
395
+
396
+ <Card>
397
+ <CardHeader>
398
+ <CardTitle>Model Settings</CardTitle>
221
399
  </CardHeader>
222
400
  <CardContent>
223
- <Textarea
224
- value={formData.template}
225
- onChange={(e) => setFormData({ ...formData, template: e.target.value })}
226
- className="font-mono text-sm"
227
- rows={10}
228
- placeholder="Enter prompt template with {{variables}}"
229
- required
230
- />
401
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
402
+ <div className="space-y-2">
403
+ <Label>Temperature</Label>
404
+ <Input
405
+ type="number"
406
+ step="0.1"
407
+ value={formData.temperature}
408
+ onChange={(e) => setFormData({ ...formData, temperature: Number(e.target.value) })}
409
+ />
410
+ </div>
411
+ <div className="space-y-2">
412
+ <Label>Max Tokens</Label>
413
+ <Input
414
+ type="number"
415
+ value={formData.max_tokens}
416
+ onChange={(e) => setFormData({ ...formData, max_tokens: Number(e.target.value) })}
417
+ />
418
+ </div>
419
+ <div className="space-y-2">
420
+ <Label>Confidence Threshold</Label>
421
+ <Input
422
+ type="number"
423
+ step="0.1"
424
+ value={formData.confidence_threshold}
425
+ onChange={(e) => {
426
+ const v = e.target.value
427
+ setFormData({ ...formData, confidence_threshold: v === '' ? '' : Number(v) })
428
+ }}
429
+ />
430
+ </div>
431
+ </div>
231
432
  </CardContent>
232
433
  </Card>
233
434
 
234
435
  <Card>
235
436
  <CardHeader>
236
- <CardTitle>Model Config (JSON)</CardTitle>
437
+ <CardTitle>Conversation &amp; Escalation</CardTitle>
237
438
  </CardHeader>
238
439
  <CardContent>
239
- <Textarea
240
- value={formData.model_config}
241
- onChange={(e) => setFormData({ ...formData, model_config: e.target.value })}
242
- className="font-mono text-sm"
243
- rows={6}
244
- />
440
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
441
+ <div className="space-y-2">
442
+ <Label>Max History Messages</Label>
443
+ <Input
444
+ type="number"
445
+ value={formData.max_history_messages}
446
+ onChange={(e) => setFormData({ ...formData, max_history_messages: Number(e.target.value) })}
447
+ />
448
+ </div>
449
+ <div className="space-y-2">
450
+ <Label>Escalation Action</Label>
451
+ <Input
452
+ value={formData.escalation_action}
453
+ onChange={(e) => setFormData({ ...formData, escalation_action: e.target.value })}
454
+ />
455
+ </div>
456
+ <div className="space-y-2">
457
+ <Label>Escalation Target</Label>
458
+ <Input
459
+ value={formData.escalation_target}
460
+ onChange={(e) => setFormData({ ...formData, escalation_target: e.target.value })}
461
+ />
462
+ </div>
463
+ <div className="space-y-2">
464
+ <Label>Output Mode</Label>
465
+ <Input
466
+ value={formData.output_mode}
467
+ onChange={(e) => setFormData({ ...formData, output_mode: e.target.value })}
468
+ />
469
+ </div>
470
+ <div className="space-y-2">
471
+ <Label>Output Field</Label>
472
+ <Input
473
+ value={formData.output_field}
474
+ onChange={(e) => setFormData({ ...formData, output_field: e.target.value })}
475
+ />
476
+ </div>
477
+ </div>
478
+ </CardContent>
479
+ </Card>
480
+
481
+ <Card>
482
+ <CardHeader>
483
+ <CardTitle>JSON Fields</CardTitle>
484
+ </CardHeader>
485
+ <CardContent className="space-y-4">
486
+ <div className="space-y-2">
487
+ <Label>Knowledge Sources (JSON array)</Label>
488
+ <Textarea
489
+ value={formData.knowledge_sources}
490
+ onChange={(e) => setFormData({ ...formData, knowledge_sources: e.target.value })}
491
+ className="font-mono text-sm"
492
+ rows={4}
493
+ />
494
+ </div>
495
+ <div className="space-y-2">
496
+ <Label>Available Tools (JSON array)</Label>
497
+ <Textarea
498
+ value={formData.available_tools}
499
+ onChange={(e) => setFormData({ ...formData, available_tools: e.target.value })}
500
+ className="font-mono text-sm"
501
+ rows={4}
502
+ />
503
+ </div>
504
+ <div className="space-y-2">
505
+ <Label>Tool Constraints (JSON object)</Label>
506
+ <Textarea
507
+ value={formData.tool_constraints}
508
+ onChange={(e) => setFormData({ ...formData, tool_constraints: e.target.value })}
509
+ className="font-mono text-sm"
510
+ rows={4}
511
+ />
512
+ </div>
513
+ <div className="space-y-2">
514
+ <Label>Metadata (JSON object)</Label>
515
+ <Textarea
516
+ value={formData.metadata}
517
+ onChange={(e) => setFormData({ ...formData, metadata: e.target.value })}
518
+ className="font-mono text-sm"
519
+ rows={4}
520
+ />
521
+ </div>
245
522
  </CardContent>
246
523
  </Card>
247
524
 
@@ -253,11 +530,19 @@ export function PromptConfigDetailPage() {
253
530
  <div className="space-y-3">
254
531
  <div className="flex items-center gap-2">
255
532
  <Checkbox
256
- id="is_default"
257
- checked={formData.is_default}
258
- onCheckedChange={(checked) => setFormData({ ...formData, is_default: checked === true })}
533
+ id="is_multi_turn"
534
+ checked={formData.is_multi_turn}
535
+ onCheckedChange={(checked) => setFormData({ ...formData, is_multi_turn: checked === true })}
536
+ />
537
+ <Label htmlFor="is_multi_turn" className="text-sm">Is Multi Turn</Label>
538
+ </div>
539
+ <div className="flex items-center gap-2">
540
+ <Checkbox
541
+ id="requires_review"
542
+ checked={formData.requires_review}
543
+ onCheckedChange={(checked) => setFormData({ ...formData, requires_review: checked === true })}
259
544
  />
260
- <Label htmlFor="is_default" className="text-sm">Default for type</Label>
545
+ <Label htmlFor="requires_review" className="text-sm">Requires Review</Label>
261
546
  </div>
262
547
  <div className="flex items-center gap-2">
263
548
  <Checkbox
@@ -277,7 +562,11 @@ export function PromptConfigDetailPage() {
277
562
  <CardTitle>Info</CardTitle>
278
563
  </CardHeader>
279
564
  <CardContent>
280
- <dl className="grid grid-cols-2 gap-4 text-sm">
565
+ <dl className="grid grid-cols-2 md:grid-cols-3 gap-4 text-sm">
566
+ <div><dt className="text-muted-foreground">ID</dt><dd className="break-all">{config.id}</dd></div>
567
+ <div><dt className="text-muted-foreground">App ID</dt><dd className="break-all">{config.app_id || '-'}</dd></div>
568
+ <div><dt className="text-muted-foreground">Account ID</dt><dd className="break-all">{config.account_id || '-'}</dd></div>
569
+ <div><dt className="text-muted-foreground">Type ID</dt><dd className="break-all">{config.type_id || '-'}</dd></div>
281
570
  <div><dt className="text-muted-foreground">Created</dt><dd>{formatDateTime(config.created_at)}</dd></div>
282
571
  <div><dt className="text-muted-foreground">Updated</dt><dd>{formatDateTime(config.updated_at)}</dd></div>
283
572
  </dl>
@@ -297,3 +586,4 @@ export function PromptConfigDetailPage() {
297
586
  </div>
298
587
  )
299
588
  }
589
+ // CIL[END chunk_id="promptconfigdetailpage_function_promptconfigdetailpage_1783666257"]