@resolveio/server-lib 20.13.12 → 20.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/collections/ai-terminal-conversation.collection.d.ts +2 -0
- package/collections/ai-terminal-conversation.collection.js +133 -0
- package/collections/ai-terminal-conversation.collection.js.map +1 -0
- package/collections/ai-terminal-message.collection.d.ts +2 -0
- package/collections/ai-terminal-message.collection.js +113 -0
- package/collections/ai-terminal-message.collection.js.map +1 -0
- package/collections/communication-metric.collection.d.ts +2 -0
- package/collections/communication-metric.collection.js +133 -0
- package/collections/communication-metric.collection.js.map +1 -0
- package/collections/openai-usage-ledger.collection.d.ts +2 -0
- package/collections/openai-usage-ledger.collection.js +120 -0
- package/collections/openai-usage-ledger.collection.js.map +1 -0
- package/managers/communication-metric.manager.d.ts +16 -0
- package/managers/communication-metric.manager.js +134 -0
- package/managers/communication-metric.manager.js.map +1 -0
- package/managers/method.manager.d.ts +2 -0
- package/managers/method.manager.js +162 -45
- package/managers/method.manager.js.map +1 -1
- package/managers/openai-usage-ledger.manager.d.ts +14 -0
- package/managers/openai-usage-ledger.manager.js +137 -0
- package/managers/openai-usage-ledger.manager.js.map +1 -0
- package/managers/subscription.manager.js +2 -0
- package/managers/subscription.manager.js.map +1 -1
- package/methods/ai-terminal.d.ts +1 -0
- package/methods/ai-terminal.js +1200 -0
- package/methods/ai-terminal.js.map +1 -0
- package/methods/report-builder.js +741 -0
- package/methods/report-builder.js.map +1 -1
- package/methods.ts +27 -0
- package/models/ai-terminal-conversation.model.d.ts +16 -0
- package/models/ai-terminal-conversation.model.js +4 -0
- package/models/ai-terminal-conversation.model.js.map +1 -0
- package/models/ai-terminal-message.model.d.ts +22 -0
- package/models/ai-terminal-message.model.js +4 -0
- package/models/ai-terminal-message.model.js.map +1 -0
- package/models/communication-metric.model.d.ts +20 -0
- package/models/communication-metric.model.js +4 -0
- package/models/communication-metric.model.js.map +1 -0
- package/models/openai-usage-ledger.model.d.ts +14 -0
- package/models/openai-usage-ledger.model.js +4 -0
- package/models/openai-usage-ledger.model.js.map +1 -0
- package/package.json +5 -1
- package/public_api.d.ts +13 -0
- package/public_api.js +13 -0
- package/public_api.js.map +1 -1
- package/publications/ai-terminal.d.ts +1 -0
- package/publications/ai-terminal.js +58 -0
- package/publications/ai-terminal.js.map +1 -0
- package/publications.ts +6 -0
- package/services/codex-client.d.ts +81 -0
- package/services/codex-client.js +991 -0
- package/services/codex-client.js.map +1 -0
- package/services/openai-client.d.ts +46 -0
- package/services/openai-client.js +315 -0
- package/services/openai-client.js.map +1 -0
- package/util/tokenizer.d.ts +5 -0
- package/util/tokenizer.js +35 -0
- package/util/tokenizer.js.map +1 -0
package/methods.ts
CHANGED
|
@@ -3,6 +3,30 @@ import { UserModel } from './models/user.model';
|
|
|
3
3
|
|
|
4
4
|
export function SERVER_METHODS(resolveioServer) {
|
|
5
5
|
return {
|
|
6
|
+
aiCoderTerminalDeployTest: (cb?: Function): Promise<any> => {
|
|
7
|
+
return resolveioServer.call('aiCoderTerminalDeployTest', cb);
|
|
8
|
+
},
|
|
9
|
+
aiCoderTerminalRunCodex: (payload, cb?: Function): Promise<any> => {
|
|
10
|
+
return resolveioServer.call('aiCoderTerminalRunCodex', payload, cb);
|
|
11
|
+
},
|
|
12
|
+
aiCoderTerminalUploadFile: (id_conversation: string, file_name: string, content_base64: string, size: number, content_type?: string, cb?: Function): Promise<any> => {
|
|
13
|
+
return resolveioServer.call('aiCoderTerminalUploadFile', id_conversation, file_name, content_base64, size, content_type, cb);
|
|
14
|
+
},
|
|
15
|
+
aiTerminalConversationCreate: (payload, cb?: Function): Promise<any> => {
|
|
16
|
+
return resolveioServer.call('aiTerminalConversationCreate', payload, cb);
|
|
17
|
+
},
|
|
18
|
+
aiTerminalConversationDelete: (id_conversation: string, cb?: Function): Promise<any> => {
|
|
19
|
+
return resolveioServer.call('aiTerminalConversationDelete', id_conversation, cb);
|
|
20
|
+
},
|
|
21
|
+
aiTerminalConversationUpdate: (id_conversation: string, patch, cb?: Function): Promise<any> => {
|
|
22
|
+
return resolveioServer.call('aiTerminalConversationUpdate', id_conversation, patch, cb);
|
|
23
|
+
},
|
|
24
|
+
aiTerminalRun: (payload, cb?: Function): Promise<any> => {
|
|
25
|
+
return resolveioServer.call('aiTerminalRun', payload, cb);
|
|
26
|
+
},
|
|
27
|
+
aiTerminalUploadFile: (id_conversation: string, file_name: string, content_base64: string, size: number, content_type?: string, cb?: Function): Promise<any> => {
|
|
28
|
+
return resolveioServer.call('aiTerminalUploadFile', id_conversation, file_name, content_base64, size, content_type, cb);
|
|
29
|
+
},
|
|
6
30
|
collectionListAll: (cb?: Function): Promise<any> => {
|
|
7
31
|
return resolveioServer.call('collectionListAll', cb);
|
|
8
32
|
},
|
|
@@ -141,6 +165,9 @@ export function SERVER_METHODS(resolveioServer) {
|
|
|
141
165
|
removeDocumentsWithQuery: (collection: string, query: Object, cb?: Function): Promise<any> => {
|
|
142
166
|
return resolveioServer.call('removeDocumentsWithQuery', collection, query, cb);
|
|
143
167
|
},
|
|
168
|
+
reportBuilderAiSuggest: (payload: any, cb?: Function): Promise<any> => {
|
|
169
|
+
return resolveioServer.call('reportBuilderAiSuggest', payload, cb);
|
|
170
|
+
},
|
|
144
171
|
reportBuilderBuildTree: (collection_root: string, collectionJoins: any[] = [], cb?: Function): Promise<any> => {
|
|
145
172
|
return resolveioServer.call('reportBuilderBuildTree', collection_root, collectionJoins, cb);
|
|
146
173
|
},
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CollectionDocument } from './collection-document.model';
|
|
2
|
+
export type AiTerminalMode = 'openai' | 'codex';
|
|
3
|
+
export type AiTerminalConversationStatus = 'active' | 'archived';
|
|
4
|
+
export interface AiTerminalConversationModel extends CollectionDocument {
|
|
5
|
+
id_client?: string;
|
|
6
|
+
id_app?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
mode?: AiTerminalMode;
|
|
9
|
+
branch_enabled?: boolean;
|
|
10
|
+
branch_name?: string;
|
|
11
|
+
status?: AiTerminalConversationStatus;
|
|
12
|
+
profile_id?: string;
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
last_message_at?: Date;
|
|
15
|
+
last_message_id?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/ai-terminal-conversation.model.ts"],"names":[],"mappings":"","file":"ai-terminal-conversation.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport type AiTerminalMode = 'openai' | 'codex';\nexport type AiTerminalConversationStatus = 'active' | 'archived';\n\nexport interface AiTerminalConversationModel extends CollectionDocument {\n\tid_client?: string;\n\tid_app?: string;\n\ttitle?: string;\n\tmode?: AiTerminalMode;\n\tbranch_enabled?: boolean;\n\tbranch_name?: string;\n\tstatus?: AiTerminalConversationStatus;\n\tprofile_id?: string;\n\tmetadata?: Record<string, any>;\n\tlast_message_at?: Date;\n\tlast_message_id?: string;\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CollectionDocument } from './collection-document.model';
|
|
2
|
+
export type AiTerminalMessageRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
3
|
+
export interface AiTerminalMessageModel extends CollectionDocument {
|
|
4
|
+
id_conversation: string;
|
|
5
|
+
role: AiTerminalMessageRole;
|
|
6
|
+
content: string;
|
|
7
|
+
metadata?: Record<string, any>;
|
|
8
|
+
usage?: {
|
|
9
|
+
model?: string;
|
|
10
|
+
input_tokens?: number;
|
|
11
|
+
output_tokens?: number;
|
|
12
|
+
total_tokens?: number;
|
|
13
|
+
cost_estimate?: number;
|
|
14
|
+
};
|
|
15
|
+
attachments?: Array<{
|
|
16
|
+
id?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
local_path?: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/ai-terminal-message.model.ts"],"names":[],"mappings":"","file":"ai-terminal-message.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport type AiTerminalMessageRole = 'system' | 'user' | 'assistant' | 'tool';\n\nexport interface AiTerminalMessageModel extends CollectionDocument {\n\tid_conversation: string;\n\trole: AiTerminalMessageRole;\n\tcontent: string;\n\tmetadata?: Record<string, any>;\n\tusage?: {\n\t\tmodel?: string;\n\t\tinput_tokens?: number;\n\t\toutput_tokens?: number;\n\t\ttotal_tokens?: number;\n\t\tcost_estimate?: number;\n\t};\n\tattachments?: Array<{\n\t\tid?: string;\n\t\tname?: string;\n\t\ttype?: string;\n\t\tsize?: number;\n\t\tlocal_path?: string;\n\t}>;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CollectionDocument } from './collection-document.model';
|
|
2
|
+
export type CommunicationMetricChannel = 'email' | 'sms';
|
|
3
|
+
export type CommunicationMetricStatus = 'queued' | 'sent' | 'failed';
|
|
4
|
+
export interface CommunicationMetricMetadata {
|
|
5
|
+
clientSlug?: string;
|
|
6
|
+
clientName?: string;
|
|
7
|
+
id_client?: string;
|
|
8
|
+
channel?: CommunicationMetricChannel;
|
|
9
|
+
status?: CommunicationMetricStatus;
|
|
10
|
+
provider?: string;
|
|
11
|
+
method?: string;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
export interface CommunicationMetricModel extends CollectionDocument {
|
|
15
|
+
date: Date;
|
|
16
|
+
type: string;
|
|
17
|
+
value: number;
|
|
18
|
+
unit?: string;
|
|
19
|
+
metadata?: CommunicationMetricMetadata;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/communication-metric.model.ts"],"names":[],"mappings":"","file":"communication-metric.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport type CommunicationMetricChannel = 'email' | 'sms';\nexport type CommunicationMetricStatus = 'queued' | 'sent' | 'failed';\n\nexport interface CommunicationMetricMetadata {\n\tclientSlug?: string;\n\tclientName?: string;\n\tid_client?: string;\n\tchannel?: CommunicationMetricChannel;\n\tstatus?: CommunicationMetricStatus;\n\tprovider?: string;\n\tmethod?: string;\n\t[key: string]: any;\n}\n\nexport interface CommunicationMetricModel extends CollectionDocument {\n\tdate: Date;\n\ttype: string;\n\tvalue: number;\n\tunit?: string;\n\tmetadata?: CommunicationMetricMetadata;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CollectionDocument } from './collection-document.model';
|
|
2
|
+
export interface OpenAIUsageLedgerModel extends CollectionDocument {
|
|
3
|
+
id_client: string;
|
|
4
|
+
timestamp: Date;
|
|
5
|
+
model: string;
|
|
6
|
+
input_tokens: number;
|
|
7
|
+
output_tokens: number;
|
|
8
|
+
total_tokens: number;
|
|
9
|
+
cost_estimate: number;
|
|
10
|
+
billable: boolean;
|
|
11
|
+
category?: string;
|
|
12
|
+
id_request?: string;
|
|
13
|
+
id_conversation?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/models/openai-usage-ledger.model.ts"],"names":[],"mappings":"","file":"openai-usage-ledger.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport interface OpenAIUsageLedgerModel extends CollectionDocument {\n\tid_client: string;\n\ttimestamp: Date;\n\tmodel: string;\n\tinput_tokens: number;\n\toutput_tokens: number;\n\ttotal_tokens: number;\n\tcost_estimate: number;\n\tbillable: boolean;\n\tcategory?: string;\n\tid_request?: string;\n\tid_conversation?: string;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolveio/server-lib",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.14.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"package": "./build_package.sh",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@aws-sdk/client-s3": "3.948.0",
|
|
18
18
|
"@aws-sdk/client-sesv2": "3.950.0",
|
|
19
19
|
"@aws-sdk/s3-request-presigner": "3.948.0",
|
|
20
|
+
"@openai/codex-sdk": "0.91.0",
|
|
20
21
|
"async": "3.2.6",
|
|
21
22
|
"axios": "1.13.2",
|
|
22
23
|
"clone": "2.1.2",
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
"imap": "0.8.19",
|
|
32
33
|
"json2csv": "6.0.0-alpha.2",
|
|
33
34
|
"jsonwebtoken": "9.0.2",
|
|
35
|
+
"js-tiktoken": "1.0.12",
|
|
34
36
|
"jwt-decode": "4.0.0",
|
|
35
37
|
"moment-timezone": "0.6.0",
|
|
36
38
|
"msgpackr": "1.11.5",
|
|
@@ -81,6 +83,7 @@
|
|
|
81
83
|
"@aws-sdk/client-s3": "3.925.0",
|
|
82
84
|
"@aws-sdk/client-sesv2": "3.925.0",
|
|
83
85
|
"@aws-sdk/s3-request-presigner": "3.925.0",
|
|
86
|
+
"@openai/codex-sdk": "0.91.0",
|
|
84
87
|
"axios": "1.13.2",
|
|
85
88
|
"body-parser": "2.2.0",
|
|
86
89
|
"clone": "2.1.2",
|
|
@@ -95,6 +98,7 @@
|
|
|
95
98
|
"imap": "0.8.19",
|
|
96
99
|
"json2csv": "6.0.0-alpha.2",
|
|
97
100
|
"jsonwebtoken": "9.0.2",
|
|
101
|
+
"js-tiktoken": "1.0.12",
|
|
98
102
|
"jwt-decode": "4.0.0",
|
|
99
103
|
"moment-timezone": "0.6.0",
|
|
100
104
|
"msgpackr": "1.11.5",
|
package/public_api.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export * from './collections/app-status.collection';
|
|
2
|
+
export * from './collections/ai-terminal-conversation.collection';
|
|
3
|
+
export * from './collections/ai-terminal-message.collection';
|
|
2
4
|
export * from './collections/counter.collection';
|
|
5
|
+
export * from './collections/communication-metric.collection';
|
|
3
6
|
export * from './collections/cron-job-history.collection';
|
|
4
7
|
export * from './collections/cron-job.collection';
|
|
5
8
|
export * from './collections/email-history.collection';
|
|
@@ -16,6 +19,7 @@ export * from './collections/monitor-function.collection';
|
|
|
16
19
|
export * from './collections/monitor-memory.collection';
|
|
17
20
|
export * from './collections/monitor-mongo.collection';
|
|
18
21
|
export * from './collections/notification.collection';
|
|
22
|
+
export * from './collections/openai-usage-ledger.collection';
|
|
19
23
|
export * from './collections/report-builder-library.collection';
|
|
20
24
|
export * from './collections/report-builder-report.collection';
|
|
21
25
|
export * from './collections/user-group.collection';
|
|
@@ -23,8 +27,11 @@ export * from './collections/user-guide.collection';
|
|
|
23
27
|
export * from './collections/user.collection';
|
|
24
28
|
export * from './managers/mongo.manager';
|
|
25
29
|
export * from './models/app-status.model';
|
|
30
|
+
export * from './models/ai-terminal-conversation.model';
|
|
31
|
+
export * from './models/ai-terminal-message.model';
|
|
26
32
|
export * from './models/billing-logged-in-users.model';
|
|
27
33
|
export * from './models/collection-document.model';
|
|
34
|
+
export * from './models/communication-metric.model';
|
|
28
35
|
export * from './models/counter.model';
|
|
29
36
|
export * from './models/cron-job-history.model';
|
|
30
37
|
export * from './models/cron-job.model';
|
|
@@ -44,6 +51,7 @@ export * from './models/monitor-cpu.model';
|
|
|
44
51
|
export * from './models/monitor-memory.model';
|
|
45
52
|
export * from './models/monitor-mongo.model';
|
|
46
53
|
export * from './models/notification.model';
|
|
54
|
+
export * from './models/openai-usage-ledger.model';
|
|
47
55
|
export * from './models/pagination.model';
|
|
48
56
|
export * from './models/permission.model';
|
|
49
57
|
export * from './models/report-builder-library.model';
|
|
@@ -56,5 +64,10 @@ export * from './models/support-ticket.model';
|
|
|
56
64
|
export * from './models/user-group.model';
|
|
57
65
|
export * from './models/user-guide.model';
|
|
58
66
|
export * from './models/user.model';
|
|
67
|
+
export * from './managers/openai-usage-ledger.manager';
|
|
68
|
+
export * from './managers/communication-metric.manager';
|
|
59
69
|
export * from './resolveio-server-app';
|
|
70
|
+
export * from './services/openai-client';
|
|
71
|
+
export * from './services/codex-client';
|
|
60
72
|
export * from './util/common';
|
|
73
|
+
export * from './util/tokenizer';
|
package/public_api.js
CHANGED
|
@@ -15,7 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./collections/app-status.collection"), exports);
|
|
18
|
+
__exportStar(require("./collections/ai-terminal-conversation.collection"), exports);
|
|
19
|
+
__exportStar(require("./collections/ai-terminal-message.collection"), exports);
|
|
18
20
|
__exportStar(require("./collections/counter.collection"), exports);
|
|
21
|
+
__exportStar(require("./collections/communication-metric.collection"), exports);
|
|
19
22
|
__exportStar(require("./collections/cron-job-history.collection"), exports);
|
|
20
23
|
__exportStar(require("./collections/cron-job.collection"), exports);
|
|
21
24
|
__exportStar(require("./collections/email-history.collection"), exports);
|
|
@@ -32,6 +35,7 @@ __exportStar(require("./collections/monitor-function.collection"), exports);
|
|
|
32
35
|
__exportStar(require("./collections/monitor-memory.collection"), exports);
|
|
33
36
|
__exportStar(require("./collections/monitor-mongo.collection"), exports);
|
|
34
37
|
__exportStar(require("./collections/notification.collection"), exports);
|
|
38
|
+
__exportStar(require("./collections/openai-usage-ledger.collection"), exports);
|
|
35
39
|
__exportStar(require("./collections/report-builder-library.collection"), exports);
|
|
36
40
|
__exportStar(require("./collections/report-builder-report.collection"), exports);
|
|
37
41
|
__exportStar(require("./collections/user-group.collection"), exports);
|
|
@@ -39,8 +43,11 @@ __exportStar(require("./collections/user-guide.collection"), exports);
|
|
|
39
43
|
__exportStar(require("./collections/user.collection"), exports);
|
|
40
44
|
__exportStar(require("./managers/mongo.manager"), exports);
|
|
41
45
|
__exportStar(require("./models/app-status.model"), exports);
|
|
46
|
+
__exportStar(require("./models/ai-terminal-conversation.model"), exports);
|
|
47
|
+
__exportStar(require("./models/ai-terminal-message.model"), exports);
|
|
42
48
|
__exportStar(require("./models/billing-logged-in-users.model"), exports);
|
|
43
49
|
__exportStar(require("./models/collection-document.model"), exports);
|
|
50
|
+
__exportStar(require("./models/communication-metric.model"), exports);
|
|
44
51
|
__exportStar(require("./models/counter.model"), exports);
|
|
45
52
|
__exportStar(require("./models/cron-job-history.model"), exports);
|
|
46
53
|
__exportStar(require("./models/cron-job.model"), exports);
|
|
@@ -60,6 +67,7 @@ __exportStar(require("./models/monitor-cpu.model"), exports);
|
|
|
60
67
|
__exportStar(require("./models/monitor-memory.model"), exports);
|
|
61
68
|
__exportStar(require("./models/monitor-mongo.model"), exports);
|
|
62
69
|
__exportStar(require("./models/notification.model"), exports);
|
|
70
|
+
__exportStar(require("./models/openai-usage-ledger.model"), exports);
|
|
63
71
|
__exportStar(require("./models/pagination.model"), exports);
|
|
64
72
|
__exportStar(require("./models/permission.model"), exports);
|
|
65
73
|
__exportStar(require("./models/report-builder-library.model"), exports);
|
|
@@ -72,7 +80,12 @@ __exportStar(require("./models/support-ticket.model"), exports);
|
|
|
72
80
|
__exportStar(require("./models/user-group.model"), exports);
|
|
73
81
|
__exportStar(require("./models/user-guide.model"), exports);
|
|
74
82
|
__exportStar(require("./models/user.model"), exports);
|
|
83
|
+
__exportStar(require("./managers/openai-usage-ledger.manager"), exports);
|
|
84
|
+
__exportStar(require("./managers/communication-metric.manager"), exports);
|
|
75
85
|
__exportStar(require("./resolveio-server-app"), exports);
|
|
86
|
+
__exportStar(require("./services/openai-client"), exports);
|
|
87
|
+
__exportStar(require("./services/codex-client"), exports);
|
|
76
88
|
__exportStar(require("./util/common"), exports);
|
|
89
|
+
__exportStar(require("./util/tokenizer"), exports);
|
|
77
90
|
|
|
78
91
|
//# sourceMappingURL=public_api.js.map
|
package/public_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,mEAAiD;AACjD,4EAA0D;AAC1D,oEAAkD;AAClD,yEAAuD;AACvD,0EAAwD;AACxD,gEAA8C;AAC9C,uEAAqD;AACrD,gEAA8C;AAC9C,8EAA4D;AAC5D,4EAA0D;AAC1D,+DAA6C;AAC7C,2EAAyD;AACzD,uEAAqD;AACrD,4EAA0D;AAC1D,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,kFAAgE;AAChE,iFAA+D;AAC/D,sEAAoD;AACpD,sEAAoD;AACpD,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,yEAAuD;AACvD,qEAAmD;AACnD,yDAAuC;AACvC,kEAAgD;AAChD,0DAAwC;AACxC,wDAAsC;AACtC,+DAA6C;AAC7C,gEAA8C;AAC9C,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,oEAAkD;AAClD,kEAAgD;AAChD,qDAAmC;AACnC,iEAA+C;AAC/C,iEAA+C;AAC/C,wDAAsC;AACtC,6DAA2C;AAC3C,gEAA8C;AAC9C,+DAA6C;AAC7C,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,wEAAsD;AACtD,uEAAqD;AACrD,gEAA8C;AAC9C,mEAAiD;AACjD,gEAA8C;AAC9C,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,4DAA0C;AAC1C,sDAAoC;AACpC,yDAAuC;AACvC,gDAA8B","file":"public_api.js","sourcesContent":["export * from './collections/app-status.collection';\nexport * from './collections/counter.collection';\nexport * from './collections/cron-job-history.collection';\nexport * from './collections/cron-job.collection';\nexport * from './collections/email-history.collection';\nexport * from './collections/email-verified.collection';\nexport * from './collections/file.collection';\nexport * from './collections/flag-update.collection';\nexport * from './collections/flag.collection';\nexport * from './collections/log-method-latency.collection';\nexport * from './collections/log-subscription.collection';\nexport * from './collections/log.collection';\nexport * from './collections/logged-in-users.collection';\nexport * from './collections/monitor-cpu.collection';\nexport * from './collections/monitor-function.collection';\nexport * from './collections/monitor-memory.collection';\nexport * from './collections/monitor-mongo.collection';\nexport * from './collections/notification.collection';\nexport * from './collections/report-builder-library.collection';\nexport * from './collections/report-builder-report.collection';\nexport * from './collections/user-group.collection';\nexport * from './collections/user-guide.collection';\nexport * from './collections/user.collection';\nexport * from './managers/mongo.manager';\nexport * from './models/app-status.model';\nexport * from './models/billing-logged-in-users.model';\nexport * from './models/collection-document.model';\nexport * from './models/counter.model';\nexport * from './models/cron-job-history.model';\nexport * from './models/cron-job.model';\nexport * from './models/dialog.model';\nexport * from './models/email-history.model';\nexport * from './models/email-verified.model';\nexport * from './models/file.model';\nexport * from './models/flag-update.model';\nexport * from './models/flag.model';\nexport * from './models/log-method-latency.model';\nexport * from './models/log-subscription.model';\nexport * from './models/log.model';\nexport * from './models/logged-in-users.model';\nexport * from './models/method-response.model';\nexport * from './models/method.model';\nexport * from './models/monitor-cpu.model';\nexport * from './models/monitor-memory.model';\nexport * from './models/monitor-mongo.model';\nexport * from './models/notification.model';\nexport * from './models/pagination.model';\nexport * from './models/permission.model';\nexport * from './models/report-builder-library.model';\nexport * from './models/report-builder-report.model';\nexport * from './models/report-builder.model';\nexport * from './models/select-data-label.model';\nexport * from './models/server-message.model';\nexport * from './models/subscription.model';\nexport * from './models/support-ticket.model';\nexport * from './models/user-group.model';\nexport * from './models/user-guide.model';\nexport * from './models/user.model';\nexport * from './resolveio-server-app';\nexport * from './util/common';\n
|
|
1
|
+
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,oFAAkE;AAClE,+EAA6D;AAC7D,mEAAiD;AACjD,gFAA8D;AAC9D,4EAA0D;AAC1D,oEAAkD;AAClD,yEAAuD;AACvD,0EAAwD;AACxD,gEAA8C;AAC9C,uEAAqD;AACrD,gEAA8C;AAC9C,8EAA4D;AAC5D,4EAA0D;AAC1D,+DAA6C;AAC7C,2EAAyD;AACzD,uEAAqD;AACrD,4EAA0D;AAC1D,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,+EAA6D;AAC7D,kFAAgE;AAChE,iFAA+D;AAC/D,sEAAoD;AACpD,sEAAoD;AACpD,gEAA8C;AAC9C,2DAAyC;AACzC,4DAA0C;AAC1C,0EAAwD;AACxD,qEAAmD;AACnD,yEAAuD;AACvD,qEAAmD;AACnD,sEAAoD;AACpD,yDAAuC;AACvC,kEAAgD;AAChD,0DAAwC;AACxC,wDAAsC;AACtC,+DAA6C;AAC7C,gEAA8C;AAC9C,sDAAoC;AACpC,6DAA2C;AAC3C,sDAAoC;AACpC,oEAAkD;AAClD,kEAAgD;AAChD,qDAAmC;AACnC,iEAA+C;AAC/C,iEAA+C;AAC/C,wDAAsC;AACtC,6DAA2C;AAC3C,gEAA8C;AAC9C,+DAA6C;AAC7C,8DAA4C;AAC5C,qEAAmD;AACnD,4DAA0C;AAC1C,4DAA0C;AAC1C,wEAAsD;AACtD,uEAAqD;AACrD,gEAA8C;AAC9C,mEAAiD;AACjD,gEAA8C;AAC9C,8DAA4C;AAC5C,gEAA8C;AAC9C,4DAA0C;AAC1C,4DAA0C;AAC1C,sDAAoC;AACpC,yEAAuD;AACvD,0EAAwD;AACxD,yDAAuC;AACvC,2DAAyC;AACzC,0DAAwC;AACxC,gDAA8B;AAC9B,mDAAiC","file":"public_api.js","sourcesContent":["export * from './collections/app-status.collection';\nexport * from './collections/ai-terminal-conversation.collection';\nexport * from './collections/ai-terminal-message.collection';\nexport * from './collections/counter.collection';\nexport * from './collections/communication-metric.collection';\nexport * from './collections/cron-job-history.collection';\nexport * from './collections/cron-job.collection';\nexport * from './collections/email-history.collection';\nexport * from './collections/email-verified.collection';\nexport * from './collections/file.collection';\nexport * from './collections/flag-update.collection';\nexport * from './collections/flag.collection';\nexport * from './collections/log-method-latency.collection';\nexport * from './collections/log-subscription.collection';\nexport * from './collections/log.collection';\nexport * from './collections/logged-in-users.collection';\nexport * from './collections/monitor-cpu.collection';\nexport * from './collections/monitor-function.collection';\nexport * from './collections/monitor-memory.collection';\nexport * from './collections/monitor-mongo.collection';\nexport * from './collections/notification.collection';\nexport * from './collections/openai-usage-ledger.collection';\nexport * from './collections/report-builder-library.collection';\nexport * from './collections/report-builder-report.collection';\nexport * from './collections/user-group.collection';\nexport * from './collections/user-guide.collection';\nexport * from './collections/user.collection';\nexport * from './managers/mongo.manager';\nexport * from './models/app-status.model';\nexport * from './models/ai-terminal-conversation.model';\nexport * from './models/ai-terminal-message.model';\nexport * from './models/billing-logged-in-users.model';\nexport * from './models/collection-document.model';\nexport * from './models/communication-metric.model';\nexport * from './models/counter.model';\nexport * from './models/cron-job-history.model';\nexport * from './models/cron-job.model';\nexport * from './models/dialog.model';\nexport * from './models/email-history.model';\nexport * from './models/email-verified.model';\nexport * from './models/file.model';\nexport * from './models/flag-update.model';\nexport * from './models/flag.model';\nexport * from './models/log-method-latency.model';\nexport * from './models/log-subscription.model';\nexport * from './models/log.model';\nexport * from './models/logged-in-users.model';\nexport * from './models/method-response.model';\nexport * from './models/method.model';\nexport * from './models/monitor-cpu.model';\nexport * from './models/monitor-memory.model';\nexport * from './models/monitor-mongo.model';\nexport * from './models/notification.model';\nexport * from './models/openai-usage-ledger.model';\nexport * from './models/pagination.model';\nexport * from './models/permission.model';\nexport * from './models/report-builder-library.model';\nexport * from './models/report-builder-report.model';\nexport * from './models/report-builder.model';\nexport * from './models/select-data-label.model';\nexport * from './models/server-message.model';\nexport * from './models/subscription.model';\nexport * from './models/support-ticket.model';\nexport * from './models/user-group.model';\nexport * from './models/user-guide.model';\nexport * from './models/user.model';\nexport * from './managers/openai-usage-ledger.manager';\nexport * from './managers/communication-metric.manager';\nexport * from './resolveio-server-app';\nexport * from './services/openai-client';\nexport * from './services/codex-client';\nexport * from './util/common';\nexport * from './util/tokenizer';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadAiTerminalPublications(subscriptionManager: any): void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAiTerminalPublications = loadAiTerminalPublications;
|
|
4
|
+
var simpl_schema_1 = require("simpl-schema");
|
|
5
|
+
var ai_terminal_conversation_collection_1 = require("../collections/ai-terminal-conversation.collection");
|
|
6
|
+
var ai_terminal_message_collection_1 = require("../collections/ai-terminal-message.collection");
|
|
7
|
+
function loadAiTerminalPublications(subscriptionManager) {
|
|
8
|
+
subscriptionManager.publications({
|
|
9
|
+
aiTerminalConversations: {
|
|
10
|
+
function: function (id_client, id_app, status) {
|
|
11
|
+
var query = {};
|
|
12
|
+
if (id_client) {
|
|
13
|
+
query.id_client = id_client;
|
|
14
|
+
}
|
|
15
|
+
if (id_app) {
|
|
16
|
+
query.id_app = id_app;
|
|
17
|
+
}
|
|
18
|
+
if (status) {
|
|
19
|
+
query.status = status;
|
|
20
|
+
}
|
|
21
|
+
return ai_terminal_conversation_collection_1.AiTerminalConversations.find(query, { sort: { updatedAt: -1 }, limit: 200 });
|
|
22
|
+
},
|
|
23
|
+
check: new simpl_schema_1.default({
|
|
24
|
+
id_client: {
|
|
25
|
+
type: String,
|
|
26
|
+
optional: true
|
|
27
|
+
},
|
|
28
|
+
id_app: {
|
|
29
|
+
type: String,
|
|
30
|
+
optional: true
|
|
31
|
+
},
|
|
32
|
+
status: {
|
|
33
|
+
type: String,
|
|
34
|
+
optional: true
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
collections: ['ai-terminal-conversations']
|
|
38
|
+
},
|
|
39
|
+
aiTerminalMessages: {
|
|
40
|
+
function: function (id_conversation, limit) {
|
|
41
|
+
var limitValue = Number.isFinite(Number(limit)) ? Math.min(Math.max(Number(limit), 1), 400) : 200;
|
|
42
|
+
return ai_terminal_message_collection_1.AiTerminalMessages.find({ id_conversation: id_conversation }, { sort: { createdAt: 1 }, limit: limitValue });
|
|
43
|
+
},
|
|
44
|
+
check: new simpl_schema_1.default({
|
|
45
|
+
id_conversation: {
|
|
46
|
+
type: String
|
|
47
|
+
},
|
|
48
|
+
limit: {
|
|
49
|
+
type: Number,
|
|
50
|
+
optional: true
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
collections: ['ai-terminal-messages']
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=ai-terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/publications/ai-terminal.ts"],"names":[],"mappings":";;AAIA,gEAiDC;AArDD,6CAAwC;AACxC,0GAA6F;AAC7F,gGAAmF;AAEnF,SAAgB,0BAA0B,CAAC,mBAAmB;IAC7D,mBAAmB,CAAC,YAAY,CAAC;QAChC,uBAAuB,EAAE;YACxB,QAAQ,EAAE,UAAS,SAAkB,EAAE,MAAe,EAAE,MAAe;gBACtE,IAAM,KAAK,GAAQ,EAAE,CAAC;gBACtB,IAAI,SAAS,EAAE,CAAC;oBACf,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC7B,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACZ,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;gBACvB,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACZ,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;gBACvB,CAAC;gBACD,OAAO,6DAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YACrF,CAAC;YACD,KAAK,EAAE,IAAI,sBAAY,CAAC;gBACvB,SAAS,EAAE;oBACV,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,MAAM,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,MAAM,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACd;aACD,CAAC;YACF,WAAW,EAAE,CAAC,2BAA2B,CAAC;SAC1C;QACD,kBAAkB,EAAE;YACnB,QAAQ,EAAE,UAAS,eAAuB,EAAE,KAAc;gBACzD,IAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACpG,OAAO,mDAAkB,CAAC,IAAI,CAAC,EAAE,eAAe,iBAAA,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;YACpG,CAAC;YACD,KAAK,EAAE,IAAI,sBAAY,CAAC;gBACvB,eAAe,EAAE;oBAChB,IAAI,EAAE,MAAM;iBACZ;gBACD,KAAK,EAAE;oBACN,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,IAAI;iBACd;aACD,CAAC;YACF,WAAW,EAAE,CAAC,sBAAsB,CAAC;SACrC;KACD,CAAC,CAAC;AACJ,CAAC","file":"ai-terminal.js","sourcesContent":["import SimpleSchema from 'simpl-schema';\nimport { AiTerminalConversations } from '../collections/ai-terminal-conversation.collection';\nimport { AiTerminalMessages } from '../collections/ai-terminal-message.collection';\n\nexport function loadAiTerminalPublications(subscriptionManager) {\n\tsubscriptionManager.publications({\n\t\taiTerminalConversations: {\n\t\t\tfunction: function(id_client?: string, id_app?: string, status?: string) {\n\t\t\t\tconst query: any = {};\n\t\t\t\tif (id_client) {\n\t\t\t\t\tquery.id_client = id_client;\n\t\t\t\t}\n\t\t\t\tif (id_app) {\n\t\t\t\t\tquery.id_app = id_app;\n\t\t\t\t}\n\t\t\t\tif (status) {\n\t\t\t\t\tquery.status = status;\n\t\t\t\t}\n\t\t\t\treturn AiTerminalConversations.find(query, { sort: { updatedAt: -1 }, limit: 200 });\n\t\t\t},\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tid_client: {\n\t\t\t\t\ttype: String,\n\t\t\t\t\toptional: true\n\t\t\t\t},\n\t\t\t\tid_app: {\n\t\t\t\t\ttype: String,\n\t\t\t\t\toptional: true\n\t\t\t\t},\n\t\t\t\tstatus: {\n\t\t\t\t\ttype: String,\n\t\t\t\t\toptional: true\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcollections: ['ai-terminal-conversations']\n\t\t},\n\t\taiTerminalMessages: {\n\t\t\tfunction: function(id_conversation: string, limit?: number) {\n\t\t\t\tconst limitValue = Number.isFinite(Number(limit)) ? Math.min(Math.max(Number(limit), 1), 400) : 200;\n\t\t\t\treturn AiTerminalMessages.find({ id_conversation }, { sort: { createdAt: 1 }, limit: limitValue });\n\t\t\t},\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tid_conversation: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tlimit: {\n\t\t\t\t\ttype: Number,\n\t\t\t\t\toptional: true\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcollections: ['ai-terminal-messages']\n\t\t}\n\t});\n}\n"]}
|
package/publications.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
|
|
3
3
|
export function SERVER_PUBLICATIONS(resolveioServer) {
|
|
4
4
|
return {
|
|
5
|
+
aiTerminalConversations: (id_client?: string, id_app?: string, status?: string) => {
|
|
6
|
+
return <Observable<any>> resolveioServer.subscribe('aiTerminalConversations', id_client, id_app, status);
|
|
7
|
+
},
|
|
8
|
+
aiTerminalMessages: (id_conversation: string, limit?: number) => {
|
|
9
|
+
return <Observable<any>> resolveioServer.subscribe('aiTerminalMessages', id_conversation, limit);
|
|
10
|
+
},
|
|
5
11
|
appstatus: () => {
|
|
6
12
|
return <Observable<any>> resolveioServer.subscribe('appstatus');
|
|
7
13
|
},
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface CodexConfig {
|
|
2
|
+
apiKey?: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
model?: string;
|
|
5
|
+
maxRetries?: number;
|
|
6
|
+
retryDelayMs?: number;
|
|
7
|
+
}
|
|
8
|
+
type StreamEventHandler = (event: any) => void | Promise<void>;
|
|
9
|
+
type StreamTextHandler = (delta: string, fullText: string) => void | Promise<void>;
|
|
10
|
+
export interface CodexRunOptions {
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
threadOptions?: CodexThreadOptions;
|
|
13
|
+
threadKey?: string;
|
|
14
|
+
reuseThread?: boolean;
|
|
15
|
+
onStreamEvent?: StreamEventHandler;
|
|
16
|
+
onStreamText?: StreamTextHandler;
|
|
17
|
+
}
|
|
18
|
+
export type CodexThreadOptions = {
|
|
19
|
+
model?: string;
|
|
20
|
+
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
21
|
+
workingDirectory?: string;
|
|
22
|
+
skipGitRepoCheck?: boolean;
|
|
23
|
+
modelReasoningEffort?: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
24
|
+
networkAccessEnabled?: boolean;
|
|
25
|
+
webSearchMode?: 'disabled' | 'cached' | 'live';
|
|
26
|
+
webSearchEnabled?: boolean;
|
|
27
|
+
approvalPolicy?: 'never' | 'on-request' | 'on-failure' | 'untrusted';
|
|
28
|
+
additionalDirectories?: string[];
|
|
29
|
+
};
|
|
30
|
+
export declare class CodexClient {
|
|
31
|
+
private static readonly PING_PROMPT;
|
|
32
|
+
private codex;
|
|
33
|
+
private codexInit;
|
|
34
|
+
private readonly threadCache;
|
|
35
|
+
private readonly debugEnabled;
|
|
36
|
+
private readonly streamEnabled;
|
|
37
|
+
private readonly cleanZdotdirEnabled;
|
|
38
|
+
private zDotDir;
|
|
39
|
+
private readonly defaultTimeoutMs;
|
|
40
|
+
private readonly defaultThreadOptions;
|
|
41
|
+
private readonly pingEnabled;
|
|
42
|
+
private readonly pingTimeoutMs;
|
|
43
|
+
private readonly config;
|
|
44
|
+
constructor(config: CodexConfig);
|
|
45
|
+
run(prompt: string, options?: CodexRunOptions): Promise<string>;
|
|
46
|
+
private runStreamedOnce;
|
|
47
|
+
private runOnce;
|
|
48
|
+
private startThread;
|
|
49
|
+
private extractContent;
|
|
50
|
+
private handleStreamEvent;
|
|
51
|
+
private handleStreamItem;
|
|
52
|
+
private logStreamText;
|
|
53
|
+
private extractPartText;
|
|
54
|
+
private withTimeout;
|
|
55
|
+
private normalizeRetryCount;
|
|
56
|
+
private normalizeRetryDelay;
|
|
57
|
+
private isRetryableError;
|
|
58
|
+
private sleep;
|
|
59
|
+
private ensureCodex;
|
|
60
|
+
private log;
|
|
61
|
+
private resolveDefaultTimeoutMs;
|
|
62
|
+
private resolveStreamEnabled;
|
|
63
|
+
private resolveCleanZdotdirEnabled;
|
|
64
|
+
private buildCodexEnv;
|
|
65
|
+
private ensureZdotdir;
|
|
66
|
+
private resolvePingEnabled;
|
|
67
|
+
private resolvePingTimeoutMs;
|
|
68
|
+
private resolveDefaultThreadOptions;
|
|
69
|
+
private mergeThreadOptions;
|
|
70
|
+
private normalizeApprovalPolicy;
|
|
71
|
+
private normalizeSandboxMode;
|
|
72
|
+
private normalizeWebSearchMode;
|
|
73
|
+
private normalizeModelReasoningEffort;
|
|
74
|
+
private normalizeBoolean;
|
|
75
|
+
private formatThreadOptions;
|
|
76
|
+
private buildThreadOptionsKey;
|
|
77
|
+
private buildThreadCacheKey;
|
|
78
|
+
private isPingPrompt;
|
|
79
|
+
private runPing;
|
|
80
|
+
}
|
|
81
|
+
export {};
|