@subcortex-ai/sdk 0.3.5 → 0.3.7
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 +16 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -358,7 +358,10 @@ type SignalType = SystemSignalType | `custom:${string}`;
|
|
|
358
358
|
declare function isValidSignalType(type: string): type is SignalType;
|
|
359
359
|
/**
|
|
360
360
|
* Per-type decay half-life in hours.
|
|
361
|
-
*
|
|
361
|
+
* Tuned to match emotional persistence patterns:
|
|
362
|
+
* - Fast decay: confusion (resolves or escalates quickly)
|
|
363
|
+
* - Medium decay: excitement, frustration, tension
|
|
364
|
+
* - Slow decay: concern (persists until addressed), satisfaction/gratitude (positive baseline)
|
|
362
365
|
*/
|
|
363
366
|
declare const SIGNAL_DECAY_CONFIG: Record<string, number>;
|
|
364
367
|
declare function getDecayHalfLife(signalType: string): number;
|
|
@@ -543,6 +546,8 @@ interface RecordRapportInput {
|
|
|
543
546
|
aboutPerson?: string;
|
|
544
547
|
/** Confidence */
|
|
545
548
|
confidence?: ConfidenceLevel | number;
|
|
549
|
+
/** Session ID — binds to an Experience for session grouping */
|
|
550
|
+
sessionId?: string;
|
|
546
551
|
}
|
|
547
552
|
|
|
548
553
|
/**
|
|
@@ -1007,6 +1012,8 @@ interface CreateAssertionInput {
|
|
|
1007
1012
|
confidence?: number;
|
|
1008
1013
|
/** Override the default tenant ID for this operation */
|
|
1009
1014
|
tenantId?: string;
|
|
1015
|
+
/** Session ID — binds this assertion to an Experience for session grouping */
|
|
1016
|
+
sessionId?: string;
|
|
1010
1017
|
}
|
|
1011
1018
|
/**
|
|
1012
1019
|
* Input for superseding (updating) an existing assertion.
|
|
@@ -1037,6 +1044,8 @@ interface SupersedeAssertionInput {
|
|
|
1037
1044
|
confidence?: number;
|
|
1038
1045
|
/** Override the default tenant ID */
|
|
1039
1046
|
tenantId?: string;
|
|
1047
|
+
/** Session ID — binds this assertion to an Experience for session grouping */
|
|
1048
|
+
sessionId?: string;
|
|
1040
1049
|
}
|
|
1041
1050
|
/** What the SDK returns for a relationship. */
|
|
1042
1051
|
interface Relationship {
|
package/dist/index.d.ts
CHANGED
|
@@ -358,7 +358,10 @@ type SignalType = SystemSignalType | `custom:${string}`;
|
|
|
358
358
|
declare function isValidSignalType(type: string): type is SignalType;
|
|
359
359
|
/**
|
|
360
360
|
* Per-type decay half-life in hours.
|
|
361
|
-
*
|
|
361
|
+
* Tuned to match emotional persistence patterns:
|
|
362
|
+
* - Fast decay: confusion (resolves or escalates quickly)
|
|
363
|
+
* - Medium decay: excitement, frustration, tension
|
|
364
|
+
* - Slow decay: concern (persists until addressed), satisfaction/gratitude (positive baseline)
|
|
362
365
|
*/
|
|
363
366
|
declare const SIGNAL_DECAY_CONFIG: Record<string, number>;
|
|
364
367
|
declare function getDecayHalfLife(signalType: string): number;
|
|
@@ -543,6 +546,8 @@ interface RecordRapportInput {
|
|
|
543
546
|
aboutPerson?: string;
|
|
544
547
|
/** Confidence */
|
|
545
548
|
confidence?: ConfidenceLevel | number;
|
|
549
|
+
/** Session ID — binds to an Experience for session grouping */
|
|
550
|
+
sessionId?: string;
|
|
546
551
|
}
|
|
547
552
|
|
|
548
553
|
/**
|
|
@@ -1007,6 +1012,8 @@ interface CreateAssertionInput {
|
|
|
1007
1012
|
confidence?: number;
|
|
1008
1013
|
/** Override the default tenant ID for this operation */
|
|
1009
1014
|
tenantId?: string;
|
|
1015
|
+
/** Session ID — binds this assertion to an Experience for session grouping */
|
|
1016
|
+
sessionId?: string;
|
|
1010
1017
|
}
|
|
1011
1018
|
/**
|
|
1012
1019
|
* Input for superseding (updating) an existing assertion.
|
|
@@ -1037,6 +1044,8 @@ interface SupersedeAssertionInput {
|
|
|
1037
1044
|
confidence?: number;
|
|
1038
1045
|
/** Override the default tenant ID */
|
|
1039
1046
|
tenantId?: string;
|
|
1047
|
+
/** Session ID — binds this assertion to an Experience for session grouping */
|
|
1048
|
+
sessionId?: string;
|
|
1040
1049
|
}
|
|
1041
1050
|
/** What the SDK returns for a relationship. */
|
|
1042
1051
|
interface Relationship {
|
package/dist/index.js
CHANGED
|
@@ -515,14 +515,14 @@ function isValidSignalType(type) {
|
|
|
515
515
|
return false;
|
|
516
516
|
}
|
|
517
517
|
var SIGNAL_DECAY_CONFIG = {
|
|
518
|
-
|
|
519
|
-
excitement:
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
confusion: 24,
|
|
523
|
-
gratitude: 24,
|
|
524
|
-
tension: 24,
|
|
518
|
+
confusion: 8,
|
|
519
|
+
excitement: 16,
|
|
520
|
+
frustration: 18,
|
|
521
|
+
tension: 18,
|
|
525
522
|
sentiment: 24,
|
|
523
|
+
concern: 36,
|
|
524
|
+
satisfaction: 48,
|
|
525
|
+
gratitude: 48,
|
|
526
526
|
_default: 24
|
|
527
527
|
};
|
|
528
528
|
function getDecayHalfLife(signalType) {
|
|
@@ -579,15 +579,15 @@ var SignalsNamespace = class {
|
|
|
579
579
|
const value = {
|
|
580
580
|
content: input.content,
|
|
581
581
|
intensity: input.intensity ?? 0.7,
|
|
582
|
-
about_subject: input.aboutSubject || null
|
|
583
|
-
session_id: input.sessionId || null
|
|
582
|
+
about_subject: input.aboutSubject || null
|
|
584
583
|
};
|
|
585
584
|
const result = await this.http.post("/api/v1/assertions", {
|
|
586
585
|
tenant_id: this.tenantId,
|
|
587
586
|
subject: userSubject,
|
|
588
587
|
predicate,
|
|
589
588
|
value,
|
|
590
|
-
confidence: input.intensity ?? 0.7
|
|
589
|
+
confidence: input.intensity ?? 0.7,
|
|
590
|
+
...input.sessionId ? { session_id: input.sessionId } : {}
|
|
591
591
|
});
|
|
592
592
|
let resolved = 0;
|
|
593
593
|
if (input.resolveConflicting && POSITIVE_SIGNALS.has(input.type)) {
|
|
@@ -1034,7 +1034,8 @@ ${connectedPeople.map((p) => {
|
|
|
1034
1034
|
correlation_id: correlationId,
|
|
1035
1035
|
agent_id: "sdk",
|
|
1036
1036
|
tenant_id: this.tenantId,
|
|
1037
|
-
candidates
|
|
1037
|
+
candidates,
|
|
1038
|
+
...input.sessionId ? { context: { sessionId: input.sessionId } } : {}
|
|
1038
1039
|
});
|
|
1039
1040
|
return { success: true };
|
|
1040
1041
|
}
|
|
@@ -1310,7 +1311,8 @@ var AssertionsNamespace = class {
|
|
|
1310
1311
|
subject: input.subject,
|
|
1311
1312
|
predicate: input.predicate,
|
|
1312
1313
|
value: input.value,
|
|
1313
|
-
confidence: input.confidence
|
|
1314
|
+
confidence: input.confidence,
|
|
1315
|
+
...input.sessionId ? { session_id: input.sessionId } : {}
|
|
1314
1316
|
});
|
|
1315
1317
|
}
|
|
1316
1318
|
/** Get an assertion by its content-addressable ID. */
|
|
@@ -1343,7 +1345,8 @@ var AssertionsNamespace = class {
|
|
|
1343
1345
|
subject: input.subject,
|
|
1344
1346
|
predicate: input.predicate,
|
|
1345
1347
|
value: input.value,
|
|
1346
|
-
confidence: input.confidence
|
|
1348
|
+
confidence: input.confidence,
|
|
1349
|
+
...input.sessionId ? { session_id: input.sessionId } : {}
|
|
1347
1350
|
});
|
|
1348
1351
|
}
|
|
1349
1352
|
/** Retract an assertion by closing its temporal bounds. */
|