@deslop/deploy 0.1.1317 → 0.1.1326
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/README.md +1 -1
- package/dist/server.js +69 -124
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ npm install --global @deslop/deploy
|
|
|
7
7
|
deploy service install --domain mp281x.xyz --workers desktop,macbook-pro
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
- **`--workers`** lists Tailscale machine names. Deploy derives each HTTPS URL from the tailnet's MagicDNS suffix and its package port
|
|
10
|
+
- **`--workers`** lists Tailscale machine names. Deploy derives each HTTPS URL from the tailnet's MagicDNS suffix and its package port. Auth identifies peers by their tailnet owner; local commands require an admin.
|
|
11
11
|
- **Platforms.** Linux x64 and macOS arm64. Public exposure runs the bundled Caddy, a Linux x64 build, so a Mac exposes ports to the tailnet only; its apps are its `deslop-*` launch agents, measured without per-app history.
|
|
12
12
|
|
|
13
13
|
Common flags and service commands: [Deslop app runtime](https://github.com/MP281X/deslop/blob/main/packages/runtime/README.md).
|
package/dist/server.js
CHANGED
|
@@ -10986,8 +10986,6 @@ const succeedSome$1 = (a) => succeed$9(some$1(a));
|
|
|
10986
10986
|
/** @internal */
|
|
10987
10987
|
const succeedNone$1 = /*#__PURE__*/ succeed$9(/*#__PURE__*/ none());
|
|
10988
10988
|
/** @internal */
|
|
10989
|
-
const transposeOption$1 = (self) => isNone(self) ? succeedNone$1 : map$9(self.value, some$1);
|
|
10990
|
-
/** @internal */
|
|
10991
10989
|
const failCauseSync$1 = (evaluate) => suspend$4(() => failCause$6(evaluate()));
|
|
10992
10990
|
/** @internal */
|
|
10993
10991
|
const die$5 = (defect) => exitDie(defect);
|
|
@@ -19310,39 +19308,6 @@ const fromResult = fromResult$1;
|
|
|
19310
19308
|
*/
|
|
19311
19309
|
const fromOption = fromOption$1;
|
|
19312
19310
|
/**
|
|
19313
|
-
* Converts an `Option` of an `Effect` into an `Effect` of an `Option`.
|
|
19314
|
-
*
|
|
19315
|
-
* **When to use**
|
|
19316
|
-
*
|
|
19317
|
-
* Use when an effect should run only when an optional value is present, while
|
|
19318
|
-
* preserving absence as a successful `None`.
|
|
19319
|
-
*
|
|
19320
|
-
* **Details**
|
|
19321
|
-
*
|
|
19322
|
-
* - `None` becomes an effect that succeeds with `None`
|
|
19323
|
-
* - `Some(effect)` runs the inner effect and wraps its success value in `Some`
|
|
19324
|
-
* - Inner failures are preserved in the resulting effect
|
|
19325
|
-
*
|
|
19326
|
-
* **Example** (Transposing an Option of an Effect)
|
|
19327
|
-
*
|
|
19328
|
-
* ```ts import.meta.vitest
|
|
19329
|
-
* import { Effect, Option } from "effect"
|
|
19330
|
-
*
|
|
19331
|
-
* const some = Option.some(Effect.succeed(42))
|
|
19332
|
-
*
|
|
19333
|
-
* // ┌─── Effect<Option<number>, never, never>
|
|
19334
|
-
* // ▼
|
|
19335
|
-
* const program = Effect.transposeOption(some)
|
|
19336
|
-
*
|
|
19337
|
-
* Effect.runSync(program) // => Option.some(42)
|
|
19338
|
-
* ```
|
|
19339
|
-
*
|
|
19340
|
-
* @stability stable
|
|
19341
|
-
* @category converting
|
|
19342
|
-
* @since 3.13.0
|
|
19343
|
-
*/
|
|
19344
|
-
const transposeOption = transposeOption$1;
|
|
19345
|
-
/**
|
|
19346
19311
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
19347
19312
|
* operations that depend on previous results.
|
|
19348
19313
|
*
|
|
@@ -42355,7 +42320,7 @@ function OptionFromOptional(schema) {
|
|
|
42355
42320
|
* @category schemas
|
|
42356
42321
|
* @since 3.10.0
|
|
42357
42322
|
*/
|
|
42358
|
-
function Redacted
|
|
42323
|
+
function Redacted(value, options) {
|
|
42359
42324
|
const label = typeof options?.label === "string" ? options.label : void 0;
|
|
42360
42325
|
const disallowJsonEncode = options?.disallowJsonEncode === true;
|
|
42361
42326
|
const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
|
|
@@ -51833,46 +51798,6 @@ function Record(key, value, pathOrOptions, options) {
|
|
|
51833
51798
|
function Port$1(name) {
|
|
51834
51799
|
return schema$1(PortSchema, name);
|
|
51835
51800
|
}
|
|
51836
|
-
/**
|
|
51837
|
-
* Creates a config for a redacted string value. The parsed result is wrapped
|
|
51838
|
-
* in a `Redacted` container that hides the value from logs and `toString`.
|
|
51839
|
-
*
|
|
51840
|
-
* **When to use**
|
|
51841
|
-
*
|
|
51842
|
-
* Use to read secret string settings that should not be exposed in logs or
|
|
51843
|
-
* string output.
|
|
51844
|
-
*
|
|
51845
|
-
* **Details**
|
|
51846
|
-
*
|
|
51847
|
-
* Shortcut for `Config.schema(Schema.Redacted(Schema.String), name)`.
|
|
51848
|
-
*
|
|
51849
|
-
* **Example** (Reading a secret)
|
|
51850
|
-
*
|
|
51851
|
-
* ```ts import.meta.vitest
|
|
51852
|
-
* import { Config, ConfigProvider, Effect } from "effect"
|
|
51853
|
-
*
|
|
51854
|
-
* const program = Config.Redacted("API_KEY").pipe(Effect.map(String))
|
|
51855
|
-
*
|
|
51856
|
-
* const provider = ConfigProvider.fromEnv({
|
|
51857
|
-
* env: {
|
|
51858
|
-
* API_KEY: "sk-1234567890abcdef"
|
|
51859
|
-
* }
|
|
51860
|
-
* })
|
|
51861
|
-
*
|
|
51862
|
-
* Effect.runSync(
|
|
51863
|
-
* program.pipe(Effect.provideService(ConfigProvider.ConfigProvider, provider))
|
|
51864
|
-
* ) // => "<redacted>"
|
|
51865
|
-
* ```
|
|
51866
|
-
*
|
|
51867
|
-
* @see {@link String} for non-secret string settings
|
|
51868
|
-
*
|
|
51869
|
-
* @stability stable
|
|
51870
|
-
* @category constructors
|
|
51871
|
-
* @since 2.0.0
|
|
51872
|
-
*/
|
|
51873
|
-
function Redacted(name) {
|
|
51874
|
-
return schema$1(Redacted$1(String$6), name);
|
|
51875
|
-
}
|
|
51876
51801
|
// ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/Console.js
|
|
51877
51802
|
/**
|
|
51878
51803
|
* Context reference for the current console service in the Effect system, allowing access to the active console implementation from within the Effect context.
|
|
@@ -58551,7 +58476,7 @@ const TypeId$22 = "~effect/http/HttpIncomingMessage";
|
|
|
58551
58476
|
* @category schemas
|
|
58552
58477
|
* @since 4.0.0
|
|
58553
58478
|
*/
|
|
58554
|
-
const schemaBodyJson = (schema, options) => {
|
|
58479
|
+
const schemaBodyJson$1 = (schema, options) => {
|
|
58555
58480
|
const decode = decodeEffect(toCodecJson(schema));
|
|
58556
58481
|
const decodeJson = options?.reviver === void 0 ? void 0 : decodeEffect(fromJsonString(toCodecJson(schema), options));
|
|
58557
58482
|
return (self) => decodeJson === void 0 ? flatMap$3(self.json, (u) => decode(u, options)) : flatMap$3(self.text, (body) => body === "" ? flatMap$3(self.json, (u) => decode(u, options)) : decodeJson(body, options));
|
|
@@ -61436,6 +61361,22 @@ const HttpServerRequest = /*#__PURE__*/ Service$1("effect/http/HttpServerRequest
|
|
|
61436
61361
|
*/
|
|
61437
61362
|
var ParsedSearchParams = class extends (/*#__PURE__*/ Service$1()("effect/http/ParsedSearchParams")) {};
|
|
61438
61363
|
/**
|
|
61364
|
+
* Reads the current request body as JSON and decodes it with the supplied schema.
|
|
61365
|
+
*
|
|
61366
|
+
* **Details**
|
|
61367
|
+
*
|
|
61368
|
+
* The effect can fail if the body cannot be read or parsed, or if schema decoding
|
|
61369
|
+
* fails.
|
|
61370
|
+
*
|
|
61371
|
+
* @stability unstable
|
|
61372
|
+
* @category schemas
|
|
61373
|
+
* @since 4.0.0
|
|
61374
|
+
*/
|
|
61375
|
+
const schemaBodyJson = (schema, options) => {
|
|
61376
|
+
const parse = schemaBodyJson$1(schema, options);
|
|
61377
|
+
return flatMap$3(HttpServerRequest, parse);
|
|
61378
|
+
};
|
|
61379
|
+
/**
|
|
61439
61380
|
* Attempts to construct an absolute `URL` for a server request safely.
|
|
61440
61381
|
*
|
|
61441
61382
|
* **Details**
|
|
@@ -63441,7 +63382,7 @@ var Retry = class Retry extends (/*#__PURE__*/ TaggedClass("Retry")) {
|
|
|
63441
63382
|
*/
|
|
63442
63383
|
const HttpResponseDetails$1 = /*#__PURE__*/ Struct$2({
|
|
63443
63384
|
status: Int$1,
|
|
63444
|
-
headers: Record$1(String$6, Union$2([String$6, Redacted
|
|
63385
|
+
headers: Record$1(String$6, Union$2([String$6, Redacted(String$6)]))
|
|
63445
63386
|
}).annotate({ identifier: "HttpResponseDetails" });
|
|
63446
63387
|
const ReasonTypeId = "~effect/ai/AiError/Reason";
|
|
63447
63388
|
const providerMetadataWithDefaults = () => ProviderMetadata$1.pipe(withConstructorDefault(succeed$5({})), withDecodingDefault(succeed$5({})));
|
|
@@ -103792,8 +103733,8 @@ const make$8 = (httpClient, options = {}) => {
|
|
|
103792
103733
|
const executeStreamRequest = (request) => suspend$3(() => options.transformClient ? flatMap$3(options.transformClient(httpClient), (client) => filterStatusOk(client).execute(request)) : filterStatusOk(httpClient).execute(request));
|
|
103793
103734
|
const decodeBinary = (response) => map$7(response.arrayBuffer, (buffer) => new Uint8Array(buffer));
|
|
103794
103735
|
const binaryRequest = (request) => executeStreamRequest(request).pipe(map$7((response) => response.stream), unwrap$4);
|
|
103795
|
-
const decodeSuccess = (schema) => (response) => schemaBodyJson(schema)(response);
|
|
103796
|
-
const decodeError = (tag, schema) => (response) => flatMap$3(schemaBodyJson(schema)(response), (cause) => fail$6(AnthropicClientError(tag, cause, response)));
|
|
103736
|
+
const decodeSuccess = (schema) => (response) => schemaBodyJson$1(schema)(response);
|
|
103737
|
+
const decodeError = (tag, schema) => (response) => flatMap$3(schemaBodyJson$1(schema)(response), (cause) => fail$6(AnthropicClientError(tag, cause, response)));
|
|
103797
103738
|
return {
|
|
103798
103739
|
httpClient,
|
|
103799
103740
|
"messagesPost": (options) => post("/v1/messages").pipe(setHeaders$1({
|
|
@@ -106902,6 +106843,13 @@ const PackageMetadata = Struct$2({
|
|
|
106902
106843
|
});
|
|
106903
106844
|
// ../../packages/runtime/src/server/auth.ts
|
|
106904
106845
|
const localAuth = map$3(option(String$5("AUTH_URL")), isNone);
|
|
106846
|
+
function requireAdmin(user, message) {
|
|
106847
|
+
if (user.admin) return void_$2;
|
|
106848
|
+
return fail$6(AuthError.make({
|
|
106849
|
+
error: "access_denied",
|
|
106850
|
+
message
|
|
106851
|
+
}));
|
|
106852
|
+
}
|
|
106905
106853
|
function identifyRequestOf(headers) {
|
|
106906
106854
|
return IdentifyRequest.make({
|
|
106907
106855
|
address: fromNullishOr$1(headers[CLIENT_HEADER]),
|
|
@@ -106951,7 +106899,7 @@ var Auth = class Auth extends Service$1()("@deslop/runtime/server/auth") {
|
|
|
106951
106899
|
const answers = yield* makeWith$2(fnUntraced(function* (body) {
|
|
106952
106900
|
const response = yield* pipe(post(new URL(IDENTIFY_PATH, issuer).href), bodyText(body, "application/json"), client.execute, timeout("10 seconds"));
|
|
106953
106901
|
if (response.status === 401 || response.status === 403) return yield* refusalOf(response.status, getOrElse$1(yield* option$1(response.text), constant("Sign in first")));
|
|
106954
|
-
return yield* schemaBodyJson(Account)(yield* filterStatusOk$1(response));
|
|
106902
|
+
return yield* schemaBodyJson$1(Account)(yield* filterStatusOk$1(response));
|
|
106955
106903
|
}, asAuthError("The authorization service is temporarily unavailable")), {
|
|
106956
106904
|
capacity: 1024,
|
|
106957
106905
|
timeToLive: match$3({
|
|
@@ -106994,7 +106942,7 @@ var AiGateway = class AiGateway extends Service$1()("@deslop/runtime/server/ai/A
|
|
|
106994
106942
|
});
|
|
106995
106943
|
const gateway = yield* AiGateway;
|
|
106996
106944
|
const client = yield* make$7({
|
|
106997
|
-
apiUrl: `${yield* gateway.apiUrl}/
|
|
106945
|
+
apiUrl: `${yield* gateway.apiUrl}/anthropic`,
|
|
106998
106946
|
transformClient: yield* gateway.authorize(userId)
|
|
106999
106947
|
});
|
|
107000
106948
|
return yield* provideService$2(make$6({
|
|
@@ -107024,6 +106972,13 @@ var AiGateway = class AiGateway extends Service$1()("@deslop/runtime/server/ai/A
|
|
|
107024
106972
|
}));
|
|
107025
106973
|
};
|
|
107026
106974
|
// ../../packages/runtime/src/server/mcp.ts
|
|
106975
|
+
const McpStream = middleware()((app) => gen(function* () {
|
|
106976
|
+
if ((yield* HttpServerRequest).method === "POST") {
|
|
106977
|
+
const subscription = yield* option$1(schemaBodyJson(Struct$2({ method: Literal("subscriptions/listen") })));
|
|
106978
|
+
if (isSome(subscription)) yield* annotateCurrentSpan("rpc.stream", true);
|
|
106979
|
+
}
|
|
106980
|
+
return yield* app;
|
|
106981
|
+
}));
|
|
107027
106982
|
const layerStructuredTools = effect(McpServer, gen(function* () {
|
|
107028
106983
|
const registry = yield* McpServer;
|
|
107029
106984
|
return McpServer.of({
|
|
@@ -107901,7 +107856,7 @@ function layerMcp(options) {
|
|
|
107901
107856
|
],
|
|
107902
107857
|
registrations: provide$2(options.registrations, layerStructuredTools),
|
|
107903
107858
|
version: metadata.version
|
|
107904
|
-
}), HttpAuth.layer);
|
|
107859
|
+
}), merge$4(HttpAuth.layer, McpStream.layer));
|
|
107905
107860
|
}));
|
|
107906
107861
|
}
|
|
107907
107862
|
const layerNodeHttpServer = layerConfig(createServer, {
|
|
@@ -108405,7 +108360,7 @@ const updateRelease = fnUntraced(function* (name) {
|
|
|
108405
108360
|
const path = yield* Path$1;
|
|
108406
108361
|
const root = yield* serviceDirectory(name);
|
|
108407
108362
|
const running = (yield* decodeEffect(fromJsonString(Struct$2({ version: AppVersion })))(yield* fs.readFileString(path.join(root, "current", "package.json")))).version;
|
|
108408
|
-
const latest = (yield* pipe(filterStatusOk(yield* HttpClient).get(`https://registry.npmjs.org/@deslop%2f${name}/latest`), flatMap$3(schemaBodyJson(Struct$2({ version: AppVersion }))), timeout("15 seconds"))).version;
|
|
108363
|
+
const latest = (yield* pipe(filterStatusOk(yield* HttpClient).get(`https://registry.npmjs.org/@deslop%2f${name}/latest`), flatMap$3(schemaBodyJson$1(Struct$2({ version: AppVersion }))), timeout("15 seconds"))).version;
|
|
108409
108364
|
if (latest === running) return `${name} ${running} is current\n`;
|
|
108410
108365
|
const npm = path.resolve(path.dirname(execPath), "../lib/node_modules/npm/bin/npm-cli.js");
|
|
108411
108366
|
if (!(yield* fs.exists(npm))) return yield* AppError.make({ message: "This Node runtime does not include npm; install Node with Vite+" });
|
|
@@ -108432,6 +108387,7 @@ const updateRelease = fnUntraced(function* (name) {
|
|
|
108432
108387
|
});
|
|
108433
108388
|
// ../../packages/runtime/src/server/cli.ts
|
|
108434
108389
|
const DEFAULT_HOST = "127.0.0.1";
|
|
108390
|
+
const TailnetSelf = Struct$2({ Self: Struct$2({ DNSName: String$6 }) });
|
|
108435
108391
|
const SETTINGS = {
|
|
108436
108392
|
DOMAIN: {
|
|
108437
108393
|
description: "Parent domain for Deslop apps; without it every caller is the developer",
|
|
@@ -108447,8 +108403,12 @@ const SETTINGS = {
|
|
|
108447
108403
|
const configProvider = fnUntraced(function* (given, defaultPort) {
|
|
108448
108404
|
const port = given["PORT"] ?? `${defaultPort}`;
|
|
108449
108405
|
const name = yield* appName;
|
|
108406
|
+
const tailnet = yield* pipe(executeProcess("tailscale", ["status", "--json"]), flatMap$3(decodeUnknownEffect(fromJsonString(TailnetSelf))), map$7((status) => replace(/\.$/u, "")(status.Self.DNSName)), timeout("5 seconds"), option$1);
|
|
108450
108407
|
const urls = match$8(fromUndefinedOr(given["DOMAIN"]), {
|
|
108451
|
-
onNone: () => ({ APP_URL:
|
|
108408
|
+
onNone: () => ({ APP_URL: pipe(tailnet, filter$7(isNonEmpty$1), match$8({
|
|
108409
|
+
onNone: () => `http://localhost:${port}`,
|
|
108410
|
+
onSome: (host) => `https://${host}:${port}`
|
|
108411
|
+
})) }),
|
|
108452
108412
|
onSome: (domain) => ({
|
|
108453
108413
|
APP_URL: `https://${name}.${domain}`,
|
|
108454
108414
|
AUTH_URL: `https://auth.${domain}`,
|
|
@@ -111103,32 +111063,13 @@ var Metrics = class extends Service$1()("@deslop/deploy/services/metrics/service
|
|
|
111103
111063
|
static layer = provide$2(effect(this, this.make), this.migrations);
|
|
111104
111064
|
};
|
|
111105
111065
|
// src/services/fleet/service.ts
|
|
111106
|
-
const PEER = {
|
|
111107
|
-
admin: false,
|
|
111108
|
-
id: UserId.make("deploy:peer"),
|
|
111109
|
-
name: "deploy"
|
|
111110
|
-
};
|
|
111111
111066
|
const makeRemoteClient = make$26(RpcContracts.middleware(RpcStream), { flatten: true });
|
|
111112
|
-
const layerPeerAuth =
|
|
111067
|
+
const layerPeerAuth = effect(PeerRpcAuth, gen(function* () {
|
|
111113
111068
|
const auth = yield* Auth;
|
|
111114
|
-
|
|
111115
|
-
|
|
111116
|
-
return
|
|
111117
|
-
}
|
|
111118
|
-
const expected = yield* transposeOption(map$13(yield* option(Redacted("DEPLOY_KEY")), (key) => hash(`Bearer ${value$2(key)}`)));
|
|
111119
|
-
function isPeer(headers) {
|
|
111120
|
-
return map$7(hash(headers["authorization"] ?? ""), (actual) => contains$2(expected, actual));
|
|
111121
|
-
}
|
|
111122
|
-
return add$2(Auth.makeContext(fnUntraced(function* (headers) {
|
|
111123
|
-
if (yield* isPeer(headers)) return {
|
|
111124
|
-
...PEER,
|
|
111125
|
-
signOut: false
|
|
111126
|
-
};
|
|
111127
|
-
return yield* auth.account(headers);
|
|
111128
|
-
})), PeerRpcAuth, PeerRpcAuth.of((effect, request) => flatMap$3(isPeer(request.headers), (allowed) => {
|
|
111129
|
-
if (allowed) return effect;
|
|
111130
|
-
return fail$6(AuthError.make({ message: "Only another Deploy worker may issue a local command" }));
|
|
111131
|
-
})));
|
|
111069
|
+
return PeerRpcAuth.of((effect, request) => gen(function* () {
|
|
111070
|
+
yield* requireAdmin(yield* auth.user(request.headers), "Only an admin may issue a local command");
|
|
111071
|
+
return yield* effect;
|
|
111072
|
+
}));
|
|
111132
111073
|
}));
|
|
111133
111074
|
function asDeployError(effect) {
|
|
111134
111075
|
return mapError$2(effect, (cause) => {
|
|
@@ -111174,18 +111115,21 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111174
111115
|
name,
|
|
111175
111116
|
url: `https://${name}.${suffix}:${port}`
|
|
111176
111117
|
}), { concurrency: 1 });
|
|
111177
|
-
const peerHeaders = match$8(yield* option(Redacted("DEPLOY_KEY")), {
|
|
111178
|
-
onNone: () => ({}),
|
|
111179
|
-
onSome: (key) => ({ authorization: `Bearer ${value$2(key)}` })
|
|
111180
|
-
});
|
|
111181
111118
|
const clients = yield* forEach$1(workers, (worker) => gen(function* () {
|
|
111119
|
+
const connected = yield* make$54(false);
|
|
111182
111120
|
const url = new URL(RPC_PATH, worker.url);
|
|
111183
111121
|
url.protocol = match(new URL(worker.url).protocol === "http:", {
|
|
111184
111122
|
onFalse: constant("wss:"),
|
|
111185
111123
|
onTrue: constant("ws:")
|
|
111186
111124
|
});
|
|
111187
|
-
const protocol = yield* build(pipe(layerProtocolSocket({ pingTimeout: seconds(15) }), provide$2(
|
|
111188
|
-
|
|
111125
|
+
const protocol = yield* build(pipe(layerProtocolSocket({ pingTimeout: seconds(15) }), provide$2(succeed$6(ConnectionHooks, {
|
|
111126
|
+
onConnect: set(connected, true),
|
|
111127
|
+
onDisconnect: set(connected, false)
|
|
111128
|
+
})), provide$2(layerWebSocket(url.href)), provide$2(layerSchemaBinary()), provideMerge(layerRpcStreamClient)));
|
|
111129
|
+
return [worker.name, {
|
|
111130
|
+
client: yield* provideContext$2(makeRemoteClient, protocol),
|
|
111131
|
+
connected
|
|
111132
|
+
}];
|
|
111189
111133
|
}), { concurrency: "unbounded" });
|
|
111190
111134
|
const peers = fromEntries(clients);
|
|
111191
111135
|
const previous = yield* make$54({});
|
|
@@ -111211,10 +111155,11 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111211
111155
|
workers: dedupe([...snapshot.workers, ...map$10(workers, (worker) => worker.name)])
|
|
111212
111156
|
};
|
|
111213
111157
|
}), "Fleet.local");
|
|
111214
|
-
const remote =
|
|
111215
|
-
|
|
111216
|
-
|
|
111217
|
-
|
|
111158
|
+
const remote = fnUntraced(function* (worker, use) {
|
|
111159
|
+
const peer = getOrThrow$1(get$12(peers, worker.name));
|
|
111160
|
+
if (!(yield* get$2(peer.connected))) return yield* DeployError.make({ message: "Worker is unreachable" });
|
|
111161
|
+
return yield* pipe(use(peer.client), timeout(seconds(15)), withSpan("Fleet.remote", { attributes: { worker: worker.name } }));
|
|
111162
|
+
});
|
|
111218
111163
|
function selectedWorker(target) {
|
|
111219
111164
|
return pipe(workers, findFirst((worker) => worker.name === target), fromOption, mapError$2((cause) => DeployError.make({
|
|
111220
111165
|
cause,
|
|
@@ -111252,7 +111197,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111252
111197
|
worker: input.worker
|
|
111253
111198
|
});
|
|
111254
111199
|
if (input.worker === localWorker) return yield* tap$2(exposures.expose(omit(input, ["worker"])), () => inventory.refresh);
|
|
111255
|
-
return yield* remote(yield* selectedWorker(input.worker), (client
|
|
111200
|
+
return yield* remote(yield* selectedWorker(input.worker), (client) => client("exposures.apply", omit(input, ["worker"])));
|
|
111256
111201
|
}, tap$2(() => reactivity.invalidate(["deployInventory"])), asDeployError),
|
|
111257
111202
|
hide: fn("Fleet.hide")(function* (input) {
|
|
111258
111203
|
yield* annotateCurrentSpan({
|
|
@@ -111260,7 +111205,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111260
111205
|
worker: input.worker
|
|
111261
111206
|
});
|
|
111262
111207
|
if (input.worker === localWorker) return yield* tap$2(exposures.hide(input.name), () => inventory.refresh);
|
|
111263
|
-
return yield* remote(yield* selectedWorker(input.worker), (client
|
|
111208
|
+
return yield* remote(yield* selectedWorker(input.worker), (client) => client("exposures.remove", { name: input.name }));
|
|
111264
111209
|
}, tap$2(() => reactivity.invalidate(["deployInventory"])), asDeployError),
|
|
111265
111210
|
history: fn("Fleet.history")(function* (query) {
|
|
111266
111211
|
yield* annotateCurrentSpan("minutes", toMinutes(query.minutes));
|
|
@@ -111272,7 +111217,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111272
111217
|
minutes: toMinutes(query.minutes),
|
|
111273
111218
|
workers: workers.length + 1
|
|
111274
111219
|
});
|
|
111275
|
-
return [yield* metrics.read(query), ...yield* forEach$1(workers, (worker) => pipe(remote(worker, (client
|
|
111220
|
+
return [yield* metrics.read(query), ...yield* forEach$1(workers, (worker) => pipe(remote(worker, (client) => client("metrics.history", query)), timeout(seconds(2)), map$7((value) => ({
|
|
111276
111221
|
...value,
|
|
111277
111222
|
worker: worker.name
|
|
111278
111223
|
})), tapError$3((cause) => logWarning("A worker history could not be read", cause)), catch_$2(fnUntraced(function* (cause) {
|
|
@@ -111290,7 +111235,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111290
111235
|
worker: input.worker
|
|
111291
111236
|
});
|
|
111292
111237
|
if (input.worker === localWorker) return yield* inventory.run(omit(input, ["worker"]));
|
|
111293
|
-
return yield* remote(yield* selectedWorker(input.worker), (client
|
|
111238
|
+
return yield* remote(yield* selectedWorker(input.worker), (client) => client("inventory.start", omit(input, ["worker"])));
|
|
111294
111239
|
}, tap$2(() => reactivity.invalidate(["deployInventory"])), mapError$2((cause) => {
|
|
111295
111240
|
if (is$2(DeployError)(cause)) return cause;
|
|
111296
111241
|
return DeployError.make({
|
|
@@ -111300,7 +111245,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
|
|
|
111300
111245
|
})),
|
|
111301
111246
|
snapshot: withSpan(gen(function* () {
|
|
111302
111247
|
const own = yield* local;
|
|
111303
|
-
const others = yield* forEach$1(workers, (worker) => pipe(remote(worker, (client
|
|
111248
|
+
const others = yield* forEach$1(workers, (worker) => pipe(remote(worker, (client) => client("inventory.snapshot", void 0)), timeout(seconds(2)), map$7((snapshot) => ({
|
|
111304
111249
|
...snapshot,
|
|
111305
111250
|
items: map$10(snapshot.items, (item) => ({
|
|
111306
111251
|
...item,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/deploy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1326",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/MP281X/deslop.git",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=26"
|
|
42
42
|
},
|
|
43
|
-
"fingerprint": "
|
|
43
|
+
"fingerprint": "6f273bc8fcb28eb4667d85b9581a4c9932b1db3246612b824c6b9406d23d189b"
|
|
44
44
|
}
|