@adonis-agora/agent 0.1.0
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/dist/configure.d.ts +18 -0
- package/dist/configure.d.ts.map +1 -0
- package/dist/configure.js +29 -0
- package/dist/configure.js.map +1 -0
- package/dist/providers/agent_provider.d.ts +25 -0
- package/dist/providers/agent_provider.d.ts.map +1 -0
- package/dist/providers/agent_provider.js +511 -0
- package/dist/providers/agent_provider.js.map +1 -0
- package/dist/src/actor-resolver.d.ts +41 -0
- package/dist/src/actor-resolver.d.ts.map +1 -0
- package/dist/src/agent-deps-factory.d.ts +59 -0
- package/dist/src/agent-deps-factory.d.ts.map +1 -0
- package/dist/src/agent-deps-factory.js +111 -0
- package/dist/src/agent-deps-factory.js.map +1 -0
- package/dist/src/agent-deps.d.ts +42 -0
- package/dist/src/agent-deps.d.ts.map +1 -0
- package/dist/src/agent-deps.js +5 -0
- package/dist/src/agent-deps.js.map +1 -0
- package/dist/src/agent-loop.d.ts +101 -0
- package/dist/src/agent-loop.d.ts.map +1 -0
- package/dist/src/agent-loop.js +396 -0
- package/dist/src/agent-loop.js.map +1 -0
- package/dist/src/agent-registry.d.ts +10 -0
- package/dist/src/agent-registry.d.ts.map +1 -0
- package/dist/src/agent-service.d.ts +50 -0
- package/dist/src/agent-service.d.ts.map +1 -0
- package/dist/src/agent-service.js +82 -0
- package/dist/src/agent-service.js.map +1 -0
- package/dist/src/ai-sdk/ai-sdk-model.d.ts +17 -0
- package/dist/src/ai-sdk/ai-sdk-model.d.ts.map +1 -0
- package/dist/src/ai-sdk/ai-sdk-model.js +263 -0
- package/dist/src/ai-sdk/ai-sdk-model.js.map +1 -0
- package/dist/src/ai-sdk/index.d.ts +2 -0
- package/dist/src/ai-sdk/index.d.ts.map +1 -0
- package/dist/src/ai-tool-ref.d.ts +79 -0
- package/dist/src/ai-tool-ref.d.ts.map +1 -0
- package/dist/src/ai-tool-ref.js +81 -0
- package/dist/src/ai-tool-ref.js.map +1 -0
- package/dist/src/authorizer.d.ts +18 -0
- package/dist/src/authorizer.d.ts.map +1 -0
- package/dist/src/authz/authz-tool-authorizer.d.ts +85 -0
- package/dist/src/authz/authz-tool-authorizer.d.ts.map +1 -0
- package/dist/src/authz/authz-tool-authorizer.js +63 -0
- package/dist/src/authz/authz-tool-authorizer.js.map +1 -0
- package/dist/src/authz/index.d.ts +3 -0
- package/dist/src/authz/index.d.ts.map +1 -0
- package/dist/src/authz/index.js +2 -0
- package/dist/src/authz/index.js.map +1 -0
- package/dist/src/data/data-tool.d.ts +64 -0
- package/dist/src/data/data-tool.d.ts.map +1 -0
- package/dist/src/data/data-tool.js +146 -0
- package/dist/src/data/data-tool.js.map +1 -0
- package/dist/src/data/index.d.ts +7 -0
- package/dist/src/data/index.d.ts.map +1 -0
- package/dist/src/data/index.js +7 -0
- package/dist/src/data/index.js.map +1 -0
- package/dist/src/data/limit.d.ts +12 -0
- package/dist/src/data/limit.d.ts.map +1 -0
- package/dist/src/data/limit.js +29 -0
- package/dist/src/data/limit.js.map +1 -0
- package/dist/src/data/parser.d.ts +27 -0
- package/dist/src/data/parser.d.ts.map +1 -0
- package/dist/src/data/parser.js +18 -0
- package/dist/src/data/parser.js.map +1 -0
- package/dist/src/data/sql-validator.d.ts +37 -0
- package/dist/src/data/sql-validator.d.ts.map +1 -0
- package/dist/src/data/sql-validator.js +92 -0
- package/dist/src/data/sql-validator.js.map +1 -0
- package/dist/src/data/table-access.d.ts +40 -0
- package/dist/src/data/table-access.d.ts.map +1 -0
- package/dist/src/data/table-access.js +41 -0
- package/dist/src/data/table-access.js.map +1 -0
- package/dist/src/data/tenant-scope.d.ts +39 -0
- package/dist/src/data/tenant-scope.d.ts.map +1 -0
- package/dist/src/data/tenant-scope.js +126 -0
- package/dist/src/data/tenant-scope.js.map +1 -0
- package/dist/src/define_config.d.ts +153 -0
- package/dist/src/define_config.d.ts.map +1 -0
- package/dist/src/define_config.js +7 -0
- package/dist/src/define_config.js.map +1 -0
- package/dist/src/diagnostics.d.ts +82 -0
- package/dist/src/diagnostics.d.ts.map +1 -0
- package/dist/src/diagnostics.js +50 -0
- package/dist/src/diagnostics.js.map +1 -0
- package/dist/src/durable/agent-run-context.d.ts +24 -0
- package/dist/src/durable/agent-run-context.d.ts.map +1 -0
- package/dist/src/durable/agent-run-context.js +17 -0
- package/dist/src/durable/agent-run-context.js.map +1 -0
- package/dist/src/durable/agent-run-workflow.d.ts +37 -0
- package/dist/src/durable/agent-run-workflow.d.ts.map +1 -0
- package/dist/src/durable/agent-run-workflow.js +128 -0
- package/dist/src/durable/agent-run-workflow.js.map +1 -0
- package/dist/src/durable/durable-agent-runner.d.ts +25 -0
- package/dist/src/durable/durable-agent-runner.d.ts.map +1 -0
- package/dist/src/durable/durable-agent-runner.js +59 -0
- package/dist/src/durable/durable-agent-runner.js.map +1 -0
- package/dist/src/durable/index.d.ts +17 -0
- package/dist/src/durable/index.d.ts.map +1 -0
- package/dist/src/durable/index.js +20 -0
- package/dist/src/durable/index.js.map +1 -0
- package/dist/src/index.d.ts +55 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +45 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/personas.d.ts +7 -0
- package/dist/src/personas.d.ts.map +1 -0
- package/dist/src/rag/chunk.d.ts +14 -0
- package/dist/src/rag/chunk.d.ts.map +1 -0
- package/dist/src/rag/chunk.js +42 -0
- package/dist/src/rag/chunk.js.map +1 -0
- package/dist/src/rag/embedding-retriever.d.ts +15 -0
- package/dist/src/rag/embedding-retriever.d.ts.map +1 -0
- package/dist/src/rag/embedding-retriever.js +24 -0
- package/dist/src/rag/embedding-retriever.js.map +1 -0
- package/dist/src/rag/filter.d.ts +6 -0
- package/dist/src/rag/filter.d.ts.map +1 -0
- package/dist/src/rag/filter.js +11 -0
- package/dist/src/rag/filter.js.map +1 -0
- package/dist/src/rag/index.d.ts +8 -0
- package/dist/src/rag/index.d.ts.map +1 -0
- package/dist/src/rag/index.js +8 -0
- package/dist/src/rag/index.js.map +1 -0
- package/dist/src/rag/ingest.d.ts +33 -0
- package/dist/src/rag/ingest.d.ts.map +1 -0
- package/dist/src/rag/ingest.js +37 -0
- package/dist/src/rag/ingest.js.map +1 -0
- package/dist/src/rag/memory-vector-store.d.ts +16 -0
- package/dist/src/rag/memory-vector-store.d.ts.map +1 -0
- package/dist/src/rag/memory-vector-store.js +70 -0
- package/dist/src/rag/memory-vector-store.js.map +1 -0
- package/dist/src/rag/pg-vector-store.d.ts +84 -0
- package/dist/src/rag/pg-vector-store.d.ts.map +1 -0
- package/dist/src/rag/pg-vector-store.js +220 -0
- package/dist/src/rag/pg-vector-store.js.map +1 -0
- package/dist/src/rag/vector-store.d.ts +47 -0
- package/dist/src/rag/vector-store.d.ts.map +1 -0
- package/dist/src/rag/vector-store.js +5 -0
- package/dist/src/rag/vector-store.js.map +1 -0
- package/dist/src/rag-media/diagnostics.d.ts +43 -0
- package/dist/src/rag-media/diagnostics.d.ts.map +1 -0
- package/dist/src/rag-media/diagnostics.js +36 -0
- package/dist/src/rag-media/diagnostics.js.map +1 -0
- package/dist/src/rag-media/index.d.ts +5 -0
- package/dist/src/rag-media/index.d.ts.map +1 -0
- package/dist/src/rag-media/index.js +5 -0
- package/dist/src/rag-media/index.js.map +1 -0
- package/dist/src/rag-media/media-events.d.ts +23 -0
- package/dist/src/rag-media/media-events.d.ts.map +1 -0
- package/dist/src/rag-media/media-events.js +28 -0
- package/dist/src/rag-media/media-events.js.map +1 -0
- package/dist/src/rag-media/media-rag-ingestion.d.ts +155 -0
- package/dist/src/rag-media/media-rag-ingestion.d.ts.map +1 -0
- package/dist/src/rag-media/media-rag-ingestion.js +204 -0
- package/dist/src/rag-media/media-rag-ingestion.js.map +1 -0
- package/dist/src/rag-media/text-extractor.d.ts +46 -0
- package/dist/src/rag-media/text-extractor.d.ts.map +1 -0
- package/dist/src/rag-media/text-extractor.js +92 -0
- package/dist/src/rag-media/text-extractor.js.map +1 -0
- package/dist/src/redis-stream-client.d.ts +29 -0
- package/dist/src/redis-stream-client.d.ts.map +1 -0
- package/dist/src/redis-stream-client.js +2 -0
- package/dist/src/redis-stream-client.js.map +1 -0
- package/dist/src/redis-token-stream-sink.d.ts +36 -0
- package/dist/src/redis-token-stream-sink.d.ts.map +1 -0
- package/dist/src/redis-token-stream-sink.js +94 -0
- package/dist/src/redis-token-stream-sink.js.map +1 -0
- package/dist/src/runners/inline-agent-runner.d.ts +26 -0
- package/dist/src/runners/inline-agent-runner.d.ts.map +1 -0
- package/dist/src/runners/inline-agent-runner.js +85 -0
- package/dist/src/runners/inline-agent-runner.js.map +1 -0
- package/dist/src/spi/actor-directory.d.ts +23 -0
- package/dist/src/spi/actor-directory.d.ts.map +1 -0
- package/dist/src/spi/actor-directory.js +2 -0
- package/dist/src/spi/actor-directory.js.map +1 -0
- package/dist/src/spi/actor-resolver.d.ts +18 -0
- package/dist/src/spi/actor-resolver.d.ts.map +1 -0
- package/dist/src/spi/agent-runner.d.ts +20 -0
- package/dist/src/spi/agent-runner.d.ts.map +1 -0
- package/dist/src/spi/agent-store.d.ts +104 -0
- package/dist/src/spi/agent-store.d.ts.map +1 -0
- package/dist/src/spi/agent-store.js +2 -0
- package/dist/src/spi/agent-store.js.map +1 -0
- package/dist/src/spi/attachment-staging.d.ts +27 -0
- package/dist/src/spi/attachment-staging.d.ts.map +1 -0
- package/dist/src/spi/attachment-staging.js +2 -0
- package/dist/src/spi/attachment-staging.js.map +1 -0
- package/dist/src/spi/embedding-provider.d.ts +12 -0
- package/dist/src/spi/embedding-provider.d.ts.map +1 -0
- package/dist/src/spi/embedding-provider.js +2 -0
- package/dist/src/spi/embedding-provider.js.map +1 -0
- package/dist/src/spi/governance-queries.d.ts +215 -0
- package/dist/src/spi/governance-queries.d.ts.map +1 -0
- package/dist/src/spi/governance-queries.js +15 -0
- package/dist/src/spi/governance-queries.js.map +1 -0
- package/dist/src/spi/model-provider.d.ts +41 -0
- package/dist/src/spi/model-provider.d.ts.map +1 -0
- package/dist/src/spi/pricing-store.d.ts +45 -0
- package/dist/src/spi/pricing-store.d.ts.map +1 -0
- package/dist/src/spi/pricing-store.js +24 -0
- package/dist/src/spi/pricing-store.js.map +1 -0
- package/dist/src/spi/quota-store.d.ts +7 -0
- package/dist/src/spi/quota-store.d.ts.map +1 -0
- package/dist/src/spi/reranker.d.ts +17 -0
- package/dist/src/spi/reranker.d.ts.map +1 -0
- package/dist/src/spi/reranker.js +2 -0
- package/dist/src/spi/reranker.js.map +1 -0
- package/dist/src/spi/retriever.d.ts +28 -0
- package/dist/src/spi/retriever.d.ts.map +1 -0
- package/dist/src/spi/retriever.js +11 -0
- package/dist/src/spi/retriever.js.map +1 -0
- package/dist/src/spi/roles-policy.d.ts +11 -0
- package/dist/src/spi/roles-policy.d.ts.map +1 -0
- package/dist/src/spi/tool.d.ts +21 -0
- package/dist/src/spi/tool.d.ts.map +1 -0
- package/dist/src/stores/factory.d.ts +363 -0
- package/dist/src/stores/factory.d.ts.map +1 -0
- package/dist/src/stores/factory.js +341 -0
- package/dist/src/stores/factory.js.map +1 -0
- package/dist/src/stores/ledger-quota.d.ts +23 -0
- package/dist/src/stores/ledger-quota.d.ts.map +1 -0
- package/dist/src/stores/ledger-quota.js +32 -0
- package/dist/src/stores/ledger-quota.js.map +1 -0
- package/dist/src/stores/lucid-governance-queries.d.ts +73 -0
- package/dist/src/stores/lucid-governance-queries.d.ts.map +1 -0
- package/dist/src/stores/lucid-governance-queries.js +510 -0
- package/dist/src/stores/lucid-governance-queries.js.map +1 -0
- package/dist/src/stores/lucid-pricing.d.ts +20 -0
- package/dist/src/stores/lucid-pricing.d.ts.map +1 -0
- package/dist/src/stores/lucid-pricing.js +67 -0
- package/dist/src/stores/lucid-pricing.js.map +1 -0
- package/dist/src/stores/lucid-schema.d.ts +37 -0
- package/dist/src/stores/lucid-schema.d.ts.map +1 -0
- package/dist/src/stores/lucid-schema.js +139 -0
- package/dist/src/stores/lucid-schema.js.map +1 -0
- package/dist/src/stores/lucid.d.ts +73 -0
- package/dist/src/stores/lucid.d.ts.map +1 -0
- package/dist/src/stores/lucid.js +400 -0
- package/dist/src/stores/lucid.js.map +1 -0
- package/dist/src/telescope/dashboard.d.ts +21 -0
- package/dist/src/telescope/dashboard.d.ts.map +1 -0
- package/dist/src/telescope/dashboard.js +140 -0
- package/dist/src/telescope/dashboard.js.map +1 -0
- package/dist/src/telescope/data-providers.d.ts +39 -0
- package/dist/src/telescope/data-providers.d.ts.map +1 -0
- package/dist/src/telescope/data-providers.js +345 -0
- package/dist/src/telescope/data-providers.js.map +1 -0
- package/dist/src/telescope/extension.d.ts +27 -0
- package/dist/src/telescope/extension.d.ts.map +1 -0
- package/dist/src/telescope/extension.js +45 -0
- package/dist/src/telescope/extension.js.map +1 -0
- package/dist/src/telescope/index.d.ts +5 -0
- package/dist/src/telescope/index.d.ts.map +1 -0
- package/dist/src/telescope/index.js +4 -0
- package/dist/src/telescope/index.js.map +1 -0
- package/dist/src/telescope/telescope-sdk.d.ts +126 -0
- package/dist/src/telescope/telescope-sdk.d.ts.map +1 -0
- package/dist/src/telescope/telescope-sdk.js +15 -0
- package/dist/src/telescope/telescope-sdk.js.map +1 -0
- package/dist/src/testing/fake-embedding-provider.d.ts +37 -0
- package/dist/src/testing/fake-embedding-provider.d.ts.map +1 -0
- package/dist/src/testing/fake-embedding-provider.js +67 -0
- package/dist/src/testing/fake-embedding-provider.js.map +1 -0
- package/dist/src/testing/fake-media.d.ts +44 -0
- package/dist/src/testing/fake-media.d.ts.map +1 -0
- package/dist/src/testing/fake-media.js +69 -0
- package/dist/src/testing/fake-media.js.map +1 -0
- package/dist/src/testing/fake-model-provider.d.ts +29 -0
- package/dist/src/testing/fake-model-provider.d.ts.map +1 -0
- package/dist/src/testing/in-memory-actor-directory.d.ts +14 -0
- package/dist/src/testing/in-memory-actor-directory.d.ts.map +1 -0
- package/dist/src/testing/in-memory-actor-directory.js +27 -0
- package/dist/src/testing/in-memory-actor-directory.js.map +1 -0
- package/dist/src/testing/in-memory-attachment-staging.d.ts +22 -0
- package/dist/src/testing/in-memory-attachment-staging.d.ts.map +1 -0
- package/dist/src/testing/in-memory-attachment-staging.js +28 -0
- package/dist/src/testing/in-memory-attachment-staging.js.map +1 -0
- package/dist/src/testing/in-memory-governance-queries.d.ts +34 -0
- package/dist/src/testing/in-memory-governance-queries.d.ts.map +1 -0
- package/dist/src/testing/in-memory-governance-queries.js +373 -0
- package/dist/src/testing/in-memory-governance-queries.js.map +1 -0
- package/dist/src/testing/in-memory-pricing.d.ts +13 -0
- package/dist/src/testing/in-memory-pricing.d.ts.map +1 -0
- package/dist/src/testing/in-memory-pricing.js +27 -0
- package/dist/src/testing/in-memory-pricing.js.map +1 -0
- package/dist/src/testing/in-memory-quota.d.ts +11 -0
- package/dist/src/testing/in-memory-quota.d.ts.map +1 -0
- package/dist/src/testing/in-memory-sink.d.ts +14 -0
- package/dist/src/testing/in-memory-sink.d.ts.map +1 -0
- package/dist/src/testing/in-memory-store.d.ts +119 -0
- package/dist/src/testing/in-memory-store.d.ts.map +1 -0
- package/dist/src/testing/in-memory-store.js +317 -0
- package/dist/src/testing/in-memory-store.js.map +1 -0
- package/dist/src/testing/index.d.ts +11 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +11 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/tool-discovery.d.ts +35 -0
- package/dist/src/tool-discovery.d.ts.map +1 -0
- package/dist/src/tool-registry.d.ts +45 -0
- package/dist/src/tool-registry.d.ts.map +1 -0
- package/dist/src/tool-retry.d.ts +56 -0
- package/dist/src/tool-retry.d.ts.map +1 -0
- package/dist/src/tool-retry.js +95 -0
- package/dist/src/tool-retry.js.map +1 -0
- package/dist/src/types.d.ts +222 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stubs/config/agent.stub +55 -0
- package/dist/stubs/database/migrations/create_agent_rag_chunks.stub +41 -0
- package/dist/stubs/database/migrations/create_agent_run_tracking.stub +80 -0
- package/dist/stubs/database/migrations/create_agent_tables.stub +113 -0
- package/package.json +174 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The store factory namespace used in `config/agent.ts`:
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { defineConfig, stores } from '@adonis-agora/agent'
|
|
6
|
+
*
|
|
7
|
+
* export default defineConfig({
|
|
8
|
+
* store: 'lucid',
|
|
9
|
+
* stores: {
|
|
10
|
+
* memory: stores.memory(),
|
|
11
|
+
* lucid: stores.lucid({ connection: 'pg' }),
|
|
12
|
+
* },
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Each factory returns a {@link StoreFactory} — a lazy thunk. Calling it in the config file costs
|
|
17
|
+
* nothing; the peer dependency is only imported when the provider builds the selected store at boot.
|
|
18
|
+
*/
|
|
19
|
+
export const stores = {
|
|
20
|
+
/** In-memory store — single-process, non-durable. Handy for tests and scratch/dev apps. */
|
|
21
|
+
memory(_config = {}) {
|
|
22
|
+
return async () => {
|
|
23
|
+
const { InMemoryAgentStore } = await import('../testing/in-memory-store.js');
|
|
24
|
+
return new InMemoryAgentStore();
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
/** Persist threads/messages/tool-calls/usage in SQL via `@adonisjs/lucid`. */
|
|
28
|
+
lucid(config = {}) {
|
|
29
|
+
return async () => {
|
|
30
|
+
const db = (await import('@adonisjs/lucid/services/db')).default;
|
|
31
|
+
const { LucidAgentStore } = await import('./lucid.js');
|
|
32
|
+
const client = (config.connection !== undefined
|
|
33
|
+
? db.connection(config.connection)
|
|
34
|
+
: db);
|
|
35
|
+
return new LucidAgentStore(client, {
|
|
36
|
+
...(config.autoCreateTables !== undefined
|
|
37
|
+
? { autoCreateTables: config.autoCreateTables }
|
|
38
|
+
: {}),
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The quota factory namespace used in `config/agent.ts`, mirroring {@link stores}:
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* export default defineConfig({
|
|
48
|
+
* store: 'lucid',
|
|
49
|
+
* stores: { lucid: stores.lucid() },
|
|
50
|
+
* quota: quotas.ledger({ limitTokens: 1_000_000 }),
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export const quotas = {
|
|
55
|
+
/** In-memory per-actor/day budget — single-process, non-durable. Handy for tests and dev apps. */
|
|
56
|
+
memory(config) {
|
|
57
|
+
return async () => {
|
|
58
|
+
const { InMemoryQuotaStore } = await import('../testing/in-memory-quota.js');
|
|
59
|
+
return new InMemoryQuotaStore(config.limitTokens);
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Enforce the budget off the persisted token-usage ledger (the selected `store`) — one source of
|
|
64
|
+
* truth across replicas, with no double-counting. Pairs with any {@link AgentStore}.
|
|
65
|
+
*/
|
|
66
|
+
ledger(config) {
|
|
67
|
+
return async ({ store }) => {
|
|
68
|
+
const { LedgerQuotaStore } = await import('./ledger-quota.js');
|
|
69
|
+
return new LedgerQuotaStore(store, config.limitTokens);
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The pricing factory namespace used in `config/agent.ts`, mirroring {@link stores}:
|
|
75
|
+
*
|
|
76
|
+
* ```ts
|
|
77
|
+
* export default defineConfig({
|
|
78
|
+
* pricingStore: pricingStores.lucid(),
|
|
79
|
+
* })
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* Seed model prices once (e.g. in a command) with `seedModelPrices(store, [...])`.
|
|
83
|
+
*/
|
|
84
|
+
export const pricingStores = {
|
|
85
|
+
/** In-memory pricing table — for tests and the offline demo. */
|
|
86
|
+
memory() {
|
|
87
|
+
return async () => {
|
|
88
|
+
const { InMemoryPricingStore } = await import('../testing/in-memory-pricing.js');
|
|
89
|
+
return new InMemoryPricingStore();
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
/** Persist per-model prices in SQL (the `agent_model_pricing` table) via `@adonisjs/lucid`. */
|
|
93
|
+
lucid(config = {}) {
|
|
94
|
+
return async () => {
|
|
95
|
+
const db = (await import('@adonisjs/lucid/services/db')).default;
|
|
96
|
+
const { LucidPricingStore } = await import('./lucid-pricing.js');
|
|
97
|
+
const client = (config.connection !== undefined
|
|
98
|
+
? db.connection(config.connection)
|
|
99
|
+
: db);
|
|
100
|
+
return new LucidPricingStore(client);
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The governance-queries factory namespace used in `config/agent.ts`, mirroring {@link pricingStores}:
|
|
106
|
+
*
|
|
107
|
+
* ```ts
|
|
108
|
+
* export default defineConfig({
|
|
109
|
+
* pricingStore: pricingStores.lucid(),
|
|
110
|
+
* governanceQueries: governanceQueries.lucid(),
|
|
111
|
+
* })
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* The Lucid read-model aggregates the same five agent tables the store writes and prices cost against
|
|
115
|
+
* the configured `pricingStore`; wiring it mounts the `/agent/governance/*` read routes.
|
|
116
|
+
*/
|
|
117
|
+
export const governanceQueries = {
|
|
118
|
+
/** Aggregate the five agent tables in SQL via `@adonisjs/lucid`, priced against the pricing store. */
|
|
119
|
+
lucid(config = {}) {
|
|
120
|
+
return async ({ pricingStore }) => {
|
|
121
|
+
const db = (await import('@adonisjs/lucid/services/db')).default;
|
|
122
|
+
const { LucidGovernanceQueries } = await import('./lucid-governance-queries.js');
|
|
123
|
+
const client = (config.connection !== undefined
|
|
124
|
+
? db.connection(config.connection)
|
|
125
|
+
: db);
|
|
126
|
+
return new LucidGovernanceQueries(client, pricingStore);
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* The retriever factory namespace used in `config/agent.ts`, mirroring {@link stores}:
|
|
132
|
+
*
|
|
133
|
+
* ```ts
|
|
134
|
+
* export default defineConfig({
|
|
135
|
+
* model: () => aiSdkModel({ model: '...' }),
|
|
136
|
+
* retriever: retrievers.memory({ embedder: myEmbedder, documents: [...] }),
|
|
137
|
+
* retrievalTopK: 5,
|
|
138
|
+
* })
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* Use `retrievers.pgvector({...})` for the production pgvector/Lucid store; `retrievers.memory` covers
|
|
142
|
+
* tests and small/embedded corpora.
|
|
143
|
+
*/
|
|
144
|
+
export const retrievers = {
|
|
145
|
+
/** In-memory embedding retriever — cosine over a Map, single-process. Handy for tests and dev apps. */
|
|
146
|
+
memory(config) {
|
|
147
|
+
return async () => {
|
|
148
|
+
const { MemoryVectorStore } = await import('../rag/memory-vector-store.js');
|
|
149
|
+
const { EmbeddingRetriever } = await import('../rag/embedding-retriever.js');
|
|
150
|
+
const { ingestDocuments } = await import('../rag/ingest.js');
|
|
151
|
+
const embedder = typeof config.embedder === 'function' ? await config.embedder() : config.embedder;
|
|
152
|
+
const store = new MemoryVectorStore();
|
|
153
|
+
if (config.documents !== undefined && config.documents.length > 0) {
|
|
154
|
+
await ingestDocuments(config.documents, {
|
|
155
|
+
embedder,
|
|
156
|
+
store,
|
|
157
|
+
...(config.chunkSize !== undefined ? { chunkSize: config.chunkSize } : {}),
|
|
158
|
+
...(config.overlap !== undefined ? { overlap: config.overlap } : {}),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return new EmbeddingRetriever(embedder, store);
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* Production pgvector retriever — cosine/L2/inner similarity over a `vector(N)` column via
|
|
166
|
+
* `@adonisjs/lucid` (raw SQL for the pgvector operators; the embedding is a `?::vector` binding). The
|
|
167
|
+
* Lucid peer is imported lazily inside the thunk (unless a structural `db` is passed), so it stays
|
|
168
|
+
* optional. Pass `ensureSchema: true` to provision the extension/table/index at boot for tests.
|
|
169
|
+
*/
|
|
170
|
+
pgvector(config) {
|
|
171
|
+
return async () => {
|
|
172
|
+
const { PgVectorStore, PgVectorRetriever } = await import('../rag/pg-vector-store.js');
|
|
173
|
+
const { ingestDocuments } = await import('../rag/ingest.js');
|
|
174
|
+
const embedder = typeof config.embedder === 'function' ? await config.embedder() : config.embedder;
|
|
175
|
+
const db = config.db ??
|
|
176
|
+
(await (async () => {
|
|
177
|
+
const dbService = (await import('@adonisjs/lucid/services/db')).default;
|
|
178
|
+
return (config.connection !== undefined
|
|
179
|
+
? dbService.connection(config.connection)
|
|
180
|
+
: dbService);
|
|
181
|
+
})());
|
|
182
|
+
const store = new PgVectorStore(db, {
|
|
183
|
+
...(config.table !== undefined ? { table: config.table } : {}),
|
|
184
|
+
...(config.dimension !== undefined ? { dimension: config.dimension } : {}),
|
|
185
|
+
...(config.metric !== undefined ? { metric: config.metric } : {}),
|
|
186
|
+
...(config.columns !== undefined ? { columns: config.columns } : {}),
|
|
187
|
+
});
|
|
188
|
+
if (config.ensureSchema === true) {
|
|
189
|
+
await store.ensureSchema();
|
|
190
|
+
}
|
|
191
|
+
if (config.documents !== undefined && config.documents.length > 0) {
|
|
192
|
+
await ingestDocuments(config.documents, {
|
|
193
|
+
embedder,
|
|
194
|
+
store,
|
|
195
|
+
...(config.chunkSize !== undefined ? { chunkSize: config.chunkSize } : {}),
|
|
196
|
+
...(config.overlap !== undefined ? { overlap: config.overlap } : {}),
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return new PgVectorRetriever(embedder, store);
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* The attachment-staging factory namespace used in `config/agent.ts`, mirroring {@link stores}:
|
|
205
|
+
*
|
|
206
|
+
* ```ts
|
|
207
|
+
* export default defineConfig({
|
|
208
|
+
* model: () => aiSdkModel({ model: '...' }),
|
|
209
|
+
* attachmentStaging: attachmentStores.memory(),
|
|
210
|
+
* })
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* A real deployment binds its own staging store (presigning against S3/GCS or wrapping the host's
|
|
214
|
+
* media pipeline) by passing an instance; `attachmentStores.memory` covers tests and the offline demo.
|
|
215
|
+
*/
|
|
216
|
+
export const attachmentStores = {
|
|
217
|
+
/**
|
|
218
|
+
* In-memory staging — encodes the uploaded bytes into a `data:` URL the model provider fetches
|
|
219
|
+
* inline (no external object store, no presigning). Single-process; handy for tests and dev apps.
|
|
220
|
+
*/
|
|
221
|
+
memory() {
|
|
222
|
+
return async () => {
|
|
223
|
+
const { InMemoryAttachmentStagingStore } = await import('../testing/in-memory-attachment-staging.js');
|
|
224
|
+
return new InMemoryAttachmentStagingStore();
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* The token-sink factory namespace used in `config/agent.ts`, mirroring {@link stores}. Also exported as
|
|
230
|
+
* `streamTransports` (an alias — pick whichever name reads better):
|
|
231
|
+
*
|
|
232
|
+
* ```ts
|
|
233
|
+
* import { defineConfig, tokenSinks } from '@adonis-agora/agent'
|
|
234
|
+
*
|
|
235
|
+
* export default defineConfig({
|
|
236
|
+
* model: () => aiSdkModel({ model: '...' }),
|
|
237
|
+
* sink: tokenSinks.redis({ connection: 'main' }), // multi-replica; any pod serves any run's SSE
|
|
238
|
+
* })
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* Omitting `sink` entirely keeps the in-process sink (single replica); `tokenSinks.memory()` selects it
|
|
242
|
+
* explicitly. `tokenSinks.redis()` fans a run's tokens across replicas over Redis pub/sub + a replayable
|
|
243
|
+
* list, keeping the SSE envelope byte-identical. The `@adonisjs/redis` peer is imported ONLY inside the
|
|
244
|
+
* `redis` thunk, so it stays fully optional.
|
|
245
|
+
*/
|
|
246
|
+
export const tokenSinks = {
|
|
247
|
+
/** The in-process sink — per-run in-memory buffers, single replica. The default when `sink` is omitted. */
|
|
248
|
+
memory() {
|
|
249
|
+
return async () => {
|
|
250
|
+
const { InProcessTokenStreamSink } = await import('../in-process-sink.js');
|
|
251
|
+
return new InProcessTokenStreamSink();
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* The Redis multi-replica sink: any pod can serve any run's SSE stream. Builds a
|
|
256
|
+
* {@link RedisStreamClient} over `@adonisjs/redis` (imported lazily here), or uses `config.client` when
|
|
257
|
+
* provided. Requires `@adonisjs/redis` installed + configured (`config/redis.ts`) unless a `client` is
|
|
258
|
+
* passed.
|
|
259
|
+
*/
|
|
260
|
+
redis(config = {}) {
|
|
261
|
+
return async () => {
|
|
262
|
+
const { RedisTokenStreamSink } = await import('../redis-token-stream-sink.js');
|
|
263
|
+
const client = config.client ?? (await buildAdonisRedisClient(config.connection));
|
|
264
|
+
return new RedisTokenStreamSink(client, {
|
|
265
|
+
...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
/** Alias of {@link tokenSinks}. */
|
|
271
|
+
export const streamTransports = tokenSinks;
|
|
272
|
+
/**
|
|
273
|
+
* Lazily import `@adonisjs/redis` and adapt its connection to a {@link RedisStreamClient}. The specifier
|
|
274
|
+
* is held in a variable so TypeScript does NOT resolve the (optional, possibly-uninstalled) module at
|
|
275
|
+
* build time — it stays a runtime-only dependency. Uses a DEDICATED duplicated connection per subscribe
|
|
276
|
+
* (a subscribed Redis connection can't run other commands).
|
|
277
|
+
*/
|
|
278
|
+
async function buildAdonisRedisClient(connection) {
|
|
279
|
+
const specifier = '@adonisjs/redis/services/main';
|
|
280
|
+
const mod = (await import(specifier));
|
|
281
|
+
const redis = mod.default;
|
|
282
|
+
const conn = connection !== undefined ? redis.connection(connection) : redis.connection();
|
|
283
|
+
return adaptIoRedis(conn.ioConnection);
|
|
284
|
+
}
|
|
285
|
+
/** Adapt an `ioredis`-shaped client to {@link RedisStreamClient}, using a duplicated subscriber connection. */
|
|
286
|
+
function adaptIoRedis(io) {
|
|
287
|
+
return {
|
|
288
|
+
rpush: async (key, value) => {
|
|
289
|
+
await io.rpush(key, value);
|
|
290
|
+
},
|
|
291
|
+
lrange: (key, start, stop) => io.lrange(key, start, stop),
|
|
292
|
+
set: async (key, value) => {
|
|
293
|
+
await io.set(key, value);
|
|
294
|
+
},
|
|
295
|
+
get: (key) => io.get(key),
|
|
296
|
+
publish: async (channel, message) => {
|
|
297
|
+
await io.publish(channel, message);
|
|
298
|
+
},
|
|
299
|
+
subscribe: async (channel, onMessage) => {
|
|
300
|
+
const subscriber = io.duplicate();
|
|
301
|
+
const listener = (incoming, message) => {
|
|
302
|
+
if (incoming === channel) {
|
|
303
|
+
onMessage(message);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
subscriber.on('message', listener);
|
|
307
|
+
await subscriber.subscribe(channel);
|
|
308
|
+
return async () => {
|
|
309
|
+
subscriber.off('message', listener);
|
|
310
|
+
await subscriber.unsubscribe(channel);
|
|
311
|
+
await subscriber.quit();
|
|
312
|
+
};
|
|
313
|
+
},
|
|
314
|
+
del: async (...keys) => {
|
|
315
|
+
await io.del(...keys);
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* The actor-directory factory namespace used in `config/agent.ts`, mirroring {@link stores}:
|
|
321
|
+
*
|
|
322
|
+
* ```ts
|
|
323
|
+
* export default defineConfig({
|
|
324
|
+
* actorDirectory: actorDirectories.memory({ labels: { u_1: 'Ada Lovelace' } }),
|
|
325
|
+
* })
|
|
326
|
+
* ```
|
|
327
|
+
*
|
|
328
|
+
* Omit `actorDirectory` → governance surfaces render raw opaque refs. A real deployment binds its own
|
|
329
|
+
* directory over the host's user table by passing an instance; `actorDirectories.memory` covers tests,
|
|
330
|
+
* the offline demo, and small fixed label tables.
|
|
331
|
+
*/
|
|
332
|
+
export const actorDirectories = {
|
|
333
|
+
/** In-memory `actorRef → label` map — single-process. Handy for tests and dev apps. */
|
|
334
|
+
memory(config = {}) {
|
|
335
|
+
return async () => {
|
|
336
|
+
const { InMemoryActorDirectory } = await import('../testing/in-memory-actor-directory.js');
|
|
337
|
+
return new InMemoryActorDirectory(config.labels ?? {});
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/stores/factory.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,2FAA2F;IAC3F,MAAM,CAAC,UAA6B,EAAE;QACpC,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;YAC7E,OAAO,IAAI,kBAAkB,EAAE,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,KAAK,CAAC,SAA2B,EAAE;QACjC,OAAO,KAAK,IAAI,EAAE;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC;YACjE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS;gBAC7C,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;gBAClC,CAAC,CAAC,EAAE,CAAiC,CAAC;YACxC,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE;gBACjC,GAAG,CAAC,MAAM,CAAC,gBAAgB,KAAK,SAAS;oBACvC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,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;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AgentStore } from '../spi/agent-store.js';
|
|
2
|
+
import type { QuotaStore } from '../spi/quota-store.js';
|
|
3
|
+
import type { QuotaState } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* A production {@link QuotaStore} backed by the persisted usage ledger (the append-only
|
|
6
|
+
* `agent_token_usage` table the Lucid store writes each turn to). `check` reads the actor's
|
|
7
|
+
* tokens-so-far for the day straight from {@link AgentStore.quotaToday} and compares it to a fixed
|
|
8
|
+
* daily limit; `bump` is a deliberate no-op because the loop's `recordUsage` already writes every
|
|
9
|
+
* turn's tokens to that same ledger. One source of truth — so enforcement and what a usage dashboard
|
|
10
|
+
* reports can never drift, and it works across replicas with no extra shared state.
|
|
11
|
+
*
|
|
12
|
+
* Ledger-agnostic by design: it wraps any {@link AgentStore} (the `lucid` store for production, the
|
|
13
|
+
* in-memory store for tests), so no dedicated quota table is needed — the token-usage ledger IS the
|
|
14
|
+
* ledger. Wire it in `config/agent.ts` via `quota: quotas.ledger({ limitTokens })`.
|
|
15
|
+
*/
|
|
16
|
+
export declare class LedgerQuotaStore implements QuotaStore {
|
|
17
|
+
private readonly store;
|
|
18
|
+
private readonly limitTokens;
|
|
19
|
+
constructor(store: AgentStore, limitTokens: number);
|
|
20
|
+
check(actorRef: string, day: string): Promise<QuotaState>;
|
|
21
|
+
bump(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ledger-quota.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-quota.d.ts","sourceRoot":"","sources":["../../../src/stores/ledger-quota.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,UAAU;IAE/C,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,MAAM;IAGhC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IASzD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A production {@link QuotaStore} backed by the persisted usage ledger (the append-only
|
|
3
|
+
* `agent_token_usage` table the Lucid store writes each turn to). `check` reads the actor's
|
|
4
|
+
* tokens-so-far for the day straight from {@link AgentStore.quotaToday} and compares it to a fixed
|
|
5
|
+
* daily limit; `bump` is a deliberate no-op because the loop's `recordUsage` already writes every
|
|
6
|
+
* turn's tokens to that same ledger. One source of truth — so enforcement and what a usage dashboard
|
|
7
|
+
* reports can never drift, and it works across replicas with no extra shared state.
|
|
8
|
+
*
|
|
9
|
+
* Ledger-agnostic by design: it wraps any {@link AgentStore} (the `lucid` store for production, the
|
|
10
|
+
* in-memory store for tests), so no dedicated quota table is needed — the token-usage ledger IS the
|
|
11
|
+
* ledger. Wire it in `config/agent.ts` via `quota: quotas.ledger({ limitTokens })`.
|
|
12
|
+
*/
|
|
13
|
+
export class LedgerQuotaStore {
|
|
14
|
+
store;
|
|
15
|
+
limitTokens;
|
|
16
|
+
constructor(store, limitTokens) {
|
|
17
|
+
this.store = store;
|
|
18
|
+
this.limitTokens = limitTokens;
|
|
19
|
+
}
|
|
20
|
+
async check(actorRef, day) {
|
|
21
|
+
const { usedTokens } = await this.store.quotaToday(actorRef, day);
|
|
22
|
+
return {
|
|
23
|
+
usedTokens,
|
|
24
|
+
limitTokens: this.limitTokens,
|
|
25
|
+
withinLimit: usedTokens < this.limitTokens,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async bump() {
|
|
29
|
+
// No-op: the ledger is the source of truth — recordUsage already persisted this turn's tokens.
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ledger-quota.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-quota.js","sourceRoot":"","sources":["../../../src/stores/ledger-quota.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAER;IACA;IAFnB,YACmB,KAAiB,EACjB,WAAmB;QADnB,UAAK,GAAL,KAAK,CAAY;QACjB,gBAAW,GAAX,WAAW,CAAQ;IACnC,CAAC;IAEJ,KAAK,CAAC,KAAK,CAAC,QAAgB,EAAE,GAAW;QACvC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAClE,OAAO;YACL,UAAU;YACV,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC,WAAW;SAC3C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,+FAA+F;IACjG,CAAC;CACF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ActorSpendRow, AgentGovernanceQueries, GovernanceRange, ListRunsFilter, ListRunsResult, ModelSpendRow, PendingApprovalRow, PendingApprovalsFilter, PerToolStatRow, RunDetail, RunReliability, ThreadActivityRow, ToolCallActivityRow, ToolStatsRange, UsageTrendPoint } from '../spi/governance-queries.js';
|
|
2
|
+
import type { AgentPricingStore } from '../spi/pricing-store.js';
|
|
3
|
+
import type { LucidDatabaseLike } from './lucid.js';
|
|
4
|
+
/**
|
|
5
|
+
* A production {@link AgentGovernanceQueries} — the read/analytics half of the store SPI — backed by
|
|
6
|
+
* AdonisJS **Lucid** (Knex) over the same five agent tables {@link import('./lucid.js').LucidAgentStore}
|
|
7
|
+
* writes. Like the store it touches only the structural {@link LucidDatabaseLike} slice, so
|
|
8
|
+
* `@adonisjs/lucid` stays an *optional peer* (the factory casts the real `db` in).
|
|
9
|
+
*
|
|
10
|
+
* Cost is the token ledger priced against the current prices from the injected {@link AgentPricingStore}
|
|
11
|
+
* (fetched once per query, exactly like the Drizzle/MikroORM references and the loop's cost fold), so a
|
|
12
|
+
* host that binds its own pricing store controls the cost every governance surface reports. A
|
|
13
|
+
* provider-reported `cost_usd` on a usage row always wins; an unpriced model contributes 0 cost (its
|
|
14
|
+
* tokens still count). Omit the pricing store entirely for a zero-cost read-model. Aggregation is
|
|
15
|
+
* in-process (like `quotaToday`) so UTC-day bucketing stays dialect-portable across SQLite/Postgres/MySQL
|
|
16
|
+
* — the behavioral twin of {@link import('../testing/in-memory-governance-queries.js').InMemoryGovernanceQueries}.
|
|
17
|
+
*/
|
|
18
|
+
export declare class LucidGovernanceQueries implements AgentGovernanceQueries {
|
|
19
|
+
private readonly db;
|
|
20
|
+
private readonly pricingStore?;
|
|
21
|
+
constructor(db: LucidDatabaseLike, pricingStore?: AgentPricingStore | undefined);
|
|
22
|
+
private loadPricing;
|
|
23
|
+
/** Provider-reported cost wins per row; otherwise the cache-aware token estimate (0 when unpriced). */
|
|
24
|
+
private rowCost;
|
|
25
|
+
/** The usage ledger rows whose `created_at` falls inside the inclusive UTC-day range. */
|
|
26
|
+
private usageInRange;
|
|
27
|
+
spendByModel(range: GovernanceRange): Promise<ModelSpendRow[]>;
|
|
28
|
+
spendByActor(range: GovernanceRange): Promise<ActorSpendRow[]>;
|
|
29
|
+
usageTrend(range: GovernanceRange): Promise<UsageTrendPoint[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Newest-first recent tool calls, capped at `limit`. Resolves each call's `threadId` through its
|
|
32
|
+
* owning message (the structural query slice has no `join`, so it's one lookup per call — bounded by
|
|
33
|
+
* `limit`, mirroring the reference adapters' N+1 for the recent feeds).
|
|
34
|
+
*/
|
|
35
|
+
recentToolCalls(limit: number): Promise<ToolCallActivityRow[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Newest-first recent threads (soft-deleted excluded, mirroring `listThreads`/the reference), each
|
|
38
|
+
* with its message count and rolled-up token total, capped at `limit`.
|
|
39
|
+
*/
|
|
40
|
+
recentThreads(limit: number): Promise<ThreadActivityRow[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Filterable, cursor-paginated run list, newest-first (`started_at` desc, then `id` desc for a
|
|
43
|
+
* stable tiebreak). The cursor is an opaque offset (over the SAME filter set); a page fetches
|
|
44
|
+
* `limit + 1` rows to learn whether a next page exists. A store without recorded runs yields an
|
|
45
|
+
* empty page.
|
|
46
|
+
*/
|
|
47
|
+
listRuns(filter?: ListRunsFilter): Promise<ListRunsResult>;
|
|
48
|
+
/**
|
|
49
|
+
* The full trace of one run: the run row plus every message / tool call / usage row stamped with
|
|
50
|
+
* its `run_id` (oldest first), and the subset of tool calls still `pending_approval`. `null` when
|
|
51
|
+
* the run is unknown.
|
|
52
|
+
*/
|
|
53
|
+
runDetail(runId: string): Promise<RunDetail | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Tool calls sitting `pending_approval`, oldest first (an inbox drains from the back). Each call's
|
|
56
|
+
* owning actor is resolved through its run (`run_id → agent_run.actor_ref`), falling back to its
|
|
57
|
+
* thread (`message → agent_thread.actor_ref`) for a call recorded before run tracking. The `actor`
|
|
58
|
+
* filter is applied after resolution; `limit` caps the returned inbox.
|
|
59
|
+
*/
|
|
60
|
+
pendingApprovals(filter?: PendingApprovalsFilter): Promise<PendingApprovalRow[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Per-tool call/failure/rejection/latency rollup over the (optional) range, highest call count
|
|
63
|
+
* first. `avgDurationMs` is the mean `execution_ms` across calls that recorded one; `null` when
|
|
64
|
+
* none did.
|
|
65
|
+
*/
|
|
66
|
+
perToolStats(range?: ToolStatsRange): Promise<PerToolStatRow[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Success / failure / cancel rates + mean settled-run duration over the (optional) range, bucketed
|
|
69
|
+
* on `started_at`. A store without recorded runs yields all zeros / `null` duration.
|
|
70
|
+
*/
|
|
71
|
+
runReliability(range?: ToolStatsRange): Promise<RunReliability>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=lucid-governance-queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucid-governance-queries.d.ts","sourceRoot":"","sources":["../../../src/stores/lucid-governance-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,cAAc,EACd,SAAS,EAET,cAAc,EAId,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,yBAAyB,CAAC;AAGpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsHpD;;;;;;;;;;;;;GAaG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB;IAEjE,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBADb,EAAE,EAAE,iBAAiB,EACrB,YAAY,CAAC,EAAE,iBAAiB,YAAA;YAGrC,WAAW;IASzB,uGAAuG;IACvG,OAAO,CAAC,OAAO;IAef,yFAAyF;YAC3E,YAAY;IAWpB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA6B9D,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAoB9D,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAiBpE;;;;OAIG;IACG,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO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