@pyxmate/memory 1.17.17 → 1.17.18
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/agent-contract.d.ts +2 -1
- package/dist/agent-contract.mjs +3 -1
- package/dist/{chunk-FQW6BQ2N.mjs → chunk-EZERG25I.mjs} +2 -0
- package/dist/{chunk-JGFDID3B.mjs → chunk-H6ZLMPZH.mjs} +11 -2
- package/dist/{chunk-AMKPOPH6.mjs → chunk-T35ZOOES.mjs} +1 -1
- package/dist/cli/pyx-mem.mjs +2 -2
- package/dist/dashboard.mjs +2 -2
- package/dist/index.d.ts +14 -9
- package/dist/index.mjs +1 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
package/dist/agent-contract.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const PYX_MEMORY_INSTRUCTIONS = "Use pyx-memory for durable memory across sessions, proactively \u2014 do not wait to be told. SEARCH before assuming: at the start of a task, and before proposing an approach or re-deriving a past decision, search memory for the project and topic; resolve relative times (\"last year\", \"\uB450 \uB2EC \uC804\") to an absolute ISO-8601 anchorTime so results rank by proximity to that time. STORE when durable state settles \u2014 usually before your final response or handoff; if nothing durable changed, store nothing. Otherwise capture a fact (correction, bug fix + root cause, design/architecture decision + reasoning, integration/API/auth/endpoint detail, gotcha, preference, \"remember this\"), a reusable process once stable, a milestone snapshot (type episodic, not a running log), or a changed decision (store the new state with eventTime, never a silent overwrite, so lineage traces it) \u2014 concise facts not deliberation, each with topic and project. Pass eventTime (ISO-8601, when the fact took effect) for anything that can change or go stale; recency ordering, \"as of\" queries, and stale-vs-current resolution all key off it. After a memory informs your work, call reinforce so it stays in the quick/medium tiers (idle never revives it). When the user corrects you, call record_correction; before a task, call fetch_applicable_corrections (pyx never auto-applies them). When content names people, organizations, tools, places, events, or key concepts, pass entities and relationships \u2014 you build the graph, the server does not extract it; a multi-entity store with no connecting edge is refused. Match search effort to need: quick (default, strongest) for routine recall, deep for full/archived history; use lineage to trace how a fact changed. userId/teamId/agentId and callerAccessLevel are attribution filters and sensitivity redaction, not a security isolation boundary \u2014 tenant/namespace isolation is enforced server-side (namespaces + ReBAC grants; see docs/access-control.md).";
|
|
2
|
+
declare const PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS = "Use pyx-memory for durable memory across sessions, proactively \u2014 do not wait to be told. SEARCH (search_memories) before assuming: at the start of a task, and before re-deriving a past decision, search memory for the project and topic; resolve relative times (\"last year\", \"\uB450 \uB2EC \uC804\") to an absolute ISO-8601 anchorTime so results rank by proximity to that time. Match search effort to need: quick (default, strongest) for routine recall, deep for full/archived history. STORE (store_memory) when durable state settles \u2014 usually before your final response; if nothing durable changed, store nothing. Capture concise facts, not deliberation \u2014 a correction, bug fix + root cause, decision + reasoning, integration detail, gotcha, preference, or an explicit \"remember this\" \u2014 each with topic and project. Pass eventTime (ISO-8601, when the fact took effect) for anything that can change or go stale; recency ordering and stale-vs-current resolution key off it. When content names people, organizations, tools, places, events, or key concepts, pass entities and relationships \u2014 you build the graph; a multi-entity store with no connecting edge is refused. Recalled memories reflect what was true when written \u2014 verify named files, flags, and versions before acting.";
|
|
2
3
|
declare const PERSISTENT_MEMORY_SECTION: string;
|
|
3
4
|
declare function buildDesignGuide({ appName }: {
|
|
4
5
|
appName: string;
|
|
@@ -37,4 +38,4 @@ declare const STRUCTURE_GRAPH_PROMPT_DESC = "Returns a prompt that extracts the
|
|
|
37
38
|
declare function buildGraphStructuringPrompt(content: string): string;
|
|
38
39
|
declare function buildAgentSnippet(): string;
|
|
39
40
|
|
|
40
|
-
export { AGENT_TARGETS, PERSISTENT_MEMORY_SECTION, PYX_MEMORY_INSTRUCTIONS, SEARCH_ENUMERATION_CONCEPT_DESC, SEARCH_LIMIT_DESC, STORE_ENTITIES_DESC, STORE_EVENT_TIME_DESC, STORE_RELATIONSHIPS_DESC, STORE_TOOL_DESC, STORE_TRIPLES_DESC, STRUCTURE_GRAPH_PROMPT_DESC, buildAgentSnippet, buildDesignGuide, buildGraphStructuringPrompt };
|
|
41
|
+
export { AGENT_TARGETS, PERSISTENT_MEMORY_SECTION, PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS, PYX_MEMORY_INSTRUCTIONS, SEARCH_ENUMERATION_CONCEPT_DESC, SEARCH_LIMIT_DESC, STORE_ENTITIES_DESC, STORE_EVENT_TIME_DESC, STORE_RELATIONSHIPS_DESC, STORE_TOOL_DESC, STORE_TRIPLES_DESC, STRUCTURE_GRAPH_PROMPT_DESC, buildAgentSnippet, buildDesignGuide, buildGraphStructuringPrompt };
|
package/dist/agent-contract.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AGENT_TARGETS,
|
|
3
3
|
PERSISTENT_MEMORY_SECTION,
|
|
4
|
+
PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS,
|
|
4
5
|
PYX_MEMORY_INSTRUCTIONS,
|
|
5
6
|
SEARCH_ENUMERATION_CONCEPT_DESC,
|
|
6
7
|
SEARCH_LIMIT_DESC,
|
|
@@ -13,10 +14,11 @@ import {
|
|
|
13
14
|
buildAgentSnippet,
|
|
14
15
|
buildDesignGuide,
|
|
15
16
|
buildGraphStructuringPrompt
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EZERG25I.mjs";
|
|
17
18
|
export {
|
|
18
19
|
AGENT_TARGETS,
|
|
19
20
|
PERSISTENT_MEMORY_SECTION,
|
|
21
|
+
PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS,
|
|
20
22
|
PYX_MEMORY_INSTRUCTIONS,
|
|
21
23
|
SEARCH_ENUMERATION_CONCEPT_DESC,
|
|
22
24
|
SEARCH_LIMIT_DESC,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/contract/index.ts
|
|
2
2
|
var PYX_MEMORY_INSTRUCTIONS = `Use pyx-memory for durable memory across sessions, proactively \u2014 do not wait to be told. SEARCH before assuming: at the start of a task, and before proposing an approach or re-deriving a past decision, search memory for the project and topic; resolve relative times ("last year", "\uB450 \uB2EC \uC804") to an absolute ISO-8601 anchorTime so results rank by proximity to that time. STORE when durable state settles \u2014 usually before your final response or handoff; if nothing durable changed, store nothing. Otherwise capture a fact (correction, bug fix + root cause, design/architecture decision + reasoning, integration/API/auth/endpoint detail, gotcha, preference, "remember this"), a reusable process once stable, a milestone snapshot (type episodic, not a running log), or a changed decision (store the new state with eventTime, never a silent overwrite, so lineage traces it) \u2014 concise facts not deliberation, each with topic and project. Pass eventTime (ISO-8601, when the fact took effect) for anything that can change or go stale; recency ordering, "as of" queries, and stale-vs-current resolution all key off it. After a memory informs your work, call reinforce so it stays in the quick/medium tiers (idle never revives it). When the user corrects you, call record_correction; before a task, call fetch_applicable_corrections (pyx never auto-applies them). When content names people, organizations, tools, places, events, or key concepts, pass entities and relationships \u2014 you build the graph, the server does not extract it; a multi-entity store with no connecting edge is refused. Match search effort to need: quick (default, strongest) for routine recall, deep for full/archived history; use lineage to trace how a fact changed. userId/teamId/agentId and callerAccessLevel are attribution filters and sensitivity redaction, not a security isolation boundary \u2014 tenant/namespace isolation is enforced server-side (namespaces + ReBAC grants; see docs/access-control.md).`;
|
|
3
|
+
var PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS = `Use pyx-memory for durable memory across sessions, proactively \u2014 do not wait to be told. SEARCH (search_memories) before assuming: at the start of a task, and before re-deriving a past decision, search memory for the project and topic; resolve relative times ("last year", "\uB450 \uB2EC \uC804") to an absolute ISO-8601 anchorTime so results rank by proximity to that time. Match search effort to need: quick (default, strongest) for routine recall, deep for full/archived history. STORE (store_memory) when durable state settles \u2014 usually before your final response; if nothing durable changed, store nothing. Capture concise facts, not deliberation \u2014 a correction, bug fix + root cause, decision + reasoning, integration detail, gotcha, preference, or an explicit "remember this" \u2014 each with topic and project. Pass eventTime (ISO-8601, when the fact took effect) for anything that can change or go stale; recency ordering and stale-vs-current resolution key off it. When content names people, organizations, tools, places, events, or key concepts, pass entities and relationships \u2014 you build the graph; a multi-entity store with no connecting edge is refused. Recalled memories reflect what was true when written \u2014 verify named files, flags, and versions before acting.`;
|
|
3
4
|
var PERSISTENT_MEMORY_SECTION = [
|
|
4
5
|
"## Persistent Memory",
|
|
5
6
|
"",
|
|
@@ -159,6 +160,7 @@ function buildAgentSnippet() {
|
|
|
159
160
|
|
|
160
161
|
export {
|
|
161
162
|
PYX_MEMORY_INSTRUCTIONS,
|
|
163
|
+
PYX_MEMORY_COMPANION_CORE_INSTRUCTIONS,
|
|
162
164
|
PERSISTENT_MEMORY_SECTION,
|
|
163
165
|
buildDesignGuide,
|
|
164
166
|
AGENT_TARGETS,
|
|
@@ -358,6 +358,15 @@ var MemoryClient = class {
|
|
|
358
358
|
}
|
|
359
359
|
return headers;
|
|
360
360
|
}
|
|
361
|
+
exactReadAuthority(namespaceId, authority) {
|
|
362
|
+
if (namespaceId !== void 0 && authority?.namespaceId !== void 0 && namespaceId !== authority.namespaceId) {
|
|
363
|
+
throw new Error("X-Namespace-Id conflicts with the request authority scope");
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
...authority,
|
|
367
|
+
...namespaceId !== void 0 ? { namespaceId } : {}
|
|
368
|
+
};
|
|
369
|
+
}
|
|
361
370
|
async initialize() {
|
|
362
371
|
const response = await fetch(`${this.baseUrl}/health`, {
|
|
363
372
|
headers: this._authHeaders
|
|
@@ -415,7 +424,7 @@ var MemoryClient = class {
|
|
|
415
424
|
if (params.abstentionThreshold != null)
|
|
416
425
|
searchParams.set("abstentionThreshold", String(params.abstentionThreshold));
|
|
417
426
|
return this.fetchApi(`/api/memory/search?${searchParams}`, {
|
|
418
|
-
headers: this.authorityHeaders(authority)
|
|
427
|
+
headers: this.authorityHeaders(this.exactReadAuthority(params.namespaceId, authority))
|
|
419
428
|
});
|
|
420
429
|
}
|
|
421
430
|
async get(id, authority) {
|
|
@@ -481,7 +490,7 @@ var MemoryClient = class {
|
|
|
481
490
|
}
|
|
482
491
|
const qs = searchParams.toString();
|
|
483
492
|
return this.fetchApi(`/api/memory/entries${qs ? `?${qs}` : ""}`, {
|
|
484
|
-
headers: this.authorityHeaders(authority)
|
|
493
|
+
headers: this.authorityHeaders(this.exactReadAuthority(params.namespaceId, authority))
|
|
485
494
|
});
|
|
486
495
|
}
|
|
487
496
|
// --- File ingest ---
|
package/dist/cli/pyx-mem.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PERSISTENT_MEMORY_SECTION,
|
|
4
4
|
buildDesignGuide
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-EZERG25I.mjs";
|
|
6
6
|
|
|
7
7
|
// src/cli/exit-codes.ts
|
|
8
8
|
var EXIT = {
|
|
@@ -836,7 +836,7 @@ function createProxyServer(client, version, uploadLocalFile) {
|
|
|
836
836
|
return server;
|
|
837
837
|
}
|
|
838
838
|
async function runMcpProxyServer(opts) {
|
|
839
|
-
const version = opts.version ?? (true ? "1.17.
|
|
839
|
+
const version = opts.version ?? (true ? "1.17.18" : "0.0.0-dev");
|
|
840
840
|
const read = await opts.readCredentials();
|
|
841
841
|
if (!read.ok) {
|
|
842
842
|
const text = read.result.content.map((c) => c.type === "text" ? c.text : "").join(" ").trim();
|
package/dist/dashboard.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-T35ZOOES.mjs";
|
|
15
|
+
import "./chunk-H6ZLMPZH.mjs";
|
|
16
16
|
import "./chunk-3OLH3HYR.mjs";
|
|
17
17
|
export {
|
|
18
18
|
DashboardClient,
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ interface MemoryListParams {
|
|
|
28
28
|
agentId?: string;
|
|
29
29
|
/** Filter by tenant ID for multi-tenant isolation. */
|
|
30
30
|
tenantId?: string;
|
|
31
|
+
/** Exact namespace scope. Excludes legacy tenant-root entries. */
|
|
32
|
+
namespaceId?: string;
|
|
31
33
|
/**
|
|
32
34
|
* Calling principal. When supplied, list applies the AuthzPlan
|
|
33
35
|
* visibility filter so entries in forbidden namespaces never reach
|
|
@@ -385,9 +387,10 @@ declare class MemoryClient implements ExtendedMemoryInterface {
|
|
|
385
387
|
/** Encode a path segment to prevent URL injection */
|
|
386
388
|
private encodePathSegment;
|
|
387
389
|
private authorityHeaders;
|
|
390
|
+
private exactReadAuthority;
|
|
388
391
|
initialize(): Promise<void>;
|
|
389
392
|
store(entry: StoreInput$1, options?: StoreOptions): Promise<MemoryEntry$1>;
|
|
390
|
-
search(params: MemorySearchParams$1, authority?: RequestAuthorityOptions): Promise<MemorySearchResult$1>;
|
|
393
|
+
search(params: MemorySearchParams$1, authority?: RequestAuthorityOptions & Pick<TenantScopeOptions, 'tenantId' | 'namespaceId'>): Promise<MemorySearchResult$1>;
|
|
391
394
|
get(id: string, authority?: TenantScopeOptions & RequestAuthorityOptions): Promise<MemoryEntry$1 | null>;
|
|
392
395
|
delete(id: string, authority?: TenantScopeOptions & RequestAuthorityOptions): Promise<boolean>;
|
|
393
396
|
clearSession(sessionId: string): Promise<number>;
|
|
@@ -403,7 +406,7 @@ declare class MemoryClient implements ExtendedMemoryInterface {
|
|
|
403
406
|
*/
|
|
404
407
|
status(): Promise<Topology$1>;
|
|
405
408
|
shutdown(): Promise<void>;
|
|
406
|
-
list(params?: MemoryListParams, authority?: RequestAuthorityOptions): Promise<MemoryListResult>;
|
|
409
|
+
list(params?: MemoryListParams, authority?: RequestAuthorityOptions & Pick<TenantScopeOptions, 'tenantId' | 'namespaceId'>): Promise<MemoryListResult>;
|
|
407
410
|
/**
|
|
408
411
|
* Native streaming file ingest. Yields typed {@link IngestEvent}s as the
|
|
409
412
|
* server (parsing/storing) and the SDK (enrichment/result) make progress.
|
|
@@ -921,6 +924,12 @@ interface MemorySearchParams {
|
|
|
921
924
|
userId?: string;
|
|
922
925
|
/** Team/group ID within the tenant. */
|
|
923
926
|
teamId?: string;
|
|
927
|
+
/**
|
|
928
|
+
* Exact namespace requested by a trusted transport boundary. `Memory.search`
|
|
929
|
+
* validates it against the calling principal's AuthzPlan and compiles it to
|
|
930
|
+
* a singleton prefilter. Exact scope excludes legacy NULL rows.
|
|
931
|
+
*/
|
|
932
|
+
namespaceId?: string;
|
|
924
933
|
/**
|
|
925
934
|
* AuthzPlan-derived visibility list. Populated internally by `Memory.search`
|
|
926
935
|
* after computing the plan from the calling principal — callers should
|
|
@@ -928,15 +937,11 @@ interface MemorySearchParams {
|
|
|
928
937
|
* legacy NULL-namespace entries are visible). `undefined` skips the
|
|
929
938
|
* filter (single-tenant / pre-ReBAC compat).
|
|
930
939
|
*
|
|
931
|
-
*
|
|
932
|
-
* via a singular `namespaceId` field for v1 — adding it would force
|
|
933
|
-
* intersection logic with the visibility list (and confused-deputy risk
|
|
934
|
-
* if the singular value isn't validated against the plan). Callers that
|
|
935
|
-
* need it can compute the singleton intersection client-side and pass
|
|
936
|
-
* `namespaceIds: [chosenNamespace]` after verifying access via the
|
|
937
|
-
* admin API.
|
|
940
|
+
* Callers must not set this directly; use `namespaceId` for exact scope.
|
|
938
941
|
*/
|
|
939
942
|
namespaceIds?: string[];
|
|
943
|
+
/** Strict namespace equality compiled internally from `namespaceId`. */
|
|
944
|
+
exactNamespaceId?: string;
|
|
940
945
|
/**
|
|
941
946
|
* AuthzPlan-derived list of strict-mode namespaces in the caller's
|
|
942
947
|
* tenant the principal CANNOT see (v0.17.0). Graph traversal MUST
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-T35ZOOES.mjs";
|
|
15
|
+
import "./chunk-H6ZLMPZH.mjs";
|
|
16
16
|
import "./chunk-3OLH3HYR.mjs";
|
|
17
17
|
|
|
18
18
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|