@eventop/sdk 1.2.13 → 1.2.14

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/dist/core.cjs CHANGED
@@ -486,7 +486,13 @@ function buildSystemPrompt(config) {
486
486
  var _f$screen;
487
487
  return (_f$screen = f.screen) === null || _f$screen === void 0 ? void 0 : _f$screen.id;
488
488
  }).map(f => f.screen.id))];
489
- const featureSummary = (config.features || []).map(f => {
489
+
490
+ // Split features into live (current page) and ghost (other pages).
491
+ // This lets the AI understand what's immediately available vs reachable
492
+ // via navigation, and craft the right message when something isn't found.
493
+ const liveFeatures = (config.features || []).filter(f => !f._ghost);
494
+ const ghostFeatures = (config.features || []).filter(f => f._ghost);
495
+ const summarise = f => {
490
496
  var _f$screen2, _f$flow;
491
497
  const entry = {
492
498
  id: f.id,
@@ -501,15 +507,18 @@ function buildSystemPrompt(config) {
501
507
  entry.note = `This feature has ${f.flow.length} sequential sub-steps. Include ONE step per flow entry.`;
502
508
  }
503
509
  return entry;
504
- });
510
+ };
511
+ const liveSection = liveFeatures.length ? `CURRENT PAGE FEATURES (user is here now):\n${JSON.stringify(liveFeatures.map(summarise), null, 2)}` : `CURRENT PAGE FEATURES: none registered yet.`;
512
+ const ghostSection = ghostFeatures.length ? `OTHER PAGE FEATURES (reachable via navigation — SDK handles it automatically):\n${JSON.stringify(ghostFeatures.map(summarise), null, 2)}` : '';
505
513
  return `
506
514
  You are an in-app assistant called "${config.assistantName || 'AI Guide'}" for "${config.appName}".
507
515
  Your ONLY job: guide users step-by-step through tasks using the feature map below.
508
516
 
509
- ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. Features are screen-specific. The SDK handles navigation — just pick the right features.` : ''}
517
+ ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. The SDK navigates automatically — just pick the right feature id.` : ''}
518
+
519
+ ${liveSection}
510
520
 
511
- FEATURE MAP (only reference IDs from this list):
512
- ${JSON.stringify(featureSummary, null, 2)}
521
+ ${ghostSection}
513
522
 
514
523
  RESPOND ONLY with this exact JSON — no markdown, no extra text:
515
524
  {
@@ -526,16 +535,26 @@ RESPOND ONLY with this exact JSON — no markdown, no extra text:
526
535
  }
527
536
 
528
537
  RULES:
529
- 1. The step "id" MUST match a feature id from the feature map.
538
+ 1. The step "id" MUST match a feature id from the current page or other page features above.
530
539
  2. Only use selectors and IDs from the feature map. Never invent them.
531
- 3. No matching feature steps: [], explain kindly in message.
532
- 4. position values: top | bottom | left | right | auto only.
533
- 5. Order steps logically. For multi-step flows, order as the user encounters them.
534
- 6. For forms: ALWAYS include a step for the form section or first input BEFORE the
540
+ 3. position values: top | bottom | left | right | auto only.
541
+ 4. Order steps logically. For multi-step flows, order as the user encounters them.
542
+ 5. For forms: ALWAYS include a step for the form section or first input BEFORE the
535
543
  continue/submit button. The button step must always be LAST in its section.
536
- 7. If a feature has a flow, include one step per flow entry using the same feature id —
544
+ 6. If a feature has a flow, include one step per flow entry using the same feature id —
537
545
  the SDK expands them automatically.
538
- 8. Never skip features in a required sequence. Include every step end-to-end.
546
+ 7. Never skip features in a required sequence. Include every step end-to-end.
547
+
548
+ WHEN THE USER'S REQUEST DOESN'T MATCH ANY FEATURE:
549
+ - If it partially matches something (e.g. they said "create template" and there's a
550
+ "template-gallery" feature): guide them to the closest matching feature and explain
551
+ what it does. Don't say you can't help.
552
+ - If it matches a feature on another page (ghost): include that feature's steps normally.
553
+ The SDK will navigate there automatically. Do NOT tell the user to navigate manually.
554
+ - If there is genuinely no match anywhere in the feature map: set steps to [] and say
555
+ something like "That doesn't seem to be a feature in ${config.appName} yet. Here's
556
+ what I can help you with:" then list 2-3 relevant features from the map by name.
557
+ Never say you "can only guide through available features" — always offer alternatives.
539
558
  `.trim();
540
559
  }
