@itphx/synth-storage-postgres 0.12.4 → 0.13.8

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.
Files changed (33) hide show
  1. package/dist/migrations/028-message-reasoning-signature.d.ts +13 -0
  2. package/dist/migrations/028-message-reasoning-signature.js +19 -0
  3. package/dist/migrations/029-message-stream-v2.d.ts +22 -0
  4. package/dist/migrations/029-message-stream-v2.js +33 -0
  5. package/dist/migrations/030-session-retry.d.ts +12 -0
  6. package/dist/migrations/030-session-retry.js +16 -0
  7. package/dist/migrations/031-ssh-key-policy.d.ts +13 -0
  8. package/dist/migrations/031-ssh-key-policy.js +25 -0
  9. package/dist/migrations/032-mcp-remote-mode.d.ts +14 -0
  10. package/dist/migrations/032-mcp-remote-mode.js +18 -0
  11. package/dist/migrations/033-session-source-id.d.ts +16 -0
  12. package/dist/migrations/033-session-source-id.js +21 -0
  13. package/dist/migrations/034-pending-approvals.d.ts +18 -0
  14. package/dist/migrations/034-pending-approvals.js +35 -0
  15. package/dist/migrations/index.js +14 -0
  16. package/dist/ports/content.js +80 -9
  17. package/dist/ports/context-files.d.ts +3 -0
  18. package/dist/ports/context-files.js +9 -0
  19. package/dist/ports/events-scheduler.js +19 -11
  20. package/dist/ports/pending-approvals.d.ts +32 -0
  21. package/dist/ports/pending-approvals.js +108 -0
  22. package/dist/ports/principals-defaults.js +20 -0
  23. package/dist/ports/principals-projects.js +80 -48
  24. package/dist/ports/principals-settings.js +76 -0
  25. package/dist/ports/sessions-mapping.d.ts +70 -5
  26. package/dist/ports/sessions-mapping.js +124 -7
  27. package/dist/ports/sessions.d.ts +56 -10
  28. package/dist/ports/sessions.js +127 -25
  29. package/dist/ports/worktrees.d.ts +3 -3
  30. package/dist/ports/worktrees.js +3 -3
  31. package/dist/storage-context.d.ts +1 -1
  32. package/dist/storage-context.js +8 -2
  33. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PG-реализация порта **инвентаря git-worktree'ов** (ADR-114, ADR-097).
2
+ * PG-реализация порта **инвентаря git-worktree** (ADR-114, ADR-097).
3
3
  *
4
4
  * Хранение — **существующий** generic-слой `documents(kind, key, value jsonb)`
5
5
  * (миграция `001-init`): `kind = 'worktree'`, ключ документа — `id` записи,
@@ -25,7 +25,7 @@ import type { WorktreeRecord } from '@itphx/synth-shared';
25
25
  import type { PortDeps } from './deps.js';
26
26
  /** Часть `StorageContext`, которой владеет группа «worktrees». */
27
27
  export type WorktreePorts = Pick<StorageContext, 'worktrees'>;
