@deslop/deploy 0.1.1267 → 0.1.1268

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.
Files changed (33) hide show
  1. package/dist/client/assets/(home)-CllRMHQ-.js +1 -0
  2. package/dist/client/assets/-expose-CfKGc7Gu.js +1 -0
  3. package/dist/client/assets/effect-B8IRCFNP.js +16 -0
  4. package/dist/client/assets/index-4tD2Ehhk.css +2 -0
  5. package/dist/client/assets/index-pk7d-Wmy.js +2 -0
  6. package/dist/client/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  7. package/dist/client/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  8. package/dist/client/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  9. package/dist/client/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  10. package/dist/client/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  11. package/dist/client/assets/route-Buz3wuJA.js +1 -0
  12. package/dist/client/assets/schema-D7z9iJBO.js +2 -0
  13. package/dist/client/index.html +4 -4
  14. package/dist/server.js +342 -57
  15. package/package.json +2 -2
  16. package/dist/client/assets/(home)-BRBR9qdq.js +0 -41
  17. package/dist/client/assets/-expose-Bh9ChY6U.js +0 -1
  18. package/dist/client/assets/effect-BYxovlWD.js +0 -16
  19. package/dist/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  20. package/dist/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  21. package/dist/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  22. package/dist/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  23. package/dist/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  24. package/dist/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  25. package/dist/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  26. package/dist/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  27. package/dist/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  28. package/dist/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  29. package/dist/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  30. package/dist/client/assets/index-CMMy8g5j.css +0 -2
  31. package/dist/client/assets/index-CUoncAk5.js +0 -2
  32. package/dist/client/assets/route-CavKqo_R.js +0 -1
  33. package/dist/client/assets/schema-Dt7oxOOd.js +0 -2
package/dist/server.js CHANGED
@@ -6664,6 +6664,26 @@ const isArrayNonEmpty = isArrayNonEmpty$1;
6664
6664
  */
6665
6665
  const isReadonlyArrayNonEmpty = isArrayNonEmpty$1;
6666
6666
  /**
6667
+ * Returns the number of elements in a `ReadonlyArray`.
6668
+ *
6669
+ * **When to use**
6670
+ *
6671
+ * Use when you need length as a composable function rather than a property access.
6672
+ *
6673
+ * **Example** (Getting the length)
6674
+ *
6675
+ * ```ts import.meta.vitest
6676
+ * import { Array } from "effect"
6677
+ *
6678
+ * Array.length([1, 2, 3]) // => 3
6679
+ * ```
6680
+ *
6681
+ * @stability stable
6682
+ * @category getters
6683
+ * @since 2.0.0
6684
+ */
6685
+ const length$2 = (self) => self.length;
6686
+ /**
6667
6687
  * Checks whether a string represents a JavaScript array index: a non-negative
6668
6688
  * integer below `2 ** 32 - 1`, written without leading zeroes, a sign, or
6669
6689
  * exponent notation.
@@ -6910,6 +6930,41 @@ const drop$1 = /*#__PURE__*/ dual(2, (self, n) => {
6910
6930
  return input.slice(clampCount(n, input.length), input.length);
6911
6931
  });
6912
6932
  /**
6933
+ * Drops elements from the start while the predicate holds, returning the rest.
6934
+ *
6935
+ * **When to use**
6936
+ *
6937
+ * Use to remove a leading prefix of elements that satisfy a predicate.
6938
+ *
6939
+ * **Details**
6940
+ *
6941
+ * The predicate receives `(element, index)`.
6942
+ *
6943
+ * **Example** (Dropping while condition holds)
6944
+ *
6945
+ * ```ts import.meta.vitest
6946
+ * import { Array } from "effect"
6947
+ *
6948
+ * Array.dropWhile([1, 2, 3, 4, 5], (x) => x < 4) // => [4, 5]
6949
+ * ```
6950
+ *
6951
+ * @see {@link takeWhile} — keep the matching prefix instead
6952
+ * @see {@link drop} — drop a fixed count
6953
+ *
6954
+ * @stability stable
6955
+ * @category getters
6956
+ * @since 2.0.0
6957
+ */
6958
+ const dropWhile = /*#__PURE__*/ dual(2, (self, predicate) => {
6959
+ const input = fromIterable$7(self);
6960
+ let i = 0;
6961
+ while (i < input.length) {
6962
+ if (!predicate(input[i], i)) break;
6963
+ i++;
6964
+ }
6965
+ return input.slice(i);
6966
+ });
6967
+ /**
6913
6968
  * Returns the index of the first element matching the predicate, wrapped in an
6914
6969
  * `Option`.
6915
6970
  *
@@ -14617,7 +14672,7 @@ const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
14617
14672
  * @category converting
14618
14673
  * @since 4.0.0
14619
14674
  */
14620
- const unwrap$7 = (self) => flatMap$3(effect(unwrapKey)(self), get$12(unwrapKey));
14675
+ const unwrap$8 = (self) => flatMap$3(effect(unwrapKey)(self), get$12(unwrapKey));
14621
14676
  const mergeAllEffect = (layers, memoMap, scope) => {
14622
14677
  const parentScope = forkUnsafe(scope, "parallel");
14623
14678
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$7((context) => mergeAll$2(...context)));
@@ -15946,6 +16001,22 @@ const slice$1 = (start, end) => (self) => self.slice(start, end);
15946
16001
  */
15947
16002
  const isNonEmpty$1 = (self) => self.length > 0;
