@manta-eu/client 0.2.1 → 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.
Files changed (43) hide show
  1. package/dist/generated/graphql.d.ts +68 -35
  2. package/dist/generated/graphql.d.ts.map +1 -1
  3. package/dist/generated/graphql.js +31 -14
  4. package/dist/generated/graphql.js.map +1 -1
  5. package/dist/shared/datastore-id.js +1 -1
  6. package/dist/shared/datastore-id.js.map +1 -1
  7. package/dist/shared/memory-citation-sampling.d.ts +2 -1
  8. package/dist/shared/memory-citation-sampling.d.ts.map +1 -1
  9. package/dist/shared/memory-citation-sampling.js +5 -4
  10. package/dist/shared/memory-citation-sampling.js.map +1 -1
  11. package/dist/shared/memory-diversity.js +1 -1
  12. package/dist/shared/memory-diversity.js.map +1 -1
  13. package/dist/shared/memory-keyword-recall.d.ts +1 -0
  14. package/dist/shared/memory-keyword-recall.d.ts.map +1 -1
  15. package/dist/shared/memory-keyword-recall.js +2 -1
  16. package/dist/shared/memory-keyword-recall.js.map +1 -1
  17. package/dist/shared/rdf-namespaces.d.ts +1 -3
  18. package/dist/shared/rdf-namespaces.d.ts.map +1 -1
  19. package/dist/shared/rdf-namespaces.js +2 -4
  20. package/dist/shared/rdf-namespaces.js.map +1 -1
  21. package/dist/shared/tools/coercers.d.ts.map +1 -1
  22. package/dist/shared/tools/coercers.js +6 -3
  23. package/dist/shared/tools/coercers.js.map +1 -1
  24. package/dist/shared/tools/index.d.ts +1 -1
  25. package/dist/shared/tools/index.d.ts.map +1 -1
  26. package/dist/shared/tools/metadata.js +23 -23
  27. package/dist/shared/tools/metadata.js.map +1 -1
  28. package/dist/shared/tools/types.d.ts +24 -24
  29. package/dist/shared/tools/types.d.ts.map +1 -1
  30. package/dist/shared/writable-shape-query.js +2 -2
  31. package/dist/shared/writable-shape-query.js.map +1 -1
  32. package/package.json +5 -5
  33. package/src/generated/graphql.ts +107 -50
  34. package/src/shared/datastore-id.ts +1 -1
  35. package/src/shared/memory-citation-sampling.ts +5 -5
  36. package/src/shared/memory-diversity.ts +1 -1
  37. package/src/shared/memory-keyword-recall.ts +3 -1
  38. package/src/shared/rdf-namespaces.ts +2 -9
  39. package/src/shared/tools/coercers.ts +7 -4
  40. package/src/shared/tools/index.ts +8 -8
  41. package/src/shared/tools/metadata.ts +23 -23
  42. package/src/shared/tools/types.ts +30 -30
  43. package/src/shared/writable-shape-query.ts +2 -2
