@akterjs/cli 0.1.1 → 0.1.3

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 (86) hide show
  1. package/README.md +2 -2
  2. package/dist/{Argument-D81dqizB.mjs → Argument-BKjmk8CZ.mjs} +1 -1
  3. package/dist/{ChildProcess-BCIwxPGc.mjs → ChildProcess-UWPy-kPn.mjs} +2 -2
  4. package/dist/{CliError-Cf5xqkkj.mjs → CliError-CphGZMfO.mjs} +2 -2
  5. package/dist/{Command-Dzq9KM-h.mjs → Command-D3hF_i6F.mjs} +8 -8
  6. package/dist/{Config-B6OND9WR.mjs → Config-DEUiBxw4.mjs} +2 -2
  7. package/dist/{Console-BKHUkH6a.mjs → Console-DY7H086H.mjs} +1 -1
  8. package/dist/{Digest-CBd3uv5B.mjs → Digest-CnBYV3Oh.mjs} +2 -2
  9. package/dist/{Effect-CKFpqbmw.mjs → Effect-CFIPV2Jg.mjs} +44 -4
  10. package/dist/{FileSystem-4pPcEb_i.mjs → FileSystem-iEC-kUB-.mjs} +2 -2
  11. package/dist/{HttpClientError-BUeMWx70.mjs → HttpClientError-BVd83gxQ.mjs} +1 -1
  12. package/dist/{HttpClientResponse-D5ZKICVV.mjs → HttpClientResponse-CifutXCF.mjs} +4 -4
  13. package/dist/{Path-Djdv_eF5.mjs → Path-BRnAx8py.mjs} +1 -1
  14. package/dist/{Queue-CO5UQ6os.mjs → Queue-CyWN-MDp.mjs} +1 -1
  15. package/dist/{Ref-BIPOxJNH.mjs → Ref-CX3ghLq6.mjs} +1 -1
  16. package/dist/{Runtime-BInIAwK3.mjs → Runtime-CyqeMpLX.mjs} +1 -1
  17. package/dist/{Schema-MiKt5K1v.mjs → Schema-O3QUdX3B.mjs} +1 -1
  18. package/dist/{SecureRandom-B_U4ysO3.mjs → SecureRandom-DYpl-YDn.mjs} +2 -2
  19. package/dist/{Semaphore-DOVJ4ZGS.mjs → Semaphore-DHYKAQSv.mjs} +1 -1
  20. package/dist/{Stdio-KylmOBX_.mjs → Stdio-7l23nD6W.mjs} +1 -1
  21. package/dist/{Stream-bK9QIETN.mjs → Stream-BeqiANg7.mjs} +3 -3
  22. package/dist/{TerminalCapabilities-w_44MAca.mjs → TerminalCapabilities-R2LPyCNs.mjs} +3 -3
  23. package/dist/{WebCrypto-ZI_GNVlw.mjs → WebCrypto-C_95GMdw.mjs} +1 -1
  24. package/dist/{actor-call.service-CGM_vD9u.mjs → actor-call.service-vJm8gKjI.mjs} +15 -15
  25. package/dist/{actor-client.adapter-Coem7gF1.mjs → actor-client.adapter-CfKUj7Gi.mjs} +32 -16
  26. package/dist/{akter-program.config-D8yb9xQP.mjs → akter-program.config-BqHoPt6H.mjs} +252 -39
  27. package/dist/akter.cli.mjs +1 -1
  28. package/dist/app-cli.config.mjs +4 -3
  29. package/dist/archive/akter-archive.schema.mjs +1 -1
  30. package/dist/archive/akter-archive.service.mjs +7 -7
  31. package/dist/archive/archive-cli.config.mjs +6 -6
  32. package/dist/archive/archive-invalid.errors.mjs +1 -1
  33. package/dist/archive/tar.pure.mjs +1 -1
  34. package/dist/archive/zstd.adapter.mjs +2 -2
  35. package/dist/bench/bench-report.pure.mjs +7 -2
  36. package/dist/bench/bench-runner.pure.mjs +40 -3
  37. package/dist/bench/bench.service.mjs +17 -14
  38. package/dist/{cli-runtime.layer-BqK2mmVL.mjs → cli-runtime.layer-Bwuqll8h.mjs} +13 -13
  39. package/dist/cli-runtime.layer.mjs +1 -1
  40. package/dist/{cloud-client.adapter-Cy1BjDbG.mjs → cloud-client.adapter-Ce4oyGNh.mjs} +94 -17
  41. package/dist/{cloud-client.adapter-DOVMoYAj.mjs → cloud-client.adapter-Dln8NW-9.mjs} +9 -9
  42. package/dist/command/akter-commands.config.mjs +2 -2
  43. package/dist/command/akter-program.config.mjs +1 -1
  44. package/dist/credentials/credentials.service.mjs +5 -5
  45. package/dist/credentials/keychain.adapter.mjs +3 -3
  46. package/dist/credentials/login.config.mjs +9 -9
  47. package/dist/deploy/auth/api-attempt.service.mjs +4 -4
  48. package/dist/deploy/auth/token-refresh.errors.mjs +1 -1
  49. package/dist/deploy/build-bundle.adapter.mjs +8 -8
  50. package/dist/deploy/cloud-client.adapter.mjs +1 -1
  51. package/dist/deploy/cloud-url.pure.mjs +2 -2
  52. package/dist/deploy/deploy-failed.errors.mjs +2 -2
  53. package/dist/deploy/deploy.service.mjs +6 -6
  54. package/dist/deploy/request-failure.pure.mjs +3 -3
  55. package/dist/docs/docs.config.mjs +1 -1
  56. package/dist/{docs.config-D2amjsje.mjs → docs.config-Dy0MFrKd.mjs} +10 -42
  57. package/dist/export/actor-export.service.mjs +8 -8
  58. package/dist/export/export-failed.errors.mjs +1 -1
  59. package/dist/export/export-failure.pure.mjs +2 -2
  60. package/dist/export/ordered-lines.pure.mjs +3 -3
  61. package/dist/export/ranged-download.pure.mjs +3 -3
  62. package/dist/export/snapshot-download.pure.mjs +3 -3
  63. package/dist/{hosted-runtime.layer-Cx3IPsEd.mjs → hosted-runtime.layer-BDXPqzSp.mjs} +128 -99
  64. package/dist/local/environment-cli.config.mjs +4 -4
  65. package/dist/local/local-cli.config.mjs +9 -9
  66. package/dist/logs/log-follow.config.mjs +2 -2
  67. package/dist/logs/log-follow.service.mjs +7 -7
  68. package/dist/logs/log-lines.pure.mjs +4 -4
  69. package/dist/{operation-input.pure-CS9iUhqK.mjs → operation-input.pure-B72BbxCG.mjs} +2 -2
  70. package/dist/operation-output.pure-ChUlePFj.mjs +120 -0
  71. package/dist/{operation-registry.pure-DVC8EDgj.mjs → operation-registry.pure-DeoTbR3J.mjs} +2 -2
  72. package/dist/registry/actor-call.service.mjs +1 -1
  73. package/dist/registry/actor-commands.config.mjs +6 -6
  74. package/dist/registry/approval.service.mjs +5 -5
  75. package/dist/registry/cloud-commands.config.mjs +3 -3
  76. package/dist/registry/cloud-served.pure.mjs +1 -1
  77. package/dist/registry/operation-call.service.mjs +42 -23
  78. package/dist/registry/operation-input.pure.mjs +1 -1
  79. package/dist/registry/operation-output.pure.mjs +1 -91
  80. package/dist/registry/served-command.config.mjs +6 -6
  81. package/dist/runner-exited.errors.mjs +2 -2
  82. package/dist/terminal/cli-exit.errors.mjs +2 -2
  83. package/dist/terminal/cli-failure.pure.mjs +7 -7
  84. package/dist/terminal/confirm.adapter.mjs +2 -2
  85. package/package.json +3 -3
  86. package/dist/docs.config-D3zzLzLR.mjs +0 -190
