@deepagents/context 7.8.1 → 7.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.
@@ -0,0 +1,25 @@
1
+ import type { Pool, QueryResult, QueryResultRow } from 'pg';
2
+ import { z } from 'zod';
3
+ import { PostgresTransaction } from './postgres-transaction.ts';
4
+ /**
5
+ * Where a Postgres store reads and writes: its schema on the host's pool, or
6
+ * on one open transaction once `bind` has narrowed it. A store holds one and
7
+ * builds its `bind(tx)` view from `database.bind(tx)`.
8
+ */
9
+ export declare class PostgresStoreDatabase {
10
+ #private;
11
+ readonly schema: string;
12
+ constructor(db: Pool | PostgresTransaction, schema?: string);
13
+ /** The same schema, read and written inside `tx`. */
14
+ bind(tx: PostgresTransaction): PostgresStoreDatabase;
15
+ /** `name` qualified by the schema, quoted for SQL. */
16
+ table(name: string): string;
17
+ query<Row extends QueryResultRow = QueryResultRow>(text: string, values?: unknown[]): Promise<QueryResult<Row>>;
18
+ rows<Row extends z.ZodType>(row: Row, text: string, values?: unknown[]): Promise<z.output<Row>[]>;
19
+ /**
20
+ * Runs `fn` in a transaction: its own on the pool, or a savepoint of the
21
+ * transaction this database is bound to.
22
+ */
23
+ transaction<T>(fn: (tx: PostgresTransaction) => Promise<T>): Promise<T>;
24
+ }
25
+ //# sourceMappingURL=postgres-store-database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-store-database.d.ts","sourceRoot":"","sources":["../../../src/lib/store/postgres-store-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EAEpB,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,qBAAa,qBAAqB;;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGZ,EAAE,EAAE,IAAI,GAAG,mBAAmB,EAAE,MAAM,SAAW;IAQ7D,qDAAqD;IACrD,IAAI,CAAC,EAAE,EAAE,mBAAmB,GAAG,qBAAqB;IAIpD,sDAAsD;IACtD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI3B,KAAK,CAAC,GAAG,SAAS,cAAc,GAAG,cAAc,EAC/C,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAKtB,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,OAAO,EAC9B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAI3B;;;OAGG;IACH,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAGxE"}
@@ -1,8 +1,22 @@
1
- import type { Pool, PoolClient } from 'pg';
1
+ import type { Pool, QueryResult, QueryResultRow } from 'pg';
2
2
  /**
3
- * Runs `fn` in one transaction on a pooled client and rethrows the error that
4
- * ended it. A ROLLBACK that fails too means the connection is broken, so the
5
- * pool discards the client instead of handing it out again.
3
+ * An open transaction on one pooled client. Only `postgresTransaction`
4
+ * creates it; a store bound to it writes inside that transaction. Its work is
5
+ * sequential: while a savepoint opened on it runs, it refuses queries and new
6
+ * savepoints, and once the transaction (or an enclosing one) ends it refuses
7
+ * every query, because its client may already serve someone else.
6
8
  */
7
- export declare function postgresTransaction<T>(pool: Pool, fn: (client: PoolClient) => Promise<T>): Promise<T>;
9
+ export declare class PostgresTransaction {
10
+ #private;
11
+ private constructor();
12
+ query<Row extends QueryResultRow = QueryResultRow>(text: string, values?: unknown[]): Promise<QueryResult<Row>>;
13
+ }
14
+ /**
15
+ * Runs `fn` in one transaction and rethrows the error that ended it. On a
16
+ * pool it opens the transaction on a pooled client; a ROLLBACK that fails too
17
+ * means the connection is broken, so the pool discards the client instead of
18
+ * handing it out again. On an open transaction it runs `fn` in a savepoint,
19
+ * so a failure undoes only what `fn` wrote.
20
+ */
21
+ export declare function postgresTransaction<T>(db: Pool | PostgresTransaction, fn: (tx: PostgresTransaction) => Promise<T>): Promise<T>;
8
22
  //# sourceMappingURL=postgres-transaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-transaction.d.ts","sourceRoot":"","sources":["../../../src/lib/store/postgres-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAS3C;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GACrC,OAAO,CAAC,CAAC,CAAC,CAoBZ"}
