@origintrail-official/dkg-adapter-hermes 10.1.0 → 10.1.2

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.
@@ -279,6 +279,13 @@ DKG_QUERY_SCHEMA = {
279
279
  "When supplied, context_graph_id is required."
280
280
  ),
281
281
  },
282
+ "semantics": {
283
+ "type": "string",
284
+ "description": (
285
+ "Optional with view: merged matches patterns outside GRAPH across the view's "
286
+ "assets, as one graph; per-asset (the default) matches inside one asset at a time."
287
+ ),
288
+ },
282
289
  "agent_address": {
283
290
  "type": "string",
284
291
  "description": "Optional Working Memory owner address. Defaults to this node when view is working-memory.",
@@ -1497,6 +1504,9 @@ class DKGMemoryProvider(MemoryProvider):
1497
1504
  view = _first_text(args, "view")
1498
1505
  if view and view not in ("working-memory", "shared-working-memory", "verifiable-memory"):
1499
1506
  return tool_error('"view" must be one of: working-memory, shared-working-memory, verifiable-memory.')
1507
+ semantics = _first_text(args, "semantics") or None
1508
+ if semantics not in (None, "merged", "per-asset"):
1509
+ return tool_error('"semantics" must be merged or per-asset.')
1500
1510
  if view and not _first_text(args, "context_graph_id"):
1501
1511
  return tool_error(f'"view: {view}" requires "context_graph_id".')
1502
1512
  if view and _first_text(args, "sub_graph_name"):
@@ -1522,6 +1532,7 @@ class DKGMemoryProvider(MemoryProvider):
1522
1532
  verified_graph=_first_text(args, "verified_graph"),
1523
1533
  graph_suffix=_first_text(args, "graph_suffix"),
1524
1534
  min_trust=args.get("min_trust") if "min_trust" in args else None,
1535
+ semantics=semantics,
1525
1536
  )
1526
1537
  return json.dumps(result)
1527
1538
 
@@ -425,8 +425,13 @@ class DKGClient:
425
425
  verified_graph: Optional[str] = None,
426
426
  graph_suffix: Optional[str] = None,
427
427
  min_trust: Optional[Any] = None,
428
+ semantics: Optional[str] = None,
428
429
  ) -> Dict[str, Any]:
429
- """POST /api/query — run SPARQL on local triple store."""
430
+ """POST /api/query — run SPARQL on local triple store.
431
+
432
+ ``semantics`` ("merged" or "per-asset") sets how a view query matches its
433
+ patterns; the response states the semantics it was answered with.
434
+ """
430
435
  payload: Dict[str, Any] = {"sparql": sparql}
431
436
  if context_graph_id:
432
437
  payload["contextGraphId"] = _normalize_context_graph_id(context_graph_id)
@@ -434,6 +439,8 @@ class DKGClient:
434
439
  payload["graphSuffix"] = graph_suffix
435
440
  if view:
436
441
  payload["view"] = view
442
+ if semantics:
443
+ payload["semantics"] = semantics
437
444
  if assertion_name:
438
445
  payload["assertionName"] = assertion_name
439
446
  if agent_address:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@origintrail-official/dkg-adapter-hermes",
3
- "version": "10.1.0",
3
+ "version": "10.1.2",
4
4
  "description": "Hermes Agent adapter — connects Hermes AI agents to a DKG V10 node for verifiable shared memory",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "@origintrail-official/dkg-core": "10.1.0"
23
+ "@origintrail-official/dkg-core": "10.1.2"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@vitest/coverage-v8": "^4.0.18",