@molroo-io/sdk 0.8.4 → 0.9.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 (43) hide show
  1. package/dist/cjs/errors.d.ts +1 -1
  2. package/dist/cjs/errors.d.ts.map +1 -1
  3. package/dist/cjs/errors.js +2 -1
  4. package/dist/cjs/index.d.ts +4 -2
  5. package/dist/cjs/index.d.ts.map +1 -1
  6. package/dist/cjs/index.js +5 -1
  7. package/dist/cjs/persona/conversation.d.ts +63 -0
  8. package/dist/cjs/persona/conversation.d.ts.map +1 -0
  9. package/dist/cjs/persona/conversation.js +70 -0
  10. package/dist/cjs/persona.d.ts +187 -2
  11. package/dist/cjs/persona.d.ts.map +1 -1
  12. package/dist/cjs/persona.js +195 -2
  13. package/dist/cjs/shared/errors.d.ts +28 -2
  14. package/dist/cjs/shared/errors.d.ts.map +1 -1
  15. package/dist/cjs/shared/errors.js +29 -2
  16. package/dist/cjs/types.d.ts +52 -5
  17. package/dist/cjs/types.d.ts.map +1 -1
  18. package/dist/cjs/types.js +2 -1
  19. package/dist/cjs/world/world.d.ts +5 -2
  20. package/dist/cjs/world/world.d.ts.map +1 -1
  21. package/dist/cjs/world/world.js +5 -2
  22. package/dist/esm/errors.d.ts +1 -1
  23. package/dist/esm/errors.d.ts.map +1 -1
  24. package/dist/esm/errors.js +1 -1
  25. package/dist/esm/index.d.ts +4 -2
  26. package/dist/esm/index.d.ts.map +1 -1
  27. package/dist/esm/index.js +3 -1
  28. package/dist/esm/persona/conversation.d.ts +63 -0
  29. package/dist/esm/persona/conversation.d.ts.map +1 -0
  30. package/dist/esm/persona/conversation.js +66 -0
  31. package/dist/esm/persona.d.ts +187 -2
  32. package/dist/esm/persona.d.ts.map +1 -1
  33. package/dist/esm/persona.js +196 -3
  34. package/dist/esm/shared/errors.d.ts +28 -2
  35. package/dist/esm/shared/errors.d.ts.map +1 -1
  36. package/dist/esm/shared/errors.js +28 -1
  37. package/dist/esm/types.d.ts +52 -5
  38. package/dist/esm/types.d.ts.map +1 -1
  39. package/dist/esm/types.js +1 -1
  40. package/dist/esm/world/world.d.ts +5 -2
  41. package/dist/esm/world/world.d.ts.map +1 -1
  42. package/dist/esm/world/world.js +5 -2
  43. package/package.json +1 -1
@@ -39,6 +39,7 @@ const errors_1 = require("./errors");
39
39
  const api_client_1 = require("./api-client");
40
40
  const memory_pipeline_1 = require("./persona/memory-pipeline");
41
41
  const chat_orchestrator_1 = require("./persona/chat-orchestrator");
42
+ const conversation_1 = require("./persona/conversation");
42
43
  // ── SDK Persona Types ──
43
44
  const DEFAULT_BASE_URL = 'https://api.molroo.io';
44
45
  // ── MolrooPersona ──
@@ -60,9 +61,11 @@ class MolrooPersona {
60
61
  this.appraisalMode = config.appraisalMode ?? 'direct';
61
62
  }
62
63
  // ── Properties ──
64
+ /** Unique persona instance ID. */
63
65
  get id() {
64
66
  return this._personaId;
65
67
  }
68
+ /** @deprecated Use {@link id} instead. */
66
69
  get personaId() {
67
70
  return this._personaId;
68
71
  }
