@aria-cli/tools 1.0.9 → 1.0.11
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/package.json +9 -5
- package/src/__tests__/web-fetch-download.test.ts +0 -433
- package/src/__tests__/web-tools.test.ts +0 -619
- package/src/ask-user-interaction.ts +0 -33
- package/src/cache/web-cache.ts +0 -110
- package/src/definitions/arion.ts +0 -118
- package/src/definitions/browser/browser.ts +0 -502
- package/src/definitions/browser/index.ts +0 -5
- package/src/definitions/browser/pw-downloads.ts +0 -142
- package/src/definitions/browser/pw-interactions.ts +0 -282
- package/src/definitions/browser/pw-responses.ts +0 -98
- package/src/definitions/browser/pw-session.ts +0 -405
- package/src/definitions/browser/pw-shared.ts +0 -85
- package/src/definitions/browser/pw-snapshot.ts +0 -383
- package/src/definitions/browser/pw-state.ts +0 -101
- package/src/definitions/browser/types.ts +0 -203
- package/src/definitions/code-intelligence.ts +0 -526
- package/src/definitions/core.ts +0 -118
- package/src/definitions/delegation.ts +0 -567
- package/src/definitions/deploy.ts +0 -73
- package/src/definitions/filesystem.ts +0 -217
- package/src/definitions/frg.ts +0 -67
- package/src/definitions/index.ts +0 -28
- package/src/definitions/memory.ts +0 -150
- package/src/definitions/messaging.ts +0 -734
- package/src/definitions/meta.ts +0 -392
- package/src/definitions/network.ts +0 -179
- package/src/definitions/outlook.ts +0 -318
- package/src/definitions/patch/apply-patch.ts +0 -235
- package/src/definitions/patch/fuzzy-match.ts +0 -217
- package/src/definitions/patch/index.ts +0 -1
- package/src/definitions/patch/patch-parser.ts +0 -297
- package/src/definitions/patch/sandbox-paths.ts +0 -129
- package/src/definitions/process/index.ts +0 -5
- package/src/definitions/process/process-registry.ts +0 -303
- package/src/definitions/process/process.ts +0 -456
- package/src/definitions/process/pty-keys.ts +0 -298
- package/src/definitions/process/session-slug.ts +0 -147
- package/src/definitions/quip.ts +0 -225
- package/src/definitions/search.ts +0 -67
- package/src/definitions/session-history.ts +0 -79
- package/src/definitions/shell.ts +0 -202
- package/src/definitions/slack.ts +0 -211
- package/src/definitions/web.ts +0 -119
- package/src/executors/apply-patch.ts +0 -1035
- package/src/executors/arion.ts +0 -199
- package/src/executors/code-intelligence.ts +0 -1179
- package/src/executors/deploy.ts +0 -1066
- package/src/executors/filesystem.ts +0 -1428
- package/src/executors/frg-freshness.ts +0 -743
- package/src/executors/frg.ts +0 -394
- package/src/executors/index.ts +0 -280
- package/src/executors/learning-meta.ts +0 -1367
- package/src/executors/lsp-client.ts +0 -355
- package/src/executors/memory.ts +0 -978
- package/src/executors/meta.ts +0 -293
- package/src/executors/process-registry.ts +0 -570
- package/src/executors/pty-session-store.ts +0 -43
- package/src/executors/pty.ts +0 -342
- package/src/executors/restart.ts +0 -133
- package/src/executors/search-freshness.ts +0 -249
- package/src/executors/search-types.ts +0 -98
- package/src/executors/search.ts +0 -89
- package/src/executors/self-diagnose.ts +0 -552
- package/src/executors/session-history.ts +0 -435
- package/src/executors/shell-safety.ts +0 -519
- package/src/executors/shell.ts +0 -1243
- package/src/executors/utils.ts +0 -40
- package/src/executors/web.ts +0 -786
- package/src/extraction/content-extraction.ts +0 -281
- package/src/extraction/index.ts +0 -5
- package/src/headless-control-contract.ts +0 -1149
- package/src/index.ts +0 -788
- package/src/local-control-http-auth.ts +0 -2
- package/src/mcp/client.ts +0 -218
- package/src/mcp/connection.ts +0 -568
- package/src/mcp/index.ts +0 -11
- package/src/mcp/jsonrpc.ts +0 -195
- package/src/mcp/types.ts +0 -199
- package/src/network-control-adapter.ts +0 -88
- package/src/network-runtime/address-types.ts +0 -218
- package/src/network-runtime/db-owner-fencing.ts +0 -91
- package/src/network-runtime/delivery-receipts.ts +0 -372
- package/src/network-runtime/direct-endpoint-authority.ts +0 -35
- package/src/network-runtime/index.ts +0 -316
- package/src/network-runtime/local-control-contract.ts +0 -784
- package/src/network-runtime/node-store-contract.ts +0 -46
- package/src/network-runtime/pair-route-contract.ts +0 -97
- package/src/network-runtime/peer-capabilities.ts +0 -48
- package/src/network-runtime/peer-principal-ref.ts +0 -20
- package/src/network-runtime/peer-state-machine.ts +0 -160
- package/src/network-runtime/protocol-schemas.ts +0 -265
- package/src/network-runtime/runtime-bootstrap-contract.ts +0 -83
- package/src/outlook/desktop-session.ts +0 -409
- package/src/policy.ts +0 -171
- package/src/providers/brave.ts +0 -80
- package/src/providers/duckduckgo.ts +0 -199
- package/src/providers/exa.ts +0 -85
- package/src/providers/firecrawl.ts +0 -77
- package/src/providers/index.ts +0 -8
- package/src/providers/jina.ts +0 -70
- package/src/providers/router.ts +0 -121
- package/src/providers/search-provider.ts +0 -74
- package/src/providers/tavily.ts +0 -74
- package/src/quip/desktop-session.ts +0 -435
- package/src/registry/index.ts +0 -1
- package/src/registry/registry.ts +0 -905
- package/src/runtime-socket-local-control-client.ts +0 -632
- package/src/security/dns-normalization.ts +0 -34
- package/src/security/dns-pinning.ts +0 -138
- package/src/security/external-content.ts +0 -129
- package/src/security/ssrf.ts +0 -207
- package/src/slack/desktop-session.ts +0 -493
- package/src/tool-factory.ts +0 -91
- package/src/types.ts +0 -1341
- package/src/utils/retry.ts +0 -163
- package/src/utils/safe-parse-json.ts +0 -176
- package/src/utils/url.ts +0 -20
- package/tests/benchmarks/registry.bench.ts +0 -57
- package/tests/cache/web-cache.test.ts +0 -147
- package/tests/critical-integration.test.ts +0 -1465
- package/tests/definitions/apply-patch.test.ts +0 -586
- package/tests/definitions/browser.test.ts +0 -495
- package/tests/definitions/delegation-pause-resume.test.ts +0 -758
- package/tests/definitions/execution.test.ts +0 -671
- package/tests/definitions/messaging-inbox-scope.test.ts +0 -229
- package/tests/definitions/messaging.test.ts +0 -1468
- package/tests/definitions/outlook.test.ts +0 -30
- package/tests/definitions/process.test.ts +0 -469
- package/tests/definitions/slack.test.ts +0 -28
- package/tests/definitions/tool-inventory.test.ts +0 -218
- package/tests/e2e/delegation-quest-orchestration.e2e.test.ts +0 -433
- package/tests/e2e/memory-tool-discovery-contract.e2e.test.ts +0 -81
- package/tests/executors/apply-patch.test.ts +0 -538
- package/tests/executors/arion.test.ts +0 -309
- package/tests/executors/conversation-primitives.test.ts +0 -250
- package/tests/executors/deploy.test.ts +0 -746
- package/tests/executors/filesystem-tools.test.ts +0 -357
- package/tests/executors/filesystem.test.ts +0 -959
- package/tests/executors/frg-freshness.test.ts +0 -136
- package/tests/executors/frg-merge.test.ts +0 -70
- package/tests/executors/frg-session-content.test.ts +0 -40
- package/tests/executors/frg.test.ts +0 -56
- package/tests/executors/memory-bugfixes.test.ts +0 -257
- package/tests/executors/memory-real-memoria.integration.test.ts +0 -316
- package/tests/executors/memory.test.ts +0 -853
- package/tests/executors/meta-tools.test.ts +0 -411
- package/tests/executors/meta.test.ts +0 -683
- package/tests/executors/path-containment.test.ts +0 -51
- package/tests/executors/process-registry.test.ts +0 -505
- package/tests/executors/pty.test.ts +0 -664
- package/tests/executors/quest-security.test.ts +0 -249
- package/tests/executors/read-file-media.test.ts +0 -230
- package/tests/executors/recall-knowledge-schema.test.ts +0 -209
- package/tests/executors/recall-tags.test.ts +0 -278
- package/tests/executors/remember-null-safety.contract.test.ts +0 -41
- package/tests/executors/restart.test.ts +0 -67
- package/tests/executors/search-unified.test.ts +0 -381
- package/tests/executors/session-history.test.ts +0 -340
- package/tests/executors/session-transcript.test.ts +0 -561
- package/tests/executors/shell-abort.test.ts +0 -416
- package/tests/executors/shell-env-blocklist.test.ts +0 -648
- package/tests/executors/shell-env-process.test.ts +0 -245
- package/tests/executors/shell-process-registry.test.ts +0 -334
- package/tests/executors/shell-tools.test.ts +0 -393
- package/tests/executors/shell.test.ts +0 -690
- package/tests/executors/web-abort-vs-timeout.test.ts +0 -213
- package/tests/executors/web-integration.test.ts +0 -633
- package/tests/executors/web-symlink.test.ts +0 -18
- package/tests/executors/web.test.ts +0 -1400
- package/tests/executors/write-stdin.test.ts +0 -145
- package/tests/extraction/content-extraction.test.ts +0 -153
- package/tests/guards/tools-default-test-lane.integration.test.ts +0 -21
- package/tests/guards/tools-package-test-commands.e2e.test.ts +0 -43
- package/tests/guards/tools-test-lane-manifest.contract.test.ts +0 -76
- package/tests/guards/tools-vitest-workspace-alias.contract.test.ts +0 -63
- package/tests/helpers/async-waits.ts +0 -53
- package/tests/integration/headless-control-contract.integration.test.ts +0 -153
- package/tests/integration/memory-tool-schema-parity.integration.test.ts +0 -67
- package/tests/integration/meta-tools-round-trip.integration.test.ts +0 -506
- package/tests/integration/quest-round-trip.test.ts +0 -303
- package/tests/integration/registry-executor-flow.test.ts +0 -85
- package/tests/integration.test.ts +0 -177
- package/tests/loading-tier.test.ts +0 -126
- package/tests/mcp/client-reconnect.test.ts +0 -267
- package/tests/mcp/connection.test.ts +0 -846
- package/tests/mcp/injectable-logger.test.ts +0 -83
- package/tests/mcp/jsonrpc.test.ts +0 -109
- package/tests/mcp/lifecycle.test.ts +0 -879
- package/tests/network-runtime/address-types.contract.test.ts +0 -143
- package/tests/network-runtime/continuity-bind-schema.contract.test.ts +0 -203
- package/tests/network-runtime/local-control-contract.test.ts +0 -869
- package/tests/network-runtime/local-control-invite-token.contract.test.ts +0 -146
- package/tests/network-runtime/node-store-contract.test.ts +0 -11
- package/tests/network-runtime/pair-protocol-nodeid.contract.test.ts +0 -15
- package/tests/network-runtime/peer-state-machine.contract.test.ts +0 -148
- package/tests/network-runtime/protocol-schemas.contract.test.ts +0 -512
- package/tests/network-runtime/relay-pending-nodeid.contract.test.ts +0 -62
- package/tests/network-runtime/runtime-bootstrap-contract.test.ts +0 -227
- package/tests/network-runtime/runtime-socket-local-control-client.test.ts +0 -621
- package/tests/network-runtime/wait-for-message-script.test.ts +0 -288
- package/tests/parallel.test.ts +0 -71
- package/tests/policy.test.ts +0 -184
- package/tests/print-default-test-lane.ts +0 -14
- package/tests/print-test-lane-manifest.ts +0 -22
- package/tests/providers/brave.test.ts +0 -159
- package/tests/providers/duckduckgo.test.ts +0 -207
- package/tests/providers/exa.test.ts +0 -175
- package/tests/providers/firecrawl.test.ts +0 -168
- package/tests/providers/jina.test.ts +0 -144
- package/tests/providers/router.test.ts +0 -328
- package/tests/providers/tavily.test.ts +0 -165
- package/tests/registry/discovery.test.ts +0 -154
- package/tests/registry/injectable-logger.test.ts +0 -230
- package/tests/registry/input-validation.test.ts +0 -361
- package/tests/registry/interface-completeness.test.ts +0 -85
- package/tests/registry/mcp-integration.test.ts +0 -103
- package/tests/registry/mcp-read-only-hint.test.ts +0 -60
- package/tests/registry/memoria-discovery.test.ts +0 -390
- package/tests/registry/nested-validation.test.ts +0 -283
- package/tests/registry/pseudo-tool-filtering.test.ts +0 -258
- package/tests/registry/registration-lifecycle.test.ts +0 -133
- package/tests/registry-validation.test.ts +0 -424
- package/tests/registry.test.ts +0 -460
- package/tests/security/dns-pinning.test.ts +0 -162
- package/tests/security/external-content.test.ts +0 -144
- package/tests/security/ssrf.test.ts +0 -118
- package/tests/shell-safety-integration.test.ts +0 -32
- package/tests/shell-safety.test.ts +0 -365
- package/tests/slack/desktop-session.test.ts +0 -50
- package/tests/test-lane-manifest.ts +0 -440
- package/tests/test-utils.ts +0 -27
- package/tests/tool-factory.test.ts +0 -188
- package/tests/utils/retry.test.ts +0 -231
- package/tests/utils/url.test.ts +0 -63
- package/tsconfig.cjs.json +0 -24
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -55
- package/vitest.e2e.config.ts +0 -24
- package/vitest.integration.config.ts +0 -24
- package/vitest.native.config.ts +0 -24
|
@@ -1,632 +0,0 @@
|
|
|
1
|
-
import * as net from "node:net";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
import type {
|
|
4
|
-
AttachedClientAuth,
|
|
5
|
-
AttachedLocalControlApi,
|
|
6
|
-
LocalControlApi,
|
|
7
|
-
RunHandle,
|
|
8
|
-
ResumeRunRequest,
|
|
9
|
-
RuntimeRunEvent,
|
|
10
|
-
RuntimeEventCursor,
|
|
11
|
-
} from "./types.js";
|
|
12
|
-
import type {
|
|
13
|
-
AcceptInviteRequest,
|
|
14
|
-
AcceptInviteResponse,
|
|
15
|
-
AcceptInviteTokenRequest,
|
|
16
|
-
AcceptInviteTokenResponse,
|
|
17
|
-
DirectPairRequest,
|
|
18
|
-
DirectPairResponse,
|
|
19
|
-
CancelInviteRequest,
|
|
20
|
-
CancelInviteResponse,
|
|
21
|
-
CreateInviteRequest,
|
|
22
|
-
CreateInviteResponse,
|
|
23
|
-
InboxCursor,
|
|
24
|
-
InboxListRequest,
|
|
25
|
-
InvitePeerRequest,
|
|
26
|
-
InvitePeerResult,
|
|
27
|
-
NodeId,
|
|
28
|
-
NearbyPeerView,
|
|
29
|
-
OutboundMessage,
|
|
30
|
-
PairRequestDecision,
|
|
31
|
-
PairRequestResponse,
|
|
32
|
-
PendingInviteView,
|
|
33
|
-
PendingPairRequestView,
|
|
34
|
-
PeerViewEvent,
|
|
35
|
-
PersistedInboxEvent,
|
|
36
|
-
RepairPeerRequest,
|
|
37
|
-
RepairPeerResponse,
|
|
38
|
-
RevokePeerRequest,
|
|
39
|
-
RevokePeerResponse,
|
|
40
|
-
RuntimeAutonomousLoopCommand,
|
|
41
|
-
RuntimeDeliveryReceipt,
|
|
42
|
-
RuntimeQueuedReceipt,
|
|
43
|
-
RuntimeStatus,
|
|
44
|
-
RuntimeBootstrapRecord,
|
|
45
|
-
RuntimeEvent,
|
|
46
|
-
RunRequest,
|
|
47
|
-
RunResult,
|
|
48
|
-
LocalControlSocketMethod,
|
|
49
|
-
} from "./network-runtime/index.js";
|
|
50
|
-
import {
|
|
51
|
-
AcceptInviteRequestSchema,
|
|
52
|
-
AcceptInviteResponseSchema,
|
|
53
|
-
AcceptInviteTokenRequestSchema,
|
|
54
|
-
AcceptInviteTokenResponseSchema,
|
|
55
|
-
AttachedClientAuthSchema,
|
|
56
|
-
AttachedClientViewSchema,
|
|
57
|
-
CancelInviteRequestSchema,
|
|
58
|
-
CancelInviteResponseSchema,
|
|
59
|
-
CreateInviteRequestSchema,
|
|
60
|
-
CreateInviteResponseSchema,
|
|
61
|
-
InboxAddressSchema,
|
|
62
|
-
InboxCursorSchema,
|
|
63
|
-
InboxListRequestSchema,
|
|
64
|
-
DirectPairRequestSchema,
|
|
65
|
-
DirectPairResponseSchema,
|
|
66
|
-
InvitePeerRequestSchema,
|
|
67
|
-
InvitePeerResultSchema,
|
|
68
|
-
NearbyPeerViewSchema,
|
|
69
|
-
OutboundMessageSchema,
|
|
70
|
-
PairRequestDecisionSchema,
|
|
71
|
-
PairRequestResponseSchema,
|
|
72
|
-
PendingInviteViewSchema,
|
|
73
|
-
PendingPairRequestViewSchema,
|
|
74
|
-
PeerViewEventSchema,
|
|
75
|
-
PersistedInboxEventSchema,
|
|
76
|
-
RepairPeerRequestSchema,
|
|
77
|
-
RepairPeerResponseSchema,
|
|
78
|
-
RevokePeerRequestSchema,
|
|
79
|
-
RevokePeerResponseSchema,
|
|
80
|
-
ResumeRunRequestSchema,
|
|
81
|
-
RunRequestSchema,
|
|
82
|
-
RunResultSchema,
|
|
83
|
-
RuntimeDeliveryReceiptSchema,
|
|
84
|
-
RuntimeEventCursorSchema,
|
|
85
|
-
RuntimeEventSchema,
|
|
86
|
-
RuntimeQueuedReceiptSchema,
|
|
87
|
-
RuntimeRunEventSchema,
|
|
88
|
-
RuntimeStatusSchema,
|
|
89
|
-
RuntimeAutonomousLoopCommandSchema,
|
|
90
|
-
RuntimeBootstrapRecordSchema,
|
|
91
|
-
createTrustedRuntimeError,
|
|
92
|
-
LocalControlSocketRequestSchema,
|
|
93
|
-
LocalControlSocketResponseSchema,
|
|
94
|
-
} from "./network-runtime/index.js";
|
|
95
|
-
|
|
96
|
-
function createOneShotHandle(resultPromise: Promise<RunResult>): RunHandle {
|
|
97
|
-
return {
|
|
98
|
-
runId: `run-local-${Date.now()}`,
|
|
99
|
-
wait: () => resultPromise,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async function sleep(ms: number): Promise<void> {
|
|
104
|
-
await new Promise((resolve) => setTimeout(resolve, Math.max(ms, 0)));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
async function* createPollingSubscription<
|
|
108
|
-
T extends { id?: string; nodeId?: NodeId; createdAt?: number },
|
|
109
|
-
>(
|
|
110
|
-
loadOnce: () => Promise<T[]>,
|
|
111
|
-
options: {
|
|
112
|
-
pollIntervalMs: number;
|
|
113
|
-
initialAfterCreatedAt?: number;
|
|
114
|
-
getVersionKey?: (item: T) => string | number;
|
|
115
|
-
} = { pollIntervalMs: 1_000 },
|
|
116
|
-
): AsyncIterable<T> {
|
|
117
|
-
const seenVersions = new Map<string, string | number>();
|
|
118
|
-
let afterCreatedAt = options.initialAfterCreatedAt ?? 0;
|
|
119
|
-
|
|
120
|
-
while (true) {
|
|
121
|
-
const snapshot = await loadOnce();
|
|
122
|
-
let emitted = false;
|
|
123
|
-
|
|
124
|
-
for (const item of snapshot) {
|
|
125
|
-
if (typeof item.createdAt === "number" && item.createdAt < afterCreatedAt) {
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
const identity = typeof item.id === "string" ? item.id : item.nodeId;
|
|
129
|
-
if (typeof identity === "string") {
|
|
130
|
-
const versionKey = options.getVersionKey?.(item) ?? JSON.stringify(item);
|
|
131
|
-
if (seenVersions.get(identity) === versionKey) {
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
seenVersions.set(identity, versionKey);
|
|
135
|
-
}
|
|
136
|
-
if (typeof item.createdAt === "number") {
|
|
137
|
-
afterCreatedAt = Math.max(afterCreatedAt, item.createdAt);
|
|
138
|
-
}
|
|
139
|
-
emitted = true;
|
|
140
|
-
yield item;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!emitted) {
|
|
144
|
-
await sleep(options.pollIntervalMs);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function requestRuntimeSocket<T>(
|
|
150
|
-
runtimeSocket: string,
|
|
151
|
-
method: LocalControlSocketMethod,
|
|
152
|
-
payload: unknown,
|
|
153
|
-
parse: (raw: unknown) => T,
|
|
154
|
-
auth?: AttachedClientAuth,
|
|
155
|
-
): Promise<T> {
|
|
156
|
-
const request = LocalControlSocketRequestSchema.parse({
|
|
157
|
-
id: randomUUID(),
|
|
158
|
-
method,
|
|
159
|
-
...(payload === undefined ? {} : { payload }),
|
|
160
|
-
...(auth === undefined ? {} : { auth: AttachedClientAuthSchema.parse(auth) }),
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
return new Promise<T>((resolve, reject) => {
|
|
164
|
-
const socket = net.createConnection(runtimeSocket);
|
|
165
|
-
let buffer = "";
|
|
166
|
-
let settled = false;
|
|
167
|
-
|
|
168
|
-
const fail = (error: unknown) => {
|
|
169
|
-
if (settled) return;
|
|
170
|
-
settled = true;
|
|
171
|
-
socket.destroy();
|
|
172
|
-
reject(error);
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
socket.setEncoding("utf8");
|
|
176
|
-
socket.once("error", fail);
|
|
177
|
-
socket.once("connect", () => {
|
|
178
|
-
socket.write(`${JSON.stringify(request)}\n`);
|
|
179
|
-
});
|
|
180
|
-
socket.on("data", (chunk) => {
|
|
181
|
-
buffer += chunk;
|
|
182
|
-
const newlineIndex = buffer.indexOf("\n");
|
|
183
|
-
if (newlineIndex === -1 || settled) return;
|
|
184
|
-
|
|
185
|
-
settled = true;
|
|
186
|
-
socket.destroy();
|
|
187
|
-
try {
|
|
188
|
-
const response = LocalControlSocketResponseSchema.parse(
|
|
189
|
-
JSON.parse(buffer.slice(0, newlineIndex)),
|
|
190
|
-
);
|
|
191
|
-
if (response.id !== request.id) {
|
|
192
|
-
reject(new Error("Local control socket response ID mismatch"));
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (!response.ok) {
|
|
196
|
-
const trustedError = createTrustedRuntimeError(response.error, response.diagnostic);
|
|
197
|
-
// Propagate reason sub-code for stale-lease detection
|
|
198
|
-
if ("reason" in response && typeof response.reason === "string") {
|
|
199
|
-
(trustedError as Error & { reason?: string }).reason = response.reason;
|
|
200
|
-
}
|
|
201
|
-
reject(trustedError);
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
resolve(parse(response.payload));
|
|
205
|
-
} catch (error) {
|
|
206
|
-
reject(error);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
socket.once("end", () => {
|
|
210
|
-
if (!settled) {
|
|
211
|
-
fail(new Error("Local control socket closed before sending a response"));
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function requestRuntimeSocketStream<T>(
|
|
218
|
-
runtimeSocket: string,
|
|
219
|
-
method: LocalControlSocketMethod,
|
|
220
|
-
payload: unknown,
|
|
221
|
-
parse: (raw: unknown) => T,
|
|
222
|
-
signal?: AbortSignal,
|
|
223
|
-
auth?: AttachedClientAuth,
|
|
224
|
-
): AsyncIterable<T> {
|
|
225
|
-
const request = LocalControlSocketRequestSchema.parse({
|
|
226
|
-
id: randomUUID(),
|
|
227
|
-
method,
|
|
228
|
-
...(payload === undefined ? {} : { payload }),
|
|
229
|
-
...(auth === undefined ? {} : { auth: AttachedClientAuthSchema.parse(auth) }),
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
return {
|
|
233
|
-
async *[Symbol.asyncIterator](): AsyncIterator<T> {
|
|
234
|
-
const socket = net.createConnection(runtimeSocket);
|
|
235
|
-
let buffer = "";
|
|
236
|
-
let ended = false;
|
|
237
|
-
let pendingError: unknown;
|
|
238
|
-
const queued: T[] = [];
|
|
239
|
-
let wake: (() => void) | undefined;
|
|
240
|
-
|
|
241
|
-
const notify = () => {
|
|
242
|
-
const resolve = wake;
|
|
243
|
-
wake = undefined;
|
|
244
|
-
resolve?.();
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
socket.setEncoding("utf8");
|
|
248
|
-
socket.once("connect", () => {
|
|
249
|
-
socket.write(`${JSON.stringify(request)}\n`);
|
|
250
|
-
});
|
|
251
|
-
const onAbort = () => {
|
|
252
|
-
ended = true;
|
|
253
|
-
socket.destroy();
|
|
254
|
-
notify();
|
|
255
|
-
};
|
|
256
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
257
|
-
socket.on("data", (chunk) => {
|
|
258
|
-
buffer += chunk;
|
|
259
|
-
while (true) {
|
|
260
|
-
const newlineIndex = buffer.indexOf("\n");
|
|
261
|
-
if (newlineIndex === -1) break;
|
|
262
|
-
const line = buffer.slice(0, newlineIndex).trim();
|
|
263
|
-
buffer = buffer.slice(newlineIndex + 1);
|
|
264
|
-
if (line.length === 0) {
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
try {
|
|
268
|
-
const response = LocalControlSocketResponseSchema.parse(JSON.parse(line));
|
|
269
|
-
if (response.id !== request.id) {
|
|
270
|
-
pendingError = new Error("Local control socket response ID mismatch");
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
|
-
if (!response.ok) {
|
|
274
|
-
const streamError = createTrustedRuntimeError(response.error, response.diagnostic);
|
|
275
|
-
if ("reason" in response && typeof response.reason === "string") {
|
|
276
|
-
(streamError as Error & { reason?: string }).reason = response.reason;
|
|
277
|
-
}
|
|
278
|
-
pendingError = streamError;
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
queued.push(parse(response.payload));
|
|
282
|
-
} catch (error) {
|
|
283
|
-
pendingError = error;
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
notify();
|
|
288
|
-
});
|
|
289
|
-
socket.once("error", (error) => {
|
|
290
|
-
pendingError = error;
|
|
291
|
-
notify();
|
|
292
|
-
});
|
|
293
|
-
socket.once("end", () => {
|
|
294
|
-
ended = true;
|
|
295
|
-
notify();
|
|
296
|
-
});
|
|
297
|
-
socket.once("close", () => {
|
|
298
|
-
ended = true;
|
|
299
|
-
notify();
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
try {
|
|
303
|
-
while (true) {
|
|
304
|
-
if (queued.length > 0) {
|
|
305
|
-
yield queued.shift()!;
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
if (pendingError) {
|
|
309
|
-
throw pendingError;
|
|
310
|
-
}
|
|
311
|
-
if (ended) {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
await new Promise<void>((resolve) => {
|
|
315
|
-
wake = resolve;
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
} finally {
|
|
319
|
-
signal?.removeEventListener("abort", onAbort);
|
|
320
|
-
socket.destroy();
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export function createRuntimeSocketLocalControlClient(options: {
|
|
327
|
-
runtimeSocket: string;
|
|
328
|
-
pollIntervalMs?: number;
|
|
329
|
-
}): LocalControlApi {
|
|
330
|
-
const pollIntervalMs = options.pollIntervalMs ?? 1_000;
|
|
331
|
-
const listInbox = async (request?: InboxListRequest): Promise<PersistedInboxEvent[]> =>
|
|
332
|
-
requestRuntimeSocket(
|
|
333
|
-
options.runtimeSocket,
|
|
334
|
-
"listInbox",
|
|
335
|
-
InboxListRequestSchema.optional().parse(request),
|
|
336
|
-
(raw) => PersistedInboxEventSchema.array().parse(raw),
|
|
337
|
-
);
|
|
338
|
-
|
|
339
|
-
return {
|
|
340
|
-
async submitRun(request: RunRequest): Promise<RunHandle> {
|
|
341
|
-
const payload = RunRequestSchema.parse(request);
|
|
342
|
-
return createOneShotHandle(
|
|
343
|
-
requestRuntimeSocket(options.runtimeSocket, "submitRun", payload, (raw) =>
|
|
344
|
-
RunResultSchema.parse(raw),
|
|
345
|
-
),
|
|
346
|
-
);
|
|
347
|
-
},
|
|
348
|
-
async resumeRun(request: ResumeRunRequest) {
|
|
349
|
-
return requestRuntimeSocket(
|
|
350
|
-
options.runtimeSocket,
|
|
351
|
-
"resumeRun",
|
|
352
|
-
ResumeRunRequestSchema.parse(request),
|
|
353
|
-
(raw) => RunResultSchema.parse(raw),
|
|
354
|
-
);
|
|
355
|
-
},
|
|
356
|
-
streamRun(request: RunRequest, signal?: AbortSignal): AsyncIterable<RuntimeRunEvent> {
|
|
357
|
-
return requestRuntimeSocketStream(
|
|
358
|
-
options.runtimeSocket,
|
|
359
|
-
"streamRun",
|
|
360
|
-
RunRequestSchema.parse(request),
|
|
361
|
-
(raw) => RuntimeRunEventSchema.parse(raw),
|
|
362
|
-
signal,
|
|
363
|
-
);
|
|
364
|
-
},
|
|
365
|
-
subscribeRuntimeEvents(cursor?: RuntimeEventCursor): AsyncIterable<RuntimeEvent> {
|
|
366
|
-
return requestRuntimeSocketStream(
|
|
367
|
-
options.runtimeSocket,
|
|
368
|
-
"subscribeRuntimeEvents",
|
|
369
|
-
RuntimeEventCursorSchema.optional().parse(cursor),
|
|
370
|
-
(raw) => RuntimeEventSchema.parse(raw),
|
|
371
|
-
);
|
|
372
|
-
},
|
|
373
|
-
async sendBestEffort(message: OutboundMessage): Promise<RuntimeQueuedReceipt> {
|
|
374
|
-
return requestRuntimeSocket(
|
|
375
|
-
options.runtimeSocket,
|
|
376
|
-
"sendBestEffort",
|
|
377
|
-
OutboundMessageSchema.parse(message),
|
|
378
|
-
(raw) => RuntimeQueuedReceiptSchema.parse(raw),
|
|
379
|
-
);
|
|
380
|
-
},
|
|
381
|
-
async sendDurable(message: OutboundMessage): Promise<RuntimeDeliveryReceipt> {
|
|
382
|
-
return requestRuntimeSocket(
|
|
383
|
-
options.runtimeSocket,
|
|
384
|
-
"sendDurable",
|
|
385
|
-
OutboundMessageSchema.parse(message),
|
|
386
|
-
(raw) => RuntimeDeliveryReceiptSchema.parse(raw),
|
|
387
|
-
);
|
|
388
|
-
},
|
|
389
|
-
listInbox,
|
|
390
|
-
subscribeInbox(cursor?: InboxCursor): AsyncIterable<PersistedInboxEvent> {
|
|
391
|
-
return createPollingSubscription(() => listInbox({ limit: 100, unreadOnly: false }), {
|
|
392
|
-
pollIntervalMs,
|
|
393
|
-
initialAfterCreatedAt: cursor?.afterCreatedAt ?? 0,
|
|
394
|
-
});
|
|
395
|
-
},
|
|
396
|
-
async listPeers(): Promise<PeerViewEvent[]> {
|
|
397
|
-
return requestRuntimeSocket(options.runtimeSocket, "listPeers", undefined, (raw) =>
|
|
398
|
-
PeerViewEventSchema.array().parse(raw),
|
|
399
|
-
);
|
|
400
|
-
},
|
|
401
|
-
async listNearbyPeers(): Promise<NearbyPeerView[]> {
|
|
402
|
-
return requestRuntimeSocket(options.runtimeSocket, "listNearbyPeers", undefined, (raw) =>
|
|
403
|
-
NearbyPeerViewSchema.array().parse(raw),
|
|
404
|
-
);
|
|
405
|
-
},
|
|
406
|
-
subscribePeers(): AsyncIterable<PeerViewEvent> {
|
|
407
|
-
return createPollingSubscription(
|
|
408
|
-
() =>
|
|
409
|
-
requestRuntimeSocket(options.runtimeSocket, "listPeers", undefined, (raw) =>
|
|
410
|
-
PeerViewEventSchema.array().parse(raw),
|
|
411
|
-
),
|
|
412
|
-
{
|
|
413
|
-
pollIntervalMs,
|
|
414
|
-
getVersionKey: (peer) =>
|
|
415
|
-
[
|
|
416
|
-
peer.updatedAt,
|
|
417
|
-
peer.endpointRevision,
|
|
418
|
-
peer.identityState,
|
|
419
|
-
peer.transportState,
|
|
420
|
-
peer.lastSeenAt ?? "",
|
|
421
|
-
peer.transportPublicKey,
|
|
422
|
-
peer.displayNameSnapshot ?? "",
|
|
423
|
-
].join("|"),
|
|
424
|
-
},
|
|
425
|
-
);
|
|
426
|
-
},
|
|
427
|
-
async getRuntimeStatus(): Promise<RuntimeStatus> {
|
|
428
|
-
return requestRuntimeSocket(options.runtimeSocket, "getRuntimeStatus", undefined, (raw) =>
|
|
429
|
-
RuntimeStatusSchema.parse(raw),
|
|
430
|
-
);
|
|
431
|
-
},
|
|
432
|
-
async startAutonomousLoop(input?: RuntimeAutonomousLoopCommand): Promise<RuntimeStatus> {
|
|
433
|
-
return requestRuntimeSocket(
|
|
434
|
-
options.runtimeSocket,
|
|
435
|
-
"startAutonomousLoop",
|
|
436
|
-
RuntimeAutonomousLoopCommandSchema.optional().parse(input),
|
|
437
|
-
(raw) => RuntimeStatusSchema.parse(raw),
|
|
438
|
-
);
|
|
439
|
-
},
|
|
440
|
-
async stopAutonomousLoop(): Promise<RuntimeStatus> {
|
|
441
|
-
return requestRuntimeSocket(options.runtimeSocket, "stopAutonomousLoop", undefined, (raw) =>
|
|
442
|
-
RuntimeStatusSchema.parse(raw),
|
|
443
|
-
);
|
|
444
|
-
},
|
|
445
|
-
async getRuntimeBootstrap(): Promise<RuntimeBootstrapRecord> {
|
|
446
|
-
return requestRuntimeSocket(options.runtimeSocket, "getRuntimeBootstrap", undefined, (raw) =>
|
|
447
|
-
RuntimeBootstrapRecordSchema.parse(raw),
|
|
448
|
-
);
|
|
449
|
-
},
|
|
450
|
-
async listPendingPairRequests(): Promise<PendingPairRequestView[]> {
|
|
451
|
-
return requestRuntimeSocket(
|
|
452
|
-
options.runtimeSocket,
|
|
453
|
-
"listPendingPairRequests",
|
|
454
|
-
undefined,
|
|
455
|
-
(raw) => PendingPairRequestViewSchema.array().parse(raw),
|
|
456
|
-
);
|
|
457
|
-
},
|
|
458
|
-
async respondToPairRequest(input: PairRequestDecision): Promise<PairRequestResponse> {
|
|
459
|
-
return requestRuntimeSocket(
|
|
460
|
-
options.runtimeSocket,
|
|
461
|
-
"respondToPairRequest",
|
|
462
|
-
PairRequestDecisionSchema.parse(input),
|
|
463
|
-
(raw) => PairRequestResponseSchema.parse(raw),
|
|
464
|
-
);
|
|
465
|
-
},
|
|
466
|
-
async createInvite(input: CreateInviteRequest): Promise<CreateInviteResponse> {
|
|
467
|
-
return requestRuntimeSocket(
|
|
468
|
-
options.runtimeSocket,
|
|
469
|
-
"createInvite",
|
|
470
|
-
CreateInviteRequestSchema.parse(input),
|
|
471
|
-
(raw) => CreateInviteResponseSchema.parse(raw),
|
|
472
|
-
);
|
|
473
|
-
},
|
|
474
|
-
async listPendingInvites(): Promise<PendingInviteView[]> {
|
|
475
|
-
return requestRuntimeSocket(options.runtimeSocket, "listPendingInvites", undefined, (raw) =>
|
|
476
|
-
PendingInviteViewSchema.array().parse(raw),
|
|
477
|
-
);
|
|
478
|
-
},
|
|
479
|
-
async acceptInviteToken(input: AcceptInviteTokenRequest): Promise<AcceptInviteTokenResponse> {
|
|
480
|
-
return requestRuntimeSocket(
|
|
481
|
-
options.runtimeSocket,
|
|
482
|
-
"acceptInviteToken",
|
|
483
|
-
AcceptInviteTokenRequestSchema.parse(input),
|
|
484
|
-
(raw) => AcceptInviteTokenResponseSchema.parse(raw),
|
|
485
|
-
);
|
|
486
|
-
},
|
|
487
|
-
async cancelInvite(input: CancelInviteRequest): Promise<CancelInviteResponse> {
|
|
488
|
-
return requestRuntimeSocket(
|
|
489
|
-
options.runtimeSocket,
|
|
490
|
-
"cancelInvite",
|
|
491
|
-
CancelInviteRequestSchema.parse(input),
|
|
492
|
-
(raw) => CancelInviteResponseSchema.parse(raw),
|
|
493
|
-
);
|
|
494
|
-
},
|
|
495
|
-
async invitePeer(input: InvitePeerRequest): Promise<InvitePeerResult> {
|
|
496
|
-
return requestRuntimeSocket(
|
|
497
|
-
options.runtimeSocket,
|
|
498
|
-
"invitePeer",
|
|
499
|
-
InvitePeerRequestSchema.parse(input),
|
|
500
|
-
(raw) => InvitePeerResultSchema.parse(raw),
|
|
501
|
-
);
|
|
502
|
-
},
|
|
503
|
-
async acceptInvite(input: AcceptInviteRequest): Promise<AcceptInviteResponse> {
|
|
504
|
-
return requestRuntimeSocket(
|
|
505
|
-
options.runtimeSocket,
|
|
506
|
-
"acceptInvite",
|
|
507
|
-
AcceptInviteRequestSchema.parse(input),
|
|
508
|
-
(raw) => AcceptInviteResponseSchema.parse(raw),
|
|
509
|
-
);
|
|
510
|
-
},
|
|
511
|
-
async directPair(input: DirectPairRequest): Promise<DirectPairResponse> {
|
|
512
|
-
return requestRuntimeSocket(
|
|
513
|
-
options.runtimeSocket,
|
|
514
|
-
"directPair",
|
|
515
|
-
DirectPairRequestSchema.parse(input),
|
|
516
|
-
(raw) => DirectPairResponseSchema.parse(raw),
|
|
517
|
-
);
|
|
518
|
-
},
|
|
519
|
-
async revokePeer(input: RevokePeerRequest): Promise<RevokePeerResponse> {
|
|
520
|
-
return requestRuntimeSocket(
|
|
521
|
-
options.runtimeSocket,
|
|
522
|
-
"revokePeer",
|
|
523
|
-
RevokePeerRequestSchema.parse(input),
|
|
524
|
-
(raw) => RevokePeerResponseSchema.parse(raw),
|
|
525
|
-
);
|
|
526
|
-
},
|
|
527
|
-
async repairPeer(input: RepairPeerRequest): Promise<RepairPeerResponse> {
|
|
528
|
-
return requestRuntimeSocket(
|
|
529
|
-
options.runtimeSocket,
|
|
530
|
-
"repairPeer",
|
|
531
|
-
RepairPeerRequestSchema.parse(input),
|
|
532
|
-
(raw) => RepairPeerResponseSchema.parse(raw),
|
|
533
|
-
);
|
|
534
|
-
},
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
export function createRuntimeSocketAttachedLocalControlClient(options: {
|
|
539
|
-
runtimeSocket: string;
|
|
540
|
-
auth: AttachedClientAuth;
|
|
541
|
-
pollIntervalMs?: number;
|
|
542
|
-
}): AttachedLocalControlApi {
|
|
543
|
-
const auth = AttachedClientAuthSchema.parse(options.auth);
|
|
544
|
-
const base = createRuntimeSocketLocalControlClient({
|
|
545
|
-
runtimeSocket: options.runtimeSocket,
|
|
546
|
-
pollIntervalMs: options.pollIntervalMs,
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
const listDirectClientInbox = async (
|
|
550
|
-
request?: InboxListRequest,
|
|
551
|
-
): Promise<PersistedInboxEvent[]> =>
|
|
552
|
-
requestRuntimeSocket(
|
|
553
|
-
options.runtimeSocket,
|
|
554
|
-
"listDirectClientInbox",
|
|
555
|
-
InboxListRequestSchema.optional().parse(request),
|
|
556
|
-
(raw) => PersistedInboxEventSchema.array().parse(raw),
|
|
557
|
-
auth,
|
|
558
|
-
);
|
|
559
|
-
|
|
560
|
-
return {
|
|
561
|
-
...base,
|
|
562
|
-
async sendBestEffort(message) {
|
|
563
|
-
return requestRuntimeSocket(
|
|
564
|
-
options.runtimeSocket,
|
|
565
|
-
"sendBestEffort",
|
|
566
|
-
OutboundMessageSchema.parse(message),
|
|
567
|
-
(raw) => RuntimeQueuedReceiptSchema.parse(raw),
|
|
568
|
-
auth,
|
|
569
|
-
);
|
|
570
|
-
},
|
|
571
|
-
async sendDurable(message) {
|
|
572
|
-
return requestRuntimeSocket(
|
|
573
|
-
options.runtimeSocket,
|
|
574
|
-
"sendDurable",
|
|
575
|
-
OutboundMessageSchema.parse(message),
|
|
576
|
-
(raw) => RuntimeDeliveryReceiptSchema.parse(raw),
|
|
577
|
-
auth,
|
|
578
|
-
);
|
|
579
|
-
},
|
|
580
|
-
async submitRun(request) {
|
|
581
|
-
const payload = RunRequestSchema.parse(request);
|
|
582
|
-
return createOneShotHandle(
|
|
583
|
-
requestRuntimeSocket(
|
|
584
|
-
options.runtimeSocket,
|
|
585
|
-
"submitRun",
|
|
586
|
-
payload,
|
|
587
|
-
(raw) => RunResultSchema.parse(raw),
|
|
588
|
-
auth,
|
|
589
|
-
),
|
|
590
|
-
);
|
|
591
|
-
},
|
|
592
|
-
async resumeRun(request) {
|
|
593
|
-
return requestRuntimeSocket(
|
|
594
|
-
options.runtimeSocket,
|
|
595
|
-
"resumeRun",
|
|
596
|
-
ResumeRunRequestSchema.parse(request),
|
|
597
|
-
(raw) => RunResultSchema.parse(raw),
|
|
598
|
-
auth,
|
|
599
|
-
);
|
|
600
|
-
},
|
|
601
|
-
streamRun(request, signal) {
|
|
602
|
-
return requestRuntimeSocketStream(
|
|
603
|
-
options.runtimeSocket,
|
|
604
|
-
"streamRun",
|
|
605
|
-
RunRequestSchema.parse(request),
|
|
606
|
-
(raw) => RuntimeRunEventSchema.parse(raw),
|
|
607
|
-
signal,
|
|
608
|
-
auth,
|
|
609
|
-
);
|
|
610
|
-
},
|
|
611
|
-
async listAttachedClients() {
|
|
612
|
-
return requestRuntimeSocket(
|
|
613
|
-
options.runtimeSocket,
|
|
614
|
-
"listAttachedClients",
|
|
615
|
-
undefined,
|
|
616
|
-
(raw) => AttachedClientViewSchema.array().parse(raw),
|
|
617
|
-
auth,
|
|
618
|
-
);
|
|
619
|
-
},
|
|
620
|
-
listDirectClientInbox,
|
|
621
|
-
subscribeDirectClientInbox(cursor?: InboxCursor): AsyncIterable<PersistedInboxEvent> {
|
|
622
|
-
return requestRuntimeSocketStream(
|
|
623
|
-
options.runtimeSocket,
|
|
624
|
-
"subscribeDirectClientInbox",
|
|
625
|
-
InboxCursorSchema.optional().parse(cursor),
|
|
626
|
-
(raw) => PersistedInboxEventSchema.parse(raw),
|
|
627
|
-
undefined,
|
|
628
|
-
auth,
|
|
629
|
-
);
|
|
630
|
-
},
|
|
631
|
-
};
|
|
632
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { LookupAddress } from "node:dns";
|
|
2
|
-
|
|
3
|
-
export interface NormalizedLookupAddress {
|
|
4
|
-
address: string;
|
|
5
|
-
family: 4 | 6;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function isLookupAddress(value: unknown): value is NormalizedLookupAddress {
|
|
9
|
-
if (typeof value !== "object" || value === null) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const candidate = value as { address?: unknown; family?: unknown };
|
|
14
|
-
return (
|
|
15
|
-
typeof candidate.address === "string" && (candidate.family === 4 || candidate.family === 6)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function normalizeLookupResult(
|
|
20
|
-
lookupResult: LookupAddress | LookupAddress[] | unknown,
|
|
21
|
-
): NormalizedLookupAddress[] {
|
|
22
|
-
if (Array.isArray(lookupResult)) {
|
|
23
|
-
return lookupResult.filter(isLookupAddress).map((entry) => ({
|
|
24
|
-
address: entry.address,
|
|
25
|
-
family: entry.family,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (isLookupAddress(lookupResult)) {
|
|
30
|
-
return [{ address: lookupResult.address, family: lookupResult.family }];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return [];
|
|
34
|
-
}
|