@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.
- package/dist/index.js +1 -9
- package/index.ts +1 -9
- package/package.json +1 -1
- package/scripts/check-pack.mjs +0 -8
- package/scripts/selfcheck.mjs +0 -10
- package/src/bootstrap/runtime-loader.ts +1 -1
- package/src/channel.ts +118 -171
- package/src/core/accounts.ts +1 -6
- package/src/core/connection-reachability.ts +2 -6
- package/src/core/dead-letter-diagnostics.ts +4 -10
- package/src/core/logging.ts +1 -1
- package/src/core/outbox-entry-builders.ts +78 -84
- package/src/core/outbox-file-transfer-failure.ts +5 -0
- package/src/core/outbox-file-transfer-guards.ts +6 -0
- package/src/core/outbox-file-transfer-prep.ts +8 -5
- package/src/core/outbox-file-transfer-success.ts +5 -0
- package/src/core/outbox-queue.ts +1 -7
- package/src/core/outbox-summary.ts +10 -56
- package/src/core/permissions.ts +2 -10
- package/src/core/persisted-outbox-entry.ts +54 -11
- package/src/core/policy.ts +1 -11
- package/src/core/register-trace.ts +4 -7
- package/src/core/status-meta.ts +1 -9
- package/src/core/status.ts +1 -21
- package/src/core/targets.ts +52 -70
- package/src/core/types.ts +1 -17
- package/src/core/value-sanitize.ts +38 -1
- package/src/messaging/inbound/commands.ts +2 -24
- package/src/messaging/inbound/dispatch-prep.ts +1 -1
- package/src/messaging/inbound/gate.ts +2 -31
- package/src/messaging/inbound/group-history.ts +0 -75
- package/src/messaging/inbound/parse.ts +2 -32
- package/src/messaging/inbound/scene-admin.ts +8 -8
- package/src/messaging/outbound/diagnostics-debug-builders.ts +0 -15
- package/src/messaging/outbound/diagnostics.ts +1 -7
- package/src/messaging/outbound/durable-queue-adapter.ts +17 -11
- package/src/messaging/outbound/marker-parser.ts +277 -28
- package/src/messaging/outbound/media-dedupe.ts +3 -10
- package/src/messaging/outbound/media.ts +1 -6
- package/src/messaging/outbound/normalize-outbound-send.ts +329 -0
- package/src/messaging/outbound/queue-selectors.ts +1 -5
- package/src/messaging/outbound/reply-enqueue-media.ts +1 -184
- package/src/messaging/outbound/reply-enqueue.ts +313 -175
- package/src/messaging/outbound/session-route.ts +6 -11
- package/src/messaging/outbound/target-resolver.ts +1 -6
- package/src/openclaw/media-runtime.ts +1 -1
- package/src/openclaw/routing-runtime.ts +0 -11
- package/src/openclaw/sdk-helpers.ts +0 -2
- package/src/plugin/bridge-media-facade.ts +0 -4
- package/src/plugin/bridge-outbox-facade.ts +0 -1
- package/src/plugin/channel-components.ts +0 -13
- package/src/plugin/channel-plugin-surface-group.ts +52 -65
- package/src/plugin/channel-runtime-builders-delivery.ts +3 -362
- package/src/plugin/channel-runtime-builders-status.ts +0 -160
- package/src/plugin/channel-runtime-builders.ts +3 -17
- package/src/plugin/channel-runtime-constants.ts +1 -1
- package/src/plugin/channel-runtime-types.ts +2 -24
- package/src/plugin/channel-send.ts +206 -221
- package/src/plugin/channel-utils.ts +8 -29
- package/src/plugin/connection-handlers-helpers.ts +0 -15
- package/src/plugin/connection-handlers.ts +6 -5
- package/src/plugin/file-inbound-abort.ts +5 -0
- package/src/plugin/file-inbound-chunk.ts +5 -0
- package/src/plugin/file-inbound-complete.ts +5 -0
- package/src/plugin/file-transfer-orchestrator.ts +39 -2
- package/src/plugin/media-dedupe-runtime.ts +1 -6
- package/src/plugin/media-orchestrators-runtime-group.ts +20 -149
- package/src/plugin/message-send.ts +7 -8
- package/src/plugin/messaging.ts +3 -3
- package/src/plugin/outbound.ts +6 -26
- package/src/plugin/outbox-drain-loop.ts +2 -2
- package/src/plugin/outbox-push.ts +1 -52
- package/src/plugin/outbox-unified-push-flow.ts +307 -0
- package/src/plugin/scene-registry.ts +1 -1
- package/src/plugin/target-runtime.ts +1 -6
- package/src/runtime/log-dedupe.ts +3 -3
- package/src/runtime/outbound-ack-timeout.ts +3 -12
- package/src/runtime/outbox-transitions.ts +1 -4
- package/src/runtime/status-snapshots.ts +2 -2
- package/src/runtime/status-worker.ts +3 -15
- package/src/core/outbox-text-push-prep.ts +0 -36
- package/src/messaging/outbound/build-send-action.ts +0 -130
- package/src/messaging/outbound/durable-message-adapter.ts +0 -121
- package/src/messaging/outbound/send-params.ts +0 -114
- package/src/messaging/outbound/send.ts +0 -127
- package/src/openclaw/ingress-runtime.ts +0 -25
- package/src/plugin/bridge-file-transfer-push-facade.ts +0 -142
- package/src/plugin/channel-send-runtime-group.ts +0 -37
- package/src/plugin/outbox-file-push-flow.ts +0 -69
- 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
|
-
}
|