@xmoxmo/bncr 0.5.6 → 0.5.8

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 (90) hide show
  1. package/dist/index.js +1 -9
  2. package/index.ts +1 -9
  3. package/package.json +1 -1
  4. package/scripts/check-pack.mjs +0 -8
  5. package/scripts/selfcheck.mjs +0 -10
  6. package/src/bootstrap/runtime-loader.ts +1 -1
  7. package/src/channel.ts +118 -171
  8. package/src/core/accounts.ts +1 -6
  9. package/src/core/connection-reachability.ts +2 -6
  10. package/src/core/dead-letter-diagnostics.ts +4 -10
  11. package/src/core/logging.ts +1 -1
  12. package/src/core/outbox-entry-builders.ts +78 -84
  13. package/src/core/outbox-file-transfer-failure.ts +5 -0
  14. package/src/core/outbox-file-transfer-guards.ts +6 -0
  15. package/src/core/outbox-file-transfer-prep.ts +8 -5
  16. package/src/core/outbox-file-transfer-success.ts +5 -0
  17. package/src/core/outbox-queue.ts +1 -7
  18. package/src/core/outbox-summary.ts +10 -56
  19. package/src/core/permissions.ts +2 -10
  20. package/src/core/persisted-outbox-entry.ts +54 -11
  21. package/src/core/policy.ts +1 -11
  22. package/src/core/register-trace.ts +4 -7
  23. package/src/core/status-meta.ts +1 -9
  24. package/src/core/status.ts +1 -21
  25. package/src/core/targets.ts +52 -70
  26. package/src/core/types.ts +1 -17
  27. package/src/core/value-sanitize.ts +38 -1
  28. package/src/messaging/inbound/commands.ts +2 -24
  29. package/src/messaging/inbound/dispatch-prep.ts +1 -1
  30. package/src/messaging/inbound/gate.ts +2 -31
  31. package/src/messaging/inbound/group-history.ts +0 -75
  32. package/src/messaging/inbound/parse.ts +2 -32
  33. package/src/messaging/inbound/scene-admin.ts +8 -8
  34. package/src/messaging/outbound/diagnostics-debug-builders.ts +0 -15
  35. package/src/messaging/outbound/diagnostics.ts +1 -7
  36. package/src/messaging/outbound/durable-queue-adapter.ts +17 -11
  37. package/src/messaging/outbound/marker-parser.ts +277 -28
  38. package/src/messaging/outbound/media-dedupe.ts +3 -10
  39. package/src/messaging/outbound/media.ts +1 -6
  40. package/src/messaging/outbound/normalize-outbound-send.ts +329 -0
  41. package/src/messaging/outbound/queue-selectors.ts +1 -5
  42. package/src/messaging/outbound/reply-enqueue-media.ts +1 -184
  43. package/src/messaging/outbound/reply-enqueue.ts +313 -175
  44. package/src/messaging/outbound/session-route.ts +6 -11
  45. package/src/messaging/outbound/target-resolver.ts +1 -6
  46. package/src/openclaw/media-runtime.ts +1 -1
  47. package/src/openclaw/routing-runtime.ts +0 -11
  48. package/src/openclaw/sdk-helpers.ts +0 -2
  49. package/src/plugin/bridge-media-facade.ts +0 -4
  50. package/src/plugin/bridge-outbox-facade.ts +0 -1
  51. package/src/plugin/channel-components.ts +0 -13
  52. package/src/plugin/channel-plugin-surface-group.ts +52 -65
  53. package/src/plugin/channel-runtime-builders-delivery.ts +3 -362
  54. package/src/plugin/channel-runtime-builders-status.ts +0 -160
  55. package/src/plugin/channel-runtime-builders.ts +3 -17
  56. package/src/plugin/channel-runtime-constants.ts +1 -1
  57. package/src/plugin/channel-runtime-types.ts +2 -24
  58. package/src/plugin/channel-send.ts +206 -221
  59. package/src/plugin/channel-utils.ts +8 -29
  60. package/src/plugin/connection-handlers-helpers.ts +0 -15
  61. package/src/plugin/connection-handlers.ts +6 -5
  62. package/src/plugin/file-inbound-abort.ts +5 -0
  63. package/src/plugin/file-inbound-chunk.ts +5 -0
  64. package/src/plugin/file-inbound-complete.ts +5 -0
  65. package/src/plugin/file-transfer-orchestrator.ts +39 -2
  66. package/src/plugin/media-dedupe-runtime.ts +1 -6
  67. package/src/plugin/media-orchestrators-runtime-group.ts +20 -149
  68. package/src/plugin/message-send.ts +7 -8
  69. package/src/plugin/messaging.ts +3 -3
  70. package/src/plugin/outbound.ts +6 -26
  71. package/src/plugin/outbox-drain-loop.ts +2 -2
  72. package/src/plugin/outbox-push.ts +1 -52
  73. package/src/plugin/outbox-unified-push-flow.ts +307 -0
  74. package/src/plugin/scene-registry.ts +1 -1
  75. package/src/plugin/target-runtime.ts +1 -6
  76. package/src/runtime/log-dedupe.ts +3 -3
  77. package/src/runtime/outbound-ack-timeout.ts +3 -12
  78. package/src/runtime/outbox-transitions.ts +1 -4
  79. package/src/runtime/status-snapshots.ts +2 -2
  80. package/src/runtime/status-worker.ts +3 -15
  81. package/src/core/outbox-text-push-prep.ts +0 -36
  82. package/src/messaging/outbound/build-send-action.ts +0 -130
  83. package/src/messaging/outbound/durable-message-adapter.ts +0 -121
  84. package/src/messaging/outbound/send-params.ts +0 -114
  85. package/src/messaging/outbound/send.ts +0 -127
  86. package/src/openclaw/ingress-runtime.ts +0 -25
  87. package/src/plugin/bridge-file-transfer-push-facade.ts +0 -142
  88. package/src/plugin/channel-send-runtime-group.ts +0 -37
  89. package/src/plugin/outbox-file-push-flow.ts +0 -69
  90. package/src/plugin/outbox-text-push-flow.ts +0 -90
