@sixb/sqlite 0.0.1
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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/action-run-storage.d.ts +29 -0
- package/dist/action-run-storage.d.ts.map +1 -0
- package/dist/agents/agent-storage.d.ts +25 -0
- package/dist/agents/agent-storage.d.ts.map +1 -0
- package/dist/agents/index.d.ts +6 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/messages.d.ts +14 -0
- package/dist/agents/messages.d.ts.map +1 -0
- package/dist/agents/rows.d.ts +77 -0
- package/dist/agents/rows.d.ts.map +1 -0
- package/dist/agents/runs.d.ts +26 -0
- package/dist/agents/runs.d.ts.map +1 -0
- package/dist/agents/threads.d.ts +14 -0
- package/dist/agents/threads.d.ts.map +1 -0
- package/dist/auth-storage/access-tokens.d.ts +33 -0
- package/dist/auth-storage/access-tokens.d.ts.map +1 -0
- package/dist/auth-storage/auth-storage.d.ts +46 -0
- package/dist/auth-storage/auth-storage.d.ts.map +1 -0
- package/dist/auth-storage/group-memberships.d.ts +21 -0
- package/dist/auth-storage/group-memberships.d.ts.map +1 -0
- package/dist/auth-storage/identities.d.ts +17 -0
- package/dist/auth-storage/identities.d.ts.map +1 -0
- package/dist/auth-storage/index.d.ts +3 -0
- package/dist/auth-storage/index.d.ts.map +1 -0
- package/dist/auth-storage/invitations.d.ts +28 -0
- package/dist/auth-storage/invitations.d.ts.map +1 -0
- package/dist/auth-storage/magic-links.d.ts +28 -0
- package/dist/auth-storage/magic-links.d.ts.map +1 -0
- package/dist/auth-storage/oidc-attempts.d.ts +18 -0
- package/dist/auth-storage/oidc-attempts.d.ts.map +1 -0
- package/dist/auth-storage/rows.d.ts +134 -0
- package/dist/auth-storage/rows.d.ts.map +1 -0
- package/dist/auth-storage/service-account-group-memberships.d.ts +17 -0
- package/dist/auth-storage/service-account-group-memberships.d.ts.map +1 -0
- package/dist/auth-storage/service-accounts.d.ts +14 -0
- package/dist/auth-storage/service-accounts.d.ts.map +1 -0
- package/dist/auth-storage/sessions.d.ts +55 -0
- package/dist/auth-storage/sessions.d.ts.map +1 -0
- package/dist/auth-storage/shared.d.ts +131 -0
- package/dist/auth-storage/shared.d.ts.map +1 -0
- package/dist/auth-storage/users.d.ts +19 -0
- package/dist/auth-storage/users.d.ts.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10204 -0
- package/dist/index.js.map +54 -0
- package/dist/latest-run-query.d.ts +22 -0
- package/dist/latest-run-query.d.ts.map +1 -0
- package/dist/migrations.d.ts +18 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/object-query-compiler.d.ts +44 -0
- package/dist/object-query-compiler.d.ts.map +1 -0
- package/dist/object-storage.d.ts +93 -0
- package/dist/object-storage.d.ts.map +1 -0
- package/dist/ontology-storage/commits.d.ts +14 -0
- package/dist/ontology-storage/commits.d.ts.map +1 -0
- package/dist/ontology-storage/index.d.ts +22 -0
- package/dist/ontology-storage/index.d.ts.map +1 -0
- package/dist/ontology-storage/materialization-session.d.ts +49 -0
- package/dist/ontology-storage/materialization-session.d.ts.map +1 -0
- package/dist/ontology-storage/materialization-state.d.ts +63 -0
- package/dist/ontology-storage/materialization-state.d.ts.map +1 -0
- package/dist/ontology-storage/materialization-writer.d.ts +15 -0
- package/dist/ontology-storage/materialization-writer.d.ts.map +1 -0
- package/dist/ontology-storage/materializations.d.ts +32 -0
- package/dist/ontology-storage/materializations.d.ts.map +1 -0
- package/dist/ontology-storage/outbox.d.ts +14 -0
- package/dist/ontology-storage/outbox.d.ts.map +1 -0
- package/dist/ontology-storage/shared.d.ts +91 -0
- package/dist/ontology-storage/shared.d.ts.map +1 -0
- package/dist/ontology-storage/sources.d.ts +26 -0
- package/dist/ontology-storage/sources.d.ts.map +1 -0
- package/dist/pipeline-run-storage.d.ts +26 -0
- package/dist/pipeline-run-storage.d.ts.map +1 -0
- package/dist/projection-run-storage.d.ts +32 -0
- package/dist/projection-run-storage.d.ts.map +1 -0
- package/dist/rules-storage.d.ts +33 -0
- package/dist/rules-storage.d.ts.map +1 -0
- package/dist/run-list-query.d.ts +27 -0
- package/dist/run-list-query.d.ts.map +1 -0
- package/dist/storage-errors.d.ts +2 -0
- package/dist/storage-errors.d.ts.map +1 -0
- package/dist/sync-run-storage.d.ts +23 -0
- package/dist/sync-run-storage.d.ts.map +1 -0
- package/dist/timeseries-storage.d.ts +41 -0
- package/dist/timeseries-storage.d.ts.map +1 -0
- package/dist/transactions.d.ts +15 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/tsconfig.json +5 -0
- package/dist/validation.d.ts +5 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/webhook-delivery-storage.d.ts +27 -0
- package/dist/webhook-delivery-storage.d.ts.map +1 -0
- package/dist/webhook-run-storage.d.ts +22 -0
- package/dist/webhook-run-storage.d.ts.map +1 -0
- package/dist/workflow-intervention-storage.d.ts +26 -0
- package/dist/workflow-intervention-storage.d.ts.map +1 -0
- package/dist/workflow-run-storage.d.ts +63 -0
- package/dist/workflow-run-storage.d.ts.map +1 -0
- package/package.json +58 -0
- package/src/action-run-storage.ts +761 -0
- package/src/agents/agent-storage.ts +46 -0
- package/src/agents/index.ts +5 -0
- package/src/agents/messages.ts +162 -0
- package/src/agents/rows.ts +205 -0
- package/src/agents/runs.ts +389 -0
- package/src/agents/threads.ts +133 -0
- package/src/auth-storage/access-tokens.ts +289 -0
- package/src/auth-storage/auth-storage.ts +784 -0
- package/src/auth-storage/group-memberships.ts +52 -0
- package/src/auth-storage/identities.ts +98 -0
- package/src/auth-storage/index.ts +2 -0
- package/src/auth-storage/invitations.ts +258 -0
- package/src/auth-storage/magic-links.ts +149 -0
- package/src/auth-storage/oidc-attempts.ts +109 -0
- package/src/auth-storage/rows.ts +338 -0
- package/src/auth-storage/service-account-group-memberships.ts +161 -0
- package/src/auth-storage/service-accounts.ts +168 -0
- package/src/auth-storage/sessions.ts +230 -0
- package/src/auth-storage/shared.ts +707 -0
- package/src/auth-storage/users.ts +226 -0
- package/src/index.ts +292 -0
- package/src/latest-run-query.ts +49 -0
- package/src/migrations/001-initial-schema.sql +1068 -0
- package/src/migrations.ts +245 -0
- package/src/object-query-compiler.ts +1198 -0
- package/src/object-storage.ts +605 -0
- package/src/ontology-storage/commits.ts +127 -0
- package/src/ontology-storage/index.ts +35 -0
- package/src/ontology-storage/materialization-session.ts +393 -0
- package/src/ontology-storage/materialization-state.ts +901 -0
- package/src/ontology-storage/materialization-writer.ts +394 -0
- package/src/ontology-storage/materializations.ts +838 -0
- package/src/ontology-storage/outbox.ts +237 -0
- package/src/ontology-storage/shared.ts +269 -0
- package/src/ontology-storage/sources.ts +653 -0
- package/src/pipeline-run-storage.ts +506 -0
- package/src/projection-run-storage.ts +592 -0
- package/src/rules-storage.ts +375 -0
- package/src/run-list-query.ts +98 -0
- package/src/sql.d.ts +4 -0
- package/src/storage-errors.ts +3 -0
- package/src/sync-run-storage.ts +299 -0
- package/src/timeseries-storage.ts +212 -0
- package/src/transactions.ts +96 -0
- package/src/validation.ts +30 -0
- package/src/webhook-delivery-storage.ts +272 -0
- package/src/webhook-run-storage.ts +240 -0
- package/src/workflow-intervention-storage.ts +398 -0
- package/src/workflow-run-storage.ts +1148 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sixb contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @sixb/sqlite
|
|
2
|
+
|
|
3
|
+
SQLite storage provider for Sixb, built on `bun:sqlite`.
|
|
4
|
+
|
|
5
|
+
Backs every Sixb store — objects, ontology commits, auth, agents, timeseries, and the run history for
|
|
6
|
+
actions, syncs, pipelines, projections, workflows, and webhooks — from a single local database file.
|
|
7
|
+
This is the storage `bun create sixb` scaffolds, and part of what makes a fresh project run with no
|
|
8
|
+
service to install.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bun add @sixb/sqlite
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { SqliteStorage } from "@sixb/sqlite"
|
|
20
|
+
import { createSixb, InMemoryBroker } from "@sixb/core"
|
|
21
|
+
|
|
22
|
+
const storage = new SqliteStorage({ path: ".sixb" })
|
|
23
|
+
|
|
24
|
+
export const sixb = createSixb({ storage, broker: new InMemoryBroker() })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`path` is a **directory**; the provider owns the database file inside it. Omit `path` and the database
|
|
28
|
+
is in-memory: useful for tests, and it also means there is nothing to migrate, so `migrators` is
|
|
29
|
+
empty.
|
|
30
|
+
|
|
31
|
+
## Migrations
|
|
32
|
+
|
|
33
|
+
With a `path`, `SqliteStorage` exposes core's `StorageMigrator` contract and the CLI runs it at
|
|
34
|
+
startup. You do not write migrations — they ship inside this package.
|
|
35
|
+
|
|
36
|
+
Before 1.0 the schema is a single migration whose checksum is verified at boot. A schema change
|
|
37
|
+
**replaces** that migration instead of adding another, so moving between 0.x versions can require
|
|
38
|
+
deleting the database file and starting over.
|
|
39
|
+
|
|
40
|
+
## Transactions
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
await storage.transaction(async (tx) => {
|
|
44
|
+
// Use `tx`, never the root storage — the root throws inside a transaction callback.
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Nested transactions are rejected. The `isolation` option is accepted and **ignored**: every
|
|
49
|
+
transaction runs through one shared connection, serialized by an internal lock and a
|
|
50
|
+
`BEGIN IMMEDIATE`, so there is no concurrent transaction to isolate against — the lock already gives
|
|
51
|
+
serializable semantics for transaction-vs-transaction races. `isolation: "serializable"` only becomes
|
|
52
|
+
meaningful on a provider with true concurrent connections, such as [`@sixb/pg`](../pg).
|
|
53
|
+
|
|
54
|
+
That single-connection design is also the reason to reach for `@sixb/pg` before you scale out: every
|
|
55
|
+
process needs its own file, so replicas cannot share this storage.
|
|
56
|
+
|
|
57
|
+
Call `close()` on shutdown.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ActionRunRecord, ActionRunStorage, EnterActionRunPhaseInput, FinishActionRunInput, ListActionRunsInput, ListActionRunsResult, LockActionMaterializationRunInput, QueueActionRunInput, RecordActionEffectsInput, RecordActionWritebackInput, StartActionRunInput } from "@sixb/core/storage";
|
|
2
|
+
import { type SqliteStoreConnection } from "./transactions";
|
|
3
|
+
export interface SqliteActionRunStorageOptions {
|
|
4
|
+
/** Path to SQLite database file. Defaults to ':memory:' for in-memory database. */
|
|
5
|
+
path?: string;
|
|
6
|
+
/** Internal shared connection used by bundled SqliteStorage. */
|
|
7
|
+
connection?: SqliteStoreConnection;
|
|
8
|
+
}
|
|
9
|
+
export declare class SqliteActionRunStorage implements ActionRunStorage {
|
|
10
|
+
private readonly connection;
|
|
11
|
+
private readonly db;
|
|
12
|
+
constructor(options?: SqliteActionRunStorageOptions);
|
|
13
|
+
lockForMaterialization(input: LockActionMaterializationRunInput): Promise<ActionRunRecord>;
|
|
14
|
+
queue(input: QueueActionRunInput): Promise<ActionRunRecord>;
|
|
15
|
+
private requeueAfterEnqueueFailure;
|
|
16
|
+
start(input: StartActionRunInput): Promise<ActionRunRecord>;
|
|
17
|
+
enterPhase(input: EnterActionRunPhaseInput): Promise<ActionRunRecord>;
|
|
18
|
+
recordWriteback(input: RecordActionWritebackInput): Promise<ActionRunRecord>;
|
|
19
|
+
recordEffects(input: RecordActionEffectsInput): Promise<ActionRunRecord>;
|
|
20
|
+
finish(input: FinishActionRunInput): Promise<ActionRunRecord>;
|
|
21
|
+
getById(params: {
|
|
22
|
+
projectId: string;
|
|
23
|
+
id: string;
|
|
24
|
+
}): Promise<ActionRunRecord | null>;
|
|
25
|
+
list(input: ListActionRunsInput): Promise<ListActionRunsResult>;
|
|
26
|
+
close(): void;
|
|
27
|
+
private requireRunningRun;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=action-run-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-run-storage.d.ts","sourceRoot":"","sources":["../src/action-run-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKV,eAAe,EACf,gBAAgB,EAEhB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,iCAAiC,EACjC,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAGL,KAAK,qBAAqB,EAC3B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ageStore } from "./messages";
|
|
4
|
+
import { SqliteAgentRunStore } from "./runs";
|
|
5
|
+
import { SqliteAgentThreadStore } from "./threads";
|
|
6
|
+
export interface SqliteAgentStorageOptions {
|
|
7
|
+
/** Path to SQLite database file. Defaults to ':memory:' for in-memory database. */
|
|
8
|
+
path?: string;
|
|
9
|
+
/** Internal shared connection used by bundled SqliteStorage. */
|
|
10
|
+
connection?: SqliteStoreConnection;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* SQLite-backed agent persistence: thread / run / message sub-stores sharing one connection. The
|
|
14
|
+
* cross-table writes (reserve + finish touch the thread anchor, append bumps thread stats) run in
|
|
15
|
+
* SQLite transactions; the bundled {@link SqliteStorage} serializes all of them on one connection.
|
|
16
|
+
*/
|
|
17
|
+
export declare class SqliteAgentStorage implements AgentStorage {
|
|
18
|
+
readonly threads: SqliteAgentThreadStore;
|
|
19
|
+
readonly runs: SqliteAgentRunStore;
|
|
20
|
+
readonly messages: SqliteAgentMessageStore;
|
|
21
|
+
private readonly connection;
|
|
22
|
+
constructor(options?: SqliteAgentStorageOptions);
|
|
23
|
+
close(): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=agent-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-storage.d.ts","sourceRoot":"","sources":["../../src/agents/agent-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAElD,MAAM,WAAW,yBAAyB;IACxC,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,UAAU,CAAC,EAAE,qBAAqB,CAAA;CACnC;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;IAClC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAA;IAE1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;gBAEtC,OAAO,GAAE,yBAA8B;IAYnD,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { SqliteAgentStorageOptions } from "./agent-storage";
|
|
2
|
+
export { SqliteAgentStorage } from "./agent-storage";
|
|
3
|
+
export { SqliteAgentMessageStore } from "./messages";
|
|
4
|
+
export { SqliteAgentRunStore } from "./runs";
|
|
5
|
+
export { SqliteAgentThreadStore } from "./threads";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import { type AgentMessageRecord, type AgentMessageStore, type AppendAgentMessageInput, type ListAgentMessagesInput, type ListAgentMessagesResult } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAgentMessageStore implements AgentMessageStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
append(input: AppendAgentMessageInput): Promise<AgentMessageRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
projectId: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}): Promise<AgentMessageRecord | null>;
|
|
11
|
+
list(input: ListAgentMessagesInput): Promise<ListAgentMessagesResult>;
|
|
12
|
+
private requireMessage;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/agents/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAA;AAK3B,qBAAa,uBAAwB,YAAW,iBAAiB;IACnD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA+FnE,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAQtF,IAAI,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA2B3E,OAAO,CAAC,cAAc;CAcvB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import { type Principal } from "@sixb/core";
|
|
3
|
+
import { type AgentMessageRecord, type AgentRunRecord, type AgentThreadRecord } from "@sixb/core/storage";
|
|
4
|
+
import type { SqliteValue } from "../run-list-query";
|
|
5
|
+
export interface AgentThreadRow {
|
|
6
|
+
project_id: string;
|
|
7
|
+
id: string;
|
|
8
|
+
agent_id: string;
|
|
9
|
+
owner_principal_type: Principal["type"];
|
|
10
|
+
owner_principal_id: string;
|
|
11
|
+
title: string | null;
|
|
12
|
+
status: AgentThreadRecord["status"];
|
|
13
|
+
active_run_id: string | null;
|
|
14
|
+
last_message_at: string | null;
|
|
15
|
+
message_count: number;
|
|
16
|
+
created_at: string;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AgentRunRow {
|
|
20
|
+
project_id: string;
|
|
21
|
+
id: string;
|
|
22
|
+
thread_id: string;
|
|
23
|
+
agent_id: string;
|
|
24
|
+
trigger_message_id: string;
|
|
25
|
+
requested_by_principal_type: Principal["type"] | null;
|
|
26
|
+
requested_by_principal_id: string | null;
|
|
27
|
+
execution_principal_type: "serviceAccount" | null;
|
|
28
|
+
execution_principal_id: string | null;
|
|
29
|
+
status: AgentRunRecord["status"];
|
|
30
|
+
model_id: string | null;
|
|
31
|
+
finish_reason: string | null;
|
|
32
|
+
usage_input_tokens: number | null;
|
|
33
|
+
usage_output_tokens: number | null;
|
|
34
|
+
usage_total_tokens: number | null;
|
|
35
|
+
usage_reasoning_tokens: number | null;
|
|
36
|
+
usage_cached_input_tokens: number | null;
|
|
37
|
+
error: string | null;
|
|
38
|
+
diagnostics: string | null;
|
|
39
|
+
attempt: number;
|
|
40
|
+
execution_token: string | null;
|
|
41
|
+
execution_queue_lease_expires_at: string | null;
|
|
42
|
+
created_at: string;
|
|
43
|
+
started_at: string | null;
|
|
44
|
+
completed_at: string | null;
|
|
45
|
+
}
|
|
46
|
+
export interface AgentMessageRow {
|
|
47
|
+
project_id: string;
|
|
48
|
+
id: string;
|
|
49
|
+
thread_id: string;
|
|
50
|
+
run_id: string | null;
|
|
51
|
+
role: AgentMessageRecord["role"];
|
|
52
|
+
author_principal_type: Principal["type"] | null;
|
|
53
|
+
author_principal_id: string | null;
|
|
54
|
+
seq: number;
|
|
55
|
+
parts: string;
|
|
56
|
+
metadata: string | null;
|
|
57
|
+
content_version: number;
|
|
58
|
+
created_at: string;
|
|
59
|
+
completed_at: string | null;
|
|
60
|
+
}
|
|
61
|
+
export declare function rowToThreadRecord(row: AgentThreadRow): AgentThreadRecord;
|
|
62
|
+
export declare function rowToRunRecord(row: AgentRunRow): AgentRunRecord;
|
|
63
|
+
export declare function rowToMessageRecord(row: AgentMessageRow): AgentMessageRecord;
|
|
64
|
+
export declare function queryAgentList<TRow>(input: {
|
|
65
|
+
readonly db: Database;
|
|
66
|
+
readonly table: "agent_threads" | "agent_messages";
|
|
67
|
+
readonly whereClauses: readonly string[];
|
|
68
|
+
readonly args: readonly SqliteValue[];
|
|
69
|
+
readonly orderBy: string;
|
|
70
|
+
readonly limit?: number;
|
|
71
|
+
readonly offset?: number;
|
|
72
|
+
}): {
|
|
73
|
+
readonly rows: readonly TRow[];
|
|
74
|
+
readonly total: number;
|
|
75
|
+
readonly hasMore: boolean;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/agents/rows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAyB,KAAK,SAAS,EAAoB,MAAM,YAAY,CAAA;AACpF,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAIpD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;IACvC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,KAAK,EAAE,MAAM,GAAG,IAA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C,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAsBxF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import { type AgentRunRecord, type AgentRunStore, type ConfirmAgentRunExecutionOwnershipInput, type CreateAgentRunInput, type FinishAgentRunInput, type FinishQueuedAgentRunInput, type ListAgentRunsInput, type ListAgentRunsResult, type ReclaimAgentRunInput, type StartAgentRunInput } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAgentRunStore implements AgentRunStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
create(input: CreateAgentRunInput): Promise<AgentRunRecord>;
|
|
7
|
+
start(input: StartAgentRunInput): Promise<AgentRunRecord>;
|
|
8
|
+
finishQueued(input: FinishQueuedAgentRunInput): Promise<AgentRunRecord>;
|
|
9
|
+
reclaim(input: ReclaimAgentRunInput): Promise<AgentRunRecord>;
|
|
10
|
+
confirmExecutionOwnership(input: ConfirmAgentRunExecutionOwnershipInput): Promise<AgentRunRecord>;
|
|
11
|
+
finish(input: FinishAgentRunInput): Promise<AgentRunRecord>;
|
|
12
|
+
getById(params: {
|
|
13
|
+
projectId: string;
|
|
14
|
+
id: string;
|
|
15
|
+
}): Promise<AgentRunRecord | null>;
|
|
16
|
+
getByIds(params: {
|
|
17
|
+
projectId: string;
|
|
18
|
+
ids: readonly string[];
|
|
19
|
+
}): Promise<readonly AgentRunRecord[]>;
|
|
20
|
+
list(input: ListAgentRunsInput): Promise<ListAgentRunsResult>;
|
|
21
|
+
private requireRunning;
|
|
22
|
+
private requireStatus;
|
|
23
|
+
private releaseThread;
|
|
24
|
+
private requireRun;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AAO,CAAC,mBAAmB,CAAC;IAiCnE,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,UAAU;CAcnB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import { type AgentThreadRecord, type AgentThreadStore, type CreateAgentThreadInput, type ListAgentThreadsInput, type ListAgentThreadsResult } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAgentThreadStore implements AgentThreadStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
create(input: CreateAgentThreadInput): Promise<AgentThreadRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
projectId: string;
|
|
9
|
+
id: string;
|
|
10
|
+
}): Promise<AgentThreadRecord | null>;
|
|
11
|
+
list(input: ListAgentThreadsInput): Promise<ListAgentThreadsResult>;
|
|
12
|
+
private requireThread;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=threads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/agents/threads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAA;AAK3B,qBAAa,sBAAuB,YAAW,gBAAgB;IACjD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiDjE,OAAO,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQrF,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA6CzE,OAAO,CAAC,aAAa;CActB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AccessTokenRecord, AuthAccessTokenStore, CreateAuthAccessTokenInput, ListAuthAccessTokensInput, ListAuthAccessTokensResult } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthAccessTokenStore implements AuthAccessTokenStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
create(input: CreateAuthAccessTokenInput): Promise<AccessTokenRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
}): Promise<AccessTokenRecord | null>;
|
|
11
|
+
list(input: ListAuthAccessTokensInput): Promise<ListAuthAccessTokensResult>;
|
|
12
|
+
findValidByTokenHash(params: {
|
|
13
|
+
readonly projectId: string;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly kind: AccessTokenRecord["kind"];
|
|
16
|
+
readonly tokenHash: string;
|
|
17
|
+
readonly now: Date;
|
|
18
|
+
}): Promise<AccessTokenRecord | null>;
|
|
19
|
+
revoke(params: {
|
|
20
|
+
readonly projectId: string;
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly revokedAt: Date;
|
|
23
|
+
}): Promise<AccessTokenRecord>;
|
|
24
|
+
touch(params: {
|
|
25
|
+
readonly projectId: string;
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly lastUsedAt: Date;
|
|
28
|
+
readonly userAgent?: string;
|
|
29
|
+
readonly ipAddress?: string;
|
|
30
|
+
}): Promise<AccessTokenRecord>;
|
|
31
|
+
private assertSubjectExists;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=access-tokens.d.ts.map
|
|
@@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,KAAK,CAAC,MAAM,EAAE;QAClB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAA;QACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAC5B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAuC9B,OAAO,CAAC,mBAAmB;CAyB5B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AuthStorage, CompleteMagicLinkSignInInput, CompleteOidcSignInInput, CompleteSignInResult, SuspendUserAndRevokeSessionsInput, UserRecord } from "@sixb/core/storage";
|
|
2
|
+
import { type SqliteStoreConnection } from "../transactions";
|
|
3
|
+
import { SqliteAuthAccessTokenStore } from "./access-tokens";
|
|
4
|
+
import { SqliteAuthGroupMembershipStore } from "./group-memberships";
|
|
5
|
+
import { SqliteAuthUserIdentityStore } from "./identities";
|
|
6
|
+
import { SqliteAuthInvitationStore } from "./invitations";
|
|
7
|
+
import { SqliteAuthMagicLinkStore } from "./magic-links";
|
|
8
|
+
import { SqliteAuthOidcAuthorizationAttemptStore } from "./oidc-attempts";
|
|
9
|
+
import { SqliteAuthServiceAccountGroupMembershipStore } from "./service-account-group-memberships";
|
|
10
|
+
import { SqliteAuthServiceAccountStore } from "./service-accounts";
|
|
11
|
+
import { SqliteAuthSessionStore } from "./sessions";
|
|
12
|
+
import { SqliteAuthUserStore } from "./users";
|
|
13
|
+
export interface SqliteAuthStorageOptions {
|
|
14
|
+
/** Path to SQLite database file. Defaults to ':memory:' for in-memory database. */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** Internal shared connection used by bundled SqliteStorage. */
|
|
17
|
+
connection?: SqliteStoreConnection;
|
|
18
|
+
}
|
|
19
|
+
export declare class SqliteAuthStorage implements AuthStorage {
|
|
20
|
+
private readonly connection;
|
|
21
|
+
private readonly db;
|
|
22
|
+
readonly users: SqliteAuthUserStore;
|
|
23
|
+
readonly identities: SqliteAuthUserIdentityStore;
|
|
24
|
+
readonly serviceAccounts: SqliteAuthServiceAccountStore;
|
|
25
|
+
readonly serviceAccountGroupMemberships: SqliteAuthServiceAccountGroupMembershipStore;
|
|
26
|
+
readonly sessions: SqliteAuthSessionStore;
|
|
27
|
+
readonly accessTokens: SqliteAuthAccessTokenStore;
|
|
28
|
+
readonly invitations: SqliteAuthInvitationStore;
|
|
29
|
+
readonly groupMemberships: SqliteAuthGroupMembershipStore;
|
|
30
|
+
readonly magicLinks: SqliteAuthMagicLinkStore;
|
|
31
|
+
readonly oidcAuthorizationAttempts: SqliteAuthOidcAuthorizationAttemptStore;
|
|
32
|
+
constructor(options?: SqliteAuthStorageOptions);
|
|
33
|
+
completeMagicLinkSignIn(input: CompleteMagicLinkSignInInput): Promise<CompleteSignInResult>;
|
|
34
|
+
completeOidcSignIn(input: CompleteOidcSignInInput): Promise<CompleteSignInResult>;
|
|
35
|
+
suspendUserAndRevokeSessions(input: SuspendUserAndRevokeSessionsInput): Promise<UserRecord>;
|
|
36
|
+
close(): void;
|
|
37
|
+
private assertMagicLinkUsable;
|
|
38
|
+
private assertOidcAttemptUsable;
|
|
39
|
+
private insertUser;
|
|
40
|
+
private acceptInvitationAndApplyGroups;
|
|
41
|
+
private applyManualGroups;
|
|
42
|
+
private createSignInSession;
|
|
43
|
+
private consumeOidcAttempt;
|
|
44
|
+
private upsertIdentity;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=auth-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-storage.d.ts","sourceRoot":"","sources":["../../src/auth-storage/auth-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,EAIpB,iCAAiC,EAEjC,UAAU,EACX,MAAM,oBAAoB,CAAA;AA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UAAU,EAAE,wBAAwB,CAAA;IAC7C,QAAQ,CAAC,yBAAyB,EAAE,uCAAuC,CAAA;gBAE/D,OAAO,GAAE,wBAA6B;IAoB5C,uBAAuB,CAC3B,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,oBAAoB,CAAC;IAsJ1B,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6LjF,4BAA4B,CAChC,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,UAAU,CAAC;IAuCtB,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,uBAAuB;IA6B/B,OAAO,CAAC,UAAU;IAqDlB,OAAO,CAAC,8BAA8B;IAkDtC,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,cAAc;CAgDvB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AuthGroupMembershipStore, GroupMembershipRecord, UpsertAuthGroupMembershipInput } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthGroupMembershipStore implements AuthGroupMembershipStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
upsert(input: UpsertAuthGroupMembershipInput): Promise<GroupMembershipRecord>;
|
|
7
|
+
remove(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly userId: string;
|
|
10
|
+
readonly groupId: string;
|
|
11
|
+
}): Promise<GroupMembershipRecord | null>;
|
|
12
|
+
listForUser(params: {
|
|
13
|
+
readonly projectId: string;
|
|
14
|
+
readonly userId: string;
|
|
15
|
+
}): Promise<readonly GroupMembershipRecord[]>;
|
|
16
|
+
listForGroup(params: {
|
|
17
|
+
readonly projectId: string;
|
|
18
|
+
readonly groupId: string;
|
|
19
|
+
}): Promise<readonly GroupMembershipRecord[]>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=group-memberships.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-memberships.d.ts","sourceRoot":"","sources":["../../src/auth-storage/group-memberships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,8BAA8B,EAC/B,MAAM,oBAAoB,CAAA;AAM3B,qBAAa,8BAA+B,YAAW,wBAAwB;IACjE,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI7E,MAAM,CAAC,MAAM,EAAE;QACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KACzB,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAInC,WAAW,CAAC,MAAM,EAAE;QACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KACxB,GAAG,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC;IAIvC,YAAY,CAAC,MAAM,EAAE;QACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KACzB,GAAG,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC;CAe9C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AuthUserIdentityStore, UpsertAuthUserIdentityInput, UserIdentityRecord } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthUserIdentityStore implements AuthUserIdentityStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
upsert(input: UpsertAuthUserIdentityInput): Promise<UserIdentityRecord>;
|
|
7
|
+
getBySubject(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly strategyId: string;
|
|
10
|
+
readonly subject: string;
|
|
11
|
+
}): Promise<UserIdentityRecord | null>;
|
|
12
|
+
listForUser(params: {
|
|
13
|
+
readonly projectId: string;
|
|
14
|
+
readonly userId: string;
|
|
15
|
+
}): Promise<readonly UserIdentityRecord[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=identities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identities.d.ts","sourceRoot":"","sources":["../../src/auth-storage/identities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAK3B,qBAAa,2BAA4B,YAAW,qBAAqB;IAC3D,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAyDvE,YAAY,CAAC,MAAM,EAAE;QACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KACzB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAKhC,WAAW,CAAC,MAAM,EAAE;QACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KACxB,GAAG,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC;CAe3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth-storage/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AuthInvitationStore, CreateOrUpdateAuthInvitationInput, InvitationRecord, ListAuthInvitationsInput, ListAuthInvitationsResult } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthInvitationStore implements AuthInvitationStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
createOrUpdateActive(input: CreateOrUpdateAuthInvitationInput): Promise<InvitationRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
}): Promise<InvitationRecord | null>;
|
|
11
|
+
getActiveByEmail(params: {
|
|
12
|
+
readonly projectId: string;
|
|
13
|
+
readonly email: string;
|
|
14
|
+
readonly now: Date;
|
|
15
|
+
}): Promise<InvitationRecord | null>;
|
|
16
|
+
list(input: ListAuthInvitationsInput): Promise<ListAuthInvitationsResult>;
|
|
17
|
+
accept(params: {
|
|
18
|
+
readonly projectId: string;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly acceptedAt: Date;
|
|
21
|
+
}): Promise<InvitationRecord>;
|
|
22
|
+
revoke(params: {
|
|
23
|
+
readonly projectId: string;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly revokedAt: Date;
|
|
26
|
+
}): Promise<InvitationRecord>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=invitations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["../../src/auth-storage/invitations.ts"],"names":[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}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AuthMagicLinkStore, CreateAuthMagicLinkInput, MagicLinkRecord } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthMagicLinkStore implements AuthMagicLinkStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
create(input: CreateAuthMagicLinkInput): Promise<MagicLinkRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
}): Promise<MagicLinkRecord | null>;
|
|
11
|
+
getActiveByEmail(params: {
|
|
12
|
+
readonly projectId: string;
|
|
13
|
+
readonly email: string;
|
|
14
|
+
readonly now: Date;
|
|
15
|
+
}): Promise<MagicLinkRecord | null>;
|
|
16
|
+
consume(params: {
|
|
17
|
+
readonly projectId: string;
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly tokenHash: string;
|
|
20
|
+
readonly consumedAt: Date;
|
|
21
|
+
}): Promise<MagicLinkRecord>;
|
|
22
|
+
revokeActiveForEmail(params: {
|
|
23
|
+
readonly projectId: string;
|
|
24
|
+
readonly email: string;
|
|
25
|
+
readonly revokedAt: Date;
|
|
26
|
+
}): Promise<readonly MagicLinkRecord[]>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=magic-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-links.d.ts","sourceRoot":"","sources":["../../src/auth-storage/magic-links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EAChB,MAAM,oBAAoB,CAAA;AAgB3B,qBAAa,wBAAyB,YAAW,kBAAkB;IACrD,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAwEjE,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;IAI7B,gBAAgB,CAAC,MAAM,EAAE;QAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAA;KACnB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAwB7B,OAAO,CAAC,MAAM,EAAE;QACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAA;KAC1B,GAAG,OAAO,CAAC,eAAe,CAAC;IAItB,oBAAoB,CAAC,MAAM,EAAE;QACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;KACzB,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAGxC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import type { AuthOidcAuthorizationAttemptStore, CreateOidcAuthorizationAttemptInput, OidcAuthorizationAttemptRecord } from "@sixb/core/storage";
|
|
3
|
+
export declare class SqliteAuthOidcAuthorizationAttemptStore implements AuthOidcAuthorizationAttemptStore {
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(db: Database);
|
|
6
|
+
create(input: CreateOidcAuthorizationAttemptInput): Promise<OidcAuthorizationAttemptRecord>;
|
|
7
|
+
getById(params: {
|
|
8
|
+
readonly projectId: string;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
}): Promise<OidcAuthorizationAttemptRecord | null>;
|
|
11
|
+
consume(params: {
|
|
12
|
+
readonly projectId: string;
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly stateHash: string;
|
|
15
|
+
readonly consumedAt: Date;
|
|
16
|
+
}): Promise<OidcAuthorizationAttemptRecord>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=oidc-attempts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc-attempts.d.ts","sourceRoot":"","sources":["../../src/auth-storage/oidc-attempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C,OAAO,KAAK,EACV,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC/B,MAAM,oBAAoB,CAAA;AAY3B,qBAAa,uCAAwC,YAAW,iCAAiC;IACnF,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAEnC,MAAM,CACV,KAAK,EAAE,mCAAmC,GACzC,OAAO,CAAC,8BAA8B,CAAC;IAsEpC,OAAO,CAAC,MAAM,EAAE;QACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KACpB,GAAG,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC;IAI5C,OAAO,CAAC,MAAM,EAAE;QACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;QAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAA;KAC1B,GAAG,OAAO,CAAC,8BAA8B,CAAC;CAG5C"}
|