541
560
 
package/dist/core.js CHANGED
@@ -484,7 +484,13 @@ function buildSystemPrompt(config) {
484
484
  var _f$screen;
485
485
  return (_f$screen = f.screen) === null || _f$screen === void 0 ? void 0 : _f$screen.id;
486
486
  }).map(f => f.screen.id))];
487
- const featureSummary = (config.features || []).map(f => {
487
+
488
+ // Split features into live (current page) and ghost (other pages).
489
+ // This lets the AI understand what's immediately available vs reachable
490
+ // via navigation, and craft the right message when something isn't found.
491
+ const liveFeatures = (config.features || []).filter(f => !f._ghost);
492
+ const ghostFeatures = (config.features || []).filter(f => f._ghost);
493
+ const summarise = f => {
488
494
  var _f$screen2, _f$flow;
489
495
  const entry = {
490
496
  id: f.id,
@@ -499,15 +505,18 @@ function buildSystemPrompt(config) {
499
505
  entry.note = `This feature has ${f.flow.length} sequential sub-steps. Include ONE step per flow entry.`;
500
506
  }
501
507
  return entry;
502
- });
508
+ };
509
+ const liveSection = liveFeatures.length ? `CURRENT PAGE FEATURES (user is here now):\n${JSON.stringify(liveFeatures.map(summarise), null, 2)}` : `CURRENT PAGE FEATURES: none registered yet.`;
510
+ const ghostSection = ghostFeatures.length ? `OTHER PAGE FEATURES (reachable via navigation — SDK handles it automatically):\n${JSON.stringify(ghostFeatures.map(summarise), null, 2)}` : '';
503
511
  return `
504
512
  You are an in-app assistant called "${config.assistantName || 'AI Guide'}" for "${config.appName}".
505
513
  Your ONLY job: guide users step-by-step through tasks using the feature map below.
506
514
 
507
- ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. Features are screen-specific. The SDK handles navigation — just pick the right features.` : ''}
515
+ ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. The SDK navigates automatically — just pick the right feature id.` : ''}
516
+
517
+ ${liveSection}
508
518
 
509
- FEATURE MAP (only reference IDs from this list):
510
- ${JSON.stringify(featureSummary, null, 2)}
519
+ ${ghostSection}
511
520
 
512
521
  RESPOND ONLY with this exact JSON — no markdown, no extra text:
513
522
  {
@@ -524,16 +533,26 @@ RESPOND ONLY with this exact JSON — no markdown, no extra text:
524
533
  }
525
534
 
526
535
  RULES:
527
- 1. The step "id" MUST match a feature id from the feature map.
536
+ 1. The step "id" MUST match a feature id from the current page or other page features above.
528
537
  2. Only use selectors and IDs from the feature map. Never invent them.
529
- 3. No matching feature steps: [], explain kindly in message.
530
- 4. position values: top | bottom | left | right | auto only.
531
- 5. Order steps logically. For multi-step flows, order as the user encounters them.
532
- 6. For forms: ALWAYS include a step for the form section or first input BEFORE the
538
+ 3. position values: top | bottom | left | right | auto only.
539
+ 4. Order steps logically. For multi-step flows, order as the user encounters them.
540
+ 5. For forms: ALWAYS include a step for the form section or first input BEFORE the
533
541
  continue/submit button. The button step must always be LAST in its section.
534
- 7. If a feature has a flow, include one step per flow entry using the same feature id —
542
+ 6. If a feature has a flow, include one step per flow entry using the same feature id —
535
543
  the SDK expands them automatically.
536
- 8. Never skip features in a required sequence. Include every step end-to-end.
544
+ 7. Never skip features in a required sequence. Include every step end-to-end.
545
+
546
+ WHEN THE USER'S REQUEST DOESN'T MATCH ANY FEATURE:
547
+ - If it partially matches something (e.g. they said "create template" and there's a
548
+ "template-gallery" feature): guide them to the closest matching feature and explain
549
+ what it does. Don't say you can't help.
550
+ - If it matches a feature on another page (ghost): include that feature's steps normally.
551
+ The SDK will navigate there automatically. Do NOT tell the user to navigate manually.
552
+ - If there is genuinely no match anywhere in the feature map: set steps to [] and say
553
+ something like "That doesn't seem to be a feature in ${config.appName} yet. Here's
554
+ what I can help you with:" then list 2-3 relevant features from the map by name.
555
+ Never say you "can only guide through available features" — always offer alternatives.
537
556
  `.trim();
538
557
  }
539
558
 
