@tpsdev-ai/flair-client 0.19.0 → 0.20.1
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/client.d.ts +7 -1
- package/dist/client.js +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* const results = await flair.memory.search('that thing')
|
|
8
8
|
* const ctx = await flair.bootstrap({ maxTokens: 4000 })
|
|
9
9
|
*/
|
|
10
|
-
import type { FlairClientConfig, Memory, MemoryType, Durability, SoulEntry, SearchResult, BootstrapResult } from "./types.js";
|
|
10
|
+
import type { FlairClientConfig, Memory, MemoryType, Durability, Visibility, SoulEntry, SearchResult, BootstrapResult } from "./types.js";
|
|
11
11
|
export declare class FlairClient {
|
|
12
12
|
readonly url: string;
|
|
13
13
|
readonly agentId: string;
|
|
@@ -56,6 +56,12 @@ declare class MemoryApi {
|
|
|
56
56
|
durability?: Durability;
|
|
57
57
|
tags?: string[];
|
|
58
58
|
subject?: string;
|
|
59
|
+
/** Writer-controlled sharing intent. Omit to let the
|
|
60
|
+
* server apply its durability-keyed default (permanent/persistent →
|
|
61
|
+
* shared, standard/ephemeral → private) — only forwarded when the
|
|
62
|
+
* caller explicitly sets it, so omitting this is a no-op change from
|
|
63
|
+
* today's behavior. */
|
|
64
|
+
visibility?: Visibility;
|
|
59
65
|
/** Ask the server to run its conservative near-duplicate check for this
|
|
60
66
|
* write and report a collision signal if found. Does NOT suppress the
|
|
61
67
|
* write either way. Default: false (server still applies its own
|
package/dist/client.js
CHANGED
|
@@ -129,6 +129,12 @@ class MemoryApi {
|
|
|
129
129
|
subject: opts.subject,
|
|
130
130
|
createdAt: new Date().toISOString(),
|
|
131
131
|
};
|
|
132
|
+
// Forward visibility ONLY when the caller set it — an unset visibility
|
|
133
|
+
// must reach the server as "absent" (not e.g. defaulted client-side) so
|
|
134
|
+
// the server's durability-keyed default (Memory.post/put) is the one
|
|
135
|
+
// source of truth for the default, never duplicated here.
|
|
136
|
+
if (opts.visibility !== undefined)
|
|
137
|
+
record.visibility = opts.visibility;
|
|
132
138
|
// Passthrough hints — the server strips these before persisting; they are
|
|
133
139
|
// never stored on the record itself.
|
|
134
140
|
if (opts.dedup !== undefined)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { FlairClient, FlairError } from "./client.js";
|
|
2
2
|
export { loadPrivateKey, resolveKeyPath, signRequest } from "./auth.js";
|
|
3
|
-
export type { FlairClientConfig, Memory, MemoryType, Durability, SoulEntry, SearchResult, BootstrapResult, } from "./types.js";
|
|
3
|
+
export type { FlairClientConfig, Memory, MemoryType, Durability, Visibility, SoulEntry, SearchResult, BootstrapResult, } from "./types.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,15 @@ export type { KeyObject };
|
|
|
4
4
|
export type Durability = "permanent" | "persistent" | "standard" | "ephemeral";
|
|
5
5
|
/** Memory type classification. */
|
|
6
6
|
export type MemoryType = "session" | "lesson" | "decision" | "preference" | "fact" | "goal";
|
|
7
|
+
/**
|
|
8
|
+
* Writer-controlled sharing intent. "private" — owner only,
|
|
9
|
+
* never returned to another agent even if that agent holds a MemoryGrant.
|
|
10
|
+
* "shared" — visible to owner + any grant-holder (subject to the grant's
|
|
11
|
+
* scope). When unset on write, the server defaults it from `durability`:
|
|
12
|
+
* permanent/persistent → shared, standard/ephemeral/absent → private. An
|
|
13
|
+
* explicit value here always overrides the server default.
|
|
14
|
+
*/
|
|
15
|
+
export type Visibility = "private" | "shared";
|
|
7
16
|
/** A memory record. */
|
|
8
17
|
export interface Memory {
|
|
9
18
|
id: string;
|
|
@@ -13,6 +22,11 @@ export interface Memory {
|
|
|
13
22
|
durability: Durability;
|
|
14
23
|
tags: string[];
|
|
15
24
|
subject?: string;
|
|
25
|
+
/** Writer-controlled sharing intent. Absent on records written before this
|
|
26
|
+
* field existed — the server treats absence as "shared" (migration-
|
|
27
|
+
* invariant: an existing memory keeps reading to exactly whoever holds a
|
|
28
|
+
* grant today), never as "private". */
|
|
29
|
+
visibility?: Visibility;
|
|
16
30
|
createdAt: string;
|
|
17
31
|
updatedAt?: string;
|
|
18
32
|
/** Always true after a successful write()/update() — the server never
|
package/package.json
CHANGED