@guidelytech/sdk-core 0.9.0 → 0.11.0

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 (48) hide show
  1. package/README.md +15 -4
  2. package/dist/{capture-Dqd7up2n.d.ts → capture-CgN69Lxq.d.cts} +2 -1
  3. package/dist/{capture-C3faAYb7.d.cts → capture-Csz721-A.d.ts} +2 -1
  4. package/dist/capture.cjs +4 -0
  5. package/dist/capture.cjs.map +1 -1
  6. package/dist/capture.d.cts +3 -2
  7. package/dist/capture.d.ts +3 -2
  8. package/dist/capture.js +4 -6
  9. package/dist/capture.js.map +1 -1
  10. package/dist/chunk-JUSM7J5N.js +376 -0
  11. package/dist/chunk-JUSM7J5N.js.map +1 -0
  12. package/dist/{chunk-544KSOC3.js → chunk-ZAF2KRJA.js} +142 -22
  13. package/dist/chunk-ZAF2KRJA.js.map +1 -0
  14. package/dist/headless.cjs +307 -44
  15. package/dist/headless.cjs.map +1 -1
  16. package/dist/headless.d.cts +44 -3
  17. package/dist/headless.d.ts +44 -3
  18. package/dist/headless.js +21 -9
  19. package/dist/health-sbP9JwTE.d.cts +90 -0
  20. package/dist/health-sbP9JwTE.d.ts +90 -0
  21. package/dist/{http-47tiAlOM.d.ts → http-Cb6KYYFv.d.cts} +10 -35
  22. package/dist/{http-47tiAlOM.d.cts → http-D047Ngxk.d.ts} +10 -35
  23. package/dist/index.cjs +1352 -500
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +81 -8
  26. package/dist/index.d.ts +81 -8
  27. package/dist/index.js +809 -211
  28. package/dist/index.js.map +1 -1
  29. package/dist/recorder.cjs +70 -9
  30. package/dist/recorder.cjs.map +1 -1
  31. package/dist/recorder.d.cts +9 -0
  32. package/dist/recorder.d.ts +9 -0
  33. package/dist/recorder.js +57 -11
  34. package/dist/recorder.js.map +1 -1
  35. package/dist/{types-DnJW_4ck.d.ts → types-BDlebXrm.d.ts} +68 -7
  36. package/dist/{types-zM5e3loY.d.cts → types-Mtlmlj5C.d.cts} +68 -7
  37. package/package.json +4 -4
  38. package/dist/chunk-544KSOC3.js.map +0 -1
  39. package/dist/chunk-AKNE7D5M.js +0 -160
  40. package/dist/chunk-AKNE7D5M.js.map +0 -1
  41. package/dist/chunk-CYAG6ZYX.js +0 -85
  42. package/dist/chunk-CYAG6ZYX.js.map +0 -1
  43. package/dist/chunk-GDF6RCHQ.js +0 -209
  44. package/dist/chunk-GDF6RCHQ.js.map +0 -1
  45. package/dist/types-DbKQPvFt.d.cts +0 -238
  46. package/dist/types-DqhNl5Am.d.ts +0 -238
  47. package/dist/types-RyeRQd9f.d.ts +0 -226
  48. package/dist/types-d4eOerxi.d.cts +0 -226
package/dist/index.d.cts CHANGED
@@ -1,17 +1,19 @@
1
1
  import * as _guidelytech_guide_runtime from '@guidelytech/guide-runtime';
2
2
  import { TargetingContext, PublishedGuide, ProjectTheme, SelectorStrategy, AuthoringPick, AppSnapshot } from '@guidelytech/shared';
