@sonzai-labs/agents 1.0.8 → 1.0.9
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.cjs +105 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -1
- package/dist/index.d.ts +99 -1
- package/dist/index.js +105 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -288,6 +288,40 @@ interface RelationshipResponse extends Record<string, unknown> {
|
|
|
288
288
|
}
|
|
289
289
|
interface HabitsResponse extends Record<string, unknown> {
|
|
290
290
|
}
|
|
291
|
+
interface Habit {
|
|
292
|
+
id?: string;
|
|
293
|
+
agent_id: string;
|
|
294
|
+
user_id?: string;
|
|
295
|
+
name: string;
|
|
296
|
+
category: string;
|
|
297
|
+
description: string;
|
|
298
|
+
display_name?: string;
|
|
299
|
+
strength: number;
|
|
300
|
+
formed: boolean;
|
|
301
|
+
observation_count: number;
|
|
302
|
+
last_reinforced_at?: string;
|
|
303
|
+
formed_at?: string;
|
|
304
|
+
created_at?: string;
|
|
305
|
+
updated_at?: string;
|
|
306
|
+
}
|
|
307
|
+
interface CreateHabitOptions {
|
|
308
|
+
userId?: string;
|
|
309
|
+
name: string;
|
|
310
|
+
category?: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
displayName?: string;
|
|
313
|
+
strength?: number;
|
|
314
|
+
}
|
|
315
|
+
interface UpdateHabitOptions {
|
|
316
|
+
userId?: string;
|
|
317
|
+
category?: string;
|
|
318
|
+
description?: string;
|
|
319
|
+
displayName?: string;
|
|
320
|
+
strength?: number;
|
|
321
|
+
}
|
|
322
|
+
interface DeleteHabitOptions {
|
|
323
|
+
userId?: string;
|
|
324
|
+
}
|
|
291
325
|
type GoalType = "personal_growth" | "skill_mastery" | "relationship" | "learning_discovery";
|
|
292
326
|
type GoalStatus = "active" | "achieved" | "abandoned";
|
|
293
327
|
type GoalPriority = 0 | 1 | 2;
|
|
@@ -348,6 +382,34 @@ interface UsersResponse extends Record<string, unknown> {
|
|
|
348
382
|
}
|
|
349
383
|
interface ConstellationResponse extends Record<string, unknown> {
|
|
350
384
|
}
|
|
385
|
+
interface ConstellationNode {
|
|
386
|
+
node_id: string;
|
|
387
|
+
agent_id: string;
|
|
388
|
+
user_id?: string;
|
|
389
|
+
node_type: string;
|
|
390
|
+
label: string;
|
|
391
|
+
description?: string;
|
|
392
|
+
significance: number;
|
|
393
|
+
mention_count: number;
|
|
394
|
+
brightness: number;
|
|
395
|
+
first_mentioned_at?: string;
|
|
396
|
+
last_mentioned_at?: string;
|
|
397
|
+
created_at?: string;
|
|
398
|
+
updated_at?: string;
|
|
399
|
+
}
|
|
400
|
+
interface CreateConstellationNodeOptions {
|
|
401
|
+
userId?: string;
|
|
402
|
+
nodeType?: string;
|
|
403
|
+
label: string;
|
|
404
|
+
description?: string;
|
|
405
|
+
significance?: number;
|
|
406
|
+
}
|
|
407
|
+
interface UpdateConstellationNodeOptions {
|
|
408
|
+
label?: string;
|
|
409
|
+
description?: string;
|
|
410
|
+
significance?: number;
|
|
411
|
+
nodeType?: string;
|
|
412
|
+
}
|
|
351
413
|
interface BreakthroughsResponse extends Record<string, unknown> {
|
|
352
414
|
}
|
|
353
415
|
interface WakeupsResponse extends Record<string, unknown> {
|
|
@@ -788,6 +850,24 @@ interface FactListOptions {
|
|
|
788
850
|
limit?: number;
|
|
789
851
|
offset?: number;
|
|
790
852
|
}
|
|
853
|
+
interface CreateFactOptions {
|
|
854
|
+
content: string;
|
|
855
|
+
userId?: string;
|
|
856
|
+
factType?: string;
|
|
857
|
+
importance?: number;
|
|
858
|
+
confidence?: number;
|
|
859
|
+
entities?: string[];
|
|
860
|
+
nodeId?: string;
|
|
861
|
+
metadata?: Record<string, unknown>;
|
|
862
|
+
}
|
|
863
|
+
interface UpdateFactOptions {
|
|
864
|
+
content?: string;
|
|
865
|
+
factType?: string;
|
|
866
|
+
importance?: number;
|
|
867
|
+
confidence?: number;
|
|
868
|
+
entities?: string[];
|
|
869
|
+
metadata?: Record<string, unknown>;
|
|
870
|
+
}
|
|
791
871
|
interface MemoryResetOptions {
|
|
792
872
|
userId?: string;
|
|
793
873
|
instanceId?: string;
|
|
@@ -2000,6 +2080,12 @@ declare class Memory {
|
|
|
2000
2080
|
listFacts(agentId: string, options?: FactListOptions): Promise<FactListResponse>;
|
|
2001
2081
|
/** Reset (delete) all memory for an agent, optionally scoped to a user. */
|
|
2002
2082
|
reset(agentId: string, options?: MemoryResetOptions): Promise<MemoryResetResponse>;
|
|
2083
|
+
/** Create a new fact for an agent. Facts are tagged source_type='manual'. */
|
|
2084
|
+
createFact(agentId: string, options: CreateFactOptions): Promise<AtomicFact>;
|
|
2085
|
+
/** Update an existing fact by ID. */
|
|
2086
|
+
updateFact(agentId: string, factId: string, options: UpdateFactOptions): Promise<AtomicFact>;
|
|
2087
|
+
/** Delete a fact by ID. */
|
|
2088
|
+
deleteFact(agentId: string, factId: string): Promise<void>;
|
|
2003
2089
|
/** Get the version history of a specific fact. */
|
|
2004
2090
|
getFactHistory(agentId: string, factId: string): Promise<FactHistoryResponse>;
|
|
2005
2091
|
}
|
|
@@ -2264,6 +2350,12 @@ declare class Agents {
|
|
|
2264
2350
|
getMoodAggregate(agentId: string, options?: ContextDataOptions): Promise<MoodAggregateResponse>;
|
|
2265
2351
|
getRelationships(agentId: string, options?: ContextDataOptions): Promise<RelationshipResponse>;
|
|
2266
2352
|
getHabits(agentId: string, options?: ContextDataOptions): Promise<HabitsResponse>;
|
|
2353
|
+
/** Create a habit for an agent. Set userId for a per-user habit. */
|
|
2354
|
+
createHabit(agentId: string, options: CreateHabitOptions): Promise<Habit>;
|
|
2355
|
+
/** Update an existing habit by name. */
|
|
2356
|
+
updateHabit(agentId: string, habitName: string, options: UpdateHabitOptions): Promise<Habit>;
|
|
2357
|
+
/** Delete a habit. Set userId for per-user habits. */
|
|
2358
|
+
deleteHabit(agentId: string, habitName: string, options?: DeleteHabitOptions): Promise<void>;
|
|
2267
2359
|
getGoals(agentId: string, options?: ContextDataOptions): Promise<GoalsResponse>;
|
|
2268
2360
|
/** Create a goal for an agent. Set userId to create a per-user goal. */
|
|
2269
2361
|
createGoal(agentId: string, options: CreateGoalOptions): Promise<Goal>;
|
|
@@ -2276,6 +2368,12 @@ declare class Agents {
|
|
|
2276
2368
|
getUsers(agentId: string): Promise<UsersResponse>;
|
|
2277
2369
|
/** Get constellation data for an agent. */
|
|
2278
2370
|
getConstellation(agentId: string, options?: ContextDataOptions): Promise<ConstellationResponse>;
|
|
2371
|
+
/** Create a constellation node (lore) for an agent. */
|
|
2372
|
+
createConstellationNode(agentId: string, options: CreateConstellationNodeOptions): Promise<ConstellationNode>;
|
|
2373
|
+
/** Update an existing constellation node. */
|
|
2374
|
+
updateConstellationNode(agentId: string, nodeId: string, options: UpdateConstellationNodeOptions): Promise<ConstellationNode>;
|
|
2375
|
+
/** Delete a constellation node. */
|
|
2376
|
+
deleteConstellationNode(agentId: string, nodeId: string): Promise<void>;
|
|
2279
2377
|
/** Get breakthroughs for an agent. */
|
|
2280
2378
|
getBreakthroughs(agentId: string, options?: ContextDataOptions): Promise<BreakthroughsResponse>;
|
|
2281
2379
|
/** List agents with optional pagination, search, and project filtering. */
|
|
@@ -2565,4 +2663,4 @@ declare class StreamError extends SonzaiError {
|
|
|
2565
2663
|
constructor(message: string);
|
|
2566
2664
|
}
|
|
2567
2665
|
|
|
2568
|
-
export { APIError, type AcknowledgeAllOptions, type AcknowledgeNotificationsOptions, type AcknowledgeResponse, type AddContentOptions, type AddContentResponse, type Agent, type AgentCapabilities, type AgentIndex, type AgentInstance, type AgentKBSearchOptions, type AgentKBSearchResponse, type AgentKBSearchResult, type AgentListOptions, type AgentListResponse, type AgentToolCapabilities, type AtomicFact, AuthenticationError, BadRequestError, type BatchImportOptions, type BatchImportResponse, type BatchImportUser, type BatchPersonalityEntry, type BatchPersonalityResponse, type Big5, type Big5Scores, type Big5Trait, type BreakthroughsResponse, type ChatChoice, type ChatMessage, type ChatOptions, type ChatResponse, type ChatStreamEvent, type ChatUsage, type ConsolidateOptions, type ConsolidateResponse, type ConstellationResponse, type ContextDataOptions, type CreateAgentOptions, type CreateAnalyticsRuleOptions, type CreateCustomToolOptions, type CreateGoalOptions, type CreateSchemaOptions, type CustomLLMConfigResponse, type CustomState, type CustomStateCreateOptions, type CustomStateDeleteByKeyOptions, type CustomStateGetByKeyOptions, type CustomStateListOptions, type CustomStateListResponse, type CustomStateUpdateOptions, type CustomStateUpsertOptions, type CustomToolDefinition, type CustomToolListResponse, type DeleteGoalOptions, type DeliveryAttemptsResponse, type DialogueOptions, type DialogueResponse, type DiaryResponse, type EnrichedContextResponse, type EvalCategory, type EvalOnlyOptions, type EvalRun, type EvalRunListOptions, type EvalRunListResponse, type EvalTemplate, type EvalTemplateCategory, type EvalTemplateCreateOptions, type EvalTemplateListResponse, type EvalTemplateUpdateOptions, type EvaluateOptions, type EvaluationResult, type ExtractionDimensionDelta, type ExtractionFact, type ExtractionHabit, type ExtractionInnerThoughts, type ExtractionInterest, type ExtractionMoodDelta, type ExtractionPersonalityDelta, type ExtractionProactive, type ExtractionRecurring, type ExtractionRelationshipDelta, type Fact, type FactHistoryResponse, type FactListOptions, type FactListResponse, type GenerateAvatarOptions, type GenerateAvatarResponse, type GenerateBioOptions, type GenerateBioResponse, type GenerateCharacterOptions, type GenerateCharacterResponse, type GenerateSeedMemoriesOptions, type GenerateSeedMemoriesResponse, type GeneratedGoal, type GetContextOptions, type Goal, type GoalPriority, type GoalStatus, type GoalType, type GoalsResponse, type HabitsResponse, type IdentityMemory, type ImageGenerateOptions, type ImageGenerateResponse, type ImportJob, type ImportJobListResponse, type InitialGoal, type InsertFactDetail, type InsertFactEntry, type InsertFactsOptions, type InsertFactsResponse, type InsertRelEntry, type InstanceCreateOptions, type InstanceListResponse, type InterestsResponse, InternalServerError, type InventoryBatchImportOptions, type InventoryBatchImportResponse, type InventoryBatchItem, type InventoryDirectUpdateOptions, type InventoryDirectUpdateResponse, type InventoryGroupResult, type InventoryItem, type InventoryQueryOptions, type InventoryQueryResponse, type InventoryUpdateOptions, type InventoryUpdateResponse, type KBAnalyticsRule, type KBAnalyticsRuleListResponse, type KBBulkUpdateEntry, type KBBulkUpdateOptions, type KBBulkUpdateResponse, type KBCandidate, type KBConversionStats, type KBConversionsResponse, type KBDocument, type KBDocumentListResponse, type KBEdge, type KBEntitySchema, type KBNode, type KBNodeDetailResponse, type KBNodeHistory, type KBNodeHistoryResponse, type KBNodeListResponse, type KBRecommendationScore, type KBRecommendationsResponse, type KBRelatedNode, type KBResolutionInfo, type KBSchemaField, type KBSchemaListResponse, type KBSearchOptions, type KBSearchResponse, type KBSearchResult, type KBSimilarityConfig, type KBStats, type KBTrendAggregation, type KBTrendRanking, type KBTrendRankingsResponse, type KBTrendsResponse, type ListAllFactsOptions, type ListAllFactsResponse, type LoreGenerationContext, type MemoryListOptions, type MemoryNode, type MemoryResetOptions, type MemoryResetResponse, type MemoryResponse, type MemorySearchOptions, type MemorySearchResponse, type MemorySearchResult, type MemorySummary, type MemoryTimelineOptions, type MemoryTimelineResponse, type ModelsProviderEntry, type ModelsResponse, type MoodAggregateResponse, type MoodResponse, NotFoundError, type Notification, type NotificationListOptions, type NotificationListResponse, PermissionDeniedError, type PersonalityBehaviors, type PersonalityDelta, type PersonalityDimensions, type PersonalityGetOptions, type PersonalityPreferences, type PersonalityProfile, type PersonalityResponse, type PersonalityShift, type PersonalityUpdateOptions, type PersonalityUpdateResponse, type PrimeContentBlock, type PrimeUserMetadata, type PrimeUserOptions, type PrimeUserResponse, type ProcessOptions, type ProcessResponse, type ProcessSideEffectsSummary, type ProjectConfigEntry, type ProjectConfigListResponse, type ProjectNotificationListOptions, type ProjectNotificationListResponse, RateLimitError, type RecentShiftsResponse, type RecordFeedbackOptions, type RelationshipResponse, type RunEvalOptions, type RunRef, type SDKBehavioralTraits, type SDKInteractionPreferences, type SDKPersonalityDimensions, type STTOptions, type STTResponse, type ScheduleWakeupOptions, type ScheduledWakeup, type SeedMemoriesOptions, type SeedMemoriesResponse, type SeedMemory, type SessionEndOptions, type SessionResponse, type SessionStartOptions, type SetConfigOptions, type SetCustomLLMOptions, type SetSessionToolsOptions, type SetStatusOptions, type SetStatusResponse, type SideEffectExtraction, type SignificantMoment, type SignificantMomentsResponse, type SimulateOptions, type SimulationConfig, type SimulationEvent, type SimulationSession, Sonzai, type SonzaiConfig, SonzaiError, type StoredFact, StreamError, type StructuredColumnMapping, type StructuredImportSpec, type SummariesOptions, type SummariesResponse, type TTSOptions, type TTSResponse, type TimeMachineMoodSnapshot, type TimeMachineOptions, type TimeMachineResponse, type TimelineSession, type ToolDefinition, type ToolSchema, type ToolSchemasResponse, type TriggerEventOptions, type TriggerEventResponse, type UpdateAgentOptions, type UpdateAnalyticsRuleOptions, type UpdateCapabilitiesOptions, type UpdateCustomToolOptions, type UpdateGoalOptions, type UpdateInstanceOptions, type UpdateMetadataOptions, type UpdateMetadataResponse, type UpdateProjectOptions, type UpdateProjectResponse, type UserOverlayDetailResponse, type UserOverlayOptions, type UserOverlaysListResponse, type UserPersona, type UserPersonalityOverlay, type UserPrimingMetadata, type UsersResponse, type VoiceEntry, type VoiceListOptions, type VoiceListResponse, type VoiceStreamEvent, VoiceStreamInstance, type VoiceStreamToken, type VoiceTokenOptions, type VoiceUsage, type WakeupsResponse, type WebhookDeliveryAttempt, type WebhookEndpoint, type WebhookListResponse, type WebhookRegisterOptions, type WebhookRegisterResponse };
|
|
2666
|
+
export { APIError, type AcknowledgeAllOptions, type AcknowledgeNotificationsOptions, type AcknowledgeResponse, type AddContentOptions, type AddContentResponse, type Agent, type AgentCapabilities, type AgentIndex, type AgentInstance, type AgentKBSearchOptions, type AgentKBSearchResponse, type AgentKBSearchResult, type AgentListOptions, type AgentListResponse, type AgentToolCapabilities, type AtomicFact, AuthenticationError, BadRequestError, type BatchImportOptions, type BatchImportResponse, type BatchImportUser, type BatchPersonalityEntry, type BatchPersonalityResponse, type Big5, type Big5Scores, type Big5Trait, type BreakthroughsResponse, type ChatChoice, type ChatMessage, type ChatOptions, type ChatResponse, type ChatStreamEvent, type ChatUsage, type ConsolidateOptions, type ConsolidateResponse, type ConstellationNode, type ConstellationResponse, type ContextDataOptions, type CreateAgentOptions, type CreateAnalyticsRuleOptions, type CreateConstellationNodeOptions, type CreateCustomToolOptions, type CreateFactOptions, type CreateGoalOptions, type CreateHabitOptions, type CreateSchemaOptions, type CustomLLMConfigResponse, type CustomState, type CustomStateCreateOptions, type CustomStateDeleteByKeyOptions, type CustomStateGetByKeyOptions, type CustomStateListOptions, type CustomStateListResponse, type CustomStateUpdateOptions, type CustomStateUpsertOptions, type CustomToolDefinition, type CustomToolListResponse, type DeleteGoalOptions, type DeleteHabitOptions, type DeliveryAttemptsResponse, type DialogueOptions, type DialogueResponse, type DiaryResponse, type EnrichedContextResponse, type EvalCategory, type EvalOnlyOptions, type EvalRun, type EvalRunListOptions, type EvalRunListResponse, type EvalTemplate, type EvalTemplateCategory, type EvalTemplateCreateOptions, type EvalTemplateListResponse, type EvalTemplateUpdateOptions, type EvaluateOptions, type EvaluationResult, type ExtractionDimensionDelta, type ExtractionFact, type ExtractionHabit, type ExtractionInnerThoughts, type ExtractionInterest, type ExtractionMoodDelta, type ExtractionPersonalityDelta, type ExtractionProactive, type ExtractionRecurring, type ExtractionRelationshipDelta, type Fact, type FactHistoryResponse, type FactListOptions, type FactListResponse, type GenerateAvatarOptions, type GenerateAvatarResponse, type GenerateBioOptions, type GenerateBioResponse, type GenerateCharacterOptions, type GenerateCharacterResponse, type GenerateSeedMemoriesOptions, type GenerateSeedMemoriesResponse, type GeneratedGoal, type GetContextOptions, type Goal, type GoalPriority, type GoalStatus, type GoalType, type GoalsResponse, type Habit, type HabitsResponse, type IdentityMemory, type ImageGenerateOptions, type ImageGenerateResponse, type ImportJob, type ImportJobListResponse, type InitialGoal, type InsertFactDetail, type InsertFactEntry, type InsertFactsOptions, type InsertFactsResponse, type InsertRelEntry, type InstanceCreateOptions, type InstanceListResponse, type InterestsResponse, InternalServerError, type InventoryBatchImportOptions, type InventoryBatchImportResponse, type InventoryBatchItem, type InventoryDirectUpdateOptions, type InventoryDirectUpdateResponse, type InventoryGroupResult, type InventoryItem, type InventoryQueryOptions, type InventoryQueryResponse, type InventoryUpdateOptions, type InventoryUpdateResponse, type KBAnalyticsRule, type KBAnalyticsRuleListResponse, type KBBulkUpdateEntry, type KBBulkUpdateOptions, type KBBulkUpdateResponse, type KBCandidate, type KBConversionStats, type KBConversionsResponse, type KBDocument, type KBDocumentListResponse, type KBEdge, type KBEntitySchema, type KBNode, type KBNodeDetailResponse, type KBNodeHistory, type KBNodeHistoryResponse, type KBNodeListResponse, type KBRecommendationScore, type KBRecommendationsResponse, type KBRelatedNode, type KBResolutionInfo, type KBSchemaField, type KBSchemaListResponse, type KBSearchOptions, type KBSearchResponse, type KBSearchResult, type KBSimilarityConfig, type KBStats, type KBTrendAggregation, type KBTrendRanking, type KBTrendRankingsResponse, type KBTrendsResponse, type ListAllFactsOptions, type ListAllFactsResponse, type LoreGenerationContext, type MemoryListOptions, type MemoryNode, type MemoryResetOptions, type MemoryResetResponse, type MemoryResponse, type MemorySearchOptions, type MemorySearchResponse, type MemorySearchResult, type MemorySummary, type MemoryTimelineOptions, type MemoryTimelineResponse, type ModelsProviderEntry, type ModelsResponse, type MoodAggregateResponse, type MoodResponse, NotFoundError, type Notification, type NotificationListOptions, type NotificationListResponse, PermissionDeniedError, type PersonalityBehaviors, type PersonalityDelta, type PersonalityDimensions, type PersonalityGetOptions, type PersonalityPreferences, type PersonalityProfile, type PersonalityResponse, type PersonalityShift, type PersonalityUpdateOptions, type PersonalityUpdateResponse, type PrimeContentBlock, type PrimeUserMetadata, type PrimeUserOptions, type PrimeUserResponse, type ProcessOptions, type ProcessResponse, type ProcessSideEffectsSummary, type ProjectConfigEntry, type ProjectConfigListResponse, type ProjectNotificationListOptions, type ProjectNotificationListResponse, RateLimitError, type RecentShiftsResponse, type RecordFeedbackOptions, type RelationshipResponse, type RunEvalOptions, type RunRef, type SDKBehavioralTraits, type SDKInteractionPreferences, type SDKPersonalityDimensions, type STTOptions, type STTResponse, type ScheduleWakeupOptions, type ScheduledWakeup, type SeedMemoriesOptions, type SeedMemoriesResponse, type SeedMemory, type SessionEndOptions, type SessionResponse, type SessionStartOptions, type SetConfigOptions, type SetCustomLLMOptions, type SetSessionToolsOptions, type SetStatusOptions, type SetStatusResponse, type SideEffectExtraction, type SignificantMoment, type SignificantMomentsResponse, type SimulateOptions, type SimulationConfig, type SimulationEvent, type SimulationSession, Sonzai, type SonzaiConfig, SonzaiError, type StoredFact, StreamError, type StructuredColumnMapping, type StructuredImportSpec, type SummariesOptions, type SummariesResponse, type TTSOptions, type TTSResponse, type TimeMachineMoodSnapshot, type TimeMachineOptions, type TimeMachineResponse, type TimelineSession, type ToolDefinition, type ToolSchema, type ToolSchemasResponse, type TriggerEventOptions, type TriggerEventResponse, type UpdateAgentOptions, type UpdateAnalyticsRuleOptions, type UpdateCapabilitiesOptions, type UpdateConstellationNodeOptions, type UpdateCustomToolOptions, type UpdateFactOptions, type UpdateGoalOptions, type UpdateHabitOptions, type UpdateInstanceOptions, type UpdateMetadataOptions, type UpdateMetadataResponse, type UpdateProjectOptions, type UpdateProjectResponse, type UserOverlayDetailResponse, type UserOverlayOptions, type UserOverlaysListResponse, type UserPersona, type UserPersonalityOverlay, type UserPrimingMetadata, type UsersResponse, type VoiceEntry, type VoiceListOptions, type VoiceListResponse, type VoiceStreamEvent, VoiceStreamInstance, type VoiceStreamToken, type VoiceTokenOptions, type VoiceUsage, type WakeupsResponse, type WebhookDeliveryAttempt, type WebhookEndpoint, type WebhookListResponse, type WebhookRegisterOptions, type WebhookRegisterResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -288,6 +288,40 @@ interface RelationshipResponse extends Record<string, unknown> {
|
|
|
288
288
|
}
|
|
289
289
|
interface HabitsResponse extends Record<string, unknown> {
|
|
290
290
|
}
|
|
291
|
+
interface Habit {
|
|
292
|
+
id?: string;
|
|
293
|
+
agent_id: string;
|
|
294
|
+
user_id?: string;
|
|
295
|
+
name: string;
|
|
296
|
+
category: string;
|
|
297
|
+
description: string;
|
|
298
|
+
display_name?: string;
|
|
299
|
+
strength: number;
|
|
300
|
+
formed: boolean;
|
|
301
|
+
observation_count: number;
|
|
302
|
+
last_reinforced_at?: string;
|
|
303
|
+
formed_at?: string;
|
|
304
|
+
created_at?: string;
|
|
305
|
+
updated_at?: string;
|
|
306
|
+
}
|
|
307
|
+
interface CreateHabitOptions {
|
|
308
|
+
userId?: string;
|
|
309
|
+
name: string;
|
|
310
|
+
category?: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
displayName?: string;
|
|
313
|
+
strength?: number;
|
|
314
|
+
}
|
|
315
|
+
interface UpdateHabitOptions {
|
|
316
|
+
userId?: string;
|
|
317
|
+
category?: string;
|
|
318
|
+
description?: string;
|
|
319
|
+
displayName?: string;
|
|
320
|
+
strength?: number;
|
|
321
|
+
}
|
|
322
|
+
interface DeleteHabitOptions {
|
|
323
|
+
userId?: string;
|
|
324
|
+
}
|
|
291
325
|
type GoalType = "personal_growth" | "skill_mastery" | "relationship" | "learning_discovery";
|
|
292
326
|
type GoalStatus = "active" | "achieved" | "abandoned";
|
|
293
327
|
type GoalPriority = 0 | 1 | 2;
|
|
@@ -348,6 +382,34 @@ interface UsersResponse extends Record<string, unknown> {
|
|
|
348
382
|
}
|
|
349
383
|
interface ConstellationResponse extends Record<string, unknown> {
|
|
350
384
|
}
|
|
385
|
+
interface ConstellationNode {
|
|
386
|
+
node_id: string;
|
|
387
|
+
agent_id: string;
|
|
388
|
+
user_id?: string;
|
|
389
|
+
node_type: string;
|
|
390
|
+
label: string;
|
|
391
|
+
description?: string;
|
|
392
|
+
significance: number;
|
|
393
|
+
mention_count: number;
|
|
394
|
+
brightness: number;
|
|
395
|
+
first_mentioned_at?: string;
|
|
396
|
+
last_mentioned_at?: string;
|
|
397
|
+
created_at?: string;
|
|
398
|
+
updated_at?: string;
|
|
399
|
+
}
|
|
400
|
+
interface CreateConstellationNodeOptions {
|
|
401
|
+
userId?: string;
|
|
402
|
+
nodeType?: string;
|
|
403
|
+
label: string;
|
|
404
|
+
description?: string;
|
|
405
|
+
significance?: number;
|
|
406
|
+
}
|
|
407
|
+
interface UpdateConstellationNodeOptions {
|
|
408
|
+
label?: string;
|
|
409
|
+
description?: string;
|
|
410
|
+
significance?: number;
|
|
411
|
+
nodeType?: string;
|
|
412
|
+
}
|
|
351
413
|
interface BreakthroughsResponse extends Record<string, unknown> {
|
|
352
414
|
}
|
|
353
415
|
interface WakeupsResponse extends Record<string, unknown> {
|
|
@@ -788,6 +850,24 @@ interface FactListOptions {
|
|
|
788
850
|
limit?: number;
|
|
789
851
|
offset?: number;
|
|
790
852
|
}
|
|
853
|
+
interface CreateFactOptions {
|
|
854
|
+
content: string;
|
|
855
|
+
userId?: string;
|
|
856
|
+
factType?: string;
|
|
857
|
+
importance?: number;
|
|
858
|
+
confidence?: number;
|
|
859
|
+
entities?: string[];
|
|
860
|
+
nodeId?: string;
|
|
861
|
+
metadata?: Record<string, unknown>;
|
|
862
|
+
}
|
|
863
|
+
interface UpdateFactOptions {
|
|
864
|
+
content?: string;
|
|
865
|
+
factType?: string;
|
|
866
|
+
importance?: number;
|
|
867
|
+
confidence?: number;
|
|
868
|
+
entities?: string[];
|
|
869
|
+
metadata?: Record<string, unknown>;
|
|
870
|
+
}
|
|
791
871
|
interface MemoryResetOptions {
|
|
792
872
|
userId?: string;
|
|
793
873
|
instanceId?: string;
|
|
@@ -2000,6 +2080,12 @@ declare class Memory {
|
|
|
2000
2080
|
listFacts(agentId: string, options?: FactListOptions): Promise<FactListResponse>;
|
|
2001
2081
|
/** Reset (delete) all memory for an agent, optionally scoped to a user. */
|
|
2002
2082
|
reset(agentId: string, options?: MemoryResetOptions): Promise<MemoryResetResponse>;
|
|
2083
|
+
/** Create a new fact for an agent. Facts are tagged source_type='manual'. */
|
|
2084
|
+
createFact(agentId: string, options: CreateFactOptions): Promise<AtomicFact>;
|
|
2085
|
+
/** Update an existing fact by ID. */
|
|
2086
|
+
updateFact(agentId: string, factId: string, options: UpdateFactOptions): Promise<AtomicFact>;
|
|
2087
|
+
/** Delete a fact by ID. */
|
|
2088
|
+
deleteFact(agentId: string, factId: string): Promise<void>;
|
|
2003
2089
|
/** Get the version history of a specific fact. */
|
|
2004
2090
|
getFactHistory(agentId: string, factId: string): Promise<FactHistoryResponse>;
|
|
2005
2091
|
}
|
|
@@ -2264,6 +2350,12 @@ declare class Agents {
|
|
|
2264
2350
|
getMoodAggregate(agentId: string, options?: ContextDataOptions): Promise<MoodAggregateResponse>;
|
|
2265
2351
|
getRelationships(agentId: string, options?: ContextDataOptions): Promise<RelationshipResponse>;
|
|
2266
2352
|
getHabits(agentId: string, options?: ContextDataOptions): Promise<HabitsResponse>;
|
|
2353
|
+
/** Create a habit for an agent. Set userId for a per-user habit. */
|
|
2354
|
+
createHabit(agentId: string, options: CreateHabitOptions): Promise<Habit>;
|
|
2355
|
+
/** Update an existing habit by name. */
|
|
2356
|
+
updateHabit(agentId: string, habitName: string, options: UpdateHabitOptions): Promise<Habit>;
|
|
2357
|
+
/** Delete a habit. Set userId for per-user habits. */
|
|
2358
|
+
deleteHabit(agentId: string, habitName: string, options?: DeleteHabitOptions): Promise<void>;
|
|
2267
2359
|
getGoals(agentId: string, options?: ContextDataOptions): Promise<GoalsResponse>;
|
|
2268
2360
|
/** Create a goal for an agent. Set userId to create a per-user goal. */
|
|
2269
2361
|
createGoal(agentId: string, options: CreateGoalOptions): Promise<Goal>;
|
|
@@ -2276,6 +2368,12 @@ declare class Agents {
|
|
|
2276
2368
|
getUsers(agentId: string): Promise<UsersResponse>;
|
|
2277
2369
|
/** Get constellation data for an agent. */
|
|
2278
2370
|
getConstellation(agentId: string, options?: ContextDataOptions): Promise<ConstellationResponse>;
|
|
2371
|
+
/** Create a constellation node (lore) for an agent. */
|
|
2372
|
+
createConstellationNode(agentId: string, options: CreateConstellationNodeOptions): Promise<ConstellationNode>;
|
|
2373
|
+
/** Update an existing constellation node. */
|
|
2374
|
+
updateConstellationNode(agentId: string, nodeId: string, options: UpdateConstellationNodeOptions): Promise<ConstellationNode>;
|
|
2375
|
+
/** Delete a constellation node. */
|
|
2376
|
+
deleteConstellationNode(agentId: string, nodeId: string): Promise<void>;
|
|
2279
2377
|
/** Get breakthroughs for an agent. */
|
|
2280
2378
|
getBreakthroughs(agentId: string, options?: ContextDataOptions): Promise<BreakthroughsResponse>;
|
|
2281
2379
|
/** List agents with optional pagination, search, and project filtering. */
|
|
@@ -2565,4 +2663,4 @@ declare class StreamError extends SonzaiError {
|
|
|
2565
2663
|
constructor(message: string);
|
|
2566
2664
|
}
|
|
2567
2665
|
|
|
2568
|
-
export { APIError, type AcknowledgeAllOptions, type AcknowledgeNotificationsOptions, type AcknowledgeResponse, type AddContentOptions, type AddContentResponse, type Agent, type AgentCapabilities, type AgentIndex, type AgentInstance, type AgentKBSearchOptions, type AgentKBSearchResponse, type AgentKBSearchResult, type AgentListOptions, type AgentListResponse, type AgentToolCapabilities, type AtomicFact, AuthenticationError, BadRequestError, type BatchImportOptions, type BatchImportResponse, type BatchImportUser, type BatchPersonalityEntry, type BatchPersonalityResponse, type Big5, type Big5Scores, type Big5Trait, type BreakthroughsResponse, type ChatChoice, type ChatMessage, type ChatOptions, type ChatResponse, type ChatStreamEvent, type ChatUsage, type ConsolidateOptions, type ConsolidateResponse, type ConstellationResponse, type ContextDataOptions, type CreateAgentOptions, type CreateAnalyticsRuleOptions, type CreateCustomToolOptions, type CreateGoalOptions, type CreateSchemaOptions, type CustomLLMConfigResponse, type CustomState, type CustomStateCreateOptions, type CustomStateDeleteByKeyOptions, type CustomStateGetByKeyOptions, type CustomStateListOptions, type CustomStateListResponse, type CustomStateUpdateOptions, type CustomStateUpsertOptions, type CustomToolDefinition, type CustomToolListResponse, type DeleteGoalOptions, type DeliveryAttemptsResponse, type DialogueOptions, type DialogueResponse, type DiaryResponse, type EnrichedContextResponse, type EvalCategory, type EvalOnlyOptions, type EvalRun, type EvalRunListOptions, type EvalRunListResponse, type EvalTemplate, type EvalTemplateCategory, type EvalTemplateCreateOptions, type EvalTemplateListResponse, type EvalTemplateUpdateOptions, type EvaluateOptions, type EvaluationResult, type ExtractionDimensionDelta, type ExtractionFact, type ExtractionHabit, type ExtractionInnerThoughts, type ExtractionInterest, type ExtractionMoodDelta, type ExtractionPersonalityDelta, type ExtractionProactive, type ExtractionRecurring, type ExtractionRelationshipDelta, type Fact, type FactHistoryResponse, type FactListOptions, type FactListResponse, type GenerateAvatarOptions, type GenerateAvatarResponse, type GenerateBioOptions, type GenerateBioResponse, type GenerateCharacterOptions, type GenerateCharacterResponse, type GenerateSeedMemoriesOptions, type GenerateSeedMemoriesResponse, type GeneratedGoal, type GetContextOptions, type Goal, type GoalPriority, type GoalStatus, type GoalType, type GoalsResponse, type HabitsResponse, type IdentityMemory, type ImageGenerateOptions, type ImageGenerateResponse, type ImportJob, type ImportJobListResponse, type InitialGoal, type InsertFactDetail, type InsertFactEntry, type InsertFactsOptions, type InsertFactsResponse, type InsertRelEntry, type InstanceCreateOptions, type InstanceListResponse, type InterestsResponse, InternalServerError, type InventoryBatchImportOptions, type InventoryBatchImportResponse, type InventoryBatchItem, type InventoryDirectUpdateOptions, type InventoryDirectUpdateResponse, type InventoryGroupResult, type InventoryItem, type InventoryQueryOptions, type InventoryQueryResponse, type InventoryUpdateOptions, type InventoryUpdateResponse, type KBAnalyticsRule, type KBAnalyticsRuleListResponse, type KBBulkUpdateEntry, type KBBulkUpdateOptions, type KBBulkUpdateResponse, type KBCandidate, type KBConversionStats, type KBConversionsResponse, type KBDocument, type KBDocumentListResponse, type KBEdge, type KBEntitySchema, type KBNode, type KBNodeDetailResponse, type KBNodeHistory, type KBNodeHistoryResponse, type KBNodeListResponse, type KBRecommendationScore, type KBRecommendationsResponse, type KBRelatedNode, type KBResolutionInfo, type KBSchemaField, type KBSchemaListResponse, type KBSearchOptions, type KBSearchResponse, type KBSearchResult, type KBSimilarityConfig, type KBStats, type KBTrendAggregation, type KBTrendRanking, type KBTrendRankingsResponse, type KBTrendsResponse, type ListAllFactsOptions, type ListAllFactsResponse, type LoreGenerationContext, type MemoryListOptions, type MemoryNode, type MemoryResetOptions, type MemoryResetResponse, type MemoryResponse, type MemorySearchOptions, type MemorySearchResponse, type MemorySearchResult, type MemorySummary, type MemoryTimelineOptions, type MemoryTimelineResponse, type ModelsProviderEntry, type ModelsResponse, type MoodAggregateResponse, type MoodResponse, NotFoundError, type Notification, type NotificationListOptions, type NotificationListResponse, PermissionDeniedError, type PersonalityBehaviors, type PersonalityDelta, type PersonalityDimensions, type PersonalityGetOptions, type PersonalityPreferences, type PersonalityProfile, type PersonalityResponse, type PersonalityShift, type PersonalityUpdateOptions, type PersonalityUpdateResponse, type PrimeContentBlock, type PrimeUserMetadata, type PrimeUserOptions, type PrimeUserResponse, type ProcessOptions, type ProcessResponse, type ProcessSideEffectsSummary, type ProjectConfigEntry, type ProjectConfigListResponse, type ProjectNotificationListOptions, type ProjectNotificationListResponse, RateLimitError, type RecentShiftsResponse, type RecordFeedbackOptions, type RelationshipResponse, type RunEvalOptions, type RunRef, type SDKBehavioralTraits, type SDKInteractionPreferences, type SDKPersonalityDimensions, type STTOptions, type STTResponse, type ScheduleWakeupOptions, type ScheduledWakeup, type SeedMemoriesOptions, type SeedMemoriesResponse, type SeedMemory, type SessionEndOptions, type SessionResponse, type SessionStartOptions, type SetConfigOptions, type SetCustomLLMOptions, type SetSessionToolsOptions, type SetStatusOptions, type SetStatusResponse, type SideEffectExtraction, type SignificantMoment, type SignificantMomentsResponse, type SimulateOptions, type SimulationConfig, type SimulationEvent, type SimulationSession, Sonzai, type SonzaiConfig, SonzaiError, type StoredFact, StreamError, type StructuredColumnMapping, type StructuredImportSpec, type SummariesOptions, type SummariesResponse, type TTSOptions, type TTSResponse, type TimeMachineMoodSnapshot, type TimeMachineOptions, type TimeMachineResponse, type TimelineSession, type ToolDefinition, type ToolSchema, type ToolSchemasResponse, type TriggerEventOptions, type TriggerEventResponse, type UpdateAgentOptions, type UpdateAnalyticsRuleOptions, type UpdateCapabilitiesOptions, type UpdateCustomToolOptions, type UpdateGoalOptions, type UpdateInstanceOptions, type UpdateMetadataOptions, type UpdateMetadataResponse, type UpdateProjectOptions, type UpdateProjectResponse, type UserOverlayDetailResponse, type UserOverlayOptions, type UserOverlaysListResponse, type UserPersona, type UserPersonalityOverlay, type UserPrimingMetadata, type UsersResponse, type VoiceEntry, type VoiceListOptions, type VoiceListResponse, type VoiceStreamEvent, VoiceStreamInstance, type VoiceStreamToken, type VoiceTokenOptions, type VoiceUsage, type WakeupsResponse, type WebhookDeliveryAttempt, type WebhookEndpoint, type WebhookListResponse, type WebhookRegisterOptions, type WebhookRegisterResponse };
|
|
2666
|
+
export { APIError, type AcknowledgeAllOptions, type AcknowledgeNotificationsOptions, type AcknowledgeResponse, type AddContentOptions, type AddContentResponse, type Agent, type AgentCapabilities, type AgentIndex, type AgentInstance, type AgentKBSearchOptions, type AgentKBSearchResponse, type AgentKBSearchResult, type AgentListOptions, type AgentListResponse, type AgentToolCapabilities, type AtomicFact, AuthenticationError, BadRequestError, type BatchImportOptions, type BatchImportResponse, type BatchImportUser, type BatchPersonalityEntry, type BatchPersonalityResponse, type Big5, type Big5Scores, type Big5Trait, type BreakthroughsResponse, type ChatChoice, type ChatMessage, type ChatOptions, type ChatResponse, type ChatStreamEvent, type ChatUsage, type ConsolidateOptions, type ConsolidateResponse, type ConstellationNode, type ConstellationResponse, type ContextDataOptions, type CreateAgentOptions, type CreateAnalyticsRuleOptions, type CreateConstellationNodeOptions, type CreateCustomToolOptions, type CreateFactOptions, type CreateGoalOptions, type CreateHabitOptions, type CreateSchemaOptions, type CustomLLMConfigResponse, type CustomState, type CustomStateCreateOptions, type CustomStateDeleteByKeyOptions, type CustomStateGetByKeyOptions, type CustomStateListOptions, type CustomStateListResponse, type CustomStateUpdateOptions, type CustomStateUpsertOptions, type CustomToolDefinition, type CustomToolListResponse, type DeleteGoalOptions, type DeleteHabitOptions, type DeliveryAttemptsResponse, type DialogueOptions, type DialogueResponse, type DiaryResponse, type EnrichedContextResponse, type EvalCategory, type EvalOnlyOptions, type EvalRun, type EvalRunListOptions, type EvalRunListResponse, type EvalTemplate, type EvalTemplateCategory, type EvalTemplateCreateOptions, type EvalTemplateListResponse, type EvalTemplateUpdateOptions, type EvaluateOptions, type EvaluationResult, type ExtractionDimensionDelta, type ExtractionFact, type ExtractionHabit, type ExtractionInnerThoughts, type ExtractionInterest, type ExtractionMoodDelta, type ExtractionPersonalityDelta, type ExtractionProactive, type ExtractionRecurring, type ExtractionRelationshipDelta, type Fact, type FactHistoryResponse, type FactListOptions, type FactListResponse, type GenerateAvatarOptions, type GenerateAvatarResponse, type GenerateBioOptions, type GenerateBioResponse, type GenerateCharacterOptions, type GenerateCharacterResponse, type GenerateSeedMemoriesOptions, type GenerateSeedMemoriesResponse, type GeneratedGoal, type GetContextOptions, type Goal, type GoalPriority, type GoalStatus, type GoalType, type GoalsResponse, type Habit, type HabitsResponse, type IdentityMemory, type ImageGenerateOptions, type ImageGenerateResponse, type ImportJob, type ImportJobListResponse, type InitialGoal, type InsertFactDetail, type InsertFactEntry, type InsertFactsOptions, type InsertFactsResponse, type InsertRelEntry, type InstanceCreateOptions, type InstanceListResponse, type InterestsResponse, InternalServerError, type InventoryBatchImportOptions, type InventoryBatchImportResponse, type InventoryBatchItem, type InventoryDirectUpdateOptions, type InventoryDirectUpdateResponse, type InventoryGroupResult, type InventoryItem, type InventoryQueryOptions, type InventoryQueryResponse, type InventoryUpdateOptions, type InventoryUpdateResponse, type KBAnalyticsRule, type KBAnalyticsRuleListResponse, type KBBulkUpdateEntry, type KBBulkUpdateOptions, type KBBulkUpdateResponse, type KBCandidate, type KBConversionStats, type KBConversionsResponse, type KBDocument, type KBDocumentListResponse, type KBEdge, type KBEntitySchema, type KBNode, type KBNodeDetailResponse, type KBNodeHistory, type KBNodeHistoryResponse, type KBNodeListResponse, type KBRecommendationScore, type KBRecommendationsResponse, type KBRelatedNode, type KBResolutionInfo, type KBSchemaField, type KBSchemaListResponse, type KBSearchOptions, type KBSearchResponse, type KBSearchResult, type KBSimilarityConfig, type KBStats, type KBTrendAggregation, type KBTrendRanking, type KBTrendRankingsResponse, type KBTrendsResponse, type ListAllFactsOptions, type ListAllFactsResponse, type LoreGenerationContext, type MemoryListOptions, type MemoryNode, type MemoryResetOptions, type MemoryResetResponse, type MemoryResponse, type MemorySearchOptions, type MemorySearchResponse, type MemorySearchResult, type MemorySummary, type MemoryTimelineOptions, type MemoryTimelineResponse, type ModelsProviderEntry, type ModelsResponse, type MoodAggregateResponse, type MoodResponse, NotFoundError, type Notification, type NotificationListOptions, type NotificationListResponse, PermissionDeniedError, type PersonalityBehaviors, type PersonalityDelta, type PersonalityDimensions, type PersonalityGetOptions, type PersonalityPreferences, type PersonalityProfile, type PersonalityResponse, type PersonalityShift, type PersonalityUpdateOptions, type PersonalityUpdateResponse, type PrimeContentBlock, type PrimeUserMetadata, type PrimeUserOptions, type PrimeUserResponse, type ProcessOptions, type ProcessResponse, type ProcessSideEffectsSummary, type ProjectConfigEntry, type ProjectConfigListResponse, type ProjectNotificationListOptions, type ProjectNotificationListResponse, RateLimitError, type RecentShiftsResponse, type RecordFeedbackOptions, type RelationshipResponse, type RunEvalOptions, type RunRef, type SDKBehavioralTraits, type SDKInteractionPreferences, type SDKPersonalityDimensions, type STTOptions, type STTResponse, type ScheduleWakeupOptions, type ScheduledWakeup, type SeedMemoriesOptions, type SeedMemoriesResponse, type SeedMemory, type SessionEndOptions, type SessionResponse, type SessionStartOptions, type SetConfigOptions, type SetCustomLLMOptions, type SetSessionToolsOptions, type SetStatusOptions, type SetStatusResponse, type SideEffectExtraction, type SignificantMoment, type SignificantMomentsResponse, type SimulateOptions, type SimulationConfig, type SimulationEvent, type SimulationSession, Sonzai, type SonzaiConfig, SonzaiError, type StoredFact, StreamError, type StructuredColumnMapping, type StructuredImportSpec, type SummariesOptions, type SummariesResponse, type TTSOptions, type TTSResponse, type TimeMachineMoodSnapshot, type TimeMachineOptions, type TimeMachineResponse, type TimelineSession, type ToolDefinition, type ToolSchema, type ToolSchemasResponse, type TriggerEventOptions, type TriggerEventResponse, type UpdateAgentOptions, type UpdateAnalyticsRuleOptions, type UpdateCapabilitiesOptions, type UpdateConstellationNodeOptions, type UpdateCustomToolOptions, type UpdateFactOptions, type UpdateGoalOptions, type UpdateHabitOptions, type UpdateInstanceOptions, type UpdateMetadataOptions, type UpdateMetadataResponse, type UpdateProjectOptions, type UpdateProjectResponse, type UserOverlayDetailResponse, type UserOverlayOptions, type UserOverlaysListResponse, type UserPersona, type UserPersonalityOverlay, type UserPrimingMetadata, type UsersResponse, type VoiceEntry, type VoiceListOptions, type VoiceListResponse, type VoiceStreamEvent, VoiceStreamInstance, type VoiceStreamToken, type VoiceTokenOptions, type VoiceUsage, type WakeupsResponse, type WebhookDeliveryAttempt, type WebhookEndpoint, type WebhookListResponse, type WebhookRegisterOptions, type WebhookRegisterResponse };
|
package/dist/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var HTTPClient = class {
|
|
|
69
69
|
this.headers = {
|
|
70
70
|
Authorization: `Bearer ${options.apiKey}`,
|
|
71
71
|
"Content-Type": "application/json",
|
|
72
|
-
"User-Agent": "sonzai-typescript/1.0.
|
|
72
|
+
"User-Agent": "sonzai-typescript/1.0.9"
|
|
73
73
|
};
|
|
74
74
|
this.timeout = options.timeout;
|
|
75
75
|
this.maxRetries = options.maxRetries;
|
|
@@ -555,6 +555,41 @@ var Memory = class {
|
|
|
555
555
|
}
|
|
556
556
|
);
|
|
557
557
|
}
|
|
558
|
+
/** Create a new fact for an agent. Facts are tagged source_type='manual'. */
|
|
559
|
+
async createFact(agentId, options) {
|
|
560
|
+
const body = {
|
|
561
|
+
content: options.content
|
|
562
|
+
};
|
|
563
|
+
if (options.userId) body.user_id = options.userId;
|
|
564
|
+
if (options.factType) body.fact_type = options.factType;
|
|
565
|
+
if (options.importance != null) body.importance = options.importance;
|
|
566
|
+
if (options.confidence != null) body.confidence = options.confidence;
|
|
567
|
+
if (options.entities) body.entities = options.entities;
|
|
568
|
+
if (options.nodeId) body.node_id = options.nodeId;
|
|
569
|
+
if (options.metadata) body.metadata = options.metadata;
|
|
570
|
+
return this.http.post(
|
|
571
|
+
`/api/v1/agents/${agentId}/memory/facts`,
|
|
572
|
+
body
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
/** Update an existing fact by ID. */
|
|
576
|
+
async updateFact(agentId, factId, options) {
|
|
577
|
+
const body = {};
|
|
578
|
+
if (options.content) body.content = options.content;
|
|
579
|
+
if (options.factType) body.fact_type = options.factType;
|
|
580
|
+
if (options.importance != null) body.importance = options.importance;
|
|
581
|
+
if (options.confidence != null) body.confidence = options.confidence;
|
|
582
|
+
if (options.entities) body.entities = options.entities;
|
|
583
|
+
if (options.metadata) body.metadata = options.metadata;
|
|
584
|
+
return this.http.put(
|
|
585
|
+
`/api/v1/agents/${agentId}/memory/facts/${factId}`,
|
|
586
|
+
body
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
/** Delete a fact by ID. */
|
|
590
|
+
async deleteFact(agentId, factId) {
|
|
591
|
+
await this.http.delete(`/api/v1/agents/${agentId}/memory/facts/${factId}`);
|
|
592
|
+
}
|
|
558
593
|
/** Get the version history of a specific fact. */
|
|
559
594
|
async getFactHistory(agentId, factId) {
|
|
560
595
|
return this.http.get(`/api/v1/agents/${agentId}/memory/fact/${factId}/history`);
|
|
@@ -1391,6 +1426,43 @@ var Agents = class {
|
|
|
1391
1426
|
instance_id: options.instanceId
|
|
1392
1427
|
});
|
|
1393
1428
|
}
|
|
1429
|
+
/** Create a habit for an agent. Set userId for a per-user habit. */
|
|
1430
|
+
async createHabit(agentId, options) {
|
|
1431
|
+
const body = {
|
|
1432
|
+
name: options.name
|
|
1433
|
+
};
|
|
1434
|
+
if (options.userId) body.user_id = options.userId;
|
|
1435
|
+
if (options.category) body.category = options.category;
|
|
1436
|
+
if (options.description) body.description = options.description;
|
|
1437
|
+
if (options.displayName) body.display_name = options.displayName;
|
|
1438
|
+
if (options.strength != null) body.strength = options.strength;
|
|
1439
|
+
return this.http.post(
|
|
1440
|
+
`/api/v1/agents/${agentId}/habits`,
|
|
1441
|
+
body
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
/** Update an existing habit by name. */
|
|
1445
|
+
async updateHabit(agentId, habitName, options) {
|
|
1446
|
+
const body = {};
|
|
1447
|
+
if (options.userId) body.user_id = options.userId;
|
|
1448
|
+
if (options.category) body.category = options.category;
|
|
1449
|
+
if (options.description) body.description = options.description;
|
|
1450
|
+
if (options.displayName) body.display_name = options.displayName;
|
|
1451
|
+
if (options.strength != null) body.strength = options.strength;
|
|
1452
|
+
return this.http.put(
|
|
1453
|
+
`/api/v1/agents/${agentId}/habits/${encodeURIComponent(habitName)}`,
|
|
1454
|
+
body
|
|
1455
|
+
);
|
|
1456
|
+
}
|
|
1457
|
+
/** Delete a habit. Set userId for per-user habits. */
|
|
1458
|
+
async deleteHabit(agentId, habitName, options = {}) {
|
|
1459
|
+
const params = {};
|
|
1460
|
+
if (options.userId) params.user_id = options.userId;
|
|
1461
|
+
await this.http.delete(
|
|
1462
|
+
`/api/v1/agents/${agentId}/habits/${encodeURIComponent(habitName)}`,
|
|
1463
|
+
params
|
|
1464
|
+
);
|
|
1465
|
+
}
|
|
1394
1466
|
async getGoals(agentId, options = {}) {
|
|
1395
1467
|
return this.http.get(`/api/v1/agents/${agentId}/goals`, {
|
|
1396
1468
|
user_id: options.userId,
|
|
@@ -1457,6 +1529,38 @@ var Agents = class {
|
|
|
1457
1529
|
instance_id: options.instanceId
|
|
1458
1530
|
});
|
|
1459
1531
|
}
|
|
1532
|
+
/** Create a constellation node (lore) for an agent. */
|
|
1533
|
+
async createConstellationNode(agentId, options) {
|
|
1534
|
+
const body = {
|
|
1535
|
+
label: options.label
|
|
1536
|
+
};
|
|
1537
|
+
if (options.userId) body.user_id = options.userId;
|
|
1538
|
+
if (options.nodeType) body.node_type = options.nodeType;
|
|
1539
|
+
if (options.description) body.description = options.description;
|
|
1540
|
+
if (options.significance != null) body.significance = options.significance;
|
|
1541
|
+
return this.http.post(
|
|
1542
|
+
`/api/v1/agents/${agentId}/constellation/nodes`,
|
|
1543
|
+
body
|
|
1544
|
+
);
|
|
1545
|
+
}
|
|
1546
|
+
/** Update an existing constellation node. */
|
|
1547
|
+
async updateConstellationNode(agentId, nodeId, options) {
|
|
1548
|
+
const body = {};
|
|
1549
|
+
if (options.label) body.label = options.label;
|
|
1550
|
+
if (options.description) body.description = options.description;
|
|
1551
|
+
if (options.significance != null) body.significance = options.significance;
|
|
1552
|
+
if (options.nodeType) body.node_type = options.nodeType;
|
|
1553
|
+
return this.http.put(
|
|
1554
|
+
`/api/v1/agents/${agentId}/constellation/nodes/${nodeId}`,
|
|
1555
|
+
body
|
|
1556
|
+
);
|
|
1557
|
+
}
|
|
1558
|
+
/** Delete a constellation node. */
|
|
1559
|
+
async deleteConstellationNode(agentId, nodeId) {
|
|
1560
|
+
await this.http.delete(
|
|
1561
|
+
`/api/v1/agents/${agentId}/constellation/nodes/${nodeId}`
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1460
1564
|
/** Get breakthroughs for an agent. */
|
|
1461
1565
|
async getBreakthroughs(agentId, options = {}) {
|
|
1462
1566
|
return this.http.get(`/api/v1/agents/${agentId}/breakthroughs`, {
|