@frockbot/computer-core 0.3.1 → 0.3.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.
- package/package.json +2 -2
- package/src/core.ts +35 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/computer-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
15
|
+
"@frockbot/kernel-contracts": "0.3.3",
|
|
16
16
|
"cordis": "4.0.0-rc.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
package/src/core.ts
CHANGED
|
@@ -622,8 +622,18 @@ export interface ComputerControl {
|
|
|
622
622
|
): Promise<void>;
|
|
623
623
|
}
|
|
624
624
|
|
|
625
|
-
/**
|
|
626
|
-
|
|
625
|
+
/**
|
|
626
|
+
* Why one run of the durable-root sync happened.
|
|
627
|
+
*
|
|
628
|
+
* `publish` is the only reason outside the Turn's own policy, and it is one
|
|
629
|
+
* root rather than all of them: an Applet publish (ADR 0022 decision 7) reads
|
|
630
|
+
* the built artifact from the Workspace *store*, so the bytes `applet build`
|
|
631
|
+
* left on the Computer have to reach the store before it looks. It is recorded
|
|
632
|
+
* under its own name rather than borrowed from `signal`, because a record that
|
|
633
|
+
* said "the watcher moved" when a publish asked would be a record nobody could
|
|
634
|
+
* use to explain the sync afterwards.
|
|
635
|
+
*/
|
|
636
|
+
export type ComputerSyncReasonV1 = "open" | "signal" | "turn-end" | "publish";
|
|
627
637
|
|
|
628
638
|
/**
|
|
629
639
|
* What one sync run moved, flattened to counts.
|
|
@@ -686,6 +696,18 @@ export interface ComputerSyncV1 {
|
|
|
686
696
|
reason: ComputerSyncReasonV1,
|
|
687
697
|
options?: ComputerOperationOptions,
|
|
688
698
|
): Promise<ComputerSyncSummaryV1>;
|
|
699
|
+
/**
|
|
700
|
+
* Reconciles exactly one declared durable root. Never throws.
|
|
701
|
+
*
|
|
702
|
+
* Optional, because a provider that cannot reconcile a root on its own has
|
|
703
|
+
* nothing to answer with and a caller must fall back to `reconcile`. A root
|
|
704
|
+
* this Computer declares no mount for is `refused`, not silently skipped.
|
|
705
|
+
*/
|
|
706
|
+
reconcileRoot?(
|
|
707
|
+
root: WorkspaceRootV1,
|
|
708
|
+
reason: ComputerSyncReasonV1,
|
|
709
|
+
options?: ComputerOperationOptions,
|
|
710
|
+
): Promise<ComputerSyncSummaryV1>;
|
|
689
711
|
/**
|
|
690
712
|
* The Computer-side watcher's change signal, or `undefined` when it cannot
|
|
691
713
|
* be read. A caller reconciles again when this changes, rather than scanning
|
|
@@ -710,6 +732,17 @@ export interface ComputerSyncHostV1 {
|
|
|
710
732
|
effects?: WorkspaceSyncEffectsV1;
|
|
711
733
|
/** The owning object's generation ledger, read to recover a removal writer. */
|
|
712
734
|
generations?: WorkspaceGenerationsV1;
|
|
735
|
+
/**
|
|
736
|
+
* The `package-declared` roots the User's enabled Packages declare, which
|
|
737
|
+
* the Computer Package cannot derive on its own.
|
|
738
|
+
*
|
|
739
|
+
* A Computer Package's layout declares root *kinds* and where each is
|
|
740
|
+
* mounted; only the host knows which Packages this User has installed and
|
|
741
|
+
* which roots their manifests declare. Absent, and the sync reconciles the
|
|
742
|
+
* layout's own kinds and no Package root at all — which is what every host
|
|
743
|
+
* did before this field existed.
|
|
744
|
+
*/
|
|
745
|
+
packageRoots?: readonly { packageId: string; rootId: string }[];
|
|
713
746
|
// There is deliberately no writer here. "A file that reaches a durable root
|
|
714
747
|
// without passing through the Workspace file surface (a shell write on the
|
|
715
748
|
// Computer) is mirrored to object storage by the sync with an unattributed
|