@telorun/runner-core 0.11.0 → 0.13.0
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/backend.d.ts +12 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/base-image-catalog.d.ts +0 -16
- package/dist/base-image-catalog.d.ts.map +1 -1
- package/dist/base-image-catalog.js +0 -37
- package/dist/base-image-catalog.js.map +1 -1
- package/dist/capabilities-schema.d.ts +3 -3
- package/dist/capabilities-schema.d.ts.map +1 -1
- package/dist/contract.d.ts +37 -2
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/routes/session-start.d.ts.map +1 -1
- package/dist/routes/session-start.js +8 -7
- package/dist/routes/session-start.js.map +1 -1
- package/package.json +1 -1
- package/src/backend.ts +10 -0
- package/src/base-image-catalog.test.ts +0 -40
- package/src/base-image-catalog.ts +0 -44
- package/src/capabilities-schema.ts +3 -3
- package/src/contract.ts +38 -2
- package/src/index.ts +1 -2
- package/src/routes/session-start.ts +9 -7
- package/dist/dependency-key.d.ts +0 -38
- package/dist/dependency-key.d.ts.map +0 -1
- package/dist/dependency-key.js +0 -68
- package/dist/dependency-key.js.map +0 -1
- package/src/dependency-key.test.ts +0 -64
- package/src/dependency-key.ts +0 -105
package/dist/backend.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DebugFrame } from "@telorun/debug-wire";
|
|
2
2
|
import type { ResolvedRunnerApp } from "./config.js";
|
|
3
|
-
import type { AvailabilityReport, ByteStreamTag, IoMode, PortMapping, ProbeConfig, ReachabilityState, RunBundle, RunnerEndpoint, RunPhase, RunStatus, SessionConfig, SessionMode, WorkspaceChangeSet, WorkspaceCheckpointFile, WorkspaceTree } from "./contract.js";
|
|
3
|
+
import type { AvailabilityReport, ByteStreamTag, IoMode, PortMapping, ProbeConfig, ReachabilityState, RouteState, RunBundle, RunnerEndpoint, RunPhase, RunStatus, SessionConfig, SessionMode, WorkspaceChangeSet, WorkspaceCheckpointFile, WorkspaceTree } from "./contract.js";
|
|
4
4
|
/**
|
|
5
5
|
* The seam between backend-neutral session machinery (routes, registry, SSE)
|
|
6
6
|
* and a concrete workload runtime (docker container, kubernetes pod).
|
|
@@ -87,6 +87,17 @@ export interface BackendStartSpec extends WorkloadLaunch {
|
|
|
87
87
|
* while the workload comes up, then `reachable`, or `unreachable` after a
|
|
88
88
|
* timeout. Surfaced on the editor's endpoint badge, not the log stream. */
|
|
89
89
|
onReachability(app: string, port: number, state: ReachabilityState): void;
|
|
90
|
+
/** Report whether the cluster's routing layer programmed a published host.
|
|
91
|
+
* Separate from `onReachability`, which only proves the workload is listening
|
|
92
|
+
* on its own address — a route nothing reconciles leaves every port reachable
|
|
93
|
+
* and every public URL dead. Backends that front nothing (docker publishes
|
|
94
|
+
* host ports directly) never call this. */
|
|
95
|
+
onRoute(app: string | undefined, route: {
|
|
96
|
+
host: string;
|
|
97
|
+
port: number;
|
|
98
|
+
state: RouteState;
|
|
99
|
+
reason?: string;
|
|
100
|
+
}): void;
|
|
90
101
|
/** One app's workload ended on its own. A run session's workload ending IS the
|
|
91
102
|
* session ending, so this is a watch-session concern: under `--watch` a
|
|
92
103
|
* finished run leaves the container up, and a container that goes away has
|
package/dist/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,MAAM,EACN,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,QAAQ,EACR,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E,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtD;;;8DAG0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;wEACoE;IACpE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;oCAEgC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IAErC;;;6CAGyC;IACzC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;gEAE4D;IAC5D,OAAO,CAAC,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;0EACsE;IACtE,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED;;0EAE0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClF;;6DAEyD;IACzD,QAAQ,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAAC;CAChD"}
|
|
@@ -67,22 +67,6 @@ export declare function parseDockerHubRef(ref: string): {
|
|
|
67
67
|
tag: string;
|
|
68
68
|
digest?: string;
|
|
69
69
|
} | null;
|
|
70
|
-
/**
|
|
71
|
-
* Resolve a Docker Hub image ref's CURRENT manifest digest. A moving tag
|
|
72
|
-
* (`latest-slim`) maps to a new digest once a new version is published, so a
|
|
73
|
-
* build that folds this into its cache key detects that the base moved and
|
|
74
|
-
* rebuilds. An already `@sha256:`-pinned ref returns its digest without a
|
|
75
|
-
* network call. Returns `undefined` for a non-Docker-Hub ref (not an error —
|
|
76
|
-
* resolution simply doesn't apply) or when a Hub request fails. A genuine
|
|
77
|
-
* request failure is reported to `onError` rather than swallowed, so an operator
|
|
78
|
-
* whose Hub calls persistently fail (auth / network / rate-limit) gets a signal
|
|
79
|
-
* instead of an unexplained "always reuses the cached image".
|
|
80
|
-
*/
|
|
81
|
-
export declare function resolveTagDigest(ref: string, opts?: {
|
|
82
|
-
fetchImpl?: typeof fetch;
|
|
83
|
-
requestTimeoutMs?: number;
|
|
84
|
-
onError?: (err: unknown) => void;
|
|
85
|
-
}): Promise<string | undefined>;
|
|
86
70
|
export declare class BaseImageCatalog {
|
|
87
71
|
private readonly repository;
|
|
88
72
|
private readonly defaultRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-image-catalog.d.ts","sourceRoot":"","sources":["../src/base-image-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;wCAEwC;AACxC,MAAM,WAAW,SAAS;IACxB;qEACiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;qEACiE;IACjE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,iBAAiB,CA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AAI,GAAG,IAAI;IAQ7C,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -152,43 +152,6 @@ export function parseDockerHubRef(ref) {
|
|
|
152
152
|
digest,
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
/**
|
|
156
|
-
* Resolve a Docker Hub image ref's CURRENT manifest digest. A moving tag
|
|
157
|
-
* (`latest-slim`) maps to a new digest once a new version is published, so a
|
|
158
|
-
* build that folds this into its cache key detects that the base moved and
|
|
159
|
-
* rebuilds. An already `@sha256:`-pinned ref returns its digest without a
|
|
160
|
-
* network call. Returns `undefined` for a non-Docker-Hub ref (not an error —
|
|
161
|
-
* resolution simply doesn't apply) or when a Hub request fails. A genuine
|
|
162
|
-
* request failure is reported to `onError` rather than swallowed, so an operator
|
|
163
|
-
* whose Hub calls persistently fail (auth / network / rate-limit) gets a signal
|
|
164
|
-
* instead of an unexplained "always reuses the cached image".
|
|
165
|
-
*/
|
|
166
|
-
export async function resolveTagDigest(ref, opts = {}) {
|
|
167
|
-
const parsed = parseDockerHubRef(ref);
|
|
168
|
-
if (!parsed)
|
|
169
|
-
return undefined;
|
|
170
|
-
if (parsed.digest)
|
|
171
|
-
return parsed.digest;
|
|
172
|
-
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
173
|
-
const url = `https://hub.docker.com/v2/repositories/${encodeURIComponent(parsed.namespace)}/` +
|
|
174
|
-
`${encodeURIComponent(parsed.repo)}/tags/${encodeURIComponent(parsed.tag)}`;
|
|
175
|
-
try {
|
|
176
|
-
const res = await fetchImpl(url, {
|
|
177
|
-
headers: { Accept: "application/json" },
|
|
178
|
-
signal: AbortSignal.timeout(opts.requestTimeoutMs ?? 10_000),
|
|
179
|
-
});
|
|
180
|
-
if (!res.ok) {
|
|
181
|
-
opts.onError?.(new Error(`Docker Hub tag request for '${ref}' failed: ${res.status} ${res.statusText}`));
|
|
182
|
-
return undefined;
|
|
183
|
-
}
|
|
184
|
-
const body = (await res.json());
|
|
185
|
-
return body.digest ?? body.images?.find((i) => i.digest)?.digest ?? undefined;
|
|
186
|
-
}
|
|
187
|
-
catch (err) {
|
|
188
|
-
opts.onError?.(err);
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
155
|
export class BaseImageCatalog {
|
|
193
156
|
repository;
|
|
194
157
|
defaultRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-image-catalog.js","sourceRoot":"","sources":["../src/base-image-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAuCH,MAAM,OAAO,GAAG,0BAA0B,CAAC;AAC3C,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAChD,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C;0CAC0C;AAC1C,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,IAAI;IACJ,OAAO;IACP,MAAM;IACN,KAAK;IACL,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH,SAAS,QAAQ,CAAC,GAAW;IAC3B,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACvD,OAAO,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;yCACyC;AACzC,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,SAAoB,EAAE;IAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;QACzB,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CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IACvB,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACzB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -9,9 +9,9 @@ export interface SessionConfigSchemaOptions {
|
|
|
9
9
|
imageEnum?: string[];
|
|
10
10
|
/** Default pull policy (defaults to `missing`). */
|
|
11
11
|
pullPolicyDefault?: PullPolicy;
|
|
12
|
-
/** Override the `pullPolicy` field description.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
/** Override the `pullPolicy` field description. Wording differs per backend
|
|
13
|
+
* (a container pull policy on docker, a Pod `imagePullPolicy` on k8s), so
|
|
14
|
+
* each runner can supply text that matches what its workload sees. */
|
|
15
15
|
pullPolicyDescription?: string;
|
|
16
16
|
/** When true, `image` is server-enforced — advertised `readOnly` (locked to
|
|
17
17
|
* `imageDefault`) so the editor renders it disabled but still sends it. No
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities-schema.d.ts","sourceRoot":"","sources":["../src/capabilities-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,0BAA0B;IACzC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB;;;iFAG6E;IAC7E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;
|
|
1
|
+
{"version":3,"file":"capabilities-schema.d.ts","sourceRoot":"","sources":["../src/capabilities-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,WAAW,0BAA0B;IACzC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAC;IACrB;;;iFAG6E;IAC7E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;2EAEuE;IACvE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;qCAGiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,UAAU,CA6BhF"}
|
package/dist/contract.d.ts
CHANGED
|
@@ -241,12 +241,33 @@ export type RunStatus = {
|
|
|
241
241
|
* Coarse phase a session passes through while coming up, carried on `progress`
|
|
242
242
|
* events. Additive to the status enum: `RunStatus` stays `starting` until the
|
|
243
243
|
* workload is actually up; these messages drive the editor's spinner + step feed.
|
|
244
|
+
*
|
|
245
|
+
* `build` is kept though no runner in this repo emits it any more: it is the
|
|
246
|
+
* vocabulary a BACKEND reports in, and a backend that materializes an image
|
|
247
|
+
* before boot has a phase to name. A client must render an unknown phase as
|
|
248
|
+
* prose anyway — an older runner is still on the other end of the stream.
|
|
244
249
|
*/
|
|
245
250
|
export type RunPhase = "build" | "provision" | "boot";
|
|
246
251
|
/** Per-port reachability of a running session's declared ports, watched by the
|
|
247
252
|
* runner from its own network. Drives the editor's endpoint badge
|
|
248
253
|
* (spinner → ok / error) instead of an app-log line. */
|
|
249
254
|
export type ReachabilityState = "checking" | "reachable" | "unreachable";
|
|
255
|
+
/**
|
|
256
|
+
* Whether the cluster's routing layer actually PROGRAMMED the public route for a
|
|
257
|
+
* session port — a separate axis from `ReachabilityState`, deliberately.
|
|
258
|
+
*
|
|
259
|
+
* Reachability is the runner dialling the workload's own address; it answers "is
|
|
260
|
+
* the app listening". It says nothing about whether anything routes to it, so a
|
|
261
|
+
* session whose routing objects are reconciled by no controller reports every
|
|
262
|
+
* port `reachable` while every public URL 404s. The two fail independently and
|
|
263
|
+
* want different actions — one is the user's manifest, the other the operator's
|
|
264
|
+
* cluster — so they are two states, not one.
|
|
265
|
+
*
|
|
266
|
+
* - `pending` — published, no verdict from the routing layer yet.
|
|
267
|
+
* - `programmed` — a controller claimed the route and resolved its backend.
|
|
268
|
+
* - `unprogrammed` — a controller rejected it, or none claimed it in time.
|
|
269
|
+
*/
|
|
270
|
+
export type RouteState = "pending" | "programmed" | "unprogrammed";
|
|
250
271
|
/** What started one generation of an application.
|
|
251
272
|
* - `initial` — the session came up
|
|
252
273
|
* - `watch` — a file changed under the app's watcher
|
|
@@ -311,10 +332,24 @@ export type RunEvent = {
|
|
|
311
332
|
app: string;
|
|
312
333
|
port: number;
|
|
313
334
|
state: ReachabilityState;
|
|
335
|
+
}
|
|
336
|
+
/** A routing-layer verdict for one published host. `app` is absent for a port
|
|
337
|
+
* that belongs to no application (a co-resident agent's). `reason` carries the
|
|
338
|
+
* routing controller's own words for a refusal — the operator-facing half,
|
|
339
|
+
* since every cause here (no controller for the class, a Gateway listener that
|
|
340
|
+
* does not admit the session namespace) is fixed in the cluster, not the
|
|
341
|
+
* manifest. */
|
|
342
|
+
| {
|
|
343
|
+
type: "route";
|
|
344
|
+
app?: string;
|
|
345
|
+
host: string;
|
|
346
|
+
port: number;
|
|
347
|
+
state: RouteState;
|
|
348
|
+
reason?: string;
|
|
314
349
|
} | RunOutcomeEvent
|
|
315
350
|
/** An app's declared port set changed on reload and the runner re-patched the
|
|
316
|
-
* Service and
|
|
317
|
-
* and is simply unreachable: no
|
|
351
|
+
* Service and its routing objects. Without this the app binds the new port
|
|
352
|
+
* inside the pod and is simply unreachable: no route, no error, no event. */
|
|
318
353
|
| {
|
|
319
354
|
type: "endpoints";
|
|
320
355
|
app: string;
|
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QAAE,MAAM,EAAE,UAAU,CAAA;KAAE,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB;;;;mFAI+E;IAC/E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;uDAEmD;IACnD,IAAI,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED;2EAC2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,4DAA4D;IAC5D,KAAK,EAAE,OAAO,CAAC;IACf;wEACoE;IACpE,KAAK,EAAE,OAAO,CAAC;IACf;6CACyC;IACzC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;gEAIgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,W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KG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC,CAAC;IAC/E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;wEAEwE;AACxE,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAEZ,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,IAAI,EAAE,aAAa,GAAG,cAAc;aACpC,KAAK,EAAE,iBAAiB;aAExB,aAAa,CAAC,EAAE,MAAM;gBAHtB,IAAI,EAAE,aAAa,GAAG,cAAc,EACpC,KAAK,EAAE,iBAAiB,EACxC,OAAO,EAAE,MAAM,EACC,aAAa,CAAC,EAAE,MAAM,YAAA;CAKzC"}
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AA6G7D;;gEAEgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AA6G7D;;gEAEgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AA+LtC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAiB;IAC1C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;AAC3F,CAAC;AA0DD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAExB;IACA;IAEA;IAJlB,YACkB,IAAoC,EACpC,KAAwB,EACxC,OAAe,EACC,aAAsB;QAEtC,KAAK,CAAC,OAAO,CAAC,CAAC;QALC,SAAI,GAAJ,IAAI,CAAgC;QACpC,UAAK,GAAL,KAAK,CAAmB;QAExB,kBAAa,GAAb,aAAa,CAAS;QAGtC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,7 @@ export * from "./backend.js";
|
|
|
3
3
|
export * from "./config.js";
|
|
4
4
|
export * from "./server.js";
|
|
5
5
|
export { sessionConfigSchema, type SessionConfigSchemaOptions } from "./capabilities-schema.js";
|
|
6
|
-
export { BaseImageCatalog, filterTags, parseDockerHubRef,
|
|
7
|
-
export { extractDependencyKey, type DependencyKey } from "./dependency-key.js";
|
|
6
|
+
export { BaseImageCatalog, filterTags, parseDockerHubRef, type TagFilter, type BaseImageCatalogOptions, } from "./base-image-catalog.js";
|
|
8
7
|
export { SessionRegistry, SessionLimitError, SessionEvictedError, UnknownAppError, type AppChannel, type RunAttribution, type SessionEntry, type RegisterArgs, type RegistryDeps, type WorkspaceCheckpoint, } from "./session/registry.js";
|
|
9
8
|
export { WatchSupervisor, type WatchSupervisorDeps } from "./session/watch-supervisor.js";
|
|
10
9
|
export { RunProjection } from "./debug/run-projection.js";
|
|
@@ -24,5 +23,6 @@ export { appsRoute, type AppsRouteDeps } from "./routes/apps.js";
|
|
|
24
23
|
export { ioRoute, type IoRouteDeps } from "./routes/io.js";
|
|
25
24
|
export { relayDebugStream, type DebugRelayOptions } from "./debug/relay.js";
|
|
26
25
|
export { watchReachability, type WatchReachabilityOptions, } from "./reachability.js";
|
|
26
|
+
export { abortableDelay } from "./abortable-delay.js";
|
|
27
27
|
export type { DebugFrame, DebugEvent, DebugLog } from "@telorun/debug-wire";
|
|
28
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAC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,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,7 @@ export * from "./backend.js";
|
|
|
3
3
|
export * from "./config.js";
|
|
4
4
|
export * from "./server.js";
|
|
5
5
|
export { sessionConfigSchema } from "./capabilities-schema.js";
|
|
6
|
-
export { BaseImageCatalog, filterTags, parseDockerHubRef,
|
|
7
|
-
export { extractDependencyKey } from "./dependency-key.js";
|
|
6
|
+
export { BaseImageCatalog, filterTags, parseDockerHubRef, } from "./base-image-catalog.js";
|
|
8
7
|
export { SessionRegistry, SessionLimitError, SessionEvictedError, UnknownAppError, } from "./session/registry.js";
|
|
9
8
|
export { WatchSupervisor } from "./session/watch-supervisor.js";
|
|
10
9
|
export { RunProjection } from "./debug/run-projection.js";
|
|
@@ -24,4 +23,5 @@ export { appsRoute } from "./routes/apps.js";
|
|
|
24
23
|
export { ioRoute } from "./routes/io.js";
|
|
25
24
|
export { relayDebugStream } from "./debug/relay.js";
|
|
26
25
|
export { watchReachability, } from "./reachability.js";
|
|
26
|
+
export { abortableDelay } from "./abortable-delay.js";
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAmC,MAAM,0BAA0B,CAAC;AAChG,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B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,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,YAAY,GAClB,IAAI,
|
|
1
|
+
{"version":3,"file":"session-start.d.ts","sourceRoot":"","sources":["../../src/routes/session-start.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAEhC;2EAC2E;AAC3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAUd,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,WAAW,GAAG,SAAS,GAC7B,OAAO,CAST;AAED;gFACgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,YAAY;AACnB;;;4EAG4E;AAC5E,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,YAAY,GAClB,IAAI,CA4FN"}
|
|
@@ -66,12 +66,12 @@ notices) {
|
|
|
66
66
|
}
|
|
67
67
|
const sessionEnv = withoutCacheOverride(args.env);
|
|
68
68
|
// Respond as soon as the session is registered — BEFORE the backend starts.
|
|
69
|
-
// `backend.start()`
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
69
|
+
// `backend.start()` spans image pull and workload bring-up, which can take
|
|
70
|
+
// seconds-to-minutes; awaiting it here would hide the event stream until the
|
|
71
|
+
// workload is already up, so the client never sees provision / boot progress
|
|
72
|
+
// live. Returning the streamUrl first lets the client connect immediately;
|
|
73
|
+
// start runs in the background and its progress, output, and terminal status
|
|
74
|
+
// flow over the stream.
|
|
75
75
|
reply.code(201).send({
|
|
76
76
|
sessionId,
|
|
77
77
|
streamUrl: `/v1/sessions/${sessionId}/events`,
|
|
@@ -139,6 +139,7 @@ export function launchWorkload(app, deps, args, entry) {
|
|
|
139
139
|
reason: outcome.reason ?? "workload ended",
|
|
140
140
|
}),
|
|
141
141
|
onReachability: (app, port, state) => deps.registry.emit(sessionId, { type: "reachability", app, port, state }),
|
|
142
|
+
onRoute: (app, route) => deps.registry.emit(sessionId, { type: "route", ...(app ? { app } : {}), ...route }),
|
|
142
143
|
onEndpoints: (appName, change) => {
|
|
143
144
|
// The registry's own channel is what `GET /v1/sessions/:id` reports, so
|
|
144
145
|
// the delta has to land there too — otherwise the session document keeps
|
|
@@ -158,7 +159,7 @@ export function launchWorkload(app, deps, args, entry) {
|
|
|
158
159
|
.then(async (session) => {
|
|
159
160
|
entry.session = session;
|
|
160
161
|
// Pre-start DELETE race: a DELETE received during backend.start (e.g.
|
|
161
|
-
// while
|
|
162
|
+
// while the image was still pulling) can't stop a workload that didn't
|
|
162
163
|
// exist yet — it set userStopped and returned 204. Now that the workload
|
|
163
164
|
// is live, honor the earlier DELETE.
|
|
164
165
|
if (entry.userStopped) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../src/routes/session-start.ts"],"names":[],"mappings":"A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AC;AACP,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,GAA2B;IACvD,IAAI,CAAC,CAAC,gBAAgB,IAAI,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3C,MAAM,IAAI,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IACxB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/runner-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Backend-neutral core for Telo runners: the /v1 session contract, the RunnerBackend interface, the session registry, SSE/byte ring buffers, and bundle handling. Shared by docker-runner and k8s-runner.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
package/src/backend.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
PortMapping,
|
|
9
9
|
ProbeConfig,
|
|
10
10
|
ReachabilityState,
|
|
11
|
+
RouteState,
|
|
11
12
|
RunBundle,
|
|
12
13
|
RunnerEndpoint,
|
|
13
14
|
RunPhase,
|
|
@@ -111,6 +112,15 @@ export interface BackendStartSpec extends WorkloadLaunch {
|
|
|
111
112
|
* while the workload comes up, then `reachable`, or `unreachable` after a
|
|
112
113
|
* timeout. Surfaced on the editor's endpoint badge, not the log stream. */
|
|
113
114
|
onReachability(app: string, port: number, state: ReachabilityState): void;
|
|
115
|
+
/** Report whether the cluster's routing layer programmed a published host.
|
|
116
|
+
* Separate from `onReachability`, which only proves the workload is listening
|
|
117
|
+
* on its own address — a route nothing reconciles leaves every port reachable
|
|
118
|
+
* and every public URL dead. Backends that front nothing (docker publishes
|
|
119
|
+
* host ports directly) never call this. */
|
|
120
|
+
onRoute(
|
|
121
|
+
app: string | undefined,
|
|
122
|
+
route: { host: string; port: number; state: RouteState; reason?: string },
|
|
123
|
+
): void;
|
|
114
124
|
/** One app's workload ended on its own. A run session's workload ending IS the
|
|
115
125
|
* session ending, so this is a watch-session concern: under `--watch` a
|
|
116
126
|
* finished run leaves the container up, and a container that goes away has
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
BaseImageCatalog,
|
|
5
5
|
filterTags,
|
|
6
6
|
parseDockerHubRef,
|
|
7
|
-
resolveTagDigest,
|
|
8
7
|
} from "./base-image-catalog.js";
|
|
9
8
|
|
|
10
9
|
const SAMPLE = [
|
|
@@ -168,42 +167,3 @@ describe("parseDockerHubRef", () => {
|
|
|
168
167
|
expect(parseDockerHubRef("registry.telo-runner.svc:5000/x:y")).toBeNull();
|
|
169
168
|
});
|
|
170
169
|
});
|
|
171
|
-
|
|
172
|
-
describe("resolveTagDigest", () => {
|
|
173
|
-
it("returns an already-pinned digest without a network call", async () => {
|
|
174
|
-
let called = false;
|
|
175
|
-
const fetchImpl = (async () => {
|
|
176
|
-
called = true;
|
|
177
|
-
return new Response("{}");
|
|
178
|
-
}) as unknown as typeof fetch;
|
|
179
|
-
expect(await resolveTagDigest("telorun/node@sha256:deadbeef", { fetchImpl })).toBe(
|
|
180
|
-
"sha256:deadbeef",
|
|
181
|
-
);
|
|
182
|
-
expect(called).toBe(false);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it("reads the manifest digest from the Docker Hub tag endpoint", async () => {
|
|
186
|
-
const fetchImpl = (async () =>
|
|
187
|
-
new Response(JSON.stringify({ digest: "sha256:abc123", images: [{ digest: "sha256:zzz" }] }), {
|
|
188
|
-
status: 200,
|
|
189
|
-
headers: { "content-type": "application/json" },
|
|
190
|
-
})) as unknown as typeof fetch;
|
|
191
|
-
expect(await resolveTagDigest("telorun/node:latest-slim", { fetchImpl })).toBe("sha256:abc123");
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it("returns undefined for a non-Hub ref or on a failed request", async () => {
|
|
195
|
-
expect(await resolveTagDigest("ghcr.io/foo/bar:1")).toBeUndefined();
|
|
196
|
-
const fetchImpl = (async () => new Response("nope", { status: 404 })) as unknown as typeof fetch;
|
|
197
|
-
expect(await resolveTagDigest("telorun/node:missing", { fetchImpl })).toBeUndefined();
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
it("reports a genuine Hub failure to onError but stays silent for a non-Hub ref", async () => {
|
|
201
|
-
const errors: unknown[] = [];
|
|
202
|
-
const fail = (async () => new Response("boom", { status: 500 })) as unknown as typeof fetch;
|
|
203
|
-
await resolveTagDigest("telorun/node:latest", { fetchImpl: fail, onError: (e) => errors.push(e) });
|
|
204
|
-
expect(errors).toHaveLength(1);
|
|
205
|
-
|
|
206
|
-
await resolveTagDigest("ghcr.io/foo/bar:1", { onError: (e) => errors.push(e) });
|
|
207
|
-
expect(errors).toHaveLength(1); // non-Hub ref is not an error
|
|
208
|
-
});
|
|
209
|
-
});
|
|
@@ -211,50 +211,6 @@ export function parseDockerHubRef(
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
/**
|
|
215
|
-
* Resolve a Docker Hub image ref's CURRENT manifest digest. A moving tag
|
|
216
|
-
* (`latest-slim`) maps to a new digest once a new version is published, so a
|
|
217
|
-
* build that folds this into its cache key detects that the base moved and
|
|
218
|
-
* rebuilds. An already `@sha256:`-pinned ref returns its digest without a
|
|
219
|
-
* network call. Returns `undefined` for a non-Docker-Hub ref (not an error —
|
|
220
|
-
* resolution simply doesn't apply) or when a Hub request fails. A genuine
|
|
221
|
-
* request failure is reported to `onError` rather than swallowed, so an operator
|
|
222
|
-
* whose Hub calls persistently fail (auth / network / rate-limit) gets a signal
|
|
223
|
-
* instead of an unexplained "always reuses the cached image".
|
|
224
|
-
*/
|
|
225
|
-
export async function resolveTagDigest(
|
|
226
|
-
ref: string,
|
|
227
|
-
opts: {
|
|
228
|
-
fetchImpl?: typeof fetch;
|
|
229
|
-
requestTimeoutMs?: number;
|
|
230
|
-
onError?: (err: unknown) => void;
|
|
231
|
-
} = {},
|
|
232
|
-
): Promise<string | undefined> {
|
|
233
|
-
const parsed = parseDockerHubRef(ref);
|
|
234
|
-
if (!parsed) return undefined;
|
|
235
|
-
if (parsed.digest) return parsed.digest;
|
|
236
|
-
|
|
237
|
-
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
238
|
-
const url =
|
|
239
|
-
`https://hub.docker.com/v2/repositories/${encodeURIComponent(parsed.namespace)}/` +
|
|
240
|
-
`${encodeURIComponent(parsed.repo)}/tags/${encodeURIComponent(parsed.tag)}`;
|
|
241
|
-
try {
|
|
242
|
-
const res = await fetchImpl(url, {
|
|
243
|
-
headers: { Accept: "application/json" },
|
|
244
|
-
signal: AbortSignal.timeout(opts.requestTimeoutMs ?? 10_000),
|
|
245
|
-
});
|
|
246
|
-
if (!res.ok) {
|
|
247
|
-
opts.onError?.(new Error(`Docker Hub tag request for '${ref}' failed: ${res.status} ${res.statusText}`));
|
|
248
|
-
return undefined;
|
|
249
|
-
}
|
|
250
|
-
const body = (await res.json()) as { digest?: string; images?: Array<{ digest?: string }> };
|
|
251
|
-
return body.digest ?? body.images?.find((i) => i.digest)?.digest ?? undefined;
|
|
252
|
-
} catch (err) {
|
|
253
|
-
opts.onError?.(err);
|
|
254
|
-
return undefined;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
214
|
export class BaseImageCatalog {
|
|
259
215
|
private readonly repository: string;
|
|
260
216
|
private readonly defaultRef: string;
|
|
@@ -10,9 +10,9 @@ export interface SessionConfigSchemaOptions {
|
|
|
10
10
|
imageEnum?: string[];
|
|
11
11
|
/** Default pull policy (defaults to `missing`). */
|
|
12
12
|
pullPolicyDefault?: PullPolicy;
|
|
13
|
-
/** Override the `pullPolicy` field description.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
/** Override the `pullPolicy` field description. Wording differs per backend
|
|
14
|
+
* (a container pull policy on docker, a Pod `imagePullPolicy` on k8s), so
|
|
15
|
+
* each runner can supply text that matches what its workload sees. */
|
|
16
16
|
pullPolicyDescription?: string;
|
|
17
17
|
/** When true, `image` is server-enforced — advertised `readOnly` (locked to
|
|
18
18
|
* `imageDefault`) so the editor renders it disabled but still sends it. No
|
package/src/contract.ts
CHANGED
|
@@ -248,6 +248,11 @@ export type RunStatus =
|
|
|
248
248
|
* Coarse phase a session passes through while coming up, carried on `progress`
|
|
249
249
|
* events. Additive to the status enum: `RunStatus` stays `starting` until the
|
|
250
250
|
* workload is actually up; these messages drive the editor's spinner + step feed.
|
|
251
|
+
*
|
|
252
|
+
* `build` is kept though no runner in this repo emits it any more: it is the
|
|
253
|
+
* vocabulary a BACKEND reports in, and a backend that materializes an image
|
|
254
|
+
* before boot has a phase to name. A client must render an unknown phase as
|
|
255
|
+
* prose anyway — an older runner is still on the other end of the stream.
|
|
251
256
|
*/
|
|
252
257
|
export type RunPhase = "build" | "provision" | "boot";
|
|
253
258
|
|
|
@@ -256,6 +261,23 @@ export type RunPhase = "build" | "provision" | "boot";
|
|
|
256
261
|
* (spinner → ok / error) instead of an app-log line. */
|
|
257
262
|
export type ReachabilityState = "checking" | "reachable" | "unreachable";
|
|
258
263
|
|
|
264
|
+
/**
|
|
265
|
+
* Whether the cluster's routing layer actually PROGRAMMED the public route for a
|
|
266
|
+
* session port — a separate axis from `ReachabilityState`, deliberately.
|
|
267
|
+
*
|
|
268
|
+
* Reachability is the runner dialling the workload's own address; it answers "is
|
|
269
|
+
* the app listening". It says nothing about whether anything routes to it, so a
|
|
270
|
+
* session whose routing objects are reconciled by no controller reports every
|
|
271
|
+
* port `reachable` while every public URL 404s. The two fail independently and
|
|
272
|
+
* want different actions — one is the user's manifest, the other the operator's
|
|
273
|
+
* cluster — so they are two states, not one.
|
|
274
|
+
*
|
|
275
|
+
* - `pending` — published, no verdict from the routing layer yet.
|
|
276
|
+
* - `programmed` — a controller claimed the route and resolved its backend.
|
|
277
|
+
* - `unprogrammed` — a controller rejected it, or none claimed it in time.
|
|
278
|
+
*/
|
|
279
|
+
export type RouteState = "pending" | "programmed" | "unprogrammed";
|
|
280
|
+
|
|
259
281
|
/** What started one generation of an application.
|
|
260
282
|
* - `initial` — the session came up
|
|
261
283
|
* - `watch` — a file changed under the app's watcher
|
|
@@ -297,10 +319,24 @@ export type RunEvent =
|
|
|
297
319
|
| { type: "debug"; app: string; frame: DebugFrame }
|
|
298
320
|
/** A reachability transition for one declared port of one app. */
|
|
299
321
|
| { type: "reachability"; app: string; port: number; state: ReachabilityState }
|
|
322
|
+
/** A routing-layer verdict for one published host. `app` is absent for a port
|
|
323
|
+
* that belongs to no application (a co-resident agent's). `reason` carries the
|
|
324
|
+
* routing controller's own words for a refusal — the operator-facing half,
|
|
325
|
+
* since every cause here (no controller for the class, a Gateway listener that
|
|
326
|
+
* does not admit the session namespace) is fixed in the cluster, not the
|
|
327
|
+
* manifest. */
|
|
328
|
+
| {
|
|
329
|
+
type: "route";
|
|
330
|
+
app?: string;
|
|
331
|
+
host: string;
|
|
332
|
+
port: number;
|
|
333
|
+
state: RouteState;
|
|
334
|
+
reason?: string;
|
|
335
|
+
}
|
|
300
336
|
| RunOutcomeEvent
|
|
301
337
|
/** An app's declared port set changed on reload and the runner re-patched the
|
|
302
|
-
* Service and
|
|
303
|
-
* and is simply unreachable: no
|
|
338
|
+
* Service and its routing objects. Without this the app binds the new port
|
|
339
|
+
* inside the pod and is simply unreachable: no route, no error, no event. */
|
|
304
340
|
| {
|
|
305
341
|
type: "endpoints";
|
|
306
342
|
app: string;
|
package/src/index.ts
CHANGED
|
@@ -7,11 +7,9 @@ export {
|
|
|
7
7
|
BaseImageCatalog,
|
|
8
8
|
filterTags,
|
|
9
9
|
parseDockerHubRef,
|
|
10
|
-
resolveTagDigest,
|
|
11
10
|
type TagFilter,
|
|
12
11
|
type BaseImageCatalogOptions,
|
|
13
12
|
} from "./base-image-catalog.js";
|
|
14
|
-
export { extractDependencyKey, type DependencyKey } from "./dependency-key.js";
|
|
15
13
|
|
|
16
14
|
export {
|
|
17
15
|
SessionRegistry,
|
|
@@ -54,4 +52,5 @@ export {
|
|
|
54
52
|
watchReachability,
|
|
55
53
|
type WatchReachabilityOptions,
|
|
56
54
|
} from "./reachability.js";
|
|
55
|
+
export { abortableDelay } from "./abortable-delay.js";
|
|
57
56
|
export type { DebugFrame, DebugEvent, DebugLog } from "@telorun/debug-wire";
|
|
@@ -99,12 +99,12 @@ export async function startWorkloadSession(
|
|
|
99
99
|
const sessionEnv = withoutCacheOverride(args.env);
|
|
100
100
|
|
|
101
101
|
// Respond as soon as the session is registered — BEFORE the backend starts.
|
|
102
|
-
// `backend.start()`
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
//
|
|
102
|
+
// `backend.start()` spans image pull and workload bring-up, which can take
|
|
103
|
+
// seconds-to-minutes; awaiting it here would hide the event stream until the
|
|
104
|
+
// workload is already up, so the client never sees provision / boot progress
|
|
105
|
+
// live. Returning the streamUrl first lets the client connect immediately;
|
|
106
|
+
// start runs in the background and its progress, output, and terminal status
|
|
107
|
+
// flow over the stream.
|
|
108
108
|
reply.code(201).send({
|
|
109
109
|
sessionId,
|
|
110
110
|
streamUrl: `/v1/sessions/${sessionId}/events`,
|
|
@@ -185,6 +185,8 @@ export function launchWorkload(
|
|
|
185
185
|
}),
|
|
186
186
|
onReachability: (app, port, state) =>
|
|
187
187
|
deps.registry.emit(sessionId, { type: "reachability", app, port, state }),
|
|
188
|
+
onRoute: (app, route) =>
|
|
189
|
+
deps.registry.emit(sessionId, { type: "route", ...(app ? { app } : {}), ...route }),
|
|
188
190
|
onEndpoints: (appName, change) => {
|
|
189
191
|
// The registry's own channel is what `GET /v1/sessions/:id` reports, so
|
|
190
192
|
// the delta has to land there too — otherwise the session document keeps
|
|
@@ -206,7 +208,7 @@ export function launchWorkload(
|
|
|
206
208
|
.then(async (session) => {
|
|
207
209
|
entry.session = session;
|
|
208
210
|
// Pre-start DELETE race: a DELETE received during backend.start (e.g.
|
|
209
|
-
// while
|
|
211
|
+
// while the image was still pulling) can't stop a workload that didn't
|
|
210
212
|
// exist yet — it set userStopped and returned 204. Now that the workload
|
|
211
213
|
// is live, honor the earlier DELETE.
|
|
212
214
|
if (entry.userStopped) {
|
package/dist/dependency-key.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { RunBundle } from "./contract.js";
|
|
2
|
-
/**
|
|
3
|
-
* The inputs that determine a session's baked dependency layer — everything
|
|
4
|
-
* `telo install` would resolve into `.telo/{manifests,npm}`, and nothing about
|
|
5
|
-
* resource bodies or CEL. A backend that prebuilds a per-app image keys the
|
|
6
|
-
* image tag on this so a body-only edit reuses the image while an import or
|
|
7
|
-
* controller change rebuilds it.
|
|
8
|
-
*
|
|
9
|
-
* Derived by a SHALLOW static parse of the in-memory bundle — no graph load, no
|
|
10
|
-
* network, no archive. Exact import versions pin the transitive closure, so the
|
|
11
|
-
* authored `imports:` + body-declared controllers are sufficient.
|
|
12
|
-
*
|
|
13
|
-
* Assumes every file in the bundle is reachable from the entry (true for
|
|
14
|
-
* editor / control-plane-produced bundles, which carry exactly the app's
|
|
15
|
-
* files). It scans ALL `Telo.Definition` docs rather than following the entry's
|
|
16
|
-
* include/import graph — cheaper, and erring toward over-inclusion only ever
|
|
17
|
-
* busts the cache more eagerly. The one unsound case is a bundle carrying an
|
|
18
|
-
* orphan controller-bearing Definition that `telo install` would NOT bake (not
|
|
19
|
-
* reachable from this entry) yet another entry with the same closure WOULD: they
|
|
20
|
-
* could share a tag whose image lacks that controller. Not reachable via the
|
|
21
|
-
* editor; revisit (anchor to the include graph) if bundles ever carry unreachable
|
|
22
|
-
* Definition files.
|
|
23
|
-
*/
|
|
24
|
-
export interface DependencyKey {
|
|
25
|
-
/** Sorted `imports:` source strings from every module doc. */
|
|
26
|
-
importSources: string[];
|
|
27
|
-
/** Sorted controller PURLs declared by inline `Telo.Definition` docs. */
|
|
28
|
-
controllerLocators: string[];
|
|
29
|
-
/**
|
|
30
|
-
* True when a `Telo.Definition` resolves its controller from bundle-local
|
|
31
|
-
* source (`local_path`), or a file failed to parse. In either case the dep
|
|
32
|
-
* key alone can't capture a controller change, so the caller MUST also fold
|
|
33
|
-
* the full bundle contents into the tag (safe fallback to content-keying).
|
|
34
|
-
*/
|
|
35
|
-
fullContentFallback: boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare function extractDependencyKey(bundle: RunBundle): DependencyKey;
|
|
38
|
-
//# sourceMappingURL=dependency-key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-key.d.ts","sourceRoot":"","sources":["../src/dependency-key.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAgBD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,aAAa,CAkDrE"}
|
package/dist/dependency-key.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { parseAllDocuments } from "yaml";
|
|
2
|
-
function asModuleKind(kind) {
|
|
3
|
-
return kind === "Telo.Application" || kind === "Telo.Library";
|
|
4
|
-
}
|
|
5
|
-
/** Pull `{ source }` out of an `imports:` map value (bare string or object). */
|
|
6
|
-
function importSourceOf(value) {
|
|
7
|
-
if (typeof value === "string")
|
|
8
|
-
return value;
|
|
9
|
-
if (value && typeof value === "object") {
|
|
10
|
-
const source = value.source;
|
|
11
|
-
if (typeof source === "string")
|
|
12
|
-
return source;
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
export function extractDependencyKey(bundle) {
|
|
17
|
-
const importSources = new Set();
|
|
18
|
-
const controllerLocators = new Set();
|
|
19
|
-
let fullContentFallback = false;
|
|
20
|
-
for (const file of bundle.files) {
|
|
21
|
-
let docs;
|
|
22
|
-
try {
|
|
23
|
-
docs = parseAllDocuments(file.contents);
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
// Unparseable file — we can't know what it declares, so fall back to
|
|
27
|
-
// hashing the whole bundle rather than risk an under-specified key.
|
|
28
|
-
fullContentFallback = true;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
for (const doc of docs) {
|
|
32
|
-
if (doc.errors.length > 0) {
|
|
33
|
-
fullContentFallback = true;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const value = doc.toJS();
|
|
37
|
-
if (!value || typeof value !== "object")
|
|
38
|
-
continue;
|
|
39
|
-
const kind = value.kind;
|
|
40
|
-
if (asModuleKind(kind) && value.imports && typeof value.imports === "object") {
|
|
41
|
-
for (const entry of Object.values(value.imports)) {
|
|
42
|
-
const source = importSourceOf(entry);
|
|
43
|
-
if (source)
|
|
44
|
-
importSources.add(source);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (kind === "Telo.Definition") {
|
|
48
|
-
const controllers = value.controllers;
|
|
49
|
-
if (Array.isArray(controllers)) {
|
|
50
|
-
for (const c of controllers) {
|
|
51
|
-
if (typeof c === "string")
|
|
52
|
-
controllerLocators.add(c);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// A bundle-local controller's source lives in the body; the PURL/path
|
|
56
|
-
// can't capture an edit to it, so force full-content keying.
|
|
57
|
-
if (typeof value.local_path === "string")
|
|
58
|
-
fullContentFallback = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
importSources: [...importSources].sort(),
|
|
64
|
-
controllerLocators: [...controllerLocators].sort(),
|
|
65
|
-
fullContentFallback,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=dependency-key.js.map
|
|
@@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|
-
import type { RunBundle } from "./contract.js";
|
|
4
|
-
import { extractDependencyKey } from "./dependency-key.js";
|
|
5
|
-
|
|
6
|
-
function bundle(manifest: string, extra: RunBundle["files"] = []): RunBundle {
|
|
7
|
-
return {
|
|
8
|
-
entryRelativePath: "manifest.yaml",
|
|
9
|
-
files: [{ relativePath: "manifest.yaml", contents: manifest }, ...extra],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const APP = [
|
|
14
|
-
"kind: Telo.Application",
|
|
15
|
-
"metadata:",
|
|
16
|
-
" name: app",
|
|
17
|
-
"imports:",
|
|
18
|
-
" Console: std/console@0.9.0",
|
|
19
|
-
" Http: std/http-server@1.2.0",
|
|
20
|
-
"---",
|
|
21
|
-
"kind: Telo.Definition",
|
|
22
|
-
"metadata:",
|
|
23
|
-
" name: Thing",
|
|
24
|
-
"controllers:",
|
|
25
|
-
" - pkg:npm/@acme/thing@1.0.0",
|
|
26
|
-
"",
|
|
27
|
-
].join("\n");
|
|
28
|
-
|
|
29
|
-
describe("extractDependencyKey", () => {
|
|
30
|
-
it("collects imports and body-declared controllers, sorted", () => {
|
|
31
|
-
const key = extractDependencyKey(bundle(APP));
|
|
32
|
-
expect(key.importSources).toEqual(["std/console@0.9.0", "std/http-server@1.2.0"]);
|
|
33
|
-
expect(key.controllerLocators).toEqual(["pkg:npm/@acme/thing@1.0.0"]);
|
|
34
|
-
expect(key.fullContentFallback).toBe(false);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("reads the object form of an import entry", () => {
|
|
38
|
-
const m = APP.replace(
|
|
39
|
-
" Console: std/console@0.9.0",
|
|
40
|
-
" Console:\n source: std/console@0.9.0\n variables: { level: info }",
|
|
41
|
-
);
|
|
42
|
-
expect(extractDependencyKey(bundle(m)).importSources).toContain("std/console@0.9.0");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("flags local_path controllers for full-content fallback", () => {
|
|
46
|
-
const m = APP.replace(
|
|
47
|
-
" - pkg:npm/@acme/thing@1.0.0",
|
|
48
|
-
" - pkg:npm/@acme/thing@1.0.0\nlocal_path: ./thing",
|
|
49
|
-
);
|
|
50
|
-
expect(extractDependencyKey(bundle(m)).fullContentFallback).toBe(true);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("flags an unparseable file for full-content fallback", () => {
|
|
54
|
-
const key = extractDependencyKey(bundle(APP, [{ relativePath: "broken.yaml", contents: "a: b: c: :\n - [" }]));
|
|
55
|
-
expect(key.fullContentFallback).toBe(true);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("returns empty sets for a manifest with no imports or controllers", () => {
|
|
59
|
-
const key = extractDependencyKey(bundle("kind: Telo.Application\nmetadata:\n name: bare\n"));
|
|
60
|
-
expect(key.importSources).toEqual([]);
|
|
61
|
-
expect(key.controllerLocators).toEqual([]);
|
|
62
|
-
expect(key.fullContentFallback).toBe(false);
|
|
63
|
-
});
|
|
64
|
-
});
|
package/src/dependency-key.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { parseAllDocuments } from "yaml";
|
|
2
|
-
|
|
3
|
-
import type { RunBundle } from "./contract.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The inputs that determine a session's baked dependency layer — everything
|
|
7
|
-
* `telo install` would resolve into `.telo/{manifests,npm}`, and nothing about
|
|
8
|
-
* resource bodies or CEL. A backend that prebuilds a per-app image keys the
|
|
9
|
-
* image tag on this so a body-only edit reuses the image while an import or
|
|
10
|
-
* controller change rebuilds it.
|
|
11
|
-
*
|
|
12
|
-
* Derived by a SHALLOW static parse of the in-memory bundle — no graph load, no
|
|
13
|
-
* network, no archive. Exact import versions pin the transitive closure, so the
|
|
14
|
-
* authored `imports:` + body-declared controllers are sufficient.
|
|
15
|
-
*
|
|
16
|
-
* Assumes every file in the bundle is reachable from the entry (true for
|
|
17
|
-
* editor / control-plane-produced bundles, which carry exactly the app's
|
|
18
|
-
* files). It scans ALL `Telo.Definition` docs rather than following the entry's
|
|
19
|
-
* include/import graph — cheaper, and erring toward over-inclusion only ever
|
|
20
|
-
* busts the cache more eagerly. The one unsound case is a bundle carrying an
|
|
21
|
-
* orphan controller-bearing Definition that `telo install` would NOT bake (not
|
|
22
|
-
* reachable from this entry) yet another entry with the same closure WOULD: they
|
|
23
|
-
* could share a tag whose image lacks that controller. Not reachable via the
|
|
24
|
-
* editor; revisit (anchor to the include graph) if bundles ever carry unreachable
|
|
25
|
-
* Definition files.
|
|
26
|
-
*/
|
|
27
|
-
export interface DependencyKey {
|
|
28
|
-
/** Sorted `imports:` source strings from every module doc. */
|
|
29
|
-
importSources: string[];
|
|
30
|
-
/** Sorted controller PURLs declared by inline `Telo.Definition` docs. */
|
|
31
|
-
controllerLocators: string[];
|
|
32
|
-
/**
|
|
33
|
-
* True when a `Telo.Definition` resolves its controller from bundle-local
|
|
34
|
-
* source (`local_path`), or a file failed to parse. In either case the dep
|
|
35
|
-
* key alone can't capture a controller change, so the caller MUST also fold
|
|
36
|
-
* the full bundle contents into the tag (safe fallback to content-keying).
|
|
37
|
-
*/
|
|
38
|
-
fullContentFallback: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function asModuleKind(kind: unknown): boolean {
|
|
42
|
-
return kind === "Telo.Application" || kind === "Telo.Library";
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Pull `{ source }` out of an `imports:` map value (bare string or object). */
|
|
46
|
-
function importSourceOf(value: unknown): string | undefined {
|
|
47
|
-
if (typeof value === "string") return value;
|
|
48
|
-
if (value && typeof value === "object") {
|
|
49
|
-
const source = (value as { source?: unknown }).source;
|
|
50
|
-
if (typeof source === "string") return source;
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function extractDependencyKey(bundle: RunBundle): DependencyKey {
|
|
56
|
-
const importSources = new Set<string>();
|
|
57
|
-
const controllerLocators = new Set<string>();
|
|
58
|
-
let fullContentFallback = false;
|
|
59
|
-
|
|
60
|
-
for (const file of bundle.files) {
|
|
61
|
-
let docs;
|
|
62
|
-
try {
|
|
63
|
-
docs = parseAllDocuments(file.contents);
|
|
64
|
-
} catch {
|
|
65
|
-
// Unparseable file — we can't know what it declares, so fall back to
|
|
66
|
-
// hashing the whole bundle rather than risk an under-specified key.
|
|
67
|
-
fullContentFallback = true;
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
for (const doc of docs) {
|
|
71
|
-
if (doc.errors.length > 0) {
|
|
72
|
-
fullContentFallback = true;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
const value = doc.toJS() as Record<string, unknown> | null;
|
|
76
|
-
if (!value || typeof value !== "object") continue;
|
|
77
|
-
const kind = value.kind;
|
|
78
|
-
|
|
79
|
-
if (asModuleKind(kind) && value.imports && typeof value.imports === "object") {
|
|
80
|
-
for (const entry of Object.values(value.imports as Record<string, unknown>)) {
|
|
81
|
-
const source = importSourceOf(entry);
|
|
82
|
-
if (source) importSources.add(source);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (kind === "Telo.Definition") {
|
|
87
|
-
const controllers = value.controllers;
|
|
88
|
-
if (Array.isArray(controllers)) {
|
|
89
|
-
for (const c of controllers) {
|
|
90
|
-
if (typeof c === "string") controllerLocators.add(c);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// A bundle-local controller's source lives in the body; the PURL/path
|
|
94
|
-
// can't capture an edit to it, so force full-content keying.
|
|
95
|
-
if (typeof value.local_path === "string") fullContentFallback = true;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return {
|
|
101
|
-
importSources: [...importSources].sort(),
|
|
102
|
-
controllerLocators: [...controllerLocators].sort(),
|
|
103
|
-
fullContentFallback,
|
|
104
|
-
};
|
|
105
|
-
}
|