spine-framework-cortex 0.1.19 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/{functions/custom_cortex-handler.ts → api/cortex-handler.ts} +9 -9
  2. package/components/CliInstancesCard.tsx +144 -0
  3. package/components/CortexSidebar.tsx +27 -53
  4. package/hooks/useTypeRegistry.ts +74 -0
  5. package/index.tsx +13 -24
  6. package/manifest.json +1 -13
  7. package/package.json +11 -20
  8. package/pages/courses/CoursesPage.tsx +14 -4
  9. package/pages/crm/AccountDetailPage.tsx +149 -194
  10. package/pages/crm/ContactsPage.tsx +7 -7
  11. package/pages/intelligence/IntelligencePage.tsx +24 -31
  12. package/pages/kb/KBEditorPage.tsx +9 -2
  13. package/pages/operations/AuditFunnelPage.tsx +378 -0
  14. package/pages/operations/InstallFunnelPage.tsx +410 -0
  15. package/pages/operations/OperationsDashboard.tsx +275 -0
  16. package/pages/support/RedactionReview.tsx +11 -2
  17. package/seed/link-types.json +4 -42
  18. package/seed/package.json +27 -0
  19. package/seed/roles.json +1 -1
  20. package/seed/types.json +2711 -596
  21. package/CHANGELOG.md +0 -46
  22. package/LICENSE.md +0 -223
  23. package/README.md +0 -69
  24. package/functions/custom_anonymous-sessions.ts +0 -356
  25. package/functions/custom_case_analysis.ts +0 -507
  26. package/functions/custom_community-escalation.ts +0 -234
  27. package/functions/custom_cortex-chunks.ts +0 -52
  28. package/functions/custom_funnel-scoring.ts +0 -256
  29. package/functions/custom_funnel-signal.ts +0 -446
  30. package/functions/custom_funnel-timers.ts +0 -449
  31. package/functions/custom_kb-chunker-test.ts +0 -364
  32. package/functions/custom_kb-chunker.ts +0 -576
  33. package/functions/custom_kb-embeddings.ts +0 -481
  34. package/functions/custom_kb-ingestion.ts +0 -448
  35. package/functions/custom_support-triage.ts +0 -649
  36. package/functions/custom_tag_management.ts +0 -314
  37. package/functions/webhook-handlers.ts +0 -29
  38. package/lib/resolveTypeId.ts +0 -16
  39. package/pages/crm/ContactDetailPage.tsx +0 -184
  40. package/pages/ops/AuditFunnelPage.tsx +0 -191
  41. package/pages/ops/CommandCenterPage.tsx +0 -377
  42. package/pages/ops/InstallFunnelPage.tsx +0 -226
  43. package/seed/accounts.json +0 -9
  44. package/seed/integrations.json +0 -24
  45. package/seed/pipelines.json +0 -59
  46. package/seed/triggers.json +0 -125
@@ -1,7 +1,7 @@
1
1
  import { useState, useEffect, useCallback } from 'react'
2
- import { resolveTypeId } from '../../lib/resolveTypeId'
3
2
  import { useParams, useNavigate } from 'react-router-dom'
4
3
  import { apiFetch } from '@core/lib/api'
4
+ import { getTypeIdAsync } from '../hooks/useTypeRegistry'
5
5
  import { Button } from '@core/components/ui/button'
6
6
  import { Badge } from '@core/components/ui/badge'
7
7
  import { ScrollArea } from '@core/components/ui/scroll-area'