@@ -1,90 +0,0 @@
1
- import { resolveTextPushGuard } from '../core/outbox-text-push-guards.ts';
2
- import { prepareTextPushRouteSelection } from '../core/outbox-text-push-prep.ts';
3
- import type { BncrConnection, OutboxEntry } from '../core/types.ts';
4
- import { selectOutboxRouteCandidates } from '../messaging/outbound/queue-selectors.ts';
5
-
6
- export async function runBncrTextOutboxPush(args: {
7
- entry: OutboxEntry;
8
- gatewayContext: unknown;
9
- owner: BncrConnection | null;
10
- resolvePushConnIds: (accountId: string) => Set<string>;
11
- resolveRecentInboundConnIds: (accountId: string) => Set<string>;
12
- hasRecentInboundReachability: (accountId: string) => boolean;
13
- isRevalidatedAttemptedConn: (connId: string) => boolean;
14
- recordOutboxPrePushFailure: (args: {
15
- entry: OutboxEntry;
16
- lastError: string;
17
- persist?: boolean;
18
- }) => void;
19
- logOutboxPushSkip: (args: {
20
- messageId: string;
21
- accountId: string;
22
- reason: string;
23
- recentInboundReachable?: boolean;
24
- routeReason?: string;
25
- connIds?: Iterable<string>;
26
- ownerConnId?: string;
27
- ownerClientId?: string;
28
- }) => void;
29
- pushTextSuccessPath: (args: {
30
- entry: OutboxEntry;
31
- owner: BncrConnection | null;
32
- connIds: Iterable<string>;
33
- recentInboundReachable: boolean;
34
- routeReason: string;
35
- ownerConnId?: string;
36
- }) => void;
37
- handleTextPushFailure: (args: { entry: OutboxEntry; error: unknown }) => void;
38
- }) {
39
- const selection = prepareTextPushRouteSelection({
40
- entry: args.entry,
41
- owner: args.owner,
42
- resolvePushConnIds: args.resolvePushConnIds,
43
- resolveRecentInboundConnIds: args.resolveRecentInboundConnIds,
44
- hasRecentInboundReachability: args.hasRecentInboundReachability,
45
- isRevalidatedAttemptedConn: args.isRevalidatedAttemptedConn,
46
- selectOutboxRouteCandidates,
47
- });
48
- const guard = resolveTextPushGuard({
49
- gatewayContext: args.gatewayContext,
50
- entry: args.entry,
51
- routeSelection: selection,
52
- });
53
- if (!guard.ok) {
54
- args.recordOutboxPrePushFailure({
55
- entry: args.entry,
56
- lastError:
57
- guard.reason === 'no-gateway-context'
58
- ? 'gateway context unavailable'
59
- : 'no active bncr client',
60
- persist: true,
61
- });
62
- args.logOutboxPushSkip({
63
- messageId: args.entry.messageId,
64
- accountId: args.entry.accountId,
65
- reason: guard.reason,
66
- recentInboundReachable:
67
- guard.reason === 'no-active-connection' ? guard.recentInboundReachable : undefined,
68
- routeReason: selection.routeReason,
69
- connIds: selection.connIds,
70
- ownerConnId: selection.ownerConnId,
71
- ownerClientId: args.owner?.clientId,
72
- });
73
- return false;
74
- }
75
-
76
- try {
77
- args.pushTextSuccessPath({
78
- entry: args.entry,
79
- owner: args.owner,
80
- connIds: guard.connIds,
81
- recentInboundReachable: guard.recentInboundReachable,
82
- routeReason: guard.routeReason,
83
- ownerConnId: guard.ownerConnId,
84
- });
85
- return true;
86
- } catch (error) {
87
- args.handleTextPushFailure({ entry: args.entry, error });
88
- return false;
89
- }
90
- }