@@ -71,7 +74,7 @@ class MolrooPersona {
71
74
  if (typeof input === 'string') {
72
75
  if (!config.llm) {
73
76
  throw new errors_1.MolrooApiError('LLM adapter is required when using description string. ' +
74
- 'Provide llm option or use explicit PersonaConfigData.', 'LLM_REQUIRED', 400);
77
+ 'Provide llm option or use explicit PersonaConfigData.', errors_1.MolrooErrorCode.LLM_REQUIRED, 400);
75
78
  }
76
79
  const { generatePersona } = await Promise.resolve().then(() => __importStar(require('./generate/persona')));
77
80
  const llm = await (0, resolve_1.resolveLLM)(config.llm);
@@ -106,6 +109,23 @@ class MolrooPersona {
106
109
  static async generate(config, description) {
107
110
  return MolrooPersona.create(config, description);
108
111
  }
112
+ /**
113
+ * Connect to an existing persona by ID.
114
+ *
115
+ * @param config - Connection configuration (apiKey required).
116
+ * @param personaId - The persona instance ID to connect to.
117
+ * @returns A connected MolrooPersona instance.
118
+ *
119
+ * @deprecated Use {@link Molroo.connectPersona} instead.
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const sera = await MolrooPersona.connect(
124
+ * { apiKey: 'mk_...', llm: openaiAdapter },
125
+ * 'persona_abc123'
126
+ * );
127
+ * ```
128
+ */
109
129
  static async connect(config, personaId) {
110
130
  const [llm, engineLlm] = await Promise.all([
111
131
  config.llm ? (0, resolve_1.resolveLLM)(config.llm) : undefined,
@@ -118,6 +138,12 @@ class MolrooPersona {
118
138
  });
119
139
  return persona;
120
140
  }
141
+ /**
142
+ * List all personas for the authenticated tenant.
143
+ *
144
+ * @param config - API connection config.
145
+ * @returns Paginated list of persona summaries.
146
+ */
121
147
  static async listPersonas(config) {
122
148
  const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
123
149
  const client = (0, api_client_1.createApiClient)(baseUrl, config.apiKey);
@@ -125,6 +151,14 @@ class MolrooPersona {
125
151
  return (0, api_client_1.unwrap)(data);
126
152
  }
127
153
  // ── Runtime ──
154
+ /**
155
+ * Send a stimulus to the persona's emotion engine and get the updated emotional response.
156
+ * This is the low-level API — for common cases, prefer {@link hear}, {@link experience}, or {@link chat}.
157
+ *
158
+ * @param message - The stimulus text (user message, event description, etc.).
159
+ * @param options - Appraisal, source, relationship context, and other options.
160
+ * @returns Emotion engine response with VAD, discrete emotion, and side effects.
161
+ */
128
162
  async perceive(message, options) {
129
163
  const eventType = options?.type ?? 'chat_message';
130
164
  const sourceName = typeof options?.from === 'string'
@@ -161,9 +195,92 @@ class MolrooPersona {
161
195
  }
162
196
  return response;
163
197
  }
198
+ /**
199
+ * Send a custom event with a required appraisal vector.
200
+ *
201
+ * @param type - Custom event type (e.g., 'gift_received', 'argument').
202
+ * @param description - Human-readable event description.
203
+ * @param options - Must include a pre-computed appraisal vector.
204
+ * @returns Emotion engine response.
205
+ */
164
206
  async event(type, description, options) {
165
207
  return this.perceive(description, { ...options, type });
166
208
  }
209
+ /**
210
+ * Perceive a chat message from another entity. Simplest wrapper over {@link perceive}.
211
+ *
212
+ * @param message - The incoming message text.
213
+ * @param from - Who sent the message (name string or structured context).
214
+ * @returns Emotion engine response.
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * const response = await persona.hear('How are you?', 'Alice');
219
+ * ```
220
+ */
221
+ async hear(message, from) {
222
+ return this.perceive(message, { from, type: 'chat_message' });
223
+ }
224
+ /**
225
+ * Perceive an environmental or narrative event with a pre-computed appraisal.
226
+ *
227
+ * @param description - What happened (e.g., 'The sun set over the ocean').
228
+ * @param appraisal - 9-dimensional Scherer CPM appraisal vector.
229
+ * @returns Emotion engine response.
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * const response = await persona.experience('Received a surprise gift', {
234
+ * goal_relevance: 0.8, goal_congruence: 0.9, expectedness: 0.2,
235
+ * controllability: 0.5, agency: 0.3, norm_compatibility: 0.8,
236
+ * internal_standards: 0.7, adjustment_potential: 0.6, urgency: 0.3,
237
+ * });
238
+ * ```
239
+ */
240
+ async experience(description, appraisal) {
241
+ return this.perceive(description, { appraisal, type: 'environment' });
242
+ }
243
+ /**
244
+ * Perceive a social interaction with relationship context for trust/intimacy computation.
245
+ *
246
+ * @param message - The interaction message.
247
+ * @param from - Who the interaction is from.
248
+ * @param relationship - Current relationship state (closeness, trust, familiarity).
249
+ * @returns Emotion engine response including socialUpdates.
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * const response = await persona.socialize('I missed you!', 'Bob', {
254
+ * closeness: 0.7, trust: 0.8, familiarity: 0.9, type: 'friend',
255
+ * });
256
+ * console.log(response.socialUpdates); // trust/intimacy deltas
257
+ * ```
258
+ */
259
+ async socialize(message, from, relationship) {
260
+ return this.perceive(message, { from, relationshipContext: relationship, type: 'chat_message' });
261
+ }
262
+ /**
263
+ * Send a message and get an LLM-generated response with emotion processing.
264
+ * This is the primary method for conversational interactions.
265
+ *
266
+ * The system prompt is assembled server-side via {@link getPromptContext} and includes:
267
+ * identity, behavioral instructions, current psychological state, expression style,
268
+ * and consumerSuffix. Do NOT duplicate these in consumerSuffix.
269
+ *
270
+ * @param message - User message to respond to.
271
+ * @param options - Conversation history, source entity, and app-specific suffix.
272
+ * @returns LLM response text, emotion data, and updated conversation history.
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * const result = await persona.chat('Tell me about yourself', {
277
+ * from: 'Alice',
278
+ * history: previousMessages,
279
+ * });
280
+ * console.log(result.text); // LLM response
281
+ * console.log(result.response.emotion); // updated VAD
282
+ * ```
283
+ */
167
284
  async chat(message, options) {
168
285
  const llm = this.requireLLM();
169
286
  const deps = {
@@ -179,6 +296,13 @@ class MolrooPersona {
179
296
  };
180
297
  return (0, chat_orchestrator_1.chat)(deps, message, options);
181
298
  }
299
+ /**
300
+ * Advance persona simulation time. Triggers idle decay, body budget recovery,
301
+ * need regression, and timeline advancement.
302
+ *
303
+ * @param seconds - Number of seconds to advance (must be >= 1).
304
+ * @returns Any pending internal events generated by threshold checks.
305
+ */
182
306
  async tick(seconds) {
183
307
  const { data } = await this.client.POST('/personas/{id}/tick', {
184
308
  params: { path: { id: this._personaId } },
@@ -186,6 +310,12 @@ class MolrooPersona {
186
310
  });
187
311
  return (0, api_client_1.unwrap)(data);
188
312
  }
313
+ /**
314
+ * Override the persona's current emotion to a specific VAD point.
315
+ * Useful for testing or narrative-driven emotion control.
316
+ *
317
+ * @param vad - Partial VAD values to set (V: valence, A: arousal, D: dominance).
318
+ */
189
319
  async setEmotion(vad) {
190
320
  await this.client.POST('/personas/{id}/emotion', {
191
321
  params: { path: { id: this._personaId } },
@@ -217,6 +347,13 @@ class MolrooPersona {
217
347
  * Once set, expression constraints (promptText) are automatically
218
348
  * included in getPromptContext() and modulated by current emotion.
219
349
  */
350
+ /**
351
+ * Set a StyleProfile for expression-aware prompt generation.
352
+ * Once set, expression constraints are automatically included in
353
+ * {@link getPromptContext} and modulated by current emotion.
354
+ *
355
+ * @param profile - StyleProfile object (lexical, structural, register features, etc.).
356
+ */
220
357
  async setStyleProfile(profile) {
221
358
  await this.client.POST('/personas/{id}/style-profile', {
222
359
  params: { path: { id: this._personaId } },
@@ -240,18 +377,34 @@ class MolrooPersona {
240
377
  return result.styleProfile;
241
378
  }
242
379
  // ── State ──
380
+ /**
381
+ * Get the persona's current emotional and psychological state.
382
+ *
383
+ * @returns Current emotion (VAD + discrete), mood, somatic sensations, and narrative.
384
+ */
243
385
  async getState() {
244
386
  const { data } = await this.client.GET('/personas/{id}/state', {
245
387
  params: { path: { id: this._personaId } },
246
388
  });
247
389
  return (0, api_client_1.unwrap)(data);
248
390
  }
391
+ /**
392
+ * Get a full snapshot of the persona (config + engine state).
393
+ * Useful for backup, migration, or debugging.
394
+ *
395
+ * @returns Full persona snapshot including config and internal state.
396
+ */
249
397
  async getSnapshot() {
250
398
  const { data } = await this.client.GET('/personas/{id}/snapshot', {
251
399
  params: { path: { id: this._personaId } },
252
400
  });
253
401
  return (0, api_client_1.unwrap)(data);
254
402
  }
403
+ /**
404
+ * Restore a persona from a snapshot. Overwrites current state entirely.
405
+ *
406
+ * @param snapshot - Full persona snapshot to restore.
407
+ */
255
408
  async putSnapshot(snapshot) {
256
409
  await this.client.PUT('/personas/{id}/snapshot', {
257
410
  params: { path: { id: this._personaId } },
@@ -259,6 +412,11 @@ class MolrooPersona {
259
412
  });
260
413
  }
261
414
  // ── Config ──
415
+ /**
416
+ * Partially update persona configuration (identity, personality, goals, etc.).
417
+ *
418
+ * @param updates - Fields to update. Only provided fields are changed.
419
+ */
262
420
  async patch(updates) {
263
421
  await this.client.PATCH('/personas/{id}', {
264
422
  params: { path: { id: this._personaId } },
@@ -266,6 +424,9 @@ class MolrooPersona {
266
424
  });
267
425
  }
268
426
  // ── Lifecycle ──
427
+ /**
428
+ * Soft-delete this persona. Can be restored within retention period via {@link restore}.
429
+ */
269
430
  async destroy() {
270
431
  if (this._personaId) {
271
432
  await this.client.DELETE('/personas/{id}', {
@@ -273,6 +434,7 @@ class MolrooPersona {
273
434
  });
274
435
  }
275
436
  }
437
+ /** Restore a soft-deleted persona. */
276
438
  async restore() {
277
439
  if (this._personaId) {
278
440
  await this.client.POST('/personas/{id}/restore', {
@@ -281,6 +443,18 @@ class MolrooPersona {
281
443
  }
282
444
  }
283
445
  // ── Prompt / Memory ──
446
+ /**
447
+ * Fetch the server-assembled system prompt for this persona.
448
+ * Includes identity, behavioral instructions, psychological state,
449
+ * expression style (if StyleProfile set), and consumerSuffix.
450
+ *
451
+ * Called internally by {@link chat}. Use directly when building custom LLM pipelines.
452
+ *
453
+ * @param consumerSuffix - App-specific context appended to the system prompt.
454
+ * Do NOT include identity, personality, or emotion — these are already in the prompt.
455
+ * @param sourceEntity - Name of the conversation partner (for interlocutor-aware prompts).
456
+ * @returns System prompt string and structured persona prompt data.
457
+ */
284
458
  async getPromptContext(consumerSuffix, sourceEntity) {
285
459
  const { data } = await this.client.POST('/personas/{id}/prompt-context', {
286
460
  params: { path: { id: this._personaId } },
@@ -291,6 +465,25 @@ class MolrooPersona {
291
465
  });
292
466
  return (0, api_client_1.unwrap)(data);
293
467
  }
468
+ // ── Conversation ──
469
+ /**
470
+ * Create a conversation session that auto-manages message history.
471
+ * Each `.send()` call automatically appends to the history.
472
+ *
473
+ * @param options - Max messages or custom chat options.
474
+ * @returns A new Conversation instance bound to this persona.
475
+ *
476
+ * @example
477
+ * ```typescript
478
+ * const conv = persona.conversation({ maxMessages: 20 });
479
+ * const r1 = await conv.send('Hello!');
480
+ * const r2 = await conv.send('Tell me more'); // history auto-managed
481
+ * console.log(conv.messages); // full conversation
482
+ * ```
483
+ */
484
+ conversation(options) {
485
+ return new conversation_1.Conversation(this, options);
486
+ }
294
487
  // ── Private ──
295
488
  get memoryPipelineDeps() {
296
489
  return {
@@ -303,7 +496,7 @@ class MolrooPersona {
303
496
  }
304
497
  requireLLM() {
305
498
  if (!this.llm) {
306
- throw new errors_1.MolrooApiError('LLM adapter is required for chat(). Provide llm option, or use perceive() directly.', 'LLM_NOT_CONFIGURED', 400);
499
+ throw new errors_1.MolrooApiError('LLM adapter is required for chat(). Provide llm option, or use perceive() directly.', errors_1.MolrooErrorCode.LLM_NOT_CONFIGURED, 400);
307
500
  }
308
501
  return this.llm;
309
502
  }
@@ -3,14 +3,40 @@
3
3
  *
4
4
  * `instanceof MolrooApiError` catches ALL API errors (persona + world).
5
5
  * `instanceof WorldApiError` catches world-only errors.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { MolrooApiError, MolrooErrorCode } from '@molroo-io/sdk';
10
+ *
11
+ * try {
12
+ * await persona.chat('hello');
13
+ * } catch (e) {
14
+ * if (e instanceof MolrooApiError && e.code === MolrooErrorCode.LLM_NOT_CONFIGURED) {
15
+ * console.log('Please provide an LLM adapter');
16
+ * }
17
+ * }
18
+ * ```
6
19
  */
20
+ /** Machine-readable error codes for programmatic error handling. */
21
+ export declare enum MolrooErrorCode {
22
+ /** LLM adapter is required for this operation (e.g., description-based create). */
23
+ LLM_REQUIRED = "LLM_REQUIRED",
24
+ /** LLM adapter was not configured at initialization (e.g., calling chat() without llm). */
25
+ LLM_NOT_CONFIGURED = "LLM_NOT_CONFIGURED",
26
+ /** Requested entity (persona, world, etc.) was not found. */
27
+ ENTITY_NOT_FOUND = "ENTITY_NOT_FOUND",
28
+ /** Authentication failed — invalid or missing API key. */
29
+ UNAUTHORIZED = "UNAUTHORIZED",
30
+ /** API returned an unexpected error not covered by other codes. */
31
+ API_ERROR = "API_ERROR"
32
+ }
7
33
  export declare class MolrooApiError extends Error {
8
- /** Machine-readable error code (e.g., 'ENTITY_NOT_FOUND', 'UNAUTHORIZED'). */
34
+ /** Machine-readable error code. Use {@link MolrooErrorCode} for type-safe matching. */
9
35
  readonly code: string;
10
36
  /** HTTP status code. */
11
37
  readonly status: number;
12
38
  constructor(message: string,
13
- /** Machine-readable error code (e.g., 'ENTITY_NOT_FOUND', 'UNAUTHORIZED'). */
39
+ /** Machine-readable error code. Use {@link MolrooErrorCode} for type-safe matching. */
14
40
  code: string,
15
41
  /** HTTP status code. */
16
42
  status: number);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,cAAe,SAAQ,KAAK;IAGrC,8EAA8E;aAC9D,IAAI,EAAE,MAAM;IAC5B,wBAAwB;aACR,MAAM,EAAE,MAAM;gBAJ9B,OAAO,EAAE,MAAM;IACf,8EAA8E;IAC9D,IAAI,EAAE,MAAM;IAC5B,wBAAwB;IACR,MAAM,EAAE,MAAM;CAKjC;AAED,qBAAa,aAAc,SAAQ,cAAc;gBACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI1D"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/shared/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,oEAAoE;AACpE,oBAAY,eAAe;IACzB,mFAAmF;IACnF,YAAY,iBAAiB;IAC7B,2FAA2F;IAC3F,kBAAkB,uBAAuB;IACzC,6DAA6D;IAC7D,gBAAgB,qBAAqB;IACrC,0DAA0D;IAC1D,YAAY,iBAAiB;IAC7B,mEAAmE;IACnE,SAAS,cAAc;CACxB;AAED,qBAAa,cAAe,SAAQ,KAAK;IAGrC,uFAAuF;aACvE,IAAI,EAAE,MAAM;IAC5B,wBAAwB;aACR,MAAM,EAAE,MAAM;gBAJ9B,OAAO,EAAE,MAAM;IACf,uFAAuF;IACvE,IAAI,EAAE,MAAM;IAC5B,wBAAwB;IACR,MAAM,EAAE,MAAM;CAKjC;AAED,qBAAa,aAAc,SAAQ,cAAc;gBACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI1D"}
@@ -4,12 +4,39 @@
4
4
  *
5
5
  * `instanceof MolrooApiError` catches ALL API errors (persona + world).
6
6
  * `instanceof WorldApiError` catches world-only errors.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { MolrooApiError, MolrooErrorCode } from '@molroo-io/sdk';
11
+ *
12
+ * try {
13
+ * await persona.chat('hello');
14
+ * } catch (e) {
15
+ * if (e instanceof MolrooApiError && e.code === MolrooErrorCode.LLM_NOT_CONFIGURED) {
16
+ * console.log('Please provide an LLM adapter');
17
+ * }
18
+ * }
19
+ * ```
7
20
  */
8
21
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.WorldApiError = exports.MolrooApiError = void 0;
22
+ exports.WorldApiError = exports.MolrooApiError = exports.MolrooErrorCode = void 0;
23
+ /** Machine-readable error codes for programmatic error handling. */
24
+ var MolrooErrorCode;
25
+ (function (MolrooErrorCode) {
26
+ /** LLM adapter is required for this operation (e.g., description-based create). */
27
+ MolrooErrorCode["LLM_REQUIRED"] = "LLM_REQUIRED";
28
+ /** LLM adapter was not configured at initialization (e.g., calling chat() without llm). */
29
+ MolrooErrorCode["LLM_NOT_CONFIGURED"] = "LLM_NOT_CONFIGURED";
30
+ /** Requested entity (persona, world, etc.) was not found. */
31
+ MolrooErrorCode["ENTITY_NOT_FOUND"] = "ENTITY_NOT_FOUND";
32
+ /** Authentication failed — invalid or missing API key. */
33
+ MolrooErrorCode["UNAUTHORIZED"] = "UNAUTHORIZED";
34
+ /** API returned an unexpected error not covered by other codes. */
35
+ MolrooErrorCode["API_ERROR"] = "API_ERROR";
36
+ })(MolrooErrorCode || (exports.MolrooErrorCode = MolrooErrorCode = {}));
10
37
  class MolrooApiError extends Error {
11
38
  constructor(message,
12
- /** Machine-readable error code (e.g., 'ENTITY_NOT_FOUND', 'UNAUTHORIZED'). */
39
+ /** Machine-readable error code. Use {@link MolrooErrorCode} for type-safe matching. */
13
40
  code,
14
41
  /** HTTP status code. */
15
42
  status) {
@@ -21,6 +21,19 @@ export interface InterlocutorContext {
21
21
  /** Arbitrary key-value extensions rendered as subsections. */
22
22
  extensions?: Record<string, string>;
23
23
  }
24
+ /** Relationship state between two entities, used for social update computation. */
25
+ export interface RelationshipContext {
26
+ /** Overall closeness/intimacy (0–1). */
27
+ closeness?: number;
28
+ /** Mutual trust level (0–1). */
29
+ trust?: number;
30
+ /** How well they know each other (0–1). */
31
+ familiarity?: number;
32
+ /** Relationship type label. */
33
+ type?: 'friend' | 'romantic' | 'authority' | 'stranger' | string;
34
+ /** Additional relationship-specific fields. */
35
+ [key: string]: unknown;
36
+ }
24
37
  type PerceiveBody = RequestBody<'/personas/{id}/perceive', 'post'>;
25
38
  export type PerceiveEvent = PerceiveBody['event'];
26
39
  export type PerceiveContext = NonNullable<PerceiveBody['context']>;
@@ -38,7 +51,7 @@ export interface PerceiveOptions {
38
51
  type?: string;
39
52
  /** Low-level stimulus overrides (bodyBudgetDelta, vadOverride, etc.). */
40
53
  stimulus?: PerceiveEvent['stimulus'];
41
- /** Extra payload fields merged into event.payload alongside message. */
54
+ /** Extra payload fields merged into event.payload alongside message (app-specific data). */
42
55
  payload?: Record<string, unknown>;
43
56
  /** Prior episodic memories for context-aware appraisal. */
44
57
  priorEpisodes?: Episode[];
@@ -46,7 +59,7 @@ export interface PerceiveOptions {
46
59
  * When provided, the engine computes trust/intimacy/proximity deltas
47
60
  * and emits socialUpdates in the response.
48
61
  * Typically sourced from World-level storage (D1). */
49
- relationshipContext?: Record<string, unknown>;
62
+ relationshipContext?: RelationshipContext;
50
63
  /** Skip saving memoryEpisode to the episode store. Default: false. */
51
64
  skipMemory?: boolean;
52
65
  }
@@ -58,7 +71,34 @@ export interface EventAppraisal {
58
71
  relationship: 'friend' | 'romantic' | 'authority' | 'stranger';
59
72
  intensity: number;
60
73
  }
61
- export type PersonaDynamicState = Record<string, unknown>;
74
+ /** Full dynamic state returned by the persona state endpoint. */
75
+ export interface PersonaDynamicState {
76
+ emotion: {
77
+ vad: VAD;
78
+ discrete?: {
79
+ primary: string;
80
+ secondary?: string;
81
+ intensity: number;
82
+ };
83
+ };
84
+ mood?: {
85
+ vad: VAD;
86
+ };
87
+ somatic?: string[];
88
+ narrative?: {
89
+ tone: number;
90
+ agency: number;
91
+ coherence: number;
92
+ };
93
+ goals?: Goal[];
94
+ bodyBudget?: number;
95
+ soulStage?: {
96
+ id: number;
97
+ name: string;
98
+ };
99
+ /** Additional engine-specific fields. */
100
+ [key: string]: unknown;
101
+ }
62
102
  export type BlendRatio = Record<string, number>;
63
103
  export interface AgentResponse {
64
104
  text?: string;
@@ -143,7 +183,14 @@ export interface SocialUpdate {
143
183
  dimension: string;
144
184
  delta: number;
145
185
  }
146
- export type PersonaSnapshot = Record<string, unknown>;
186
+ /** Full persona snapshot including engine state, config, and metadata. */
187
+ export interface PersonaSnapshot {
188
+ config?: PersonaConfigData;
189
+ state?: State;
190
+ engineVersion?: string;
191
+ /** Additional engine-specific fields. */
192
+ [key: string]: unknown;
193
+ }
147
194
  /**
148
195
  * HEXACO-PI-R personality domain traits (Ashton & Lee, 2007).
149
196
  * Each value ranges from 0 (low) to 1 (high).
@@ -272,5 +319,5 @@ export interface State {
272
319
  regulation: RegulationState;
273
320
  prevMaskIntegrity?: number;
274
321
  }
275
- export { MolrooApiError } from './errors';
322
+ export { MolrooApiError, MolrooErrorCode } from './errors';
276
323
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI7C,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAIjF,MAAM,MAAM,WAAW,CACrB,CAAC,SAAS,MAAM,KAAK,EACrB,CAAC,SAAS,MAAM,GAAG,KAAK,GAAG,OAAO,IAChC,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE;YAAE,kBAA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AAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
package/dist/cjs/types.js CHANGED
@@ -9,7 +9,8 @@
9
9
  // Pipeline: Engine Zod schemas → @hono/zod-openapi → OpenAPI JSON → openapi-typescript → api.d.ts
10
10
  // ============================================================================
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MolrooApiError = void 0;
12
+ exports.MolrooErrorCode = exports.MolrooApiError = void 0;
13
13
  // ── Error (re-exported from errors.ts) ──
14
14
  var errors_1 = require("./errors");
15
15
  Object.defineProperty(exports, "MolrooApiError", { enumerable: true, get: function () { return errors_1.MolrooApiError; } });
16
+ Object.defineProperty(exports, "MolrooErrorCode", { enumerable: true, get: function () { return errors_1.MolrooErrorCode; } });
@@ -99,8 +99,11 @@ export declare class Molroo {
99
99
  */
100
100
  getWorld(id: string): Promise<World>;
101
101
  /**
102
- * List worlds. Returns raw data objects (not World instances) for
103
- * efficiency when only metadata is needed.
102
+ * List worlds for the authenticated tenant.
103
+ * Returns raw data objects (not World instances) for efficiency when only metadata is needed.
104
+ *
105
+ * @param options - Pagination options (limit, cursor).
106
+ * @returns Paginated list of world data and next cursor.
104
107
  */
105
108
  listWorlds(options?: PaginationOptions): Promise<{
106
109
  worlds: WorldData[];
@@ -1 +1 @@
1
- {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../../src/world/world.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aA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AAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC;IAwB9D;;OAEG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAmB1C;;;;;;OAMG;IACG,UAAU,CACd,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC;QAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CA6B/D"}
@@ -114,8 +114,11 @@ class Molroo {
114
114
  return new world_domain_1.World(this._client, toWorldData(raw));
115
115
  }
116
116
  /**
117
- * List worlds. Returns raw data objects (not World instances) for
118
- * efficiency when only metadata is needed.
117
+ * List worlds for the authenticated tenant.
118
+ * Returns raw data objects (not World instances) for efficiency when only metadata is needed.
119
+ *
120
+ * @param options - Pagination options (limit, cursor).
121
+ * @returns Paginated list of world data and next cursor.
119
122
  */
120
123
  async listWorlds(options) {
121
124
  const { data } = await this._client.GET('/worlds', {
@@ -1,2 +1,2 @@
1
- export { MolrooApiError } from './shared/errors';
1
+ export { MolrooApiError, MolrooErrorCode } from './shared/errors';
2
2
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- export { MolrooApiError } from './shared/errors';
1
+ export { MolrooApiError, MolrooErrorCode } from './shared/errors';
@@ -30,14 +30,16 @@
30
30
  */
31
31
  export { Molroo } from './world/world';
32
32
  export type { MolrooOptions, PersonaOptions } from './world/world';
33
- export { MolrooApiError, WorldApiError } from './shared/errors';
33
+ export { MolrooApiError, WorldApiError, MolrooErrorCode } from './shared/errors';
34
34
  export { NEUTRAL_APPRAISAL, toWireAppraisal, fromWireAppraisal } from './shared/appraisal';
35
35
  export type { Appraisal } from './shared/appraisal';
36
36
  export type { LLMAdapter, Message, GenerateTextOptions, GenerateObjectOptions, } from './llm/adapter';
37
37
  export type { LLMInput } from './llm/resolve';
38
38
  export type { MemoryAdapter, RecallQuery, SemanticRecallOptions, RecallLimits, Reflection, } from './memory/types';
39
39
  export type { PersonaSummary, PersonaState, PersonaChatResult, } from './persona';
40
- export type { AppraisalMode, EventAppraisal, InterlocutorContext, PerceiveOptions, PerceiveEvent, PerceiveContext, } from './types';
40
+ export { Conversation } from './persona/conversation';
41
+ export type { ConversationOptions } from './persona/conversation';
42
+ export type { AppraisalMode, EventAppraisal, InterlocutorContext, RelationshipContext, PerceiveOptions, PerceiveEvent, PerceiveContext, } from './types';
41
43
  export type { AgentResponse, VAD, Velocity, AppraisalVector, State, SoulStage, CatastropheState, MetacogState, AffectDynamicsState, InterpersonalState, RegulationState, RegulationStrategy, RegulationPhase, ActiveRegulation, RegulationRecord, EffectivenessRecord, NeedState, Episode, SocialUpdate, ReflectionPrompt, } from './types';
42
44
  export type { PersonaSnapshot, PersonaConfigData, PersonalityTraits, Identity, Goal, MotivationContext, } from './types';
43
45
  export type { ApiResponse, ApiErrorResponse, PersonaDynamicState, } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB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