@sixb/sqlite 0.1.8 → 0.1.10
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/action-run-storage.d.ts.map +1 -1
- package/dist/agents/rows.d.ts +0 -1
- package/dist/agents/rows.d.ts.map +1 -1
- package/dist/agents/runs.d.ts.map +1 -1
- package/dist/ai-cost-storage.d.ts.map +1 -1
- package/dist/ai-usage-storage.d.ts.map +1 -1
- package/dist/execution-storage.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +495 -244
- package/dist/index.js.map +23 -21
- package/dist/migrations.d.ts.map +1 -1
- package/dist/ontology-storage/materialization-state.d.ts +2 -1
- package/dist/ontology-storage/materialization-state.d.ts.map +1 -1
- package/dist/ontology-storage/materializations.d.ts.map +1 -1
- package/dist/ontology-storage/shared.d.ts +2 -0
- package/dist/ontology-storage/shared.d.ts.map +1 -1
- package/dist/ontology-storage/source-cleanup.d.ts +4 -0
- package/dist/ontology-storage/source-cleanup.d.ts.map +1 -0
- package/dist/ontology-storage/source-roots.d.ts +27 -0
- package/dist/ontology-storage/source-roots.d.ts.map +1 -0
- package/dist/ontology-storage/sources.d.ts.map +1 -1
- package/dist/pipeline-run-storage.d.ts.map +1 -1
- package/dist/projection-run-storage.d.ts.map +1 -1
- package/dist/sync-run-storage.d.ts.map +1 -1
- package/dist/workflow-run-storage.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/action-run-storage.ts +6 -7
- package/src/agents/rows.ts +0 -2
- package/src/agents/runs.ts +3 -7
- package/src/ai-cost-groups.ts +3 -0
- package/src/ai-cost-storage.ts +11 -2
- package/src/ai-usage-storage.ts +1 -2
- package/src/connector-connection-storage.ts +3 -3
- package/src/execution-storage.ts +7 -5
- package/src/index.ts +4 -2
- package/src/migrations/037-execution-requester-groups.sql +24 -0
- package/src/migrations/038-projection-source-roots.sql +44 -0
- package/src/migrations/039-connector-optional-pkce.sql +52 -0
- package/src/migrations.ts +14 -0
- package/src/ontology-storage/materialization-state.ts +56 -91
- package/src/ontology-storage/materializations.ts +7 -1
- package/src/ontology-storage/shared.ts +10 -0
- package/src/ontology-storage/source-cleanup.ts +59 -0
- package/src/ontology-storage/source-roots.ts +230 -0
- package/src/ontology-storage/sources.ts +25 -78
- package/src/pipeline-run-storage.ts +2 -5
- package/src/projection-run-storage.ts +11 -3
- package/src/sync-run-storage.ts +2 -5
- package/src/workflow-run-storage.ts +1 -6
package/dist/migrations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAGV,YAAY,EACZ,aAAa,EACb,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAGV,YAAY,EACZ,aAAa,EACb,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAkG3B,eAAO,MAAM,yBAAyB,sBAAsB,CAAA;AAC5D,eAAO,MAAM,mBAAmB,mBAAmB,CAAA;AAEnD,eAAO,MAAM,uBAAuB,wBA8ElC,CAAA;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAQ9E;AAED,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC1C,OAAO,GAAE,oBAAyB,GACjC,aAAa,CAAC,QAAQ,CAAC,CAEzB;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAS3D;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,CAOzF;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;CAC5C,GAAG,eAAe,CAoBlB;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1E"}
|
|
@@ -15,6 +15,7 @@ export type ReplacementIdentity = {
|
|
|
15
15
|
readonly diffRequired: boolean;
|
|
16
16
|
};
|
|
17
17
|
interface ReplacementIdentityInput {
|
|
18
|
+
readonly incremental?: boolean;
|
|
18
19
|
readonly sessionId: string;
|
|
19
20
|
readonly sourceId: string;
|
|
20
21
|
readonly candidateMaterializationId: string;
|
|
@@ -49,7 +50,7 @@ export declare class SqliteMaterializationStateReader {
|
|
|
49
50
|
replacementObjectStates(sourceId: string, candidateMaterializationId: string, refs: readonly OntologyObjectRef[]): readonly SourceReplacementObjectState[];
|
|
50
51
|
replacementLinkStates(sourceId: string, candidateMaterializationId: string, materializationIds: readonly string[], identities: readonly Extract<ReplacementIdentity, {
|
|
51
52
|
readonly kind: "link";
|
|
52
|
-
}>[]): readonly SourceReplacementLinkState[];
|
|
53
|
+
}>[], incremental?: boolean): readonly SourceReplacementLinkState[];
|
|
53
54
|
effectiveObjectRevision(ref: OntologyObjectRef): {
|
|
54
55
|
readonly version: number;
|
|
55
56
|
readonly lastCommitId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialization-state.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/materialization-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAGV,eAAe,EACf,iBAAiB,EAEjB,kBAAkB,EACnB,MAAM,qCAAqC,CAAA;AAe5C,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAO5B,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"materialization-state.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/materialization-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAGV,eAAe,EACf,iBAAiB,EAEjB,kBAAkB,EACnB,MAAM,qCAAqC,CAAA;AAe5C,OAAO,KAAK,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAO5B,oBAAoB,EACrB,MAAM,oBAAoB,CAAA;AAW3B,eAAO,MAAM,iCAAiC,kCAAkC,CAAA;AAChF,eAAO,MAAM,6BAA6B,8BAA8B,CAAA;AAiFxE,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAC5B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;C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AGzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materializations.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/materializations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA2B1C,OAAO,KAAK,EACV,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAEvB,8BAA8B,EAC9B,uCAAuC,EAEvC,0BAA0B,EAC1B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EAClC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAGL,KAAK,gCAAgC,EACtC,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"materializations.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/materializations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AA2B1C,OAAO,KAAK,EACV,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAEvB,8BAA8B,EAC9B,uCAAuC,EAEvC,0BAA0B,EAC1B,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,iCAAiC,EAClC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAGL,KAAK,gCAAgC,EACtC,MAAM,2BAA2B,CAAA;AAkBlC,qBAAa,oCAAqC,YAAW,8BAA8B;IAKvF,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;gBAGjC,EAAE,EAAE,QAAQ,EAC7B,OAAO,EAAE,gCAAgC,GAAG,IAAI;IAM5C,KAAK,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmCvE,WAAW,CAChB,KAAK,EAAE,+BAA+B,GACrC,aAAa,CAAC,wBAAwB,CAAC;IAmDnC,4BAA4B,CACjC,KAAK,EAAE,iCAAiC,GACvC,aAAa,CAAC,0BAA0B,CAAC;IA6FtC,SAAS,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE,UAAU,CAAC,KAAK,EAAE,8BAA8B,GAAG,aAAa,CAAC,uBAAuB,CAAC;IAKnF,mBAAmB,CACvB,KAAK,EAAE,uCAAuC,GAC7C,OAAO,CAAC,SAAS,8BAA8B,EAAE,CAAC;IAK/C,UAAU,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBhE,QAAQ,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAYxF,kBAAkB,IAAI,IAAI;IAI1B,OAAO,CAAC,kBAAkB;IA4D1B,OAAO,CAAC,kBAAkB;IA+C1B,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,UAAU;YAsBJ,kBAAkB;IAwDhC,OAAO,CAAC,sBAAsB;IAwD9B,OAAO,CAAC,cAAc;IAsGtB,OAAO,CAAC,YAAY;IAmDpB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,SAAS;CAYlB"}
|
|
@@ -37,6 +37,8 @@ export interface SqliteOntologySourceRow {
|
|
|
37
37
|
readonly ownership_hash: string;
|
|
38
38
|
readonly ontology_revision: string;
|
|
39
39
|
readonly root_count: number | null;
|
|
40
|
+
readonly base_materialization_id: string | null;
|
|
41
|
+
readonly base_commit_id: string | null;
|
|
40
42
|
readonly assertion_count: number | null;
|
|
41
43
|
readonly created_at: string;
|
|
42
44
|
readonly ready_at: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.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|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { CleanupTerminalSourceMaterializationsInput, CleanupTerminalSourceMaterializationsResult } from "@sixb/core/storage";
|
|
3
|
+
export declare function cleanupSourceVersions(db: Database, input: CleanupTerminalSourceMaterializationsInput): CleanupTerminalSourceMaterializationsResult;
|
|
4
|
+
//# sourceMappingURL=source-cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-cleanup.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/source-cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EACV,0CAA0C,EAC1C,2CAA2C,EAC5C,MAAM,oBAAoB,CAAA;AAE3B,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,0CAA0C,GAChD,2CAA2C,CAiD7C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { ProjectionEntityRef } from "@sixb/core/internal/materialization";
|
|
3
|
+
import type { SourceActivationWrite, StageSourceRowsInput } from "@sixb/core/storage";
|
|
4
|
+
import type { SqliteOntologySourceAssertionRow } from "./shared";
|
|
5
|
+
import { type SqliteOntologySourceRow } from "./shared";
|
|
6
|
+
export declare function replacementSourceRows(input: {
|
|
7
|
+
readonly projectId: string;
|
|
8
|
+
readonly sourceId: string;
|
|
9
|
+
readonly materializationId: string;
|
|
10
|
+
readonly incremental: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
readonly sql: string;
|
|
13
|
+
readonly values: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
export declare function stageSourceRoots(db: Database, manifest: SqliteOntologySourceRow, input: StageSourceRowsInput): void;
|
|
16
|
+
export declare function activateSourceRoots(db: Database, projectId: string, candidate: SqliteOntologySourceRow, activation: SourceActivationWrite): void;
|
|
17
|
+
export declare function assertSourceRootCoverage(db: Database, manifest: SqliteOntologySourceRow): void;
|
|
18
|
+
export declare function activeSourceRows(db: Database, projectId: string, refs: readonly ProjectionEntityRef[]): SqliteOntologySourceAssertionRow[];
|
|
19
|
+
export declare function replacementAssertionRows(db: Database, input: {
|
|
20
|
+
projectId: string;
|
|
21
|
+
sourceId: string;
|
|
22
|
+
materializationId: string;
|
|
23
|
+
incremental: boolean;
|
|
24
|
+
includePrevious: boolean;
|
|
25
|
+
refs: readonly ProjectionEntityRef[];
|
|
26
|
+
}): SqliteOntologySourceAssertionRow[];
|
|
27
|
+
//# sourceMappingURL=source-roots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-roots.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/source-roots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAO9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAA;AAChE,OAAO,EAAiB,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEtE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAC9B,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAyB/D;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,uBAAuB,EACjC,KAAK,EAAE,oBAAoB,GAC1B,IAAI,CAuCN;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,uBAAuB,EAClC,UAAU,EAAE,qBAAqB,GAChC,IAAI,CAiCN;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAc9F;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,SAAS,mBAAmB,EAAE,GACnC,gCAAgC,EAAE,CAuBpC;AAED,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,IAAI,EAAE,SAAS,mBAAmB,EAAE,CAAA;CACrC,GACA,gCAAgC,EAAE,CA6CpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/ontology-storage/sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAkB1C,OAAO,KAAK,EACV,0CAA0C,EAG1C,+BAA+B,EAC/B,0CAA0C,EAC1C,2CAA2C,EAC3C,4BAA4B,EAC5B,mCAAmC,EACnC,oBAAoB,EACpB,qBAAqB,EACrB,iCAAiC,EACjC,oBAAoB,EACpB,qBAAqB,EACrB,4CAA4C,EAC5C,oCAAoC,EACrC,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EASL,KAAK,mBAAmB,EAGzB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src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CAAC,qBAAqB;IA0C7B,OAAO,CAAC,gBAAgB;IAgFxB,OAAO,CAAC,aAAa;IA+BrB,OAAO,CAAC,eAAe;IAwEvB,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,eAAe;CASxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-run-storage.d.ts","sourceRoot":"","sources":["../src/pipeline-run-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline-run-storage.d.ts","sourceRoot":"","sources":["../src/pipeline-run-storage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAW3B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,+BAA+B;IAC9C,8DAA8D;IAC9D,UAAU,EAAE,gBAAgB,CAAA;IAC5B,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,UAAU,CAAC,EAAE,qBAAqB,CAAA;CACnC;AAED,qBAAa,wBAAyB,YAAW,kBAAkB;IACjE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAClD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;gBAEjC,OAAO,EAAE,+BAA+B;IAU9C,KAAK,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAmDvD,0BAA0B;IAmClC,KAAK,CAAC,KAAK,EAAE,qBAAqB,GAAG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A+B;IAoBvC,OAAO,CAAC,YAAY;IA2CpB,OAAO,CAAC,cAAc;IA6BtB,OAAO,CAAC,+BAA+B;IAQvC,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,UAAU;CAOnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-run-storage.d.ts","sourceRoot":"","sources":["../src/sync-run-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-run-storage.d.ts","sourceRoot":"","sources":["../src/sync-run-storage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,MAAM,oBAAoB,CAAA;AAU3B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,2BAA2B;IAC1C,8DAA8D;IAC9D,UAAU,EAAE,gBAAgB,CAAA;IAC5B,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,UAAU,CAAC,EAAE,qBAAqB,CAAA;CACnC;AAED,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAClD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;gBAEjC,OAAO,EAAE,2BAA2B;IAU1C,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;YA2D/C,0BAA0B;IAgClC,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAgCvD,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAyEzD,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAQjF,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8C3D,mBAAmB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAe5F,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run-storage.d.ts","sourceRoot":"","sources":["../src/workflow-run-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-run-storage.d.ts","sourceRoot":"","sources":["../src/workflow-run-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAO1C,OAAO,KAAK,EACV,+BAA+B,EAC/B,kDAAkD,EAClD,yCAAyC,EACzC,+BAA+B,EAC/B,gBAAgB,EAChB,+BAA+B,EAC/B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,gCAAgC,EAChC,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAe3B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,+BAA+B;IAC9C,8DAA8D;I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AI,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAyCrE,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAQzF,IAAI,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAwDjF,OAAO,CAAC,yBAAyB;CAOlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/sqlite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "SQLite storage provider for Sixb",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"prepack": "bun run build"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@sixb/core": "0.1.
|
|
39
|
+
"@sixb/core": "0.1.10"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@sixb/core": "0.1.
|
|
42
|
+
"@sixb/core": "0.1.10",
|
|
43
43
|
"@types/bun": "latest",
|
|
44
44
|
"typescript": "^5.7.0"
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"engines": {
|
|
48
|
-
"bun": ">=1.
|
|
48
|
+
"bun": ">=1.4.2"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
serializeActionRunFailure,
|
|
6
6
|
} from "@sixb/core/internal/action-run-storage"
|
|
7
7
|
import { assertActionRunExecution } from "@sixb/core/internal/action-run-storage-provider"
|
|
8
|
+
import {
|
|
9
|
+
actionRunPhaseRecordsEqual,
|
|
10
|
+
canRequeueActionRunAfterEnqueueFailure,
|
|
11
|
+
finishActionRunPhase,
|
|
12
|
+
} from "@sixb/core/internal/storage"
|
|
8
13
|
import type {
|
|
9
14
|
ActionRunEffectsRecord,
|
|
10
15
|
ActionRunFailure,
|
|
@@ -24,13 +29,7 @@ import type {
|
|
|
24
29
|
RecordActionWritebackInput,
|
|
25
30
|
StartActionRunInput,
|
|
26
31
|
} from "@sixb/core/storage"
|
|
27
|
-
import {
|
|
28
|
-
ActionRunError,
|
|
29
|
-
actionRunPhaseRecordsEqual,
|
|
30
|
-
canRequeueActionRunAfterEnqueueFailure,
|
|
31
|
-
finishActionRunPhase,
|
|
32
|
-
isTerminalActionRun,
|
|
33
|
-
} from "@sixb/core/storage"
|
|
32
|
+
import { ActionRunError, isTerminalActionRun } from "@sixb/core/storage"
|
|
34
33
|
import { installFreshSqliteSchema } from "./migrations"
|
|
35
34
|
import {
|
|
36
35
|
closeSqliteStoreConnection,
|
package/src/agents/rows.ts
CHANGED
|
@@ -42,7 +42,6 @@ export interface AgentRunRow {
|
|
|
42
42
|
spawn_key: string | null
|
|
43
43
|
spec: string | null
|
|
44
44
|
result: string | null
|
|
45
|
-
requester_group_ids: string
|
|
46
45
|
status: AgentRunRecord["status"]
|
|
47
46
|
model_id: string | null
|
|
48
47
|
finish_reason: string | null
|
|
@@ -111,7 +110,6 @@ export function rowToRunRecord(row: AgentRunRow): AgentRunRecord {
|
|
|
111
110
|
id: row.id,
|
|
112
111
|
projectId: row.project_id,
|
|
113
112
|
executionId: row.execution_id,
|
|
114
|
-
requesterGroupIds: JSON.parse(row.requester_group_ids) as string[],
|
|
115
113
|
status: row.status,
|
|
116
114
|
modelId: row.model_id ?? undefined,
|
|
117
115
|
finishReason: coerceAgentRunFinishReason(row.finish_reason),
|
package/src/agents/runs.ts
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
assertSubagentRunResult,
|
|
7
7
|
subagentRunMatchesCreateInput,
|
|
8
8
|
} from "@sixb/core/internal/agent-run-storage-provider"
|
|
9
|
-
import { normalizeRequesterGroupIds } from "@sixb/core/internal/auth"
|
|
10
9
|
import { serializeSixbFailure } from "@sixb/core/internal/errors"
|
|
11
10
|
import {
|
|
12
11
|
AGENT_RUN_FAILURE_CODES,
|
|
@@ -83,11 +82,10 @@ export class SqliteAgentRunStore implements AgentRunStore {
|
|
|
83
82
|
thread_id,
|
|
84
83
|
trigger_message_id,
|
|
85
84
|
spec,
|
|
86
|
-
requester_group_ids,
|
|
87
85
|
status,
|
|
88
86
|
attempt,
|
|
89
87
|
created_at
|
|
90
|
-
) VALUES (?, ?, ?, 'conversation', ?, ?, ?,
|
|
88
|
+
) VALUES (?, ?, ?, 'conversation', ?, ?, ?, 'queued', 0, ?)
|
|
91
89
|
`
|
|
92
90
|
)
|
|
93
91
|
.run(
|
|
@@ -97,7 +95,6 @@ export class SqliteAgentRunStore implements AgentRunStore {
|
|
|
97
95
|
input.threadId,
|
|
98
96
|
input.triggerMessageId,
|
|
99
97
|
JSON.stringify(input.spec),
|
|
100
|
-
JSON.stringify(normalizeRequesterGroupIds(input.requesterGroupIds)),
|
|
101
98
|
createdAt.toISOString()
|
|
102
99
|
)
|
|
103
100
|
} catch (error) {
|
|
@@ -197,8 +194,8 @@ export class SqliteAgentRunStore implements AgentRunStore {
|
|
|
197
194
|
`
|
|
198
195
|
INSERT INTO agent_runs (
|
|
199
196
|
project_id, id, execution_id, kind, parent_run_id, spawn_key, spec,
|
|
200
|
-
|
|
201
|
-
) VALUES (?, ?, ?, 'subagent', ?, ?, ?,
|
|
197
|
+
status, attempt, created_at
|
|
198
|
+
) VALUES (?, ?, ?, 'subagent', ?, ?, ?, 'queued', 0, ?)
|
|
202
199
|
`
|
|
203
200
|
)
|
|
204
201
|
.run(
|
|
@@ -208,7 +205,6 @@ export class SqliteAgentRunStore implements AgentRunStore {
|
|
|
208
205
|
input.parentRunId,
|
|
209
206
|
input.spawnKey,
|
|
210
207
|
JSON.stringify(input.spec),
|
|
211
|
-
parentRow.requester_group_ids,
|
|
212
208
|
(input.createdAt ?? new Date()).toISOString()
|
|
213
209
|
)
|
|
214
210
|
} catch (error) {
|
package/src/ai-cost-groups.ts
CHANGED
|
@@ -37,6 +37,7 @@ WITH filtered AS (
|
|
|
37
37
|
SELECT COALESCE(root_agent.execution_id, usage.execution_id) AS root_execution_id,
|
|
38
38
|
usage.execution_id, usage.provider_id, usage.requested_model_id, usage.occurred_at,
|
|
39
39
|
usage.total_tokens,
|
|
40
|
+
execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
|
|
40
41
|
COALESCE(cost.status, 'unvalued') AS valuation_status,
|
|
41
42
|
cost.currency AS amount_currency, cost.amount_nanos,
|
|
42
43
|
root_agent.id AS root_agent_run_id,
|
|
@@ -49,6 +50,7 @@ WITH filtered AS (
|
|
|
49
50
|
workflow_node.workflow_id AS workflow_id,
|
|
50
51
|
workflow_node.workflow_run_id AS workflow_run_id
|
|
51
52
|
FROM ai_model_call_usage AS usage
|
|
53
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
52
54
|
LEFT JOIN agent_runs AS direct_agent
|
|
53
55
|
ON direct_agent.project_id = usage.project_id AND direct_agent.execution_id = usage.execution_id
|
|
54
56
|
LEFT JOIN agent_runs AS root_agent
|
|
@@ -86,6 +88,7 @@ SELECT filtered.root_execution_id, execution_id, provider_id, requested_model_id
|
|
|
86
88
|
CAST(SUM((amount_nanos / 1000000) % 1000000) AS TEXT) AS amount_middle,
|
|
87
89
|
CAST(SUM(amount_nanos % 1000000) AS TEXT) AS amount_low,
|
|
88
90
|
MAX(root_agent_run_id) AS root_agent_run_id,
|
|
91
|
+
MAX(executor_kind) AS executor_kind, MAX(executor_id) AS executor_id, MAX(primitive_id) AS primitive_id,
|
|
89
92
|
MAX(root_thread_id) AS root_thread_id,
|
|
90
93
|
MAX(direct_kind) AS direct_kind,
|
|
91
94
|
MAX(direct_run_id) AS direct_run_id,
|
package/src/ai-cost-storage.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
aiModelCallCostDetails,
|
|
5
5
|
aiModelCallCostMatchesUsage,
|
|
6
6
|
buildAiAccountingOverviewFromFragments,
|
|
7
|
+
directModelCallAttribution,
|
|
7
8
|
normalizeAiAccountingQuery,
|
|
8
9
|
normalizeAiModelCallAccountingQuery,
|
|
9
10
|
normalizeAiModelCallCostRecord,
|
|
@@ -199,6 +200,7 @@ const SQLITE_ACCOUNTING_LIST_PAGE_SQL = `
|
|
|
199
200
|
workflow_agent.node_run_id AS attribution_node_run_id,
|
|
200
201
|
workflow_node.workflow_id AS attribution_workflow_id,
|
|
201
202
|
workflow_node.workflow_run_id AS attribution_workflow_run_id,
|
|
203
|
+
execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
|
|
202
204
|
COALESCE((
|
|
203
205
|
SELECT json_group_array(group_id) FROM (
|
|
204
206
|
SELECT group_id FROM ai_model_call_usage_groups
|
|
@@ -215,6 +217,7 @@ const SQLITE_ACCOUNTING_LIST_PAGE_SQL = `
|
|
|
215
217
|
cost.details AS cost_details,
|
|
216
218
|
cost.rated_at AS cost_rated_at
|
|
217
219
|
FROM ai_model_call_usage AS usage
|
|
220
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
218
221
|
LEFT JOIN agent_runs AS direct_agent
|
|
219
222
|
ON direct_agent.project_id = usage.project_id
|
|
220
223
|
AND direct_agent.execution_id = usage.execution_id
|
|
@@ -250,7 +253,9 @@ const SQLITE_ACCOUNTING_OVERVIEW_SQL = `
|
|
|
250
253
|
ELSE NULL
|
|
251
254
|
END AS attribution_agent_kind,
|
|
252
255
|
workflow_node.node_id AS attribution_agent_step_id,
|
|
253
|
-
workflow_node.workflow_id
|
|
256
|
+
COALESCE(workflow_node.workflow_id,
|
|
257
|
+
CASE WHEN execution.executor_kind = 'workflow' THEN execution.authority_primitive_id END
|
|
258
|
+
) AS attribution_workflow_id,
|
|
254
259
|
CASE
|
|
255
260
|
WHEN cost.status = 'rated' THEN 'rated'
|
|
256
261
|
WHEN cost.status = 'unpriceable' THEN 'unpriceable'
|
|
@@ -259,6 +264,7 @@ const SQLITE_ACCOUNTING_OVERVIEW_SQL = `
|
|
|
259
264
|
CASE WHEN cost.status = 'rated' THEN cost.currency ELSE NULL END AS amount_currency,
|
|
260
265
|
CASE WHEN cost.status = 'rated' THEN cost.amount_nanos ELSE NULL END AS amount_nanos
|
|
261
266
|
FROM ai_model_call_usage AS usage
|
|
267
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
262
268
|
LEFT JOIN agent_runs AS direct_agent
|
|
263
269
|
ON direct_agent.project_id = usage.project_id
|
|
264
270
|
AND direct_agent.execution_id = usage.execution_id
|
|
@@ -393,6 +399,9 @@ interface UsageRow {
|
|
|
393
399
|
}
|
|
394
400
|
|
|
395
401
|
interface JoinedRow extends UsageRow {
|
|
402
|
+
readonly executor_kind: string | null
|
|
403
|
+
readonly executor_id: string | null
|
|
404
|
+
readonly primitive_id: string | null
|
|
396
405
|
readonly attribution_kind: "agent" | "subagent" | "workflowAgent" | null
|
|
397
406
|
readonly attribution_agent_step_id: string | null
|
|
398
407
|
readonly attribution_agent_run_id: string | null
|
|
@@ -534,7 +543,7 @@ function accountingItemFromRow(row: JoinedRow): AiAccountingRecordSetItem {
|
|
|
534
543
|
const cost = row.cost_status === null ? undefined : costFromJoinedRow(row)
|
|
535
544
|
const attribution =
|
|
536
545
|
row.attribution_kind === null
|
|
537
|
-
?
|
|
546
|
+
? directModelCallAttribution(row.executor_kind, row.executor_id, row.primitive_id)
|
|
538
547
|
: row.attribution_kind === "agent"
|
|
539
548
|
? {
|
|
540
549
|
kind: "agent" as const,
|
package/src/ai-usage-storage.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assertAiUsageExecutionId, normalizeAiModelCallRecord } from "@sixb/core/internal/storage"
|
|
1
2
|
import { isModelReasoning, normalizeModelProviderIds } from "@sixb/core/models"
|
|
2
3
|
import type { ReadonlyJsonObject } from "@sixb/core/storage"
|
|
3
4
|
import {
|
|
@@ -7,9 +8,7 @@ import {
|
|
|
7
8
|
type AiUsageStorage,
|
|
8
9
|
AiUsageStorageError,
|
|
9
10
|
aggregateAiModelCallUsage,
|
|
10
|
-
assertAiUsageExecutionId,
|
|
11
11
|
type GetLatestAiModelCallForExecutionInput,
|
|
12
|
-
normalizeAiModelCallRecord,
|
|
13
12
|
type RecordAiModelCallInput,
|
|
14
13
|
type RecordAiModelCallResult,
|
|
15
14
|
type SummarizeAiUsageExecutionInput,
|
|
@@ -87,7 +87,7 @@ class SqliteConnectorConnectionPersistence implements ConnectorConnectionPersist
|
|
|
87
87
|
record.slot,
|
|
88
88
|
record.initiatedByExecutionId,
|
|
89
89
|
record.stateHash,
|
|
90
|
-
json(record.codeVerifier),
|
|
90
|
+
record.codeVerifier === undefined ? null : json(record.codeVerifier),
|
|
91
91
|
record.redirectUri,
|
|
92
92
|
record.connectionRunId ?? null,
|
|
93
93
|
record.returnTo ?? null,
|
|
@@ -411,7 +411,7 @@ function authorizationAttemptFromRow(
|
|
|
411
411
|
slot: row.slot,
|
|
412
412
|
initiatedByExecutionId: row.initiated_by_execution_id,
|
|
413
413
|
stateHash: row.state_hash,
|
|
414
|
-
codeVerifier: parseJson(row.code_verifier),
|
|
414
|
+
...(row.code_verifier === null ? {} : { codeVerifier: parseJson(row.code_verifier) }),
|
|
415
415
|
redirectUri: row.redirect_uri,
|
|
416
416
|
...(row.connection_run_id === null ? {} : { connectionRunId: row.connection_run_id }),
|
|
417
417
|
...(row.return_to === null ? {} : { returnTo: row.return_to }),
|
|
@@ -706,7 +706,7 @@ interface SqliteAuthorizationAttemptRow {
|
|
|
706
706
|
readonly slot: string
|
|
707
707
|
readonly initiated_by_execution_id: string
|
|
708
708
|
readonly state_hash: string
|
|
709
|
-
readonly code_verifier: string
|
|
709
|
+
readonly code_verifier: string | null
|
|
710
710
|
readonly redirect_uri: string
|
|
711
711
|
readonly connection_run_id: string | null
|
|
712
712
|
readonly return_to: string | null
|
package/src/execution-storage.ts
CHANGED
|
@@ -3,8 +3,7 @@ import {
|
|
|
3
3
|
type ExecutionStorageRow,
|
|
4
4
|
executionRecordFromStorageRow,
|
|
5
5
|
executionRecordToStorageRow,
|
|
6
|
-
|
|
7
|
-
validateExecutionRecordReferences,
|
|
6
|
+
prepareExecutionRecord,
|
|
8
7
|
} from "@sixb/core/internal/execution-storage"
|
|
9
8
|
import type {
|
|
10
9
|
CreateExecutionInput,
|
|
@@ -23,8 +22,7 @@ export class SqliteExecutionStorage implements ExecutionStorage {
|
|
|
23
22
|
) {}
|
|
24
23
|
|
|
25
24
|
async create(input: CreateExecutionInput): Promise<ExecutionRecord> {
|
|
26
|
-
const record =
|
|
27
|
-
await validateExecutionRecordReferences(record, {
|
|
25
|
+
const record = await prepareExecutionRecord(input, {
|
|
28
26
|
auth: this.auth,
|
|
29
27
|
getExecution: (params) => this.getById(params),
|
|
30
28
|
getShareSession: (params) => this.shareSessions.getById(params),
|
|
@@ -44,6 +42,7 @@ export class SqliteExecutionStorage implements ExecutionStorage {
|
|
|
44
42
|
source_id,
|
|
45
43
|
requested_by_user_id,
|
|
46
44
|
requested_by_service_account_id,
|
|
45
|
+
requester_group_ids,
|
|
47
46
|
correlation_id,
|
|
48
47
|
parent_execution_id,
|
|
49
48
|
authority_kind,
|
|
@@ -58,7 +57,7 @@ export class SqliteExecutionStorage implements ExecutionStorage {
|
|
|
58
57
|
authority_delegation_id,
|
|
59
58
|
authority_delegation_session_id,
|
|
60
59
|
created_at
|
|
61
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
60
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
62
61
|
`
|
|
63
62
|
)
|
|
64
63
|
.run(
|
|
@@ -70,6 +69,7 @@ export class SqliteExecutionStorage implements ExecutionStorage {
|
|
|
70
69
|
row.sourceId,
|
|
71
70
|
row.requestedByUserId,
|
|
72
71
|
row.requestedByServiceAccountId,
|
|
72
|
+
JSON.stringify(row.requesterGroupIds),
|
|
73
73
|
row.correlationId,
|
|
74
74
|
row.parentExecutionId,
|
|
75
75
|
row.authorityKind,
|
|
@@ -127,6 +127,7 @@ function toStorageRow(row: SqliteExecutionRow): ExecutionStorageRow {
|
|
|
127
127
|
sourceId: row.source_id,
|
|
128
128
|
requestedByUserId: row.requested_by_user_id,
|
|
129
129
|
requestedByServiceAccountId: row.requested_by_service_account_id,
|
|
130
|
+
requesterGroupIds: JSON.parse(row.requester_group_ids),
|
|
130
131
|
correlationId: row.correlation_id,
|
|
131
132
|
parentExecutionId: row.parent_execution_id,
|
|
132
133
|
authorityKind: row.authority_kind,
|
|
@@ -160,6 +161,7 @@ interface SqliteExecutionRow {
|
|
|
160
161
|
readonly source_id: string
|
|
161
162
|
readonly requested_by_user_id: string | null
|
|
162
163
|
readonly requested_by_service_account_id: string | null
|
|
164
|
+
readonly requester_group_ids: string
|
|
163
165
|
readonly correlation_id: string
|
|
164
166
|
readonly parent_execution_id: string | null
|
|
165
167
|
readonly authority_kind: ExecutionStorageRow["authorityKind"]
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,10 @@ import type {
|
|
|
10
10
|
StorageTransactionOptions,
|
|
11
11
|
} from "@sixb/core"
|
|
12
12
|
import { ProviderMaterializationTransactionLifecycle } from "@sixb/core/internal/ontology-storage-provider"
|
|
13
|
+
import {
|
|
14
|
+
createTransactionStorageProxy,
|
|
15
|
+
throwNestedStorageTransaction,
|
|
16
|
+
} from "@sixb/core/internal/storage"
|
|
13
17
|
import {
|
|
14
18
|
createAgentOperationScope,
|
|
15
19
|
createAuthOperationScope,
|
|
@@ -23,11 +27,9 @@ import {
|
|
|
23
27
|
type AiCostStorage,
|
|
24
28
|
type AiLimitStorage,
|
|
25
29
|
type AiUsageStorage,
|
|
26
|
-
createTransactionStorageProxy,
|
|
27
30
|
type ShareGrantStorage,
|
|
28
31
|
type ShareSessionStorage,
|
|
29
32
|
StorageTransactionError,
|
|
30
|
-
throwNestedStorageTransaction,
|
|
31
33
|
} from "@sixb/core/storage"
|
|
32
34
|
import { SqliteActionRunStorage } from "./action-run-storage"
|
|
33
35
|
import { SqliteAgentStorage } from "./agents"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
ALTER TABLE executions ADD COLUMN requester_group_ids TEXT NOT NULL DEFAULT '[]';
|
|
2
|
+
|
|
3
|
+
-- Preserve each admitted snapshot, including an intentionally empty one. Executions without
|
|
4
|
+
-- their own historical snapshot inherit from their parent; historical roots remain unknown/empty.
|
|
5
|
+
WITH RECURSIVE attribution(project_id, id, groups) AS (
|
|
6
|
+
SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, '[]')
|
|
7
|
+
FROM executions e
|
|
8
|
+
LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
|
|
9
|
+
LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
|
|
10
|
+
WHERE e.parent_execution_id IS NULL
|
|
11
|
+
UNION ALL
|
|
12
|
+
SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, p.groups)
|
|
13
|
+
FROM executions e
|
|
14
|
+
JOIN attribution p ON p.project_id = e.project_id AND p.id = e.parent_execution_id
|
|
15
|
+
LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
|
|
16
|
+
LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
|
|
17
|
+
)
|
|
18
|
+
UPDATE executions SET requester_group_ids = (
|
|
19
|
+
SELECT groups FROM attribution
|
|
20
|
+
WHERE attribution.project_id = executions.project_id AND attribution.id = executions.id
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
ALTER TABLE workflow_runs DROP COLUMN requester_group_ids;
|
|
24
|
+
ALTER TABLE agent_runs DROP COLUMN requester_group_ids;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
ALTER TABLE ontology_sources ADD COLUMN base_materialization_id TEXT;
|
|
2
|
+
ALTER TABLE ontology_sources ADD COLUMN base_commit_id TEXT
|
|
3
|
+
CHECK ((base_materialization_id IS NULL) = (base_commit_id IS NULL));
|
|
4
|
+
|
|
5
|
+
CREATE TABLE ontology_source_roots (
|
|
6
|
+
project_id TEXT NOT NULL,
|
|
7
|
+
source_id TEXT NOT NULL,
|
|
8
|
+
materialization_id TEXT NOT NULL,
|
|
9
|
+
root_sort_key TEXT NOT NULL,
|
|
10
|
+
root_kind TEXT NOT NULL CHECK (root_kind IN ('object', 'link')),
|
|
11
|
+
root_key TEXT NOT NULL CHECK (json_valid(root_key)),
|
|
12
|
+
root TEXT NOT NULL CHECK (json_valid(root)),
|
|
13
|
+
staging_ordinal INTEGER NOT NULL CHECK (staging_ordinal >= 0),
|
|
14
|
+
deleted INTEGER NOT NULL DEFAULT 0 CHECK (deleted IN (0, 1)),
|
|
15
|
+
active INTEGER NOT NULL DEFAULT 0 CHECK (active IN (0, 1)),
|
|
16
|
+
retired_at TEXT,
|
|
17
|
+
PRIMARY KEY (project_id, source_id, materialization_id, root_sort_key),
|
|
18
|
+
UNIQUE (project_id, source_id, materialization_id, staging_ordinal),
|
|
19
|
+
FOREIGN KEY (project_id, source_id, materialization_id)
|
|
20
|
+
REFERENCES ontology_sources(project_id, source_id, materialization_id) ON DELETE RESTRICT,
|
|
21
|
+
CHECK (active = 0 OR (deleted = 0 AND retired_at IS NULL))
|
|
22
|
+
);
|
|
23
|
+
CREATE UNIQUE INDEX idx_ontology_source_roots_active
|
|
24
|
+
ON ontology_source_roots (project_id, source_id, root_sort_key) WHERE active = 1;
|
|
25
|
+
CREATE INDEX idx_ontology_source_roots_lookup
|
|
26
|
+
ON ontology_source_roots (project_id, root_sort_key, source_id) WHERE active = 1;
|
|
27
|
+
CREATE INDEX idx_ontology_source_roots_cleanup
|
|
28
|
+
ON ontology_source_roots (project_id, retired_at, source_id, materialization_id, root_sort_key)
|
|
29
|
+
WHERE active = 0 AND retired_at IS NOT NULL;
|
|
30
|
+
|
|
31
|
+
INSERT INTO ontology_source_roots (
|
|
32
|
+
project_id, source_id, materialization_id, root_sort_key, root_kind, root_key, root,
|
|
33
|
+
staging_ordinal, active, retired_at
|
|
34
|
+
)
|
|
35
|
+
SELECT DISTINCT rows.project_id, rows.source_id, rows.materialization_id,
|
|
36
|
+
rows.root_sort_key, rows.root_kind, rows.root_key, rows.root, rows.staging_ordinal,
|
|
37
|
+
sources.status = 'active', sources.terminal_at
|
|
38
|
+
FROM ontology_source_rows AS rows
|
|
39
|
+
JOIN ontology_sources AS sources USING (project_id, source_id, materialization_id);
|
|
40
|
+
|
|
41
|
+
ANALYZE ontology_source_roots;
|
|
42
|
+
|
|
43
|
+
ALTER TABLE projection_runs ADD COLUMN source_changes_read INTEGER
|
|
44
|
+
CHECK (source_changes_read IS NULL OR source_changes_read >= 0);
|