@cratis/ai 2.14.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/dist/cjs/generated/Harnesses/Harness.js +16 -0
- package/dist/cjs/generated/Harnesses/Harness.js.map +1 -0
- package/dist/cjs/generated/Usage/Daily/AgentUsageByDay.js +99 -0
- package/dist/cjs/generated/Usage/Daily/AgentUsageByDay.js.map +1 -0
- package/dist/cjs/generated/Usage/Daily/LastYear.js +61 -0
- package/dist/cjs/generated/Usage/Daily/LastYear.js.map +1 -0
- package/dist/cjs/generated/Usage/RecordAgentSessionUsage.js +194 -0
- package/dist/cjs/generated/Usage/RecordAgentSessionUsage.js.map +1 -0
- package/dist/cjs/generated/Usage/Trends/AgentUsageByMonth.js +50 -0
- package/dist/cjs/generated/Usage/Trends/AgentUsageByMonth.js.map +1 -0
- package/dist/cjs/generated/Usage/Trends/AgentUsageByWeek.js +50 -0
- package/dist/cjs/generated/Usage/Trends/AgentUsageByWeek.js.map +1 -0
- package/dist/cjs/generated/Usage/Trends/RecentMonths.js +61 -0
- package/dist/cjs/generated/Usage/Trends/RecentMonths.js.map +1 -0
- package/dist/cjs/generated/Usage/Trends/RecentWeeks.js +61 -0
- package/dist/cjs/generated/Usage/Trends/RecentWeeks.js.map +1 -0
- package/dist/cjs/index.js +23 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/esm/generated/Harnesses/Harness.d.ts +5 -0
- package/dist/esm/generated/Harnesses/Harness.d.ts.map +1 -0
- package/dist/esm/generated/Harnesses/Harness.js +14 -0
- package/dist/esm/generated/Harnesses/Harness.js.map +1 -0
- package/dist/esm/generated/Harnesses/index.d.ts +2 -0
- package/dist/esm/generated/Harnesses/index.d.ts.map +1 -0
- package/dist/esm/generated/Harnesses/index.js +2 -0
- package/dist/esm/generated/Harnesses/index.js.map +1 -0
- package/dist/esm/generated/Usage/Daily/AgentUsageByDay.d.ts +16 -0
- package/dist/esm/generated/Usage/Daily/AgentUsageByDay.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Daily/AgentUsageByDay.js +97 -0
- package/dist/esm/generated/Usage/Daily/AgentUsageByDay.js.map +1 -0
- package/dist/esm/generated/Usage/Daily/LastYear.d.ts +31 -0
- package/dist/esm/generated/Usage/Daily/LastYear.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Daily/LastYear.js +59 -0
- package/dist/esm/generated/Usage/Daily/LastYear.js.map +1 -0
- package/dist/esm/generated/Usage/Daily/index.d.ts +3 -0
- package/dist/esm/generated/Usage/Daily/index.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Daily/index.js +3 -0
- package/dist/esm/generated/Usage/Daily/index.js.map +1 -0
- package/dist/esm/generated/Usage/RecordAgentSessionUsage.d.ts +73 -0
- package/dist/esm/generated/Usage/RecordAgentSessionUsage.d.ts.map +1 -0
- package/dist/esm/generated/Usage/RecordAgentSessionUsage.js +191 -0
- package/dist/esm/generated/Usage/RecordAgentSessionUsage.js.map +1 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByMonth.d.ts +6 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByMonth.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByMonth.js +48 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByMonth.js.map +1 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByWeek.d.ts +6 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByWeek.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByWeek.js +48 -0
- package/dist/esm/generated/Usage/Trends/AgentUsageByWeek.js.map +1 -0
- package/dist/esm/generated/Usage/Trends/RecentMonths.d.ts +31 -0
- package/dist/esm/generated/Usage/Trends/RecentMonths.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Trends/RecentMonths.js +59 -0
- package/dist/esm/generated/Usage/Trends/RecentMonths.js.map +1 -0
- package/dist/esm/generated/Usage/Trends/RecentWeeks.d.ts +31 -0
- package/dist/esm/generated/Usage/Trends/RecentWeeks.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Trends/RecentWeeks.js +59 -0
- package/dist/esm/generated/Usage/Trends/RecentWeeks.js.map +1 -0
- package/dist/esm/generated/Usage/Trends/index.d.ts +5 -0
- package/dist/esm/generated/Usage/Trends/index.d.ts.map +1 -0
- package/dist/esm/generated/Usage/Trends/index.js +5 -0
- package/dist/esm/generated/Usage/Trends/index.js.map +1 -0
- package/dist/esm/generated/Usage/index.d.ts +2 -0
- package/dist/esm/generated/Usage/index.d.ts.map +1 -0
- package/dist/esm/generated/Usage/index.js +2 -0
- package/dist/esm/generated/Usage/index.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/generated/Harnesses/Harness.ts +13 -0
- package/generated/Harnesses/index.ts +1 -0
- package/generated/Usage/Daily/AgentUsageByDay.ts +77 -0
- package/generated/Usage/Daily/LastYear.ts +78 -0
- package/generated/Usage/Daily/index.ts +2 -0
- package/generated/Usage/RecordAgentSessionUsage.ts +298 -0
- package/generated/Usage/Trends/AgentUsageByMonth.ts +32 -0
- package/generated/Usage/Trends/AgentUsageByWeek.ts +32 -0
- package/generated/Usage/Trends/RecentMonths.ts +78 -0
- package/generated/Usage/Trends/RecentWeeks.ts +78 -0
- package/generated/Usage/Trends/index.ts +4 -0
- package/generated/Usage/index.ts +1 -0
- package/index.ts +14 -0
- package/package.json +59 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var queries = require('@cratis/arc/queries');
|
|
4
|
+
var queries$1 = require('@cratis/arc.react/queries');
|
|
5
|
+
var AgentUsageByWeek = require('./AgentUsageByWeek.js');
|
|
6
|
+
|
|
7
|
+
// @generated by Cratis. Source: Cratis.AI.Usage.Trends.AgentUsageByWeek. Time: 2026-09-15T09:45:50.6993030Z. Hash: D66AFEC531F3FED5A5909A0C97F3BEF11E54213E02D6B55E664A8C0671371133
|
|
8
|
+
/*---------------------------------------------------------------------------------------------
|
|
9
|
+
* **DO NOT EDIT** - This file is an automatically generated file.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/ /* eslint-disable sort-imports */ // eslint-disable-next-line header/header
|
|
11
|
+
class RecentWeeksSortBy {
|
|
12
|
+
query;
|
|
13
|
+
constructor(query){
|
|
14
|
+
this.query = query;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class RecentWeeksSortByWithoutQuery {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets the most recent weeks that recorded any agent session usage, oldest first.
|
|
21
|
+
*/ class RecentWeeks extends queries.QueryFor {
|
|
22
|
+
route = '/api/a-i/usage/trends/recent-weeks';
|
|
23
|
+
queryName = 'Cratis.AI.Usage.Trends.AgentUsageByWeek.RecentWeeks';
|
|
24
|
+
treatWarningsAsErrors = false;
|
|
25
|
+
roles = [];
|
|
26
|
+
defaultValue = [];
|
|
27
|
+
_sortBy;
|
|
28
|
+
static _sortBy = new RecentWeeksSortByWithoutQuery();
|
|
29
|
+
constructor(){
|
|
30
|
+
super(AgentUsageByWeek.AgentUsageByWeek, true);
|
|
31
|
+
this._sortBy = new RecentWeeksSortBy(this);
|
|
32
|
+
}
|
|
33
|
+
get requiredRequestParameters() {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
parameterDescriptors = [];
|
|
37
|
+
get sortBy() {
|
|
38
|
+
return this._sortBy;
|
|
39
|
+
}
|
|
40
|
+
static get sortBy() {
|
|
41
|
+
return this._sortBy;
|
|
42
|
+
}
|
|
43
|
+
static use(sorting) {
|
|
44
|
+
return queries$1.useQuery(RecentWeeks, undefined, sorting);
|
|
45
|
+
}
|
|
46
|
+
static useWithPaging(pageSize, sorting) {
|
|
47
|
+
return queries$1.useQueryWithPaging(RecentWeeks, new queries.Paging(0, pageSize), undefined, sorting);
|
|
48
|
+
}
|
|
49
|
+
static useSuspense(sorting) {
|
|
50
|
+
return queries$1.useSuspenseQuery(RecentWeeks, undefined, sorting);
|
|
51
|
+
}
|
|
52
|
+
static useSuspenseWithPaging(pageSize, sorting) {
|
|
53
|
+
return queries$1.useSuspenseQueryWithPaging(RecentWeeks, new queries.Paging(0, pageSize), undefined, sorting);
|
|
54
|
+
}
|
|
55
|
+
static when(condition) {
|
|
56
|
+
return new queries$1.QueryWhen(RecentWeeks, condition);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.RecentWeeks = RecentWeeks;
|
|
61
|
+
//# sourceMappingURL=RecentWeeks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecentWeeks.js","sources":["../../../../../generated/Usage/Trends/RecentWeeks.ts"],"sourcesContent":["// @generated by Cratis. Source: Cratis.AI.Usage.Trends.AgentUsageByWeek. Time: 2026-09-15T09:45:50.6993030Z. Hash: D66AFEC531F3FED5A5909A0C97F3BEF11E54213E02D6B55E664A8C0671371133\n/*---------------------------------------------------------------------------------------------\n * **DO NOT EDIT** - This file is an automatically generated file.\n *--------------------------------------------------------------------------------------------*/\n\n/* eslint-disable sort-imports */\n// eslint-disable-next-line header/header\nimport { QueryFor, QueryResultWithState, Sorting, Paging } from '@cratis/arc/queries';\nimport { useQuery, useQueryWithPaging, useSuspenseQuery, useSuspenseQueryWithPaging, PerformQuery, SetSorting, SetPage, SetPageSize, QueryWhen } from '@cratis/arc.react/queries';\nimport { ParameterDescriptor } from '@cratis/arc/reflection';\nimport { AgentUsageByWeek } from './AgentUsageByWeek';\n\nclass RecentWeeksSortBy {\n\n constructor(readonly query: RecentWeeks) {\n }\n\n}\n\nclass RecentWeeksSortByWithoutQuery {\n\n}\n\n\n/**\n * Gets the most recent weeks that recorded any agent session usage, oldest first.\n */\nexport class RecentWeeks extends QueryFor<AgentUsageByWeek[]> {\n readonly route: string = '/api/a-i/usage/trends/recent-weeks';\n readonly queryName: string = 'Cratis.AI.Usage.Trends.AgentUsageByWeek.RecentWeeks';\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly defaultValue: AgentUsageByWeek[] = [];\n private readonly _sortBy: RecentWeeksSortBy;\n private static readonly _sortBy: RecentWeeksSortByWithoutQuery = new RecentWeeksSortByWithoutQuery();\n\n constructor() {\n super(AgentUsageByWeek, true);\n this._sortBy = new RecentWeeksSortBy(this);\n }\n\n get requiredRequestParameters(): string[] {\n return [\n ];\n }\n\n readonly parameterDescriptors: ParameterDescriptor[] = [\n ];\n\n\n get sortBy(): RecentWeeksSortBy {\n return this._sortBy;\n }\n\n static get sortBy(): RecentWeeksSortByWithoutQuery {\n return this._sortBy;\n }\n\n static use(sorting?: Sorting): [QueryResultWithState<AgentUsageByWeek[]>, PerformQuery, SetSorting] {\n return useQuery<AgentUsageByWeek[], RecentWeeks>(RecentWeeks, undefined, sorting);\n }\n\n static useWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByWeek[]>, PerformQuery, SetSorting, SetPage, SetPageSize] {\n return useQueryWithPaging<AgentUsageByWeek[], RecentWeeks>(RecentWeeks, new Paging(0, pageSize), undefined, sorting);\n }\n\n static useSuspense(sorting?: Sorting): [QueryResultWithState<AgentUsageByWeek[]>, PerformQuery, SetSorting] {\n return useSuspenseQuery<AgentUsageByWeek[], RecentWeeks>(RecentWeeks, undefined, sorting);\n }\n\n static useSuspenseWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByWeek[]>, PerformQuery, SetSorting, SetPage, SetPageSize] {\n return useSuspenseQueryWithPaging<AgentUsageByWeek[], RecentWeeks>(RecentWeeks, new Paging(0, pageSize), undefined, sorting);\n }\n\n static when(condition: boolean): QueryWhen<RecentWeeks, AgentUsageByWeek[]> {\n return new QueryWhen<RecentWeeks, AgentUsageByWeek[]>(RecentWeeks, condition);\n }\n}\n"],"names":["RecentWeeksSortBy","query","RecentWeeksSortByWithoutQuery","RecentWeeks","QueryFor","route","queryName","treatWarningsAsErrors","roles","defaultValue","_sortBy","AgentUsageByWeek","requiredRequestParameters","parameterDescriptors","sortBy","use","sorting","useQuery","undefined","useWithPaging","pageSize","useQueryWithPaging","Paging","useSuspense","useSuspenseQuery","useSuspenseWithPaging","useSuspenseQueryWithPaging","when","condition","QueryWhen"],"mappings":";;;;;;AAAA;AACA;;;AAWA,MAAMA,iBAAAA,CAAAA;;IAEF,WAAA,CAAqBC,KAAkB,CAAE;aAApBA,KAAAA,GAAAA,KAAAA;AACrB,IAAA;AAEJ;AAEA,MAAMC,6BAAAA,CAAAA;AAEN;AAGA;;IAGO,MAAMC,WAAAA,SAAoBC,gBAAAA,CAAAA;AACpBC,IAAAA,KAAAA,GAAgB,oCAAA;AAChBC,IAAAA,SAAAA,GAAoB,qDAAA;AACpBC,IAAAA,qBAAAA,GAAiC,KAAA;AACjCC,IAAAA,KAAAA,GAAkB,EAAE;AACpBC,IAAAA,YAAAA,GAAmC,EAAE;IAC7BC,OAAAA;IACjB,OAAwBA,OAAAA,GAAyC,IAAIR,6BAAAA,EAAAA;IAErE,WAAA,EAAc;AACV,QAAA,KAAK,CAACS,iCAAAA,EAAkB,IAAA,CAAA;AACxB,QAAA,IAAI,CAACD,OAAO,GAAG,IAAIV,kBAAkB,IAAI,CAAA;AAC7C,IAAA;AAEA,IAAA,IAAIY,yBAAAA,GAAsC;AACtC,QAAA,OAAO,EACN;AACL,IAAA;AAESC,IAAAA,oBAAAA,GAA8C,EACtD;AAGD,IAAA,IAAIC,MAAAA,GAA4B;QAC5B,OAAO,IAAI,CAACJ,OAAO;AACvB,IAAA;AAEA,IAAA,WAAWI,MAAAA,GAAwC;QAC/C,OAAO,IAAI,CAACJ,OAAO;AACvB,IAAA;IAEA,OAAOK,GAAAA,CAAIC,OAAiB,EAAwE;QAChG,OAAOC,kBAAAA,CAA0Cd,aAAae,SAAAA,EAAWF,OAAAA,CAAAA;AAC7E,IAAA;AAEA,IAAA,OAAOG,aAAAA,CAAcC,QAAgB,EAAEJ,OAAiB,EAA8F;AAClJ,QAAA,OAAOK,6BAAoDlB,WAAAA,EAAa,IAAImB,cAAAA,CAAO,CAAA,EAAGF,WAAWF,SAAAA,EAAWF,OAAAA,CAAAA;AAChH,IAAA;IAEA,OAAOO,WAAAA,CAAYP,OAAiB,EAAwE;QACxG,OAAOQ,0BAAAA,CAAkDrB,aAAae,SAAAA,EAAWF,OAAAA,CAAAA;AACrF,IAAA;AAEA,IAAA,OAAOS,qBAAAA,CAAsBL,QAAgB,EAAEJ,OAAiB,EAA8F;AAC1J,QAAA,OAAOU,qCAA4DvB,WAAAA,EAAa,IAAImB,cAAAA,CAAO,CAAA,EAAGF,WAAWF,SAAAA,EAAWF,OAAAA,CAAAA;AACxH,IAAA;IAEA,OAAOW,IAAAA,CAAKC,SAAkB,EAA8C;QACxE,OAAO,IAAIC,oBAA2C1B,WAAAA,EAAayB,SAAAA,CAAAA;AACvE,IAAA;AACJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Harness = require('./generated/Harnesses/Harness.js');
|
|
4
|
+
var RecordAgentSessionUsage = require('./generated/Usage/RecordAgentSessionUsage.js');
|
|
5
|
+
var AgentUsageByMonth = require('./generated/Usage/Trends/AgentUsageByMonth.js');
|
|
6
|
+
var AgentUsageByWeek = require('./generated/Usage/Trends/AgentUsageByWeek.js');
|
|
7
|
+
var RecentMonths = require('./generated/Usage/Trends/RecentMonths.js');
|
|
8
|
+
var RecentWeeks = require('./generated/Usage/Trends/RecentWeeks.js');
|
|
9
|
+
var AgentUsageByDay = require('./generated/Usage/Daily/AgentUsageByDay.js');
|
|
10
|
+
var LastYear = require('./generated/Usage/Daily/LastYear.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.Harness = Harness.Harness;
|
|
15
|
+
exports.RecordAgentSessionUsage = RecordAgentSessionUsage.RecordAgentSessionUsage;
|
|
16
|
+
exports.RecordAgentSessionUsageValidator = RecordAgentSessionUsage.RecordAgentSessionUsageValidator;
|
|
17
|
+
exports.AgentUsageByMonth = AgentUsageByMonth.AgentUsageByMonth;
|
|
18
|
+
exports.AgentUsageByWeek = AgentUsageByWeek.AgentUsageByWeek;
|
|
19
|
+
exports.RecentMonths = RecentMonths.RecentMonths;
|
|
20
|
+
exports.RecentWeeks = RecentWeeks.RecentWeeks;
|
|
21
|
+
exports.AgentUsageByDay = AgentUsageByDay.AgentUsageByDay;
|
|
22
|
+
exports.LastYear = LastYear.LastYear;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Harness.d.ts","sourceRoot":"","sources":["../../../../generated/Harnesses/Harness.ts"],"names":[],"mappings":"AASA,oBAAY,OAAO;IACf,MAAM,IAAI;IACV,EAAE,IAAI;CACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @generated by Cratis. Source: Cratis.AI.Harnesses.Harness. Time: 2026-09-15T09:45:50.7086800Z. Hash: 998FE1093B65276DB88F2E4904A3A48FB362909D1A150190218015501F903174
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* **DO NOT EDIT** - This file is an automatically generated file.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/ // eslint-disable-next-line header/header
|
|
5
|
+
/**
|
|
6
|
+
* The CLI harness an agent session runs under when it is a job invocation, driving a coding agent inside a worker container - as opposed to a chat/conversation invocation, which talks to its AI provider directly and touches no harness. Ported from Direct's `Agents.Harness` (plan Section 5.6).
|
|
7
|
+
*/ var Harness = /*#__PURE__*/ function(Harness) {
|
|
8
|
+
Harness[Harness["claude"] = 0] = "claude";
|
|
9
|
+
Harness[Harness["pi"] = 1] = "pi";
|
|
10
|
+
return Harness;
|
|
11
|
+
}({});
|
|
12
|
+
|
|
13
|
+
export { Harness };
|
|
14
|
+
//# sourceMappingURL=Harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Harness.js","sources":["../../../../generated/Harnesses/Harness.ts"],"sourcesContent":["// @generated by Cratis. Source: Cratis.AI.Harnesses.Harness. Time: 2026-09-15T09:45:50.7086800Z. Hash: 998FE1093B65276DB88F2E4904A3A48FB362909D1A150190218015501F903174\n/*---------------------------------------------------------------------------------------------\n * **DO NOT EDIT** - This file is an automatically generated file.\n *--------------------------------------------------------------------------------------------*/\n\n// eslint-disable-next-line header/header\n/**\n * The CLI harness an agent session runs under when it is a job invocation, driving a coding agent inside a worker container - as opposed to a chat/conversation invocation, which talks to its AI provider directly and touches no harness. Ported from Direct's `Agents.Harness` (plan Section 5.6).\n */\nexport enum Harness {\n claude = 0,\n pi = 1,\n}\n"],"names":["Harness"],"mappings":"AAAA;AACA;;AAE8F;AAG9F;;IAGO,IAAKA,OAAAA,iBAAAA,SAAAA,OAAAA,EAAAA;AACC,IAAA,OAAA,CAAA,OAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAA;AACJ,IAAA,OAAA,CAAA,OAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA;AAFGA,IAAAA,OAAAA,OAAAA;AAGX,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../generated/Harnesses/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../generated/Harnesses/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DateOnly } from '@cratis/fundamentals';
|
|
2
|
+
import { Guid } from '@cratis/fundamentals';
|
|
3
|
+
import { TimeSpan } from '@cratis/fundamentals';
|
|
4
|
+
export declare class AgentUsageByDay {
|
|
5
|
+
day: DateOnly;
|
|
6
|
+
providerId?: Guid;
|
|
7
|
+
agentId?: string;
|
|
8
|
+
purpose: string;
|
|
9
|
+
model: string;
|
|
10
|
+
sessions: number;
|
|
11
|
+
inputTokens: number;
|
|
12
|
+
outputTokens: number;
|
|
13
|
+
cost: number;
|
|
14
|
+
duration: TimeSpan;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AgentUsageByDay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentUsageByDay.d.ts","sourceRoot":"","sources":["../../../../../generated/Usage/Daily/AgentUsageByDay.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,qBAAa,eAAe;IAMxB,GAAG,EAAG,QAAQ,CAAC;IAMf,UAAU,CAAC,EAAE,IAAI,CAAC;IAMlB,OAAO,CAAC,EAAE,MAAM,CAAC;IAMjB,OAAO,EAAG,MAAM,CAAC;IAMjB,KAAK,EAAG,MAAM,CAAC;IAMf,QAAQ,EAAG,MAAM,CAAC;IAMlB,WAAW,EAAG,MAAM,CAAC;IAMrB,YAAY,EAAG,MAAM,CAAC;IAMtB,IAAI,EAAG,MAAM,CAAC;IAMd,QAAQ,EAAG,QAAQ,CAAC;CACvB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { field, DateOnly, Guid, TimeSpan } from '@cratis/fundamentals';
|
|
2
|
+
|
|
3
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length, r = c < 3 ? target : desc, d;
|
|
5
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") {
|
|
6
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
} else {
|
|
8
|
+
for(var i = decorators.length - 1; i >= 0; i--){
|
|
9
|
+
if (d = decorators[i]) {
|
|
10
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
}
|
|
16
|
+
function _ts_metadata(metadataKey, metadataValue) {
|
|
17
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") {
|
|
18
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One day's agent usage along one dimension - which provider served it, which agent ran it, on which model, for what purpose. A consumer's own usage page aggregates these rows client-side, so its filters can narrow the same trailing window without a second round trip per filter. Generalized from Direct's `AIUsage.DailyUsage.AgentUsageByDay` (plan Section 5.3d) - unlike Direct's original, which read from its own `IRecordedWork`/`ILanguageModelJobs` and so bucketed work and completions separately, this reads a single source, the package's own {@link AgentSessionUsageRecorded}, since that event already carries every dimension both of Direct's sources had to be combined to get.
|
|
23
|
+
*/ class AgentUsageByDay {
|
|
24
|
+
/**
|
|
25
|
+
* The calendar day the usage falls in (UTC).
|
|
26
|
+
*/ day;
|
|
27
|
+
/**
|
|
28
|
+
* The AI provider that served the work - `null` when none was resolved.
|
|
29
|
+
*/ providerId;
|
|
30
|
+
/**
|
|
31
|
+
* The agent that did the work - `null` when none was resolved.
|
|
32
|
+
*/ agentId;
|
|
33
|
+
/**
|
|
34
|
+
* What the sessions that day were for.
|
|
35
|
+
*/ purpose;
|
|
36
|
+
/**
|
|
37
|
+
* The model the work ran on.
|
|
38
|
+
*/ model;
|
|
39
|
+
/**
|
|
40
|
+
* How many agent sessions were recorded that day.
|
|
41
|
+
*/ sessions;
|
|
42
|
+
/**
|
|
43
|
+
* The input tokens those sessions consumed.
|
|
44
|
+
*/ inputTokens;
|
|
45
|
+
/**
|
|
46
|
+
* The output tokens those sessions produced.
|
|
47
|
+
*/ outputTokens;
|
|
48
|
+
/**
|
|
49
|
+
* The reported cost of those sessions, in USD.
|
|
50
|
+
*/ cost;
|
|
51
|
+
/**
|
|
52
|
+
* How long those sessions ran in total.
|
|
53
|
+
*/ duration;
|
|
54
|
+
}
|
|
55
|
+
_ts_decorate([
|
|
56
|
+
field(DateOnly),
|
|
57
|
+
_ts_metadata("design:type", typeof DateOnly === "undefined" ? Object : DateOnly)
|
|
58
|
+
], AgentUsageByDay.prototype, "day", void 0);
|
|
59
|
+
_ts_decorate([
|
|
60
|
+
field(Guid),
|
|
61
|
+
_ts_metadata("design:type", typeof Guid === "undefined" ? Object : Guid)
|
|
62
|
+
], AgentUsageByDay.prototype, "providerId", void 0);
|
|
63
|
+
_ts_decorate([
|
|
64
|
+
field(String),
|
|
65
|
+
_ts_metadata("design:type", String)
|
|
66
|
+
], AgentUsageByDay.prototype, "agentId", void 0);
|
|
67
|
+
_ts_decorate([
|
|
68
|
+
field(String),
|
|
69
|
+
_ts_metadata("design:type", String)
|
|
70
|
+
], AgentUsageByDay.prototype, "purpose", void 0);
|
|
71
|
+
_ts_decorate([
|
|
72
|
+
field(String),
|
|
73
|
+
_ts_metadata("design:type", String)
|
|
74
|
+
], AgentUsageByDay.prototype, "model", void 0);
|
|
75
|
+
_ts_decorate([
|
|
76
|
+
field(Number),
|
|
77
|
+
_ts_metadata("design:type", Number)
|
|
78
|
+
], AgentUsageByDay.prototype, "sessions", void 0);
|
|
79
|
+
_ts_decorate([
|
|
80
|
+
field(Number),
|
|
81
|
+
_ts_metadata("design:type", Number)
|
|
82
|
+
], AgentUsageByDay.prototype, "inputTokens", void 0);
|
|
83
|
+
_ts_decorate([
|
|
84
|
+
field(Number),
|
|
85
|
+
_ts_metadata("design:type", Number)
|
|
86
|
+
], AgentUsageByDay.prototype, "outputTokens", void 0);
|
|
87
|
+
_ts_decorate([
|
|
88
|
+
field(Number),
|
|
89
|
+
_ts_metadata("design:type", Number)
|
|
90
|
+
], AgentUsageByDay.prototype, "cost", void 0);
|
|
91
|
+
_ts_decorate([
|
|
92
|
+
field(TimeSpan),
|
|
93
|
+
_ts_metadata("design:type", typeof TimeSpan === "undefined" ? Object : TimeSpan)
|
|
94
|
+
], AgentUsageByDay.prototype, "duration", void 0);
|
|
95
|
+
|
|
96
|
+
export { AgentUsageByDay };
|
|
97
|
+
//# sourceMappingURL=AgentUsageByDay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentUsageByDay.js","sources":["../../../../../generated/Usage/Daily/AgentUsageByDay.ts"],"sourcesContent":["// @generated by Cratis. Source: Cratis.AI.Usage.Daily.AgentUsageByDay. Time: 2026-09-15T09:45:50.7054720Z. Hash: D60BEC2E6E993E225BBE7B91525E03E1852D44D10E545F2D0F2DAD00CB7659E7\n/*---------------------------------------------------------------------------------------------\n * **DO NOT EDIT** - This file is an automatically generated file.\n *--------------------------------------------------------------------------------------------*/\n\n/* eslint-disable sort-imports */\n// eslint-disable-next-line header/header\nimport { field } from '@cratis/fundamentals';\nimport { DateOnly } from '@cratis/fundamentals';\nimport { Guid } from '@cratis/fundamentals';\nimport { TimeSpan } from '@cratis/fundamentals';\n\n/**\n * One day's agent usage along one dimension - which provider served it, which agent ran it, on which model, for what purpose. A consumer's own usage page aggregates these rows client-side, so its filters can narrow the same trailing window without a second round trip per filter. Generalized from Direct's `AIUsage.DailyUsage.AgentUsageByDay` (plan Section 5.3d) - unlike Direct's original, which read from its own `IRecordedWork`/`ILanguageModelJobs` and so bucketed work and completions separately, this reads a single source, the package's own {@link AgentSessionUsageRecorded}, since that event already carries every dimension both of Direct's sources had to be combined to get.\n */\nexport class AgentUsageByDay {\n\n /**\n * The calendar day the usage falls in (UTC).\n */\n @field(DateOnly)\n day!: DateOnly;\n\n /**\n * The AI provider that served the work - `null` when none was resolved.\n */\n @field(Guid)\n providerId?: Guid;\n\n /**\n * The agent that did the work - `null` when none was resolved.\n */\n @field(String)\n agentId?: string;\n\n /**\n * What the sessions that day were for.\n */\n @field(String)\n purpose!: string;\n\n /**\n * The model the work ran on.\n */\n @field(String)\n model!: string;\n\n /**\n * How many agent sessions were recorded that day.\n */\n @field(Number)\n sessions!: number;\n\n /**\n * The input tokens those sessions consumed.\n */\n @field(Number)\n inputTokens!: number;\n\n /**\n * The output tokens those sessions produced.\n */\n @field(Number)\n outputTokens!: number;\n\n /**\n * The reported cost of those sessions, in USD.\n */\n @field(Number)\n cost!: number;\n\n /**\n * How long those sessions ran in total.\n */\n @field(TimeSpan)\n duration!: TimeSpan;\n}\n"],"names":["AgentUsageByDay","day","providerId","agentId","purpose","model","sessions","inputTokens","outputTokens","cost","duration"],"mappings":";;;;;;;;;;;;;;;;;;;;AAYA;;AAEC,IACM,MAAMA,eAAAA,CAAAA;AAET;;AAEC,QACD,GACAC;AAEA;;AAEC,QACD,UACAC;AAEA;;AAEC,QACD,OACAC;AAEA;;AAEC,QACD,OACAC;AAEA;;AAEC,QACD,KACAC;AAEA;;AAEC,QACD,QACAC;AAEA;;AAEC,QACD,WACAC;AAEA;;AAEC,QACD,YACAC;AAEA;;AAEC,QACD,IACAC;AAEA;;AAEC,QACD,QACAC;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { QueryFor, QueryResultWithState, Sorting } from '@cratis/arc/queries';
|
|
2
|
+
import { PerformQuery, SetSorting, SetPage, SetPageSize, QueryWhen } from '@cratis/arc.react/queries';
|
|
3
|
+
import { ParameterDescriptor } from '@cratis/arc/reflection';
|
|
4
|
+
import { AgentUsageByDay } from './AgentUsageByDay';
|
|
5
|
+
declare class LastYearSortBy {
|
|
6
|
+
readonly query: LastYear;
|
|
7
|
+
constructor(query: LastYear);
|
|
8
|
+
}
|
|
9
|
+
declare class LastYearSortByWithoutQuery {
|
|
10
|
+
}
|
|
11
|
+
export declare class LastYear extends QueryFor<AgentUsageByDay[]> {
|
|
12
|
+
readonly route: string;
|
|
13
|
+
readonly queryName: string;
|
|
14
|
+
readonly treatWarningsAsErrors: boolean;
|
|
15
|
+
readonly roles: string[];
|
|
16
|
+
readonly defaultValue: AgentUsageByDay[];
|
|
17
|
+
private readonly _sortBy;
|
|
18
|
+
private static readonly _sortBy;
|
|
19
|
+
constructor();
|
|
20
|
+
get requiredRequestParameters(): string[];
|
|
21
|
+
readonly parameterDescriptors: ParameterDescriptor[];
|
|
22
|
+
get sortBy(): LastYearSortBy;
|
|
23
|
+
static get sortBy(): LastYearSortByWithoutQuery;
|
|
24
|
+
static use(sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting];
|
|
25
|
+
static useWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting, SetPage, SetPageSize];
|
|
26
|
+
static useSuspense(sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting];
|
|
27
|
+
static useSuspenseWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting, SetPage, SetPageSize];
|
|
28
|
+
static when(condition: boolean): QueryWhen<LastYear, AgentUsageByDay[]>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=LastYear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LastYear.d.ts","sourceRoot":"","sources":["../../../../../generated/Usage/Daily/LastYear.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAU,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAA8E,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EA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C,oBAAoB,CAAC,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,UAAU,CAAC,CAEzG;IAED,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,CAAC,oBAAoB,CAAC,eAAe,EAAE,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAE3J;IAED,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC,CAEtE;CACJ"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { QueryFor, Paging } from '@cratis/arc/queries';
|
|
2
|
+
import { useQuery, useQueryWithPaging, useSuspenseQuery, useSuspenseQueryWithPaging, QueryWhen } from '@cratis/arc.react/queries';
|
|
3
|
+
import { AgentUsageByDay } from './AgentUsageByDay.js';
|
|
4
|
+
|
|
5
|
+
// @generated by Cratis. Source: Cratis.AI.Usage.Daily.AgentUsageByDay. Time: 2026-09-15T09:45:50.6993030Z. Hash: D1AB14922E03E8E3709610E8C2476E5A080396D759345FA976233AAF9588F5B5
|
|
6
|
+
/*---------------------------------------------------------------------------------------------
|
|
7
|
+
* **DO NOT EDIT** - This file is an automatically generated file.
|
|
8
|
+
*--------------------------------------------------------------------------------------------*/ /* eslint-disable sort-imports */ // eslint-disable-next-line header/header
|
|
9
|
+
class LastYearSortBy {
|
|
10
|
+
query;
|
|
11
|
+
constructor(query){
|
|
12
|
+
this.query = query;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class LastYearSortByWithoutQuery {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Gets every day's usage within the trailing window, oldest day first, bucketed per provider/agent/purpose/model combination so a consumer's page can narrow by any of them.
|
|
19
|
+
*/ class LastYear extends QueryFor {
|
|
20
|
+
route = '/api/a-i/usage/daily/last-year';
|
|
21
|
+
queryName = 'Cratis.AI.Usage.Daily.AgentUsageByDay.LastYear';
|
|
22
|
+
treatWarningsAsErrors = false;
|
|
23
|
+
roles = [];
|
|
24
|
+
defaultValue = [];
|
|
25
|
+
_sortBy;
|
|
26
|
+
static _sortBy = new LastYearSortByWithoutQuery();
|
|
27
|
+
constructor(){
|
|
28
|
+
super(AgentUsageByDay, true);
|
|
29
|
+
this._sortBy = new LastYearSortBy(this);
|
|
30
|
+
}
|
|
31
|
+
get requiredRequestParameters() {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
parameterDescriptors = [];
|
|
35
|
+
get sortBy() {
|
|
36
|
+
return this._sortBy;
|
|
37
|
+
}
|
|
38
|
+
static get sortBy() {
|
|
39
|
+
return this._sortBy;
|
|
40
|
+
}
|
|
41
|
+
static use(sorting) {
|
|
42
|
+
return useQuery(LastYear, undefined, sorting);
|
|
43
|
+
}
|
|
44
|
+
static useWithPaging(pageSize, sorting) {
|
|
45
|
+
return useQueryWithPaging(LastYear, new Paging(0, pageSize), undefined, sorting);
|
|
46
|
+
}
|
|
47
|
+
static useSuspense(sorting) {
|
|
48
|
+
return useSuspenseQuery(LastYear, undefined, sorting);
|
|
49
|
+
}
|
|
50
|
+
static useSuspenseWithPaging(pageSize, sorting) {
|
|
51
|
+
return useSuspenseQueryWithPaging(LastYear, new Paging(0, pageSize), undefined, sorting);
|
|
52
|
+
}
|
|
53
|
+
static when(condition) {
|
|
54
|
+
return new QueryWhen(LastYear, condition);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { LastYear };
|
|
59
|
+
//# sourceMappingURL=LastYear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LastYear.js","sources":["../../../../../generated/Usage/Daily/LastYear.ts"],"sourcesContent":["// @generated by Cratis. Source: Cratis.AI.Usage.Daily.AgentUsageByDay. Time: 2026-09-15T09:45:50.6993030Z. Hash: D1AB14922E03E8E3709610E8C2476E5A080396D759345FA976233AAF9588F5B5\n/*---------------------------------------------------------------------------------------------\n * **DO NOT EDIT** - This file is an automatically generated file.\n *--------------------------------------------------------------------------------------------*/\n\n/* eslint-disable sort-imports */\n// eslint-disable-next-line header/header\nimport { QueryFor, QueryResultWithState, Sorting, Paging } from '@cratis/arc/queries';\nimport { useQuery, useQueryWithPaging, useSuspenseQuery, useSuspenseQueryWithPaging, PerformQuery, SetSorting, SetPage, SetPageSize, QueryWhen } from '@cratis/arc.react/queries';\nimport { ParameterDescriptor } from '@cratis/arc/reflection';\nimport { AgentUsageByDay } from './AgentUsageByDay';\n\nclass LastYearSortBy {\n\n constructor(readonly query: LastYear) {\n }\n\n}\n\nclass LastYearSortByWithoutQuery {\n\n}\n\n\n/**\n * Gets every day's usage within the trailing window, oldest day first, bucketed per provider/agent/purpose/model combination so a consumer's page can narrow by any of them.\n */\nexport class LastYear extends QueryFor<AgentUsageByDay[]> {\n readonly route: string = '/api/a-i/usage/daily/last-year';\n readonly queryName: string = 'Cratis.AI.Usage.Daily.AgentUsageByDay.LastYear';\n readonly treatWarningsAsErrors: boolean = false;\n readonly roles: string[] = [];\n readonly defaultValue: AgentUsageByDay[] = [];\n private readonly _sortBy: LastYearSortBy;\n private static readonly _sortBy: LastYearSortByWithoutQuery = new LastYearSortByWithoutQuery();\n\n constructor() {\n super(AgentUsageByDay, true);\n this._sortBy = new LastYearSortBy(this);\n }\n\n get requiredRequestParameters(): string[] {\n return [\n ];\n }\n\n readonly parameterDescriptors: ParameterDescriptor[] = [\n ];\n\n\n get sortBy(): LastYearSortBy {\n return this._sortBy;\n }\n\n static get sortBy(): LastYearSortByWithoutQuery {\n return this._sortBy;\n }\n\n static use(sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting] {\n return useQuery<AgentUsageByDay[], LastYear>(LastYear, undefined, sorting);\n }\n\n static useWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting, SetPage, SetPageSize] {\n return useQueryWithPaging<AgentUsageByDay[], LastYear>(LastYear, new Paging(0, pageSize), undefined, sorting);\n }\n\n static useSuspense(sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting] {\n return useSuspenseQuery<AgentUsageByDay[], LastYear>(LastYear, undefined, sorting);\n }\n\n static useSuspenseWithPaging(pageSize: number, sorting?: Sorting): [QueryResultWithState<AgentUsageByDay[]>, PerformQuery, SetSorting, SetPage, SetPageSize] {\n return useSuspenseQueryWithPaging<AgentUsageByDay[], LastYear>(LastYear, new Paging(0, pageSize), undefined, sorting);\n }\n\n static when(condition: boolean): QueryWhen<LastYear, AgentUsageByDay[]> {\n return new QueryWhen<LastYear, AgentUsageByDay[]>(LastYear, condition);\n }\n}\n"],"names":["LastYearSortBy","query","LastYearSortByWithoutQuery","LastYear","QueryFor","route","queryName","treatWarningsAsErrors","roles","defaultValue","_sortBy","AgentUsageByDay","requiredRequestParameters","parameterDescriptors","sortBy","use","sorting","useQuery","undefined","useWithPaging","pageSize","useQueryWithPaging","Paging","useSuspense","useSuspenseQuery","useSuspenseWithPaging","useSuspenseQueryWithPaging","when","condition","QueryWhen"],"mappings":";;;;AAAA;AACA;;;AAWA,MAAMA,cAAAA,CAAAA;;IAEF,WAAA,CAAqBC,KAAe,CAAE;aAAjBA,KAAAA,GAAAA,KAAAA;AACrB,IAAA;AAEJ;AAEA,MAAMC,0BAAAA,CAAAA;AAEN;AAGA;;IAGO,MAAMC,QAAAA,SAAiBC,QAAAA,CAAAA;AACjBC,IAAAA,KAAAA,GAAgB,gCAAA;AAChBC,IAAAA,SAAAA,GAAoB,gDAAA;AACpBC,IAAAA,qBAAAA,GAAiC,KAAA;AACjCC,IAAAA,KAAAA,GAAkB,EAAE;AACpBC,IAAAA,YAAAA,GAAkC,EAAE;IAC5BC,OAAAA;IACjB,OAAwBA,OAAAA,GAAsC,IAAIR,0BAAAA,EAAAA;IAElE,WAAA,EAAc;AACV,QAAA,KAAK,CAACS,eAAAA,EAAiB,I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AC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../generated/Usage/Daily/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Command, CommandValidator } from '@cratis/arc/commands';
|
|
2
|
+
import { SetCommandValues, ClearCommandValues } from '@cratis/arc.react/commands';
|
|
3
|
+
import { PropertyDescriptor } from '@cratis/arc/reflection';
|
|
4
|
+
import { Harness } from '../Harnesses/Harness';
|
|
5
|
+
import { Guid } from '@cratis/fundamentals';
|
|
6
|
+
export interface IRecordAgentSessionUsage {
|
|
7
|
+
agent?: string;
|
|
8
|
+
cachedTokens?: number;
|
|
9
|
+
costUsd?: number;
|
|
10
|
+
cpuSeconds?: number;
|
|
11
|
+
duration?: number;
|
|
12
|
+
harness?: Harness;
|
|
13
|
+
inputTokens?: number;
|
|
14
|
+
memoryBytes?: number;
|
|
15
|
+
model?: string;
|
|
16
|
+
outputTokens?: number;
|
|
17
|
+
provider?: Guid;
|
|
18
|
+
purpose?: string;
|
|
19
|
+
session?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class RecordAgentSessionUsageValidator extends CommandValidator<IRecordAgentSessionUsage> {
|
|
22
|
+
constructor();
|
|
23
|
+
}
|
|
24
|
+
export declare class RecordAgentSessionUsage extends Command<IRecordAgentSessionUsage, string> implements IRecordAgentSessionUsage {
|
|
25
|
+
readonly route: string;
|
|
26
|
+
readonly validation: CommandValidator;
|
|
27
|
+
readonly treatWarningsAsErrors: boolean;
|
|
28
|
+
readonly roles: string[];
|
|
29
|
+
readonly propertyDescriptors: PropertyDescriptor[];
|
|
30
|
+
private _agent;
|
|
31
|
+
private _cachedTokens?;
|
|
32
|
+
private _costUsd?;
|
|
33
|
+
private _cpuSeconds?;
|
|
34
|
+
private _duration?;
|
|
35
|
+
private _harness?;
|
|
36
|
+
private _inputTokens?;
|
|
37
|
+
private _memoryBytes?;
|
|
38
|
+
private _model;
|
|
39
|
+
private _outputTokens?;
|
|
40
|
+
private _provider?;
|
|
41
|
+
private _purpose;
|
|
42
|
+
private _session;
|
|
43
|
+
constructor();
|
|
44
|
+
get requestParameters(): string[];
|
|
45
|
+
get agent(): string;
|
|
46
|
+
set agent(value: string);
|
|
47
|
+
get cachedTokens(): number | undefined;
|
|
48
|
+
set cachedTokens(value: number | undefined);
|
|
49
|
+
get costUsd(): number | undefined;
|
|
50
|
+
set costUsd(value: number | undefined);
|
|
51
|
+
get cpuSeconds(): number | undefined;
|
|
52
|
+
set cpuSeconds(value: number | undefined);
|
|
53
|
+
get duration(): number | undefined;
|
|
54
|
+
set duration(value: number | undefined);
|
|
55
|
+
get harness(): Harness | undefined;
|
|
56
|
+
set harness(value: Harness | undefined);
|
|
57
|
+
get inputTokens(): number | undefined;
|
|
58
|
+
set inputTokens(value: number | undefined);
|
|
59
|
+
get memoryBytes(): number | undefined;
|
|
60
|
+
set memoryBytes(value: number | undefined);
|
|
61
|
+
get model(): string;
|
|
62
|
+
set model(value: string);
|
|
63
|
+
get outputTokens(): number | undefined;
|
|
64
|
+
set outputTokens(value: number | undefined);
|
|
65
|
+
get provider(): Guid | undefined;
|
|
66
|
+
set provider(value: Guid | undefined);
|
|
67
|
+
get purpose(): string;
|
|
68
|
+
set purpose(value: string);
|
|
69
|
+
get session(): string;
|
|
70
|
+
set session(value: string);
|
|
71
|
+
static use(initialValues?: IRecordAgentSessionUsage): [RecordAgentSessionUsage, SetCommandValues<IRecordAgentSessionUsage>, ClearCommandValues];
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=RecordAgentSessionUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordAgentSessionUsage.d.ts","sourceRoot":"","sources":["../../../../generated/Usage/RecordAgentSessionUsage.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,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