@theia/ai-codex 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.
Files changed (61) hide show
  1. package/lib/browser/codex-chat-agent.d.ts +79 -0
  2. package/lib/browser/codex-chat-agent.d.ts.map +1 -0
  3. package/lib/browser/codex-chat-agent.js +556 -0
  4. package/lib/browser/codex-chat-agent.js.map +1 -0
  5. package/lib/browser/codex-chat-agent.spec.d.ts +2 -0
  6. package/lib/browser/codex-chat-agent.spec.d.ts.map +1 -0
  7. package/lib/browser/codex-chat-agent.spec.js +538 -0
  8. package/lib/browser/codex-chat-agent.spec.js.map +1 -0
  9. package/lib/browser/codex-frontend-module.d.ts +5 -0
  10. package/lib/browser/codex-frontend-module.d.ts.map +1 -0
  11. package/lib/browser/codex-frontend-module.js +52 -0
  12. package/lib/browser/codex-frontend-module.js.map +1 -0
  13. package/lib/browser/codex-frontend-service.d.ts +47 -0
  14. package/lib/browser/codex-frontend-service.d.ts.map +1 -0
  15. package/lib/browser/codex-frontend-service.js +194 -0
  16. package/lib/browser/codex-frontend-service.js.map +1 -0
  17. package/lib/browser/codex-frontend-service.spec.d.ts +2 -0
  18. package/lib/browser/codex-frontend-service.spec.d.ts.map +1 -0
  19. package/lib/browser/codex-frontend-service.spec.js +200 -0
  20. package/lib/browser/codex-frontend-service.spec.js.map +1 -0
  21. package/lib/browser/codex-tool-call-content.d.ts +9 -0
  22. package/lib/browser/codex-tool-call-content.d.ts.map +1 -0
  23. package/lib/browser/codex-tool-call-content.js +41 -0
  24. package/lib/browser/codex-tool-call-content.js.map +1 -0
  25. package/lib/browser/renderers/collapsible-tool-renderer.d.ts +13 -0
  26. package/lib/browser/renderers/collapsible-tool-renderer.d.ts.map +1 -0
  27. package/lib/browser/renderers/collapsible-tool-renderer.js +45 -0
  28. package/lib/browser/renderers/collapsible-tool-renderer.js.map +1 -0
  29. package/lib/browser/renderers/command-execution-renderer.d.ts +10 -0
  30. package/lib/browser/renderers/command-execution-renderer.d.ts.map +1 -0
  31. package/lib/browser/renderers/command-execution-renderer.js +74 -0
  32. package/lib/browser/renderers/command-execution-renderer.js.map +1 -0
  33. package/lib/browser/renderers/todo-list-renderer.d.ts +11 -0
  34. package/lib/browser/renderers/todo-list-renderer.d.ts.map +1 -0
  35. package/lib/browser/renderers/todo-list-renderer.js +106 -0
  36. package/lib/browser/renderers/todo-list-renderer.js.map +1 -0
  37. package/lib/browser/renderers/web-search-renderer.d.ts +10 -0
  38. package/lib/browser/renderers/web-search-renderer.d.ts.map +1 -0
  39. package/lib/browser/renderers/web-search-renderer.js +71 -0
  40. package/lib/browser/renderers/web-search-renderer.js.map +1 -0
  41. package/lib/common/codex-preferences.d.ts +4 -0
  42. package/lib/common/codex-preferences.d.ts.map +1 -0
  43. package/lib/common/codex-preferences.js +32 -0
  44. package/lib/common/codex-preferences.js.map +1 -0
  45. package/lib/common/codex-service.d.ts +23 -0
  46. package/lib/common/codex-service.d.ts.map +1 -0
  47. package/lib/common/codex-service.js +22 -0
  48. package/lib/common/codex-service.js.map +1 -0
  49. package/lib/common/index.d.ts +3 -0
  50. package/lib/common/index.d.ts.map +1 -0
  51. package/lib/common/index.js +21 -0
  52. package/lib/common/index.js.map +1 -0
  53. package/lib/node/codex-backend-module.d.ts +4 -0
  54. package/lib/node/codex-backend-module.d.ts.map +1 -0
  55. package/lib/node/codex-backend-module.js +35 -0
  56. package/lib/node/codex-backend-module.js.map +1 -0
  57. package/lib/node/codex-service-impl.d.ts +13 -0
  58. package/lib/node/codex-service-impl.d.ts.map +1 -0
  59. package/lib/node/codex-service-impl.js +97 -0
  60. package/lib/node/codex-service-impl.js.map +1 -0
  61. package/package.json +11 -11
