@subcortex-ai/sdk 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +576 -103
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +417 -1
- package/dist/index.d.ts +417 -1
- package/dist/index.js +568 -103
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -905,49 +905,10 @@ ${connectedPeople.map((p) => {
|
|
|
905
905
|
let assertionsCreated = 0;
|
|
906
906
|
let relationshipsCreated = 0;
|
|
907
907
|
const warnings = [];
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
subject: personSubject,
|
|
911
|
-
predicate: "name",
|
|
912
|
-
value: input.name,
|
|
913
|
-
confidence: conf
|
|
914
|
-
});
|
|
915
|
-
assertionsCreated++;
|
|
908
|
+
const candidates = [];
|
|
909
|
+
candidates.push({ subject: personSubject, predicate: "name", value: input.name, source_confidence: conf, provenance: "agent" });
|
|
916
910
|
if (input.role) {
|
|
917
|
-
|
|
918
|
-
const existing = await this.http.get(
|
|
919
|
-
`/api/v1/assertions/query/${enc2(this.tenantId)}/${enc2(personSubject)}`
|
|
920
|
-
);
|
|
921
|
-
const existingRole = existing.find((a) => a.predicate === "role" && !a.isSuperseded);
|
|
922
|
-
if (existingRole && existingRole.value !== input.role) {
|
|
923
|
-
warnings.push(`${input.name} was previously "${existingRole.value}" \u2014 now being set as "${input.role}". Role change or mistake?`);
|
|
924
|
-
await this.http.post("/api/v1/assertions/supersede", {
|
|
925
|
-
tenant_id: this.tenantId,
|
|
926
|
-
original_assertion_id: existingRole.id,
|
|
927
|
-
subject: personSubject,
|
|
928
|
-
predicate: "role",
|
|
929
|
-
value: input.role,
|
|
930
|
-
confidence: conf
|
|
931
|
-
});
|
|
932
|
-
} else if (!existingRole) {
|
|
933
|
-
await this.http.post("/api/v1/assertions", {
|
|
934
|
-
tenant_id: this.tenantId,
|
|
935
|
-
subject: personSubject,
|
|
936
|
-
predicate: "role",
|
|
937
|
-
value: input.role,
|
|
938
|
-
confidence: conf
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
} catch {
|
|
942
|
-
await this.http.post("/api/v1/assertions", {
|
|
943
|
-
tenant_id: this.tenantId,
|
|
944
|
-
subject: personSubject,
|
|
945
|
-
predicate: "role",
|
|
946
|
-
value: input.role,
|
|
947
|
-
confidence: conf
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
assertionsCreated++;
|
|
911
|
+
candidates.push({ subject: personSubject, predicate: "role", value: input.role, source_confidence: conf, provenance: "agent" });
|
|
951
912
|
try {
|
|
952
913
|
const allAssertions = await this.http.get(
|
|
953
914
|
`/api/v1/assertions/list/${enc2(this.tenantId)}`
|
|
@@ -964,6 +925,35 @@ ${connectedPeople.map((p) => {
|
|
|
964
925
|
}
|
|
965
926
|
} catch {
|
|
966
927
|
}
|
|
928
|
+
}
|
|
929
|
+
if (input.details) {
|
|
930
|
+
candidates.push({ subject: personSubject, predicate: "details", value: input.details, source_confidence: conf, provenance: "agent" });
|
|
931
|
+
}
|
|
932
|
+
candidates.push({
|
|
933
|
+
subject: personSubject,
|
|
934
|
+
predicate: "status",
|
|
935
|
+
value: input.relationship === "candidate" ? "candidate" : "active",
|
|
936
|
+
source_confidence: conf,
|
|
937
|
+
provenance: "agent"
|
|
938
|
+
});
|
|
939
|
+
const correlationId = `register_person_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`;
|
|
940
|
+
const intakeResult = await this.http.post("/api/v1/intake/submit", {
|
|
941
|
+
correlation_id: correlationId,
|
|
942
|
+
agent_id: "sdk",
|
|
943
|
+
tenant_id: this.tenantId,
|
|
944
|
+
candidates,
|
|
945
|
+
context: input.sessionId ? { sessionId: input.sessionId } : void 0
|
|
946
|
+
});
|
|
947
|
+
assertionsCreated = intakeResult.accepted + intakeResult.reinforced;
|
|
948
|
+
if (intakeResult.conflicts > 0) {
|
|
949
|
+
const conflictItems = (intakeResult.items || []).filter(
|
|
950
|
+
(i) => i.status === "conflict_detected"
|
|
951
|
+
);
|
|
952
|
+
for (const item of conflictItems) {
|
|
953
|
+
warnings.push(item.surfacingHint || "A conflict was detected with existing data.");
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
if (input.role) {
|
|
967
957
|
const roleSubject = subject("role" /* ROLE */, input.role);
|
|
968
958
|
await this.http.post("/api/v1/assertions", {
|
|
969
959
|
tenant_id: this.tenantId,
|
|
@@ -979,34 +969,13 @@ ${connectedPeople.map((p) => {
|
|
|
979
969
|
relationship_type: "holds_role" /* HOLDS_ROLE */,
|
|
980
970
|
confidence: conf
|
|
981
971
|
});
|
|
982
|
-
assertionsCreated++;
|
|
983
972
|
relationshipsCreated++;
|
|
984
973
|
}
|
|
985
|
-
if (input.details) {
|
|
986
|
-
await this.http.post("/api/v1/assertions", {
|
|
987
|
-
tenant_id: this.tenantId,
|
|
988
|
-
subject: personSubject,
|
|
989
|
-
predicate: "details",
|
|
990
|
-
value: input.details,
|
|
991
|
-
confidence: conf
|
|
992
|
-
});
|
|
993
|
-
assertionsCreated++;
|
|
994
|
-
}
|
|
995
|
-
await this.http.post("/api/v1/assertions", {
|
|
996
|
-
tenant_id: this.tenantId,
|
|
997
|
-
subject: personSubject,
|
|
998
|
-
predicate: "status",
|
|
999
|
-
value: input.relationship === "candidate" ? "candidate" : "active",
|
|
1000
|
-
confidence: conf
|
|
1001
|
-
});
|
|
1002
|
-
assertionsCreated++;
|
|
1003
974
|
const FORWARD_MAP = {
|
|
1004
975
|
"direct_report": "manages" /* MANAGES */,
|
|
1005
976
|
"team_member": "has_member" /* HAS_MEMBER */,
|
|
1006
977
|
"candidate": "manages" /* MANAGES */,
|
|
1007
|
-
// user manages the hiring
|
|
1008
978
|
"manager": "reports_to" /* REPORTS_TO */,
|
|
1009
|
-
// user reports to this person
|
|
1010
979
|
"stakeholder": "stakeholder_in" /* STAKEHOLDER_IN */,
|
|
1011
980
|
"collaborator": "collaborates_with" /* COLLABORATES_WITH */,
|
|
1012
981
|
"mentor": "mentors" /* MENTORS */
|
|
@@ -1047,31 +1016,26 @@ ${connectedPeople.map((p) => {
|
|
|
1047
1016
|
async recordRapport(input) {
|
|
1048
1017
|
const userSubject = subject("user" /* USER */, input.userId);
|
|
1049
1018
|
const conf = typeof input.confidence === "number" ? input.confidence : confidenceToScore(input.confidence || "high" /* HIGH */);
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
predicate: input.type,
|
|
1054
|
-
value: input.value,
|
|
1055
|
-
confidence: conf
|
|
1056
|
-
});
|
|
1019
|
+
const candidates = [
|
|
1020
|
+
{ subject: userSubject, predicate: input.type, value: input.value, source_confidence: conf, provenance: "agent" }
|
|
1021
|
+
];
|
|
1057
1022
|
if (input.aboutPerson) {
|
|
1058
1023
|
const personSubject = subject("person" /* PERSON */, input.aboutPerson);
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
subject: personSubject,
|
|
1067
|
-
predicate: "timeline",
|
|
1068
|
-
value: input.value,
|
|
1069
|
-
confidence: conf
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
} catch {
|
|
1073
|
-
}
|
|
1024
|
+
candidates.push({
|
|
1025
|
+
subject: personSubject,
|
|
1026
|
+
predicate: "timeline",
|
|
1027
|
+
value: input.value,
|
|
1028
|
+
source_confidence: conf,
|
|
1029
|
+
provenance: "agent"
|
|
1030
|
+
});
|
|
1074
1031
|
}
|
|
1032
|
+
const correlationId = `rapport_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`;
|
|
1033
|
+
await this.http.post("/api/v1/intake/submit", {
|
|
1034
|
+
correlation_id: correlationId,
|
|
1035
|
+
agent_id: "sdk",
|
|
1036
|
+
tenant_id: this.tenantId,
|
|
1037
|
+
candidates
|
|
1038
|
+
});
|
|
1075
1039
|
return { success: true };
|
|
1076
1040
|
}
|
|
1077
1041
|
/**
|
|
@@ -1096,6 +1060,242 @@ function enc2(s) {
|
|
|
1096
1060
|
return encodeURIComponent(s);
|
|
1097
1061
|
}
|
|
1098
1062
|
|
|
1063
|
+
// src/types/rules.ts
|
|
1064
|
+
var RulePredicates = {
|
|
1065
|
+
BANNED_PATTERN: "rule:banned_pattern",
|
|
1066
|
+
REQUIRED_PATTERN: "rule:required_pattern",
|
|
1067
|
+
FILE_CONSTRAINT: "rule:file_constraint",
|
|
1068
|
+
REQUIRES_PROPAGATION: "rule:requires_propagation"
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
// src/rules.ts
|
|
1072
|
+
var RULE_PREDICATE_PREFIX = "rule:";
|
|
1073
|
+
var TYPE_TO_PREDICATE = {
|
|
1074
|
+
banned_pattern: RulePredicates.BANNED_PATTERN,
|
|
1075
|
+
required_pattern: RulePredicates.REQUIRED_PATTERN,
|
|
1076
|
+
file_constraint: RulePredicates.FILE_CONSTRAINT,
|
|
1077
|
+
requires_propagation: RulePredicates.REQUIRES_PROPAGATION
|
|
1078
|
+
};
|
|
1079
|
+
function defaultSeverity(confidence) {
|
|
1080
|
+
if (confidence >= 1) return "block";
|
|
1081
|
+
if (confidence >= 0.7) return "warn";
|
|
1082
|
+
return "info";
|
|
1083
|
+
}
|
|
1084
|
+
var RulesNamespace = class {
|
|
1085
|
+
http;
|
|
1086
|
+
tenantId;
|
|
1087
|
+
constructor(http, tenantId) {
|
|
1088
|
+
this.http = http;
|
|
1089
|
+
this.tenantId = tenantId;
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Create a new rule.
|
|
1093
|
+
*
|
|
1094
|
+
* Stores an assertion with a `rule:*` predicate and a typed value.
|
|
1095
|
+
* Defaults to confidence 1.0 (enforcement) if not specified.
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```typescript
|
|
1099
|
+
* await subcortex.rules.create({
|
|
1100
|
+
* subject: 'project:my-project',
|
|
1101
|
+
* type: 'banned_pattern',
|
|
1102
|
+
* pattern: 'as any',
|
|
1103
|
+
* description: 'No any casts — use proper types',
|
|
1104
|
+
* })
|
|
1105
|
+
* ```
|
|
1106
|
+
*/
|
|
1107
|
+
async create(input) {
|
|
1108
|
+
const confidence = input.confidence ?? 1;
|
|
1109
|
+
const severity = input.severity ?? defaultSeverity(confidence);
|
|
1110
|
+
const ruleValue = {
|
|
1111
|
+
description: input.description,
|
|
1112
|
+
pattern: input.pattern,
|
|
1113
|
+
fileScope: input.fileScope,
|
|
1114
|
+
propagatesTo: input.propagatesTo
|
|
1115
|
+
};
|
|
1116
|
+
const assertion = await this.http.post(
|
|
1117
|
+
`/api/v1/assertions`,
|
|
1118
|
+
{
|
|
1119
|
+
subject: input.subject,
|
|
1120
|
+
predicate: TYPE_TO_PREDICATE[input.type],
|
|
1121
|
+
value: { ...ruleValue, severity },
|
|
1122
|
+
confidence,
|
|
1123
|
+
tenant_id: input.tenantId ?? this.tenantId
|
|
1124
|
+
},
|
|
1125
|
+
input.tenantId ?? this.tenantId
|
|
1126
|
+
);
|
|
1127
|
+
return parseRule(assertion);
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Get a rule by its assertion ID.
|
|
1131
|
+
*/
|
|
1132
|
+
async get(ruleId, options) {
|
|
1133
|
+
const tenant = options?.tenantId ?? this.tenantId;
|
|
1134
|
+
const assertion = await this.http.get(
|
|
1135
|
+
`/api/v1/assertions/${enc3(tenant)}/${enc3(ruleId)}`
|
|
1136
|
+
);
|
|
1137
|
+
return parseRule(assertion);
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* List all rules for this project, optionally filtered by type or severity.
|
|
1141
|
+
*/
|
|
1142
|
+
async list(options) {
|
|
1143
|
+
const tenant = options?.tenantId ?? this.tenantId;
|
|
1144
|
+
const assertions = await this.http.get(
|
|
1145
|
+
`/api/v1/assertions/list/${enc3(tenant)}`
|
|
1146
|
+
);
|
|
1147
|
+
return assertions.filter((a) => isRuleAssertion(a)).filter((a) => options?.includeSuperseded || !a.isSuperseded).map(parseRule).filter((r) => !options?.type || r.type === options.type).filter((r) => !options?.severity || r.severity === options.severity);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Get all rules whose fileScope matches the given file path.
|
|
1151
|
+
*
|
|
1152
|
+
* This is the primary query for the PreToolUse hook — "what rules apply
|
|
1153
|
+
* to the file I'm about to modify?"
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
* ```typescript
|
|
1157
|
+
* const rules = await subcortex.rules.forFile('app/api/users/route.ts')
|
|
1158
|
+
* // Returns banned_pattern and required_pattern rules whose fileScope
|
|
1159
|
+
* // matches the path, plus any project-wide rules without a fileScope.
|
|
1160
|
+
* ```
|
|
1161
|
+
*/
|
|
1162
|
+
async forFile(filePath, options) {
|
|
1163
|
+
const allRules = await this.list(options);
|
|
1164
|
+
return allRules.filter((rule) => {
|
|
1165
|
+
if (!rule.value.fileScope) return true;
|
|
1166
|
+
try {
|
|
1167
|
+
const regex = new RegExp(rule.value.fileScope);
|
|
1168
|
+
return regex.test(filePath);
|
|
1169
|
+
} catch {
|
|
1170
|
+
return false;
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Get all rules scoped to a specific intent subject.
|
|
1176
|
+
*
|
|
1177
|
+
* @example
|
|
1178
|
+
* ```typescript
|
|
1179
|
+
* const apiRules = await subcortex.rules.forIntent('api')
|
|
1180
|
+
* // Queries subject "intent:api" for all rule assertions
|
|
1181
|
+
* ```
|
|
1182
|
+
*/
|
|
1183
|
+
async forIntent(intent, options) {
|
|
1184
|
+
const tenant = options?.tenantId ?? this.tenantId;
|
|
1185
|
+
const subject2 = intent.startsWith("intent:") ? intent : `intent:${intent}`;
|
|
1186
|
+
const assertions = await this.http.get(
|
|
1187
|
+
`/api/v1/assertions/query/${enc3(tenant)}/${enc3(subject2)}`
|
|
1188
|
+
);
|
|
1189
|
+
return assertions.filter((a) => isRuleAssertion(a)).filter((a) => options?.includeSuperseded || !a.isSuperseded).map(parseRule).filter((r) => !options?.type || r.type === options.type).filter((r) => !options?.severity || r.severity === options.severity);
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Get all rules scoped to a specific subject (project, file, intent, etc.).
|
|
1193
|
+
*/
|
|
1194
|
+
async forSubject(subject2, options) {
|
|
1195
|
+
const tenant = options?.tenantId ?? this.tenantId;
|
|
1196
|
+
const assertions = await this.http.get(
|
|
1197
|
+
`/api/v1/assertions/query/${enc3(tenant)}/${enc3(subject2)}`
|
|
1198
|
+
);
|
|
1199
|
+
return assertions.filter((a) => isRuleAssertion(a)).filter((a) => options?.includeSuperseded || !a.isSuperseded).map(parseRule).filter((r) => !options?.type || r.type === options.type).filter((r) => !options?.severity || r.severity === options.severity);
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* Update a rule by superseding it.
|
|
1203
|
+
*
|
|
1204
|
+
* The old rule is marked as superseded, a new one is created.
|
|
1205
|
+
* Full assertion history is preserved.
|
|
1206
|
+
*/
|
|
1207
|
+
async update(input) {
|
|
1208
|
+
const tenant = input.tenantId ?? this.tenantId;
|
|
1209
|
+
const existing = await this.get(input.ruleId, { tenantId: tenant });
|
|
1210
|
+
const confidence = input.confidence ?? existing.confidence;
|
|
1211
|
+
const severity = input.severity ?? existing.severity;
|
|
1212
|
+
const ruleValue = {
|
|
1213
|
+
description: input.description ?? existing.value.description,
|
|
1214
|
+
pattern: input.pattern ?? existing.value.pattern,
|
|
1215
|
+
fileScope: input.fileScope ?? existing.value.fileScope,
|
|
1216
|
+
propagatesTo: input.propagatesTo ?? existing.value.propagatesTo
|
|
1217
|
+
};
|
|
1218
|
+
const assertion = await this.http.post(
|
|
1219
|
+
`/api/v1/assertions/supersede`,
|
|
1220
|
+
{
|
|
1221
|
+
original_assertion_id: input.ruleId,
|
|
1222
|
+
subject: existing.subject,
|
|
1223
|
+
predicate: existing.predicate,
|
|
1224
|
+
value: { ...ruleValue, severity },
|
|
1225
|
+
confidence,
|
|
1226
|
+
tenant_id: tenant
|
|
1227
|
+
},
|
|
1228
|
+
tenant
|
|
1229
|
+
);
|
|
1230
|
+
return parseRule(assertion);
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Retract (deactivate) a rule.
|
|
1234
|
+
*
|
|
1235
|
+
* The assertion's temporal bounds are closed. The rule stops matching
|
|
1236
|
+
* in future queries but its history is preserved.
|
|
1237
|
+
*/
|
|
1238
|
+
async retract(ruleId, options) {
|
|
1239
|
+
const tenant = options?.tenantId ?? this.tenantId;
|
|
1240
|
+
await this.http.post(
|
|
1241
|
+
`/api/v1/assertions/retract/${enc3(tenant)}/${enc3(ruleId)}`,
|
|
1242
|
+
{},
|
|
1243
|
+
tenant
|
|
1244
|
+
);
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
function isRuleAssertion(assertion) {
|
|
1248
|
+
return assertion.predicate?.startsWith(RULE_PREDICATE_PREFIX) ?? false;
|
|
1249
|
+
}
|
|
1250
|
+
function parseRule(assertion) {
|
|
1251
|
+
const predicate = assertion.predicate;
|
|
1252
|
+
const type = predicate.replace(RULE_PREDICATE_PREFIX, "");
|
|
1253
|
+
let ruleValue;
|
|
1254
|
+
let severity;
|
|
1255
|
+
if (typeof assertion.value === "object" && assertion.value !== null) {
|
|
1256
|
+
const val = assertion.value;
|
|
1257
|
+
ruleValue = {
|
|
1258
|
+
description: String(val.description ?? ""),
|
|
1259
|
+
pattern: val.pattern != null ? String(val.pattern) : void 0,
|
|
1260
|
+
fileScope: val.fileScope != null ? String(val.fileScope) : void 0,
|
|
1261
|
+
propagatesTo: Array.isArray(val.propagatesTo) ? val.propagatesTo.map(String) : void 0
|
|
1262
|
+
};
|
|
1263
|
+
severity = val.severity ?? defaultSeverity(assertion.confidence);
|
|
1264
|
+
} else if (typeof assertion.value === "string") {
|
|
1265
|
+
try {
|
|
1266
|
+
const parsed = JSON.parse(assertion.value);
|
|
1267
|
+
ruleValue = {
|
|
1268
|
+
description: String(parsed.description ?? ""),
|
|
1269
|
+
pattern: parsed.pattern != null ? String(parsed.pattern) : void 0,
|
|
1270
|
+
fileScope: parsed.filePattern != null ? String(parsed.filePattern) : void 0,
|
|
1271
|
+
propagatesTo: Array.isArray(parsed.propagatesTo) ? parsed.propagatesTo.map(String) : void 0
|
|
1272
|
+
};
|
|
1273
|
+
severity = parsed.severity ?? defaultSeverity(assertion.confidence);
|
|
1274
|
+
} catch {
|
|
1275
|
+
ruleValue = { description: String(assertion.value) };
|
|
1276
|
+
severity = defaultSeverity(assertion.confidence);
|
|
1277
|
+
}
|
|
1278
|
+
} else {
|
|
1279
|
+
ruleValue = { description: "" };
|
|
1280
|
+
severity = defaultSeverity(assertion.confidence);
|
|
1281
|
+
}
|
|
1282
|
+
return {
|
|
1283
|
+
id: assertion.id,
|
|
1284
|
+
tenantId: assertion.tenantId,
|
|
1285
|
+
subject: assertion.subject,
|
|
1286
|
+
type,
|
|
1287
|
+
predicate,
|
|
1288
|
+
value: ruleValue,
|
|
1289
|
+
severity,
|
|
1290
|
+
confidence: assertion.confidence,
|
|
1291
|
+
validFrom: assertion.validFrom,
|
|
1292
|
+
isSuperseded: assertion.isSuperseded
|
|
1293
|
+
};
|
|
1294
|
+
}
|
|
1295
|
+
function enc3(s) {
|
|
1296
|
+
return encodeURIComponent(s);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1099
1299
|
// src/client.ts
|
|
1100
1300
|
var AssertionsNamespace = class {
|
|
1101
1301
|
constructor(http, tenantId) {
|
|
@@ -1117,21 +1317,21 @@ var AssertionsNamespace = class {
|
|
|
1117
1317
|
async get(assertionId, options) {
|
|
1118
1318
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1119
1319
|
return this.http.get(
|
|
1120
|
-
`/api/v1/assertions/${
|
|
1320
|
+
`/api/v1/assertions/${enc4(tenantId)}/${enc4(assertionId)}`
|
|
1121
1321
|
);
|
|
1122
1322
|
}
|
|
1123
1323
|
/** Query assertions by subject. */
|
|
1124
1324
|
async query(subject2, options) {
|
|
1125
1325
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1126
1326
|
return this.http.get(
|
|
1127
|
-
`/api/v1/assertions/query/${
|
|
1327
|
+
`/api/v1/assertions/query/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1128
1328
|
);
|
|
1129
1329
|
}
|
|
1130
1330
|
/** List all active assertions for the tenant. */
|
|
1131
1331
|
async list(options) {
|
|
1132
1332
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1133
1333
|
return this.http.get(
|
|
1134
|
-
`/api/v1/assertions/list/${
|
|
1334
|
+
`/api/v1/assertions/list/${enc4(tenantId)}`
|
|
1135
1335
|
);
|
|
1136
1336
|
}
|
|
1137
1337
|
/** Supersede an existing assertion with updated values. */
|
|
@@ -1150,7 +1350,7 @@ var AssertionsNamespace = class {
|
|
|
1150
1350
|
async retract(assertionId, options) {
|
|
1151
1351
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1152
1352
|
return this.http.post(
|
|
1153
|
-
`/api/v1/assertions/retract/${
|
|
1353
|
+
`/api/v1/assertions/retract/${enc4(tenantId)}/${enc4(assertionId)}`,
|
|
1154
1354
|
{}
|
|
1155
1355
|
);
|
|
1156
1356
|
}
|
|
@@ -1177,14 +1377,14 @@ var RelationshipsNamespace = class {
|
|
|
1177
1377
|
async query(subject2, options) {
|
|
1178
1378
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1179
1379
|
return this.http.get(
|
|
1180
|
-
`/api/v1/relationships/${
|
|
1380
|
+
`/api/v1/relationships/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1181
1381
|
);
|
|
1182
1382
|
}
|
|
1183
1383
|
/** List all relationships for the tenant. */
|
|
1184
1384
|
async list(options) {
|
|
1185
1385
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1186
1386
|
return this.http.get(
|
|
1187
|
-
`/api/v1/relationships/list/${
|
|
1387
|
+
`/api/v1/relationships/list/${enc4(tenantId)}`
|
|
1188
1388
|
);
|
|
1189
1389
|
}
|
|
1190
1390
|
};
|
|
@@ -1211,14 +1411,14 @@ var AgentsNamespace = class {
|
|
|
1211
1411
|
async get(agentId, options) {
|
|
1212
1412
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1213
1413
|
return this.http.get(
|
|
1214
|
-
`/api/v1/agents/${
|
|
1414
|
+
`/api/v1/agents/${enc4(tenantId)}/${enc4(agentId)}`
|
|
1215
1415
|
);
|
|
1216
1416
|
}
|
|
1217
1417
|
/** Update an agent. */
|
|
1218
1418
|
async update(agentId, input, options) {
|
|
1219
1419
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1220
1420
|
return this.http.put(
|
|
1221
|
-
`/api/v1/agents/${
|
|
1421
|
+
`/api/v1/agents/${enc4(tenantId)}/${enc4(agentId)}`,
|
|
1222
1422
|
{
|
|
1223
1423
|
tenant_id: tenantId,
|
|
1224
1424
|
name: input.name,
|
|
@@ -1235,20 +1435,20 @@ var AgentsNamespace = class {
|
|
|
1235
1435
|
/** Delete an agent. */
|
|
1236
1436
|
async delete(agentId, options) {
|
|
1237
1437
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1238
|
-
await this.http.delete(`/api/v1/agents/${
|
|
1438
|
+
await this.http.delete(`/api/v1/agents/${enc4(tenantId)}/${enc4(agentId)}`);
|
|
1239
1439
|
}
|
|
1240
1440
|
/** List all agents for the tenant. */
|
|
1241
1441
|
async list(options) {
|
|
1242
1442
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1243
1443
|
return this.http.get(
|
|
1244
|
-
`/api/v1/agents/list/${
|
|
1444
|
+
`/api/v1/agents/list/${enc4(tenantId)}`
|
|
1245
1445
|
);
|
|
1246
1446
|
}
|
|
1247
1447
|
/** Get composed system instructions for an agent. */
|
|
1248
1448
|
async getInstructions(agentId, options) {
|
|
1249
1449
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1250
1450
|
return this.http.get(
|
|
1251
|
-
`/api/v1/agents/${
|
|
1451
|
+
`/api/v1/agents/${enc4(tenantId)}/${enc4(agentId)}/instructions`
|
|
1252
1452
|
);
|
|
1253
1453
|
}
|
|
1254
1454
|
};
|
|
@@ -1298,14 +1498,14 @@ var MemoryNamespace = class {
|
|
|
1298
1498
|
async recall(subject2, options) {
|
|
1299
1499
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1300
1500
|
return this.http.get(
|
|
1301
|
-
`/api/v1/assertions/query/${
|
|
1501
|
+
`/api/v1/assertions/query/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1302
1502
|
);
|
|
1303
1503
|
}
|
|
1304
1504
|
/** Forget a specific memory (retract the assertion). */
|
|
1305
1505
|
async forget(assertionId, options) {
|
|
1306
1506
|
const tenantId = options?.tenantId || this.tenantId;
|
|
1307
1507
|
return this.http.post(
|
|
1308
|
-
`/api/v1/assertions/retract/${
|
|
1508
|
+
`/api/v1/assertions/retract/${enc4(tenantId)}/${enc4(assertionId)}`,
|
|
1309
1509
|
{}
|
|
1310
1510
|
);
|
|
1311
1511
|
}
|
|
@@ -1337,7 +1537,7 @@ var IntakeNamespace = class {
|
|
|
1337
1537
|
}
|
|
1338
1538
|
/** Get pending intake results for an agent. */
|
|
1339
1539
|
async pending(agentId, options) {
|
|
1340
|
-
let path = `/api/v1/intake/pending/${
|
|
1540
|
+
let path = `/api/v1/intake/pending/${enc4(agentId)}`;
|
|
1341
1541
|
const params = [];
|
|
1342
1542
|
if (options?.status) params.push(`status=${options.status.join(",")}`);
|
|
1343
1543
|
if (options?.limit) params.push(`limit=${options.limit}`);
|
|
@@ -1346,18 +1546,131 @@ var IntakeNamespace = class {
|
|
|
1346
1546
|
}
|
|
1347
1547
|
/** Acknowledge an intake result (mark as consumed). */
|
|
1348
1548
|
async acknowledge(itemId) {
|
|
1349
|
-
await this.http.post(`/api/v1/intake/acknowledge/${
|
|
1549
|
+
await this.http.post(`/api/v1/intake/acknowledge/${enc4(itemId)}`, {});
|
|
1350
1550
|
}
|
|
1351
1551
|
/** Acknowledge all pending items for an agent. */
|
|
1352
1552
|
async acknowledgeAll(agentId) {
|
|
1353
1553
|
return this.http.post(
|
|
1354
|
-
`/api/v1/intake/acknowledge-all/${
|
|
1554
|
+
`/api/v1/intake/acknowledge-all/${enc4(agentId)}`,
|
|
1355
1555
|
{}
|
|
1356
1556
|
);
|
|
1357
1557
|
}
|
|
1358
1558
|
/** Get intake processing stats for an agent. */
|
|
1359
1559
|
async stats(agentId) {
|
|
1360
|
-
return this.http.get(`/api/v1/intake/stats/${
|
|
1560
|
+
return this.http.get(`/api/v1/intake/stats/${enc4(agentId)}`);
|
|
1561
|
+
}
|
|
1562
|
+
};
|
|
1563
|
+
var ExperiencesNamespace = class {
|
|
1564
|
+
constructor(http, tenantId) {
|
|
1565
|
+
this.http = http;
|
|
1566
|
+
this.tenantId = tenantId;
|
|
1567
|
+
}
|
|
1568
|
+
/** List experiences, optionally filtered by subject. */
|
|
1569
|
+
async list(input) {
|
|
1570
|
+
const tenantId = input?.tenantId || this.tenantId;
|
|
1571
|
+
const params = new URLSearchParams();
|
|
1572
|
+
if (input?.subject) params.set("subject", input.subject);
|
|
1573
|
+
if (input?.limit) params.set("limit", String(input.limit));
|
|
1574
|
+
const qs = params.toString();
|
|
1575
|
+
return this.http.get(
|
|
1576
|
+
`/api/v1/experiences/${enc4(tenantId)}${qs ? `?${qs}` : ""}`
|
|
1577
|
+
);
|
|
1578
|
+
}
|
|
1579
|
+
/** Get a single experience by ID. */
|
|
1580
|
+
async get(experienceId, options) {
|
|
1581
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1582
|
+
return this.http.get(
|
|
1583
|
+
`/api/v1/experiences/${enc4(tenantId)}/${enc4(experienceId)}`
|
|
1584
|
+
);
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
1587
|
+
var RecallNamespace = class {
|
|
1588
|
+
constructor(http, tenantId) {
|
|
1589
|
+
this.http = http;
|
|
1590
|
+
this.tenantId = tenantId;
|
|
1591
|
+
}
|
|
1592
|
+
/** BM25 full-text search across assertions. */
|
|
1593
|
+
async search(input) {
|
|
1594
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1595
|
+
const params = new URLSearchParams({ q: input.query });
|
|
1596
|
+
if (input.limit) params.set("limit", String(input.limit));
|
|
1597
|
+
return this.http.get(
|
|
1598
|
+
`/api/v1/recall/${enc4(tenantId)}?${params.toString()}`
|
|
1599
|
+
);
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
var GraphNamespace = class {
|
|
1603
|
+
constructor(http, tenantId) {
|
|
1604
|
+
this.http = http;
|
|
1605
|
+
this.tenantId = tenantId;
|
|
1606
|
+
}
|
|
1607
|
+
/** Find paths between two subjects. */
|
|
1608
|
+
async findPaths(input) {
|
|
1609
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1610
|
+
return this.http.post(
|
|
1611
|
+
`/api/v1/graph/${enc4(tenantId)}/paths`,
|
|
1612
|
+
{
|
|
1613
|
+
from: input.from,
|
|
1614
|
+
to: input.to,
|
|
1615
|
+
max_depth: input.maxDepth,
|
|
1616
|
+
min_confidence: input.minConfidence,
|
|
1617
|
+
strategy: input.strategy
|
|
1618
|
+
}
|
|
1619
|
+
);
|
|
1620
|
+
}
|
|
1621
|
+
/** BFS traversal from a starting subject. */
|
|
1622
|
+
async traverse(input) {
|
|
1623
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1624
|
+
return this.http.post(
|
|
1625
|
+
`/api/v1/graph/${enc4(tenantId)}/traverse`,
|
|
1626
|
+
{
|
|
1627
|
+
start_subject: input.startSubject,
|
|
1628
|
+
max_depth: input.maxDepth,
|
|
1629
|
+
relationship_types: input.relationshipTypes,
|
|
1630
|
+
min_confidence: input.minConfidence,
|
|
1631
|
+
max_nodes: input.maxNodes
|
|
1632
|
+
}
|
|
1633
|
+
);
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
var TemporalNamespace = class {
|
|
1637
|
+
constructor(http, tenantId) {
|
|
1638
|
+
this.http = http;
|
|
1639
|
+
this.tenantId = tenantId;
|
|
1640
|
+
}
|
|
1641
|
+
/** Get assertions valid at a specific point in time. */
|
|
1642
|
+
async at(subject2, point, options) {
|
|
1643
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1644
|
+
const pointStr = point instanceof Date ? point.toISOString() : point;
|
|
1645
|
+
return this.http.get(
|
|
1646
|
+
`/api/v1/temporal/${enc4(tenantId)}/${enc4(subject2)}/at?point=${enc4(pointStr)}`
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
/** Get assertions within a date range. */
|
|
1650
|
+
async range(subject2, start, end, options) {
|
|
1651
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1652
|
+
const startStr = start instanceof Date ? start.toISOString() : start;
|
|
1653
|
+
const endStr = end instanceof Date ? end.toISOString() : end;
|
|
1654
|
+
return this.http.get(
|
|
1655
|
+
`/api/v1/temporal/${enc4(tenantId)}/${enc4(subject2)}/range?start=${enc4(startStr)}&end=${enc4(endStr)}`
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
var SearchNamespace = class {
|
|
1660
|
+
constructor(http, tenantId) {
|
|
1661
|
+
this.http = http;
|
|
1662
|
+
this.tenantId = tenantId;
|
|
1663
|
+
}
|
|
1664
|
+
/** Semantic nearest-neighbor search over assertion embeddings. */
|
|
1665
|
+
async semantic(input) {
|
|
1666
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1667
|
+
return this.http.post(
|
|
1668
|
+
`/api/v1/search/${enc4(tenantId)}/semantic`,
|
|
1669
|
+
{
|
|
1670
|
+
embedding: input.embedding,
|
|
1671
|
+
top_k: input.topK
|
|
1672
|
+
}
|
|
1673
|
+
);
|
|
1361
1674
|
}
|
|
1362
1675
|
};
|
|
1363
1676
|
var DEFAULT_RETRY = {
|
|
@@ -1365,6 +1678,129 @@ var DEFAULT_RETRY = {
|
|
|
1365
1678
|
baseDelayMs: 500,
|
|
1366
1679
|
maxDelayMs: 1e4
|
|
1367
1680
|
};
|
|
1681
|
+
var EntitiesNamespace = class {
|
|
1682
|
+
constructor(http, tenantId) {
|
|
1683
|
+
this.http = http;
|
|
1684
|
+
this.tenantId = tenantId;
|
|
1685
|
+
}
|
|
1686
|
+
/** Create an entity with optional description and type. */
|
|
1687
|
+
async create(input) {
|
|
1688
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1689
|
+
const subject2 = `entity:${input.name.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1690
|
+
const typeAssertion = await this.http.post(
|
|
1691
|
+
`/api/v1/assertions`,
|
|
1692
|
+
{
|
|
1693
|
+
tenant_id: tenantId,
|
|
1694
|
+
subject: subject2,
|
|
1695
|
+
predicate: "type",
|
|
1696
|
+
value: input.type || "model",
|
|
1697
|
+
confidence: 1
|
|
1698
|
+
}
|
|
1699
|
+
);
|
|
1700
|
+
if (input.description) {
|
|
1701
|
+
await this.http.post(
|
|
1702
|
+
`/api/v1/assertions`,
|
|
1703
|
+
{
|
|
1704
|
+
tenant_id: tenantId,
|
|
1705
|
+
subject: subject2,
|
|
1706
|
+
predicate: "description",
|
|
1707
|
+
value: input.description,
|
|
1708
|
+
confidence: 1
|
|
1709
|
+
}
|
|
1710
|
+
);
|
|
1711
|
+
}
|
|
1712
|
+
return typeAssertion;
|
|
1713
|
+
}
|
|
1714
|
+
/** Add a property to an entity. */
|
|
1715
|
+
async addProperty(input) {
|
|
1716
|
+
const tenantId = input.tenantId || this.tenantId;
|
|
1717
|
+
const entitySubject = `entity:${input.entityName.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1718
|
+
const propertySubject = `property:${input.entityName.toLowerCase().replace(/\s+/g, "-")}.${input.name.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1719
|
+
const assertion = await this.http.post(
|
|
1720
|
+
`/api/v1/assertions`,
|
|
1721
|
+
{
|
|
1722
|
+
tenant_id: tenantId,
|
|
1723
|
+
subject: propertySubject,
|
|
1724
|
+
predicate: "field_type",
|
|
1725
|
+
value: input.fieldType,
|
|
1726
|
+
confidence: 1
|
|
1727
|
+
}
|
|
1728
|
+
);
|
|
1729
|
+
const relationship = await this.http.post(
|
|
1730
|
+
`/api/v1/relationships`,
|
|
1731
|
+
{
|
|
1732
|
+
tenant_id: tenantId,
|
|
1733
|
+
from_subject: entitySubject,
|
|
1734
|
+
to_subject: propertySubject,
|
|
1735
|
+
relationship_type: "has_property",
|
|
1736
|
+
confidence: 1
|
|
1737
|
+
}
|
|
1738
|
+
);
|
|
1739
|
+
if (input.required) {
|
|
1740
|
+
await this.http.post(
|
|
1741
|
+
`/api/v1/assertions`,
|
|
1742
|
+
{
|
|
1743
|
+
tenant_id: tenantId,
|
|
1744
|
+
subject: propertySubject,
|
|
1745
|
+
predicate: "required",
|
|
1746
|
+
value: true,
|
|
1747
|
+
confidence: 1
|
|
1748
|
+
}
|
|
1749
|
+
);
|
|
1750
|
+
}
|
|
1751
|
+
return { assertion, relationship };
|
|
1752
|
+
}
|
|
1753
|
+
/** Describe an entity by reconstructing its properties and relationships from assertions. */
|
|
1754
|
+
async describe(entityName, options) {
|
|
1755
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1756
|
+
const subject2 = `entity:${entityName.toLowerCase().replace(/\s+/g, "-")}`;
|
|
1757
|
+
const assertions = await this.http.get(
|
|
1758
|
+
`/api/v1/assertions/query/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1759
|
+
);
|
|
1760
|
+
const relationships = await this.http.get(
|
|
1761
|
+
`/api/v1/relationships/query/${enc4(tenantId)}/${enc4(subject2)}`
|
|
1762
|
+
);
|
|
1763
|
+
const typeAssertion = assertions.find((a) => a.predicate === "type" && !a.isSuperseded);
|
|
1764
|
+
const descAssertion = assertions.find((a) => a.predicate === "description" && !a.isSuperseded);
|
|
1765
|
+
const propertyRels = relationships.filter((r) => r.relationshipType === "has_property");
|
|
1766
|
+
const properties = await Promise.all(
|
|
1767
|
+
propertyRels.map(async (rel) => {
|
|
1768
|
+
const propAssertions = await this.http.get(
|
|
1769
|
+
`/api/v1/assertions/query/${enc4(tenantId)}/${enc4(rel.toSubject)}`
|
|
1770
|
+
);
|
|
1771
|
+
const fieldType = propAssertions.find((a) => a.predicate === "field_type" && !a.isSuperseded);
|
|
1772
|
+
const required = propAssertions.find((a) => a.predicate === "required" && !a.isSuperseded);
|
|
1773
|
+
const name = rel.toSubject.replace(/^property:[^.]+\./, "");
|
|
1774
|
+
return {
|
|
1775
|
+
name,
|
|
1776
|
+
fieldType: fieldType ? String(fieldType.value) : null,
|
|
1777
|
+
required: required ? Boolean(required.value) : false
|
|
1778
|
+
};
|
|
1779
|
+
})
|
|
1780
|
+
);
|
|
1781
|
+
const otherRels = relationships.filter((r) => r.relationshipType !== "has_property").map((r) => ({
|
|
1782
|
+
type: r.relationshipType,
|
|
1783
|
+
target: r.toSubject,
|
|
1784
|
+
confidence: r.confidence
|
|
1785
|
+
}));
|
|
1786
|
+
return {
|
|
1787
|
+
subject: subject2,
|
|
1788
|
+
name: entityName,
|
|
1789
|
+
type: typeAssertion ? String(typeAssertion.value) : null,
|
|
1790
|
+
description: descAssertion ? String(descAssertion.value) : null,
|
|
1791
|
+
properties,
|
|
1792
|
+
relationships: otherRels
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
/** List all entities for a tenant (subjects with entity: prefix that have a type predicate). */
|
|
1796
|
+
async list(options) {
|
|
1797
|
+
const tenantId = options?.tenantId || this.tenantId;
|
|
1798
|
+
const all = await this.http.get(
|
|
1799
|
+
`/api/v1/assertions/list/${enc4(tenantId)}`
|
|
1800
|
+
);
|
|
1801
|
+
return all.filter((a) => a.subject.startsWith("entity:") && a.predicate === "type" && !a.isSuperseded);
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1368
1804
|
var SubCortexClient = class {
|
|
1369
1805
|
/** Assertion operations (low-level knowledge primitives) */
|
|
1370
1806
|
assertions;
|
|
@@ -1380,6 +1816,20 @@ var SubCortexClient = class {
|
|
|
1380
1816
|
users;
|
|
1381
1817
|
/** Emotional signals — record, query, and resolve */
|
|
1382
1818
|
signals;
|
|
1819
|
+
/** Graph queries — pathfinding and traversal */
|
|
1820
|
+
graph;
|
|
1821
|
+
/** Temporal queries — point-in-time snapshots and range queries */
|
|
1822
|
+
temporal;
|
|
1823
|
+
/** Semantic search over assertion embeddings */
|
|
1824
|
+
search;
|
|
1825
|
+
/** BM25 full-text recall search */
|
|
1826
|
+
recall;
|
|
1827
|
+
/** Episodic memory — experiences grouped by session */
|
|
1828
|
+
experiences;
|
|
1829
|
+
/** Entity schema management — create, describe, and manage data models */
|
|
1830
|
+
entities;
|
|
1831
|
+
/** Code guardrails — typed rules stored as assertions with file-scope matching */
|
|
1832
|
+
rules;
|
|
1383
1833
|
http;
|
|
1384
1834
|
constructor(options) {
|
|
1385
1835
|
if (!options.apiKey && !options.token) {
|
|
@@ -1403,13 +1853,20 @@ var SubCortexClient = class {
|
|
|
1403
1853
|
this.intake = new IntakeNamespace(this.http, options.tenantId);
|
|
1404
1854
|
this.users = new UsersNamespace(this.http, options.tenantId);
|
|
1405
1855
|
this.signals = new SignalsNamespace(this.http, options.tenantId);
|
|
1856
|
+
this.graph = new GraphNamespace(this.http, options.tenantId);
|
|
1857
|
+
this.temporal = new TemporalNamespace(this.http, options.tenantId);
|
|
1858
|
+
this.search = new SearchNamespace(this.http, options.tenantId);
|
|
1859
|
+
this.recall = new RecallNamespace(this.http, options.tenantId);
|
|
1860
|
+
this.experiences = new ExperiencesNamespace(this.http, options.tenantId);
|
|
1861
|
+
this.entities = new EntitiesNamespace(this.http, options.tenantId);
|
|
1862
|
+
this.rules = new RulesNamespace(this.http, options.tenantId);
|
|
1406
1863
|
}
|
|
1407
1864
|
/** Check SubCortex server health. */
|
|
1408
1865
|
async health() {
|
|
1409
1866
|
return this.http.get("/health");
|
|
1410
1867
|
}
|
|
1411
1868
|
};
|
|
1412
|
-
function
|
|
1869
|
+
function enc4(s) {
|
|
1413
1870
|
return encodeURIComponent(s);
|
|
1414
1871
|
}
|
|
1415
1872
|
|
|
@@ -1577,9 +2034,12 @@ export {
|
|
|
1577
2034
|
CONTEXT_SCHEMA_VERSION,
|
|
1578
2035
|
ConfidenceLevel,
|
|
1579
2036
|
ConfidenceScores,
|
|
2037
|
+
EntitiesNamespace,
|
|
1580
2038
|
EntityPredicate,
|
|
1581
2039
|
EntityRelationship,
|
|
1582
2040
|
EventPredicate,
|
|
2041
|
+
ExperiencesNamespace,
|
|
2042
|
+
GraphNamespace,
|
|
1583
2043
|
IdentityPredicate,
|
|
1584
2044
|
IntakeNamespace,
|
|
1585
2045
|
MULTI_VALUE_PREDICATES,
|
|
@@ -1592,10 +2052,14 @@ export {
|
|
|
1592
2052
|
RELATIONSHIP_LABELS,
|
|
1593
2053
|
REVERSE_RELATIONSHIPS,
|
|
1594
2054
|
RapportPredicate,
|
|
2055
|
+
RecallNamespace,
|
|
1595
2056
|
RelationshipTypes,
|
|
1596
2057
|
RelationshipsNamespace,
|
|
2058
|
+
RulePredicates,
|
|
2059
|
+
RulesNamespace,
|
|
1597
2060
|
SIGNAL_DECAY_CONFIG,
|
|
1598
2061
|
SYSTEM_SIGNAL_TYPES,
|
|
2062
|
+
SearchNamespace,
|
|
1599
2063
|
SignalsNamespace,
|
|
1600
2064
|
SubCortexAuthenticationError,
|
|
1601
2065
|
SubCortexAuthorizationError,
|
|
@@ -1609,6 +2073,7 @@ export {
|
|
|
1609
2073
|
SubCortexTimeoutError,
|
|
1610
2074
|
SubCortexValidationError,
|
|
1611
2075
|
SubjectPrefix,
|
|
2076
|
+
TemporalNamespace,
|
|
1612
2077
|
UsersNamespace,
|
|
1613
2078
|
WorkPredicate,
|
|
1614
2079
|
confidenceToScore,
|