28
- /** Порт инвентаря worktree'ов поверх таблицы `documents`. */
28
+ /** Порт инвентаря worktree поверх таблицы `documents`. */
29
29
  export declare class PgWorktreeRepository implements WorktreeRepository {
30
30
  private readonly _deps;
31
31
  constructor(_deps: PortDeps);
@@ -37,5 +37,5 @@ export declare class PgWorktreeRepository implements WorktreeRepository {
37
37
  delete(id: string): Promise<void>;
38
38
  deleteByProject(projectId: string): Promise<number>;
39
39
  }
40
- /** Собрать порт инвентаря worktree'ов (ADR-114). */
40
+ /** Собрать порт инвентаря worktree (ADR-114). */
41
41
  export declare function buildWorktreePorts(deps: PortDeps): WorktreePorts;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PG-реализация порта **инвентаря git-worktree'ов** (ADR-114, ADR-097).
2
+ * PG-реализация порта **инвентаря git-worktree** (ADR-114, ADR-097).
3
3
  *
4
4
  * Хранение — **существующий** generic-слой `documents(kind, key, value jsonb)`
5
5
  * (миграция `001-init`): `kind = 'worktree'`, ключ документа — `id` записи,
@@ -23,7 +23,7 @@
23
23
  import { jsonbParam } from '../json-param.js';
24
24
  /** `kind` generic-таблицы `documents` для записей worktree. */
25
25
  const WORKTREE_KIND = 'worktree';
26
- /** Порт инвентаря worktree'ов поверх таблицы `documents`. */
26
+ /** Порт инвентаря worktree поверх таблицы `documents`. */
27
27
  export class PgWorktreeRepository {
28
28
  _deps;
29
29
  constructor(_deps) {
@@ -77,7 +77,7 @@ function byCreatedAtDesc(a, b) {
77
77
  return diff;
78
78
  return a.id.localeCompare(b.id);
79
79
  }
80
- /** Собрать порт инвентаря worktree'ов (ADR-114). */
80
+ /** Собрать порт инвентаря worktree (ADR-114). */
81
81
  export function buildWorktreePorts(deps) {
82
82
  return {
83
83
  worktrees: new PgWorktreeRepository(deps),
@@ -25,7 +25,7 @@
25
25
  * - `buildBackgroundRunPorts(deps)` → `backgroundRuns` (этап 1 roadmap 0.13,
26
26
  * блок 1.2 — фоновые саб-агенты и шелл-процессы);
27
27
  * - `buildWorktreePorts(deps)` → `worktrees` (ADR-114 — инвентарь
28
- * git-worktree'ов; generic-таблица `documents`, `kind='worktree'`).
28
+ * git-worktree; generic-таблица `documents`, `kind='worktree'`).
29
29
  * - `buildBlobRefPorts(deps)` → `blobRefs` (ADR-115/ADR-116 — учёт ссылок
30
30
  * на объекты blob-хранилища; таблица `blob_refs`).
31
31
  * - `buildPackPorts(deps)` → `packs` (ADR-086 §5 — реестр установок
@@ -25,7 +25,7 @@
25
25
  * - `buildBackgroundRunPorts(deps)` → `backgroundRuns` (этап 1 roadmap 0.13,
26
26
  * блок 1.2 — фоновые саб-агенты и шелл-процессы);
27
27
  * - `buildWorktreePorts(deps)` → `worktrees` (ADR-114 — инвентарь
28
- * git-worktree'ов; generic-таблица `documents`, `kind='worktree'`).
28
+ * git-worktree; generic-таблица `documents`, `kind='worktree'`).
29
29
  * - `buildBlobRefPorts(deps)` → `blobRefs` (ADR-115/ADR-116 — учёт ссылок
30
30
  * на объекты blob-хранилища; таблица `blob_refs`).
31
31
  * - `buildPackPorts(deps)` → `packs` (ADR-086 §5 — реестр установок
@@ -84,6 +84,9 @@ import { buildContextFilePorts } from './ports/context-files.js';
84
84
  import { buildQuestionPorts } from './ports/questions.js';
85
85
  import { buildBackgroundRunPorts } from './ports/background-runs.js';
86
86
  import { buildWorktreePorts } from './ports/worktrees.js';
87
+ // ADR-029: ожидания подтверждения прав — отдельный стор (таблица
88
+ // `pending_approvals`, миграция 035), а не поле документа сессии.
89
+ import { buildPendingApprovalPorts } from './ports/pending-approvals.js';
87
90
  // ADR-115/ADR-116: учёт ссылок на объекты blob-хранилища (таблица `blob_refs`).
88
91
  import { buildBlobRefPorts } from './ports/blob-refs.js';
89
92
  import { buildPluginLockPorts } from './ports/plugin-lock.js';
@@ -208,9 +211,12 @@ export function buildPostgresStorageContext(opts) {
208
211
  // реестр фоновых прогонов (таблица `background_runs`) — миграция 021.
209
212
  ...buildQuestionPorts(deps),
210
213
  ...buildBackgroundRunPorts(deps),
211
- // ADR-114: инвентарь git-worktree'ов — generic-таблица `documents`
214
+ // ADR-114: инвентарь git-worktree — generic-таблица `documents`
212
215
  // (`kind='worktree'`), без новой миграции.
213
216
  ...buildWorktreePorts(deps),
217
+ // ADR-029: ожидания подтверждения прав — отдельная таблица
218
+ // `pending_approvals` (миграция 035); документ сессии не трогаем.
219
+ ...buildPendingApprovalPorts(deps),
214
220
  // ADR-115/ADR-116: учёт ссылок на объекты blob-хранилища — таблица
215
221
  // `blob_refs` (миграция 024). Байты объектов остаются на томе (`blobs`).
216
222
  ...buildBlobRefPorts(deps),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itphx/synth-storage-postgres",
3
- "version": "0.12.4",
3
+ "version": "0.13.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,13 +15,13 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "@itphx/synth-shared": "0.12.4"
18
+ "@itphx/synth-shared": "0.13.8"
19
19
  },
20
20
  "peerDependencies": {
21
- "@itphx/synth-core": "0.12.4"
21
+ "@itphx/synth-core": "0.13.8"
22
22
  },
23
23
  "devDependencies": {
24
- "@itphx/synth-core": "0.12.4",
24
+ "@itphx/synth-core": "0.13.8",
25
25
  "@types/node": "^22.0.0",
26
26
  "@types/pg": "^8.15.0",
27
27
  "typescript": "^5.8.0"
@@ -35,7 +35,7 @@
35
35
  "scripts": {
36
36
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
37
37
  "typecheck": "tsc --noEmit",
38
- "lint": "eslint src/",
38
+ "lint": "eslint src/ --max-warnings 0",
39
39
  "test": "vitest run",
40
40
  "test:watch": "vitest",
41
41
  "clean": "rm -rf dist"