spine-framework 0.3.125 → 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.
- package/.framework/cli/commands/agents.ts +35 -37
- package/.framework/cli/commands/auth.ts +35 -34
- package/.framework/cli/commands/create-app.ts +104 -40
- package/.framework/cli/commands/dev.ts +104 -69
- package/.framework/cli/commands/doctor.ts +169 -97
- package/.framework/cli/commands/generate.ts +82 -160
- package/.framework/cli/commands/init.ts +72 -34
- package/.framework/cli/commands/install-app.ts +260 -125
- package/.framework/cli/commands/items.ts +33 -44
- package/.framework/cli/commands/migrate.ts +122 -40
- package/.framework/cli/commands/migrations.ts +33 -40
- package/.framework/cli/commands/pipelines.ts +31 -39
- package/.framework/cli/commands/status.ts +47 -23
- package/.framework/cli/commands/system.ts +47 -37
- package/.framework/cli/commands/test.ts +112 -68
- package/.framework/cli/commands/validate-app.ts +215 -121
- package/.framework/cli/context.ts +112 -130
- package/.framework/cli/env-loader.ts +47 -18
- package/.framework/cli/index.ts +81 -42
- package/.framework/docs/runtime-types.md +1024 -0
- package/.framework/functions/_shared/agent-runner.ts +1296 -961
- package/.framework/functions/_shared/app-manifest.ts +82 -68
- package/.framework/functions/_shared/audit.ts +135 -83
- package/.framework/functions/_shared/{cil-state.ts → cil.ts} +147 -54
- package/.framework/functions/_shared/db.ts +80 -126
- package/.framework/functions/_shared/hash-api-key.ts +63 -0
- package/.framework/functions/_shared/index.ts +222 -347
- package/.framework/functions/_shared/kb.ts +319 -0
- package/.framework/functions/_shared/llm.ts +92 -0
- package/.framework/functions/_shared/logging.ts +288 -0
- package/.framework/functions/_shared/middleware.ts +329 -365
- package/.framework/functions/_shared/outcomes.ts +36 -0
- package/.framework/functions/_shared/permissions.ts +359 -643
- package/.framework/functions/_shared/pipeline-runner.ts +243 -316
- package/.framework/functions/_shared/principal.ts +376 -468
- package/.framework/functions/_shared/resolve-credentials.ts +102 -0
- package/.framework/functions/_shared/resolve-ids.ts +162 -14
- package/.framework/functions/_shared/retry-deliveries.ts +104 -0
- package/.framework/functions/_shared/schema-utils.ts +611 -373
- package/.framework/functions/_shared/testing.ts +207 -137
- package/.framework/functions/_shared/tracing.ts +276 -0
- package/.framework/functions/_shared/trigger-engine.ts +159 -211
- package/.framework/functions/_shared/webhook-registration.ts +95 -81
- package/.framework/functions/_shared/webhook-registry.ts +153 -75
- package/.framework/functions/account-nodes.ts +31 -53
- package/.framework/functions/adapters/generic-webhook-inbound.ts +56 -0
- package/.framework/functions/adapters/generic-webhook-outbound.ts +43 -0
- package/.framework/functions/adapters/openai-outbound.ts +40 -0
- package/.framework/functions/admin-data.ts +687 -533
- package/.framework/functions/admin-funnel.ts +31 -20
- package/.framework/functions/admin-install-funnel.ts +47 -28
- package/.framework/functions/admin-signals.ts +47 -29
- package/.framework/functions/ai-agents.ts +122 -147
- package/.framework/functions/ai-interactions.ts +180 -90
- package/.framework/functions/api-keys.ts +250 -192
- package/.framework/functions/apps.ts +203 -197
- package/.framework/functions/auth.ts +98 -91
- package/.framework/functions/cil-agent-ingest.ts +773 -0
- package/.framework/functions/cil-agent.ts +592 -0
- package/.framework/functions/cil-callmap.ts +1227 -0
- package/.framework/functions/cil-config.ts +583 -0
- package/.framework/functions/cil-context.ts +445 -0
- package/.framework/functions/cil-doc.ts +1752 -0
- package/.framework/functions/cil-embeddings.ts +1202 -0
- package/.framework/functions/cil-graph.ts +585 -0
- package/.framework/functions/cil-ingest.ts +2416 -0
- package/.framework/functions/cil-pipeline.ts +318 -0
- package/.framework/functions/cil-project.ts +499 -0
- package/.framework/functions/cil-validate.ts +469 -0
- package/.framework/functions/debug-auth.ts +73 -53
- package/.framework/functions/deliveries.ts +117 -0
- package/.framework/functions/embeddings.ts +528 -516
- package/.framework/functions/eval-harness.ts +158 -106
- package/.framework/functions/integration-outbound.ts +311 -0
- package/.framework/functions/integration-routes.ts +240 -466
- package/.framework/functions/integrations.ts +132 -140
- package/.framework/functions/invites.ts +401 -201
- package/.framework/functions/item-progress.ts +113 -53
- package/.framework/functions/kb.ts +28 -0
- package/.framework/functions/logs.ts +239 -222
- package/.framework/functions/observability.ts +308 -259
- package/.framework/functions/pipeline-executions.ts +179 -235
- package/.framework/functions/pipelines.ts +163 -205
- package/.framework/functions/prompt-configs.ts +109 -156
- package/.framework/functions/roles.ts +97 -147
- package/.framework/functions/system-cron.ts +132 -218
- package/.framework/functions/system.ts +112 -52
- package/.framework/functions/tests.ts +32 -28
- package/.framework/functions/timers.ts +162 -210
- package/.framework/functions/triggers.ts +282 -346
- package/.framework/functions/types.ts +283 -400
- package/.framework/migrations/001_core_schema.sql +630 -0
- package/.framework/migrations/002_core_rls_and_functions.sql +532 -0
- package/.framework/migrations/{003_system_data.sql → 003_core_system_data.sql} +26 -153
- package/.framework/migrations/004_core_rpc_and_broker.sql +421 -0
- package/.framework/migrations/005_core_observability.sql +598 -0
- package/.framework/migrations/006_security_hardening_rls.sql +97 -0
- package/.framework/migrations/007_kb_article_list.sql +237 -0
- package/.framework/migrations/008_items_target.sql +8 -0
- package/.framework/migrations/009_roles_slug_unique.sql +11 -0
- package/.framework/public/spine.config.json +91 -0
- package/.framework/scripts/app-install-cli.ts +112 -98
- package/.framework/src/App.tsx +67 -20
- package/.framework/src/apps/admin/index.tsx +97 -27
- package/.framework/src/components/AppWrapper.tsx +50 -11
- package/.framework/src/components/CustomAppLoader.tsx +131 -22
- package/.framework/src/components/admin/AdminListPage.tsx +75 -8
- package/.framework/src/components/admin/AdminSidebar.tsx +148 -36
- package/.framework/src/components/admin/AdminStatsCard.tsx +48 -29
- package/.framework/src/components/admin/PageInstructions.tsx +49 -0
- package/.framework/src/components/admin/SortableTableHeader.tsx +49 -2
- package/.framework/src/components/app-shell/GenericAppShell.tsx +69 -11
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +55 -10
- package/.framework/src/components/app-shell/GenericListPage.tsx +76 -9
- package/.framework/src/components/app-sidebar.tsx +50 -3
- package/.framework/src/components/auth/ProtectedRoute.tsx +53 -45
- package/.framework/src/components/kb/KBArticleEditor.tsx +409 -0
- package/.framework/src/components/kb/KBArticleList.tsx +557 -0
- package/.framework/src/components/layout/AppShell.tsx +54 -16
- package/.framework/src/components/layout/Header.tsx +50 -38
- package/.framework/src/components/layout/Layout.tsx +48 -32
- package/.framework/src/components/layout/Sidebar.tsx +167 -16
- package/.framework/src/components/runtime/DataDetailHeader.tsx +33 -1
- package/.framework/src/components/runtime/DataDetailPage.tsx +289 -4
- package/.framework/src/components/runtime/DataFilters.tsx +78 -1
- package/.framework/src/components/runtime/DataHeader.tsx +32 -29
- package/.framework/src/components/runtime/DataListPage.tsx +161 -2
- package/.framework/src/components/runtime/DataStats.tsx +48 -1
- package/.framework/src/components/runtime/DataTable.tsx +153 -1
- package/.framework/src/components/runtime/SchemaDetailForm.tsx +77 -46
- package/.framework/src/components/runtime/index.ts +16 -9
- package/.framework/src/components/search-form.tsx +33 -1
- package/.framework/src/components/shared/AgentView.tsx +48 -51
- package/.framework/src/components/shared/FieldRenderer.tsx +84 -67
- package/.framework/src/components/shared/InviteManager.tsx +113 -52
- package/.framework/src/components/shared/MemberList.tsx +182 -0
- package/.framework/src/components/shared/SchemaFields.tsx +96 -78
- package/.framework/src/components/ui/DataTable.tsx +86 -56
- package/.framework/src/components/ui/Form.tsx +188 -109
- package/.framework/src/components/ui/ItemCard.tsx +86 -58
- package/.framework/src/components/ui/ItemListView.tsx +88 -61
- package/.framework/src/components/ui/LoadingSpinner.tsx +52 -27
- package/.framework/src/components/ui/Modal.tsx +81 -4
- package/.framework/src/components/ui/RichTextEditor.tsx +101 -9
- package/.framework/src/components/ui/accordion.tsx +97 -5
- package/.framework/src/components/ui/alert-dialog.tsx +225 -13
- package/.framework/src/components/ui/alert.tsx +113 -6
- package/.framework/src/components/ui/aspect-ratio.tsx +49 -2
- package/.framework/src/components/ui/avatar.tsx +129 -7
- package/.framework/src/components/ui/badge.tsx +65 -3
- package/.framework/src/components/ui/breadcrumb.tsx +145 -8
- package/.framework/src/components/ui/button-group.tsx +81 -4
- package/.framework/src/components/ui/button.tsx +49 -2
- package/.framework/src/components/ui/calendar.tsx +65 -3
- package/.framework/src/components/ui/card.tsx +145 -8
- package/.framework/src/components/ui/carousel.tsx +129 -7
- package/.framework/src/components/ui/chart.tsx +161 -10
- package/.framework/src/components/ui/checkbox.tsx +49 -2
- package/.framework/src/components/ui/collapsible.tsx +81 -5
- package/.framework/src/components/ui/combobox.tsx +305 -20
- package/.framework/src/components/ui/command.tsx +177 -11
- package/.framework/src/components/ui/context-menu.tsx +273 -17
- package/.framework/src/components/ui/dialog.tsx +209 -27
- package/.framework/src/components/ui/direction.tsx +64 -4
- package/.framework/src/components/ui/drawer.tsx +193 -12
- package/.framework/src/components/ui/dropdown-menu.tsx +273 -18
- package/.framework/src/components/ui/empty.tsx +145 -9
- package/.framework/src/components/ui/field.tsx +209 -14
- package/.framework/src/components/ui/hover-card.tsx +81 -4
- package/.framework/src/components/ui/input-group.tsx +162 -10
- package/.framework/src/components/ui/input-otp.tsx +98 -5
- package/.framework/src/components/ui/input.tsx +49 -2
- package/.framework/src/components/ui/item.tsx +225 -13
- package/.framework/src/components/ui/kbd.tsx +65 -3
- package/.framework/src/components/ui/label.tsx +49 -2
- package/.framework/src/components/ui/menubar.tsx +289 -17
- package/.framework/src/components/ui/native-select.tsx +97 -5
- package/.framework/src/components/ui/navigation-menu.tsx +177 -10
- package/.framework/src/components/ui/pagination.tsx +161 -9
- package/.framework/src/components/ui/popover.tsx +145 -8
- package/.framework/src/components/ui/progress.tsx +49 -2
- package/.framework/src/components/ui/radio-group.tsx +65 -3
- package/.framework/src/components/ui/resizable.tsx +82 -4
- package/.framework/src/components/ui/scroll-area.tsx +65 -3
- package/.framework/src/components/ui/select.tsx +193 -11
- package/.framework/src/components/ui/separator.tsx +49 -2
- package/.framework/src/components/ui/sheet.tsx +193 -11
- package/.framework/src/components/ui/sidebar.tsx +481 -38
- package/.framework/src/components/ui/skeleton.tsx +49 -2
- package/.framework/src/components/ui/slider.tsx +49 -2
- package/.framework/src/components/ui/sonner.tsx +49 -2
- package/.framework/src/components/ui/spinner.tsx +49 -2
- package/.framework/src/components/ui/switch.tsx +49 -2
- package/.framework/src/components/ui/table-primitives.tsx +160 -33
- package/.framework/src/components/ui/table.tsx +161 -9
- package/.framework/src/components/ui/tabs.tsx +113 -6
- package/.framework/src/components/ui/textarea.tsx +49 -2
- package/.framework/src/components/ui/toggle-group.tsx +81 -4
- package/.framework/src/components/ui/toggle.tsx +65 -3
- package/.framework/src/components/ui/tooltip.tsx +97 -5
- package/.framework/src/contexts/AppContext.tsx +129 -45
- package/.framework/src/contexts/AuthContext.tsx +173 -145
- package/.framework/src/hooks/use-mobile.ts +48 -2
- package/.framework/src/hooks/useApi.ts +208 -159
- package/.framework/src/hooks/useAppPath.ts +32 -23
- package/.framework/src/hooks/useApps.ts +51 -20
- package/.framework/src/hooks/useEntityList.ts +32 -78
- package/.framework/src/hooks/useEntityRecord.ts +35 -96
- package/.framework/src/hooks/useForm.ts +32 -92
- package/.framework/src/hooks/useListSchema.ts +49 -78
- package/.framework/src/hooks/useSchemaRecord.ts +114 -105
- package/.framework/src/lib/api.ts +192 -115
- package/.framework/src/lib/supabase.ts +98 -64
- package/.framework/src/lib/utils.ts +287 -151
- package/.framework/src/main.tsx +49 -3
- package/.framework/src/pages/DashboardPage.tsx +52 -29
- package/.framework/src/pages/NotFoundPage.tsx +32 -10
- package/.framework/src/pages/SetupPage.tsx +32 -12
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +119 -10
- package/.framework/src/pages/admin/AIAgentsPage.tsx +48 -19
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +187 -17
- package/.framework/src/pages/admin/APIKeysPage.tsx +98 -22
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +113 -26
- package/.framework/src/pages/admin/AppDetailPage.tsx +125 -8
- package/.framework/src/pages/admin/AppsPage.tsx +49 -2
- package/.framework/src/pages/admin/DeliveriesPage.tsx +196 -0
- package/.framework/src/pages/admin/DesignedPage.tsx +32 -18
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +215 -484
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +116 -319
- package/.framework/src/pages/admin/ExtendedShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IncrementalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/IntegratedDashboard.tsx +32 -16
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +183 -26
- package/.framework/src/pages/admin/IntegrationsPage.tsx +48 -19
- package/.framework/src/pages/admin/InvitesPage.tsx +48 -14
- package/.framework/src/pages/admin/LogsPage.tsx +422 -75
- package/.framework/src/pages/admin/MinimalShadcnTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +113 -24
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +206 -34
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +50 -17
- package/.framework/src/pages/admin/PipelinesPage.tsx +160 -21
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +378 -88
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +125 -16
- package/.framework/src/pages/admin/ProperlyDesignedPage.tsx +49 -10
- package/.framework/src/pages/admin/RoleDetailPage.tsx +130 -10
- package/.framework/src/pages/admin/RolesPage.tsx +171 -18
- package/.framework/src/pages/admin/SelectTestPage.tsx +34 -9
- package/.framework/src/pages/admin/ShadcnTestPage.tsx +49 -11
- package/.framework/src/pages/admin/SimpleDashboard.tsx +49 -10
- package/.framework/src/pages/admin/TestRunDetailPage.tsx +49 -4
- package/.framework/src/pages/admin/TestingDashboard.tsx +98 -28
- package/.framework/src/pages/admin/TimerDetailPage.tsx +143 -33
- package/.framework/src/pages/admin/TimersPage.tsx +48 -20
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +118 -30
- package/.framework/src/pages/admin/TriggersPage.tsx +64 -19
- package/.framework/src/pages/admin/TypeDetailPage.tsx +138 -15
- package/.framework/src/pages/admin/TypesPage.tsx +48 -20
- package/.framework/src/pages/admin/cil/CILAgentPage.tsx +465 -0
- package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +787 -0
- package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +699 -0
- package/.framework/src/pages/admin/cil/CILFileListPage.tsx +647 -0
- package/.framework/src/pages/admin/cil/CILGraphPage.tsx +616 -0
- package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +1402 -0
- package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +614 -0
- package/.framework/src/pages/admin/cil/CILSearchPage.tsx +571 -0
- package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +731 -0
- package/.framework/src/pages/admin/kb/KBAdminPage.tsx +64 -0
- package/.framework/src/pages/auth/AuthConfirmPage.tsx +52 -51
- package/.framework/src/pages/auth/ForgotPasswordPage.tsx +31 -22
- package/.framework/src/pages/auth/LoginPage.tsx +50 -23
- package/.framework/src/pages/auth/PendingApprovalPage.tsx +31 -15
- package/.framework/src/pages/auth/RegisterPage.tsx +281 -317
- package/.framework/src/pages/spine-framework/APIPage.tsx +33 -0
- package/.framework/src/pages/spine-framework/CLIPage.tsx +33 -0
- package/.framework/src/types/auth.ts +128 -71
- package/.framework/src/types/types.ts +373 -157
- package/custom/.devin/skills/spine-workbench-discovery/SKILL.md +39 -0
- package/custom/.devin/skills/spine-workbench-idea/SKILL.md +36 -0
- package/custom/.devin/skills/spine-workbench-implement/SKILL.md +46 -0
- package/custom/.devin/skills/spine-workbench-initiative/SKILL.md +28 -0
- package/custom/.devin/skills/spine-workbench-plan/SKILL.md +38 -0
- package/docs/README.md +9 -130
- package/netlify.toml +3 -3
- package/package.json +13 -25
- package/scripts/kb-ingest-docs.ts +203 -0
- package/spine.config.json +65 -4
- package/.framework/migrations/001_schema.sql +0 -425
- package/.framework/migrations/002_rls_and_functions.sql +0 -763
- package/.framework/migrations/004_enhancements.sql +0 -43
- package/.framework/migrations/005_auth_user_trigger.sql +0 -105
- package/.framework/migrations/006_fix_current_actor_id.sql +0 -21
- package/.framework/migrations/016_invites.sql +0 -27
- package/.framework/migrations/017_fix_get_account_apps.sql +0 -78
- package/.framework/migrations/018_apps_required_roles.sql +0 -17
- package/.framework/migrations/019_triggers_unique_constraint.sql +0 -13
- package/.framework/migrations/020_get_account_apps_role_filter.sql +0 -117
- package/.framework/migrations/021_app_domains.sql +0 -112
- package/.framework/migrations/022_route_prefix_domain_unique.sql +0 -21
- package/.framework/migrations/023_match_embeddings_rpc.sql +0 -78
- package/.framework/migrations/024_messages_account_id.sql +0 -9
- package/.framework/migrations/025_retype_threads_messages.sql +0 -240
- package/.framework/migrations/026_fix_rls_policies.sql +0 -47
- package/.framework/migrations/027_embedding_lifecycle.sql +0 -176
- package/.framework/migrations/028_fix_message_data_permissions.sql +0 -49
- package/.framework/migrations/029_tighten_support_triage_prompt.sql +0 -41
- package/.framework/migrations/030_messages_updated_by.sql +0 -6
- package/.framework/migrations/031_seed_upsert_constraints.sql +0 -35
- package/docs/APPS.md +0 -232
- package/docs/ARCHITECTURE.md +0 -246
- package/docs/INSTALL.md +0 -155
- package/docs/design-schema-spec.md +0 -1837
- package/docs/dev-guides/01-create-an-app.md +0 -183
- package/docs/dev-guides/02-create-a-function.md +0 -178
- package/docs/dev-guides/03-create-a-component.md +0 -178
- package/docs/dev-guides/04-webhook-handlers.md +0 -129
- package/docs/dev-guides/05-testing.md +0 -168
- package/docs/dev-guides/README.md +0 -40
- package/docs/npm-packages-plan.md +0 -288
- package/docs/spine-core--api-reference.md +0 -822
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module src/pages/admin/AlertsConfigPage
|
|
3
|
-
* @audience installer
|
|
4
|
-
* @layer frontend-page
|
|
5
|
-
* @stability stable
|
|
6
|
-
*
|
|
7
|
-
* Alert rule configuration page. Fetches configured alert rules via
|
|
8
|
-
* `/api/admin-data?action=alerts`, supports create / edit / delete via
|
|
9
|
-
* an inline modal form. Rules define thresholds (metric, operator,
|
|
10
|
-
* threshold value) and notification channels. Renders inside
|
|
11
|
-
* `AdminListPage`.
|
|
12
|
-
*
|
|
13
|
-
* @seeAlso src/pages/admin/ObservabilityDashboard.tsx
|
|
14
|
-
*/
|
|
15
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_module_header_1783668265" type="module_header" identity="module_header" parent="none"]
|
|
9
|
+
// CIL[DOC-MACRO purpose="Import dependencies for AlertsConfigPage component"]
|
|
10
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Import React hooks, UI components, and utilities"]
|
|
11
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" layer="presentation" related_files="[\".framework/src/components/ui/dialog.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
12
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Imported modules" errors="none" side_effects="none"]
|
|
13
|
+
// CIL[DOC-MICRO logic_summary="Imports React state management, UI components, API hooks, icons" notable_decisions="[]"]
|
|
14
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
15
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
16
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
17
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
18
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
19
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
20
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
21
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
22
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
16
23
|
import React, { useState } from 'react'
|
|
17
24
|
import {
|
|
18
25
|
Bell,
|
|
@@ -30,7 +37,21 @@ import { AdminListPage } from '../../components/admin/AdminListPage'
|
|
|
30
37
|
import { useApi } from '../../hooks/useApi'
|
|
31
38
|
import { apiFetch } from '../../lib/api'
|
|
32
39
|
import { formatDateTime } from '../../lib/utils'
|
|
33
|
-
|
|
40
|
+
// CIL[END chunk_id="alertsconfigpage_module_header_1783668265"]
|
|
41
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_interface_thresholdalert_1783668265" type="interface" identity="ThresholdAlert" parent="none"]
|
|
42
|
+
// CIL[DOC-MACRO purpose="Define ThresholdAlert data structure"]
|
|
43
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Type definition for threshold alert objects"]
|
|
44
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" 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\",\"\\\"]"]
|
|
45
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="ThresholdAlert interface type" errors="none" side_effects="none"]
|
|
46
|
+
// CIL[DOC-MICRO logic_summary="Defines alert structure with metric configuration and status" notable_decisions="[]"]
|
|
47
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
48
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
49
|
+
// 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, \."]
|
|
50
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
51
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
52
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
53
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
54
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
34
55
|
interface ThresholdAlert {
|
|
35
56
|
id: string
|
|
36
57
|
title: string
|
|
@@ -47,12 +68,40 @@ interface ThresholdAlert {
|
|
|
47
68
|
created_at: string
|
|
48
69
|
updated_at: string
|
|
49
70
|
}
|
|
50
|
-
|
|
71
|
+
// CIL[END chunk_id="alertsconfigpage_interface_thresholdalert_1783668265"]
|
|
72
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_interface_pipeline_1783668265" type="interface" identity="Pipeline" parent="none"]
|
|
73
|
+
// CIL[DOC-MACRO purpose="Define Pipeline data structure"]
|
|
74
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Type definition for pipeline objects"]
|
|
75
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" 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\",\"\\\"]"]
|
|
76
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Pipeline interface type" errors="none" side_effects="none"]
|
|
77
|
+
// CIL[DOC-MICRO logic_summary="Defines basic pipeline structure with id and name" notable_decisions="[]"]
|
|
78
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
79
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
80
|
+
// 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, \."]
|
|
81
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
82
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
83
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
84
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
85
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
51
86
|
interface Pipeline {
|
|
52
87
|
id: string
|
|
53
88
|
name: string
|
|
54
89
|
}
|
|
55
|
-
|
|
90
|
+
// CIL[END chunk_id="alertsconfigpage_interface_pipeline_1783668265"]
|
|
91
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_constant_metric_labels_1783668265" type="constant" identity="METRIC_LABELS" parent="none"]
|
|
92
|
+
// CIL[DOC-MACRO purpose="Define metric and operator label mappings"]
|
|
93
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Configure display labels for metrics and operators"]
|
|
94
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" layer="constants" related_files="[\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/pages/admin/IntegrationsPage.tsx\",\".framework/functions/_shared/principal.ts\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\".framework/functions/_shared/schema-utils.ts\",\"\\\"]"]
|
|
95
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Label mappings" errors="none" side_effects="none"]
|
|
96
|
+
// CIL[DOC-MICRO logic_summary="Defines human-readable labels for metrics, operators, and units" notable_decisions="[]"]
|
|
97
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
98
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
99
|
+
// CIL[DOC-VECTOR type="context" content="Layer: constants. Direct callers: 0. Direct calls: 0. Related files: custom/apps/portal/pages/ContentPage.tsx, .framework/src/pages/admin/IntegrationsPage.tsx, .framework/functions/_shared/principal.ts, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, .framework/functions/_shared/schema-utils.ts, \."]
|
|
100
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
101
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
102
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
103
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
104
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
56
105
|
const METRIC_LABELS: Record<string, string> = {
|
|
57
106
|
error_rate: 'Error Rate',
|
|
58
107
|
latency_p95: 'Latency (P95)',
|
|
@@ -69,13 +118,26 @@ const UNIT_LABELS: Record<string, string> = {
|
|
|
69
118
|
latency_p95: 'ms',
|
|
70
119
|
pipeline_failure_rate: '%',
|
|
71
120
|
}
|
|
72
|
-
|
|
121
|
+
// CIL[END chunk_id="alertsconfigpage_constant_metric_labels_1783668265"]
|
|
122
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_function_alertsconfigpage_1783668265" type="function" identity="AlertsConfigPage" parent="none"]
|
|
123
|
+
// CIL[DOC-MACRO purpose="Main AlertsConfigPage component implementation"]
|
|
124
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render threshold alerts management interface with CRUD operations"]
|
|
125
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" layer="presentation" related_files="[]"]
|
|
126
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React component" errors="API failures" side_effects="API calls, state management"]
|
|
127
|
+
// CIL[DOC-MICRO logic_summary="Manages alerts state, handles create/edit/delete, renders alert list with modal" notable_decisions="[]"]
|
|
128
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
129
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
130
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: none."]
|
|
131
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
132
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
133
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
134
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
135
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
73
136
|
export function AlertsConfigPage() {
|
|
74
137
|
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
75
138
|
const [editingAlert, setEditingAlert] = useState<ThresholdAlert | null>(null)
|
|
76
139
|
const [isDeleting, setIsDeleting] = useState(false)
|
|
77
140
|
|
|
78
|
-
// Fetch threshold alerts (items with type = threshold_alert)
|
|
79
141
|
const { data: alerts, loading, error, refetch } = useApi<ThresholdAlert[]>(
|
|
80
142
|
async () => {
|
|
81
143
|
const response = await apiFetch('/api/admin-data?entity=items&type_slug=threshold_alert')
|
|
@@ -88,7 +150,6 @@ export function AlertsConfigPage() {
|
|
|
88
150
|
{ immediate: true }
|
|
89
151
|
)
|
|
90
152
|
|
|
91
|
-
// Fetch available pipelines for dropdown
|
|
92
153
|
const { data: pipelines } = useApi<Pipeline[]>(
|
|
93
154
|
async () => {
|
|
94
155
|
const response = await apiFetch('/api/pipelines?action=list')
|
|
@@ -102,7 +163,7 @@ export function AlertsConfigPage() {
|
|
|
102
163
|
const handleSave = async (formData: any) => {
|
|
103
164
|
try {
|
|
104
165
|
const payload = {
|
|
105
|
-
type_id: 'threshold_alert',
|
|
166
|
+
type_id: 'threshold_alert',
|
|
106
167
|
title: formData.title,
|
|
107
168
|
description: formData.description,
|
|
108
169
|
status: formData.is_active ? 'active' : 'inactive',
|
|
@@ -117,14 +178,12 @@ export function AlertsConfigPage() {
|
|
|
117
178
|
}
|
|
118
179
|
|
|
119
180
|
if (editingAlert) {
|
|
120
|
-
// Update existing
|
|
121
181
|
const response = await apiFetch(`/api/admin-data?entity=items&id=${editingAlert.id}`, {
|
|
122
182
|
method: 'PUT',
|
|
123
183
|
body: JSON.stringify(payload),
|
|
124
184
|
})
|
|
125
185
|
if (!response.ok) throw new Error('Failed to update alert')
|
|
126
186
|
} else {
|
|
127
|
-
// Create new
|
|
128
187
|
const response = await apiFetch('/api/admin-data?entity=items', {
|
|
129
188
|
method: 'POST',
|
|
130
189
|
body: JSON.stringify(payload),
|
|
@@ -315,7 +374,6 @@ export function AlertsConfigPage() {
|
|
|
315
374
|
</div>
|
|
316
375
|
)}
|
|
317
376
|
|
|
318
|
-
{/* Create/Edit Modal */}
|
|
319
377
|
<AlertModal
|
|
320
378
|
isOpen={isModalOpen}
|
|
321
379
|
onClose={() => {
|
|
@@ -329,7 +387,21 @@ export function AlertsConfigPage() {
|
|
|
329
387
|
</AdminListPage>
|
|
330
388
|
)
|
|
331
389
|
}
|
|
332
|
-
|
|
390
|
+
// CIL[END chunk_id="alertsconfigpage_function_alertsconfigpage_1783668265"]
|
|
391
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_interface_alertmodalprops_1783668265" type="interface" identity="AlertModalProps" parent="none"]
|
|
392
|
+
// CIL[DOC-MACRO purpose="Define AlertModal component props"]
|
|
393
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Type definition for AlertModal component properties"]
|
|
394
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" layer="types" related_files="[]"]
|
|
395
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="AlertModalProps interface type" errors="none" side_effects="none"]
|
|
396
|
+
// CIL[DOC-MICRO logic_summary="Defines props for alert modal with state and callback handlers" notable_decisions="[]"]
|
|
397
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
398
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
399
|
+
// CIL[DOC-VECTOR type="context" content="Layer: types. Direct callers: 0. Direct calls: 0. Related files: none."]
|
|
400
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
401
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
402
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
403
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
404
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
333
405
|
interface AlertModalProps {
|
|
334
406
|
isOpen: boolean
|
|
335
407
|
onClose: () => void
|
|
@@ -337,7 +409,21 @@ interface AlertModalProps {
|
|
|
337
409
|
alert: ThresholdAlert | null
|
|
338
410
|
pipelines: Pipeline[]
|
|
339
411
|
}
|
|
340
|
-
|
|
412
|
+
// CIL[END chunk_id="alertsconfigpage_interface_alertmodalprops_1783668265"]
|
|
413
|
+
// CIL[BEGIN chunk_id="alertsconfigpage_function_alertmodal_1783668265" type="function" identity="AlertModal" parent="none"]
|
|
414
|
+
// CIL[DOC-MACRO purpose="AlertModal component implementation"]
|
|
415
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render modal for creating/editing threshold alerts"]
|
|
416
|
+
// CIL[DOC-CONTEXT module="AlertsConfigPage" layer="presentation" related_files="[]"]
|
|
417
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React component" errors="Form validation" side_effects="Form submission"]
|
|
418
|
+
// CIL[DOC-MICRO logic_summary="Manages form state for alert configuration with metric selection" notable_decisions="[]"]
|
|
419
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
420
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
421
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: none."]
|
|
422
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
423
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
424
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
425
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
426
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
341
427
|
function AlertModal({ isOpen, onClose, onSave, alert, pipelines }: AlertModalProps) {
|
|
342
428
|
const [formData, setFormData] = useState({
|
|
343
429
|
title: '',
|
|
@@ -521,3 +607,4 @@ function AlertModal({ isOpen, onClose, onSave, alert, pipelines }: AlertModalPro
|
|
|
521
607
|
</Modal>
|
|
522
608
|
)
|
|
523
609
|
}
|
|
610
|
+
// CIL[END chunk_id="alertsconfigpage_function_alertmodal_1783668265"]
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// CIL[BEGIN chunk_id="appdetailpage_module_header_1783668265" type="module_header" identity="module_header" parent="none"]
|
|
5
|
+
// CIL[DOC-MACRO purpose="Import dependencies for AppDetailPage component"]
|
|
6
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Import React hooks, routing, API hooks, and UI components"]
|
|
7
|
+
// CIL[DOC-CONTEXT module="AppDetailPage" layer="presentation" related_files="[\".framework/src/components/ui/dialog.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/pages/admin/TypeDetailPage.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
8
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Imported modules" errors="none" side_effects="none"]
|
|
9
|
+
// CIL[DOC-MICRO logic_summary="Imports React state management, routing, API hooks, UI components" notable_decisions="[]"]
|
|
10
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
11
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
12
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
13
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/src/pages/admin/TypeDetailPage.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
14
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
15
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
16
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
17
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
18
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
1
19
|
import React, { useState, useEffect } from 'react'
|
|
2
20
|
import { useParams, useNavigate } from 'react-router-dom'
|
|
3
21
|
import { useApi } from '../../hooks/useApi'
|
|
@@ -20,7 +38,22 @@ import {
|
|
|
20
38
|
} from '../../components/ui/select'
|
|
21
39
|
import { ArrowLeft, Pencil, Trash2, AlertCircle } from 'lucide-react';
|
|
22
40
|
import { formatDateTime } from '../../lib/utils'
|
|
23
|
-
|
|
41
|
+
import { PageInstructions } from '../../components/admin/PageInstructions'
|
|
42
|
+
// CIL[END chunk_id="appdetailpage_module_header_1783668265"]
|
|
43
|
+
// CIL[BEGIN chunk_id="appdetailpage_interface_app_1783668265" type="interface" identity="App" parent="none"]
|
|
44
|
+
// CIL[DOC-MACRO purpose="Define App data structure"]
|
|
45
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Type definition for app objects"]
|
|
46
|
+
// CIL[DOC-CONTEXT module="AppDetailPage" layer="types" related_files="[\".framework/src/pages/admin/IntegrationsPage.tsx\",\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"\\\"]"]
|
|
47
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="App interface type" errors="none" side_effects="none"]
|
|
48
|
+
// CIL[DOC-MICRO logic_summary="Defines complete app structure with metadata, config, and stats" notable_decisions="[]"]
|
|
49
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
50
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
51
|
+
// CIL[DOC-VECTOR type="context" content="Layer: types. Direct callers: 0. Direct calls: 0. Related files: .framework/src/pages/admin/IntegrationsPage.tsx, custom/apps/cortex/functions/custom_cil-embeddings.ts, custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, \."]
|
|
52
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
53
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
54
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
55
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
56
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
24
57
|
interface App {
|
|
25
58
|
id: string
|
|
26
59
|
slug: string
|
|
@@ -38,14 +71,32 @@ interface App {
|
|
|
38
71
|
created_at: string
|
|
39
72
|
updated_at?: string
|
|
40
73
|
config?: Record<string, any>
|
|
41
|
-
|
|
74
|
+
nav_items?: any[]
|
|
75
|
+
integration_deps?: any[]
|
|
76
|
+
metadata?: Record<string, any>
|
|
77
|
+
route_prefix?: string
|
|
78
|
+
renderer?: 'generic' | 'custom' | 'none'
|
|
42
79
|
item_count?: number
|
|
43
80
|
user_count?: number
|
|
44
81
|
account_name?: string
|
|
45
82
|
created_by?: string
|
|
46
83
|
account_id?: string
|
|
47
84
|
}
|
|
48
|
-
|
|
85
|
+
// CIL[END chunk_id="appdetailpage_interface_app_1783668265"]
|
|
86
|
+
// CIL[BEGIN chunk_id="appdetailpage_function_appdetailpage_1783668265" type="function" identity="AppDetailPage" parent="none"]
|
|
87
|
+
// CIL[DOC-MACRO purpose="Main AppDetailPage component implementation"]
|
|
88
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render app detail view with create/edit/delete functionality"]
|
|
89
|
+
// CIL[DOC-CONTEXT module="AppDetailPage" layer="presentation" related_files="[\".framework/src/components/ui/dialog.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
90
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React component" errors="API failures" side_effects="Navigation, API calls"]
|
|
91
|
+
// CIL[DOC-MICRO logic_summary="Manages CRUD operations for apps with form validation and state management" notable_decisions="[]"]
|
|
92
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
93
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
94
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, custom/apps/portal/pages/ContentPage.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
95
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
96
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
97
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
98
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
99
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
49
100
|
export function AppDetailPage() {
|
|
50
101
|
const { id } = useParams<{ id: string }>()
|
|
51
102
|
const navigate = useNavigate()
|
|
@@ -67,7 +118,11 @@ export function AppDetailPage() {
|
|
|
67
118
|
is_system: false,
|
|
68
119
|
min_role: 'member',
|
|
69
120
|
config: {},
|
|
70
|
-
|
|
121
|
+
nav_items: [],
|
|
122
|
+
integration_deps: [],
|
|
123
|
+
metadata: {},
|
|
124
|
+
route_prefix: '',
|
|
125
|
+
renderer: 'generic'
|
|
71
126
|
})
|
|
72
127
|
const [configText, setConfigText] = useState(JSON.stringify({}, null, 2))
|
|
73
128
|
|
|
@@ -90,7 +145,11 @@ export function AppDetailPage() {
|
|
|
90
145
|
min_role: 'member',
|
|
91
146
|
created_at: new Date().toISOString(),
|
|
92
147
|
config: {},
|
|
93
|
-
|
|
148
|
+
nav_items: [],
|
|
149
|
+
integration_deps: [],
|
|
150
|
+
metadata: {},
|
|
151
|
+
route_prefix: '',
|
|
152
|
+
renderer: 'generic'
|
|
94
153
|
}
|
|
95
154
|
}
|
|
96
155
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
|
|
@@ -126,7 +185,11 @@ export function AppDetailPage() {
|
|
|
126
185
|
is_system: app.is_system,
|
|
127
186
|
min_role: app.min_role,
|
|
128
187
|
config: app.config || {},
|
|
129
|
-
|
|
188
|
+
nav_items: app.nav_items || [],
|
|
189
|
+
integration_deps: app.integration_deps || [],
|
|
190
|
+
metadata: app.metadata || {},
|
|
191
|
+
route_prefix: app.route_prefix || '',
|
|
192
|
+
renderer: app.renderer || 'generic'
|
|
130
193
|
}
|
|
131
194
|
setEditData(initialData)
|
|
132
195
|
setConfigText(JSON.stringify(app.config || {}, null, 2))
|
|
@@ -142,7 +205,7 @@ export function AppDetailPage() {
|
|
|
142
205
|
console.warn('Invalid JSON in config field, using default:', error)
|
|
143
206
|
}
|
|
144
207
|
|
|
145
|
-
const {
|
|
208
|
+
const { item_count: _ic, user_count: _uc, account_name: _an, ...cleanData } = editData
|
|
146
209
|
const saveData = { ...cleanData, config: parsedConfig }
|
|
147
210
|
const url = isCreateMode
|
|
148
211
|
? '/api/apps?action=create'
|
|
@@ -190,7 +253,11 @@ export function AppDetailPage() {
|
|
|
190
253
|
is_system: app.is_system,
|
|
191
254
|
min_role: app.min_role,
|
|
192
255
|
config: app.config || {},
|
|
193
|
-
|
|
256
|
+
nav_items: app.nav_items || [],
|
|
257
|
+
integration_deps: app.integration_deps || [],
|
|
258
|
+
metadata: app.metadata || {},
|
|
259
|
+
route_prefix: app.route_prefix || '',
|
|
260
|
+
renderer: app.renderer || 'generic'
|
|
194
261
|
})
|
|
195
262
|
setConfigText(JSON.stringify(app.config || {}, null, 2))
|
|
196
263
|
}
|
|
@@ -285,6 +352,55 @@ export function AppDetailPage() {
|
|
|
285
352
|
</div>
|
|
286
353
|
</div>
|
|
287
354
|
|
|
355
|
+
<PageInstructions
|
|
356
|
+
description="Configure an app, its metadata, and runtime settings."
|
|
357
|
+
sections={[
|
|
358
|
+
{ title: 'What this app controls', content: 'An app is a registered application in Spine. It controls navigation visibility, which people can use it, and the JSON configuration that the app or its runtime types consume.' },
|
|
359
|
+
{ title: 'Fields explained', content: <ul className="list-disc pl-4 space-y-1">
|
|
360
|
+
<li><strong>Name</strong> — string. The display name in the app switcher and registry.</li>
|
|
361
|
+
<li><strong>Slug</strong> — string. A unique URL-friendly identifier. Should be set at creation and rarely changed.</li>
|
|
362
|
+
<li><strong>Description</strong> — string. Optional short text shown in the app list.</li>
|
|
363
|
+
<li><strong>App Type</strong> — select. system, custom, or marketplace. Drives how the app is treated by the platform.</li>
|
|
364
|
+
<li><strong>Source</strong> — select. system, custom, or marketplace. Tracks where the app package came from.</li>
|
|
365
|
+
<li><strong>Min Role</strong> — select. member, admin, or owner. The lowest role that can see or access the app.</li>
|
|
366
|
+
<li><strong>Version</strong> — string. The current app version shown in the registry.</li>
|
|
367
|
+
<li><strong>Active</strong> — select true/false. Inactive apps are hidden and cannot be opened.</li>
|
|
368
|
+
<li><strong>System</strong> — select true/false. Marks apps that are part of the platform and should not be treated as tenant-managed.</li>
|
|
369
|
+
<li><strong>Icon</strong> — string. An icon name used by the UI. Invalid names show no icon.</li>
|
|
370
|
+
<li><strong>Color</strong> — select. The theme color for the app tile.</li>
|
|
371
|
+
<li><strong>Route Prefix</strong> — string. Optional URL prefix for the app (defaults to /slug).</li>
|
|
372
|
+
<li><strong>Renderer</strong> — select. generic, custom, or none. generic uses the design schema to render pages.</li>
|
|
373
|
+
<li><strong>Configuration (JSON)</strong> — JSON. Runtime configuration for the app or its generic renderer.</li>
|
|
374
|
+
<li><strong>Nav Items (JSON)</strong> — JSON. Array of navigation items for the app shell.</li>
|
|
375
|
+
<li><strong>Integration Deps (JSON)</strong> — JSON. Array of integration slugs the app depends on.</li>
|
|
376
|
+
<li><strong>Metadata (JSON)</strong> — JSON. Free-form metadata associated with the app.</li>
|
|
377
|
+
</ul> },
|
|
378
|
+
{ title: 'Options and values', content: <ul className="list-disc pl-4 space-y-1">
|
|
379
|
+
<li><strong>Type/Source</strong>: <em>system</em> for built-in apps, <em>custom</em> for account-built apps, <em>marketplace</em> for installed apps.</li>
|
|
380
|
+
<li><strong>Min Role</strong>: <em>member</em> is most permissive, <em>admin</em> for admins, <em>owner</em> for account owners.</li>
|
|
381
|
+
<li><strong>Active</strong>: choose Active to publish, Inactive to hide.</li>
|
|
382
|
+
<li><strong>System</strong>: choose System to protect the app from tenant deletion.</li>
|
|
383
|
+
<li><strong>Color</strong>: blue, green, red, yellow, purple, pink, indigo, gray, slate.</li>
|
|
384
|
+
</ul> },
|
|
385
|
+
{ title: 'Downstream impact', content: <ul className="list-disc pl-4 space-y-1">
|
|
386
|
+
<li>The app registry and shell navigation read these fields to decide which apps to show and who can open them.</li>
|
|
387
|
+
<li>Generic apps use the Configuration JSON and related types to render lists and detail pages.</li>
|
|
388
|
+
<li>Custom apps may read the slug and config to initialize routes. A missing slug or bad config can break the app.</li>
|
|
389
|
+
</ul> },
|
|
390
|
+
{ title: 'How to create, save, and validate', content: <ol className="list-decimal pl-4 space-y-1">
|
|
391
|
+
<li>In create mode, fill the App Information card and enter a unique slug, then choose Type, Source, and Min Role.</li>
|
|
392
|
+
<li>Edit the Configuration JSON with valid JSON; the form warns about invalid syntax on save.</li>
|
|
393
|
+
<li>Click Create to save, or Save Changes when editing. Use Delete to remove the app after a confirmation.</li>
|
|
394
|
+
<li>Validation checks required fields and that the Configuration JSON is parseable.</li>
|
|
395
|
+
</ol> },
|
|
396
|
+
{ title: 'Common mistakes', content: <ul className="list-disc pl-4 space-y-1">
|
|
397
|
+
<li>Reusing a slug that already exists, causing a unique constraint error.</li>
|
|
398
|
+
<li>Switching an app to Inactive while people are using it.</li>
|
|
399
|
+
<li>Pasting non-JSON text or trailing commas in the Configuration JSON.</li>
|
|
400
|
+
</ul> },
|
|
401
|
+
]}
|
|
402
|
+
/>
|
|
403
|
+
|
|
288
404
|
<Card>
|
|
289
405
|
<CardHeader>
|
|
290
406
|
<CardTitle>App Information</CardTitle>
|
|
@@ -491,3 +607,4 @@ export function AppDetailPage() {
|
|
|
491
607
|
</div>
|
|
492
608
|
)
|
|
493
609
|
}
|
|
610
|
+
// CIL[END chunk_id="appdetailpage_function_appdetailpage_1783668265"]
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// CIL[BEGIN chunk_id="appspage_module_header_1783668265" type="module_header" identity="module_header" parent="none"]
|
|
5
|
+
// CIL[DOC-MACRO purpose="Import dependencies for AppsPage component"]
|
|
6
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Import React hooks, UI components, and utilities"]
|
|
7
|
+
// CIL[DOC-CONTEXT module="AppsPage" layer="presentation" related_files="[\".framework/src/components/layout/Sidebar.tsx\",\".framework/src/components/ui/dialog.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/portal/pages/CoursesPage.tsx\",\"\\\"]"]
|
|
8
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="Imported modules" errors="none" side_effects="none"]
|
|
9
|
+
// CIL[DOC-MICRO logic_summary="Imports React state management, routing, API hooks, UI components" notable_decisions="[]"]
|
|
10
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
11
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
12
|
+
// CIL[DOC-AUDIENCE audience="developer"]
|
|
13
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/layout/Sidebar.tsx, .framework/src/components/ui/dialog.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, custom/apps/portal/pages/ContentPage.tsx, custom/apps/portal/pages/CoursesPage.tsx, \."]
|
|
14
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
15
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
16
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
17
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
18
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
1
19
|
import { useState } from 'react'
|
|
2
20
|
import { useNavigate } from 'react-router-dom'
|
|
3
21
|
import { useApi } from '../../hooks/useApi'
|
|
@@ -25,7 +43,21 @@ import {
|
|
|
25
43
|
} from '../../components/ui/table'
|
|
26
44
|
import { AdminListPage } from '../../components/admin/AdminListPage'
|
|
27
45
|
import { SortableTableHeader } from '../../components/admin/SortableTableHeader'
|
|
28
|
-
|
|
46
|
+
// CIL[END chunk_id="appspage_module_header_1783668265"]
|
|
47
|
+
// CIL[BEGIN chunk_id="appspage_interface_app_1783668265" type="interface" identity="App" parent="none"]
|
|
48
|
+
// CIL[DOC-MACRO purpose="Define App data structure"]
|
|
49
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Type definition for app objects"]
|
|
50
|
+
// CIL[DOC-CONTEXT module="AppsPage" layer="types" related_files="[\".framework/src/pages/admin/IntegrationsPage.tsx\",\"custom/apps/cortex/functions/custom_cil-embeddings.ts\",\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/cortex/pages/operations/OperationsDashboard.tsx\",\"custom/apps/portal/pages/CoursesPage.tsx\",\"\\\"]"]
|
|
51
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="App interface type" errors="none" side_effects="none"]
|
|
52
|
+
// CIL[DOC-MICRO logic_summary="Defines complete app structure with metadata and stats" notable_decisions="[]"]
|
|
53
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
54
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
55
|
+
// CIL[DOC-VECTOR type="context" content="Layer: types. Direct callers: 0. Direct calls: 0. Related files: .framework/src/pages/admin/IntegrationsPage.tsx, custom/apps/cortex/functions/custom_cil-embeddings.ts, custom/apps/portal/pages/ContentPage.tsx, custom/apps/cortex/pages/operations/OperationsDashboard.tsx, custom/apps/portal/pages/CoursesPage.tsx, \."]
|
|
56
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
57
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
58
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
59
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
60
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
29
61
|
interface App {
|
|
30
62
|
id: string
|
|
31
63
|
slug: string
|
|
@@ -44,7 +76,21 @@ interface App {
|
|
|
44
76
|
item_count: number
|
|
45
77
|
user_count: number
|
|
46
78
|
}
|
|
47
|
-
|
|
79
|
+
// CIL[END chunk_id="appspage_interface_app_1783668265"]
|
|
80
|
+
// CIL[BEGIN chunk_id="appspage_function_appspage_1783668265" type="function" identity="AppsPage" parent="none"]
|
|
81
|
+
// CIL[DOC-MACRO purpose="Main AppsPage component implementation"]
|
|
82
|
+
// CIL[DOC-RESPONSIBILITY responsibility="Render app management interface with filtering, sorting, and stats"]
|
|
83
|
+
// CIL[DOC-CONTEXT module="AppsPage" layer="presentation" related_files="[\".framework/src/components/ui/dialog.tsx\",\".framework/src/components/layout/Sidebar.tsx\",\"custom/apps/portal/pages/ContentPage.tsx\",\"custom/apps/portal/pages/CoursesPage.tsx\",\".framework/src/pages/admin/RolesPage.tsx\",\"\\\"]"]
|
|
84
|
+
// CIL[DOC-CONTRACT inputs="none" outputs="React component" errors="API failures" side_effects="Navigation, API calls"]
|
|
85
|
+
// CIL[DOC-MICRO logic_summary="Manages state, fetches apps, handles filtering/sorting, renders table" notable_decisions="[]"]
|
|
86
|
+
// CIL[DOC-CONFIDENCE pass="second" score="0.95" flags="none"]
|
|
87
|
+
// CIL[DOC-STABILITY stability="stable"]
|
|
88
|
+
// CIL[DOC-VECTOR type="context" content="Layer: presentation. Direct callers: 0. Direct calls: 0. Related files: .framework/src/components/ui/dialog.tsx, .framework/src/components/layout/Sidebar.tsx, custom/apps/portal/pages/ContentPage.tsx, custom/apps/portal/pages/CoursesPage.tsx, .framework/src/pages/admin/RolesPage.tsx, \."]
|
|
89
|
+
// CIL[DOC-VECTOR type="blast_radius" content="Direct callers: 0. Total affected: 0."]
|
|
90
|
+
// CIL[DOC-VECTOR type="configuration" content="No configuration dependencies."]
|
|
91
|
+
// CIL[DOC-VECTOR type="constraint" content="No test paths identified."]
|
|
92
|
+
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
93
|
+
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
48
94
|
export function AppsPage() {
|
|
49
95
|
const navigate = useNavigate()
|
|
50
96
|
const [searchTerm, setSearchTerm] = useState('')
|
|
@@ -353,3 +399,4 @@ export function AppsPage() {
|
|
|
353
399
|
</AdminListPage>
|
|
354
400
|
)
|
|
355
401
|
}
|
|
402
|
+
// CIL[END chunk_id="appspage_function_appspage_1783668265"]
|