@resolveio/server-lib 22.0.24 → 22.1.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.
@@ -55,10 +55,39 @@ 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 buildAssistantInvoiceCustomerLabelExpr(): Record<string, any>;
90
+ export declare function buildAssistantDatedPivotDisplay(display: AiAssistantDisplayTable, expectedMonths?: string[]): AiAssistantDisplayTable | null;
62
91
  export declare function normalizeIdsForTargetField(ids: any[], targetDocs: any[], targetFieldPath: string, targetFieldTypeOverride?: 'objectId' | 'string' | 'unknown'): any[];
63
92
  export declare function serializeMongoValue(value: any, maxLength?: number): string | number | boolean | null;
64
93
  export declare function flattenForTable(doc: any, options?: {
@@ -73,10 +102,40 @@ export declare function buildDisplayTable(docs: any[], options?: {
73
102
  includeGroupFromId?: boolean;
74
103
  }): AiAssistantDisplayTable;
75
104
  export declare function formatDisplayTableMarkdown(display: AiAssistantDisplayTable): string;
105
+ export declare function resolveAssistantReadDisplayMaxRows(limit: number | undefined, rowCount: number): number;
76
106
  export declare function normalizeAssistantNowExprPlaceholders(value: any): any;
77
107
  export declare function rewriteMatchExpressionsToExpr(match: any): any;
78
108
  export declare function normalizeAssistantMonthlyCalendarWindowPipeline(pipeline: Array<Record<string, any>>): Array<Record<string, any>>;
79
109
  export declare function stripQueryFieldPathsDeep(query: any, fieldsToStrip: string[]): any;
80
110
  export declare function stripScopedFieldsFromPipeline(pipeline: any[], fieldsToStrip: string[]): any[];
81
111
  export declare function rewriteEmbeddedMatchObjects(query: any): any;
112
+ export declare function resolveAssistantCollectionOverride(collectionRanking: Record<string, any> | null, currentCollection: string): {
113
+ from: string;
114
+ to: string;
115
+ fromScore: number;
116
+ toScore: number;
117
+ reason: string;
118
+ } | null;
119
+ export declare function collectUserViewPermissions(user: any): string[];
120
+ export declare function userHasInvoiceAccess(user: any): boolean;
121
+ export declare function resolveAssistantUserAccessTier(user: any): 'super_admin' | 'customer_portal' | 'client_user';
122
+ export declare function classifyAssistantRequestType(message: string, plannerOutput?: any): AssistantRequestClassification;
123
+ export declare function collectAssistantAllowedRoutesForUser(user: any, allRoutes: string[], isSuperAdmin: boolean): string[];
124
+ export declare function rankAssistantNavigationRoutes(message: string, routes: string[], limit?: number): string[];
125
+ export declare function shouldUseAssistantNavigationFastPath(message: string, hasAttachments?: boolean): boolean;
126
+ export declare function evaluateAssistantNavigationFastPathWithRoutes(params: {
127
+ message: string;
128
+ hasAttachments: boolean;
129
+ allowedRoutes: string[];
130
+ contextRoute?: string;
131
+ }): AssistantNavigationFastPathResult | null;
132
+ export declare function shouldUseAssistantChangeHistoryFastPath(message: string, hasAttachments?: boolean): boolean;
133
+ export declare function buildAssistantChangeHistorySummaryFromCommits(params: {
134
+ message: string;
135
+ user: any;
136
+ isSuperAdmin: boolean;
137
+ commits: AssistantChangeHistoryCommit[];
138
+ branch?: string;
139
+ now?: Date;
140
+ }): AssistantChangeHistoryFastPathResult;
82
141
  export {};