@@ -1,29 +1,29 @@
1
1
  import { Bt as hash, C as orElse, Ct as NodeInspectSymbol, Et as format, F as PipeInspectableProto, Ft as byReferenceUnsafe, Ht as optimize, It as equals, Kt as symbol$2, Lt as symbol$1, Mt as redact, On as pipeArguments, S as none$2, Sn as identity, St as Class, T as toArray, Tn as pipe, Ut as string, _ as isSome, _n as constUndefined, an as isObject, b as map, bn as dual, cn as isString, d as fromUndefinedOr, dn as isUndefined, f as getOrElse, gn as constTrue, h as isNone, i as filter, l as fromNullOr, m as getOrUndefined, mn as backEdges, n as contains, nn as isNotUndefined, o as flatMap, p as getOrNull, pn as or$1, qt as hasProperty, r as exists, s as flatMapNullishOr, t as all, u as fromNullishOr, un as isTagged, v as liftPredicate, vn as constVoid, w as some, wt as toJson, x as match, xn as flow, y as liftThrowable, yn as constant, zt as combine } from "./Option-DkxSnBhp.mjs";
2
- import { c as BadArgument, d as bytes, f as fromInputUnsafe, i as make$17, l as badArgument, n as FileTypeId, p as mebibytes, r as WatchBackend, t as FileSystem, u as systemError } from "./FileSystem-4pPcEb_i.mjs";
3
- import { $n as closeUnsafe, $t as suspend, A as ensuring, An as spaced, Ar as match$1, At as provideContext, B as flatMap$1, Bn as build$1, Br as done, C as catch_, Cr as getSuccess, Ct as onExitPrimitive, D as delay, Dr as isFailure, Dt as orElseSucceed, E as contextWith, En as exponential, Er as isExit, Et as orDie, Fi as makeSpanUnsafe, Fn as catchDone, Ft as repeat, Gn as mergeAll, Gr as hasDies, Gt as scoped, Hn as effectContext, I as filter$1, It as result, J as forkChild, Jn as succeed$1, Jt as serviceOption, K as forEach, Kn as provide$1, Kr as hasInterrupts$1, Kt as scopedWith, Lt as retry, M as fail$1, Mn as toStepWithSleep, Mr as void_$1, Mt as provideServiceEffect, N as failCause$1, Nr as Done, Nt as raceFirst, O as die, On as min, Or as isSuccess, Pr as ExceededCapacityError, Q as fromOption, Qi as externalSpan, Qn as close$1, Qr as isFailReason, Qt as succeedSome, R as filterOrFail, Ri as reportCauseUnsafe, Rn as isDoneCause, Rr as combine$1, Rt as runFork, S as catchTags, Sn as yieldNow, Sr as failCause, St as onExit, T as context, Tr as interrupt$2, Tt as option, U as fn, Ur as findErrorOption, Vn as effect, Vr as fail$2, Vt as runSync, W as fnUntraced, Wn as merge$1, Wr as fromReasons, Wt as scope, X as forkScoped, Xn as addFinalizer, Xt as succeed, Y as forkIn$1, Yi as TracerTimingEnabled, Yn as Scope, Yt as sleep, Z as fromNullishOr$1, Zi as ParentSpan, Zn as addFinalizerExit, Zt as succeedNone, _i as endSpan, _r as succeed$2, a as all$1, aa as Service, an as timeoutOption, at as isEffect, b as catchReason, br as die$1, bt as never, c as annotateLogs, ca as get$5, ci as squash, cn as tryPromise, cr as done$1, ct as logFatal, d as asVoid, da as getOrUndefinedUnsafe, dn as txRetry, dt as map$1, en as sync, er as fork, et as gen, f as cached, fa as getUnsafe$1, fr as isDeferred, ft as mapBoth, g as catchDefect, ga as omit, gn as void_, gr as makeUnsafe$5, ha as merge, hn as useSpan, hr as make$20, ht as mapError, i as addFinalizer$1, ia as Reference, ir as provide, it as interruptible, j as exit, jr as succeed$3, jt as provideService, k as effectify, kr as map$2, kt as provide$2, l as as, la as getOption, ln as try_, lr as doneUnsafe, lt as logWarning, m as catchCause, ma as makeUnsafe$7, mn as updateContext, n as acquireRelease, ni as makeDieReason, nn as tapCause, nr as make$18, nt as ignoreCause, o as andThen, oa as add, oi as pretty, on as timeoutOrElse, or as TracerTimingEnabled$1, ot as logDebug, p as callback, pa as make$19, pn as uninterruptibleMask, q as forever, qn as provideMerge, qr as hasInterruptsOnly, qt as service, r as acquireUseRelease, rn as tapError, rr as makeUnsafe$6, rt as interrupt$1, s as annotateCurrentSpan, si as reasonAnnotations, sn as transposeOption, sr as _await, st as logError, t as Transaction, tn as tap, tr as forkUnsafe, tt as ignore$1, u as asSome, ua as getOrUndefined$1, un as tx, ut as makeSpanScoped, va as Prototype, vn as whileLoop, vr as asVoid$1, vt as matchCauseEffect, wr as hasInterrupts, x as catchTag, xn as withSpan, xr as fail$3, xt as onError, y as catchIf, yn as withFiber, yr as asVoidAll, yt as matchEffect, zr as die$2, zt as runForkWith } from "./Effect-CKFpqbmw.mjs";
4
- import { _ as takeAll, a as fail$4, c as make$21, d as offerUnsafe, g as take, h as sliding, i as endUnsafe, l as offer, n as collect$1, p as shutdown, r as end, s as failCauseUnsafe, t as bounded } from "./Queue-CO5UQ6os.mjs";
5
- import { B as runCollect, E as map$3, F as pipeThroughChannel, G as runForEachArray, J as suspend$1, L as provideService$1, O as mapEffect, P as paginate, S as fromReadableStream, T as make$22, U as runFoldEffect, W as runForEach, X as tap$1, _ as fromChannel, a as die$3, bt as runIn, d as ensuring$1, dt as make$23, f as fail$5, ft as makeUnsafe$8, gt as interrupt$3, h as fromArray, ht as getCurrent, it as fromTransform, k as mapError$1, l as empty$3, m as flatMap$2, mt as await_, n as callback$1, nt as unwrap, o as drain$1, ot as mapError$2, p as filter$2, q as succeed$4, r as concat, rt as fromPull, st as mkUint8Array$1, t as buffer, ut as isOpen, v as fromEffect, x as fromQueue, y as fromIterable$4, yt as join$1, z as run$2 } from "./Stream-bK9QIETN.mjs";
6
- import { n as make$24, t as Path$1 } from "./Path-Djdv_eF5.mjs";
7
- import { a as modify$1, i as makeUnsafe$9, o as set$3, r as make$25, s as update$3, t as get$6 } from "./Ref-BIPOxJNH.mjs";
8
- import { A as Option, B as TaggedStruct, D as Null, Dt as isGreaterThanOrEqualTo, F as String$1, Hn as fromBody, I as Struct, J as UndefinedOr, Jn as fromRecordUnsafe, K as Uint8Array$1, Kn as empty$4, Mn as defaultFormatter, Q as brand, Qt as isUUID, Rn as fromInput$1, S as Literals, T as NonEmptyArray, U as Tuple, Un as toPath, X as Unknown, Y as Union, Yn as get$8, Yt as isSchema, Z as Void, _ as FiniteFromString, _r as values$2, a as Boolean$1, an as optionalKey, at as decodeUnknownEffect, cn as toCodecJson, cr as getSomes, d as Defect, dn as concat$1, dr as keys$1, dt as encodeUnknownEffect, f as Duration, fn as omit$1, fr as map$4, ft as encodeUnknownOption, g as Finite, hr as toEntries, in as optional, it as decodeTo, jt as isInt, lr as has$4, lt as encodeSync, m as Exit, mr as set$4, mt as is, n as ArraySchema, nt as decodeOption, or as fromEntries, ot as decodeUnknownOption, pt as fromJsonString, q as Uint8ArrayFromBase64, qn as fromInput, r as BigInt$2, rr as parseHeader, sr as get$7, st as encodeEffect, t as Any, tr as empty$5, tt as decodeEffect, un as toEncoded, v as Int, w as Never, wn as transform, y as Json, z as TaggedError, zn as redactUrl } from "./Schema-MiKt5K1v.mjs";
2
+ import { c as BadArgument, d as bytes, f as fromInputUnsafe, i as make$17, l as badArgument, n as FileTypeId, p as mebibytes, r as WatchBackend, t as FileSystem, u as systemError } from "./FileSystem-iEC-kUB-.mjs";
3
+ import { $i as ParentSpan, $n as addFinalizerExit, $t as suspend, A as ensuring, Ar as isSuccess, At as provideContext, B as flatMap$1, Bi as reportCauseUnsafe, Bn as isDoneCause, Br as combine$1, C as catch_, Cr as fail$3, Ct as onExitPrimitive, D as delay, Dr as interrupt$2, Dt as orElseSucceed, E as contextWith, En as exponential, Er as hasInterrupts, Et as orDie, Fr as Done, Ft as repeat, Gr as findErrorOption, Gt as scoped, Hn as build$1, Hr as done, I as filter$1, Ir as ExceededCapacityError, It as result, J as forkChild, Jn as provide$1, Jr as hasInterrupts$1, Jt as serviceOption, K as forEach, Kn as merge$1, Kr as fromReasons, Kt as scopedWith, Li as makeSpanUnsafe, Ln as catchDone, Lt as retry, M as fail$1, Mr as match$1, Mt as provideServiceEffect, N as failCause$1, Nr as succeed$3, Nt as raceFirst, O as die, On as min, Or as isExit, Pn as toStepWithSleep, Pr as void_$1, Q as fromOption, Qn as addFinalizer, Qt as succeedSome, R as filterOrFail, Rt as runFork, S as catchTags, Sn as yieldNow, Sr as die$1, St as onExit, T as context, Tr as getSuccess, Tt as option, U as fn, Un as effect, Ur as fail$2, Vr as die$2, Vt as runSync, W as fnUntraced, Wn as effectContext, Wt as scope, X as forkScoped, Xn as succeed$1, Xt as succeed, Y as forkIn$1, Yn as provideMerge, Yr as hasInterruptsOnly, Yt as sleep, Z as fromNullishOr$1, Zi as TracerTimingEnabled, Zn as Scope, Zt as succeedNone, _a as merge, _r as make$20, a as all$1, an as timeoutOption, ar as makeUnsafe$6, at as isEffect, b as catchReason, ba as Prototype, br as asVoid$1, bt as never, c as annotateLogs, ca as add, ci as pretty, cn as tryPromise, cr as TracerTimingEnabled$1, ct as logFatal, d as asVoid, da as getOption, dn as txRetry, dr as doneUnsafe, dt as map$1, ea as externalSpan, ei as isFailReason, en as sync, er as close$1, et as gen, f as cached, fa as getOrUndefined$1, ft as mapBoth, g as catchDefect, ga as makeUnsafe$7, gn as void_, ha as make$19, hn as useSpan, ht as mapError, i as addFinalizer$1, ii as makeDieReason, ir as make$18, it as interruptible, j as exit, jn as spaced, jr as map$2, jt as provideService, k as effectify, kr as isFailure, kt as provide$2, l as as, li as reasonAnnotations, ln as try_, lr as _await, lt as logWarning, m as catchCause, ma as getUnsafe$1, mn as updateContext, mr as isDeferred, n as acquireRelease, nn as tapCause, nr as fork, nt as ignoreCause, o as andThen, oa as Reference, on as timeoutOrElse, or as provide, ot as logDebug, p as callback, pa as getOrUndefinedUnsafe, pn as uninterruptibleMask, q as forever, qn as mergeAll, qr as hasDies, qt as service, r as acquireUseRelease, rn as tapError, rr as forkUnsafe, rt as interrupt$1, s as annotateCurrentSpan, sa as Service, sn as transposeOption, st as logError, t as Transaction, tn as tap, tr as closeUnsafe, tt as ignore$1, u as asSome, ua as get$5, ui as squash, un as tx, ur as done$1, ut as makeSpanScoped, va as omit, vn as whileLoop, vr as makeUnsafe$5, vt as matchCauseEffect, wr as failCause, x as catchTag, xn as withSpan, xr as asVoidAll, xt as onError, y as catchIf, yi as endSpan, yn as withFiber, yr as succeed$2, yt as matchEffect, zt as runForkWith } from "./Effect-CFIPV2Jg.mjs";
4
+ import { _ as takeAll, a as fail$4, c as make$21, d as offerUnsafe, g as take, h as sliding, i as endUnsafe, l as offer, n as collect, p as shutdown, r as end, s as failCauseUnsafe, t as bounded } from "./Queue-CyWN-MDp.mjs";
5
+ import { B as runCollect, D as mapAccum, E as map$3, F as pipeThroughChannel, G as runForEachArray, J as suspend$1, L as provideService$1, O as mapEffect, P as paginate, S as fromReadableStream, T as make$22, U as runFoldEffect, W as runForEach, X as tap$1, _ as fromChannel, a as die$3, bt as runIn, d as ensuring$1, dt as make$23, f as fail$5, ft as makeUnsafe$8, gt as interrupt$3, h as fromArray, ht as getCurrent, it as fromTransform, k as mapError$1, l as empty$3, m as flatMap$2, mt as await_, n as callback$1, nt as unwrap, o as drain$1, ot as mapError$2, p as filter$2, q as succeed$4, r as concat, rt as fromPull, st as mkUint8Array$1, t as buffer, ut as isOpen, v as fromEffect, x as fromQueue, y as fromIterable$4, yt as join$1, z as run$2 } from "./Stream-BeqiANg7.mjs";
6
+ import { n as make$24, t as Path$1 } from "./Path-BRnAx8py.mjs";
7
+ import { a as modify$1, i as makeUnsafe$9, o as set$3, r as make$25, s as update$3, t as get$6 } from "./Ref-CX3ghLq6.mjs";
8
+ import { A as Option, B as TaggedStruct, D as Null, Dt as isGreaterThanOrEqualTo, F as String$1, Hn as fromBody, I as Struct, J as UndefinedOr, Jn as fromRecordUnsafe, K as Uint8Array$1, Kn as empty$4, Mn as defaultFormatter, Q as brand, Qt as isUUID, Rn as fromInput$1, S as Literals, T as NonEmptyArray, U as Tuple, Un as toPath, X as Unknown, Y as Union, Yn as get$8, Yt as isSchema, Z as Void, _ as FiniteFromString, _r as values$2, a as Boolean$1, an as optionalKey, at as decodeUnknownEffect, cn as toCodecJson, cr as getSomes, d as Defect, dn as concat$1, dr as keys$1, dt as encodeUnknownEffect, f as Duration, fn as omit$1, fr as map$4, ft as encodeUnknownOption, g as Finite, hr as toEntries, in as optional, it as decodeTo, jt as isInt, lr as has$4, lt as encodeSync, m as Exit, mr as set$4, mt as is, n as ArraySchema, nt as decodeOption, or as fromEntries, ot as decodeUnknownOption, pt as fromJsonString, q as Uint8ArrayFromBase64, qn as fromInput, r as BigInt$2, rr as parseHeader, sr as get$7, st as encodeEffect, t as Any, tr as empty$5, tt as decodeEffect, un as toEncoded, v as Int, w as Never, wn as transform, y as Json, z as TaggedError, zn as redactUrl } from "./Schema-O3QUdX3B.mjs";
9
9
  import { $ as isFailure$1, B as sortWith, C as isReadonlyArrayEmpty, D as lastNonEmpty, E as last, G as zip, H as takeRight, L as reduce, M as match$2, N as matchLeft, R as some$1, T as join$2, U as takeWhile, V as take$1, Y as fail$6, _ as getSomes$1, a as drop$1, d as findFirstIndex, g as get$9, h as fromIterable$5, i as dedupe, it as match$3, j as map$5, k as makeBy, l as filter$3, m as flatten, n as appendAll, p as flatMap$3, r as contains$1, t as append$1, tt as isSuccess$1, u as findFirst, w as isReadonlyArrayNonEmpty, y as head$1, z as sort } from "./Array-B4kuTQeW.mjs";
