@theia/ai-chat 1.67.0-next.56 → 1.67.0-next.59
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/lib/browser/agent-delegation-tool.d.ts +25 -0
- package/lib/browser/agent-delegation-tool.d.ts.map +1 -0
- package/lib/browser/agent-delegation-tool.js +196 -0
- package/lib/browser/agent-delegation-tool.js.map +1 -0
- package/lib/browser/ai-chat-frontend-contribution.d.ts +11 -0
- package/lib/browser/ai-chat-frontend-contribution.d.ts.map +1 -0
- package/lib/browser/ai-chat-frontend-contribution.js +56 -0
- package/lib/browser/ai-chat-frontend-contribution.js.map +1 -0
- package/lib/browser/ai-chat-frontend-module.d.ts +4 -0
- package/lib/browser/ai-chat-frontend-module.d.ts.map +1 -0
- package/lib/browser/ai-chat-frontend-module.js +143 -0
- package/lib/browser/ai-chat-frontend-module.js.map +1 -0
- package/lib/browser/change-set-decorator-service.d.ts +24 -0
- package/lib/browser/change-set-decorator-service.d.ts.map +1 -0
- package/lib/browser/change-set-decorator-service.js +66 -0
- package/lib/browser/change-set-decorator-service.js.map +1 -0
- package/lib/browser/change-set-file-element-deserializer.d.ts +7 -0
- package/lib/browser/change-set-file-element-deserializer.d.ts.map +1 -0
- package/lib/browser/change-set-file-element-deserializer.js +61 -0
- package/lib/browser/change-set-file-element-deserializer.js.map +1 -0
- package/lib/browser/change-set-file-element.d.ts +122 -0
- package/lib/browser/change-set-file-element.d.ts.map +1 -0
- package/lib/browser/change-set-file-element.js +435 -0
- package/lib/browser/change-set-file-element.js.map +1 -0
- package/lib/browser/change-set-file-resource.d.ts +4 -0
- package/lib/browser/change-set-file-resource.d.ts.map +1 -0
- package/lib/browser/change-set-file-resource.js +24 -0
- package/lib/browser/change-set-file-resource.js.map +1 -0
- package/lib/browser/change-set-file-service.d.ts +32 -0
- package/lib/browser/change-set-file-service.d.ts.map +1 -0
- package/lib/browser/change-set-file-service.js +161 -0
- package/lib/browser/change-set-file-service.js.map +1 -0
- package/lib/browser/change-set-variable.d.ts +11 -0
- package/lib/browser/change-set-variable.d.ts.map +1 -0
- package/lib/browser/change-set-variable.js +64 -0
- package/lib/browser/change-set-variable.js.map +1 -0
- package/lib/browser/chat-session-store-impl.d.ts +36 -0
- package/lib/browser/chat-session-store-impl.d.ts.map +1 -0
- package/lib/browser/chat-session-store-impl.js +287 -0
- package/lib/browser/chat-session-store-impl.js.map +1 -0
- package/lib/browser/chat-tool-preference-bindings.d.ts +34 -0
- package/lib/browser/chat-tool-preference-bindings.d.ts.map +1 -0
- package/lib/browser/chat-tool-preference-bindings.js +122 -0
- package/lib/browser/chat-tool-preference-bindings.js.map +1 -0
- package/lib/browser/chat-tool-request-service.d.ts +21 -0
- package/lib/browser/chat-tool-request-service.d.ts.map +1 -0
- package/lib/browser/chat-tool-request-service.js +90 -0
- package/lib/browser/chat-tool-request-service.js.map +1 -0
- package/lib/browser/context-file-validation-service.d.ts +15 -0
- package/lib/browser/context-file-validation-service.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service.js +26 -0
- package/lib/browser/context-file-validation-service.js.map +1 -0
- package/lib/browser/context-file-variable-label-provider.d.ts +14 -0
- package/lib/browser/context-file-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/context-file-variable-label-provider.js +63 -0
- package/lib/browser/context-file-variable-label-provider.js.map +1 -0
- package/lib/browser/context-variable-label-provider.d.ts +9 -0
- package/lib/browser/context-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/context-variable-label-provider.js +55 -0
- package/lib/browser/context-variable-label-provider.js.map +1 -0
- package/lib/browser/custom-agent-factory.d.ts +4 -0
- package/lib/browser/custom-agent-factory.d.ts.map +1 -0
- package/lib/browser/custom-agent-factory.js +20 -0
- package/lib/browser/custom-agent-factory.js.map +1 -0
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts +13 -0
- package/lib/browser/custom-agent-frontend-application-contribution.d.ts.map +1 -0
- package/lib/browser/custom-agent-frontend-application-contribution.js +83 -0
- package/lib/browser/custom-agent-frontend-application-contribution.js.map +1 -0
- package/lib/browser/delegation-response-content.d.ts +20 -0
- package/lib/browser/delegation-response-content.d.ts.map +1 -0
- package/lib/browser/delegation-response-content.js +47 -0
- package/lib/browser/delegation-response-content.js.map +1 -0
- package/lib/browser/file-chat-variable-contribution.d.ts +32 -0
- package/lib/browser/file-chat-variable-contribution.d.ts.map +1 -0
- package/lib/browser/file-chat-variable-contribution.js +241 -0
- package/lib/browser/file-chat-variable-contribution.js.map +1 -0
- package/lib/browser/frontend-chat-service.d.ts +15 -0
- package/lib/browser/frontend-chat-service.d.ts.map +1 -0
- package/lib/browser/frontend-chat-service.js +72 -0
- package/lib/browser/frontend-chat-service.js.map +1 -0
- package/lib/browser/image-context-variable-contribution.d.ts +27 -0
- package/lib/browser/image-context-variable-contribution.d.ts.map +1 -0
- package/lib/browser/image-context-variable-contribution.js +149 -0
- package/lib/browser/image-context-variable-contribution.js.map +1 -0
- package/lib/browser/task-context-service.d.ts +46 -0
- package/lib/browser/task-context-service.d.ts.map +1 -0
- package/lib/browser/task-context-service.js +256 -0
- package/lib/browser/task-context-service.js.map +1 -0
- package/lib/browser/task-context-storage-service.d.ts +19 -0
- package/lib/browser/task-context-storage-service.d.ts.map +1 -0
- package/lib/browser/task-context-storage-service.js +80 -0
- package/lib/browser/task-context-storage-service.js.map +1 -0
- package/lib/browser/task-context-variable-contribution.d.ts +20 -0
- package/lib/browser/task-context-variable-contribution.d.ts.map +1 -0
- package/lib/browser/task-context-variable-contribution.js +101 -0
- package/lib/browser/task-context-variable-contribution.js.map +1 -0
- package/lib/browser/task-context-variable-label-provider.d.ts +21 -0
- package/lib/browser/task-context-variable-label-provider.d.ts.map +1 -0
- package/lib/browser/task-context-variable-label-provider.js +83 -0
- package/lib/browser/task-context-variable-label-provider.js.map +1 -0
- package/lib/browser/task-context-variable.d.ts +3 -0
- package/lib/browser/task-context-variable.d.ts.map +1 -0
- package/lib/browser/task-context-variable.js +33 -0
- package/lib/browser/task-context-variable.js.map +1 -0
- package/lib/common/ai-chat-preferences.d.ts +5 -0
- package/lib/common/ai-chat-preferences.d.ts.map +1 -0
- package/lib/common/ai-chat-preferences.js +40 -0
- package/lib/common/ai-chat-preferences.js.map +1 -0
- package/lib/common/change-set-element-deserializer.d.ts +30 -0
- package/lib/common/change-set-element-deserializer.d.ts.map +1 -0
- package/lib/common/change-set-element-deserializer.js +81 -0
- package/lib/common/change-set-element-deserializer.js.map +1 -0
- package/lib/common/change-set.d.ts +85 -0
- package/lib/common/change-set.d.ts.map +1 -0
- package/lib/common/change-set.js +133 -0
- package/lib/common/change-set.js.map +1 -0
- package/lib/common/chat-agent-service.d.ts +46 -0
- package/lib/common/chat-agent-service.d.ts.map +1 -0
- package/lib/common/chat-agent-service.js +79 -0
- package/lib/common/chat-agent-service.js.map +1 -0
- package/lib/common/chat-agents-variable-contribution.d.ts +17 -0
- package/lib/common/chat-agents-variable-contribution.d.ts.map +1 -0
- package/lib/common/chat-agents-variable-contribution.js +67 -0
- package/lib/common/chat-agents-variable-contribution.js.map +1 -0
- package/lib/common/chat-agents.d.ts +138 -0
- package/lib/common/chat-agents.d.ts.map +1 -0
- package/lib/common/chat-agents.js +428 -0
- package/lib/common/chat-agents.js.map +1 -0
- package/lib/common/chat-auto-save.spec.d.ts +2 -0
- package/lib/common/chat-auto-save.spec.d.ts.map +1 -0
- package/lib/common/chat-auto-save.spec.js +304 -0
- package/lib/common/chat-auto-save.spec.js.map +1 -0
- package/lib/common/chat-content-deserializer.d.ts +161 -0
- package/lib/common/chat-content-deserializer.d.ts.map +1 -0
- package/lib/common/chat-content-deserializer.js +166 -0
- package/lib/common/chat-content-deserializer.js.map +1 -0
- package/lib/common/chat-content-deserializer.spec.d.ts +2 -0
- package/lib/common/chat-content-deserializer.spec.d.ts.map +1 -0
- package/lib/common/chat-content-deserializer.spec.js +307 -0
- package/lib/common/chat-content-deserializer.spec.js.map +1 -0
- package/lib/common/chat-model-serialization.d.ts +110 -0
- package/lib/common/chat-model-serialization.d.ts.map +1 -0
- package/lib/common/chat-model-serialization.js +20 -0
- package/lib/common/chat-model-serialization.js.map +1 -0
- package/lib/common/chat-model-serialization.spec.d.ts +2 -0
- package/lib/common/chat-model-serialization.spec.d.ts.map +1 -0
- package/lib/common/chat-model-serialization.spec.js +278 -0
- package/lib/common/chat-model-serialization.spec.js.map +1 -0
- package/lib/common/chat-model-util.d.ts +7 -0
- package/lib/common/chat-model-util.d.ts.map +1 -0
- package/lib/common/chat-model-util.js +50 -0
- package/lib/common/chat-model-util.js.map +1 -0
- package/lib/common/chat-model.d.ts +923 -0
- package/lib/common/chat-model.d.ts.map +1 -0
- package/lib/common/chat-model.js +1791 -0
- package/lib/common/chat-model.js.map +1 -0
- package/lib/common/chat-request-parser.d.ts +38 -0
- package/lib/common/chat-request-parser.d.ts.map +1 -0
- package/lib/common/chat-request-parser.js +230 -0
- package/lib/common/chat-request-parser.js.map +1 -0
- package/lib/common/chat-request-parser.spec.d.ts +2 -0
- package/lib/common/chat-request-parser.spec.d.ts.map +1 -0
- package/lib/common/chat-request-parser.spec.js +235 -0
- package/lib/common/chat-request-parser.spec.js.map +1 -0
- package/lib/common/chat-service-deletion.spec.d.ts +2 -0
- package/lib/common/chat-service-deletion.spec.d.ts.map +1 -0
- package/lib/common/chat-service-deletion.spec.js +221 -0
- package/lib/common/chat-service-deletion.spec.js.map +1 -0
- package/lib/common/chat-service.d.ts +153 -0
- package/lib/common/chat-service.d.ts.map +1 -0
- package/lib/common/chat-service.js +474 -0
- package/lib/common/chat-service.js.map +1 -0
- package/lib/common/chat-session-naming-prompt-template.d.ts +3 -0
- package/lib/common/chat-session-naming-prompt-template.d.ts.map +1 -0
- package/lib/common/chat-session-naming-prompt-template.js +31 -0
- package/lib/common/chat-session-naming-prompt-template.js.map +1 -0
- package/lib/common/chat-session-naming-service.d.ts +26 -0
- package/lib/common/chat-session-naming-service.d.ts.map +1 -0
- package/lib/common/chat-session-naming-service.js +119 -0
- package/lib/common/chat-session-naming-service.js.map +1 -0
- package/lib/common/chat-session-store.d.ts +43 -0
- package/lib/common/chat-session-store.d.ts.map +1 -0
- package/lib/common/chat-session-store.js +20 -0
- package/lib/common/chat-session-store.js.map +1 -0
- package/lib/common/chat-session-summary-agent-prompt.d.ts +8 -0
- package/lib/common/chat-session-summary-agent-prompt.d.ts.map +1 -0
- package/lib/common/chat-session-summary-agent-prompt.js +33 -0
- package/lib/common/chat-session-summary-agent-prompt.js.map +1 -0
- package/lib/common/chat-session-summary-agent.d.ts +16 -0
- package/lib/common/chat-session-summary-agent.d.ts.map +1 -0
- package/lib/common/chat-session-summary-agent.js +48 -0
- package/lib/common/chat-session-summary-agent.js.map +1 -0
- package/lib/common/chat-string-utils.d.ts +3 -0
- package/lib/common/chat-string-utils.d.ts.map +1 -0
- package/lib/common/chat-string-utils.js +27 -0
- package/lib/common/chat-string-utils.js.map +1 -0
- package/lib/common/chat-tool-preferences.d.ts +23 -0
- package/lib/common/chat-tool-preferences.d.ts.map +1 -0
- package/lib/common/chat-tool-preferences.js +68 -0
- package/lib/common/chat-tool-preferences.js.map +1 -0
- package/lib/common/chat-tool-request-service.d.ts +18 -0
- package/lib/common/chat-tool-request-service.d.ts.map +1 -0
- package/lib/common/chat-tool-request-service.js +52 -0
- package/lib/common/chat-tool-request-service.js.map +1 -0
- package/lib/common/context-details-variable.d.ts +9 -0
- package/lib/common/context-details-variable.d.ts.map +1 -0
- package/lib/common/context-details-variable.js +57 -0
- package/lib/common/context-details-variable.js.map +1 -0
- package/lib/common/context-summary-variable.d.ts +9 -0
- package/lib/common/context-summary-variable.d.ts.map +1 -0
- package/lib/common/context-summary-variable.js +57 -0
- package/lib/common/context-summary-variable.js.map +1 -0
- package/lib/common/context-variables.d.ts +4 -0
- package/lib/common/context-variables.d.ts.map +1 -0
- package/lib/common/context-variables.js +22 -0
- package/lib/common/context-variables.js.map +1 -0
- package/lib/common/custom-chat-agent.d.ts +10 -0
- package/lib/common/custom-chat-agent.d.ts.map +1 -0
- package/lib/common/custom-chat-agent.js +40 -0
- package/lib/common/custom-chat-agent.js.map +1 -0
- package/lib/common/image-context-variable.d.ts +29 -0
- package/lib/common/image-context-variable.d.ts.map +1 -0
- package/lib/common/image-context-variable.js +114 -0
- package/lib/common/image-context-variable.js.map +1 -0
- package/lib/common/index.d.ts +13 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +31 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts +2 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.d.ts.map +1 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.js +103 -0
- package/lib/common/parse-contents-with-incomplete-parts.spec.js.map +1 -0
- package/lib/common/parse-contents.d.ts +12 -0
- package/lib/common/parse-contents.d.ts.map +1 -0
- package/lib/common/parse-contents.js +107 -0
- package/lib/common/parse-contents.js.map +1 -0
- package/lib/common/parse-contents.spec.d.ts +10 -0
- package/lib/common/parse-contents.spec.d.ts.map +1 -0
- package/lib/common/parse-contents.spec.js +146 -0
- package/lib/common/parse-contents.spec.js.map +1 -0
- package/lib/common/parsed-chat-request.d.ts +66 -0
- package/lib/common/parsed-chat-request.d.ts.map +1 -0
- package/lib/common/parsed-chat-request.js +83 -0
- package/lib/common/parsed-chat-request.js.map +1 -0
- package/lib/common/response-content-matcher.d.ts +69 -0
- package/lib/common/response-content-matcher.d.ts.map +1 -0
- package/lib/common/response-content-matcher.js +97 -0
- package/lib/common/response-content-matcher.js.map +1 -0
- package/lib/node/ai-chat-backend-module.d.ts +4 -0
- package/lib/node/ai-chat-backend-module.d.ts.map +1 -0
- package/lib/node/ai-chat-backend-module.js +26 -0
- package/lib/node/ai-chat-backend-module.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-file-resource.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-resource.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,eAAO,MAAM,+BAA+B,mBAAmB,CAAC;AAEhE,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,GAAG,CAElF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.createChangeSetFileUri = exports.CHANGE_SET_FILE_RESOURCE_SCHEME = void 0;
|
|
19
|
+
exports.CHANGE_SET_FILE_RESOURCE_SCHEME = 'changeset-file';
|
|
20
|
+
function createChangeSetFileUri(chatSessionId, elementUri) {
|
|
21
|
+
return elementUri.withScheme(exports.CHANGE_SET_FILE_RESOURCE_SCHEME).withAuthority(chatSessionId);
|
|
22
|
+
}
|
|
23
|
+
exports.createChangeSetFileUri = createChangeSetFileUri;
|
|
24
|
+
//# sourceMappingURL=change-set-file-resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-file-resource.js","sourceRoot":"","sources":["../../src/browser/change-set-file-resource.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAInE,QAAA,+BAA+B,GAAG,gBAAgB,CAAC;AAEhE,SAAgB,sBAAsB,CAAC,aAAqB,EAAE,UAAe;IACzE,OAAO,UAAU,CAAC,UAAU,CAAC,uCAA+B,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;AAC/F,CAAC;AAFD,wDAEC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ILogger, URI } from '@theia/core';
|
|
2
|
+
import { ApplicationShell, LabelProvider, OpenerService } from '@theia/core/lib/browser';
|
|
3
|
+
import { EditorManager } from '@theia/editor/lib/browser';
|
|
4
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
5
|
+
import { MonacoWorkspace } from '@theia/monaco/lib/browser/monaco-workspace';
|
|
6
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
|
|
7
|
+
import { ChangeSetFileElement } from './change-set-file-element';
|
|
8
|
+
export declare class ChangeSetFileService {
|
|
9
|
+
protected readonly logger: ILogger;
|
|
10
|
+
protected readonly wsService: WorkspaceService;
|
|
11
|
+
protected readonly labelProvider: LabelProvider;
|
|
12
|
+
protected readonly openerService: OpenerService;
|
|
13
|
+
protected readonly editorManager: EditorManager;
|
|
14
|
+
protected readonly shell: ApplicationShell;
|
|
15
|
+
protected readonly monacoWorkspace: MonacoWorkspace;
|
|
16
|
+
protected readonly fileService: FileService;
|
|
17
|
+
read(uri: URI): Promise<string | undefined>;
|
|
18
|
+
getName(uri: URI): string;
|
|
19
|
+
getIcon(uri: URI): string | undefined;
|
|
20
|
+
getAdditionalInfo(uri: URI): string | undefined;
|
|
21
|
+
open(element: ChangeSetFileElement): Promise<void>;
|
|
22
|
+
openDiff(originalUri: URI, suggestedUri: URI): Promise<void>;
|
|
23
|
+
protected getDiffUri(originalUri: URI, suggestedUri: URI): URI;
|
|
24
|
+
delete(uri: URI): Promise<void>;
|
|
25
|
+
/** Returns true if there was a document available to save for the specified URI. */
|
|
26
|
+
trySave(suggestedUri: URI): Promise<boolean>;
|
|
27
|
+
writeFrom(from: URI, to: URI, fallbackContent: string): Promise<void>;
|
|
28
|
+
write(uri: URI, text: string): Promise<void>;
|
|
29
|
+
closeDiffsForSession(sessionId: string, except?: URI[]): void;
|
|
30
|
+
closeDiff(uri: URI): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=change-set-file-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-file-service.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-file-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAO,GAAG,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAY,aAAa,EAAqB,aAAa,EAAQ,MAAM,yBAAyB,CAAC;AAE5H,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBACa,oBAAoB;IAE7B,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAGnC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IAG/C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAGhD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAGhD,SAAS,CAAC,QAAQ,CAAC,aAAa,E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
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ChangeSetFileService = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const browser_2 = require("@theia/editor/lib/browser");
|
|
24
|
+
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
25
|
+
const monaco_workspace_1 = require("@theia/monaco/lib/browser/monaco-workspace");
|
|
26
|
+
const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
|
|
27
|
+
let ChangeSetFileService = class ChangeSetFileService {
|
|
28
|
+
async read(uri) {
|
|
29
|
+
const exists = await this.fileService.exists(uri);
|
|
30
|
+
if (!exists) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const document = this.monacoWorkspace.getTextDocument(uri.toString());
|
|
35
|
+
if (document) {
|
|
36
|
+
return document.getText();
|
|
37
|
+
}
|
|
38
|
+
return (await this.fileService.readFile(uri)).value.toString();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this.logger.error('Failed to read original content of change set file element.', error);
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
getName(uri) {
|
|
46
|
+
return this.labelProvider.getName(uri);
|
|
47
|
+
}
|
|
48
|
+
getIcon(uri) {
|
|
49
|
+
return this.labelProvider.getIcon(uri);
|
|
50
|
+
}
|
|
51
|
+
getAdditionalInfo(uri) {
|
|
52
|
+
const wsUri = this.wsService.getWorkspaceRootUri(uri);
|
|
53
|
+
if (wsUri) {
|
|
54
|
+
const wsRelative = wsUri.relative(uri);
|
|
55
|
+
if (wsRelative === null || wsRelative === void 0 ? void 0 : wsRelative.hasDir) {
|
|
56
|
+
return wsRelative.dir.toString();
|
|
57
|
+
}
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
return this.labelProvider.getLongName(uri.parent);
|
|
61
|
+
}
|
|
62
|
+
async open(element) {
|
|
63
|
+
const exists = await this.fileService.exists(element.uri);
|
|
64
|
+
if (exists) {
|
|
65
|
+
await (0, browser_1.open)(this.openerService, element.uri);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
await this.editorManager.open(element.changedUri, {
|
|
69
|
+
mode: 'reveal'
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async openDiff(originalUri, suggestedUri) {
|
|
73
|
+
const diffUri = this.getDiffUri(originalUri, suggestedUri);
|
|
74
|
+
(0, browser_1.open)(this.openerService, diffUri);
|
|
75
|
+
}
|
|
76
|
+
getDiffUri(originalUri, suggestedUri) {
|
|
77
|
+
return browser_1.DiffUris.encode(originalUri, suggestedUri, core_1.nls.localize('theia/ai/chat/changeSetFileDiffUriLabel', 'AI Changes: {0}', this.labelProvider.getName(originalUri)));
|
|
78
|
+
}
|
|
79
|
+
async delete(uri) {
|
|
80
|
+
const exists = await this.fileService.exists(uri);
|
|
81
|
+
if (exists) {
|
|
82
|
+
await this.fileService.delete(uri);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Returns true if there was a document available to save for the specified URI. */
|
|
86
|
+
async trySave(suggestedUri) {
|
|
87
|
+
const openModel = this.monacoWorkspace.getTextDocument(suggestedUri.toString());
|
|
88
|
+
if (openModel) {
|
|
89
|
+
await openModel.save();
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async writeFrom(from, to, fallbackContent) {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const authoritativeContent = (_b = (_a = this.monacoWorkspace.getTextDocument(from.toString())) === null || _a === void 0 ? void 0 : _a.getText()) !== null && _b !== void 0 ? _b : fallbackContent;
|
|
99
|
+
await this.write(to, authoritativeContent);
|
|
100
|
+
}
|
|
101
|
+
async write(uri, text) {
|
|
102
|
+
const document = this.monacoWorkspace.getTextDocument(uri.toString());
|
|
103
|
+
if (document) {
|
|
104
|
+
await this.monacoWorkspace.applyBackgroundEdit(document, [{
|
|
105
|
+
range: document.textEditorModel.getFullModelRange(),
|
|
106
|
+
text
|
|
107
|
+
}], () => true);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
await this.fileService.write(uri, text);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
closeDiffsForSession(sessionId, except) {
|
|
114
|
+
const openEditors = this.shell.widgets.filter(widget => {
|
|
115
|
+
const uri = browser_1.NavigatableWidget.getUri(widget);
|
|
116
|
+
return uri && uri.authority === sessionId && !(except === null || except === void 0 ? void 0 : except.some(candidate => candidate.path.toString() === uri.path.toString()));
|
|
117
|
+
});
|
|
118
|
+
openEditors.forEach(editor => editor.close());
|
|
119
|
+
}
|
|
120
|
+
closeDiff(uri) {
|
|
121
|
+
const openEditors = this.shell.widgets.filter(widget => { var _a; return (_a = browser_1.NavigatableWidget.getUri(widget)) === null || _a === void 0 ? void 0 : _a.isEqual(uri); });
|
|
122
|
+
openEditors.forEach(editor => editor.close());
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.ChangeSetFileService = ChangeSetFileService;
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
(0, inversify_1.inject)(core_1.ILogger),
|
|
128
|
+
tslib_1.__metadata("design:type", Object)
|
|
129
|
+
], ChangeSetFileService.prototype, "logger", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
(0, inversify_1.inject)(workspace_service_1.WorkspaceService),
|
|
132
|
+
tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
|
|
133
|
+
], ChangeSetFileService.prototype, "wsService", void 0);
|
|
134
|
+
tslib_1.__decorate([
|
|
135
|
+
(0, inversify_1.inject)(browser_1.LabelProvider),
|
|
136
|
+
tslib_1.__metadata("design:type", browser_1.LabelProvider)
|
|
137
|
+
], ChangeSetFileService.prototype, "labelProvider", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, inversify_1.inject)(browser_1.OpenerService),
|
|
140
|
+
tslib_1.__metadata("design:type", Object)
|
|
141
|
+
], ChangeSetFileService.prototype, "openerService", void 0);
|
|
142
|
+
tslib_1.__decorate([
|
|
143
|
+
(0, inversify_1.inject)(browser_2.EditorManager),
|
|
144
|
+
tslib_1.__metadata("design:type", browser_2.EditorManager)
|
|
145
|
+
], ChangeSetFileService.prototype, "editorManager", void 0);
|
|
146
|
+
tslib_1.__decorate([
|
|
147
|
+
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
148
|
+
tslib_1.__metadata("design:type", browser_1.ApplicationShell)
|
|
149
|
+
], ChangeSetFileService.prototype, "shell", void 0);
|
|
150
|
+
tslib_1.__decorate([
|
|
151
|
+
(0, inversify_1.inject)(monaco_workspace_1.MonacoWorkspace),
|
|
152
|
+
tslib_1.__metadata("design:type", monaco_workspace_1.MonacoWorkspace)
|
|
153
|
+
], ChangeSetFileService.prototype, "monacoWorkspace", void 0);
|
|
154
|
+
tslib_1.__decorate([
|
|
155
|
+
(0, inversify_1.inject)(file_service_1.FileService),
|
|
156
|
+
tslib_1.__metadata("design:type", file_service_1.FileService)
|
|
157
|
+
], ChangeSetFileService.prototype, "fileService", void 0);
|
|
158
|
+
exports.ChangeSetFileService = ChangeSetFileService = tslib_1.__decorate([
|
|
159
|
+
(0, inversify_1.injectable)()
|
|
160
|
+
], ChangeSetFileService);
|
|
161
|
+
//# sourceMappingURL=change-set-file-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-file-service.js","sourceRoot":"","sources":["../../src/browser/change-set-file-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAAgD;AAChD,qDAA4H;AAC5H,4DAAkE;AAClE,uDAA0D;AAC1D,6EAAyE;AACzE,iFAA6E;AAC7E,sFAAkF;AAI3E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAyB7B,KAAK,CAAC,IAAI,CAAC,GAAQ;QACf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACtE,IAAI,QAAQ,EAAE,CAAC;gBACX,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC9B,CAAC;YACD,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KA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AM,CAAC,MAAM,CAAC,EAAE,WAAC,OAAA,MAAA,2BAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,0CAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;QACxG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;CACJ,CAAA;AAnIY,oDAAoB;AAEV;IADlB,IAAA,kBAAM,EAAC,cAAO,CAAC;;oDACmB;AAGhB;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;sCACK,oCAAgB;uDAAC;AAG5B;IADlB,IAAA,kBAAM,EAAC,uBAAa,CAAC;sCACY,uBAAa;2DAAC;AAG7B;IADlB,IAAA,kBAAM,EAAC,uBAAa,CAAC;;2DAC0B;AAG7B;IADlB,IAAA,kBAAM,EAAC,uBAAa,CAAC;sCACY,uBAAa;2DAAC;AAG7B;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACC,0BAAgB;mDAAC;AAGxB;IADlB,IAAA,kBAAM,EAAC,kCAAe,CAAC;sCACY,kCAAe;6DAAC;AAGjC;IADlB,IAAA,kBAAM,EAAC,0BAAW,CAAC;sCACY,0BAAW;yDAAC;+BAvBnC,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAmIhC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaybePromise } from '@theia/core';
|
|
2
|
+
import { AIVariable, ResolvedAIVariable, AIVariableContribution, AIVariableResolver, AIVariableService, AIVariableResolutionRequest, AIVariableContext } from '@theia/ai-core';
|
|
3
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
4
|
+
export declare const CHANGE_SET_SUMMARY_VARIABLE: AIVariable;
|
|
5
|
+
export declare class ChangeSetVariableContribution implements AIVariableContribution, AIVariableResolver {
|
|
6
|
+
protected readonly workspaceService: WorkspaceService;
|
|
7
|
+
registerVariables(service: AIVariableService): void;
|
|
8
|
+
canResolve(request: AIVariableResolutionRequest, context: AIVariableContext): MaybePromise<number>;
|
|
9
|
+
resolve(request: AIVariableResolutionRequest, context: AIVariableContext): Promise<ResolvedAIVariable | undefined>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=change-set-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-variable.d.ts","sourceRoot":"","sources":["../../src/browser/change-set-variable.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAO,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/K,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,eAAO,MAAM,2BAA2B,EAAE,UAKzC,CAAC;AAEF,qBACa,6BAA8B,YAAW,sBAAsB,EAAE,kBAAkB;IAE5F,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAInD,UAAU,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,CAAC;IAI5F,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;CAmB3H"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ChangeSetVariableContribution = exports.CHANGE_SET_SUMMARY_VARIABLE = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const core_1 = require("@theia/core");
|
|
21
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
+
const browser_1 = require("@theia/workspace/lib/browser");
|
|
23
|
+
const common_1 = require("../common");
|
|
24
|
+
exports.CHANGE_SET_SUMMARY_VARIABLE = {
|
|
25
|
+
id: common_1.CHANGE_SET_SUMMARY_VARIABLE_ID,
|
|
26
|
+
description: core_1.nls.localize('theia/ai/core/changeSetSummaryVariable/description', 'Provides a summary of the files in a change set and their contents.'),
|
|
27
|
+
name: common_1.CHANGE_SET_SUMMARY_VARIABLE_ID,
|
|
28
|
+
};
|
|
29
|
+
let ChangeSetVariableContribution = class ChangeSetVariableContribution {
|
|
30
|
+
registerVariables(service) {
|
|
31
|
+
service.registerResolver(exports.CHANGE_SET_SUMMARY_VARIABLE, this);
|
|
32
|
+
}
|
|
33
|
+
canResolve(request, context) {
|
|
34
|
+
return request.variable.name === exports.CHANGE_SET_SUMMARY_VARIABLE.name ? 50 : 0;
|
|
35
|
+
}
|
|
36
|
+
async resolve(request, context) {
|
|
37
|
+
if (!common_1.ChatSessionContext.is(context) || request.variable.name !== exports.CHANGE_SET_SUMMARY_VARIABLE.name) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
if (!context.model.changeSet.getElements().length) {
|
|
41
|
+
return {
|
|
42
|
+
variable: exports.CHANGE_SET_SUMMARY_VARIABLE,
|
|
43
|
+
value: ''
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const entries = await Promise.all(context.model.changeSet.getElements().map(async (element) => `- file: ${await this.workspaceService.getWorkspaceRelativePath(element.uri)}, status: ${element.state}`));
|
|
47
|
+
return {
|
|
48
|
+
variable: exports.CHANGE_SET_SUMMARY_VARIABLE,
|
|
49
|
+
value: `## Previously Proposed Changes
|
|
50
|
+
You have previously proposed changes for the following files. Some suggestions may have been accepted by the user, while others may still be pending.
|
|
51
|
+
${entries.join('\n')}
|
|
52
|
+
`
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.ChangeSetVariableContribution = ChangeSetVariableContribution;
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, inversify_1.inject)(browser_1.WorkspaceService),
|
|
59
|
+
tslib_1.__metadata("design:type", browser_1.WorkspaceService)
|
|
60
|
+
], ChangeSetVariableContribution.prototype, "workspaceService", void 0);
|
|
61
|
+
exports.ChangeSetVariableContribution = ChangeSetVariableContribution = tslib_1.__decorate([
|
|
62
|
+
(0, inversify_1.injectable)()
|
|
63
|
+
], ChangeSetVariableContribution);
|
|
64
|
+
//# sourceMappingURL=change-set-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-set-variable.js","sourceRoot":"","sources":["../../src/browser/change-set-variable.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAAgD;AAChD,4DAAkE;AAElE,0DAAgE;AAChE,sCAA+E;AAElE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AAC,IAAI,CAAC,IAAI,CAAC;CACnB;SACQ,CAAC;IACN,CAAC;CACJ,CAAA;AA/BY,sEAA6B;AAEnB;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;uEAAC;wCAF7C,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CA+BzC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
2
|
+
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
3
|
+
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
4
|
+
import { StorageService } from '@theia/core/lib/browser';
|
|
5
|
+
import { URI } from '@theia/core';
|
|
6
|
+
import { ILogger } from '@theia/core/lib/common/logger';
|
|
7
|
+
import { ChatModel } from '../common/chat-model';
|
|
8
|
+
import { ChatSessionIndex, ChatSessionStore, ChatModelWithMetadata, ChatSessionMetadata } from '../common/chat-session-store';
|
|
9
|
+
import { SerializedChatData } from '../common/chat-model-serialization';
|
|
10
|
+
export declare class ChatSessionStoreImpl implements ChatSessionStore {
|
|
11
|
+
protected readonly fileService: FileService;
|
|
12
|
+
protected readonly workspaceService: WorkspaceService;
|
|
13
|
+
protected readonly envServer: EnvVariablesServer;
|
|
14
|
+
protected readonly storageService: StorageService;
|
|
15
|
+
protected readonly logger: ILogger;
|
|
16
|
+
protected storageRoot?: URI;
|
|
17
|
+
protected indexCache?: ChatSessionIndex;
|
|
18
|
+
protected storePromise: Promise<void>;
|
|
19
|
+
storeSessions(...sessions: Array<ChatModel | ChatModelWithMetadata>): Promise<void>;
|
|
20
|
+
private isChatModelWithMetadata;
|
|
21
|
+
readSession(sessionId: string): Promise<SerializedChatData | undefined>;
|
|
22
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
23
|
+
clearAllSessions(): Promise<void>;
|
|
24
|
+
getSessionIndex(): Promise<ChatSessionIndex>;
|
|
25
|
+
setSessionTitle(sessionId: string, title: string): Promise<void>;
|
|
26
|
+
protected getStorageRoot(): Promise<URI>;
|
|
27
|
+
protected updateIndex(sessions: ((ChatModelWithMetadata & {
|
|
28
|
+
saveDate: number;
|
|
29
|
+
})[])): Promise<void>;
|
|
30
|
+
protected trimSessions(): Promise<void>;
|
|
31
|
+
protected loadIndex(): Promise<ChatSessionIndex>;
|
|
32
|
+
protected isValidMetadata(metadata: unknown): metadata is ChatSessionMetadata;
|
|
33
|
+
protected saveIndex(index: ChatSessionIndex): Promise<void>;
|
|
34
|
+
protected migrateData(data: unknown): SerializedChatData;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=chat-session-store-impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-session-store-impl.d.ts","sourceRoot":"","sources":["../../src/browser/chat-session-store-impl.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oCAAoC,CAAC;AAK3F,qBACa,oBAAqB,YAAW,gBAAgB;IAEzD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAG5C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,S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