@inflatable-cookie/longhorn 0.5.0 → 0.7.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/README.md +2 -2
- package/package.json +1 -7
- package/src/agent-control/generated/protocol.ts +228 -0
- package/src/agent-control/index.ts +1 -5
- package/src/agent-control/inject.ts +4 -1
- package/src/agent-control/selection.ts +42 -25
- package/src/agent-control/shim.ts +428 -198
- package/src/bridge/direct.ts +1 -1
- package/src/bridge/generated/fields.ts +4 -3
- package/src/bridge/generated/protocol.ts +62 -7
- package/src/bridge/generated/variant-fields.ts +1 -1
- package/src/bridge/job.ts +49 -12
- package/src/bridge/loopback.ts +7 -25
- package/src/bridge/operation.ts +13 -43
- package/src/bridge/router.ts +10 -23
- package/src/bridge/runtime/connection.ts +78 -109
- package/src/bridge/runtime/policy.ts +8 -28
- package/src/bridge/runtime/retry.ts +6 -18
- package/src/bridge/session.ts +4 -14
- package/src/bridge/stream/connection.ts +24 -55
- package/src/bridge/stream/source.ts +2 -6
- package/src/bridge/stream/tracker.ts +12 -12
- package/src/bridge/supervision.ts +104 -97
- package/src/bridge/validation/base.ts +21 -63
- package/src/bridge/validation/jobs.ts +11 -25
- package/src/bridge/validation/negotiation.ts +28 -43
- package/src/bridge/validation/operations.ts +29 -65
- package/src/bridge/validation/streams.ts +3 -10
- package/src/commands/client.ts +37 -28
- package/src/commands/controller.ts +119 -96
- package/src/commands/generated/fields.ts +7 -6
- package/src/commands/generated/protocol.ts +28 -1
- package/src/commands/generated/variant-fields.ts +1 -1
- package/src/commands/keyboard.ts +94 -100
- package/src/commands/physical-code.ts +11 -0
- package/src/commands/ports.ts +8 -13
- package/src/commands/projectors.ts +100 -75
- package/src/commands/validation.ts +434 -241
- package/src/config/client.ts +9 -22
- package/src/config/generated/base.ts +22 -6
- package/src/config/generated/fields.ts +4 -3
- package/src/config/generated/label-template.ts +1 -1
- package/src/config/generated/labels.ts +1 -1
- package/src/config/generated/protocol.ts +1 -1
- package/src/config/generated/restore.ts +35 -12
- package/src/config/generated/variant-fields.ts +1 -1
- package/src/config/names.ts +6 -12
- package/src/config/validation/commands.ts +11 -25
- package/src/config/validation/outcomes.ts +163 -70
- package/src/config/validation/primitives.ts +35 -80
- package/src/config/validation/projection.ts +100 -128
- package/src/core/connection.ts +187 -83
- package/src/core/controller-lifecycle.ts +144 -0
- package/src/core/generated/identifiers.ts +4 -0
- package/src/core/identifiers.ts +40 -0
- package/src/core/index.ts +10 -1
- package/src/core/json-value.ts +58 -0
- package/src/core/listeners.ts +35 -0
- package/src/core/record.ts +80 -0
- package/src/core/transport.ts +9 -11
- package/src/core/wire-copy.ts +7 -0
- package/src/history/client.ts +11 -13
- package/src/history/controller.ts +106 -108
- package/src/history/direct.ts +1 -3
- package/src/history/generated/fields.ts +4 -3
- package/src/history/generated/protocol.ts +8 -5
- package/src/history/generated/variant-fields.ts +1 -1
- package/src/history/ports.ts +7 -4
- package/src/history/serialized.ts +9 -13
- package/src/history/validation.ts +69 -75
- package/src/history-tree/client.ts +89 -11
- package/src/history-tree/controller.ts +380 -96
- package/src/history-tree/direct.ts +3 -1
- package/src/history-tree/generated/fields.ts +5 -3
- package/src/history-tree/generated/protocol.ts +43 -7
- package/src/history-tree/generated/variant-fields.ts +7 -1
- package/src/history-tree/ports.ts +12 -5
- package/src/history-tree/serialized.ts +39 -11
- package/src/history-tree/validation.ts +286 -78
- package/src/layout/generated/protocol.ts +4 -3
- package/src/layout/generated/variant-fields.ts +47 -0
- package/src/layout/index.ts +1 -1
- package/src/layout/ratio.ts +10 -9
- package/src/layout/validation.ts +98 -32
- package/src/layout/visibility.ts +1 -2
- package/src/licence/client.ts +48 -7
- package/src/licence/controller.ts +127 -70
- package/src/licence/direct.ts +3 -1
- package/src/licence/generated/fields.ts +4 -3
- package/src/licence/generated/key-conformance.json +28 -0
- package/src/licence/generated/protocol.ts +9 -5
- package/src/licence/generated/variant-fields.ts +1 -1
- package/src/licence/key.ts +42 -18
- package/src/licence/ports.ts +10 -3
- package/src/licence/serialized.ts +32 -9
- package/src/licence/validation.ts +134 -43
- package/src/native-content/client.ts +207 -234
- package/src/native-content/generated/fields.ts +6 -6
- package/src/native-content/generated/protocol.ts +16 -5
- package/src/native-content/generated/variant-fields.ts +1 -1
- package/src/native-content/ports.ts +11 -16
- package/src/native-content/serialized.ts +12 -19
- package/src/native-content/validation/base.ts +57 -80
- package/src/native-content/validation/messages.ts +24 -35
- package/src/native-content/validation/state.ts +31 -33
- package/src/notifications/client.ts +85 -51
- package/src/notifications/controller.ts +400 -145
- package/src/notifications/direct.ts +3 -1
- package/src/notifications/generated/fields.ts +4 -3
- package/src/notifications/generated/labels.ts +1 -1
- package/src/notifications/generated/protocol.ts +5 -1
- package/src/notifications/generated/variant-fields.ts +1 -1
- package/src/notifications/ports.ts +9 -4
- package/src/notifications/serialized.ts +11 -9
- package/src/notifications/tone.ts +1 -1
- package/src/notifications/validation.ts +165 -71
- package/src/operation/bridge.ts +187 -60
- package/src/operation/client.ts +48 -62
- package/src/operation/controller.ts +67 -97
- package/src/operation/direct.ts +1 -3
- package/src/operation/generated/fields.ts +4 -3
- package/src/operation/generated/labels.ts +1 -1
- package/src/operation/generated/protocol.ts +5 -1
- package/src/operation/generated/variant-fields.ts +1 -1
- package/src/operation/ports.ts +12 -10
- package/src/operation/serialized.ts +8 -9
- package/src/operation/validation.ts +189 -104
- package/src/settings/client.ts +11 -44
- package/src/settings/connection.ts +35 -53
- package/src/settings/generated/fields.ts +5 -4
- package/src/settings/generated/protocol.ts +14 -5
- package/src/settings/generated/variant-fields.ts +1 -1
- package/src/settings/names.ts +2 -4
- package/src/settings/registry.ts +23 -25
- package/src/settings/validation/authority.ts +21 -19
- package/src/settings/validation/command.ts +22 -41
- package/src/settings/validation/error.ts +2 -8
- package/src/settings/validation/primitives.ts +46 -97
- package/src/settings/validation/projection.ts +8 -24
- package/src/settings/validation/registry.ts +33 -79
- package/src/surface-transfer/client.ts +6 -18
- package/src/surface-transfer/generated/fields.ts +3 -3
- package/src/surface-transfer/generated/protocol.ts +3 -3
- package/src/surface-transfer/generated/variant-fields.ts +1 -1
- package/src/surface-transfer/validation.ts +91 -86
- package/src/surfaces/client.ts +33 -55
- package/src/surfaces/generated/fields.ts +3 -3
- package/src/surfaces/generated/protocol.ts +1 -1
- package/src/surfaces/generated/variant-fields.ts +1 -1
- package/src/surfaces/validation.ts +227 -99
- package/src/transfer/client.ts +26 -60
- package/src/transfer/connection.ts +29 -51
- package/src/transfer/generated/fields.ts +7 -6
- package/src/transfer/generated/protocol.ts +13 -5
- package/src/transfer/generated/variant-fields.ts +1 -1
- package/src/transfer/index.ts +8 -1
- package/src/transfer/payload.ts +20 -35
- package/src/transfer/validation.ts +169 -119
- package/src/update/client.ts +86 -9
- package/src/update/controller.ts +264 -116
- package/src/update/direct.ts +3 -1
- package/src/update/generated/fields.ts +5 -4
- package/src/update/generated/protocol.ts +25 -9
- package/src/update/generated/variant-fields.ts +4 -2
- package/src/update/ports.ts +14 -6
- package/src/update/serialized.ts +36 -10
- package/src/update/validation.ts +118 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// @generated by `effigy generate:
|
|
1
|
+
// @generated by `effigy generate:bindings`; do not edit.
|
|
2
2
|
// Rust serde types are authoritative. Product payloads are intentionally absent.
|
|
3
3
|
|
|
4
|
-
export const FORK_HISTORY_PROTOCOL_VERSION =
|
|
4
|
+
export const FORK_HISTORY_PROTOCOL_VERSION = 2 as const;
|
|
5
5
|
export const MAXIMUM_FORK_HISTORY_PAGE_SIZE = 256 as const;
|
|
6
6
|
export const FORK_HISTORY_ENTRY_POSITIONS = ["past","current","future"] as const;
|
|
7
7
|
export const FORK_HISTORY_PATH_TARGETS = ["default","branch","continuation"] as const;
|
|
@@ -10,7 +10,9 @@ export const FORK_HISTORY_NAVIGATION_TARGETS = ["undo","redo","checkout","checko
|
|
|
10
10
|
export const FORK_HISTORY_NAVIGATION_REJECTION_CODES = ["incompatibleProtocol","staleAuthority","foreignHistory","staleRevision","nothingToUndo","nothingToRedo","alreadyAtTarget","unknownTarget","unauthorized","applyFailed","rollbackFailed","invalidRequest"] as const;
|
|
11
11
|
export const FORK_HISTORY_NAVIGATION_STATUSES = ["committed","rejected"] as const;
|
|
12
12
|
export const FORK_HISTORY_CHANGED_KINDS = ["record","navigation","branchMetadata","retention","checkpoint","imported","reset"] as const;
|
|
13
|
-
export const
|
|
13
|
+
export const FORK_HISTORY_RETENTION_REJECTION_CODES = ["incompatibleProtocol","staleAuthority","foreignHistory","staleRevision","unknownEntry","currentNodeInSubtree","entryOnCurrentPath","pinnedBranchInSubtree","zeroLimit","limitTooLarge","unauthorized","invalidRequest"] as const;
|
|
14
|
+
export const FORK_HISTORY_DELETE_STATUSES = ["deleted","rejected"] as const;
|
|
15
|
+
export const FORK_HISTORY_PRUNE_STATUSES = ["rejected","unchanged","pruned"] as const;
|
|
14
16
|
|
|
15
17
|
export type HistoryId = string;
|
|
16
18
|
|
|
@@ -143,13 +145,13 @@ position: ForkProjectionPosition,
|
|
|
143
145
|
*/
|
|
144
146
|
continuationCount: number, };
|
|
145
147
|
|
|
146
|
-
export type ForkPathFloorProjection = { "kind": "origin" } | { "kind": "anchor",
|
|
148
|
+
export type ForkPathFloorProjection = { "kind": "origin", } | { "kind": "anchor",
|
|
147
149
|
/**
|
|
148
150
|
* The fork point.
|
|
149
151
|
*/
|
|
150
152
|
entryId: HistoryEntryId, };
|
|
151
153
|
|
|
152
|
-
export type ForkPathTargetProjection = { "kind": "default" } | { "kind": "branch",
|
|
154
|
+
export type ForkPathTargetProjection = { "kind": "default", } | { "kind": "branch",
|
|
153
155
|
/**
|
|
154
156
|
* Explicit first-class branch selection.
|
|
155
157
|
*/
|
|
@@ -470,6 +472,32 @@ expectedRevision: HistoryRevision,
|
|
|
470
472
|
*/
|
|
471
473
|
entryId: HistoryEntryId, };
|
|
472
474
|
|
|
475
|
+
export type ForkRetentionRejectionCode = "incompatibleProtocol" | "staleAuthority" | "foreignHistory" | "staleRevision" | "unknownEntry" | "currentNodeInSubtree" | "entryOnCurrentPath" | "pinnedBranchInSubtree" | "zeroLimit" | "limitTooLarge" | "unauthorized" | "invalidRequest";
|
|
476
|
+
|
|
477
|
+
export type ForkRetentionRejectionProjection = {
|
|
478
|
+
/**
|
|
479
|
+
* Stable category.
|
|
480
|
+
*/
|
|
481
|
+
code: ForkRetentionRejectionCode,
|
|
482
|
+
/**
|
|
483
|
+
* Renderer-safe diagnostic.
|
|
484
|
+
*/
|
|
485
|
+
detail: string,
|
|
486
|
+
/**
|
|
487
|
+
* Whether the caller should refresh.
|
|
488
|
+
*/
|
|
489
|
+
refreshRequired: boolean, };
|
|
490
|
+
|
|
491
|
+
export type ForkDeleteResult = { "status": "deleted",
|
|
492
|
+
/**
|
|
493
|
+
* Receipt for the committed deletion.
|
|
494
|
+
*/
|
|
495
|
+
receipt: ForkRemovalReceiptProjection, } | { "status": "rejected",
|
|
496
|
+
/**
|
|
497
|
+
* Reason for refusal.
|
|
498
|
+
*/
|
|
499
|
+
rejection: ForkRetentionRejectionProjection, };
|
|
500
|
+
|
|
473
501
|
export type ForkRemovedEntryRecord = {
|
|
474
502
|
/**
|
|
475
503
|
* Stable identity of the removed entry.
|
|
@@ -564,13 +592,17 @@ maximumEntries: number,
|
|
|
564
592
|
*/
|
|
565
593
|
maximumEncodedWeight: number, };
|
|
566
594
|
|
|
567
|
-
export type ForkPruneResult = { "status": "
|
|
595
|
+
export type ForkPruneResult = { "status": "rejected",
|
|
596
|
+
/**
|
|
597
|
+
* Reason for refusal.
|
|
598
|
+
*/
|
|
599
|
+
rejection: ForkRetentionRejectionProjection, } | { "status": "unchanged", } | { "status": "pruned",
|
|
568
600
|
/**
|
|
569
601
|
* What it removed, and what is left.
|
|
570
602
|
*/
|
|
571
603
|
receipt: ForkRemovalReceiptProjection, };
|
|
572
604
|
|
|
573
|
-
export type ForkNavigationTargetProjection = { "kind": "undo" } | { "kind": "redo" } | { "kind": "checkout",
|
|
605
|
+
export type ForkNavigationTargetProjection = { "kind": "undo", } | { "kind": "redo", } | { "kind": "checkout",
|
|
574
606
|
/**
|
|
575
607
|
* Stable target branch.
|
|
576
608
|
*/
|
|
@@ -709,3 +741,7 @@ committedRevision: HistoryRevision,
|
|
|
709
741
|
* Coarse invalidation category.
|
|
710
742
|
*/
|
|
711
743
|
kind: ForkChangedKind, };
|
|
744
|
+
|
|
745
|
+
export type ForkHistoryHostErrorCode = "authorityUnavailable" | "stateUnavailable" | "eventPublication";
|
|
746
|
+
|
|
747
|
+
export type ForkHistoryHostError = { "code": ForkHistoryHostErrorCode, "message": string, "retryable": boolean, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by `effigy generate:
|
|
1
|
+
// @generated by `effigy generate:bindings`; do not edit.
|
|
2
2
|
// Allowed field names per tagged-union variant, from the Rust enums.
|
|
3
3
|
// Keyed by type, then by discriminant. The discriminant itself is in
|
|
4
4
|
// each list, because `exact()` compares every key.
|
|
@@ -13,7 +13,12 @@ export const HISTORY_TREE_VARIANT_FIELDS: Record<string, Record<string, readonly
|
|
|
13
13
|
"branch": ["kind", "branchId"],
|
|
14
14
|
"continuation": ["kind", "fromEntryId"],
|
|
15
15
|
},
|
|
16
|
+
"ForkDeleteResult": {
|
|
17
|
+
"deleted": ["status", "receipt"],
|
|
18
|
+
"rejected": ["status", "rejection"],
|
|
19
|
+
},
|
|
16
20
|
"ForkPruneResult": {
|
|
21
|
+
"rejected": ["status", "rejection"],
|
|
17
22
|
"unchanged": ["status"],
|
|
18
23
|
"pruned": ["status", "receipt"],
|
|
19
24
|
},
|
|
@@ -33,6 +38,7 @@ export const HISTORY_TREE_VARIANT_FIELDS: Record<string, Record<string, readonly
|
|
|
33
38
|
export const HISTORY_TREE_VARIANT_FIELDS_DISCRIMINANTS: Record<string, string> = {
|
|
34
39
|
"ForkPathFloorProjection": "kind",
|
|
35
40
|
"ForkPathTargetProjection": "kind",
|
|
41
|
+
"ForkDeleteResult": "status",
|
|
36
42
|
"ForkPruneResult": "status",
|
|
37
43
|
"ForkNavigationTargetProjection": "kind",
|
|
38
44
|
"ForkNavigationResult": "status",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ConnectionFailureReporter } from "../core/connection.ts";
|
|
2
|
+
import type { Unlisten } from "../core/transport.ts";
|
|
1
3
|
import type {
|
|
2
4
|
ForkBranchPageCommand,
|
|
3
5
|
ForkBranchPageSnapshot,
|
|
@@ -11,12 +13,12 @@ import type {
|
|
|
11
13
|
ForkNavigationResult,
|
|
12
14
|
ForkPathPageCommand,
|
|
13
15
|
ForkPathPageSnapshot,
|
|
14
|
-
|
|
16
|
+
ForkDeleteResult,
|
|
15
17
|
ForkSnapshot,
|
|
16
18
|
HistoryPlanId,
|
|
17
19
|
} from "./generated/protocol.ts";
|
|
18
20
|
|
|
19
|
-
export type ForkHistoryUnlisten =
|
|
21
|
+
export type ForkHistoryUnlisten = Unlisten;
|
|
20
22
|
|
|
21
23
|
export interface ForkHistoryPort {
|
|
22
24
|
snapshot(): Promise<unknown>;
|
|
@@ -26,7 +28,9 @@ export interface ForkHistoryPort {
|
|
|
26
28
|
deleteContinuation(command: ForkDeleteContinuationCommand): Promise<unknown>;
|
|
27
29
|
prune(command: ForkPruneCommand): Promise<unknown>;
|
|
28
30
|
navigate(command: ForkNavigationCommand): Promise<unknown>;
|
|
29
|
-
listen
|
|
31
|
+
listen?:
|
|
32
|
+
| ((listener: (event: unknown) => void) => ForkHistoryUnlisten | Promise<ForkHistoryUnlisten>)
|
|
33
|
+
| undefined;
|
|
30
34
|
nextPlanId(): HistoryPlanId;
|
|
31
35
|
}
|
|
32
36
|
|
|
@@ -35,9 +39,12 @@ export interface CheckedForkHistoryPort {
|
|
|
35
39
|
path(command: ForkPathPageCommand): Promise<ForkPathPageSnapshot>;
|
|
36
40
|
branches(command: ForkBranchPageCommand): Promise<ForkBranchPageSnapshot>;
|
|
37
41
|
continuations(command: ForkContinuationPageCommand): Promise<ForkContinuationPageSnapshot>;
|
|
38
|
-
deleteContinuation(command: ForkDeleteContinuationCommand): Promise<
|
|
42
|
+
deleteContinuation(command: ForkDeleteContinuationCommand): Promise<ForkDeleteResult>;
|
|
39
43
|
prune(command: ForkPruneCommand): Promise<ForkPruneResult>;
|
|
40
44
|
navigate(command: ForkNavigationCommand): Promise<ForkNavigationResult>;
|
|
41
|
-
listen?(
|
|
45
|
+
listen?(
|
|
46
|
+
listener: (event: ForkChangedEvent) => void,
|
|
47
|
+
onFailure?: ConnectionFailureReporter,
|
|
48
|
+
): Promise<ForkHistoryUnlisten>;
|
|
42
49
|
nextPlanId(): HistoryPlanId;
|
|
43
50
|
}
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { wireCopy } from "../core/wire-copy.ts";
|
|
2
|
+
import type {
|
|
3
|
+
ForkBranchPageCommand,
|
|
4
|
+
ForkContinuationPageCommand,
|
|
5
|
+
ForkDeleteContinuationCommand,
|
|
6
|
+
ForkNavigationCommand,
|
|
7
|
+
ForkPathPageCommand,
|
|
8
|
+
ForkPruneCommand,
|
|
9
|
+
} from "./generated/protocol.ts";
|
|
2
10
|
import type { ForkHistoryPort, ForkHistoryUnlisten } from "./ports.ts";
|
|
3
11
|
export class SerializedForkHistoryPort implements ForkHistoryPort {
|
|
4
12
|
constructor(readonly inner: ForkHistoryPort) {}
|
|
5
|
-
async snapshot(): Promise<unknown> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
async
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
async snapshot(): Promise<unknown> {
|
|
14
|
+
return wireCopy(await this.inner.snapshot());
|
|
15
|
+
}
|
|
16
|
+
async path(command: ForkPathPageCommand): Promise<unknown> {
|
|
17
|
+
return wireCopy(await this.inner.path(wireCopy(command)));
|
|
18
|
+
}
|
|
19
|
+
async branches(command: ForkBranchPageCommand): Promise<unknown> {
|
|
20
|
+
return wireCopy(await this.inner.branches(wireCopy(command)));
|
|
21
|
+
}
|
|
22
|
+
async continuations(command: ForkContinuationPageCommand): Promise<unknown> {
|
|
23
|
+
return wireCopy(await this.inner.continuations(wireCopy(command)));
|
|
24
|
+
}
|
|
25
|
+
async deleteContinuation(command: ForkDeleteContinuationCommand): Promise<unknown> {
|
|
26
|
+
return wireCopy(await this.inner.deleteContinuation(wireCopy(command)));
|
|
27
|
+
}
|
|
28
|
+
async prune(command: ForkPruneCommand): Promise<unknown> {
|
|
29
|
+
return wireCopy(await this.inner.prune(wireCopy(command)));
|
|
30
|
+
}
|
|
31
|
+
async navigate(command: ForkNavigationCommand): Promise<unknown> {
|
|
32
|
+
return wireCopy(await this.inner.navigate(wireCopy(command)));
|
|
33
|
+
}
|
|
34
|
+
async listen(listener: (event: unknown) => void): Promise<ForkHistoryUnlisten> {
|
|
35
|
+
if (this.inner.listen === undefined) {
|
|
36
|
+
return () => {};
|
|
37
|
+
}
|
|
38
|
+
return this.inner.listen((event) => listener(wireCopy(event)));
|
|
39
|
+
}
|
|
40
|
+
nextPlanId(): string {
|
|
41
|
+
return this.inner.nextPlanId();
|
|
42
|
+
}
|
|
14
43
|
}
|
|
15
|
-
function clone<T>(value: T): T { return JSON.parse(JSON.stringify(value)) as T; }
|