@subcortex-ai/sdk 0.3.9 → 0.3.11
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 +22 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +22 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -245,6 +245,8 @@ declare enum OrgRelationship {
|
|
|
245
245
|
HOLDS_ROLE = "holds_role",
|
|
246
246
|
/** Person is a candidate for a role */
|
|
247
247
|
CANDIDATE_FOR = "candidate_for",
|
|
248
|
+
/** User/manager is considering/evaluating a candidate (inverse of candidate_for) */
|
|
249
|
+
CONSIDERING = "considering",
|
|
248
250
|
/** Person collaborates with another person */
|
|
249
251
|
COLLABORATES_WITH = "collaborates_with",
|
|
250
252
|
/** Person mentors another person */
|
|
@@ -285,6 +287,8 @@ declare const RelationshipTypes: {
|
|
|
285
287
|
readonly HOLDS_ROLE: OrgRelationship.HOLDS_ROLE;
|
|
286
288
|
/** Person is a candidate for a role */
|
|
287
289
|
readonly CANDIDATE_FOR: OrgRelationship.CANDIDATE_FOR;
|
|
290
|
+
/** User/manager is considering/evaluating a candidate (inverse of candidate_for) */
|
|
291
|
+
readonly CONSIDERING: OrgRelationship.CONSIDERING;
|
|
288
292
|
/** Person collaborates with another person */
|
|
289
293
|
readonly COLLABORATES_WITH: OrgRelationship.COLLABORATES_WITH;
|
|
290
294
|
/** Person mentors another person */
|
|
@@ -457,6 +461,12 @@ interface IdentifyUserInput {
|
|
|
457
461
|
email?: string;
|
|
458
462
|
/** Agent ID — used to scope conflict detection to this agent's intake queue */
|
|
459
463
|
agentId?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Whether to auto-dismiss reminders after surfacing them (default true).
|
|
466
|
+
* The agent leaves this on so a reminder surfaces once per session; set it to
|
|
467
|
+
* false for inspection/programmatic recall so reading does not consume reminders.
|
|
468
|
+
*/
|
|
469
|
+
dismissReminders?: boolean;
|
|
460
470
|
}
|
|
461
471
|
/** Result of user identification */
|
|
462
472
|
interface UserIdentification {
|
|
@@ -1110,6 +1120,10 @@ declare class RelationshipsNamespace {
|
|
|
1110
1120
|
list(options?: {
|
|
1111
1121
|
tenantId?: string;
|
|
1112
1122
|
}): Promise<Relationship[]>;
|
|
1123
|
+
/** Retract (hard-delete) a relationship by id. Returns the removed relationship. */
|
|
1124
|
+
retract(relationshipId: string, options?: {
|
|
1125
|
+
tenantId?: string;
|
|
1126
|
+
}): Promise<Relationship>;
|
|
1113
1127
|
}
|
|
1114
1128
|
/**
|
|
1115
1129
|
* Agent personality — defines how the agent communicates.
|
package/dist/index.d.ts
CHANGED
|
@@ -245,6 +245,8 @@ declare enum OrgRelationship {
|
|
|
245
245
|
HOLDS_ROLE = "holds_role",
|
|
246
246
|
/** Person is a candidate for a role */
|
|
247
247
|
CANDIDATE_FOR = "candidate_for",
|
|
248
|
+
/** User/manager is considering/evaluating a candidate (inverse of candidate_for) */
|
|
249
|
+
CONSIDERING = "considering",
|
|
248
250
|
/** Person collaborates with another person */
|
|
249
251
|
COLLABORATES_WITH = "collaborates_with",
|
|
250
252
|
/** Person mentors another person */
|
|
@@ -285,6 +287,8 @@ declare const RelationshipTypes: {
|
|
|
285
287
|
readonly HOLDS_ROLE: OrgRelationship.HOLDS_ROLE;
|
|
286
288
|
/** Person is a candidate for a role */
|
|
287
289
|
readonly CANDIDATE_FOR: OrgRelationship.CANDIDATE_FOR;
|
|
290
|
+
/** User/manager is considering/evaluating a candidate (inverse of candidate_for) */
|
|
291
|
+
readonly CONSIDERING: OrgRelationship.CONSIDERING;
|
|
288
292
|
/** Person collaborates with another person */
|
|
289
293
|
readonly COLLABORATES_WITH: OrgRelationship.COLLABORATES_WITH;
|
|
290
294
|
/** Person mentors another person */
|
|
@@ -457,6 +461,12 @@ interface IdentifyUserInput {
|
|
|
457
461
|
email?: string;
|
|
458
462
|
/** Agent ID — used to scope conflict detection to this agent's intake queue */
|
|
459
463
|
agentId?: string;
|
|
464
|
+
/**
|
|
465
|
+
* Whether to auto-dismiss reminders after surfacing them (default true).
|
|
466
|
+
* The agent leaves this on so a reminder surfaces once per session; set it to
|
|
467
|
+
* false for inspection/programmatic recall so reading does not consume reminders.
|
|
468
|
+
*/
|
|
469
|
+
dismissReminders?: boolean;
|
|
460
470
|
}
|
|
461
471
|
/** Result of user identification */
|
|
462
472
|
interface UserIdentification {
|
|
@@ -1110,6 +1120,10 @@ declare class RelationshipsNamespace {
|
|
|
1110
1120
|
list(options?: {
|
|
1111
1121
|
tenantId?: string;
|
|
1112
1122
|
}): Promise<Relationship[]>;
|
|
1123
|
+
/** Retract (hard-delete) a relationship by id. Returns the removed relationship. */
|
|
1124
|
+
retract(relationshipId: string, options?: {
|
|
1125
|
+
tenantId?: string;
|
|
1126
|
+
}): Promise<Relationship>;
|
|
1113
1127
|
}
|
|
1114
1128
|
/**
|
|
1115
1129
|
* Agent personality — defines how the agent communicates.
|
package/dist/index.js
CHANGED
|
@@ -406,6 +406,7 @@ var OrgRelationship = /* @__PURE__ */ ((OrgRelationship2) => {
|
|
|
406
406
|
OrgRelationship2["HAS_MEMBER"] = "has_member";
|
|
407
407
|
OrgRelationship2["HOLDS_ROLE"] = "holds_role";
|
|
408
408
|
OrgRelationship2["CANDIDATE_FOR"] = "candidate_for";
|
|
409
|
+
OrgRelationship2["CONSIDERING"] = "considering";
|
|
409
410
|
OrgRelationship2["COLLABORATES_WITH"] = "collaborates_with";
|
|
410
411
|
OrgRelationship2["MENTORS"] = "mentors";
|
|
411
412
|
OrgRelationship2["MENTORED_BY"] = "mentored_by";
|
|
@@ -475,7 +476,8 @@ var REVERSE_RELATIONSHIPS = {
|
|
|
475
476
|
["mentors" /* MENTORS */]: "mentored_by" /* MENTORED_BY */,
|
|
476
477
|
["mentored_by" /* MENTORED_BY */]: "mentors" /* MENTORS */,
|
|
477
478
|
["collaborates_with" /* COLLABORATES_WITH */]: "collaborates_with" /* COLLABORATES_WITH */,
|
|
478
|
-
["candidate_for" /* CANDIDATE_FOR */]: "
|
|
479
|
+
["candidate_for" /* CANDIDATE_FOR */]: "considering" /* CONSIDERING */,
|
|
480
|
+
["considering" /* CONSIDERING */]: "candidate_for" /* CANDIDATE_FOR */,
|
|
479
481
|
["stakeholder_in" /* STAKEHOLDER_IN */]: "stakeholder_in" /* STAKEHOLDER_IN */,
|
|
480
482
|
// Agent-facing predicate names → proper relationship types
|
|
481
483
|
// The model sends 'direct_report' as predicate, SDK maps to proper relationships
|
|
@@ -777,13 +779,15 @@ var UsersNamespace = class {
|
|
|
777
779
|
const nameAssertion = active.find((a) => a.predicate === "name" || a.predicate === "full_name");
|
|
778
780
|
const name = nameAssertion?.value || input.displayName || null;
|
|
779
781
|
const reminders = active.filter((a) => a.predicate === "reminder").map((a) => ({ id: a.id, predicate: a.predicate, value: a.value, confidence: a.confidence, createdAt: a.validFrom }));
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
782
|
+
if (input.dismissReminders !== false) {
|
|
783
|
+
for (const reminder of reminders) {
|
|
784
|
+
try {
|
|
785
|
+
await this.http.post(
|
|
786
|
+
`/api/v1/assertions/retract/${enc2(this.tenantId)}/${enc2(reminder.id)}`,
|
|
787
|
+
{}
|
|
788
|
+
);
|
|
789
|
+
} catch {
|
|
790
|
+
}
|
|
787
791
|
}
|
|
788
792
|
}
|
|
789
793
|
const contexts = active.filter((a) => a.predicate === "context" || a.predicate === "context:task").map((a) => ({ id: a.id, predicate: a.predicate, value: a.value, confidence: a.confidence, createdAt: a.validFrom }));
|
|
@@ -974,7 +978,7 @@ ${connectedPeople.map((p) => {
|
|
|
974
978
|
const FORWARD_MAP = {
|
|
975
979
|
"direct_report": "manages" /* MANAGES */,
|
|
976
980
|
"team_member": "has_member" /* HAS_MEMBER */,
|
|
977
|
-
"candidate": "
|
|
981
|
+
"candidate": "considering" /* CONSIDERING */,
|
|
978
982
|
"manager": "reports_to" /* REPORTS_TO */,
|
|
979
983
|
"stakeholder": "stakeholder_in" /* STAKEHOLDER_IN */,
|
|
980
984
|
"collaborator": "collaborates_with" /* COLLABORATES_WITH */,
|
|
@@ -1390,6 +1394,14 @@ var RelationshipsNamespace = class {
|
|
|
1390
1394
|
`/api/v1/relationships/list/${enc4(tenantId)}`
|
|
1391
1395
|
);
|
|
1392
1396
|
}
|
|
1397
|
+
/** Retract (hard-delete) a relationship by id. Returns the removed relationship. */
|
|
1398
|
+
async retract(relationshipId, options) {
|
|
1399
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1400
|
+
return this.http.post(
|
|
1401
|
+
`/api/v1/relationships/retract/${enc4(tenantId)}/${enc4(relationshipId)}`,
|
|
1402
|
+
{}
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1393
1405
|
};
|
|
1394
1406
|
var AgentsNamespace = class {
|
|
1395
1407
|
constructor(http, tenantId) {
|
|
@@ -1766,7 +1778,7 @@ var EntitiesNamespace = class {
|
|
|
1766
1778
|
`/api/v1/assertions/query/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1767
1779
|
);
|
|
1768
1780
|
const relationships = await this.http.get(
|
|
1769
|
-
`/api/v1/relationships
|
|
1781
|
+
`/api/v1/relationships/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1770
1782
|
);
|
|
1771
1783
|
const typeAssertion = assertions.find((a) => a.predicate === "type" && !a.isSuperseded);
|
|
1772
1784
|
const descAssertion = assertions.find((a) => a.predicate === "description" && !a.isSuperseded);
|