specrails-desktop 2.61.0 → 2.62.0
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/client/dist/assets/ActivityFeedPage-C_pqc281.js +1 -0
- package/client/dist/assets/{AgentBrowserCapture-CkNWDZT3.js → AgentBrowserCapture-vz6rbDtu.js} +1 -1
- package/client/dist/assets/AgentModeAnalyticsPane-BHCcUahS.js +2 -0
- package/client/dist/assets/AgentModeCodePane-DhmxgG3W.js +2 -0
- package/client/dist/assets/{AgentModeJobsPane-U1J6PaBo.js → AgentModeJobsPane-99fBBLri.js} +1 -1
- package/client/dist/assets/{AgentsPage-CXrqu5vo.js → AgentsPage-CTwm_6T8.js} +3 -3
- package/client/dist/assets/{AnalyticsPage-Cvtt-LOO.js → AnalyticsPage-YD8MLoPa.js} +1 -1
- package/client/dist/assets/CodePage-CLJn2F2e.js +3 -0
- package/client/dist/assets/{DesktopAnalyticsPage-CsDFy5rp.js → DesktopAnalyticsPage-MWGQVbwp.js} +1 -1
- package/client/dist/assets/{DocsDialog-CSlMPemn.js → DocsDialog-XUCYKoq0.js} +1 -1
- package/client/dist/assets/{DocsPage-BKlYAvWq.js → DocsPage-dOLC8bXA.js} +1 -1
- package/client/dist/assets/{ExportDropdown-CweP_1GP.js → ExportDropdown-BvKQgwM9.js} +1 -1
- package/client/dist/assets/InteractiveJobComposer-DxOvwmBF.js +19 -0
- package/client/dist/assets/{JobDetailModal-DYyGq1Vp.js → JobDetailModal-CkiubrkZ.js} +1 -1
- package/client/dist/assets/JobDetailPage-CNe4Wn7l.js +1 -0
- package/client/dist/assets/JobsPage-DSts_L_d.js +1 -0
- package/client/dist/assets/LoopBuilderPage-C9D9eer5.js +1 -0
- package/client/dist/assets/{LoopPreviewModal-DkLRfsYX.js → LoopPreviewModal-Dv3dxHr_.js} +1 -1
- package/client/dist/assets/{LoopWindowSurface-CuACkXFV.js → LoopWindowSurface-DN2lbSnL.js} +1 -1
- package/client/dist/assets/{LoopsPage-ClSrWzDd.js → LoopsPage-DHgIreEW.js} +2 -2
- package/client/dist/assets/MinimizedChatsContext-Ds2-R6qJ.js +1 -0
- package/client/dist/assets/PluginsPage-D1EJ9oja.js +2 -0
- package/client/dist/assets/ProjectSettingsDialog-DKpa1wKk.js +1 -0
- package/client/dist/assets/{RepositoryDeliveries-DJCm1pZr.js → RepositoryDeliveries-CW4eKG3x.js} +1 -1
- package/client/dist/assets/{RepositoryScopeSelector-CeCr6Jz-.js → RepositoryScopeSelector-DrtPqvc_.js} +1 -1
- package/client/dist/assets/ReviewPacketPage-BtjPI0Cc.js +4 -0
- package/client/dist/assets/{TemplatePreviewModal-B8yd1AGU.js → TemplatePreviewModal-DcFlhUxy.js} +1 -1
- package/client/dist/assets/TicketDetailModalContext-Dea22CI-.js +16 -0
- package/client/dist/assets/{Trans-D5eOjfvG.js → Trans-CAY2Rd2f.js} +1 -1
- package/client/dist/assets/agent-5bSixVzz.js +1 -0
- package/client/dist/assets/agent-BR4EHfhq.js +1 -0
- package/client/dist/assets/agent-C0IKkJP8.js +1 -0
- package/client/dist/assets/agent-C7li9ayC.js +1 -0
- package/client/dist/assets/agent-D0dRmEen.js +1 -0
- package/client/dist/assets/{agent-BjttZLIl.js → agent-DZVGHm7H.js} +1 -1
- package/client/dist/assets/agent-Dip4h2YE.js +1 -0
- package/client/dist/assets/agent-Pp-P-n1p.js +1 -0
- package/client/dist/assets/ban-E4EaZe3a.js +1 -0
- package/client/dist/assets/chevron-up-CwGUHd6D.js +1 -0
- package/client/dist/assets/dist-Bq10nS2m.js +1 -0
- package/client/dist/assets/{formatDistanceToNow-DZ3VWsHq.js → formatDistanceToNow-DlQY1Lm_.js} +1 -1
- package/client/dist/assets/{getTimezoneOffsetInMilliseconds-9JiGlFrx.js → getTimezoneOffsetInMilliseconds-COUeq65G.js} +1 -1
- package/client/dist/assets/index-BacrO_ub.css +2 -0
- package/client/dist/assets/index-CONHvEJw.js +83 -0
- package/client/dist/assets/{jira-api-Bp0zXwjg.js → jira-api-C94VNHNY.js} +1 -1
- package/client/dist/assets/layers-eDMjG41I.js +1 -0
- package/client/dist/assets/{project-repositories-CadLZOnr.js → project-repositories-Cc3oNv8X.js} +1 -1
- package/client/dist/assets/save-B6wGWwBR.js +1 -0
- package/client/dist/assets/{settings-Dn-pXukr.js → settings-BKJZ2KEM.js} +1 -1
- package/client/dist/assets/{settings-BBj_kZaD.js → settings-BV3jocIx.js} +1 -1
- package/client/dist/assets/{settings-COlH_P33.js → settings-BjM2Dw8_.js} +1 -1
- package/client/dist/assets/settings-CKu0LTib.js +1 -0
- package/client/dist/assets/{settings-D77mC_Lb.js → settings-DA77M48m.js} +1 -1
- package/client/dist/assets/{settings-ByVE7jdZ.js → settings-LfFnl1UH.js} +1 -1
- package/client/dist/assets/{settings-DZKy7MqN.js → settings-P1IQvhnL.js} +1 -1
- package/client/dist/assets/{settings-B5Hy_Kol.js → settings-eIMJjyK_.js} +1 -1
- package/client/dist/assets/{spending-DQDNtM8q.js → spending-DemeFfrH.js} +1 -1
- package/client/dist/assets/{useDesktop-DKNbOF0u.js → useDesktop-9Lwoel_8.js} +1 -1
- package/client/dist/assets/{useRuntimeRuns-D3YMw9qx.js → useRuntimeRuns-DL0xYoZ2.js} +1 -1
- package/client/dist/assets/{useSharedWebSocket-DaWuiO0S.js → useSharedWebSocket-BEHPeU1Y.js} +2 -2
- package/client/dist/assets/zap-CHo3aCD1.js +1 -0
- package/client/dist/index.html +23 -19
- package/docs/guide/de/integrations/6-agent-chat.md +11 -0
- package/docs/guide/en/integrations/6-agent-chat.md +11 -0
- package/docs/guide/es/integrations/6-agent-chat.md +11 -0
- package/docs/guide/fr/integrations/6-agent-chat.md +11 -0
- package/docs/guide/it/integrations/6-agent-chat.md +11 -0
- package/docs/guide/ja/integrations/6-agent-chat.md +11 -0
- package/docs/guide/pt/integrations/6-agent-chat.md +11 -0
- package/docs/guide/zh/integrations/6-agent-chat.md +11 -0
- package/docs/internals/README.md +1 -0
- package/docs/internals/agent-sessions.md +157 -0
- package/docs/internals/api-reference.md +33 -4
- package/docs/internals/configuration.md +34 -0
- package/docs/internals/core-runtime-updates.md +10 -3
- package/docs/internals/operations-runbook.md +11 -0
- package/docs/internals/programmatic-agent-runtime.md +1 -1
- package/docs/internals/source-map.md +40 -1
- package/mcp-bridge/dist/specrails-mcp.js +82 -15
- package/package.json +1 -1
- package/server/dist/agent-mcp-config.js +41 -0
- package/server/dist/core-compat.js +2 -0
- package/server/dist/desktop-db.js +101 -4
- package/server/dist/desktop-router.js +31 -2
- package/server/dist/index.js +58 -0
- package/server/dist/mcp/tools/app-settings.js +11 -0
- package/server/dist/mcp/tools/mission.js +45 -2
- package/server/dist/mcp/tools/specs.js +2 -2
- package/server/dist/modules/accounting/runtime/result-event.js +9 -1
- package/server/dist/modules/agent-runtime/runtime/agent-runtime-controls.js +25 -0
- package/server/dist/modules/agent-sessions/adapters/host-process.js +73 -0
- package/server/dist/modules/agent-sessions/adapters/http.js +31 -0
- package/server/dist/modules/agent-sessions/adapters/rpc-client.js +147 -0
- package/server/dist/modules/agent-sessions/application/session-event-pump.js +99 -0
- package/server/dist/modules/agent-sessions/domain/availability.js +25 -0
- package/server/dist/modules/agent-sessions/domain/errors.js +23 -0
- package/server/dist/modules/agent-sessions/domain/host-state.js +80 -0
- package/server/dist/modules/agent-sessions/domain/projection.js +147 -0
- package/server/dist/modules/agent-sessions/domain/protocol.js +59 -0
- package/server/dist/modules/agent-sessions/domain/subagent-policy.js +34 -0
- package/server/dist/modules/agent-sessions/index.js +31 -0
- package/server/dist/modules/agent-sessions/ports.js +2 -0
- package/server/dist/modules/agent-sessions/runtime/core-sessions-availability.js +43 -0
- package/server/dist/modules/agent-sessions/runtime/session-host-registry.js +226 -0
- package/server/dist/modules/agents/runtime/agent-store.js +3 -1
- package/server/dist/modules/loops/runtime/loop-implement-recipe.js +15 -4
- package/server/dist/modules/loops/runtime/loop-run-manager.js +4 -0
- package/server/dist/modules/missions/runtime/agent-chat-manager.js +137 -40
- package/server/dist/modules/missions/runtime/agent-chat-router.js +68 -0
- package/server/dist/modules/missions/runtime/agent-operator-prompt.js +8 -9
- package/server/dist/modules/missions/runtime/agent-session-store.js +133 -0
- package/server/dist/modules/missions/runtime/core-session-runner.js +204 -0
- package/server/dist/modules/missions/runtime/mission-core-sessions.js +286 -0
- package/server/dist/modules/missions/runtime/mission-session-projector.js +168 -0
- package/server/dist/modules/project-settings/adapters/http.js +14 -2
- package/server/dist/modules/project-settings/adapters/sqlite.js +30 -2
- package/server/dist/modules/project-settings/domain.js +24 -0
- package/server/dist/modules/project-settings/index.js +2 -1
- package/server/dist/modules/specs/runtime/spec-models.js +1 -1
- package/server/dist/plugins/codex-spawn.js +15 -7
- package/server/dist/project-registry.js +32 -0
- package/server/dist/project-router-settings.js +7 -1
- package/server/dist/providers/claude-adapter.js +6 -1
- package/client/dist/assets/ActivityFeedPage-Wi5XNgoG.js +0 -1
- package/client/dist/assets/AgentModeAnalyticsPane-CXz2j-Bt.js +0 -2
- package/client/dist/assets/AgentModeCodePane-DnsBPtpS.js +0 -2
- package/client/dist/assets/CodePage-D35o-MFO.js +0 -3
- package/client/dist/assets/InteractiveJobComposer-CFKvbQeJ.js +0 -19
- package/client/dist/assets/JobDetailPage-C6gpdYvj.js +0 -1
- package/client/dist/assets/JobsPage-CgS0pnKd.js +0 -1
- package/client/dist/assets/LoopBuilderPage-jUp20DSZ.js +0 -1
- package/client/dist/assets/MinimizedChatsContext-CroAs6Kh.js +0 -1
- package/client/dist/assets/PluginsPage-nCKQOwRL.js +0 -2
- package/client/dist/assets/ProjectSettingsDialog-BVDYwllU.js +0 -1
- package/client/dist/assets/ReviewPacketPage-kTErrEjx.js +0 -4
- package/client/dist/assets/TicketDetailModalContext-YBJX3RmP.js +0 -16
- package/client/dist/assets/agent--8QAfoXL.js +0 -1
- package/client/dist/assets/agent-3HxXkIWX.js +0 -1
- package/client/dist/assets/agent-CpFCz32T.js +0 -1
- package/client/dist/assets/agent-DVnw6ybO.js +0 -1
- package/client/dist/assets/agent-Z5s_GTP0.js +0 -1
- package/client/dist/assets/agent-hv57-zyG.js +0 -1
- package/client/dist/assets/agent-xGrZ_aN1.js +0 -1
- package/client/dist/assets/index-Bfunvi6w.css +0 -2
- package/client/dist/assets/index-lTGJJTuk.js +0 -83
- package/client/dist/assets/save-OsUqVn99.js +0 -1
- package/client/dist/assets/settings-Dbyd6gmj.js +0 -1
- package/client/dist/assets/zap-CUOlvtT1.js +0 -1
|
@@ -3,14 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerProjectSettingsHttp = registerProjectSettingsHttp;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
/** Inbound adapter: translate HTTP into use cases and domain errors into HTTP. */
|
|
6
|
-
function registerProjectSettingsHttp(router, serviceForRequest
|
|
6
|
+
function registerProjectSettingsHttp(router, serviceForRequest,
|
|
7
|
+
/** Observer for committed changes (e.g. open agent sessions re-reading policy). */
|
|
8
|
+
onUpdated) {
|
|
7
9
|
router.get('/:projectId/settings', (req, res) => {
|
|
8
10
|
res.json(serviceForRequest(req).getSettings());
|
|
9
11
|
});
|
|
10
12
|
router.patch('/:projectId/settings', (req, res) => {
|
|
11
13
|
try {
|
|
12
|
-
const
|
|
14
|
+
const service = serviceForRequest(req);
|
|
15
|
+
const previous = onUpdated ? service.getSettings() : null;
|
|
16
|
+
const settings = service.updateSettings(req.body);
|
|
13
17
|
res.json({ ok: true, settings });
|
|
18
|
+
if (onUpdated && previous) {
|
|
19
|
+
try {
|
|
20
|
+
onUpdated(req, settings, previous);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error('[project-router] settings observer error:', error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
14
26
|
}
|
|
15
27
|
catch (error) {
|
|
16
28
|
if (error instanceof __1.SettingsValidationError) {
|
|
@@ -18,13 +18,25 @@ function parseWorktreeEnvPassthrough(raw) {
|
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
/** A stored value that no longer parses (hand-edited, older shape) reads as "same as the mission agent". */
|
|
22
|
+
function readSubagentRuntime(raw) {
|
|
23
|
+
if (!raw)
|
|
24
|
+
return null;
|
|
25
|
+
try {
|
|
26
|
+
return (0, domain_1.parseSubagentRuntimeSetting)(JSON.parse(raw));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
21
32
|
function getProjectSettings(db) {
|
|
22
|
-
// Read the settings as one snapshot instead of preparing
|
|
33
|
+
// Read the settings as one snapshot instead of preparing separate queries.
|
|
23
34
|
const rows = db.prepare(`
|
|
24
35
|
SELECT key, value FROM queue_state WHERE key IN (
|
|
25
36
|
'config.pipeline_telemetry_enabled', 'config.orchestrator_model',
|
|
26
37
|
'config.pre_prompt', 'config.freestyle_pre_prompt',
|
|
27
|
-
'config.integration_branch', 'config.worktree_env_passthrough'
|
|
38
|
+
'config.integration_branch', 'config.worktree_env_passthrough',
|
|
39
|
+
'config.allow_subagents', 'config.subagent_runtime'
|
|
28
40
|
)
|
|
29
41
|
`).all();
|
|
30
42
|
const settings = new Map(rows.map(row => [row.key, row]));
|
|
@@ -42,6 +54,8 @@ function getProjectSettings(db) {
|
|
|
42
54
|
freestylePrePrompt: freestylePrePromptRow?.value ?? '',
|
|
43
55
|
integrationBranch: integrationBranchRow?.value ?? '',
|
|
44
56
|
worktreeEnvPassthrough: parseWorktreeEnvPassthrough(worktreeEnvPassthroughRow?.value),
|
|
57
|
+
allowSubagents: settings.get('config.allow_subagents')?.value === 'true',
|
|
58
|
+
subagentRuntime: readSubagentRuntime(settings.get('config.subagent_runtime')?.value),
|
|
45
59
|
};
|
|
46
60
|
}
|
|
47
61
|
/** Resolve the effective Freestyle pre-prompt: the per-project override when
|
|
@@ -81,6 +95,20 @@ function updateProjectSettings(db, patch) {
|
|
|
81
95
|
db.prepare(`INSERT OR REPLACE INTO queue_state (key, value) VALUES ('config.integration_branch', ?)`).run(patch.integrationBranch.trim());
|
|
82
96
|
}
|
|
83
97
|
}
|
|
98
|
+
if (patch.allowSubagents !== undefined) {
|
|
99
|
+
if (patch.allowSubagents) {
|
|
100
|
+
db.prepare(`INSERT OR REPLACE INTO queue_state (key, value) VALUES ('config.allow_subagents', 'true')`).run();
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
db.prepare(`DELETE FROM queue_state WHERE key = 'config.allow_subagents'`).run();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (patch.subagentRuntime !== undefined) {
|
|
107
|
+
if (patch.subagentRuntime === null)
|
|
108
|
+
db.prepare(`DELETE FROM queue_state WHERE key = 'config.subagent_runtime'`).run();
|
|
109
|
+
else
|
|
110
|
+
db.prepare(`INSERT OR REPLACE INTO queue_state (key, value) VALUES ('config.subagent_runtime', ?)`).run(JSON.stringify(patch.subagentRuntime));
|
|
111
|
+
}
|
|
84
112
|
if (patch.worktreeEnvPassthrough !== undefined) {
|
|
85
113
|
const names = (0, domain_1.normalizeWorktreeEnvPassthrough)(patch.worktreeEnvPassthrough);
|
|
86
114
|
if (names.length === 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SettingsValidationError = exports.WORKTREE_ENV_NAME_RE = exports.DEFAULT_FREESTYLE_PRE_PROMPT = void 0;
|
|
4
|
+
exports.parseSubagentRuntimeSetting = parseSubagentRuntimeSetting;
|
|
4
5
|
exports.normalizeWorktreeEnvPassthrough = normalizeWorktreeEnvPassthrough;
|
|
5
6
|
exports.parseProjectSettingsPatch = parseProjectSettingsPatch;
|
|
6
7
|
const git_branch_name_1 = require("../../shared/git-branch-name");
|
|
@@ -18,6 +19,22 @@ exports.DEFAULT_FREESTYLE_PRE_PROMPT = [
|
|
|
18
19
|
'Never ask for confirmation; there is no human to answer. Choose the recommended option and proceed.',
|
|
19
20
|
'Run every command in the FOREGROUND and wait for it to finish — never background a command (no run_in_background, no trailing `&`): your reply ends the step and anything still running is killed with its output lost.',
|
|
20
21
|
].join('\n');
|
|
22
|
+
const PROVIDER_ID_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
23
|
+
/** Strict shape check shared by project and app settings; null clears the choice. */
|
|
24
|
+
function parseSubagentRuntimeSetting(value) {
|
|
25
|
+
if (value === null)
|
|
26
|
+
return null;
|
|
27
|
+
const input = value;
|
|
28
|
+
if (!input || typeof input !== 'object' || Array.isArray(input))
|
|
29
|
+
throw new SettingsValidationError('subagentRuntime must be an object or null');
|
|
30
|
+
if (typeof input.provider !== 'string' || !PROVIDER_ID_RE.test(input.provider))
|
|
31
|
+
throw new SettingsValidationError('subagentRuntime.provider must be a provider id');
|
|
32
|
+
if (typeof input.model !== 'string' || !input.model.trim() || input.model.length > 200)
|
|
33
|
+
throw new SettingsValidationError('subagentRuntime.model must be a model name');
|
|
34
|
+
if (input.effort !== undefined && input.effort !== null && (typeof input.effort !== 'string' || !input.effort.trim() || input.effort.length > 50))
|
|
35
|
+
throw new SettingsValidationError('subagentRuntime.effort must be an effort level or null');
|
|
36
|
+
return { provider: input.provider, model: input.model.trim(), effort: typeof input.effort === 'string' ? input.effort.trim() : null };
|
|
37
|
+
}
|
|
21
38
|
exports.WORKTREE_ENV_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
22
39
|
const WORKTREE_ENV_MAX_NAMES = 64;
|
|
23
40
|
const WORKTREE_ENV_MAX_NAME_LENGTH = 128;
|
|
@@ -82,6 +99,13 @@ function parseProjectSettingsPatch(input) {
|
|
|
82
99
|
throw new SettingsValidationError(error instanceof Error ? error.message : 'invalid worktreeEnvPassthrough');
|
|
83
100
|
}
|
|
84
101
|
}
|
|
102
|
+
if (values.subagentRuntime !== undefined)
|
|
103
|
+
patch.subagentRuntime = parseSubagentRuntimeSetting(values.subagentRuntime);
|
|
104
|
+
if (values.allowSubagents !== undefined) {
|
|
105
|
+
if (typeof values.allowSubagents !== 'boolean')
|
|
106
|
+
throw new SettingsValidationError('allowSubagents must be a boolean');
|
|
107
|
+
patch.allowSubagents = values.allowSubagents;
|
|
108
|
+
}
|
|
85
109
|
if (values.integrationBranch !== undefined) {
|
|
86
110
|
const branch = values.integrationBranch;
|
|
87
111
|
if (typeof branch !== 'string')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SettingsValidationError = exports.normalizeWorktreeEnvPassthrough = exports.WORKTREE_ENV_NAME_RE = exports.DEFAULT_FREESTYLE_PRE_PROMPT = exports.createProjectSettingsService = void 0;
|
|
3
|
+
exports.SettingsValidationError = exports.parseSubagentRuntimeSetting = exports.normalizeWorktreeEnvPassthrough = exports.WORKTREE_ENV_NAME_RE = exports.DEFAULT_FREESTYLE_PRE_PROMPT = exports.createProjectSettingsService = void 0;
|
|
4
4
|
// Public application API. Infrastructure adapters are wired only at composition roots.
|
|
5
5
|
var application_1 = require("./application");
|
|
6
6
|
Object.defineProperty(exports, "createProjectSettingsService", { enumerable: true, get: function () { return application_1.createProjectSettingsService; } });
|
|
@@ -8,4 +8,5 @@ var domain_1 = require("./domain");
|
|
|
8
8
|
Object.defineProperty(exports, "DEFAULT_FREESTYLE_PRE_PROMPT", { enumerable: true, get: function () { return domain_1.DEFAULT_FREESTYLE_PRE_PROMPT; } });
|
|
9
9
|
Object.defineProperty(exports, "WORKTREE_ENV_NAME_RE", { enumerable: true, get: function () { return domain_1.WORKTREE_ENV_NAME_RE; } });
|
|
10
10
|
Object.defineProperty(exports, "normalizeWorktreeEnvPassthrough", { enumerable: true, get: function () { return domain_1.normalizeWorktreeEnvPassthrough; } });
|
|
11
|
+
Object.defineProperty(exports, "parseSubagentRuntimeSetting", { enumerable: true, get: function () { return domain_1.parseSubagentRuntimeSetting; } });
|
|
11
12
|
Object.defineProperty(exports, "SettingsValidationError", { enumerable: true, get: function () { return domain_1.SettingsValidationError; } });
|
|
@@ -9,7 +9,7 @@ exports.CLAUDE_MODELS = [
|
|
|
9
9
|
{ value: 'sonnet', label: 'Sonnet 5.5' },
|
|
10
10
|
{ value: 'fable', label: 'Fable 5.1' },
|
|
11
11
|
{ value: 'opus', label: 'Claude Opus' },
|
|
12
|
-
{ value: 'haiku', label: 'Claude Haiku' },
|
|
12
|
+
{ value: 'haiku', label: 'Claude Haiku 5.5' },
|
|
13
13
|
];
|
|
14
14
|
exports.CODEX_MODELS = [
|
|
15
15
|
{ value: 'gpt-6.1-sol', label: 'GPT-6.1 Sol' },
|
|
@@ -3,18 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveCodexPluginMcpServers = resolveCodexPluginMcpServers;
|
|
6
7
|
exports.buildCodexPluginArgs = buildCodexPluginArgs;
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const manager_1 = require("./manager");
|
|
9
|
-
/**
|
|
10
|
+
/** MCP servers of app-installed plugins active for this Codex invocation. The
|
|
10
11
|
* legacy per-project CODEX_HOME is an install record, not the provider's
|
|
11
12
|
* runtime home: switching HOME would discard the user's login and settings. */
|
|
12
|
-
function
|
|
13
|
+
function resolveCodexPluginMcpServers(options) {
|
|
13
14
|
if (options.providerId !== 'codex')
|
|
14
15
|
return [];
|
|
15
16
|
const manager = (0, manager_1.getPluginManager)();
|
|
16
17
|
const state = manager.getProjectState(options.stateRoot);
|
|
17
|
-
const
|
|
18
|
+
const servers = [];
|
|
18
19
|
for (const [name, installed] of Object.entries(state.plugins ?? {})) {
|
|
19
20
|
if (!installed || typeof installed !== 'object')
|
|
20
21
|
continue;
|
|
@@ -30,7 +31,6 @@ function buildCodexPluginArgs(options) {
|
|
|
30
31
|
// owned keys or overwrite Specrails' authenticated bridge.
|
|
31
32
|
if (keys.length !== 1 || !/^[A-Za-z][A-Za-z0-9_-]*$/.test(keys[0]) || keys[0] === 'specrails')
|
|
32
33
|
continue;
|
|
33
|
-
const server = keys[0];
|
|
34
34
|
const serverArgs = [...entry.args];
|
|
35
35
|
// Serena's '.' must mean this invocation's source/worktree, even when
|
|
36
36
|
// the CLI starts in an app-managed conversation or artifact directory.
|
|
@@ -39,9 +39,17 @@ function buildCodexPluginArgs(options) {
|
|
|
39
39
|
if (project >= 0)
|
|
40
40
|
serverArgs[project + 1] = path_1.default.resolve(options.repositoryPath);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
servers.push({ name: keys[0], command: entry.command, args: serverArgs, ...(entry.env && Object.keys(entry.env).length ? { env: { ...entry.env } } : {}) });
|
|
43
|
+
}
|
|
44
|
+
return servers;
|
|
45
|
+
}
|
|
46
|
+
/** Materialize app-installed plugins in a spawned Codex CLI invocation. */
|
|
47
|
+
function buildCodexPluginArgs(options) {
|
|
48
|
+
const args = [];
|
|
49
|
+
for (const server of resolveCodexPluginMcpServers(options)) {
|
|
50
|
+
const prefix = `mcp_servers.${server.name}`;
|
|
51
|
+
args.push('-c', `${prefix}.command=${JSON.stringify(server.command)}`, '-c', `${prefix}.args=${JSON.stringify(server.args)}`, '-c', `${prefix}.enabled=true`);
|
|
52
|
+
for (const [key, value] of Object.entries(server.env ?? {})) {
|
|
45
53
|
args.push('-c', `${prefix}.env.${JSON.stringify(key)}=${JSON.stringify(value)}`);
|
|
46
54
|
}
|
|
47
55
|
}
|
|
@@ -110,6 +110,9 @@ class ProjectRegistry {
|
|
|
110
110
|
// M9: projects whose per-project DB failed to load at startup (corrupt, locked,
|
|
111
111
|
// or migration-stuck). They stay registered but have no live context.
|
|
112
112
|
_failedProjects;
|
|
113
|
+
/** Settings that running agent sessions depend on changed (`projectId: null` = app-global). */
|
|
114
|
+
_settingsListeners = new Set();
|
|
115
|
+
_removalListeners = new Set();
|
|
113
116
|
_loadRetryTimers = new Map();
|
|
114
117
|
_shuttingDown = false;
|
|
115
118
|
// App-wide shared browser context for "Add Spec from a website": ONE persistent
|
|
@@ -443,6 +446,35 @@ class ProjectRegistry {
|
|
|
443
446
|
}
|
|
444
447
|
this._failedProjects.delete(id);
|
|
445
448
|
(0, desktop_db_1.removeProject)(this._desktopDb, id);
|
|
449
|
+
if (persistedProject) {
|
|
450
|
+
for (const listener of this._removalListeners) {
|
|
451
|
+
try {
|
|
452
|
+
listener({ id, slug: persistedProject.slug });
|
|
453
|
+
}
|
|
454
|
+
catch (err) {
|
|
455
|
+
console.error('[project-registry] project removal listener failed (non-fatal):', err);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
/** Observe project removal (e.g. to stop the project's Core session host). */
|
|
461
|
+
onSettingsChanged(listener) {
|
|
462
|
+
this._settingsListeners.add(listener);
|
|
463
|
+
return () => { this._settingsListeners.delete(listener); };
|
|
464
|
+
}
|
|
465
|
+
notifySettingsChanged(scope) {
|
|
466
|
+
for (const listener of this._settingsListeners) {
|
|
467
|
+
try {
|
|
468
|
+
listener(scope);
|
|
469
|
+
}
|
|
470
|
+
catch (error) {
|
|
471
|
+
console.error('[project-registry] settings listener failed:', error);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
onProjectRemoved(listener) {
|
|
476
|
+
this._removalListeners.add(listener);
|
|
477
|
+
return () => { this._removalListeners.delete(listener); };
|
|
446
478
|
}
|
|
447
479
|
getContext(id) {
|
|
448
480
|
return this._contexts.get(id);
|
|
@@ -29,7 +29,13 @@ function registerSettingsRoutes(deps) {
|
|
|
29
29
|
(0, agent_runtime_controls_router_1.registerAgentRuntimeControlRoutes)(deps);
|
|
30
30
|
const { router, registry, ctx } = deps;
|
|
31
31
|
// ─── Project settings (pipeline telemetry) ───────────────────────────────────
|
|
32
|
-
(0, http_1.registerProjectSettingsHttp)(router, req => (0, project_settings_1.createProjectSettingsService)((0, sqlite_1.createSqliteProjectSettingsRepository)(ctx(req).db))
|
|
32
|
+
(0, http_1.registerProjectSettingsHttp)(router, req => (0, project_settings_1.createProjectSettingsService)((0, sqlite_1.createSqliteProjectSettingsRepository)(ctx(req).db)),
|
|
33
|
+
// Open agent sessions of this project re-read their sub-agent policy.
|
|
34
|
+
(req, settings, previous) => {
|
|
35
|
+
const runtimeChanged = JSON.stringify(settings.subagentRuntime) !== JSON.stringify(previous.subagentRuntime);
|
|
36
|
+
if (settings.allowSubagents !== previous.allowSubagents || runtimeChanged)
|
|
37
|
+
registry.notifySettingsChanged({ projectId: String(req.params.projectId) });
|
|
38
|
+
});
|
|
33
39
|
// ─── Per-project Quick mode Contract Refine last-used value ─────────────────
|
|
34
40
|
router.get('/:projectId/add-spec-quick-contract-refine-last', (req, res) => {
|
|
35
41
|
res.json({
|
|
@@ -22,7 +22,7 @@ const CLAUDE_MODELS = [
|
|
|
22
22
|
{ value: 'sonnet', label: 'Sonnet 5.5', default: true },
|
|
23
23
|
{ value: 'fable', label: 'Fable 5.1' },
|
|
24
24
|
{ value: 'opus', label: 'Claude Opus 5.5' },
|
|
25
|
-
{ value: 'haiku', label: 'Claude Haiku' },
|
|
25
|
+
{ value: 'haiku', label: 'Claude Haiku 5.5' },
|
|
26
26
|
];
|
|
27
27
|
/** Mirror of ChatManager.normalizeClaudeCodeModel — pinned model strings the
|
|
28
28
|
* CLI accepts collapse to the short alias. */
|
|
@@ -44,6 +44,8 @@ function normaliseModel(model) {
|
|
|
44
44
|
case 'claude-opus-4-1-20250805':
|
|
45
45
|
case 'claude-opus-4-20250514':
|
|
46
46
|
return 'opus';
|
|
47
|
+
case 'claude-haiku-5-5':
|
|
48
|
+
case 'claude-haiku-5':
|
|
47
49
|
case 'claude-haiku-4-5-20251001':
|
|
48
50
|
case 'claude-3-5-haiku-20241022':
|
|
49
51
|
case 'claude-3-5-haiku-latest':
|
|
@@ -65,6 +67,7 @@ function normaliseModel(model) {
|
|
|
65
67
|
const PINNED_ALIAS_MODEL_IDS = {
|
|
66
68
|
sonnet: 'claude-sonnet-5-5',
|
|
67
69
|
opus: 'claude-opus-5-5',
|
|
70
|
+
haiku: 'claude-haiku-5-5',
|
|
68
71
|
};
|
|
69
72
|
/** Catalog value (or concrete id) in, spawn model id out. */
|
|
70
73
|
function resolveSpawnModel(model) {
|
|
@@ -482,6 +485,8 @@ exports.claudeAdapter = {
|
|
|
482
485
|
nativeOtelEnv: true,
|
|
483
486
|
profileEnvSupport: true,
|
|
484
487
|
systemPromptArg: true,
|
|
488
|
+
// Missions already run with --dangerously-skip-permissions; Specrails tiers gate actions.
|
|
489
|
+
sessionPermissions: 'bypass',
|
|
485
490
|
persistentStdin: true,
|
|
486
491
|
liveInputTransport: 'claude-stream-json',
|
|
487
492
|
supportsReasoningEffort: true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{h as r,r as i}from"./useSharedWebSocket-DaWuiO0S.js";import{n as a}from"./createLucideIcon-Bjbbp_KS.js";import{a as o,r as s}from"./useDesktop-DKNbOF0u.js";import{n as c,t as l}from"./zap-CUOlvtT1.js";import{t as u}from"./circle-x-CMYsN4ZH.js";import{t as d}from"./loader-circle-DcygOQpC.js";import{$t as f,Gt as p}from"./index-lTGJJTuk.js";var m=e(t(),1);function h(e){let t=new Set;return e.filter(e=>{let n=`${e.type}:${e.jobId}`;return t.has(n)?!1:(t.add(n),!0)})}function g({activeProjectId:e,limit:t=50}){let[n,a]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!0),d=(0,m.useRef)(e);(0,m.useEffect)(()=>{d.current=e},[e]);let{registerHandler:f,unregisterHandler:p}=i();(0,m.useEffect)(()=>{if(!e){a([]),u(!0);return}let n=!1;c(!0),a([]),u(!0);async function r(){let e=o();try{let r=await fetch(`${e}/activity?limit=${t}`);if(!r.ok||n)return;let i=await r.json();if(n)return;a(i),u(i.length===t)}catch{}finally{n||c(!1)}}return r(),()=>{n=!0}},[e,t]);let g=(0,m.useCallback)(async()=>{if(s||!l)return;c(!0);let e=o(),n=d.current;try{a(r=>{let i=r[r.length-1];if(!i)return r;let o=encodeURIComponent(i.timestamp);return fetch(`${e}/activity?limit=${t}&before=${o}`).then(e=>e.json()).then(e=>{if(d.current!==n){c(!1);return}a(t=>h([...t,...e])),u(e.length===t),c(!1)}).catch(()=>c(!1)),r})}catch{c(!1)}},[s,l,t]),_=(0,m.useCallback)(e=>{let t=e,n=d.current;if(!(!t||typeof t.type!=`string`)&&!(t.projectId&&t.projectId!==n)){if(t.type===`queue`&&Array.isArray(t.jobs)){let e=[];for(let n of t.jobs){let t=n.status===`completed`?`job_completed`:n.status===`failed`?`job_failed`:n.status===`canceled`?`job_canceled`:`job_started`;e.push({id:`${t}:${n.id}`,type:t,jobId:n.id,jobCommand:n.command??``,timestamp:n.startedAt??new Date().toISOString(),summary:`${t.replace(`_`,` `)}: ${n.command??``}`,costUsd:null})}e.length>0&&a(t=>h([...e,...t]))}if(t.type===`phase`&&t.phase&&t.state&&t.timestamp){let e={id:`phase:${t.phase}:${t.state}:${t.timestamp}`,type:`job_started`,jobId:`phase-${t.phase}`,jobCommand:r.t(`activity:feed.phaseCommand`,{phase:t.phase,state:t.state}),timestamp:t.timestamp,summary:`Phase ${t.phase} is ${t.state}`,costUsd:null};a(t=>h([e,...t]))}}},[]);return(0,m.useLayoutEffect)(()=>(f(`activity`,_),()=>p(`activity`)),[_,f,p]),{items:n,loading:s,hasMore:l,loadMore:g}}var _=n();function v(e,t){let n=Date.now()-new Date(e).getTime(),r=Math.floor(n/1e3);if(r<60)return t(`feed.relativeTime.seconds`,{value:r});let i=Math.floor(r/60);if(i<60)return t(`feed.relativeTime.minutes`,{value:i});let a=Math.floor(i/60);return a<24?t(`feed.relativeTime.hours`,{value:a}):t(`feed.relativeTime.days`,{value:Math.floor(a/24)})}function y({type:e}){switch(e){case`job_completed`:return(0,_.jsx)(p,{className:`w-4 h-4 text-green-500 aurora-light:text-accent-success flex-shrink-0`});case`job_failed`:return(0,_.jsx)(u,{className:`w-4 h-4 text-red-500 aurora-light:text-destructive flex-shrink-0`});case`job_canceled`:return(0,_.jsx)(c,{className:`w-4 h-4 text-muted-foreground flex-shrink-0`});default:return(0,_.jsx)(l,{className:`w-4 h-4 text-blue-500 aurora-light:text-accent-info flex-shrink-0`})}}function b(e,t){switch(e){case`job_completed`:return t(`common:status.completed`);case`job_failed`:return t(`common:status.failed`);case`job_canceled`:return t(`common:status.canceled`);default:return t(`feed.typeStarted`)}}function x(e){switch(e){case`job_completed`:return`text-green-500 aurora-light:text-accent-success`;case`job_failed`:return`text-red-500 aurora-light:text-destructive`;case`job_canceled`:return`text-muted-foreground`;default:return`text-blue-500 aurora-light:text-accent-info`}}function S(){let{t:e}=a(`activity`),{activeProjectId:t}=s(),{items:n,loading:r,hasMore:i,loadMore:o}=g({activeProjectId:t}),c=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=c.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&i&&!r&&o()},{threshold:.1});return t.observe(e),()=>t.disconnect()},[i,r,o]),(0,_.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border bg-background/50`,children:[(0,_.jsx)(f,{className:`w-4 h-4 text-muted-foreground`}),(0,_.jsx)(`h1`,{className:`text-sm font-medium`,children:e(`feed.title`)})]}),(0,_.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[r&&n.length===0?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-32`,children:(0,_.jsx)(d,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):n.length===0?(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-48 gap-2 text-muted-foreground`,children:[(0,_.jsx)(f,{className:`w-8 h-8 opacity-40`}),(0,_.jsx)(`p`,{className:`text-sm`,children:e(`feed.emptyTitle`)}),(0,_.jsx)(`p`,{className:`text-xs opacity-70`,children:e(`feed.emptyHint`)})]}):(0,_.jsx)(`ul`,{className:`divide-y divide-border/50`,children:n.map(t=>(0,_.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-2.5 hover:bg-accent/30 transition-colors`,children:[(0,_.jsx)(y,{type:t.type}),(0,_.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,_.jsx)(`p`,{className:`text-xs text-foreground truncate`,title:t.jobCommand,children:t.jobCommand}),(0,_.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,_.jsx)(`span`,{className:`text-xs font-medium ${x(t.type)}`,children:b(t.type,e)}),t.costUsd!=null&&(0,_.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`$`,t.costUsd.toFixed(4)]})]})]}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground flex-shrink-0 tabular-nums`,children:v(t.timestamp,e)})]},`${t.type}:${t.jobId}`))}),(0,_.jsx)(`div`,{ref:c,className:`h-1`}),r&&n.length>0&&(0,_.jsx)(`div`,{className:`flex justify-center py-3`,children:(0,_.jsx)(d,{className:`w-4 h-4 animate-spin text-muted-foreground`})}),!i&&n.length>0&&(0,_.jsx)(`p`,{className:`text-center text-xs text-muted-foreground py-3`,children:e(`feed.allLoaded`)})]})]})}export{S as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnalyticsPage-Cvtt-LOO.js","assets/rolldown-runtime-CNC7AqOf.js","assets/jsx-runtime-zu2_FqZY.js","assets/chunk-KS7C4IRE-DEKu087k.js","assets/preload-helper-Czpn1I53.js","assets/useSharedWebSocket-DaWuiO0S.js","assets/activity-DiyjsgQV.js","assets/addspec-BOvgmcgk.js","assets/agent-Z5s_GTP0.js","assets/agentRuntime-C_yLPKDy.js","assets/agents-Doe1sHY5.js","assets/agentstudio-BzugqB_N.js","assets/aiedit-iIjz2_Qk.js","assets/analytics-BWynXPEm.js","assets/attachments-B53PG733.js","assets/browser-CG0PE1j_.js","assets/builder-CpS9liE9.js","assets/chat-BGD7MXAy.js","assets/code-DaZ-ZwCT.js","assets/commands-BAWSYHjQ.js","assets/common-Bdi0qN4S.js","assets/dashboard-XGdQ5mjw.js","assets/explore-DgBACn39.js","assets/integrations-Dwl9KQp0.js","assets/jira-FXr7u2lh.js","assets/jobs-De3EqaO0.js","assets/loops-WyWDkhok.js","assets/mcp-CUAN6ORK.js","assets/narration-DbHnz0qV.js","assets/nav--u7iPYlS.js","assets/packet-B0H15elv.js","assets/settings-Dbyd6gmj.js","assets/setup-CKGUxKr-.js","assets/specs-DfIdoU5L.js","assets/subscriptionUsage-CdlE5Mg1.js","assets/terminal-BAzpHtpY.js","assets/tickets-D41ZMQpf.js","assets/createLucideIcon-Bjbbp_KS.js","assets/Trans-D5eOjfvG.js","assets/useDesktop-DKNbOF0u.js","assets/react-dom-DiWzBDP9.js","assets/provider-capabilities-lePfeT_Y.js","assets/spending-DQDNtM8q.js","assets/clsx-CjueKrWZ.js","assets/formatDistanceToNow-DZ3VWsHq.js","assets/getTimezoneOffsetInMilliseconds-9JiGlFrx.js","assets/index-lTGJJTuk.js","assets/tauri-shell-DE6LfGPw.js","assets/TicketDetailModalContext-YBJX3RmP.js","assets/save-OsUqVn99.js","assets/MinimizedChatsContext-CroAs6Kh.js","assets/sparkles-DrY8hb0X.js","assets/x-CBMI9ejn.js","assets/zap-CUOlvtT1.js","assets/file-text-BcLCfcWZ.js","assets/circle-x-CMYsN4ZH.js","assets/download-CFHyyHcw.js","assets/external-link-D6XxC_Cu.js","assets/git-branch-BRM0F5GN.js","assets/loader-circle-DcygOQpC.js","assets/pencil-C9RkrIPZ.js","assets/square-Ci-PFcFe.js","assets/plus-CsnjfkmX.js","assets/rotate-ccw-Wh4id13q.js","assets/search-Cq_gE3Ik.js","assets/trash-2-BOU3WdZZ.js","assets/triangle-alert-H9T4jAmh.js","assets/jira-api-Bp0zXwjg.js","assets/dialog-CMgps2MY.js","assets/utils-BC4DHlz2.js","assets/lib-CGdyxIWg.js","assets/button-D1xExSTF.js","assets/RepositoryScopeSelector-CeCr6Jz-.js","assets/project-repositories-CadLZOnr.js","assets/core-B3mKBIh5.js","assets/RepositoryDeliveries-DJCm1pZr.js","assets/useRuntimeRuns-D3YMw9qx.js","assets/event-Bt7f3wXe.js","assets/index-Bfunvi6w.css","assets/ExportDropdown-CweP_1GP.js","assets/BarChart-nBOMNfiy.js","assets/value-s-gzBeyF.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{n as i}from"./createLucideIcon-Bjbbp_KS.js";import{t as a}from"./loader-circle-DcygOQpC.js";import{t as o}from"./x-CBMI9ejn.js";import{t as s}from"./utils-BC4DHlz2.js";import{At as c,Q as l,kt as u}from"./index-lTGJJTuk.js";var d=e(t(),1),f=n(),p=(0,d.lazy)(()=>r(()=>import(`./AnalyticsPage-Cvtt-LOO.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81]))),m=420,h=560;function g(){let{t:e}=i(`agent`),{closeAnalyticsPane:t}=l(),[n,r]=(0,d.useState)(h),[g,_]=(0,d.useState)(!1),v=(0,d.useCallback)(e=>{let t=e.clientX,i=n,a=window.innerWidth-m;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o=e=>{let n=Math.min(Math.max(i+(t-e.clientX),m),a);r(n)},s=()=>{window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s)},[n]);return(0,f.jsxs)(`div`,{className:s(`flex h-full flex-col overflow-hidden border-l border-border bg-background`,g&&`absolute inset-0 z-30 border-l-0`),style:g?void 0:{width:n,flexShrink:0},"data-testid":`agent-analytics-pane`,children:[(0,f.jsx)(`div`,{className:`relative flex items-center`,children:!g&&(0,f.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:v,className:`absolute left-0 top-0 h-full w-1.5 -translate-x-full cursor-col-resize select-none touch-none hover:bg-accent-primary/20`,title:e(`workspace.resizeAnalytics`)})}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 bg-surface/40 px-3 py-1.5`,children:[(0,f.jsx)(`span`,{className:`text-xs font-medium text-foreground/70`,children:e(`workspace.analytics`)}),(0,f.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,f.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),"aria-label":e(g?`restore`:`maximize`),title:e(g?`restore`:`maximize`),className:`rounded-md p-1 text-foreground/60 hover:bg-surface hover:text-foreground`,children:g?(0,f.jsx)(u,{className:`h-4 w-4`}):(0,f.jsx)(c,{className:`h-4 w-4`})}),(0,f.jsx)(`button`,{type:`button`,onClick:t,"aria-label":e(`workspace.closeAnalytics`),title:e(`workspace.closeAnalytics`),className:`rounded-md p-1 text-foreground/60 hover:bg-surface hover:text-foreground`,children:(0,f.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(`div`,{className:`flex h-24 items-center justify-center text-muted-foreground`,children:(0,f.jsx)(a,{className:`h-4 w-4 animate-spin`})}),children:(0,f.jsx)(p,{})})})]})}export{g as AgentModeAnalyticsPane};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodePage-D35o-MFO.js","assets/rolldown-runtime-CNC7AqOf.js","assets/jsx-runtime-zu2_FqZY.js","assets/react-dom-DiWzBDP9.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-DEKu087k.js","assets/useSharedWebSocket-DaWuiO0S.js","assets/activity-DiyjsgQV.js","assets/addspec-BOvgmcgk.js","assets/agent-Z5s_GTP0.js","assets/agentRuntime-C_yLPKDy.js","assets/agents-Doe1sHY5.js","assets/agentstudio-BzugqB_N.js","assets/aiedit-iIjz2_Qk.js","assets/analytics-BWynXPEm.js","assets/attachments-B53PG733.js","assets/browser-CG0PE1j_.js","assets/builder-CpS9liE9.js","assets/chat-BGD7MXAy.js","assets/code-DaZ-ZwCT.js","assets/commands-BAWSYHjQ.js","assets/common-Bdi0qN4S.js","assets/dashboard-XGdQ5mjw.js","assets/explore-DgBACn39.js","assets/integrations-Dwl9KQp0.js","assets/jira-FXr7u2lh.js","assets/jobs-De3EqaO0.js","assets/loops-WyWDkhok.js","assets/mcp-CUAN6ORK.js","assets/narration-DbHnz0qV.js","assets/nav--u7iPYlS.js","assets/packet-B0H15elv.js","assets/settings-Dbyd6gmj.js","assets/setup-CKGUxKr-.js","assets/specs-DfIdoU5L.js","assets/subscriptionUsage-CdlE5Mg1.js","assets/terminal-BAzpHtpY.js","assets/tickets-D41ZMQpf.js","assets/createLucideIcon-Bjbbp_KS.js","assets/useDesktop-DKNbOF0u.js","assets/TicketDetailModalContext-YBJX3RmP.js","assets/tauri-shell-DE6LfGPw.js","assets/Trans-D5eOjfvG.js","assets/provider-capabilities-lePfeT_Y.js","assets/save-OsUqVn99.js","assets/spending-DQDNtM8q.js","assets/MinimizedChatsContext-CroAs6Kh.js","assets/sparkles-DrY8hb0X.js","assets/x-CBMI9ejn.js","assets/zap-CUOlvtT1.js","assets/file-text-BcLCfcWZ.js","assets/circle-x-CMYsN4ZH.js","assets/download-CFHyyHcw.js","assets/external-link-D6XxC_Cu.js","assets/git-branch-BRM0F5GN.js","assets/loader-circle-DcygOQpC.js","assets/pencil-C9RkrIPZ.js","assets/square-Ci-PFcFe.js","assets/plus-CsnjfkmX.js","assets/rotate-ccw-Wh4id13q.js","assets/search-Cq_gE3Ik.js","assets/trash-2-BOU3WdZZ.js","assets/triangle-alert-H9T4jAmh.js","assets/jira-api-Bp0zXwjg.js","assets/dialog-CMgps2MY.js","assets/utils-BC4DHlz2.js","assets/clsx-CjueKrWZ.js","assets/lib-CGdyxIWg.js","assets/formatDistanceToNow-DZ3VWsHq.js","assets/getTimezoneOffsetInMilliseconds-9JiGlFrx.js","assets/button-D1xExSTF.js","assets/RepositoryScopeSelector-CeCr6Jz-.js","assets/project-repositories-CadLZOnr.js","assets/index-lTGJJTuk.js","assets/core-B3mKBIh5.js","assets/RepositoryDeliveries-DJCm1pZr.js","assets/useRuntimeRuns-D3YMw9qx.js","assets/event-Bt7f3wXe.js","assets/index-Bfunvi6w.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{n as i}from"./createLucideIcon-Bjbbp_KS.js";import{t as a}from"./x-CBMI9ejn.js";import{At as o,Q as s,dt as c,kt as l,ut as u}from"./index-lTGJJTuk.js";var d=e(t(),1),f=n(),p=(0,d.lazy)(()=>r(()=>import(`./CodePage-D35o-MFO.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78]))),m=420,h=560;function g({projectId:e,conversationId:t}){let{t:n}=i(`agent`),{closeCodePane:r}=s(),[g,_]=(0,d.useState)(h),[v,y]=(0,d.useState)(()=>window.innerWidth),[b,x]=(0,d.useState)(!1),S=(0,d.useRef)(null),C=(0,d.useRef)(null),w=Math.max(0,v-Math.min(m,v/2)),T=Math.min(m,w),E=Math.min(w,Math.max(T,g)),D=(0,d.useCallback)(e=>Math.min(w,Math.max(T,e)),[w,T]),O=`${e}:${t}`,k=(0,d.useCallback)(n=>{c(e,t,{path:n})},[e,t]);(0,d.useLayoutEffect)(()=>{let e=S.current,t=e?.parentElement;if(!e||!t)return;let n=()=>{let n=t.getBoundingClientRect().width||t.clientWidth||window.innerWidth,r=0;for(let n of t.children){if(n===e||!(n instanceof HTMLElement))continue;let t=getComputedStyle(n);t.display===`none`||t.position===`absolute`||t.position===`fixed`||Number(t.flexGrow)>0||(r+=n.getBoundingClientRect().width)}y(Math.max(0,n-r))},r=new ResizeObserver(n),i=()=>{r.disconnect(),r.observe(t);for(let n of t.children)n!==e&&r.observe(n);n()},a=new MutationObserver(i);return a.observe(t,{childList:!0}),i(),window.addEventListener(`resize`,n),()=>{r.disconnect(),a.disconnect(),window.removeEventListener(`resize`,n)}},[O]),(0,d.useEffect)(()=>()=>{C.current?.()},[O,b,w]);let A=(0,d.useCallback)(e=>{if(e.button!==0)return;e.preventDefault(),C.current?.();let t=e.clientX,n=E,r=e.pointerId,i=e.currentTarget;try{i.setPointerCapture(r)}catch{}let a=e=>{e.pointerId===r&&_(D(n+t-e.clientX))},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),window.removeEventListener(`blur`,o),i.removeEventListener(`lostpointercapture`,o);try{i.hasPointerCapture(r)&&i.releasePointerCapture(r)}catch{}C.current=null},s=e=>{e.pointerId===r&&o()};C.current=o,window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s),window.addEventListener(`blur`,o),i.addEventListener(`lostpointercapture`,o)},[E,D]);return(0,f.jsxs)(`div`,{ref:S,className:`flex h-full min-w-0 flex-col overflow-hidden border-l border-border bg-background${b?` absolute inset-0 z-30 border-l-0`:` relative`}`,style:b?void 0:{width:E,maxWidth:`100%`,flexShrink:0},"data-testid":`agent-code-pane`,children:[!b&&(0,f.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:A,tabIndex:0,"aria-label":n(`workspace.resizeCode`),"aria-valuemin":Math.round(T),"aria-valuemax":Math.round(w),"aria-valuenow":Math.round(E),onKeyDown:e=>{let t=e.key===`ArrowLeft`?E+32:e.key===`ArrowRight`?E-32:e.key===`Home`?T:e.key===`End`?w:null;t!==null&&(e.preventDefault(),_(D(t)))},className:`absolute inset-y-0 left-0 z-20 w-1.5 cursor-col-resize select-none touch-none hover:bg-accent-primary/20 focus-visible:bg-accent-primary/30 focus-visible:outline-none`,title:n(`workspace.resizeCode`)}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 bg-surface/40 px-3 py-1.5`,children:[(0,f.jsx)(`span`,{className:`text-xs font-medium text-foreground/70`,children:n(`workspace.files`)}),(0,f.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,f.jsx)(`button`,{type:`button`,onClick:()=>{C.current?.(),x(e=>!e)},"aria-label":n(b?`restore`:`maximize`),title:n(b?`restore`:`maximize`),className:`rounded-md p-1 text-foreground/60 hover:bg-surface hover:text-foreground`,children:b?(0,f.jsx)(l,{className:`h-4 w-4`}):(0,f.jsx)(o,{className:`h-4 w-4`})}),(0,f.jsx)(`button`,{type:`button`,onClick:()=>{C.current?.(),r()},"aria-label":n(`workspace.closeFiles`),title:n(`workspace.closeFiles`),className:`rounded-md p-1 text-foreground/60 hover:bg-surface hover:text-foreground`,children:(0,f.jsx)(a,{className:`h-4 w-4`})})]})]}),(0,f.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`…`}),children:(0,f.jsx)(p,{embedded:!0,initialRepositoryId:u(e,t).repositoryId,onRepositoryChange:n=>c(e,t,{repositoryId:n}),initialPath:u(e,t).path,onSelectedPathChange:k},O)})})]},O)}export{g as AgentModeCodePane};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor.main-DxrmGfoq.js","assets/rolldown-runtime-CNC7AqOf.js","assets/preload-helper-Czpn1I53.js","assets/editor.api2-4ndOupAA.js","assets/editor-Br_kD0ds.css","assets/monaco.contribution-Bt92R3Vw.js","assets/workers-uOo7WLaa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{t as r}from"./react-dom-DiWzBDP9.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,u as o}from"./chunk-KS7C4IRE-DEKu087k.js";import{r as s}from"./useSharedWebSocket-DaWuiO0S.js";import{n as c,t as l}from"./createLucideIcon-Bjbbp_KS.js";import{a as u,i as d,r as f,s as p}from"./useDesktop-DKNbOF0u.js";import{J as m,V as h,X as g,Y as _,n as v,tt as y}from"./TicketDetailModalContext-YBJX3RmP.js";import{p as b}from"./provider-capabilities-lePfeT_Y.js";import{n as x,r as S}from"./save-OsUqVn99.js";import{c as C}from"./MinimizedChatsContext-CroAs6Kh.js";import{n as w,t as T}from"./file-text-BcLCfcWZ.js";import{t as E}from"./external-link-D6XxC_Cu.js";import{t as D}from"./loader-circle-DcygOQpC.js";import{t as O}from"./search-Cq_gE3Ik.js";import{t as k}from"./sparkles-DrY8hb0X.js";import{t as A}from"./x-CBMI9ejn.js";import{F as j,P as M}from"./dialog-CMgps2MY.js";import{t as N}from"./utils-BC4DHlz2.js";import{n as P,t as F}from"./lib-CGdyxIWg.js";import{n as ee,t as I}from"./project-repositories-CadLZOnr.js";import{Bt as te,Lt as ne,Pt as L,Rt as R,tn as re,wt as z}from"./index-lTGJJTuk.js";var B=l(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),ie=l(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),V=l(`folder-search`,[[`path`,{d:`M10.7 20H4a2 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.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),ae=l(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),oe=l(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),se=l(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),H=e(t(),1),ce=e(r(),1);function U(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function W(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function G(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var K=(e,t)=>Math.abs(e-t)<1.01,le=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},q,ue=()=>{if(q!==void 0)return q;if(typeof navigator>`u`)return q=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return q=!0;let e=navigator.maxTouchPoints;return q=navigator.platform===`MacIntel`&&e!==void 0&&e>0},J=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},de=e=>e,fe=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},pe=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(J(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(J(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},me={passive:!0},Y=typeof window>`u`||`onscrollend`in window,he=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Y,o=0,s=a?null:le(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,me),a&&r.addEventListener(`scrollend`,u,me),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ge=(e,t)=>he(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),X=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},_e=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},ve=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:de,rangeExtractor:fe,onChange:()=>{},measureElement:X,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}this.options=t},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=W(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!ue()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,me),e.addEventListener(`touchend`,n,me),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=W(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=W(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=U(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=W(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?be({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=W(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);o!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this))&&(ue()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,this.notify(!1))},this.getVirtualItems=W(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return G(t[ye(0,t.length-1,r?e=>n[e*2]:e=>G(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&K(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},ye=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function be({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=ye(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var xe=typeof document<`u`?H.useLayoutEffect:H.useEffect;function Se({useFlushSync:e=!0,...t}){let n=H.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,ce.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=H.useState(()=>new ve(r));return i.setOptions(r),xe(()=>i._didMount(),[]),xe(()=>i._willUpdate()),i}function Ce(e){return Se({observeElementRect:pe,observeElementOffset:ge,scrollToFn:_e,...e})}var we=(0,H.createContext)(null);function Z(){return(0,H.useContext)(we)??{apiBase:u()}}function Te(e,t){return e?e===t.repositoryId:!t.repositoryId||t.isPrimary===!0}var Q=n(),Ee=e=>`specrails-desktop:code-tree-filter:${e}`,De=e=>`specrails-desktop:code-tree-collapsed:${e}`;function Oe(e){return e.split(`/`).length-1}function ke(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ae(e){return e?e.length>10?e.slice(0,10):e:null}function je(e){return e===`created`?`added`:e===`modified`?`changed`:e===`deleted`?`deleted`:null}function Me(e,t){if(t.size===0)return!1;let n=e.split(`/`);for(let e=1;e<n.length;e++)if(t.has(n.slice(0,e).join(`/`)))return!0;return!1}function Ne({onOpenFile:e,selectedPath:t,filterJobId:n,filterTicketId:r}){let{t:i}=c(`code`),a=(0,H.useId)(),o=Z(),{apiBase:l,repositoryId:u,repositoryPath:p}=o,{activeProjectId:h}=f(),{openTicketDetail:g}=v(),{registerHandler:_,unregisterHandler:y}=s(),[b,S]=(0,H.useState)(()=>{if(!h)return`all`;try{let e=localStorage.getItem(Ee(`${h}:${u??`primary`}`));if(e===`all`||e===`touched-by-ai`)return e}catch{}return`all`});(0,H.useEffect)(()=>{if(h)try{localStorage.setItem(Ee(`${h}:${u??`primary`}`),b)}catch{}},[b,h,u]),(0,H.useEffect)(()=>{(n||r)&&S(`touched-by-ai`)},[n,r]);let[C,T]=(0,H.useState)(()=>{if(!h)return new Set;try{let e=localStorage.getItem(De(`${h}:${u??`primary`}`));if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set});(0,H.useEffect)(()=>{if(h)try{localStorage.setItem(De(`${h}:${u??`primary`}`),JSON.stringify([...C]))}catch{}},[C,h,u]);let E=(0,H.useCallback)(e=>{T(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),D=(0,H.useCallback)(()=>{T(new Set)},[]),O=b===`touched-by-ai`?`${n??`all-jobs`}:${r??`all-specs`}`:`all`,{data:k,refresh:A,isFirstLoad:j,isLoading:M,error:P}=d({namespace:`code-tree-v2:${JSON.stringify([u,p,b,O])}`,projectId:h,initialValue:{entries:[],partial:!1},fetcher:(0,H.useCallback)(async({signal:e})=>{let t=new Map,i=new Set,a=null,o=!1;for(let s=0;s<20;s+=1){e.throwIfAborted();let s=new URLSearchParams({withProvenance:`1`,filter:b});b===`touched-by-ai`&&n&&s.set(`jobId`,n),b===`touched-by-ai`&&typeof r==`number`&&s.set(`ticketId`,String(r)),a&&s.set(`cursor`,a);let c=await fetch(`${l}/code/tree?${s}`,{signal:e});if(!c.ok)throw Error(`tree_request_failed`);let u=await c.json();if(e.throwIfAborted(),!Array.isArray(u.entries))throw Error(`invalid_tree_response`);for(let e of u.entries)t.set(e.path,e);if(o||=u.truncated===!0,a=u.nextCursor??null,!a)break;if(i.has(a)||t.size>=2e4){o=!0;break}i.add(a)}return{entries:[...t.values()].slice(0,2e4),partial:o||!!a}},[b,n,r,l])}),F=k.entries,ee=(0,H.useRef)(h);(0,H.useEffect)(()=>{ee.current=h},[h]),(0,H.useEffect)(()=>{if(!h)return;let e=`code-tree-${a}-${h}-${u??`primary`}`,t;return _(e,e=>{let n=e;n.projectId!==ee.current||!Te(n.repositoryId,o)||n.type===`file.provenance_updated`&&(clearTimeout(t),t=setTimeout(()=>{A()},150))}),()=>{clearTimeout(t),y(e)}},[l,u,h,_,y,A,a]);let I=(0,H.useRef)(null),L=(0,H.useMemo)(()=>(F??[]).filter(e=>!Me(e.path,C)),[F,C]),re=(0,H.useCallback)(()=>{T(new Set((F??[]).filter(e=>e.kind===`dir`).map(e=>e.path)))},[F]),B=Ce({count:L.length,getScrollElement:()=>I.current,estimateSize:()=>28,overscan:12,initialRect:{width:320,height:600},observeElementRect:(e,t)=>{let n=e.scrollElement;if(!n)return()=>{};let r=()=>{let e=n.getBoundingClientRect(),r=e.height||n.clientHeight||600;t({width:e.width||n.clientWidth||320,height:r})};if(r(),typeof ResizeObserver<`u`){let e=new ResizeObserver(r);return e.observe(n),()=>e.disconnect()}return()=>{}}}),ie=(0,H.useId)(),[V,ae]=(0,H.useState)(t),oe=Math.max(0,L.findIndex(e=>e.path===V));(0,H.useEffect)(()=>{t&&(ae(t),T(e=>{let n=new Set(e),r=t.split(`/`);for(let e=1;e<r.length;e++)n.delete(r.slice(0,e).join(`/`));return n}))},[t]);let se=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!t||se.current===t)return;let e=L.findIndex(e=>e.path===t);e>=0&&(B.scrollToIndex(e,{align:`auto`}),se.current=t)},[t,L,B]);let ce=(t,n)=>{let r=L[n];if(!r)return;let i=n;switch(t.key){case`ArrowDown`:i=Math.min(L.length-1,n+1);break;case`ArrowUp`:i=Math.max(0,n-1);break;case`Home`:i=0;break;case`End`:i=L.length-1;break;case`ArrowRight`:r.kind===`dir`&&C.has(r.path)?E(r.path):r.kind===`dir`&&(i=Math.min(L.length-1,n+1));break;case`ArrowLeft`:if(r.kind===`dir`&&!C.has(r.path))E(r.path);else{let e=r.path.split(`/`).slice(0,-1).join(`/`),t=L.findIndex(t=>t.path===e);t>=0&&(i=t)}break;case`Enter`:case` `:r.kind===`dir`?E(r.path):e(r.path);break;default:return}t.preventDefault(),t.stopPropagation(),ae(L[i].path),i!==n&&B.scrollToIndex(i,{align:`auto`})},U=L.length===0,W=(0,H.useMemo)(()=>(F??[]).filter(e=>e.kind===`file`).length,[F]);return(0,Q.jsxs)(`div`,{className:`flex flex-col h-full`,"data-testid":`file-tree`,children:[(0,Q.jsxs)(`div`,{className:`px-2 py-2 border-b border-border text-xs space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>S(`touched-by-ai`),className:N(`px-2 py-1 rounded-md transition-colors`,b===`touched-by-ai`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":b===`touched-by-ai`,children:i(n?`tree.jobFiles`:r?`tree.specFiles`:`tree.touchedByAi`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>S(`all`),className:N(`px-2 py-1 rounded-md transition-colors`,b===`all`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":b===`all`,children:i(`tree.allFiles`)}),(0,Q.jsx)(`div`,{className:`flex-1`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{A()},disabled:M,"aria-label":i(`explore.refresh`),title:i(`explore.refresh`),className:`rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40`,children:(0,Q.jsx)(z,{className:`h-3.5 w-3.5 ${M?`animate-spin`:``}`})}),(0,Q.jsx)(`button`,{type:`button`,onClick:re,title:i(`tree.collapseAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":i(`tree.collapseAll`),children:(0,Q.jsx)(w,{className:`w-3.5 h-3.5`})}),(0,Q.jsx)(`button`,{type:`button`,onClick:D,title:i(`tree.expandAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":i(`tree.expandAll`),children:(0,Q.jsx)(x,{className:`w-3.5 h-3.5`})})]}),b===`touched-by-ai`&&W>0&&(0,Q.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:(0,Q.jsx)(`span`,{children:i(`tree.touchedCount`,{count:W})})})]}),P&&(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-1 border-b border-border p-3 text-xs`,children:[(0,Q.jsx)(`p`,{children:i(`tree.loadFailed`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{A()},className:`text-accent-primary underline`,children:i(`explore.retry`)})]}),k.partial&&(0,Q.jsx)(`p`,{role:`status`,className:`border-b border-border p-3 text-xs text-amber-600 dark:text-amber-400`,children:i(`tree.partial`)}),U&&P?null:U&&j?(0,Q.jsx)(`div`,{className:`flex-1 flex items-center justify-center px-4 text-center`,"data-testid":`file-tree-loading`,children:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground animate-pulse`,children:i(`tree.loadingFiles`)})}):U&&b===`touched-by-ai`?(0,Q.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-4 text-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`tree.emptyTouched`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>S(`all`),className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30`,children:i(`tree.showAllFiles`)})]}):U?(0,Q.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-muted-foreground px-4 text-center`,children:i(`tree.noFiles`)}):(0,Q.jsx)(`div`,{ref:I,className:`min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent-primary/50`,"data-testid":`file-tree-scroller`,role:`tree`,tabIndex:0,"aria-label":i(`explore.files`),"aria-activedescendant":L[oe]?`${ie}-${oe}`:void 0,onKeyDown:e=>{e.target===e.currentTarget&&ce(e,oe)},children:(0,Q.jsx)(`div`,{style:{height:B.getTotalSize(),position:`relative`,width:`100%`},children:B.getVirtualItems().map(n=>{let r=L[n.index],a=Oe(r.path)*12,o=r.kind===`file`&&r.path===t,s=r.provenance?.createdByTicketId,c=r.provenance?.modifiedByTicketIds??[],l=r.provenance?.latest??null,u=Ae(l?.jobId),d=je(l?.kind),f=r.kind===`dir`,p=f&&C.has(r.path),h=r.provenance?.touchedFileCount??0;return(0,Q.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,transform:`translateY(${n.start}px)`,height:n.size,width:`100%`},className:N(`flex items-center gap-2 px-2 text-xs cursor-pointer hover:bg-muted/50`,o&&`bg-accent-primary/10 text-foreground`,r.path===V&&`ring-1 ring-inset ring-accent-primary/30`),onClick:()=>{ae(r.path),I.current?.focus({preventScroll:!0}),f?E(r.path):e(r.path)},onKeyDown:e=>{e.target===e.currentTarget&&ce(e,n.index)},role:`treeitem`,id:`${ie}-${n.index}`,tabIndex:-1,"aria-level":Oe(r.path)+1,"aria-selected":o,title:r.path,"aria-expanded":f?!p:void 0,"data-testid":`file-tree-row-${r.path}`,children:[(0,Q.jsxs)(`span`,{style:{paddingLeft:a},className:`flex items-center gap-1 min-w-0 flex-1`,children:[f?(0,Q.jsxs)(Q.Fragment,{children:[p?(0,Q.jsx)(w,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}):(0,Q.jsx)(x,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}),p?(0,Q.jsx)(ne,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`}):(0,Q.jsx)(R,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`w-3 flex-shrink-0`}),(0,Q.jsx)(te,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`})]}),(0,Q.jsx)(`span`,{className:`truncate ml-0.5`,children:ke(r.path)})]}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 flex-shrink-0`,children:[f&&h>0&&(0,Q.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground`,title:i(`tree.folderTouched`,{count:h}),children:h}),!f&&d&&(0,Q.jsx)(`span`,{className:N(`h-1.5 w-1.5 rounded-full`,l?.kind===`created`&&`bg-accent-success`,l?.kind===`modified`&&`bg-accent-info`,l?.kind===`deleted`&&`bg-destructive`),title:l?.kind===`created`?i(`tree.latestTitleCreated`):l?.kind===`deleted`?i(`tree.latestTitleDeleted`):i(`tree.latestTitleModified`),children:(0,Q.jsx)(`span`,{className:`sr-only`,children:i(`action.${d}`)})}),!f&&u&&(0,Q.jsxs)(`span`,{className:`inline-flex items-center px-0.5 text-muted-foreground`,title:i(`tree.jobTitle`,{jobId:l?.jobId??``}),children:[(0,Q.jsx)(m,{className:`h-3 w-3`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:u})]}),!f&&typeof s==`number`&&(0,Q.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),g(s)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,"data-testid":`provenance-chip-created-${s}`,title:i(`tree.createdBySpec`,{id:s}),children:[`#`,s]}),!f&&c.slice(0,2).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),g(e)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,"data-testid":`provenance-chip-modified-${e}`,title:i(`tree.modifiedBySpec`,{id:e}),children:[`#`,e]},e))]})]},r.path)})})})]})}function Pe(e){return new Worker(`/assets/editor.worker-tytyn86m.js`,{name:e?.name})}function Fe(e){return new Worker(`/assets/json.worker-Oa9UrkKE.js`,{name:e?.name})}function Ie(e){return new Worker(`/assets/css.worker-yKcq13f2.js`,{name:e?.name})}function Le(e){return new Worker(`/assets/html.worker-DSJ9zmd7.js`,{name:e?.name})}function Re(e){return new Worker(`/assets/ts.worker-BtjBFNHX.js`,{name:e?.name})}var ze=!1;function Be(e){let t=e.trim().match(/^hsl\(\s*([-\d.]+)[\s,]+([\d.]+)%[\s,]+([\d.]+)%\s*\)$/i);return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}function $(e,t=`#1e1e1e`){if(e.startsWith(`#`))return e;let n=Be(e);if(!n)return t;let[r,i,a]=n,o=i/100,s=a/100,c=(1-Math.abs(2*s-1))*o,l=(r%360+360)%360/60,u=c*(1-Math.abs(l%2-1)),d=0,f=0,p=0;l<1?(d=c,f=u):l<2?(d=u,f=c):l<3?(f=c,p=u):l<4?(f=u,p=c):l<5?(d=u,p=c):(d=c,p=u);let m=s-c/2,h=e=>Math.round((e+m)*255).toString(16).padStart(2,`0`);return`#${h(d)}${h(f)}${h(p)}`}function Ve(e){return`specrails-${e}`}function He(e,t){let n=Ve(t.id),r=t.xterm,i=$(r.background),a=$(r.foreground),o=$(r.brightBlack),s=$(r.magenta),c=$(r.yellow),l=$(r.cyan),u=$(r.blue),d=$(r.green),f=$(r.brightBlack),p=$(r.brightCyan),m=$(r.red),h=$(r.selectionBackground);return e.editor.defineTheme(n,{base:t.scheme===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:``,foreground:a.slice(1)},{token:`comment`,foreground:f.slice(1),fontStyle:`italic`},{token:`keyword`,foreground:s.slice(1)},{token:`string`,foreground:c.slice(1)},{token:`number`,foreground:l.slice(1)},{token:`constant`,foreground:p.slice(1)},{token:`constant.numeric`,foreground:l.slice(1)},{token:`type`,foreground:d.slice(1)},{token:`type.identifier`,foreground:d.slice(1)},{token:`identifier`,foreground:a.slice(1)},{token:`function`,foreground:u.slice(1)},{token:`tag`,foreground:m.slice(1)},{token:`attribute.name`,foreground:p.slice(1)},{token:`attribute.value`,foreground:c.slice(1)},{token:`delimiter`,foreground:o.slice(1)},{token:`operator`,foreground:o.slice(1)}],colors:{"editor.background":i,"editor.foreground":a,"editorLineNumber.foreground":o,"editorLineNumber.activeForeground":a,"editorCursor.foreground":$(r.cursor),"editor.selectionBackground":h,"editor.inactiveSelectionBackground":h,"editor.lineHighlightBackground":$(r.black),"editor.lineHighlightBorder":$(r.black),"editorGutter.background":i,"editorWhitespace.foreground":o,"editorIndentGuide.background1":$(r.black),"editorIndentGuide.activeBackground1":o,"scrollbarSlider.background":`${o}55`,"scrollbarSlider.hoverBackground":`${o}88`,"scrollbarSlider.activeBackground":`${o}bb`,"minimap.background":i}}),n}function Ue(){ze||=(self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new Fe;case`css`:case`scss`:case`less`:return new Ie;case`html`:case`handlebars`:case`razor`:return new Le;case`typescript`:case`javascript`:return new Re;default:return new Pe}}},!0)}function We({content:e,language:t,initialLine:n}){let{t:r}=c(`code`),a=re(),o=(0,H.useRef)(null),s=(0,H.useRef)(null),l=(0,H.useRef)(null),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!1),[m,h]=(0,H.useState)(0),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(``),b=(0,H.useRef)({content:e,language:t,theme:a,initialLine:n,wrap:g});b.current={content:e,language:t,theme:a,initialLine:n,wrap:g};let x=(e,t=!1)=>{let n=s.current,r=n?.getModel();if(!n||!r||!Number.isFinite(e)||e<1)return;let i=Math.min(r.getLineCount(),Math.max(1,Math.floor(e)));n.setSelection({startLineNumber:i,startColumn:1,endLineNumber:i,endColumn:r.getLineMaxColumn(i)}),n.revealLineInCenter(i),t&&n.focus()};return(0,H.useEffect)(()=>{let e=!1;return d(!1),p(!1),Ue(),i(()=>import(`./editor.main-DxrmGfoq.js`).then(t=>{if(e||!o.current)return;l.current=t;let n=b.current,r=t.editor.create(o.current,{value:n.content,language:n.language,readOnly:!0,domReadOnly:!0,theme:He(t,n.theme),minimap:{enabled:!1},lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,renderValidationDecorations:`off`,wordWrap:n.wrap?`on`:`off`,fontSize:13});s.current=r,x(n.initialLine),d(!0)}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>{e||p(!0)}),()=>{e=!0;let t=s.current?.getModel();s.current?.dispose(),t?.dispose(),s.current=null,l.current=null}},[m]),(0,H.useEffect)(()=>{let t=s.current;t&&t.getValue()!==e&&t.setValue(e)},[e]),(0,H.useEffect)(()=>{let e=s.current?.getModel();e&&l.current&&l.current.editor.setModelLanguage(e,t)},[t]),(0,H.useEffect)(()=>{let e=l.current;e&&e.editor.setTheme(He(e,a))},[a]),(0,H.useEffect)(()=>{x(n)},[n,u]),(0,H.useEffect)(()=>{s.current?.updateOptions({wordWrap:g?`on`:`off`})},[g]),(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-muted/20 px-3 py-1 text-xs`,children:[(0,Q.jsx)(`button`,{type:`button`,disabled:!u,className:`rounded px-2 py-1 hover:bg-muted disabled:opacity-50`,onClick:()=>{s.current?.getAction(`actions.find`)?.run()},children:r(`reader.find`,{defaultValue:`Find in file`})}),(0,Q.jsx)(`button`,{type:`button`,disabled:!u,"aria-pressed":g,className:`rounded px-2 py-1 hover:bg-muted disabled:opacity-50`,onClick:()=>_(e=>!e),children:r(`reader.wrap`,{defaultValue:`Wrap lines`})}),(0,Q.jsxs)(`form`,{className:`ml-auto flex items-center gap-1`,onSubmit:e=>{e.preventDefault(),x(Number(v),!0)},children:[(0,Q.jsx)(`input`,{type:`number`,min:1,step:1,"aria-label":r(`reader.line`,{defaultValue:`Line number`}),placeholder:`#`,title:r(`reader.line`,{defaultValue:`Line number`}),value:v,onChange:e=>y(e.target.value),className:`w-28 rounded border border-border bg-background px-2 py-1`}),(0,Q.jsx)(`button`,{type:`submit`,disabled:!u||!Number.isInteger(Number(v))||Number(v)<1,className:`rounded px-2 py-1 hover:bg-muted disabled:opacity-50`,children:r(`reader.go`,{defaultValue:`Go`})})]})]}),f?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,"data-testid":`monaco-load-error`,children:[(0,Q.jsx)(`span`,{children:r(`monaco.loadFailed`)}),(0,Q.jsx)(`button`,{onClick:()=>h(e=>e+1),className:`rounded border px-3 py-1`,children:r(`reader.retry`,{defaultValue:`Retry`})})]}):(0,Q.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[!u&&(0,Q.jsx)(`div`,{role:`status`,className:`absolute inset-0 flex items-center justify-center text-sm text-muted-foreground`,children:r(`reader.loading`,{defaultValue:`Loading source viewer…`})}),(0,Q.jsx)(`div`,{ref:o,className:`h-full w-full`,"data-testid":`monaco-host`})]})]})}function Ge(e,t){if(!e)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((n-Date.now())/1e3),i=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),a=Math.abs(r);return a<60?i.format(r,`second`):a<3600?i.format(Math.round(r/60),`minute`):a<86400?i.format(Math.round(r/3600),`hour`):i.format(Math.round(r/86400),`day`)}function Ke({path:e,summary:t,stale:n,regenerating:r,generateDisabledReason:i,onCollapse:a}){let{t:o,i18n:s}=c(`code`),{openTicketDetail:l}=v();if(!t)return(0,Q.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header-empty`,children:(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i?o(`summary.unavailable`,{reason:i}):o(`summary.empty`)})]}),a&&(0,Q.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Q.jsx)(C,{className:`h-3.5 w-3.5`}),o(`summary.hide`)]})]})});let u=Ge(t.generatedAt,s.language),d=t.generatedBy?.model??t.model,f=t.generatedAt&&Number.isFinite(Date.parse(t.generatedAt))?new Date(t.generatedAt).toLocaleString(s.language):void 0,p=t.triggeredBy?.ticketId,m=t.triggeredBy?.modifiedTicketIds??[];return(0,Q.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header`,children:(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,Q.jsx)(`span`,{className:N(`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning font-medium`),"data-testid":`summary-stale-badge`,children:o(`summary.stale`)}),r&&(0,Q.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent-primary animate-pulse`,"aria-hidden":!0})]}),(0,Q.jsx)(`p`,{className:`text-sm text-foreground mt-1 whitespace-pre-wrap break-words`,children:t.summary}),t.generatedBy?.truncated&&(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-accent-warning`,children:o(`reader.summaryPartial`,{defaultValue:`Generated from a partial source snapshot. This summary may not cover the entire file.`})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap`,children:[d&&(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:o(`story.explainedBy`,{model:d})}),typeof p==`number`&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>l(p),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,children:[`#`,p]}),m.map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,children:[`#`,e]},e)),u&&(0,Q.jsx)(`time`,{className:`text-[10px] text-muted-foreground`,dateTime:t.generatedAt,title:f,children:u})]})]}),a&&(0,Q.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Q.jsx)(C,{className:`h-3.5 w-3.5`}),o(`summary.hide`)]})]})})}function qe({content:e}){return(0,Q.jsx)(P,{remarkPlugins:[F],children:e})}var Je=2e3,Ye=256e3;function Xe({path:e,jobId:t}){let{activeProjectId:n}=f(),r=Z(),i=JSON.stringify([n,r.apiBase,r.repositoryPath,e,t]);return(0,Q.jsx)(Ze,{path:e,jobId:t},i)}function Ze({path:e,jobId:t}){let{t:n}=c(`code`),{apiBase:r}=Z(),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(`loading`),[l,u]=(0,H.useState)(0);(0,H.useEffect)(()=>{let n=new AbortController;s(`loading`);let i=new URLSearchParams({path:e,jobId:t});return fetch(`${r}/code/diff?${i}`,{signal:n.signal}).then(async e=>{if(e.status===404){n.signal.aborted||s(`missing`);return}if(!e.ok)throw Error(`Diff request failed`);let t=await e.json();if(typeof t.patch!=`string`)throw Error(`Invalid patch response`);n.signal.aborted||(a({patch:t.patch,truncated:t.truncated===!0}),s(t.patch?`ready`:`missing`))}).catch(()=>{n.signal.aborted||s(`failed`)}),()=>n.abort()},[r,e,t,l]);let d=(i?.patch??``).slice(0,Ye).split(`
|
|
3
|
-
`),f=d.length>Je||(i?.patch.length??0)>Ye,p=null,m=null;return(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-2 text-xs`,"data-testid":`recorded-diff`,children:[(0,Q.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`p`,{className:`font-medium`,children:[n(`reader.recordedChange`,{defaultValue:`Recorded change`}),` · `,(0,Q.jsx)(`span`,{className:`font-mono`,title:t,children:t.slice(0,12)})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:n(`reader.recordedNotice`,{defaultValue:`This patch records a past run. It may differ from the current registered checkout.`})})]}),o===`loading`&&(0,Q.jsx)(`p`,{role:`status`,children:n(`history.loadingDiff`)}),o===`missing`&&(0,Q.jsx)(`p`,{children:n(`history.diffUnavailable`)}),o===`failed`&&(0,Q.jsxs)(`div`,{role:`alert`,children:[(0,Q.jsx)(`p`,{children:n(`reader.diffFailed`,{defaultValue:`Could not load the recorded change.`})}),(0,Q.jsx)(`button`,{className:`mt-2 rounded border px-2 py-1`,onClick:()=>u(e=>e+1),children:n(`reader.retry`,{defaultValue:`Retry`})})]}),o===`ready`&&i&&(0,Q.jsxs)(Q.Fragment,{children:[i.truncated&&(0,Q.jsx)(`p`,{className:`text-accent-warning`,children:n(`reader.patchIncomplete`,{defaultValue:`The stored patch is incomplete. Missing content cannot be reconstructed from this record.`})}),f&&(0,Q.jsx)(`p`,{className:`text-accent-warning`,children:n(`reader.displayLimited`,{defaultValue:`Preview limited to {{count}} lines or {{chars}} characters. The remaining patch is not shown.`,count:Je,chars:Ye})}),(0,Q.jsx)(`div`,{className:`max-h-[32rem] overflow-auto rounded-md border border-border bg-background font-mono text-[11px] leading-5`,tabIndex:0,"aria-label":n(`reader.patch`,{defaultValue:`Recorded patch`}),children:d.slice(0,Je).map((e,t)=>{let n=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(e),r=null,i=null,a=`meta`;return n?(p=Number(n[1]),m=Number(n[2])):p!==null&&m!==null&&(e.startsWith(`+`)?(a=`added`,i=m++):e.startsWith(`-`)?(a=`removed`,r=p++):e.startsWith(` `)&&(a=`context`,r=p++,i=m++)),(0,Q.jsxs)(`div`,{"data-kind":a,className:`flex min-w-max ${a===`added`?`bg-accent-success/10`:a===`removed`?`bg-destructive/10`:a===`meta`?`text-muted-foreground`:``}`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`w-12 shrink-0 select-none border-r border-border/40 px-2 text-right text-muted-foreground`,children:r}),(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`w-12 shrink-0 select-none border-r border-border/40 px-2 text-right text-muted-foreground`,children:i}),(0,Q.jsx)(`code`,{className:`whitespace-pre px-3`,children:e||` `})]},t)})})]})]})}var Qe={done:`bg-accent-success/15 text-accent-success`,in_progress:`bg-accent-info/15 text-accent-info`,on_review:`bg-accent-warning/15 text-accent-warning`,todo:`bg-muted/60 text-muted-foreground`,draft:`bg-accent-secondary/15 text-accent-secondary`};function $e(e){return e===`created`?_:e===`deleted`?g:T}function et(e){let t=Z(),{activeProjectId:n}=f(),r=JSON.stringify([n,t.apiBase,t.repositoryPath,e.relPath]);return(0,Q.jsx)(tt,{...e},r)}function tt({relPath:e,height:t,onOpenTicket:n,onFilterJob:r,onViewDiff:i}){let{t:a}=c(`code`),o=Z(),{apiBase:l,repositoryId:u}=o,{activeProjectId:d,projects:m}=f(),h=m.find(e=>e.id===d)?.provider,g=b(h),{registerHandler:_,unregisterHandler:v}=s(),y=(0,H.useId)(),[x,S]=(0,H.useState)(null),[C,w]=(0,H.useState)(!1),T=(0,H.useRef)(!0),E=(0,H.useRef)(null),D=(0,H.useRef)(new Map);(0,H.useEffect)(()=>(T.current=!0,()=>{T.current=!1,E.current?.abort();for(let e of D.current.values())e.abort();D.current.clear()}),[]);let[O,k]=(0,H.useState)({}),A=(0,H.useRef)(d);(0,H.useEffect)(()=>{A.current=d},[d]);let j=(0,H.useRef)(e);(0,H.useEffect)(()=>{j.current=e},[e]);let M=(0,H.useRef)(0),N=(0,H.useCallback)(async()=>{if(!T.current)return;let t=++M.current;E.current?.abort();let n=new AbortController;E.current=n;try{let r=await fetch(`${l}/code/file/story?path=${encodeURIComponent(e)}`,{signal:n.signal});if(!T.current||n.signal.aborted||t!==M.current)return;if(!r.ok){S([]),w(!0);return}let i=await r.json();if(!T.current||n.signal.aborted||t!==M.current)return;S(Array.isArray(i.story)?i.story:[]),w(!1)}catch{T.current&&!n.signal.aborted&&t===M.current&&(S([]),w(!0))}},[e,d,l]);(0,H.useEffect)(()=>{S(null),k({}),N()},[N]),(0,H.useEffect)(()=>{if(!d)return;let e=`code-story-${d}-${u??`primary`}-${y}`;return _(e,e=>{let t=e;t.projectId!==A.current||!Te(t.repositoryId,o)||t.path===j.current&&(t.type===`file.story_updated`||t.type===`file.provenance_updated`)&&N()}),()=>v(e)},[y,l,u,d,_,v,N]);let P=(0,H.useCallback)(async(t,n)=>{if(!g||!T.current||!t.hasPatch||t.evidence?.kind===`missing`||D.current.has(t.provenanceId))return;let r=new AbortController;D.current.set(t.provenanceId,r),k(e=>({...e,[t.provenanceId]:`busy`}));try{let i=await fetch(`${l}/code/file/story/explain?path=${encodeURIComponent(e)}`,{method:`POST`,signal:r.signal,headers:{"content-type":`application/json`},body:JSON.stringify({provenanceId:t.provenanceId,overrideBudget:n,...t.summaryStale?{force:!0}:{}})}),o=await i.json().catch(()=>({}));if(!T.current||r.signal.aborted)return;if(o.skipped===`budget`){k(e=>({...e,[t.provenanceId]:`budget`}));return}if(!i.ok||!o.ok){p.error(a(`story.explainFailed`)),k(e=>{let n={...e};return delete n[t.provenanceId],n});return}if(await N(),!T.current||r.signal.aborted)return;k(e=>{let n={...e};return delete n[t.provenanceId],n})}catch{if(!T.current||r.signal.aborted)return;p.error(a(`story.explainFailed`)),k(e=>{let n={...e};return delete n[t.provenanceId],n})}finally{D.current.delete(t.provenanceId)}},[g,N,e,a]);return(0,Q.jsx)(`div`,{className:`shrink-0 border-t border-border bg-card/40 px-4 py-3 overflow-hidden`,style:{height:t},"data-testid":`construction-story`,children:(0,Q.jsx)(`div`,{className:`h-full overflow-auto`,children:x===null?(0,Q.jsx)(`div`,{className:`text-[11px] text-muted-foreground animate-pulse py-2`,children:a(`story.loading`)}):C?(0,Q.jsxs)(`div`,{className:`text-[11px] text-muted-foreground py-2`,"data-testid":`story-failed`,role:`alert`,children:[a(`story.loadFailed`),` `,(0,Q.jsx)(`button`,{className:`ml-2 underline`,onClick:()=>{N()},children:a(`reader.retry`,{defaultValue:`Retry`})})]}):x.length===0?(0,Q.jsx)(`div`,{className:`text-[11px] text-muted-foreground py-2`,"data-testid":`story-empty`,children:a(`story.empty`)}):(0,Q.jsx)(`ol`,{className:`relative ml-1.5 border-l border-border/60 space-y-3 py-1`,children:x.map(t=>(0,Q.jsx)(nt,{entry:t,state:O[t.provenanceId],canExplain:g&&t.hasPatch&&t.evidence?.kind!==`missing`,path:e,onViewDiff:i,onOpenTicket:n,onFilterJob:r,onExplain:e=>{P(t,e)}},t.provenanceId))})})})}function nt({entry:e,state:t,canExplain:n,path:r,onViewDiff:i,onOpenTicket:a,onFilterJob:o,onExplain:s}){let{t:l}=c(`code`),[u,d]=(0,H.useState)(!1),f=$e(e.kind),p=e.ticket?.status??null,m=e.ticket?.title?`#${e.ticket.id} · ${e.ticket.title}`:e.ticketId==null?null:l(`story.spec`,{ticketId:e.ticketId}),h=e.ticketId==null?`${e.kind}NoSpec`:e.kind;return(0,Q.jsxs)(`li`,{className:`relative pl-4`,"data-testid":`story-card`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`absolute -left-[5px] top-2 h-2.5 w-2.5 rounded-full border-2 border-background ${e.kind===`created`?`bg-accent-success`:e.kind===`deleted`?`bg-destructive`:`bg-accent-info`}`}),(0,Q.jsxs)(`article`,{className:`rounded-lg border border-border/60 bg-card/60 px-3 py-2.5 backdrop-blur-sm transition-colors hover:border-border`,children:[(0,Q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),l(`story.kindLabel.${e.kind}`)]}),m!=null&&e.ticketId!=null&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>a(e.ticketId),className:`min-w-0 max-w-full truncate rounded bg-accent-primary/15 px-1.5 py-0.5 text-left text-[11px] font-medium text-accent-primary hover:bg-accent-primary/25`,title:l(`story.openSpec`,{ticketId:e.ticketId}),children:m}),m==null&&(0,Q.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:l(`story.unknownSpec`)}),p&&(0,Q.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] ${Qe[p]??`bg-muted/60 text-muted-foreground`}`,"data-testid":`story-status-pill`,children:p}),(0,Q.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-2`,children:[e.addedLines!=null&&e.addedLines>0&&(0,Q.jsxs)(`span`,{className:`font-mono text-[10px] text-accent-success`,title:l(`story.linesAdded`),children:[`+`,e.addedLines]}),e.removedLines!=null&&e.removedLines>0&&(0,Q.jsxs)(`span`,{className:`font-mono text-[10px] text-destructive`,title:l(`story.linesRemoved`),children:[`−`,e.removedLines]}),(0,Q.jsx)(`time`,{className:`text-[10px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]})]}),(0,Q.jsx)(`div`,{className:`mt-1.5`,children:e.summary?(0,Q.jsxs)(Q.Fragment,{children:[e.summaryStale&&(0,Q.jsx)(`span`,{className:`text-[10px] text-accent-warning`,children:l(`summary.stale`)}),(0,Q.jsx)(`p`,{className:`text-sm leading-relaxed text-foreground/90`,"data-testid":`story-contribution`,children:e.summary}),e.summaryGeneratedAt&&(0,Q.jsx)(`time`,{className:`mt-1 block text-[10px] text-muted-foreground`,dateTime:e.summaryGeneratedAt,children:new Date(e.summaryGeneratedAt).toLocaleString()}),e.summaryStale&&n&&(t===`budget`?(0,Q.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-2 text-[11px] text-accent-warning`,children:[(0,Q.jsx)(`span`,{children:l(`story.budgetReached`)}),(0,Q.jsx)(`button`,{className:`rounded border px-2 py-1`,onClick:()=>s(!0),children:l(`story.generateAnyway`)})]}):(0,Q.jsx)(`button`,{disabled:t===`busy`,className:`mt-1 rounded border px-2 py-1 text-[11px]`,onClick:()=>s(!1),children:t===`busy`?l(`story.explaining`):l(`reader.regenerateExplanation`,{defaultValue:`Refresh explanation`})})),e.summaryModel&&(0,Q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground/80`,children:l(`story.explainedBy`,{model:e.summaryModel})})]}):(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`story-fallback`,children:l(`story.fallback.${h}`)}),n?t===`budget`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[10px] text-accent-warning`,children:l(`story.budgetReached`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>s(!0),className:`rounded bg-accent-warning/15 px-1.5 py-0.5 text-[10px] text-accent-warning hover:bg-accent-warning/25`,children:l(`story.generateAnyway`)})]}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>s(!1),disabled:t===`busy`,className:`inline-flex items-center gap-1 rounded bg-accent-primary/10 px-1.5 py-0.5 text-[10px] text-accent-primary hover:bg-accent-primary/20 disabled:opacity-60`,"data-testid":`story-explain`,children:[(0,Q.jsx)(k,{className:t===`busy`?`h-3 w-3 animate-pulse`:`h-3 w-3`}),l(t===`busy`?`story.explaining`:`story.explain`)]}):(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,"data-testid":`story-explain-unavailable`,children:!e.hasPatch||e.evidence?.kind===`missing`?l(`reader.noEvidence`,{defaultValue:`No patch evidence was stored for this change.`}):l(`story.explainUnavailable`)})]})}),e.summary&&(!e.hasPatch||e.evidence?.kind===`missing`)&&(0,Q.jsx)(`p`,{className:`mt-2 text-[10px] text-accent-warning`,children:l(`reader.noEvidence`,{defaultValue:`No patch evidence was stored for this change.`})}),(e.summaryEvidence?.truncated??e.evidence?.truncated)&&(0,Q.jsx)(`p`,{className:`mt-2 text-[10px] text-accent-warning`,children:l(`reader.excerptEvidence`,{defaultValue:`This explanation uses incomplete patch evidence.`})}),e.jobId&&(0,Q.jsxs)(`div`,{className:`mt-2`,children:[(0,Q.jsx)(`button`,{className:`rounded border px-2 py-1 text-[11px]`,onClick:()=>{i?i(e.jobId):d(e=>!e)},children:l(`reader.viewPatch`,{defaultValue:`View recorded change`})}),u&&(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(Xe,{path:r,jobId:e.jobId})})]}),e.jobId&&o&&(0,Q.jsx)(`footer`,{className:`mt-1.5`,children:(0,Q.jsx)(`button`,{type:`button`,onClick:()=>o(e.jobId),className:`font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:l(`history.filterByJob`,{jobId:e.jobId}),children:e.jobId.length>12?e.jobId.slice(0,12):e.jobId})})]})]})}function rt(e,t){return t===`markdown`||t===`md`||/\.(md|mdx|markdown)$/i.test(e)}var it=180,at=120,ot=240;function st(e){return e?`specrails-desktop:code-summary-collapsed:${e}`:null}function ct(e){return e?`specrails-desktop:code-history-height:${e}`:null}function lt(e){return e?`specrails-desktop:code-history-collapsed:${e}`:null}function ut(e){return e?`specrails-desktop:code-history-mode:${e}`:null}function dt(e){let t=ut(e);if(!t)return`story`;try{return localStorage.getItem(t)===`log`?`log`:`story`}catch{return`story`}}function ft(e,t){let n=ut(e);if(n)try{localStorage.setItem(n,t)}catch{}}function pt(e){let t=ct(e);if(!t)return it;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:it}catch{return it}}function mt(e,t){let n=ct(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function ht(e){let t=st(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function gt(e,t){let n=st(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function _t(e,t=!1){let n=lt(e);if(!n)return t;let r=t?n+`:compact`:n;try{let e=localStorage.getItem(r);return e===null?t:e===`true`}catch{return t}}function vt(e,t,n=!1){let r=lt(e),i=r&&n?r+`:compact`:r;if(i)try{localStorage.setItem(i,t?`true`:`false`)}catch{}}function yt(e,t){let n=Math.max(at,t-ot);return Math.min(Math.max(e,at),n)}function bt(e){let{activeProjectId:t}=f(),n=Z(),r=JSON.stringify([t,n.apiBase,n.repositoryId,n.repositoryPath,e.relPath,e.initialJobId]);return(0,Q.jsx)(xt,{...e},r)}function xt({relPath:e,initialLine:t,initialJobId:n,compact:r=!1,onFilterJob:i,onSummaryActionChange:a,onCopyPathActionChange:o}){let{t:l}=c(`code`),u=Z(),{apiBase:d,repositoryId:m}=u,{activeProjectId:h,projects:g}=f(),_=g.find(e=>e.id===h)?.provider,y=b(_),{openTicketDetail:S}=v(),{registerHandler:w,unregisterHandler:T}=s(),E=(0,H.useId)(),D=j({allowMove:!1}),O=(0,H.useRef)(null),[k,A]=(0,H.useState)(null),[N,P]=(0,H.useState)(!1),F=(0,H.useRef)(!0),ee=(0,H.useRef)(null),I=(0,H.useRef)(new Set);(0,H.useEffect)(()=>(F.current=!0,()=>{F.current=!1,ee.current?.abort();for(let e of I.current)e.abort();I.current.clear()}),[]);let[te,ne]=(0,H.useState)(n??null),[L,R]=(0,H.useState)(n?`recorded`:`source`);(0,H.useEffect)(()=>{ne(n??null),R(n?`recorded`:`source`)},[n]),(0,H.useEffect)(()=>{t&&!n&&R(`source`)},[t,n]);let re=(0,H.useCallback)(e=>{ne(e),R(`recorded`)},[]),[z,B]=(0,H.useState)(!0),[ie,V]=(0,H.useState)(!1),[ae,oe]=(0,H.useState)(!1),[se,U]=(0,H.useState)(()=>ht(h)),[W,G]=(0,H.useState)(()=>pt(h)),[K,le]=(0,H.useState)(()=>_t(h,r)),[q,ue]=(0,H.useState)(()=>dt(h)),J=(0,H.useRef)(h);(0,H.useEffect)(()=>{J.current=h},[h]);let de=(0,H.useRef)(e);(0,H.useEffect)(()=>{de.current=e},[e]),(0,H.useEffect)(()=>{let e=O.current?.clientHeight||window.innerHeight;U(ht(h)),G(yt(pt(h),e)),le(_t(h,r)),ue(dt(h))},[h,r]);let fe=(0,H.useCallback)(e=>{let t=e.clientY,n=W,r=O.current?.clientHeight||window.innerHeight,i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}function a(e){G(yt(n+(t-e.clientY),r))}function o(){window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),G(e=>{let t=yt(e,r);return mt(h,t),t})}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},[h,W]),pe=(0,H.useCallback)(()=>{let e=yt(it,O.current?.clientHeight||window.innerHeight);G(e),mt(h,e)},[h]),me=(0,H.useCallback)(()=>{U(e=>{let t=!e;return gt(h,t),t})},[h]),Y=(0,H.useCallback)(()=>{le(e=>{let t=!e;return vt(h,t,r),t})},[h,r]),he=(0,H.useCallback)(e=>{ue(e),ft(h,e)},[h]);(0,H.useEffect)(()=>{xe(t?`raw`:`preview`)},[e,t]);let ge=(0,H.useRef)(0),X=(0,H.useCallback)(async()=>{if(!F.current)return;let t=++ge.current;ee.current?.abort();let n=new AbortController;ee.current=n,B(!0),P(!1);try{let r=await fetch(`${d}/code/file?path=${encodeURIComponent(e)}`,{signal:n.signal});if(!F.current||n.signal.aborted||t!==ge.current)return;if(!r.ok){P(!0);return}let i=await r.json();if(!F.current||n.signal.aborted||t!==ge.current)return;A(i)}catch{F.current&&!n.signal.aborted&&t===ge.current&&P(!0)}finally{F.current&&!n.signal.aborted&&t===ge.current&&B(!1)}},[e,h,d]);(0,H.useEffect)(()=>{X()},[X]),(0,H.useEffect)(()=>{let e=()=>{X()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[X]),(0,H.useEffect)(()=>{if(!h)return;let e=`code-file-${h}-${m??`primary`}-${E}`;return w(e,e=>{let t=e;t.projectId!==J.current||!Te(t.repositoryId,u)||((t.type===`file.summary_updated`||t.type===`file.provenance_updated`||t.type===`file.content_updated`)&&t.path===de.current?(t.type===`file.summary_updated`&&V(!1),X()):t.type===`file.summary_failed`&&t.path===de.current?(p.error(t.reason??l(`summary.generationFailed`)),V(!1)):t.type===`file.summary_skipped`&&t.path===de.current&&(t.reason&&p(l(`summary.skipped`,{reason:t.reason})),V(!1)))}),()=>T(e)},[E,d,m,h,w,T,X,l]);let _e=(0,H.useCallback)(async t=>{if(!y||!F.current||I.current.size>0)return;let n=new AbortController;I.current.add(n),V(!0);try{let r=await fetch(`${d}/code/file/regenerate-summary?path=${encodeURIComponent(e)}`,{method:`POST`,signal:n.signal,headers:{"content-type":`application/json`},body:JSON.stringify({overrideBudget:t})}),i=await r.json().catch(()=>({}));if(!F.current||n.signal.aborted)return;if(!r.ok){V(!1);let e=typeof i.skipped==`string`?i.skipped:null;p.error(e?l(`summary.skipped`,{reason:e}):l(`summary.generationFailed`));return}if(i.skipped===`budget`){V(!1),oe(!0);return}if(i.skipped){V(!1),p(l(`summary.skipped`,{reason:i.skipped}));return}await X(),F.current&&!n.signal.aborted&&V(!1)}catch{F.current&&!n.signal.aborted&&(V(!1),p.error(l(`summary.generationFailed`)))}finally{I.current.delete(n)}},[y,X,e,l]),ve=(0,H.useCallback)(async()=>{let t=k?.absolutePath??e;try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(t),p.success(l(`viewer.pathCopied`))}catch{p.error(l(`viewer.copyPathFailed`))}},[k,e,l]),ye=(0,H.useMemo)(()=>rt(e,k?.language),[e,k?.language]),[be,xe]=(0,H.useState)(t?`raw`:`preview`),Se=k?.summary??null,Ce=!!k?.summaryStale,we=k?.provenance??[],Ee=k?.reason===`not-found`,De=k?y?Ee?l(`summary.reason.missing`):k?.binary?l(`summary.reason.binary`):k?.tooLarge?l(`summary.reason.tooLarge`):null:l(`summary.reason.providerNoPureOutput`):l(`reader.sourceUnavailable`,{defaultValue:`source unavailable`});return(0,H.useEffect)(()=>{if(a){if(L===`recorded`||z&&!k){a(null);return}return a({hasSummary:!!Se,regenerating:ie,disabledReason:De,onClick:()=>_e(!1)}),()=>a(null)}},[k,_e,z,a,ie,Se,De,L]),(0,H.useEffect)(()=>{if(o){if(z&&!k){o(null);return}return o({onClick:ve}),()=>o(null)}},[ve,k,z,o]),L===`source`&&z&&!k?(0,Q.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:l(`viewer.loadingFile`)}):(0,Q.jsxs)(`div`,{ref:O,className:`flex flex-col h-full`,"data-testid":`file-viewer`,children:[L===`source`&&(se?(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-surface px-4`,"data-testid":`summary-header-collapsed`,children:[(0,Q.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e}),(0,Q.jsxs)(`button`,{type:`button`,onClick:me,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Q.jsx)(x,{className:`h-3.5 w-3.5`}),l(`viewer.showSummary`)]})]}):(0,Q.jsx)(Ke,{path:e,summary:Se,stale:Ce,regenerating:ie,generateDisabledReason:De,onCollapse:me})),(0,Q.jsxs)(`div`,{className:`px-4 py-1 border-b border-border flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 min-w-0`,children:[(0,Q.jsx)(`button`,{"aria-pressed":L===`source`,onClick:()=>R(`source`),className:`rounded px-2 py-1 text-xs hover:bg-muted`,children:l(`reader.currentFile`,{defaultValue:`Current file`})}),te&&(0,Q.jsx)(`button`,{"aria-pressed":L===`recorded`,onClick:()=>R(`recorded`),className:`rounded px-2 py-1 text-xs hover:bg-muted`,children:l(`reader.recordedChange`,{defaultValue:`Recorded change`})}),L===`source`&&ye&&k?.content!==void 0&&!k.binary&&!k.tooLarge&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px]`,role:`group`,"aria-label":l(`viewer.markdownViewMode`),children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>xe(`preview`),"aria-pressed":be===`preview`,className:be===`preview`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:l(`viewer.preview`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>xe(`raw`),"aria-pressed":be===`raw`,className:be===`raw`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:l(`viewer.raw`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[k?.language&&(0,Q.jsx)(`span`,{children:k.language}),typeof k?.sizeBytes==`number`&&(0,Q.jsxs)(`span`,{children:[(k.sizeBytes/1024).toFixed(1),` KB`]}),(0,Q.jsx)(`button`,{disabled:z,onClick:()=>{X()},className:`rounded px-2 py-1 hover:bg-muted disabled:opacity-50`,children:l(`reader.refresh`,{defaultValue:`Refresh source`})})]})]}),N&&(0,Q.jsxs)(`div`,{role:`alert`,className:`border-b border-border px-4 py-2 text-xs`,children:[l(`reader.sourceFailed`,{defaultValue:`Could not refresh the current file. Any displayed source is the last successful read.`}),(0,Q.jsx)(`button`,{className:`ml-2 underline`,onClick:()=>{X()},children:l(`reader.retry`,{defaultValue:`Retry`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:L===`recorded`&&te?(0,Q.jsx)(`div`,{className:`h-full overflow-auto p-3`,children:(0,Q.jsx)(Xe,{path:e,jobId:te})}):Ee?(0,Q.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-missing`,children:l(`viewer.missingFile`)}):k?.binary?(0,Q.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-binary`,children:l(`viewer.binaryFile`)}):k?.tooLarge?(0,Q.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-too-large`,children:l(`viewer.tooLarge`,{size:Math.round((k.sizeBytes??0)/1024/1024)})}):k?.content===void 0?(0,Q.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:l(`viewer.noContent`)}):ye&&be===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4 prose prose-invert prose-sm max-w-none prose-p:my-2 prose-headings:mt-4 prose-headings:mb-2 prose-pre:bg-muted/40 prose-pre:rounded-md prose-code:before:content-none prose-code:after:content-none`,"data-testid":`markdown-preview`,children:(0,Q.jsx)(qe,{content:k.content})}):(0,Q.jsx)(We,{content:k.content,language:k.language??`plaintext`,initialLine:t})}),we.length>0&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":l(`history.resize`),onPointerDown:K?void 0:fe,onDoubleClick:K?void 0:pe,className:K?`flex h-8 shrink-0 items-center justify-between border-t border-border bg-card/35 px-4`:`flex h-8 shrink-0 cursor-row-resize items-center justify-between border-y border-border/40 bg-card/35 px-4 hover:bg-accent-primary/10`,title:K?void 0:l(`resizer.hint`),"data-testid":`code-history-resizer`,children:[(0,Q.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:l(q===`story`?`story.title`:`history.title`,{count:we.length})}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[!K&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-0.5 rounded-md bg-muted/40 p-0.5`,role:`group`,"aria-label":l(`story.viewMode`),onPointerDown:e=>e.stopPropagation(),children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>he(`story`),"aria-pressed":q===`story`,className:q===`story`?`rounded px-2 py-0.5 text-[10px] bg-accent-primary/20 text-accent-primary`:`rounded px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground`,children:l(`story.modeStory`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>he(`log`),"aria-pressed":q===`log`,className:q===`log`?`rounded px-2 py-0.5 text-[10px] bg-accent-primary/20 text-accent-primary`:`rounded px-2 py-0.5 text-[10px] text-muted-foreground hover:text-foreground`,children:l(`story.modeLog`)})]}),(0,Q.jsxs)(`button`,{type:`button`,onPointerDown:e=>e.stopPropagation(),onClick:Y,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[K?(0,Q.jsx)(C,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(x,{className:`h-3.5 w-3.5`}),l(K?`history.show`:`history.hide`)]})]})]}),!K&&(q===`story`?(0,Q.jsx)(et,{relPath:e,height:W,onOpenTicket:S,onFilterJob:i,onViewDiff:re}):(0,Q.jsx)(St,{rows:we,onOpenTicket:S,onFilterJob:i,height:W}))]}),ae&&(0,ce.createPortal)((0,Q.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,role:`dialog`,"aria-modal":`true`,"data-testid":`budget-prompt`,onClick:D.guardBackdrop(()=>oe(!1)),children:[(0,Q.jsxs)(`div`,{ref:D.panelRef,onClick:e=>e.stopPropagation(),className:`bg-card border border-border rounded-lg p-4 w-80 flex flex-col gap-3`,style:D.panelStyle,children:[(0,Q.jsx)(`p`,{className:`text-sm text-foreground`,children:l(`viewer.budgetPrompt`)}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>oe(!1),className:`text-xs px-3 py-1.5 rounded-md text-muted-foreground hover:text-foreground`,children:l(`common:actions.cancel`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{oe(!1),_e(!0)},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white`,children:l(`common:actions.confirm`)})]})]}),(0,Q.jsx)(M,{handles:D.resizeHandles})]}),document.body)]})}function St({rows:e,onOpenTicket:t,onFilterJob:n,height:r}){let{t:i}=c(`code`),[a,o]=(0,H.useState)(null);if(e.length===0)return null;function s(e,t){o(e=>e===t?null:t)}return(0,Q.jsx)(`div`,{className:`shrink-0 border-t border-border bg-card/40 px-4 py-3 overflow-hidden`,style:{height:r},"data-testid":`file-provenance-timeline`,children:(0,Q.jsx)(`div`,{className:`h-full overflow-auto space-y-1`,children:e.map((e,r)=>{let o=e.kind===`created`?_:e.kind===`deleted`?g:T,c=e.jobId?e.jobId.length>12?e.jobId.slice(0,12):e.jobId:i(`history.unknownJob`),l=`${e.jobId??`job`}:${e.path}:${e.at}:${r}`;return(0,Q.jsxs)(`div`,{className:`rounded-md hover:bg-muted/40`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,auto)_minmax(0,1fr)_auto] items-center gap-2 text-xs px-2 py-1.5`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0`,children:[(0,Q.jsx)(o,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`capitalize`,children:i(`kind.${e.kind}`)})]}),(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0 text-muted-foreground`,children:[(0,Q.jsx)(m,{className:`h-3.5 w-3.5 shrink-0`}),e.jobId&&n?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>n(e.jobId),className:`font-mono truncate hover:text-foreground`,title:i(`history.filterByJob`,{jobId:e.jobId}),children:c}):(0,Q.jsx)(`span`,{className:`font-mono truncate`,title:e.jobId??void 0,children:c}),e.jobId&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>s(e,l),className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,children:i(`history.diff`)}),typeof e.ticketId==`number`&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>t(e.ticketId),className:`shrink-0 rounded bg-accent-primary/15 px-1.5 py-0.5 text-[10px] text-accent-primary hover:bg-accent-primary/25`,title:i(`history.openSpec`,{ticketId:e.ticketId}),children:i(`history.specChip`,{ticketId:e.ticketId})})]}),(0,Q.jsx)(`time`,{className:`text-[11px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]}),a===l&&(0,Q.jsx)(`div`,{className:`px-2 pb-2`,children:e.jobId&&(0,Q.jsx)(Xe,{path:e.path,jobId:e.jobId})})]},l)})})})}function Ct({projectId:e,repositoryName:t,multipleRepositories:n,active:r=!0,onOpen:i}){let{t:a}=c(`code`),{apiBase:o,repositoryId:s,repositoryPath:l}=Z(),[u,d]=(0,H.useState)(``),[f,p]=(0,H.useState)(`find`),[m,h]=(0,H.useState)(n),[g,_]=(0,H.useState)(!1),[v,y]=(0,H.useState)(``),[b,x]=(0,H.useState)(null),[S,C]=(0,H.useState)(!1),[w,T]=(0,H.useState)(!1),[E,k]=(0,H.useState)(0),A=n&&m,j=A?ee(e):o,M=A?void 0:s,N=A?void 0:t,P=A?void 0:l,F=(0,H.useRef)(0),I=(0,H.useRef)(null);return(0,H.useEffect)(()=>{r&&I.current?.focus()},[r]),(0,H.useEffect)(()=>{let e=++F.current,t=new AbortController;x(null),T(!1);let n=u.trim();if(!n)return C(!1),()=>t.abort();C(!0);let r=setTimeout(async()=>{try{let r=new URLSearchParams({q:n,limit:f===`find`?`50`:`100`});f===`search`&&r.set(`caseSensitive`,String(g)),f===`search`&&v.trim()&&r.set(`path`,v.trim()),A&&r.set(`kind`,f);let i=await fetch(`${j}/code/${A?`discover`:f}?${r}`,{signal:t.signal});if(!i.ok)throw Error(`search_failed`);let a=await i.json();if(!Array.isArray(a.matches))throw Error(`invalid_search_response`);!t.signal.aborted&&e===F.current&&x({...a,matches:a.matches.map(e=>({...e,repositoryId:e.repositoryId??M,repositoryName:e.repositoryName??N}))})}catch{!t.signal.aborted&&e===F.current&&T(!0)}finally{!t.signal.aborted&&e===F.current&&C(!1)}},250);return()=>{clearTimeout(r),t.abort()}},[u,f,g,v,E,A,j,M,N,P]),(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":a(`explore.search`),children:[(0,Q.jsxs)(`div`,{className:`space-y-2 border-b border-border p-3`,children:[(0,Q.jsx)(`div`,{className:`flex gap-1 rounded-lg bg-muted/40 p-1`,children:[`find`,`search`].map(e=>(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":f===e,onClick:()=>p(e),className:`flex-1 rounded-md px-2 py-1.5 text-xs ${f===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`}`,children:a(`search.${e}`)},e))}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(O,{className:`pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground`}),(0,Q.jsx)(`input`,{ref:I,value:u,onChange:e=>d(e.target.value),maxLength:256,"aria-label":a(`search.query`),placeholder:a(f===`find`?`search.filePlaceholder`:`search.contentPlaceholder`),className:`h-9 w-full rounded-md border border-border bg-background pl-8 pr-2 text-xs outline-none focus:border-accent-primary`})]}),n&&(0,Q.jsxs)(`select`,{"aria-label":a(`search.scope`),value:m?`all`:`current`,onChange:e=>h(e.target.value===`all`),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`option`,{value:`all`,children:a(`search.allRepositories`)}),(0,Q.jsx)(`option`,{value:`current`,children:t??a(`search.currentRepository`)})]}),f===`search`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`input`,{value:v,onChange:e=>y(e.target.value),placeholder:a(`search.pathPlaceholder`),"aria-label":a(`search.withinPath`),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none focus:border-accent-primary`}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>_(e.target.checked)}),a(`search.caseSensitive`)]})]})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,"aria-busy":S,children:[!u.trim()&&(0,Q.jsxs)(`div`,{className:`space-y-2 px-5 py-8 text-center text-xs text-muted-foreground`,children:[(0,Q.jsx)(B,{className:`mx-auto h-7 w-7 opacity-50`}),(0,Q.jsx)(`p`,{children:a(`search.hint`)})]}),S&&(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 p-4 text-xs text-muted-foreground`,children:[(0,Q.jsx)(D,{className:`h-3.5 w-3.5 animate-spin`}),a(`search.loading`)]}),w&&(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 p-4 text-xs`,children:[(0,Q.jsx)(`p`,{children:a(`search.failed`)}),(0,Q.jsx)(`button`,{type:`button`,className:`text-accent-primary underline`,onClick:()=>k(e=>e+1),children:a(`explore.retry`)})]}),b&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{role:`status`,className:`space-y-1 border-b border-border/50 px-3 py-2 text-[11px] text-muted-foreground`,children:[(0,Q.jsx)(`p`,{children:a(`search.results`,{count:b.matches.length})}),b.truncated&&(0,Q.jsx)(`p`,{className:`text-amber-600 dark:text-amber-400`,children:a(`search.partial`)}),b.repositories?.filter(e=>![`ok`,`partial`].includes(e.status)).map(e=>(0,Q.jsx)(`p`,{children:a(`search.repositoryIncomplete`,{name:e.repositoryName})},e.repositoryId))]}),b.matches.length===0&&(0,Q.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:a(b.truncated?`search.noMatchesPartial`:`search.noMatches`)}),(0,Q.jsx)(`ul`,{className:`divide-y divide-border/40`,children:b.matches.map((e,t)=>(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>i({repositoryId:e.repositoryId,path:e.path,line:e.lineNumber}),className:`w-full space-y-1 px-3 py-3 text-left hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent-primary`,title:`${e.repositoryName??``} / ${e.path}`,children:[n&&(0,Q.jsx)(`span`,{className:`block text-[10px] font-medium text-accent-primary`,children:e.repositoryName}),(0,Q.jsxs)(`span`,{className:`block break-all font-mono text-xs text-foreground`,children:[e.path,e.lineNumber?(0,Q.jsxs)(`span`,{className:`text-accent-primary`,children:[`:`,e.lineNumber]}):null]}),e.snippet!==void 0&&(0,Q.jsxs)(`span`,{className:`block overflow-hidden text-ellipsis whitespace-pre font-mono text-[11px] text-muted-foreground`,children:[e.snippetTruncated?`… `:``,e.snippet]})]})},`${e.repositoryId}:${e.path}:${e.lineNumber??0}:${t}`))})]})]})]})}function wt({projectId:e,repositoryName:t,multipleRepositories:n,jobId:r,ticketId:i,onOpen:a}){let{t:o,i18n:l}=c(`code`),{repositoryId:u,repositoryPath:d}=Z(),{registerHandler:f,unregisterHandler:p}=s(),[h,v]=(0,H.useState)(n),[y,b]=(0,H.useState)(null),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(!1),E=(0,H.useRef)(0),O=(0,H.useRef)(null),k=(0,H.useId)(),A=JSON.stringify([e,u,d,h,r,i]),j=(0,H.useRef)(A);j.current=A;let M=y?.scope===A?y:null,N=(0,H.useCallback)(async t=>{let n=++E.current;O.current?.abort();let a=new AbortController;O.current=a,S(!0),w(!1),t||b(null);try{let o=new URLSearchParams({limit:`50`});!h&&u&&o.set(`repositoryId`,u),r&&o.set(`jobId`,r),i&&o.set(`ticketId`,String(i)),t&&o.set(`cursor`,t);let s=await fetch(`${ee(e)}/code/activity?${o}`,{signal:a.signal});if(!s.ok)throw Error(`activity_failed`);let c=await s.json();if(!Array.isArray(c.entries)||t&&c.nextCursor===t)throw Error(`invalid_activity_page`);if(a.signal.aborted||n!==E.current||j.current!==A)return;b(e=>{let n=t&&e?.scope===A?[...e.entries,...c.entries]:c.entries,r=[...new Map(n.map(e=>[e.id,e])).values()],i=r.length>1e3||r.length===1e3&&c.nextCursor!==null;return{...c,scope:A,entries:r.slice(0,1e3),nextCursor:i?null:c.nextCursor,truncated:c.truncated||i||!!t&&e?.scope===A&&e.truncated}})}catch{!a.signal.aborted&&n===E.current&&j.current===A&&w(!0)}finally{!a.signal.aborted&&n===E.current&&j.current===A&&S(!1)}},[e,u,d,h,r,i,A]);return(0,H.useEffect)(()=>(N(),()=>{E.current++,O.current?.abort()}),[N]),(0,H.useEffect)(()=>{let t=`code-activity-${e}-${k}`,n;return f(t,t=>{let r=t;r.type!==`file.provenance_updated`||r.projectId!==e||(clearTimeout(n),n=setTimeout(()=>{N()},250))}),()=>{clearTimeout(n),p(t)}},[N,e,k,f,p]),(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":o(`explore.activity`),children:[(0,Q.jsxs)(`div`,{className:`space-y-2 border-b border-border p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:o(`activity.description`)}),(0,Q.jsx)(`button`,{type:`button`,disabled:x,onClick:()=>{N()},"aria-label":o(`explore.refresh`),title:o(`explore.refresh`),className:`rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40`,children:(0,Q.jsx)(z,{className:`h-3.5 w-3.5 ${x?`animate-spin`:``}`})})]}),n&&(0,Q.jsxs)(`select`,{"aria-label":o(`activity.scope`),value:h?`all`:`current`,onChange:e=>v(e.target.value===`all`),className:`w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`option`,{value:`all`,children:o(`search.allRepositories`)}),(0,Q.jsx)(`option`,{value:`current`,children:t??o(`search.currentRepository`)})]}),(i||r)&&(0,Q.jsx)(`p`,{className:`break-all text-[11px] text-accent-primary`,children:i?o(`provenancePanel.specTitle`,{ticketId:i}):o(`provenancePanel.jobTitle`,{jobId:r})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,"aria-busy":x,children:[C&&(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 p-3 text-xs`,children:[(0,Q.jsx)(`p`,{children:o(`activity.failed`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{N(M?.nextCursor??void 0)},className:`text-accent-primary underline`,children:o(`explore.retry`)})]}),M?.truncated&&(0,Q.jsx)(`p`,{role:`status`,className:`border-b border-border p-3 text-xs text-amber-600 dark:text-amber-400`,children:o(`activity.partial`)}),M&&M.entries.length===0&&!M.truncated&&!M.nextCursor&&!x&&(0,Q.jsxs)(`div`,{className:`space-y-2 p-6 text-center text-xs text-muted-foreground`,children:[(0,Q.jsx)(L,{className:`mx-auto h-6 w-6 opacity-50`}),(0,Q.jsx)(`p`,{children:o(`activity.empty`)})]}),(0,Q.jsx)(`ol`,{children:M?.entries.map((e,t)=>{let n=M.entries[t-1],r=!n||n.repositoryId!==e.repositoryId||n.jobId!==e.jobId||n.ticketId!==e.ticketId,i=e.kind===`created`?_:e.kind===`deleted`?g:T;return(0,Q.jsxs)(`li`,{children:[r&&(0,Q.jsxs)(`div`,{className:`sticky top-0 z-[1] space-y-1 border-y border-border bg-background/95 px-3 py-2 backdrop-blur`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.repositoryName}),e.ticketId!=null&&(0,Q.jsx)(`span`,{className:`rounded bg-accent-primary/10 px-1.5 py-0.5 text-accent-primary`,children:o(`story.spec`,{ticketId:e.ticketId})})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[10px] text-muted-foreground`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,title:e.jobId??void 0,children:[(0,Q.jsx)(m,{className:`h-3 w-3`}),e.jobId?.slice(0,10)??o(`history.unknownJob`)]}),(0,Q.jsx)(`time`,{dateTime:new Date(e.at).toISOString(),title:new Date(e.at).toLocaleString(l.language),children:new Date(e.at).toLocaleDateString(l.language,{month:`short`,day:`numeric`})})]})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a({repositoryId:e.repositoryId,path:e.path,changeJobId:e.jobId}),className:`flex w-full items-start gap-2 border-b border-border/30 px-3 py-3 text-left hover:bg-muted/50`,title:e.path,children:[(0,Q.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 ${e.kind===`created`?`text-accent-success`:e.kind===`deleted`?`text-destructive`:`text-accent-info`}`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block break-all font-mono text-xs`,children:e.path}),(0,Q.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[o(`story.kindLabel.${e.kind}`),` · `,o(e.hasPatch?e.patchTruncated?`activity.partialPatch`:`activity.patch`:`activity.noPatch`)]})]})]})]},e.id)})}),x&&(0,Q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 p-4 text-xs text-muted-foreground`,children:[(0,Q.jsx)(D,{className:`h-3.5 w-3.5 animate-spin`}),o(`activity.loading`)]}),M?.nextCursor&&!x&&!C&&(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{N(M.nextCursor)},className:`m-3 rounded-md border border-border px-3 py-1.5 text-xs hover:bg-muted/50`,children:o(`activity.loadMore`)})]})]})}function Tt(e){if(!e||!/^\d+$/.test(e))return;let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:void 0}var Et=320,Dt=240,Ot=420,kt=760,At=e=>`specrails-desktop:code-tree-width:${e}`;function jt(e){try{let t=Number(localStorage.getItem(At(e)));return t>0&&Number.isFinite(t)?t:Et}catch{return Et}}function Mt(e,t){if(e)try{localStorage.setItem(At(e),String(Math.round(t)))}catch{}}function Nt(e,t){return Math.min(Math.max(e,Dt),Math.max(Dt,t-Ot))}function Pt(e={}){let{activeProjectId:t}=f();return(0,Q.jsx)(Ft,{...e},t??`no-project`)}function Ft({embedded:e=!1,initialPath:t=null,initialRepositoryId:n,onRepositoryChange:r,onSelectedPathChange:i}){let{t:s}=c(`code`),{t:l}=c(`common`),{activeProjectId:d,projects:p}=f(),[m,h]=a(),g=o(),_=p?.find(e=>e.id===d),v=(0,H.useMemo)(()=>I(_),[_]),[b,x]=(0,H.useState)(()=>({entries:[{repositoryId:n??void 0,path:t}],index:0})),C=e?b.entries[b.index]:{repositoryId:m.get(`repositoryId`)??void 0,path:m.get(`path`),line:Tt(m.get(`line`)),changeJobId:m.get(`changeJobId`)},E=C.repositoryId?v.find(e=>e.id===C.repositoryId):v.find(e=>e.isPrimary),D=!!C.repositoryId&&!!_&&!E,k=(0,H.useMemo)(()=>({apiBase:d?ee(d,E?.id):u(),repositoryId:E?.id,repositoryPath:E?.path,isPrimary:E?.isPrimary}),[d,E?.id,E?.path,E?.isPrimary]),A=JSON.stringify([d,E?.id,E?.path]),[j,M]=(0,H.useState)(`files`),[N,P]=(0,H.useState)(!0),[F,te]=(0,H.useState)(e),[ne,R]=(0,H.useState)(()=>jt(d)),[re,z]=(0,H.useState)(null),[B,ae]=(0,H.useState)(null),[ce,U]=(0,H.useState)({}),W=e?ce.jobId??null:m.get(`jobId`),G=e?ce.ticketId??null:Tt(m.get(`ticketId`))??null,[K,le]=(0,H.useState)(G?String(G):``),q=(0,H.useRef)(null),ue=(0,H.useRef)(null);(0,H.useEffect)(()=>{le(G?String(G):``)},[G]),(0,H.useEffect)(()=>{let e=q.current;if(!e)return;let t=e=>{e&&(te(e<kt),R(t=>Nt(t,e)))};if(t(e.clientWidth),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(e=>t(e[0]?.contentRect.width??0));return n.observe(e),()=>n.disconnect()},[]),(0,H.useEffect)(()=>()=>ue.current?.(),[]),(0,H.useEffect)(()=>{F&&C.path&&P(!1)},[F,C.path]);let J=(0,H.useCallback)(t=>{let n={...t,repositoryId:t.repositoryId??E?.id},a=n.repositoryId!==E?.id;if(e)x(e=>({entries:[...e.entries.slice(0,e.index+1),n],index:e.index+1})),a&&U({});else{let e=new URLSearchParams(m);for(let t of[`path`,`line`,`changeJobId`])e.delete(t);n.repositoryId&&e.set(`repositoryId`,n.repositoryId),n.path&&e.set(`path`,n.path),n.line&&e.set(`line`,String(n.line)),n.changeJobId&&e.set(`changeJobId`,n.changeJobId),a&&(e.delete(`jobId`),e.delete(`ticketId`)),h(e)}i?.(n.path),n.repositoryId&&r?.(n.repositoryId),F&&n.path&&P(!1)},[e,E?.id,m,h,i,r,F]),de=t=>{if(!e){g(t);return}let n=b.index+t,a=b.entries[n];if(!a)return;let o=a.repositoryId??v.find(e=>e.isPrimary)?.id;o!==E?.id&&U({}),x({...b,index:n}),i?.(a.path),o&&r?.(o)},fe=(0,H.useCallback)(t=>{if(e)U(t);else{let e=new URLSearchParams(m);e.delete(`jobId`),e.delete(`ticketId`),t.jobId&&e.set(`jobId`,t.jobId),t.ticketId&&e.set(`ticketId`,String(t.ticketId)),h(e)}},[e,m,h]),pe=(0,H.useCallback)(e=>{fe({jobId:e}),M(`activity`),P(!0)},[fe]),me=e=>{ue.current?.();let t=e.clientX,n=ne,r=ne,i=e=>{r=Nt(n+e.clientX-t,q.current?.clientWidth||window.innerWidth),R(r)},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a),Mt(d,r),ue.current=null};ue.current=a,window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},Y=N||!C.path,he=!F||!Y,ge=C.path?.split(`/`)??[];return(0,Q.jsx)(we.Provider,{value:k,children:(0,Q.jsxs)(`div`,{ref:q,className:`flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden`,"data-testid":`code-page`,"data-compact":F,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-card/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(`button`,{type:`button`,"aria-label":s(`explore.back`),title:s(`explore.back`),onClick:()=>de(-1),disabled:e&&b.index===0,className:`rounded p-1.5 text-muted-foreground hover:bg-muted disabled:opacity-30`,children:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`button`,{type:`button`,"aria-label":s(`explore.forward`),title:s(`explore.forward`),onClick:()=>de(1),disabled:e&&b.index===b.entries.length-1,className:`rounded p-1.5 text-muted-foreground hover:bg-muted disabled:opacity-30`,children:(0,Q.jsx)(y,{className:`h-3.5 w-3.5`})}),C.path&&(0,Q.jsx)(`button`,{type:`button`,"aria-label":s(Y?`explore.hideNavigation`:`explore.showNavigation`),title:s(Y?`explore.hideNavigation`:`explore.showNavigation`),onClick:()=>P(!Y),className:`rounded p-1.5 text-muted-foreground hover:bg-muted`,children:Y?(0,Q.jsx)(oe,{className:`h-4 w-4`}):(0,Q.jsx)(se,{className:`h-4 w-4`})})]}),v.length>0&&(0,Q.jsxs)(`select`,{"aria-label":l(`repositories.select`),className:`max-w-full min-w-0 rounded-md border border-border bg-background px-2 py-1 text-xs`,value:E?.id??C.repositoryId??``,onChange:e=>J({repositoryId:e.target.value,path:null}),children:[D&&(0,Q.jsx)(`option`,{value:C.repositoryId,children:l(`repositories.unavailable`)}),v.map(e=>(0,Q.jsxs)(`option`,{value:e.id,children:[e.name,e.isPrimary?` · ${l(`repositories.primary`)}`:``]},e.id))]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-muted-foreground`,title:E?.path,children:E?.path})]}),D?(0,Q.jsx)(`p`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:l(`repositories.invalidSelection`)}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,Q.jsxs)(`aside`,{hidden:!Y,className:`${Y?`flex`:`hidden`} min-h-0 min-w-0 shrink-0 flex-col overflow-hidden bg-card/15`,style:{width:F?`100%`:ne},"aria-label":s(`explore.navigation`),children:[(0,Q.jsx)(`nav`,{className:`flex shrink-0 gap-0.5 border-b border-border px-2 pt-2`,"aria-label":s(`explore.views`),children:[{mode:`files`,Icon:ie},{mode:`search`,Icon:O},{mode:`activity`,Icon:L}].map(({mode:e,Icon:t})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":j===e,onClick:()=>M(e),className:`flex min-w-0 flex-1 items-center justify-center gap-1.5 border-b-2 px-1 py-2 text-xs ${j===e?`border-accent-primary text-accent-primary`:`border-transparent text-muted-foreground hover:text-foreground`}`,children:[(0,Q.jsx)(t,{className:`h-3.5 w-3.5 shrink-0`}),s(`explore.${e}`)]},e))}),(0,Q.jsx)(`div`,{className:j===`files`?`min-h-0 flex-1`:`hidden`,children:(0,Q.jsx)(Ne,{selectedPath:C.path,onOpenFile:e=>J({path:e}),filterJobId:W,filterTicketId:G},A)}),d&&(0,Q.jsx)(`div`,{className:j===`search`?`flex min-h-0 flex-1 flex-col`:`hidden`,children:(0,Q.jsx)(Ct,{active:j===`search`&&Y,projectId:d,repositoryName:E?.name,multipleRepositories:v.length>1,onOpen:J})}),j===`activity`&&d&&(0,Q.jsx)(wt,{projectId:d,repositoryName:E?.name,multipleRepositories:v.length>1,jobId:W,ticketId:G,onOpen:J})]}),Y&&!F&&(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":s(`page.resizeFileTree`),onPointerDown:me,onDoubleClick:()=>{let e=Nt(Et,q.current?.clientWidth||window.innerWidth);R(e),Mt(d,e)},className:`w-1.5 shrink-0 cursor-col-resize touch-none select-none border-x border-border/40 hover:bg-accent-primary/20`,title:s(`resizer.hint`),"data-testid":`code-tree-resizer`}),(0,Q.jsxs)(`main`,{hidden:!he,className:`${he?`flex`:`hidden`} min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[C.path&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b border-border/60 px-3 py-2 text-[11px]`,"aria-label":s(`explore.breadcrumb`),children:[(0,Q.jsx)(T,{className:`mr-1 h-3.5 w-3.5 shrink-0 text-muted-foreground`}),ge.map((e,t)=>(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 ${t===ge.length-1?`font-medium text-foreground`:`text-muted-foreground`}`,children:[t>0&&(0,Q.jsx)(w,{className:`h-3 w-3`}),e]},t)),C.line&&(0,Q.jsxs)(`span`,{className:`ml-1 shrink-0 text-accent-primary`,children:[`:`,C.line]})]}),(0,Q.jsx)(It,{jobId:W,ticketId:G,ticketInput:K,onTicketInputChange:le,onApplyTicket:e=>fe({ticketId:Tt(e.trim())}),onClear:()=>fe({}),summaryAction:C.path?re:null,copyPathAction:C.path?B:null}),(W||G)&&(0,Q.jsx)(Lt,{jobId:W,ticketId:G,onOpenFile:e=>J({path:e,changeJobId:W})},`${A}:${W}:${G}`),C.path?(0,Q.jsx)(bt,{compact:F,relPath:C.path,initialLine:C.line,initialJobId:C.changeJobId,onFilterJob:pe,onSummaryActionChange:z,onCopyPathActionChange:ae},`${A}:${C.path}`):(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-6`,children:(0,Q.jsxs)(`div`,{className:`max-w-sm space-y-4 text-center`,children:[(0,Q.jsx)(`div`,{className:`mx-auto flex h-14 w-14 items-center justify-center rounded-2xl border border-accent-primary/20 bg-accent-primary/10 text-accent-primary`,children:(0,Q.jsx)(V,{className:`h-7 w-7`})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-lg font-semibold`,children:s(`explore.welcome`)}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:s(`explore.description`)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{M(`search`),P(!0)},className:`rounded-lg bg-accent-primary/15 px-3 py-2 text-xs text-accent-primary`,children:s(`explore.findCode`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{M(`activity`),P(!0)},className:`rounded-lg border border-border px-3 py-2 text-xs text-muted-foreground hover:text-foreground`,children:s(`explore.viewActivity`)})]}),(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground/80`,children:s(`explore.sourceHint`)})]})})]})]})]})})}function It({jobId:e,ticketId:t,ticketInput:n,onTicketInputChange:r,onApplyTicket:i,onClear:a,summaryAction:o,copyPathAction:s}){let{t:l}=c(`code`),u=t?`spec`:e?`job-context`:`all`;return(0,Q.jsx)(`div`,{className:`border-b border-border bg-background/80 px-4 py-2`,"data-testid":`code-provenance-toolbar`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,Q.jsx)(ae,{className:`h-3.5 w-3.5`}),l(`toolbar.scope`)]}),(0,Q.jsx)(`button`,{type:`button`,onClick:a,"aria-pressed":u===`all`,className:u===`all`?`rounded-md bg-accent-primary/20 px-2 py-1 text-xs text-accent-primary`:`rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.allAi`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-card/40 px-1 py-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>i(n),"aria-pressed":u===`spec`,className:u===`spec`?`rounded bg-accent-success/20 px-2 py-0.5 text-xs text-accent-success`:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.spec`)}),(0,Q.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i(n)},placeholder:l(`toolbar.ticketIdPlaceholder`),inputMode:`numeric`,className:`h-6 w-20 bg-transparent px-1 font-mono text-xs outline-none placeholder:text-muted-foreground/60`})]}),(0,Q.jsx)(`div`,{className:`flex-1`}),s&&(0,Q.jsx)(`button`,{type:`button`,onClick:s.onClick,className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.copyFilePath`)}),o&&(0,Q.jsxs)(`button`,{type:`button`,onClick:o.onClick,disabled:o.regenerating||!!o.disabledReason,"aria-label":o.hasSummary?l(`toolbar.regenerateSummary`):l(`toolbar.generateSummary`),className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary/15 px-2.5 py-1 text-xs text-accent-primary hover:bg-accent-primary/25 disabled:opacity-50`,title:o.disabledReason?l(`toolbar.summaryUnavailable`,{reason:o.disabledReason}):void 0,children:[(0,Q.jsx)(h,{className:o.regenerating?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),o.hasSummary?o.regenerating?l(`toolbar.regenerating`):l(`toolbar.regenerateSummary`):o.regenerating?l(`toolbar.generating`):l(`toolbar.generateSummary`)]}),u===`job-context`&&(0,Q.jsx)(`span`,{className:`rounded-md bg-accent-info/15 px-2 py-1 text-xs text-accent-info`,children:l(`toolbar.jobContext`)}),(e||t)&&(0,Q.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),l(`toolbar.clear`)]})]})})}function Lt({jobId:e,ticketId:t,onOpenFile:n}){let{t:r}=c(`code`),{apiBase:i}=Z(),[a,o]=(0,H.useState)(null),[s,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(0);(0,H.useEffect)(()=>{let n=new AbortController;o(null),l(!1),d(!1);let r=new URLSearchParams({limit:`100`});return e&&r.set(`jobId`,e),t&&r.set(`ticketId`,String(t)),fetch(`${i}/code/activity?${r}`,{signal:n.signal}).then(async e=>{if(!e.ok)throw Error(`activity_failed`);return e.json()}).then(e=>{if(n.signal.aborted)return;if(!Array.isArray(e.entries))throw Error(`invalid_activity_response`);let t=new Map;for(let n of e.entries)t.has(n.path)||t.set(n.path,n);o([...t.values()]),d(!!e.nextCursor||e.truncated===!0)}).catch(()=>{n.signal.aborted||l(!0)}),()=>n.abort()},[e,t,i,f]);let m=(0,H.useMemo)(()=>{let e=a??[];return{created:e.filter(e=>e.kind===`created`),modified:e.filter(e=>e.kind===`modified`),deleted:e.filter(e=>e.kind===`deleted`)}},[a]),h=a?.length??0,g=e?r(`provenancePanel.jobTitle`,{jobId:e}):r(`provenancePanel.specTitle`,{ticketId:t});return(0,Q.jsxs)(`section`,{className:`max-h-52 shrink-0 overflow-auto border-b border-border bg-card/35 px-4 py-3`,"data-testid":`provenance-result-panel`,children:[s&&(0,Q.jsxs)(`p`,{role:`alert`,className:`mb-2 text-xs`,children:[r(`activity.failed`),` `,(0,Q.jsx)(`button`,{type:`button`,className:`text-accent-primary underline`,onClick:()=>p(e=>e+1),children:r(`explore.retry`)})]}),!a&&!s&&(0,Q.jsx)(`p`,{role:`status`,className:`mb-2 text-xs text-muted-foreground`,children:r(`activity.loading`)}),u&&(0,Q.jsx)(`p`,{role:`status`,className:`mb-2 text-xs text-amber-600 dark:text-amber-400`,children:r(`activity.partial`)}),(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold truncate`,children:g}),(0,Q.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:a?r(`provenancePanel.touchedFiles`,{count:h}):`—`})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,Q.jsx)(Rt,{label:r(`action.added`),rows:m.created,icon:`created`,onOpenFile:n}),(0,Q.jsx)(Rt,{label:r(`action.changed`),rows:m.modified,icon:`modified`,onOpenFile:n}),(0,Q.jsx)(Rt,{label:r(`action.deleted`),rows:m.deleted,icon:`deleted`,onOpenFile:n})]})]}),(0,Q.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:e&&(0,Q.jsxs)(`a`,{href:`/jobs/${encodeURIComponent(e)}`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,Q.jsx)(E,{className:`h-3.5 w-3.5`}),r(`provenancePanel.log`)]})})]})]})}function Rt({label:e,rows:t,icon:n,onOpenFile:r}){return(0,Q.jsxs)(`details`,{className:`group min-w-[180px] max-w-[320px]`,children:[(0,Q.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 rounded-md bg-muted/35 px-2 py-1 text-xs hover:bg-muted/55`,children:[(0,Q.jsx)(n===`created`?_:n===`deleted`?g:T,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,Q.jsx)(`span`,{children:e}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:t.length})]}),t.length>0&&(0,Q.jsx)(`div`,{className:`mt-1 max-h-28 overflow-auto rounded-md border border-border/60 bg-background/60 p-1`,children:t.map((e,t)=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>r(e.path),className:`block w-full truncate rounded px-1.5 py-1 text-left font-mono text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,title:e.path,children:e.path},`${e.path}-${e.jobId??`job`}-${e.at}-${t}`))})]})}export{Pt as default};
|