dsh-mnemon 0.5.24 → 0.5.26
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 -1
- package/README.zh-CN.md +2 -1
- package/lib/bundle.js +1 -1
- package/lib/client.js +2564 -116
- package/lib/index.js +4451 -270
- package/lib/{starter-resolution-DFLhgaoL.js → starter-resolution-BjfPGF8R.js} +5 -5
- package/lib/starter.js +1 -1
- package/lib/types/src/client/locales.d.ts +209 -0
- package/lib/types/src/client/page-controls.d.ts +1 -0
- package/lib/types/src/host/protocol.d.ts +487 -1
- package/package.json +7 -6
|
@@ -27,7 +27,30 @@ export declare const MNEMON_READ_CHANNEL = "/dsh-mnemon-read";
|
|
|
27
27
|
export declare const MNEMON_ACTIVATION_CHANNEL = "/dsh-mnemon-activation";
|
|
28
28
|
export declare const MNEMON_WRITE_CHANNEL = "/dsh-mnemon-write";
|
|
29
29
|
export declare const MNEMON_PACK_CHANNEL = "/dsh-mnemon-pack";
|
|
30
|
+
export declare const MNEMON_SYNC_CHANNEL = "/dsh-mnemon-sync";
|
|
31
|
+
/**
|
|
32
|
+
* The credential environment variable the sync channel reads before its stored
|
|
33
|
+
* token. The name travels to the browser so the settings form can tell the user
|
|
34
|
+
* which variable wins; the value never does.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MNEMON_SYNC_TOKEN_ENV = "MNEMON_SYNC_GIT_TOKEN";
|
|
37
|
+
/**
|
|
38
|
+
* What a storage root publishes before anyone configures it: the branch, the
|
|
39
|
+
* directory inside it, and the commit identity used when no author is set. They
|
|
40
|
+
* are declared with the wire constants because the settings form shows the same
|
|
41
|
+
* defaults the Host would apply to an empty field.
|
|
42
|
+
*/
|
|
43
|
+
export declare const MNEMON_SYNC_DEFAULT_BRANCH = "mnemon-sync";
|
|
44
|
+
export declare const MNEMON_SYNC_DEFAULT_SUBDIR = "mnemon/";
|
|
45
|
+
export declare const MNEMON_SYNC_DEFAULT_AUTHOR_NAME = "dsh-mnemon sync";
|
|
46
|
+
export declare const MNEMON_SYNC_DEFAULT_AUTHOR_EMAIL = "mnemon@localhost";
|
|
30
47
|
export declare const MNEMON_SETTINGS_CHANNEL = "/dsh-mnemon-settings";
|
|
48
|
+
/**
|
|
49
|
+
* Reconciliation is the only channel that changes memory after a human read it:
|
|
50
|
+
* it stages proposals into a review ledger, takes opinions, and applies an
|
|
51
|
+
* accepted entry. It is deliberately separate from the write channel.
|
|
52
|
+
*/
|
|
53
|
+
export declare const MNEMON_REVIEW_CHANNEL = "/dsh-mnemon-review";
|
|
31
54
|
/** DSH API Gateway endpoints used by paired remote Web clients. */
|
|
32
55
|
export declare const MNEMON_REMOTE_CHANNEL = "/api";
|
|
33
56
|
export declare const MNEMON_REMOTE_NAMESPACE = "dshMnemon";
|
|
@@ -35,9 +58,11 @@ export declare const MNEMON_REMOTE_READ_ENDPOINT = "dshMnemon/read";
|
|
|
35
58
|
export declare const MNEMON_REMOTE_ACTIVATION_ENDPOINT = "dshMnemon/activation";
|
|
36
59
|
export declare const MNEMON_REMOTE_WRITE_ENDPOINT = "dshMnemon/write";
|
|
37
60
|
export declare const MNEMON_REMOTE_PACK_ENDPOINT = "dshMnemon/pack";
|
|
61
|
+
export declare const MNEMON_REMOTE_SYNC_ENDPOINT = "dshMnemon/sync";
|
|
38
62
|
export declare const MNEMON_REMOTE_SETTINGS_ENDPOINT = "dshMnemon/settings";
|
|
39
63
|
export declare const MNEMON_REMOTE_VIEW_ENDPOINT = "dshMnemon/view";
|
|
40
64
|
export declare const MNEMON_REMOTE_VIEW_WRITE_ENDPOINT = "dshMnemon/viewWrite";
|
|
65
|
+
export declare const MNEMON_REMOTE_REVIEW_ENDPOINT = "dshMnemon/review";
|
|
41
66
|
export declare const MNEMON_SETTINGS_NAMESPACE = "mnemon";
|
|
42
67
|
export declare const MNEMON_UI_SETTINGS_NAMESPACE = "mnemon-ui";
|
|
43
68
|
export * from './view-protocol.ts';
|
|
@@ -239,6 +264,12 @@ export interface Config {
|
|
|
239
264
|
persistenceStrategy?: MemoryPersistenceStrategy;
|
|
240
265
|
/** Model route used by clean, session-independent maintenance Agents. */
|
|
241
266
|
taskAgentModel?: TaskAgentModelConfig;
|
|
267
|
+
/**
|
|
268
|
+
* Whether this profile runs Git repository sync at all. It lives here rather than
|
|
269
|
+
* in the data directory because the settings page has to draw the block without
|
|
270
|
+
* asking the Host anything: a disabled block must not run a single Git command.
|
|
271
|
+
*/
|
|
272
|
+
syncEnabled?: boolean;
|
|
242
273
|
}
|
|
243
274
|
export interface TaskAgentModelConfig {
|
|
244
275
|
mode?: 'inherit' | 'fixed';
|
|
@@ -314,6 +345,7 @@ export interface ResolvedConfig {
|
|
|
314
345
|
};
|
|
315
346
|
persistenceStrategy: ResolvedMemoryPersistenceStrategy;
|
|
316
347
|
taskAgentModel: ResolvedTaskAgentModelConfig;
|
|
348
|
+
syncEnabled: boolean;
|
|
317
349
|
}
|
|
318
350
|
export interface ResolvedInteractionConfig {
|
|
319
351
|
turnBar: boolean;
|
|
@@ -421,9 +453,10 @@ export interface SubagentCounters {
|
|
|
421
453
|
compactions: number;
|
|
422
454
|
documentArchives: number;
|
|
423
455
|
metadataMaintenances: number;
|
|
456
|
+
reconciliations: number;
|
|
424
457
|
failures: number;
|
|
425
458
|
lastRunId?: string;
|
|
426
|
-
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance';
|
|
459
|
+
lastOperation?: 'recall' | 'write' | 'review' | 'placement' | 'migration' | 'compaction' | 'document-archive' | 'metadata-maintenance' | 'reconcile';
|
|
427
460
|
lastAt?: string;
|
|
428
461
|
}
|
|
429
462
|
export type LifecyclePhase = 'idle' | 'prime' | 'recall' | 'writeback' | 'review' | 'supervised' | 'error';
|
|
@@ -574,12 +607,465 @@ export interface MnemonPackPreview {
|
|
|
574
607
|
manifest: MnemonPackManifest;
|
|
575
608
|
occupied: Record<MnemonPackComponent, boolean>;
|
|
576
609
|
}
|
|
610
|
+
/**
|
|
611
|
+
* What a merge did to the runtime entries, stated as counts rather than as a file.
|
|
612
|
+
* A page that reports "added" without this number is guessing, and a merge that
|
|
613
|
+
* leaves an entry out because a tombstone still hides it has to say how many.
|
|
614
|
+
*/
|
|
615
|
+
export interface MnemonRuntimeMergeReport {
|
|
616
|
+
/** Incoming entries this merge wrote into the data directory. */
|
|
617
|
+
added: number;
|
|
618
|
+
/** Incoming entries a tombstone still hides, so the merge left them out. */
|
|
619
|
+
held: number;
|
|
620
|
+
}
|
|
577
621
|
export interface MnemonPackImportResult {
|
|
578
622
|
imported: true;
|
|
579
623
|
mode: MnemonPackImportMode;
|
|
580
624
|
targetRoot: string;
|
|
581
625
|
components: MnemonPackComponent[];
|
|
582
626
|
summary: MnemonPackComponentSummary[];
|
|
627
|
+
/** Present when this import merged runtime entries. */
|
|
628
|
+
runtime?: MnemonRuntimeMergeReport;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* The identity one installation signs its entries with. It stays in the data
|
|
632
|
+
* directory's state area, which no Pack component carries, and travels only
|
|
633
|
+
* over the sync channel, never inside a Pack.
|
|
634
|
+
*/
|
|
635
|
+
export interface MnemonMachineIdentity {
|
|
636
|
+
id: string;
|
|
637
|
+
label: string;
|
|
638
|
+
createdAt: string;
|
|
639
|
+
}
|
|
640
|
+
/** Which machine wrote one runtime entry, so a merge can tell two installations apart. */
|
|
641
|
+
export interface MnemonEntryOrigin {
|
|
642
|
+
machine: string;
|
|
643
|
+
label: string;
|
|
644
|
+
at: string;
|
|
645
|
+
}
|
|
646
|
+
/** One entry one machine removed, so the removal survives a merge instead of resurrecting. */
|
|
647
|
+
export interface MnemonTombstone {
|
|
648
|
+
target: 'memory' | 'user';
|
|
649
|
+
contentHash: string;
|
|
650
|
+
deletedAt: string;
|
|
651
|
+
machine?: string;
|
|
652
|
+
}
|
|
653
|
+
export interface MnemonTombstoneFile {
|
|
654
|
+
version: 1;
|
|
655
|
+
tombstones: MnemonTombstone[];
|
|
656
|
+
}
|
|
657
|
+
/** What one memory reconciliation proposes, and why. Nothing here is applied until a reviewer accepts it. */
|
|
658
|
+
export type MnemonReconcileOperation = {
|
|
659
|
+
kind: 'runtime-add';
|
|
660
|
+
target: 'memory' | 'user';
|
|
661
|
+
content: string;
|
|
662
|
+
importance: 'critical' | 'normal' | 'low';
|
|
663
|
+
branches?: string[];
|
|
664
|
+
reason: string;
|
|
665
|
+
} | {
|
|
666
|
+
kind: 'runtime-replace';
|
|
667
|
+
target: 'memory' | 'user';
|
|
668
|
+
oldText: string;
|
|
669
|
+
content: string;
|
|
670
|
+
importance?: 'critical' | 'normal' | 'low';
|
|
671
|
+
branches?: string[];
|
|
672
|
+
reason: string;
|
|
673
|
+
} | {
|
|
674
|
+
kind: 'runtime-remove';
|
|
675
|
+
target: 'memory' | 'user';
|
|
676
|
+
oldText: string;
|
|
677
|
+
reason: string;
|
|
678
|
+
} | {
|
|
679
|
+
kind: 'document-archive';
|
|
680
|
+
documentId: string;
|
|
681
|
+
reason: string;
|
|
682
|
+
};
|
|
683
|
+
export type MnemonReviewStatus = 'pending' | 'accepted' | 'rejected';
|
|
684
|
+
/** One reviewer's opinion on a proposal. Accepting or rejecting never replaces writing what one thinks. */
|
|
685
|
+
export interface MnemonReviewOpinion {
|
|
686
|
+
id: string;
|
|
687
|
+
author: 'user' | 'agent';
|
|
688
|
+
text: string;
|
|
689
|
+
createdAt: string;
|
|
690
|
+
}
|
|
691
|
+
export interface MnemonReviewEntry {
|
|
692
|
+
id: string;
|
|
693
|
+
createdAt: string;
|
|
694
|
+
updatedAt: string;
|
|
695
|
+
status: MnemonReviewStatus;
|
|
696
|
+
title: string;
|
|
697
|
+
summary: string;
|
|
698
|
+
/** The installation that produced the proposal. */
|
|
699
|
+
machine: {
|
|
700
|
+
id: string;
|
|
701
|
+
label: string;
|
|
702
|
+
};
|
|
703
|
+
/** Other installations whose entries the proposal touches, so a reviewer sees whose memory is at stake. */
|
|
704
|
+
foreignMachines: string[];
|
|
705
|
+
operations: MnemonReconcileOperation[];
|
|
706
|
+
opinions: MnemonReviewOpinion[];
|
|
707
|
+
decidedAt?: string;
|
|
708
|
+
appliedAt?: string;
|
|
709
|
+
/**
|
|
710
|
+
* The positions in `operations` that have already run. Applying a plan is repeatable
|
|
711
|
+
* because a reviewer can keep only part of it: a position written here is never offered
|
|
712
|
+
* again, and a plan whose every operation ran is history rather than work.
|
|
713
|
+
*/
|
|
714
|
+
appliedOperations?: number[];
|
|
715
|
+
failure?: string;
|
|
716
|
+
}
|
|
717
|
+
export interface MnemonReviewLedgerView {
|
|
718
|
+
path: string;
|
|
719
|
+
entries: MnemonReviewEntry[];
|
|
720
|
+
pending: number;
|
|
721
|
+
/**
|
|
722
|
+
* The newest proposal, and only it, carried with the list so a caller can read what
|
|
723
|
+
* the last run proposed without a second round trip. Its operations are withheld
|
|
724
|
+
* here: the list is a summary, and one plan can hold `MAX_RECONCILE_OPERATIONS` changes.
|
|
725
|
+
*/
|
|
726
|
+
latest?: MnemonReviewEntry;
|
|
727
|
+
}
|
|
728
|
+
export interface MnemonReviewApplyResult {
|
|
729
|
+
entry: MnemonReviewEntry;
|
|
730
|
+
applied: number;
|
|
731
|
+
failures: string[];
|
|
732
|
+
}
|
|
733
|
+
/** What a reconciliation run is told beyond the memory it reads. */
|
|
734
|
+
export interface MnemonReconcileOptions {
|
|
735
|
+
/**
|
|
736
|
+
* The reviewer's own words: what the plan should accomplish. It shapes the plan and
|
|
737
|
+
* never widens it - the host still decides what an operation may contain.
|
|
738
|
+
*/
|
|
739
|
+
guidance?: string;
|
|
740
|
+
}
|
|
741
|
+
/** What one reconciliation run produced. A run with no findings creates no review. */
|
|
742
|
+
export interface MnemonReconcileResult {
|
|
743
|
+
/** One line a reviewer scans in the ledger list. */
|
|
744
|
+
title: string;
|
|
745
|
+
summary: string;
|
|
746
|
+
action: 'planned' | 'none' | 'failed';
|
|
747
|
+
/** How many operations the proposal holds; the review entry carries the details. */
|
|
748
|
+
operations: number;
|
|
749
|
+
foreignMachines: string[];
|
|
750
|
+
/** How many entries the branch held that this installation had not merged, when it could be read. */
|
|
751
|
+
remoteEntries?: number;
|
|
752
|
+
/** Whether the plan was given the reviewer's own words to follow. */
|
|
753
|
+
guided?: boolean;
|
|
754
|
+
entry?: MnemonReviewEntry;
|
|
755
|
+
provider: string;
|
|
756
|
+
runId: string;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Git repository sync: the Mnemon Pack payload published as readable files on one
|
|
760
|
+
* branch, so a second machine can pull it back. Push and pull are confirmed
|
|
761
|
+
* actions, and the token is read per operation and never leaves the Host.
|
|
762
|
+
*/
|
|
763
|
+
export interface MnemonSyncConfigView {
|
|
764
|
+
/**
|
|
765
|
+
* Whether this profile syncs at all. It lives in the profile rather than in the
|
|
766
|
+
* data directory so the settings page can draw the block without asking the Host
|
|
767
|
+
* anything - a disabled block must not run a single Git command to render.
|
|
768
|
+
*/
|
|
769
|
+
enabled: boolean;
|
|
770
|
+
repoUrl?: string;
|
|
771
|
+
branch: string;
|
|
772
|
+
subdir: string;
|
|
773
|
+
/** Whether a credential is available; its value is never part of an answer. */
|
|
774
|
+
hasToken: boolean;
|
|
775
|
+
/** Where the credential the channel would authenticate with comes from. */
|
|
776
|
+
credentialSource: MnemonSyncCredentialSource;
|
|
777
|
+
/** The GitHub account the stored grant belongs to, when that is the source. */
|
|
778
|
+
credentialLogin?: string;
|
|
779
|
+
authorName: string;
|
|
780
|
+
authorEmail: string;
|
|
781
|
+
/** Minutes between automatic backups; zero means the channel runs only when asked. */
|
|
782
|
+
autoBackupMinutes: number;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* The credential the next Git operation authenticates with. The environment
|
|
786
|
+
* wins over the stored token, and the GitHub sign-in is what a user reaches for
|
|
787
|
+
* when neither is set: the order here is the order of resolution.
|
|
788
|
+
*/
|
|
789
|
+
export type MnemonSyncCredentialSource = 'environment' | 'token' | 'github' | 'none';
|
|
790
|
+
/** How far the browser step of a GitHub sign-in has come. */
|
|
791
|
+
export type MnemonSyncGitHubFlowStatus = 'pending' | 'expired' | 'denied' | 'error';
|
|
792
|
+
export interface MnemonSyncGitHubFlow {
|
|
793
|
+
userCode: string;
|
|
794
|
+
verificationUri: string;
|
|
795
|
+
/** When the code stops being accepted, as an ISO timestamp. */
|
|
796
|
+
expiresAt: string;
|
|
797
|
+
/** The cadence the Host polls at, so the page can match it. */
|
|
798
|
+
intervalMs: number;
|
|
799
|
+
}
|
|
800
|
+
/** The sign-in surface: whether it is possible, and how far it has come. */
|
|
801
|
+
export interface MnemonSyncGitHubStatus {
|
|
802
|
+
/** Whether this Host exposes a credentials store the grant can live in. */
|
|
803
|
+
available: boolean;
|
|
804
|
+
signedIn: boolean;
|
|
805
|
+
/** Whether the store accepts writes, which a read-only source denies. */
|
|
806
|
+
writable: boolean;
|
|
807
|
+
login?: string;
|
|
808
|
+
scopes?: string[];
|
|
809
|
+
flow?: MnemonSyncGitHubFlow;
|
|
810
|
+
}
|
|
811
|
+
export interface MnemonSyncGitHubPoll {
|
|
812
|
+
status: 'pending' | 'success' | 'expired' | 'denied' | 'error';
|
|
813
|
+
/** The cadence to wait for before asking again. */
|
|
814
|
+
intervalMs?: number;
|
|
815
|
+
login?: string;
|
|
816
|
+
/** Why the sign-in ended without a grant, when it did. */
|
|
817
|
+
message?: string;
|
|
818
|
+
}
|
|
819
|
+
export interface MnemonSyncGitHubRepository {
|
|
820
|
+
name: string;
|
|
821
|
+
fullName: string;
|
|
822
|
+
/** The HTTPS address Git clones, which is what the channel stores. */
|
|
823
|
+
url: string;
|
|
824
|
+
private: boolean;
|
|
825
|
+
defaultBranch: string;
|
|
826
|
+
owner: string;
|
|
827
|
+
/** Whether the account may push here; a repository it cannot is shown disabled. */
|
|
828
|
+
push: boolean;
|
|
829
|
+
}
|
|
830
|
+
export interface MnemonSyncGitHubRepositoryList {
|
|
831
|
+
login: string;
|
|
832
|
+
repositories: MnemonSyncGitHubRepository[];
|
|
833
|
+
}
|
|
834
|
+
export interface MnemonSyncGitStatus {
|
|
835
|
+
available: boolean;
|
|
836
|
+
required: string;
|
|
837
|
+
version?: string;
|
|
838
|
+
/** Why Git cannot serve the channel, when it cannot. */
|
|
839
|
+
issue?: string;
|
|
840
|
+
}
|
|
841
|
+
export interface MnemonSyncRemoteStatus {
|
|
842
|
+
reachable: boolean;
|
|
843
|
+
branchExists: boolean;
|
|
844
|
+
commit?: string;
|
|
845
|
+
error?: string;
|
|
846
|
+
}
|
|
847
|
+
export interface MnemonSyncCommit {
|
|
848
|
+
id: string;
|
|
849
|
+
message: string;
|
|
850
|
+
committedAt: string;
|
|
851
|
+
}
|
|
852
|
+
export interface MnemonSyncStatus {
|
|
853
|
+
/** Whether this profile syncs at all; when false nothing else here was checked. */
|
|
854
|
+
enabled: boolean;
|
|
855
|
+
configured: boolean;
|
|
856
|
+
config: MnemonSyncConfigView;
|
|
857
|
+
configPath: string;
|
|
858
|
+
/** The disposable Git work tree the channel commits in. */
|
|
859
|
+
mirrorPath: string;
|
|
860
|
+
git: MnemonSyncGitStatus;
|
|
861
|
+
remote: MnemonSyncRemoteStatus;
|
|
862
|
+
/**
|
|
863
|
+
* This installation's identity, which its entries and its commits carry. Absent
|
|
864
|
+
* while sync is switched off: the identity is only ever minted for a channel that
|
|
865
|
+
* runs, and a disabled block writes nothing.
|
|
866
|
+
*/
|
|
867
|
+
machine?: MnemonMachineIdentity;
|
|
868
|
+
lastCommit?: MnemonSyncCommit;
|
|
869
|
+
/** The background cadence this Host keeps; absent when no timer runs for this runtime. */
|
|
870
|
+
autoBackup?: MnemonSyncAutoBackup;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* The background cadence one runtime keeps. The timer never writes memory: it
|
|
874
|
+
* repeats the same confirmed push the button runs, and the merge a push
|
|
875
|
+
* performs is the only thing that brings remote entries in.
|
|
876
|
+
*/
|
|
877
|
+
export interface MnemonSyncAutoBackup {
|
|
878
|
+
/** Whether this Host runs a background backup at all. */
|
|
879
|
+
available: boolean;
|
|
880
|
+
/** When the last automatic run finished, as an ISO timestamp. */
|
|
881
|
+
lastAt?: string;
|
|
882
|
+
/** When the next automatic run is due, as an ISO timestamp. */
|
|
883
|
+
nextAt?: string;
|
|
884
|
+
/** Why the last automatic run failed, when it did. */
|
|
885
|
+
lastError?: string;
|
|
886
|
+
/** The commit the last automatic run recorded. */
|
|
887
|
+
lastCommit?: string;
|
|
888
|
+
/** Whether the last automatic run reached the branch. */
|
|
889
|
+
lastPushed?: boolean;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* What folding the mirror's loose objects into one pack recovered. Git keeps
|
|
893
|
+
* every payload as new blobs until a repack runs, so a mirror that is never
|
|
894
|
+
* repacked grows with every push while the pack is what a clone downloads.
|
|
895
|
+
*/
|
|
896
|
+
export interface MnemonSyncCompaction {
|
|
897
|
+
/** Loose objects before the repack. */
|
|
898
|
+
loose: number;
|
|
899
|
+
/** What those loose objects weighed, in bytes; zero when none were loose. */
|
|
900
|
+
bytes: number;
|
|
901
|
+
/** Objects the pack holds afterwards. */
|
|
902
|
+
packed: number;
|
|
903
|
+
/**
|
|
904
|
+
* What a clone downloads, in bytes: the pack after the repack, or - when the
|
|
905
|
+
* push wrote nothing new - the pack that was already there.
|
|
906
|
+
*/
|
|
907
|
+
packedBytes: number;
|
|
908
|
+
/** Why the mirror was left alone, when it was; the push itself still succeeded. */
|
|
909
|
+
warning?: string;
|
|
910
|
+
}
|
|
911
|
+
export interface MnemonSyncPushResult {
|
|
912
|
+
repoUrl: string;
|
|
913
|
+
branch: string;
|
|
914
|
+
subdir: string;
|
|
915
|
+
/** The commit holding this payload in the mirror. */
|
|
916
|
+
commit: string;
|
|
917
|
+
/** Whether this run recorded a new commit; a repeat of the same payload does not. */
|
|
918
|
+
committed: boolean;
|
|
919
|
+
message: string;
|
|
920
|
+
files: number;
|
|
921
|
+
bytes: number;
|
|
922
|
+
summary: MnemonPackComponentSummary[];
|
|
923
|
+
pushed: boolean;
|
|
924
|
+
/**
|
|
925
|
+
* What a push folded in from the branch before publishing. A push never
|
|
926
|
+
* overwrites a remote payload: the remote is merged into this machine first,
|
|
927
|
+
* and the merged result is what the new commit holds.
|
|
928
|
+
*/
|
|
929
|
+
merged?: {
|
|
930
|
+
commit: string;
|
|
931
|
+
machine?: {
|
|
932
|
+
id: string;
|
|
933
|
+
label: string;
|
|
934
|
+
};
|
|
935
|
+
components: MnemonPackComponent[];
|
|
936
|
+
summary: MnemonPackComponentSummary[];
|
|
937
|
+
/** Entries the merge dropped because a tombstone removed them. */
|
|
938
|
+
tombstones: number;
|
|
939
|
+
};
|
|
940
|
+
/** Why the branch was not published, when it was not. */
|
|
941
|
+
reason?: string;
|
|
942
|
+
/** What folding the mirror's loose objects into a pack recovered, when it ran. */
|
|
943
|
+
compaction?: MnemonSyncCompaction;
|
|
944
|
+
}
|
|
945
|
+
export interface MnemonSyncComponentDelta extends MnemonPackComponentSummary {
|
|
946
|
+
/** Whether the remote payload differs from this machine's for the component. */
|
|
947
|
+
changed: boolean;
|
|
948
|
+
}
|
|
949
|
+
export interface MnemonSyncFileDelta {
|
|
950
|
+
total: number;
|
|
951
|
+
changed: number;
|
|
952
|
+
added: number;
|
|
953
|
+
removed: number;
|
|
954
|
+
}
|
|
955
|
+
export interface MnemonSyncPreview {
|
|
956
|
+
repoUrl: string;
|
|
957
|
+
branch: string;
|
|
958
|
+
subdir: string;
|
|
959
|
+
commit: string;
|
|
960
|
+
pushedAt?: string;
|
|
961
|
+
manifest: MnemonPackManifest;
|
|
962
|
+
archiveBytes: number;
|
|
963
|
+
expandedBytes: number;
|
|
964
|
+
targetRoot: string;
|
|
965
|
+
targetScope: StorageScopeKind;
|
|
966
|
+
occupied: Record<MnemonPackComponent, boolean>;
|
|
967
|
+
components: MnemonSyncComponentDelta[];
|
|
968
|
+
files: MnemonSyncFileDelta;
|
|
969
|
+
/** When this machine's payload was collected for the comparison. */
|
|
970
|
+
localExportAt: string;
|
|
971
|
+
}
|
|
972
|
+
export interface MnemonSyncPullResult {
|
|
973
|
+
imported: true;
|
|
974
|
+
mode: MnemonPackImportMode;
|
|
975
|
+
repoUrl: string;
|
|
976
|
+
branch: string;
|
|
977
|
+
subdir: string;
|
|
978
|
+
commit: string;
|
|
979
|
+
pushedAt?: string;
|
|
980
|
+
manifest: MnemonPackManifest;
|
|
981
|
+
targetRoot: string;
|
|
982
|
+
components: MnemonPackComponent[];
|
|
983
|
+
summary: MnemonPackComponentSummary[];
|
|
984
|
+
/** Present when this pull merged runtime entries. */
|
|
985
|
+
runtime?: MnemonRuntimeMergeReport;
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* One commit on the sync branch that carries a Mnemon payload. The manifest inside
|
|
989
|
+
* the commit is what says which installation published it and what it held; the
|
|
990
|
+
* commit itself only says when and with which message.
|
|
991
|
+
*/
|
|
992
|
+
export interface MnemonSyncBackup {
|
|
993
|
+
commit: string;
|
|
994
|
+
message: string;
|
|
995
|
+
committedAt: string;
|
|
996
|
+
/** The installation that published this backup, when the manifest names one. */
|
|
997
|
+
machine?: MnemonMachineIdentity;
|
|
998
|
+
pushedAt?: string;
|
|
999
|
+
components: MnemonPackComponentSummary[];
|
|
1000
|
+
}
|
|
1001
|
+
export interface MnemonSyncBackupList {
|
|
1002
|
+
repoUrl: string;
|
|
1003
|
+
branch: string;
|
|
1004
|
+
subdir: string;
|
|
1005
|
+
commits: MnemonSyncBackup[];
|
|
1006
|
+
/** Whether commits older than the requested window exist on the branch. */
|
|
1007
|
+
truncated: boolean;
|
|
1008
|
+
}
|
|
1009
|
+
/** One runtime entry, as a difference between this machine and the branch shows it. */
|
|
1010
|
+
export interface MnemonSyncDiffEntry {
|
|
1011
|
+
target: 'memory' | 'user';
|
|
1012
|
+
content: string;
|
|
1013
|
+
importance: 'critical' | 'normal' | 'low';
|
|
1014
|
+
/** Which installation wrote it, when that is not this machine. */
|
|
1015
|
+
origin?: MnemonEntryOrigin;
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* One memory this machine holds and the branch holds a different wording of: the same
|
|
1019
|
+
* subject written twice, so the two texts cannot both stand. Entries that merely exist
|
|
1020
|
+
* on one side are additions, not conflicts, and never appear here.
|
|
1021
|
+
*/
|
|
1022
|
+
export interface MnemonSyncDiffConflict {
|
|
1023
|
+
target: 'memory' | 'user';
|
|
1024
|
+
/** What this machine holds. */
|
|
1025
|
+
local: MnemonSyncDiffEntry;
|
|
1026
|
+
/** What the branch holds, with the installation that wrote it. */
|
|
1027
|
+
remote: MnemonSyncDiffEntry;
|
|
1028
|
+
/** How alike the two texts are, from 0 to 1, after normalization. */
|
|
1029
|
+
similarity: number;
|
|
1030
|
+
}
|
|
1031
|
+
export interface MnemonSyncDiffSide {
|
|
1032
|
+
/** The manifest identity of the side: this machine's export, or the commit. */
|
|
1033
|
+
exportedAt: string;
|
|
1034
|
+
entries: number;
|
|
1035
|
+
machine?: MnemonMachineIdentity;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* What this machine holds and the branch tip holds, stated as entries rather than
|
|
1039
|
+
* as bytes: which memories are only here, which are only there, and which removals
|
|
1040
|
+
* the branch recorded that this machine has not applied.
|
|
1041
|
+
*/
|
|
1042
|
+
export interface MnemonSyncDiff {
|
|
1043
|
+
repoUrl: string;
|
|
1044
|
+
branch: string;
|
|
1045
|
+
subdir: string;
|
|
1046
|
+
commit: string;
|
|
1047
|
+
pushedAt?: string;
|
|
1048
|
+
localExportAt: string;
|
|
1049
|
+
local: MnemonSyncDiffSide;
|
|
1050
|
+
remote: MnemonSyncDiffSide;
|
|
1051
|
+
localOnly: MnemonSyncDiffEntry[];
|
|
1052
|
+
remoteOnly: MnemonSyncDiffEntry[];
|
|
1053
|
+
/**
|
|
1054
|
+
* The same subject recorded differently on both sides. Only these need reconciling;
|
|
1055
|
+
* anything that exists on one side alone can simply be added.
|
|
1056
|
+
*/
|
|
1057
|
+
conflicts: MnemonSyncDiffConflict[];
|
|
1058
|
+
/** How many entries both sides hold, compared by target and content. */
|
|
1059
|
+
shared: number;
|
|
1060
|
+
/** Whether a side held more differences than this response lists. */
|
|
1061
|
+
truncated: boolean;
|
|
1062
|
+
/**
|
|
1063
|
+
* How many of the entries the branch holds and this machine does not are held
|
|
1064
|
+
* back by this machine's own tombstones: a merge would leave every one of them
|
|
1065
|
+
* out, so a page that offers to add them has to say what that offer would do.
|
|
1066
|
+
*/
|
|
1067
|
+
heldBack: number;
|
|
1068
|
+
remoteTombstones: MnemonTombstone[];
|
|
583
1069
|
}
|
|
584
1070
|
export type VersionPackageId = `dsh-mnemon-${'source' | 'strategy' | 'provider'}-${string}`;
|
|
585
1071
|
export type VersionComponentId = 'mnemon' | 'dsh-mnemon' | VersionPackageId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.26",
|
|
4
4
|
"description": "Composable, view-based memory for DeepSeek Harness. Pluggable sources and strategies, with layered memory out of the box.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
"verify:plugins": "node scripts/verify-plugin-artifacts.mjs",
|
|
143
143
|
"verify:docs": "node scripts/verify-docs.mjs",
|
|
144
144
|
"e2e:serve": "node scripts/serve-e2e.mjs",
|
|
145
|
+
"e2e:sync": "node scripts/verify-sync-git.mjs",
|
|
145
146
|
"verify": "pnpm run verify:docs && pnpm run typecheck && pnpm run verify:build && pnpm --workspace-concurrency=4 -r build && pnpm -r typecheck && pnpm -r test && pnpm run test:root && pnpm run verify:headless && pnpm run verify:package",
|
|
146
147
|
"changeset": "changeset",
|
|
147
148
|
"release:intent": "node scripts/check-release-intent.mjs",
|
|
@@ -157,15 +158,15 @@
|
|
|
157
158
|
"dsh-mnemon-provider-holographic": "0.5.6",
|
|
158
159
|
"dsh-mnemon-provider-honcho": "0.5.5",
|
|
159
160
|
"dsh-mnemon-provider-mem0": "0.5.5",
|
|
160
|
-
"dsh-mnemon-provider-mnemon-native": "0.5.
|
|
161
|
+
"dsh-mnemon-provider-mnemon-native": "0.5.9",
|
|
161
162
|
"dsh-mnemon-provider-openviking": "0.5.7",
|
|
162
163
|
"dsh-mnemon-provider-retaindb": "0.5.5",
|
|
163
164
|
"dsh-mnemon-provider-supermemory": "0.5.5",
|
|
164
|
-
"dsh-mnemon-source-documents": "0.5.
|
|
165
|
-
"dsh-mnemon-source-memory-spaces": "0.5.
|
|
166
|
-
"dsh-mnemon-source-runtime": "0.5.
|
|
165
|
+
"dsh-mnemon-source-documents": "0.5.10",
|
|
166
|
+
"dsh-mnemon-source-memory-spaces": "0.5.17",
|
|
167
|
+
"dsh-mnemon-source-runtime": "0.5.14",
|
|
167
168
|
"dsh-mnemon-strategy-auto-capture": "0.5.5",
|
|
168
|
-
"dsh-mnemon-strategy-default-three-tier": "0.5.
|
|
169
|
+
"dsh-mnemon-strategy-default-three-tier": "0.5.8",
|
|
169
170
|
"dsh-mnemon-strategy-general": "0.5.1",
|
|
170
171
|
"dsh-mnemon-strategy-light-context": "0.5.5",
|
|
171
172
|
"dsh-mnemon-strategy-scoped": "0.5.5",
|