@firststep-studio/sdk 0.5.0 → 0.7.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.
- package/dist/index.d.mts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +55 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +55 -0
- package/dist/server.mjs.map +1 -1
- package/dist/{types-fhi9K2il.d.mts → types-DCrYoOfK.d.mts} +54 -1
- package/dist/{types-fhi9K2il.d.ts → types-DCrYoOfK.d.ts} +54 -1
- package/package.json +1 -1
|
@@ -154,6 +154,8 @@ interface ProtocolContext {
|
|
|
154
154
|
knowledge: KnowledgeContext;
|
|
155
155
|
/** Integration access */
|
|
156
156
|
integrations: IntegrationContext;
|
|
157
|
+
/** Handler document store (backed by Studio MongoDB) */
|
|
158
|
+
storage?: StorageContext;
|
|
157
159
|
/** Analytics tracking */
|
|
158
160
|
analytics: AnalyticsContext;
|
|
159
161
|
/** Logging */
|
|
@@ -313,9 +315,28 @@ interface SchemaQuestion {
|
|
|
313
315
|
negative: string;
|
|
314
316
|
};
|
|
315
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Optional context about the chatbot for persona generation and testing.
|
|
320
|
+
* Handlers can provide as much or as little as they have available.
|
|
321
|
+
*/
|
|
322
|
+
interface SchemaBrief {
|
|
323
|
+
/** What the chatbot does */
|
|
324
|
+
description?: string;
|
|
325
|
+
/** Target audience description (e.g. "Teens and young adults aged 13-25") */
|
|
326
|
+
audience?: string;
|
|
327
|
+
/** Chatbot goals/objectives */
|
|
328
|
+
goals?: string[];
|
|
329
|
+
/** Stage/agent objectives for richer persona context */
|
|
330
|
+
stageDescriptions?: Array<{
|
|
331
|
+
id: string;
|
|
332
|
+
objective: string;
|
|
333
|
+
}>;
|
|
334
|
+
}
|
|
316
335
|
interface SchemaDeclarationPayload {
|
|
317
336
|
agents: SchemaAgent[];
|
|
318
337
|
questions: SchemaQuestion[];
|
|
338
|
+
/** Optional context for virtual persona testing and simulation */
|
|
339
|
+
brief?: SchemaBrief;
|
|
319
340
|
}
|
|
320
341
|
/**
|
|
321
342
|
* Agent transition payload - sent when the conversation moves to a new stage.
|
|
@@ -379,6 +400,38 @@ interface Helpline {
|
|
|
379
400
|
website?: string;
|
|
380
401
|
description?: string;
|
|
381
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Handler document store backed by Studio MongoDB.
|
|
405
|
+
* Opaque to Studio: stores data but never reads or interprets it.
|
|
406
|
+
* Key naming, data structure, and lifecycle are the handler's responsibility.
|
|
407
|
+
* All operations are scoped to the deployment (isolated by JWT token).
|
|
408
|
+
*/
|
|
409
|
+
interface StorageContext {
|
|
410
|
+
/** Get a value by key. Returns null if not found. */
|
|
411
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
412
|
+
/** Set a value by key. Overwrites if exists. */
|
|
413
|
+
set(key: string, value: unknown, options?: StorageSetOptions): Promise<void>;
|
|
414
|
+
/** Delete a key. */
|
|
415
|
+
delete(key: string): Promise<void>;
|
|
416
|
+
/** Check if key exists. */
|
|
417
|
+
has(key: string): Promise<boolean>;
|
|
418
|
+
/** List keys matching a prefix. Returns all keys if no prefix given. */
|
|
419
|
+
keys(prefix?: string): Promise<string[]>;
|
|
420
|
+
/**
|
|
421
|
+
* Shallow merge a partial object into an existing value.
|
|
422
|
+
* Creates the key if it doesn't exist.
|
|
423
|
+
*/
|
|
424
|
+
merge(key: string, partial: Record<string, unknown>): Promise<void>;
|
|
425
|
+
/**
|
|
426
|
+
* Append an item to an array stored at key.
|
|
427
|
+
* Creates the array if the key doesn't exist.
|
|
428
|
+
*/
|
|
429
|
+
append(key: string, item: unknown): Promise<void>;
|
|
430
|
+
}
|
|
431
|
+
interface StorageSetOptions {
|
|
432
|
+
/** TTL in seconds. Key auto-deletes after expiry. */
|
|
433
|
+
ttl?: number;
|
|
434
|
+
}
|
|
382
435
|
interface LoggerContext {
|
|
383
436
|
debug(message: string, data?: Record<string, unknown>): void;
|
|
384
437
|
info(message: string, data?: Record<string, unknown>): void;
|
|
@@ -598,4 +651,4 @@ interface HandoffInboundContext {
|
|
|
598
651
|
returnResult?: HandoffReturnPayload;
|
|
599
652
|
}
|
|
600
653
|
|
|
601
|
-
export type { AgentTransitionPayload as A,
|
|
654
|
+
export type { AgentTransitionPayload as A, ClassifierConfig as B, ChatMessage as C, DeploymentInfo as D, FormFieldValue as E, FormData as F, RoutingLog as G, HandoffRequestPayload as H, IntegrationContext as I, SessionMetadata as J, KnowledgeContext as K, LoggerContext as L, AnalyticsContext as M, InteractionEvent as N, InteractionEventType as O, ProtocolStreamChunk as P, FormSchema as Q, RoutingClassificationPayload as R, SchemaDeclarationPayload as S, FormFieldDefinition as T, FormFieldType as U, ProtocolRegistration as V, SchemaAgent as W, SchemaQuestion as X, HandoffContext as Y, HandoffOptions as Z, HandoffReturnPayload as a, HandoffOfferPayload as b, ProtocolRequest as c, ProtocolResponse as d, SessionStatus as e, HandoffInboundContext as f, ProtocolForm as g, ProtocolFormField as h, ProtocolFormOption as i, ProtocolFieldValidation as j, ProtocolError as k, ProtocolHandler as l, ProtocolCapabilities as m, HandlerInfo as n, ProtocolContext as o, SessionContext as p, SessionState as q, KnowledgeResult as r, IntegrationResult as s, HelplineSearchOptions as t, HelplineResult as u, Helpline as v, StorageContext as w, StorageSetOptions as x, RoutingDecision as y, ChatbotInfo as z };
|
|
@@ -154,6 +154,8 @@ interface ProtocolContext {
|
|
|
154
154
|
knowledge: KnowledgeContext;
|
|
155
155
|
/** Integration access */
|
|
156
156
|
integrations: IntegrationContext;
|
|
157
|
+
/** Handler document store (backed by Studio MongoDB) */
|
|
158
|
+
storage?: StorageContext;
|
|
157
159
|
/** Analytics tracking */
|
|
158
160
|
analytics: AnalyticsContext;
|
|
159
161
|
/** Logging */
|
|
@@ -313,9 +315,28 @@ interface SchemaQuestion {
|
|
|
313
315
|
negative: string;
|
|
314
316
|
};
|
|
315
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Optional context about the chatbot for persona generation and testing.
|
|
320
|
+
* Handlers can provide as much or as little as they have available.
|
|
321
|
+
*/
|
|
322
|
+
interface SchemaBrief {
|
|
323
|
+
/** What the chatbot does */
|
|
324
|
+
description?: string;
|
|
325
|
+
/** Target audience description (e.g. "Teens and young adults aged 13-25") */
|
|
326
|
+
audience?: string;
|
|
327
|
+
/** Chatbot goals/objectives */
|
|
328
|
+
goals?: string[];
|
|
329
|
+
/** Stage/agent objectives for richer persona context */
|
|
330
|
+
stageDescriptions?: Array<{
|
|
331
|
+
id: string;
|
|
332
|
+
objective: string;
|
|
333
|
+
}>;
|
|
334
|
+
}
|
|
316
335
|
interface SchemaDeclarationPayload {
|
|
317
336
|
agents: SchemaAgent[];
|
|
318
337
|
questions: SchemaQuestion[];
|
|
338
|
+
/** Optional context for virtual persona testing and simulation */
|
|
339
|
+
brief?: SchemaBrief;
|
|
319
340
|
}
|
|
320
341
|
/**
|
|
321
342
|
* Agent transition payload - sent when the conversation moves to a new stage.
|
|
@@ -379,6 +400,38 @@ interface Helpline {
|
|
|
379
400
|
website?: string;
|
|
380
401
|
description?: string;
|
|
381
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Handler document store backed by Studio MongoDB.
|
|
405
|
+
* Opaque to Studio: stores data but never reads or interprets it.
|
|
406
|
+
* Key naming, data structure, and lifecycle are the handler's responsibility.
|
|
407
|
+
* All operations are scoped to the deployment (isolated by JWT token).
|
|
408
|
+
*/
|
|
409
|
+
interface StorageContext {
|
|
410
|
+
/** Get a value by key. Returns null if not found. */
|
|
411
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
412
|
+
/** Set a value by key. Overwrites if exists. */
|
|
413
|
+
set(key: string, value: unknown, options?: StorageSetOptions): Promise<void>;
|
|
414
|
+
/** Delete a key. */
|
|
415
|
+
delete(key: string): Promise<void>;
|
|
416
|
+
/** Check if key exists. */
|
|
417
|
+
has(key: string): Promise<boolean>;
|
|
418
|
+
/** List keys matching a prefix. Returns all keys if no prefix given. */
|
|
419
|
+
keys(prefix?: string): Promise<string[]>;
|
|
420
|
+
/**
|
|
421
|
+
* Shallow merge a partial object into an existing value.
|
|
422
|
+
* Creates the key if it doesn't exist.
|
|
423
|
+
*/
|
|
424
|
+
merge(key: string, partial: Record<string, unknown>): Promise<void>;
|
|
425
|
+
/**
|
|
426
|
+
* Append an item to an array stored at key.
|
|
427
|
+
* Creates the array if the key doesn't exist.
|
|
428
|
+
*/
|
|
429
|
+
append(key: string, item: unknown): Promise<void>;
|
|
430
|
+
}
|
|
431
|
+
interface StorageSetOptions {
|
|
432
|
+
/** TTL in seconds. Key auto-deletes after expiry. */
|
|
433
|
+
ttl?: number;
|
|
434
|
+
}
|
|
382
435
|
interface LoggerContext {
|
|
383
436
|
debug(message: string, data?: Record<string, unknown>): void;
|
|
384
437
|
info(message: string, data?: Record<string, unknown>): void;
|
|
@@ -598,4 +651,4 @@ interface HandoffInboundContext {
|
|
|
598
651
|
returnResult?: HandoffReturnPayload;
|
|
599
652
|
}
|
|
600
653
|
|
|
601
|
-
export type { AgentTransitionPayload as A,
|
|
654
|
+
export type { AgentTransitionPayload as A, ClassifierConfig as B, ChatMessage as C, DeploymentInfo as D, FormFieldValue as E, FormData as F, RoutingLog as G, HandoffRequestPayload as H, IntegrationContext as I, SessionMetadata as J, KnowledgeContext as K, LoggerContext as L, AnalyticsContext as M, InteractionEvent as N, InteractionEventType as O, ProtocolStreamChunk as P, FormSchema as Q, RoutingClassificationPayload as R, SchemaDeclarationPayload as S, FormFieldDefinition as T, FormFieldType as U, ProtocolRegistration as V, SchemaAgent as W, SchemaQuestion as X, HandoffContext as Y, HandoffOptions as Z, HandoffReturnPayload as a, HandoffOfferPayload as b, ProtocolRequest as c, ProtocolResponse as d, SessionStatus as e, HandoffInboundContext as f, ProtocolForm as g, ProtocolFormField as h, ProtocolFormOption as i, ProtocolFieldValidation as j, ProtocolError as k, ProtocolHandler as l, ProtocolCapabilities as m, HandlerInfo as n, ProtocolContext as o, SessionContext as p, SessionState as q, KnowledgeResult as r, IntegrationResult as s, HelplineSearchOptions as t, HelplineResult as u, Helpline as v, StorageContext as w, StorageSetOptions as x, RoutingDecision as y, ChatbotInfo as z };
|