@muhkoo/connect 0.11.0-alpha.0 → 0.12.0-alpha.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/browser/index.js +941 -17
- package/dist/browser/index.js.map +1 -1
- package/dist/connect.d.ts +421 -3
- package/dist/server/index.js +941 -17
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/connect.d.ts
CHANGED
|
@@ -5500,6 +5500,60 @@ declare class AccessTokensNamespace {
|
|
|
5500
5500
|
* seam group-sharing hangs off later without re-encrypting the filesystem.
|
|
5501
5501
|
*/
|
|
5502
5502
|
|
|
5503
|
+
/** Personal-space KV key holding a directory record. */
|
|
5504
|
+
declare const dirKey: (id: string) => string;
|
|
5505
|
+
/** Personal-space KV key holding one file's prior versions. */
|
|
5506
|
+
declare const historyKey: (id: string) => string;
|
|
5507
|
+
/** The root directory's id is fixed — it is the one node reached without a parent. */
|
|
5508
|
+
declare const ROOT_ID = "root";
|
|
5509
|
+
/** HKDF label for the seed-derived root key. Sits alongside `muhkoo-storage-v1`. */
|
|
5510
|
+
declare const VFS_ROOT_INFO = "muhkoo-vfs-v1";
|
|
5511
|
+
interface FileEntry {
|
|
5512
|
+
kind: "file";
|
|
5513
|
+
/**
|
|
5514
|
+
* Stable identity, independent of name and location. Renaming a file keeps
|
|
5515
|
+
* its id, so its version history follows it rather than being orphaned.
|
|
5516
|
+
*/
|
|
5517
|
+
id: string;
|
|
5518
|
+
/** The handle: everything needed to read the current bytes back. */
|
|
5519
|
+
manifest: FileManifest;
|
|
5520
|
+
/** Plaintext byte length. */
|
|
5521
|
+
size: number;
|
|
5522
|
+
mtime: number;
|
|
5523
|
+
/**
|
|
5524
|
+
* Count of prior versions in the file's history record.
|
|
5525
|
+
*
|
|
5526
|
+
* Denormalised on purpose: the file tree wants to show "3 versions" while
|
|
5527
|
+
* listing a directory, and fetching every history record to answer that
|
|
5528
|
+
* would defeat the point of keeping history out of the directory record.
|
|
5529
|
+
*/
|
|
5530
|
+
versions?: number;
|
|
5531
|
+
}
|
|
5532
|
+
interface DirEntry {
|
|
5533
|
+
kind: "dir";
|
|
5534
|
+
/** Record id — `dirKey(id)` locates it. Permanent for the directory's life. */
|
|
5535
|
+
id: string;
|
|
5536
|
+
/** Base64 AES-256 key for that record. See the capability note above. */
|
|
5537
|
+
key: string;
|
|
5538
|
+
mtime: number;
|
|
5539
|
+
}
|
|
5540
|
+
type Entry = FileEntry | DirEntry;
|
|
5541
|
+
/** One directory record, as stored (before encryption). */
|
|
5542
|
+
interface DirNode {
|
|
5543
|
+
v: 1;
|
|
5544
|
+
/** Child name → entry. Names are unique within a directory, per filesystem. */
|
|
5545
|
+
entries: Record<string, Entry>;
|
|
5546
|
+
mtime: number;
|
|
5547
|
+
}
|
|
5548
|
+
/** A file's prior versions, newest first. Fetched only when asked for. */
|
|
5549
|
+
interface HistoryRecord {
|
|
5550
|
+
v: 1;
|
|
5551
|
+
versions: Array<{
|
|
5552
|
+
manifest: FileManifest;
|
|
5553
|
+
size: number;
|
|
5554
|
+
mtime: number;
|
|
5555
|
+
}>;
|
|
5556
|
+
}
|
|
5503
5557
|
/** What `stat` and `list` hand back — a path-addressed view of an entry. */
|
|
5504
5558
|
interface VfsStat {
|
|
5505
5559
|
path: string;
|
|
@@ -5509,6 +5563,14 @@ interface VfsStat {
|
|
|
5509
5563
|
mtime: number;
|
|
5510
5564
|
versions: number;
|
|
5511
5565
|
}
|
|
5566
|
+
/** The encrypted envelope every record is stored in. */
|
|
5567
|
+
interface SealedRecord {
|
|
5568
|
+
v: 1;
|
|
5569
|
+
/** Base64 12-byte AES-GCM IV. */
|
|
5570
|
+
iv: string;
|
|
5571
|
+
/** Base64 ciphertext with the 16-byte tag appended. */
|
|
5572
|
+
ct: string;
|
|
5573
|
+
}
|
|
5512
5574
|
/** The personal-space blob store the VFS persists through. */
|
|
5513
5575
|
interface VfsStore {
|
|
5514
5576
|
get(key: string): Promise<unknown | null>;
|
|
@@ -5517,6 +5579,18 @@ interface VfsStore {
|
|
|
5517
5579
|
/** Every key in the store — the personal space is shared, so this is NOT VFS-only. */
|
|
5518
5580
|
list(): Promise<string[]>;
|
|
5519
5581
|
}
|
|
5582
|
+
/** Raised when the master seed is not held, so the root key cannot be derived. */
|
|
5583
|
+
declare class VfsLockedError extends Error {
|
|
5584
|
+
constructor();
|
|
5585
|
+
}
|
|
5586
|
+
/** Raised for a path that does not exist. */
|
|
5587
|
+
declare class VfsNotFoundError extends Error {
|
|
5588
|
+
constructor(path: string);
|
|
5589
|
+
}
|
|
5590
|
+
/** Raised when an operation would clobber or misuse an existing entry. */
|
|
5591
|
+
declare class VfsConflictError extends Error {
|
|
5592
|
+
constructor(message: string);
|
|
5593
|
+
}
|
|
5520
5594
|
|
|
5521
5595
|
/**
|
|
5522
5596
|
* `client.vfs` — a real filesystem over Muhkoo primitives.
|
|
@@ -5660,6 +5734,42 @@ declare class VfsNamespace {
|
|
|
5660
5734
|
walk(path?: string): Promise<string[]>;
|
|
5661
5735
|
readFile(path: string): Promise<Uint8Array>;
|
|
5662
5736
|
readText(path: string): Promise<string>;
|
|
5737
|
+
/**
|
|
5738
|
+
* A file's manifest — the handle itself, without reading the bytes.
|
|
5739
|
+
*
|
|
5740
|
+
* Version control records manifests rather than content, so a commit costs
|
|
5741
|
+
* a hash and a reference, not a copy.
|
|
5742
|
+
*/
|
|
5743
|
+
statManifest(path: string): Promise<{
|
|
5744
|
+
manifest: FileManifest;
|
|
5745
|
+
size: number;
|
|
5746
|
+
}>;
|
|
5747
|
+
/**
|
|
5748
|
+
* Read content by its manifest, wherever it came from.
|
|
5749
|
+
*
|
|
5750
|
+
* A merge needs the COMMON ANCESTOR's version of a file, which by definition
|
|
5751
|
+
* is not in the working tree any more. The manifest is the whole capability,
|
|
5752
|
+
* so no path lookup is involved.
|
|
5753
|
+
*/
|
|
5754
|
+
readByManifest(manifest: FileManifest): Promise<Uint8Array>;
|
|
5755
|
+
/**
|
|
5756
|
+
* Pin content that something other than the working tree depends on.
|
|
5757
|
+
*
|
|
5758
|
+
* A commit references a manifest, so it is an OWNER of that content — without
|
|
5759
|
+
* a reference of its own, deleting the file from the working tree would free
|
|
5760
|
+
* shards the history still needs, and checking out an older commit would find
|
|
5761
|
+
* the content gone. (It did, in test.)
|
|
5762
|
+
*/
|
|
5763
|
+
retainManifest(manifest: FileManifest): Promise<void>;
|
|
5764
|
+
/**
|
|
5765
|
+
* Point a path at content that already exists.
|
|
5766
|
+
*
|
|
5767
|
+
* This is how a checkout restores a file: the bytes are in the shard store
|
|
5768
|
+
* already, so nothing is uploaded or downloaded — only the directory record
|
|
5769
|
+
* changes. Takes a reference, because a second path now depends on those
|
|
5770
|
+
* shards.
|
|
5771
|
+
*/
|
|
5772
|
+
writeManifest(path: string, manifest: FileManifest, size: number): Promise<VfsStat>;
|
|
5663
5773
|
/**
|
|
5664
5774
|
* Create a directory. `recursive` creates missing parents and tolerates an
|
|
5665
5775
|
* existing target, matching `mkdir -p`.
|
|
@@ -5677,9 +5787,17 @@ declare class VfsNamespace {
|
|
|
5677
5787
|
writeFile(path: string, data: Uint8Array | string | Blob, opts?: {
|
|
5678
5788
|
type?: string;
|
|
5679
5789
|
}): Promise<VfsStat>;
|
|
5680
|
-
/**
|
|
5790
|
+
/**
|
|
5791
|
+
* Delete a file, or a directory when `recursive`.
|
|
5792
|
+
*
|
|
5793
|
+
* `keepContent` removes the entry WITHOUT releasing its shards. A checkout
|
|
5794
|
+
* needs that: the file is leaving the working tree, but commits still
|
|
5795
|
+
* reference the same manifest, and releasing would free content history
|
|
5796
|
+
* depends on.
|
|
5797
|
+
*/
|
|
5681
5798
|
delete(path: string, opts?: {
|
|
5682
5799
|
recursive?: boolean;
|
|
5800
|
+
keepContent?: boolean;
|
|
5683
5801
|
}): Promise<void>;
|
|
5684
5802
|
/**
|
|
5685
5803
|
* Move or rename. Works across directories, which is the same operation:
|
|
@@ -5773,6 +5891,263 @@ declare class VfsNamespace {
|
|
|
5773
5891
|
private pushHistory;
|
|
5774
5892
|
}
|
|
5775
5893
|
|
|
5894
|
+
/**
|
|
5895
|
+
* Object model for version control over the VFS. See `docs/VCS_DESIGN.md`.
|
|
5896
|
+
*
|
|
5897
|
+
* Two spaces, deliberately: the WORKING TREE (`/apps/<slug>`) uses mutable
|
|
5898
|
+
* random directory ids so a file write touches one record; the REPOSITORY
|
|
5899
|
+
* (here) is content-addressed so a commit means the same thing forever. Git
|
|
5900
|
+
* makes the same split, for the same reason.
|
|
5901
|
+
*/
|
|
5902
|
+
|
|
5903
|
+
/** A file in a commit. The manifest IS the content — there are no blob objects. */
|
|
5904
|
+
interface TreeFile {
|
|
5905
|
+
kind: "file";
|
|
5906
|
+
manifest: FileManifest;
|
|
5907
|
+
size: number;
|
|
5908
|
+
}
|
|
5909
|
+
/** A subdirectory, by the hash of its own tree object. */
|
|
5910
|
+
interface TreeDir {
|
|
5911
|
+
kind: "tree";
|
|
5912
|
+
hash: string;
|
|
5913
|
+
}
|
|
5914
|
+
type TreeEntry = TreeFile | TreeDir;
|
|
5915
|
+
/**
|
|
5916
|
+
* One directory, frozen.
|
|
5917
|
+
*
|
|
5918
|
+
* Addressed by the hash of its canonical form, so an unchanged directory has
|
|
5919
|
+
* the same hash in every commit containing it — a deep project costs one new
|
|
5920
|
+
* tree per CHANGED directory, not one per commit.
|
|
5921
|
+
*/
|
|
5922
|
+
interface Tree {
|
|
5923
|
+
v: 1;
|
|
5924
|
+
entries: Record<string, TreeEntry>;
|
|
5925
|
+
}
|
|
5926
|
+
interface Commit {
|
|
5927
|
+
v: 1;
|
|
5928
|
+
/** Hash of the root tree. */
|
|
5929
|
+
tree: string;
|
|
5930
|
+
/**
|
|
5931
|
+
* Ancestors. An ARRAY because a merge has two; the first commit has none.
|
|
5932
|
+
* Order matters: `parents[0]` is the branch being committed onto.
|
|
5933
|
+
*/
|
|
5934
|
+
parents: string[];
|
|
5935
|
+
message: string;
|
|
5936
|
+
author: string;
|
|
5937
|
+
at: number;
|
|
5938
|
+
}
|
|
5939
|
+
/** Where a branch points, or a specific commit when detached. */
|
|
5940
|
+
type Head = {
|
|
5941
|
+
branch: string;
|
|
5942
|
+
} | {
|
|
5943
|
+
detached: string;
|
|
5944
|
+
};
|
|
5945
|
+
/** A single change between two trees. */
|
|
5946
|
+
interface Change {
|
|
5947
|
+
path: string;
|
|
5948
|
+
kind: "added" | "removed" | "modified";
|
|
5949
|
+
}
|
|
5950
|
+
/** A path the merge could not settle on its own. */
|
|
5951
|
+
interface Conflict {
|
|
5952
|
+
path: string;
|
|
5953
|
+
/** `binary` cannot be merged at all — the user picks a side. */
|
|
5954
|
+
reason: "content" | "binary" | "modify-delete";
|
|
5955
|
+
}
|
|
5956
|
+
interface MergeResult {
|
|
5957
|
+
/** "up-to-date" and "fast-forward" do no three-way work at all. */
|
|
5958
|
+
kind: "up-to-date" | "fast-forward" | "merged" | "conflicted";
|
|
5959
|
+
commit?: string;
|
|
5960
|
+
conflicts: Conflict[];
|
|
5961
|
+
}
|
|
5962
|
+
interface LogEntry {
|
|
5963
|
+
hash: string;
|
|
5964
|
+
message: string;
|
|
5965
|
+
author: string;
|
|
5966
|
+
at: number;
|
|
5967
|
+
parents: string[];
|
|
5968
|
+
}
|
|
5969
|
+
/** Storage keys. Namespaced per project so repositories cannot collide. */
|
|
5970
|
+
declare const objectKey: (slug: string, hash: string) => string;
|
|
5971
|
+
declare const refKey: (slug: string, name: string) => string;
|
|
5972
|
+
declare const headKey: (slug: string) => string;
|
|
5973
|
+
declare const refsIndexKey: (slug: string) => string;
|
|
5974
|
+
/** An in-progress merge: what to make the second parent when it is committed. */
|
|
5975
|
+
declare const mergeKey: (slug: string) => string;
|
|
5976
|
+
declare const DEFAULT_BRANCH = "main";
|
|
5977
|
+
declare class VcsError extends Error {
|
|
5978
|
+
constructor(message: string);
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5981
|
+
/**
|
|
5982
|
+
* `client.vcs` — version control for a project in the VFS.
|
|
5983
|
+
*
|
|
5984
|
+
* Phase 1: objects, commit, log, checkout, diff. Branches and merge build on
|
|
5985
|
+
* this; see `docs/VCS_DESIGN.md` for the whole shape and for why the repository
|
|
5986
|
+
* is content-addressed while the working tree is not.
|
|
5987
|
+
*/
|
|
5988
|
+
|
|
5989
|
+
interface VcsNamespaceDeps {
|
|
5990
|
+
vfs: VfsNamespace;
|
|
5991
|
+
store: VfsStore;
|
|
5992
|
+
/** The key repository objects are sealed with — the project's own. */
|
|
5993
|
+
key: () => Promise<Uint8Array>;
|
|
5994
|
+
/** Who to record as the author. */
|
|
5995
|
+
author: () => string;
|
|
5996
|
+
}
|
|
5997
|
+
declare class Repo {
|
|
5998
|
+
private readonly slug;
|
|
5999
|
+
private readonly deps;
|
|
6000
|
+
constructor(slug: string, deps: VcsNamespaceDeps);
|
|
6001
|
+
private get root();
|
|
6002
|
+
/** Store an object, returning its hash and whether it was new. */
|
|
6003
|
+
private put;
|
|
6004
|
+
private get;
|
|
6005
|
+
private head;
|
|
6006
|
+
private setHead;
|
|
6007
|
+
private readRef;
|
|
6008
|
+
private writeRef;
|
|
6009
|
+
/** Every branch name in this repository. */
|
|
6010
|
+
branches(): Promise<string[]>;
|
|
6011
|
+
/** The commit HEAD resolves to, or null in an empty repository. */
|
|
6012
|
+
current(): Promise<string | null>;
|
|
6013
|
+
/**
|
|
6014
|
+
* Freeze the working tree as a commit.
|
|
6015
|
+
*
|
|
6016
|
+
* Trees are written bottom-up so a directory's hash is known before its
|
|
6017
|
+
* parent references it. Nothing is written to the shard store: file entries
|
|
6018
|
+
* carry the manifest the VFS already holds.
|
|
6019
|
+
*/
|
|
6020
|
+
commit(message: string, parents?: string[]): Promise<string>;
|
|
6021
|
+
/** Move whatever HEAD points at onto a new commit. */
|
|
6022
|
+
private advance;
|
|
6023
|
+
/** The other side of a merge that stopped for conflicts, if any. */
|
|
6024
|
+
pendingMerge(): Promise<{
|
|
6025
|
+
theirs: string;
|
|
6026
|
+
name: string;
|
|
6027
|
+
} | null>;
|
|
6028
|
+
/** Write a directory and everything under it, returning the tree's hash. */
|
|
6029
|
+
private writeTree;
|
|
6030
|
+
/** Commits reachable from HEAD, newest first. */
|
|
6031
|
+
log(limit?: number): Promise<LogEntry[]>;
|
|
6032
|
+
/**
|
|
6033
|
+
* What changed between two commits.
|
|
6034
|
+
*
|
|
6035
|
+
* Identical subtree hashes prune the walk: an untouched directory is one
|
|
6036
|
+
* comparison regardless of how much is inside it. That is the payoff for
|
|
6037
|
+
* content-addressing the trees.
|
|
6038
|
+
*/
|
|
6039
|
+
diff(fromHash: string | null, toHash: string): Promise<Change[]>;
|
|
6040
|
+
private diffTrees;
|
|
6041
|
+
/**
|
|
6042
|
+
* Replace the working tree with a commit's.
|
|
6043
|
+
*
|
|
6044
|
+
* Moves no file content: entries carry manifests the shard store already
|
|
6045
|
+
* holds, so this rewrites directory records only.
|
|
6046
|
+
*/
|
|
6047
|
+
/**
|
|
6048
|
+
* What has changed since the last commit.
|
|
6049
|
+
*
|
|
6050
|
+
* Compares the WORKING TREE against HEAD without writing any objects: the
|
|
6051
|
+
* common case is answering "anything to commit?", and a `status` that
|
|
6052
|
+
* quietly stored a tree object every time would litter the repository with
|
|
6053
|
+
* trees for states nobody chose to keep.
|
|
6054
|
+
*/
|
|
6055
|
+
status(): Promise<Change[]>;
|
|
6056
|
+
/** The working tree as a path → entry map, mirroring `filesOf`. */
|
|
6057
|
+
private workingFiles;
|
|
6058
|
+
/**
|
|
6059
|
+
* Turn what a person typed into a commit hash.
|
|
6060
|
+
*
|
|
6061
|
+
* Accepts a branch name, `HEAD`, a full or abbreviated hash, and trailing
|
|
6062
|
+
* `^` / `~n` to walk back through parents — so `show abc123^` means "the
|
|
6063
|
+
* commit before that one" the way anyone who has used git expects.
|
|
6064
|
+
*/
|
|
6065
|
+
resolve(rev: string): Promise<string>;
|
|
6066
|
+
/** A hash prefix a person typed → the one commit it names. */
|
|
6067
|
+
private expand;
|
|
6068
|
+
/**
|
|
6069
|
+
* Put one file back to the way it was in a commit.
|
|
6070
|
+
*
|
|
6071
|
+
* Scoped to a path on purpose — recovering one file you broke should not
|
|
6072
|
+
* mean rewinding everything else you have done since.
|
|
6073
|
+
*/
|
|
6074
|
+
restore(path: string, rev?: string): Promise<void>;
|
|
6075
|
+
checkout(commitHash: string, opts?: {
|
|
6076
|
+
discardChanges?: boolean;
|
|
6077
|
+
}): Promise<void>;
|
|
6078
|
+
/** Make the working tree match a commit, leaving HEAD alone. */
|
|
6079
|
+
private materialise;
|
|
6080
|
+
/** Project-relative path → absolute VFS path. */
|
|
6081
|
+
private abs;
|
|
6082
|
+
private collect;
|
|
6083
|
+
/** Create a branch at a commit (HEAD by default). Does not switch to it. */
|
|
6084
|
+
branch(name: string, at?: string): Promise<string>;
|
|
6085
|
+
/**
|
|
6086
|
+
* Move onto a branch, bringing the working tree with it.
|
|
6087
|
+
*
|
|
6088
|
+
* Unlike {@link checkout}, this ATTACHES head: later commits advance the
|
|
6089
|
+
* branch. Checking out a bare commit deliberately does not, so that
|
|
6090
|
+
* committing from a historical state cannot silently rewrite a branch.
|
|
6091
|
+
*/
|
|
6092
|
+
switchTo(name: string, opts?: {
|
|
6093
|
+
discardChanges?: boolean;
|
|
6094
|
+
}): Promise<void>;
|
|
6095
|
+
/**
|
|
6096
|
+
* Refuse to overwrite work that was never recorded.
|
|
6097
|
+
*
|
|
6098
|
+
* Moving between commits REPLACES the working tree, so uncommitted edits
|
|
6099
|
+
* are gone — and unlike an ordinary overwrite, the person did not ask for
|
|
6100
|
+
* anything to be written. Naming the files is the point: "you have changes"
|
|
6101
|
+
* with no list leaves them guessing what they are about to lose.
|
|
6102
|
+
*/
|
|
6103
|
+
private guardWorkingTree;
|
|
6104
|
+
/** The branch HEAD is on, or null when detached. */
|
|
6105
|
+
currentBranch(): Promise<string | null>;
|
|
6106
|
+
/**
|
|
6107
|
+
* Merge another branch into the current one.
|
|
6108
|
+
*
|
|
6109
|
+
* Every part of this is client-side by necessity: the server holds
|
|
6110
|
+
* ciphertext and cannot compare versions, so base, ours and theirs are all
|
|
6111
|
+
* fetched and decrypted here.
|
|
6112
|
+
*/
|
|
6113
|
+
merge(name: string, opts?: {
|
|
6114
|
+
discardChanges?: boolean;
|
|
6115
|
+
}): Promise<MergeResult>;
|
|
6116
|
+
/** Decide one path. Returns a conflict when it cannot be settled. */
|
|
6117
|
+
private settlePath;
|
|
6118
|
+
private take;
|
|
6119
|
+
/**
|
|
6120
|
+
* The most recent commit reachable from both.
|
|
6121
|
+
*
|
|
6122
|
+
* Walks our ancestry into a set, then theirs breadth-first until it hits it —
|
|
6123
|
+
* so the first match is the nearest, which is what a three-way merge needs.
|
|
6124
|
+
*/
|
|
6125
|
+
mergeBase(a: string, b: string): Promise<string | null>;
|
|
6126
|
+
/** Every file in a commit, by path. */
|
|
6127
|
+
private filesOf;
|
|
6128
|
+
}
|
|
6129
|
+
/**
|
|
6130
|
+
* Version control over the VFS.
|
|
6131
|
+
*
|
|
6132
|
+
* One repository per project, addressed by slug — the same slug the VFS stores
|
|
6133
|
+
* that project's working tree under. `client.vcs.open("my-app")` is the whole
|
|
6134
|
+
* entry point.
|
|
6135
|
+
*/
|
|
6136
|
+
declare class VcsNamespace {
|
|
6137
|
+
private readonly deps;
|
|
6138
|
+
private readonly repos;
|
|
6139
|
+
constructor(deps: VcsNamespaceOptions);
|
|
6140
|
+
/** The repository for one project. Cheap and cached; creates nothing. */
|
|
6141
|
+
open(slug: string): Repo;
|
|
6142
|
+
}
|
|
6143
|
+
interface VcsNamespaceOptions {
|
|
6144
|
+
vfs: VfsNamespace;
|
|
6145
|
+
store: VfsStore;
|
|
6146
|
+
/** The in-memory master seed, or null when locked. Read per call. */
|
|
6147
|
+
seed: () => Uint8Array | null;
|
|
6148
|
+
author: () => string;
|
|
6149
|
+
}
|
|
6150
|
+
|
|
5776
6151
|
/** The hosted Muhkoo Accelerator — the default {@link ClientOptions.baseUrl}. */
|
|
5777
6152
|
declare const DEFAULT_BASE_URL = "https://api.muhkoo.dev";
|
|
5778
6153
|
/** The hosted auth SPA — the default {@link ClientOptions.authBaseUrl}. */
|
|
@@ -5872,6 +6247,8 @@ declare class Client {
|
|
|
5872
6247
|
readonly storage: StorageNamespace;
|
|
5873
6248
|
/** Filesystem over the personal space: directories, versions, real paths. */
|
|
5874
6249
|
readonly vfs: VfsNamespace;
|
|
6250
|
+
/** Version control over the VFS: commits, branches, merges — per project. */
|
|
6251
|
+
readonly vcs: VcsNamespace;
|
|
5875
6252
|
/** Realtime messaging — `client.message.subscribe(...)`, etc. */
|
|
5876
6253
|
readonly message: MessageNamespace;
|
|
5877
6254
|
/** Fan-out group spaces — `client.space.createSpace(...)`, etc. */
|
|
@@ -6065,6 +6442,47 @@ declare function loadDeviceIdentity(): Promise<PersistedDeviceIdentity | null>;
|
|
|
6065
6442
|
*/
|
|
6066
6443
|
declare function clearDeviceIdentity(): Promise<void>;
|
|
6067
6444
|
|
|
6445
|
+
/**
|
|
6446
|
+
* Three-way line merge.
|
|
6447
|
+
*
|
|
6448
|
+
* Given a common ancestor and two descendants, produce the combined text — or
|
|
6449
|
+
* report the regions where both sides changed the same lines differently.
|
|
6450
|
+
*
|
|
6451
|
+
* The server cannot do any of this: it holds ciphertext and cannot compare
|
|
6452
|
+
* versions, so merging is entirely a client concern and has to be exact here.
|
|
6453
|
+
*/
|
|
6454
|
+
interface MergeRegionConflict {
|
|
6455
|
+
/** 1-based line where the conflict begins in the merged output. */
|
|
6456
|
+
line: number;
|
|
6457
|
+
ours: string[];
|
|
6458
|
+
theirs: string[];
|
|
6459
|
+
}
|
|
6460
|
+
interface Merge3Result {
|
|
6461
|
+
lines: string[];
|
|
6462
|
+
conflicts: MergeRegionConflict[];
|
|
6463
|
+
}
|
|
6464
|
+
/**
|
|
6465
|
+
* Merge `ours` and `theirs` over their common ancestor `base`.
|
|
6466
|
+
*
|
|
6467
|
+
* A region where only one side changed takes that side. A region where both
|
|
6468
|
+
* made the SAME change takes it once — two people fixing the same typo is not a
|
|
6469
|
+
* conflict. Only genuinely divergent edits conflict.
|
|
6470
|
+
*/
|
|
6471
|
+
declare function merge3(base: string[], ours: string[], theirs: string[]): Merge3Result;
|
|
6472
|
+
/**
|
|
6473
|
+
* Merge to text, writing conflict markers where the sides diverged.
|
|
6474
|
+
*
|
|
6475
|
+
* Markers rather than a bespoke format: they are what every developer already
|
|
6476
|
+
* knows how to resolve, and resolving becomes ordinary editing.
|
|
6477
|
+
*/
|
|
6478
|
+
declare function merge3Text(base: string, ours: string, theirs: string, labels?: {
|
|
6479
|
+
ours: string;
|
|
6480
|
+
theirs: string;
|
|
6481
|
+
}): {
|
|
6482
|
+
text: string;
|
|
6483
|
+
conflicted: boolean;
|
|
6484
|
+
};
|
|
6485
|
+
|
|
6068
6486
|
/**
|
|
6069
6487
|
* Passkey factor (M1.1) — WebAuthn with the **PRF extension**.
|
|
6070
6488
|
*
|
|
@@ -7055,5 +7473,5 @@ declare class KeyringClient implements KeyringTransport {
|
|
|
7055
7473
|
fetchMetadata(): Promise<SpaceMetadata | null>;
|
|
7056
7474
|
}
|
|
7057
7475
|
|
|
7058
|
-
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_AUTH_BASE_URL, DEFAULT_BASE_URL, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DevicePairingError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, ReauthRequiredError, ReedSolomonCodec, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VaultUnavailableError, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, configureDeviceStore, createPasskeyWithPrf, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultRpId, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, evaluatePasskeyPrf, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, generateAuthProof, generateDevicePairingKeypair, generatePkce, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, manifestToStat, materializeRow, mergeMap, mergeMessage, mergeRegister, messageKey, pack, padHandle, pairingVerificationCode, passkeyPrfCapable, passkeySupported, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, shardHash, signMessage, stableStringify, toField, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, verify, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
7059
|
-
export type { ACL, ACLEntry, AccessTokenInfo, AccessTokensNamespaceDeps, AgentConfig, AgentCreateInput, AgentDbToolMode, AgentProvisioned, AgentScopeOpts, AgentSkill, AgentToolsConfig, AgentTrigger, AgentTriggerType, AgentUpdateInput, AgentsNamespaceDeps, AttachedPeerNetwork, AuthClientOptions, AuthKeyPair, AuthSuccess, AuthToken, AuthType, AuthUser, BlockStore, Bn128WasmInstance, BroadcastChannelEvent, BroadcastChannelOptions, CachedSpaceMessage, ChannelLike, ChunkKeyMaterial, ChunkManifest, CipherFrame, CipherMessage, CipherMessageHeader, CircuitBufferConfig, CircuitUrls, ClientOptions, ConnectivityOptions, ConnectivityState, CreateAccessTokenInput, CreatedAccessToken, DbQueryPage, DehydratedKeypair, DehydratedKeys, DeviceBlobStore, DeviceKeyVault, DevicePairingErrorReason, DevicePairingKeypair, DevicePairingPoll, DevicePairingRequest, DevicePairingSession, DoubleRatchetCipherDeps, ECDHCurve, EncodeResult, EngineHandle, EngineHost, EphemeralEvent, EpochKeyProvider, FileManifest, FileNamespaceDeps, FileStat, FileStorageOptions, FunctionCaps, FunctionConfig, FunctionDeployInput, FunctionInvokeOptions, FunctionScopeOpts, FunctionTrigger, FunctionTriggerType, FunctionTriggers, FunctionUpdateInput, FunctionsNamespaceDeps, Groth16Proof, Hasher, HlcParts, HlcState, HostedAuthDeps, HttpClientOptions, IncomingFrame, KeyExchangeFrame, KeyPair, Keypair, KeyringClientDeps, KeyringTransport, KvEntry, KvNamespaceDeps, LoginOptions, LwwMap, LwwRegister, MessageBody, MessageDeletedEvent, MessageEntry, MessageEvent, MessageHeaders, MessageNamespaceDeps, MessageOp, MessageOptions, MessageSubscription, MuhkooAgentMeta, MuhkooAgentToolsConfig, MuhkooAppDescriptor, MuhkooDBAccess, MuhkooDBMeta, MuhkooFunctionMeta, MuhkooKeystoreBridge, MuhkooMessageEvent, MuhkooSpaceMeta, OAuthProvider, OfflineEntry, OfflineManagerDeps, OfflineStore, OutSink, PacketCipher, PacketHeaders, PacketOptions, PairedDevice, Participant, PasskeyEnrollment, PeerBlockSource, PeerExchangeOptions, PeerId, PeerNetworkOptions, PeerTransport, Permission, PermissionCheckRequest, PermissionCheckResult, PersistedDeviceIdentity, PersonalSpaceClientOptions, Pkce, PublicKeyJWK, QueueEntry, RatchetState, ReceiveResult, RegisterParams, Replayer, Role, SpaceDeps as RoomDeps, SpaceFileMetadata as RoomFileMetadata, Scope, SealedHandoff, SealedHeaders, Session, SessionOptions, SessionStore, SetOptions, ShardByteCache, ShardClientOptions, SharedSpaceClientOptions, SignalEnvelope, SignalKind, SignalingSpace, SnapshotNamespaceDeps, SnarkProof, SpaceChannelLike, SpaceCursor, SpaceDeps, SpaceFileMetadata, SpaceKeyCache, SpaceKeyringDeps, SpaceMessageEvent, SpaceNamespaceDeps, SpaceOfflineAdapter, StartDevicePairingOptions, StorageChangeEvent, StoreName, StoredSession, Subscription, UserIdentity, VaultFactor, VerificationKey, WSMessage, WSMessageType, WSTransportOptions, WaitForDevicePairingOptions, WebRtcTransportOptions, WrappedPayload, WriteFileInput, WriteFileOptions, WriteToShardsInput, ZkAuthDeps, ZkAuthenticateRequest, ZkChallengeResponse, ZkCompiled, ZkIdentity, ZkRegisterRequest, ZkRegisterResponse };
|
|
7476
|
+
export { ACCESS_TOKEN_SCOPES, AES_GCM_IV_BYTES, AES_GCM_KEY_BYTES, AES_GCM_TAG_BYTES, AccessTokensNamespace, AgentsNamespace, AuthClient, AuthNamespace, AuthPublicInput, Authenticator, BlockEngine, BroadcastChannel, BroadcastChannelEvents, ChannelExistsError, ChannelNotFoundError, ChunkCipher, Client, ConnectivityManager, DEFAULT_AUTH_BASE_URL, DEFAULT_BASE_URL, DEFAULT_BRANCH, DEFAULT_FN_HOST_SUFFIX, DEVICE_IDENTITY_STORAGE_KEY, DEVICE_KEY_DB_NAME, DbCache, DevicePairingError, DeviceStoreUnavailableError, DoubleRatchet, DoubleRatchetCipher, DoubleRatchetManager, EncryptedSession, EventCore, EventCoreEvents, Field, Field as FieldElement, FileStorage, FunctionsNamespace, HLC, HashKnowledge, HostedAuth, HttpClient, HttpError, IndexedDbStore, KEEPER_MEMBER_ID, KeyStore, KeyringClient, KvCache, KvNamespace, LocalEngineHost, LocalStorageSessionStore, MemorySessionStore, Message, Message as MessageDefault, MessageNamespace, MuhkooAgent, MuhkooDB, MuhkooFunction, MuhkooSpace, NoopStore, OfflineLockedError, OfflineManager, OutboundQueue, P2P_SUBJECT, PAIRING_CODE_ALPHABET, PAIRING_CODE_LENGTH, PBKDF2_DEFAULT_ITERATIONS, PREIMAGE_POK_VERIFICATION_KEY, Packet, PasskeyOriginError, PeerExchange, PeerNetwork, PersonalSpaceClient, Poseidon, PreimagePoK, ROOT_ID, ReauthRequiredError, ReedSolomonCodec, Repo, Space as Room, SerializeMessage, SessionState, ShardCache, ShardClient, SharedSpaceClient, SnapshotNamespace, Space, SpaceCache, SpaceKeyring, SpaceNamespace, SpacePacketCipher, SpaceSignaler, StorageNamespace, SyncEngine, VFS_ROOT_INFO, VaultUnavailableError, VcsError, VcsNamespace, VfsConflictError, VfsLockedError, VfsNamespace, VfsNotFoundError, WSTransport, WebRtcTransport, WorkerEngineHost, ZERO_HLC, ZkAuth, buildCommitment, canonicalUserCode, clearDeviceIdentity, compareHlc, compilePrograms, configureDeviceStore, createPasskeyWithPrf, decodeFromHex, decorators, decryptAesGcm, defaultCircuitUrls, defaultRpId, defaultSessionStore, deleteBeatsWrite, deleteRegister, deriveAesKeyFromPassphrase, deriveBitsHkdf, deriveIdentity, deriveIdentityFromSeed, deriveMasterSeedFromPassword, deviceFingerprint, deviceIdentityIsEphemeral, deviceIdentityKey, dirKey, ejectAgentPrompt, ejectAgentTools, emptyMap, emptyRegister, encodeToHex, encryptAesGcm, evaluatePasskeyPrf, exportPublicKeyBase64, exportPublicKeyHex, formatUserCode, generateAuthProof, generateDevicePairingKeypair, generatePkce, getMuhkooAppDescriptor, getSubtle, hasDeviceIdentity, headKey, historyKey, initBn128Wasm, initRsWasm, initializeCircuits, isNewer, isOfflineCapable, isP2pCapable, isProvisional, loadDeviceIdentity, manifestToStat, materializeRow, merge3, merge3Text, mergeKey, mergeMap, mergeMessage, mergeRegister, messageKey, objectKey, pack, padHandle, pairingVerificationCode, passkeyPrfCapable, passkeySupported, passkeyUsableFromOrigin, persistDeviceIdentity, poseidonHash, protocol, provisionalHandle, quickVerify, randomBytes, randomState, refKey, refsIndexKey, rpIdUsableForOrigin, sealSeed, sealSeedToDevice, shardHash, signMessage, stableStringify, toField, tombstoneRow, unpack, unsealSeed, unsealSeedFromDevice, unwrapWithPassphrase, verify, verifyGroth16, verifyHashKnowledge, verifyPreimagePoK, wrapWithPassphrase, writeBeatsTombstone, writeColumns, writeRegister };
|
|
7477
|
+
export type { ACL, ACLEntry, AccessTokenInfo, AccessTokensNamespaceDeps, AgentConfig, AgentCreateInput, AgentDbToolMode, AgentProvisioned, AgentScopeOpts, AgentSkill, AgentToolsConfig, AgentTrigger, AgentTriggerType, AgentUpdateInput, AgentsNamespaceDeps, AttachedPeerNetwork, AuthClientOptions, AuthKeyPair, AuthSuccess, AuthToken, AuthType, AuthUser, BlockStore, Bn128WasmInstance, BroadcastChannelEvent, BroadcastChannelOptions, CachedSpaceMessage, Change, ChannelLike, ChunkKeyMaterial, ChunkManifest, CipherFrame, CipherMessage, CipherMessageHeader, CircuitBufferConfig, CircuitUrls, ClientOptions, Commit, Conflict, ConnectivityOptions, ConnectivityState, CreateAccessTokenInput, CreatedAccessToken, DbQueryPage, DehydratedKeypair, DehydratedKeys, DeviceBlobStore, DeviceKeyVault, DevicePairingErrorReason, DevicePairingKeypair, DevicePairingPoll, DevicePairingRequest, DevicePairingSession, DirEntry, DirNode, DoubleRatchetCipherDeps, ECDHCurve, EncodeResult, EngineHandle, EngineHost, Entry, EphemeralEvent, EpochKeyProvider, FileEntry, FileManifest, FileNamespaceDeps, FileStat, FileStorageOptions, FunctionCaps, FunctionConfig, FunctionDeployInput, FunctionInvokeOptions, FunctionScopeOpts, FunctionTrigger, FunctionTriggerType, FunctionTriggers, FunctionUpdateInput, FunctionsNamespaceDeps, Groth16Proof, Hasher, Head, HistoryRecord, HlcParts, HlcState, HostedAuthDeps, HttpClientOptions, IncomingFrame, KeyExchangeFrame, KeyPair, Keypair, KeyringClientDeps, KeyringTransport, KvEntry, KvNamespaceDeps, LogEntry, LoginOptions, LwwMap, LwwRegister, Merge3Result, MergeRegionConflict, MergeResult, MessageBody, MessageDeletedEvent, MessageEntry, MessageEvent, MessageHeaders, MessageNamespaceDeps, MessageOp, MessageOptions, MessageSubscription, MuhkooAgentMeta, MuhkooAgentToolsConfig, MuhkooAppDescriptor, MuhkooDBAccess, MuhkooDBMeta, MuhkooFunctionMeta, MuhkooKeystoreBridge, MuhkooMessageEvent, MuhkooSpaceMeta, OAuthProvider, OfflineEntry, OfflineManagerDeps, OfflineStore, OutSink, PacketCipher, PacketHeaders, PacketOptions, PairedDevice, Participant, PasskeyEnrollment, PeerBlockSource, PeerExchangeOptions, PeerId, PeerNetworkOptions, PeerTransport, Permission, PermissionCheckRequest, PermissionCheckResult, PersistedDeviceIdentity, PersonalSpaceClientOptions, Pkce, PublicKeyJWK, QueueEntry, RatchetState, ReceiveResult, RegisterParams, Replayer, Role, SpaceDeps as RoomDeps, SpaceFileMetadata as RoomFileMetadata, Scope, SealedHandoff, SealedHeaders, SealedRecord, Session, SessionOptions, SessionStore, SetOptions, ShardByteCache, ShardClientOptions, SharedSpaceClientOptions, SignalEnvelope, SignalKind, SignalingSpace, SnapshotNamespaceDeps, SnarkProof, SpaceChannelLike, SpaceCursor, SpaceDeps, SpaceFileMetadata, SpaceKeyCache, SpaceKeyringDeps, SpaceMessageEvent, SpaceNamespaceDeps, SpaceOfflineAdapter, StartDevicePairingOptions, StorageChangeEvent, StoreName, StoredSession, Subscription, Tree, TreeDir, TreeEntry, TreeFile, UserIdentity, VaultFactor, VcsNamespaceDeps, VcsNamespaceOptions, VerificationKey, VfsContentStore, VfsNamespaceDeps, VfsStat, VfsStore, WSMessage, WSMessageType, WSTransportOptions, WaitForDevicePairingOptions, WebRtcTransportOptions, WrappedPayload, WriteFileInput, WriteFileOptions, WriteToShardsInput, ZkAuthDeps, ZkAuthenticateRequest, ZkChallengeResponse, ZkCompiled, ZkIdentity, ZkRegisterRequest, ZkRegisterResponse };
|