@shepai/cli 1.153.0 → 1.154.0-pr479.ab1d6e4
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 +1 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +1 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +1 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +4 -0
- 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 +22 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.js +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts +65 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/codex-cli-executor.service.js +655 -0
- package/dist/packages/core/src/infrastructure/services/agents/sessions/codex-cli-session.repository.d.ts +62 -0
- package/dist/packages/core/src/infrastructure/services/agents/sessions/codex-cli-session.repository.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/sessions/codex-cli-session.repository.js +353 -0
- package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.js +6 -5
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.js +52 -3
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts +6 -2
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/agent-select.prompt.js +7 -2
- 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 +4 -2
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.js +26 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.stories.js +21 -0
- 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 +2 -0
- 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 +1 -0
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +1 -0
- 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 +7 -0
- 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 +1 -0
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts +1 -0
- 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 +8 -0
- package/dist/src/presentation/web/lib/parse-log-line.d.ts +1 -1
- package/dist/src/presentation/web/lib/parse-log-line.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/parse-log-line.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -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 +3 -3
- package/web/.next/required-server-files.json +3 -3
- 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/chat/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +29 -29
- 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]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/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)/chat/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +29 -29
- 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]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/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 +5 -5
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- 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/api/interactive/chat/[featureId]/messages/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 +10 -10
- 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 +10 -10
- 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 +5 -5
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- 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]__beda892a._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__beda892a._.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/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +3 -3
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.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]__17ed7ed1._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.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]__42bf1807._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.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/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_3a0b989f._.js +2 -2
- package/web/.next/server/chunks/ssr/_3a0b989f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5f69c13f._.js +1 -1
- package/web/.next/server/chunks/ssr/_5f69c13f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_82c57f10._.js +1 -1
- package/web/.next/server/chunks/ssr/_82c57f10._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_9495d50b._.js +1 -1
- package/web/.next/server/chunks/ssr/_9495d50b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js +1 -1
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ac4a3873._.js +1 -1
- package/web/.next/server/chunks/ssr/{_75a563a9._.js → _c402d513._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_75a563a9._.js.map → _c402d513._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js +1 -1
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_cb5a021e._.js +1 -1
- package/web/.next/server/chunks/ssr/_cb5a021e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_65e76c9a._.js → _cca387dc._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_65e76c9a._.js.map → _cca387dc._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d86175ae._.js +1 -1
- package/web/.next/server/chunks/ssr/_d86175ae._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8bedf13._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8bedf13._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f9a4fecb._.js +3 -0
- package/web/.next/server/chunks/ssr/{_d9337063._.js.map → _f9a4fecb._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_fa7efce3._.js +2 -2
- package/web/.next/server/chunks/ssr/_fa7efce3._.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_cdc632e3.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.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_357e3eb0._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.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/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +45 -45
- package/web/.next/static/chunks/{ebdef1415f61f021.js → 0c9699ac344d7fdc.js} +1 -1
- package/web/.next/static/chunks/{11074feeacea0319.js → 0dc9ccd977e71ca5.js} +1 -1
- package/web/.next/static/chunks/{a0101660264c178b.js → 163a9b511f011413.js} +2 -2
- package/web/.next/static/chunks/{34417fd25d41b914.js → 295c8bae374d81d1.js} +1 -1
- package/web/.next/static/chunks/3435db49fb1d9ca1.js +5 -0
- package/web/.next/static/chunks/{2a54cf0384becb8f.js → 474262e5d0623ad7.js} +1 -1
- package/web/.next/static/chunks/{9c45b599460d0f60.js → 5137bba42f9f0471.js} +1 -1
- package/web/.next/static/chunks/8590bd2e69b24b9e.css +1 -0
- package/web/.next/static/chunks/{58adaad3bab50e74.js → 8a0f87eae02050b5.js} +2 -2
- package/web/.next/static/chunks/9d64ae99b767b638.js +1 -0
- package/web/.next/static/chunks/{634f6f485b81464a.js → bc9f980db72f59b7.js} +1 -1
- package/web/.next/static/chunks/df326fea0c719d06.js +1 -0
- package/web/.next/static/chunks/{51df7b00bbb7d365.js → f066634ebee801a2.js} +1 -1
- package/web/public/icons/agents/openai.svg +3 -0
- package/web/.next/server/chunks/ssr/_d9337063._.js +0 -3
- package/web/.next/static/chunks/18abd4f8b9c216a3.js +0 -1
- package/web/.next/static/chunks/8bbc916241b4c141.js +0 -1
- package/web/.next/static/chunks/b70bc188ac05a8be.js +0 -5
- package/web/.next/static/chunks/c86594475dcb03d5.css +0 -1
- /package/web/.next/static/{zY7W9Btxu_CXSFrwelXeS → jCFPs9oKV5JFhluhP5C1O}/_buildManifest.js +0 -0
- /package/web/.next/static/{zY7W9Btxu_CXSFrwelXeS → jCFPs9oKV5JFhluhP5C1O}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{zY7W9Btxu_CXSFrwelXeS → jCFPs9oKV5JFhluhP5C1O}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex CLI Session Repository
|
|
3
|
+
*
|
|
4
|
+
* Infrastructure implementation of IAgentSessionRepository for OpenAI Codex CLI.
|
|
5
|
+
* Reads JSONL session rollout files from `$CODEX_HOME/sessions/` (or `~/.codex/sessions/`
|
|
6
|
+
* when CODEX_HOME is not set) and the session index from `$CODEX_HOME/session_index.jsonl`.
|
|
7
|
+
*
|
|
8
|
+
* Directory structure:
|
|
9
|
+
* $CODEX_HOME/session_index.jsonl — one JSON object per line with {id, thread_name, updated_at}
|
|
10
|
+
* $CODEX_HOME/sessions/YYYY/MM/DD/rollout-<timestamp>-<session-id>.jsonl
|
|
11
|
+
*
|
|
12
|
+
* Rollout file events:
|
|
13
|
+
* - session_meta: session metadata (id, cwd, cli_version, model_provider)
|
|
14
|
+
* - event_msg: lifecycle events (task_started, etc.)
|
|
15
|
+
* - response_item: messages (role: user/assistant/developer), function_call, function_call_output
|
|
16
|
+
* - turn_context: per-turn context (cwd, model, sandbox_policy)
|
|
17
|
+
*/
|
|
18
|
+
import type { AgentSession } from '../../../../domain/generated/output.js';
|
|
19
|
+
import type { IAgentSessionRepository, ListSessionsOptions, GetSessionOptions } from '../../../../application/ports/output/agents/agent-session-repository.interface.js';
|
|
20
|
+
export declare class CodexCliSessionRepository implements IAgentSessionRepository {
|
|
21
|
+
private readonly basePath;
|
|
22
|
+
constructor(basePath?: string);
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the Codex home directory.
|
|
25
|
+
* Uses CODEX_HOME env var if set, otherwise defaults to ~/.codex
|
|
26
|
+
*/
|
|
27
|
+
static resolveCodexHome(): string;
|
|
28
|
+
isSupported(): boolean;
|
|
29
|
+
list(options?: ListSessionsOptions): Promise<AgentSession[]>;
|
|
30
|
+
findById(id: string, options?: GetSessionOptions): Promise<AgentSession | null>;
|
|
31
|
+
/** Read and parse the session_index.jsonl file */
|
|
32
|
+
private readSessionIndex;
|
|
33
|
+
/** Convert a session index entry to a lightweight AgentSession */
|
|
34
|
+
private indexEntryToSession;
|
|
35
|
+
/**
|
|
36
|
+
* Recursively collect all rollout .jsonl files from the sessions/ directory.
|
|
37
|
+
* Structure: sessions/YYYY/MM/DD/rollout-<timestamp>-<id>.jsonl
|
|
38
|
+
*/
|
|
39
|
+
private collectSessionFiles;
|
|
40
|
+
/** Recursively walk a directory tree collecting .jsonl rollout files */
|
|
41
|
+
private walkDirectory;
|
|
42
|
+
/**
|
|
43
|
+
* Extract session ID from a rollout filename.
|
|
44
|
+
* Format: rollout-YYYY-MM-DDTHH-MM-SS-<session-id>.jsonl
|
|
45
|
+
* The session ID is the UUID portion after the timestamp.
|
|
46
|
+
*/
|
|
47
|
+
private extractSessionIdFromFilename;
|
|
48
|
+
/**
|
|
49
|
+
* Find a session rollout file by ID.
|
|
50
|
+
* Scans the sessions/ directory recursively for a file containing the given ID.
|
|
51
|
+
*/
|
|
52
|
+
private findSessionFile;
|
|
53
|
+
/**
|
|
54
|
+
* Parse a Codex CLI rollout JSONL file into an AgentSession.
|
|
55
|
+
*/
|
|
56
|
+
private parseRolloutFile;
|
|
57
|
+
/** Extract text from Codex content blocks */
|
|
58
|
+
private extractTextFromContent;
|
|
59
|
+
/** Replace home directory prefix with ~ */
|
|
60
|
+
private abbreviatePath;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=codex-cli-session.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-cli-session.repository.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/sessions/codex-cli-session.repository.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,mFAAmF,CAAC;AA0C3F,qBACa,yBAA0B,YAAW,uBAAuB;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,GAAE,MAAqD;IAE5F;;;OAGG;IACH,MAAM,CAAC,gBAAgB,IAAI,MAAM;IAIjC,WAAW,IAAI,OAAO;IAIhB,IAAI,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IA8C5D,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAmBrF,kDAAkD;YACpC,gBAAgB;IAoB9B,kEAAkE;IAClE,OAAO,CAAC,mBAAmB;IAa3B;;;OAGG;YACW,mBAAmB;IAajC,wEAAwE;YAC1D,aAAa;IAsC3B;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IASpC;;;OAGG;YACW,eAAe;IAqB7B;;OAEG;YACW,gBAAgB;IA8H9B,6CAA6C;IAC7C,OAAO,CAAC,sBAAsB;IAW9B,2CAA2C;IAC3C,OAAO,CAAC,cAAc;CAQvB"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex CLI Session Repository
|
|
3
|
+
*
|
|
4
|
+
* Infrastructure implementation of IAgentSessionRepository for OpenAI Codex CLI.
|
|
5
|
+
* Reads JSONL session rollout files from `$CODEX_HOME/sessions/` (or `~/.codex/sessions/`
|
|
6
|
+
* when CODEX_HOME is not set) and the session index from `$CODEX_HOME/session_index.jsonl`.
|
|
7
|
+
*
|
|
8
|
+
* Directory structure:
|
|
9
|
+
* $CODEX_HOME/session_index.jsonl — one JSON object per line with {id, thread_name, updated_at}
|
|
10
|
+
* $CODEX_HOME/sessions/YYYY/MM/DD/rollout-<timestamp>-<session-id>.jsonl
|
|
11
|
+
*
|
|
12
|
+
* Rollout file events:
|
|
13
|
+
* - session_meta: session metadata (id, cwd, cli_version, model_provider)
|
|
14
|
+
* - event_msg: lifecycle events (task_started, etc.)
|
|
15
|
+
* - response_item: messages (role: user/assistant/developer), function_call, function_call_output
|
|
16
|
+
* - turn_context: per-turn context (cwd, model, sandbox_policy)
|
|
17
|
+
*/
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
25
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
26
|
+
};
|
|
27
|
+
var CodexCliSessionRepository_1;
|
|
28
|
+
import * as fs from 'node:fs/promises';
|
|
29
|
+
import * as os from 'node:os';
|
|
30
|
+
import * as path from 'node:path';
|
|
31
|
+
import { injectable } from 'tsyringe';
|
|
32
|
+
let CodexCliSessionRepository = CodexCliSessionRepository_1 = class CodexCliSessionRepository {
|
|
33
|
+
basePath;
|
|
34
|
+
constructor(basePath = CodexCliSessionRepository_1.resolveCodexHome()) {
|
|
35
|
+
this.basePath = basePath;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the Codex home directory.
|
|
39
|
+
* Uses CODEX_HOME env var if set, otherwise defaults to ~/.codex
|
|
40
|
+
*/
|
|
41
|
+
static resolveCodexHome() {
|
|
42
|
+
return process.env.CODEX_HOME ?? path.join(os.homedir(), '.codex');
|
|
43
|
+
}
|
|
44
|
+
isSupported() {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
async list(options) {
|
|
48
|
+
const limit = options?.limit ?? 20;
|
|
49
|
+
// First try the session index for fast listing
|
|
50
|
+
const indexEntries = await this.readSessionIndex();
|
|
51
|
+
if (indexEntries.length > 0) {
|
|
52
|
+
// Deduplicate: keep the latest entry per session ID
|
|
53
|
+
const latestById = new Map();
|
|
54
|
+
for (const entry of indexEntries) {
|
|
55
|
+
latestById.set(entry.id, entry);
|
|
56
|
+
}
|
|
57
|
+
// Sort by updated_at descending
|
|
58
|
+
const sorted = [...latestById.values()].sort((a, b) => {
|
|
59
|
+
const aTime = a.updated_at ? new Date(a.updated_at).getTime() : 0;
|
|
60
|
+
const bTime = b.updated_at ? new Date(b.updated_at).getTime() : 0;
|
|
61
|
+
return bTime - aTime;
|
|
62
|
+
});
|
|
63
|
+
const toReturn = limit > 0 ? sorted.slice(0, limit) : sorted;
|
|
64
|
+
// Build lightweight sessions from index (no need to parse full rollout files)
|
|
65
|
+
return toReturn.map((entry) => this.indexEntryToSession(entry));
|
|
66
|
+
}
|
|
67
|
+
// Fallback: scan rollout files directly
|
|
68
|
+
const fileInfos = await this.collectSessionFiles();
|
|
69
|
+
fileInfos.sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
|
|
70
|
+
const toParse = limit > 0 ? fileInfos.slice(0, limit) : fileInfos;
|
|
71
|
+
const parseResults = await Promise.allSettled(toParse.map((fi) => this.parseRolloutFile(fi, { includeMessages: false })));
|
|
72
|
+
const sessions = [];
|
|
73
|
+
for (const result of parseResults) {
|
|
74
|
+
if (result.status === 'fulfilled' && result.value !== null) {
|
|
75
|
+
sessions.push(result.value);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return sessions;
|
|
79
|
+
}
|
|
80
|
+
async findById(id, options) {
|
|
81
|
+
const messageLimit = options?.messageLimit ?? 20;
|
|
82
|
+
const match = await this.findSessionFile(id);
|
|
83
|
+
if (match === null)
|
|
84
|
+
return null;
|
|
85
|
+
try {
|
|
86
|
+
const stat = await fs.stat(match.filePath);
|
|
87
|
+
const fileInfo = {
|
|
88
|
+
id: match.resolvedId,
|
|
89
|
+
filePath: match.filePath,
|
|
90
|
+
mtime: stat.mtime,
|
|
91
|
+
};
|
|
92
|
+
return await this.parseRolloutFile(fileInfo, { includeMessages: true, messageLimit });
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** Read and parse the session_index.jsonl file */
|
|
99
|
+
async readSessionIndex() {
|
|
100
|
+
const indexPath = path.join(this.basePath, 'session_index.jsonl');
|
|
101
|
+
try {
|
|
102
|
+
const content = await fs.readFile(indexPath, 'utf-8');
|
|
103
|
+
const entries = [];
|
|
104
|
+
for (const line of content.split('\n')) {
|
|
105
|
+
const trimmed = line.trim();
|
|
106
|
+
if (!trimmed)
|
|
107
|
+
continue;
|
|
108
|
+
try {
|
|
109
|
+
entries.push(JSON.parse(trimmed));
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Skip malformed lines
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return entries;
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Convert a session index entry to a lightweight AgentSession */
|
|
122
|
+
indexEntryToSession(entry) {
|
|
123
|
+
const updatedAt = entry.updated_at ? new Date(entry.updated_at) : new Date();
|
|
124
|
+
return {
|
|
125
|
+
id: entry.id,
|
|
126
|
+
agentType: 'codex-cli',
|
|
127
|
+
projectPath: '',
|
|
128
|
+
messageCount: 0,
|
|
129
|
+
createdAt: updatedAt,
|
|
130
|
+
updatedAt,
|
|
131
|
+
preview: entry.thread_name,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Recursively collect all rollout .jsonl files from the sessions/ directory.
|
|
136
|
+
* Structure: sessions/YYYY/MM/DD/rollout-<timestamp>-<id>.jsonl
|
|
137
|
+
*/
|
|
138
|
+
async collectSessionFiles() {
|
|
139
|
+
const sessionsDir = path.join(this.basePath, 'sessions');
|
|
140
|
+
const fileInfos = [];
|
|
141
|
+
try {
|
|
142
|
+
await this.walkDirectory(sessionsDir, fileInfos);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// sessions directory doesn't exist
|
|
146
|
+
}
|
|
147
|
+
return fileInfos;
|
|
148
|
+
}
|
|
149
|
+
/** Recursively walk a directory tree collecting .jsonl rollout files */
|
|
150
|
+
async walkDirectory(dir, results) {
|
|
151
|
+
let entries;
|
|
152
|
+
try {
|
|
153
|
+
entries = await fs.readdir(dir, { withFileTypes: true, encoding: 'utf-8' });
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const promises = [];
|
|
159
|
+
for (const entry of entries) {
|
|
160
|
+
const fullPath = path.join(dir, entry.name);
|
|
161
|
+
if (entry.isDirectory()) {
|
|
162
|
+
promises.push(this.walkDirectory(fullPath, results));
|
|
163
|
+
}
|
|
164
|
+
else if (entry.isFile() &&
|
|
165
|
+
entry.name.endsWith('.jsonl') &&
|
|
166
|
+
entry.name.startsWith('rollout-')) {
|
|
167
|
+
promises.push(fs
|
|
168
|
+
.stat(fullPath)
|
|
169
|
+
.then((stat) => {
|
|
170
|
+
const sessionId = this.extractSessionIdFromFilename(entry.name);
|
|
171
|
+
if (sessionId) {
|
|
172
|
+
results.push({ id: sessionId, filePath: fullPath, mtime: stat.mtime });
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
.catch(() => {
|
|
176
|
+
// Skip files we can't stat
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
await Promise.allSettled(promises);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Extract session ID from a rollout filename.
|
|
184
|
+
* Format: rollout-YYYY-MM-DDTHH-MM-SS-<session-id>.jsonl
|
|
185
|
+
* The session ID is the UUID portion after the timestamp.
|
|
186
|
+
*/
|
|
187
|
+
extractSessionIdFromFilename(filename) {
|
|
188
|
+
// rollout-2026-03-24T12-25-16-019d1f60-95de-7141-a648-e3e2fe3da012.jsonl
|
|
189
|
+
// The UUID starts after the timestamp prefix (rollout-YYYY-MM-DDTHH-MM-SS-)
|
|
190
|
+
const withoutExt = filename.replace(/\.jsonl$/, '');
|
|
191
|
+
// Match: rollout-<date>T<time>-<uuid>
|
|
192
|
+
const match = withoutExt.match(/^rollout-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-(.+)$/);
|
|
193
|
+
return match ? match[1] : null;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Find a session rollout file by ID.
|
|
197
|
+
* Scans the sessions/ directory recursively for a file containing the given ID.
|
|
198
|
+
*/
|
|
199
|
+
async findSessionFile(id) {
|
|
200
|
+
const fileInfos = await this.collectSessionFiles();
|
|
201
|
+
// Exact match first
|
|
202
|
+
for (const fi of fileInfos) {
|
|
203
|
+
if (fi.id === id) {
|
|
204
|
+
return { filePath: fi.filePath, resolvedId: fi.id };
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Prefix match
|
|
208
|
+
const matches = fileInfos.filter((fi) => fi.id.startsWith(id));
|
|
209
|
+
if (matches.length === 1) {
|
|
210
|
+
return { filePath: matches[0].filePath, resolvedId: matches[0].id };
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Parse a Codex CLI rollout JSONL file into an AgentSession.
|
|
216
|
+
*/
|
|
217
|
+
async parseRolloutFile(fileInfo, options) {
|
|
218
|
+
const content = await fs.readFile(fileInfo.filePath, 'utf-8');
|
|
219
|
+
const lines = content.split('\n').filter((l) => l.trim().length > 0);
|
|
220
|
+
let cwd;
|
|
221
|
+
let firstMessageAt;
|
|
222
|
+
let lastMessageAt;
|
|
223
|
+
let preview;
|
|
224
|
+
let messageCount = 0;
|
|
225
|
+
const messages = [];
|
|
226
|
+
for (const line of lines) {
|
|
227
|
+
let entry;
|
|
228
|
+
try {
|
|
229
|
+
entry = JSON.parse(line);
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
const type = entry.type;
|
|
235
|
+
const timestamp = entry.timestamp ? new Date(entry.timestamp) : fileInfo.mtime;
|
|
236
|
+
if (type === 'session_meta') {
|
|
237
|
+
const payload = entry.payload;
|
|
238
|
+
if (payload?.cwd)
|
|
239
|
+
cwd = payload.cwd;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
if (type === 'turn_context') {
|
|
243
|
+
// Use turn context cwd as fallback
|
|
244
|
+
if (!cwd && entry.payload?.cwd)
|
|
245
|
+
cwd = entry.payload.cwd;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (type === 'response_item') {
|
|
249
|
+
const payload = entry.payload;
|
|
250
|
+
if (!payload)
|
|
251
|
+
continue;
|
|
252
|
+
// Only count user and assistant messages (skip developer/system)
|
|
253
|
+
if (payload.type === 'message' &&
|
|
254
|
+
(payload.role === 'user' || payload.role === 'assistant')) {
|
|
255
|
+
messageCount++;
|
|
256
|
+
firstMessageAt ??= timestamp;
|
|
257
|
+
lastMessageAt = timestamp;
|
|
258
|
+
// Extract preview from first user message
|
|
259
|
+
if (payload.role === 'user' && preview === undefined) {
|
|
260
|
+
preview = this.extractTextFromContent(payload.content);
|
|
261
|
+
}
|
|
262
|
+
if (options.includeMessages) {
|
|
263
|
+
messages.push({
|
|
264
|
+
uuid: entry.payload?.call_id ?? `${fileInfo.id}-${messageCount}`,
|
|
265
|
+
role: payload.role,
|
|
266
|
+
content: this.extractTextFromContent(payload.content),
|
|
267
|
+
timestamp,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Count function calls as part of conversation but don't add as messages
|
|
272
|
+
if (payload.type === 'function_call') {
|
|
273
|
+
messageCount++;
|
|
274
|
+
lastMessageAt = timestamp;
|
|
275
|
+
if (options.includeMessages) {
|
|
276
|
+
const toolName = payload.name ?? 'unknown_tool';
|
|
277
|
+
messages.push({
|
|
278
|
+
uuid: payload.call_id ?? `${fileInfo.id}-${messageCount}`,
|
|
279
|
+
role: 'assistant',
|
|
280
|
+
content: `[tool: ${toolName}] ${payload.arguments ?? ''}`,
|
|
281
|
+
timestamp,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (payload.type === 'function_call_output') {
|
|
286
|
+
lastMessageAt = timestamp;
|
|
287
|
+
if (options.includeMessages) {
|
|
288
|
+
const output = payload.output ?? '';
|
|
289
|
+
const truncated = output.length > 500 ? `${output.slice(0, 497)}...` : output;
|
|
290
|
+
messages.push({
|
|
291
|
+
uuid: payload.call_id ?? `${fileInfo.id}-result-${messageCount}`,
|
|
292
|
+
role: 'assistant',
|
|
293
|
+
content: `[tool-result] ${truncated}`,
|
|
294
|
+
timestamp,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (cwd === undefined) {
|
|
301
|
+
// Can't determine project path — too sparse
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
let messagesToReturn = messages;
|
|
305
|
+
if (options.includeMessages && options.messageLimit !== undefined && options.messageLimit > 0) {
|
|
306
|
+
messagesToReturn = messages.slice(-options.messageLimit);
|
|
307
|
+
}
|
|
308
|
+
const session = {
|
|
309
|
+
id: fileInfo.id,
|
|
310
|
+
agentType: 'codex-cli',
|
|
311
|
+
projectPath: this.abbreviatePath(cwd),
|
|
312
|
+
messageCount,
|
|
313
|
+
createdAt: firstMessageAt ?? fileInfo.mtime,
|
|
314
|
+
updatedAt: lastMessageAt ?? fileInfo.mtime,
|
|
315
|
+
};
|
|
316
|
+
if (preview !== undefined)
|
|
317
|
+
session.preview = preview;
|
|
318
|
+
if (firstMessageAt !== undefined)
|
|
319
|
+
session.firstMessageAt = firstMessageAt;
|
|
320
|
+
if (lastMessageAt !== undefined)
|
|
321
|
+
session.lastMessageAt = lastMessageAt;
|
|
322
|
+
if (options.includeMessages)
|
|
323
|
+
session.messages = messagesToReturn;
|
|
324
|
+
return session;
|
|
325
|
+
}
|
|
326
|
+
/** Extract text from Codex content blocks */
|
|
327
|
+
extractTextFromContent(content) {
|
|
328
|
+
if (!content || !Array.isArray(content))
|
|
329
|
+
return '';
|
|
330
|
+
const parts = [];
|
|
331
|
+
for (const block of content) {
|
|
332
|
+
if ((block.type === 'input_text' || block.type === 'output_text') && block.text) {
|
|
333
|
+
parts.push(block.text);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return parts.join('\n');
|
|
337
|
+
}
|
|
338
|
+
/** Replace home directory prefix with ~ */
|
|
339
|
+
abbreviatePath(filePath) {
|
|
340
|
+
const home = os.homedir();
|
|
341
|
+
if (filePath === home)
|
|
342
|
+
return '~';
|
|
343
|
+
if (filePath.startsWith(`${home}${path.sep}`)) {
|
|
344
|
+
return `~${filePath.slice(home.length)}`;
|
|
345
|
+
}
|
|
346
|
+
return filePath;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
CodexCliSessionRepository = CodexCliSessionRepository_1 = __decorate([
|
|
350
|
+
injectable(),
|
|
351
|
+
__metadata("design:paramtypes", [String])
|
|
352
|
+
], CodexCliSessionRepository);
|
|
353
|
+
export { CodexCliSessionRepository };
|
package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAmC,MAAM,oBAAoB,CAAC;AAK5E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAiCzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AA0CD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,EAAE,CAAkC;gBAEhC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAIxC;;;;;;;;;;;;OAYG;IACH,UAAU,IAAI,IAAI;IAqFlB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAmC,MAAM,oBAAoB,CAAC;AAK5E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAiCzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AA0CD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,EAAE,CAAkC;gBAEhC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAIxC;;;;;;;;;;;;OAYG;IACH,UAAU,IAAI,IAAI;IAqFlB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,IAAI;IA8H5E;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IA4CpD;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0D3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAef;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI;IAM5C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI1D;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAM3D,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,MAAM;IAed,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YA4Dd,aAAa;IAW3B,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;YACW,kBAAkB;IAsChC;;;OAGG;IACH,OAAO,CAAC,SAAS;CAwBlB"}
|
|
@@ -188,14 +188,15 @@ export class DeploymentService {
|
|
|
188
188
|
throw new Error(detection.error);
|
|
189
189
|
}
|
|
190
190
|
// Build spawn args based on package manager
|
|
191
|
-
const { packageManager, scriptName, command, needsInstall } = detection;
|
|
191
|
+
const { packageManager, scriptName, command, needsInstall, resolvedDir } = detection;
|
|
192
|
+
const spawnDir = resolvedDir;
|
|
192
193
|
const args = packageManager === 'npm' ? ['run', scriptName] : [scriptName];
|
|
193
194
|
// Install dependencies if node_modules is missing (e.g. fresh worktree)
|
|
194
195
|
if (needsInstall) {
|
|
195
|
-
log.info(`node_modules missing in "${
|
|
196
|
+
log.info(`node_modules missing in "${spawnDir}" — running ${packageManager} install`);
|
|
196
197
|
try {
|
|
197
198
|
execFileSync(packageManager, ['install'], {
|
|
198
|
-
cwd:
|
|
199
|
+
cwd: spawnDir,
|
|
199
200
|
shell: true,
|
|
200
201
|
stdio: 'ignore',
|
|
201
202
|
...(IS_WINDOWS ? { windowsHide: true } : {}),
|
|
@@ -207,10 +208,10 @@ export class DeploymentService {
|
|
|
207
208
|
throw new Error(`Failed to install dependencies: ${err}`);
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
log.info(`Spawning dev server: command="${command}", packageManager="${packageManager}", scriptName="${scriptName}", cwd="${
|
|
211
|
+
log.info(`Spawning dev server: command="${command}", packageManager="${packageManager}", scriptName="${scriptName}", cwd="${spawnDir}"`);
|
|
211
212
|
const child = this.deps.spawn(packageManager, args, {
|
|
212
213
|
shell: true,
|
|
213
|
-
cwd:
|
|
214
|
+
cwd: spawnDir,
|
|
214
215
|
// On Unix, detached: true creates a process group via setsid() so we can
|
|
215
216
|
// kill the entire tree with process.kill(-pid). On Windows this flag causes
|
|
216
217
|
// CREATE_NEW_CONSOLE which opens a visible terminal window and disconnects
|
|
@@ -11,6 +11,8 @@ export interface DetectDevScriptSuccess {
|
|
|
11
11
|
scriptName: string;
|
|
12
12
|
command: string;
|
|
13
13
|
needsInstall: boolean;
|
|
14
|
+
/** The directory where package.json was found (may differ from input when scanning subdirs) */
|
|
15
|
+
resolvedDir: string;
|
|
14
16
|
}
|
|
15
17
|
export interface DetectDevScriptError {
|
|
16
18
|
success: false;
|
package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,+FAA+F;IAC/F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAetE"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* scripts (dev, start, serve), and detects the package manager from lockfile
|
|
6
6
|
* presence. Returns the detected command or an error.
|
|
7
7
|
*/
|
|
8
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
8
|
+
import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { createDeploymentLogger } from './deployment-logger.js';
|
|
11
11
|
/** Script names to search for, in priority order */
|
|
@@ -25,6 +25,23 @@ const log = createDeploymentLogger('[detectDevScript]');
|
|
|
25
25
|
*/
|
|
26
26
|
export function detectDevScript(dirPath) {
|
|
27
27
|
log.info(`scanning dirPath="${dirPath}"`);
|
|
28
|
+
// Try the given directory first
|
|
29
|
+
const directResult = detectDevScriptInDir(dirPath);
|
|
30
|
+
if (directResult.success)
|
|
31
|
+
return directResult;
|
|
32
|
+
// Fallback: scan immediate subdirectories for a package.json with a dev script.
|
|
33
|
+
// This handles monorepos and projects where the app lives in a subdirectory
|
|
34
|
+
// (e.g., worktree root has no package.json but `site/` or `app/` does).
|
|
35
|
+
log.info(`no dev script at root, scanning subdirectories of "${dirPath}"`);
|
|
36
|
+
const subdirResult = scanSubdirectories(dirPath);
|
|
37
|
+
if (subdirResult)
|
|
38
|
+
return subdirResult;
|
|
39
|
+
return directResult;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Attempt detection in a single directory.
|
|
43
|
+
*/
|
|
44
|
+
function detectDevScriptInDir(dirPath) {
|
|
28
45
|
// Read and parse package.json
|
|
29
46
|
let packageJson;
|
|
30
47
|
try {
|
|
@@ -51,8 +68,40 @@ export function detectDevScript(dirPath) {
|
|
|
51
68
|
// Build the command — pnpm/yarn use `<pm> <script>`, npm uses `npm run <script>`
|
|
52
69
|
const command = packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
|
|
53
70
|
const needsInstall = !existsSync(join(dirPath, 'node_modules'));
|
|
54
|
-
log.info(`detected — packageManager="${packageManager}", scriptName="${scriptName}", command="${command}", needsInstall=${needsInstall}`);
|
|
55
|
-
return { success: true, packageManager, scriptName, command, needsInstall };
|
|
71
|
+
log.info(`detected — packageManager="${packageManager}", scriptName="${scriptName}", command="${command}", needsInstall=${needsInstall}, resolvedDir="${dirPath}"`);
|
|
72
|
+
return { success: true, packageManager, scriptName, command, needsInstall, resolvedDir: dirPath };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Scan immediate subdirectories for a package.json with a dev script.
|
|
76
|
+
* Skips hidden dirs, node_modules, and common non-project directories.
|
|
77
|
+
*/
|
|
78
|
+
function scanSubdirectories(dirPath) {
|
|
79
|
+
const SKIP_DIRS = new Set(['node_modules', '.git', '.next', 'dist', 'build', 'out', '.cache']);
|
|
80
|
+
let entries;
|
|
81
|
+
try {
|
|
82
|
+
entries = readdirSync(dirPath);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
for (const entry of entries) {
|
|
88
|
+
if (entry.startsWith('.') || SKIP_DIRS.has(entry))
|
|
89
|
+
continue;
|
|
90
|
+
const subPath = join(dirPath, entry);
|
|
91
|
+
try {
|
|
92
|
+
if (!statSync(subPath).isDirectory())
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const result = detectDevScriptInDir(subPath);
|
|
99
|
+
if (result.success) {
|
|
100
|
+
log.info(`found dev script in subdirectory "${entry}" — resolvedDir="${subPath}"`);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
56
105
|
}
|
|
57
106
|
/**
|
|
58
107
|
* Detect the package manager by checking for lockfile presence.
|
|
@@ -8,8 +8,8 @@ import { AgentType } from '../../../../packages/core/src/domain/generated/output
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates the @inquirer/select configuration for selecting an AI coding agent.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* disabled with a "Coming Soon" badge.
|
|
11
|
+
* Active agents are selectable. Agents not yet implemented are shown
|
|
12
|
+
* as disabled with a "Coming Soon" badge.
|
|
13
13
|
*/
|
|
14
14
|
export declare function createAgentSelectConfig(): {
|
|
15
15
|
readonly message: "Select your AI coding agent";
|
|
@@ -21,6 +21,10 @@ export declare function createAgentSelectConfig(): {
|
|
|
21
21
|
readonly name: "Gemini CLI";
|
|
22
22
|
readonly value: AgentType.GeminiCli;
|
|
23
23
|
readonly description: "Google Gemini CLI";
|
|
24
|
+
}, {
|
|
25
|
+
readonly name: "Codex CLI";
|
|
26
|
+
readonly value: AgentType.CodexCli;
|
|
27
|
+
readonly description: "OpenAI's Codex CLI terminal agent (GPT models)";
|
|
24
28
|
}, {
|
|
25
29
|
readonly name: "Cursor";
|
|
26
30
|
readonly value: AgentType.Cursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-select.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/agent-select.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,uBAAuB
|
|
1
|
+
{"version":3,"file":"agent-select.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/agent-select.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CtC"}
|
|
@@ -9,8 +9,8 @@ import { shepTheme } from '../themes/shep.theme.js';
|
|
|
9
9
|
/**
|
|
10
10
|
* Creates the @inquirer/select configuration for selecting an AI coding agent.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* disabled with a "Coming Soon" badge.
|
|
12
|
+
* Active agents are selectable. Agents not yet implemented are shown
|
|
13
|
+
* as disabled with a "Coming Soon" badge.
|
|
14
14
|
*/
|
|
15
15
|
export function createAgentSelectConfig() {
|
|
16
16
|
return {
|
|
@@ -26,6 +26,11 @@ export function createAgentSelectConfig() {
|
|
|
26
26
|
value: AgentType.GeminiCli,
|
|
27
27
|
description: 'Google Gemini CLI',
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Codex CLI',
|
|
31
|
+
value: AgentType.CodexCli,
|
|
32
|
+
description: "OpenAI's Codex CLI terminal agent (GPT models)",
|
|
33
|
+
},
|
|
29
34
|
{
|
|
30
35
|
name: 'Cursor',
|
|
31
36
|
value: AgentType.Cursor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-all-agent-models.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-all-agent-models.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"get-all-agent-models.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-all-agent-models.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAmBD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CA+BpE"}
|
|
@@ -3,6 +3,7 @@ import { resolve } from '../../lib/server-container.js';
|
|
|
3
3
|
import { getModelMeta } from '../../lib/model-metadata.js';
|
|
4
4
|
const AGENT_LABELS = {
|
|
5
5
|
'claude-code': 'Claude Code',
|
|
6
|
+
'codex-cli': 'Codex CLI',
|
|
6
7
|
cursor: 'Cursor CLI',
|
|
7
8
|
'gemini-cli': 'Gemini CLI',
|
|
8
9
|
dev: 'Demo',
|
|
@@ -10,8 +11,9 @@ const AGENT_LABELS = {
|
|
|
10
11
|
/** Sort weight — higher = further down. Demo always last. */
|
|
11
12
|
const AGENT_ORDER = {
|
|
12
13
|
'claude-code': 0,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
'codex-cli': 1,
|
|
15
|
+
cursor: 2,
|
|
16
|
+
'gemini-cli': 3,
|
|
15
17
|
dev: 99,
|
|
16
18
|
};
|
|
17
19
|
export async function getAllAgentModels() {
|
package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-log-viewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-log-viewer.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.tsx"],"names":[],"mappings":"AA2BA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,mBAAmB,kDAa9D"}
|