@xmoxmo/bncr 0.4.5 → 0.4.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.
Files changed (36) hide show
  1. package/dist/index.js +6 -0
  2. package/index.ts +6 -0
  3. package/package.json +1 -1
  4. package/src/channel.ts +41 -2
  5. package/src/core/targets.ts +106 -17
  6. package/src/messaging/inbound/commands.ts +263 -51
  7. package/src/messaging/inbound/context-facts.ts +126 -14
  8. package/src/messaging/inbound/contracts.ts +24 -0
  9. package/src/messaging/inbound/dispatch-prep.ts +214 -39
  10. package/src/messaging/inbound/dispatch.ts +71 -5
  11. package/src/messaging/inbound/gate.ts +56 -86
  12. package/src/messaging/inbound/group-history.ts +189 -0
  13. package/src/messaging/inbound/native-command-runtime.ts +77 -61
  14. package/src/messaging/inbound/native-command.ts +92 -8
  15. package/src/messaging/inbound/parse.ts +113 -8
  16. package/src/messaging/inbound/reply-dispatch-serial.ts +62 -0
  17. package/src/messaging/inbound/reply-dispatch.ts +252 -77
  18. package/src/messaging/inbound/scene-admin.ts +269 -0
  19. package/src/messaging/inbound/session-label.ts +122 -13
  20. package/src/messaging/inbound/session-meta-task.ts +17 -0
  21. package/src/messaging/inbound/turn-context.ts +184 -71
  22. package/src/openclaw/channel-runtime-contracts.ts +1 -0
  23. package/src/plugin/channel-components.ts +34 -1
  24. package/src/plugin/channel-inbound-helpers.ts +9 -2
  25. package/src/plugin/channel-runtime-builders-delivery.ts +24 -1
  26. package/src/plugin/channel-runtime-types.ts +42 -0
  27. package/src/plugin/file-inbound-init.ts +27 -12
  28. package/src/plugin/file-inbound-runtime.ts +2 -0
  29. package/src/plugin/inbound-acceptance.ts +82 -1
  30. package/src/plugin/inbound-handlers.ts +55 -2
  31. package/src/plugin/inbound-surface-handlers-group.ts +16 -0
  32. package/src/plugin/messaging.ts +22 -5
  33. package/src/plugin/scene-registry.ts +155 -0
  34. package/src/plugin/state-store.ts +133 -0
  35. package/src/plugin/state-transient-runtime-group.ts +5 -0
  36. package/src/plugin/target-runtime.ts +2 -2
@@ -6,6 +6,7 @@ import type {
6
6
  FileSendTransferState,
7
7
  OutboxEntry,
8
8
  } from '../core/types.ts';
9
+ import type { BncrPersistedGroupHistoryEntry, BncrSceneRecord } from './channel-runtime-types.ts';
9
10
  import { createBncrStateStore } from './state-store.ts';
10
11
  import { createBncrTransientStateRuntime } from './transient-state-runtime.ts';
11
12
 
@@ -31,6 +32,8 @@ export function createBncrStateTransientRuntimeGroup(runtime: {
31
32
  maxDeadLetterEntries: number;
32
33
  maxSessionRouteEntries: number;
33
34
  maxAccountActivityEntries: number;
35
+ sceneRegistry: Map<string, BncrSceneRecord>;
36
+ groupHistories: Map<string, BncrPersistedGroupHistoryEntry[]>;
34
37
  outbox: Map<string, OutboxEntry>;
35
38
  getDeadLetter: () => OutboxEntry[];
36
39
  setDeadLetter: (entries: OutboxEntry[]) => void;
@@ -69,6 +72,8 @@ export function createBncrStateTransientRuntimeGroup(runtime: {
69
72
  maxDeadLetterEntries: runtime.maxDeadLetterEntries,
70
73
  maxSessionRouteEntries: runtime.maxSessionRouteEntries,
71
74
  maxAccountActivityEntries: runtime.maxAccountActivityEntries,
75
+ sceneRegistry: runtime.sceneRegistry,
76
+ groupHistories: runtime.groupHistories,
72
77
  outbox: runtime.outbox,
73
78
  getDeadLetter: runtime.getDeadLetter,
74
79
  setDeadLetter: runtime.setDeadLetter,
@@ -95,11 +95,11 @@ export function createBncrTargetRuntime(runtime: {
95
95
  if (!route) {
96
96
  runtime.logWarn(
97
97
  'target',
98
- `invalid raw=${raw} accountId=${acc} reason=unparseable-or-unknown standardTo=Bncr:<platform>:<groupId>:<userId>|Bncr:<platform>:<userId> standardSessionKey=agent:<agentId>:bncr:direct:<hex(scope)>`,
98
+ `invalid raw=${raw} accountId=${acc} reason=unparseable-or-unknown canonicalTo=Bncr:<platform>:0:<userId>|Bncr:<platform>:<groupId>:0 acceptedAliases=Bncr:<platform>:user:<userId>|Bncr:<platform>:group:<groupId> standardSessionKey=agent:<agentId>:bncr:<direct|group>:<hex(scope)>`,
99
99
  { debugOnly: true },
100
100
  );
101
101
  throw new Error(
102
- `bncr invalid target(standard: Bncr:<platform>:<groupId>:<userId> | Bncr:<platform>:<userId>): ${raw}`,
102
+ `bncr invalid target(canonical: Bncr:<platform>:0:<userId> | Bncr:<platform>:<groupId>:0; aliases: Bncr:<platform>:user:<userId> | Bncr:<platform>:group:<groupId>): ${raw}`,
103
103
  );
104
104
  }
105
105