dsh-mnemon 0.4.7 → 0.5.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.
Files changed (136) hide show
  1. package/README.md +10 -20
  2. package/README.zh-CN.md +10 -20
  3. package/SECURITY.md +8 -8
  4. package/cordis.patch.yml +42 -0
  5. package/lib/client.js +2360 -6843
  6. package/lib/contracts.js +16 -17
  7. package/lib/core.js +11 -0
  8. package/lib/definitions-j0FLgE0-.js +251 -0
  9. package/lib/extension-sdk.js +93 -229
  10. package/lib/index.js +3730 -6330
  11. package/lib/runtime-AtIOTeP1.js +1316 -0
  12. package/lib/storage-lock-Bqrhkyag.js +20 -0
  13. package/lib/testing.js +231 -0
  14. package/lib/types/src/client/extension-sdk.d.ts +10 -0
  15. package/lib/types/src/client/index.d.ts +1 -0
  16. package/lib/types/src/client/locales.d.ts +84 -0
  17. package/lib/types/src/client/page-client.d.ts +15 -0
  18. package/lib/types/src/client/page-kit.d.ts +40 -0
  19. package/lib/types/src/client/source-contracts.d.ts +46 -0
  20. package/lib/types/src/client/source-pages.d.ts +83 -0
  21. package/lib/types/src/core/contracts/index.d.ts +40 -0
  22. package/lib/types/src/core/contracts/plugin.d.ts +32 -0
  23. package/lib/types/src/core/contracts/view.d.ts +416 -0
  24. package/lib/types/src/core/definitions.d.ts +16 -0
  25. package/lib/types/src/core/plugin.d.ts +6 -0
  26. package/lib/types/src/{config-values.d.ts → host/config-values.d.ts} +7 -7
  27. package/lib/types/src/{config.d.ts → host/config.d.ts} +4 -1
  28. package/lib/types/src/{shared → host}/display-mode.d.ts +1 -1
  29. package/lib/types/src/host/plugin.d.ts +8 -0
  30. package/lib/types/src/host/protocol.d.ts +549 -0
  31. package/lib/types/src/host/view-protocol.d.ts +123 -0
  32. package/lib/types/src/index.d.ts +2 -21
  33. package/lib/types/src/sdk/index.d.ts +9 -0
  34. package/lib/types/src/sdk/input.d.ts +11 -0
  35. package/lib/types/src/sdk/install.d.ts +7 -0
  36. package/lib/types/src/sdk/service.d.ts +31 -0
  37. package/lib/types/src/sdk/storage-lock.d.ts +6 -0
  38. package/lib/types/src/sdk/strategy-configuration.d.ts +31 -0
  39. package/lib/types/src/sdk/testing.d.ts +70 -0
  40. package/package.json +46 -35
  41. package/lib/kernel.js +0 -1173
  42. package/lib/layers/documents.js +0 -31
  43. package/lib/layers/memory-spaces.js +0 -34
  44. package/lib/layers/runtime.js +0 -27
  45. package/lib/provider-sdk.js +0 -2
  46. package/lib/registry-B9SdBRLo.js +0 -2423
  47. package/lib/strategy-default-three-tier.js +0 -99
  48. package/lib/strategy-sdk.js +0 -56
  49. package/lib/types/packages/contracts/src/index.d.ts +0 -221
  50. package/lib/types/packages/extension-sdk/src/index.d.ts +0 -54
  51. package/lib/types/packages/kernel/src/access.d.ts +0 -14
  52. package/lib/types/packages/kernel/src/catalog.d.ts +0 -42
  53. package/lib/types/packages/kernel/src/index.d.ts +0 -5
  54. package/lib/types/packages/kernel/src/kernel.d.ts +0 -46
  55. package/lib/types/packages/kernel/src/topology.d.ts +0 -25
  56. package/lib/types/packages/kernel/src/view.d.ts +0 -89
  57. package/lib/types/packages/layer-documents/src/index.d.ts +0 -4
  58. package/lib/types/packages/layer-memory-spaces/src/index.d.ts +0 -4
  59. package/lib/types/packages/layer-runtime/src/index.d.ts +0 -4
  60. package/lib/types/packages/provider-sdk/src/index.d.ts +0 -19
  61. package/lib/types/packages/strategy-default-three-tier/src/index.d.ts +0 -7
  62. package/lib/types/packages/strategy-sdk/src/index.d.ts +0 -35
  63. package/lib/types/src/activity.d.ts +0 -16
  64. package/lib/types/src/agent-memory-turn.d.ts +0 -42
  65. package/lib/types/src/channels.d.ts +0 -1
  66. package/lib/types/src/client/GlobalLocationSetting.d.ts +0 -19
  67. package/lib/types/src/client/MnemonPackSection.d.ts +0 -13
  68. package/lib/types/src/client/MnemonSaveAction.d.ts +0 -13
  69. package/lib/types/src/client/MnemonSettingsCard.d.ts +0 -16
  70. package/lib/types/src/client/MnemonTurnTail.d.ts +0 -21
  71. package/lib/types/src/client/MnemonView.d.ts +0 -26
  72. package/lib/types/src/client/ProviderIcon.d.ts +0 -8
  73. package/lib/types/src/client/ProviderSettingsSection.d.ts +0 -16
  74. package/lib/types/src/client/anchor.d.ts +0 -27
  75. package/lib/types/src/client/api.d.ts +0 -83
  76. package/lib/types/src/client/better-sidebar.d.ts +0 -13
  77. package/lib/types/src/client/dsh-compat.d.ts +0 -51
  78. package/lib/types/src/client/settings.d.ts +0 -23
  79. package/lib/types/src/client/sidebar-entry.d.ts +0 -5
  80. package/lib/types/src/client/subagent-token-usage.d.ts +0 -23
  81. package/lib/types/src/client/workspace-controller.d.ts +0 -14
  82. package/lib/types/src/client/workspace-mount.d.ts +0 -20
  83. package/lib/types/src/commands.d.ts +0 -13
  84. package/lib/types/src/contracts.d.ts +0 -316
  85. package/lib/types/src/documents.d.ts +0 -77
  86. package/lib/types/src/git-branch.d.ts +0 -6
  87. package/lib/types/src/guidance.d.ts +0 -29
  88. package/lib/types/src/lifecycle.d.ts +0 -80
  89. package/lib/types/src/live-runtime.d.ts +0 -92
  90. package/lib/types/src/memory-bodies.d.ts +0 -57
  91. package/lib/types/src/memory-receipts.d.ts +0 -21
  92. package/lib/types/src/memory-system/access.d.ts +0 -2
  93. package/lib/types/src/memory-system/catalog.d.ts +0 -2
  94. package/lib/types/src/memory-system/contracts.d.ts +0 -2
  95. package/lib/types/src/memory-system/defaults.d.ts +0 -6
  96. package/lib/types/src/memory-system/index.d.ts +0 -7
  97. package/lib/types/src/memory-system/kernel.d.ts +0 -2
  98. package/lib/types/src/memory-system/topology.d.ts +0 -2
  99. package/lib/types/src/memory-system/view.d.ts +0 -2
  100. package/lib/types/src/memory-view.d.ts +0 -21
  101. package/lib/types/src/pack.d.ts +0 -29
  102. package/lib/types/src/process.d.ts +0 -16
  103. package/lib/types/src/provider-placement.d.ts +0 -26
  104. package/lib/types/src/provider-sdk.d.ts +0 -4
  105. package/lib/types/src/providers/byterover.d.ts +0 -32
  106. package/lib/types/src/providers/catalog.d.ts +0 -23
  107. package/lib/types/src/providers/hindsight.d.ts +0 -20
  108. package/lib/types/src/providers/holographic.d.ts +0 -23
  109. package/lib/types/src/providers/honcho.d.ts +0 -18
  110. package/lib/types/src/providers/http.d.ts +0 -32
  111. package/lib/types/src/providers/mem0.d.ts +0 -18
  112. package/lib/types/src/providers/memory-system.d.ts +0 -6
  113. package/lib/types/src/providers/openviking.d.ts +0 -32
  114. package/lib/types/src/providers/provider.d.ts +0 -46
  115. package/lib/types/src/providers/registry.d.ts +0 -23
  116. package/lib/types/src/providers/retaindb.d.ts +0 -17
  117. package/lib/types/src/providers/supermemory.d.ts +0 -17
  118. package/lib/types/src/recall-quality/contracts.d.ts +0 -32
  119. package/lib/types/src/recall-quality/engine.d.ts +0 -13
  120. package/lib/types/src/recall-quality/index.d.ts +0 -4
  121. package/lib/types/src/recall-quality/policies.d.ts +0 -5
  122. package/lib/types/src/recall-quality/registry.d.ts +0 -10
  123. package/lib/types/src/review-activity.d.ts +0 -19
  124. package/lib/types/src/rpc.d.ts +0 -22
  125. package/lib/types/src/runner.d.ts +0 -41
  126. package/lib/types/src/runtime-memory.d.ts +0 -90
  127. package/lib/types/src/search-tokens.d.ts +0 -5
  128. package/lib/types/src/service.d.ts +0 -113
  129. package/lib/types/src/session-events.d.ts +0 -8
  130. package/lib/types/src/settings.d.ts +0 -6
  131. package/lib/types/src/shared/contracts.d.ts +0 -1008
  132. package/lib/types/src/storage-scope.d.ts +0 -12
  133. package/lib/types/src/subagent-token-usage.d.ts +0 -53
  134. package/lib/types/src/subagent.d.ts +0 -124
  135. package/lib/types/src/tools.d.ts +0 -10
  136. package/lib/types/src/version-updates.d.ts +0 -37
