@hasna/mementos 0.17.1 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/prompt-context.d.ts +3 -0
- package/dist/cli/commands/prompt-context.d.ts.map +1 -0
- package/dist/cli/commands/system-session.d.ts.map +1 -1
- package/dist/cli/index.js +2501 -519
- package/dist/cli/register-all.d.ts.map +1 -1
- package/dist/lib/claude-hook-install.d.ts +33 -0
- package/dist/lib/claude-hook-install.d.ts.map +1 -0
- package/dist/lib/claude-stop-hook.d.ts +9 -0
- package/dist/lib/claude-stop-hook.d.ts.map +1 -0
- package/dist/lib/prompt-context.d.ts +65 -0
- package/dist/lib/prompt-context.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAkB7D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare function claudeHookCommand(): string;
|
|
2
|
+
export declare function planClaudeHook(home: string, command?: string): {
|
|
3
|
+
settingsPath: string;
|
|
4
|
+
resolvedSettingsPath: string;
|
|
5
|
+
legacyPath: string;
|
|
6
|
+
directory: {
|
|
7
|
+
path: string;
|
|
8
|
+
exists: boolean;
|
|
9
|
+
alias: boolean;
|
|
10
|
+
sha256: string;
|
|
11
|
+
};
|
|
12
|
+
directory_sha256: string;
|
|
13
|
+
before: Buffer<ArrayBufferLike> | null;
|
|
14
|
+
next: string;
|
|
15
|
+
changed: boolean;
|
|
16
|
+
settings_sha256: string;
|
|
17
|
+
legacy_hook_sha256: string | null;
|
|
18
|
+
command: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function installClaudeHook(home: string, expected: {
|
|
21
|
+
settingsSha256: string;
|
|
22
|
+
legacyHookSha256?: string;
|
|
23
|
+
directorySha256?: string;
|
|
24
|
+
}, command?: string): {
|
|
25
|
+
changed: boolean;
|
|
26
|
+
settings_sha256: string;
|
|
27
|
+
backup?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
changed: boolean;
|
|
30
|
+
settings_sha256: string;
|
|
31
|
+
backup: string | null;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=claude-hook-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-hook-install.d.ts","sourceRoot":"","sources":["../../src/lib/claude-hook-install.ts"],"names":[],"mappings":"AAYA,wBAAgB,iBAAiB,IAAI,MAAM,CAI1C;AAuBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,SAAsB;;;;;;;;;;;;;;;;;EAmCzE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,SAAsB;;;;;;;;EA+BvK"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MementosClient } from "../sdk/index.js";
|
|
2
|
+
/** Read only the native conversation's user/assistant text, never tool payloads. */
|
|
3
|
+
export declare function claudeTranscript(context: Record<string, unknown>): string;
|
|
4
|
+
export declare function runClaudeStopHook(options?: {
|
|
5
|
+
stdin?: AsyncIterable<Uint8Array>;
|
|
6
|
+
stderr?: (text: string) => void;
|
|
7
|
+
client?: MementosClient;
|
|
8
|
+
}): Promise<number>;
|
|
9
|
+
//# sourceMappingURL=claude-stop-hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-stop-hook.d.ts","sourceRoot":"","sources":["../../src/lib/claude-stop-hook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAC;AAoBhE,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAuCzE;AAED,wBAAsB,iBAAiB,CAAC,OAAO,GAAE;IAC/C,KAAK,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,cAAc,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsCvB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { assessDecisions, type DecisionAssessment, type DecisionConfig } from "../decisions/index.js";
|
|
2
|
+
import type { MemorySearchResult, MemoryScope } from "../types/index.js";
|
|
3
|
+
export interface PromptContextInput {
|
|
4
|
+
prompt: string;
|
|
5
|
+
project: string;
|
|
6
|
+
scope?: "shared" | "private" | "working";
|
|
7
|
+
agent_id?: string;
|
|
8
|
+
session_id?: string;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface PromptContextOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
max_items?: number;
|
|
14
|
+
max_candidates?: number;
|
|
15
|
+
max_tokens?: number;
|
|
16
|
+
min_relevance?: number;
|
|
17
|
+
timeout_ms?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PromptContextItem {
|
|
20
|
+
id: string;
|
|
21
|
+
version: number;
|
|
22
|
+
key: string;
|
|
23
|
+
text: string;
|
|
24
|
+
project_id: string;
|
|
25
|
+
scope: string;
|
|
26
|
+
category: string;
|
|
27
|
+
source: string;
|
|
28
|
+
updated_at: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PromptContextReceipt {
|
|
31
|
+
contract: "mementos.prompt-context.v1";
|
|
32
|
+
status: "disabled" | "ready" | "empty" | "unavailable";
|
|
33
|
+
reason?: string;
|
|
34
|
+
project_id?: string;
|
|
35
|
+
assessment?: DecisionAssessment;
|
|
36
|
+
candidate_count: number;
|
|
37
|
+
has_more: boolean;
|
|
38
|
+
items: PromptContextItem[];
|
|
39
|
+
context: string;
|
|
40
|
+
context_bytes: number;
|
|
41
|
+
token_estimate: number;
|
|
42
|
+
token_budget_kind: "utf8_bytes_divided_by_four_estimate";
|
|
43
|
+
max_context_bytes: number;
|
|
44
|
+
advisory: true;
|
|
45
|
+
}
|
|
46
|
+
export interface PromptContextDependencies {
|
|
47
|
+
project: (reference: string) => {
|
|
48
|
+
id: string;
|
|
49
|
+
} | null | Promise<{
|
|
50
|
+
id: string;
|
|
51
|
+
} | null>;
|
|
52
|
+
search: (query: string, options: {
|
|
53
|
+
project_id: string;
|
|
54
|
+
scope: MemoryScope;
|
|
55
|
+
agent_id?: string;
|
|
56
|
+
session_id?: string;
|
|
57
|
+
tags?: string[];
|
|
58
|
+
limit: number;
|
|
59
|
+
}) => MemorySearchResult[] | Promise<MemorySearchResult[]>;
|
|
60
|
+
assess?: typeof assessDecisions;
|
|
61
|
+
}
|
|
62
|
+
export declare function emptyPromptContext(status?: PromptContextReceipt["status"], reason?: string): PromptContextReceipt;
|
|
63
|
+
/** Read-only retrieval projection. Hook enablement and provider enablement are independent. */
|
|
64
|
+
export declare function buildPromptContext(raw: unknown, settings: Partial<DecisionConfig>, options: PromptContextOptions, dependencies: PromptContextDependencies): Promise<PromptContextReceipt>;
|
|
65
|
+
//# sourceMappingURL=prompt-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-context.d.ts","sourceRoot":"","sources":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