1
+ {"version":3,"file":"postgres-transaction.d.ts","sourceRoot":"","sources":["../../../src/lib/store/postgres-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,WAAW,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAiBxE;;;;;;GAMG;AACH,qBAAa,mBAAmB;;IAuB9B,OAAO;IAQD,KAAK,CAAC,GAAG,SAAS,cAAc,GAAG,cAAc,EACrD,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;CAsB7B;AAID;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,EAAE,EAAE,IAAI,GAAG,mBAAmB,EAC9B,EAAE,EAAE,CAAC,EAAE,EAAE,mBAAmB,KAAK,OAAO,CAAC,CAAC,CAAC,GAC1C,OAAO,CAAC,CAAC,CAAC,CA6BZ"}
@@ -1,12 +1,10 @@
1
- import type { Pool, PoolConfig } from 'pg';
1
+ import type { Pool } from 'pg';
2
+ import type { PostgresTransaction } from './postgres-transaction.ts';
2
3
  import type { BranchData, BranchInfo, ChatData, ChatInfo, ChatUpdater, CheckpointData, CheckpointInfo, DeleteChatOptions, GraphData, ListChatsOptions, MessageData, SearchOptions, SearchResult, StoredChatData } from './store.ts';
3
4
  import { ContextStore } from './store.ts';
4
5
  export interface PostgresStoreOptions {
5
- /**
6
- * PostgreSQL connection pool configuration.
7
- * Can be a connection string, PoolConfig object, or existing Pool instance.
8
- */
9
- pool: Pool | PoolConfig | string;
6
+ /** The host's pool; the store borrows it and never ends it. */
7
+ pool: Pool;
10
8
  /**
11
9
  * PostgreSQL schema to scope all tables under.
12
10
  * Defaults to 'public'.
@@ -16,24 +14,16 @@ export interface PostgresStoreOptions {
16
14
  /**
17
15
  * PostgreSQL-based context store using graph model.
18
16
  *
19
- * Uses pg Pool for connection management.
20
- * Messages are stored as nodes in a DAG with parentId links.
21
- *
22
- * Requires `pg` package to be installed:
23
- * ```
24
- * npm install pg
25
- * ```
17
+ * Messages are stored as nodes in a DAG with parentId links. The host creates
18
+ * the `pg` Pool and ends it after its last store is done.
26
19
  */
27
20
  export declare class PostgresContextStore extends ContextStore {
28
21
  #private;
29
22
  private constructor();
30
23
  /** Opens the store: creates its schema objects before it returns. */
31
24
  static create(options: PostgresStoreOptions): Promise<PostgresContextStore>;
32
- /**
33
- * Close the pool connection.
34
- * Call this when done with the store.
35
- */
36
- close(): Promise<void>;
25
+ /** A view of this store whose reads and writes run inside `tx`. */
26
+ bind(tx: PostgresTransaction): PostgresContextStore;
37
27
  createChat(chat: ChatData): Promise<StoredChatData>;
38
28
  upsertChat(chat: ChatData): Promise<StoredChatData>;
39
29
  getChat(chatId: string): Promise<StoredChatData | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.store.d.ts","sourceRoot":"","sources":["../../../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,EAAE,MAAM,GAAG,IAAI,EACxB,qBAAqB,EAAE,MAAM,GAAG,IAAI,GACnC,OAAO,CAAC,OAAO,CAAC;IAWb,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAmDnD,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3D,aAAa,CACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAShC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAW1D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW7D,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,EAAE,CAAC;IAyCpB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CA+CnD"}
@@ -1,7 +1,8 @@
1
- import type { Pool, PoolConfig } from 'pg';
1
+ import type { Pool } from 'pg';
2
2
  import type { StreamChange, StreamChangeSource } from './change-source.ts';
3
3
  export interface PostgresNotifyChangeSourceOptions {
4
- pool: Pool | PoolConfig | string;
4
+ /** The host's pool; the source borrows it and never ends it. */
5
+ pool: Pool;
5
6
  schema?: string;
6
7
  channel?: string;
7
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-notify-change-source.d.ts","sourceRoot":"","sources":["../../../src/lib/stream/postgres-notify-change-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,IAAI,EAAc,UAAU,EAAE,MAAM,IAAI,CAAC;AAKrE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAM3E,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA2DD,qBAAa,0BAA2B,YAAW,kBAAkB;;IA8BnE,OAAO;IAgCP,wEAAwE;WAC3D,MAAM,CACjB,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAgB/B,SAAS,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,GAClB,aAAa,CAAC,YAAY,CAAC;IA6BxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CA0E7B"}
1
+ {"version":3,"file":"postgres-notify-change-source.d.ts","sourceRoot":"","sources":["../../../src/lib/stream/postgres-notify-change-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,IAAI,EAAc,MAAM,IAAI,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAM3E,MAAM,WAAW,iCAAiC;IAChD,gEAAgE;IAChE,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA2DD,qBAAa,0BAA2B,YAAW,kBAAkB;;IA6BnE,OAAO;IAUP,wEAAwE;WAC3D,MAAM,CACjB,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,0BAA0B,CAAC;IAW/B,SAAS,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,GAClB,aAAa,CAAC,YAAY,CAAC;IA6BxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAsE7B"}
@@ -1,8 +1,10 @@
1
- import type { Pool, PoolConfig } from 'pg';
1
+ import type { Pool } from 'pg';
2
+ import type { PostgresTransaction } from '../store/postgres-transaction.ts';
2
3
  import type { ListStreamIdsOptions, StreamChunkData, StreamData, StreamStatus, StreamUpdateResult, StreamUpdater } from './stream-store.ts';
3
4
  import { StreamStore } from './stream-store.ts';
4
5
  export interface PostgresStreamStoreOptions {
5
- pool: Pool | PoolConfig | string;
6
+ /** The host's pool; the store borrows it and never ends it. */
7
+ pool: Pool;
6
8
  schema?: string;
7
9
  }
8
10
  export declare class PostgresStreamStore extends StreamStore {
@@ -10,7 +12,8 @@ export declare class PostgresStreamStore extends StreamStore {
10
12
  private constructor();
11
13
  /** Opens the store: creates its tables before it returns. */
12
14
  static create(options: PostgresStreamStoreOptions): Promise<PostgresStreamStore>;
13
- close(): Promise<void>;
15
+ /** A view of this store whose reads and writes run inside `tx`. */
16
+ bind(tx: PostgresTransaction): PostgresStreamStore;
14
17
  createStream(stream: StreamData): Promise<void>;
15
18
  upsertStream(stream: StreamData): Promise<{
16
19
  stream: StreamData;
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.stream-store.d.ts","sourceRoot":"","sources":["../../../src/lib/stream/postgres.stream-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAQ3C,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AAEvE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAoCD,qBAAa,mBAAoB,SAAQ,WAAW;;IAKlD,OAAO;IAkCP,6DAA6D;WAChD,MAAM,CACjB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC;IAiBzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,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2CtD,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,EAAE,CAAC;IA2BvB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO7C,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CA0C1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepagents/context",
3
- "version": "7.8.1",
3
+ "version": "7.9.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,7 +69,7 @@
69
69
  "@ai-sdk/provider": "^4.0.37",
70
70
  "@ai-sdk/provider-utils": "^5.0.76",
71
71
  "@ai-sdk/sandbox-just-bash": "^1.0.177",
72
- "@deepagents/agent": "7.8.1",
72
+ "@deepagents/agent": "7.9.0",
73
73
  "@zukhruf/async": "^0.8.41",
74
74
  "@zukhruf/docker": "^0.8.41",
75
75
  "@zukhruf/fs": "^0.8.41",