10
- import { A as stream$1, M as uint8Array$1, N as Clock, P as currentTimeMillis, c as TypeId$12, j as text$1, k as empty$7, l as inspect, s as MaxBodySize } from "./HttpClientResponse-D5ZKICVV.mjs";
11
- import { $ as ActorAlreadyExistsError, A as SecretName, At as SuspendOnFailure, B as ComputerLostError, C as CommandId, Ct as isWrapper, D as uploadChunkBytes, Dt as isStreamSchema, E as fileTag, Et as getStreamSchemas, F as FileNotFoundError, Ft as wrapActivityResult, G as InvalidRequestError, H as ComputerHeldError, I as FileAccessDeniedError, It as make$27, J as UnauthenticatedError, K as HandlerFailedError, L as StepNotFoundError, Lt as remove$3, M as InvalidFileRequestError, Mt as intoResult, N as FilesUnavailableError, Nt as make$26, O as HostedFailure, P as FileTooLargeError, Pt as suspend$2, Q as ActorErasedError, R as ComputersUnavailableError, Rt as run$3, S as forkRpcOf, St as exitSchema$1, T as fileRpcsOf, Tt as ClientAbort$1, U as BlobTransferError, V as ComputerLimitError, W as StorageLimitError, X as ActorUnavailableError, Y as CallerNotAllowedError, Z as ActorNotCreatedError, _ as ExecUnknown, _t as Collector, a as ActorComputerClients, at as json, b as ComputerFileRequest, bt as ParseOptions, c as creationModesOf, ct as ResponseDefectEncoded, d as StepEnd, dt as constPong, f as StepStart, g as ExecRan, gt as spanName$1, h as ComputerSpec, ht as spanAttributes, i as ActorState, it as RpcSerialization, j as InvalidSecretNameError, jt as Suspended, k as SecretUnavailableError, kt as Complete, l as computerRpcsOf, lt as constEof, m as ComputerLogLine, n as ActorFileClients, o as Authentication, ot as layerNdjson, p as largestPage, q as CommandIdExpiredError, r as ActorSecrets, rt as withRun, s as creationErrors, st as RequestId, t as ActorClients, u as computerTag, v as execLimits, vt as makeCollectorUnsafe, w as fileChunkBytes, wt as make$29, x as computerFileBytes, xt as ServerClient, y as logPageLines, yt as make$28, z as ComputerNotFoundError } from "./actor-client.adapter-Coem7gF1.mjs";
10
+ import { A as stream$1, M as uint8Array$1, N as Clock, P as currentTimeMillis, c as TypeId$12, j as text$1, k as empty$7, l as inspect, s as MaxBodySize } from "./HttpClientResponse-CifutXCF.mjs";
11
+ import { A as SecretName, At as Suspended, B as ComputerLostError, C as CommandId, Ct as make$29, D as uploadChunkBytes, E as fileTag, Et as isStreamSchema, F as FileNotFoundError, Ft as make$27, G as HandlerFailedError, H as BlobTransferError, I as FileAccessDeniedError, It as remove$3, J as CallerNotAllowedError, K as CommandIdExpiredError, L as StepNotFoundError, Lt as run$3, M as InvalidFileRequestError, Mt as make$26, N as FilesUnavailableError, Nt as suspend$2, O as HostedFailure, Ot as Complete, P as FileTooLargeError, Pt as wrapActivityResult, Q as ActorAlreadyExistsError, R as ComputersUnavailableError, S as forkRpcOf, St as isWrapper, T as fileRpcsOf, Tt as getStreamSchemas, U as StorageLimitError, V as ComputerHeldError, W as InvalidRequestError, X as ActorNotCreatedError, Y as ActorUnavailableError, Z as ActorErasedError, _ as ExecUnknown, _t as makeCollectorUnsafe, a as ActorComputerClients, at as layerNdjson, b as ComputerFileRequest, bt as ServerClient, c as creationModesOf, ct as constEof, d as StepEnd, f as StepStart, g as ExecRan, gt as Collector, h as ComputerSpec, ht as spanName$1, i as ActorState, it as json, j as InvalidSecretNameError, jt as intoResult, k as SecretUnavailableError, kt as SuspendOnFailure, l as computerRpcsOf, m as ComputerLogLine, mt as spanAttributes, n as ActorFileClients, nt as withRun, o as Authentication, ot as RequestId, p as largestPage, q as UnauthenticatedError, r as ActorSecrets, rt as RpcSerialization, s as creationErrors, st as ResponseDefectEncoded, t as ActorClients, u as computerTag, ut as constPong, v as execLimits, vt as make$28, w as fileChunkBytes, wt as ClientAbort$1, x as computerFileBytes, xt as exitSchema$1, y as logPageLines, yt as ParseOptions, z as ComputerNotFoundError } from "./actor-client.adapter-CfKUj7Gi.mjs";
12
12
  import { a as remove$4, c as values$3, i as has$5, n as empty$8, o as set$5, r as get$10, s as size$2, t as clear } from "./MutableHashMap-f8nW8AJR.mjs";
