@sixb/pg 0.1.8 → 0.1.9

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.
@@ -25,7 +25,6 @@ export interface AgentRunRow {
25
25
  spawn_key: string | null;
26
26
  spec: ConversationAgentRunSpec | SubagentRunSpec | string | null;
27
27
  result: SubagentRunResult | string | null;
28
- requester_group_ids: string[] | string;
29
28
  status: AgentRunRecord["status"];
30
29
  model_id: string | null;
31
30
  finish_reason: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/agents/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAExE,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAE7B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAK3D,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;IACvC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACnC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,eAAe,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IACrC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B,UAAU,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAA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CAAC,CAAC,CAAC;IA2Cb,OAAO,CAAC,4BAA4B;IAOpC;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,OAAO,CAAC,wBAAwB;CAiBjC;AA4ED,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -2,6 +2,10 @@
2
2
  // src/index.ts
3
3
  import { AsyncLocalStorage } from "async_hooks";
4
4
  import { ProviderMaterializationTransactionLifecycle } from "@sixb/core/internal/ontology-storage-provider";
5
+ import {
6
+ createTransactionStorageProxy,
7
+ throwNestedStorageTransaction
8
+ } from "@sixb/core/internal/storage";
5
9
  import {
6
10
  createAgentOperationScope,
7
11
  createAuthOperationScope,
@@ -12,9 +16,7 @@ import {
12
16
  createWorkflowRunOperationScope
13
17
  } from "@sixb/core/internal/storage-operation-scope";
14
18
  import {
15
- createTransactionStorageProxy,
16
- StorageTransactionError,
17
- throwNestedStorageTransaction
19
+ StorageTransactionError
18
20
  } from "@sixb/core/storage";
19
21
 
20
22
  // src/agents/checkpoints.ts
@@ -147,7 +149,6 @@ function rowToRunRecord(row) {
147
149
  id: row.id,
148
150
  projectId: row.project_id,
149
151
  executionId: row.execution_id,
150
- requesterGroupIds: typeof row.requester_group_ids === "string" ? JSON.parse(row.requester_group_ids) : row.requester_group_ids,
151
152
  status: row.status,
152
153
  modelId: row.model_id ?? undefined,
153
154
  finishReason: coerceAgentRunFinishReason(row.finish_reason),
@@ -580,7 +581,6 @@ import {
580
581
  assertSubagentRunResult,
581
582
  subagentRunMatchesCreateInput
582
583
  } from "@sixb/core/internal/agent-run-storage-provider";
583
- import { normalizeRequesterGroupIds } from "@sixb/core/internal/auth";
584
584
  import { serializeSixbFailure } from "@sixb/core/internal/errors";
585
585
  import {
586
586
  AGENT_RUN_FAILURE_CODES as AGENT_RUN_FAILURE_CODES2,
@@ -683,7 +683,6 @@ class PgAgentRunStore {
683
683
  thread_id,
684
684
  trigger_message_id,
685
685
  spec,
686
- requester_group_ids,
687
686
  status,
688
687
  attempt,
689
688
  created_at
@@ -695,7 +694,6 @@ class PgAgentRunStore {
695
694
  ${input.threadId},
696
695
  ${input.triggerMessageId},
697
696
  ${JSON.stringify(input.spec)}::text::jsonb,
698
- ${JSON.stringify(normalizeRequesterGroupIds(input.requesterGroupIds))}::text::jsonb,
699
697
  ${"queued"},
700
698
  ${0},
701
699
  ${createdAt}
@@ -756,7 +754,6 @@ class PgAgentRunStore {
756
754
  if (parent.execution_token !== input.parentExecutionToken) {
757
755
  throw new AgentStorageError3("execution_lost", `[SixbPg] Parent Agent run '${parent.id}' is no longer owned by this execution.`);
758
756
  }
759
- const parentRecord = rowToRunRecord(parent);
760
757
  const [countRow] = await tx`
761
758
  SELECT COUNT(*)::bigint AS count FROM agent_runs
762
759
  WHERE project_id = ${input.projectId}
@@ -770,12 +767,11 @@ class PgAgentRunStore {
770
767
  const [row] = await tx`
771
768
  INSERT INTO agent_runs (
772
769
  project_id, id, execution_id, kind, parent_run_id, spawn_key, spec,
773
- requester_group_ids, status, attempt, created_at
770
+ status, attempt, created_at
774
771
  ) VALUES (
775
772
  ${input.projectId}, ${input.id}, ${input.executionId}, ${"subagent"},
776
773
  ${input.parentRunId}, ${input.spawnKey},
777
774
  ${JSON.stringify(input.spec)}::text::jsonb,
778
- ${JSON.stringify(parentRecord.requesterGroupIds)}::text::jsonb,
779
775
  ${"queued"}, ${0}, ${input.createdAt ?? new Date}
780
776
  )
781
777
  RETURNING *
@@ -1871,13 +1867,13 @@ class PgAuthAccessTokenStore {
1871
1867
  }
1872
1868
  async assertSubjectExists(projectId, subjectType, subjectId) {
1873
1869
  if (subjectType === "user") {
1874
- const [row2] = await this.sql`
1870
+ const [row] = await this.sql`
1875
1871
  SELECT *
1876
1872
  FROM auth_users
1877
1873
  WHERE project_id = ${projectId}
1878
1874
  AND id = ${subjectId}
1879
1875
  `;
1880
- if (row2)
1876
+ if (row)
1881
1877
  return;
1882
1878
  throw new AuthStorageError2("missing_user", `[Sixb] User '${subjectId}' not found for project '${projectId}'.`);
1883
1879
  }
@@ -7085,6 +7081,30 @@ ALTER TABLE executions
7085
7081
  ON DELETE RESTRICT;
7086
7082
  `;
7087
7083
 
7084
+ // src/migrations/037-execution-requester-groups.sql
7085
+ var _037_execution_requester_groups_default = `ALTER TABLE executions ADD COLUMN requester_group_ids JSONB NOT NULL DEFAULT '[]'::jsonb;
7086
+
7087
+ -- Keep historical admission snapshots; never reconstruct them from current memberships.
7088
+ WITH RECURSIVE attribution(project_id, id, groups) AS (
7089
+ SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, '[]'::jsonb)
7090
+ FROM executions e
7091
+ LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
7092
+ LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
7093
+ WHERE e.parent_execution_id IS NULL
7094
+ UNION ALL
7095
+ SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, p.groups)
7096
+ FROM executions e
7097
+ JOIN attribution p ON p.project_id = e.project_id AND p.id = e.parent_execution_id
7098
+ LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
7099
+ LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
7100
+ )
7101
+ UPDATE executions e SET requester_group_ids = a.groups
7102
+ FROM attribution a WHERE a.project_id = e.project_id AND a.id = e.id;
7103
+
7104
+ ALTER TABLE workflow_runs DROP COLUMN requester_group_ids;
7105
+ ALTER TABLE agent_runs DROP COLUMN requester_group_ids;
7106
+ `;
7107
+
7088
7108
  // src/migrations.ts
7089
7109
  var POSTGRES_STORAGE_ADAPTER_ID = "SixbPostgresStorage";
7090
7110
  function pgSql(id, sqlText) {
@@ -7295,7 +7315,8 @@ var postgresStorageMigrations = defineMigrations({
7295
7315
  pgSql("033-retire-agent-definitions", _033_retire_agent_definitions_default),
7296
7316
  pgSql("034-device-authorizations", _034_device_authorizations_default),
7297
7317
  pgSql("035-share-grants", _035_share_grants_default),
7298
- pgSql("036-share-sessions", _036_share_sessions_default)
7318
+ pgSql("036-share-sessions", _036_share_sessions_default),
7319
+ pgSql("037-execution-requester-groups", _037_execution_requester_groups_default)
7299
7320
  ]
7300
7321
  });
7301
7322
 
@@ -7744,18 +7765,18 @@ function compileExpansionOrder(expansion, target, neighborType, neighborId) {
7744
7765
  }
7745
7766
  function compileSet(projectId, op, inputs, ctx) {
7746
7767
  if (inputs.length === 0) {
7747
- const order2 = compileOrder(identityOrderFields());
7768
+ const order = compileOrder(identityOrderFields());
7748
7769
  return {
7749
7770
  sql: `
7750
7771
  SELECT *, properties AS _cursor_properties
7751
7772
  FROM ${ctx.source.objectsTable}
7752
7773
  WHERE 1 = 0
7753
- ORDER BY ${order2.sql}
7774
+ ORDER BY ${order.sql}
7754
7775
  `,
7755
- args: order2.args,
7776
+ args: order.args,
7756
7777
  totalSql: "SELECT 0::bigint AS total",
7757
7778
  totalArgs: [],
7758
- order: order2,
7779
+ order,
7759
7780
  hasMore: () => false,
7760
7781
  trimRows: identityRows,
7761
7782
  nextPageToken: () => {
@@ -9428,7 +9449,7 @@ function valuesJoin(sql, select, columns, tuples, where, whereParams) {
9428
9449
  const colWidth = columns.length;
9429
9450
  const base = whereParams.length;
9430
9451
  const valuePlaceholders = tuples.map((_, i) => {
9431
- const cols = columns.map((_2, j) => `$${base + i * colWidth + j + 1}`);
9452
+ const cols = columns.map((_, j) => `$${base + i * colWidth + j + 1}`);
9432
9453
  return `(${cols.join(",")})`;
9433
9454
  }).join(",");
9434
9455
  const onClause = columns.map((c) => {
@@ -12697,12 +12718,11 @@ import {
12697
12718
  } from "@sixb/core/internal/action-run-storage";
12698
12719
  import { assertActionRunExecution } from "@sixb/core/internal/action-run-storage-provider";
12699
12720
  import {
12700
- ActionRunError,
12701
12721
  actionRunPhaseRecordsEqual,
12702
12722
  canRequeueActionRunAfterEnqueueFailure,
12703
- finishActionRunPhase,
12704
- isTerminalActionRun
12705
- } from "@sixb/core/storage";
12723
+ finishActionRunPhase
12724
+ } from "@sixb/core/internal/storage";
12725
+ import { ActionRunError, isTerminalActionRun } from "@sixb/core/storage";
12706
12726
  class PgActionRunStorage {
12707
12727
  sql;
12708
12728
  executions;
@@ -12960,8 +12980,8 @@ class PgActionRunStorage {
12960
12980
  params.push(input.actionId);
12961
12981
  }
12962
12982
  if (input.actionIds) {
12963
- const placeholders2 = input.actionIds.map(() => `$${index++}`);
12964
- whereClauses.push(`action_id IN (${placeholders2.join(", ")})`);
12983
+ const placeholders = input.actionIds.map(() => `$${index++}`);
12984
+ whereClauses.push(`action_id IN (${placeholders.join(", ")})`);
12965
12985
  params.push(...input.actionIds);
12966
12986
  }
12967
12987
  if (input.objectTypeIds) {
@@ -12970,8 +12990,8 @@ class PgActionRunStorage {
12970
12990
  params.push("object");
12971
12991
  } else {
12972
12992
  const subjectKindIndex = index++;
12973
- const placeholders2 = input.objectTypeIds.map(() => `$${index++}`);
12974
- whereClauses.push(`(subject_kind <> $${subjectKindIndex} OR object_type_id IN (${placeholders2.join(", ")}))`);
12993
+ const placeholders = input.objectTypeIds.map(() => `$${index++}`);
12994
+ whereClauses.push(`(subject_kind <> $${subjectKindIndex} OR object_type_id IN (${placeholders.join(", ")}))`);
12975
12995
  params.push("object", ...input.objectTypeIds);
12976
12996
  }
12977
12997
  }
@@ -12998,8 +13018,8 @@ class PgActionRunStorage {
12998
13018
  }
12999
13019
  }
13000
13020
  if (input.statuses) {
13001
- const placeholders2 = input.statuses.map(() => `$${index++}`);
13002
- whereClauses.push(`status IN (${placeholders2.join(", ")})`);
13021
+ const placeholders = input.statuses.map(() => `$${index++}`);
13022
+ whereClauses.push(`status IN (${placeholders.join(", ")})`);
13003
13023
  params.push(...input.statuses);
13004
13024
  }
13005
13025
  if (input.startedAfter) {
@@ -13157,6 +13177,7 @@ import {
13157
13177
  aiModelCallCostDetails,
13158
13178
  aiModelCallCostMatchesUsage,
13159
13179
  buildAiAccountingOverviewFromFragments,
13180
+ directModelCallAttribution,
13160
13181
  normalizeAiAccountingQuery,
13161
13182
  normalizeAiModelCallAccountingQuery as normalizeAiModelCallAccountingQuery2,
13162
13183
  normalizeAiModelCallCostRecord,
@@ -13201,6 +13222,7 @@ WITH filtered AS (
13201
13222
  SELECT COALESCE(root_agent.execution_id, usage.execution_id) AS root_execution_id,
13202
13223
  usage.execution_id, usage.provider_id, usage.requested_model_id, usage.occurred_at,
13203
13224
  usage.total_tokens,
13225
+ execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
13204
13226
  COALESCE(cost.status, 'unvalued') AS valuation_status,
13205
13227
  cost.currency AS amount_currency, cost.amount_nanos,
13206
13228
  root_agent.id AS root_agent_run_id,
@@ -13213,6 +13235,7 @@ WITH filtered AS (
13213
13235
  workflow_node.workflow_id AS workflow_id,
13214
13236
  workflow_node.workflow_run_id AS workflow_run_id
13215
13237
  FROM ai_model_call_usage AS usage
13238
+ JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
13216
13239
  LEFT JOIN agent_runs AS direct_agent
13217
13240
  ON direct_agent.project_id = usage.project_id AND direct_agent.execution_id = usage.execution_id
13218
13241
  LEFT JOIN agent_runs AS root_agent
@@ -13250,6 +13273,7 @@ SELECT filtered.root_execution_id, execution_id, provider_id, requested_model_id
13250
13273
  CAST(SUM((amount_nanos / 1000000) % 1000000) AS TEXT) AS amount_middle,
13251
13274
  CAST(SUM(amount_nanos % 1000000) AS TEXT) AS amount_low,
13252
13275
  MAX(root_agent_run_id) AS root_agent_run_id,
13276
+ MAX(executor_kind) AS executor_kind, MAX(executor_id) AS executor_id, MAX(primitive_id) AS primitive_id,
13253
13277
  MAX(root_thread_id) AS root_thread_id,
13254
13278
  MAX(direct_kind) AS direct_kind,
13255
13279
  MAX(direct_run_id) AS direct_run_id,
@@ -13264,12 +13288,11 @@ GROUP BY filtered.root_execution_id, execution_id, provider_id, requested_model_
13264
13288
  `;
13265
13289
 
13266
13290
  // src/pg-ai-usage-storage.ts
13291
+ import { assertAiUsageExecutionId, normalizeAiModelCallRecord } from "@sixb/core/internal/storage";
13267
13292
  import { isModelReasoning, normalizeModelProviderIds } from "@sixb/core/models";
13268
13293
  import {
13269
13294
  AiUsageStorageError,
13270
- aggregateAiModelCallUsage,
13271
- assertAiUsageExecutionId,
13272
- normalizeAiModelCallRecord
13295
+ aggregateAiModelCallUsage
13273
13296
  } from "@sixb/core/storage";
13274
13297
  class PgAiUsageStorage {
13275
13298
  sql;
@@ -13581,11 +13604,14 @@ class PgAiCostStorage {
13581
13604
  ELSE NULL
13582
13605
  END AS attribution_agent_kind,
13583
13606
  workflow_node.node_id AS attribution_agent_step_id,
13584
- workflow_node.workflow_id AS attribution_workflow_id,
13607
+ COALESCE(workflow_node.workflow_id,
13608
+ CASE WHEN execution.executor_kind = 'workflow' THEN execution.authority_primitive_id END
13609
+ ) AS attribution_workflow_id,
13585
13610
  cost.status AS cost_status,
13586
13611
  cost.currency AS cost_currency,
13587
13612
  cost.amount_nanos AS cost_amount_nanos
13588
13613
  FROM ai_model_call_usage AS usage
13614
+ JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
13589
13615
  LEFT JOIN agent_runs AS direct_agent
13590
13616
  ON direct_agent.project_id = usage.project_id
13591
13617
  AND direct_agent.execution_id = usage.execution_id
@@ -13712,6 +13738,7 @@ class PgAiCostStorage {
13712
13738
  workflow_agent.node_run_id AS attribution_node_run_id,
13713
13739
  workflow_node.workflow_id AS attribution_workflow_id,
13714
13740
  workflow_node.workflow_run_id AS attribution_workflow_run_id,
13741
+ execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
13715
13742
  COALESCE((
13716
13743
  SELECT jsonb_agg(groups.group_id ORDER BY groups.group_id)
13717
13744
  FROM ai_model_call_usage_groups AS groups
@@ -13726,6 +13753,7 @@ class PgAiCostStorage {
13726
13753
  cost.details AS cost_details,
13727
13754
  cost.rated_at AS cost_rated_at
13728
13755
  FROM ai_model_call_usage AS usage
13756
+ JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
13729
13757
  LEFT JOIN agent_runs AS direct_agent
13730
13758
  ON direct_agent.project_id = usage.project_id
13731
13759
  AND direct_agent.execution_id = usage.execution_id
@@ -13814,7 +13842,7 @@ function meterFragment(presentCallCount, total) {
13814
13842
  function accountingItemFromRow(row) {
13815
13843
  const usage = usageFromRow2(row, parseStringArray(row.requester_group_ids));
13816
13844
  const cost = row.cost_status === null ? undefined : costFromJoinedRow(row);
13817
- const attribution = row.attribution_kind === null ? undefined : row.attribution_kind === "agent" ? {
13845
+ const attribution = row.attribution_kind === null ? directModelCallAttribution(row.executor_kind, row.executor_id, row.primitive_id) : row.attribution_kind === "agent" ? {
13818
13846
  kind: "agent",
13819
13847
  agentRunId: required2(row.attribution_agent_run_id),
13820
13848
  threadId: required2(row.attribution_thread_id)
@@ -14649,8 +14677,7 @@ function createPgClient(options) {
14649
14677
  import {
14650
14678
  executionRecordFromStorageRow,
14651
14679
  executionRecordToStorageRow,
14652
- normalizeExecutionRecord,
14653
- validateExecutionRecordReferences
14680
+ prepareExecutionRecord
14654
14681
  } from "@sixb/core/internal/execution-storage";
14655
14682
  import { ExecutionStorageError } from "@sixb/core/storage";
14656
14683
  class PgExecutionStorage {
@@ -14663,8 +14690,7 @@ class PgExecutionStorage {
14663
14690
  this.shareSessions = shareSessions;
14664
14691
  }
14665
14692
  async create(input) {
14666
- const record = normalizeExecutionRecord(input);
14667
- await validateExecutionRecordReferences(record, {
14693
+ const record = await prepareExecutionRecord(input, {
14668
14694
  auth: this.auth,
14669
14695
  getExecution: (params) => this.getById(params),
14670
14696
  getShareSession: (params) => this.shareSessions.getById(params)
@@ -14681,6 +14707,7 @@ class PgExecutionStorage {
14681
14707
  source_id,
14682
14708
  requested_by_user_id,
14683
14709
  requested_by_service_account_id,
14710
+ requester_group_ids,
14684
14711
  correlation_id,
14685
14712
  parent_execution_id,
14686
14713
  authority_kind,
@@ -14704,6 +14731,7 @@ class PgExecutionStorage {
14704
14731
  ${row.sourceId},
14705
14732
  ${row.requestedByUserId},
14706
14733
  ${row.requestedByServiceAccountId},
14734
+ ${JSON.stringify(row.requesterGroupIds)}::text::jsonb,
14707
14735
  ${row.correlationId},
14708
14736
  ${row.parentExecutionId},
14709
14737
  ${row.authorityKind},
@@ -14751,6 +14779,7 @@ function toStorageRow(row) {
14751
14779
  sourceId: row.source_id,
14752
14780
  requestedByUserId: row.requested_by_user_id,
14753
14781
  requestedByServiceAccountId: row.requested_by_service_account_id,
14782
+ requesterGroupIds: row.requester_group_ids,
14754
14783
  correlationId: row.correlation_id,
14755
14784
  parentExecutionId: row.parent_execution_id,
14756
14785
  authorityKind: row.authority_kind,
@@ -14771,11 +14800,8 @@ function toStorageRow(row) {
14771
14800
  // src/pg-pipeline-run-storage.ts
14772
14801
  import { parseSixbFailure as parseSixbFailure3, serializeSixbFailure as serializeSixbFailure3 } from "@sixb/core/internal/errors";
14773
14802
  import { assertPipelineRunExecution } from "@sixb/core/internal/pipeline-run-storage-provider";
14774
- import {
14775
- canRequeuePipelineRunAfterEnqueueFailure,
14776
- PIPELINE_RUN_FAILURE_CODES,
14777
- PipelineRunError
14778
- } from "@sixb/core/storage";
14803
+ import { canRequeuePipelineRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
14804
+ import { PIPELINE_RUN_FAILURE_CODES, PipelineRunError } from "@sixb/core/storage";
14779
14805
 
14780
14806
  // src/latest-run-query.ts
14781
14807
  async function queryLatestRunsByOwnerId(input) {
@@ -14783,12 +14809,12 @@ async function queryLatestRunsByOwnerId(input) {
14783
14809
  if (ownerIds.length === 0) {
14784
14810
  return [];
14785
14811
  }
14786
- const placeholders2 = ownerIds.map((_, index) => `$${index + 2}`).join(", ");
14812
+ const placeholders = ownerIds.map((_, index) => `$${index + 2}`).join(", ");
14787
14813
  const orderColumn = input.tableName === "sync_runs" || input.tableName === "pipeline_runs" || input.tableName === "projection_runs" ? "COALESCE(started_at, queued_at)" : "started_at";
14788
14814
  const rows = await input.sql.unsafe(`
14789
14815
  SELECT DISTINCT ON (${input.ownerColumn}) ${input.selectList ?? "*"}
14790
14816
  FROM ${input.tableName}
14791
- WHERE project_id = $1 AND ${input.ownerColumn} IN (${placeholders2})
14817
+ WHERE project_id = $1 AND ${input.ownerColumn} IN (${placeholders})
14792
14818
  ORDER BY ${input.ownerColumn}, ${orderColumn} DESC, id DESC
14793
14819
  `, [input.projectId, ...ownerIds]);
14794
14820
  const latestByOwnerId = new Map(rows.map((row) => [input.ownerIdFor(row), row]));
@@ -15031,8 +15057,8 @@ class PgPipelineRunStorage {
15031
15057
  params.push(input.pipelineId);
15032
15058
  }
15033
15059
  if (input.pipelineIds) {
15034
- const placeholders2 = input.pipelineIds.map(() => `$${index++}`).join(", ");
15035
- whereClauses.push(`pipeline_id IN (${placeholders2})`);
15060
+ const placeholders = input.pipelineIds.map(() => `$${index++}`).join(", ");
15061
+ whereClauses.push(`pipeline_id IN (${placeholders})`);
15036
15062
  params.push(...input.pipelineIds);
15037
15063
  }
15038
15064
  index = appendRunListFilters(whereClauses, params, index, input, "COALESCE(started_at, queued_at)");
@@ -15467,16 +15493,16 @@ class PgProjectionRunStorage {
15467
15493
  if (input.objectTypeIds.length === 0) {
15468
15494
  return { runs: [], hasMore: false, total: 0 };
15469
15495
  }
15470
- const placeholders2 = input.objectTypeIds.map(() => `$${index++}`);
15471
- const list = placeholders2.join(", ");
15496
+ const placeholders = input.objectTypeIds.map(() => `$${index++}`);
15497
+ const list = placeholders.join(", ");
15472
15498
  const sourceList = input.objectTypeIds.map(() => `$${index++}`).join(", ");
15473
15499
  const targetList = input.objectTypeIds.map(() => `$${index++}`).join(", ");
15474
15500
  whereClauses.push(`(object_type_id IN (${list})` + ` OR (source_object_type_id IN (${sourceList})` + ` AND target_object_type_id IN (${targetList})))`);
15475
15501
  params.push(...input.objectTypeIds, ...input.objectTypeIds, ...input.objectTypeIds);
15476
15502
  }
15477
15503
  if (input.statuses) {
15478
- const placeholders2 = input.statuses.map(() => `$${index++}`);
15479
- whereClauses.push(`status IN (${placeholders2.join(", ")})`);
15504
+ const placeholders = input.statuses.map(() => `$${index++}`);
15505
+ whereClauses.push(`status IN (${placeholders.join(", ")})`);
15480
15506
  params.push(...input.statuses);
15481
15507
  }
15482
15508
  if (input.startedAfter) {
@@ -15694,8 +15720,8 @@ class PgRulesStorage {
15694
15720
  params.push(input.objectTypeId);
15695
15721
  }
15696
15722
  if (input.objectTypeIds) {
15697
- const placeholders2 = input.objectTypeIds.map(() => `$${index++}`);
15698
- whereClauses.push(`object_type_id IN (${placeholders2.join(", ")})`);
15723
+ const placeholders = input.objectTypeIds.map(() => `$${index++}`);
15724
+ whereClauses.push(`object_type_id IN (${placeholders.join(", ")})`);
15699
15725
  params.push(...input.objectTypeIds);
15700
15726
  }
15701
15727
  if (input.primaryId) {
@@ -15871,12 +15897,9 @@ function toIsoString3(value) {
15871
15897
 
15872
15898
  // src/pg-sync-run-storage.ts
15873
15899
  import { parseSixbFailure as parseSixbFailure4, serializeSixbFailure as serializeSixbFailure5 } from "@sixb/core/internal/errors";
15900
+ import { canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
15874
15901
  import { assertSyncRunExecution } from "@sixb/core/internal/sync-run-storage-provider";
15875
- import {
15876
- canRequeueSyncRunAfterEnqueueFailure,
15877
- SYNC_RUN_FAILURE_CODES,
15878
- SyncRunError
15879
- } from "@sixb/core/storage";
15902
+ import { SYNC_RUN_FAILURE_CODES, SyncRunError } from "@sixb/core/storage";
15880
15903
  class PgSyncRunStorage {
15881
15904
  sql;
15882
15905
  executions;
@@ -16036,8 +16059,8 @@ class PgSyncRunStorage {
16036
16059
  params.push(input.syncId);
16037
16060
  }
16038
16061
  if (input.syncIds) {
16039
- const placeholders2 = input.syncIds.map(() => `$${index++}`);
16040
- whereClauses.push(`sync_id IN (${placeholders2.join(", ")})`);
16062
+ const placeholders = input.syncIds.map(() => `$${index++}`);
16063
+ whereClauses.push(`sync_id IN (${placeholders.join(", ")})`);
16041
16064
  params.push(...input.syncIds);
16042
16065
  }
16043
16066
  if (input.datasetId) {
@@ -16139,14 +16162,14 @@ class PgTimeseriesStorage {
16139
16162
  const params = [];
16140
16163
  let nextIndex = 1;
16141
16164
  const values = input.series.map((series, seriesIndex) => {
16142
- const placeholders2 = [
16165
+ const placeholders = [
16143
16166
  `$${nextIndex++}`,
16144
16167
  `$${nextIndex++}`,
16145
16168
  `$${nextIndex++}`,
16146
16169
  `$${nextIndex++}`
16147
16170
  ];
16148
16171
  params.push(seriesIndex, series.objectTypeId, series.objectId, series.propertyId);
16149
- return `(${placeholders2.join(", ")})`;
16172
+ return `(${placeholders.join(", ")})`;
16150
16173
  }).join(", ");
16151
16174
  const projectIdPlaceholder = `$${nextIndex++}`;
16152
16175
  params.push(input.projectId);
@@ -16498,8 +16521,8 @@ class PgWorkflowInterventionStorage {
16498
16521
  const params = [input.projectId];
16499
16522
  let index = 2;
16500
16523
  if (input.statuses) {
16501
- const placeholders2 = input.statuses.map(() => `$${index++}`);
16502
- whereClauses.push(`status IN (${placeholders2.join(", ")})`);
16524
+ const placeholders = input.statuses.map(() => `$${index++}`);
16525
+ whereClauses.push(`status IN (${placeholders.join(", ")})`);
16503
16526
  params.push(...input.statuses);
16504
16527
  }
16505
16528
  if (input.workflowId) {
@@ -16507,8 +16530,8 @@ class PgWorkflowInterventionStorage {
16507
16530
  params.push(input.workflowId);
16508
16531
  }
16509
16532
  if (input.workflowIds) {
16510
- const placeholders2 = input.workflowIds.map(() => `$${index++}`);
16511
- whereClauses.push(`workflow_id IN (${placeholders2.join(", ")})`);
16533
+ const placeholders = input.workflowIds.map(() => `$${index++}`);
16534
+ whereClauses.push(`workflow_id IN (${placeholders.join(", ")})`);
16512
16535
  params.push(...input.workflowIds);
16513
16536
  }
16514
16537
  if (input.workflowRunId) {
@@ -16622,7 +16645,6 @@ function assertNonNegativeInteger(value, fieldName) {
16622
16645
  }
16623
16646
 
16624
16647
  // src/pg-workflow-run-storage.ts
16625
- import { normalizeRequesterGroupIds as normalizeRequesterGroupIds2 } from "@sixb/core/internal/auth";
16626
16648
  import { parseSixbFailure as parseSixbFailure6, serializeSixbFailure as serializeSixbFailure7 } from "@sixb/core/internal/errors";
16627
16649
  import {
16628
16650
  assertWorkflowAgentNodeRunExecution,
@@ -16664,7 +16686,6 @@ class PgWorkflowRunStorage {
16664
16686
  input,
16665
16687
  queued_at,
16666
16688
  started_at,
16667
- requester_group_ids,
16668
16689
  attempt
16669
16690
  ) VALUES (
16670
16691
  ${input.projectId},
@@ -16675,7 +16696,6 @@ class PgWorkflowRunStorage {
16675
16696
  ${serializeRecord2(input.input)}::text::jsonb,
16676
16697
  ${queuedAt},
16677
16698
  ${queuedAt},
16678
- ${JSON.stringify(normalizeRequesterGroupIds2(input.requesterGroupIds))}::text::jsonb,
16679
16699
  ${0}
16680
16700
  )
16681
16701
  RETURNING *
@@ -16861,8 +16881,8 @@ class PgWorkflowRunStorage {
16861
16881
  params.push(input.workflowId);
16862
16882
  }
16863
16883
  if (input.workflowIds) {
16864
- const placeholders2 = input.workflowIds.map(() => `$${index++}`);
16865
- whereClauses.push(`workflow_id IN (${placeholders2.join(", ")})`);
16884
+ const placeholders = input.workflowIds.map(() => `$${index++}`);
16885
+ whereClauses.push(`workflow_id IN (${placeholders.join(", ")})`);
16866
16886
  params.push(...input.workflowIds);
16867
16887
  }
16868
16888
  index = appendRunListFilters(whereClauses, params, index, input);
@@ -17268,7 +17288,6 @@ function rowToWorkflowRunRecord(row) {
17268
17288
  startedAt: new Date(row.started_at),
17269
17289
  finishedAt: row.finished_at ? new Date(row.finished_at) : undefined,
17270
17290
  error: row.error === null ? undefined : parseSixbFailure6(row.error, WORKFLOW_RUN_FAILURE_CODES),
17271
- requesterGroupIds: parseJson(row.requester_group_ids),
17272
17291
  attempt: Number(row.attempt),
17273
17292
  ...row.execution_token && row.execution_queue_lease_expires_at ? {
17274
17293
  execution: {
@@ -17843,8 +17862,8 @@ function resolveTimeoutMillis(value, label) {
17843
17862
  return Math.trunc(value);
17844
17863
  }
17845
17864
  export {
17846
- migratePostgresStorage,
17847
- PostgresStorage
17865
+ PostgresStorage,
17866
+ migratePostgresStorage
17848
17867
  };
17849
17868
 
17850
- //# debugId=66A7E573B9EBA9B464756E2164756E21
17869
+ //# debugId=E76835E14E96BFEC64756E2164756E21