@@ -486,7 +486,13 @@ function buildSystemPrompt(config) {
486
486
  var _f$screen;
487
487
  return (_f$screen = f.screen) === null || _f$screen === void 0 ? void 0 : _f$screen.id;
488
488
  }).map(f => f.screen.id))];
489
- const featureSummary = (config.features || []).map(f => {
489
+
490
+ // Split features into live (current page) and ghost (other pages).
491
+ // This lets the AI understand what's immediately available vs reachable
492
+ // via navigation, and craft the right message when something isn't found.
493
+ const liveFeatures = (config.features || []).filter(f => !f._ghost);
494
+ const ghostFeatures = (config.features || []).filter(f => f._ghost);
495
+ const summarise = f => {
490
496
  var _f$screen2, _f$flow;
491
497
  const entry = {
492
498
  id: f.id,
@@ -501,15 +507,18 @@ function buildSystemPrompt(config) {
501
507
  entry.note = `This feature has ${f.flow.length} sequential sub-steps. Include ONE step per flow entry.`;
502
508
  }
503
509
  return entry;
504
- });
510
+ };
511
+ const liveSection = liveFeatures.length ? `CURRENT PAGE FEATURES (user is here now):\n${JSON.stringify(liveFeatures.map(summarise), null, 2)}` : `CURRENT PAGE FEATURES: none registered yet.`;
512
+ const ghostSection = ghostFeatures.length ? `OTHER PAGE FEATURES (reachable via navigation — SDK handles it automatically):\n${JSON.stringify(ghostFeatures.map(summarise), null, 2)}` : '';
505
513
  return `
506
514
  You are an in-app assistant called "${config.assistantName || 'AI Guide'}" for "${config.appName}".
507
515
  Your ONLY job: guide users step-by-step through tasks using the feature map below.
508
516
 
509
- ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. Features are screen-specific. The SDK handles navigation — just pick the right features.` : ''}
517
+ ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. The SDK navigates automatically — just pick the right feature id.` : ''}
518
+
519
+ ${liveSection}
510
520
 
511
- FEATURE MAP (only reference IDs from this list):
512
- ${JSON.stringify(featureSummary, null, 2)}
521
+ ${ghostSection}
513
522
 
514
523
  RESPOND ONLY with this exact JSON — no markdown, no extra text:
515
524
  {
@@ -526,16 +535,26 @@ RESPOND ONLY with this exact JSON — no markdown, no extra text:
526
535
  }
527
536
 
528
537
  RULES:
529
- 1. The step "id" MUST match a feature id from the feature map.
538
+ 1. The step "id" MUST match a feature id from the current page or other page features above.
530
539
  2. Only use selectors and IDs from the feature map. Never invent them.
531
- 3. No matching feature steps: [], explain kindly in message.
532
- 4. position values: top | bottom | left | right | auto only.
533
- 5. Order steps logically. For multi-step flows, order as the user encounters them.
534
- 6. For forms: ALWAYS include a step for the form section or first input BEFORE the
540
+ 3. position values: top | bottom | left | right | auto only.
541
+ 4. Order steps logically. For multi-step flows, order as the user encounters them.
542
+ 5. For forms: ALWAYS include a step for the form section or first input BEFORE the
535
543
  continue/submit button. The button step must always be LAST in its section.
536
- 7. If a feature has a flow, include one step per flow entry using the same feature id —
544
+ 6. If a feature has a flow, include one step per flow entry using the same feature id —
537
545
  the SDK expands them automatically.
538
- 8. Never skip features in a required sequence. Include every step end-to-end.
546
+ 7. Never skip features in a required sequence. Include every step end-to-end.
547
+
548
+ WHEN THE USER'S REQUEST DOESN'T MATCH ANY FEATURE:
549
+ - If it partially matches something (e.g. they said "create template" and there's a
550
+ "template-gallery" feature): guide them to the closest matching feature and explain
551
+ what it does. Don't say you can't help.
552
+ - If it matches a feature on another page (ghost): include that feature's steps normally.
553
+ The SDK will navigate there automatically. Do NOT tell the user to navigate manually.
554
+ - If there is genuinely no match anywhere in the feature map: set steps to [] and say
555
+ something like "That doesn't seem to be a feature in ${config.appName} yet. Here's
556
+ what I can help you with:" then list 2-3 relevant features from the map by name.
557
+ Never say you "can only guide through available features" — always offer alternatives.
539
558
  `.trim();
540
559
  }
541
560
 
