crewx 0.8.7-rc.21 → 0.8.7-rc.22
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/assets/{MarketPage-aY16UW1_.js → MarketPage-lLBtAENs.js} +10 -15
- package/dist/assets/{PromptTab-C3aTJS6u.js → PromptTab-Daq54dMi.js} +1 -1
- package/dist/assets/_baseUniq-BJDqmZBO.js +1 -0
- package/dist/assets/{arc-BCQAokB1.js → arc-ByjRIa5p.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-Bc87ujv2.js → architectureDiagram-UYN6MBPD-DcKpqSFb.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-wC9uH8Lb.js → blockDiagram-ZHA2E4KO-YvUeULT5.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-CqB7lqni.js → c4Diagram-6F5ED5ID-vggzH2N5.js} +1 -1
- package/dist/assets/channel-1Y6YooBb.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-Cc1L17Eh.js → chunk-5HRBRIJM-BbaQwJkn.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-Df3nu_7G.js → chunk-7U56Z5CX-DVYVpFaa.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-DIXslLG-.js → chunk-ASOPGD6M-CXEvWb-8.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-FytVljyP.js → chunk-KFBOBJHC-CadVXFV3.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-CU5z-cXq.js → chunk-T2TOU4HS-lDZr1sVF.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-CWo1AFyn.js → chunk-TMUBEWPD-D5A0MrFD.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-CDxkV2JV.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-CDxkV2JV.js +1 -0
- package/dist/assets/clone-6xznz_9G.js +1 -0
- package/dist/assets/{dagre-4EVJKHTY-CgZW5tg4.js → dagre-4EVJKHTY-Bncx7Ijq.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-CJAng8RC.js → diagram-QW4FP2JN-RkxVNs99.js} +1 -1
- package/dist/assets/{erDiagram-6RL3IURR-C1uHztHX.js → erDiagram-6RL3IURR-DIiKqQdx.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-Yiu2odO-.js → flowDiagram-7ASYPVHJ-DQ5PN7v6.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-tutc0dJP.js → ganttDiagram-NTVNEXSI-BeNWGpB6.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-C3jM6T4G.js → gitGraph-YCYPL57B-CdMe059q.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-0aqHEKzz.js → gitGraphDiagram-NRZ2UAAF-BEke5TyK.js} +1 -1
- package/dist/assets/{graph-DC224ILV.js → graph-DyQIwWJd.js} +1 -1
- package/dist/assets/{infoDiagram-A4XQUW5V-Do7Mpzkx.js → infoDiagram-A4XQUW5V-CUcC8I_5.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-DAruEJc7.js → journeyDiagram-G5WM74LC-CQ5DqAH5.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-DB63vLR0.js → kanban-definition-QRCXZQQD-BBsgOii7.js} +1 -1
- package/dist/assets/{layout-BiYH5x6Q.js → layout-D7vBs_Wy.js} +1 -1
- package/dist/assets/{linear-CLyGW2s0.js → linear-CEOF9oJz.js} +1 -1
- package/dist/assets/{main-CEKkUqZb.js → main-Bx1nZ7_p.js} +278 -273
- package/dist/assets/main-C4ebvOIJ.css +10 -0
- package/dist/assets/{min-ChJMFU2N.js → min-RK9J5Utn.js} +1 -1
- package/dist/assets/{mindmap-definition-GWI6TPTV-CtADqQgd.js → mindmap-definition-GWI6TPTV-BXvEU7qC.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-BSOfzo3O.js → pieDiagram-YF2LJOPJ-TrXqcpni.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-BLBQNFVb.js → quadrantDiagram-OS5C2QUG-B-chTEU4.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-DqorvuS6.js → requirementDiagram-MIRIMTAZ-BgJhNLp_.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-4NDcrLkB.js → sankeyDiagram-Y46BX6SQ-BVsgYKK7.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-yha6BxK2.js → sequenceDiagram-G6AWOVSC-ByJOpkq3.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-XJ_I41ez.js → stateDiagram-MAYHULR4-Dw7lUL1B.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-DYJiM3bF.js +1 -0
- package/dist/assets/{timeline-definition-U7ZMHBDA-DCNrmvE7.js → timeline-definition-U7ZMHBDA-CSoEYs60.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-9N-Ohhdp.js → xychartDiagram-6QU3TZC5-0_rG7p3L.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +8 -8
- package/packages/cli/package.json +1 -1
- package/dist/assets/_baseUniq-DxEFlwNt.js +0 -1
- package/dist/assets/channel-DNLHkiNp.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-B430Onym.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-B430Onym.js +0 -1
- package/dist/assets/clone-B9O3E3P1.js +0 -1
- package/dist/assets/main-D3YeRndF.css +0 -10
- package/dist/assets/stateDiagram-v2-4JROLMXI-CxcyPJO2.js +0 -1
- package/dist-server/adapters/adapter.module.js +0 -35
- package/dist-server/adapters/adapter.service.js +0 -79
- package/dist-server/adapters/http-router.service.js +0 -91
- package/dist-server/app.module.js +0 -111
- package/dist-server/bootstrap/crewx-server.js +0 -80
- package/dist-server/bootstrap/tls.js +0 -138
- package/dist-server/common/analytics.client.js +0 -180
- package/dist-server/common/analytics.module.js +0 -21
- package/dist-server/common/cors.js +0 -15
- package/dist-server/common/decorators/project.decorator.js +0 -21
- package/dist-server/common/decorators/workspace.decorator.js +0 -24
- package/dist-server/common/device-id.js +0 -33
- package/dist-server/common/interceptor/api-id-header.interceptor.js +0 -53
- package/dist-server/common/interceptor/http-logging.interceptor.js +0 -124
- package/dist-server/common/limits/defaults.js +0 -13
- package/dist-server/common/limits/limits-provider.js +0 -6
- package/dist-server/common/limits/limits.controller.js +0 -38
- package/dist-server/common/limits/limits.module.js +0 -24
- package/dist-server/common/limits/local-limits.provider.js +0 -27
- package/dist-server/common/middleware/workspace.middleware.js +0 -210
- package/dist-server/common/repository.exception-filter.js +0 -48
- package/dist-server/common/workspace-context.store.js +0 -25
- package/dist-server/domain/agent/agent.controller.js +0 -96
- package/dist-server/domain/agent/agent.module.js +0 -27
- package/dist-server/domain/agent/agent.service.js +0 -335
- package/dist-server/domain/agent/agent.types.js +0 -3
- package/dist-server/domain/agent/dto/create-agent.dto.js +0 -80
- package/dist-server/domain/agent/dto/preview-prompt.dto.js +0 -77
- package/dist-server/domain/agent/dto/provider-meta.dto.js +0 -2
- package/dist-server/domain/agent/dto/update-agent.dto.js +0 -92
- package/dist-server/domain/agent/provider.controller.js +0 -38
- package/dist-server/domain/agent/template-processor.service.js +0 -71
- package/dist-server/domain/auth/auth.constants.js +0 -4
- package/dist-server/domain/auth/auth.controller.js +0 -123
- package/dist-server/domain/auth/auth.module.js +0 -47
- package/dist-server/domain/auth/decorators/public.decorator.js +0 -7
- package/dist-server/domain/auth/guards/base-auth.guard.js +0 -66
- package/dist-server/domain/auth/session-store.js +0 -26
- package/dist-server/domain/auth/utils/ip.utils.js +0 -31
- package/dist-server/domain/box/box.controller.js +0 -77
- package/dist-server/domain/box/box.module.js +0 -21
- package/dist-server/domain/box/box.service.js +0 -97
- package/dist-server/domain/box/dto/create-box.dto.js +0 -74
- package/dist-server/domain/cli/cli.controller.js +0 -136
- package/dist-server/domain/cli/cli.module.js +0 -21
- package/dist-server/domain/cli/cli.service.js +0 -598
- package/dist-server/domain/cli/dto/login-cli.dto.js +0 -25
- package/dist-server/domain/cli/dto/update-cli.dto.js +0 -31
- package/dist-server/domain/doc/doc.controller.js +0 -95
- package/dist-server/domain/doc/doc.module.js +0 -21
- package/dist-server/domain/doc/doc.service.js +0 -368
- package/dist-server/domain/doc/dto/doc.dto.js +0 -64
- package/dist-server/domain/document/document.controller.js +0 -57
- package/dist-server/domain/document/document.module.js +0 -22
- package/dist-server/domain/document/document.service.js +0 -274
- package/dist-server/domain/document/dto/register-document.dto.js +0 -24
- package/dist-server/domain/fs/dto/mkdir-request.dto.js +0 -47
- package/dist-server/domain/fs/dto/mkdir-response.dto.js +0 -2
- package/dist-server/domain/fs/dto/quick-access.dto.js +0 -2
- package/dist-server/domain/fs/dto/tree-node.dto.js +0 -2
- package/dist-server/domain/fs/dto/tree-query.dto.js +0 -35
- package/dist-server/domain/fs/fs.controller.js +0 -63
- package/dist-server/domain/fs/fs.module.js +0 -22
- package/dist-server/domain/fs/fs.service.js +0 -303
- package/dist-server/domain/git/git.module.js +0 -20
- package/dist-server/domain/git/git.service.js +0 -222
- package/dist-server/domain/goal/dto/goal.dto.js +0 -49
- package/dist-server/domain/goal/goal.controller.js +0 -86
- package/dist-server/domain/goal/goal.module.js +0 -22
- package/dist-server/domain/goal/goal.service.js +0 -197
- package/dist-server/domain/goal/parser/goal-md-parser.js +0 -166
- package/dist-server/domain/goal/parser/goal-md-serializer.js +0 -110
- package/dist-server/domain/health/health.controller.js +0 -57
- package/dist-server/domain/health/health.module.js +0 -19
- package/dist-server/domain/knowledge/dto/graph-knowledge.dto.js +0 -27
- package/dist-server/domain/knowledge/dto/knowledge.dto.js +0 -71
- package/dist-server/domain/knowledge/knowledge.controller.js +0 -122
- package/dist-server/domain/knowledge/knowledge.module.js +0 -21
- package/dist-server/domain/knowledge/knowledge.service.js +0 -538
- package/dist-server/domain/market/dto/add-registry.dto.js +0 -32
- package/dist-server/domain/market/dto/install-market.dto.js +0 -30
- package/dist-server/domain/market/market.controller.js +0 -163
- package/dist-server/domain/market/market.module.js +0 -22
- package/dist-server/domain/market/market.service.js +0 -1447
- package/dist-server/domain/mcp/browser-session.store.js +0 -247
- package/dist-server/domain/mcp/crewx-tool.factory.js +0 -119
- package/dist-server/domain/mcp/mcp-auth.guard.js +0 -61
- package/dist-server/domain/mcp/mcp.constants.js +0 -4
- package/dist-server/domain/mcp/mcp.controller.js +0 -125
- package/dist-server/domain/mcp/mcp.dto.js +0 -12
- package/dist-server/domain/mcp/mcp.module.js +0 -49
- package/dist-server/domain/mcp/mcp.service.js +0 -684
- package/dist-server/domain/mcp/tool-router.service.js +0 -120
- package/dist-server/domain/message/dto/list-messages.dto.js +0 -57
- package/dist-server/domain/message/dto/send-message.dto.js +0 -45
- package/dist-server/domain/message/message.controller.js +0 -73
- package/dist-server/domain/message/message.module.js +0 -25
- package/dist-server/domain/message/message.service.js +0 -160
- package/dist-server/domain/onboarding/onboarding.controller.js +0 -97
- package/dist-server/domain/onboarding/onboarding.module.js +0 -23
- package/dist-server/domain/onboarding/onboarding.service.js +0 -106
- package/dist-server/domain/onboarding/onboarding.types.js +0 -2
- package/dist-server/domain/onboarding/presets/custom.js +0 -10
- package/dist-server/domain/onboarding/presets/dev-team.js +0 -41
- package/dist-server/domain/onboarding/presets/index.js +0 -15
- package/dist-server/domain/onboarding/presets/marketing-team.js +0 -29
- package/dist-server/domain/onboarding/presets/planning-team.js +0 -29
- package/dist-server/domain/onboarding/presets/solo.js +0 -17
- package/dist-server/domain/planner/dto/planner.dto.js +0 -58
- package/dist-server/domain/planner/planner.controller.js +0 -74
- package/dist-server/domain/planner/planner.module.js +0 -22
- package/dist-server/domain/planner/planner.service.js +0 -269
- package/dist-server/domain/project/dto/create-project.dto.js +0 -46
- package/dist-server/domain/project/dto/update-project.dto.js +0 -60
- package/dist-server/domain/project/project.controller.js +0 -129
- package/dist-server/domain/project/project.module.js +0 -22
- package/dist-server/domain/project/project.service.js +0 -173
- package/dist-server/domain/settings/settings.controller.js +0 -52
- package/dist-server/domain/settings/settings.module.js +0 -22
- package/dist-server/domain/settings/settings.service.js +0 -105
- package/dist-server/domain/task/dto/all-tasks.dto.js +0 -55
- package/dist-server/domain/task/dto/list-tasks.dto.js +0 -69
- package/dist-server/domain/task/dto/search-tasks.dto.js +0 -66
- package/dist-server/domain/task/dto/send-message.dto.js +0 -31
- package/dist-server/domain/task/dto/task-status.dto.js +0 -34
- package/dist-server/domain/task/dto/workspace-usage.dto.js +0 -38
- package/dist-server/domain/task/task.constants.js +0 -5
- package/dist-server/domain/task/task.controller.js +0 -169
- package/dist-server/domain/task/task.module.js +0 -23
- package/dist-server/domain/task/task.service.js +0 -775
- package/dist-server/domain/thread/dto/build-context.dto.js +0 -42
- package/dist-server/domain/thread/dto/list-messages.dto.js +0 -49
- package/dist-server/domain/thread/dto/list-threads.dto.js +0 -70
- package/dist-server/domain/thread/dto/search-threads.dto.js +0 -13
- package/dist-server/domain/thread/dto/update-thread.dto.js +0 -23
- package/dist-server/domain/thread/thread.controller.js +0 -160
- package/dist-server/domain/thread/thread.module.js +0 -23
- package/dist-server/domain/thread/thread.service.js +0 -419
- package/dist-server/domain/usage/usage.controller.js +0 -118
- package/dist-server/domain/usage/usage.module.js +0 -21
- package/dist-server/domain/usage/usage.service.js +0 -358
- package/dist-server/domain/usage/usage.types.js +0 -4
- package/dist-server/domain/wbs/wbs.controller.js +0 -51
- package/dist-server/domain/wbs/wbs.module.js +0 -21
- package/dist-server/domain/wbs/wbs.service.js +0 -94
- package/dist-server/domain/workflow/workflow.controller.js +0 -53
- package/dist-server/domain/workflow/workflow.module.js +0 -21
- package/dist-server/domain/workflow/workflow.service.js +0 -209
- package/dist-server/domain/workspace/dto/create-workspace.dto.js +0 -45
- package/dist-server/domain/workspace/dto/switch-workspace.dto.js +0 -32
- package/dist-server/domain/workspace/dto/workspace-info.dto.js +0 -2
- package/dist-server/domain/workspace/workspace.controller.js +0 -98
- package/dist-server/domain/workspace/workspace.module.js +0 -22
- package/dist-server/domain/workspace/workspace.service.js +0 -198
- package/dist-server/main.js +0 -204
- package/dist-server/modules/crewx-pool.service.js +0 -75
- package/dist-server/modules/crewx.module.js +0 -47
- package/dist-server/repository/base-sqlite.repository.js +0 -18
- package/dist-server/repository/box.repository.js +0 -99
- package/dist-server/repository/message.repository.js +0 -22
- package/dist-server/repository/project.repository.js +0 -51
- package/dist-server/repository/repository.module.js +0 -34
- package/dist-server/repository/request-log.repository.js +0 -96
- package/dist-server/repository/task.repository.js +0 -105
- package/dist-server/repository/thread.repository.js +0 -165
- package/dist-server/shared/crewx-home.js +0 -58
- package/dist-server/shared/crewx-state.js +0 -66
- package/dist-server/test-utils/compat-database.js +0 -30
- package/dist-server/utils/tokenizer.js +0 -8
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ThreadService = void 0;
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const tokenizer_js_1 = require("../../utils/tokenizer.js");
|
|
15
|
-
const sdk_1 = require("@crewx/sdk");
|
|
16
|
-
const thread_repository_js_1 = require("../../repository/thread.repository.js");
|
|
17
|
-
let ThreadService = class ThreadService {
|
|
18
|
-
threadRepo;
|
|
19
|
-
constructor(threadRepo) {
|
|
20
|
-
this.threadRepo = threadRepo;
|
|
21
|
-
}
|
|
22
|
-
// THD.LIST: List threads from threads table (with optional q search)
|
|
23
|
-
listThreads(params, workspaceId) {
|
|
24
|
-
const rows = this.threadRepo.findAllThreads(workspaceId);
|
|
25
|
-
// Filter by platform
|
|
26
|
-
let filtered = rows;
|
|
27
|
-
const platform = params.platform || 'all';
|
|
28
|
-
if (platform !== 'all') {
|
|
29
|
-
filtered = filtered.filter((r) => r.platform === platform);
|
|
30
|
-
}
|
|
31
|
-
// Filter by search keyword (q param)
|
|
32
|
-
if (params.q && params.q.trim().length > 0) {
|
|
33
|
-
const queryLower = params.q.toLowerCase();
|
|
34
|
-
filtered = filtered.filter((r) => {
|
|
35
|
-
const text = [r.title, r.first_message, r.last_message].filter(Boolean).join(' ').toLowerCase();
|
|
36
|
-
return text.includes(queryLower);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
// Sort
|
|
40
|
-
const sort = params.sort || 'updatedAt';
|
|
41
|
-
const order = params.order || 'desc';
|
|
42
|
-
filtered.sort((a, b) => {
|
|
43
|
-
let cmp = 0;
|
|
44
|
-
if (sort === 'messageCount') {
|
|
45
|
-
cmp = (a.message_count ?? 0) - (b.message_count ?? 0);
|
|
46
|
-
}
|
|
47
|
-
else if (sort === 'createdAt') {
|
|
48
|
-
cmp = new Date(a.created_at).getTime() - new Date(b.created_at).getTime();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
cmp = new Date(a.updated_at).getTime() - new Date(b.updated_at).getTime();
|
|
52
|
-
}
|
|
53
|
-
return order === 'asc' ? cmp : -cmp;
|
|
54
|
-
});
|
|
55
|
-
// Pagination
|
|
56
|
-
const total = filtered.length;
|
|
57
|
-
const limit = this.normalizeLimit(params.limit, 50, 200);
|
|
58
|
-
const offset = this.normalizeOffset(params.offset);
|
|
59
|
-
const paged = filtered.slice(offset, offset + limit);
|
|
60
|
-
// Batch-fetch tasks for paged threads
|
|
61
|
-
const threadIds = paged.map((r) => r.id);
|
|
62
|
-
const tasksByThread = this.threadRepo.batchFetchTasks(threadIds, workspaceId);
|
|
63
|
-
const threads = paged.map((row) => ({
|
|
64
|
-
...this.toSummary(row),
|
|
65
|
-
tasks: (tasksByThread.get(row.id) || []).map((t) => ({
|
|
66
|
-
taskId: t.id,
|
|
67
|
-
agentId: t.agent_id || '',
|
|
68
|
-
prompt: '',
|
|
69
|
-
status: t.status,
|
|
70
|
-
startedAt: t.started_at,
|
|
71
|
-
completedAt: t.completed_at || null,
|
|
72
|
-
durationMs: t.duration_ms ?? null,
|
|
73
|
-
inputTokens: t.input_tokens ?? 0,
|
|
74
|
-
outputTokens: t.output_tokens ?? 0,
|
|
75
|
-
costUsd: t.cost_usd ?? 0,
|
|
76
|
-
error: t.error || null,
|
|
77
|
-
})),
|
|
78
|
-
}));
|
|
79
|
-
return { threads, total };
|
|
80
|
-
}
|
|
81
|
-
// THD.GET: Get thread meta info only (messages moved to MSG.LIST)
|
|
82
|
-
getThread(threadId, workspaceId) {
|
|
83
|
-
this.validateId(threadId);
|
|
84
|
-
const threadRow = this.threadRepo.findThreadById(threadId, workspaceId);
|
|
85
|
-
if (!threadRow) {
|
|
86
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
87
|
-
}
|
|
88
|
-
const stats = this.threadRepo.aggregateTaskStats(threadId, workspaceId);
|
|
89
|
-
return {
|
|
90
|
-
threadId: threadRow.id,
|
|
91
|
-
platform: threadRow.platform || 'cli',
|
|
92
|
-
title: threadRow.title || '',
|
|
93
|
-
agents: stats.agents,
|
|
94
|
-
createdAt: threadRow.created_at,
|
|
95
|
-
updatedAt: threadRow.updated_at,
|
|
96
|
-
pinned: !!(threadRow.pinned ?? 0),
|
|
97
|
-
starred: !!(threadRow.starred ?? 0),
|
|
98
|
-
totals: {
|
|
99
|
-
taskCount: stats.taskCount,
|
|
100
|
-
inputTokens: stats.inputTokens,
|
|
101
|
-
outputTokens: stats.outputTokens,
|
|
102
|
-
costUsd: stats.costUsd,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
// THD.PIN: Toggle pinned 0↔1
|
|
107
|
-
togglePin(workspaceId, threadId) {
|
|
108
|
-
this.validateId(threadId);
|
|
109
|
-
const result = this.threadRepo.togglePin(threadId, workspaceId);
|
|
110
|
-
if (!result)
|
|
111
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
112
|
-
return { threadId, pinned: result.pinned };
|
|
113
|
-
}
|
|
114
|
-
// THD.STAR: Toggle starred 0↔1
|
|
115
|
-
toggleStar(workspaceId, threadId) {
|
|
116
|
-
this.validateId(threadId);
|
|
117
|
-
const result = this.threadRepo.toggleStar(threadId, workspaceId);
|
|
118
|
-
if (!result)
|
|
119
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
120
|
-
return { threadId, starred: result.starred };
|
|
121
|
-
}
|
|
122
|
-
// THD.UPDATE: Update thread title (locks against auto-overwrite)
|
|
123
|
-
updateThread(threadId, workspaceId, patch) {
|
|
124
|
-
this.validateId(threadId);
|
|
125
|
-
const updated = this.threadRepo.updateThreadTitle(threadId, patch.title, workspaceId);
|
|
126
|
-
if (!updated) {
|
|
127
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
128
|
-
}
|
|
129
|
-
return { threadId, title: patch.title };
|
|
130
|
-
}
|
|
131
|
-
// TSK.LIST: List tasks for a thread (polling)
|
|
132
|
-
getThreadTasks(threadId, workspaceId) {
|
|
133
|
-
this.validateId(threadId);
|
|
134
|
-
const threadExists = this.threadRepo.threadExists(threadId, workspaceId);
|
|
135
|
-
const taskRows = this.threadRepo.findAllTasks(threadId, workspaceId);
|
|
136
|
-
// TSK.LIST spec: if thread exists but no tasks yet, return empty array (not 404)
|
|
137
|
-
if (taskRows.length === 0 && !threadExists) {
|
|
138
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
139
|
-
}
|
|
140
|
-
const tasks = taskRows.map((t) => ({
|
|
141
|
-
taskId: t.id,
|
|
142
|
-
agentId: t.agent_id || undefined,
|
|
143
|
-
status: t.status,
|
|
144
|
-
prompt: t.prompt || undefined,
|
|
145
|
-
startedAt: t.started_at,
|
|
146
|
-
completedAt: t.completed_at || undefined,
|
|
147
|
-
durationMs: t.duration_ms ?? undefined,
|
|
148
|
-
inputTokens: t.input_tokens ?? undefined,
|
|
149
|
-
outputTokens: t.output_tokens ?? undefined,
|
|
150
|
-
costUsd: t.cost_usd ?? undefined,
|
|
151
|
-
error: t.error || undefined,
|
|
152
|
-
parentTaskId: t.parent_task_id || undefined,
|
|
153
|
-
}));
|
|
154
|
-
return { tasks, total: tasks.length };
|
|
155
|
-
}
|
|
156
|
-
// TSK.GET: Get individual task detail with logs + children
|
|
157
|
-
getThreadTask(threadId, taskId, include, logLimit, workspaceId) {
|
|
158
|
-
this.validateId(threadId);
|
|
159
|
-
this.validateId(taskId);
|
|
160
|
-
const includes = (include || '').split(',').map((s) => s.trim());
|
|
161
|
-
const wantLogs = includes.includes('logs');
|
|
162
|
-
const wantChildren = includes.includes('children');
|
|
163
|
-
const limit = this.normalizeLimit(logLimit, 20, 200);
|
|
164
|
-
const found = this.threadRepo.findTaskById(threadId, taskId, workspaceId);
|
|
165
|
-
if (!found) {
|
|
166
|
-
throw new common_1.NotFoundException(`Task not found: ${taskId} in thread: ${threadId}`);
|
|
167
|
-
}
|
|
168
|
-
const { task: row, children } = found;
|
|
169
|
-
const result = {
|
|
170
|
-
taskId: row.id,
|
|
171
|
-
threadId: row.thread_id,
|
|
172
|
-
agentId: row.agent_id || undefined,
|
|
173
|
-
status: row.status,
|
|
174
|
-
prompt: row.prompt || undefined,
|
|
175
|
-
result: row.result || undefined,
|
|
176
|
-
startedAt: row.started_at,
|
|
177
|
-
completedAt: row.completed_at || undefined,
|
|
178
|
-
durationMs: row.duration_ms ?? undefined,
|
|
179
|
-
inputTokens: row.input_tokens ?? undefined,
|
|
180
|
-
outputTokens: row.output_tokens ?? undefined,
|
|
181
|
-
costUsd: row.cost_usd ?? undefined,
|
|
182
|
-
error: row.error || undefined,
|
|
183
|
-
parentTaskId: row.parent_task_id || undefined,
|
|
184
|
-
callerAgentId: row.caller_agent_id || undefined,
|
|
185
|
-
};
|
|
186
|
-
if (wantLogs) {
|
|
187
|
-
result.logs = this.parseLogs(row.logs, limit);
|
|
188
|
-
}
|
|
189
|
-
if (wantChildren && children) {
|
|
190
|
-
result.childTasks = children.map((child) => {
|
|
191
|
-
const logs = this.parseLogs(child.logs, 1);
|
|
192
|
-
return {
|
|
193
|
-
taskId: child.id,
|
|
194
|
-
agentId: child.agent_id || '',
|
|
195
|
-
status: child.status,
|
|
196
|
-
startedAt: child.started_at,
|
|
197
|
-
completedAt: child.completed_at || undefined,
|
|
198
|
-
durationMs: child.duration_ms ?? undefined,
|
|
199
|
-
error: child.error || undefined,
|
|
200
|
-
latestLog: logs.length > 0 ? logs[logs.length - 1] : undefined,
|
|
201
|
-
};
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
206
|
-
// CTX.BUILD: Build context with Hot/Warm zones (v2 spec)
|
|
207
|
-
// Delegates to SDK buildContext; server injects tiktoken-based ITokenizer for precision.
|
|
208
|
-
buildContext(threadId, boxService, params, _workspaceId) {
|
|
209
|
-
const tiktokenTokenizer = { countTokens: tokenizer_js_1.countTokens };
|
|
210
|
-
return (0, sdk_1.buildContext)(threadId, this, // ThreadService satisfies ITaskReader
|
|
211
|
-
boxService, params, tiktokenTokenizer);
|
|
212
|
-
}
|
|
213
|
-
// --- Private helpers ---
|
|
214
|
-
// Reconstruct messages from tasks (used by buildContext and MessageService)
|
|
215
|
-
getThreadMessages(threadId, workspaceId) {
|
|
216
|
-
this.validateId(threadId);
|
|
217
|
-
const threadExists = this.threadRepo.threadExists(threadId, workspaceId);
|
|
218
|
-
const taskRows = this.threadRepo.findTopLevelTasks(threadId, workspaceId);
|
|
219
|
-
if (!threadExists && taskRows.length === 0) {
|
|
220
|
-
throw new common_1.NotFoundException(`Thread not found: ${threadId}`);
|
|
221
|
-
}
|
|
222
|
-
const messages = [];
|
|
223
|
-
for (const task of taskRows) {
|
|
224
|
-
if (task.prompt) {
|
|
225
|
-
messages.push({
|
|
226
|
-
id: `${task.id}-user`,
|
|
227
|
-
role: 'user',
|
|
228
|
-
content: task.prompt,
|
|
229
|
-
timestamp: task.started_at,
|
|
230
|
-
metadata: null,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
if (task.result || task.status !== 'pending') {
|
|
234
|
-
let content = task.result || '';
|
|
235
|
-
let numTurns = null;
|
|
236
|
-
let totalCostUsd = null;
|
|
237
|
-
let sessionId = null;
|
|
238
|
-
try {
|
|
239
|
-
const parsed = JSON.parse(content);
|
|
240
|
-
if (Array.isArray(parsed)) {
|
|
241
|
-
// Contaminated content array → extract text only
|
|
242
|
-
content = parsed
|
|
243
|
-
.filter((c) => c?.type === 'text' && c?.text)
|
|
244
|
-
.map((c) => c.text)
|
|
245
|
-
.join('\n');
|
|
246
|
-
}
|
|
247
|
-
else if (parsed && typeof parsed === 'object' && parsed.result !== undefined) {
|
|
248
|
-
content = parsed.result || '';
|
|
249
|
-
numTurns = parsed.num_turns ?? null;
|
|
250
|
-
totalCostUsd = parsed.total_cost_usd ?? null;
|
|
251
|
-
sessionId = parsed.session_id ?? null;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
catch {
|
|
255
|
-
// Not JSON — strip CLI noise from raw content
|
|
256
|
-
content = this.stripCliNoise(content);
|
|
257
|
-
}
|
|
258
|
-
messages.push({
|
|
259
|
-
id: `${task.id}-assistant`,
|
|
260
|
-
role: 'assistant',
|
|
261
|
-
content,
|
|
262
|
-
timestamp: task.completed_at || task.started_at,
|
|
263
|
-
metadata: {
|
|
264
|
-
task: {
|
|
265
|
-
taskId: task.id,
|
|
266
|
-
agentId: task.agent_id || '',
|
|
267
|
-
status: task.status,
|
|
268
|
-
prompt: task.prompt || '',
|
|
269
|
-
startedAt: task.started_at,
|
|
270
|
-
completedAt: task.completed_at || null,
|
|
271
|
-
durationMs: task.duration_ms ?? null,
|
|
272
|
-
numTurns,
|
|
273
|
-
inputTokens: task.input_tokens ?? 0,
|
|
274
|
-
outputTokens: task.output_tokens ?? 0,
|
|
275
|
-
costUsd: task.cost_usd ?? 0,
|
|
276
|
-
totalCostUsd,
|
|
277
|
-
sessionId,
|
|
278
|
-
error: task.error || null,
|
|
279
|
-
logs: this.parseLogs(task.logs, 50),
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return messages;
|
|
286
|
-
}
|
|
287
|
-
/** Expose DB path for callers that need it (e.g. MessageService). */
|
|
288
|
-
resolveCrewxDbPath(_workspaceId) {
|
|
289
|
-
return this.threadRepo.resolveDbPath();
|
|
290
|
-
}
|
|
291
|
-
stripCliNoise(content) {
|
|
292
|
-
// Remove <conversation_history> blocks (contaminated previous chat data)
|
|
293
|
-
let cleaned = content.replace(/<conversation_history[^>]*>[\s\S]*?<\/conversation_history>/g, '');
|
|
294
|
-
const lines = cleaned.split('\n');
|
|
295
|
-
const cleanLines = lines.filter(line => {
|
|
296
|
-
// Strip CLI runtime log lines
|
|
297
|
-
if (line.startsWith('Loaded ') && line.includes('layouts from'))
|
|
298
|
-
return false;
|
|
299
|
-
if (line.includes('[dotenv@'))
|
|
300
|
-
return false;
|
|
301
|
-
if (line.includes('[Nest]') && line.includes('DEBUG'))
|
|
302
|
-
return false;
|
|
303
|
-
if (line.startsWith('Registered custom layout:'))
|
|
304
|
-
return false;
|
|
305
|
-
if (line.startsWith('Updated custom layout:'))
|
|
306
|
-
return false;
|
|
307
|
-
return true;
|
|
308
|
-
});
|
|
309
|
-
return cleanLines.join('\n').trim();
|
|
310
|
-
}
|
|
311
|
-
toSummary = (row) => ({
|
|
312
|
-
threadId: row.id,
|
|
313
|
-
platform: row.platform || 'cli',
|
|
314
|
-
title: row.title || '',
|
|
315
|
-
messageCount: row.message_count ?? 0,
|
|
316
|
-
createdAt: row.created_at,
|
|
317
|
-
updatedAt: row.updated_at,
|
|
318
|
-
pinned: !!(row.pinned ?? 0),
|
|
319
|
-
starred: !!(row.starred ?? 0),
|
|
320
|
-
});
|
|
321
|
-
validateId(id) {
|
|
322
|
-
if (!/^[\w\p{L}\p{N}._-]+$/u.test(id)) {
|
|
323
|
-
throw new common_1.BadRequestException('Invalid ID format');
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
normalizeLimit(limit, fallback, max) {
|
|
327
|
-
const num = Number(limit);
|
|
328
|
-
if (!Number.isFinite(num) || num <= 0)
|
|
329
|
-
return fallback;
|
|
330
|
-
return Math.min(Math.floor(num), max);
|
|
331
|
-
}
|
|
332
|
-
normalizeOffset(offset) {
|
|
333
|
-
const num = Number(offset);
|
|
334
|
-
if (!Number.isFinite(num) || num < 0)
|
|
335
|
-
return 0;
|
|
336
|
-
return Math.floor(num);
|
|
337
|
-
}
|
|
338
|
-
truncate(text, maxLen) {
|
|
339
|
-
if (text.length <= maxLen)
|
|
340
|
-
return text;
|
|
341
|
-
return text.slice(0, maxLen) + '...';
|
|
342
|
-
}
|
|
343
|
-
/** @see TaskService.parseLogs — 동일 역할, ACP 파싱 로직 동기화 필요 */
|
|
344
|
-
parseLogs(logsJson, logLimit) {
|
|
345
|
-
if (!logsJson)
|
|
346
|
-
return [];
|
|
347
|
-
let rawLogs;
|
|
348
|
-
try {
|
|
349
|
-
rawLogs = JSON.parse(logsJson);
|
|
350
|
-
}
|
|
351
|
-
catch {
|
|
352
|
-
return [];
|
|
353
|
-
}
|
|
354
|
-
if (!Array.isArray(rawLogs))
|
|
355
|
-
return [];
|
|
356
|
-
const entries = [];
|
|
357
|
-
for (const log of rawLogs) {
|
|
358
|
-
if (log.level === 'stdout') {
|
|
359
|
-
try {
|
|
360
|
-
const parsed = (0, sdk_1.parseStdoutEvent)(log.timestamp, log.message);
|
|
361
|
-
if (parsed.length > 0) {
|
|
362
|
-
entries.push(...parsed);
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
catch { /* adapter parse failure — fallback to text */ }
|
|
367
|
-
entries.push({ timestamp: log.timestamp, type: 'text', content: log.message });
|
|
368
|
-
}
|
|
369
|
-
else if (log.level === 'info') {
|
|
370
|
-
entries.push(...(0, sdk_1.defaultParseEvent)(log.message, log.timestamp));
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
// Pipeline: merge consecutive text → deduplicate tool_use → logLimit slice
|
|
374
|
-
const merged = this.mergeConsecutiveText(entries);
|
|
375
|
-
const deduped = this.deduplicateToolUse(merged);
|
|
376
|
-
if (deduped.length > logLimit) {
|
|
377
|
-
return deduped.slice(deduped.length - logLimit);
|
|
378
|
-
}
|
|
379
|
-
return deduped;
|
|
380
|
-
}
|
|
381
|
-
/** Merge consecutive type=text entries into one (fixes Gemini delta streaming fragmentation) */
|
|
382
|
-
mergeConsecutiveText(entries) {
|
|
383
|
-
const merged = [];
|
|
384
|
-
for (const entry of entries) {
|
|
385
|
-
const prev = merged[merged.length - 1];
|
|
386
|
-
if (prev && prev.type === 'text' && entry.type === 'text') {
|
|
387
|
-
prev.content = (prev.content || '') + (entry.content || '');
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
merged.push({ ...entry });
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
return merged;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* ACP providers (claude, opencode) emit the same toolUseId twice — first with
|
|
397
|
-
* a placeholder input, then with the real one. Keep only the last occurrence.
|
|
398
|
-
*/
|
|
399
|
-
deduplicateToolUse(entries) {
|
|
400
|
-
const latestIdx = new Map();
|
|
401
|
-
for (let i = 0; i < entries.length; i++) {
|
|
402
|
-
const e = entries[i];
|
|
403
|
-
if (e.type === 'tool_use' && e.toolUseId) {
|
|
404
|
-
latestIdx.set(e.toolUseId, i);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
return entries.filter((e, i) => {
|
|
408
|
-
if (e.type === 'tool_use' && e.toolUseId) {
|
|
409
|
-
return latestIdx.get(e.toolUseId) === i;
|
|
410
|
-
}
|
|
411
|
-
return true;
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
exports.ThreadService = ThreadService;
|
|
416
|
-
exports.ThreadService = ThreadService = __decorate([
|
|
417
|
-
(0, common_1.Injectable)(),
|
|
418
|
-
__metadata("design:paramtypes", [thread_repository_js_1.ThreadRepository])
|
|
419
|
-
], ThreadService);
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.UsageController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
-
const usage_service_js_1 = require("./usage.service.js");
|
|
19
|
-
const usage_types_js_1 = require("./usage.types.js");
|
|
20
|
-
let UsageController = class UsageController {
|
|
21
|
-
usageService;
|
|
22
|
-
constructor(usageService) {
|
|
23
|
-
this.usageService = usageService;
|
|
24
|
-
}
|
|
25
|
-
// USG.AGENT: 에이전트별 사용량 집계
|
|
26
|
-
getAgentUsage(from, to, workspace) {
|
|
27
|
-
if (!from || !to) {
|
|
28
|
-
throw new common_1.BadRequestException('Both "from" and "to" query parameters are required (ISO 8601)');
|
|
29
|
-
}
|
|
30
|
-
const data = this.usageService.getAgentUsage(from, to, workspace);
|
|
31
|
-
return { success: true, data };
|
|
32
|
-
}
|
|
33
|
-
// USG.AGENT.TREND: 에이전트별 일별 트렌드
|
|
34
|
-
getAgentUsageTrend(from, to, tz, workspace) {
|
|
35
|
-
if (!from || !to || !tz) {
|
|
36
|
-
throw new common_1.BadRequestException('Parameters "from", "to" (ISO 8601), and "tz" (IANA timezone) are required');
|
|
37
|
-
}
|
|
38
|
-
const data = this.usageService.getAgentUsageTrend(from, to, tz, workspace);
|
|
39
|
-
return { success: true, data };
|
|
40
|
-
}
|
|
41
|
-
// USG.DAILY: 일별 사용량 조회
|
|
42
|
-
async getDailyUsage(provider = 'all', force = 'false', res) {
|
|
43
|
-
const validProvider = this.validateProvider(provider);
|
|
44
|
-
try {
|
|
45
|
-
const result = await this.usageService.getDailyUsage(validProvider, force === 'true');
|
|
46
|
-
res.setHeader('X-Cache', result.cached ? 'HIT' : 'MISS');
|
|
47
|
-
return { success: true, data: result.data };
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
throw new common_1.InternalServerErrorException('Failed to load daily usage data');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// USG.MONTHLY: 월별 사용량 조회
|
|
54
|
-
async getMonthlyUsage(provider = 'all', force = 'false', res) {
|
|
55
|
-
const validProvider = this.validateProvider(provider);
|
|
56
|
-
try {
|
|
57
|
-
const result = await this.usageService.getMonthlyUsage(validProvider, force === 'true');
|
|
58
|
-
res.setHeader('X-Cache', result.cached ? 'HIT' : 'MISS');
|
|
59
|
-
return { success: true, data: result.data };
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
throw new common_1.InternalServerErrorException('Failed to load monthly usage data');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
validateProvider(provider) {
|
|
66
|
-
if (usage_types_js_1.VALID_PROVIDERS.includes(provider)) {
|
|
67
|
-
return provider;
|
|
68
|
-
}
|
|
69
|
-
throw new common_1.BadRequestException('Invalid provider. Must be one of: claude, codex, all');
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
exports.UsageController = UsageController;
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, swagger_1.ApiOperation)({ operationId: 'USG.AGENT', summary: 'Get per-agent usage aggregation' }),
|
|
75
|
-
(0, common_1.Get)('agents'),
|
|
76
|
-
__param(0, (0, common_1.Query)('from')),
|
|
77
|
-
__param(1, (0, common_1.Query)('to')),
|
|
78
|
-
__param(2, (0, common_1.Query)('workspace')),
|
|
79
|
-
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
81
|
-
__metadata("design:returntype", void 0)
|
|
82
|
-
], UsageController.prototype, "getAgentUsage", null);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, swagger_1.ApiOperation)({ operationId: 'USG.AGENT.TREND', summary: 'Get per-agent daily trend' }),
|
|
85
|
-
(0, common_1.Get)('agents/trend'),
|
|
86
|
-
__param(0, (0, common_1.Query)('from')),
|
|
87
|
-
__param(1, (0, common_1.Query)('to')),
|
|
88
|
-
__param(2, (0, common_1.Query)('tz')),
|
|
89
|
-
__param(3, (0, common_1.Query)('workspace')),
|
|
90
|
-
__metadata("design:type", Function),
|
|
91
|
-
__metadata("design:paramtypes", [String, String, String, String]),
|
|
92
|
-
__metadata("design:returntype", void 0)
|
|
93
|
-
], UsageController.prototype, "getAgentUsageTrend", null);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, swagger_1.ApiOperation)({ operationId: 'USG.DAILY', summary: 'Get daily usage statistics' }),
|
|
96
|
-
(0, common_1.Get)('daily'),
|
|
97
|
-
__param(0, (0, common_1.Query)('provider')),
|
|
98
|
-
__param(1, (0, common_1.Query)('force')),
|
|
99
|
-
__param(2, (0, common_1.Res)({ passthrough: true })),
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
102
|
-
__metadata("design:returntype", Promise)
|
|
103
|
-
], UsageController.prototype, "getDailyUsage", null);
|
|
104
|
-
__decorate([
|
|
105
|
-
(0, swagger_1.ApiOperation)({ operationId: 'USG.MONTHLY', summary: 'Get monthly usage statistics' }),
|
|
106
|
-
(0, common_1.Get)('monthly'),
|
|
107
|
-
__param(0, (0, common_1.Query)('provider')),
|
|
108
|
-
__param(1, (0, common_1.Query)('force')),
|
|
109
|
-
__param(2, (0, common_1.Res)({ passthrough: true })),
|
|
110
|
-
__metadata("design:type", Function),
|
|
111
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
112
|
-
__metadata("design:returntype", Promise)
|
|
113
|
-
], UsageController.prototype, "getMonthlyUsage", null);
|
|
114
|
-
exports.UsageController = UsageController = __decorate([
|
|
115
|
-
(0, swagger_1.ApiTags)('usage'),
|
|
116
|
-
(0, common_1.Controller)('ws/:slug/usage'),
|
|
117
|
-
__metadata("design:paramtypes", [usage_service_js_1.UsageService])
|
|
118
|
-
], UsageController);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.UsageModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const usage_controller_js_1 = require("./usage.controller.js");
|
|
12
|
-
const usage_service_js_1 = require("./usage.service.js");
|
|
13
|
-
let UsageModule = class UsageModule {
|
|
14
|
-
};
|
|
15
|
-
exports.UsageModule = UsageModule;
|
|
16
|
-
exports.UsageModule = UsageModule = __decorate([
|
|
17
|
-
(0, common_1.Module)({
|
|
18
|
-
controllers: [usage_controller_js_1.UsageController],
|
|
19
|
-
providers: [usage_service_js_1.UsageService],
|
|
20
|
-
})
|
|
21
|
-
], UsageModule);
|