File size: 5,183 Bytes
ad7840f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**

 * Non-linear onboarding paths for the chat welcome screen.

 * Only root nodes (tier 0) show initially; deeper steps unlock as prerequisites complete.

 */

export const PATH_SECTION_TITLE = 'Find your way';

/** @typedef {'scroll_suggestions'|'open_profile'|'navigate_journey'|'navigate_canvas'|'open_user_guide'|'open_model_status'|'navigate_signup'|'none'} PathActionType */

/**

 * @typedef {Object} PathNode

 * @property {string} id

 * @property {number} tier

 * @property {string} title

 * @property {string} tagline

 * @property {string} guide

 * @property {{ type: PathActionType, label?: string }} action

 * @property {string[]} [requires] - all must be completed

 * @property {string[]} [requiresAny] - at least one must be completed

 * @property {string} icon - Lucide icon name

 * @property {boolean} [guestOnly]

 * @property {boolean} [signedInOnly]

 */

/** @type {PathNode[]} */
export const PATH_NODES = [
  {
    id: 'first-question',
    tier: 0,
    title: 'Ask your first question',
    tagline: 'Start with a suggested prompt',
    guide:
      'Scroll to “Practical Next Steps” and tap any chip. Your panel answers in the carousel — no need to pick a topic up here.',
    action: { type: 'scroll_suggestions', label: 'Show suggestions' },
    icon: 'MessageCircle',
  },
  {
    id: 'your-profile',
    tier: 0,
    title: 'Build your profile',
    tagline: 'Role, org & context',
    guide:
      'Open About You and add a few facts — who you are, what you protect, and what you’re worried about. Advisors use this in every reply.',
    action: { type: 'open_profile', label: 'Open About You' },
    icon: 'UserCircle',
  },
  {
    id: 'your-journey',
    tier: 0,
    title: 'Set your journey',
    tagline: 'Goal → milestones',
    guide:
      'The Journey page turns a security goal into trackable steps — baseline hardening, audit prep, IR readiness, or career growth.',
    action: { type: 'navigate_journey', label: 'Open Journey' },
    icon: 'Map',
  },
  {
    id: 'your-workspace',
    tier: 0,
    title: 'Open workspace',
    tagline: 'Drafts & references',
    guide:
      'Workspace is where you pin sources, build checklists, and draft policies. Search arXiv, NIST, NVD, and CISA without leaving the app.',
    action: { type: 'navigate_canvas', label: 'Open workspace' },
    icon: 'FileText',
  },
  {
    id: 'stated-goal',
    tier: 1,
    title: 'Name your priority',
    tagline: 'One line advisors remember',
    guide:
      'Add a stated goal in About You — e.g. “SOC 2 for a 50-person SaaS” or “home network hardening.” Starters and follow-ups adapt to it.',
    action: { type: 'open_profile', label: 'Set your goal' },
    requiresAny: ['your-profile', 'your-journey'],
    icon: 'Target',
  },
  {
    id: 'add-references',
    tier: 1,
    title: 'Add reference material',
    tagline: 'Upload or paste sources',
    guide:
      'Attach PDFs in chat, paste from your clipboard into context, or pull citations from workspace search. Ground advice in your policies and standards.',
    action: { type: 'open_user_guide', label: 'See how' },
    requiresAny: ['your-workspace', 'first-question'],
    icon: 'BookmarkPlus',
  },
  {
    id: 'pick-advisors',
    tier: 1,
    title: 'Shape your panel',
    tagline: 'Turn specialists on/off',
    guide:
      'Use the advisor menu in the header to add or remove experts. Jerry stays as lead; invite compliance, IR, or career mentors when the topic fits.',
    action: { type: 'none', label: 'Got it' },
    requires: ['first-question'],
    icon: 'Users',
  },
  {
    id: 'explore-guide',
    tier: 1,
    title: 'Skim the user guide',
    tagline: '2-minute feature map',
    guide:
      'The guide covers chat, workspace widgets, Journey tracks, and profile memory — useful when you want the full layout before diving in.',
    action: { type: 'open_user_guide', label: 'Open guide' },
    requiresAny: ['first-question', 'your-workspace'],
    icon: 'BookOpen',
  },
  {
    id: 'model-status',
    tier: 2,
    title: 'Check advisor availability',
    tagline: 'See who’s online',
    guide:
      'Settings → Model Status probes each advisor endpoint. Unavailable models are hidden from the panel so you’re not waiting on a dead API.',
    action: { type: 'open_model_status', label: 'Open model status' },
    requires: ['first-question'],
    signedInOnly: true,
    icon: 'Activity',
  },
  {
    id: 'save-progress',
    tier: 2,
    title: 'Create an account',
    tagline: 'Keep chats & progress',
    guide:
      'Guest mode is temporary. Sign up to save profile, Journey, workspace layout, and chat history across devices.',
    action: { type: 'navigate_signup', label: 'Create account' },
    requiresAny: ['your-profile', 'your-journey', 'first-question'],
    guestOnly: true,
    icon: 'KeyRound',
  },
];

export const ROOT_NODE_IDS = PATH_NODES.filter((n) => n.tier === 0).map((n) => n.id);

export function getPathNode(id) {
  return PATH_NODES.find((n) => n.id === id) || null;
}