@@ -484,7 +484,13 @@ function buildSystemPrompt(config) {
484
484
  var _f$screen;
485
485
  return (_f$screen = f.screen) === null || _f$screen === void 0 ? void 0 : _f$screen.id;
486
486
  }).map(f => f.screen.id))];
487
- const featureSummary = (config.features || []).map(f => {
487
+
488
+ // Split features into live (current page) and ghost (other pages).
489
+ // This lets the AI understand what's immediately available vs reachable
490
+ // via navigation, and craft the right message when something isn't found.
491
+ const liveFeatures = (config.features || []).filter(f => !f._ghost);
492
+ const ghostFeatures = (config.features || []).filter(f => f._ghost);
493
+ const summarise = f => {
488
494
  var _f$screen2, _f$flow;
489
495
  const entry = {
490
496
  id: f.id,
@@ -499,15 +505,18 @@ function buildSystemPrompt(config) {
499
505
  entry.note = `This feature has ${f.flow.length} sequential sub-steps. Include ONE step per flow entry.`;
500
506
  }
501
507
  return entry;
502
- });
508
+ };
509
+ const liveSection = liveFeatures.length ? `CURRENT PAGE FEATURES (user is here now):\n${JSON.stringify(liveFeatures.map(summarise), null, 2)}` : `CURRENT PAGE FEATURES: none registered yet.`;
510
+ const ghostSection = ghostFeatures.length ? `OTHER PAGE FEATURES (reachable via navigation — SDK handles it automatically):\n${JSON.stringify(ghostFeatures.map(summarise), null, 2)}` : '';
503
511
  return `
504
512
  You are an in-app assistant called "${config.assistantName || 'AI Guide'}" for "${config.appName}".
505
513
  Your ONLY job: guide users step-by-step through tasks using the feature map below.
506
514
 
507
- ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. Features are screen-specific. The SDK handles navigation — just pick the right features.` : ''}
515
+ ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. The SDK navigates automatically — just pick the right feature id.` : ''}
516
+
517
+ ${liveSection}
508
518
 
509
- FEATURE MAP (only reference IDs from this list):
510
- ${JSON.stringify(featureSummary, null, 2)}
519
+ ${ghostSection}
511
520
 
512
521
  RESPOND ONLY with this exact JSON — no markdown, no extra text:
513
522
  {
@@ -524,16 +533,26 @@ RESPOND ONLY with this exact JSON — no markdown, no extra text:
524
533
  }
525
534
 
526
535
  RULES:
527
- 1. The step "id" MUST match a feature id from the feature map.
536
+ 1. The step "id" MUST match a feature id from the current page or other page features above.
528
537
  2. Only use selectors and IDs from the feature map. Never invent them.
529
- 3. No matching feature steps: [], explain kindly in message.
530
- 4. position values: top | bottom | left | right | auto only.
531
- 5. Order steps logically. For multi-step flows, order as the user encounters them.
532
- 6. For forms: ALWAYS include a step for the form section or first input BEFORE the
538
+ 3. position values: top | bottom | left | right | auto only.
539
+ 4. Order steps logically. For multi-step flows, order as the user encounters them.
540
+ 5. For forms: ALWAYS include a step for the form section or first input BEFORE the
533
541
  continue/submit button. The button step must always be LAST in its section.
534
- 7. If a feature has a flow, include one step per flow entry using the same feature id —
542
+ 6. If a feature has a flow, include one step per flow entry using the same feature id —
535
543
  the SDK expands them automatically.
536
- 8. Never skip features in a required sequence. Include every step end-to-end.
544
+ 7. Never skip features in a required sequence. Include every step end-to-end.
545
+
546
+ WHEN THE USER'S REQUEST DOESN'T MATCH ANY FEATURE:
547
+ - If it partially matches something (e.g. they said "create template" and there's a
548
+ "template-gallery" feature): guide them to the closest matching feature and explain
549
+ what it does. Don't say you can't help.
550
+ - If it matches a feature on another page (ghost): include that feature's steps normally.
551
+ The SDK will navigate there automatically. Do NOT tell the user to navigate manually.
552
+ - If there is genuinely no match anywhere in the feature map: set steps to [] and say
553
+ something like "That doesn't seem to be a feature in ${config.appName} yet. Here's
554
+ what I can help you with:" then list 2-3 relevant features from the map by name.
555
+ Never say you "can only guide through available features" — always offer alternatives.
537
556
  `.trim();
538
557
  }
539
558
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventop/sdk",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "AI-powered guided tours for any web app. Drop-in, themeable, provider-agnostic.",
5
5
  "keywords": [
6
6
  "onboarding",