@adonis-agora/agent 0.20.0 → 0.22.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/CHANGELOG.md +23 -0
- package/README.md +39 -1
- package/dist/assets/spa/assets/index-D8pLS_sd.css +1 -0
- package/dist/assets/spa/assets/index-DoUZ23yb.js +9 -0
- package/dist/assets/spa/index.html +13 -0
- package/dist/configure.d.ts +11 -6
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +12 -6
- package/dist/configure.js.map +1 -1
- package/dist/providers/agent_provider.d.ts.map +1 -1
- package/dist/providers/agent_provider.js +6 -0
- package/dist/providers/agent_provider.js.map +1 -1
- package/dist/providers/dashboard_provider.d.ts +55 -0
- package/dist/providers/dashboard_provider.d.ts.map +1 -0
- package/dist/providers/dashboard_provider.js +152 -0
- package/dist/providers/dashboard_provider.js.map +1 -0
- package/dist/src/dashboard/define_config.d.ts +75 -0
- package/dist/src/dashboard/define_config.d.ts.map +1 -0
- package/dist/src/dashboard/define_config.js +56 -0
- package/dist/src/dashboard/define_config.js.map +1 -0
- package/dist/src/dashboard/gate.d.ts +33 -0
- package/dist/src/dashboard/gate.d.ts.map +1 -0
- package/dist/src/dashboard/gate.js +52 -0
- package/dist/src/dashboard/gate.js.map +1 -0
- package/dist/src/dashboard/index.d.ts +20 -0
- package/dist/src/dashboard/index.d.ts.map +1 -0
- package/dist/src/dashboard/index.js +20 -0
- package/dist/src/dashboard/index.js.map +1 -0
- package/dist/src/dashboard/paths.d.ts +40 -0
- package/dist/src/dashboard/paths.d.ts.map +1 -0
- package/dist/src/dashboard/paths.js +99 -0
- package/dist/src/dashboard/paths.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/telescope/agent-governance-providers.d.ts +67 -0
- package/dist/src/telescope/agent-governance-providers.d.ts.map +1 -0
- package/dist/src/telescope/agent-governance-providers.js +312 -0
- package/dist/src/telescope/agent-governance-providers.js.map +1 -0
- package/dist/src/telescope/dashboard.d.ts +28 -8
- package/dist/src/telescope/dashboard.d.ts.map +1 -1
- package/dist/src/telescope/dashboard.js +233 -4
- package/dist/src/telescope/dashboard.js.map +1 -1
- package/dist/src/telescope/data-providers.d.ts +40 -1
- package/dist/src/telescope/data-providers.d.ts.map +1 -1
- package/dist/src/telescope/data-providers.js +19 -8
- package/dist/src/telescope/data-providers.js.map +1 -1
- package/dist/src/telescope/extension.d.ts +59 -14
- package/dist/src/telescope/extension.d.ts.map +1 -1
- package/dist/src/telescope/extension.js +90 -13
- package/dist/src/telescope/extension.js.map +1 -1
- package/dist/src/telescope/governance-registry.d.ts +15 -0
- package/dist/src/telescope/governance-registry.d.ts.map +1 -0
- package/dist/src/telescope/governance-registry.js +42 -0
- package/dist/src/telescope/governance-registry.js.map +1 -0
- package/dist/src/telescope/index.d.ts +4 -2
- package/dist/src/telescope/index.d.ts.map +1 -1
- package/dist/src/telescope/index.js +3 -1
- package/dist/src/telescope/index.js.map +1 -1
- package/dist/src/telescope/rag-data-providers.d.ts +69 -0
- package/dist/src/telescope/rag-data-providers.d.ts.map +1 -0
- package/dist/src/telescope/rag-data-providers.js +84 -0
- package/dist/src/telescope/rag-data-providers.js.map +1 -0
- package/dist/src/telescope/telescope-sdk.d.ts +11 -0
- package/dist/src/telescope/telescope-sdk.d.ts.map +1 -1
- package/dist/stubs/config/agent.stub +7 -0
- package/package.json +28 -18
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { DataProvider } from './telescope-sdk.js';
|
|
2
|
+
/**
|
|
3
|
+
* RAG data providers for the "Agent" Telescope tab — a DELIBERATELY PARTIAL port of the Nest
|
|
4
|
+
* reference's `rag-data-providers.ts`.
|
|
5
|
+
*
|
|
6
|
+
* ## What Adonis's retrieval instrumentation actually publishes
|
|
7
|
+
*
|
|
8
|
+
* `@adonis-agora/agent` has exactly ONE retrieval telemetry point today: `agent-loop.ts`'s
|
|
9
|
+
* inject-mode retrieval path (`deps.retriever` configured) publishes `agora:agent:retrieved` via
|
|
10
|
+
* `publishAgentRetrieved` (`src/diagnostics.ts`) with payload `{ runId, queryLength, count }` —
|
|
11
|
+
* nothing else. Telescope's generic diagnostics bridge records it as any other `lib:agent` event:
|
|
12
|
+
* `type: 'diagnostic'`, `tag: 'lib:agent'`, `content: { event: 'retrieved', payload: {...} }`.
|
|
13
|
+
*
|
|
14
|
+
* That payload has NO `store`, `collection`, `retriever` kind, `topScore`, or `durationMs` — unlike
|
|
15
|
+
* `@dudousxd/nestjs-agent-rag`'s dedicated `aviary:rag:retrieval` channel, which is what lets the
|
|
16
|
+
* Nest reference build latency histograms, score distributions, and store/collection breakdowns.
|
|
17
|
+
* `agent-loop.ts` DOES span the retrieval (`spannedAgent('retrieval', ...)`, which carries `topK` and
|
|
18
|
+
* a `count` result on its `asyncEnd`), but those spans ride raw `node:diagnostics_channel` sub-channels
|
|
19
|
+
* (`agora:agent:retrieval:start/end/asyncStart/asyncEnd/error`) that NOTHING in `@adonis-agora/telescope`
|
|
20
|
+
* subscribes to today — confirmed by reading its `diagnostics_watcher.ts` and every `metrics/*.ts` file:
|
|
21
|
+
* the generic bridge only auto-subscribes to POINT channels a producer registers via
|
|
22
|
+
* `@adonis-agora/diagnostics`'s `registry.channels`, and `spannedAgent` publishes on ad-hoc sub-channel
|
|
23
|
+
* names it never registers there (by design — it avoids importing `@adonis-agora/diagnostics` at all).
|
|
24
|
+
* So the span data is not lost, exactly, but nothing today turns it into a recorded Telescope entry;
|
|
25
|
+
* building that bridge is a `@adonis-agora/telescope` (or `@adonis-agora/diagnostics`) change, not
|
|
26
|
+
* something this file can conjure from the entries Telescope already has.
|
|
27
|
+
*
|
|
28
|
+
* ## What that leaves portable
|
|
29
|
+
*
|
|
30
|
+
* From `{ runId, queryLength, count }` alone: how many retrievals happened, what fraction came back
|
|
31
|
+
* empty (`count === 0`), the mean passage count, and a retrievals/zero-hits trend. That is FOUR of the
|
|
32
|
+
* Nest reference's ten RAG providers. The other six — latency distribution, score distribution,
|
|
33
|
+
* store breakdown, retriever breakdown, per-collection table, slowest-retrievals table — are NOT
|
|
34
|
+
* ported: there is no field in the recorded entry for any of them, and faking one (e.g. a
|
|
35
|
+
* `durationMs` of 0 for every row) would render a chart that looks real and lies. Widening
|
|
36
|
+
* `AgentRetrieved`'s payload (and `agent-loop.ts`'s publish call) to carry that data is the real fix;
|
|
37
|
+
* it's a `src/diagnostics.ts`/`src/agent-loop.ts` instrumentation change, out of scope for a telescope
|
|
38
|
+
* extension change, and is called out as the recommended follow-up.
|
|
39
|
+
*
|
|
40
|
+
* ## Shares the SAME 5,000-entry window as every other agent provider
|
|
41
|
+
*
|
|
42
|
+
* Unlike the Nest reference — where `RagTelescopeWatcher` gives retrieval events their OWN entry type
|
|
43
|
+
* (`agent-rag`) specifically so a busy retrieval stream can never crowd `run.finished` out of the
|
|
44
|
+
* agent window — Adonis has no per-extension entry-type/watcher mechanism (see `extension.ts`'s
|
|
45
|
+
* header for why), so `retrieved` entries live in the exact same capped `lib:agent` slice
|
|
46
|
+
* `data-providers.ts` reads. A retrieval-heavy deployment can push older `run.*`/`tool-call` entries
|
|
47
|
+
* out of that window, and vice versa. This is an accepted, documented limitation, not an oversight.
|
|
48
|
+
*/
|
|
49
|
+
/** One retrieval, normalized out of an entry's `content.payload`. */
|
|
50
|
+
interface RagRetrieval {
|
|
51
|
+
at: number;
|
|
52
|
+
queryLength: number;
|
|
53
|
+
count: number;
|
|
54
|
+
}
|
|
55
|
+
/** Fraction (0–1) of retrievals that came back with nothing. `0` over an empty window. */
|
|
56
|
+
export declare function zeroHitRate(retrievals: RagRetrieval[]): number;
|
|
57
|
+
/** Mean passages returned per retrieval. `0` over an empty window. */
|
|
58
|
+
export declare function meanChunks(retrievals: RagRetrieval[]): number;
|
|
59
|
+
/** stat → retrievals recorded in the current window. */
|
|
60
|
+
export declare function ragRetrievalsProvider(): DataProvider;
|
|
61
|
+
/** stat (percent) → share of retrievals that returned nothing. */
|
|
62
|
+
export declare function ragZeroHitRateProvider(): DataProvider;
|
|
63
|
+
/** stat → mean passages returned per retrieval. */
|
|
64
|
+
export declare function ragChunksProvider(): DataProvider;
|
|
65
|
+
/** timeseries → retrievals and zero-hits per bucket, using the same bucketing every other agent
|
|
66
|
+
* timeseries provider uses (`data-providers.ts`'s `timeBuckets`), not a second bucketing scheme. */
|
|
67
|
+
export declare function ragTrendProvider(): DataProvider;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=rag-data-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rag-data-providers.d.ts","sourceRoot":"","sources":["../../../src/telescope/rag-data-providers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAwC,MAAM,oBAAoB,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,qEAAqE;AACrE,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AA+BD,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAI9D;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,MAAM,CAG7D;AAeD,wDAAwD;AACxD,wBAAgB,qBAAqB,IAAI,YAAY,CAEpD;AAED,kEAAkE;AAClE,wBAAgB,sBAAsB,IAAI,YAAY,CAIrD;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,IAAI,YAAY,CAEhD;AAED;oGACoG;AACpG,wBAAgB,gBAAgB,IAAI,YAAY,CAoB/C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ENTRY_LIMIT, atOf, bucketIndexFor, fetchEntries, timeBuckets } from './data-providers.js';
|
|
2
|
+
const contentOf = (e) => (e.content ?? {});
|
|
3
|
+
/** Read every recorded `retrieved` entry (newest first, capped at {@link ENTRY_LIMIT}). */
|
|
4
|
+
async function readRetrievals(ctx) {
|
|
5
|
+
const entries = await fetchEntries(ctx, ENTRY_LIMIT);
|
|
6
|
+
const retrievals = [];
|
|
7
|
+
for (const entry of entries) {
|
|
8
|
+
const content = contentOf(entry);
|
|
9
|
+
if (content.event !== 'retrieved')
|
|
10
|
+
continue;
|
|
11
|
+
retrievals.push({
|
|
12
|
+
at: atOf(entry),
|
|
13
|
+
queryLength: content.payload?.queryLength ?? 0,
|
|
14
|
+
count: content.payload?.count ?? 0,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return retrievals;
|
|
18
|
+
}
|
|
19
|
+
function round(value, places) {
|
|
20
|
+
const factor = 10 ** places;
|
|
21
|
+
return Math.round(value * factor) / factor;
|
|
22
|
+
}
|
|
23
|
+
/** Fraction (0–1) of retrievals that came back with nothing. `0` over an empty window. */
|
|
24
|
+
export function zeroHitRate(retrievals) {
|
|
25
|
+
if (retrievals.length === 0)
|
|
26
|
+
return 0;
|
|
27
|
+
const zeroHits = retrievals.filter((r) => r.count === 0).length;
|
|
28
|
+
return round(zeroHits / retrievals.length, 4);
|
|
29
|
+
}
|
|
30
|
+
/** Mean passages returned per retrieval. `0` over an empty window. */
|
|
31
|
+
export function meanChunks(retrievals) {
|
|
32
|
+
if (retrievals.length === 0)
|
|
33
|
+
return 0;
|
|
34
|
+
return round(retrievals.reduce((sum, r) => sum + r.count, 0) / retrievals.length, 2);
|
|
35
|
+
}
|
|
36
|
+
/** Build a provider from one shaping step over every recorded retrieval. */
|
|
37
|
+
function retrievalProvider(name, format) {
|
|
38
|
+
return {
|
|
39
|
+
name,
|
|
40
|
+
async resolve(_query, ctx) {
|
|
41
|
+
return format(await readRetrievals(ctx));
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** stat → retrievals recorded in the current window. */
|
|
46
|
+
export function ragRetrievalsProvider() {
|
|
47
|
+
return retrievalProvider('agent.rag.retrievals', (retrievals) => ({ value: retrievals.length }));
|
|
48
|
+
}
|
|
49
|
+
/** stat (percent) → share of retrievals that returned nothing. */
|
|
50
|
+
export function ragZeroHitRateProvider() {
|
|
51
|
+
return retrievalProvider('agent.rag.zeroHitRate', (retrievals) => ({
|
|
52
|
+
value: zeroHitRate(retrievals),
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
/** stat → mean passages returned per retrieval. */
|
|
56
|
+
export function ragChunksProvider() {
|
|
57
|
+
return retrievalProvider('agent.rag.chunks', (retrievals) => ({ value: meanChunks(retrievals) }));
|
|
58
|
+
}
|
|
59
|
+
/** timeseries → retrievals and zero-hits per bucket, using the same bucketing every other agent
|
|
60
|
+
* timeseries provider uses (`data-providers.ts`'s `timeBuckets`), not a second bucketing scheme. */
|
|
61
|
+
export function ragTrendProvider() {
|
|
62
|
+
return {
|
|
63
|
+
name: 'agent.rag.trend',
|
|
64
|
+
async resolve(query, ctx) {
|
|
65
|
+
const entries = await fetchEntries(ctx, ENTRY_LIMIT);
|
|
66
|
+
const buckets = Math.max(1, Number(query?.buckets ?? 24));
|
|
67
|
+
const retrievedEntries = entries.filter((e) => contentOf(e).event === 'retrieved');
|
|
68
|
+
const { rows, minTime, bucketSize } = timeBuckets(retrievedEntries, buckets, () => ({
|
|
69
|
+
retrievals: 0,
|
|
70
|
+
zeroHits: 0,
|
|
71
|
+
}));
|
|
72
|
+
for (const entry of retrievedEntries) {
|
|
73
|
+
const row = rows[bucketIndexFor(entry, minTime, bucketSize, buckets)];
|
|
74
|
+
if (!row)
|
|
75
|
+
continue;
|
|
76
|
+
row.retrievals += 1;
|
|
77
|
+
if ((contentOf(entry).payload?.count ?? 0) === 0)
|
|
78
|
+
row.zeroHits += 1;
|
|
79
|
+
}
|
|
80
|
+
return { rows };
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=rag-data-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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|
title: string;
|
|
94
94
|
data: DataBinding;
|
|
95
95
|
columns: Column[];
|
|
96
|
+
/**
|
|
97
|
+
* Opt into paged-table mode: the UI renders prev/next controls and re-resolves this panel's
|
|
98
|
+
* provider with `query.page` (1-based) and `query.limit` merged in. The provider must then
|
|
99
|
+
* return `{ rows, total, page, limit }` instead of a bare `{ rows }`. Omit (or `false`) for
|
|
100
|
+
* the existing bare-rows table. Mirrors `@adonis-agora/telescope`'s `Panel` (table variant) —
|
|
101
|
+
* kept here so a host on a telescope version that ships it doesn't excess-property-error.
|
|
102
|
+
* None of this extension's OWN table providers opt in yet: see `agent-governance-providers.ts`
|
|
103
|
+
* for why (the governance read-model doesn't expose a page+total query for every table this
|
|
104
|
+
* would apply to).
|
|
105
|
+
*/
|
|
106
|
+
paged?: boolean;
|
|
96
107
|
} | {
|
|
97
108
|
kind: 'distribution';
|
|
98
109
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telescope-sdk.d.ts","sourceRoot":"","sources":["../../../src/telescope/telescope-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CAC9F;AAED,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACrC;AAED,gGAAgG;AAChG,MAAM,WAAW,gBAAgB;IA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,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAAE,CAAC;AAErF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9F;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,kBAAkB,EAAE,CAAC;IACzD,UAAU,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,aAAa,EAAE,CAAC;IACpD,aAAa,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAAC;CACvD"}
|
|
@@ -39,6 +39,13 @@ export default defineConfig({
|
|
|
39
39
|
// defaultRoles: ['ADMIN'], // roles a tool requires when it declares none (fail-closed)
|
|
40
40
|
// maxSteps: 8, // cap on model↔tool iterations per turn
|
|
41
41
|
|
|
42
|
+
// Governance console — served automatically at <path>/dashboard (default /agent/dashboard), no
|
|
43
|
+
// separate install. It only mounts once `governanceAuthorize` is set (every panel but Quota reads
|
|
44
|
+
// the cross-actor governance routes, which need that gate too — see the docs). Toggle it off,
|
|
45
|
+
// relocate it, or add an extra gate on top of governanceAuthorize:
|
|
46
|
+
// dashboard: { enabled: true, path: '/agent/dashboard', authorize: (actor) => actor.roles?.includes('ADMIN') ?? false },
|
|
47
|
+
// governanceAuthorize: (actor) => actor.roles?.includes('ADMIN') ?? false,
|
|
48
|
+
|
|
42
49
|
// Multimodal uploads — mounts POST /agent/attachments, which stages a file into a model-fetchable
|
|
43
50
|
// MessageAttachment the client sends back with its next chat message. Bind your own store (presign
|
|
44
51
|
// S3/GCS or wrap your media pipeline); `attachmentStores.memory()` inlines bytes as a data: URL.
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/DavideCarvalho/adonis-agent.git",
|
|
8
|
+
"url": "git+https://github.com/DavideCarvalho/adonis-agora-agent.git",
|
|
9
9
|
"directory": "packages/adonis"
|
|
10
10
|
},
|
|
11
11
|
"author": "Davi Carvalho <davi@goflip.ai>",
|
|
@@ -58,6 +58,16 @@
|
|
|
58
58
|
"import": "./dist/providers/agent_provider.js",
|
|
59
59
|
"default": "./dist/providers/agent_provider.js"
|
|
60
60
|
},
|
|
61
|
+
"./dashboard_provider": {
|
|
62
|
+
"types": "./dist/providers/dashboard_provider.d.ts",
|
|
63
|
+
"import": "./dist/providers/dashboard_provider.js",
|
|
64
|
+
"default": "./dist/providers/dashboard_provider.js"
|
|
65
|
+
},
|
|
66
|
+
"./dashboard": {
|
|
67
|
+
"types": "./dist/src/dashboard/index.d.ts",
|
|
68
|
+
"import": "./dist/src/dashboard/index.js",
|
|
69
|
+
"default": "./dist/src/dashboard/index.js"
|
|
70
|
+
},
|
|
61
71
|
"./configure": {
|
|
62
72
|
"types": "./dist/configure.d.ts",
|
|
63
73
|
"import": "./dist/configure.js",
|
|
@@ -106,8 +116,8 @@
|
|
|
106
116
|
],
|
|
107
117
|
"sideEffects": false,
|
|
108
118
|
"dependencies": {
|
|
109
|
-
"@modelcontextprotocol/sdk": "
|
|
110
|
-
"@standard-schema/spec": "
|
|
119
|
+
"@modelcontextprotocol/sdk": "1.30.0",
|
|
120
|
+
"@standard-schema/spec": "1.1.0"
|
|
111
121
|
},
|
|
112
122
|
"peerDependencies": {
|
|
113
123
|
"@adonis-agora/authz": ">=0.4.2 <1.0.0",
|
|
@@ -166,27 +176,27 @@
|
|
|
166
176
|
}
|
|
167
177
|
},
|
|
168
178
|
"devDependencies": {
|
|
169
|
-
"@adonis-agora/authz": "
|
|
170
|
-
"@adonis-agora/diagnostics": "
|
|
179
|
+
"@adonis-agora/authz": "0.10.1",
|
|
180
|
+
"@adonis-agora/diagnostics": "0.2.5",
|
|
171
181
|
"@adonis-agora/durable": "0.21.0",
|
|
172
|
-
"@adonis-agora/telescope": "
|
|
173
|
-
"@adonisjs/assembler": "
|
|
182
|
+
"@adonis-agora/telescope": "0.6.0",
|
|
183
|
+
"@adonisjs/assembler": "8.4.0",
|
|
174
184
|
"@adonisjs/core": "7.4.0",
|
|
175
|
-
"@adonisjs/lucid": "
|
|
185
|
+
"@adonisjs/lucid": "22.4.2",
|
|
176
186
|
"@qdrant/js-client-rest": "1.19.0",
|
|
177
|
-
"@types/node": "
|
|
187
|
+
"@types/node": "22.20.0",
|
|
178
188
|
"@types/react": "19.2.18",
|
|
179
189
|
"ai": "7.0.59",
|
|
180
|
-
"better-sqlite3": "
|
|
181
|
-
"luxon": "
|
|
182
|
-
"node-sql-parser": "
|
|
190
|
+
"better-sqlite3": "11.10.0",
|
|
191
|
+
"luxon": "3.7.2",
|
|
192
|
+
"node-sql-parser": "5.4.0",
|
|
183
193
|
"react": "19.2.8",
|
|
184
|
-
"typescript": "
|
|
185
|
-
"vitest": "
|
|
186
|
-
"zod": "
|
|
194
|
+
"typescript": "5.9.3",
|
|
195
|
+
"vitest": "3.2.7",
|
|
196
|
+
"zod": "3.25.76"
|
|
187
197
|
},
|
|
188
198
|
"engines": {
|
|
189
|
-
"node": "
|
|
199
|
+
"node": "v22.23.2"
|
|
190
200
|
},
|
|
191
201
|
"keywords": [
|
|
192
202
|
"adonisjs",
|
|
@@ -204,7 +214,7 @@
|
|
|
204
214
|
"build": "pnpm run clean && tsc -p tsconfig.build.json && pnpm run copy:stubs && pnpm run check:dist",
|
|
205
215
|
"check:dist": "node ../../scripts/assert-build-output.mjs dist src/index.js",
|
|
206
216
|
"clean": "rm -rf dist",
|
|
207
|
-
"copy:stubs": "mkdir -p dist/stubs/config dist/stubs/database/migrations && cp stubs/config/agent.stub dist/stubs/config/agent.stub && cp stubs/config/mcp.stub dist/stubs/config/mcp.stub && cp -r stubs/database/migrations/. dist/stubs/database/migrations/",
|
|
217
|
+
"copy:stubs": "mkdir -p dist/stubs/config dist/stubs/database/migrations dist/assets && cp stubs/config/agent.stub dist/stubs/config/agent.stub && cp stubs/config/mcp.stub dist/stubs/config/mcp.stub && cp -r stubs/database/migrations/. dist/stubs/database/migrations/ && rm -rf dist/assets/spa && cp -r ../dashboard/dist/spa dist/assets/spa",
|
|
208
218
|
"test": "vitest run --passWithNoTests",
|
|
209
219
|
"test:watch": "vitest",
|
|
210
220
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json"
|