@@ -99,6 +99,7 @@ export default function RedactionReview() {
99
99
  const [finalContent, setFinalContent] = useState('')
100
100
  const [articleTitle, setArticleTitle] = useState('')
101
101
  const [viewMode, setViewMode] = useState<'review' | 'final'>('review')
102
+ const [kbArticleTypeId, setKbArticleTypeId] = useState<string>('')
102
103
 
103
104
  // Load ticket and trigger redaction analysis
104
105
  useEffect(() => {
@@ -147,6 +148,11 @@ export default function RedactionReview() {
147
148
  }
148
149
 
149
150
  loadAndAnalyze()
151
+
152
+ // Load KB article type ID
153
+ getTypeIdAsync('kb_article').then(id => {
154
+ if (id) setKbArticleTypeId(id)
155
+ })
150
156
  }, [id])
151
157
 
152
158
  // Build content from ticket for analysis
@@ -234,10 +240,13 @@ export default function RedactionReview() {
234
240
  // Publish KB article
235
241
  const publishKB = async () => {
236
242
  if (!id || !finalContent || !articleTitle) return
243
+ if (!kbArticleTypeId) {
244
+ console.error('KB article type not loaded')
245
+ return
246
+ }
237
247
 
238
248
  setProcessing(true)
239
249
  try {
240
- const kbArticleTypeId = await resolveTypeId('kb_article')
241
250
  // Create KB article
242
251
  const kbRes = await apiFetch('/api/admin-data?action=create&entity=items', {
243
252
  method: 'POST',
@@ -1,52 +1,14 @@
1
1
  [
2
2
  {
3
- "slug": "account_opportunities",
4
- "name": "Account Opportunities",
5
- "description": "Links accounts to their opportunity queue entries",
6
- "config": {
7
- "source_type_slug": "account",
8
- "target_type_slug": "item",
9
- "relationship_type": "many-to-many",
10
- "cardinality": "many-to-many"
11
- },
12
- "is_active": true
13
- },
14
- {
15
- "slug": "account_signals",
16
- "name": "Account Signals",
17
- "description": "Links accounts to their funnel signals",
18
- "config": {
19
- "source_type_slug": "account",
20
- "target_type_slug": "item",
21
- "relationship_type": "many-to-many",
22
- "cardinality": "many-to-many"
23
- },
3
+ "slug": "tagged_with",
4
+ "name": "Tagged With",
5
+ "description": "Generic tag relationship between items",
24
6
  "is_active": true
25
7
  },
26
8
  {
27
9
  "slug": "analyzed_by",
28
10
  "name": "Analyzed By",
29
- "description": "Ticket analyzed by case analysis",
30
- "config": {
31
- "source_type_slug": "item",
32
- "target_type_slug": "item",
33
- "relationship_type": "many-to-many",
34
- "forward_label": "analyzed by",
35
- "reverse_label": "analysis of"
36
- },
37
- "is_active": true
38
- },
39
- {
40
- "slug": "tagged_with",
41
- "name": "Tagged With",
42
- "description": "Entity tagged with a specific tag",
43
- "config": {
44
- "source_type_slug": "item",
45
- "target_type_slug": "item",
46
- "relationship_type": "many-to-many",
47
- "forward_label": "tagged with",
48
- "reverse_label": "applied to"
49
- },
11
+ "description": "Item analyzed by another item (e.g., ticket analyzed by AI)",
50
12
  "is_active": true
51
13
  }
52
14
  ]
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "spine-framework-cortex",
3
+ "version": "0.2.1",
4
+ "private": false,
5
+ "description": "Cortex — AI-powered support, CRM, and knowledge base app for Spine Framework",
6
+ "keywords": ["spine-framework", "crm", "support", "knowledge-base", "community"],
7
+ "author": "Spine Team",
8
+ "license": "MIT",
9
+ "peerDependencies": {
10
+ "spine-framework": ">=0.1.0"
11
+ },
12
+ "files": [
13
+ "index.tsx",
14
+ "manifest.json",
15
+ "seed/",
16
+ "pages/",
17
+ "components/",
18
+ "api/",
19
+ "hooks/",
20
+ "README.md"
21
+ ],
22
+ "spine": {
23
+ "app_slug": "cortex",
24
+ "entry_point": "./index.tsx",
25
+ "manifest": "./manifest.json"
26
+ }
27
+ }
package/seed/roles.json CHANGED
@@ -2,7 +2,7 @@
2
2
  {
3
3
  "slug": "support",
4
4
  "name": "Support",
5
- "description": "Support agent with full CRM and support access",
5
+ "description": "Support agent with access to tickets, community moderation, and knowledge base management",
6
6
  "permissions": ["*"],
7
7
  "is_system": true,
8
8
  "is_active": true,