3
- export { AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
3
+ export { AgentEventsResponse, AgentOutcome, AgentToolCallInput, AgentTurnInput, AgentTurnRole, AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
4
4
  import { FlagsClient, JsonValue, FlagValue, FlagDetails } from '@guidelytech/flags';
5
5
  export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, JsonValue } from '@guidelytech/flags';
6
6
  import { MessengerTab } from '@guidelytech/guide-runtime/messenger';
7
- import { k as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, l as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-zM5e3loY.cjs';
8
- export { E as EventQueue, b as EventQueueOptions, m as GuideStepInfo, d as GuidelyEnvironment, n as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, i as isExclusiveGuide, h as isFrequencyEligible, j as isWithinSchedule } from './types-zM5e3loY.cjs';
9
- export { K as KEYS, b as KeyValueStore, S as StorageKind, d as createStorage } from './http-47tiAlOM.cjs';
10
- export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-C3faAYb7.cjs';
7
+ import { AgentTurnInput } from '@guidelytech/shared/runtime';
11
8
  export { CAPTURE_PARAM } from '@guidelytech/shared/runtime';
9
+ import { m as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, n as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-Mtlmlj5C.cjs';
10
+ export { A as AgentTurnRedactor, E as EventQueue, b as EventQueueOptions, o as GuideStepInfo, d as GuidelyEnvironment, q as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, g as countsTowardThrottle, i as isExclusiveGuide, j as isFrequencyEligible, k as isThrottleEligible, l as isWithinSchedule, p as pruneLaunches } from './types-Mtlmlj5C.cjs';
11
+ export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-sbP9JwTE.cjs';
12
+ export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-CgN69Lxq.cjs';
13
+ import './http-Cb6KYYFv.cjs';
12
14
 
13
15
  declare const SDK_NAME = "@guidelytech/sdk-core";
14
- declare const SDK_VERSION = "0.9.0";
16
+ declare const SDK_VERSION = "0.11.0";
15
17
  declare const DEFAULT_API_URL = "https://api.guidely.app";
16
18
  /**
17
19
  * Framework-independent Guidely client. Create one per page with {@link createGuidely} or
@@ -24,6 +26,10 @@ declare class GuidelyClient {
24
26
  private readonly sessionStore;
25
27
  private readonly emitter;
26
28
  private readonly queue;
29
+ /** Survey answers and guide/checklist progress, kept until the server accepts them. */
30
+ private readonly outbox;
31
+ /** Agent Analytics turns (agentConversation), in their own outbox. */
32
+ private readonly agentTurns;
27
33
  private config;
28
34
  private etag;
29
35
  private anonymousId;
@@ -72,6 +78,10 @@ declare class GuidelyClient {
72
78
  readonly flags: FlagsClient;
73
79
  /** Experiments already reported this session (`experiment_viewed` is sent once per session). */
74
80
  private exposures;
81
+ /** Language set with `setLocale()`. */
82
+ private locale;
83
+ /** Language each shown guide was rendered in; added to its events as `locale`. */
84
+ private guideLocales;
75
85
  constructor(options: GuidelyOptions);
76
86
  private createFlags;
77
87
  /** Loads config (cache first, then network), wires listeners and evaluates triggers. Idempotent. */
@@ -85,6 +95,8 @@ declare class GuidelyClient {
85
95
  private wireErrorListeners;
86
96
  /** Re-fetches the published config and re-evaluates triggers. */
87
97
  refresh(): Promise<void>;
98
+ /** Re-renders after a config change (refresh, or a config that arrived after start). */
99
+ private applyConfigChange;
88
100
  /** Tears everything down: guides, widgets, listeners, timers, host element. Re-init is allowed via a new client. */
89
101
  destroy(): void;
90
102
  /** Identifies the end user and loads server-held state (audiences, guide history, checklist progress). */
@@ -104,8 +116,18 @@ declare class GuidelyClient {
104
116
  private enqueue;
105
117
  /** Tracks a custom event. Events drive `event` triggers, `advanceOn: "event"` steps and checklist tasks. */
106
118
  track(name: string, properties?: Record<string, unknown>): void;
119
+ /**
120
+ * Agent Analytics: records one or more turns of a conversation with your own AI agent or chatbot
121
+ * (`{ conversationId, agentId, role, text, toolCalls?, latencyMs?, outcome?, … }`). The visitor's
122
+ * anonymous id, user id, account id and session id are filled in, `agents.redact` from the init
123
+ * options runs on each turn, and turns are retried until Guidely accepts them. Returns false when
124
+ * nothing was queued (analytics off or consent denied, or every turn was invalid or dropped).
125
+ */
126
+ agentConversation(turns: AgentTurnInput | AgentTurnInput[]): boolean;
127
+ /** Alias of {@link agentConversation}. */
128
+ trackAgentTurn(turns: AgentTurnInput | AgentTurnInput[]): boolean;
107
129
  /** Records a page view and re-evaluates triggers. Called automatically on SPA navigation. */
108
- page(url?: string): void;
130
+ page(href?: string): void;
109
131
  private readonly customListeners;
110
132
  private readonly eventBus;
111
133
  private handleNavigation;
@@ -155,9 +177,27 @@ declare class GuidelyClient {
155
177
  isRecording(): boolean;
156
178
  /** The current analytics session id (rotates after inactivity; also the replay id). */
157
179
  getSessionId(): string;
180
+ /** The page URL Guidely works with: `options.pageUrl`, else app-relative for `file:` / custom protocols (`normalizeAppUrl`). */
181
+ pageHref(href?: string): string;
158
182
  /** Builds the targeting context for the current moment. */
159
183
  getContext(): TargetingContext;
160
184
  private isTargeted;
185
+ /** Guide throttling: may this guide launch automatically now? */
186
+ private throttleAllows;
187
+ private recordLaunch;
188
+ /** Guides and A/B test control groups, which are evaluated the same way but never render. */
189
+ private candidates;
190
+ private holdoutFor;
191
+ /** The visitor's language candidates, most preferred first. */
192
+ private locales;
193
+ private defaultLocale;
194
+ /** The guide in the visitor's language (remembered so its events carry `locale`). */
195
+ private localize;
196
+ /**
197
+ * Sets the language for guides and the resource center (`null` = back to the traits / browser).
198
+ * Guides already on screen keep their language; the resource center re-renders.
199
+ */
200
+ setLocale(locale: string | null): void;
161
201
  private isEligible;
162
202
  private triggerFires;
163
203
  private evaluate;
@@ -184,6 +224,8 @@ declare class GuidelyClient {
184
224
  /** What the messenger personalises from, computed fresh on every render. */
185
225
  private messengerVisitor;
186
226
  private destroyMessenger;
227
+ /** The resource center's language for this visitor, or null for the default language. */
228
+ private rcLocale;
187
229
  private loadArticle;
188
230
  private searchResourceCenter;
189
231
  /** Current progress for a checklist guide (by id or key). */
@@ -214,11 +256,22 @@ declare class GuidelyClient {
214
256
  /** Opens the Scout messenger (when enabled for the project), optionally on a tab. */
215
257
  openMessenger(tab?: MessengerTab): void;
216
258
  closeMessenger(): void;
259
+ /**
260
+ * Opens a Guidely prototype test (its `/validate/<token>` URL on this SDK's API origin, or the bare
261
+ * token) in a full-screen overlay, attributed to the current user. Returns false, doing nothing, for
262
+ * any other URL. Guide buttons that open a test URL use this automatically.
263
+ */
264
+ openPrototypeTest(urlOrToken: string): boolean;
217
265
  /**
218
266
  * Opens the complaint form in the messenger, optionally with a category picked (its id from
219
267
  * Complaints → Categories). Does nothing when the project doesn't take complaints.
220
268
  */
221
269
  openComplaint(categoryId?: string): void;
270
+ /**
271
+ * Opens the Ideas tab in the messenger (feature requests and voting), or one idea by its id.
272
+ * Does nothing when the project hasn't turned on Ideas.
273
+ */
274
+ openIdeas(requestId?: string): void;
222
275
  /** Opens a new messenger conversation, optionally pre-filling the message. */
223
276
  showNewMessage(text?: string): void;
224
277
  /** Boolean flag value for the current user; `fallback` (default `false`) until loaded or when missing. */
@@ -330,6 +383,10 @@ type Listener = (url: string) => void;
330
383
  */
331
384
  declare function watchNavigation(listener: Listener, debounceMs?: number): () => void;
332
385
 
386
+ declare function normalizeAppUrl(href: string): string;
387
+ /** True for desktop-shell URLs (`file:`, custom protocols such as `app:`), which {@link normalizeAppUrl} makes app-relative. */
388
+ declare function isAppUrl(href: string): boolean;
389
+
333
390
  declare const AUTHORING_PARAM = "guidely_authoring";
334
391
  declare const HEARTBEAT_MS = 15000;
335
392
  /** Messages the SDK posts to the dashboard window (`window.opener`). */
@@ -419,6 +476,22 @@ interface PageLeaveInfo {
419
476
  scrollDepth: number;
420
477
  }
421
478
 
479
+ /**
480
+ * In-app recruitment for Guidely prototype tests (Validate). A guide button that opens a Guidely test URL
481
+ * (`<apiOrigin>/validate/<token>`, same origin as the SDK's API) shows the test in a full-screen overlay
482
+ * iframe instead of navigating away. Attribution (public key, anonymous id, user id) goes in the URL
483
+ * fragment, so it never reaches servers, proxies or logs; the test page reads and clears it.
484
+ *
485
+ * The overlay is a modal dialog: focus moves into it and is trapped between the close button and the
486
+ * test frame, Escape closes it, and it closes when the test page posts `{ type: "guidely:prototype:close" }`.
487
+ */
488
+ declare const PROTOTYPE_CLOSE_MESSAGE = "guidely:prototype:close";
489
+ /**
490
+ * The test URL for a full test URL or a bare token, when it points at this Guidely deployment's
491
+ * `/validate/<token>` page; null for anything else (other origins and paths keep their normal behaviour).
492
+ */
493
+ declare function matchPrototypeTestUrl(urlOrToken: string, apiUrl: string): URL | null;
494
+
422
495
  /**
423
496
  * @guidelytech/sdk-core — framework-independent Guidely browser SDK.
424
497
  *
@@ -434,4 +507,4 @@ declare const Guidely: {
434
507
  version: string;
435
508
  };
436
509
 
437
- export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, watchNavigation };
510
+ export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, PROTOTYPE_CLOSE_MESSAGE, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, isAppUrl, matchPrototypeTestUrl, normalizeAppUrl, watchNavigation };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  import * as _guidelytech_guide_runtime from '@guidelytech/guide-runtime';
2
2
  import { TargetingContext, PublishedGuide, ProjectTheme, SelectorStrategy, AuthoringPick, AppSnapshot } from '@guidelytech/shared';
3
- export { AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
3
+ export { AgentEventsResponse, AgentOutcome, AgentToolCallInput, AgentTurnInput, AgentTurnRole, AppSnapshot, AutocaptureSettings, ExceptionProperties, GuideConfig, GuideStep, PublishedGuide, SdkConfigResponse, SdkEvent, StackFrame, TargetingContext } from '@guidelytech/shared';
4
4
  import { FlagsClient, JsonValue, FlagValue, FlagDetails } from '@guidelytech/flags';
5
5
  export { Attributes, EvaluationResult, FlagDetails, FlagsBootstrap, FlagsClient, FlagsClientOptions, FlagsPayload, JsonValue } from '@guidelytech/flags';
6
6
  import { MessengerTab } from '@guidelytech/guide-runtime/messenger';
7
- import { k as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, l as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-DnJW_4ck.js';
8
- export { E as EventQueue, b as EventQueueOptions, m as GuideStepInfo, d as GuidelyEnvironment, n as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, i as isExclusiveGuide, h as isFrequencyEligible, j as isWithinSchedule } from './types-DnJW_4ck.js';
9
- export { K as KEYS, b as KeyValueStore, S as StorageKind, d as createStorage } from './http-47tiAlOM.js';
10
- export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-Dqd7up2n.js';
7
+ import { AgentTurnInput } from '@guidelytech/shared/runtime';
11
8
  export { CAPTURE_PARAM } from '@guidelytech/shared/runtime';
9
+ import { m as GuidelyOptions, c as GuidelyAccount, a as ConsentState, C as ChecklistProgressState, n as GuidelyEvents, e as GuidelyUser, G as GuideLocalState, S as SessionState } from './types-BDlebXrm.js';
10
+ export { A as AgentTurnRedactor, E as EventQueue, b as EventQueueOptions, o as GuideStepInfo, d as GuidelyEnvironment, q as GuidelyEventName, P as PersistedState, f as areMutuallyExclusive, g as countsTowardThrottle, i as isExclusiveGuide, j as isFrequencyEligible, k as isThrottleEligible, l as isWithinSchedule, p as pruneLaunches } from './types-BDlebXrm.js';
11
+ export { a as KEYS, K as KeyValueStore, c as StorageKind, d as createStorage } from './health-sbP9JwTE.js';
12
+ export { C as CaptureMarker, a as CaptureOutgoingMessage } from './capture-Csz721-A.js';
13
+ import './http-D047Ngxk.js';
12
14
 
13
15
  declare const SDK_NAME = "@guidelytech/sdk-core";
14
- declare const SDK_VERSION = "0.9.0";
16
+ declare const SDK_VERSION = "0.11.0";
15
17
  declare const DEFAULT_API_URL = "https://api.guidely.app";
16
18
  /**
17
19
  * Framework-independent Guidely client. Create one per page with {@link createGuidely} or
@@ -24,6 +26,10 @@ declare class GuidelyClient {
24
26
  private readonly sessionStore;
25
27
  private readonly emitter;
26
28
  private readonly queue;
29
+ /** Survey answers and guide/checklist progress, kept until the server accepts them. */
30
+ private readonly outbox;
31
+ /** Agent Analytics turns (agentConversation), in their own outbox. */
32
+ private readonly agentTurns;
27
33
  private config;
28
34
  private etag;
29
35
  private anonymousId;
@@ -72,6 +78,10 @@ declare class GuidelyClient {
72
78
  readonly flags: FlagsClient;
73
79
  /** Experiments already reported this session (`experiment_viewed` is sent once per session). */
74
80
  private exposures;
81
+ /** Language set with `setLocale()`. */
82
+ private locale;
83
+ /** Language each shown guide was rendered in; added to its events as `locale`. */
84
+ private guideLocales;
75
85
  constructor(options: GuidelyOptions);
76
86
  private createFlags;
77
87
  /** Loads config (cache first, then network), wires listeners and evaluates triggers. Idempotent. */
@@ -85,6 +95,8 @@ declare class GuidelyClient {
85
95
  private wireErrorListeners;
86
96
  /** Re-fetches the published config and re-evaluates triggers. */
87
97
  refresh(): Promise<void>;
98
+ /** Re-renders after a config change (refresh, or a config that arrived after start). */
99
+ private applyConfigChange;
88
100
  /** Tears everything down: guides, widgets, listeners, timers, host element. Re-init is allowed via a new client. */
89
101
  destroy(): void;
90
102
  /** Identifies the end user and loads server-held state (audiences, guide history, checklist progress). */
@@ -104,8 +116,18 @@ declare class GuidelyClient {
104
116
  private enqueue;
105
117
  /** Tracks a custom event. Events drive `event` triggers, `advanceOn: "event"` steps and checklist tasks. */
106
118
  track(name: string, properties?: Record<string, unknown>): void;
119
+ /**
120
+ * Agent Analytics: records one or more turns of a conversation with your own AI agent or chatbot
121
+ * (`{ conversationId, agentId, role, text, toolCalls?, latencyMs?, outcome?, … }`). The visitor's
122
+ * anonymous id, user id, account id and session id are filled in, `agents.redact` from the init
123
+ * options runs on each turn, and turns are retried until Guidely accepts them. Returns false when
124
+ * nothing was queued (analytics off or consent denied, or every turn was invalid or dropped).
125
+ */
126
+ agentConversation(turns: AgentTurnInput | AgentTurnInput[]): boolean;
127
+ /** Alias of {@link agentConversation}. */
128
+ trackAgentTurn(turns: AgentTurnInput | AgentTurnInput[]): boolean;
107
129
  /** Records a page view and re-evaluates triggers. Called automatically on SPA navigation. */
108
- page(url?: string): void;
130
+ page(href?: string): void;
109
131
  private readonly customListeners;
110
132
  private readonly eventBus;
111
133
  private handleNavigation;
@@ -155,9 +177,27 @@ declare class GuidelyClient {
155
177
  isRecording(): boolean;
156
178
  /** The current analytics session id (rotates after inactivity; also the replay id). */
157
179
  getSessionId(): string;
180
+ /** The page URL Guidely works with: `options.pageUrl`, else app-relative for `file:` / custom protocols (`normalizeAppUrl`). */
181
+ pageHref(href?: string): string;
158
182
  /** Builds the targeting context for the current moment. */
159
183
  getContext(): TargetingContext;
160
184
  private isTargeted;
185
+ /** Guide throttling: may this guide launch automatically now? */
186
+ private throttleAllows;
187
+ private recordLaunch;
188
+ /** Guides and A/B test control groups, which are evaluated the same way but never render. */
189
+ private candidates;
190
+ private holdoutFor;
191
+ /** The visitor's language candidates, most preferred first. */
192
+ private locales;
193
+ private defaultLocale;
194
+ /** The guide in the visitor's language (remembered so its events carry `locale`). */
195
+ private localize;
196
+ /**
197
+ * Sets the language for guides and the resource center (`null` = back to the traits / browser).
198
+ * Guides already on screen keep their language; the resource center re-renders.
199
+ */
200
+ setLocale(locale: string | null): void;
161
201
  private isEligible;
162
202
  private triggerFires;
163
203
  private evaluate;
@@ -184,6 +224,8 @@ declare class GuidelyClient {
184
224
  /** What the messenger personalises from, computed fresh on every render. */
185
225
  private messengerVisitor;
186
226
  private destroyMessenger;
227
+ /** The resource center's language for this visitor, or null for the default language. */
228
+ private rcLocale;
187
229
  private loadArticle;
188
230
  private searchResourceCenter;
189
231
  /** Current progress for a checklist guide (by id or key). */
@@ -214,11 +256,22 @@ declare class GuidelyClient {
214
256
  /** Opens the Scout messenger (when enabled for the project), optionally on a tab. */
215
257
  openMessenger(tab?: MessengerTab): void;
216
258
  closeMessenger(): void;
259
+ /**
260
+ * Opens a Guidely prototype test (its `/validate/<token>` URL on this SDK's API origin, or the bare
261
+ * token) in a full-screen overlay, attributed to the current user. Returns false, doing nothing, for
262
+ * any other URL. Guide buttons that open a test URL use this automatically.
263
+ */
264
+ openPrototypeTest(urlOrToken: string): boolean;
217
265
  /**
218
266
  * Opens the complaint form in the messenger, optionally with a category picked (its id from
219
267
  * Complaints → Categories). Does nothing when the project doesn't take complaints.
220
268
  */
221
269
  openComplaint(categoryId?: string): void;
270
+ /**
271
+ * Opens the Ideas tab in the messenger (feature requests and voting), or one idea by its id.
272
+ * Does nothing when the project hasn't turned on Ideas.
273
+ */
274
+ openIdeas(requestId?: string): void;
222
275
  /** Opens a new messenger conversation, optionally pre-filling the message. */
223
276
  showNewMessage(text?: string): void;
224
277
  /** Boolean flag value for the current user; `fallback` (default `false`) until loaded or when missing. */
@@ -330,6 +383,10 @@ type Listener = (url: string) => void;
330
383
  */
331
384
  declare function watchNavigation(listener: Listener, debounceMs?: number): () => void;
332
385
 
386
+ declare function normalizeAppUrl(href: string): string;
387
+ /** True for desktop-shell URLs (`file:`, custom protocols such as `app:`), which {@link normalizeAppUrl} makes app-relative. */
388
+ declare function isAppUrl(href: string): boolean;
389
+
333
390
  declare const AUTHORING_PARAM = "guidely_authoring";
334
391
  declare const HEARTBEAT_MS = 15000;
335
392
  /** Messages the SDK posts to the dashboard window (`window.opener`). */
@@ -419,6 +476,22 @@ interface PageLeaveInfo {
419
476
  scrollDepth: number;
420
477
  }
421
478
 
479
+ /**
480
+ * In-app recruitment for Guidely prototype tests (Validate). A guide button that opens a Guidely test URL
481
+ * (`<apiOrigin>/validate/<token>`, same origin as the SDK's API) shows the test in a full-screen overlay
482
+ * iframe instead of navigating away. Attribution (public key, anonymous id, user id) goes in the URL
483
+ * fragment, so it never reaches servers, proxies or logs; the test page reads and clears it.
484
+ *
485
+ * The overlay is a modal dialog: focus moves into it and is trapped between the close button and the
486
+ * test frame, Escape closes it, and it closes when the test page posts `{ type: "guidely:prototype:close" }`.
487
+ */
488
+ declare const PROTOTYPE_CLOSE_MESSAGE = "guidely:prototype:close";
489
+ /**
490
+ * The test URL for a full test URL or a bare token, when it points at this Guidely deployment's
491
+ * `/validate/<token>` page; null for anything else (other origins and paths keep their normal behaviour).
492
+ */
493
+ declare function matchPrototypeTestUrl(urlOrToken: string, apiUrl: string): URL | null;
494
+
422
495
  /**
423
496
  * @guidelytech/sdk-core — framework-independent Guidely browser SDK.
424
497
  *
@@ -434,4 +507,4 @@ declare const Guidely: {
434
507
  version: string;
435
508
  };
436
509
 
437
- export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, watchNavigation };
510
+ export { AUTHORING_PARAM, type AuthoringIncomingMessage, type AuthoringOutgoingMessage, ChecklistProgressState, type ClickProperties, ConsentState, type ContextInput, DEFAULT_API_URL, type DeviceInfo, GuideLocalState, Guidely, GuidelyAccount, GuidelyClient, GuidelyEvents, GuidelyOptions, GuidelyUser, HEARTBEAT_MS, PROTOTYPE_CLOSE_MESSAGE, type PageLeaveInfo, SDK_NAME, SDK_VERSION, SessionState, buildContext, captureSnapshot, createGuidely, Guidely as default, detectDevice, isAppUrl, matchPrototypeTestUrl, normalizeAppUrl, watchNavigation };