13
13
  import { a as isFinite, g as zero, l as millis, m as toMillis, n as fromInputUnsafe$1, p as seconds, r as infinity, s as isZero } from "./Duration-EH9Vy4U6.mjs";
14
14
  import { a as indexOf, c as normalize, d as replace, f as replaceAll, g as toLowerCase, h as startsWith, i as includes, m as split, o as isEmpty$2, p as slice, t as Order, u as padStart } from "./String-q5dcsVe4.mjs";
15
- import { n as makeUnsafe$10, t as make$30 } from "./Semaphore-DOVJ4ZGS.mjs";
16
- import { c as notExtractable, d as webCryptoError, f as DecryptionFailed, h as Unsupported, i as sha256$1, l as run$4, m as InvalidKey, n as layerWebCrypto$2, o as fail$7, p as InvalidArgument, r as nameSuffix, s as invalidKey, t as Digest, u as runWithReference } from "./Digest-CBd3uv5B.mjs";
17
- import { n as layerWebCrypto$3, t as SecureRandom } from "./SecureRandom-B_U4ysO3.mjs";
18
- import { t as WebCrypto } from "./WebCrypto-ZI_GNVlw.mjs";
15
+ import { n as makeUnsafe$10, t as make$30 } from "./Semaphore-DHYKAQSv.mjs";
16
+ import { c as notExtractable, d as webCryptoError, f as DecryptionFailed, h as Unsupported, i as sha256$1, l as run$4, m as InvalidKey, n as layerWebCrypto$2, o as fail$7, p as InvalidArgument, r as nameSuffix, s as invalidKey, t as Digest, u as runWithReference } from "./Digest-CnBYV3Oh.mjs";
17
+ import { n as layerWebCrypto$3, t as SecureRandom } from "./SecureRandom-DYpl-YDn.mjs";
18
+ import { t as WebCrypto } from "./WebCrypto-C_95GMdw.mjs";
19
19
  import { i as value } from "./Redacted-RkJrG5Me.mjs";
20
20
  import { a as String$2, f as mapInput, i as Number$1, o as combine$2 } from "./Order-C1JC991I.mjs";
21
21
  import { a as tags, i as tag, r as orElse$1, s as value$1 } from "./Match-CGPLZYrV.mjs";
22
22
  import { n as empty$9, r as has$6, t as add$1 } from "./MutableHashSet-_HI572Ya.mjs";
23
- import { a as ChildProcessSpawner, n as make$31 } from "./ChildProcess-BCIwxPGc.mjs";
24
- import { o as withDefault, t as Boolean$2 } from "./Config-B6OND9WR.mjs";
23
+ import { a as ChildProcessSpawner, n as make$31 } from "./ChildProcess-UWPy-kPn.mjs";
24
+ import { o as withDefault, t as Boolean$2 } from "./Config-DEUiBxw4.mjs";
25
25
  import { i as TaggedError$1, n as Error$1 } from "./Data-CeCULr0-.mjs";
26
- import "./HttpClientError-BUeMWx70.mjs";
26
+ import "./HttpClientError-BVd83gxQ.mjs";
27
27
  import { t as match$4 } from "./Boolean-kILIvmhE.mjs";
28
28
  import * as Crypto from "node:crypto";
29
29
  import { createHash } from "node:crypto";
@@ -8187,7 +8187,7 @@ const makeProtocolWithHttpEffect = /*#__PURE__*/ fnUntraced(function* (options =
8187
8187
  }
8188
8188
  yield* writeRequest(id, constEof);
8189
8189
  if (!includesFraming) {
8190
- const responses = yield* interruptible(collect$1(queue));
8190
+ const responses = yield* interruptible(collect(queue));
8191
8191
  const encoded = parser.encode(responses);
8192
8192
  return text(encoded === void 0 ? "" : encoded, { contentType: serialization.contentType });
8193
8193
  }
@@ -8542,7 +8542,7 @@ const scopeOf$1 = fnUntraced(function* scopeOf(source, key, options) {
8542
8542
  since: sinceOf(now, options)
8543
8543
  };
8544
8544
  });