@@ -846,8 +846,12 @@ export type GQLDatastoreProvisioningStatus = {
846
846
 
847
847
  export type GQLDatastoreSubscription = {
848
848
  __typename?: "DatastoreSubscription";
849
+ amount?: Maybe<Scalars["Int"]["output"]>;
850
+ currency?: Maybe<Scalars["String"]["output"]>;
849
851
  datastoreId: Scalars["String"]["output"];
850
852
  inGoodStanding: Scalars["Boolean"]["output"];
853
+ interval?: Maybe<Scalars["String"]["output"]>;
854
+ intervalCount?: Maybe<Scalars["Int"]["output"]>;
851
855
  status: Scalars["String"]["output"];
852
856
  };
853
857
 
@@ -1029,6 +1033,14 @@ export type GQLExecuteActionUpdateInput = {
1029
1033
  subjectIri: Scalars["IRI"]["input"];
1030
1034
  };
1031
1035
 
1036
+ export type GQLFactExplanationResponse = {
1037
+ __typename?: "FactExplanationResponse";
1038
+ error?: Maybe<Scalars["String"]["output"]>;
1039
+ facts: Scalars["JSON"]["output"];
1040
+ formatted: Scalars["String"]["output"];
1041
+ summary?: Maybe<Scalars["String"]["output"]>;
1042
+ };
1043
+
1032
1044
  export enum GQLFactValueStatus {
1033
1045
  Changed = "CHANGED",
1034
1046
  Removed = "REMOVED",
@@ -1043,6 +1055,12 @@ export type GQLFileFactsInput = {
1043
1055
  width?: InputMaybe<Scalars["PositiveInt"]["input"]>;
1044
1056
  };
1045
1057
 
1058
+ export type GQLForgetUserNameResponse = {
1059
+ __typename?: "ForgetUserNameResponse";
1060
+ datastoreIds: Array<Scalars["String"]["output"]>;
1061
+ id: Scalars["String"]["output"];
1062
+ };
1063
+
1046
1064
  export type GQLGmailIntegration = {
1047
1065
  __typename?: "GmailIntegration";
1048
1066
  email: Scalars["String"]["output"];
@@ -1213,6 +1231,7 @@ export type GQLInitiateUploadResponse = {
1213
1231
  };
1214
1232
 
1215
1233
  export enum GQLIntegration {
1234
+ Canva = "CANVA",
1216
1235
  Dash = "DASH",
1217
1236
  Figma = "FIGMA",
1218
1237
  Google = "GOOGLE",
@@ -1372,7 +1391,7 @@ export type GQLLinkedinSetupProgress = {
1372
1391
  state: Array<Scalars["String"]["output"]>;
1373
1392
  };
1374
1393
 
1375
- export type GQLManageRdFoxRuleInput = {
1394
+ export type GQLManageRuleInput = {
1376
1395
  dryRun?: InputMaybe<Scalars["Boolean"]["input"]>;
1377
1396
  expectNoInference?: InputMaybe<Scalars["Boolean"]["input"]>;
1378
1397
  humanIntent: Scalars["String"]["input"];
@@ -1382,8 +1401,8 @@ export type GQLManageRdFoxRuleInput = {
1382
1401
  testTriple?: InputMaybe<GQLTestTripleInput>;
1383
1402
  };
1384
1403
 
1385
- export type GQLManageRdFoxRuleResponse = {
1386
- __typename?: "ManageRDFoxRuleResponse";
1404
+ export type GQLManageRuleResponse = {
1405
+ __typename?: "ManageRuleResponse";
1387
1406
  error?: Maybe<Scalars["String"]["output"]>;
1388
1407
  inferenceTest?: Maybe<Scalars["String"]["output"]>;
1389
1408
  inferenceVerified: Scalars["Boolean"]["output"];
@@ -1616,6 +1635,7 @@ export type GQLMutation = {
1616
1635
  executeActionDeletion: GQLExecuteActionResponse;
1617
1636
  executeActionPlan: GQLExecuteActionPlanResponse;
1618
1637
  executeActionUpdate: GQLExecuteActionResponse;
1638
+ forgetUserName: GQLForgetUserNameResponse;
1619
1639
  generateStructuredData: GQLStructuredDataResponse;
1620
1640
  googleAnalyticsSetupConnect: GQLGoogleAnalyticsSetupProgress;
1621
1641
  googleSetupConnect: GQLGoogleSetupProgress;
@@ -1628,7 +1648,7 @@ export type GQLMutation = {
1628
1648
  linkOrganizationToProvider: GQLLinkOrganizationResponse;
1629
1649
  linkUnlinkedDatastore: GQLProvisionDatastoreResponse;
1630
1650
  linkedinSetupConnect?: Maybe<GQLLinkedinSetupProgress>;
1631
- manageRDFoxRule: GQLManageRdFoxRuleResponse;
1651
+ manageRule: GQLManageRuleResponse;
1632
1652
  manualActionChangeAssignees?: Maybe<GQLManualActionChangeAssigneesPayload>;
1633
1653
  manualActionResolve?: Maybe<GQLManualActionResolvePayload>;
1634
1654
  materializeOntologyCoverage: GQLMaterializeOntologyCoverageResponse;
@@ -1665,7 +1685,7 @@ export type GQLMutation = {
1665
1685
  updateMemory: GQLUpdateMemoryResponse;
1666
1686
  updateTeamMember: GQLTeamMemberUpdateResponse;
1667
1687
  updateUserPreferences: GQLUpdateUserPreferencesResponse;
1668
- validateRDFoxRule: GQLValidateRdFoxRuleResponse;
1688
+ validateRule: GQLValidateRuleResponse;
1669
1689
  validateStagedRules: GQLValidateStagedRulesResponse;
1670
1690
  };
1671
1691
 
@@ -1817,6 +1837,10 @@ export type GQLMutationExecuteActionUpdateArgs = {
1817
1837
  input: GQLExecuteActionUpdateInput;
1818
1838
  };
1819
1839
 
1840
+ export type GQLMutationForgetUserNameArgs = {
1841
+ userId: Scalars["String"]["input"];
1842
+ };
1843
+
1820
1844
  export type GQLMutationGenerateStructuredDataArgs = {
1821
1845
  input: GQLStructuredDataInput;
1822
1846
  };
@@ -1879,8 +1903,8 @@ export type GQLMutationLinkedinSetupConnectArgs = {
1879
1903
  accountIds: Array<Scalars["String"]["input"]>;
1880
1904
  };
1881
1905
 
1882
- export type GQLMutationManageRdFoxRuleArgs = {
1883
- input: GQLManageRdFoxRuleInput;
1906
+ export type GQLMutationManageRuleArgs = {
1907
+ input: GQLManageRuleInput;
1884
1908
  };
1885
1909
 
1886
1910
  export type GQLMutationManualActionChangeAssigneesArgs = {
@@ -2062,8 +2086,8 @@ export type GQLMutationUpdateUserPreferencesArgs = {
2062
2086
  input: GQLUpdateUserPreferencesInput;
2063
2087
  };
2064
2088
 
2065
- export type GQLMutationValidateRdFoxRuleArgs = {
2066
- input: GQLValidateRdFoxRuleInput;
2089
+ export type GQLMutationValidateRuleArgs = {
2090
+ input: GQLValidateRuleInput;
2067
2091
  };
2068
2092
 
2069
2093
  export type GQLMutationValidateStagedRulesArgs = {
@@ -2195,7 +2219,7 @@ export type GQLQuery = {
2195
2219
  datastoreSubscriptions: Array<GQLDatastoreSubscription>;
2196
2220
  datastoreTree: Array<GQLDatastoreTreeNode>;
2197
2221
  detectMemoryConflicts: GQLDetectMemoryConflictsResult;
2198
- explainRDFoxFact: GQLRdFoxExplanationResponse;
2222
+ explainFact: GQLFactExplanationResponse;
2199
2223
  gmailIntegrations: Array<GQLGmailIntegration>;
2200
2224
  googleAnalyticsSetupProgress: GQLGoogleAnalyticsSetupProgress;
2201
2225
  googleBrandSuggestions: Array<GQLGoogleBrandSuggestion>;
@@ -2328,7 +2352,7 @@ export type GQLQueryDetectMemoryConflictsArgs = {
2328
2352
  input: GQLDetectMemoryConflictsInput;
2329
2353
  };
2330
2354
 
2331
- export type GQLQueryExplainRdFoxFactArgs = {
2355
+ export type GQLQueryExplainFactArgs = {
2332
2356
  namedGraph?: InputMaybe<Scalars["IRI"]["input"]>;
2333
2357
  object: Scalars["String"]["input"];
2334
2358
  objectDatatype?: InputMaybe<Scalars["String"]["input"]>;
@@ -2442,14 +2466,6 @@ export type GQLQueryWarehouseQueryArgs = {
2442
2466
  sql: Scalars["String"]["input"];
2443
2467
  };
2444
2468
 
2445
- export type GQLRdFoxExplanationResponse = {
2446
- __typename?: "RDFoxExplanationResponse";
2447
- error?: Maybe<Scalars["String"]["output"]>;
2448
- facts: Scalars["JSON"]["output"];
2449
- formatted: Scalars["String"]["output"];
2450
- summary?: Maybe<Scalars["String"]["output"]>;
2451
- };
2452
-
2453
2469
  export type GQLRecordHotelProfileResponse = {
2454
2470
  __typename?: "RecordHotelProfileResponse";
2455
2471
  companyIri?: Maybe<Scalars["IRI"]["output"]>;
@@ -3075,12 +3091,12 @@ export type GQLValidateActionPlanResponse = {
3075
3091
  valid: Scalars["Boolean"]["output"];
3076
3092
  };
3077
3093
 
3078
- export type GQLValidateRdFoxRuleInput = {
3094
+ export type GQLValidateRuleInput = {
3079
3095
  rule: Scalars["DatalogRule"]["input"];
3080
3096
  };
3081
3097
 
3082
- export type GQLValidateRdFoxRuleResponse = {
3083
- __typename?: "ValidateRDFoxRuleResponse";
3098
+ export type GQLValidateRuleResponse = {
3099
+ __typename?: "ValidateRuleResponse";
3084
3100
  error?: Maybe<Scalars["String"]["output"]>;
3085
3101
  ruleStructure?: Maybe<GQLRuleStructure>;
3086
3102
  valid: Scalars["Boolean"]["output"];
@@ -3673,6 +3689,15 @@ export type GQLExecuteAgentActionUpdateMutation = {
3673
3689
  };
3674
3690
  };
3675
3691
 
3692
+ export type GQLForgetUserNameMutationVariables = Exact<{
3693
+ userId: Scalars["String"]["input"];
3694
+ }>;
3695
+
3696
+ export type GQLForgetUserNameMutation = {
3697
+ __typename?: "Mutation";
3698
+ forgetUserName: { __typename?: "ForgetUserNameResponse"; id: string; datastoreIds: Array<string> };
3699
+ };
3700
+
3676
3701
  export type GQLGenerateStructuredDataMutationVariables = Exact<{
3677
3702
  input: GQLStructuredDataInput;
3678
3703
  }>;
@@ -5083,6 +5108,10 @@ export type GQLDatastoreSubscriptionsQuery = {
5083
5108
  datastoreId: string;
5084
5109
  status: string;
5085
5110
  inGoodStanding: boolean;
5111
+ amount?: number | null;
5112
+ currency?: string | null;
5113
+ interval?: string | null;
5114
+ intervalCount?: number | null;
5086
5115
  }>;
5087
5116
  };
5088
5117
 
@@ -5133,7 +5162,7 @@ export type GQLDetectMemoryConflictsQuery = {
5133
5162
  };
5134
5163
  };
5135
5164
 
5136
- export type GQLExplainRdFoxFactQueryVariables = Exact<{
5165
+ export type GQLExplainFactQueryVariables = Exact<{
5137
5166
  subject: Scalars["String"]["input"];
5138
5167
  predicate?: InputMaybe<Scalars["String"]["input"]>;
5139
5168
  object: Scalars["String"]["input"];
@@ -5142,10 +5171,10 @@ export type GQLExplainRdFoxFactQueryVariables = Exact<{
5142
5171
  namedGraph?: InputMaybe<Scalars["IRI"]["input"]>;
5143
5172
  }>;
5144
5173
 
5145
- export type GQLExplainRdFoxFactQuery = {
5174
+ export type GQLExplainFactQuery = {
5146
5175
  __typename?: "Query";
5147
- explainRDFoxFact: {
5148
- __typename?: "RDFoxExplanationResponse";
5176
+ explainFact: {
5177
+ __typename?: "FactExplanationResponse";
5149
5178
  facts: unknown;
5150
5179
  formatted: string;
5151
5180
  summary?: string | null;
@@ -7059,6 +7088,33 @@ export const useExecuteAgentActionUpdateMutation = <TError = unknown, TContext =
7059
7088
  });
7060
7089
  };
7061
7090
 
7091
+ export const ForgetUserNameDocument = `
7092
+ mutation ForgetUserName($userId: String!) {
7093
+ forgetUserName(userId: $userId) {
7094
+ id
7095
+ datastoreIds
7096
+ }
7097
+ }
7098
+ `;
7099
+
7100
+ export const useForgetUserNameMutation = <TError = unknown, TContext = unknown>(
7101
+ client: GraphQLClient,
7102
+ options?: UseMutationOptions<GQLForgetUserNameMutation, TError, GQLForgetUserNameMutationVariables, TContext>,
7103
+ headers?: RequestInit["headers"],
7104
+ ) => {
7105
+ return useMutation<GQLForgetUserNameMutation, TError, GQLForgetUserNameMutationVariables, TContext>({
7106
+ mutationKey: ["ForgetUserName"],
7107
+ mutationFn: (variables?: GQLForgetUserNameMutationVariables) =>
7108
+ fetcher<GQLForgetUserNameMutation, GQLForgetUserNameMutationVariables>(
7109
+ client,
7110
+ ForgetUserNameDocument,
7111
+ variables,
7112
+ headers,
7113
+ )(),
7114
+ ...options,
7115
+ });
7116
+ };
7117
+
7062
7118
  export const GenerateStructuredDataDocument = `
7063
7119
  mutation GenerateStructuredData($input: StructuredDataInput!) {
7064
7120
  generateStructuredData(input: $input) {
@@ -10016,6 +10072,10 @@ export const DatastoreSubscriptionsDocument = `
10016
10072
  datastoreId
10017
10073
  status
10018
10074
  inGoodStanding
10075
+ amount
10076
+ currency
10077
+ interval
10078
+ intervalCount
10019
10079
  }
10020
10080
  }
10021
10081
  `;
@@ -10206,9 +10266,9 @@ useSuspenseDetectMemoryConflictsQuery.getKey = (variables: GQLDetectMemoryConfli
10206
10266
  variables,
10207
10267
  ];
10208
10268
 
10209
- export const ExplainRdFoxFactDocument = `
10210
- query ExplainRDFoxFact($subject: String!, $predicate: String, $object: String!, $objectDatatype: String, $summarize: Boolean = false, $namedGraph: IRI) {
10211
- explainRDFoxFact(
10269
+ export const ExplainFactDocument = `
10270
+ query ExplainFact($subject: String!, $predicate: String, $object: String!, $objectDatatype: String, $summarize: Boolean = false, $namedGraph: IRI) {
10271
+ explainFact(
10212
10272
  subject: $subject
10213
10273
  predicate: $predicate
10214
10274
  object: $object
@@ -10224,19 +10284,19 @@ export const ExplainRdFoxFactDocument = `
10224
10284
  }
10225
10285
  `;
10226
10286
 
10227
- export const useExplainRdFoxFactQuery = <TData = GQLExplainRdFoxFactQuery, TError = unknown>(
10287
+ export const useExplainFactQuery = <TData = GQLExplainFactQuery, TError = unknown>(
10228
10288
  client: GraphQLClient,
10229
- variables: GQLExplainRdFoxFactQueryVariables,
10230
- options?: Omit<UseQueryOptions<GQLExplainRdFoxFactQuery, TError, TData>, "queryKey"> & {
10231
- queryKey?: UseQueryOptions<GQLExplainRdFoxFactQuery, TError, TData>["queryKey"];
10289
+ variables: GQLExplainFactQueryVariables,
10290
+ options?: Omit<UseQueryOptions<GQLExplainFactQuery, TError, TData>, "queryKey"> & {
10291
+ queryKey?: UseQueryOptions<GQLExplainFactQuery, TError, TData>["queryKey"];
10232
10292
  },
10233
10293
  headers?: RequestInit["headers"],
10234
10294
  ) => {
10235
- return useQuery<GQLExplainRdFoxFactQuery, TError, TData>({
10236
- queryKey: ["ExplainRDFoxFact", variables],
10237
- queryFn: fetcher<GQLExplainRdFoxFactQuery, GQLExplainRdFoxFactQueryVariables>(
10295
+ return useQuery<GQLExplainFactQuery, TError, TData>({
10296
+ queryKey: ["ExplainFact", variables],
10297
+ queryFn: fetcher<GQLExplainFactQuery, GQLExplainFactQueryVariables>(
10238
10298
  client,
10239
- ExplainRdFoxFactDocument,
10299
+ ExplainFactDocument,
10240
10300
  variables,
10241
10301
  headers,
10242
10302
  ),
@@ -10244,21 +10304,21 @@ export const useExplainRdFoxFactQuery = <TData = GQLExplainRdFoxFactQuery, TErro
10244
10304
  });
10245
10305
  };
10246
10306
 
10247
- useExplainRdFoxFactQuery.getKey = (variables: GQLExplainRdFoxFactQueryVariables) => ["ExplainRDFoxFact", variables];
10307
+ useExplainFactQuery.getKey = (variables: GQLExplainFactQueryVariables) => ["ExplainFact", variables];
10248
10308
 
10249
- export const useSuspenseExplainRdFoxFactQuery = <TData = GQLExplainRdFoxFactQuery, TError = unknown>(
10309
+ export const useSuspenseExplainFactQuery = <TData = GQLExplainFactQuery, TError = unknown>(
10250
10310
  client: GraphQLClient,
10251
- variables: GQLExplainRdFoxFactQueryVariables,
10252
- options?: Omit<UseSuspenseQueryOptions<GQLExplainRdFoxFactQuery, TError, TData>, "queryKey"> & {
10253
- queryKey?: UseSuspenseQueryOptions<GQLExplainRdFoxFactQuery, TError, TData>["queryKey"];
10311
+ variables: GQLExplainFactQueryVariables,
10312
+ options?: Omit<UseSuspenseQueryOptions<GQLExplainFactQuery, TError, TData>, "queryKey"> & {
10313
+ queryKey?: UseSuspenseQueryOptions<GQLExplainFactQuery, TError, TData>["queryKey"];
10254
10314
  },
10255
10315
  headers?: RequestInit["headers"],
10256
10316
  ) => {
10257
- return useSuspenseQuery<GQLExplainRdFoxFactQuery, TError, TData>({
10258
- queryKey: ["ExplainRDFoxFactSuspense", variables],
10259
- queryFn: fetcher<GQLExplainRdFoxFactQuery, GQLExplainRdFoxFactQueryVariables>(
10317
+ return useSuspenseQuery<GQLExplainFactQuery, TError, TData>({
10318
+ queryKey: ["ExplainFactSuspense", variables],
10319
+ queryFn: fetcher<GQLExplainFactQuery, GQLExplainFactQueryVariables>(
10260
10320
  client,
10261
- ExplainRdFoxFactDocument,
10321
+ ExplainFactDocument,
10262
10322
  variables,
10263
10323
  headers,
10264
10324
  ),
@@ -10266,10 +10326,7 @@ export const useSuspenseExplainRdFoxFactQuery = <TData = GQLExplainRdFoxFactQuer
10266
10326
  });
10267
10327
  };
10268
10328
 
10269
- useSuspenseExplainRdFoxFactQuery.getKey = (variables: GQLExplainRdFoxFactQueryVariables) => [
10270
- "ExplainRDFoxFactSuspense",
10271
- variables,
10272
- ];
10329
+ useSuspenseExplainFactQuery.getKey = (variables: GQLExplainFactQueryVariables) => ["ExplainFactSuspense", variables];
10273
10330
 
10274
10331
  export const GmailIntegrationsDocument = `
10275
10332
  query GmailIntegrations {
@@ -17,7 +17,7 @@ export function deriveDatastoreId(organizationName: string, segments: string[]):
17
17
  );
18
18
  }
19
19
 
20
- // Validated before reaching Infisical/KGC/RDFox since the Keycloak attribute is admin-settable.
20
+ // Validated before reaching Infisical, KGC or the datastore, since the Keycloak attribute is admin-settable.
21
21
  const datastoreIdPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
22
22
 
23
23
  export function isValidDatastoreId(id: string): boolean {
@@ -9,18 +9,18 @@ export function shouldRequestCitations(seed: string, rate: number = memoryCitati
9
9
 
10
10
  export type CitationRequestTurn = {
11
11
  hasPersonalPreload: boolean;
12
+ hasPersonalRecall: boolean;
12
13
  hasSharedSections: boolean;
13
14
  seed: string;
14
15
  };
15
16
 
16
17
  export type CitationDecision =
17
18
  | { requested: false; reason: "none" }
18
- | { requested: true; reason: "personal" | "sampled" };
19
+ | { requested: true; reason: "personal" | "recalled" | "sampled" };
19
20
 
20
21
  export function citationDecisionForTurn(turn: CitationRequestTurn, rate?: number): CitationDecision {
21
22
  if (turn.hasPersonalPreload) return { requested: true, reason: "personal" };
22
- if (turn.hasSharedSections && shouldRequestCitations(turn.seed, rate)) {
23
- return { requested: true, reason: "sampled" };
24
- }
25
- return { requested: false, reason: "none" };
23
+ if (!turn.hasPersonalRecall && !turn.hasSharedSections) return { requested: false, reason: "none" };
24
+ if (!shouldRequestCitations(turn.seed, rate)) return { requested: false, reason: "none" };
25
+ return { requested: true, reason: turn.hasPersonalRecall ? "recalled" : "sampled" };
26
26
  }
@@ -7,7 +7,7 @@ export type DiversityCandidate = {
7
7
  description?: string | null;
8
8
  };
9
9
 
10
- const tokenPattern = /[a-z0-9]+/g;
10
+ const tokenPattern = /[\p{L}\p{N}]+/gu;
11
11
 
12
12
  const minimumTokenLength = 3;
13
13
 
@@ -5,6 +5,8 @@ export const rankFusionConstant = 60;
5
5
 
6
6
  export const maxKeywordTerms = 8;
7
7
 
8
+ export const maxKeywordTermLength = 40;
9
+
8
10
  export type KeywordCandidate = DiversityCandidate & { iri: string };
9
11
 
10
12
  // A term feeds a SPARQL CONTAINS that admits rows, so a stray function word like "the" would widen the pool to the
@@ -103,7 +105,7 @@ const stopWords = new Set([
103
105
 
104
106
  export function keywordTerms(text: string, limit: number = maxKeywordTerms): string[] {
105
107
  return [...memoryTokens({ label: text })]
106
- .filter((token) => !stopWords.has(token))
108
+ .filter((token) => !stopWords.has(token) && token.length <= maxKeywordTermLength)
107
109
  .sort((a, b) => b.length - a.length || a.localeCompare(b))
108
110
  .slice(0, limit);
109
111
  }
@@ -3,12 +3,8 @@ import {
3
3
  expandPrefix as expandPrefixIri,
4
4
  iriLocalName as iriLocalNameValue,
5
5
  iriNamespace as iriNamespaceValue,
6
- rdfoxDefaultBaseIri as rdfoxDefaultBaseIriValue,
7
- shaclGraphIri as shaclGraphIriValue,
8
6
  } from "@manta-eu/rdf-lib/namespaces";
9
7
 
10
- export const rulesGraphIri = `${rdfoxDefaultBaseIriValue}rules`;
11
-
12
8
  // KGC uploads the realm ontology here (kgc/kgc/realms/lib/ontology.py: realm_base + "ontology").
13
9
  export const ontologyGraphIri = expandPrefixIri(":ontology");
14
10
 
@@ -19,8 +15,6 @@ export const writeLifecycle = {
19
15
  createOnly: expandPrefixIri("relay:CreateOnly"),
20
16
  };
21
17
 
22
- export const nonDataGraphIris = [ontologyGraphIri, shaclGraphIriValue, rulesGraphIri];
23
-
24
18
  export function mintInstanceIri(classIri: string, localId: string): string {
25
19
  return `${iriNamespaceValue(classIri)}${encodeIriLocalNameValue(`${iriLocalNameValue(classIri)}_${localId}`)}`;
26
20
  }
@@ -33,7 +27,7 @@ export {
33
27
  encodeIriUnsafeChars,
34
28
  expandPrefix,
35
29
  formatEntityName,
36
- formatIriForRdfox,
30
+ formatIriForSparql,
37
31
  getNamespaceValues,
38
32
  isFullIri,
39
33
  isValidFullIri,
@@ -52,8 +46,7 @@ export {
52
46
  nfo,
53
47
  parseEntityUri,
54
48
  prependMissingSparqlPrefixes,
55
- rdfoxDefaultBaseIri,
56
- shaclGraphIri,
49
+ shaclGraph,
57
50
  sh,
58
51
  toTurtlePrefixes,
59
52
  validateFullIri,
@@ -1,5 +1,5 @@
1
1
  import type {
2
- RDFoxFactsOutput,
2
+ QueryKnowledgeGraphOutput,
3
3
  ShowEntitiesOutput,
4
4
  SparqlJsonResults,
5
5
  ToolErrorResult,
@@ -43,8 +43,11 @@ function coerceWith<T>(
43
43
  return { is_error: true, content: `Unexpected ${toolName} output format` };
44
44
  }
45
45
 
46
- function coerceRDFoxFactsOutput(raw: unknown): RDFoxFactsOutput {
47
- return coerceWith<RDFoxFactsOutput>("getRDFoxFacts", raw, [isSparqlJsonResults, isJsonLdGraphDocument]);
46
+ function coerceQueryKnowledgeGraphOutput(raw: unknown): QueryKnowledgeGraphOutput {
47
+ return coerceWith<QueryKnowledgeGraphOutput>("queryKnowledgeGraph", raw, [
48
+ isSparqlJsonResults,
49
+ isJsonLdGraphDocument,
50
+ ]);
48
51
  }
49
52
 
50
53
  export function isShowEntitiesResult(data: unknown): data is Exclude<ShowEntitiesOutput, ToolErrorResult> {
@@ -62,7 +65,7 @@ function coerceShowEntitiesOutput(raw: unknown): ShowEntitiesOutput {
62
65
  }
63
66
 
64
67
  const coercers: Partial<Record<ToolName, ToolOutputCoercer<ToolName>>> = {
65
- getRDFoxFacts: coerceRDFoxFactsOutput as ToolOutputCoercer<"getRDFoxFacts">,
68
+ queryKnowledgeGraph: coerceQueryKnowledgeGraphOutput as ToolOutputCoercer<"queryKnowledgeGraph">,
66
69
  showEntities: coerceShowEntitiesOutput as ToolOutputCoercer<"showEntities">,
67
70
  };
68
71
 
@@ -13,22 +13,22 @@ export type {
13
13
  ActionPlanShowcaseInput,
14
14
  ActionPlanShowcaseOutput,
15
15
  ActionPlanStatus,
16
- AddRDFoxFactsInput,
17
- AddRDFoxFactsOutput,
16
+ AddFactsInput,
17
+ AddFactsOutput,
18
18
  CancelScheduleInput,
19
19
  CancelScheduleOutput,
20
20
  ExecuteActionPlanInput,
21
21
  ExecuteActionPlanOutput,
22
- ExplainRDFoxRulesInput,
23
- ExplainRDFoxRulesOutput,
22
+ ExplainFactToolInput,
23
+ ExplainFactToolOutput,
24
24
  GenerateChartInput,
25
25
  GenerateChartOutput,
26
- GetRDFoxRulesInput,
27
- GetRDFoxRulesOutput,
26
+ GetRulesInput,
27
+ GetRulesOutput,
28
28
  ListScheduledTasksInput,
29
29
  ListScheduledTasksOutput,
30
- RDFoxFactsInput,
31
- RDFoxFactsOutput,
30
+ QueryKnowledgeGraphInput,
31
+ QueryKnowledgeGraphOutput,
32
32
  ScheduleTaskInput,
33
33
  ScheduleTaskOutput,
34
34
  ShowEntitiesInput,
@@ -6,30 +6,30 @@ import { iriLocalName } from "../rdf-namespaces";
6
6
  import type { ToolMetadata, ToolName } from "./types";
7
7
 
8
8
  export const toolMetadata: ToolMetadata = {
9
- getRDFoxFacts: {
10
- name: "getRDFoxFacts",
11
- category: "rdfox",
9
+ queryKnowledgeGraph: {
10
+ name: "queryKnowledgeGraph",
11
+ category: "knowledge-graph",
12
12
  humanName: "Query knowledge base",
13
- description: "Retrieve facts from RDFox knowledge base using SPARQL",
13
+ description: "Retrieve facts from the knowledge graph using SPARQL",
14
14
  getHumanName: (input) => {
15
15
  return input?.humanIntent || "Querying...";
16
16
  },
17
17
  },
18
- addRDFoxFacts: {
19
- name: "addRDFoxFacts",
20
- category: "rdfox",
18
+ addFacts: {
19
+ name: "addFacts",
20
+ category: "knowledge-graph",
21
21
  humanName: "Add facts",
22
- description: "Add facts to RDFox knowledge base as Turtle",
22
+ description: "Add facts to the knowledge graph as Turtle",
23
23
  getHumanName: (input) => {
24
24
  return input?.humanIntent || "Adding facts...";
25
25
  },
26
26
  },
27
- getRDFoxRules: {
28
- name: "getRDFoxRules",
29
- category: "rdfox",
27
+ getRules: {
28
+ name: "getRules",
29
+ category: "knowledge-graph",
30
30
  humanName: "Check rules",
31
31
  description:
32
- "Retrieve Datalog rules from RDFox with optional filters (named graph, rdf:type, limit) to avoid context overflow",
32
+ "Retrieve Datalog rules from the knowledge graph with optional filters (named graph, rdf:type, limit) to avoid context overflow",
33
33
  getHumanName: (input) => {
34
34
  const parts: string[] = [];
35
35
  if (input?.namedGraphIri) parts.push(`plan: ${input.namedGraphIri}`);
@@ -38,9 +38,9 @@ export const toolMetadata: ToolMetadata = {
38
38
  return `Checking rules ${parts.join(" + ")}`;
39
39
  },
40
40
  },
41
- explainRDFoxRules: {
42
- name: "explainRDFoxRules",
43
- category: "rdfox",
41
+ explainFact: {
42
+ name: "explainFact",
43
+ category: "knowledge-graph",
44
44
  humanName: "Explain reasoning",
45
45
  description: "Explain how facts are derived using rules",
46
46
  getHumanName: () => "Explaining reasoning...",
@@ -88,20 +88,20 @@ export const toolMetadata: ToolMetadata = {
88
88
  return input?.namedGraphIri ? `Execute plan: ${input.namedGraphIri}` : "Executing action plan...";
89
89
  },
90
90
  },
91
- manageRDFoxRules: {
92
- name: "manageRDFoxRules",
93
- category: "rdfox",
91
+ manageRules: {
92
+ name: "manageRules",
93
+ category: "knowledge-graph",
94
94
  humanName: "Manage rules",
95
- description: "Add, change, or remove Datalog rules in RDFox knowledge base",
95
+ description: "Add, change, or remove Datalog rules in the knowledge graph",
96
96
  getHumanName: (input) => {
97
97
  return input?.humanIntent || "Managing rules...";
98
98
  },
99
99
  },
100
- manageRDFoxFacts: {
101
- name: "manageRDFoxFacts",
102
- category: "rdfox",
100
+ manageFacts: {
101
+ name: "manageFacts",
102
+ category: "knowledge-graph",
103
103
  humanName: "Manage facts",
104
- description: "Add, change facts in RDFox knowledge",
104
+ description: "Add or change facts in the knowledge graph",
105
105
  getHumanName: (input) => {
106
106
  return input?.humanIntent || "Managing facts...";
107
107
  },