@kitman-sh/cli 0.14.3 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3f6mzrm7.js → chunk-07xpz8bh.js} +1 -1
- package/dist/{chunk-zxmx605h.js → chunk-4qpmjrd2.js} +2 -2
- package/dist/{chunk-44kx62t6.js → chunk-4vrfpwcr.js} +7 -7
- package/dist/{chunk-65dpe0ev.js → chunk-4ywn8fya.js} +5 -3
- package/dist/{chunk-hasfatd4.js → chunk-77jk3v8v.js} +5 -5
- package/dist/{chunk-ctpgfdzf.js → chunk-93xj74qp.js} +3 -3
- package/dist/{chunk-9avbsbvk.js → chunk-c80dvhxf.js} +6 -1
- package/dist/{chunk-er9n65mh.js → chunk-cs0b1w4z.js} +9 -9
- package/dist/{chunk-y0y2gg8d.js → chunk-cwdrhsvk.js} +2 -2
- package/dist/{chunk-rvnem2bt.js → chunk-d2x7y78c.js} +4 -4
- package/dist/{chunk-9anvghq2.js → chunk-fch7pjzh.js} +2 -2
- package/dist/{chunk-dhtx14r5.js → chunk-hbfwyjak.js} +3 -3
- package/dist/{chunk-7v1n7a6k.js → chunk-jp7cjnng.js} +4 -4
- package/dist/{chunk-91j33xf2.js → chunk-k32w2t9h.js} +6 -6
- package/dist/{chunk-tebzffha.js → chunk-me5hk67r.js} +17 -17
- package/dist/{chunk-34748vfg.js → chunk-mwdgz2s2.js} +121 -277
- package/dist/{chunk-my9vcmfw.js → chunk-mz803qps.js} +44 -30
- package/dist/{chunk-f96vy2h9.js → chunk-p2p3k2d5.js} +4 -4
- package/dist/{chunk-2w9a76nr.js → chunk-rbbh4f56.js} +177 -28
- package/dist/{chunk-rgrpvnwg.js → chunk-reb6rftm.js} +22 -22
- package/dist/{chunk-a4mkjaxa.js → chunk-s6bcx409.js} +6 -6
- package/dist/{chunk-daem5h1c.js → chunk-vt5p65jd.js} +14 -14
- package/dist/{chunk-bbf0jzsc.js → chunk-vt8aqeby.js} +1 -1
- package/dist/{chunk-zpp4jg4a.js → chunk-wttgq85b.js} +60 -60
- package/dist/{chunk-7q3t3x0x.js → chunk-zdfrtydr.js} +6 -6
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
succeed,
|
|
13
13
|
isSuccess,
|
|
14
14
|
TaggedError,
|
|
15
|
-
|
|
15
|
+
make16,
|
|
16
16
|
_await,
|
|
17
17
|
fail5,
|
|
18
18
|
succeed5,
|
|
@@ -104,7 +104,19 @@ import {
|
|
|
104
104
|
decodeJsonString,
|
|
105
105
|
encodeJsonStringSync,
|
|
106
106
|
encodePrettyJsonString
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-wttgq85b.js";
|
|
108
|
+
import {
|
|
109
|
+
tap,
|
|
110
|
+
mapError,
|
|
111
|
+
decodeText,
|
|
112
|
+
run,
|
|
113
|
+
mkString,
|
|
114
|
+
FileSystem,
|
|
115
|
+
Path,
|
|
116
|
+
withDefault,
|
|
117
|
+
option,
|
|
118
|
+
String2
|
|
119
|
+
} from "./chunk-rbbh4f56.js";
|
|
108
120
|
import {
|
|
109
121
|
currentTimeMillis,
|
|
110
122
|
SecureRandom,
|
|
@@ -220,26 +232,14 @@ import {
|
|
|
220
232
|
harnessNames,
|
|
221
233
|
herdrRunnerCapabilities2,
|
|
222
234
|
declaredChecks
|
|
223
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-mwdgz2s2.js";
|
|
224
236
|
import {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
decodeText,
|
|
228
|
-
run,
|
|
229
|
-
mkString,
|
|
230
|
-
FileSystem,
|
|
231
|
-
Path,
|
|
232
|
-
withDefault,
|
|
233
|
-
option,
|
|
234
|
-
String2
|
|
235
|
-
} from "./chunk-2w9a76nr.js";
|
|
237
|
+
Id
|
|
238
|
+
} from "./chunk-c80dvhxf.js";
|
|
236
239
|
import {
|
|
237
240
|
ChildProcessSpawner,
|
|
238
241
|
make3
|
|
239
|
-
} from "./chunk-
|
|
240
|
-
import {
|
|
241
|
-
Id
|
|
242
|
-
} from "./chunk-9avbsbvk.js";
|
|
242
|
+
} from "./chunk-4qpmjrd2.js";
|
|
243
243
|
|
|
244
244
|
// apps/cli/src/cli-error.ts
|
|
245
245
|
function cliErrorCode(error, status) {
|
|
@@ -1020,10 +1020,10 @@ var sandboxMissing = (sandbox, missing) => ({
|
|
|
1020
1020
|
var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
|
|
1021
1021
|
var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
|
|
1022
1022
|
var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
|
|
1023
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1023
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-d2x7y78c.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
|
|
1024
1024
|
});
|
|
1025
1025
|
var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
|
|
1026
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1026
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-d2x7y78c.js")), (module) => module.updateHerdrCore(options))
|
|
1027
1027
|
});
|
|
1028
1028
|
var herdrCoreMissing = (error) => {
|
|
1029
1029
|
if (isTagged(error, "HerdrCoreMissing"))
|
|
@@ -1198,7 +1198,7 @@ var settingChangeRows = (history) => history.items.map((change) => ({
|
|
|
1198
1198
|
|
|
1199
1199
|
// apps/cli/src/managed-install.ts
|
|
1200
1200
|
var RunnerReleaseManifest = Struct({
|
|
1201
|
-
version: String4.check(isPattern(/^[\w.+-]+$/u)),
|
|
1201
|
+
version: String4.check(isPattern(/^(?!\.+$)[\w.+-]+$/u)),
|
|
1202
1202
|
platforms: ArraySchema(Struct({ os: String4, architecture: String4, sha256: String4, url: String4 }))
|
|
1203
1203
|
});
|
|
1204
1204
|
var versionsDirectory = (platform) => gen(function* () {
|
|
@@ -1277,10 +1277,24 @@ var linkManagedKitman = (kitman) => gen(function* () {
|
|
|
1277
1277
|
const path = yield* Path;
|
|
1278
1278
|
const link = yield* managedKitmanPath;
|
|
1279
1279
|
const nextLink = `${link}.next`;
|
|
1280
|
+
const previous = yield* fs.readLink(link).pipe(map8((target) => path.resolve(path.dirname(link), target)), orElseSucceed(() => {
|
|
1281
|
+
return;
|
|
1282
|
+
}));
|
|
1280
1283
|
yield* fs.makeDirectory(path.dirname(link), { recursive: true });
|
|
1281
1284
|
yield* ignore(fs.remove(nextLink));
|
|
1282
1285
|
yield* fs.symlink(kitman, nextLink);
|
|
1283
1286
|
yield* fs.rename(nextLink, link);
|
|
1287
|
+
const versions = path.dirname(path.dirname(kitman));
|
|
1288
|
+
if (previous === kitman || path.basename(versions) !== "versions")
|
|
1289
|
+
return;
|
|
1290
|
+
const kept = new Set([kitman, ...previous === undefined ? [] : [previous]].map((kept) => path.dirname(kept)));
|
|
1291
|
+
const installed = yield* fs.readDirectory(versions).pipe(orElseSucceed(() => []));
|
|
1292
|
+
for (const version of installed) {
|
|
1293
|
+
const directory = path.join(versions, version);
|
|
1294
|
+
const managed = yield* fs.exists(path.join(directory, "kitman")).pipe(orElseSucceed(() => false));
|
|
1295
|
+
if (managed && !version.startsWith(".") && !kept.has(directory))
|
|
1296
|
+
yield* ignore(fs.remove(directory, { recursive: true }));
|
|
1297
|
+
}
|
|
1284
1298
|
});
|
|
1285
1299
|
var installManagedKitman = (apiUrl, platform) => gen(function* () {
|
|
1286
1300
|
const downloaded = yield* downloadManagedKitman(apiUrl, platform);
|
|
@@ -1449,7 +1463,7 @@ var syncTargets = (harness) => gen(function* () {
|
|
|
1449
1463
|
});
|
|
1450
1464
|
var syncKits = (input) => gen(function* () {
|
|
1451
1465
|
const fs = yield* FileSystem;
|
|
1452
|
-
const { syncKitSetup } = yield* promise(() => import("./chunk-
|
|
1466
|
+
const { syncKitSetup } = yield* promise(() => import("./chunk-4vrfpwcr.js"));
|
|
1453
1467
|
const harnesses = yield* syncTargets(input.harness);
|
|
1454
1468
|
const chain = yield* input.client.getKitChain(input.workspaceId);
|
|
1455
1469
|
for (const { name, problem } of chain.skipped)
|
|
@@ -2368,7 +2382,7 @@ var package_default = {
|
|
|
2368
2382
|
};
|
|
2369
2383
|
|
|
2370
2384
|
// apps/cli/src/scaffold.ts
|
|
2371
|
-
var cliVersion = "0.14.
|
|
2385
|
+
var cliVersion = "0.14.5";
|
|
2372
2386
|
var packageJson = (name, scaffold) => `${JSON.stringify({
|
|
2373
2387
|
name,
|
|
2374
2388
|
private: true,
|
|
@@ -2520,7 +2534,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
|
|
|
2520
2534
|
|
|
2521
2535
|
// apps/cli/src/commands.ts
|
|
2522
2536
|
var ClientId = "kitman-cli";
|
|
2523
|
-
var agentRuntime = promise(() => import("./chunk-
|
|
2537
|
+
var agentRuntime = promise(() => import("./chunk-reb6rftm.js"));
|
|
2524
2538
|
var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
|
|
2525
2539
|
defaultValue: () => gen(function* () {
|
|
2526
2540
|
const tui = yield* tryPromise({
|
|
@@ -3556,7 +3570,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
|
|
|
3556
3570
|
});
|
|
3557
3571
|
var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
|
|
3558
3572
|
defaultValue: () => (options) => gen(function* () {
|
|
3559
|
-
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-
|
|
3573
|
+
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-s6bcx409.js"));
|
|
3560
3574
|
return yield* makeRunnerRpcClient({
|
|
3561
3575
|
runnerId: options.runnerId,
|
|
3562
3576
|
bearer: options.bearer,
|
|
@@ -3868,7 +3882,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
3868
3882
|
yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) => map8(checkouts.reaches(repoBinding), (reachable) => ({ repoBinding, reachable })), { concurrency: 4 })), tap2((probed) => sync2(() => reached = probed)), catch_((error) => logWarning("runner_repository_probe_failed", error.message)), flatMap3(() => sleep(reached.some((probe) => !probe.reachable) ? repositoryRetryInterval : repositoryProbeInterval)), forever, forkScoped);
|
|
3869
3883
|
yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
|
|
3870
3884
|
const platform = yield* context();
|
|
3871
|
-
const updated = yield*
|
|
3885
|
+
const updated = yield* make16();
|
|
3872
3886
|
const scope = yield* scope2;
|
|
3873
3887
|
const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
|
|
3874
3888
|
const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
|
|
@@ -4123,7 +4137,7 @@ function mcpCommand(args) {
|
|
|
4123
4137
|
if (command.action === "run") {
|
|
4124
4138
|
if (command.args.length > 0)
|
|
4125
4139
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
4126
|
-
const { runMcpServerCommand } = yield* promise(() => import("./chunk-
|
|
4140
|
+
const { runMcpServerCommand } = yield* promise(() => import("./chunk-vt5p65jd.js"));
|
|
4127
4141
|
return yield* runMcpServerCommand({ flags: command.flags });
|
|
4128
4142
|
}
|
|
4129
4143
|
if (command.action !== "setup")
|
|
@@ -4611,7 +4625,7 @@ function programLoopCommand(command) {
|
|
|
4611
4625
|
return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
|
|
4612
4626
|
});
|
|
4613
4627
|
}
|
|
4614
|
-
var docsModule = promise(() => import("./chunk-
|
|
4628
|
+
var docsModule = promise(() => import("./chunk-07xpz8bh.js"));
|
|
4615
4629
|
function docsCommand(args) {
|
|
4616
4630
|
return gen(function* () {
|
|
4617
4631
|
const command = parseCommand(args);
|
|
@@ -5453,9 +5467,9 @@ function changeRequestCommand(args) {
|
|
|
5453
5467
|
yield* log(command.action === "approve" ? `Approved ${short} of ${changeRequest.title}. A Run waiting on approval of ${short} resumes; one waiting on another head does not.` : `Requested changes to ${short} of ${changeRequest.title}`);
|
|
5454
5468
|
});
|
|
5455
5469
|
}
|
|
5456
|
-
var KitWriter = map8(promise(() => import("./chunk-
|
|
5470
|
+
var KitWriter = map8(promise(() => import("./chunk-cs0b1w4z.js")), (build) => build.writeKit);
|
|
5457
5471
|
var KitBuilder = Reference("kitman/cli/KitBuilder", {
|
|
5458
|
-
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-
|
|
5472
|
+
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-cs0b1w4z.js")), (build) => build.buildKit(directory))
|
|
5459
5473
|
});
|
|
5460
5474
|
var uploadKit = (client, workspaceId, built) => gen(function* () {
|
|
5461
5475
|
yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
|
|
@@ -25,21 +25,21 @@ import {
|
|
|
25
25
|
isString2,
|
|
26
26
|
encodePrettyJsonString,
|
|
27
27
|
decodeJsonStringSync
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-wttgq85b.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSystem,
|
|
31
31
|
Path,
|
|
32
32
|
optionalEnv,
|
|
33
33
|
tempDirectoryScoped
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-rbbh4f56.js";
|
|
35
35
|
import {
|
|
36
36
|
AgentHarnessIds,
|
|
37
37
|
sha2562,
|
|
38
38
|
runCommand2
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-mwdgz2s2.js";
|
|
40
40
|
import {
|
|
41
41
|
NpmRegistry
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-hbfwyjak.js";
|
|
43
43
|
|
|
44
44
|
// packages/agent-runtime/src/config-convergence.ts
|
|
45
45
|
var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
|
|
@@ -34,8 +34,11 @@ import {
|
|
|
34
34
|
getOrUndefined,
|
|
35
35
|
map4,
|
|
36
36
|
Service2,
|
|
37
|
-
|
|
37
|
+
add,
|
|
38
|
+
get4,
|
|
38
39
|
Reference,
|
|
40
|
+
fromInputUnsafe,
|
|
41
|
+
isFinite,
|
|
39
42
|
normalize,
|
|
40
43
|
succeed,
|
|
41
44
|
fail3,
|
|
@@ -81,6 +84,7 @@ import {
|
|
|
81
84
|
fail4,
|
|
82
85
|
interrupt2,
|
|
83
86
|
void_2,
|
|
87
|
+
isSuccess2,
|
|
84
88
|
isFailure2,
|
|
85
89
|
asVoidAll,
|
|
86
90
|
makeUnsafe5,
|
|
@@ -152,12 +156,14 @@ import {
|
|
|
152
156
|
tapError2,
|
|
153
157
|
ignoreCause,
|
|
154
158
|
orElseSucceed,
|
|
159
|
+
sleep,
|
|
155
160
|
raceFirst,
|
|
156
161
|
when,
|
|
157
162
|
matchCauseEffect,
|
|
158
163
|
context,
|
|
159
164
|
contextWith,
|
|
160
165
|
provideContext2,
|
|
166
|
+
scope2,
|
|
161
167
|
scoped,
|
|
162
168
|
scopedWith,
|
|
163
169
|
acquireRelease,
|
|
@@ -168,6 +174,7 @@ import {
|
|
|
168
174
|
interrupt3,
|
|
169
175
|
onInterrupt,
|
|
170
176
|
uninterruptible,
|
|
177
|
+
uninterruptibleMask2,
|
|
171
178
|
forever,
|
|
172
179
|
forkChild,
|
|
173
180
|
forkIn,
|
|
@@ -190,11 +197,11 @@ import {
|
|
|
190
197
|
toEncoded,
|
|
191
198
|
decodeUnknownEffect,
|
|
192
199
|
SchemaError,
|
|
193
|
-
|
|
200
|
+
make17,
|
|
194
201
|
String4,
|
|
195
202
|
toCodecStringTree,
|
|
196
203
|
encodeUnknownJsonStringSync
|
|
197
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-wttgq85b.js";
|
|
198
205
|
|
|
199
206
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
|
|
200
207
|
var headUnsafe = (self) => {
|
|
@@ -363,7 +370,7 @@ var fromStringUnsafe = (input) => {
|
|
|
363
370
|
return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
|
|
364
371
|
return make(value);
|
|
365
372
|
};
|
|
366
|
-
var
|
|
373
|
+
var fromInputUnsafe2 = (input) => {
|
|
367
374
|
switch (typeof input) {
|
|
368
375
|
case "bigint":
|
|
369
376
|
if (input < bigint0)
|
|
@@ -376,7 +383,7 @@ var fromInputUnsafe = (input) => {
|
|
|
376
383
|
}
|
|
377
384
|
return invalid(`unsupported input ${input}`);
|
|
378
385
|
};
|
|
379
|
-
var bytes = (value) => typeof value === "bigint" ?
|
|
386
|
+
var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe2(value) : fromNumber(value);
|
|
380
387
|
|
|
381
388
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Fiber.js
|
|
382
389
|
var join = fiberJoin;
|
|
@@ -1302,7 +1309,7 @@ var publishUnsafe = /* @__PURE__ */ dual(2, (self, value) => {
|
|
|
1302
1309
|
return false;
|
|
1303
1310
|
});
|
|
1304
1311
|
var subscribe = (self) => uninterruptible(contextWith((services) => {
|
|
1305
|
-
const localScope =
|
|
1312
|
+
const localScope = get4(services, Scope);
|
|
1306
1313
|
const scope = forkUnsafe(self.scope);
|
|
1307
1314
|
const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
|
|
1308
1315
|
return addFinalizer(scope, unsubscribe(subscription)).pipe(andThen2(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
|
|
@@ -2759,16 +2766,158 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f)
|
|
|
2759
2766
|
}), catchDone(() => endVoid)));
|
|
2760
2767
|
var unwrap3 = (effect) => fromChannel(unwrap2(map8(effect, toChannel)));
|
|
2761
2768
|
|
|
2769
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
|
|
2770
|
+
var TypeId8 = "~effect/RcRef";
|
|
2771
|
+
var stateEmpty = {
|
|
2772
|
+
_tag: "Empty"
|
|
2773
|
+
};
|
|
2774
|
+
var stateClosed = {
|
|
2775
|
+
_tag: "Closed"
|
|
2776
|
+
};
|
|
2777
|
+
var variance2 = {
|
|
2778
|
+
_A: identity,
|
|
2779
|
+
_E: identity
|
|
2780
|
+
};
|
|
2781
|
+
|
|
2782
|
+
class RcRefImpl {
|
|
2783
|
+
[TypeId8] = variance2;
|
|
2784
|
+
pipe() {
|
|
2785
|
+
return pipeArguments(this, arguments);
|
|
2786
|
+
}
|
|
2787
|
+
state = stateEmpty;
|
|
2788
|
+
acquire;
|
|
2789
|
+
context;
|
|
2790
|
+
scope;
|
|
2791
|
+
idleTimeToLive;
|
|
2792
|
+
constructor(acquire, context, scope, idleTimeToLive) {
|
|
2793
|
+
this.acquire = acquire;
|
|
2794
|
+
this.context = context;
|
|
2795
|
+
this.scope = scope;
|
|
2796
|
+
this.idleTimeToLive = idleTimeToLive;
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
var make6 = (options) => withFiber2((fiber) => {
|
|
2800
|
+
const context = fiber.context;
|
|
2801
|
+
const scope = get4(context, Scope);
|
|
2802
|
+
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
|
|
2803
|
+
return as(addFinalizerExit(scope, () => {
|
|
2804
|
+
const state = ref.state;
|
|
2805
|
+
ref.state = stateClosed;
|
|
2806
|
+
if (state._tag === "Acquired")
|
|
2807
|
+
return close(state.scope, void_2);
|
|
2808
|
+
if (state._tag === "Acquiring")
|
|
2809
|
+
return interrupt(state.fiber);
|
|
2810
|
+
return void_3;
|
|
2811
|
+
}), ref);
|
|
2812
|
+
});
|
|
2813
|
+
var getState = (self, restore) => {
|
|
2814
|
+
switch (self.state._tag) {
|
|
2815
|
+
case "Closed": {
|
|
2816
|
+
return interrupt3;
|
|
2817
|
+
}
|
|
2818
|
+
case "Acquired": {
|
|
2819
|
+
const state = self.state;
|
|
2820
|
+
state.refCount++;
|
|
2821
|
+
return state.fiber ? as(interrupt(state.fiber), state) : succeed6(state);
|
|
2822
|
+
}
|
|
2823
|
+
case "Acquiring": {
|
|
2824
|
+
const state = self.state;
|
|
2825
|
+
state.awaiters++;
|
|
2826
|
+
return awaitAcquiring(self, state, restore);
|
|
2827
|
+
}
|
|
2828
|
+
case "Empty": {
|
|
2829
|
+
const acquiring = {
|
|
2830
|
+
_tag: "Acquiring",
|
|
2831
|
+
fiber: undefined,
|
|
2832
|
+
awaiters: 1,
|
|
2833
|
+
acquired: undefined
|
|
2834
|
+
};
|
|
2835
|
+
self.state = acquiring;
|
|
2836
|
+
const scope = makeUnsafe6();
|
|
2837
|
+
const acquire = provideContext2(self.acquire, add(self.context, Scope, scope)).pipe(flatMap3((value) => {
|
|
2838
|
+
if (self.state !== acquiring) {
|
|
2839
|
+
return interrupt3;
|
|
2840
|
+
}
|
|
2841
|
+
const state = {
|
|
2842
|
+
_tag: "Acquired",
|
|
2843
|
+
value,
|
|
2844
|
+
scope,
|
|
2845
|
+
fiber: undefined,
|
|
2846
|
+
refCount: acquiring.awaiters,
|
|
2847
|
+
invalidated: false
|
|
2848
|
+
};
|
|
2849
|
+
self.state = state;
|
|
2850
|
+
acquiring.acquired = state;
|
|
2851
|
+
return succeed6(state);
|
|
2852
|
+
}), onExit((exit) => {
|
|
2853
|
+
if (isSuccess2(exit))
|
|
2854
|
+
return void_3;
|
|
2855
|
+
if (self.state === acquiring)
|
|
2856
|
+
self.state = stateEmpty;
|
|
2857
|
+
return close(scope, exit);
|
|
2858
|
+
}));
|
|
2859
|
+
acquiring.fiber = runForkWith(getCurrent().context)(acquire);
|
|
2860
|
+
return awaitAcquiring(self, acquiring, restore);
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
};
|
|
2864
|
+
var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
|
|
2865
|
+
const acquired = acquiring.acquired;
|
|
2866
|
+
if (acquired !== undefined) {
|
|
2867
|
+
return isFailure2(exit) ? release(self, acquired) : void_3;
|
|
2868
|
+
}
|
|
2869
|
+
if (--acquiring.awaiters > 0 || self.state !== acquiring)
|
|
2870
|
+
return void_3;
|
|
2871
|
+
self.state = stateEmpty;
|
|
2872
|
+
return interrupt(acquiring.fiber);
|
|
2873
|
+
});
|
|
2874
|
+
var get2 = (self_) => {
|
|
2875
|
+
const self = self_;
|
|
2876
|
+
return uninterruptibleMask2((restore) => flatMap3(scope2, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
|
|
2877
|
+
};
|
|
2878
|
+
var release = (self, state) => {
|
|
2879
|
+
state.refCount--;
|
|
2880
|
+
if (state.refCount > 0) {
|
|
2881
|
+
return void_3;
|
|
2882
|
+
}
|
|
2883
|
+
const idleTimeToLive = self.idleTimeToLive;
|
|
2884
|
+
if (idleTimeToLive === undefined || state.invalidated) {
|
|
2885
|
+
if (self.state === state) {
|
|
2886
|
+
self.state = stateEmpty;
|
|
2887
|
+
}
|
|
2888
|
+
return close(state.scope, void_2);
|
|
2889
|
+
} else if (!isFinite(idleTimeToLive)) {
|
|
2890
|
+
return void_3;
|
|
2891
|
+
}
|
|
2892
|
+
state.fiber = uninterruptibleMask2((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
|
|
2893
|
+
if (self.state === state && state.refCount === 0) {
|
|
2894
|
+
self.state = stateEmpty;
|
|
2895
|
+
return ignoreCause(close(state.scope, void_2), {
|
|
2896
|
+
log: "Unhandled",
|
|
2897
|
+
message: "Unhandled error in RcRef finalizer"
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
return void_3;
|
|
2901
|
+
})).pipe(ensuring2(sync2(() => {
|
|
2902
|
+
state.fiber = undefined;
|
|
2903
|
+
})), runForkWith(self.context), runIn(self.scope));
|
|
2904
|
+
return void_3;
|
|
2905
|
+
};
|
|
2906
|
+
|
|
2907
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
|
|
2908
|
+
var make10 = make6;
|
|
2909
|
+
var get3 = get2;
|
|
2910
|
+
|
|
2762
2911
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stream.js
|
|
2763
|
-
var
|
|
2764
|
-
var isStream = (u) => hasProperty(u,
|
|
2912
|
+
var TypeId9 = "~effect/Stream";
|
|
2913
|
+
var isStream = (u) => hasProperty(u, TypeId9);
|
|
2765
2914
|
var fromChannel2 = fromChannel3;
|
|
2766
2915
|
var fromPull2 = (pull) => fromChannel2(fromPull(pull));
|
|
2767
2916
|
var transformPull2 = (self, f) => fromChannel2(fromTransform((_, scope) => flatMap3(toPullScoped(self.channel, scope), (pull) => f(pull, scope))));
|
|
2768
2917
|
var toChannel2 = (stream) => stream.channel;
|
|
2769
2918
|
var callback = (f, options) => fromChannel2(callbackArray(f, options));
|
|
2770
2919
|
var empty2 = /* @__PURE__ */ fromChannel2(empty);
|
|
2771
|
-
var
|
|
2920
|
+
var make11 = (...values) => fromArray2(values);
|
|
2772
2921
|
var suspend = (stream) => {
|
|
2773
2922
|
const suspended = fromChannel2(suspend4(() => stream().channel));
|
|
2774
2923
|
suspendedStreams.set(suspended, stream);
|
|
@@ -2949,11 +3098,11 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
|
|
|
2949
3098
|
var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map8(context(), (context) => toReadableStreamWith(self, context, options)));
|
|
2950
3099
|
|
|
2951
3100
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
|
|
2952
|
-
var
|
|
3101
|
+
var TypeId10 = "~effect/FileSystem";
|
|
2953
3102
|
var FileSystem = /* @__PURE__ */ Service2("effect/FileSystem");
|
|
2954
|
-
var
|
|
3103
|
+
var make12 = (impl) => FileSystem.of({
|
|
2955
3104
|
...impl,
|
|
2956
|
-
[
|
|
3105
|
+
[TypeId10]: TypeId10,
|
|
2957
3106
|
glob: make2(impl),
|
|
2958
3107
|
exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
|
|
2959
3108
|
readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
|
|
@@ -2969,11 +3118,11 @@ var make11 = (impl) => FileSystem.of({
|
|
|
2969
3118
|
const file = yield* impl.open(path, {
|
|
2970
3119
|
flag: "r"
|
|
2971
3120
|
});
|
|
2972
|
-
const offset = options?.offset === undefined ? undefined :
|
|
3121
|
+
const offset = options?.offset === undefined ? undefined : fromInputUnsafe2(options.offset);
|
|
2973
3122
|
if (offset) {
|
|
2974
3123
|
yield* file.seek(offset, "start");
|
|
2975
3124
|
}
|
|
2976
|
-
const bytesToRead = options?.bytesToRead === undefined ? undefined :
|
|
3125
|
+
const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe2(options.bytesToRead);
|
|
2977
3126
|
let totalBytesRead = BigInt(0);
|
|
2978
3127
|
const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
|
|
2979
3128
|
const readChunk = file.readAlloc(chunkSize);
|
|
@@ -3009,11 +3158,11 @@ class WatchBackend extends (/* @__PURE__ */ Service2()("effect/FileSystem/WatchB
|
|
|
3009
3158
|
}
|
|
3010
3159
|
|
|
3011
3160
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
|
|
3012
|
-
var
|
|
3161
|
+
var TypeId11 = "~effect/Path";
|
|
3013
3162
|
var Path = /* @__PURE__ */ Service2("effect/Path");
|
|
3014
|
-
var
|
|
3163
|
+
var make13 = (impl) => Path.of({
|
|
3015
3164
|
...impl,
|
|
3016
|
-
[
|
|
3165
|
+
[TypeId11]: TypeId11,
|
|
3017
3166
|
resolveWithin(root, input) {
|
|
3018
3167
|
if (impl.parse(input).root !== "")
|
|
3019
3168
|
return none();
|
|
@@ -3086,7 +3235,7 @@ function makeProvider(load, mapInput) {
|
|
|
3086
3235
|
function makeSource(get, transform) {
|
|
3087
3236
|
return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
|
|
3088
3237
|
}
|
|
3089
|
-
function
|
|
3238
|
+
function make7(get) {
|
|
3090
3239
|
return makeSource(get, identityPath);
|
|
3091
3240
|
}
|
|
3092
3241
|
function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
@@ -3095,7 +3244,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
|
3095
3244
|
function fromEnvRecord(env, options) {
|
|
3096
3245
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
3097
3246
|
const trie = buildEnvTrie(env);
|
|
3098
|
-
return
|
|
3247
|
+
return make7((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
|
|
3099
3248
|
}
|
|
3100
3249
|
function fromEnv(options) {
|
|
3101
3250
|
const env = options?.env ?? {
|
|
@@ -3148,7 +3297,7 @@ function trieNodeAt(root, path) {
|
|
|
3148
3297
|
}
|
|
3149
3298
|
|
|
3150
3299
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Config.js
|
|
3151
|
-
var
|
|
3300
|
+
var TypeId12 = "~effect/Config";
|
|
3152
3301
|
class ConfigError {
|
|
3153
3302
|
_tag = "ConfigError";
|
|
3154
3303
|
name = "ConfigError";
|
|
@@ -3170,14 +3319,14 @@ var Proto2 = {
|
|
|
3170
3319
|
return this.parse(fiber.getRef(ConfigProvider));
|
|
3171
3320
|
}
|
|
3172
3321
|
}),
|
|
3173
|
-
[
|
|
3322
|
+
[TypeId12]: TypeId12,
|
|
3174
3323
|
toJSON() {
|
|
3175
3324
|
return {
|
|
3176
3325
|
_id: "Config"
|
|
3177
3326
|
};
|
|
3178
3327
|
}
|
|
3179
3328
|
};
|
|
3180
|
-
function
|
|
3329
|
+
function make14(evaluator) {
|
|
3181
3330
|
const self = Object.create(Proto2);
|
|
3182
3331
|
self.evaluator = evaluator;
|
|
3183
3332
|
self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
|
|
@@ -3185,14 +3334,14 @@ function make7(evaluator) {
|
|
|
3185
3334
|
}
|
|
3186
3335
|
var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
|
|
3187
3336
|
var map3 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
3188
|
-
return
|
|
3337
|
+
return make14((provider, pathPrefix) => map8(evaluateAt(self, provider, pathPrefix), map5(f)));
|
|
3189
3338
|
});
|
|
3190
3339
|
function all(arg) {
|
|
3191
3340
|
const configs = globalThis.Array.isArray(arg) ? arg : (Symbol.iterator in arg) ? [...arg] : arg;
|
|
3192
|
-
return
|
|
3341
|
+
return make14((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all3(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all2) : mapEager(all3(map(configs, (config) => evaluateAt(config, provider, pathPrefix))), all2));
|
|
3193
3342
|
}
|
|
3194
3343
|
var withDefault = /* @__PURE__ */ dual(2, (self, defaultValue) => {
|
|
3195
|
-
return
|
|
3344
|
+
return make14((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
|
|
3196
3345
|
});
|
|
3197
3346
|
var option = (self) => self.pipe(map3(some), withDefault(none()));
|
|
3198
3347
|
var isSourceError = (u) => isTagged(u, "SourceError");
|
|
@@ -3309,9 +3458,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
|
|
|
3309
3458
|
function schema(codec, path) {
|
|
3310
3459
|
const codecStringTree = toCodecStringTree(codec);
|
|
3311
3460
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
3312
|
-
const decodeCursor = decodeUnknownEffect(
|
|
3461
|
+
const decodeCursor = decodeUnknownEffect(make17(toConfigCursorAST(codecStringTree.ast)));
|
|
3313
3462
|
const localPath = typeof path === "string" ? [path] : path ?? [];
|
|
3314
|
-
return
|
|
3463
|
+
return make14((provider, pathPrefix) => {
|
|
3315
3464
|
const fullPath = [...pathPrefix, ...localPath];
|
|
3316
3465
|
return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed), catchEager((issue) => {
|
|
3317
3466
|
const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
|
|
@@ -3426,4 +3575,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
|
|
|
3426
3575
|
...argv
|
|
3427
3576
|
];
|
|
3428
3577
|
|
|
3429
|
-
export { map, makeEquivalence, bytes, join, interrupt, getCurrent,
|
|
3578
|
+
export { map, makeEquivalence, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, take2, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
|