@hexis-ai/engram-sdk 0.7.0 → 0.9.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.
package/dist/client.d.ts CHANGED
@@ -117,10 +117,15 @@ export declare class Engram {
117
117
  * `null` clears. Returns the materialized session post-update.
118
118
  */
119
119
  updateSession(id: string, patch: SessionUpdate): Promise<SessionEnvelope>;
120
- /** List recent sessions plus the deduped persons map across them. */
120
+ /**
121
+ * List recent sessions plus the deduped persons map across them.
122
+ * Sorted by `updated_at` desc (most recent activity first); pass
123
+ * `status` to filter by lifecycle state.
124
+ */
121
125
  listSessions(opts?: {
122
126
  limit?: number;
123
127
  channel?: string;
128
+ status?: "active" | "idle" | "completed";
124
129
  }): Promise<SessionListEnvelope>;
125
130
  /** Run a search. */
126
131
  search(req: SearchRequest): Promise<SearchEnvelope>;
@@ -172,6 +177,21 @@ export declare class Engram {
172
177
  /** Look up by ref. Returns 404 if the ref is unknown. */
173
178
  get: (ref: string) => Promise<IdentityInfo>;
174
179
  };
180
+ /**
181
+ * Workspace-wide alias lookup. `persons.aliases(id)` answers "what
182
+ * does this person go by"; this answers the inverse — "which
183
+ * person(s) does this name resolve to?" — without pre-knowing the
184
+ * owner. Match is case-insensitive; multiple persons can share an
185
+ * alias, so the response is an array ordered by `last_used` desc.
186
+ * Inlined `persons` map saves a round-trip for the typical
187
+ * candidate-picker UI.
188
+ */
189
+ readonly aliases: {
190
+ findByName: (name: string) => Promise<{
191
+ aliases: AliasInfo[];
192
+ persons: PersonMap;
193
+ }>;
194
+ };
175
195
  /** Internal: ship an event batch to the server. */
176
196
  sendBatch(sessionId: string, batch: EventBatch): Promise<void>;
177
197
  /** Internal accessor used by EngramSession to honor SDK config. */
package/dist/client.js CHANGED
@@ -57,13 +57,19 @@ export class Engram {
57
57
  async updateSession(id, patch) {
58
58
  return this.request("PATCH", `/v1/sessions/${encodeURIComponent(id)}`, patch);
59
59
  }
60
- /** List recent sessions plus the deduped persons map across them. */
60
+ /**
61
+ * List recent sessions plus the deduped persons map across them.
62
+ * Sorted by `updated_at` desc (most recent activity first); pass
63
+ * `status` to filter by lifecycle state.
64
+ */
61
65
  async listSessions(opts = {}) {
62
66
  const qs = new URLSearchParams();
63
67
  if (opts.limit !== undefined)
64
68
  qs.set("limit", String(opts.limit));
65
69
  if (opts.channel)
66
70
  qs.set("channel", opts.channel);
71
+ if (opts.status)
72
+ qs.set("status", opts.status);
67
73
  const tail = qs.toString();
68
74
  return this.request("GET", `/v1/sessions${tail ? `?${tail}` : ""}`);
69
75
  }
@@ -125,6 +131,18 @@ export class Engram {
125
131
  /** Look up by ref. Returns 404 if the ref is unknown. */
126
132
  get: (ref) => this.request("GET", `/v1/identities/${encodeURIComponent(ref)}`),
127
133
  };
134
+ /**
135
+ * Workspace-wide alias lookup. `persons.aliases(id)` answers "what
136
+ * does this person go by"; this answers the inverse — "which
137
+ * person(s) does this name resolve to?" — without pre-knowing the
138
+ * owner. Match is case-insensitive; multiple persons can share an
139
+ * alias, so the response is an array ordered by `last_used` desc.
140
+ * Inlined `persons` map saves a round-trip for the typical
141
+ * candidate-picker UI.
142
+ */
143
+ aliases = {
144
+ findByName: (name) => this.request("GET", `/v1/aliases?name=${encodeURIComponent(name)}`),
145
+ };
128
146
  /** Internal: ship an event batch to the server. */
129
147
  async sendBatch(sessionId, batch) {
130
148
  if (batch.events.length === 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexis-ai/engram-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Host SDK for engram. Records agent session steps and ships them to an engram server.",
5
5
  "keywords": [
6
6
  "engram",