@@ -0,0 +1,45 @@
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.CollapsibleToolRenderer = void 0;
19
+ const browser_1 = require("@theia/core/lib/browser");
20
+ const React = require("@theia/core/shared/react");
21
+ const CollapsibleToolRenderer = ({ compactHeader, expandedContent, onHeaderClick, headerStyle, defaultExpanded = false }) => {
22
+ const [isExpanded, setIsExpanded] = React.useState(defaultExpanded);
23
+ const hasExpandableContent = expandedContent !== undefined;
24
+ const handleHeaderClick = (event) => {
25
+ const target = event.target;
26
+ if (target.closest('.clickable-element')) {
27
+ onHeaderClick === null || onHeaderClick === void 0 ? void 0 : onHeaderClick();
28
+ return;
29
+ }
30
+ if (hasExpandableContent) {
31
+ setIsExpanded(!isExpanded);
32
+ }
33
+ onHeaderClick === null || onHeaderClick === void 0 ? void 0 : onHeaderClick();
34
+ };
35
+ return (React.createElement("div", { className: "codex-tool container" },
36
+ React.createElement("div", { className: `codex-tool header${hasExpandableContent ? ' expandable' : ''}`, onClick: handleHeaderClick, style: {
37
+ cursor: hasExpandableContent || onHeaderClick ? 'pointer' : 'default',
38
+ ...headerStyle
39
+ } },
40
+ hasExpandableContent && (React.createElement("span", { className: `${(0, browser_1.codicon)(isExpanded ? 'chevron-down' : 'chevron-right')} codex-tool expand-icon` })),
41
+ compactHeader),
42
+ hasExpandableContent && isExpanded && (React.createElement("div", { className: "codex-tool expanded-content" }, expandedContent))));
43
+ };
44
+ exports.CollapsibleToolRenderer = CollapsibleToolRenderer;
45
+ //# sourceMappingURL=collapsible-tool-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible-tool-renderer.js","sourceRoot":"","sources":["../../../src/browser/renderers/collapsible-tool-renderer.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;AAChF,gFAAgF;;;AAEhF,qDAAkD;AAClD,kDAAkD;AAW3C,MAAM,uBAAuB,GAA2C,CAAC,EAC5E,aAAa,EACb,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,GAAG,KAAK,EAC1B,EAAE,EAAE;IACD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAEpE,MAAM,oBAAoB,GAAG,eAAe,KAAK,SAAS,CAAC;IAE3D,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QAClD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;QAC3C,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACvC,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC;YAClB,OAAO;QACX,CAAC;QAED,IAAI,oBAAoB,EAAE,CAAC;YACvB,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC;QAC/B,CAAC;QACD,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAC,sBAAsB;QACjC,6BACI,SAAS,EAAE,oBAAoB,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,EAC1E,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE;gBACH,MAAM,EAAE,oBAAoB,IAAI,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;gBACrE,GAAG,WAAW;aACjB;YAEA,oBAAoB,IAAI,CACrB,8BAAM,SAAS,EAAE,GAAG,IAAA,iBAAO,EAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,yBAAyB,GAAI,CAC1G;YACA,aAAa,CACZ;QACL,oBAAoB,IAAI,UAAU,IAAI,CACnC,6BAAK,SAAS,EAAC,6BAA6B,IACvC,eAAe,CACd,CACT,CACC,CACT,CAAC;AACN,CAAC,CAAC;AA9CW,QAAA,uBAAuB,2BA8ClC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ChatResponseContent } from '@theia/ai-chat';
3
+ import { ChatResponsePartRenderer } from '@theia/ai-chat-ui/lib/browser/chat-response-part-renderer';
4
+ import { ReactNode } from '@theia/core/shared/react';
5
+ import { CodexToolCallChatResponseContent } from '../codex-tool-call-content';
6
+ export declare class CommandExecutionRenderer implements ChatResponsePartRenderer<CodexToolCallChatResponseContent> {
7
+ canHandle(response: ChatResponseContent): number;
8
+ render(content: CodexToolCallChatResponseContent): ReactNode;
9
+ }
10
+ //# sourceMappingURL=command-execution-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-execution-renderer.d.ts","sourceRoot":"","sources":["../../../src/browser/renderers/command-execution-renderer.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAIrG,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAG9E,qBACa,wBAAyB,YAAW,wBAAwB,CAAC,gCAAgC,CAAC;IACvG,SAAS,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAOhD,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,SAAS;CAqB/D"}
@@ -0,0 +1,74 @@
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.CommandExecutionRenderer = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const inversify_1 = require("@theia/core/shared/inversify");
22
+ const React = require("@theia/core/shared/react");
23
+ const core_1 = require("@theia/core");
24
+ let CommandExecutionRenderer = class CommandExecutionRenderer {
25
+ canHandle(response) {
26
+ return response.kind === 'toolCall' &&
27
+ response.name === 'command_execution'
28
+ ? 100
29
+ : 0;
30
+ }
31
+ render(content) {
32
+ let item;
33
+ if (content.result) {
34
+ try {
35
+ item = typeof content.result === 'string'
36
+ ? JSON.parse(content.result)
37
+ : content.result;
38
+ }
39
+ catch (error) {
40
+ console.error('Failed to parse command execution result:', error);
41
+ return undefined;
42
+ }
43
+ }
44
+ if (!item) {
45
+ const args = content.arguments ? JSON.parse(content.arguments) : {};
46
+ return React.createElement(CommandExecutionInProgressComponent, { command: args.command || 'executing...' });
47
+ }
48
+ return React.createElement(CommandExecutionComponent, { item: item });
49
+ }
50
+ };
51
+ exports.CommandExecutionRenderer = CommandExecutionRenderer;
52
+ exports.CommandExecutionRenderer = CommandExecutionRenderer = tslib_1.__decorate([
53
+ (0, inversify_1.injectable)()
54
+ ], CommandExecutionRenderer);
55
+ const CommandExecutionInProgressComponent = ({ command }) => (React.createElement("div", { className: "codex-command-execution" },
56
+ React.createElement("div", { className: "codex-tool-header" },
57
+ React.createElement("span", { className: `${(0, browser_1.codicon)('loading')} codex-tool-icon codex-loading` }),
58
+ React.createElement("span", { className: "codex-tool-name" }, core_1.nls.localizeByDefault('Terminal')),
59
+ React.createElement("code", { className: "codex-command-line" }, command),
60
+ React.createElement("span", { className: "codex-exit-code in-progress" }, core_1.nls.localize('theia/ai/codex/running', 'Running...')))));
61
+ const CommandExecutionComponent = ({ item }) => {
62
+ const [isExpanded, setIsExpanded] = React.useState(false);
63
+ const success = item.exit_code === 0;
64
+ const hasOutput = item.aggregated_output && item.aggregated_output.trim().length > 0;
65
+ return (React.createElement("div", { className: "codex-command-execution" },
66
+ React.createElement("div", { className: `codex-tool-header${hasOutput ? ' expandable' : ''}`, onClick: () => hasOutput && setIsExpanded(!isExpanded), style: { cursor: hasOutput ? 'pointer' : 'default' } },
67
+ hasOutput && (React.createElement("span", { className: `${(0, browser_1.codicon)(isExpanded ? 'chevron-down' : 'chevron-right')} codex-expand-icon` })),
68
+ React.createElement("span", { className: `${(0, browser_1.codicon)('terminal')} codex-tool-icon` }),
69
+ React.createElement("span", { className: "codex-tool-name" }, core_1.nls.localizeByDefault('Terminal')),
70
+ React.createElement("code", { className: "codex-command-line" }, item.command),
71
+ React.createElement("span", { className: `codex-exit-code ${success ? 'success' : 'error'}` }, core_1.nls.localize('theia/ai/codex/exitCode', 'Exit code: {0}', item.exit_code))),
72
+ hasOutput && isExpanded && (React.createElement("pre", { className: "codex-command-output" }, item.aggregated_output))));
73
+ };
74
+ //# sourceMappingURL=command-execution-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-execution-renderer.js","sourceRoot":"","sources":["../../../src/browser/renderers/command-execution-renderer.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAm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GAAG,IAAA,iBAAO,EAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,oBAAoB,GAAI,CACrG;YACD,8BAAM,SAAS,EAAE,GAAG,IAAA,iBAAO,EAAC,UAAU,CAAC,kBAAkB,GAAS;YAClE,8BAAM,SAAS,EAAC,iBAAiB,IAAE,UAAG,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAQ;YAC5E,8BAAM,SAAS,EAAC,oBAAoB,IAAE,IAAI,CAAC,OAAO,CAAQ;YAC1D,8BAAM,SAAS,EAAE,mBAAmB,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,IAC9D,UAAG,CAAC,QAAQ,CAAC,yBAAyB,EAAE,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CACvE,CACL;QACL,SAAS,IAAI,UAAU,IAAI,CACxB,6BAAK,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,iBAAiB,CAAO,CACvE,CACC,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ChatResponsePartRenderer } from '@theia/ai-chat-ui/lib/browser/chat-response-part-renderer';
3
+ import { ResponseNode } from '@theia/ai-chat-ui/lib/browser/chat-tree-view';
4
+ import { ChatResponseContent } from '@theia/ai-chat/lib/common';
5
+ import { ReactNode } from '@theia/core/shared/react';
6
+ import { CodexToolCallChatResponseContent } from '../codex-tool-call-content';
7
+ export declare class TodoListRenderer implements ChatResponsePartRenderer<CodexToolCallChatResponseContent> {
8
+ canHandle(response: ChatResponseContent): number;
9
+ render(content: CodexToolCallChatResponseContent, parentNode: ResponseNode): ReactNode;
10
+ }
11
+ //# sourceMappingURL=todo-list-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-list-renderer.d.ts","sourceRoot":"","sources":["../../../src/browser/renderers/todo-list-renderer.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAG9E,qBACa,gBAAiB,YAAW,wBAAwB,CAAC,gCAAgC,CAAC;IAE/F,SAAS,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAOhD,MAAM,CAAC,OAAO,EAAE,gCAAgC,EAAE,UAAU,EAAE,YAAY,GAAG,SAAS;CAkCzF"}
@@ -0,0 +1,106 @@
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.TodoListRenderer = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const core_1 = require("@theia/core");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ const React = require("@theia/core/shared/react");
24
+ const collapsible_tool_renderer_1 = require("./collapsible-tool-renderer");
25
+ let TodoListRenderer = class TodoListRenderer {
26
+ canHandle(response) {
27
+ return response.kind === 'toolCall' &&
28
+ response.name === 'todo_list'
29
+ ? 15
30
+ : 0;
31
+ }
32
+ render(content, parentNode) {
33
+ let item;
34
+ if (content.result) {
35
+ try {
36
+ item = typeof content.result === 'string'
37
+ ? JSON.parse(content.result)
38
+ : content.result;
39
+ }
40
+ catch (error) {
41
+ console.error('[TodoListRenderer] Failed to parse todo_list result:', error);
42
+ }
43
+ }
44
+ if (!item && content.arguments) {
45
+ try {
46
+ const args = JSON.parse(content.arguments);
47
+ if (args.items) {
48
+ item = {
49
+ id: args.id || 'unknown',
50
+ type: 'todo_list',
51
+ items: args.items
52
+ };
53
+ }
54
+ }
55
+ catch (error) {
56
+ console.error('[TodoListRenderer] Failed to parse todo_list arguments:', error);
57
+ }
58
+ }
59
+ if (!item) {
60
+ return undefined;
61
+ }
62
+ return React.createElement(TodoListComponent, { item: item });
63
+ }
64
+ };
65
+ exports.TodoListRenderer = TodoListRenderer;
66
+ exports.TodoListRenderer = TodoListRenderer = tslib_1.__decorate([
67
+ (0, inversify_1.injectable)()
68
+ ], TodoListRenderer);
69
+ const TodoListComponent = ({ item }) => {
70
+ const items = item.items || [];
71
+ const completedCount = items.filter(todo => todo.completed).length;
72
+ const totalCount = items.length;
73
+ if (totalCount === 0) {
74
+ // Show empty state
75
+ return (React.createElement("div", { className: "codex-tool container" },
76
+ React.createElement("div", { className: "codex-tool header" },
77
+ React.createElement("div", { className: "codex-tool header-left" },
78
+ React.createElement("span", { className: "codex-tool title" }, core_1.nls.localize('theia/ai/codex/todoList', 'Todo List')),
79
+ React.createElement("span", { className: `${(0, browser_1.codicon)('checklist')} codex-tool icon` }),
80
+ React.createElement("span", { className: "codex-tool progress-text" }, core_1.nls.localize('theia/ai/codex/loading', 'Loading...'))),
81
+ React.createElement("div", { className: "codex-tool header-right" },
82
+ React.createElement("span", { className: "codex-tool badge" }, core_1.nls.localize('theia/ai/codex/noItems', 'No items'))))));
83
+ }
84
+ const compactHeader = (React.createElement(React.Fragment, null,
85
+ React.createElement("div", { className: "codex-tool header-left" },
86
+ React.createElement("span", { className: "codex-tool title" }, core_1.nls.localize('theia/ai/codex/todoList', 'Todo List')),
87
+ React.createElement("span", { className: `${(0, browser_1.codicon)('checklist')} codex-tool icon` }),
88
+ React.createElement("span", { className: "codex-tool progress-text" }, core_1.nls.localize('theia/ai/codex/completedCount', '{0}/{1} completed', completedCount, totalCount))),
89
+ React.createElement("div", { className: "codex-tool header-right" },
90
+ React.createElement("span", { className: "codex-tool badge" }, totalCount === 1
91
+ ? core_1.nls.localize('theia/ai/codex/oneItem', '1 item')
92
+ : core_1.nls.localize('theia/ai/codex/itemCount', '{0} items', totalCount)))));
93
+ const expandedContent = (React.createElement("div", { className: "codex-tool details" },
94
+ React.createElement("div", { className: "codex-tool todo-list-items" }, items.map((todo, index) => {
95
+ const statusIcon = todo.completed
96
+ ? React.createElement("span", { className: `${(0, browser_1.codicon)('check')} codex-tool todo-status-icon completed` })
97
+ : React.createElement("span", { className: `${(0, browser_1.codicon)('circle-outline')} codex-tool todo-status-icon pending` });
98
+ return (React.createElement("div", { key: index, className: `codex-tool todo-item ${todo.completed ? 'status-completed' : 'status-pending'}` },
99
+ React.createElement("div", { className: "codex-tool todo-item-main" },
100
+ React.createElement("div", { className: "codex-tool todo-item-status" }, statusIcon),
101
+ React.createElement("div", { className: "codex-tool todo-item-content" },
102
+ React.createElement("span", { className: "codex-tool todo-item-text" }, todo.text)))));
103
+ }))));
104
+ return (React.createElement(collapsible_tool_renderer_1.CollapsibleToolRenderer, { compactHeader: compactHeader, expandedContent: expandedContent, defaultExpanded: true }));
105
+ };
106
+ //# sourceMappingURL=todo-list-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-list-renderer.js","sourceRoot":"","sources":["../../../src/browser/renderers/todo-list-renderer.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,uDAA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BACzC,8BAAM,SAAS,EAAC,2BAA2B,IAAE,IAAI,CAAC,IAAI,CAAQ,CAC5D,CACJ,CACJ,CACT,CAAC;QACN,CAAC,CAAC,CACA,CACJ,CACT,CAAC;IAEF,OAAO,CACH,oBAAC,mDAAuB,IACpB,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,IAAI,GACvB,CACL,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { ChatResponsePartRenderer } from '@theia/ai-chat-ui/lib/browser/chat-response-part-renderer';
3
+ import { ChatResponseContent } from '@theia/ai-chat/lib/common';
4
+ import { ReactNode } from '@theia/core/shared/react';
5
+ import { CodexToolCallChatResponseContent } from '../codex-tool-call-content';
6
+ export declare class WebSearchRenderer implements ChatResponsePartRenderer<CodexToolCallChatResponseContent> {
7
+ canHandle(response: ChatResponseContent): number;
8
+ render(content: CodexToolCallChatResponseContent): ReactNode;
9
+ }
10
+ //# sourceMappingURL=web-search-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-search-renderer.d.ts","sourceRoot":"","sources":["../../../src/browser/renderers/web-search-renderer.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAE9E,qBACa,iBAAkB,YAAW,wBAAwB,CAAC,gCAAgC,CAAC;IAEhG,SAAS,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAOhD,MAAM,CAAC,OAAO,EAAE,gCAAgC,GAAG,SAAS;CAqB/D"}
@@ -0,0 +1,71 @@
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.WebSearchRenderer = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const browser_1 = require("@theia/core/lib/browser");
21
+ const core_1 = require("@theia/core");
22
+ const inversify_1 = require("@theia/core/shared/inversify");
23
+ const React = require("@theia/core/shared/react");
24
+ let WebSearchRenderer = class WebSearchRenderer {
25
+ canHandle(response) {
26
+ return response.kind === 'toolCall' &&
27
+ response.name === 'web_search'
28
+ ? 15
29
+ : 0;
30
+ }
31
+ render(content) {
32
+ let item;
33
+ if (content.result) {
34
+ try {
35
+ item = typeof content.result === 'string'
36
+ ? JSON.parse(content.result)
37
+ : content.result;
38
+ }
39
+ catch (error) {
40
+ console.error('Failed to parse web_search result:', error);
41
+ return undefined;
42
+ }
43
+ }
44
+ if (!item) {
45
+ const args = content.arguments ? JSON.parse(content.arguments) : {};
46
+ return React.createElement(WebSearchInProgressComponent, { query: args.query || '' });
47
+ }
48
+ return React.createElement(WebSearchCompletedComponent, { item: item });
49
+ }
50
+ };
51
+ exports.WebSearchRenderer = WebSearchRenderer;
52
+ exports.WebSearchRenderer = WebSearchRenderer = tslib_1.__decorate([
53
+ (0, inversify_1.injectable)()
54
+ ], WebSearchRenderer);
55
+ const WebSearchInProgressComponent = ({ query }) => (React.createElement("div", { className: "codex-tool container" },
56
+ React.createElement("div", { className: "codex-tool header" },
57
+ React.createElement("div", { className: "codex-tool header-left" },
58
+ React.createElement("span", { className: "codex-tool title" }, core_1.nls.localize('theia/ai/codex/searching', 'Searching')),
59
+ React.createElement("span", { className: `${(0, browser_1.codicon)('loading')} codex-tool icon theia-animation-spin` }),
60
+ React.createElement("span", { className: "codex-tool command" }, query)),
61
+ React.createElement("div", { className: "codex-tool header-right" },
62
+ React.createElement("span", { className: "codex-tool badge" }, core_1.nls.localize('theia/ai/codex/webSearch', 'Web Search'))))));
63
+ const WebSearchCompletedComponent = ({ item }) => (React.createElement("div", { className: "codex-tool container" },
64
+ React.createElement("div", { className: "codex-tool header" },
65
+ React.createElement("div", { className: "codex-tool header-left" },
66
+ React.createElement("span", { className: "codex-tool title" }, core_1.nls.localize('theia/ai/codex/searched', 'Searched')),
67
+ React.createElement("span", { className: `${(0, browser_1.codicon)('globe')} codex-tool icon` }),
68
+ React.createElement("span", { className: "codex-tool command" }, item.query)),
69
+ React.createElement("div", { className: "codex-tool header-right" },
70
+ React.createElement("span", { className: "codex-tool badge" }, core_1.nls.localize('theia/ai/codex/webSearch', 'Web Search'))))));
71
+ //# sourceMappingURL=web-search-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-search-renderer.js","sourceRoot":"","sources":["../../../src/browser/renderers/web-search-renderer.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;AAChF,gFAAgF;;;;AAIhF,qDAAkD;AAClD,sCAAkC;AAClC,4DAA0D;AAC1D,kDAAkD;AAM3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE1B,SAAS,CAAC,QAA6B;QACnC,OAAO,QAAQ,CAAC,IAAI,KAAK,UAAU;YAC9B,QAA6C,CAAC,IAAI,KAAK,YAAY;YACpE,CAAC,CAA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,iBAAO,EAAC,SAAS,CAAC,uCAAuC,GAAI;YACjF,8BAAM,SAAS,EAAC,oBAAoB,IAAE,KAAK,CAAQ,CACjD;QACN,6BAAK,SAAS,EAAC,yBAAyB;YACpC,8BAAM,SAAS,EAAC,kBAAkB,IAAE,UAAG,CAAC,QAAQ,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAQ,CAChG,CACJ,CACJ,CACT,CAAC;AAEF,MAAM,2BAA2B,GAAsC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACjF,6BAAK,SAAS,EAAC,sBAAsB;IACjC,6BAAK,SAAS,EAAC,mBAAmB;QAC9B,6BAAK,SAAS,EAAC,wBAAwB;YACnC,8BAAM,SAAS,EAAC,kBAAkB,IAAE,UAAG,CAAC,QAAQ,CAAC,yBAAyB,EAAE,UAAU,CAAC,CAAQ;YAC/F,8BAAM,SAAS,EAAE,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,kBAAkB,GAAI;YAC1D,8BAAM,SAAS,EAAC,oBAAoB,IAAE,IAAI,CAAC,KAAK,CAAQ,CACtD;QACN,6BAAK,SAAS,EAAC,yBAAyB;YACpC,8BAAM,SAAS,EAAC,kBAAkB,IAAE,UAAG,CAAC,QAAQ,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAQ,CAChG,CACJ,CACJ,CACT,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PreferenceSchema } from '@theia/core';
2
+ export declare const CODEX_API_KEY_PREF = "ai-features.codex.apiKey";
3
+ export declare const CodexPreferencesSchema: PreferenceSchema;
4
+ //# sourceMappingURL=codex-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-preferences.d.ts","sourceRoot":"","sources":["../../src/common/codex-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAO,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,eAAO,MAAM,sBAAsB,EAAE,gBAUpC,CAAC"}
@@ -0,0 +1,32 @@
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.CodexPreferencesSchema = exports.CODEX_API_KEY_PREF = void 0;
19
+ const ai_core_preferences_1 = require("@theia/ai-core/lib/common/ai-core-preferences");
20
+ const core_1 = require("@theia/core");
21
+ exports.CODEX_API_KEY_PREF = 'ai-features.codex.apiKey';
22
+ exports.CodexPreferencesSchema = {
23
+ properties: {
24
+ [exports.CODEX_API_KEY_PREF]: {
25
+ type: 'string',
26
+ markdownDescription: core_1.nls.localize('theia/ai/codex/apiKey/description', 'OpenAI API key for Codex. If not set, falls back to the shared OpenAI API key (`ai-features.openAiOfficial.openAiApiKey`). ' +
27
+ 'Can also be set via `OPENAI_API_KEY` environment variable.'),
28
+ title: ai_core_preferences_1.AI_CORE_PREFERENCES_TITLE,
29
+ },
30
+ }
31
+ };
32
+ //# sourceMappingURL=codex-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-preferences.js","sourceRoot":"","sources":["../../src/common/codex-preferences.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,uFAA0F;AAC1F,sCAAoD;AAEvC,QAAA,kBAAkB,GAAG,0BAA0B,CAAC;AAEhD,QAAA,sBAAsB,GAAqB;IACpD,UAAU,EAAE;QACR,CAAC,0BAAkB,CAAC,EAAE;YAClB,IAAI,EAAE,QAAQ;YACd,mBAAmB,EAAE,UAAG,CAAC,QAAQ,CAAC,mCAAmC,EACjE,6HAA6H;gBAC7H,4DAA4D,CAAC;YACjE,KAAK,EAAE,+CAAyB;SACnC;KACJ;CACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { ThreadEvent, ThreadOptions } from '@openai/codex-sdk';
2
+ export declare const CODEX_SERVICE_PATH = "/services/codex";
3
+ export interface CodexRequest {
4
+ prompt: string;
5
+ options?: Partial<ThreadOptions>;
6
+ sessionId?: string;
7
+ sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access';
8
+ }
9
+ export interface CodexBackendRequest extends CodexRequest {
10
+ apiKey?: string;
11
+ sessionId?: string;
12
+ }
13
+ export declare const CodexClient: unique symbol;
14
+ export interface CodexClient {
15
+ sendToken(streamId: string, token?: ThreadEvent): void;
16
+ sendError(streamId: string, error: Error): void;
17
+ }
18
+ export declare const CodexService: unique symbol;
19
+ export interface CodexService {
20
+ send(request: CodexBackendRequest, streamId: string): Promise<void>;
21
+ cancel(streamId: string): void;
22
+ }
23
+ //# sourceMappingURL=codex-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-service.d.ts","sourceRoot":"","sources":["../../src/common/codex-service.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACR,WAAW,EACX,aAAa,EAChB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAEpD,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;CACxE;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,MAAM,WAAW,WAAW;IACxB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,MAAM,WAAW,YAAY;IACzB,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC"}
@@ -0,0 +1,22 @@
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.CodexService = exports.CodexClient = exports.CODEX_SERVICE_PATH = void 0;
19
+ exports.CODEX_SERVICE_PATH = '/services/codex';
20
+ exports.CodexClient = Symbol('CodexClient');
21
+ exports.CodexService = Symbol('CodexService');
22
+ //# sourceMappingURL=codex-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-service.js","sourceRoot":"","sources":["../../src/common/codex-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;;;AAOnE,QAAA,kBAAkB,GAAG,iBAAiB,CAAC;AAcvC,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAMpC,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './codex-service';
2
+ export * from './codex-preferences';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAgBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
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
+ const tslib_1 = require("tslib");
19
+ tslib_1.__exportStar(require("./codex-service"), exports);
20
+ tslib_1.__exportStar(require("./codex-preferences"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.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,0DAAgC;AAChC,8DAAoC"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=codex-backend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/codex-backend-module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAqB/D,wBAEG"}
@@ -0,0 +1,35 @@
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
+ const core_1 = require("@theia/core");
19
+ const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const codex_service_1 = require("../common/codex-service");
22
+ const codex_service_impl_1 = require("./codex-service-impl");
23
+ const codexConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind }) => {
24
+ bind(codex_service_impl_1.CodexServiceImpl).toSelf().inSingletonScope();
25
+ bind(codex_service_1.CodexService).toService(codex_service_impl_1.CodexServiceImpl);
26
+ bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(codex_service_1.CODEX_SERVICE_PATH, client => {
27
+ const server = ctx.container.get(codex_service_1.CodexService);
28
+ server.setClient(client);
29
+ return server;
30
+ })).inSingletonScope();
31
+ });
32
+ exports.default = new inversify_1.ContainerModule(bind => {
33
+ bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(codexConnectionModule);
34
+ });
35
+ //# sourceMappingURL=codex-backend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-backend-module.js","sourceRoot":"","sources":["../../src/node/codex-backend-module.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,sCAAsE;AACtE,4GAAuG;AACvG,4DAA+D;AAC/D,2DAIiC;AACjC,6DAAwD;AAExD,MAAM,qBAAqB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACxE,IAAI,CAAC,qCAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACnD,IAAI,CAAC,4BAAY,CAAC,CAAC,SAAS,CAAC,qCAAgB,CAAC,CAAC;IAE/C,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAAc,kCAAkB,EAAE,MAAM,CAAC,EAAE;QAC/D,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAmB,4BAAY,CAAC,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CACL,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAC3E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { CodexBackendRequest, CodexClient, CodexService } from '../common/codex-service';
2
+ export declare class CodexServiceImpl implements CodexService {
3
+ private logger;
4
+ private client;
5
+ private sessionThreads;
6
+ private abortControllers;
7
+ setClient(client: CodexClient): void;
8
+ send(request: CodexBackendRequest, streamId: string): Promise<void>;
9
+ protected sendMessages(streamId: string, request: CodexBackendRequest): Promise<void>;
10
+ cancel(streamId: string): void;
11
+ protected cleanup(streamId: string): void;
12
+ }
13
+ //# sourceMappingURL=codex-service-impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-service-impl.d.ts","sourceRoot":"","sources":["../../src/node/codex-service-impl.ts"],"names":[],"mappings":"AAmBA,OAAO,EACH,mBAAmB,EACnB,WAAW,EACX,YAAY,EACf,MAAM,yBAAyB,CAAC;AAEjC,qBACa,gBAAiB,YAAW,YAAY;IAGjD,OAAO,CAAC,MAAM,CAAU;IAExB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,cAAc,CAA6B;IACnD,OAAO,CAAC,gBAAgB,CAAsC;IAE9D,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAI9B,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAOzD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8C3F,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQ9B,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAG5C"}