@@ -1,4 +0,0 @@
1
- import type { MemoryLayerDescriptor } from '../../contracts/src/index.ts';
2
- import type { MemoryCatalog, MemoryLayerRegistration } from '../../kernel/src/index.ts';
3
- export declare const RUNTIME_MEMORY_LAYER: Readonly<MemoryLayerDescriptor>;
4
- export declare function registerRuntimeMemoryLayer(catalog: MemoryCatalog, registration?: Omit<MemoryLayerRegistration, 'descriptor'>): () => void;
@@ -1,19 +0,0 @@
1
- import type { MemoryAdapterDescriptor } from '../../contracts/src/index.ts';
2
- export interface MemoryAdapterFactory<Id extends string, Context, Adapter extends {
3
- readonly id: Id;
4
- }> {
5
- readonly id: Id;
6
- create(context: Context): Adapter;
7
- }
8
- /** Lifecycle-owned factory directory used by Provider plugins and the Host. */
9
- export declare class MemoryAdapterFactoryRegistry<Id extends string, Context, Adapter extends {
10
- readonly id: Id;
11
- }> {
12
- private readonly factories;
13
- constructor(factories?: readonly MemoryAdapterFactory<Id, Context, Adapter>[]);
14
- register(factory: MemoryAdapterFactory<Id, Context, Adapter>): () => void;
15
- create(context: Context): Map<Id, Adapter>;
16
- ids(): Id[];
17
- }
18
- export declare function defineMemoryAdapterDescriptor<T extends MemoryAdapterDescriptor>(descriptor: T): T;
19
- export type { MemoryAdapterDescriptor, MemoryAdapterLocality, MemoryAdapterScope, MemoryCapability, MemoryJsonValue, } from '../../contracts/src/index.ts';
@@ -1,7 +0,0 @@
1
- import type { MemoryCatalog, MemoryLayerRegistration, MemoryStrategyRegistration } from '../../kernel/src/index.ts';
2
- import type { MemoryLayerParticipation, MemoryTopologyDefinition } from '../../contracts/src/index.ts';
3
- export declare const BUILTIN_MEMORY_LAYERS: readonly [Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>, Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>, Readonly<import("../../contracts/src/index.ts").MemoryLayerDescriptor>];
4
- export declare const DEFAULT_LAYER_PARTICIPATION: Readonly<MemoryLayerParticipation>;
5
- export declare const DEFAULT_THREE_TIER_TOPOLOGY: Readonly<MemoryTopologyDefinition>;
6
- export declare const DEFAULT_THREE_TIER_STRATEGY: MemoryStrategyRegistration;
7
- export declare function registerDefaultMemorySystem(catalog: MemoryCatalog, layers?: Partial<Record<string, Omit<MemoryLayerRegistration, 'descriptor'>>>): () => void;
@@ -1,35 +0,0 @@
1
- import type { MemoryPlanProposal, MemoryPlanRequest, MemorySystemDescriptor } from '../../contracts/src/index.ts';
2
- import type { MemoryStrategyRegistration } from '../../kernel/src/index.ts';
3
- export declare const MEMORY_STRATEGY_PLUGIN_API_VERSION: "dsh-mnemon/v1alpha1";
4
- export interface MemoryStrategyPluginManifest {
5
- apiVersion: typeof MEMORY_STRATEGY_PLUGIN_API_VERSION;
6
- kind: 'MemoryStrategyPlugin';
7
- metadata: {
8
- id: string;
9
- version: string;
10
- label: string;
11
- description: string;
12
- };
13
- permissions: {
14
- layerIds: string[];
15
- adapterIds: string[];
16
- capabilities: MemoryPlanRequest['capability'][];
17
- maxSteps: number;
18
- };
19
- }
20
- export interface MemoryStrategyPlugin {
21
- manifest: MemoryStrategyPluginManifest;
22
- strategy: MemoryStrategyRegistration;
23
- }
24
- /** Define an immutable, declarative strategy package; the Kernel remains authoritative. */
25
- export declare function defineMemoryStrategyPlugin(plugin: MemoryStrategyPlugin): Readonly<MemoryStrategyPlugin>;
26
- export interface MemoryStrategyReplayCase {
27
- request: MemoryPlanRequest;
28
- descriptor: MemorySystemDescriptor;
29
- assert(proposal: MemoryPlanProposal): void | Promise<void>;
30
- }
31
- /** Deterministic replay primitive for generated and hand-written strategies. */
32
- export declare function replayMemoryStrategy(strategy: MemoryStrategyRegistration, cases: readonly MemoryStrategyReplayCase[]): Promise<void>;
33
- export declare function defineMemoryStrategy<T extends MemoryStrategyRegistration>(strategy: T): T;
34
- export type { MemoryPlanProposal, MemoryPlanRequest, MemoryStrategyDescriptor, MemoryStrategyHook, MemorySystemDescriptor, } from '../../contracts/src/index.ts';
35
- export type { MemoryStrategyContext, MemoryStrategyRegistration } from '../../kernel/src/index.ts';
@@ -1,16 +0,0 @@
1
- import type { HostSessionEvent } from './contracts.ts';
2
- import type { TurnMemoryActivitySnapshot } from './shared/contracts.ts';
3
- export type { TurnMemoryActivity, TurnMemoryActivitySnapshot } from './shared/contracts.ts';
4
- /**
5
- * Incremental durable-log projection. Repeated UI reads process only events
6
- * appended since the previous snapshot instead of rescanning the full session.
7
- */
8
- export declare class TurnActivityProjection {
9
- private eventCount;
10
- private lastEventSeq;
11
- private readonly pending;
12
- private readonly byTurn;
13
- reset(): void;
14
- snapshot(events: readonly HostSessionEvent[]): TurnMemoryActivitySnapshot;
15
- private consume;
16
- }
@@ -1,42 +0,0 @@
1
- import type { MemoryOperationScope, MemoryTurnContext } from '../packages/contracts/src/index.ts';
2
- import type { MemoryTurnViewManager } from '../packages/kernel/src/index.ts';
3
- import type { HostAgent } from './contracts.ts';
4
- import type { MnemonAgentRuntimeSource, MnemonRuntimeGraph } from './live-runtime.ts';
5
- /** Host-owned authority captured before a child activation starts executing. */
6
- export interface DelegatedMemoryView {
7
- readonly graph: MnemonRuntimeGraph;
8
- readonly scope: MemoryOperationScope;
9
- readonly viewId?: string;
10
- }
11
- export interface PinnedAgentMemoryTurn {
12
- readonly turn: number;
13
- readonly graph: MnemonRuntimeGraph;
14
- readonly manager: MemoryTurnViewManager;
15
- readonly context: MemoryTurnContext;
16
- readonly releaseRuntime?: () => void;
17
- }
18
- export declare function agentMemoryScope(agent: HostAgent, graph: MnemonRuntimeGraph): MemoryOperationScope;
19
- /** The durable log, not a parent session id, identifies the executing turn. */
20
- export declare function openAgentTurn(agent: HostAgent): number | undefined;
21
- /**
22
- * One Agent owns each turn pin. A child additionally retains its delegation
23
- * across parent completion, collection, and runtime swaps until it is disposed.
24
- */
25
- export declare class AgentMemoryTurn {
26
- private readonly agent;
27
- private readonly runtime;
28
- private readonly delegation?;
29
- private pinned;
30
- private pending;
31
- private generation;
32
- private closed;
33
- private readonly releaseDelegation;
34
- constructor(agent: HostAgent, runtime: Pick<MnemonAgentRuntimeSource, 'forAgent' | 'bindAgentRuntime'>, delegation?: DelegatedMemoryView | undefined);
35
- get current(): PinnedAgentMemoryTurn | undefined;
36
- /** Capture now; descendants must not resolve a later parent turn on demand. */
37
- delegate(): DelegatedMemoryView;
38
- begin(turn: number, signal?: AbortSignal): Promise<void>;
39
- end(turn?: number): void;
40
- dispose(): void;
41
- private pin;
42
- }
@@ -1 +0,0 @@
1
- export { MNEMON_ACTIVATION_CHANNEL, MNEMON_PACK_CHANNEL, MNEMON_READ_CHANNEL, MNEMON_WRITE_CHANNEL } from './shared/contracts.ts';
@@ -1,19 +0,0 @@
1
- import type { JSX, ReactNode } from 'react';
2
- interface GlobalLocationSettingProps {
3
- name: string;
4
- ariaLabel: string;
5
- label: string;
6
- hint: string;
7
- defaultLabel: string;
8
- customLabel: string;
9
- custom: boolean;
10
- workspace: boolean;
11
- disabled: boolean;
12
- className?: string | undefined;
13
- children?: ReactNode;
14
- onChange: (custom: boolean) => void;
15
- onInteract?: (() => void) | undefined;
16
- }
17
- /** Shared global/default location control for Native and workspace-aware providers. */
18
- export declare function GlobalLocationSetting(props: GlobalLocationSettingProps): JSX.Element;
19
- export {};
@@ -1,13 +0,0 @@
1
- import { type JSX } from 'react';
2
- import type { ClientConnectionHandle } from '../shared/contracts.ts';
3
- import type { MnemonTranslate } from './locales.ts';
4
- interface MnemonPackSectionProps {
5
- connection?: ClientConnectionHandle;
6
- sessionId?: string;
7
- workspaceId?: string;
8
- refreshKey: number;
9
- t: MnemonTranslate;
10
- embedded?: boolean;
11
- }
12
- export declare function MnemonPackSection({ connection, sessionId, workspaceId, refreshKey, t, embedded }: MnemonPackSectionProps): JSX.Element;
13
- export {};
@@ -1,13 +0,0 @@
1
- import type { ClientConnectionHandle, ClientSettingsScope, Config } from '../shared/contracts.ts';
2
- import type { MnemonKey } from './locales.ts';
3
- export interface MnemonSaveActionProps {
4
- /** Stable identity of the finalized assistant message this action addresses. */
5
- messageId: string;
6
- /** Injected by the slot host: the session this message belongs to. */
7
- sessionId?: string;
8
- connection: ClientConnectionHandle;
9
- settingsScope: ClientSettingsScope<Config>;
10
- t: (key: MnemonKey, params?: Record<string, unknown>) => string;
11
- }
12
- /** Save-to-memory action on finalized assistant messages, routed through the supervised writeback gate. */
13
- export declare const MnemonSaveAction: import("react").NamedExoticComponent<MnemonSaveActionProps>;
@@ -1,16 +0,0 @@
1
- import { type JSX } from 'react';
2
- import { type ClientConnectionHandle, type ClientSettingsScope, type Config, type InteractionConfig } from '../shared/contracts.ts';
3
- import { type MnemonTranslate } from './locales.ts';
4
- export interface MnemonSettingsCardProps {
5
- scope: ClientSettingsScope<Config>;
6
- /** Separate live namespace; falls back to the core scope for older hosts. */
7
- interactionScope?: ClientSettingsScope<InteractionConfig>;
8
- /** Loopback RPC used for whole-directory ZIP backup and restore. */
9
- connection?: ClientConnectionHandle;
10
- sessionId?: string;
11
- workspaceId?: string;
12
- workspaceLabel?: string;
13
- t?: MnemonTranslate;
14
- }
15
- /** Dedicated Mnemon page contributed directly to DSH's settings navigation. */
16
- export declare function MnemonSettingsCard({ scope, interactionScope: suppliedInteractionScope, connection, sessionId, workspaceId, workspaceLabel, t }: MnemonSettingsCardProps): JSX.Element | null;
@@ -1,21 +0,0 @@
1
- import type { ClientConnectionHandle } from '../shared/contracts.ts';
2
- import { type MnemonAnchorPage } from './anchor.ts';
3
- import type { MnemonKey } from './locales.ts';
4
- export interface MnemonTurnTailProps {
5
- /** Engine-owned closing Turn boundary (TurnLocation on the wire). */
6
- turn: unknown;
7
- seq: number;
8
- openFile: (path: string) => void;
9
- /** Injected by the slot host: the session this tail belongs to. */
10
- sessionId?: string;
11
- connection: ClientConnectionHandle;
12
- t: (key: MnemonKey, params?: Record<string, unknown>) => string;
13
- }
14
- /** Route a settled tool name to the workbench page that explains its effect. */
15
- export declare function memoryPageForTool(name: string): MnemonAnchorPage;
16
- /** Whether this entry renders for the owner; chain selectors decline quietly. */
17
- export declare function selectMnemonTurnTail(owner: {
18
- turn: unknown;
19
- }): Record<string, never> | null;
20
- /** One-line memory-activity bar under a completed turn; hides when the turn touched no memory. */
21
- export declare const MnemonTurnTail: import("react").NamedExoticComponent<MnemonTurnTailProps>;
@@ -1,26 +0,0 @@
1
- import { type ClientConnectionHandle, type ClientSettingsScope, type Config, type MnemonDisplayMode } from '../shared/contracts.ts';
2
- import { type MnemonTranslate } from './locales.ts';
3
- export interface MnemonViewProps {
4
- connection: ClientConnectionHandle;
5
- settingsScope: ClientSettingsScope<Config>;
6
- sessionId?: string;
7
- workspaceId?: string;
8
- workspaceSelection?: MnemonWorkspaceSelection;
9
- /** Placement affects the scope header, never the shared pages or skin. */
10
- surface?: MnemonDisplayMode;
11
- t?: MnemonTranslate;
12
- locale?: string;
13
- onClose?: () => void;
14
- }
15
- export interface MnemonWorkspaceSelection {
16
- options: Array<{
17
- id: string;
18
- title: string;
19
- path: string;
20
- }>;
21
- selectedWorkspaceId?: string;
22
- effectiveWorkspaceId?: string;
23
- onSelect(workspaceId: string): void;
24
- onAlign(): void;
25
- }
26
- export declare function MnemonView(props: MnemonViewProps): JSX.Element;
@@ -1,8 +0,0 @@
1
- import type { MemoryProviderId } from '../shared/contracts.ts';
2
- export interface ProviderIconProps {
3
- providerId: MemoryProviderId;
4
- className?: string | undefined;
5
- title?: string | undefined;
6
- }
7
- /** Provider brand mark. Official assets are bundled locally; Holographic uses its canonical mirror motif. */
8
- export declare function ProviderIcon({ providerId, className, title }: ProviderIconProps): JSX.Element;
@@ -1,16 +0,0 @@
1
- import { type JSX } from 'react';
2
- import type { ClientConnectionHandle } from '../shared/contracts.ts';
3
- import type { MnemonTranslate } from './locales.ts';
4
- interface ProviderSettingsSectionProps {
5
- connection?: ClientConnectionHandle;
6
- sessionId?: string;
7
- workspaceId?: string;
8
- workspaceLabel?: string;
9
- activeScope: 'global' | 'workspace';
10
- refreshKey: number;
11
- disabled: boolean;
12
- scopeChanging: boolean;
13
- t: MnemonTranslate;
14
- }
15
- export declare function ProviderSettingsSection(props: ProviderSettingsSectionProps): JSX.Element;
16
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * Lightweight anchor channel between conversation-scoped Mnemon surfaces
3
- * (turnTail bar and assistant actions) and the Mnemon workspace view.
4
- *
5
- * A dispatch asks the Mnemon view to open a page (optionally with a seed) in
6
- * the session the dispatch came from. The view may not be mounted when the
7
- * user clicks — the dispatch is then held per session and consumed the next
8
- * time that session's Mnemon workspace mounts, so opening Memory System from
9
- * the sidebar afterwards still lands on the requested page or write dialog.
10
- */
11
- /** Pages of the Mnemon workspace, mirroring MnemonView's internal Page union. */
12
- export type MnemonAnchorPage = 'overview' | 'runtime' | 'documents' | 'explore' | 'entities' | 'remember' | 'list' | 'status';
13
- export interface MnemonAnchor {
14
- /** Target workspace page. */
15
- page: MnemonAnchorPage;
16
- /** Optional context seed (recall query for explore, candidate text for remember). */
17
- seed?: string;
18
- /** Session the dispatch belongs to; omitted dispatches address every session. */
19
- sessionId?: string;
20
- }
21
- export declare const MNEMON_ANCHOR_EVENT = "mnemon:anchor";
22
- /** Ask the Mnemon view to open a page; held until a matching view consumes it. */
23
- export declare function dispatchMnemonAnchor(anchor: MnemonAnchor): void;
24
- /** Take the anchor held for this session (usually at mount time), or null. */
25
- export declare function consumeMnemonAnchor(sessionId?: string): MnemonAnchor | null;
26
- /** Subscribe to anchors addressed to this session; returns an unsubscribe. */
27
- export declare function subscribeMnemonAnchor(sessionId: string | undefined, onAnchor: (anchor: MnemonAnchor) => void): () => void;
@@ -1,83 +0,0 @@
1
- import { type AssistantMessageText, type CreateMemoryBodyRequest, type ClientConnectionHandle, type DocumentMutation, type DocumentMutationResult, type DocumentSearchResult, type DocumentSnapshot, type DocumentView, type EntityView, type Insight, type MemoryBody, type MemoryBodyView, type MemoryBodyMetadataMaintenanceResult, type MemoryBodyCatalog, type MemoryProviderServiceCatalog, type MemoryProviderServiceView, type MemoryGraphSnapshot, type MemoryListRequest, type MemoryListView, type MemorySystemDescriptor, type MemoryReadSource, type MnemonPackExport, type MnemonPackImportResult, type MnemonPackPreview, type MnemonEmbeddingStatus, type RememberRequest, type RuntimeMemoryImportance, type RuntimeMemoryMutationResult, type RuntimeMemorySnapshot, type RuntimeMemoryTarget, type SearchRequest, type StatusView, type TaskAgentModelCatalog, type TurnMemoryActivity, type UpdateMemoryBodyRequest, type UpdateMemoryProviderServiceRequest, type VersionComponentId, type VersionStatus, type VersionUpdateResult } from '../shared/contracts.ts';
2
- export interface SearchResponse {
3
- query: string;
4
- mode: string;
5
- results: Insight[];
6
- hint?: string;
7
- /** Omitted only when talking to a pre-provider-aware Host. */
8
- sources?: MemoryReadSource[];
9
- }
10
- export interface AgentSearchResponse extends SearchResponse {
11
- answer: string;
12
- citations: string[];
13
- delegation: {
14
- runId: string;
15
- provider: string;
16
- };
17
- }
18
- export declare class MnemonClient {
19
- private readonly connection;
20
- private readonly sessionId?;
21
- private readonly workspaceId?;
22
- constructor(connection: ClientConnectionHandle, sessionId?: string | undefined, workspaceId?: string | undefined);
23
- private call;
24
- private scoped;
25
- status(): Promise<StatusView>;
26
- statusSummary(): Promise<StatusView>;
27
- embeddingStatus(): Promise<MnemonEmbeddingStatus>;
28
- memorySystem(): Promise<MemorySystemDescriptor>;
29
- taskAgentModels(includeCatalog?: boolean): Promise<TaskAgentModelCatalog>;
30
- versions(): Promise<VersionStatus>;
31
- updateVersion(component: VersionComponentId): Promise<VersionUpdateResult>;
32
- runtimeMemory(): Promise<RuntimeMemorySnapshot>;
33
- mutateRuntimeMemory(request: {
34
- action: 'add' | 'replace' | 'remove';
35
- target: RuntimeMemoryTarget;
36
- content?: string;
37
- old_text?: string;
38
- importance?: RuntimeMemoryImportance;
39
- branches?: string[];
40
- }): Promise<RuntimeMemoryMutationResult>;
41
- documents(): Promise<DocumentSnapshot>;
42
- document(id: string): Promise<DocumentView>;
43
- searchDocuments(query: string, includeArchived?: boolean, limit?: number): Promise<DocumentSearchResult>;
44
- mutateDocument(request: DocumentMutation): Promise<DocumentMutationResult>;
45
- archiveDocument(id: string): Promise<DocumentMutationResult>;
46
- bodies(): Promise<MemoryBodyCatalog>;
47
- bodyDirectory(): Promise<MemoryBodyCatalog>;
48
- providerServices(): Promise<MemoryProviderServiceCatalog>;
49
- updateProviderService(request: UpdateMemoryProviderServiceRequest): Promise<MemoryProviderServiceView>;
50
- graph(memoryBodyIds?: string[]): Promise<MemoryGraphSnapshot>;
51
- list(request?: MemoryListRequest): Promise<MemoryListView>;
52
- entities(entity?: string, limit?: number): Promise<EntityView>;
53
- search(request: SearchRequest): Promise<SearchResponse>;
54
- agentSearch(request: SearchRequest): Promise<AgentSearchResponse>;
55
- related(id: string, memoryBodyId?: string): Promise<Insight[]>;
56
- /** Settled memory-tool activity of one turn, shared across all mounted tails. */
57
- turnActivity(turn: number, cursor?: number): Promise<TurnMemoryActivity | null>;
58
- /** Plain text of one finalized assistant message; null when absent or empty. */
59
- assistantMessageText(messageId: string): Promise<AssistantMessageText | null>;
60
- remember(request: RememberRequest): Promise<Record<string, unknown>>;
61
- supervise(content: string, idempotencyKey?: string): Promise<{
62
- delegated: true;
63
- sessionId: string;
64
- runId: string;
65
- provider: string;
66
- summary: string;
67
- action: string;
68
- memoryBodyIds: string[];
69
- }>;
70
- forget(id: string, memoryBodyId?: string): Promise<Record<string, unknown>>;
71
- createBody(request: CreateMemoryBodyRequest): Promise<MemoryBody>;
72
- updateBody(memoryBodyId: string, request: UpdateMemoryBodyRequest): Promise<MemoryBody>;
73
- reconnectBody(memoryBodyId: string): Promise<MemoryBodyView>;
74
- maintainBodyMetadata(memoryBodyIds: string[]): Promise<MemoryBodyMetadataMaintenanceResult>;
75
- deleteBody(memoryBodyId: string): Promise<MemoryBody>;
76
- packTarget(): Promise<{
77
- root: string;
78
- scope: 'global' | 'workspace' | 'custom';
79
- }>;
80
- exportPack(): Promise<MnemonPackExport>;
81
- inspectPack(base64: string, fileName?: string): Promise<MnemonPackPreview>;
82
- importPack(base64: string): Promise<MnemonPackImportResult>;
83
- }
@@ -1,13 +0,0 @@
1
- import type { ClientSettingsScope, Config } from '../shared/contracts.ts';
2
- import type { MnemonClientContext } from './dsh-compat.ts';
3
- import type { MnemonTranslate } from './locales.ts';
4
- /** Stable type id exposed to Better Sidebar and its persisted tab state. */
5
- export declare const MNEMON_BETTER_SIDEBAR_TAB_ID = "dsh-mnemon:memory";
6
- /**
7
- * Register Mnemon through Better Sidebar's documented optional service.
8
- *
9
- * The service is deliberately a soft dependency. Watching Cordis service
10
- * changes makes installation order and HMR irrelevant while preserving the
11
- * standalone Mnemon sidebar on profiles that do not install Better Sidebar.
12
- */
13
- export declare function mountBetterSidebarTab(ctx: MnemonClientContext, settings: ClientSettingsScope<Config>, t: MnemonTranslate): () => void;
@@ -1,51 +0,0 @@
1
- /**
2
- * Compile-time boundary against the public DSH browser contracts.
3
- *
4
- * Keep version-sensitive declaration merging in one place so a future DSH
5
- * upgrade fails here instead of being papered over by local copies of slots.
6
- */
7
- import type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client';
8
- import type { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client';
9
- import type { Context } from '@deepseek-ai/cordis';
10
- import type { MnemonKey } from './locales.ts';
11
- declare module '@deepseek-ai/dsh-client-ui-slots' {
12
- interface LocaleNamespaceMap {
13
- mnemon: MnemonKey;
14
- }
15
- }
16
- export interface MnemonSessionSummary {
17
- cwd?: string;
18
- origin?: string;
19
- projectionValues?: Readonly<Record<string, unknown>>;
20
- [key: string]: unknown;
21
- }
22
- export interface MnemonSessionListState {
23
- current?: string;
24
- byId: Record<string, MnemonSessionSummary>;
25
- [key: string]: unknown;
26
- }
27
- export interface MnemonWorkspaceSummary {
28
- workspaceId: unknown;
29
- title: string;
30
- path: string;
31
- }
32
- export interface MnemonWorkspaceListState {
33
- items: MnemonWorkspaceSummary[];
34
- [key: string]: unknown;
35
- }
36
- interface SnapshotStore<State> {
37
- getSnapshot(): State;
38
- subscribe(listener: () => void): () => void;
39
- }
40
- /** Context shared by the released client runtime and the 0.1.2 controller split. */
41
- export type MnemonClientContext = Context & {
42
- connection: ConnectionHandle;
43
- locale: LocaleRuntime;
44
- sessions: {
45
- list: SnapshotStore<MnemonSessionListState>;
46
- };
47
- workspaces: {
48
- list: SnapshotStore<MnemonWorkspaceListState>;
49
- };
50
- };
51
- export {};
@@ -1,23 +0,0 @@
1
- import { type ClientConnectionHandle, type ClientSettingsScope, type ClientSettingsSnapshot, type SettingsOperation } from '../shared/contracts.ts';
2
- export declare class MnemonSettingsScope<T extends object> implements ClientSettingsScope<T> {
3
- private readonly connection;
4
- private readonly namespace;
5
- private readonly requestTimeoutMs;
6
- private snapshot;
7
- private readonly listeners;
8
- private tail;
9
- constructor(connection: ClientConnectionHandle, namespace?: string, requestTimeoutMs?: number);
10
- getSnapshot: () => ClientSettingsSnapshot<T>;
11
- subscribe: (listener: () => void) => (() => void);
12
- set(field: string, value: unknown): Promise<void>;
13
- unset(field: string): Promise<void>;
14
- /** Set a nested field. */
15
- setPath(path: string[], value: unknown): Promise<void>;
16
- /** Unset a nested field, falling back to its schema default. */
17
- unsetPath(path: string[]): Promise<void>;
18
- mutate(ops: SettingsOperation[]): Promise<void>;
19
- private load;
20
- private write;
21
- private call;
22
- private publish;
23
- }
@@ -1,5 +0,0 @@
1
- import type { MnemonTranslate } from './locales.ts';
2
- import type { MnemonWorkspaceController } from './workspace-controller.ts';
3
- export declare const MNEMON_ENTRY_SELECTOR = "[data-dsh-mnemon-entry]";
4
- /** Mount a self-healing official-style entry under the New Session row. */
5
- export declare function mountMnemonSidebarEntry(controller: MnemonWorkspaceController, t: MnemonTranslate, subscribeLocale?: (listener: () => void) => () => void): () => void;
@@ -1,23 +0,0 @@
1
- import type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-store';
2
- import type { MnemonClientContext, MnemonSessionListState } from './dsh-compat.ts';
3
- export declare const MNEMON_SUBAGENT_TOKEN_USAGE_KEY = "mnemonSubagentTokenUsage";
4
- export interface MnemonTokenUsageProjection {
5
- uncachedInputTokens: number;
6
- outputTokens: number;
7
- cacheReadTokens: number;
8
- cacheWriteTokens: number;
9
- }
10
- /**
11
- * Present the child-local projection under the generic key expected by the
12
- * released official catalog component. All other consumers continue seeing
13
- * DSH's complete-log `tokenUsage` value.
14
- */
15
- export declare function scopeSubagentTokenUsage(state: MnemonSessionListState): MnemonSessionListState;
16
- /** Wrap the framework hook while preserving its selector/equality contract. */
17
- export declare function createScopedUseSessions(useSessions: SnapshotSelectorHook<MnemonSessionListState>): SnapshotSelectorHook<MnemonSessionListState>;
18
- /**
19
- * Shadow the released official single-slot entry at a lower priority. The
20
- * component and action factory are captured from the public slot ledger, so
21
- * Mnemon keeps the official UI, styles, locale, and navigation behavior.
22
- */
23
- export declare function mountSubagentTokenUsageOverride(ctx: MnemonClientContext): () => void;
@@ -1,14 +0,0 @@
1
- export interface MnemonWorkspaceSnapshot {
2
- open: boolean;
3
- }
4
- /** Small framework-neutral state holder shared by the sidebar row and panel. */
5
- export declare class MnemonWorkspaceController {
6
- private snapshot;
7
- private readonly listeners;
8
- getSnapshot: () => MnemonWorkspaceSnapshot;
9
- subscribe: (listener: () => void) => (() => void);
10
- open(): void;
11
- close(): void;
12
- toggle(): void;
13
- private setOpen;
14
- }
@@ -1,20 +0,0 @@
1
- import type { ClientSettingsScope, Config } from '../shared/contracts.ts';
2
- import type { MnemonClientContext } from './dsh-compat.ts';
3
- import type { MnemonTranslate } from './locales.ts';
4
- export declare const MNEMON_VIEW_SELECTOR = "[data-dsh-mnemon-view]";
5
- interface MnemonPanelProps {
6
- ctx: MnemonClientContext;
7
- settings: ClientSettingsScope<Config>;
8
- t: MnemonTranslate;
9
- onClose?: () => void;
10
- scope?: MnemonWorkspaceScope;
11
- }
12
- export interface MnemonWorkspaceScope {
13
- sessionId: string;
14
- cwd?: string;
15
- }
16
- /** Shared sidebar-sized view used by both the legacy workspace and Better Sidebar. */
17
- export declare function MnemonPanel({ ctx, settings, t, onClose, scope }: MnemonPanelProps): JSX.Element;
18
- /** Mount the sidebar row and its stateful center-column workspace as one unit. */
19
- export declare function mountMnemonWorkspace(ctx: MnemonClientContext, settings: ClientSettingsScope<Config>, t: MnemonTranslate): () => void;
20
- export {};
@@ -1,13 +0,0 @@
1
- import type { CommandDefinition, CommandService } from './contracts.ts';
2
- import type { MnemonService } from './service.ts';
3
- import type { MnemonSubagentCoordinator } from './subagent.ts';
4
- import type { HostAgent } from './contracts.ts';
5
- interface AgentServiceSource {
6
- readonly config: MnemonService['config'];
7
- forAgent(agent: HostAgent): {
8
- service: MnemonService;
9
- };
10
- }
11
- export declare function createMnemonCommand(service: MnemonService | AgentServiceSource, coordinator: MnemonSubagentCoordinator): CommandDefinition;
12
- export declare function registerCommands(commands: CommandService, service: MnemonService | AgentServiceSource, coordinator: MnemonSubagentCoordinator): void;
13
- export {};