@resolveio/server-lib 22.0.23 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/managers/subscription.manager.js +23 -3
- package/managers/subscription.manager.js.map +1 -1
- package/methods/ai-terminal.d.ts +50 -0
- package/methods/ai-terminal.js +3223 -805
- package/methods/ai-terminal.js.map +1 -1
- package/models/collection-document.model.d.ts +2 -0
- package/models/collection-document.model.js.map +1 -1
- package/package.json +7 -2
- package/server-app.js +266 -250
- package/server-app.js.map +1 -1
- package/util/subscription-dependency-context.js +24 -9
- package/util/subscription-dependency-context.js.map +1 -1
package/methods/ai-terminal.d.ts
CHANGED
|
@@ -55,10 +55,38 @@ type AssistantMongoDirective = {
|
|
|
55
55
|
cleaned: string;
|
|
56
56
|
rawLine: string;
|
|
57
57
|
};
|
|
58
|
+
type AssistantRequestType = 'data' | 'navigation' | 'feature_info' | 'bug_issue' | 'mixed' | 'unknown';
|
|
59
|
+
type AssistantRequestTypeSource = 'heuristic' | 'planner' | 'merged';
|
|
60
|
+
type AssistantRequestClassification = {
|
|
61
|
+
type: AssistantRequestType;
|
|
62
|
+
dataQuestion: boolean;
|
|
63
|
+
source: AssistantRequestTypeSource;
|
|
64
|
+
plannerIntentType?: string;
|
|
65
|
+
};
|
|
66
|
+
type AssistantNavigationFastPathResult = {
|
|
67
|
+
response: string;
|
|
68
|
+
routes: string[];
|
|
69
|
+
reason: 'explicit' | 'ranked' | 'permission_denied' | 'no_access';
|
|
70
|
+
};
|
|
71
|
+
type AssistantChangeModule = 'invoice' | 'work_order' | 'delivery' | 'blend' | 'job' | 'customer' | 'chemical' | 'portal' | 'general' | 'internal';
|
|
72
|
+
type AssistantChangeHistoryCommit = {
|
|
73
|
+
date: string;
|
|
74
|
+
subject: string;
|
|
75
|
+
files: string[];
|
|
76
|
+
modules: AssistantChangeModule[];
|
|
77
|
+
};
|
|
78
|
+
type AssistantChangeHistoryFastPathResult = {
|
|
79
|
+
response: string;
|
|
80
|
+
reason: 'detailed' | 'generic' | 'no_repo' | 'error';
|
|
81
|
+
commitCount: number;
|
|
82
|
+
generic: boolean;
|
|
83
|
+
branch?: string;
|
|
84
|
+
};
|
|
58
85
|
export declare function loadAiTerminalMethods(methodManager: any): void;
|
|
59
86
|
export declare function executeAiAssistantMongoRead(payload: AiAssistantMongoReadInput, context: any): Promise<any>;
|
|
60
87
|
export declare function executeAiAssistantMongoAggregate(payload: AiAssistantMongoAggregateInput, context: any): Promise<any>;
|
|
61
88
|
export declare function extractAssistantMongoDirective(content: string): AssistantMongoDirective | null;
|
|
89
|
+
export declare function buildAssistantDatedPivotDisplay(display: AiAssistantDisplayTable, expectedMonths?: string[]): AiAssistantDisplayTable | null;
|
|
62
90
|
export declare function normalizeIdsForTargetField(ids: any[], targetDocs: any[], targetFieldPath: string, targetFieldTypeOverride?: 'objectId' | 'string' | 'unknown'): any[];
|
|
63
91
|
export declare function serializeMongoValue(value: any, maxLength?: number): string | number | boolean | null;
|
|
64
92
|
export declare function flattenForTable(doc: any, options?: {
|
|
@@ -79,4 +107,26 @@ export declare function normalizeAssistantMonthlyCalendarWindowPipeline(pipeline
|
|
|
79
107
|
export declare function stripQueryFieldPathsDeep(query: any, fieldsToStrip: string[]): any;
|
|
80
108
|
export declare function stripScopedFieldsFromPipeline(pipeline: any[], fieldsToStrip: string[]): any[];
|
|
81
109
|
export declare function rewriteEmbeddedMatchObjects(query: any): any;
|
|
110
|
+
export declare function collectUserViewPermissions(user: any): string[];
|
|
111
|
+
export declare function userHasInvoiceAccess(user: any): boolean;
|
|
112
|
+
export declare function resolveAssistantUserAccessTier(user: any): 'super_admin' | 'customer_portal' | 'client_user';
|
|
113
|
+
export declare function classifyAssistantRequestType(message: string, plannerOutput?: any): AssistantRequestClassification;
|
|
114
|
+
export declare function collectAssistantAllowedRoutesForUser(user: any, allRoutes: string[], isSuperAdmin: boolean): string[];
|
|
115
|
+
export declare function rankAssistantNavigationRoutes(message: string, routes: string[], limit?: number): string[];
|
|
116
|
+
export declare function shouldUseAssistantNavigationFastPath(message: string, hasAttachments?: boolean): boolean;
|
|
117
|
+
export declare function evaluateAssistantNavigationFastPathWithRoutes(params: {
|
|
118
|
+
message: string;
|
|
119
|
+
hasAttachments: boolean;
|
|
120
|
+
allowedRoutes: string[];
|
|
121
|
+
contextRoute?: string;
|
|
122
|
+
}): AssistantNavigationFastPathResult | null;
|
|
123
|
+
export declare function shouldUseAssistantChangeHistoryFastPath(message: string, hasAttachments?: boolean): boolean;
|
|
124
|
+
export declare function buildAssistantChangeHistorySummaryFromCommits(params: {
|
|
125
|
+
message: string;
|
|
126
|
+
user: any;
|
|
127
|
+
isSuperAdmin: boolean;
|
|
128
|
+
commits: AssistantChangeHistoryCommit[];
|
|
129
|
+
branch?: string;
|
|
130
|
+
now?: Date;
|
|
131
|
+
}): AssistantChangeHistoryFastPathResult;
|
|
82
132
|
export {};
|