@sixb/sqlite 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.
- 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 +89 -64
- package/dist/index.js.map +14 -14
- package/dist/migrations.d.ts.map +1 -1
- package/dist/pipeline-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/execution-storage.ts +7 -5
- package/src/index.ts +4 -2
- package/src/migrations/037-execution-requester-groups.sql +24 -0
- package/src/migrations.ts +5 -0
- package/src/pipeline-run-storage.ts +2 -5
- package/src/sync-run-storage.ts +2 -5
- package/src/workflow-run-storage.ts +1 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-run-storage.d.ts","sourceRoot":"","sources":["../src/action-run-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action-run-storage.d.ts","sourceRoot":"","sources":["../src/action-run-storage.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAKV,eAAe,EACf,gBAAgB,EAEhB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,iCAAiC,EACjC,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACpB,MA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"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/agents/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/agents/runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAS1C,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,sCAAsC,EAC3C,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAA;AAY3B,qBAAa,mBAAoB,YAAW,aAAa;IAErD,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,EAAE,EAAE,QAAQ,EACZ,UAAU,EAAE,gBAAgB;IAGzC,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAgFvE,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAuGzE,KAAK,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC;IA+BzD,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IA0BvE,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAyB7D,yBAAyB,CAC7B,KAAK,EAAE,sCAAsC,GAC5C,OAAO,CAAC,cAAc,CAAC;IAsBpB,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAmE3D,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAQlF,QAAQ,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,MAAM,CAAA;QACjB,GAAG,EAAE,SAAS,MAAM,EAAE,CAAA;KACvB,GAAG,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC;IAuBhC,IAAI,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAsCnE,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,UAAU;CAcnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-cost-storage.d.ts","sourceRoot":"","sources":["../src/ai-cost-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-cost-storage.d.ts","sourceRoot":"","sources":["../src/ai-cost-storage.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAElB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAE1B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACpC,MAAM,oBAAoB,CAAA;AAI3B,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAEpF,0EAA0E;AAC1E,qBAAa,mBAAoB,YAAW,aAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,qBAAqB;IAExD,mBAAmB,CACvB,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,2BAA2B,CAAC;IAIjC,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBhE,mBAAmB,CACvB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC;IAuB9B,oBAAoB,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAiB1F,cAAc,CAClB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,+BAA+B,CAAC;IAkB3C,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,SAAS;CAMlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-usage-storage.d.ts","sourceRoot":"","sources":["../src/ai-usage-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai-usage-storage.d.ts","sourceRoot":"","sources":["../src/ai-usage-storage.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EAGnB,KAAK,qCAAqC,EAC1C,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACrC,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CAC5C;AAED,yDAAyD;AACzD,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;gBAEtC,OAAO,GAAE,2BAAgC;IAO/C,eAAe,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAoChF,kBAAkB,CACtB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,uBAAuB,CAAC;IAQ7B,qBAAqB,CACzB,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAgBnC,mBAAmB,CACvB,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC;IAS9C,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,YAAY;IA4DpB,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,WAAW;IAyCnB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,qBAAqB;CAU9B;AAkED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,GACZ,sBAAsB,CAAC,oBAAoB,CAAC,CAM9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-storage.d.ts","sourceRoot":"","sources":["../src/execution-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"execution-storage.d.ts","sourceRoot":"","sources":["../src/execution-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAO1C,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,qBAAa,sBAAuB,YAAW,gBAAgB;IAE3D,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,EAAE,EAAE,QAAQ,EACZ,IAAI,EAAE,iBAAiB,EACvB,aAAa,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IAGhE,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IA8E7D,OAAO,CAAC,MAAM,EAAE;QACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KACpB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;CAapC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uBAAuB,EACvB,OAAO,EACP,eAAe,EACf,yBAAyB,EAC1B,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uBAAuB,EACvB,OAAO,EACP,eAAe,EACf,yBAAyB,EAC1B,MAAM,YAAY,CAAA;AAenB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAI7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAO5D,OAAO,EAAE,qBAAqB,EAAyC,MAAM,oBAAoB,CAAA;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AASz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AoB,EAAE,gCAAgC,CAAA;IAC/D,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAA;IAE9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;IAClD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA+C;IAChF,OAAO,CAAC,eAAe,CAAmC;gBAE9C,OAAO,GAAE,oBAAyB;IAiExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B;;;;;OAKG;IACG,WAAW,CAAC,CAAC,EACjB,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EACpC,QAAQ,GAAE,yBAA8B,GACvC,OAAO,CAAC,CAAC,CAAC;IAqCb,KAAK,IAAI,IAAI;IAKb,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,4BAA4B;YAOtB,mBAAmB;CAclC;AAgED,OAAO,EAAE,oBAAoB,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
|
-
|
|
16
|
-
StorageTransactionError,
|
|
17
|
-
throwNestedStorageTransaction
|
|
19
|
+
StorageTransactionError
|
|
18
20
|
} from "@sixb/core/storage";
|
|
19
21
|
|
|
20
22
|
// src/action-run-storage.ts
|
|
@@ -24,12 +26,11 @@ import {
|
|
|
24
26
|
} from "@sixb/core/internal/action-run-storage";
|
|
25
27
|
import { assertActionRunExecution } from "@sixb/core/internal/action-run-storage-provider";
|
|
26
28
|
import {
|
|
27
|
-
ActionRunError,
|
|
28
29
|
actionRunPhaseRecordsEqual,
|
|
29
30
|
canRequeueActionRunAfterEnqueueFailure,
|
|
30
|
-
finishActionRunPhase
|
|
31
|
-
|
|
32
|
-
} from "@sixb/core/storage";
|
|
31
|
+
finishActionRunPhase
|
|
32
|
+
} from "@sixb/core/internal/storage";
|
|
33
|
+
import { ActionRunError, isTerminalActionRun } from "@sixb/core/storage";
|
|
33
34
|
|
|
34
35
|
// src/migrations.ts
|
|
35
36
|
import { Database } from "bun:sqlite";
|
|
@@ -3931,6 +3932,33 @@ DROP TABLE executions;
|
|
|
3931
3932
|
ALTER TABLE executions_v2 RENAME TO executions;
|
|
3932
3933
|
`;
|
|
3933
3934
|
|
|
3935
|
+
// src/migrations/037-execution-requester-groups.sql
|
|
3936
|
+
var _037_execution_requester_groups_default = `ALTER TABLE executions ADD COLUMN requester_group_ids TEXT NOT NULL DEFAULT '[]';
|
|
3937
|
+
|
|
3938
|
+
-- Preserve each admitted snapshot, including an intentionally empty one. Executions without
|
|
3939
|
+
-- their own historical snapshot inherit from their parent; historical roots remain unknown/empty.
|
|
3940
|
+
WITH RECURSIVE attribution(project_id, id, groups) AS (
|
|
3941
|
+
SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, '[]')
|
|
3942
|
+
FROM executions e
|
|
3943
|
+
LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
|
|
3944
|
+
LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
|
|
3945
|
+
WHERE e.parent_execution_id IS NULL
|
|
3946
|
+
UNION ALL
|
|
3947
|
+
SELECT e.project_id, e.id, COALESCE(w.requester_group_ids, a.requester_group_ids, p.groups)
|
|
3948
|
+
FROM executions e
|
|
3949
|
+
JOIN attribution p ON p.project_id = e.project_id AND p.id = e.parent_execution_id
|
|
3950
|
+
LEFT JOIN workflow_runs w ON w.project_id = e.project_id AND w.execution_id = e.id
|
|
3951
|
+
LEFT JOIN agent_runs a ON a.project_id = e.project_id AND a.execution_id = e.id
|
|
3952
|
+
)
|
|
3953
|
+
UPDATE executions SET requester_group_ids = (
|
|
3954
|
+
SELECT groups FROM attribution
|
|
3955
|
+
WHERE attribution.project_id = executions.project_id AND attribution.id = executions.id
|
|
3956
|
+
);
|
|
3957
|
+
|
|
3958
|
+
ALTER TABLE workflow_runs DROP COLUMN requester_group_ids;
|
|
3959
|
+
ALTER TABLE agent_runs DROP COLUMN requester_group_ids;
|
|
3960
|
+
`;
|
|
3961
|
+
|
|
3934
3962
|
// src/migrations.ts
|
|
3935
3963
|
var MIGRATIONS_TABLE_SQL = `
|
|
3936
3964
|
CREATE TABLE IF NOT EXISTS sixb_migrations (
|
|
@@ -4001,7 +4029,8 @@ var sqliteStorageMigrations = defineMigrations({
|
|
|
4001
4029
|
sqliteSql("033-retire-agent-definitions", _033_retire_agent_definitions_default),
|
|
4002
4030
|
sqliteSql("034-device-authorizations", _034_device_authorizations_default),
|
|
4003
4031
|
sqliteSql("035-share-grants", _035_share_grants_default),
|
|
4004
|
-
sqliteSql("036-share-sessions", _036_share_sessions_default)
|
|
4032
|
+
sqliteSql("036-share-sessions", _036_share_sessions_default),
|
|
4033
|
+
sqliteSql("037-execution-requester-groups", _037_execution_requester_groups_default)
|
|
4005
4034
|
]
|
|
4006
4035
|
});
|
|
4007
4036
|
function sqliteStoragePath(basePath) {
|
|
@@ -4710,7 +4739,6 @@ function rowToRunRecord(row) {
|
|
|
4710
4739
|
id: row.id,
|
|
4711
4740
|
projectId: row.project_id,
|
|
4712
4741
|
executionId: row.execution_id,
|
|
4713
|
-
requesterGroupIds: JSON.parse(row.requester_group_ids),
|
|
4714
4742
|
status: row.status,
|
|
4715
4743
|
modelId: row.model_id ?? undefined,
|
|
4716
4744
|
finishReason: coerceAgentRunFinishReason(row.finish_reason),
|
|
@@ -5056,7 +5084,6 @@ import {
|
|
|
5056
5084
|
assertSubagentRunResult,
|
|
5057
5085
|
subagentRunMatchesCreateInput
|
|
5058
5086
|
} from "@sixb/core/internal/agent-run-storage-provider";
|
|
5059
|
-
import { normalizeRequesterGroupIds } from "@sixb/core/internal/auth";
|
|
5060
5087
|
import { serializeSixbFailure } from "@sixb/core/internal/errors";
|
|
5061
5088
|
import {
|
|
5062
5089
|
AGENT_RUN_FAILURE_CODES as AGENT_RUN_FAILURE_CODES2,
|
|
@@ -5151,12 +5178,11 @@ class SqliteAgentRunStore {
|
|
|
5151
5178
|
thread_id,
|
|
5152
5179
|
trigger_message_id,
|
|
5153
5180
|
spec,
|
|
5154
|
-
requester_group_ids,
|
|
5155
5181
|
status,
|
|
5156
5182
|
attempt,
|
|
5157
5183
|
created_at
|
|
5158
|
-
) VALUES (?, ?, ?, 'conversation', ?, ?, ?,
|
|
5159
|
-
`).run(input.projectId, input.id, input.executionId, input.threadId, input.triggerMessageId, JSON.stringify(input.spec),
|
|
5184
|
+
) VALUES (?, ?, ?, 'conversation', ?, ?, ?, 'queued', 0, ?)
|
|
5185
|
+
`).run(input.projectId, input.id, input.executionId, input.threadId, input.triggerMessageId, JSON.stringify(input.spec), createdAt.toISOString());
|
|
5160
5186
|
} catch (error) {
|
|
5161
5187
|
if (isUniqueConstraintError2(error)) {
|
|
5162
5188
|
throw new AgentStorageError3("duplicate_id", `[SixbSqlite] Agent run '${input.id}' already exists for project '${input.projectId}'.`);
|
|
@@ -5209,9 +5235,9 @@ class SqliteAgentRunStore {
|
|
|
5209
5235
|
this.db.query(`
|
|
5210
5236
|
INSERT INTO agent_runs (
|
|
5211
5237
|
project_id, id, execution_id, kind, parent_run_id, spawn_key, spec,
|
|
5212
|
-
|
|
5213
|
-
) VALUES (?, ?, ?, 'subagent', ?, ?, ?,
|
|
5214
|
-
`).run(input.projectId, input.id, input.executionId, input.parentRunId, input.spawnKey, JSON.stringify(input.spec),
|
|
5238
|
+
status, attempt, created_at
|
|
5239
|
+
) VALUES (?, ?, ?, 'subagent', ?, ?, ?, 'queued', 0, ?)
|
|
5240
|
+
`).run(input.projectId, input.id, input.executionId, input.parentRunId, input.spawnKey, JSON.stringify(input.spec), (input.createdAt ?? new Date).toISOString());
|
|
5215
5241
|
} catch (error) {
|
|
5216
5242
|
if (isUniqueConstraintError2(error)) {
|
|
5217
5243
|
throw new AgentStorageError3("duplicate_id", `[SixbSqlite] Subagent run '${input.id}' conflicts with an existing durable spawn.`);
|
|
@@ -5499,6 +5525,7 @@ import {
|
|
|
5499
5525
|
aiModelCallCostDetails,
|
|
5500
5526
|
aiModelCallCostMatchesUsage,
|
|
5501
5527
|
buildAiAccountingOverviewFromFragments,
|
|
5528
|
+
directModelCallAttribution,
|
|
5502
5529
|
normalizeAiAccountingQuery,
|
|
5503
5530
|
normalizeAiModelCallAccountingQuery as normalizeAiModelCallAccountingQuery2,
|
|
5504
5531
|
normalizeAiModelCallCostRecord,
|
|
@@ -5539,6 +5566,7 @@ WITH filtered AS (
|
|
|
5539
5566
|
SELECT COALESCE(root_agent.execution_id, usage.execution_id) AS root_execution_id,
|
|
5540
5567
|
usage.execution_id, usage.provider_id, usage.requested_model_id, usage.occurred_at,
|
|
5541
5568
|
usage.total_tokens,
|
|
5569
|
+
execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
|
|
5542
5570
|
COALESCE(cost.status, 'unvalued') AS valuation_status,
|
|
5543
5571
|
cost.currency AS amount_currency, cost.amount_nanos,
|
|
5544
5572
|
root_agent.id AS root_agent_run_id,
|
|
@@ -5551,6 +5579,7 @@ WITH filtered AS (
|
|
|
5551
5579
|
workflow_node.workflow_id AS workflow_id,
|
|
5552
5580
|
workflow_node.workflow_run_id AS workflow_run_id
|
|
5553
5581
|
FROM ai_model_call_usage AS usage
|
|
5582
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
5554
5583
|
LEFT JOIN agent_runs AS direct_agent
|
|
5555
5584
|
ON direct_agent.project_id = usage.project_id AND direct_agent.execution_id = usage.execution_id
|
|
5556
5585
|
LEFT JOIN agent_runs AS root_agent
|
|
@@ -5588,6 +5617,7 @@ SELECT filtered.root_execution_id, execution_id, provider_id, requested_model_id
|
|
|
5588
5617
|
CAST(SUM((amount_nanos / 1000000) % 1000000) AS TEXT) AS amount_middle,
|
|
5589
5618
|
CAST(SUM(amount_nanos % 1000000) AS TEXT) AS amount_low,
|
|
5590
5619
|
MAX(root_agent_run_id) AS root_agent_run_id,
|
|
5620
|
+
MAX(executor_kind) AS executor_kind, MAX(executor_id) AS executor_id, MAX(primitive_id) AS primitive_id,
|
|
5591
5621
|
MAX(root_thread_id) AS root_thread_id,
|
|
5592
5622
|
MAX(direct_kind) AS direct_kind,
|
|
5593
5623
|
MAX(direct_run_id) AS direct_run_id,
|
|
@@ -5602,12 +5632,11 @@ GROUP BY filtered.root_execution_id, execution_id, provider_id, requested_model_
|
|
|
5602
5632
|
`;
|
|
5603
5633
|
|
|
5604
5634
|
// src/ai-usage-storage.ts
|
|
5635
|
+
import { assertAiUsageExecutionId, normalizeAiModelCallRecord } from "@sixb/core/internal/storage";
|
|
5605
5636
|
import { isModelReasoning, normalizeModelProviderIds } from "@sixb/core/models";
|
|
5606
5637
|
import {
|
|
5607
5638
|
AiUsageStorageError,
|
|
5608
|
-
aggregateAiModelCallUsage
|
|
5609
|
-
assertAiUsageExecutionId,
|
|
5610
|
-
normalizeAiModelCallRecord
|
|
5639
|
+
aggregateAiModelCallUsage
|
|
5611
5640
|
} from "@sixb/core/storage";
|
|
5612
5641
|
class SqliteAiUsageStorage {
|
|
5613
5642
|
connection;
|
|
@@ -5930,6 +5959,7 @@ var SQLITE_ACCOUNTING_LIST_PAGE_SQL = `
|
|
|
5930
5959
|
workflow_agent.node_run_id AS attribution_node_run_id,
|
|
5931
5960
|
workflow_node.workflow_id AS attribution_workflow_id,
|
|
5932
5961
|
workflow_node.workflow_run_id AS attribution_workflow_run_id,
|
|
5962
|
+
execution.executor_kind, execution.executor_id, execution.authority_primitive_id AS primitive_id,
|
|
5933
5963
|
COALESCE((
|
|
5934
5964
|
SELECT json_group_array(group_id) FROM (
|
|
5935
5965
|
SELECT group_id FROM ai_model_call_usage_groups
|
|
@@ -5946,6 +5976,7 @@ var SQLITE_ACCOUNTING_LIST_PAGE_SQL = `
|
|
|
5946
5976
|
cost.details AS cost_details,
|
|
5947
5977
|
cost.rated_at AS cost_rated_at
|
|
5948
5978
|
FROM ai_model_call_usage AS usage
|
|
5979
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
5949
5980
|
LEFT JOIN agent_runs AS direct_agent
|
|
5950
5981
|
ON direct_agent.project_id = usage.project_id
|
|
5951
5982
|
AND direct_agent.execution_id = usage.execution_id
|
|
@@ -5980,7 +6011,9 @@ var SQLITE_ACCOUNTING_OVERVIEW_SQL = `
|
|
|
5980
6011
|
ELSE NULL
|
|
5981
6012
|
END AS attribution_agent_kind,
|
|
5982
6013
|
workflow_node.node_id AS attribution_agent_step_id,
|
|
5983
|
-
workflow_node.workflow_id
|
|
6014
|
+
COALESCE(workflow_node.workflow_id,
|
|
6015
|
+
CASE WHEN execution.executor_kind = 'workflow' THEN execution.authority_primitive_id END
|
|
6016
|
+
) AS attribution_workflow_id,
|
|
5984
6017
|
CASE
|
|
5985
6018
|
WHEN cost.status = 'rated' THEN 'rated'
|
|
5986
6019
|
WHEN cost.status = 'unpriceable' THEN 'unpriceable'
|
|
@@ -5989,6 +6022,7 @@ var SQLITE_ACCOUNTING_OVERVIEW_SQL = `
|
|
|
5989
6022
|
CASE WHEN cost.status = 'rated' THEN cost.currency ELSE NULL END AS amount_currency,
|
|
5990
6023
|
CASE WHEN cost.status = 'rated' THEN cost.amount_nanos ELSE NULL END AS amount_nanos
|
|
5991
6024
|
FROM ai_model_call_usage AS usage
|
|
6025
|
+
JOIN executions AS execution ON execution.project_id = usage.project_id AND execution.id = usage.execution_id
|
|
5992
6026
|
LEFT JOIN agent_runs AS direct_agent
|
|
5993
6027
|
ON direct_agent.project_id = usage.project_id
|
|
5994
6028
|
AND direct_agent.execution_id = usage.execution_id
|
|
@@ -6120,7 +6154,7 @@ function sqliteAggregateAmount(row) {
|
|
|
6120
6154
|
function accountingItemFromRow(row) {
|
|
6121
6155
|
const usage = usageFromRow2(row, parseStringArray(row.requester_group_ids));
|
|
6122
6156
|
const cost = row.cost_status === null ? undefined : costFromJoinedRow(row);
|
|
6123
|
-
const attribution = row.attribution_kind === null ?
|
|
6157
|
+
const attribution = row.attribution_kind === null ? directModelCallAttribution(row.executor_kind, row.executor_id, row.primitive_id) : row.attribution_kind === "agent" ? {
|
|
6124
6158
|
kind: "agent",
|
|
6125
6159
|
agentRunId: required(row.attribution_agent_run_id),
|
|
6126
6160
|
threadId: required(row.attribution_thread_id)
|
|
@@ -7532,8 +7566,8 @@ class SqliteAuthAccessTokenStore {
|
|
|
7532
7566
|
}
|
|
7533
7567
|
function assertSubjectExists(db, projectId, subjectType, subjectId) {
|
|
7534
7568
|
if (subjectType === "user") {
|
|
7535
|
-
const
|
|
7536
|
-
if (
|
|
7569
|
+
const row = db.query("SELECT * FROM auth_users WHERE project_id = ? AND id = ?").get(projectId, subjectId);
|
|
7570
|
+
if (row)
|
|
7537
7571
|
return;
|
|
7538
7572
|
throw new AuthStorageError2("missing_user", `[Sixb] User '${subjectId}' not found for project '${projectId}'.`);
|
|
7539
7573
|
}
|
|
@@ -8664,7 +8698,7 @@ class SqliteAuthStorage {
|
|
|
8664
8698
|
}
|
|
8665
8699
|
this.consumeOidcAttempt(input, completedAt, projectId);
|
|
8666
8700
|
if (!userRow) {
|
|
8667
|
-
const
|
|
8701
|
+
const user = this.insertUser({
|
|
8668
8702
|
id: newUserId ?? assertNonEmpty(input.newUserId, "User id"),
|
|
8669
8703
|
projectId,
|
|
8670
8704
|
email,
|
|
@@ -8673,14 +8707,14 @@ class SqliteAuthStorage {
|
|
|
8673
8707
|
createdAt: completedAt
|
|
8674
8708
|
});
|
|
8675
8709
|
userRow = {
|
|
8676
|
-
project_id:
|
|
8677
|
-
id:
|
|
8678
|
-
email:
|
|
8679
|
-
display_name:
|
|
8680
|
-
avatar_url:
|
|
8681
|
-
status:
|
|
8682
|
-
created_at: toIso(
|
|
8683
|
-
updated_at: toIso(
|
|
8710
|
+
project_id: user.projectId,
|
|
8711
|
+
id: user.id,
|
|
8712
|
+
email: user.email,
|
|
8713
|
+
display_name: user.displayName ?? null,
|
|
8714
|
+
avatar_url: user.avatarUrl ?? null,
|
|
8715
|
+
status: user.status,
|
|
8716
|
+
created_at: toIso(user.createdAt),
|
|
8717
|
+
updated_at: toIso(user.updatedAt)
|
|
8684
8718
|
};
|
|
8685
8719
|
}
|
|
8686
8720
|
const user = rowToUserRecord(userRow);
|
|
@@ -9398,8 +9432,7 @@ function assertChanged(changes, label, id) {
|
|
|
9398
9432
|
import {
|
|
9399
9433
|
executionRecordFromStorageRow,
|
|
9400
9434
|
executionRecordToStorageRow,
|
|
9401
|
-
|
|
9402
|
-
validateExecutionRecordReferences
|
|
9435
|
+
prepareExecutionRecord
|
|
9403
9436
|
} from "@sixb/core/internal/execution-storage";
|
|
9404
9437
|
import { ExecutionStorageError } from "@sixb/core/storage";
|
|
9405
9438
|
|
|
@@ -9413,8 +9446,7 @@ class SqliteExecutionStorage {
|
|
|
9413
9446
|
this.shareSessions = shareSessions;
|
|
9414
9447
|
}
|
|
9415
9448
|
async create(input) {
|
|
9416
|
-
const record =
|
|
9417
|
-
await validateExecutionRecordReferences(record, {
|
|
9449
|
+
const record = await prepareExecutionRecord(input, {
|
|
9418
9450
|
auth: this.auth,
|
|
9419
9451
|
getExecution: (params) => this.getById(params),
|
|
9420
9452
|
getShareSession: (params) => this.shareSessions.getById(params)
|
|
@@ -9431,6 +9463,7 @@ class SqliteExecutionStorage {
|
|
|
9431
9463
|
source_id,
|
|
9432
9464
|
requested_by_user_id,
|
|
9433
9465
|
requested_by_service_account_id,
|
|
9466
|
+
requester_group_ids,
|
|
9434
9467
|
correlation_id,
|
|
9435
9468
|
parent_execution_id,
|
|
9436
9469
|
authority_kind,
|
|
@@ -9445,8 +9478,8 @@ class SqliteExecutionStorage {
|
|
|
9445
9478
|
authority_delegation_id,
|
|
9446
9479
|
authority_delegation_session_id,
|
|
9447
9480
|
created_at
|
|
9448
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
9449
|
-
`).run(row.projectId, row.id, row.executorKind, row.executorId, row.sourceKind, row.sourceId, row.requestedByUserId, row.requestedByServiceAccountId, row.correlationId, row.parentExecutionId, row.authorityKind, row.authorityUserId, row.authorityServiceAccountId, row.authoritySessionId, row.authorityAccessTokenId, row.authorityPrimitiveKind, row.authorityPrimitiveId, row.authorityKernelOperation, row.authorityDelegationKind, row.authorityDelegationId, row.authorityDelegationSessionId, row.createdAt.toISOString());
|
|
9481
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
9482
|
+
`).run(row.projectId, row.id, row.executorKind, row.executorId, row.sourceKind, row.sourceId, row.requestedByUserId, row.requestedByServiceAccountId, JSON.stringify(row.requesterGroupIds), row.correlationId, row.parentExecutionId, row.authorityKind, row.authorityUserId, row.authorityServiceAccountId, row.authoritySessionId, row.authorityAccessTokenId, row.authorityPrimitiveKind, row.authorityPrimitiveId, row.authorityKernelOperation, row.authorityDelegationKind, row.authorityDelegationId, row.authorityDelegationSessionId, row.createdAt.toISOString());
|
|
9450
9483
|
} catch (error) {
|
|
9451
9484
|
if (isDuplicateExecutionError(error)) {
|
|
9452
9485
|
throw new ExecutionStorageError("duplicate_execution", `[SixbSqlite] Execution '${record.id}' already exists in project '${record.projectId}'.`, { cause: error });
|
|
@@ -9474,6 +9507,7 @@ function toStorageRow(row) {
|
|
|
9474
9507
|
sourceId: row.source_id,
|
|
9475
9508
|
requestedByUserId: row.requested_by_user_id,
|
|
9476
9509
|
requestedByServiceAccountId: row.requested_by_service_account_id,
|
|
9510
|
+
requesterGroupIds: JSON.parse(row.requester_group_ids),
|
|
9477
9511
|
correlationId: row.correlation_id,
|
|
9478
9512
|
parentExecutionId: row.parent_execution_id,
|
|
9479
9513
|
authorityKind: row.authority_kind,
|
|
@@ -9901,18 +9935,18 @@ function compileExpansionOrder(expansion, target, neighborType, neighborId) {
|
|
|
9901
9935
|
}
|
|
9902
9936
|
function compileSet(projectId, op, inputs, ctx) {
|
|
9903
9937
|
if (inputs.length === 0) {
|
|
9904
|
-
const
|
|
9938
|
+
const order = compileOrder(identityOrderFields());
|
|
9905
9939
|
return {
|
|
9906
9940
|
sql: `
|
|
9907
9941
|
SELECT *
|
|
9908
9942
|
FROM ${ctx.source.objectsTable}
|
|
9909
9943
|
WHERE 1 = 0
|
|
9910
|
-
ORDER BY ${
|
|
9944
|
+
ORDER BY ${order.sql}
|
|
9911
9945
|
`,
|
|
9912
|
-
args:
|
|
9946
|
+
args: order.args,
|
|
9913
9947
|
totalSql: "SELECT 0 as total",
|
|
9914
9948
|
totalArgs: [],
|
|
9915
|
-
order
|
|
9949
|
+
order,
|
|
9916
9950
|
hasMore: () => false,
|
|
9917
9951
|
trimRows: identityRows,
|
|
9918
9952
|
nextPageToken: () => {
|
|
@@ -11871,13 +11905,13 @@ class SqliteMaterializationStateReader {
|
|
|
11871
11905
|
ORDER BY requested.scope_sort_key, ${linkSortExpression("links")}
|
|
11872
11906
|
`).iterate(requestedJson, this.projectId);
|
|
11873
11907
|
for (const row of rows) {
|
|
11874
|
-
const
|
|
11875
|
-
if (!
|
|
11908
|
+
const accumulator = accumulators.get(row.scope_sort_key);
|
|
11909
|
+
if (!accumulator) {
|
|
11876
11910
|
throw new MaterializationConflictError2("effective-state", `Unexpected link scope '${row.scope_sort_key}' returned by storage.`);
|
|
11877
11911
|
}
|
|
11878
11912
|
const snapshot = effectiveLinkSnapshot(row);
|
|
11879
|
-
appendScopeSnapshot(
|
|
11880
|
-
effective.set(row.scope_sort_key,
|
|
11913
|
+
appendScopeSnapshot(accumulator, snapshot);
|
|
11914
|
+
effective.set(row.scope_sort_key, accumulator.effectiveCount === 1 ? snapshot : null);
|
|
11881
11915
|
}
|
|
11882
11916
|
return {
|
|
11883
11917
|
revisions: scopes.map(({ source, linkId }) => finishScopeAccumulator(accumulators.get(linkScopeSortKey(source, linkId)))),
|
|
@@ -13889,11 +13923,8 @@ class SqliteOntologyStorage {
|
|
|
13889
13923
|
// src/pipeline-run-storage.ts
|
|
13890
13924
|
import { parseSixbFailure as parseSixbFailure3, serializeSixbFailure as serializeSixbFailure3 } from "@sixb/core/internal/errors";
|
|
13891
13925
|
import { assertPipelineRunExecution } from "@sixb/core/internal/pipeline-run-storage-provider";
|
|
13892
|
-
import {
|
|
13893
|
-
|
|
13894
|
-
PIPELINE_RUN_FAILURE_CODES,
|
|
13895
|
-
PipelineRunError
|
|
13896
|
-
} from "@sixb/core/storage";
|
|
13926
|
+
import { canRequeuePipelineRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
|
|
13927
|
+
import { PIPELINE_RUN_FAILURE_CODES, PipelineRunError } from "@sixb/core/storage";
|
|
13897
13928
|
|
|
13898
13929
|
// src/latest-run-query.ts
|
|
13899
13930
|
function queryLatestRunsByOwnerId(input) {
|
|
@@ -15175,12 +15206,9 @@ function invalidRecord2(message) {
|
|
|
15175
15206
|
|
|
15176
15207
|
// src/sync-run-storage.ts
|
|
15177
15208
|
import { parseSixbFailure as parseSixbFailure4, serializeSixbFailure as serializeSixbFailure5 } from "@sixb/core/internal/errors";
|
|
15209
|
+
import { canRequeueSyncRunAfterEnqueueFailure } from "@sixb/core/internal/storage";
|
|
15178
15210
|
import { assertSyncRunExecution } from "@sixb/core/internal/sync-run-storage-provider";
|
|
15179
|
-
import {
|
|
15180
|
-
canRequeueSyncRunAfterEnqueueFailure,
|
|
15181
|
-
SYNC_RUN_FAILURE_CODES,
|
|
15182
|
-
SyncRunError
|
|
15183
|
-
} from "@sixb/core/storage";
|
|
15211
|
+
import { SYNC_RUN_FAILURE_CODES, SyncRunError } from "@sixb/core/storage";
|
|
15184
15212
|
class SqliteSyncRunStorage {
|
|
15185
15213
|
connection;
|
|
15186
15214
|
db;
|
|
@@ -15896,7 +15924,6 @@ function assertNonNegativeInteger(value, fieldName) {
|
|
|
15896
15924
|
}
|
|
15897
15925
|
|
|
15898
15926
|
// src/workflow-run-storage.ts
|
|
15899
|
-
import { normalizeRequesterGroupIds as normalizeRequesterGroupIds2 } from "@sixb/core/internal/auth";
|
|
15900
15927
|
import { parseSixbFailure as parseSixbFailure6, serializeSixbFailure as serializeSixbFailure7 } from "@sixb/core/internal/errors";
|
|
15901
15928
|
import {
|
|
15902
15929
|
assertWorkflowAgentNodeRunExecution,
|
|
@@ -15943,10 +15970,9 @@ class SqliteWorkflowRunStorage {
|
|
|
15943
15970
|
input,
|
|
15944
15971
|
queued_at,
|
|
15945
15972
|
started_at,
|
|
15946
|
-
requester_group_ids,
|
|
15947
15973
|
attempt
|
|
15948
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
|
|
15949
|
-
`).run(input.projectId, input.id, input.executionId, input.workflowId, "queued", serializeRecord2(input.input), queuedAt.toISOString(), queuedAt.toISOString(),
|
|
15974
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
15975
|
+
`).run(input.projectId, input.id, input.executionId, input.workflowId, "queued", serializeRecord2(input.input), queuedAt.toISOString(), queuedAt.toISOString(), 0);
|
|
15950
15976
|
} catch (error) {
|
|
15951
15977
|
if (isUniqueConstraintError2(error)) {
|
|
15952
15978
|
throw new WorkflowRunError(`[SixbSqlite] Workflow run '${input.id}' or execution '${input.executionId}' is already linked for project '${input.projectId}'.`);
|
|
@@ -16457,7 +16483,6 @@ function rowToWorkflowRunRecord(row) {
|
|
|
16457
16483
|
startedAt: new Date(row.started_at),
|
|
16458
16484
|
finishedAt: row.finished_at ? new Date(row.finished_at) : undefined,
|
|
16459
16485
|
error: row.error === null ? undefined : parseSixbFailure6(row.error, WORKFLOW_RUN_FAILURE_CODES),
|
|
16460
|
-
requesterGroupIds: JSON.parse(row.requester_group_ids),
|
|
16461
16486
|
attempt: row.attempt,
|
|
16462
16487
|
...row.execution_token && row.execution_queue_lease_expires_at ? {
|
|
16463
16488
|
execution: {
|
|
@@ -16729,8 +16754,8 @@ function createSqliteStores(connection, options) {
|
|
|
16729
16754
|
};
|
|
16730
16755
|
}
|
|
16731
16756
|
export {
|
|
16732
|
-
|
|
16733
|
-
|
|
16757
|
+
SqliteStorage,
|
|
16758
|
+
migrateSqliteStorage
|
|
16734
16759
|
};
|
|
16735
16760
|
|
|
16736
|
-
//# debugId=
|
|
16761
|
+
//# debugId=8848EEC97F2007FB64756E2164756E21
|