@shepai/cli 1.149.1-pr468.4c60284 → 1.149.1-pr469.2ebd7cc
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/apis/json-schema/AgentType.yaml +0 -1
- package/dist/packages/core/src/domain/generated/output.d.ts +0 -1
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +0 -1
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +13 -3
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +0 -22
- package/dist/packages/core/src/infrastructure/services/mcp/mcp-server.service.d.ts +25 -0
- package/dist/packages/core/src/infrastructure/services/mcp/mcp-server.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/mcp-server.service.js +38 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/agent-tools.d.ts +13 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/agent-tools.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/agent-tools.js +92 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/feature-tools.d.ts +13 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/feature-tools.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/feature-tools.js +122 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/index.d.ts +12 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/index.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/index.js +18 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/repo-tools.d.ts +13 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/repo-tools.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/repo-tools.js +39 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/settings-tools.d.ts +13 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/settings-tools.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/mcp/tools/settings-tools.js +57 -0
- package/dist/src/presentation/cli/commands/mcp.command.d.ts +20 -0
- package/dist/src/presentation/cli/commands/mcp.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/mcp.command.js +65 -0
- package/dist/src/presentation/cli/index.d.ts +1 -0
- package/dist/src/presentation/cli/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/index.js +3 -0
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts +2 -6
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/agent-select.prompt.js +2 -7
- package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-all-agent-models.js +2 -4
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.js +0 -2
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.js +0 -1
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +0 -1
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.js +0 -7
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.js +0 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts +0 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.js +0 -8
- package/dist/src/presentation/web/hooks/useTheme.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2138fa7e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__29580090._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c094882b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dac5dbf1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fae8b355._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_3066bf50._.js → _07e841b4._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_3066bf50._.js.map → _07e841b4._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_4093a637._.js +1 -1
- package/web/.next/server/chunks/ssr/_4093a637._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js +1 -1
- package/web/.next/server/chunks/ssr/_6256a985._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8fcc39d4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_905be534._.js +3 -0
- package/web/.next/server/chunks/ssr/{_e3bfffad._.js.map → _905be534._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e482607f._.js +3 -0
- package/web/.next/server/chunks/ssr/{src_presentation_web_9183c7fa._.js.map → src_presentation_web_e482607f._.js.map} +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +44 -44
- package/web/.next/static/chunks/{ae411737fa84a470.js → 08baac5434d9528e.js} +7 -7
- package/web/.next/static/chunks/{0d1171cfea75e83e.js → 16953f6598d988e6.js} +1 -1
- package/web/.next/static/chunks/{d7bf79589d0d89d2.js → 187a2d1a30f1c39b.js} +1 -1
- package/web/.next/static/chunks/{12a462ee712c5f4e.js → 3973317b82cfbe6a.js} +1 -1
- package/web/.next/static/chunks/3eb1dbb96fc363e6.js +1 -0
- package/web/.next/static/chunks/6697436d831e889b.js +1 -0
- package/web/.next/static/chunks/{3a762627005e401a.js → 7e042073a83e51e6.js} +1 -1
- package/web/.next/static/chunks/b88f66d8b13b701f.js +5 -0
- package/web/.next/static/chunks/{0c2d51260002da28.js → b92c92c2e0d007d0.js} +1 -1
- package/web/.next/static/chunks/{58152ce0f08270cd.js → c95aa5667f52a5cf.js} +1 -1
- package/web/.next/static/chunks/{b203704d0b684bb3.js → cb04dc71ad63fd5c.js} +1 -1
- package/web/.next/static/chunks/{42675a4533e74269.js → d64cd47a7a527f3d.js} +1 -1
- package/web/.next/static/chunks/{663932a8e169fe21.js → f53943aeb5790c1a.js} +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts +0 -55
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts.map +0 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.js +0 -506
- package/web/.next/server/chunks/ssr/_e3bfffad._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_9183c7fa._.js +0 -3
- package/web/.next/static/chunks/93b1e7082b9ceb83.js +0 -5
- package/web/.next/static/chunks/bb1f383f304bd4ff.js +0 -1
- package/web/.next/static/chunks/cf18f75dfe6a45ba.js +0 -1
- package/web/public/icons/agents/openai.svg +0 -3
- /package/web/.next/static/{p-__FHqacyabBuoIsJ_dd → dyyjw1fSin7oivrnlVRXK}/_buildManifest.js +0 -0
- /package/web/.next/static/{p-__FHqacyabBuoIsJ_dd → dyyjw1fSin7oivrnlVRXK}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{p-__FHqacyabBuoIsJ_dd → dyyjw1fSin7oivrnlVRXK}/_ssgManifest.js +0 -0
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex CLI Executor Service
|
|
3
|
-
*
|
|
4
|
-
* Infrastructure implementation of IAgentExecutor for the OpenAI Codex CLI agent.
|
|
5
|
-
* Executes prompts via the `codex` CLI subprocess with JSONL output format.
|
|
6
|
-
*
|
|
7
|
-
* Uses constructor dependency injection for the spawn function
|
|
8
|
-
* to enable testability without mocking node:child_process directly.
|
|
9
|
-
*/
|
|
10
|
-
import * as fs from 'node:fs';
|
|
11
|
-
import * as os from 'node:os';
|
|
12
|
-
import * as path from 'node:path';
|
|
13
|
-
import { getCurrentPhase, getLogPrefix } from '../../feature-agent/log-context.js';
|
|
14
|
-
/** Features supported by Codex CLI */
|
|
15
|
-
const SUPPORTED_FEATURES = new Set(['session-resume', 'streaming', 'structured-output']);
|
|
16
|
-
/**
|
|
17
|
-
* Fatal stderr patterns indicating API-level failures even when exit code is 0.
|
|
18
|
-
* Codex CLI may exit 0 after encountering auth or rate-limit errors.
|
|
19
|
-
*/
|
|
20
|
-
const FATAL_STDERR_PATTERNS = [
|
|
21
|
-
/authentication.*failed/i,
|
|
22
|
-
/rate.?limit/i,
|
|
23
|
-
/quota.*exceeded/i,
|
|
24
|
-
/invalid.*api.?key/i,
|
|
25
|
-
/RESOURCE_EXHAUSTED/i,
|
|
26
|
-
];
|
|
27
|
-
/**
|
|
28
|
-
* Executor service for OpenAI Codex CLI agent.
|
|
29
|
-
* Uses subprocess spawning to interact with the `codex` CLI.
|
|
30
|
-
*/
|
|
31
|
-
export class CodexCliExecutorService {
|
|
32
|
-
spawn;
|
|
33
|
-
authConfig;
|
|
34
|
-
agentType = 'codex-cli';
|
|
35
|
-
/** When true, suppresses debug logging (set per-call via options.silent) */
|
|
36
|
-
silent = false;
|
|
37
|
-
constructor(spawn, authConfig) {
|
|
38
|
-
this.spawn = spawn;
|
|
39
|
-
this.authConfig = authConfig;
|
|
40
|
-
}
|
|
41
|
-
/** Debug logging — writes to stdout so it appears in the worker log file */
|
|
42
|
-
log(message) {
|
|
43
|
-
if (this.silent)
|
|
44
|
-
return;
|
|
45
|
-
const ts = new Date().toISOString();
|
|
46
|
-
process.stdout.write(`[${ts}] ${getCurrentPhase()}${getLogPrefix()}${message}\n`);
|
|
47
|
-
}
|
|
48
|
-
supportsFeature(feature) {
|
|
49
|
-
return SUPPORTED_FEATURES.has(feature);
|
|
50
|
-
}
|
|
51
|
-
async execute(prompt, options) {
|
|
52
|
-
this.silent = options?.silent ?? false;
|
|
53
|
-
const isResume = !!options?.resumeSession;
|
|
54
|
-
let tempSchemaPath;
|
|
55
|
-
try {
|
|
56
|
-
if (options?.outputSchema) {
|
|
57
|
-
tempSchemaPath = path.join(os.tmpdir(), `codex-schema-${Date.now()}-${Math.random().toString(36).slice(2)}.json`);
|
|
58
|
-
fs.writeFileSync(tempSchemaPath, JSON.stringify(options.outputSchema));
|
|
59
|
-
}
|
|
60
|
-
const args = this.buildArgs(prompt, options, tempSchemaPath);
|
|
61
|
-
const spawnOpts = this.buildSpawnOptions(options);
|
|
62
|
-
this.log(`Spawning: codex ${args.map((a) => (a.length > 80 ? `${a.slice(0, 77)}...` : a)).join(' ')}`);
|
|
63
|
-
this.log(`Spawn cwd: ${spawnOpts.cwd ?? '(inherited)'}`);
|
|
64
|
-
const proc = this.spawn('codex', args, spawnOpts);
|
|
65
|
-
this.log(`Subprocess PID: ${proc.pid ?? 'undefined (spawn may have failed)'}`);
|
|
66
|
-
this.log(`Prompt length: ${prompt.length} chars${isResume ? ' (positional arg for resume)' : ' (piped via stdin)'}`);
|
|
67
|
-
// For initial executions, pipe the prompt via stdin.
|
|
68
|
-
// For resume, the prompt is already in the CLI args.
|
|
69
|
-
if (!isResume && proc.stdin) {
|
|
70
|
-
proc.stdin.write(prompt);
|
|
71
|
-
proc.stdin.end();
|
|
72
|
-
}
|
|
73
|
-
return await new Promise((resolve, reject) => {
|
|
74
|
-
let lineBuffer = '';
|
|
75
|
-
let stderr = '';
|
|
76
|
-
let timedOut = false;
|
|
77
|
-
let timeoutId;
|
|
78
|
-
// State accumulated from JSONL events
|
|
79
|
-
let resultText = '';
|
|
80
|
-
let sessionId;
|
|
81
|
-
let usage;
|
|
82
|
-
if (options?.timeout) {
|
|
83
|
-
timeoutId = setTimeout(() => {
|
|
84
|
-
timedOut = true;
|
|
85
|
-
proc.kill();
|
|
86
|
-
}, options.timeout);
|
|
87
|
-
}
|
|
88
|
-
const processLine = (line) => {
|
|
89
|
-
try {
|
|
90
|
-
const parsed = JSON.parse(line);
|
|
91
|
-
const type = parsed.type;
|
|
92
|
-
if (type === 'thread.started' && parsed.thread_id) {
|
|
93
|
-
sessionId = parsed.thread_id;
|
|
94
|
-
}
|
|
95
|
-
else if (type === 'item.completed' && parsed.item?.type === 'agent_message') {
|
|
96
|
-
// Accumulate response text from completed agent messages
|
|
97
|
-
const content = parsed.item.content;
|
|
98
|
-
if (Array.isArray(content)) {
|
|
99
|
-
for (const block of content) {
|
|
100
|
-
if (block.type === 'text' && block.text) {
|
|
101
|
-
resultText += block.text;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (typeof content === 'string') {
|
|
106
|
-
resultText += content;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else if (type === 'turn.completed' && parsed.usage) {
|
|
110
|
-
usage = this.extractUsage(parsed.usage);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
// Malformed JSON line — skip gracefully
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
proc.stdout?.on('data', (chunk) => {
|
|
118
|
-
lineBuffer += chunk.toString();
|
|
119
|
-
const lines = lineBuffer.split('\n');
|
|
120
|
-
lineBuffer = lines.pop() ?? '';
|
|
121
|
-
for (const line of lines) {
|
|
122
|
-
const trimmed = line.trim();
|
|
123
|
-
if (trimmed)
|
|
124
|
-
processLine(trimmed);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
proc.stderr?.on('data', (chunk) => {
|
|
128
|
-
const data = chunk.toString();
|
|
129
|
-
stderr += data;
|
|
130
|
-
this.log(`stderr: ${data.trimEnd()}`);
|
|
131
|
-
});
|
|
132
|
-
proc.on('error', (error) => {
|
|
133
|
-
this.log(`Process error event: ${error.message}`);
|
|
134
|
-
if (timeoutId)
|
|
135
|
-
clearTimeout(timeoutId);
|
|
136
|
-
if (error.code === 'ENOENT') {
|
|
137
|
-
reject(new Error('Codex CLI ("codex") not found. Please install it: npm i -g @openai/codex'));
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
reject(error);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
proc.on('close', (code) => {
|
|
144
|
-
// Flush remaining buffer
|
|
145
|
-
if (lineBuffer.trim())
|
|
146
|
-
processLine(lineBuffer.trim());
|
|
147
|
-
this.log(`Process closed with code ${code}, result=${resultText.length} chars`);
|
|
148
|
-
if (timeoutId)
|
|
149
|
-
clearTimeout(timeoutId);
|
|
150
|
-
if (timedOut) {
|
|
151
|
-
reject(new Error('Agent execution timed out'));
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (code !== 0 && code !== null) {
|
|
155
|
-
const message = stderr.trim()
|
|
156
|
-
? `Process exited with code ${code}: ${stderr.trim()}`
|
|
157
|
-
: `Process exited with code ${code}`;
|
|
158
|
-
reject(new Error(message));
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// Codex CLI may exit 0 despite fatal API errors.
|
|
162
|
-
// Check stderr for known fatal patterns before trusting the output.
|
|
163
|
-
const fatalError = this.detectFatalStderrError(stderr);
|
|
164
|
-
if (fatalError) {
|
|
165
|
-
reject(new Error(fatalError));
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (!resultText && !sessionId) {
|
|
169
|
-
reject(new Error(`Empty response from Codex CLI. stderr: ${stderr.slice(0, 300)}`));
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const result = { result: resultText };
|
|
173
|
-
if (sessionId)
|
|
174
|
-
result.sessionId = sessionId;
|
|
175
|
-
if (usage)
|
|
176
|
-
result.usage = usage;
|
|
177
|
-
resolve(result);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
finally {
|
|
182
|
-
// Clean up temp schema file
|
|
183
|
-
if (tempSchemaPath) {
|
|
184
|
-
try {
|
|
185
|
-
fs.unlinkSync(tempSchemaPath);
|
|
186
|
-
}
|
|
187
|
-
catch {
|
|
188
|
-
// Best effort cleanup
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async *executeStream(prompt, options) {
|
|
194
|
-
this.silent = options?.silent ?? false;
|
|
195
|
-
const isResume = !!options?.resumeSession;
|
|
196
|
-
let tempSchemaPath;
|
|
197
|
-
try {
|
|
198
|
-
if (options?.outputSchema) {
|
|
199
|
-
tempSchemaPath = path.join(os.tmpdir(), `codex-schema-${Date.now()}-${Math.random().toString(36).slice(2)}.json`);
|
|
200
|
-
fs.writeFileSync(tempSchemaPath, JSON.stringify(options.outputSchema));
|
|
201
|
-
}
|
|
202
|
-
const args = this.buildArgs(prompt, options, tempSchemaPath);
|
|
203
|
-
const spawnOpts = this.buildSpawnOptions(options);
|
|
204
|
-
const proc = this.spawn('codex', args, spawnOpts);
|
|
205
|
-
// For initial executions, pipe the prompt via stdin.
|
|
206
|
-
// For resume, the prompt is already in the CLI args.
|
|
207
|
-
if (!isResume && proc.stdin) {
|
|
208
|
-
proc.stdin.write(prompt);
|
|
209
|
-
proc.stdin.end();
|
|
210
|
-
}
|
|
211
|
-
let lineBuffer = '';
|
|
212
|
-
let stderr = '';
|
|
213
|
-
let timedOut = false;
|
|
214
|
-
let timeoutId;
|
|
215
|
-
// State accumulated across events
|
|
216
|
-
let resultText = '';
|
|
217
|
-
const queue = [];
|
|
218
|
-
let resolve = null;
|
|
219
|
-
let spawnError = null;
|
|
220
|
-
function enqueue(event) {
|
|
221
|
-
queue.push(event);
|
|
222
|
-
if (resolve) {
|
|
223
|
-
resolve();
|
|
224
|
-
resolve = null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function waitForItem() {
|
|
228
|
-
if (queue.length > 0)
|
|
229
|
-
return Promise.resolve();
|
|
230
|
-
return new Promise((r) => {
|
|
231
|
-
resolve = r;
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
if (options?.timeout) {
|
|
235
|
-
timeoutId = setTimeout(() => {
|
|
236
|
-
timedOut = true;
|
|
237
|
-
proc.kill();
|
|
238
|
-
enqueue({ type: 'error', content: 'Agent execution timed out', timestamp: new Date() });
|
|
239
|
-
enqueue(null);
|
|
240
|
-
}, options.timeout);
|
|
241
|
-
}
|
|
242
|
-
const processStreamLine = (line) => {
|
|
243
|
-
try {
|
|
244
|
-
const parsed = JSON.parse(line);
|
|
245
|
-
const type = parsed.type;
|
|
246
|
-
if (type === 'thread.started') {
|
|
247
|
-
// Internal state — no event yielded (thread_id tracked for logging)
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
if (type === 'item.started' && parsed.item?.type === 'agent_message') {
|
|
251
|
-
enqueue({ type: 'progress', content: '', timestamp: new Date() });
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if (type === 'item.updated' && parsed.item?.type === 'agent_message') {
|
|
255
|
-
const delta = this.extractDeltaText(parsed);
|
|
256
|
-
if (delta) {
|
|
257
|
-
enqueue({ type: 'progress', content: delta, timestamp: new Date() });
|
|
258
|
-
}
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
if (type === 'item.completed' && parsed.item?.type === 'agent_message') {
|
|
262
|
-
const text = this.extractItemText(parsed);
|
|
263
|
-
if (text)
|
|
264
|
-
resultText += text;
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
if (type === 'item.started' && parsed.item?.type === 'command_execution') {
|
|
268
|
-
const cmd = parsed.item.command ?? parsed.item.name ?? 'command';
|
|
269
|
-
enqueue({ type: 'progress', content: `Running: ${cmd}`, timestamp: new Date() });
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
if (type === 'item.completed' && parsed.item?.type === 'command_execution') {
|
|
273
|
-
const exitCode = parsed.item.exit_code ?? '';
|
|
274
|
-
enqueue({
|
|
275
|
-
type: 'progress',
|
|
276
|
-
content: `Command completed (exit ${exitCode})`,
|
|
277
|
-
timestamp: new Date(),
|
|
278
|
-
});
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
if (type === 'item.started' && parsed.item?.type === 'file_change') {
|
|
282
|
-
enqueue({ type: 'progress', content: 'Modifying files', timestamp: new Date() });
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
if (type === 'item.completed' && parsed.item?.type === 'file_change') {
|
|
286
|
-
const file = parsed.item.file ?? parsed.item.path ?? '';
|
|
287
|
-
enqueue({
|
|
288
|
-
type: 'progress',
|
|
289
|
-
content: file ? `Modified: ${file}` : 'File change completed',
|
|
290
|
-
timestamp: new Date(),
|
|
291
|
-
});
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (type === 'turn.completed') {
|
|
295
|
-
// Yield final result event
|
|
296
|
-
enqueue({
|
|
297
|
-
type: 'result',
|
|
298
|
-
content: resultText,
|
|
299
|
-
timestamp: new Date(),
|
|
300
|
-
});
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
if (type === 'turn.failed') {
|
|
304
|
-
const msg = parsed.error?.message ?? parsed.message ?? 'Turn failed';
|
|
305
|
-
enqueue({ type: 'error', content: msg, timestamp: new Date() });
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
if (type === 'error') {
|
|
309
|
-
const msg = parsed.message ?? parsed.error ?? 'Unknown error';
|
|
310
|
-
enqueue({ type: 'error', content: msg, timestamp: new Date() });
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
// Unknown event type — skip gracefully
|
|
314
|
-
}
|
|
315
|
-
catch {
|
|
316
|
-
// Non-JSON line — emit as raw progress
|
|
317
|
-
enqueue({ type: 'progress', content: line, timestamp: new Date() });
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
proc.stdout?.on('data', (chunk) => {
|
|
321
|
-
lineBuffer += chunk.toString();
|
|
322
|
-
const lines = lineBuffer.split('\n');
|
|
323
|
-
lineBuffer = lines.pop() ?? '';
|
|
324
|
-
for (const line of lines) {
|
|
325
|
-
const trimmed = line.trim();
|
|
326
|
-
if (!trimmed)
|
|
327
|
-
continue;
|
|
328
|
-
processStreamLine(trimmed);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
proc.stderr?.on('data', (chunk) => {
|
|
332
|
-
stderr += chunk.toString();
|
|
333
|
-
});
|
|
334
|
-
proc.on('error', (err) => {
|
|
335
|
-
if (timeoutId)
|
|
336
|
-
clearTimeout(timeoutId);
|
|
337
|
-
spawnError = err;
|
|
338
|
-
enqueue(null);
|
|
339
|
-
});
|
|
340
|
-
proc.on('close', (code) => {
|
|
341
|
-
if (timeoutId)
|
|
342
|
-
clearTimeout(timeoutId);
|
|
343
|
-
if (timedOut)
|
|
344
|
-
return; // already handled by timeout callback
|
|
345
|
-
if (lineBuffer.trim()) {
|
|
346
|
-
processStreamLine(lineBuffer.trim());
|
|
347
|
-
}
|
|
348
|
-
if (code !== 0 && code !== null) {
|
|
349
|
-
const msg = stderr.trim()
|
|
350
|
-
? `Process exited with code ${code}: ${stderr.trim()}`
|
|
351
|
-
: `Process exited with code ${code}`;
|
|
352
|
-
enqueue({ type: 'error', content: msg, timestamp: new Date() });
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
// Check for fatal stderr patterns on exit 0
|
|
356
|
-
const fatalError = this.detectFatalStderrError(stderr);
|
|
357
|
-
if (fatalError) {
|
|
358
|
-
enqueue({ type: 'error', content: fatalError, timestamp: new Date() });
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
enqueue(null);
|
|
362
|
-
});
|
|
363
|
-
// Yield events as they arrive
|
|
364
|
-
while (true) {
|
|
365
|
-
await waitForItem();
|
|
366
|
-
const item = queue.shift();
|
|
367
|
-
if (item === null || item === undefined) {
|
|
368
|
-
if (spawnError !== null) {
|
|
369
|
-
yield {
|
|
370
|
-
type: 'error',
|
|
371
|
-
content: spawnError.message,
|
|
372
|
-
timestamp: new Date(),
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
yield item;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
finally {
|
|
381
|
-
// Clean up temp schema file
|
|
382
|
-
if (tempSchemaPath) {
|
|
383
|
-
try {
|
|
384
|
-
fs.unlinkSync(tempSchemaPath);
|
|
385
|
-
}
|
|
386
|
-
catch {
|
|
387
|
-
// Best effort cleanup
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Build CLI arguments for codex exec.
|
|
394
|
-
*
|
|
395
|
-
* For initial execution: `codex exec - --json --sandbox danger-full-access ...`
|
|
396
|
-
* For resume: `codex exec resume <threadId> "prompt" --json --sandbox danger-full-access ...`
|
|
397
|
-
*/
|
|
398
|
-
buildArgs(prompt, options, tempSchemaPath) {
|
|
399
|
-
const baseFlags = [
|
|
400
|
-
'--json',
|
|
401
|
-
'--sandbox',
|
|
402
|
-
'danger-full-access',
|
|
403
|
-
'--skip-git-repo-check',
|
|
404
|
-
'--color',
|
|
405
|
-
'never',
|
|
406
|
-
];
|
|
407
|
-
if (options?.model)
|
|
408
|
-
baseFlags.push('--model', options.model);
|
|
409
|
-
if (options?.cwd)
|
|
410
|
-
baseFlags.push('--cd', options.cwd);
|
|
411
|
-
if (tempSchemaPath)
|
|
412
|
-
baseFlags.push('--output-schema', tempSchemaPath);
|
|
413
|
-
if (options?.resumeSession) {
|
|
414
|
-
// Resume mode: codex exec resume <threadId> "prompt" [flags]
|
|
415
|
-
return ['exec', 'resume', options.resumeSession, prompt, ...baseFlags];
|
|
416
|
-
}
|
|
417
|
-
// Initial execution: codex exec - [flags]
|
|
418
|
-
// The `-` indicates prompt is piped via stdin
|
|
419
|
-
return ['exec', '-', ...baseFlags];
|
|
420
|
-
}
|
|
421
|
-
buildSpawnOptions(_options) {
|
|
422
|
-
const spawnOpts = {};
|
|
423
|
-
// Explicitly pipe stdio so streams are available even when parent disconnects
|
|
424
|
-
spawnOpts.stdio = ['pipe', 'pipe', 'pipe'];
|
|
425
|
-
// On Windows: windowsHide=true to prevent blank console windows.
|
|
426
|
-
// Codex CLI is a native Rust binary, so shell=true is NOT needed.
|
|
427
|
-
if (process.platform === 'win32') {
|
|
428
|
-
spawnOpts.windowsHide = true;
|
|
429
|
-
}
|
|
430
|
-
// Strip CLAUDECODE env var to prevent "nested session" error when shep
|
|
431
|
-
// is invoked from within a Claude Code session.
|
|
432
|
-
const { CLAUDECODE: _, ...cleanEnv } = process.env;
|
|
433
|
-
// Inject CODEX_API_KEY when using token auth
|
|
434
|
-
if (this.authConfig?.authMethod === 'token' && this.authConfig.token) {
|
|
435
|
-
spawnOpts.env = { ...cleanEnv, CODEX_API_KEY: this.authConfig.token };
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
spawnOpts.env = cleanEnv;
|
|
439
|
-
}
|
|
440
|
-
return spawnOpts;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Extract token usage from Codex CLI turn.completed usage object.
|
|
444
|
-
*/
|
|
445
|
-
extractUsage(usageObj) {
|
|
446
|
-
if (usageObj.input_tokens === undefined && usageObj.output_tokens === undefined) {
|
|
447
|
-
return undefined;
|
|
448
|
-
}
|
|
449
|
-
return {
|
|
450
|
-
inputTokens: usageObj.input_tokens ?? 0,
|
|
451
|
-
outputTokens: usageObj.output_tokens ?? 0,
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Extract delta text from an item.updated event.
|
|
456
|
-
*/
|
|
457
|
-
extractDeltaText(parsed) {
|
|
458
|
-
const item = parsed.item;
|
|
459
|
-
if (!item)
|
|
460
|
-
return undefined;
|
|
461
|
-
const content = item.content;
|
|
462
|
-
if (Array.isArray(content)) {
|
|
463
|
-
for (const block of content) {
|
|
464
|
-
if (block.type === 'text' && block.text)
|
|
465
|
-
return block.text;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
if (typeof item.delta === 'string')
|
|
469
|
-
return item.delta;
|
|
470
|
-
return undefined;
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Extract final text from an item.completed event.
|
|
474
|
-
*/
|
|
475
|
-
extractItemText(parsed) {
|
|
476
|
-
const item = parsed.item;
|
|
477
|
-
if (!item)
|
|
478
|
-
return undefined;
|
|
479
|
-
const content = item.content;
|
|
480
|
-
if (Array.isArray(content)) {
|
|
481
|
-
const parts = [];
|
|
482
|
-
for (const block of content) {
|
|
483
|
-
if (block.type === 'text' && block.text)
|
|
484
|
-
parts.push(block.text);
|
|
485
|
-
}
|
|
486
|
-
return parts.length > 0 ? parts.join('') : undefined;
|
|
487
|
-
}
|
|
488
|
-
if (typeof content === 'string')
|
|
489
|
-
return content;
|
|
490
|
-
return undefined;
|
|
491
|
-
}
|
|
492
|
-
/**
|
|
493
|
-
* Check stderr for patterns indicating fatal API errors.
|
|
494
|
-
* Returns an error message if fatal patterns are found, null otherwise.
|
|
495
|
-
*/
|
|
496
|
-
detectFatalStderrError(stderr) {
|
|
497
|
-
for (const pattern of FATAL_STDERR_PATTERNS) {
|
|
498
|
-
if (pattern.test(stderr)) {
|
|
499
|
-
const lines = stderr.split('\n').filter((l) => l.trim());
|
|
500
|
-
const summary = lines.slice(0, 3).join(' | ').slice(0, 300);
|
|
501
|
-
return `Codex CLI exited 0 but fatal error detected in stderr: ${summary}`;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
return null;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[96853,71716,a=>{"use strict";var b=a.i(25700);let c=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["default",()=>c],96853);let d=(0,b.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);a.s(["ChevronDown",()=>d],71716)},98410,a=>{"use strict";let b=(0,a.i(25700).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);a.s(["Copy",()=>b],98410)},4019,67075,a=>{"use strict";let b=(0,a.i(25700).default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);a.s(["Circle",()=>b],4019);var c=a.i(2811);a.s(["CheckCircle2",()=>c.default],67075)},3195,a=>{"use strict";let b=(0,a.i(25700).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);a.s(["FolderOpen",()=>b],3195)},50488,90944,24567,35460,a=>{"use strict";let b=(0,a.i(25700).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);a.s(["Code2",()=>b],50488);var c=a.i(25674);let d=(0,c.createServerReference)("404084627e012561c86628661442910b897204ec21",c.callServer,void 0,c.findSourceMapURL,"openIde");a.s(["openIde",()=>d],90944);let e=(0,c.createServerReference)("40d01cc6f7aae3b72d0f7391d9b5669c3de05b48ea",c.callServer,void 0,c.findSourceMapURL,"openShell");a.s(["openShell",()=>e],24567);let f=(0,c.createServerReference)("400cde925eff2c097830e1bf28dc61ff5f26f0aefa",c.callServer,void 0,c.findSourceMapURL,"openFolder");a.s(["openFolder",()=>f],35460)},3942,a=>{"use strict";let b=(0,a.i(25700).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);a.s(["Zap",()=>b],3942)},64005,a=>{"use strict";var b=a.i(96960);function c(a){let c=b.useRef({value:a,previous:a});return b.useMemo(()=>(c.current.value!==a&&(c.current.previous=c.current.value,c.current.value=a),c.current.previous),[a])}a.s(["usePrevious",()=>c])},3410,a=>{"use strict";let b=(0,a.i(25700).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["ChevronRight",()=>b],3410)},94132,a=>{"use strict";let b=(0,a.i(25700).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);a.s(["ChevronLeft",()=>b],94132)},10606,a=>{"use strict";var b=a.i(51969);a.s(["CheckIcon",()=>b.default])},72016,51969,a=>{"use strict";let b=(0,a.i(25700).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);a.s(["default",()=>b],51969),a.s(["Check",()=>b],72016)},71238,a=>{"use strict";let b=(0,a.i(25700).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);a.s(["ExternalLink",()=>b],71238)},63698,a=>{"use strict";let b=(0,a.i(25700).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);a.s(["Terminal",()=>b],63698)},78454,a=>{"use strict";a.i(24255),a.s([])},38702,16223,a=>{"use strict";var b=a.i(10973),c=a.i(85536);function d({icon:a,title:d,description:e,action:f,className:g,...h}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",g),...h,children:[a?(0,b.jsx)("div",{className:"text-muted-foreground",children:a}):null,(0,b.jsx)("h3",{className:"text-lg font-semibold",children:d}),e?(0,b.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:e}):null,f?(0,b.jsx)("div",{className:"mt-2",children:f}):null]})}a.s(["EmptyState",()=>d],16223),a.s([],38702)},30107,24675,a=>{"use strict";var b=a.i(25674);let c=(0,b.createServerReference)("00d8ab91b12fe2c2a0230d654e91e0f37a9e3537cc",b.callServer,void 0,b.findSourceMapURL,"getAllAgentModels");a.s(["getAllAgentModels",()=>c],30107);let d=(0,b.createServerReference)("60882fc5232724771be6ae2282671baa7ab052b5e8",b.callServer,void 0,b.findSourceMapURL,"updateAgentAndModel");a.s(["updateAgentAndModel",()=>d],24675)},4514,a=>{"use strict";var b=a.i(25674);let c=(0,b.createServerReference)("400826d86d9ec5d31b9a18aa7258ea02820e0df25c",b.callServer,void 0,b.findSourceMapURL,"addRepository");a.s(["addRepository",()=>c])},55628,a=>{"use strict";var b=a.i(96960),c=a.i(90944),d=a.i(24567),e=a.i(35460),f=a.i(25674);let g=(0,f.createServerReference)("40b57ab453a63254ed98a4804200b948ab005e79bb",f.callServer,void 0,f.findSourceMapURL,"syncRepository");function h(a){let[f,h]=(0,b.useState)(!1),[i,j]=(0,b.useState)(!1),[k,l]=(0,b.useState)(!1),[m,n]=(0,b.useState)(!1),[o,p]=(0,b.useState)(null),[q,r]=(0,b.useState)(null),[s,t]=(0,b.useState)(null),[u,v]=(0,b.useState)(null),w=(0,b.useRef)(null),x=(0,b.useRef)(null),y=(0,b.useRef)(null),z=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{w.current&&clearTimeout(w.current),x.current&&clearTimeout(x.current),y.current&&clearTimeout(y.current),z.current&&clearTimeout(z.current)},[]);let A=(0,b.useCallback)(async(b,c,d,e,f)=>{if(a&&!f){e.current&&clearTimeout(e.current),c(!0),d(null);try{let a=await b();if(!a.success){let b=a.error??"An unexpected error occurred";d(b),e.current=setTimeout(()=>d(null),5e3)}}catch(a){d(a instanceof Error?a.message:"An unexpected error occurred"),e.current=setTimeout(()=>d(null),5e3)}finally{c(!1)}}},[a]);return{openInIde:(0,b.useCallback)(()=>A(()=>(0,c.openIde)({repositoryPath:a.repositoryPath}),h,p,w,f),[A,f,a]),openInShell:(0,b.useCallback)(()=>A(()=>(0,d.openShell)({repositoryPath:a.repositoryPath}),j,r,x,i),[A,i,a]),openFolder:(0,b.useCallback)(()=>A(()=>(0,e.openFolder)(a.repositoryPath),l,t,y,k),[A,k,a]),syncMain:(0,b.useCallback)(()=>A(()=>g(a.repositoryId??""),n,v,z,m),[A,m,a]),ideLoading:f,shellLoading:i,folderLoading:k,syncLoading:m,ideError:o,shellError:q,folderError:s,syncError:u}}a.s(["useRepositoryActions",()=>h],55628)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_e3bfffad._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[80646,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(59653),e=a.i(6175),f=a.i(7420),g=a.i(58761),h=a.i(51473),i=a.i(59675),j=a.i(5472),k=a.i(75988),l=a.i(80930),m=a.i(14272),n=a.i(66873),o=a.i(90986),p=a.i(17329),q=a.i(16164),r=a.i(45291),s="Popover",[t,u]=(0,f.createContextScope)(s,[k.createPopperScope]),v=(0,k.createPopperScope)(),[w,x]=t(s),y=a=>{let{__scopePopover:d,children:e,open:f,defaultOpen:g,onOpenChange:h,modal:i=!1}=a,l=v(d),m=c.useRef(null),[n,o]=c.useState(!1),[q,r]=(0,p.useControllableState)({prop:f,defaultProp:g??!1,onChange:h,caller:s});return(0,b.jsx)(k.Root,{...l,children:(0,b.jsx)(w,{scope:d,contentId:(0,j.useId)(),triggerRef:m,open:q,onOpenChange:r,onOpenToggle:c.useCallback(()=>r(a=>!a),[r]),hasCustomAnchor:n,onCustomAnchorAdd:c.useCallback(()=>o(!0),[]),onCustomAnchorRemove:c.useCallback(()=>o(!1),[]),modal:i,children:e})})};y.displayName=s;var z="PopoverAnchor",A=c.forwardRef((a,d)=>{let{__scopePopover:e,...f}=a,g=x(z,e),h=v(e),{onCustomAnchorAdd:i,onCustomAnchorRemove:j}=g;return c.useEffect(()=>(i(),()=>j()),[i,j]),(0,b.jsx)(k.Anchor,{...h,...f,ref:d})});A.displayName=z;var B="PopoverTrigger",C=c.forwardRef((a,c)=>{let{__scopePopover:f,...g}=a,h=x(B,f),i=v(f),j=(0,e.useComposedRefs)(c,h.triggerRef),l=(0,b.jsx)(n.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":h.open,"aria-controls":h.contentId,"data-state":Q(h.open),...g,ref:j,onClick:(0,d.composeEventHandlers)(a.onClick,h.onOpenToggle)});return h.hasCustomAnchor?l:(0,b.jsx)(k.Anchor,{asChild:!0,...i,children:l})});C.displayName=B;var D="PopoverPortal",[E,F]=t(D,{forceMount:void 0}),G=a=>{let{__scopePopover:c,forceMount:d,children:e,container:f}=a,g=x(D,c);return(0,b.jsx)(E,{scope:c,forceMount:d,children:(0,b.jsx)(m.Presence,{present:d||g.open,children:(0,b.jsx)(l.Portal,{asChild:!0,container:f,children:e})})})};G.displayName=D;var H="PopoverContent",I=c.forwardRef((a,c)=>{let d=F(H,a.__scopePopover),{forceMount:e=d.forceMount,...f}=a,g=x(H,a.__scopePopover);return(0,b.jsx)(m.Presence,{present:e||g.open,children:g.modal?(0,b.jsx)(K,{...f,ref:c}):(0,b.jsx)(L,{...f,ref:c})})});I.displayName=H;var J=(0,o.createSlot)("PopoverContent.RemoveScroll"),K=c.forwardRef((a,f)=>{let g=x(H,a.__scopePopover),h=c.useRef(null),i=(0,e.useComposedRefs)(f,h),j=c.useRef(!1);return c.useEffect(()=>{let a=h.current;if(a)return(0,q.hideOthers)(a)},[]),(0,b.jsx)(r.RemoveScroll,{as:J,allowPinchZoom:!0,children:(0,b.jsx)(M,{...a,ref:i,trapFocus:g.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,d.composeEventHandlers)(a.onCloseAutoFocus,a=>{a.preventDefault(),j.current||g.triggerRef.current?.focus()}),onPointerDownOutside:(0,d.composeEventHandlers)(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;j.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:(0,d.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=c.forwardRef((a,d)=>{let e=x(H,a.__scopePopover),f=c.useRef(!1),g=c.useRef(!1);return(0,b.jsx)(M,{...a,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(f.current||e.triggerRef.current?.focus(),b.preventDefault()),f.current=!1,g.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(f.current=!0,"pointerdown"===b.detail.originalEvent.type&&(g.current=!0));let c=b.target;e.triggerRef.current?.contains(c)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&g.current&&b.preventDefault()}})}),M=c.forwardRef((a,c)=>{let{__scopePopover:d,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:j,disableOutsidePointerEvents:l,onEscapeKeyDown:m,onPointerDownOutside:n,onFocusOutside:o,onInteractOutside:p,...q}=a,r=x(H,d),s=v(d);return(0,h.useFocusGuards)(),(0,b.jsx)(i.FocusScope,{asChild:!0,loop:!0,trapped:e,onMountAutoFocus:f,onUnmountAutoFocus:j,children:(0,b.jsx)(g.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:m,onPointerDownOutside:n,onFocusOutside:o,onDismiss:()=>r.onOpenChange(!1),children:(0,b.jsx)(k.Content,{"data-state":Q(r.open),role:"dialog",id:r.contentId,...s,...q,ref:c,style:{...q.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),N="PopoverClose",O=c.forwardRef((a,c)=>{let{__scopePopover:e,...f}=a,g=x(N,e);return(0,b.jsx)(n.Primitive.button,{type:"button",...f,ref:c,onClick:(0,d.composeEventHandlers)(a.onClick,()=>g.onOpenChange(!1))})});O.displayName=N;var P=c.forwardRef((a,c)=>{let{__scopePopover:d,...e}=a,f=v(d);return(0,b.jsx)(k.Arrow,{...f,...e,ref:c})});function Q(a){return a?"open":"closed"}P.displayName="PopoverArrow",a.s(["Anchor",()=>A,"Arrow",()=>P,"Close",()=>O,"Content",()=>I,"Popover",()=>y,"PopoverAnchor",()=>A,"PopoverArrow",()=>P,"PopoverClose",()=>O,"PopoverContent",()=>I,"PopoverPortal",()=>G,"PopoverTrigger",()=>C,"Portal",()=>G,"Root",()=>y,"Trigger",()=>C,"createPopoverScope",()=>u],61452);var R=a.i(61452),R=R,S=a.i(85536);let T=R.Root,U=R.Trigger;R.Anchor;let V=c.forwardRef(({className:a,align:c="center",sideOffset:d=4,...e},f)=>(0,b.jsx)(R.Portal,{children:(0,b.jsx)(R.Content,{ref:f,align:c,sideOffset:d,className:(0,S.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",a),...e})}));V.displayName=R.Content.displayName,a.s(["Popover",()=>T,"PopoverContent",()=>V,"PopoverTrigger",()=>U],80646)},30107,24675,a=>{"use strict";var b=a.i(25674);let c=(0,b.createServerReference)("00d8ab91b12fe2c2a0230d654e91e0f37a9e3537cc",b.callServer,void 0,b.findSourceMapURL,"getAllAgentModels");a.s(["getAllAgentModels",()=>c],30107);let d=(0,b.createServerReference)("60882fc5232724771be6ae2282671baa7ab052b5e8",b.callServer,void 0,b.findSourceMapURL,"updateAgentAndModel");a.s(["updateAgentAndModel",()=>d],24675)},96867,61781,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(59653),e=a.i(6175),f=a.i(7420),g=a.i(17329),h=a.i(64005),i=a.i(74432),j=a.i(66873),k="Switch",[l,m]=(0,f.createContextScope)(k),[n,o]=l(k),p=c.forwardRef((a,f)=>{let{__scopeSwitch:h,name:i,checked:l,defaultChecked:m,required:o,disabled:p,value:q="on",onCheckedChange:r,form:u,...v}=a,[w,x]=c.useState(null),y=(0,e.useComposedRefs)(f,a=>x(a)),z=c.useRef(!1),A=!w||u||!!w.closest("form"),[B,C]=(0,g.useControllableState)({prop:l,defaultProp:m??!1,onChange:r,caller:k});return(0,b.jsxs)(n,{scope:h,checked:B,disabled:p,children:[(0,b.jsx)(j.Primitive.button,{type:"button",role:"switch","aria-checked":B,"aria-required":o,"data-state":t(B),"data-disabled":p?"":void 0,disabled:p,value:q,...v,ref:y,onClick:(0,d.composeEventHandlers)(a.onClick,a=>{C(a=>!a),A&&(z.current=a.isPropagationStopped(),z.current||a.stopPropagation())})}),A&&(0,b.jsx)(s,{control:w,bubbles:!z.current,name:i,value:q,checked:B,required:o,disabled:p,form:u,style:{transform:"translateX(-100%)"}})]})});p.displayName=k;var q="SwitchThumb",r=c.forwardRef((a,c)=>{let{__scopeSwitch:d,...e}=a,f=o(q,d);return(0,b.jsx)(j.Primitive.span,{"data-state":t(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:c})});r.displayName=q;var s=c.forwardRef(({__scopeSwitch:a,control:d,checked:f,bubbles:g=!0,...j},k)=>{let l=c.useRef(null),m=(0,e.useComposedRefs)(l,k),n=(0,h.usePrevious)(f),o=(0,i.useSize)(d);return c.useEffect(()=>{let a=l.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(n!==f&&b){let c=new Event("click",{bubbles:g});b.call(a,f),a.dispatchEvent(c)}},[n,f,g]),(0,b.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:f,...j,tabIndex:-1,ref:m,style:{...j.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function t(a){return a?"checked":"unchecked"}s.displayName="SwitchBubbleInput",a.s(["Root",()=>p,"Switch",()=>p,"SwitchThumb",()=>r,"Thumb",()=>r,"createSwitchScope",()=>m],91918);var u=a.i(91918),u=u,v=a.i(85536);function w({className:a,size:c="default",...d}){return(0,b.jsx)(u.Root,{"data-slot":"switch","data-size":c,className:(0,v.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",a),...d,children:(0,b.jsx)(u.Thumb,{"data-slot":"switch-thumb",className:(0,v.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}a.s(["Switch",()=>w],96867);var x=a.i(72016),y=a.i(94132),z=a.i(3410),A=a.i(30107),B=a.i(24675),C=a.i(17606),D=a.i(83852),E=a.i(18948),F=a.i(80646);function G({initialAgentType:a,initialModel:d,onAgentModelChange:e,disabled:f,className:g,mode:h}){let[i,j]=c.useState(!1),[k,l]=c.useState([]),[m,n]=c.useState(!0),[o,p]=c.useState(a),[q,r]=c.useState(d),[s,t]=c.useState(null),[u,w]=c.useState(0),[G,H]=c.useState(null);c.useEffect(()=>{(0,A.getAllAgentModels)().then(l).finally(()=>n(!1))},[]),c.useEffect(()=>{if(!i){let a=setTimeout(()=>{w(0),H(null)},150);return()=>clearTimeout(a)}},[i]);let I=async(a,b)=>{if(j(!1),a!==o||b!==q){if("override"===h){p(a),r(b),e?.(a,b);return}p(a),r(b),e?.(a,b),t(null);try{let c=await (0,B.updateAgentAndModel)(a,b||null);c.ok||(p(o),r(q),e?.(o,q),t(c.error??"Failed to save"))}catch{p(o),r(q),e?.(o,q),t("Failed to save")}}},J=(0,C.getAgentTypeIcon)(o),K=k.find(a=>a.agentType===o)?.label??o,L=q?(0,D.getModelMeta)(q).displayName||q:null,M=G?k.find(a=>a.agentType===G):null;return(0,b.jsxs)("div",{className:(0,v.cn)("flex flex-col gap-1",g),children:[(0,b.jsxs)(F.Popover,{open:i,onOpenChange:j,children:[(0,b.jsx)(F.PopoverTrigger,{asChild:!0,children:(0,b.jsx)(E.Button,{variant:"outline",role:"combobox","aria-expanded":i,disabled:(f??!1)||m,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,b.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,b.jsx)(J,{className:"h-4 w-4 shrink-0"}),m?"Loading…":(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:K}),L?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,b.jsx)("span",{className:"text-xs font-medium",children:L})]}):null]})]})})}),(0,b.jsx)(F.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,b.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===u?"-50%":"0%"})`,width:"200%"},children:[(0,b.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,b.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(a=>{let c=(0,C.getAgentTypeIcon)(a.agentType),d=o===a.agentType,e=a.models.length>0;return(0,b.jsxs)("button",{type:"button",className:(0,v.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",d&&"bg-accent/50"),onClick:()=>{e?(H(a.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>w(1))})):I(a.agentType,"")},children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-left",children:a.label}),d&&!e?(0,b.jsx)(x.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,e?(0,b.jsx)(z.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},a.agentType)})]}),(0,b.jsx)("div",{className:"w-1/2 shrink-0",children:M?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{w(0),setTimeout(()=>H(null),220)},children:[(0,b.jsx)(y.ChevronLeft,{className:"h-3.5 w-3.5"}),M.label]}),M.models.map(a=>{let c=o===M.agentType&&q===a.id;return(0,b.jsxs)("button",{type:"button",className:(0,v.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",c&&"bg-accent/50"),onClick:()=>I(M.agentType,a.id),children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:a.displayName}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description})]}),c?(0,b.jsx)(x.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},a.id)})]}):null})]})})]}),!!s&&(0,b.jsx)("p",{className:"text-destructive text-sm",children:s})]})}a.s(["AgentModelPicker",()=>G],61781)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=src_presentation_web_9183c7fa._.js.map
|