15948
16003
  /**
16004
+ * Returns the JavaScript string length, measured in UTF-16 code units.
16005
+ *
16006
+ * **Example** (Getting string length)
16007
+ *
16008
+ * ```ts import.meta.vitest
16009
+ * import { String } from "effect"
16010
+ *
16011
+ * String.length("abc") // => 3
16012
+ * ```
16013
+ *
16014
+ * @stability stable
16015
+ * @category getters
16016
+ * @since 2.0.0
16017
+ */
16018
+ const length$1 = (self) => self.length;
16019
+ /**
15949
16020
  * Splits a string into an array of substrings using a separator.
15950
16021
  *
15951
16022
  * **Example** (Splitting strings)
@@ -30886,7 +30957,7 @@ const parseRetryAfter$1 = (input) => {
30886
30957
  const retryAfterDelay$1 = (self, now) => self._tag === "Duration" ? self.duration : millis$1(Math.max(0, toEpochMillis(self.dateTime) - now));
30887
30958
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/http/internal/urlParams.js
30888
30959
  /** @internal */
30889
- const unwrap$6 = (value) => typeof value === "string" ? value : value$2(value);
30960
+ const unwrap$7 = (value) => typeof value === "string" ? value : value$2(value);
30890
30961
  /** @internal */
30891
30962
  const stripSearchAndHash = (url) => {
30892
30963
  const queryIndex = url.indexOf("?");
@@ -31057,7 +31128,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
31057
31128
  * @category converting
31058
31129
  * @since 4.0.0
31059
31130
  */
31060
- const toString$1 = (input) => new URLSearchParams(fromInput(input).params.map(([key, value]) => [key, unwrap$6(value)])).toString();
31131
+ const toString$1 = (input) => new URLSearchParams(fromInput(input).params.map(([key, value]) => [key, unwrap$7(value)])).toString();
31061
31132
  /**
31062
31133
  * Returns the parameter pairs with selected values wrapped in `Redacted`.
31063
31134
  *
@@ -43483,7 +43554,7 @@ const fromQueueArray = (queue) => fromPull$1(succeed$5(takeAll(queue)));
43483
43554
  * @category constructors
43484
43555
  * @since 4.0.0
43485
43556
  */
43486
- const fromPubSubTake$1 = (pubsub) => unwrap$5(map$5(subscribe(pubsub), (sub) => fromEffectTake(take(sub))));
43557
+ const fromPubSubTake$1 = (pubsub) => unwrap$6(map$5(subscribe(pubsub), (sub) => fromEffectTake(take(sub))));
43487
43558
  /**
43488
43559
  * Creates a channel from a lazily supplied Web `ReadableStream`.
43489
43560
  *
@@ -44343,7 +44414,7 @@ const restoreUpstreamFailure = (effect) => catchCause$2(effect, (cause) => failC
44343
44414
  * @category constructors
44344
44415
  * @since 2.0.0
44345
44416
  */
44346
- const unwrap$5 = (channel) => fromTransform$1((upstream, scope) => {
44417
+ const unwrap$6 = (channel) => fromTransform$1((upstream, scope) => {
44347
44418
  let pull;
44348
44419
  return succeed$5(suspend$2(() => {
44349
44420
  if (pull) return pull;
@@ -45592,7 +45663,7 @@ const forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$2(
45592
45663
  * @category constructors
45593
45664
  * @since 2.0.0
45594
45665
  */
45595
- const unwrap$4 = (effect) => fromChannel$1(unwrap$5(map$5(effect, toChannel$1)));
45666
+ const unwrap$5 = (effect) => fromChannel$1(unwrap$6(map$5(effect, toChannel$1)));
45596
45667
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/RcMap.js
45597
45668
  /**
45598
45669
  * Shares scoped resources by key and releases them when no one is using them.
@@ -46567,7 +46638,7 @@ const fromReadableStream = (options) => fromChannel(fromReadableStream$1(options
46567
46638
  * @category constructors
46568
46639
  * @since 2.0.0
46569
46640
  */
46570
- const unwrap$3 = (effect) => fromChannel(unwrap$5(map$5(effect, toChannel)));
46641
+ const unwrap$4 = (effect) => fromChannel(unwrap$6(map$5(effect, toChannel)));
46571
46642
  /**
46572
46643
  * Transforms the elements of this stream using the supplied function.
46573
46644
  *
@@ -47077,7 +47148,7 @@ const broadcast = /*#__PURE__*/ dual(2, (self, options) => map$5(toPubSubTake(se
47077
47148
  const share = /*#__PURE__*/ dual(2, (self, options) => map$5(make$52({
47078
47149
  acquire: broadcast(self, options),
47079
47150
  idleTimeToLive: options.idleTimeToLive
47080
- }), (ref) => unwrap$3(get$2(ref))));
47151
+ }), (ref) => unwrap$4(get$2(ref))));
47081
47152
  /**
47082
47153
  * Pipes values through the provided channel while preserving this stream's
47083
47154
  * failures alongside any channel failures.
@@ -47787,11 +47858,11 @@ const make$50 = (impl) => FileSystem.of({
47787
47858
  return succeed$5(of(buf));
47788
47859
  }
47789
47860
  }))));
47790
- }, unwrap$3),
47861
+ }, unwrap$4),
47791
47862
  sink: (path, options) => pipe(impl.open(path, {
47792
47863
  ...options,
47793
47864
  flag: options?.flag ?? "w"
47794
- }), map$5((file) => forEach((_) => file.writeAll(_))), unwrap$4),
47865
+ }), map$5((file) => forEach((_) => file.writeAll(_))), unwrap$5),
47795
47866
  writeFileString: (path, data, options) => flatMap$2(try_({
47796
47867
  try: () => new TextEncoder().encode(data),
47797
47868
  catch: (cause) => badArgument({
@@ -48782,9 +48853,9 @@ const option = (self) => self.pipe(map$2(some$1), withDefault$2(none()));
48782
48853
  * @category converting
48783
48854
  * @since 2.0.0
48784
48855
  */
48785
- const unwrap$2 = (wrapped) => {
48856
+ const unwrap$3 = (wrapped) => {
48786
48857
  if (isConfig(wrapped)) return wrapped;
48787
- return all(map$9(wrapped, (config) => unwrap$2(config)));
48858
+ return all(map$9(wrapped, (config) => unwrap$3(config)));
48788
48859
  };
48789
48860
  const isSourceError = (u) => isTagged(u, "SourceError");
48790
48861
  const cursorToString = () => "<configuration>";
@@ -54284,7 +54355,7 @@ const make$36 = (url, params, hash) => try_$2({
54284
54355
  const urlInstance = new URL(url, baseUrl());
54285
54356
  for (let i = 0; i < params.params.length; i++) {
54286
54357
  const [key, value] = params.params[i];
54287
- if (value !== void 0) urlInstance.searchParams.append(key, unwrap$6(value));
54358
+ if (value !== void 0) urlInstance.searchParams.append(key, unwrap$7(value));
54288
54359
  }
54289
54360
  if (hash !== void 0) urlInstance.hash = hash;
54290
54361
  return urlInstance;
@@ -55562,7 +55633,7 @@ const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto)
55562
55633
  * @since 4.0.0
55563
55634
  */
55564
55635
  const make$33 = (spawn) => {
55565
- const streamString = (command, options) => spawn(command).pipe(map$5((handle) => decodeText$1(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap$3);
55636
+ const streamString = (command, options) => spawn(command).pipe(map$5((handle) => decodeText$1(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap$4);
55566
55637
  const streamLines = (command, options) => splitLines(streamString(command, options));
55567
55638
  return ChildProcessSpawner.of({
55568
55639
  spawn,
@@ -60860,7 +60931,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
60860
60931
  }
60861
60932
  const queue = onStreamRequest(rpc, middleware, rpc.payloadSchema.make(payload), headers, opts?.streamBufferSize ?? 16, context);
60862
60933
  if (opts?.asQueue) return queue;
60863
- return unwrap$3(map$5(queue, fromQueue));
60934
+ return unwrap$4(map$5(queue, fromQueue));
60864
60935
  };
60865
60936
  };
60866
60937
  const onEffectRequest = (rpc, middleware, span, payload, headers, context, discard) => withFiber((parentFiber) => {
@@ -71768,7 +71839,7 @@ const serve = (appLayer, options) => {
71768
71839
  }).pipe(map$5((context) => {
71769
71840
  const handler = get$12(context, HttpRouter).asHttpEffect();
71770
71841
  return merge$4(middleware ? serve$1(handler, middleware) : serve$1(handler), succeedContext(context));
71771
- }), unwrap$7, options?.disableListenLog ? identity : withLogAddress);
71842
+ }), unwrap$8, options?.disableListenLog ? identity : withLogAddress);
71772
71843
  };
71773
71844
  // ../../node_modules/.pnpm/effect@4.1.2/node_modules/effect/dist/rpc/RpcServer.js
71774
71845
  /**
@@ -73809,7 +73880,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
73809
73880
  tool: mcpTool,
73810
73881
  annotations,
73811
73882
  handle(payload) {
73812
- return built.handle(tool.name, payload ?? {}, void 0, decodeOptions).pipe(unwrap$3, runLast, flatMap$2(fromOption), flatMap$2((result) => {
73883
+ return built.handle(tool.name, payload ?? {}, void 0, decodeOptions).pipe(unwrap$4, runLast, flatMap$2(fromOption), flatMap$2((result) => {
73813
73884
  if (!result.isFailure) return result.encodedResult === void 0 ? succeed$5(new CallToolResult$5({
73814
73885
  isError: false,
73815
73886
  content: []
@@ -74029,7 +74100,7 @@ const template = (strings, ...expressions) => {
74029
74100
  }));
74030
74101
  return parseTemplate$1(strings, expressions);
74031
74102
  };
74032
- const unwrap$1 = (item) => isRedacted(item) ? value$2(item) : String(item);
74103
+ const unwrap$2 = (item) => isRedacted(item) ? value$2(item) : String(item);
74033
74104
  const toWord = (item) => isRedacted(item) ? item : String(item);
74034
74105
  const reservedWords = /*#__PURE__*/ new Set([
74035
74106
  "!",
@@ -74126,7 +74197,7 @@ const parseTemplate$1 = (texts, values) => {
74126
74197
  }));
74127
74198
  const endWord = () => {
74128
74199
  if (word.length === 0) return;
74129
- const value = word.map(unwrap$1).join("");
74200
+ const value = word.map(unwrap$2).join("");
74130
74201
  words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$65(value) : value);
74131
74202
  word = [];
74132
74203
  plain = true;
@@ -74747,12 +74818,12 @@ const toPlatformError = (method, error, command) => {
74747
74818
  const commandStr = commands.map((cmd) => display([cmd.command, ...cmd.args], { format })).join(" | ");
74748
74819
  return handleErrnoException("ChildProcess", method)(error, [commandStr]);
74749
74820
  };
74750
- const unwrap = (value) => isRedacted(value) ? value$2(value) : value;
74821
+ const unwrap$1 = (value) => isRedacted(value) ? value$2(value) : value;
74751
74822
  const findNulCharacter = (command) => {
74752
74823
  if (command.command.includes("\0")) return "The command contains a NUL character";
74753
- const index = command.args.findIndex((arg) => unwrap(arg).includes("\0"));
74824
+ const index = command.args.findIndex((arg) => unwrap$1(arg).includes("\0"));
74754
74825
  if (index !== -1) return `Argument ${index + 1} contains a NUL character`;
74755
- for (const [name, value] of Object.entries(command.options.env ?? {})) if (value !== void 0 && unwrap(value).includes("\0")) return `The environment variable ${name} contains a NUL character`;
74826
+ for (const [name, value] of Object.entries(command.options.env ?? {})) if (value !== void 0 && unwrap$1(value).includes("\0")) return `The environment variable ${name} contains a NUL character`;
74756
74827
  };
74757
74828
  const processGroupGraceMillis = 1e3;
74758
74829
  const processGroupPollIntervalMillis = 10;
@@ -74815,7 +74886,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
74815
74886
  if (options.env === void 0) return void 0;
74816
74887
  const env = options.extendEnv === true ? { ...globalThis.process.env } : {};
74817
74888
  for (const [key, value] of Object.entries(options.env)) if (value === void 0) delete env[key];
74818
- else env[key] = unwrap(value);
74889
+ else env[key] = unwrap$1(value);
74819
74890
  return env;
74820
74891
  };
74821
74892
  const inputToStdioOption = (input) => isStream(input) ? "pipe" : input;
@@ -74978,7 +75049,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
74978
75049
  };
74979
75050
  const spawn = (command, spawnOptions) => callback$1((resume) => {
74980
75051
  const deferred = makeUnsafe$8();
74981
- const handle = NodeChildProcess.spawn(command.command, command.args.map(unwrap), spawnOptions);
75052
+ const handle = NodeChildProcess.spawn(command.command, command.args.map(unwrap$1), spawnOptions);
74982
75053
  handle.on("error", (error) => {
74983
75054
  if (command.args.some(isRedacted)) Object.assign(error, { spawnargs: [command.command, ...command.args.map((arg) => isRedacted(arg) ? "<redacted>" : arg)] });
74984
75055
  resume(fail$7(toPlatformError("spawn", error, command)));
@@ -75163,7 +75234,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
75163
75234
  const command = pipeline[i];
75164
75235
  const options = pipeOptions[i] ?? {};
75165
75236
  const stdinConfig = resolveStdinOption(command.options);
75166
- const sourceStream = unwrap$3(succeed$5(getSourceStream(handles[handles.length - 1], options.from)));
75237
+ const sourceStream = unwrap$4(succeed$5(getSourceStream(handles[handles.length - 1], options.from)));
75167
75238
  const toOption = options.to ?? "stdin";
75168
75239
  if (toOption === "stdin") handles.push(yield* spawnCommand(make$12(command.command, command.args, {
75169
75240
  ...command.options,
@@ -79776,7 +79847,7 @@ const watchNode = (path, info, options) => callback((queue) => acquireRelease(sy
79776
79847
  });
79777
79848
  return watcher;
79778
79849
  }), (watcher) => sync(() => watcher.close())).pipe(tap$1(() => sync(() => options?.onReady?.()))));
79779
- const watch = (backend, path, options) => all$1([stat(path), serviceOption(WatchBackend)]).pipe(map$5(([stat, callerBackend]) => orElse$3(callerBackend, () => backend).pipe(flatMap$7((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap$3);
79850
+ const watch = (backend, path, options) => all$1([stat(path), serviceOption(WatchBackend)]).pipe(map$5(([stat, callerBackend]) => orElse$3(callerBackend, () => backend).pipe(flatMap$7((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap$4);
79780
79851
  const writeFile = (path, data, options) => callback$1((resume, signal) => {
79781
79852
  try {
79782
79853
  NFS.writeFile(path, data, {
@@ -80634,7 +80705,7 @@ const stream = (source, headers) => makeConfig(headers).pipe(map$5((config) => f
80634
80705
  return parser;
80635
80706
  },
80636
80707
  onError: (error) => convertError(error)
80637
- })), unwrap$3, map$3(convertPart));
80708
+ })), unwrap$4, map$3(convertPart));
80638
80709
  /**
80639
80710
  * Parses multipart data from a Node readable request body and persists file
80640
80711
  * parts using the current `FileSystem`, `Path`, and `Scope` services.
@@ -81448,7 +81519,7 @@ const layerHttpServices = /*#__PURE__*/ mergeAll$1(layer$11, layerWeak, layer$4)
81448
81519
  * @category layers
81449
81520
  * @since 4.0.0
81450
81521
  */
81451
- const layerConfig = (evaluate, options) => mergeAll$1(effect(HttpServer)(flatMap$2(unwrap$2(options), (options) => make$6(evaluate, options))), layerHttpServices);
81522
+ const layerConfig = (evaluate, options) => mergeAll$1(effect(HttpServer)(flatMap$2(unwrap$3(options), (options) => make$6(evaluate, options))), layerHttpServices);
81452
81523
  http.createServer;
81453
81524
  const closeCode = (exit) => isSuccess(exit) ? 1e3 : hasInterruptsOnly(exit.cause) ? 1001 : 1011;
81454
81525
  const upgradedResponse = /*#__PURE__*/ empty({ status: 101 });
@@ -90040,7 +90111,7 @@ const SpanKind = {
90040
90111
  };
90041
90112
  // ../../packages/runtime/src/telemetry.ts
90042
90113
  function layerOtlp(serviceName, url, runtime, version) {
90043
- return pipe(unwrap$7(gen(function* () {
90114
+ return pipe(unwrap$8(gen(function* () {
90044
90115
  const start = `${yield* currentTimeNanos}`;
90045
90116
  const redacted = yield* CurrentRedactedNames;
90046
90117
  const resource = {
@@ -91206,7 +91277,7 @@ var Auth = class Auth extends Service$1()("@deslop/runtime/auth/service/Auth") {
91206
91277
  if (isStreamSchema(request.rpc.successSchema)) return annotateCurrentSpan("rpc.stream", true);
91207
91278
  return void_$1;
91208
91279
  }), flatMap$2((user) => raceFirst(provideService(effect, CurrentUser, user), pipe(delay(auth.user(request.headers), "5 minutes"), retry({ while: (error) => error.error === "temporarily_unavailable" }), forever)))))));
91209
- static layer = unwrap$7(gen(function* () {
91280
+ static layer = unwrap$8(gen(function* () {
91210
91281
  if (yield* localAuth) return succeedContext(Auth.makeContext(Auth.of({
91211
91282
  token: () => fail$7(AuthError.make({ message: "There is no sign-in without --auth" })),
91212
91283
  user: () => succeed$5(DEVELOPER)
@@ -91398,7 +91469,7 @@ function layerKeyValueStore(directory) {
91398
91469
  });
91399
91470
  })), provide$2(layerFileSystem(directory)));
91400
91471
  }
91401
- const layerDataStore = unwrap$7(map$5(dataDirectory, layerKeyValueStore));
91472
+ const layerDataStore = unwrap$8(map$5(dataDirectory, layerKeyValueStore));
91402
91473
  const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(mebibytes(10)), effect(TracerDisabledWhen, map$5(TracerDisabledWhen, (previous) => (request) => {
91403
91474
  const path = headNonEmpty(split$2(request.url, "?"));
91404
91475
  return previous(request) || path === "/api/rpc" && toLowerCase(request.headers["upgrade"] ?? "") === "websocket" || startsWith("/assets/")(path) || contains([
@@ -91408,7 +91479,7 @@ const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(meb
91408
91479
  "/manifest.webmanifest"
91409
91480
  ], path);
91410
91481
  })));
91411
- const layerTelemetry = unwrap$7(gen(function* () {
91482
+ const layerTelemetry = unwrap$8(gen(function* () {
91412
91483
  const metadata = yield* packageMetadata;
91413
91484
  return match$8(yield* option(String$5("OTEL_URL")), {
91414
91485
  onNone: () => empty$10,
@@ -91541,7 +91612,7 @@ function layerSignIn(issuer) {
91541
91612
  }));
91542
91613
  }
91543
91614
  const notConfigured = text("Sign-in is not configured for this app", { status: 503 });
91544
- const layerSessionRoutes = unwrap$7(gen(function* () {
91615
+ const layerSessionRoutes = unwrap$8(gen(function* () {
91545
91616
  return match$8(yield* option(String$5("AUTH_URL")), {
91546
91617
  onNone: () => mergeAll$1(add("GET", "/auth/sign-in", notConfigured), add("GET", "/auth/sign-out", notConfigured)),
91547
91618
  onSome: layerSignIn
@@ -91570,7 +91641,7 @@ function layerIcon(icon) {
91570
91641
  }));
91571
91642
  return mergeAll$1(add("GET", "/icon", response), add("GET", "/favicon.ico", response));
91572
91643
  }
91573
- const layerWeb = unwrap$7(gen(function* () {
91644
+ const layerWeb = unwrap$8(gen(function* () {
91574
91645
  const client = fileURLToPath(new URL("./client", import.meta.url));
91575
91646
  if (!(yield* (yield* FileSystem).exists((yield* Path$1).join(client, "index.html")))) return empty$10;
91576
91647
  const name = capitalize(yield* appName);
@@ -91611,7 +91682,7 @@ function layerRpc(options) {
91611
91682
  }), provide$2(options.handlers));
91612
91683
  }
91613
91684
  function layerMcp(options) {
91614
- return unwrap$7(gen(function* () {
91685
+ return unwrap$8(gen(function* () {
91615
91686
  const metadata = yield* packageMetadata;
91616
91687
  const canonical = yield* String$5("APP_URL");
91617
91688
  const issuer = yield* option(String$5("AUTH_URL"));
@@ -91909,9 +91980,14 @@ var DeployError = class extends TaggedError()("DeployError", {
91909
91980
  cause: optional$8(Defect()),
91910
91981
  message: String$6
91911
91982
  }) {};
91983
+ const ProcessLabel = Struct({
91984
+ detail: String$6,
91985
+ name: String$6
91986
+ });
91912
91987
  const Process = Struct({
91913
91988
  command: optionalKey(ArraySchema(String$6)),
91914
91989
  cpu: optionalKey(Finite),
91990
+ label: ProcessLabel,
91915
91991
  memory: Finite,
91916
91992
  name: String$6,
91917
91993
  parent: Int$1,
@@ -92289,6 +92365,193 @@ var Exposures = class Exposures extends Service$1()("@deslop/deploy/services/exp
92289
92365
  });
92290
92366
  }));
92291
92367
  };
92368
+ // src/services/inventory/lib/command.ts
92369
+ const WRAPPERS = [
92370
+ "env",
92371
+ "nice",
92372
+ "nohup",
92373
+ "setsid",
92374
+ "exec",
92375
+ "timeout",
92376
+ "sudo",
92377
+ "stdbuf",
92378
+ "systemd-run"
92379
+ ];
92380
+ const RUNTIMES = [
92381
+ "node",
92382
+ "bun",
92383
+ "deno",
92384
+ "python",
92385
+ "python3"
92386
+ ];
92387
+ const SHELLS = [
92388
+ "sh",
92389
+ "bash",
92390
+ "zsh",
92391
+ "dash"
92392
+ ];
92393
+ const SETUP = [
92394
+ "source",
92395
+ ".",
92396
+ "shopt",
92397
+ "set",
92398
+ "export",
92399
+ "cd",
92400
+ "true",
92401
+ "unset",
92402
+ "alias",
92403
+ "pwd",
92404
+ "{",
92405
+ "}",
92406
+ "\\builtin"
92407
+ ];
92408
+ const SUBJECT = {
92409
+ "chrome-headless-shell": ["type"],
92410
+ claude: [
92411
+ "model",
92412
+ "effort",
92413
+ "resume"
92414
+ ],
92415
+ codex: ["model"],
92416
+ vp: ["filter"]
92417
+ };
92418
+ function basename(value) {
92419
+ return getOrElse(last(filter$3(split$2(value, "/"), isNonEmpty$1)), () => value);
92420
+ }
92421
+ function isFlag(token) {
92422
+ return startsWith("-")(token) && token !== "-" && token !== "--";
92423
+ }
92424
+ function assignment(token) {
92425
+ return isSome(match$3(/^\w+=/u)(token));
92426
+ }
92427
+ function capture(pattern, value) {
92428
+ return flatMap$7(match$3(pattern)(value), (match) => fromUndefinedOr(match[1]));
92429
+ }
92430
+ function flagParts(token) {
92431
+ return match$8(match$3(/^([^=]*)(?:=(.*))?$/su)(replace(/^-+/u, "")(token)), {
92432
+ onNone: () => ({
92433
+ flag: "",
92434
+ inline: none()
92435
+ }),
92436
+ onSome: (match) => ({
92437
+ flag: getOrElse(fromUndefinedOr(match[1]), () => ""),
92438
+ inline: fromUndefinedOr(match[2])
92439
+ })
92440
+ });
92441
+ }
92442
+ function alias(value$4) {
92443
+ return pipe(value(value$4), when("vite-plus", () => "vp"), orElse(() => value$4));
92444
+ }
92445
+ function shellRest(tokens) {
92446
+ const script = getOrElse(get$10(tokens, 2), () => "");
92447
+ const shifts = match$8(match$3(/\bshift\b/gu)(script), {
92448
+ onNone: () => 0,
92449
+ onSome: (matches) => matches.length
92450
+ });
92451
+ if (includes("exec \"$@\"")(script)) return drop$1(tokens, 4 + shifts);
92452
+ const segments = filter$3(map$8(split$2(replaceAll(/\d*[<>]+\|?\s*\S+/gu, "")(replaceAll(/['"]/gu, "")(script)), /\s*(?:\|\|?|;|&&)\s*/u), (segment) => dropWhile(split$2(replace(/^eval\s+/u, "")(trim(segment)), /\s+/u), assignment)), (words) => isNonEmpty$1(words[0] ?? ""));
92453
+ return pipe(findFirst(segments, (words) => words[0] === "exec"), map$11((words) => drop$1(words, 1)), orElse$3(() => findFirst(segments, (words) => !contains(SETUP, words[0] ?? ""))), getOrElse(() => take$3(tokens, 1)));
92454
+ }
92455
+ function unwrapTokens(tokens, cwd) {
92456
+ const name = basename(getOrElse(head(tokens), () => ""));
92457
+ if (contains(WRAPPERS, name)) return unwrapTokens(pipe(findFirstIndex(tokens, (token) => token === "--"), filter$5((index) => index > 0), match$8({
92458
+ onNone: () => {
92459
+ const tail = drop$1(tokens, 1);
92460
+ return pipe(findFirstIndex(tail, (token) => !isFlag(token) && !assignment(token)), match$8({
92461
+ onNone: () => empty$11(),
92462
+ onSome: (start) => filter$3(tail, (token, index) => index >= start && !isFlag(token) && !assignment(token))
92463
+ }));
92464
+ },
92465
+ onSome: (index) => drop$1(tokens, index + 1)
92466
+ })), cwd);
92467
+ if (contains(SHELLS, name) && getOrElse(get$10(tokens, 1), () => "") === "-c") return unwrapTokens(shellRest(tokens), cwd);
92468
+ if (contains(RUNTIMES, name)) return pipe(findFirstIndex(tokens, (token, index) => index > 0 && !isFlag(token)), match$8({
92469
+ onNone: () => tokens,
92470
+ onSome: (index) => {
92471
+ const script = getOrElse(get$10(tokens, index), () => "");
92472
+ const pkg = capture(/.*node_modules\/((?:@[^/]+\/)?[^/.][^/]*)\//u, script);
92473
+ const app = pipe(capture(/\.deslop\/([^/]+)\//u, script), orElse$3(() => flatMap$7(cwd, (value) => capture(/\/apps\/([^/]+)$/u, value))));
92474
+ return [getOrElse(pipe(pkg, orElse$3(() => app)), () => basename(script)), ...drop$1(tokens, index + 1)];
92475
+ }
92476
+ }));
92477
+ return tokens;
92478
+ }
92479
+ function unwrap(argv, cwd) {
92480
+ const tokens = match$1(length$2(argv) === 1, {
92481
+ onFalse: () => argv,
92482
+ onTrue: () => filter$3(split$2(getOrElse(head(argv), () => ""), /\s+/u), isNonEmpty$1)
92483
+ });
92484
+ return unwrapTokens([replace(/:$/u, "")(getOrElse(head(tokens), () => "")), ...drop$1(tokens, 1)], cwd);
92485
+ }
92486
+ function scan(name, subject, args, words, values) {
92487
+ return match$8(head(args), {
92488
+ onNone: () => ({
92489
+ ssh: none(),
92490
+ values,
92491
+ words
92492
+ }),
92493
+ onSome: (token) => {
92494
+ if (isFlag(token)) {
92495
+ const parsed = flagParts(token);
92496
+ const next = filter$5(get$10(args, 1), (value) => !isFlag(value));
92497
+ const value = pipe(parsed.inline, orElse$3(() => next));
92498
+ return scan(name, subject, match$1(isNone(parsed.inline) && isSome(next), {
92499
+ onFalse: () => drop$1(args, 1),
92500
+ onTrue: () => drop$1(args, 2)
92501
+ }), words, match$1(contains(subject, parsed.flag), {
92502
+ onFalse: () => values,
92503
+ onTrue: () => match$1(parsed.flag === "resume", {
92504
+ onFalse: () => match$8(value, {
92505
+ onNone: () => values,
92506
+ onSome: (given) => set$6(values, parsed.flag, given)
92507
+ }),
92508
+ onTrue: () => set$6(values, parsed.flag, "resumed")
92509
+ })
92510
+ }));
92511
+ }
92512
+ if (name === "ssh") return {
92513
+ ssh: some$1({
92514
+ host: getOrElse(last(split$2(token, "@")), () => token),
92515
+ remote: drop$1(args, 1)
92516
+ }),
92517
+ values,
92518
+ words
92519
+ };
92520
+ if (token === "…" || length$1(token) > 40 || isSome(match$3(/^[0-9a-f-]{16,}$/iu)(token)) || includes("=")(token)) return scan(name, subject, drop$1(args, 1), words, values);
92521
+ const word = match$1(includes("/")(token), {
92522
+ onFalse: () => token,
92523
+ onTrue: () => basename(token)
92524
+ });
92525
+ return scan(name, subject, drop$1(args, 1), [...words, word], values);
92526
+ }
92527
+ });
92528
+ }
92529
+ function commandLabel(argv, cwd) {
92530
+ const [head = "", ...args] = unwrap(argv, cwd);
92531
+ const name = alias(basename(head));
92532
+ const subject = getOrElse(get$11(SUBJECT, name), () => empty$11());
92533
+ const scanned = scan(name, subject, args, [], {});
92534
+ if (contains(SHELLS, name) && isReadonlyArrayEmpty(scanned.words)) return {
92535
+ detail: getOrElse(map$11(cwd, basename), () => ""),
92536
+ name
92537
+ };
92538
+ return match$8(scanned.ssh, {
92539
+ onNone: () => ({
92540
+ detail: join$2([...take$3(scanned.words, 2), ...filter$3(getSomes(map$8(subject, (flag) => get$11(scanned.values, flag))), isNonEmpty$1)], " "),
92541
+ name
92542
+ }),
92543
+ onSome: (ssh) => {
92544
+ const remote = commandLabel(ssh.remote, none());
92545
+ return {
92546
+ detail: join$2(filter$3([ssh.host, match$1(isNonEmpty$1(remote.name), {
92547
+ onFalse: () => "",
92548
+ onTrue: () => `→ ${remote.name}`
92549
+ })], isNonEmpty$1), " "),
92550
+ name
92551
+ };
92552
+ }
92553
+ });
92554
+ }
92292
92555
  // src/services/inventory/lib/utils.ts
92293
92556
  const SIGNALS = {
92294
92557
  1: "SIGHUP",
@@ -92384,8 +92647,10 @@ function commandArgs(cmdline) {
92384
92647
  const args = take$3(filter$3(split$2(cmdline, "\0"), isNonEmpty$1), 40);
92385
92648
  return map$8(args, (arg, index) => {
92386
92649
  if (isSome(match$3(/^-{0,2}[\w.-]+=/u)(arg)) && SECRET.test(split$2(arg, "=")[0])) return `${split$2(arg, "=")[0]}=…`;
92387
- if (index > 0 && SECRET.test(args[index - 1] ?? "") && startsWith("-")(args[index - 1] ?? "")) return "…";
92388
- if (!startsWith("/")(arg) && isSome(match$3(/^[\w+/=-]{32,}$/u)(arg))) return "…";
92650
+ const previous = args[index - 1] ?? "";
92651
+ const secretValue = startsWith("-")(previous) && !includes("=")(previous) && SECRET.test(previous);
92652
+ const opaque = !startsWith("/")(arg) && isSome(match$3(/^[\w+/=-]{32,}$/u)(arg));
92653
+ if (index > 0 && (secretValue || !startsWith("-")(arg) && opaque)) return "…";
92389
92654
  return slice$1(0, 200)(replaceAll(/:\/\/[^/@\s]+@/gu, "://…@")(arg));
92390
92655
  });
92391
92656
  }
@@ -92397,20 +92662,30 @@ const processes = gen(function* () {
92397
92662
  records: yield* pipe(forEach$1(filter$3(yield* fs.readDirectory("/proc"), (name) => isSome(match$3(/^[0-9]+$/u)(name))), (pid) => pipe(gen(function* () {
92398
92663
  const status = yield* fs.readFileString(`/proc/${pid}/status`);
92399
92664
  const stat = yield* fs.readFileString(`/proc/${pid}/stat`);
92665
+ const cwd = yield* option$1(fs.readLink(`/proc/${pid}/cwd`));
92666
+ const command = map$11(yield* option$1(fs.readFileString(`/proc/${pid}/cmdline`)), commandArgs);
92400
92667
  const fields = split$2(slice$1(getOrElse(lastIndexOf(")")(stat), () => -1) + 2)(stat), /\s+/u);
92668
+ const parsed = yield* try_({
92669
+ catch: (cause) => DeployError.make({
92670
+ cause,
92671
+ message: `Process ${pid} has an unreadable status.`
92672
+ }),
92673
+ try: () => processStatus(status)
92674
+ });
92401
92675
  return {
92402
92676
  cgroup: yield* fs.readFileString(`/proc/${pid}/cgroup`),
92403
92677
  process: {
92404
- ...yield* try_({
92405
- catch: (cause) => DeployError.make({
92406
- cause,
92407
- message: `Process ${pid} has an unreadable status.`
92408
- }),
92409
- try: () => processStatus(status)
92410
- }),
92411
- ...match$8(yield* option$1(fs.readFileString(`/proc/${pid}/cmdline`)), {
92678
+ ...parsed,
92679
+ ...match$8(command, {
92412
92680
  onNone: () => ({}),
92413
- onSome: (cmdline) => ({ command: commandArgs(cmdline) })
92681
+ onSome: (args) => ({ command: args })
92682
+ }),
92683
+ label: match$8(filter$5(command, isReadonlyArrayNonEmpty), {
92684
+ onNone: () => ({
92685
+ detail: "",
92686
+ name: parsed.name
92687
+ }),
92688
+ onSome: (args) => commandLabel(args, cwd)
92414
92689
  })
92415
92690
  },
92416
92691
  start: yield* decodeEffect(FiniteFromString)(fields[19] ?? ""),
@@ -92814,10 +93089,19 @@ function sample(current, memory, disk, previous, load) {
92814
93089
  const fields = split$2(line, /\s+/u);
92815
93090
  return [fields[0], decodeSync(FiniteFromString)(fields[1] ?? "") * 1024];
92816
93091
  }));
93092
+ const disks = pipe(disk, trim, split$2("\n"), drop$1(1), filter$3(isNonEmpty$1), map$8((line) => {
93093
+ const fields = split$2(trim(line), /\s+/u);
93094
+ return {
93095
+ mount: fields[0],
93096
+ total: decodeSync(FiniteFromString)(fields[1] ?? ""),
93097
+ used: decodeSync(FiniteFromString)(fields[2] ?? "")
93098
+ };
93099
+ }));
93100
+ const used = reduce(disks, 0, (sum, entry) => sum + entry.used);
92817
93101
  const seconds = (current.time - (previous?.time ?? current.time)) / 1e3;
92818
93102
  const baseline = filter$5(fromUndefinedOr(previous), (old) => old.uptime < current.uptime);
92819
93103
  const old = getOrUndefined$1(baseline);
92820
- return {
93104
+ const reading = {
92821
93105
  cores: coreUsages(current, seconds, old),
92822
93106
  ...getSomes$1({
92823
93107
  cpu: cpuUsage({
@@ -92832,14 +93116,7 @@ function sample(current, memory, disk, previous, load) {
92832
93116
  networkReceive: rate(current.networkReceive, seconds, old?.networkReceive),
92833
93117
  networkSend: rate(current.networkSend, seconds, old?.networkSend)
92834
93118
  }),
92835
- disks: pipe(disk, trim, split$2("\n"), drop$1(1), filter$3(isNonEmpty$1), map$8((line) => {
92836
- const fields = split$2(trim(line), /\s+/u);
92837
- return {
92838
- mount: fields[0],
92839
- total: decodeSync(FiniteFromString)(fields[1] ?? ""),
92840
- used: decodeSync(FiniteFromString)(fields[2] ?? "")
92841
- };
92842
- })),
93119
+ disks,
92843
93120
  load: decodeSync(ArraySchema(FiniteFromString))(take$3(filter$3(split$2(trim(load ?? ""), /\s+/u), isNonEmpty$1), 3)),
92844
93121
  memoryAvailable: values["MemAvailable:"] ?? 0,
92845
93122
  memoryBuffers: values["Buffers:"] ?? 0,
@@ -92851,6 +93128,13 @@ function sample(current, memory, disk, previous, load) {
92851
93128
  time: current.time,
92852
93129
  uptime: current.uptime
92853
93130
  };
93131
+ return match$6(disks, {
93132
+ onEmpty: () => reading,
93133
+ onNonEmpty: () => ({
93134
+ ...reading,
93135
+ storageUsed: used
93136
+ })
93137
+ });
92854
93138
  }
92855
93139
  function resolution(minutes) {
92856
93140
  return minutes * 1e3;
@@ -92905,6 +93189,7 @@ function merge(bucket) {
92905
93189
  networkSend: mean(bucket, (point) => point.networkSend)
92906
93190
  }),
92907
93191
  memoryUsed: getOrElse(mean(bucket, (point) => point.memoryUsed), () => last.memoryUsed),
93192
+ ...getSomes$1({ storageUsed: mean(bucket, (point) => point.storageUsed) }),
92908
93193
  since: bucket[0].since ?? bucket[0].time
92909
93194
  };
92910
93195
  }
@@ -93340,7 +93625,7 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
93340
93625
  "deploy.hide": fleet.hide,
93341
93626
  "deploy.history": fleet.history,
93342
93627
  "deploy.inventory": () => inventory,
93343
- "deploy.metrics": (query) => unwrap$3(get$6(metrics, query.minutes)),
93628
+ "deploy.metrics": (query) => unwrap$4(get$6(metrics, query.minutes)),
93344
93629
  "deploy.run": fleet.run,
93345
93630
  "deploy.snapshot": () => fleet.local
93346
93631
  });
@@ -93375,7 +93660,7 @@ const ToolHandlers = Tools.toLayer(map$5(Fleet, (fleet) => Tools.of({
93375
93660
  })
93376
93661
  })));
93377
93662
  // src/main.server.ts
93378
- const layerServices = pipe(Fleet.layer, provideMerge(unwrap$7(map$5(dataDirectory, (directory) => provide$2(mergeAll$1(Inventory.layer, Exposures.layer(directory), Metrics.layer), layerKeyValueStore(directory))))), provide$2(ToolPath.layer));
93663
+ const layerServices = pipe(Fleet.layer, provideMerge(unwrap$8(map$5(dataDirectory, (directory) => provide$2(mergeAll$1(Inventory.layer, Exposures.layer(directory), Metrics.layer), layerKeyValueStore(directory))))), provide$2(ToolPath.layer));
93379
93664
  runApp({
93380
93665
  icon: icon_default,
93381
93666
  routes: pipe(mergeAll$1(layerRpc({