@theia/ai-ide 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/ai-configuration/agent-configuration-widget.d.ts +41 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js +333 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts +18 -0
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js +53 -0
- package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +14 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +67 -0
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +29 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js +118 -0
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts +13 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.js +104 -0
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +43 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.js +302 -0
- package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +41 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +226 -0
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +141 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +508 -0
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +10 -0
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js +48 -0
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +22 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js +156 -0
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +30 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.js +150 -0
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +19 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.js +99 -0
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -0
- package/lib/browser/ai-ide-activation-service.d.ts +18 -0
- package/lib/browser/ai-ide-activation-service.d.ts.map +1 -0
- package/lib/browser/ai-ide-activation-service.js +71 -0
- package/lib/browser/ai-ide-activation-service.js.map +1 -0
- package/lib/browser/ai-terminal-functions.d.ts +13 -0
- package/lib/browser/ai-terminal-functions.d.ts.map +1 -0
- package/lib/browser/ai-terminal-functions.js +114 -0
- package/lib/browser/ai-terminal-functions.js.map +1 -0
- package/lib/browser/app-tester-chat-agent.d.ts +35 -0
- package/lib/browser/app-tester-chat-agent.d.ts.map +1 -0
- package/lib/browser/app-tester-chat-agent.js +142 -0
- package/lib/browser/app-tester-chat-agent.js.map +1 -0
- package/lib/browser/app-tester-chat-functions.d.ts +25 -0
- package/lib/browser/app-tester-chat-functions.d.ts.map +1 -0
- package/lib/browser/app-tester-chat-functions.js +170 -0
- package/lib/browser/app-tester-chat-functions.js.map +1 -0
- package/lib/browser/app-tester-prompt-template.d.ts +6 -0
- package/lib/browser/app-tester-prompt-template.d.ts.map +1 -0
- package/lib/browser/app-tester-prompt-template.js +83 -0
- package/lib/browser/app-tester-prompt-template.js.map +1 -0
- package/lib/browser/architect-agent.d.ts +15 -0
- package/lib/browser/architect-agent.d.ts.map +1 -0
- package/lib/browser/architect-agent.js +68 -0
- package/lib/browser/architect-agent.js.map +1 -0
- package/lib/browser/coder-agent.d.ts +15 -0
- package/lib/browser/coder-agent.d.ts.map +1 -0
- package/lib/browser/coder-agent.js +81 -0
- package/lib/browser/coder-agent.js.map +1 -0
- package/lib/browser/context-file-validation-service-impl.d.ts +13 -0
- package/lib/browser/context-file-validation-service-impl.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service-impl.js +123 -0
- package/lib/browser/context-file-validation-service-impl.js.map +1 -0
- package/lib/browser/context-file-validation-service-impl.spec.d.ts +2 -0
- package/lib/browser/context-file-validation-service-impl.spec.d.ts.map +1 -0
- package/lib/browser/context-file-validation-service-impl.spec.js +340 -0
- package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -0
- package/lib/browser/context-functions.d.ts +16 -0
- package/lib/browser/context-functions.d.ts.map +1 -0
- package/lib/browser/context-functions.js +166 -0
- package/lib/browser/context-functions.js.map +1 -0
- package/lib/browser/context-functions.spec.d.ts +2 -0
- package/lib/browser/context-functions.spec.d.ts.map +1 -0
- package/lib/browser/context-functions.spec.js +213 -0
- package/lib/browser/context-functions.spec.js.map +1 -0
- package/lib/browser/file-changeset-function.spec.d.ts +2 -0
- package/lib/browser/file-changeset-function.spec.d.ts.map +1 -0
- package/lib/browser/file-changeset-function.spec.js +45 -0
- package/lib/browser/file-changeset-function.spec.js.map +1 -0
- package/lib/browser/file-changeset-functions.d.ts +87 -0
- package/lib/browser/file-changeset-functions.d.ts.map +1 -0
- package/lib/browser/file-changeset-functions.js +645 -0
- package/lib/browser/file-changeset-functions.js.map +1 -0
- package/lib/browser/file-changeset-functions.spec.d.ts +2 -0
- package/lib/browser/file-changeset-functions.spec.d.ts.map +1 -0
- package/lib/browser/file-changeset-functions.spec.js +179 -0
- package/lib/browser/file-changeset-functions.spec.js.map +1 -0
- package/lib/browser/frontend-module.d.ts +5 -0
- package/lib/browser/frontend-module.d.ts.map +1 -0
- package/lib/browser/frontend-module.js +220 -0
- package/lib/browser/frontend-module.js.map +1 -0
- package/lib/browser/github-chat-agent.d.ts +48 -0
- package/lib/browser/github-chat-agent.d.ts.map +1 -0
- package/lib/browser/github-chat-agent.js +222 -0
- package/lib/browser/github-chat-agent.js.map +1 -0
- package/lib/browser/github-prompt-template.d.ts +6 -0
- package/lib/browser/github-prompt-template.d.ts.map +1 -0
- package/lib/browser/github-prompt-template.js +53 -0
- package/lib/browser/github-prompt-template.js.map +1 -0
- package/lib/browser/github-repo-variable-contribution.d.ts +15 -0
- package/lib/browser/github-repo-variable-contribution.d.ts.map +1 -0
- package/lib/browser/github-repo-variable-contribution.js +82 -0
- package/lib/browser/github-repo-variable-contribution.js.map +1 -0
- package/lib/browser/ide-chat-welcome-message-provider.d.ts +10 -0
- package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -0
- package/lib/browser/ide-chat-welcome-message-provider.js +102 -0
- package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -0
- package/lib/browser/project-info-agent.d.ts +13 -0
- package/lib/browser/project-info-agent.d.ts.map +1 -0
- package/lib/browser/project-info-agent.js +45 -0
- package/lib/browser/project-info-agent.js.map +1 -0
- package/lib/browser/remember-command-contribution.d.ts +16 -0
- package/lib/browser/remember-command-contribution.d.ts.map +1 -0
- package/lib/browser/remember-command-contribution.js +101 -0
- package/lib/browser/remember-command-contribution.js.map +1 -0
- package/lib/browser/summarize-session-command-contribution.d.ts +19 -0
- package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -0
- package/lib/browser/summarize-session-command-contribution.js +118 -0
- package/lib/browser/summarize-session-command-contribution.js.map +1 -0
- package/lib/browser/task-background-summary-variable.d.ts +9 -0
- package/lib/browser/task-background-summary-variable.d.ts.map +1 -0
- package/lib/browser/task-background-summary-variable.js +60 -0
- package/lib/browser/task-background-summary-variable.js.map +1 -0
- package/lib/browser/task-context-agent.d.ts +13 -0
- package/lib/browser/task-context-agent.d.ts.map +1 -0
- package/lib/browser/task-context-agent.js +45 -0
- package/lib/browser/task-context-agent.js.map +1 -0
- package/lib/browser/task-context-file-storage-service.d.ts +40 -0
- package/lib/browser/task-context-file-storage-service.d.ts.map +1 -0
- package/lib/browser/task-context-file-storage-service.js +232 -0
- package/lib/browser/task-context-file-storage-service.js.map +1 -0
- package/lib/browser/template-preference-contribution.d.ts +17 -0
- package/lib/browser/template-preference-contribution.d.ts.map +1 -0
- package/lib/browser/template-preference-contribution.js +94 -0
- package/lib/browser/template-preference-contribution.js.map +1 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +2 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +1 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +52 -0
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +1 -0
- package/lib/browser/workspace-functions.d.ts +78 -0
- package/lib/browser/workspace-functions.d.ts.map +1 -0
- package/lib/browser/workspace-functions.js +697 -0
- package/lib/browser/workspace-functions.js.map +1 -0
- package/lib/browser/workspace-functions.spec.d.ts +2 -0
- package/lib/browser/workspace-functions.spec.d.ts.map +1 -0
- package/lib/browser/workspace-functions.spec.js +161 -0
- package/lib/browser/workspace-functions.spec.js.map +1 -0
- package/lib/browser/workspace-launch-provider.d.ts +24 -0
- package/lib/browser/workspace-launch-provider.d.ts.map +1 -0
- package/lib/browser/workspace-launch-provider.js +216 -0
- package/lib/browser/workspace-launch-provider.js.map +1 -0
- package/lib/browser/workspace-launch-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-launch-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-launch-provider.spec.js +245 -0
- package/lib/browser/workspace-launch-provider.spec.js.map +1 -0
- package/lib/browser/workspace-search-provider.d.ts +15 -0
- package/lib/browser/workspace-search-provider.d.ts.map +1 -0
- package/lib/browser/workspace-search-provider.js +204 -0
- package/lib/browser/workspace-search-provider.js.map +1 -0
- package/lib/browser/workspace-search-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-search-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-search-provider.spec.js +82 -0
- package/lib/browser/workspace-search-provider.spec.js.map +1 -0
- package/lib/browser/workspace-task-provider.d.ts +15 -0
- package/lib/browser/workspace-task-provider.d.ts.map +1 -0
- package/lib/browser/workspace-task-provider.js +138 -0
- package/lib/browser/workspace-task-provider.js.map +1 -0
- package/lib/browser/workspace-task-provider.spec.d.ts +2 -0
- package/lib/browser/workspace-task-provider.spec.d.ts.map +1 -0
- package/lib/browser/workspace-task-provider.spec.js +109 -0
- package/lib/browser/workspace-task-provider.spec.js.map +1 -0
- package/lib/common/ai-configuration-preferences.d.ts +8 -0
- package/lib/common/ai-configuration-preferences.d.ts.map +1 -0
- package/lib/common/ai-configuration-preferences.js +41 -0
- package/lib/common/ai-configuration-preferences.js.map +1 -0
- package/lib/common/ai-ide-preferences.d.ts +5 -0
- package/lib/common/ai-ide-preferences.d.ts.map +1 -0
- package/lib/common/ai-ide-preferences.js +53 -0
- package/lib/common/ai-ide-preferences.js.map +1 -0
- package/lib/common/ai-terminal-functions.d.ts +2 -0
- package/lib/common/ai-terminal-functions.d.ts.map +1 -0
- package/lib/common/ai-terminal-functions.js +20 -0
- package/lib/common/ai-terminal-functions.js.map +1 -0
- package/lib/common/app-tester-chat-functions.d.ts +5 -0
- package/lib/common/app-tester-chat-functions.d.ts.map +1 -0
- package/lib/common/app-tester-chat-functions.js +23 -0
- package/lib/common/app-tester-chat-functions.js.map +1 -0
- package/lib/common/architect-prompt-template.d.ts +3 -0
- package/lib/common/architect-prompt-template.d.ts.map +1 -0
- package/lib/common/architect-prompt-template.js +81 -0
- package/lib/common/architect-prompt-template.js.map +1 -0
- package/lib/common/browser-automation-protocol.d.ts +15 -0
- package/lib/common/browser-automation-protocol.d.ts.map +1 -0
- package/lib/common/browser-automation-protocol.js +22 -0
- package/lib/common/browser-automation-protocol.js.map +1 -0
- package/lib/common/coder-replace-prompt-template.d.ts +11 -0
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -0
- package/lib/common/coder-replace-prompt-template.js +296 -0
- package/lib/common/coder-replace-prompt-template.js.map +1 -0
- package/lib/common/command-chat-agents.d.ts +36 -0
- package/lib/common/command-chat-agents.d.ts.map +1 -0
- package/lib/common/command-chat-agents.js +122 -0
- package/lib/common/command-chat-agents.js.map +1 -0
- package/lib/common/command-prompt-template.d.ts +3 -0
- package/lib/common/command-prompt-template.d.ts.map +1 -0
- package/lib/common/command-prompt-template.js +226 -0
- package/lib/common/command-prompt-template.js.map +1 -0
- package/lib/common/context-files-variable.d.ts +9 -0
- package/lib/common/context-files-variable.d.ts.map +1 -0
- package/lib/common/context-files-variable.js +52 -0
- package/lib/common/context-files-variable.js.map +1 -0
- package/lib/common/context-functions.d.ts +4 -0
- package/lib/common/context-functions.d.ts.map +1 -0
- package/lib/common/context-functions.js +22 -0
- package/lib/common/context-functions.js.map +1 -0
- package/lib/common/context-variables.d.ts +3 -0
- package/lib/common/context-variables.d.ts.map +1 -0
- package/lib/common/context-variables.js +21 -0
- package/lib/common/context-variables.js.map +1 -0
- package/lib/common/file-changeset-function-ids.d.ts +19 -0
- package/lib/common/file-changeset-function-ids.d.ts.map +1 -0
- package/lib/common/file-changeset-function-ids.js +37 -0
- package/lib/common/file-changeset-function-ids.js.map +1 -0
- package/lib/common/github-repo-protocol.d.ts +15 -0
- package/lib/common/github-repo-protocol.d.ts.map +1 -0
- package/lib/common/github-repo-protocol.js +21 -0
- package/lib/common/github-repo-protocol.js.map +1 -0
- package/lib/common/orchestrator-chat-agent.d.ts +36 -0
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -0
- package/lib/common/orchestrator-chat-agent.js +167 -0
- package/lib/common/orchestrator-chat-agent.js.map +1 -0
- package/lib/common/orchestrator-prompt-template.d.ts +3 -0
- package/lib/common/orchestrator-prompt-template.d.ts.map +1 -0
- package/lib/common/orchestrator-prompt-template.js +55 -0
- package/lib/common/orchestrator-prompt-template.js.map +1 -0
- package/lib/common/project-info-prompt-template.d.ts +6 -0
- package/lib/common/project-info-prompt-template.d.ts.map +1 -0
- package/lib/common/project-info-prompt-template.js +145 -0
- package/lib/common/project-info-prompt-template.js.map +1 -0
- package/lib/common/summarize-session-commands.d.ts +4 -0
- package/lib/common/summarize-session-commands.d.ts.map +1 -0
- package/lib/common/summarize-session-commands.js +28 -0
- package/lib/common/summarize-session-commands.js.map +1 -0
- package/lib/common/task-context-prompt-template.d.ts +8 -0
- package/lib/common/task-context-prompt-template.d.ts.map +1 -0
- package/lib/common/task-context-prompt-template.js +217 -0
- package/lib/common/task-context-prompt-template.js.map +1 -0
- package/lib/common/universal-chat-agent.d.ts +17 -0
- package/lib/common/universal-chat-agent.d.ts.map +1 -0
- package/lib/common/universal-chat-agent.js +47 -0
- package/lib/common/universal-chat-agent.js.map +1 -0
- package/lib/common/universal-prompt-template.d.ts +4 -0
- package/lib/common/universal-prompt-template.d.ts.map +1 -0
- package/lib/common/universal-prompt-template.js +32 -0
- package/lib/common/universal-prompt-template.js.map +1 -0
- package/lib/common/workspace-functions.d.ts +12 -0
- package/lib/common/workspace-functions.d.ts.map +1 -0
- package/lib/common/workspace-functions.js +30 -0
- package/lib/common/workspace-functions.js.map +1 -0
- package/lib/common/workspace-preferences.d.ts +10 -0
- package/lib/common/workspace-preferences.d.ts.map +1 -0
- package/lib/common/workspace-preferences.js +89 -0
- package/lib/common/workspace-preferences.js.map +1 -0
- package/lib/common/workspace-search-provider-util.d.ts +17 -0
- package/lib/common/workspace-search-provider-util.d.ts.map +1 -0
- package/lib/common/workspace-search-provider-util.js +51 -0
- package/lib/common/workspace-search-provider-util.js.map +1 -0
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts +18 -0
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +1 -0
- package/lib/node/app-tester-agent/browser-automation-impl.js +96 -0
- package/lib/node/app-tester-agent/browser-automation-impl.js.map +1 -0
- package/lib/node/backend-module.d.ts +4 -0
- package/lib/node/backend-module.d.ts.map +1 -0
- package/lib/node/backend-module.js +45 -0
- package/lib/node/backend-module.js.map +1 -0
- package/lib/node/github-repo-service-impl.d.ts +7 -0
- package/lib/node/github-repo-service-impl.d.ts.map +1 -0
- package/lib/node/github-repo-service-impl.js +86 -0
- package/lib/node/github-repo-service-impl.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +26 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +21 -21
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactWidget } from '@theia/core/lib/browser';
|
|
3
|
+
import * as React from '@theia/core/shared/react';
|
|
4
|
+
import { MessageService } from '@theia/core';
|
|
5
|
+
import { TokenUsageFrontendService, ModelTokenUsageData } from '@theia/ai-core/lib/browser/token-usage-frontend-service';
|
|
6
|
+
export declare class AITokenUsageConfigurationWidget extends ReactWidget {
|
|
7
|
+
static readonly ID = "ai-token-usage-configuration-container-widget";
|
|
8
|
+
static readonly LABEL: string;
|
|
9
|
+
protected tokenUsageData: ModelTokenUsageData[];
|
|
10
|
+
protected readonly messageService: MessageService;
|
|
11
|
+
protected readonly tokenUsageService: TokenUsageFrontendService;
|
|
12
|
+
protected init(): void;
|
|
13
|
+
protected refreshData(): Promise<void>;
|
|
14
|
+
protected formatNumber(num: number): string;
|
|
15
|
+
protected formatDate(date?: Date): string;
|
|
16
|
+
protected hasCacheData(): boolean;
|
|
17
|
+
protected renderHeaderRow(): React.ReactNode;
|
|
18
|
+
protected renderModelRow(model: ModelTokenUsageData): React.ReactNode;
|
|
19
|
+
protected renderSummaryRow(): React.ReactNode;
|
|
20
|
+
protected render(): React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=token-usage-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/token-usage-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,cAAc,EAAO,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAKzH,qBACa,+BAAgC,SAAQ,WAAW;IAE5D,MAAM,CAAC,QAAQ,CAAC,EAAE,mDAAmD;IACrE,MAAM,CAAC,QAAQ,CAAC,KAAK,SAA4D;IAGjF,SAAS,CAAC,cAAc,EAAE,mBAAmB,EAAE,CAAM;IAGrD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;IAGhE,SAAS,CAAC,IAAI,IAAI,IAAI;cAaN,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5C,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI3C,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM;IAOzC,SAAS,CAAC,YAAY,IAAI,OAAO;IAOjC,SAAS,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS;IA0C5C,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,KAAK,CAAC,SAAS;IAuBrE,SAAS,CAAC,gBAAgB,IAAI,KAAK,CAAC,SAAS;IAmC7C,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;CAgCtC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
var AITokenUsageConfigurationWidget_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AITokenUsageConfigurationWidget = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const React = require("@theia/core/shared/react");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
25
|
+
const token_usage_frontend_service_1 = require("@theia/ai-core/lib/browser/token-usage-frontend-service");
|
|
26
|
+
const date_fns_1 = require("date-fns");
|
|
27
|
+
// Using the interface from the token usage service
|
|
28
|
+
let AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget_1 = class AITokenUsageConfigurationWidget extends browser_1.ReactWidget {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
// Data will be fetched from the service
|
|
32
|
+
this.tokenUsageData = [];
|
|
33
|
+
}
|
|
34
|
+
init() {
|
|
35
|
+
this.id = AITokenUsageConfigurationWidget_1.ID;
|
|
36
|
+
this.title.label = AITokenUsageConfigurationWidget_1.LABEL;
|
|
37
|
+
this.title.closable = false;
|
|
38
|
+
this.refreshData();
|
|
39
|
+
this.tokenUsageService.onTokenUsageUpdated(data => {
|
|
40
|
+
this.tokenUsageData = data;
|
|
41
|
+
this.update();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async refreshData() {
|
|
45
|
+
try {
|
|
46
|
+
this.tokenUsageData = await this.tokenUsageService.getTokenUsageData();
|
|
47
|
+
this.update();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.messageService.error(core_1.nls.localize('theia/ai/tokenUsage/failedToGetTokenUsageData', 'Failed to fetch token usage data: {0}', error));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
formatNumber(num) {
|
|
54
|
+
return num.toLocaleString();
|
|
55
|
+
}
|
|
56
|
+
formatDate(date) {
|
|
57
|
+
if (!date) {
|
|
58
|
+
return core_1.nls.localize('theia/ai/tokenUsage/never', 'Never');
|
|
59
|
+
}
|
|
60
|
+
return (0, date_fns_1.formatDistanceToNow)(date, { addSuffix: true });
|
|
61
|
+
}
|
|
62
|
+
hasCacheData() {
|
|
63
|
+
return this.tokenUsageData.some(model => model.cachedInputTokens !== undefined ||
|
|
64
|
+
model.readCachedInputTokens !== undefined);
|
|
65
|
+
}
|
|
66
|
+
renderHeaderRow() {
|
|
67
|
+
const showCacheColumns = this.hasCacheData();
|
|
68
|
+
return (React.createElement("tr", { className: "token-usage-header" },
|
|
69
|
+
React.createElement("th", { className: "token-usage-model-column" }, core_1.nls.localize('theia/ai/tokenUsage/model', 'Model')),
|
|
70
|
+
React.createElement("th", { className: "token-usage-column" }, core_1.nls.localize('theia/ai/tokenUsage/inputTokens', 'Input Tokens')),
|
|
71
|
+
showCacheColumns && (React.createElement(React.Fragment, null,
|
|
72
|
+
React.createElement("th", { className: "token-usage-column", title: core_1.nls.localize('theia/ai/tokenUsage/cachedInputTokensTooltip', "Tracked additionally to 'Input Tokens'. Usually more expensive than non-cached tokens.") }, core_1.nls.localize('theia/ai/tokenUsage/cachedInputTokens', 'Input Tokens Written to Cache')),
|
|
73
|
+
React.createElement("th", { className: "token-usage-column", title: core_1.nls.localize('theia/ai/tokenUsage/readCachedInputTokensTooltip', "Tracked additionally to 'Input Token'. Usually much less expensive than not cached. Usually does not count to rate limits.") }, core_1.nls.localize('theia/ai/tokenUsage/readCachedInputTokens', 'Input Tokens Read From Cache')))),
|
|
74
|
+
React.createElement("th", { className: "token-usage-column" }, core_1.nls.localize('theia/ai/tokenUsage/outputTokens', 'Output Tokens')),
|
|
75
|
+
React.createElement("th", { className: "token-usage-column", title: core_1.nls.localize('theia/ai/tokenUsage/totalTokensTooltip', "'Input Tokens' + 'Output Tokens'") }, core_1.nls.localize('theia/ai/tokenUsage/totalTokens', 'Total Tokens')),
|
|
76
|
+
React.createElement("th", { className: "token-usage-column" }, core_1.nls.localize('theia/ai/tokenUsage/lastUsed', 'Last Used'))));
|
|
77
|
+
}
|
|
78
|
+
renderModelRow(model) {
|
|
79
|
+
var _a;
|
|
80
|
+
const lastUsedDate = model.lastUsed ? new Date(model.lastUsed) : undefined;
|
|
81
|
+
const exactDateString = lastUsedDate ? lastUsedDate.toLocaleString() : '';
|
|
82
|
+
const showCacheColumns = this.hasCacheData();
|
|
83
|
+
const totalTokens = model.inputTokens + model.outputTokens + ((_a = model.cachedInputTokens) !== null && _a !== void 0 ? _a : 0);
|
|
84
|
+
return (React.createElement("tr", { key: model.modelId, className: "token-usage-row" },
|
|
85
|
+
React.createElement("td", { className: "token-usage-model-cell" }, model.modelId),
|
|
86
|
+
React.createElement("td", { className: "token-usage-cell" }, this.formatNumber(model.inputTokens)),
|
|
87
|
+
showCacheColumns && (React.createElement(React.Fragment, null,
|
|
88
|
+
React.createElement("td", { className: "token-usage-cell" }, model.cachedInputTokens !== undefined ? this.formatNumber(model.cachedInputTokens) : '-'),
|
|
89
|
+
React.createElement("td", { className: "token-usage-cell" }, model.readCachedInputTokens !== undefined ? this.formatNumber(model.readCachedInputTokens) : '-'))),
|
|
90
|
+
React.createElement("td", { className: "token-usage-cell" }, this.formatNumber(model.outputTokens)),
|
|
91
|
+
React.createElement("td", { className: "token-usage-cell" }, this.formatNumber(totalTokens)),
|
|
92
|
+
React.createElement("td", { className: "token-usage-cell", title: exactDateString }, this.formatDate(lastUsedDate))));
|
|
93
|
+
}
|
|
94
|
+
renderSummaryRow() {
|
|
95
|
+
// Only show summary row if there is data
|
|
96
|
+
if (this.tokenUsageData.length === 0) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const totalInputTokens = this.tokenUsageData.reduce((sum, model) => sum + model.inputTokens, 0);
|
|
100
|
+
const totalOutputTokens = this.tokenUsageData.reduce((sum, model) => sum + model.outputTokens, 0);
|
|
101
|
+
const totalCachedInputTokens = this.tokenUsageData.reduce((sum, model) => sum + (model.cachedInputTokens || 0), 0);
|
|
102
|
+
const totalReadCachedInputTokens = this.tokenUsageData.reduce((sum, model) => sum + (model.readCachedInputTokens || 0), 0);
|
|
103
|
+
const totalTokens = totalInputTokens + totalCachedInputTokens + totalOutputTokens;
|
|
104
|
+
const showCacheColumns = this.hasCacheData();
|
|
105
|
+
return (React.createElement("tr", { className: "token-usage-summary-row" },
|
|
106
|
+
React.createElement("td", { className: "token-usage-model-cell" },
|
|
107
|
+
React.createElement("strong", null, core_1.nls.localize('theia/ai/tokenUsage/total', 'Total'))),
|
|
108
|
+
React.createElement("td", { className: "token-usage-cell" },
|
|
109
|
+
React.createElement("strong", null, this.formatNumber(totalInputTokens))),
|
|
110
|
+
showCacheColumns && (React.createElement(React.Fragment, null,
|
|
111
|
+
React.createElement("td", { className: "token-usage-cell" },
|
|
112
|
+
React.createElement("strong", null, this.formatNumber(totalCachedInputTokens))),
|
|
113
|
+
React.createElement("td", { className: "token-usage-cell" },
|
|
114
|
+
React.createElement("strong", null, this.formatNumber(totalReadCachedInputTokens))))),
|
|
115
|
+
React.createElement("td", { className: "token-usage-cell" },
|
|
116
|
+
React.createElement("strong", null, this.formatNumber(totalOutputTokens))),
|
|
117
|
+
React.createElement("td", { className: "token-usage-cell" },
|
|
118
|
+
React.createElement("strong", null, this.formatNumber(totalTokens))),
|
|
119
|
+
React.createElement("td", { className: "token-usage-cell" })));
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
return (React.createElement("div", { className: "token-usage-configuration-container" },
|
|
123
|
+
React.createElement("h2", { className: "token-usage-configuration-title" }, core_1.nls.localize('theia/ai/tokenUsage/title', 'AI Model Token Usage')),
|
|
124
|
+
React.createElement("div", { className: "token-usage-table-container" }, this.tokenUsageData.length > 0 ? (React.createElement("table", { className: "token-usage-table" },
|
|
125
|
+
React.createElement("thead", null, this.renderHeaderRow()),
|
|
126
|
+
React.createElement("tbody", null,
|
|
127
|
+
this.tokenUsageData.map(model => this.renderModelRow(model)),
|
|
128
|
+
this.renderSummaryRow()))) : (React.createElement("div", { className: "token-usage-empty" },
|
|
129
|
+
React.createElement("p", null, core_1.nls.localize('theia/ai/tokenUsage/noData', 'No token usage data available yet.'))))),
|
|
130
|
+
React.createElement("div", { className: "token-usage-notes" },
|
|
131
|
+
React.createElement("p", { className: "token-usage-note" },
|
|
132
|
+
React.createElement("i", { className: "codicon codicon-info" }),
|
|
133
|
+
core_1.nls.localize('theia/ai/tokenUsage/note', 'Token usage is tracked since the start of the application and is not persisted.')))));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
exports.AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget;
|
|
137
|
+
AITokenUsageConfigurationWidget.ID = 'ai-token-usage-configuration-container-widget';
|
|
138
|
+
AITokenUsageConfigurationWidget.LABEL = core_1.nls.localize('theia/ai/tokenUsage/label', 'Token Usage');
|
|
139
|
+
tslib_1.__decorate([
|
|
140
|
+
(0, inversify_1.inject)(core_1.MessageService),
|
|
141
|
+
tslib_1.__metadata("design:type", core_1.MessageService)
|
|
142
|
+
], AITokenUsageConfigurationWidget.prototype, "messageService", void 0);
|
|
143
|
+
tslib_1.__decorate([
|
|
144
|
+
(0, inversify_1.inject)(token_usage_frontend_service_1.TokenUsageFrontendService),
|
|
145
|
+
tslib_1.__metadata("design:type", Object)
|
|
146
|
+
], AITokenUsageConfigurationWidget.prototype, "tokenUsageService", void 0);
|
|
147
|
+
tslib_1.__decorate([
|
|
148
|
+
(0, inversify_1.postConstruct)(),
|
|
149
|
+
tslib_1.__metadata("design:type", Function),
|
|
150
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
151
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
152
|
+
], AITokenUsageConfigurationWidget.prototype, "init", null);
|
|
153
|
+
exports.AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget = AITokenUsageConfigurationWidget_1 = tslib_1.__decorate([
|
|
154
|
+
(0, inversify_1.injectable)()
|
|
155
|
+
], AITokenUsageConfigurationWidget);
|
|
156
|
+
//# sourceMappingURL=token-usage-configuration-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-usage-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/token-usage-configuration-widget.tsx"],"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;AACh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ACJ,CACX,CAAC,CAAC,CAAC,CACA,6BAAK,SAAS,EAAC,mBAAmB;gBAC9B,+BAAI,UAAG,CAAC,QAAQ,CAAC,4BAA4B,EAAE,oCAAoC,CAAC,CAAK,CACvF,CACT,CACC;YAEN,6BAAK,SAAS,EAAC,mBAAmB;gBAC9B,2BAAG,SAAS,EAAC,kBAAkB;oBAC3B,2BAAG,SAAS,EAAC,sBAAsB,GAAK;oBACvC,UAAG,CAAC,QAAQ,CAAC,0BAA0B,EAAE,iFAAiF,CAAC,CAC5H,CACF,CACJ,CACT,CAAC;IACN,CAAC;;AA1LQ,0EAA+B;AAExB,kCAAE,GAAG,+CAA+C,AAAlD,CAAmD;AACrD,qCAAK,GAAG,UAAG,CAAC,QAAQ,CAAC,2BAA2B,EAAE,aAAa,CAAC,AAA3D,CAA4D;AAM9D;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;uEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,wDAAyB,CAAC;;0EAC8B;AAGtD;IADT,IAAA,yBAAa,GAAE;;;;2DAYf;0CA1BQ,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CA2L3C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactWidget } from '@theia/core/lib/browser';
|
|
3
|
+
import * as React from '@theia/core/shared/react';
|
|
4
|
+
import { ToolInvocationRegistry } from '@theia/ai-core';
|
|
5
|
+
import { PreferenceService } from '@theia/core';
|
|
6
|
+
import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings';
|
|
7
|
+
import { ToolConfirmationMode } from '@theia/ai-chat/lib/common/chat-tool-preferences';
|
|
8
|
+
export declare class AIToolsConfigurationWidget extends ReactWidget {
|
|
9
|
+
static readonly ID = "ai-tools-configuration-widget";
|
|
10
|
+
static readonly LABEL: string;
|
|
11
|
+
protected readonly confirmationManager: ToolConfirmationManager;
|
|
12
|
+
protected readonly preferenceService: PreferenceService;
|
|
13
|
+
protected readonly toolInvocationRegistry: ToolInvocationRegistry;
|
|
14
|
+
protected tools: string[];
|
|
15
|
+
protected toolConfirmationModes: Record<string, ToolConfirmationMode>;
|
|
16
|
+
protected defaultState: ToolConfirmationMode;
|
|
17
|
+
protected loading: boolean;
|
|
18
|
+
protected init(): void;
|
|
19
|
+
protected loadData(): Promise<void>;
|
|
20
|
+
protected loadTools(): Promise<string[]>;
|
|
21
|
+
protected loadDefaultConfirmation(): Promise<ToolConfirmationMode>;
|
|
22
|
+
protected loadToolConfigurationModes(): Promise<Record<string, ToolConfirmationMode>>;
|
|
23
|
+
protected updateToolConfirmationMode(tool: string, state: ToolConfirmationMode): Promise<void>;
|
|
24
|
+
protected updateDefaultConfirmation(state: ToolConfirmationMode): Promise<void>;
|
|
25
|
+
protected handleToolConfirmationModeChange: (tool: string, event: React.ChangeEvent<HTMLSelectElement>) => Promise<void>;
|
|
26
|
+
protected handleDefaultStateChange: (event: React.ChangeEvent<HTMLSelectElement>) => Promise<void>;
|
|
27
|
+
protected resetAllToolsToDefault(): Promise<void>;
|
|
28
|
+
protected render(): React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=tools-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/tools-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAO,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAQvF,q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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
|
+
var AIToolsConfigurationWidget_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AIToolsConfigurationWidget = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
const React = require("@theia/core/shared/react");
|
|
24
|
+
const ai_core_1 = require("@theia/ai-core");
|
|
25
|
+
const core_1 = require("@theia/core");
|
|
26
|
+
const chat_tool_preference_bindings_1 = require("@theia/ai-chat/lib/browser/chat-tool-preference-bindings");
|
|
27
|
+
const chat_tool_preferences_1 = require("@theia/ai-chat/lib/common/chat-tool-preferences");
|
|
28
|
+
const TOOL_OPTIONS = [
|
|
29
|
+
{ value: chat_tool_preferences_1.ToolConfirmationMode.DISABLED, label: core_1.nls.localizeByDefault('Disabled'), icon: 'close' },
|
|
30
|
+
{ value: chat_tool_preferences_1.ToolConfirmationMode.CONFIRM, label: core_1.nls.localize('theia/ai/ide/toolsConfiguration/toolOptions/confirm/label', 'Confirm'), icon: 'question' },
|
|
31
|
+
{ value: chat_tool_preferences_1.ToolConfirmationMode.ALWAYS_ALLOW, label: core_1.nls.localize('theia/ai/ide/toolsConfiguration/toolOptions/alwaysAllow/label', 'Always Allow'), icon: 'thumbsup' },
|
|
32
|
+
];
|
|
33
|
+
let AIToolsConfigurationWidget = AIToolsConfigurationWidget_1 = class AIToolsConfigurationWidget extends browser_1.ReactWidget {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
// Mocked tool list and state
|
|
37
|
+
this.tools = [];
|
|
38
|
+
this.toolConfirmationModes = {};
|
|
39
|
+
this.loading = true;
|
|
40
|
+
this.handleToolConfirmationModeChange = async (tool, event) => {
|
|
41
|
+
const newState = event.target.value;
|
|
42
|
+
await this.updateToolConfirmationMode(tool, newState);
|
|
43
|
+
};
|
|
44
|
+
this.handleDefaultStateChange = async (event) => {
|
|
45
|
+
const newState = event.target.value;
|
|
46
|
+
await this.updateDefaultConfirmation(newState);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
init() {
|
|
50
|
+
this.id = AIToolsConfigurationWidget_1.ID;
|
|
51
|
+
this.title.label = AIToolsConfigurationWidget_1.LABEL;
|
|
52
|
+
this.title.closable = false;
|
|
53
|
+
this.loadData();
|
|
54
|
+
this.update();
|
|
55
|
+
this.toDispose.pushAll([
|
|
56
|
+
this.preferenceService.onPreferenceChanged(async (e) => {
|
|
57
|
+
if (e.preferenceName === 'ai-features.chat.toolConfirmation') {
|
|
58
|
+
this.defaultState = await this.loadDefaultConfirmation();
|
|
59
|
+
this.toolConfirmationModes = await this.loadToolConfigurationModes();
|
|
60
|
+
this.update();
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
this.toolInvocationRegistry.onDidChange(async () => {
|
|
64
|
+
this.tools = await this.loadTools();
|
|
65
|
+
this.update();
|
|
66
|
+
})
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
async loadData() {
|
|
70
|
+
// Replace with real service calls
|
|
71
|
+
this.tools = await this.loadTools();
|
|
72
|
+
this.defaultState = await this.loadDefaultConfirmation();
|
|
73
|
+
this.toolConfirmationModes = await this.loadToolConfigurationModes();
|
|
74
|
+
this.loading = false;
|
|
75
|
+
this.update();
|
|
76
|
+
}
|
|
77
|
+
async loadTools() {
|
|
78
|
+
return this.toolInvocationRegistry.getAllFunctions().map(func => func.name);
|
|
79
|
+
}
|
|
80
|
+
async loadDefaultConfirmation() {
|
|
81
|
+
return this.confirmationManager.getConfirmationMode('*', 'doesNotMatter');
|
|
82
|
+
}
|
|
83
|
+
async loadToolConfigurationModes() {
|
|
84
|
+
return this.confirmationManager.getAllConfirmationSettings();
|
|
85
|
+
}
|
|
86
|
+
async updateToolConfirmationMode(tool, state) {
|
|
87
|
+
await this.confirmationManager.setConfirmationMode(tool, state);
|
|
88
|
+
}
|
|
89
|
+
async updateDefaultConfirmation(state) {
|
|
90
|
+
await this.confirmationManager.setConfirmationMode('*', state);
|
|
91
|
+
}
|
|
92
|
+
async resetAllToolsToDefault() {
|
|
93
|
+
const dialog = new browser_1.ConfirmDialog({
|
|
94
|
+
title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/title', 'Reset All Tool Confirmation Modes'),
|
|
95
|
+
msg: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllConfirmDialog/msg', 'Are you sure you want to reset all tool confirmation modes to the default? This will remove all custom settings.'),
|
|
96
|
+
ok: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All'),
|
|
97
|
+
cancel: core_1.nls.localizeByDefault('Cancel')
|
|
98
|
+
});
|
|
99
|
+
const shouldReset = await dialog.open();
|
|
100
|
+
if (shouldReset) {
|
|
101
|
+
this.confirmationManager.resetAllConfirmationModeSettings();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
if (this.loading) {
|
|
106
|
+
return React.createElement("div", null, core_1.nls.localize('theia/ai/ide/toolsConfiguration/loading', 'Loading tools...'));
|
|
107
|
+
}
|
|
108
|
+
return React.createElement("div", { className: 'ai-tools-configuration-container' },
|
|
109
|
+
React.createElement("div", { className: 'ai-tools-configuration-default-section', style: { display: 'flex', alignItems: 'center', gap: 8 } },
|
|
110
|
+
React.createElement("div", { className: 'ai-tools-configuration-default-label' }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/default/label', 'Default Tool Confirmation Mode:')),
|
|
111
|
+
React.createElement("select", { className: "ai-tools-configuration-default-select", value: this.defaultState, onChange: this.handleDefaultStateChange, style: { marginLeft: 8 } }, TOOL_OPTIONS.map(opt => (React.createElement("option", { key: opt.value, value: opt.value }, opt.label)))),
|
|
112
|
+
React.createElement("button", { className: 'ai-tools-configuration-reset-btn', style: { marginLeft: 'auto' }, title: core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAllTooltip', 'Reset all tools to default'), onClick: () => this.resetAllToolsToDefault() }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/resetAll', 'Reset All'))),
|
|
113
|
+
React.createElement("div", { className: 'ai-tools-configuration-tools-section' },
|
|
114
|
+
React.createElement("div", { className: 'ai-tools-configuration-tools-label' }, core_1.nls.localize('theia/ai/ide/toolsConfiguration/tools/label', 'Tools')),
|
|
115
|
+
React.createElement("ul", { className: 'ai-tools-configuration-tools-list' }, this.tools.map(tool => {
|
|
116
|
+
const state = this.toolConfirmationModes[tool] || this.defaultState;
|
|
117
|
+
const isDefault = state === this.defaultState;
|
|
118
|
+
const selectClass = 'ai-tools-configuration-tool-select';
|
|
119
|
+
return (React.createElement("li", { key: tool, className: 'ai-tools-configuration-tool-item ' +
|
|
120
|
+
(isDefault ? 'default' : 'custom') },
|
|
121
|
+
React.createElement("span", { className: 'ai-tools-configuration-tool-name' }, tool),
|
|
122
|
+
React.createElement("select", { className: selectClass, value: state, onChange: e => this.handleToolConfirmationModeChange(tool, e) }, TOOL_OPTIONS.map(opt => (React.createElement("option", { key: opt.value, value: opt.value }, opt.label))))));
|
|
123
|
+
}))));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
exports.AIToolsConfigurationWidget = AIToolsConfigurationWidget;
|
|
127
|
+
AIToolsConfigurationWidget.ID = 'ai-tools-configuration-widget';
|
|
128
|
+
AIToolsConfigurationWidget.LABEL = core_1.nls.localize('theia/ai/ide/toolsConfiguration/label', 'Tools');
|
|
129
|
+
tslib_1.__decorate([
|
|
130
|
+
(0, inversify_1.inject)(chat_tool_preference_bindings_1.ToolConfirmationManager),
|
|
131
|
+
tslib_1.__metadata("design:type", chat_tool_preference_bindings_1.ToolConfirmationManager)
|
|
132
|
+
], AIToolsConfigurationWidget.prototype, "confirmationManager", void 0);
|
|
133
|
+
tslib_1.__decorate([
|
|
134
|
+
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
135
|
+
tslib_1.__metadata("design:type", Object)
|
|
136
|
+
], AIToolsConfigurationWidget.prototype, "preferenceService", void 0);
|
|
137
|
+
tslib_1.__decorate([
|
|
138
|
+
(0, inversify_1.inject)(ai_core_1.ToolInvocationRegistry),
|
|
139
|
+
tslib_1.__metadata("design:type", Object)
|
|
140
|
+
], AIToolsConfigurationWidget.prototype, "toolInvocationRegistry", void 0);
|
|
141
|
+
tslib_1.__decorate([
|
|
142
|
+
(0, inversify_1.postConstruct)(),
|
|
143
|
+
tslib_1.__metadata("design:type", Function),
|
|
144
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
145
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
146
|
+
], AIToolsConfigurationWidget.prototype, "init", null);
|
|
147
|
+
exports.AIToolsConfigurationWidget = AIToolsConfigurationWidget = AIToolsConfigurationWidget_1 = tslib_1.__decorate([
|
|
148
|
+
(0, inversify_1.injectable)()
|
|
149
|
+
], AIToolsConfigurationWidget);
|
|
150
|
+
//# sourceMappingURL=tools-configuration-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/tools-configuration-widget.ts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0EACmC;AASxD;IADT,IAAA,yBAAa,GAAE;;;;sDAoBf;qCAvCQ,0BAA0B;IADtC,IAAA,sBAAU,GAAE;GACA,0BAA0B,CAqJtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Agent, AgentService, AIVariable, AIVariableService } from '@theia/ai-core/lib/common';
|
|
3
|
+
import { ReactWidget } from '@theia/core/lib/browser';
|
|
4
|
+
import * as React from '@theia/core/shared/react';
|
|
5
|
+
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
6
|
+
export declare class AIVariableConfigurationWidget extends ReactWidget {
|
|
7
|
+
static readonly ID = "ai-variable-configuration-container-widget";
|
|
8
|
+
static readonly LABEL: string;
|
|
9
|
+
protected readonly variableService: AIVariableService;
|
|
10
|
+
protected readonly agentService: AgentService;
|
|
11
|
+
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
12
|
+
protected init(): void;
|
|
13
|
+
protected render(): React.ReactNode;
|
|
14
|
+
protected renderReferencedVariables(variable: AIVariable): React.ReactNode | undefined;
|
|
15
|
+
protected renderArgs(variable: AIVariable): React.ReactNode | undefined;
|
|
16
|
+
protected showAgentConfiguration(agent: Agent): void;
|
|
17
|
+
protected getAgentsForVariable(variable: AIVariable): Agent[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=variable-configuration-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/variable-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAW,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAG7E,qBACa,6BAA8B,SAAQ,WAAW;IAE1D,MAAM,CAAC,QAAQ,CAAC,EAAE,gDAAgD;IAClE,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAsC;IAG3D,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAGpF,SAAS,CAAC,IAAI,IAAI,IAAI;IAQtB,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IAgBnC,SAAS,CAAC,yBAAyB,CAAC,QAAQ,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS;IAkBtF,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS;IAkBvE,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAKpD,SAAS,CAAC,oBAAoB,CAAC,QAAQ,EAAE,UAAU,GAAG,KAAK,EAAE;CAGhE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2024 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
|
+
var AIVariableConfigurationWidget_1;
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AIVariableConfigurationWidget = void 0;
|
|
20
|
+
const tslib_1 = require("tslib");
|
|
21
|
+
const common_1 = require("@theia/ai-core/lib/common");
|
|
22
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
const React = require("@theia/core/shared/react");
|
|
25
|
+
const agent_configuration_widget_1 = require("./agent-configuration-widget");
|
|
26
|
+
const ai_configuration_service_1 = require("./ai-configuration-service");
|
|
27
|
+
const core_1 = require("@theia/core");
|
|
28
|
+
let AIVariableConfigurationWidget = AIVariableConfigurationWidget_1 = class AIVariableConfigurationWidget extends browser_1.ReactWidget {
|
|
29
|
+
init() {
|
|
30
|
+
this.id = AIVariableConfigurationWidget_1.ID;
|
|
31
|
+
this.title.label = AIVariableConfigurationWidget_1.LABEL;
|
|
32
|
+
this.title.closable = false;
|
|
33
|
+
this.update();
|
|
34
|
+
this.toDispose.push(this.variableService.onDidChangeVariables(() => this.update()));
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return React.createElement("div", { className: 'configuration-variables-list' },
|
|
38
|
+
React.createElement("ul", null, this.variableService.getVariables().map(variable => React.createElement("li", { key: variable.id, className: 'variable-item' },
|
|
39
|
+
React.createElement("div", { className: 'settings-section-title settings-section-category-title', style: { paddingLeft: 0, paddingBottom: 10 } }, variable.name),
|
|
40
|
+
React.createElement("small", null, variable.id),
|
|
41
|
+
React.createElement("small", null, variable.description),
|
|
42
|
+
this.renderReferencedVariables(variable),
|
|
43
|
+
this.renderArgs(variable)))));
|
|
44
|
+
}
|
|
45
|
+
renderReferencedVariables(variable) {
|
|
46
|
+
const agents = this.getAgentsForVariable(variable);
|
|
47
|
+
if (agents.length === 0) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return React.createElement("div", null,
|
|
51
|
+
React.createElement("h3", null, core_1.nls.localize('theia/ai/ide/variableConfiguration/agents', 'Agents')),
|
|
52
|
+
React.createElement("ul", { className: 'variable-references' }, agents.map(agent => React.createElement("li", { key: agent.id, className: 'theia-TreeNode theia-CompositeTreeNode theia-ExpandableTreeNode theia-mod-selected' },
|
|
53
|
+
React.createElement("div", { onClick: () => { this.showAgentConfiguration(agent); }, className: 'variable-reference' },
|
|
54
|
+
React.createElement("span", null, agent.name),
|
|
55
|
+
React.createElement("i", { className: (0, browser_1.codicon)('chevron-right') }))))));
|
|
56
|
+
}
|
|
57
|
+
renderArgs(variable) {
|
|
58
|
+
if (variable.args === undefined || variable.args.length === 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
return React.createElement("div", { className: 'variable-args-container' },
|
|
62
|
+
React.createElement("h3", null, core_1.nls.localize('theia/ai/ide/variableConfiguration/variableArgs', 'Variable Arguments')),
|
|
63
|
+
React.createElement("div", { className: 'variable-args' }, variable.args.map(arg => React.createElement(React.Fragment, { key: arg.name },
|
|
64
|
+
React.createElement("span", null, arg.name),
|
|
65
|
+
React.createElement("small", null, arg.description)))));
|
|
66
|
+
}
|
|
67
|
+
showAgentConfiguration(agent) {
|
|
68
|
+
this.aiConfigurationSelectionService.setActiveAgent(agent);
|
|
69
|
+
this.aiConfigurationSelectionService.selectConfigurationTab(agent_configuration_widget_1.AIAgentConfigurationWidget.ID);
|
|
70
|
+
}
|
|
71
|
+
getAgentsForVariable(variable) {
|
|
72
|
+
return this.agentService.getAgents().filter(a => { var _a; return (_a = a.variables) === null || _a === void 0 ? void 0 : _a.includes(variable.id); });
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.AIVariableConfigurationWidget = AIVariableConfigurationWidget;
|
|
76
|
+
AIVariableConfigurationWidget.ID = 'ai-variable-configuration-container-widget';
|
|
77
|
+
AIVariableConfigurationWidget.LABEL = core_1.nls.localizeByDefault('Variables');
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, inversify_1.inject)(common_1.AIVariableService),
|
|
80
|
+
tslib_1.__metadata("design:type", Object)
|
|
81
|
+
], AIVariableConfigurationWidget.prototype, "variableService", void 0);
|
|
82
|
+
tslib_1.__decorate([
|
|
83
|
+
(0, inversify_1.inject)(common_1.AgentService),
|
|
84
|
+
tslib_1.__metadata("design:type", Object)
|
|
85
|
+
], AIVariableConfigurationWidget.prototype, "agentService", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, inversify_1.inject)(ai_configuration_service_1.AIConfigurationSelectionService),
|
|
88
|
+
tslib_1.__metadata("design:type", ai_configuration_service_1.AIConfigurationSelectionService)
|
|
89
|
+
], AIVariableConfigurationWidget.prototype, "aiConfigurationSelectionService", void 0);
|
|
90
|
+
tslib_1.__decorate([
|
|
91
|
+
(0, inversify_1.postConstruct)(),
|
|
92
|
+
tslib_1.__metadata("design:type", Function),
|
|
93
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
94
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
95
|
+
], AIVariableConfigurationWidget.prototype, "init", null);
|
|
96
|
+
exports.AIVariableConfigurationWidget = AIVariableConfigurationWidget = AIVariableConfigurationWidget_1 = tslib_1.__decorate([
|
|
97
|
+
(0, inversify_1.injectable)()
|
|
98
|
+
], AIVariableConfigurationWidget);
|
|
99
|
+
//# sourceMappingURL=variable-configuration-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-configuration-widget.js","sourceRoot":"","sources":["../../../src/browser/ai-configuration/variable-configuration-widget.tsx"],"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;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BAA+B,CAAC,sBAAsB,CAAC,uDAA0B,CAAC,EAAE,CAAC,CAAC;IAC/F,CAAC;IAES,oBAAoB,CAAC,QAAoB;QAC/C,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,SAAS,0CAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA,EAAA,CAAC,CAAC;IACzF,CAAC;;AAlFQ,sEAA6B;AAEtB,gCAAE,GAAG,4CAA4C,AAA/C,CAAgD;AAClD,mCAAK,GAAG,UAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,AAArC,CAAsC;AAGxC;IADlB,IAAA,kBAAM,EAAC,0BAAiB,CAAC;;sEAC4B;AAGnC;IADlB,IAAA,kBAAM,EAAC,qBAAY,CAAC;;mEACyB;AAG3B;IADlB,IAAA,kBAAM,EAAC,0DAA+B,CAAC;sCACY,0DAA+B;sFAAC;AAG1E;IADT,IAAA,yBAAa,GAAE;;;;yDAOf;wCArBQ,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAmFzC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
2
|
+
import { Emitter, MaybePromise, Event, PreferenceService } from '@theia/core';
|
|
3
|
+
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
|
|
4
|
+
import { AIActivationService } from '@theia/ai-core/lib/browser/ai-activation-service';
|
|
5
|
+
/**
|
|
6
|
+
* Implements AI Activation Service based on preferences.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AIIdeActivationServiceImpl implements AIActivationService, FrontendApplicationContribution {
|
|
9
|
+
protected readonly contextKeyService: ContextKeyService;
|
|
10
|
+
protected preferenceService: PreferenceService;
|
|
11
|
+
protected isAiEnabledKey: ContextKey<boolean>;
|
|
12
|
+
protected onDidChangeAIEnabled: Emitter<boolean>;
|
|
13
|
+
get onDidChangeActiveStatus(): Event<boolean>;
|
|
14
|
+
get isActive(): boolean;
|
|
15
|
+
protected updateEnableValue(value: boolean): void;
|
|
16
|
+
initialize(): MaybePromise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ai-ide-activation-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-ide-activation-service.d.ts","sourceRoot":"","sources":["../../src/browser/ai-ide-activation-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAG,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAyB,MAAM,kDAAkD,CAAC;AAG9G;;GAEG;AACH,qBACa,0BAA2B,YAAW,mBAAmB,EAAE,+BAA+B;IAEnG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE9C,SAAS,CAAC,oBAAoB,mBAA0B;IACxD,IAAI,uBAAuB,IAAI,KAAK,CAAC,OAAO,CAAC,CAE5C;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAOjD,UAAU,IAAI,YAAY,CAAC,IAAI,CAAC;CAanC"}
|