code60-transmission-server 0.1.0-staging.13 → 0.1.0-staging.18
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/INTENT.md +47 -0
- package/README.md +54 -340
- package/dist/src/acp.js +115 -0
- package/dist/src/contract.js +103 -0
- package/dist/src/engine.js +506 -0
- package/dist/src/main.js +72 -25
- package/dist/src/repository.js +94 -0
- package/dist/src/service.js +184 -0
- package/package.json +16 -35
- package/reference/openapi.json +728 -0
- package/README.engine.md +0 -463
- package/dist/src/broker/filesystem.js +0 -385
- package/dist/src/broker/index.js +0 -777
- package/dist/src/broker/native/README.md +0 -207
- package/dist/src/broker/native/build.js +0 -46
- package/dist/src/broker/native/command-helper.c +0 -93
- package/dist/src/broker/native/fs-helper.c +0 -529
- package/dist/src/broker/native/git-helper.c +0 -205
- package/dist/src/broker/policy.js +0 -149
- package/dist/src/broker/startup-lock.js +0 -14
- package/dist/src/broker/types.js +0 -11
- package/dist/src/cli/configure.js +0 -208
- package/dist/src/cli/daemon.js +0 -369
- package/dist/src/cli/helpers.js +0 -112
- package/dist/src/cli/main.js +0 -189
- package/dist/src/cli/runtime-build.js +0 -38
- package/dist/src/config/coding-policy.js +0 -4
- package/dist/src/config/deployment.js +0 -183
- package/dist/src/config/documents.js +0 -29
- package/dist/src/config/profile-validation.js +0 -129
- package/dist/src/config/schema-graph.js +0 -237
- package/dist/src/config/schema-loader.js +0 -185
- package/dist/src/config/validation-pool.js +0 -105
- package/dist/src/config/validation-protocol.js +0 -1
- package/dist/src/config/validation-worker.js +0 -106
- package/dist/src/config/workflow-language.js +0 -9
- package/dist/src/config/workflow-schema.json +0 -545
- package/dist/src/config/workflow-types.js +0 -1
- package/dist/src/config/workflow-validation.js +0 -95
- package/dist/src/engine/budgets.js +0 -50
- package/dist/src/engine/clocks.js +0 -27
- package/dist/src/engine/commands.js +0 -477
- package/dist/src/engine/contracts.js +0 -11
- package/dist/src/engine/drain-state.js +0 -31
- package/dist/src/engine/effective-permissions.js +0 -120
- package/dist/src/engine/instruction-pins.js +0 -205
- package/dist/src/engine/retries.js +0 -50
- package/dist/src/engine/state.js +0 -1
- package/dist/src/engine/timing.js +0 -23
- package/dist/src/engine/tool-observations.js +0 -87
- package/dist/src/engine/workflow-engine.js +0 -1864
- package/dist/src/mcp/catalog.js +0 -71
- package/dist/src/mcp/main.js +0 -26
- package/dist/src/mcp/server.js +0 -177
- package/dist/src/runtime/codex-app-server.js +0 -91
- package/dist/src/runtime/codex-executable.js +0 -50
- package/dist/src/runtime/containment.js +0 -82
- package/dist/src/runtime/engine-driver.js +0 -221
- package/dist/src/runtime/json-line-writer.js +0 -192
- package/dist/src/runtime/pinned-instruction-sources.js +0 -24
- package/dist/src/runtime/protocol-client.js +0 -264
- package/dist/src/runtime/protocol-pool.js +0 -183
- package/dist/src/runtime/protocol-projection.js +0 -393
- package/dist/src/runtime/protocol-types.js +0 -1
- package/dist/src/runtime/protocol-worker.js +0 -18
- package/dist/src/runtime/provider-bridge.js +0 -290
- package/dist/src/runtime/provider-credentials.js +0 -41
- package/dist/src/runtime/provider-transport.js +0 -406
- package/dist/src/runtime/runtime-broker.js +0 -213
- package/dist/src/runtime/workspace-instructions.js +0 -120
- package/dist/src/runtime/workspace-view.js +0 -74
- package/dist/src/server/api-contract.json +0 -11637
- package/dist/src/server/api-types.js +0 -1
- package/dist/src/server/application.js +0 -44
- package/dist/src/server/auth.js +0 -67
- package/dist/src/server/broker-handlers.js +0 -242
- package/dist/src/server/coding.js +0 -281
- package/dist/src/server/control-plane.js +0 -50
- package/dist/src/server/deployment.js +0 -249
- package/dist/src/server/errors.js +0 -22
- package/dist/src/server/history-handlers.js +0 -130
- package/dist/src/server/http.js +0 -124
- package/dist/src/server/paging.js +0 -56
- package/dist/src/server/publication.js +0 -119
- package/dist/src/server/tool-event-handler.js +0 -77
- package/dist/src/server/workspace-handlers.js +0 -34
- package/dist/src/storage/coordinator.js +0 -224
- package/dist/src/storage/startup-lock.js +0 -71
- package/dist/src/storage/store.js +0 -167
- package/dist/src/tools/check-worker.js +0 -81
- package/dist/src/tools/checks.js +0 -117
- package/dist/src/tools/command-check.js +0 -34
- package/dist/src/tools/commands.js +0 -312
- package/dist/src/tools/developer.js +0 -355
- package/dist/src/tools/dns.js +0 -248
- package/dist/src/tools/http-contract.js +0 -38
- package/dist/src/tools/http.js +0 -358
- package/dist/src/tools/index.js +0 -194
- package/dist/src/tools/worker-check.js +0 -73
- package/dist/src/workspaces/git.js +0 -227
- package/dist/src/workspaces/index.js +0 -937
- package/dist/src/workspaces/source.js +0 -295
- package/examples/deployment.local.json +0 -22
- package/scripts/postinstall.mjs +0 -26
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
2
|
-
import { constants } from 'node:fs';
|
|
3
|
-
import { mkdtemp, open, rmdir, unlink } from 'node:fs/promises';
|
|
4
|
-
import { createServer } from 'node:http';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
import { ProviderTransport, ProviderTransportError } from './provider-transport.js';
|
|
7
|
-
const unavailable = () => new Error('provider_bridge_unavailable');
|
|
8
|
-
/** One ephemeral loopback capability for one immutable session/epoch grant.
|
|
9
|
-
* Containment is an outer restriction, not billable model authorization. */
|
|
10
|
-
export class ProviderBridge {
|
|
11
|
-
options;
|
|
12
|
-
#token = randomBytes(32).toString('hex');
|
|
13
|
-
#server;
|
|
14
|
-
#transport;
|
|
15
|
-
#directory;
|
|
16
|
-
#port = 0;
|
|
17
|
-
#closed = false;
|
|
18
|
-
#closing;
|
|
19
|
-
#failure;
|
|
20
|
-
#jobs = new Set();
|
|
21
|
-
#sockets = new Set();
|
|
22
|
-
#controllers = new Set();
|
|
23
|
-
constructor(options, directory) {
|
|
24
|
-
this.options = options;
|
|
25
|
-
this.#directory = directory;
|
|
26
|
-
const provider = options.provider;
|
|
27
|
-
this.#transport = (options.createTransport ?? (options => new ProviderTransport(options)))({
|
|
28
|
-
coordinator: options.coordinator, endpoint: provider.endpoint, networkPolicy: provider.networkPolicy,
|
|
29
|
-
...(provider.dnsResolvers === undefined ? {} : { dnsResolvers: provider.dnsResolvers }),
|
|
30
|
-
...(provider.timeoutMs === undefined ? {} : { timeoutMs: provider.timeoutMs }),
|
|
31
|
-
...(provider.maxConcurrent === undefined ? {} : { maxConcurrent: provider.maxConcurrent }),
|
|
32
|
-
});
|
|
33
|
-
this.#server = createServer({ maxHeaderSize: 16_384 }, (request, response) => {
|
|
34
|
-
const task = Promise.resolve().then(() => this.serve(request, response)).catch(error => {
|
|
35
|
-
if (error instanceof ProviderTransportError)
|
|
36
|
-
this.options.diagnostic?.({ code: error.code, ...(error.upstreamStatus === undefined ? {} : { upstreamStatus: error.upstreamStatus }) });
|
|
37
|
-
if (response.headersSent)
|
|
38
|
-
response.destroy();
|
|
39
|
-
else
|
|
40
|
-
this.deny(response, 502);
|
|
41
|
-
}).finally(() => this.#jobs.delete(task));
|
|
42
|
-
this.#jobs.add(task);
|
|
43
|
-
});
|
|
44
|
-
this.#server.maxConnections = (provider.maxConcurrent ?? 2) + 8;
|
|
45
|
-
this.#server.requestTimeout = provider.timeoutMs ?? 30_000;
|
|
46
|
-
this.#server.headersTimeout = Math.min(this.#server.requestTimeout, 10_000);
|
|
47
|
-
this.#server.keepAliveTimeout = 1;
|
|
48
|
-
this.#server.on('connection', socket => {
|
|
49
|
-
this.#sockets.add(socket);
|
|
50
|
-
socket.on('error', () => { });
|
|
51
|
-
socket.once('close', () => this.#sockets.delete(socket));
|
|
52
|
-
if (this.#closed)
|
|
53
|
-
socket.destroy();
|
|
54
|
-
});
|
|
55
|
-
this.#server.on('clientError', (_error, socket) => socket.destroy());
|
|
56
|
-
this.#server.on('connect', (_request, socket) => socket.destroy());
|
|
57
|
-
this.#server.on('upgrade', (_request, socket) => socket.destroy());
|
|
58
|
-
}
|
|
59
|
-
static async open(options) {
|
|
60
|
-
options.coordinator.assertOutsideTransaction();
|
|
61
|
-
const directory = await mkdtemp(join(options.spoolRoot, 'provider-'));
|
|
62
|
-
let bridge;
|
|
63
|
-
try {
|
|
64
|
-
bridge = new ProviderBridge(options, directory);
|
|
65
|
-
const server = bridge.#server;
|
|
66
|
-
await new Promise((resolve, reject) => {
|
|
67
|
-
const failed = () => { server.removeListener('listening', ready); reject(unavailable()); };
|
|
68
|
-
const ready = () => { server.removeListener('error', failed); resolve(); };
|
|
69
|
-
server.once('error', failed);
|
|
70
|
-
server.once('listening', ready);
|
|
71
|
-
server.listen(0, '127.0.0.1');
|
|
72
|
-
});
|
|
73
|
-
bridge.#port = server.address().port;
|
|
74
|
-
server.on('error', () => { bridge.#failure = unavailable(); });
|
|
75
|
-
return bridge;
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
if (bridge)
|
|
79
|
-
await bridge.close();
|
|
80
|
-
else
|
|
81
|
-
await rmdir(directory);
|
|
82
|
-
throw unavailable();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
get clientConfiguration() {
|
|
86
|
-
return { modelPort: this.#port, headers: { Authorization: `Bearer ${this.#token}` } };
|
|
87
|
-
}
|
|
88
|
-
get activeWork() { return this.#jobs.size + this.#sockets.size + this.#transport.activeWork + Number(!!this.#failure); }
|
|
89
|
-
deny(response, status) {
|
|
90
|
-
if (response.destroyed)
|
|
91
|
-
return;
|
|
92
|
-
response.writeHead(status, { 'content-type': 'application/json', connection: 'close' });
|
|
93
|
-
response.end('{"error":"provider_request_denied"}');
|
|
94
|
-
}
|
|
95
|
-
admit(control) {
|
|
96
|
-
this.options.coordinator.assertOutsideTransaction();
|
|
97
|
-
if (this.#closed || this.#failure || control.signal.aborted)
|
|
98
|
-
throw unavailable();
|
|
99
|
-
if (this.options.admit.constructor.name === 'AsyncFunction')
|
|
100
|
-
throw unavailable();
|
|
101
|
-
const result = this.options.admit();
|
|
102
|
-
if (result && (typeof result === 'object' || typeof result === 'function') && 'then' in result) {
|
|
103
|
-
void Promise.resolve(result).catch(() => { });
|
|
104
|
-
throw unavailable();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
authorized(request) {
|
|
108
|
-
const supplied = request.headers.authorization, expected = `Bearer ${this.#token}`;
|
|
109
|
-
return typeof supplied === 'string' && Buffer.byteLength(supplied) === Buffer.byteLength(expected) &&
|
|
110
|
-
request.rawHeaders.filter((_value, index) => index % 2 === 0 && request.rawHeaders[index].toLowerCase() === 'authorization').length === 1 &&
|
|
111
|
-
timingSafeEqual(Buffer.from(supplied), Buffer.from(expected));
|
|
112
|
-
}
|
|
113
|
-
async serve(request, response) {
|
|
114
|
-
this.options.coordinator.assertOutsideTransaction();
|
|
115
|
-
if (this.#closed || request.socket.remoteAddress !== '127.0.0.1' || request.headers.host !== `127.0.0.1:${this.#port}` ||
|
|
116
|
-
request.method !== 'POST' || request.url !== '/v1/responses' || !this.authorized(request)) {
|
|
117
|
-
this.deny(response, 403);
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (this.#controllers.size >= (this.options.provider.maxConcurrent ?? 2)) {
|
|
121
|
-
this.deny(response, 503);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (request.headers['content-type']?.split(';')[0]?.trim().toLowerCase() !== 'application/json' ||
|
|
125
|
-
request.headers['content-encoding'] !== undefined) {
|
|
126
|
-
this.deny(response, 422);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const declaredLength = request.headers['content-length'];
|
|
130
|
-
if (declaredLength !== undefined && BigInt(declaredLength) > BigInt(this.options.provider.maxRequestBytes)) {
|
|
131
|
-
this.deny(response, 413);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const control = new AbortController();
|
|
135
|
-
this.#controllers.add(control);
|
|
136
|
-
const aborted = () => control.abort();
|
|
137
|
-
const disconnected = () => { if (!response.writableFinished)
|
|
138
|
-
control.abort(); };
|
|
139
|
-
const destroy = () => { this.options.coordinator.assertOutsideTransaction(); request.destroy(); response.destroy(); };
|
|
140
|
-
control.signal.addEventListener('abort', destroy, { once: true });
|
|
141
|
-
request.once('aborted', aborted);
|
|
142
|
-
response.once('close', disconnected);
|
|
143
|
-
const timer = setTimeout(aborted, this.options.provider.timeoutMs ?? 30_000);
|
|
144
|
-
timer.unref();
|
|
145
|
-
let file, path, attemptId, completed = false;
|
|
146
|
-
try {
|
|
147
|
-
this.admit(control);
|
|
148
|
-
const candidate = join(this.#directory, randomUUID());
|
|
149
|
-
file = await open(candidate, constants.O_RDWR | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 0o600);
|
|
150
|
-
path = candidate;
|
|
151
|
-
let count = 0;
|
|
152
|
-
for await (const chunk of request) {
|
|
153
|
-
this.options.coordinator.assertOutsideTransaction();
|
|
154
|
-
if (control.signal.aborted || !Buffer.isBuffer(chunk) || chunk.length > this.options.provider.maxRequestBytes - count)
|
|
155
|
-
throw unavailable();
|
|
156
|
-
let offset = 0;
|
|
157
|
-
while (offset < chunk.length) {
|
|
158
|
-
const result = await file.write(chunk, offset, chunk.length - offset, count + offset);
|
|
159
|
-
if (!result.bytesWritten)
|
|
160
|
-
throw unavailable();
|
|
161
|
-
offset += result.bytesWritten;
|
|
162
|
-
}
|
|
163
|
-
count += chunk.length;
|
|
164
|
-
}
|
|
165
|
-
this.admit(control);
|
|
166
|
-
const checked = await this.options.validation.run({ kind: 'provider_request', bytes: await file.readFile(),
|
|
167
|
-
model: this.options.model, effort: this.options.effort }, { signal: control.signal, runId: this.options.runId });
|
|
168
|
-
if (!checked.valid || !checked.providerRequestDigest) {
|
|
169
|
-
this.deny(response, 422);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
this.admit(control);
|
|
173
|
-
const id = randomUUID();
|
|
174
|
-
this.options.started?.({ id, contentDigest: checked.providerRequestDigest });
|
|
175
|
-
attemptId = id;
|
|
176
|
-
const source = file.createReadStream({ start: 0, autoClose: false, highWaterMark: 65_536 });
|
|
177
|
-
try {
|
|
178
|
-
let safeHeaders;
|
|
179
|
-
const begin = () => {
|
|
180
|
-
if (!safeHeaders)
|
|
181
|
-
throw unavailable();
|
|
182
|
-
if (!response.headersSent)
|
|
183
|
-
response.writeHead(safeHeaders.status, { ...safeHeaders.headers, connection: 'close' });
|
|
184
|
-
};
|
|
185
|
-
await this.#transport.post({ body: source, contentLength: count, signal: control.signal,
|
|
186
|
-
credential: this.options.credential, admit: () => this.admit(control), resolveCredential: this.options.resolveCredential,
|
|
187
|
-
onHeaders(status, headers) { safeHeaders = { status, headers }; },
|
|
188
|
-
onChunk: bytes => { begin(); return this.write(response, bytes); },
|
|
189
|
-
});
|
|
190
|
-
begin();
|
|
191
|
-
await new Promise((resolve, reject) => {
|
|
192
|
-
const failed = () => { clear(); reject(unavailable()); };
|
|
193
|
-
const clear = () => { response.removeListener('error', failed); response.removeListener('close', failed); };
|
|
194
|
-
response.once('error', failed);
|
|
195
|
-
response.once('close', failed);
|
|
196
|
-
response.end(() => { clear(); resolve(); });
|
|
197
|
-
});
|
|
198
|
-
completed = true;
|
|
199
|
-
}
|
|
200
|
-
finally {
|
|
201
|
-
source.destroy();
|
|
202
|
-
if (!source.closed)
|
|
203
|
-
await new Promise(resolve => source.once('close', () => resolve()));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
clearTimeout(timer);
|
|
208
|
-
request.removeListener('aborted', aborted);
|
|
209
|
-
response.removeListener('close', disconnected);
|
|
210
|
-
control.signal.removeEventListener('abort', destroy);
|
|
211
|
-
try {
|
|
212
|
-
await file?.close();
|
|
213
|
-
if (path)
|
|
214
|
-
await unlink(path);
|
|
215
|
-
}
|
|
216
|
-
catch {
|
|
217
|
-
this.#failure = unavailable();
|
|
218
|
-
}
|
|
219
|
-
if (attemptId && !this.#failure) {
|
|
220
|
-
try {
|
|
221
|
-
this.options.settled?.({ id: attemptId, outcome: completed ? 'completed' : 'failed' });
|
|
222
|
-
}
|
|
223
|
-
catch {
|
|
224
|
-
this.#failure = unavailable();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
this.#controllers.delete(control);
|
|
228
|
-
if (this.#failure) {
|
|
229
|
-
this.options.onFailure?.();
|
|
230
|
-
throw this.#failure;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
write(response, bytes) {
|
|
235
|
-
this.options.coordinator.assertOutsideTransaction();
|
|
236
|
-
return new Promise((resolve, reject) => {
|
|
237
|
-
if (response.destroyed) {
|
|
238
|
-
reject(unavailable());
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
let callback = false, drained = false, returned = false;
|
|
242
|
-
const clear = () => { response.removeListener('error', failed); response.removeListener('close', failed); response.removeListener('drain', drain); };
|
|
243
|
-
const done = () => { if (returned && callback && drained) {
|
|
244
|
-
clear();
|
|
245
|
-
resolve();
|
|
246
|
-
} };
|
|
247
|
-
const failed = () => { clear(); reject(unavailable()); };
|
|
248
|
-
const drain = () => { drained = true; done(); };
|
|
249
|
-
response.once('error', failed);
|
|
250
|
-
response.once('close', failed);
|
|
251
|
-
try {
|
|
252
|
-
drained = response.write(bytes, error => { if (error)
|
|
253
|
-
failed();
|
|
254
|
-
else {
|
|
255
|
-
callback = true;
|
|
256
|
-
done();
|
|
257
|
-
} });
|
|
258
|
-
returned = true;
|
|
259
|
-
if (!drained)
|
|
260
|
-
response.once('drain', drain);
|
|
261
|
-
done();
|
|
262
|
-
}
|
|
263
|
-
catch {
|
|
264
|
-
failed();
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
close() {
|
|
269
|
-
this.options.coordinator.assertOutsideTransaction();
|
|
270
|
-
this.#closed = true;
|
|
271
|
-
return this.#closing ??= (async () => {
|
|
272
|
-
const closed = this.#server.listening ? new Promise(resolve => this.#server.close(() => resolve())) : Promise.resolve();
|
|
273
|
-
for (const control of this.#controllers)
|
|
274
|
-
control.abort();
|
|
275
|
-
this.#server.closeAllConnections();
|
|
276
|
-
for (const socket of this.#sockets)
|
|
277
|
-
socket.destroy();
|
|
278
|
-
await this.#transport.close();
|
|
279
|
-
while (this.#jobs.size)
|
|
280
|
-
await Promise.allSettled([...this.#jobs]);
|
|
281
|
-
await closed;
|
|
282
|
-
if (this.#sockets.size)
|
|
283
|
-
await Promise.all([...this.#sockets].map(socket => new Promise(resolve => socket.once('close', () => resolve()))));
|
|
284
|
-
if (this.#failure)
|
|
285
|
-
throw this.#failure;
|
|
286
|
-
await rmdir(this.#directory);
|
|
287
|
-
this.#token = '';
|
|
288
|
-
})();
|
|
289
|
-
}
|
|
290
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ApiError } from '../server/errors.js';
|
|
2
|
-
const unavailable = () => new ApiError(422, 'unavailable_provider_credential', 'The selected provider credential is unavailable.');
|
|
3
|
-
/** Raw material is engine-private and preloaded before any runtime starts.
|
|
4
|
-
* Neither descriptions, serialization nor errors expose a secret or its path. */
|
|
5
|
-
export class ProviderCredentials {
|
|
6
|
-
#entries = new Map();
|
|
7
|
-
constructor(files, read) {
|
|
8
|
-
for (const file of files) {
|
|
9
|
-
let bytes;
|
|
10
|
-
try {
|
|
11
|
-
if (this.#entries.has(file.referenceId))
|
|
12
|
-
throw unavailable();
|
|
13
|
-
bytes = read(file.file, 8194);
|
|
14
|
-
const secret = new TextDecoder('utf-8', { fatal: true }).decode(bytes).replace(/\r?\n$/, '');
|
|
15
|
-
if (!secret.length || secret.length > 8192 || /[^\x21-\x7e]/u.test(secret))
|
|
16
|
-
throw unavailable();
|
|
17
|
-
this.#entries.set(file.referenceId, { providerId: file.providerId, secret,
|
|
18
|
-
binding: Object.freeze({ referenceId: file.referenceId, version: file.version, origin: file.origin }) });
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
throw unavailable();
|
|
22
|
-
}
|
|
23
|
-
finally {
|
|
24
|
-
bytes?.fill(0);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
get ids() { return [...this.#entries.keys()]; }
|
|
29
|
-
describe(referenceId, providerId, origin) {
|
|
30
|
-
const entry = this.#entries.get(referenceId);
|
|
31
|
-
if (!entry || entry.providerId !== providerId || entry.binding.origin !== origin)
|
|
32
|
-
throw unavailable();
|
|
33
|
-
return { ...entry.binding };
|
|
34
|
-
}
|
|
35
|
-
resolve(binding, providerId) {
|
|
36
|
-
const entry = this.#entries.get(binding.referenceId);
|
|
37
|
-
if (!entry || entry.providerId !== providerId || entry.binding.version !== binding.version || entry.binding.origin !== binding.origin)
|
|
38
|
-
throw unavailable();
|
|
39
|
-
return entry.secret;
|
|
40
|
-
}
|
|
41
|
-
}
|