@compilr-dev/sdk 0.2.7 → 0.2.9
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/agent.js
CHANGED
|
@@ -121,6 +121,7 @@ class CompilrAgentImpl {
|
|
|
121
121
|
contextManager,
|
|
122
122
|
autoContextManagement: contextManager !== undefined,
|
|
123
123
|
hooks: config?.hooks,
|
|
124
|
+
anchors: {},
|
|
124
125
|
permissions: {
|
|
125
126
|
defaultLevel: permissionsConfig.defaultLevel,
|
|
126
127
|
onPermissionRequest: permissionsConfig.onPermissionRequest,
|
|
@@ -18,7 +18,7 @@ export interface ProjectAnchorStoreConfig {
|
|
|
18
18
|
/** Returns the currently active project ID, or undefined if none */
|
|
19
19
|
getCurrentProjectId: () => number | undefined;
|
|
20
20
|
/** Returns display name for a project ID (used in list results) */
|
|
21
|
-
getProjectName?: (id: number) => string | null
|
|
21
|
+
getProjectName?: (id: number) => string | null | Promise<string | null>;
|
|
22
22
|
/** Max anchors per manager (default: 50) */
|
|
23
23
|
maxAnchors?: number;
|
|
24
24
|
/** Max tokens per manager (default: 4000) */
|
|
@@ -184,7 +184,7 @@ export class ProjectAnchorStore {
|
|
|
184
184
|
}
|
|
185
185
|
return Promise.resolve({ removed, scope });
|
|
186
186
|
},
|
|
187
|
-
list: (options) => {
|
|
187
|
+
list: async (options) => {
|
|
188
188
|
const projId = this.config.getCurrentProjectId();
|
|
189
189
|
const scope = options?.scope ?? 'all';
|
|
190
190
|
const anchors = [];
|
|
@@ -220,9 +220,9 @@ export class ProjectAnchorStore {
|
|
|
220
220
|
});
|
|
221
221
|
let activeProjectName = null;
|
|
222
222
|
if (projId && this.config.getProjectName) {
|
|
223
|
-
activeProjectName = this.config.getProjectName(projId);
|
|
223
|
+
activeProjectName = await Promise.resolve(this.config.getProjectName(projId));
|
|
224
224
|
}
|
|
225
|
-
return
|
|
225
|
+
return { count: anchors.length, activeProjectName, anchors };
|
|
226
226
|
},
|
|
227
227
|
};
|
|
228
228
|
}
|