8545
- const joined = (pages) => {
8545
+ const joined$1 = (pages) => {
8546
8546
  const all = fromIterable$5(pages);
8547
8547
  return {
8548
8548
  coveredSince: match(last(all), {
@@ -8561,7 +8561,7 @@ var ActorJournal = class ActorJournal extends Service()("@akterjs/effect/contrac
8561
8561
  }
8562
8562
  static history(source) {
8563
8563
  const stream = ActorJournal.historyStream(source);
8564
- return (key, options) => map$1(runCollect(stream(key, options)), joined);
8564
+ return (key, options) => map$1(runCollect(stream(key, options)), joined$1);
8565
8565
  }
8566
8566
  static historyStream(source) {
8567
8567
  const decode = decodeEntries(source);
@@ -11408,7 +11408,7 @@ const CommandBatch = Reference("@akterjs/effect/host/command/batch/command-batch
11408
11408
  const firstSeq$1 = 1;
11409
11409
  const nextOf = 1;
11410
11410
  const IdList = fromJsonString(ArraySchema(String$1));
11411
- const journalRows = (sql, ids) => sql`SELECT command_id AS "commandId", command, exit, principal FROM akter_commands WHERE command_id IN (SELECT value FROM json_each(${ids}))`;
11411
+ const journalRows = (sql, ids) => sql`SELECT command_id AS "commandId", command, exit, principal, seq FROM akter_commands WHERE command_id IN (SELECT value FROM json_each(${ids}))`;
11412
11412
  const readJournal = fnUntraced(function* readJournal(sql, commandIds) {
11413
11413
  const ids = yield* orDie(encodeEffect(IdList)(commandIds));
11414
11414
  const [states, rows, last] = yield* all$1([
@@ -11422,8 +11422,8 @@ const readJournal = fnUntraced(function* readJournal(sql, commandIds) {
11422
11422
  onNone: () => firstSeq$1,
11423
11423
  onSome: (row) => row.seq + nextOf
11424
11424
  }),
11425
- recorded: fromIterable$2(map$5(rows, ({ commandId, ...recorded }) => [commandId, recorded])),
11426
- seqs: empty$1(),
11425
+ recorded: fromIterable$2(map$5(rows, ({ commandId, seq: _seq, ...recorded }) => [commandId, recorded])),
11426
+ seqs: fromIterable$2(map$5(rows, ({ commandId, seq }) => [commandId, seq])),
11427
11427
  state: map(head$1(states), (row) => row.value)
11428
11428
  };
11429
11429
  });
@@ -11470,10 +11470,13 @@ const CommandBatchJournal = {
11470
11470
  ...journal,
11471
11471
  state: some(value)
11472
11472
  })),
11473
- /** The seq a command recorded in this batch was given, or none when the batch did not record it. */
11474
- seq: (commandId) => flatMap$1(CommandBatch, (batch) => match(batch, {
11475
- onNone: () => succeedNone,
11476
- onSome: (open) => map$1(get$6(open.current), flatMap((journal) => get$3(journal.seqs, commandId)))
11473
+ /**
11474
+ * The seq `commandId` was journaled with, from the batch journal when it answers for the id, so a command's check
11475
+ * whether it already ran costs no round trip of its own.
11476
+ */
11477
+ seq: (sql, commandId, read) => flatMap$1(journalOf(sql), (opened) => match(filter(opened, ([, journal]) => answers(journal, commandId)), {
11478
+ onNone: () => read,
11479
+ onSome: ([, journal]) => succeed(get$3(journal.seqs, commandId))
11477
11480
  })),
11478
11481
  /** The actor's current state, from the batch journal when there is one. */
11479
11482
  state: (sql, read) => flatMap$1(journalOf(sql), match({
@@ -12980,7 +12983,7 @@ const StatusJson = fromJsonString(StepStatus);
12980
12983
  // ../effect/src/host/computer/local-computer-log.layer.ts
12981
12984
  const firstSeq = 1;
12982
12985
  const succeeded = 0;
12983
- const oneAtATime$1 = 1;
12986
+ const oneAtATime = 1;
12984
12987
  const encodeLog = encodeEffect(LogJson);
12985
12988
  const decodeLog = decodeUnknownEffect(LogJson);
12986
12989
  const ran = is(ExecRan);
@@ -13021,7 +13024,7 @@ const localLog = (path) => {
13021
13024
  const fileOf = ({ actor, name }) => path.join(actor, ".logs", `${name}.json`);
13022
13025
  const note = (place, level, message) => suspend(() => {
13023
13026
  const file = fileOf(place);
13024
- const lock = getOrElse(get$10(locks, file), () => makeUnsafe$10(oneAtATime$1));
13027
+ const lock = getOrElse(get$10(locks, file), () => makeUnsafe$10(oneAtATime));
13025
13028
  set$5(locks, file, lock);
13026
13029
  return lock.withPermit(appended$1(path, file, {
13027
13030
  level,
@@ -13038,8 +13041,6 @@ const localLog = (path) => {
13038
13041
  };
13039
13042
  };
13040
13043
  // ../effect/src/host/computer/local-computer-records.layer.ts
13041
- /** The computers one store keeps at most, the hosted engine's default store ceiling, so a dev app meets it locally. */
13042
- const storeCeiling = 4;
13043
13044
  const recordFile$1 = "computer.json";
13044
13045
  const dotsOnly = /^\.*$/u;
13045
13046
  const encodeRecord = encodeEffect(RecordJson);
@@ -13111,33 +13112,12 @@ const movedTo = fnUntraced(function* movedTo(place, record, state) {
13111
13112
  state
13112
13113
  });
13113
13114
  });
13114
- /** Every computer the store keeps, of every actor. */
13115
- const keptIn = fnUntraced(function* keptIn({ path, root }) {
13116
- const fs = yield* FileSystem;
13117
- const under = (directory) => map$1(listed$2(directory), map$5((entry) => path.join(directory, entry)));
13118
- const actors = yield* under(root);
13119
- const keys = yield* forEach(actors, under);
13120
- const computers = yield* forEach(flatten(keys), under);
13121
- return yield* filter$1(flatten(computers), (computer) => fs.exists(path.join(computer, recordFile$1)));
13122
- });
13123
- /** Makes a new computer only while the store has room, counting and making under one permit. */
13124
- const admitted = ({ computer, store }) => (making) => store.admission.withPermit(gen(function* admitComputer() {
13125
- if ((yield* keptIn(store)).length >= storeCeiling) return yield* ComputerLimitError.make({
13126
- computer,
13127
- limit: "store",
13128
- maximum: storeCeiling
13129
- });
13130
- return yield* making;
13131
- }));
13132
13115
  // ../effect/src/host/fork/fork-computers.adapter.ts
13133
13116
  const markPrefix = "@fork-";
13134
- const oneAtATime = 1;
13135
13117
  const markOf = (fork) => `${markPrefix}${encodeURIComponent(fork)}`;
13136
13118
  const storeOf = fnUntraced(function* storeOf(root) {
13137
- const path = yield* Path$1;
13138
13119
  return {
13139
- admission: yield* make$30(oneAtATime),
13140
- path,
13120
+ path: yield* Path$1,
13141
13121
  root
13142
13122
  };
13143
13123
  });
@@ -13147,10 +13127,6 @@ const failedWith = (actor) => (failure) => value$1(failure).pipe(tags({
13147
13127
  actor,
13148
13128
  message: `${actor} can't fork while its computer ${computer} is held by ${hold}, a fork that didn't finish. Retry that fork, or resume the computer with the hold ${hold}, to release it.`
13149
13129
  }),
13150
- ComputerLimitError: ({ maximum }) => InvalidRequestError.make({
13151
- actor,
13152
- message: `${actor} can't fork: copying its computers would pass the store's limit of ${String(maximum)} computers. Remove a computer, then fork again.`
13153
- }),
13154
13130
  InvalidRequestError: (invalid) => invalid
13155
13131
  }), orElse$1(() => ActorUnavailableError.make({
13156
13132
  actor,
@@ -13206,10 +13182,7 @@ const copied$1 = (store, { child, fork, parent }) => ({ name }) => {
13206
13182
  const source = placeOf(store)(parent, name);
13207
13183
  const target = placeOf(store)(child, name);
13208
13184
  const note = `copied from ${parent.actor}/${parent.key} by the fork ${fork}, stopped`;
13209
- return andThen(admitted({
13210
- computer: name,
13211
- store
13212
- })(copyOne(source, target)), localLog(store.path).note(target, "info", note));
13185
+ return andThen(copyOne(source, target), localLog(store.path).note(target, "info", note));
13213
13186
  };
13214
13187
  const alreadyKept = ({ child, parent }) => ActorUnavailableError.make({
13215
13188
  actor: parent.actor,
@@ -13405,11 +13378,8 @@ const committedVersion = (reader) => map$1(reader`SELECT COALESCE(MAX(seq), 0) A
13405
13378
  onSome: (row) => row.version
13406
13379
  }));
13407
13380
  const recordedVersion = ({ commandId, reader }) => map$1(reader`SELECT seq FROM akter_commands WHERE command_id = ${commandId}`, (rows) => map(head$1(rows), (row) => row.seq));
13408
- /** A command recorded in the running engine batch has its seq in the batch journal; any other is read. */
13409
- const commandVersion = (at) => flatMap$1(CommandBatchJournal.seq(at.commandId), (seq) => match(seq, {
13410
- onNone: () => recordedVersion(at),
13411
- onSome: () => succeed(seq)
13412
- }));
13381
+ /** A command the running engine batch's journal answers for has its seq there; any other is read. */
13382
+ const commandVersion = (at) => CommandBatchJournal.seq(at.reader, at.commandId, recordedVersion(at));
13413
13383
  /**
13414
13384
  * When a command recorded in the journal ran, in epoch milliseconds. One the running engine batch recorded, which is
13415
13385
  * not in the journal yet, has none: it ran moments ago.
@@ -13943,6 +13913,7 @@ const runStep = fnUntraced(function* runStep(place, request) {
13943
13913
  });
13944
13914
  // ../effect/src/host/computer/local-computer-files.layer.ts
13945
13915
  const extraByte = 1;
13916
+ const fileStart = 0;
13946
13917
  const checkedPath = fnUntraced(function* checkedPath(disk, target, actor) {
13947
13918
  const canonical = yield* (yield* FileSystem).realPath(target).pipe(catchReason("PlatformError", "NotFound", () => succeed(target)));
13948
13919
  if (!startsWith(`${disk}/`)(canonical)) return yield* InvalidRequestError.make({
@@ -13965,6 +13936,14 @@ const targetOf = fnUntraced(function* targetOf(place, relative, writing) {
13965
13936
  return target;
13966
13937
  }));
13967
13938
  });
13939
+ const joined = (chunks) => {
13940
+ const bytes = new Uint8Array(reduce(chunks, fileStart, (total, chunk) => total + chunk.byteLength));
13941
+ reduce(chunks, fileStart, (offset, chunk) => {
13942
+ bytes.set(chunk, offset);
13943
+ return offset + chunk.byteLength;
13944
+ });
13945
+ return bytes;
13946
+ };
13968
13947
  const readFile = fnUntraced(function* readFile(target, actor) {
13969
13948
  const fs = yield* FileSystem;
13970
13949
  const stat = yield* fs.stat(target);
@@ -13973,13 +13952,26 @@ const readFile = fnUntraced(function* readFile(target, actor) {
13973
13952
  message: "a computer file must be a regular file of at most 1 MiB"
13974
13953
  });
13975
13954
  const chunks = yield* runCollect(fs.stream(target, { bytesToRead: computerFileBytes + extraByte }));
13976
- const content = Uint8Array.from(flatMap$3(chunks, (chunk) => [...chunk]));
13955
+ const content = joined(chunks);
13977
13956
  if (content.byteLength > 1048576) return yield* InvalidRequestError.make({
13978
13957
  actor,
13979
13958
  message: "a computer file holds at most 1 MiB"
13980
13959
  });
13981
13960
  return content;
13982
13961
  });
13962
+ /** At most one call's bytes from `offset`; fewer at the end of the file. */
13963
+ const readPiece = fnUntraced(function* readPiece(target, offset, actor) {
13964
+ const fs = yield* FileSystem;
13965
+ if ((yield* fs.stat(target)).type !== "File") return yield* InvalidRequestError.make({
13966
+ actor,
13967
+ message: "a computer file must be a regular file"
13968
+ });
13969
+ const chunks = yield* runCollect(fs.stream(target, {
13970
+ bytesToRead: computerFileBytes,
13971
+ offset
13972
+ }));
13973
+ return joined(chunks);
13974
+ });
13983
13975
  const writeFile = fnUntraced(function* writeFile(target, content) {
13984
13976
  const fs = yield* FileSystem;
13985
13977
  const path = yield* Path$1;
@@ -13988,6 +13980,18 @@ const writeFile = fnUntraced(function* writeFile(target, content) {
13988
13980
  yield* fs.rename(temporary, target);
13989
13981
  return /* @__PURE__ */ new Uint8Array();
13990
13982
  }, scoped);
13983
+ /** At offset 0 the piece replaces the file; later, the file is cut to `offset` and the piece appended. */
13984
+ const writePiece = fnUntraced(function* writePiece(target, { actor, content, offset }) {
13985
+ if (offset === fileStart) return yield* writeFile(target, content);
13986
+ const fs = yield* FileSystem;
13987
+ if ((yield* fs.stat(target)).size < BigInt(offset)) return yield* InvalidRequestError.make({
13988
+ actor,
13989
+ message: "a piece must follow the bytes already written"
13990
+ });
13991
+ yield* fs.truncate(target, offset);
13992
+ yield* fs.writeFile(target, content, { flag: "a" });
13993
+ return /* @__PURE__ */ new Uint8Array();
13994
+ });
13991
13995
  const localComputerFile = fnUntraced(function* localComputerFile(place, request) {
13992
13996
  const record = yield* recordFor(place);
13993
13997
  yield* notHeld(record);
@@ -13996,13 +14000,22 @@ const localComputerFile = fnUntraced(function* localComputerFile(place, request)
13996
14000
  actor: place.actor,
13997
14001
  message: failure.message
13998
14002
  }));
13999
- if (isTagged(request, "Write") && request.content.byteLength > 1048576) return yield* InvalidRequestError.make({
14003
+ const writing = isTagged(request, "Write") || isTagged(request, "WriteAt");
14004
+ if (writing && request.content.byteLength > 1048576) return yield* InvalidRequestError.make({
14000
14005
  actor: place.actor,
14001
- message: "a computer file holds at most 1 MiB"
14006
+ message: "a computer file call carries at most 1 MiB"
14007
+ });
14008
+ const target = yield* targetOf(place, relative, writing);
14009
+ return yield* ComputerFileRequest.match(request, {
14010
+ Read: () => readFile(target, place.actor),
14011
+ ReadAt: ({ offset }) => readPiece(target, offset, place.actor),
14012
+ Write: ({ content }) => writeFile(target, content),
14013
+ WriteAt: ({ content, offset }) => writePiece(target, {
14014
+ actor: place.actor,
14015
+ content,
14016
+ offset
14017
+ })
14002
14018
  });
14003
- const target = yield* targetOf(place, relative, isTagged(request, "Write"));
14004
- if (isTagged(request, "Write")) return yield* writeFile(target, request.content);
14005
- return yield* readFile(target, place.actor);
14006
14019
  });
14007
14020
  // ../effect/src/host/computer/local-computers.adapter.ts
14008
14021
  /** Steps on one computer share it; anything that moves, forks or removes it takes every permit. */
@@ -14035,10 +14048,7 @@ const made = fnUntraced(function* made(local, place, spec) {
14035
14048
  });
14036
14049
  /** An existing computer keeps its image and size and takes the new spec's egress and secrets. */
14037
14050
  const ensureIn = (local, place, spec) => flatMap$1(findRecord(place), (found) => match(found, {
14038
- onNone: () => admitted({
14039
- computer: spec.name,
14040
- store: local
14041
- })(made(local, place, spec)),
14051
+ onNone: () => made(local, place, spec),
14042
14052
  onSome: (record) => gen(function* ensureExisting() {
14043
14053
  yield* notHeld(record);
14044
14054
  yield* present(place);
@@ -14161,13 +14171,10 @@ const forkIn = (local, place, fork) => gen(function* forkComputer() {
14161
14171
  const existing = yield* findRecord(target);
14162
14172
  if (isSome(existing)) return yield* computerOf(target, existing.value);
14163
14173
  yield* present(place);
14164
- const forked = yield* admitted({
14165
- computer: name,
14166
- store: local
14167
- })(copied(place, target, {
14174
+ const forked = yield* copied(place, target, {
14168
14175
  ...record.spec,
14169
14176
  name
14170
- }));
14177
+ });
14171
14178
  yield* local.log.note(place, "info", `forked into ${fork.into.actor}/${fork.into.key}${heldNote(fork.name, "as")}`);
14172
14179
  return yield* computerOf(target, forked);
14173
14180
  });
@@ -14216,7 +14223,6 @@ const clientFor = (local, answered) => (address) => {
14216
14223
  const localAt = fnUntraced(function* localAt(root) {
14217
14224
  const path = yield* Path$1;
14218
14225
  return {
14219
- admission: yield* make$30(onePermit),
14220
14226
  locks: empty$8(),
14221
14227
  log: localLog(path),
14222
14228
  path,
@@ -15835,27 +15841,50 @@ const invalid = (actor, message) => InvalidRequestError.make({
15835
15841
  actor,
15836
15842
  message
15837
15843
  });
15838
- const collect = (actor, source) => runFoldEffect(source, () => /* @__PURE__ */ new Uint8Array(), (before, chunk) => {
15839
- if (before.byteLength + chunk.byteLength > 1048576) return fail$1(invalid(actor, "a computer file holds at most 1 MiB"));
15840
- const joined = new Uint8Array(before.byteLength + chunk.byteLength);
15844
+ const nothing = 0;
15845
+ const next = 1;
15846
+ const concatenated = (before, after) => {
15847
+ const joined = new Uint8Array(before.byteLength + after.byteLength);
15841
15848
  joined.set(before);
15842
- joined.set(chunk, before.byteLength);
15843
- return succeed(joined);
15844
- });
15845
- const transfer = fnUntraced(function* transfer({ actor, client, request }, files) {
15849
+ joined.set(after, before.byteLength);
15850
+ return joined;
15851
+ };
15852
+ /**
15853
+ * The file's bytes as the pieces one call carries: whole pieces of `computerFileBytes`, then what is left, and one
15854
+ * empty piece for an empty file, so writing it still makes the file.
15855
+ */
15856
+ const piecesOf = (source) => mapAccum(source, () => ({
15857
+ pending: /* @__PURE__ */ new Uint8Array(),
15858
+ sent: false
15859
+ }), ({ pending, sent }, chunk) => {
15860
+ const bytes = concatenated(pending, chunk);
15861
+ const whole = Math.floor(bytes.byteLength / computerFileBytes);
15862
+ const pieces = match$4(whole > nothing, {
15863
+ onFalse: () => [],
15864
+ onTrue: () => makeBy(whole, (index) => bytes.subarray(index * computerFileBytes, (index + next) * computerFileBytes))
15865
+ });
15866
+ return [{
15867
+ pending: bytes.subarray(whole * computerFileBytes),
15868
+ sent: sent || whole > nothing
15869
+ }, pieces];
15870
+ }, { onHalt: ({ pending, sent }) => filter$3([pending], (rest) => rest.byteLength > nothing || !sent) });
15871
+ /** The computer file's pieces from its start, until one comes back short. */
15872
+ const readPieces = (read) => paginate(nothing, (offset) => map$1(read(offset), (piece) => [filter$3([piece], (bytes) => bytes.byteLength > nothing), liftPredicate(offset + piece.byteLength, () => piece.byteLength === computerFileBytes)]));
15873
+ const transfer = fnUntraced(function* transfer({ client, request }, files) {
15846
15874
  const computerPath = yield* filePathOf(request.computerPath);
15847
- if (request.direction === "toComputer") {
15848
- const content = yield* collect(actor.name, files.download(request.path));
15849
- yield* client.files(request.computer, ComputerFileRequest.cases.Write.make({
15850
- content,
15851
- path: computerPath
15852
- }));
15853
- return { bytes: content.byteLength };
15854
- }
15855
- const content = yield* client.files(request.computer, ComputerFileRequest.cases.Read.make({ path: computerPath }));
15856
- const receipt = yield* files.upload(make$22(content));
15875
+ if (request.direction === "toComputer") return { bytes: yield* runFoldEffect(piecesOf(files.download(request.path)), () => nothing, (offset, content) => as(client.files(request.computer, ComputerFileRequest.cases.WriteAt.make({
15876
+ content,
15877
+ offset,
15878
+ path: computerPath
15879
+ })), offset + content.byteLength)) };
15880
+ const copied = yield* make$25(nothing);
15881
+ const pieces = readPieces((offset) => client.files(request.computer, ComputerFileRequest.cases.ReadAt.make({
15882
+ offset,
15883
+ path: computerPath
15884
+ }))).pipe(tap$1((piece) => update$3(copied, (bytes) => bytes + piece.byteLength)));
15885
+ const receipt = yield* files.upload(pieces);
15857
15886
  return {
15858
- bytes: content.byteLength,
15887
+ bytes: yield* get$6(copied),
15859
15888
  receipt
15860
15889
  };
15861
15890
  });
@@ -1,8 +1,8 @@
1
- import { U as fn } from "../Effect-CKFpqbmw.mjs";
1
+ import { U as fn } from "../Effect-CFIPV2Jg.mjs";
2
2
  import { x as match } from "../Option-DkxSnBhp.mjs";
3
- import { t as Path } from "../Path-Djdv_eF5.mjs";
4
- import { F as String, M as Record, pt as fromJsonString, st as encodeEffect } from "../Schema-MiKt5K1v.mjs";
5
- import { a as withSubcommands, f as optional, i as withDescription$1, l as String$1, m as withDescription, o as Boolean, p as withDefault, t as make } from "../Command-Dzq9KM-h.mjs";
3
+ import { t as Path } from "../Path-BRnAx8py.mjs";
4
+ import { F as String, M as Record, pt as fromJsonString, st as encodeEffect } from "../Schema-O3QUdX3B.mjs";
5
+ import { a as withSubcommands, f as optional, i as withDescription$1, l as String$1, m as withDescription, o as Boolean, p as withDefault, t as make } from "../Command-D3hF_i6F.mjs";
6
6
  import { RunnerExitedError } from "../runner-exited.errors.mjs";
7
7
  import { environmentRunner } from "./environment-runner.pure.mjs";
8
8
  import { dev, dir, history, migrate, runRunner, writeRunner } from "./local-cli.config.mjs";
@@ -1,13 +1,13 @@
1
- import { n as Port, o as withDefault } from "../Config-B6OND9WR.mjs";
2
- import { t as error } from "../Console-BKHUkH6a.mjs";
3
- import { U as fn, _n as when } from "../Effect-CKFpqbmw.mjs";
4
- import { t as FileSystem } from "../FileSystem-4pPcEb_i.mjs";
1
+ import { n as Port, o as withDefault } from "../Config-DEUiBxw4.mjs";
2
+ import { t as error } from "../Console-DY7H086H.mjs";
3
+ import { U as fn, _n as when } from "../Effect-CFIPV2Jg.mjs";
4
+ import { t as FileSystem } from "../FileSystem-iEC-kUB-.mjs";
5
5
  import { _ as isSome, b as map, c as flatten, f as getOrElse, h as isNone, p as getOrNull, r as exists } from "../Option-DkxSnBhp.mjs";
6
- import { t as Path } from "../Path-Djdv_eF5.mjs";
7
- import { F as String, O as NullOr, g as Finite, n as ArraySchema, pt as fromJsonString, st as encodeEffect } from "../Schema-MiKt5K1v.mjs";
8
- import { r as withDescription, t as String$1 } from "../Argument-D81dqizB.mjs";
9
- import { c as Int, f as optional, h as withFallbackConfig, i as withDescription$2, l as String$2, m as withDescription$1, o as Boolean, p as withDefault$1, t as make, u as atLeast } from "../Command-Dzq9KM-h.mjs";
10
- import { a as ChildProcessSpawner, n as make$1 } from "../ChildProcess-BCIwxPGc.mjs";
6
+ import { t as Path } from "../Path-BRnAx8py.mjs";
7
+ import { F as String, O as NullOr, g as Finite, n as ArraySchema, pt as fromJsonString, st as encodeEffect } from "../Schema-O3QUdX3B.mjs";
8
+ import { r as withDescription, t as String$1 } from "../Argument-BKjmk8CZ.mjs";
9
+ import { c as Int, f as optional, h as withFallbackConfig, i as withDescription$2, l as String$2, m as withDescription$1, o as Boolean, p as withDefault$1, t as make, u as atLeast } from "../Command-D3hF_i6F.mjs";
10
+ import { a as ChildProcessSpawner, n as make$1 } from "../ChildProcess-UWPy-kPn.mjs";
11
11
  import { importInto } from "../archive/archive-cli.config.mjs";
12
12
  import { entry } from "../app-cli.config.mjs";
13
13
  import { devRunner } from "../dev-runner.pure.mjs";
@@ -1,5 +1,5 @@
1
- import { Mt as provideServiceEffect } from "../Effect-CKFpqbmw.mjs";
2
- import { c as Int, f as optional, i as withDescription$1, l as String, m as withDescription, o as Boolean, p as withDefault, t as make } from "../Command-Dzq9KM-h.mjs";
1
+ import { Mt as provideServiceEffect } from "../Effect-CFIPV2Jg.mjs";
2
+ import { c as Int, f as optional, i as withDescription$1, l as String, m as withDescription, o as Boolean, p as withDefault, t as make } from "../Command-D3hF_i6F.mjs";
3
3
  import { LogFollow } from "./log-follow.service.mjs";
4
4
  // src/logs/log-follow.config.ts
5
5
  const described = (flag, description) => flag.pipe(optional, withDescription(description));
@@ -1,16 +1,16 @@
1
1
  import { C as isReadonlyArrayEmpty } from "../Array-B4kuTQeW.mjs";
2
2
  import { t as match } from "../Boolean-kILIvmhE.mjs";
3
- import { n as log, t as error } from "../Console-BKHUkH6a.mjs";
4
- import { At as provideContext, B as flatMap, Et as orDie, Lt as retry, T as context, U as fn, Vn as effect, Xt as succeed, Yt as sleep, _n as when, aa as Service, et as gen, ht as mapError, ln as try_, o as andThen, x as catchTag, y as catchIf } from "../Effect-CKFpqbmw.mjs";
3
+ import { n as log, t as error } from "../Console-DY7H086H.mjs";
4
+ import { At as provideContext, B as flatMap, Et as orDie, Lt as retry, T as context, U as fn, Un as effect, Xt as succeed, Yt as sleep, _n as when, et as gen, ht as mapError, ln as try_, o as andThen, sa as Service, x as catchTag, y as catchIf } from "../Effect-CFIPV2Jg.mjs";
5
5
  import { C as orElse, S as none, d as fromUndefinedOr, w as some, x as match$1 } from "../Option-DkxSnBhp.mjs";
6
- import { I as Struct, cr as getSomes, pt as fromJsonString, st as encodeEffect, tt as decodeEffect } from "../Schema-MiKt5K1v.mjs";
7
- import { P as paginate, W as runForEach, Y as take } from "../Stream-bK9QIETN.mjs";
8
- import { c as LogLine, l as LogsReadParams, t as AppName, u as OrganizationName } from "../cloud-client.adapter-Cy1BjDbG.mjs";
6
+ import { I as Struct, cr as getSomes, pt as fromJsonString, st as encodeEffect, tt as decodeEffect } from "../Schema-O3QUdX3B.mjs";
7
+ import { P as paginate, W as runForEach, Y as take } from "../Stream-BeqiANg7.mjs";
8
+ import { c as LogLine, l as LogsReadParams, t as AppName, u as OrganizationName } from "../cloud-client.adapter-Ce4oyGNh.mjs";
9
9
  import { Credentials } from "../credentials/credentials.service.mjs";
10
- import { t as CloudClient } from "../cloud-client.adapter-DOVMoYAj.mjs";
10
+ import { t as CloudClient } from "../cloud-client.adapter-Dln8NW-9.mjs";
11
11
  import { progressWait, reconnectBackoff, retryable } from "../deploy/request-failure.pure.mjs";
12
12
  import { lineText, retryNotice, stopped } from "./log-lines.pure.mjs";
13
- import { reported } from "../registry/operation-output.pure.mjs";
13
+ import { s as reported } from "../operation-output.pure-ChUlePFj.mjs";
14
14
  import { CliExitError } from "../terminal/cli-exit.errors.mjs";
15
15
  // src/logs/log-follow.service.ts
16
16
  const Path = Struct({
@@ -1,11 +1,11 @@
1
- import { ti as isTimeoutError } from "../Effect-CKFpqbmw.mjs";
1
+ import { ri as isTimeoutError } from "../Effect-CFIPV2Jg.mjs";
2
2
  import { h as isNone, x as match } from "../Option-DkxSnBhp.mjs";
3
- import { Xt as isSchemaError, mt as is } from "../Schema-MiKt5K1v.mjs";
4
- import { l as isHttpClientError } from "../HttpClientError-BUeMWx70.mjs";
3
+ import { Xt as isSchemaError, mt as is } from "../Schema-O3QUdX3B.mjs";
4
+ import { l as isHttpClientError } from "../HttpClientError-BVd83gxQ.mjs";
5
5
  import { TokenRefreshError } from "../deploy/auth/token-refresh.errors.mjs";
6
6
  import { DeployFailedError } from "../deploy/deploy-failed.errors.mjs";
7
7
  import { progressStatus, progressWait, statusOf } from "../deploy/request-failure.pure.mjs";
8
- import { unanswered } from "../registry/operation-output.pure.mjs";
8
+ import { d as unanswered } from "../operation-output.pure-ChUlePFj.mjs";
9
9
  import { CliExitError } from "../terminal/cli-exit.errors.mjs";
10
10
  // src/logs/log-lines.pure.ts
11
11
  const command = "akter logs follow";
@@ -1,7 +1,7 @@
1
1
  import { L as reduce, T as join, j as map, l as filter, p as flatMap, w as isReadonlyArrayNonEmpty, y as head } from "./Array-B4kuTQeW.mjs";
2
- import { W as fnUntraced, dt as map$1, ht as mapError, ln as try_ } from "./Effect-CKFpqbmw.mjs";
2
+ import { W as fnUntraced, dt as map$1, ht as mapError, ln as try_ } from "./Effect-CFIPV2Jg.mjs";
3
3
  import { S as none, T as toArray, Tn as pipe, b as map$2, cn as isString, f as getOrElse, gt as assignProperty, h as isNone, i as filter$1, kt as formatPath, o as flatMap$1, w as some, x as match } from "./Option-DkxSnBhp.mjs";
4
- import { $t as isUnique, Bt as isMaxProperties, Ct as isFinite, D as Null, Dn as transform, Dt as isGreaterThanOrEqualTo, E as NonEmptyString, En as passthroughSubtype, F as String$1, Fn as jsonSchemaAnnotationKeys, Ft as isLessThanOrEqualTo, Ht as isMinCodePoints, I as Struct, Jt as isPropertyNames, Kt as isMultipleOf, L as StructWithRest, M as Record, Mt as isLessThan, Pn as annotationExcludedKeys, R as Symbol, Rt as isMaxCodePoints, S as Literals, T as NonEmptyArray, U as Tuple, Ut as isMinLength, W as TupleWithRest, Wt as isMinProperties, X as Unknown, Y as Union, a as Boolean, an as optionalKey, b as JsonObject, ct as encodeOption, g as Finite, in as optional, jt as isInt, k as Number, kn as transformOptional, n as ArraySchema, on as suspend, or as fromEntries, ot as decodeUnknownOption, pr as remove, pt as fromJsonString, qt as isPattern, r as BigInt, rn as makeFilterGroup, sn as tag, sr as get, tn as make, tt as decodeEffect, ut as encodeTo, w as Never, wt as isGreaterThan, x as Literal, y as Json, yn as isJson, z as TaggedError, zt as isMaxLength } from "./Schema-MiKt5K1v.mjs";
4
+ import { $t as isUnique, Bt as isMaxProperties, Ct as isFinite, D as Null, Dn as transform, Dt as isGreaterThanOrEqualTo, E as NonEmptyString, En as passthroughSubtype, F as String$1, Fn as jsonSchemaAnnotationKeys, Ft as isLessThanOrEqualTo, Ht as isMinCodePoints, I as Struct, Jt as isPropertyNames, Kt as isMultipleOf, L as StructWithRest, M as Record, Mt as isLessThan, Pn as annotationExcludedKeys, R as Symbol, Rt as isMaxCodePoints, S as Literals, T as NonEmptyArray, U as Tuple, Ut as isMinLength, W as TupleWithRest, Wt as isMinProperties, X as Unknown, Y as Union, a as Boolean, an as optionalKey, b as JsonObject, ct as encodeOption, g as Finite, in as optional, jt as isInt, k as Number, kn as transformOptional, n as ArraySchema, on as suspend, or as fromEntries, ot as decodeUnknownOption, pr as remove, pt as fromJsonString, qt as isPattern, r as BigInt, rn as makeFilterGroup, sn as tag, sr as get, tn as make, tt as decodeEffect, ut as encodeTo, w as Never, wt as isGreaterThan, x as Literal, y as Json, yn as isJson, z as TaggedError, zt as isMaxLength } from "./Schema-O3QUdX3B.mjs";
5
5
  import { d as replace } from "./String-q5dcsVe4.mjs";
6
6
  import { CliExitError } from "./terminal/cli-exit.errors.mjs";
7
7
  // ../../node_modules/.pnpm/effect@4.1.2_patch_hash=0e61176203bb1256381ce1c5b488d7951983ce38ff698647d3f4617383abbf07/node_modules/effect/dist/internal/jsonSchema.js