@ref0/git 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access/private-refs.mjs +0 -2
- package/dist/auth/authorize.mjs +31 -24
- package/dist/auth/bridge.mjs +8 -8
- package/dist/auth/fences.d.mts +0 -1
- package/dist/auth/fences.mjs +1 -1
- package/dist/auth/grants.d.mts +0 -1
- package/dist/auth/grants.mjs +2 -2
- package/dist/auth/host-function.d.mts +1 -7
- package/dist/auth/host-function.mjs +38 -38
- package/dist/auth/identify.d.mts +0 -1
- package/dist/auth/identify.mjs +1 -1
- package/dist/auth/policy.d.mts +7 -4
- package/dist/auth/policy.mjs +13 -10
- package/dist/auth/token-rows.mjs +2 -5
- package/dist/auth/tokens-layer.d.mts +0 -2
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens-public.mjs +4 -2
- package/dist/auth/tokens.d.mts +6 -1
- package/dist/auth/tokens.mjs +7 -1
- package/dist/client/client.d.mts +22 -15
- package/dist/client/client.mjs +31 -27
- package/dist/client/git-http.mjs +22 -5
- package/dist/client/local.mjs +1 -1
- package/dist/client/namespace.d.mts +2 -0
- package/dist/client/push-upload.d.mts +1 -0
- package/dist/client/push-upload.mjs +169 -2
- package/dist/client/remote-helper.mjs +2 -4
- package/dist/client/remote.mjs +37 -15
- package/dist/client/run-remote-helper.mjs +4 -4
- package/dist/client/transport.mjs +26 -19
- package/dist/contracts/actors.d.mts +57 -28
- package/dist/contracts/actors.mjs +38 -2
- package/dist/contracts/authorize.d.mts +21 -15
- package/dist/contracts/callers.mjs +40 -0
- package/dist/contracts/client.d.mts +16 -9
- package/dist/contracts/events.d.mts +12 -10
- package/dist/contracts/events.mjs +8 -6
- package/dist/contracts/files.d.mts +42 -42
- package/dist/contracts/forks.d.mts +0 -24
- package/dist/contracts/git-hooks.d.mts +217 -0
- package/dist/contracts/git-hooks.mjs +3 -1
- package/dist/contracts/grants.d.mts +46 -27
- package/dist/contracts/lfs.d.mts +17 -4
- package/dist/contracts/merges.d.mts +7 -7
- package/dist/contracts/objects.d.mts +20 -4
- package/dist/contracts/opaque.mjs +19 -1
- package/dist/contracts/operations.d.mts +8 -1
- package/dist/contracts/operations.mjs +209 -0
- package/dist/contracts/queue.d.mts +3 -3
- package/dist/contracts/queue.mjs +5 -18
- package/dist/contracts/remote.d.mts +13 -4
- package/dist/contracts/remote.mjs +3 -3
- package/dist/contracts/repos.d.mts +11 -40
- package/dist/contracts/repos.mjs +11 -10
- package/dist/contracts/result.d.mts +28 -11
- package/dist/contracts/result.mjs +32 -2
- package/dist/contracts/rules.d.mts +706 -46
- package/dist/contracts/rules.mjs +81 -2
- package/dist/contracts/server.d.mts +5 -275
- package/dist/contracts/services.d.mts +0 -3
- package/dist/contracts/services.mjs +1 -3
- package/dist/contracts/signin.d.mts +2 -2
- package/dist/contracts/signin.mjs +4 -5
- package/dist/contracts/sync.d.mts +1 -4
- package/dist/contracts/tokens.d.mts +29 -17
- package/dist/contracts/tokens.mjs +14 -3
- package/dist/contracts/topics.d.mts +38 -11
- package/dist/contracts/topics.mjs +8 -2
- package/dist/core/access.d.mts +0 -2
- package/dist/core/access.mjs +15 -4
- package/dist/core/events/deliver.mjs +19 -1
- package/dist/core/forks.mjs +30 -11
- package/dist/core/hooks/groups.d.mts +0 -1
- package/dist/core/hooks/groups.mjs +8 -9
- package/dist/core/loose-tally.mjs +46 -0
- package/dist/core/objects/writing.mjs +1 -0
- package/dist/core/promise.mjs +1 -15
- package/dist/core/purge.mjs +14 -9
- package/dist/core/push.mjs +13 -6
- package/dist/core/ref-view.mjs +14 -6
- package/dist/core/repack.mjs +19 -14
- package/dist/core/repo-info.mjs +8 -6
- package/dist/core/repos.mjs +1 -0
- package/dist/core/rules/check.mjs +10 -10
- package/dist/core/rules/context.d.mts +3 -1
- package/dist/core/rules/context.mjs +16 -13
- package/dist/core/rules/fetch.mjs +17 -23
- package/dist/core/tokens.mjs +2 -1
- package/dist/effect.d.mts +2 -4
- package/dist/effect.mjs +2 -4
- package/dist/engine/commits.mjs +19 -47
- package/dist/engine/failures.d.mts +1 -2
- package/dist/engine/failures.mjs +1 -3
- package/dist/engine/merge-base-walk.mjs +57 -142
- package/dist/engine/merge-bases.mjs +5 -5
- package/dist/engine/merge.mjs +16 -14
- package/dist/extend.d.mts +1 -2
- package/dist/extend.mjs +1 -2
- package/dist/http/core-parts.mjs +1 -2
- package/dist/http/handler.mjs +11 -31
- package/dist/http/parts.d.mts +0 -1
- package/dist/index.d.mts +28 -21
- package/dist/index.mjs +5 -2
- package/dist/lfs/base.d.mts +6 -3
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/layer.d.mts +4 -3
- package/dist/lfs/layer.mjs +23 -9
- package/dist/lfs/objects.mjs +90 -41
- package/dist/lfs/pointers.mjs +69 -18
- package/dist/lfs/purge.mjs +6 -2
- package/dist/lfs/rows.mjs +24 -7
- package/dist/lfs/service.d.mts +6 -3
- package/dist/lfs/service.mjs +8 -2
- package/dist/lfs/upkeep.mjs +44 -26
- package/dist/lfs/upload-most.mjs +41 -0
- package/dist/lfs/uploaded.mjs +59 -0
- package/dist/protocol/bytes/sha256-hasher.mjs +51 -0
- package/dist/protocol/bytes/text.mjs +6 -1
- package/dist/protocol/objects/fsck.mjs +6 -3
- package/dist/queue/advance.mjs +38 -8
- package/dist/queue/calls.mjs +4 -14
- package/dist/queue/lanes.mjs +1 -1
- package/dist/queue/rows.mjs +8 -0
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/search.mjs +3 -4
- package/dist/rest/client-namespace.d.mts +2 -0
- package/dist/rest/client.d.mts +32 -8
- package/dist/rest/client.mjs +308 -382
- package/dist/rest/commits.d.mts +240 -240
- package/dist/rest/files.d.mts +18 -18
- package/dist/rest/forks.d.mts +45 -57
- package/dist/rest/handlers.mjs +2 -1
- package/dist/rest/listen.d.mts +8 -6
- package/dist/rest/listen.mjs +31 -75
- package/dist/rest/me.d.mts +2 -2
- package/dist/rest/merges.d.mts +7 -7
- package/dist/rest/refs.d.mts +139 -139
- package/dist/rest/repos.d.mts +54 -66
- package/dist/rest/tokens.d.mts +12 -12
- package/dist/rest/topics.d.mts +110 -110
- package/dist/rest/trees.d.mts +66 -66
- package/dist/rest/wire.d.mts +1 -1
- package/dist/rest.d.mts +1 -7
- package/dist/rest.mjs +1 -5
- package/dist/server/git-layer.d.mts +10 -2
- package/dist/server/git-layer.mjs +29 -10
- package/dist/server/joined.d.mts +1 -1
- package/dist/server/server.d.mts +0 -1
- package/dist/server/server.mjs +26 -45
- package/dist/signin/context.d.mts +0 -1
- package/dist/signin/context.mjs +5 -9
- package/dist/storage/clean-up.mjs +3 -1
- package/dist/storage/fsck.mjs +12 -2
- package/dist/storage/graph-rebuild.mjs +262 -0
- package/dist/storage/index-build.mjs +100 -12
- package/dist/storage/lfs-pointers.d.mts +5 -5
- package/dist/storage/lfs-pointers.mjs +37 -11
- package/dist/storage/loose.mjs +4 -1
- package/dist/storage/memory-budget.mjs +1 -1
- package/dist/storage/merge-fence.mjs +81 -19
- package/dist/storage/merge-most.mjs +1 -0
- package/dist/storage/merge-row.mjs +16 -4
- package/dist/storage/merge-stream.mjs +9 -6
- package/dist/storage/object-rows.mjs +17 -1
- package/dist/storage/pack-receive.mjs +10 -6
- package/dist/storage/packs.mjs +58 -27
- package/dist/storage/prune.mjs +68 -40
- package/dist/storage/ready.d.mts +1 -1
- package/dist/storage/ready.mjs +12 -3
- package/dist/storage/receive-state.mjs +1 -1
- package/dist/storage/repack-contained.mjs +22 -14
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +3 -2
- package/dist/storage/unpack.mjs +7 -0
- package/dist/store/call-count.d.mts +23 -3
- package/dist/store/call-count.mjs +36 -13
- package/dist/store/records.mjs +10 -4
- package/dist/store/repo-record.mjs +29 -12
- package/dist/store/scopes.mjs +6 -1
- package/dist/sync/import.mjs +14 -2
- package/dist/sync/layer.d.mts +5 -1
- package/dist/sync/layer.mjs +7 -2
- package/dist/sync/step.mjs +15 -15
- package/dist/topics/advance.mjs +7 -6
- package/dist/topics/members.mjs +38 -9
- package/package.json +3 -3
- package/dist/engine/merge-base-walk.d.mts +0 -3
- package/dist/server/routes.d.mts +0 -32
- package/dist/server/routes.mjs +0 -69
- package/dist/sync/bridge.d.mts +0 -6
- package/dist/sync/bridge.mjs +0 -29
package/dist/queue/advance.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { fail, gitError } from "../contracts/result.mjs";
|
|
|
4
4
|
import { hostCall } from "../auth/host-function.mjs";
|
|
5
5
|
import { buildFence, checkPush, retriedCodes } from "../core/push.mjs";
|
|
6
6
|
import { host } from "../contracts/git.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { asHost, overStore } from "../core/parts.mjs";
|
|
8
8
|
import { mergedTree } from "../core/objects/commit-writes.mjs";
|
|
9
9
|
import { openRead, readerOf } from "../core/objects/reading.mjs";
|
|
10
10
|
import { MadeObjects, madeCommit, writeDigest } from "../core/objects/writing.mjs";
|
|
@@ -161,7 +161,7 @@ const groupsKey = (id, entries, most) => JSON.stringify([
|
|
|
161
161
|
/**
|
|
162
162
|
* `groupsOf`, but once per try for a candidate, its entries and its most: a step planned again
|
|
163
163
|
* after its write found the version moved, by any write in the repo, takes the groups the host
|
|
164
|
-
* gave, as it saw the lane then, so the host's `bisect` and
|
|
164
|
+
* gave, as it saw the lane then, so the host's `bisect` is asked, and its failure logged, once.
|
|
165
165
|
*/
|
|
166
166
|
const triedGroups = (tried, state, options, id, candidate, most) => {
|
|
167
167
|
const key = groupsKey(id, candidate.entries, most);
|
|
@@ -429,7 +429,10 @@ const advanceStep = /* @__PURE__ */ Effect.fnUntraced(function* (host, context,
|
|
|
429
429
|
const schedules = schedulesOf(state, options);
|
|
430
430
|
const plan = new QueuePlan(state, now);
|
|
431
431
|
if (yield* openSearched(plan, schedules)) return queueOwn(context, plan, againStep);
|
|
432
|
-
const
|
|
432
|
+
const live = holder === void 0 ? void 0 : reserved;
|
|
433
|
+
const { frozen } = row;
|
|
434
|
+
const freeze = live === void 0 && frozen !== void 0 && (yield* isLive(context.store, frozen)) ? frozen : void 0;
|
|
435
|
+
const scanned = yield* scan(plan, schedules, stack, live, freeze);
|
|
433
436
|
if (scanned === "opened") return queueOwn(context, plan, idleStep);
|
|
434
437
|
return scanned === void 0 ? idle : {
|
|
435
438
|
kind: "done",
|
|
@@ -492,6 +495,25 @@ const pinnedOf = (state, stack) => stack.filter(({ candidate }) => candidate.ent
|
|
|
492
495
|
return row !== void 0 && opensAlone(row);
|
|
493
496
|
}));
|
|
494
497
|
/**
|
|
498
|
+
* The entries a live topic's freeze of the target lets open: those ahead of its member in one of
|
|
499
|
+
* its lanes, at no higher priority, none jumped since it froze. Each was there when it froze, so
|
|
500
|
+
* the target drains of all but these, and then of these (Q1159). With no member waiting, none.
|
|
501
|
+
*/
|
|
502
|
+
const thawedOf = (state, waiting, frozen) => {
|
|
503
|
+
const at = waiting.findIndex((place) => state.entries.get(place.entry)?.topic?.topic === frozen.topic);
|
|
504
|
+
const member = waiting[at];
|
|
505
|
+
const row = member === void 0 ? void 0 : state.entries.get(member.entry);
|
|
506
|
+
if (member === void 0 || row === void 0) return /* @__PURE__ */ new Set();
|
|
507
|
+
const lanes = new Set(lanesOf(row));
|
|
508
|
+
const thawed = waiting.slice(0, at).filter((place) => {
|
|
509
|
+
const entry = state.entries.get(place.entry);
|
|
510
|
+
const shares = entry !== void 0 && lanesOf(entry).some((lane) => lanes.has(lane));
|
|
511
|
+
const before = place.jumped === void 0 || place.jumped < frozen.next;
|
|
512
|
+
return shares && place.priority <= member.priority && before;
|
|
513
|
+
});
|
|
514
|
+
return new Set(thawed.map(({ entry }) => entry));
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
495
517
|
* Opens the next candidate in the target's order, lane by lane: the oldest waiting entry whose
|
|
496
518
|
* lanes have room and a place, with the waiting entries after it in no other lane, up to the
|
|
497
519
|
* smallest `maxSize` among its lanes. An entry that can't open blocks its lanes, and every entry
|
|
@@ -499,12 +521,15 @@ const pinnedOf = (state, stack) => stack.filter(({ candidate }) => candidate.ent
|
|
|
499
521
|
* tip, with nothing landing and no other pinned one open, so nothing moves the tip under it till it
|
|
500
522
|
* ends. A topic's member waits, blocking its lanes, till its topic reserves the target, and while
|
|
501
523
|
* `live`, a topic's reservation, holds it, only that topic's member opens, wherever it is in the
|
|
502
|
-
* order. `
|
|
524
|
+
* order. While `frozen`, a live topic's freeze, holds it, only the entries `thawedOf` names open,
|
|
525
|
+
* and a short batch waits for none. `opened` once it opened one, else when a short batch's `wait`
|
|
526
|
+
* ends.
|
|
503
527
|
*/
|
|
504
|
-
const scan = /* @__PURE__ */ Effect.fnUntraced(function* (plan, schedules, stack, live) {
|
|
528
|
+
const scan = /* @__PURE__ */ Effect.fnUntraced(function* (plan, schedules, stack, live, frozen) {
|
|
505
529
|
const { state } = plan;
|
|
506
530
|
const held = stack.some(({ candidate }) => candidate.landing === true) || pinnedOf(state, stack).length > 0;
|
|
507
531
|
const waiting = orderOf(state.row.order).filter((place) => state.entries.get(place.entry)?.state === "waiting");
|
|
532
|
+
const thawed = frozen === void 0 ? void 0 : thawedOf(state, waiting, frozen);
|
|
508
533
|
const blocked = /* @__PURE__ */ new Set();
|
|
509
534
|
let soonest;
|
|
510
535
|
for (const [at, place] of waiting.entries()) {
|
|
@@ -514,6 +539,10 @@ const scan = /* @__PURE__ */ Effect.fnUntraced(function* (plan, schedules, stack
|
|
|
514
539
|
const block = () => lanes.forEach((lane) => blocked.add(lane));
|
|
515
540
|
const { topic } = row;
|
|
516
541
|
if (live !== void 0 && topic?.topic !== live.topic) continue;
|
|
542
|
+
if (thawed !== void 0 && !thawed.has(place.entry)) {
|
|
543
|
+
block();
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
517
546
|
if (live === void 0 && topic !== void 0) {
|
|
518
547
|
block();
|
|
519
548
|
continue;
|
|
@@ -552,6 +581,7 @@ const scan = /* @__PURE__ */ Effect.fnUntraced(function* (plan, schedules, stack
|
|
|
552
581
|
const own = laterRow === void 0 ? [] : lanesOf(laterRow);
|
|
553
582
|
if (laterRow === void 0 || !own.some((lane) => lanes.has(lane))) continue;
|
|
554
583
|
if (opensAlone(laterRow) || !own.every((lane) => lanes.has(lane))) break;
|
|
584
|
+
if (thawed !== void 0 && !thawed.has(later.entry)) break;
|
|
555
585
|
const key = callerKey(laterRow);
|
|
556
586
|
const past = !callers.has(key) && callers.size >= queueLimits.candidateCallers;
|
|
557
587
|
closed = laterRow.alone === true || past;
|
|
@@ -560,7 +590,7 @@ const scan = /* @__PURE__ */ Effect.fnUntraced(function* (plan, schedules, stack
|
|
|
560
590
|
batch.push(later);
|
|
561
591
|
}
|
|
562
592
|
const due = Math.min(...batch.map((open) => open.since)) + wait;
|
|
563
|
-
if (!closed && batch.length < maxSize && due > plan.now) {
|
|
593
|
+
if (!closed && thawed === void 0 && batch.length < maxSize && due > plan.now) {
|
|
564
594
|
block();
|
|
565
595
|
soonest = Math.min(soonest ?? Number.MAX_SAFE_INTEGER, due);
|
|
566
596
|
continue;
|
|
@@ -748,10 +778,10 @@ const treeOf = (linking, entry, sides) => mergedTree(linking.opened, linking.mad
|
|
|
748
778
|
/** A host's `merge` answer read as a `MergePlan`: a host in plain JavaScript may answer any value. */
|
|
749
779
|
const decodePlan = /* @__PURE__ */ Schema.decodeUnknownSync(MergePlan);
|
|
750
780
|
/** The host's plan for an entry's link: a throw or bad plan fails it `host-error`, with the failure's ID. */
|
|
751
|
-
const planOf = (linking, entry, row, commits) =>
|
|
781
|
+
const planOf = (linking, entry, row, commits) => hostCall("queue.merge", { repo: linking.repo }, () => decodePlan(linking.options.merge({
|
|
752
782
|
entry: entryOf(linking.repo, entry, row, linking.notes.get(entry) ?? {}),
|
|
753
783
|
commits
|
|
754
|
-
})))
|
|
784
|
+
}))).pipe(Effect.catch((error) => {
|
|
755
785
|
const id = error.code === "UNAVAILABLE" || error.code === "DEADLINE_EXCEEDED" ? error.context?.id ?? "" : "";
|
|
756
786
|
return Effect.fail(linkFailed(entry, {
|
|
757
787
|
kind: "host-error",
|
package/dist/queue/calls.mjs
CHANGED
|
@@ -237,23 +237,13 @@ const askJoin = (options, repo, caller, input) => {
|
|
|
237
237
|
},
|
|
238
238
|
actor: caller.actor
|
|
239
239
|
};
|
|
240
|
-
const asked =
|
|
240
|
+
const asked = hostCall("join", about, async (signal) => decodeJoin(await join({
|
|
241
241
|
repo,
|
|
242
242
|
entry,
|
|
243
243
|
actor: caller.actor,
|
|
244
244
|
signal
|
|
245
|
-
})), { timeout: 3e4 })
|
|
246
|
-
return Effect.flatMap(asked, (answer) =>
|
|
247
|
-
if (answer.kind !== "reject") return Effect.void;
|
|
248
|
-
const refused = {
|
|
249
|
-
kind: "reject",
|
|
250
|
-
message: answer.message
|
|
251
|
-
};
|
|
252
|
-
if (answer.code !== void 0) refused.code = answer.code;
|
|
253
|
-
if (answer.hint !== void 0) refused.hint = answer.hint;
|
|
254
|
-
if (answer.context !== void 0) refused.context = answer.context;
|
|
255
|
-
return Effect.fail(rejectedError(refused));
|
|
256
|
-
});
|
|
245
|
+
})), { timeout: 3e4 });
|
|
246
|
+
return Effect.flatMap(asked, (answer) => answer.kind === "reject" ? Effect.fail(rejectedError(answer)) : Effect.void);
|
|
257
247
|
};
|
|
258
248
|
/** The write a call makes as `caller`, once it's authorized. */
|
|
259
249
|
const writeAs = (caller, name, plan) => ({
|
|
@@ -360,7 +350,7 @@ const lanesFor = /* @__PURE__ */ Effect.fnUntraced(function* (caller, opened) {
|
|
|
360
350
|
from: tip ?? void 0,
|
|
361
351
|
to: input.head
|
|
362
352
|
});
|
|
363
|
-
return yield* hostCall(
|
|
353
|
+
return yield* hostCall("queue.lanes", about, async (signal) => {
|
|
364
354
|
let diffed;
|
|
365
355
|
const changes = async () => {
|
|
366
356
|
diffed ??= runIn(Effect.result(diff), scope, signal);
|
package/dist/queue/lanes.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as Schema from "effect/Schema";
|
|
|
6
6
|
const decodeLanes = /* @__PURE__ */ Schema.decodeUnknownSync(LanesAnswer);
|
|
7
7
|
/**
|
|
8
8
|
* The lanes a host's `lanes` answered, each once in the order first named: throws, which fails
|
|
9
|
-
* the entry `host-error` and
|
|
9
|
+
* the entry `host-error` and is logged at `Error`, for an answer that isn't strings, names more than
|
|
10
10
|
* `queueLimits.lanes`, or a lane outside 1 to `queueLimits.laneBytes` bytes of UTF-8 as JSON
|
|
11
11
|
* writes it, as the queue counts its other names, so a control character counts 6.
|
|
12
12
|
*/
|
package/dist/queue/rows.mjs
CHANGED
|
@@ -65,6 +65,10 @@ const PlaceRow = /* @__PURE__ */ Schema.Struct({
|
|
|
65
65
|
* candidate merged, `b` for one its report failed and `c` for one closed otherwise; `previous`: the `concurrency` last asked.
|
|
66
66
|
* `reserved`: the topic holding the target, at its attempt, which refuses every other writer while
|
|
67
67
|
* that attempt is live, the queue's own publish and `restart` among them (Q557), `since` it took it.
|
|
68
|
+
* `frozen`: the topic whose member has waited half its `waitTimeout` for the target, with `next`,
|
|
69
|
+
* the order's next number when it froze, so an entry that jumped after it is no entry ahead: while that topic is live and holds no reservation here, the queue opens no new
|
|
70
|
+
* candidate but of the entries ahead of the member in one of its lanes, at no higher priority, and
|
|
71
|
+
* the target drains (Q1159).
|
|
68
72
|
* `idle`: when the row was put with nothing open, held, searched or reserved, which every later
|
|
69
73
|
* put of an idle row keeps, and one that isn't drops: `queue.trim` deletes it `queueLimits.kept`
|
|
70
74
|
* after.
|
|
@@ -84,6 +88,10 @@ const TargetRow = /* @__PURE__ */ Schema.Struct({
|
|
|
84
88
|
...Reservation.fields,
|
|
85
89
|
since: Schema.Int
|
|
86
90
|
})),
|
|
91
|
+
frozen: Schema.optionalKey(Schema.Struct({
|
|
92
|
+
...Reservation.fields,
|
|
93
|
+
next: Schema.Int
|
|
94
|
+
})),
|
|
87
95
|
idle: Schema.optionalKey(Schema.Finite)
|
|
88
96
|
});
|
|
89
97
|
/**
|
package/dist/queue/schedule.mjs
CHANGED
|
@@ -90,7 +90,7 @@ const schedulesOf = (state, options) => {
|
|
|
90
90
|
if (option === void 0) return fallback;
|
|
91
91
|
if (!isAsked(option)) return fit(option);
|
|
92
92
|
const seen = yield* viewOf(/* @__PURE__ */ new Set([lane]));
|
|
93
|
-
return yield* hostCall(
|
|
93
|
+
return yield* hostCall("queue.schedule", about, () => fit(option(seen))).pipe(Effect.catch(() => Effect.succeed(fallback)));
|
|
94
94
|
});
|
|
95
95
|
return {
|
|
96
96
|
of: Effect.fnUntraced(function* (lane) {
|
package/dist/queue/search.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import { openCandidate } from "./calls.mjs";
|
|
|
5
5
|
import { lanesNamed, placeOf, placed } from "./lanes.mjs";
|
|
6
6
|
import { concurrencyOf, roomFor, schedulesOf } from "./schedule.mjs";
|
|
7
7
|
import { candidateOf, closeCandidate, endEntry, endSearch, isOpen, releaseEntry, setChecking } from "./steps.mjs";
|
|
8
|
-
import { CoreParts } from "../core/parts.mjs";
|
|
9
8
|
import * as Effect from "effect/Effect";
|
|
10
9
|
import * as Schema from "effect/Schema";
|
|
11
10
|
// src/queue/search.ts
|
|
@@ -87,8 +86,8 @@ const checkGroups = (answer, entries, most) => {
|
|
|
87
86
|
/**
|
|
88
87
|
* The groups to check `row`'s entries in, naming at most `most`: the host's `bisect`, given the
|
|
89
88
|
* candidate and its lane's view without it, the target's when it's in several, or halves. An
|
|
90
|
-
* answer `checkGroups` refuses, or a throw, takes halves,
|
|
91
|
-
* `queue.bisect
|
|
89
|
+
* answer `checkGroups` refuses, or a throw, takes halves, logged at `Error` as
|
|
90
|
+
* `queue.bisect`'s.
|
|
92
91
|
*/
|
|
93
92
|
const groupsOf = /* @__PURE__ */ Effect.fnUntraced(function* (state, options, id, row, most) {
|
|
94
93
|
const { bisect } = options;
|
|
@@ -99,7 +98,7 @@ const groupsOf = /* @__PURE__ */ Effect.fnUntraced(function* (state, options, id
|
|
|
99
98
|
...seen,
|
|
100
99
|
open: seen.open.filter((open) => open.id !== id)
|
|
101
100
|
};
|
|
102
|
-
return yield* hostCall(
|
|
101
|
+
return yield* hostCall("queue.bisect", { repo }, () => checkGroups(decodeGroups(bisect(candidateOf(repo, id, row), view)), row.entries, most)).pipe(Effect.catch(() => Effect.succeed(halve(row.entries))));
|
|
103
102
|
});
|
|
104
103
|
const setSearch = (plan, failed, search) => {
|
|
105
104
|
const row = plan.candidates.get(failed);
|
package/dist/rest/client.d.mts
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Result } from "../contracts/result.mjs";
|
|
1
|
+
import { RemoteCalls, RemoteOptions, WithoutSignal } from "../contracts/remote.mjs";
|
|
2
|
+
import { GitError } from "../contracts/result.mjs";
|
|
4
3
|
import { ServerCalls } from "../contracts/server.mjs";
|
|
5
4
|
import { CreatedToken, TokenCalls, TokenCreateInput, TokenTarget } from "../contracts/tokens.mjs";
|
|
6
5
|
import { RestEvents } from "./listen.mjs";
|
|
7
6
|
import { Me } from "./me.mjs";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
9
|
+
import * as Context from "effect/Context";
|
|
10
|
+
import * as Layer from "effect/Layer";
|
|
11
|
+
declare namespace client_d_exports {
|
|
12
|
+
export { RestClient, RestClientCalls, RestTokenCalls, layer, make };
|
|
13
|
+
}
|
|
8
14
|
/** `create` takes no `actor`, as REST's caller is it; `revokeKey` is a host's own, with no route. */
|
|
9
15
|
export interface RestTokenCalls extends Omit<RemoteCalls<TokenCalls>, 'create' | 'revokeKey'> {
|
|
10
|
-
readonly create: (target: TokenTarget, input: Omit<TokenCreateInput, 'actor'
|
|
16
|
+
readonly create: (target: TokenTarget, input: WithoutSignal<Omit<TokenCreateInput, 'actor'>>) => Effect.Effect<CreatedToken, GitError>;
|
|
11
17
|
}
|
|
12
|
-
/**
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The server's calls over REST, each an Effect without `actor`, and who the remote's credential
|
|
20
|
+
* is. Interrupting a call stops it, its request and any answer's body it's still reading.
|
|
21
|
+
*/
|
|
22
|
+
export interface RestClientCalls extends RemoteCalls<Omit<ServerCalls, 'tokens' | 'lfs'>> {
|
|
14
23
|
readonly tokens: RestTokenCalls;
|
|
15
24
|
readonly events: RestEvents;
|
|
16
|
-
readonly me: (
|
|
25
|
+
readonly me: () => Effect.Effect<Me, GitError>;
|
|
17
26
|
}
|
|
18
|
-
|
|
27
|
+
declare const RestClient_base: Context.ServiceClass<RestClient, "@ref0/git/RestClient", RestClientCalls>;
|
|
28
|
+
/**
|
|
29
|
+
* A REST client of one remote as a service, for a program that's handed one: with `RestClient`
|
|
30
|
+
* from `@ref0/git`, `RestClient.layer(options)` provides it.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RestClient extends /* @__PURE__ */ RestClient_base {}
|
|
33
|
+
/**
|
|
34
|
+
* A typed client for a Git server's REST at `options.url`: `HttpApiClient` over `GitRestApi`, each
|
|
35
|
+
* call an Effect that fails with the server's own `GitError`. It sends `credentials` on each
|
|
36
|
+
* request, through `options.transport` when given and the `HttpClient` it's provided otherwise. It
|
|
37
|
+
* carries none of REST's serving code.
|
|
38
|
+
*/
|
|
39
|
+
export declare const make: (options: RemoteOptions) => Effect.Effect<RestClientCalls, never, HttpClient.HttpClient>;
|
|
40
|
+
/** `RestClient` over `options`' remote, as `make` builds it. */
|
|
41
|
+
export declare const layer: (options: RemoteOptions) => Layer.Layer<RestClient, never, HttpClient.HttpClient>;
|
|
42
|
+
export { client_d_exports };
|