vibe-coding-master 0.0.7 → 0.0.9

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.
@@ -4,6 +4,7 @@ import { ROLE_NAMES, isDispatchableRole } from "../../shared/constants.js";
4
4
  import { VcmError } from "../errors.js";
5
5
  import { resolveRepoPath } from "../adapters/filesystem.js";
6
6
  import { claudeTranscriptPath } from "./claude-transcript-service.js";
7
+ import { getTaskRuntimeRepoRoot } from "./task-service.js";
7
8
  export function createSessionService(deps) {
8
9
  const now = deps.now ?? (() => new Date().toISOString());
9
10
  async function launchRoleSession(repoRoot, taskSlug, role, input, launchMode) {
@@ -13,7 +14,8 @@ export function createSessionService(deps) {
13
14
  }
14
15
  const config = await deps.projectService.loadConfig(repoRoot);
15
16
  const task = await deps.taskService.loadTask(repoRoot, taskSlug);
16
- const paths = deps.artifactService.getHandoffPaths(repoRoot, task.handoffDir);
17
+ const taskRepoRoot = getTaskRuntimeRepoRoot(task);
18
+ const paths = deps.artifactService.getHandoffPaths(taskRepoRoot, task.handoffDir);
17
19
  const persisted = await loadPersistedRoleRecord(deps.fs, repoRoot, config.stateRoot, taskSlug, role);
18
20
  const permissionMode = input.permissionMode ?? persisted?.permissionMode ?? "default";
19
21
  const claudeSessionId = launchMode === "resume"
@@ -29,14 +31,14 @@ export function createSessionService(deps) {
29
31
  }
30
32
  const transcriptPath = launchMode === "resume" && persisted?.transcriptPath
31
33
  ? persisted.transcriptPath
32
- : claudeTranscriptPath(repoRoot, claudeSessionId);
34
+ : claudeTranscriptPath(taskRepoRoot, claudeSessionId);
33
35
  const startCommand = deps.claude.buildRoleStartCommand(role, config.claudeCommand, permissionMode, claudeSessionId, launchMode === "resume");
34
36
  const runtimeSession = await deps.runtime.createSession({
35
37
  taskSlug,
36
38
  role,
37
39
  command: startCommand.command,
38
40
  args: startCommand.args,
39
- cwd: repoRoot,
41
+ cwd: taskRepoRoot,
40
42
  env: {
41
43
  VCM_API_URL: deps.apiUrl,
42
44
  VCM_CTL_COMMAND: deps.vcmctlCommand,
@@ -45,7 +47,7 @@ export function createSessionService(deps) {
45
47
  },
46
48
  cols: input.cols,
47
49
  rows: input.rows,
48
- logPath: resolveRepoPath(repoRoot, paths.roleLogPaths[role])
50
+ logPath: resolveRepoPath(taskRepoRoot, paths.roleLogPaths[role])
49
51
  });
50
52
  const timestamp = now();
51
53
  const record = {
@@ -57,7 +59,7 @@ export function createSessionService(deps) {
57
59
  status: runtimeSession.status,
58
60
  command: startCommand.display,
59
61
  permissionMode,
60
- cwd: repoRoot,
62
+ cwd: taskRepoRoot,
61
63
  terminalBackend: "node-pty",
62
64
  pid: runtimeSession.pid,
63
65
  logPath: paths.roleLogPaths[role],
@@ -1,9 +1,11 @@
1
+ import { getTaskRuntimeRepoRoot } from "./task-service.js";
1
2
  export function createStatusService(deps) {
2
3
  return {
3
4
  async getTaskStatus(repoRoot, taskSlug) {
4
5
  const task = await deps.taskService.loadTask(repoRoot, taskSlug);
6
+ const taskRepoRoot = getTaskRuntimeRepoRoot(task);
5
7
  const artifacts = await deps.artifactService.listArtifacts({
6
- repoRoot,
8
+ repoRoot: taskRepoRoot,
7
9
  handoffDir: task.handoffDir
8
10
  });
9
11
  const sessions = await deps.sessionService.listRoleSessions(repoRoot, taskSlug);
@@ -8,6 +8,8 @@ export function createTaskService(deps) {
8
8
  assertValidTaskSlug(input.taskSlug);
9
9
  const config = await deps.projectService.loadConfig(repoRoot);
10
10
  const taskPath = getTaskPath(repoRoot, config.stateRoot, input.taskSlug);
11
+ const branch = `feature/${input.taskSlug}`;
12
+ const worktreePath = getTaskWorktreePath(repoRoot, config.stateRoot, input.taskSlug);
11
13
  if (await deps.fs.pathExists(taskPath)) {
12
14
  throw new VcmError({
13
15
  code: "TASK_EXISTS",
@@ -15,6 +17,46 @@ export function createTaskService(deps) {
15
17
  statusCode: 409
16
18
  });
17
19
  }
20
+ if (await deps.git.branchExists(repoRoot, branch)) {
21
+ throw new VcmError({
22
+ code: "TASK_BRANCH_EXISTS",
23
+ message: `Task branch already exists: ${branch}`,
24
+ statusCode: 409,
25
+ hint: "Choose a different task name or clean up the existing branch."
26
+ });
27
+ }
28
+ if (await deps.fs.pathExists(worktreePath)) {
29
+ throw new VcmError({
30
+ code: "TASK_WORKTREE_EXISTS",
31
+ message: `Task worktree already exists: ${worktreePath}`,
32
+ statusCode: 409,
33
+ hint: "Choose a different task name or clean up the existing worktree."
34
+ });
35
+ }
36
+ if (!(await deps.git.isIgnored(repoRoot, `${config.stateRoot}/tasks/.probe`))) {
37
+ throw new VcmError({
38
+ code: "VCM_STATE_NOT_IGNORED",
39
+ message: `${config.stateRoot}/ is not ignored by Git.`,
40
+ statusCode: 409,
41
+ hint: "Apply VCM Harness first so .gitignore contains the VCM managed block."
42
+ });
43
+ }
44
+ const baseStatus = await deps.git.getStatusPorcelain(repoRoot);
45
+ if (baseStatus.trim()) {
46
+ throw new VcmError({
47
+ code: "BASE_REPO_DIRTY",
48
+ message: "The connected repository has uncommitted changes.",
49
+ statusCode: 409,
50
+ hint: "Commit, stash, or discard base repository changes before creating a task worktree."
51
+ });
52
+ }
53
+ await deps.fs.ensureDir(path.dirname(worktreePath));
54
+ await deps.git.createWorktree({
55
+ repoRoot,
56
+ branch,
57
+ worktreePath,
58
+ baseRef: "HEAD"
59
+ });
18
60
  const timestamp = now();
19
61
  const task = {
20
62
  version: 1,
@@ -23,18 +65,20 @@ export function createTaskService(deps) {
23
65
  createdAt: timestamp,
24
66
  updatedAt: timestamp,
25
67
  repoRoot,
26
- branch: await deps.git.getCurrentBranch(repoRoot),
68
+ worktreePath,
69
+ branch,
27
70
  handoffDir: path.posix.join(config.handoffRoot, input.taskSlug),
28
71
  status: "created",
29
- specPath: input.specPath
72
+ specPath: input.specPath,
73
+ cleanupStatus: "active"
30
74
  };
31
75
  await deps.artifactService.ensureHandoffStructure({
32
- repoRoot,
76
+ repoRoot: worktreePath,
33
77
  taskSlug: input.taskSlug,
34
78
  handoffDir: task.handoffDir
35
79
  });
36
80
  await deps.artifactService.createArtifactTemplates({
37
- repoRoot,
81
+ repoRoot: worktreePath,
38
82
  taskSlug: input.taskSlug,
39
83
  handoffDir: task.handoffDir
40
84
  });
@@ -80,9 +124,79 @@ export function createTaskService(deps) {
80
124
  };
81
125
  await this.saveTask(repoRoot, updated);
82
126
  return updated;
127
+ },
128
+ async cleanupTask(repoRoot, taskSlug, options = {}) {
129
+ assertValidTaskSlug(taskSlug);
130
+ if (!deps.fs.removePath) {
131
+ throw new VcmError({
132
+ code: "FILESYSTEM_REMOVE_UNAVAILABLE",
133
+ message: "This VCM runtime cannot remove task files.",
134
+ statusCode: 500
135
+ });
136
+ }
137
+ const config = await deps.projectService.loadConfig(repoRoot);
138
+ const task = await this.loadTask(repoRoot, taskSlug);
139
+ const removedStatePaths = [];
140
+ const cleanedAt = now();
141
+ if (task.worktreePath) {
142
+ assertTaskWorktreePath(repoRoot, config.stateRoot, task.worktreePath);
143
+ const status = await deps.git.getStatusPorcelain(task.worktreePath);
144
+ if (status.trim() && !options.force) {
145
+ throw new VcmError({
146
+ code: "TASK_WORKTREE_DIRTY",
147
+ message: `Task worktree has uncommitted changes: ${task.worktreePath}`,
148
+ statusCode: 409,
149
+ hint: "Commit, stash, or discard the task worktree changes before cleanup, or retry with force."
150
+ });
151
+ }
152
+ await deps.git.removeWorktree(repoRoot, task.worktreePath, { force: options.force });
153
+ }
154
+ for (const statePath of getTaskStatePaths(repoRoot, config.stateRoot, taskSlug)) {
155
+ await deps.fs.removePath(statePath, { force: true });
156
+ removedStatePaths.push(statePath);
157
+ }
158
+ let deletedBranch;
159
+ if (options.deleteBranch) {
160
+ await deps.git.deleteBranch(repoRoot, task.branch, { force: options.forceDeleteBranch });
161
+ deletedBranch = task.branch;
162
+ }
163
+ return {
164
+ taskSlug,
165
+ removedWorktreePath: task.worktreePath,
166
+ removedStatePaths,
167
+ deletedBranch,
168
+ cleanedAt
169
+ };
83
170
  }
84
171
  };
85
172
  }
173
+ export function getTaskRuntimeRepoRoot(task) {
174
+ return task.worktreePath ?? task.repoRoot;
175
+ }
86
176
  function getTaskPath(repoRoot, stateRoot, taskSlug) {
87
177
  return path.join(repoRoot, stateRoot, "tasks", `${taskSlug}.json`);
88
178
  }
179
+ function getTaskWorktreePath(repoRoot, stateRoot, taskSlug) {
180
+ return path.join(repoRoot, stateRoot, "worktrees", taskSlug);
181
+ }
182
+ function getTaskStatePaths(repoRoot, stateRoot, taskSlug) {
183
+ return [
184
+ path.join(repoRoot, stateRoot, "tasks", `${taskSlug}.json`),
185
+ path.join(repoRoot, stateRoot, "sessions", `${taskSlug}.json`),
186
+ path.join(repoRoot, stateRoot, "messages", `${taskSlug}.jsonl`),
187
+ path.join(repoRoot, stateRoot, "orchestration", `${taskSlug}.json`)
188
+ ];
189
+ }
190
+ function assertTaskWorktreePath(repoRoot, stateRoot, worktreePath) {
191
+ const worktreeRoot = path.resolve(repoRoot, stateRoot, "worktrees");
192
+ const resolvedWorktreePath = path.resolve(worktreePath);
193
+ const relative = path.relative(worktreeRoot, resolvedWorktreePath);
194
+ if (relative.startsWith("..") || path.isAbsolute(relative) || relative === "") {
195
+ throw new VcmError({
196
+ code: "TASK_WORKTREE_PATH_INVALID",
197
+ message: `Refusing to clean up worktree outside ${worktreeRoot}.`,
198
+ statusCode: 400,
199
+ hint: resolvedWorktreePath
200
+ });
201
+ }
202
+ }
@@ -0,0 +1,6 @@
1
+ export function renderGitignoreHarnessRules() {
2
+ return [
3
+ "# VCM local app state, task metadata, session records, and task worktrees.",
4
+ ".ai/vcm/"
5
+ ].join("\n");
6
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#f5f2ea;color:#1c2024;line-height:1.5}html,body,#root{height:100%}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:#f5f2ea}button,input,select,textarea{font:inherit}button{border:1px solid #9ba6ad;background:#f8f7f2;color:#1d252b;border-radius:6px;min-height:34px;padding:6px 10px;cursor:pointer}button:hover:not(:disabled){background:#eef4f2;border-color:#607d74}button:disabled{cursor:not-allowed;opacity:.55}input,select,textarea:not(.xterm-helper-textarea){width:100%;border:1px solid #b9b0a1;border-radius:6px;background:#fffdf8;color:#202326;padding:8px 10px}textarea:not(.xterm-helper-textarea){min-height:240px;resize:vertical;font-family:Menlo,Monaco,Consolas,monospace;font-size:12px}h1,h2,p{margin-top:0}h1{margin-bottom:4px;font-size:26px;line-height:1.15}h2{margin-bottom:10px;font-size:14px;letter-spacing:0}.app-shell{display:grid;grid-template-columns:minmax(280px,320px) minmax(0,1fr);height:100vh;min-height:0;overflow:hidden}.app-shell.is-sidebar-collapsed{grid-template-columns:46px minmax(0,1fr)}.app-sidebar{position:relative;min-width:0;border-right:1px solid #d3c9b8;background:#fbfaf6;padding:14px;overflow:auto}.app-shell.is-sidebar-collapsed .app-sidebar{overflow:hidden;padding:8px}.sidebar-toggle{position:absolute;top:10px;right:10px;z-index:2;display:grid;place-items:center;width:28px;min-height:28px;padding:0;background:#fffdf8}.sidebar-toggle:before{width:8px;height:8px;border-color:currentColor;border-style:solid;border-width:0 2px 2px 0;content:"";transform:translate(2px) rotate(135deg)}.app-shell.is-sidebar-collapsed .sidebar-toggle{left:9px;right:auto}.app-shell.is-sidebar-collapsed .sidebar-toggle:before{transform:translate(-2px) rotate(-45deg)}.sidebar-content{min-width:0}.app-shell.is-sidebar-collapsed .sidebar-content{width:0;opacity:0;pointer-events:none}.app-main{min-width:0;height:100%;padding:14px 16px;overflow:auto}.brand-header{display:flex;gap:12px;align-items:baseline;margin-bottom:10px;padding-right:34px}.brand-header strong{font-size:18px}.brand-header span,.muted,.workspace-branch,.workspace-worktree{color:#667071;font-size:13px}.sidebar-section{margin-bottom:8px;border:1px solid #e0d6c7;border-radius:8px;background:#fffdfa;overflow:hidden}.sidebar-section-toggle{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;width:100%;min-height:34px;border:0;border-radius:0;background:transparent;color:#1c2024;font-size:13px;font-weight:750;text-align:left}.sidebar-section-toggle:hover{background:#f5f1e8}.sidebar-section-toggle[aria-expanded=true]{border-bottom:1px solid #ece5d9}.sidebar-section-chevron{width:8px;height:8px;border-color:currentColor;border-style:solid;border-width:0 2px 2px 0;transform:rotate(45deg)}.sidebar-section-toggle[aria-expanded=true] .sidebar-section-chevron{transform:rotate(-135deg)}.sidebar-section-content{padding:8px}.repo-connect,.project-summary,.harness-panel,.task-create{margin:0}.inline-form{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}.inline-form.has-recent-paths{grid-template-columns:minmax(0,1fr) auto}.inline-form>input{grid-column:1 / -1}.inline-form>button{justify-self:end}.inline-form.has-recent-paths>button{justify-self:auto}.repo-recent-select{min-width:0;max-width:none}.project-summary dl{display:grid;gap:8px;margin:0}.project-summary div{min-width:0}.project-summary dt{color:#6c6255;font-size:12px}.project-summary dd{margin:0;overflow-wrap:anywhere;font-size:13px}.warnings,.error-banner{border:1px solid #c87b54;background:#fff4ed;color:#6f3218;border-radius:6px;padding:10px 12px}.warnings{margin:12px 0 0;padding-left:26px;font-size:13px}.harness-panel{display:grid;gap:8px}.harness-panel-header{display:flex;justify-content:space-between;gap:8px;align-items:center}.harness-panel-header h2,.harness-panel-header p,.harness-result p{margin-bottom:0}.harness-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.harness-file-list{display:grid;gap:6px;margin:0;padding:0;list-style:none}.harness-file-list li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;border:1px solid #ece5d9;border-radius:6px;padding:6px 8px;background:#fffdfa}.harness-file-list span{overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.harness-changes,.harness-result{border:1px solid #e0d6c7;border-radius:6px;padding:8px;background:#f8f7f2;font-size:12px}.harness-changes h3{margin:0 0 4px;font-size:12px}.harness-changes ul,.harness-result ul{margin:0;padding-left:18px}.task-create form{display:grid;gap:8px}.task-create-preview{display:grid;gap:2px;border:1px solid #e0d6c7;border-radius:6px;background:#f8f7f2;padding:6px 8px}.task-create-preview span{color:#255f3d;font-size:12px;font-weight:700}.task-create-preview small{overflow:hidden;color:#687273;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.task-nav{display:grid;gap:8px}.task-nav-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;text-align:left}.task-nav-item.is-active,.role-tab.is-active{border-color:#2f6f73;background:#e8f1ef}.sidebar-settings{display:grid;gap:8px}.sidebar-settings button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;width:100%;text-align:left}.sidebar-settings .settings-toggle.is-active{border-color:#2f6f73;background:#e8f1ef}.workspace-header{display:grid;grid-template-columns:minmax(180px,auto) minmax(420px,1fr) auto auto;gap:16px;align-items:center;margin-bottom:6px}.workspace-title-line{display:flex;flex-wrap:wrap;gap:10px;align-items:baseline;min-width:0}.workspace-title-line h1{margin-bottom:0;font-size:18px;line-height:1.15}.workspace-branch{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace-worktree{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eyebrow{color:#7a5c2f;font-size:12px;font-weight:700;text-transform:uppercase}.role-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-bottom:8px;min-width:0}.workspace-header .role-tabs{margin-bottom:0}.role-tab{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;min-height:30px;padding:4px 8px;text-align:left}.workflow-panel{display:grid;gap:8px;margin:0}.workflow-summary p{margin-bottom:0}.workflow-summary p{color:#4f5558;font-size:13px}.workflow-steps{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:0;padding:0;list-style:none}.workflow-steps li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;min-height:28px;border:1px solid #ece5d9;border-radius:6px;padding:4px 6px;background:#fffdfa}.workflow-steps li.is-current{border-color:#2f6f73;background:#e8f1ef}.workflow-steps span{overflow:hidden;color:#394246;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr);flex:1;gap:10px;align-items:stretch;min-height:0}.workspace-main{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}.role-console-stack{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column}.role-console-panel{min-width:0;min-height:0;flex:1;display:none}.role-console-panel.is-active{display:flex;flex-direction:column}.session-console,.message-panel,.event-log,.empty-workspace{border:1px solid #d6d0c6;border-radius:8px;background:#fffdf8;padding:10px}.task-workspace{display:flex;flex-direction:column;gap:8px;height:100%;min-height:0}.session-console{display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;flex:1;min-height:0}.session-console-top{display:flex;gap:10px;align-items:center;justify-content:space-between}.session-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin:0 0 8px}.permission-mode-field{display:grid;grid-template-columns:auto minmax(180px,260px);gap:8px;align-items:center;width:fit-content;max-width:100%}.permission-mode-field span{color:#5f6a6c;font-size:13px;font-weight:650}.permission-mode-field small{display:block;color:#7b8587;font-size:11px;font-weight:500;line-height:1.2}.permission-mode-field select{width:100%;min-height:30px;border:1px solid #b9b0a1;border-radius:6px;background:#fffdf8;color:#202326;padding:4px 8px}.session-toolbar{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.session-toolbar button{min-height:30px;padding:4px 9px}.translation-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:28px;border:1px solid #b5bec4;border-radius:6px;background:#fffefa;color:#4f5558;font-size:12px;font-weight:650;padding:3px 10px;white-space:nowrap}.translation-toggle.is-active{border-color:#2f7e84;background:#e8f4f2;color:#145e64}.translation-settings-grid input[type=checkbox]{width:auto}.session-console-body{min-width:0;min-height:0;height:100%}.session-console-body.has-translation{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:stretch}.terminal-pane,.translation-pane{min-width:0;min-height:0}.terminal-frame,.terminal-empty{height:100%;min-height:0;border-radius:6px;overflow:hidden;background:#111316}.terminal-empty{display:grid;place-items:center;align-content:center;gap:8px;color:#d6d0c6;border:1px solid #292d31}.translation-panel{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:8px;height:100%;min-height:0;border:1px solid #292d31;border-radius:6px;background:#0d1117;color:#d6deeb;padding:8px;min-width:0;width:100%;overflow:hidden;font-family:Menlo,Monaco,Consolas,monospace}.translation-panel-header{display:grid;gap:3px}.translation-panel-titlebar,.translation-panel-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between}.translation-panel-header h2,.translation-panel-header p{margin-bottom:0}.translation-panel-titlebar h2{font-size:16px}.translation-panel-header p,.translation-composer span{color:#8b949e;font-size:12px}.translation-panel-actions button{border-color:#3a4149;background:#161b22;color:#d6deeb;min-height:26px;padding:2px 8px;font-size:12px}.translation-panel-actions button:hover:not(:disabled),.translation-composer-actions button:hover:not(:disabled){border-color:#58a6ff;background:#1f2937}.translation-panel-actions .auto-send-toggle.is-active{border-color:#56d364;background:#12261a;color:#d6deeb}.translation-panel-actions{justify-content:flex-end}.translation-entry-list{display:grid;align-content:start;gap:8px;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;scrollbar-color:#4b5563 #0d1117}.translation-entry{border:0;border-radius:0;background:transparent;min-width:0;max-width:100%;padding:0}.translation-entry pre{box-sizing:border-box;margin:0;max-height:none;max-width:100%;min-width:0;overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;font-family:Menlo,Monaco,Consolas,monospace;font-size:12px;line-height:1.45;color:#d6deeb}.translation-entry.is-tool-output pre{display:block;overflow:hidden;color:#7d8590;text-overflow:ellipsis;white-space:nowrap;width:100%}.translation-warning{color:#ffab70;margin-bottom:6px}.translation-composer{display:grid;gap:6px;border-top:1px solid #292d31;padding-top:8px}.translation-composer-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}.translation-composer textarea{width:100%;min-height:38px;max-height:88px;border-color:#3a4149;background:#0d1117;color:#d6deeb;font-family:inherit;font-size:12px;line-height:1.35;resize:vertical}.translation-composer textarea::placeholder{color:#7d8590}.translation-composer textarea::selection{background:#8b949e59;color:#fff}.translation-composer textarea:focus,.translation-composer textarea:focus-visible{border-color:#4b5563;outline:none;box-shadow:none}.translation-composer-actions{display:grid;align-content:start;gap:6px;min-width:104px}.translation-composer-actions button{border-color:#3a4149;background:#161b22;color:#d6deeb;width:100%;min-height:38px;padding:4px 9px;font-size:12px}.translation-panel .muted{color:#8b949e}.translation-panel .error-banner{border-color:#da7b72;background:#2d1518;color:#ffdcd7}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;display:grid;place-items:center;background:#181c1f61;padding:18px}.translation-settings-modal{display:grid;gap:12px;width:min(760px,100%);max-height:min(760px,92vh);overflow:auto;border:1px solid #d6d0c6;border-radius:8px;background:#fffdf8;padding:14px}.message-modal,.event-modal{display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;width:min(980px,100%);max-height:min(760px,92vh);overflow:hidden;border:1px solid #d6d0c6;border-radius:8px;background:#fffdf8;padding:14px}.translation-settings-modal header,.message-modal header,.event-modal header,.translation-settings-modal footer{display:flex;gap:8px;align-items:center;justify-content:space-between}.translation-prompt-settings{display:grid;gap:10px;border-top:1px solid #ece5d9;padding-top:12px}.translation-prompt-settings header{display:flex;gap:10px;align-items:end;justify-content:space-between}.translation-prompt-settings h3,.translation-prompt-settings p{margin-bottom:0}.translation-prompt-settings h3{font-size:13px}.translation-prompt-settings textarea{min-height:120px;max-height:260px;font-family:Menlo,Monaco,Consolas,monospace;font-size:12px}.translation-prompt-editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.translation-settings-modal h2,.message-modal h2,.message-modal p,.event-modal h2,.event-modal p,.translation-settings-modal p{margin-bottom:0}.translation-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.translation-settings-grid label{display:grid;gap:4px}.translation-settings-grid span{color:#4f5558;font-size:12px;font-weight:650}.translation-settings-grid select,.translation-prompt-settings select{min-height:34px;border:1px solid #b9b0a1;border-radius:6px;background:#fffdf8;color:#202326;padding:6px 10px}.translation-test-result{border-radius:6px;padding:8px;font-size:13px}.translation-test-result.is-ok{border:1px solid #6ea77e;background:#e6f3e9;color:#245334}.translation-test-result.is-error{border:1px solid #c46e5f;background:#fae9e6;color:#6f2b21}.message-panel{display:grid;gap:8px}.message-modal .message-panel,.event-modal .event-log{min-height:0;overflow:auto;border:0;background:transparent;padding:0}.message-panel-header{display:flex;justify-content:space-between;gap:12px;align-items:center}.message-panel-header h2,.message-panel-header p{margin-bottom:0}.message-controls,.message-mode-toggle,.message-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.message-mode-toggle{color:#4f5558;font-size:13px;font-weight:650}.message-mode-toggle input{width:auto}.message-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}.message-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start;border:1px solid #ece5d9;border-radius:6px;padding:8px;background:#fffdfa}.message-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:4px}.message-meta span:not(.status-badge),.message-path{color:#667071;font-size:12px}.message-item p{display:-webkit-box;margin-bottom:4px;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.message-path{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.event-log ol{margin:0;padding-left:22px;font-size:13px}.event-log{max-height:92px;overflow:auto}.event-log h2{margin-bottom:4px;font-size:13px}.event-log p{margin-bottom:0}.event-log li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-badge{display:inline-flex;align-items:center;justify-content:center;min-width:66px;min-height:20px;border-radius:999px;padding:2px 8px;border:1px solid #c7c1b8;background:#f2eee7;color:#4f5558;font-size:11px;white-space:nowrap}.status-running,.status-ok{border-color:#6ea77e;background:#e6f3e9;color:#245334}.status-blocked,.status-crashed,.status-missing,.status-empty{border-color:#c46e5f;background:#fae9e6;color:#6f2b21}.status-waiting,.status-starting,.status-incomplete{border-color:#c4a34e;background:#f7efcf;color:#604e16}.status-exited,.status-done,.status-resumable,.status-staged,.status-delivered,.status-acknowledged{border-color:#7b98b8;background:#e9f0f8;color:#2e4e70}.status-pending_approval,.status-queued,.status-translating,.status-ready,.status-create,.status-insert,.status-update{border-color:#c4a34e;background:#f7efcf;color:#604e16}.status-rejected,.status-failed,.status-cancelled,.status-blocked{border-color:#c46e5f;background:#fae9e6;color:#6f2b21}.status-pending{border-color:#c7c1b8;background:#f2eee7;color:#4f5558}.status-translated,.status-preserved{border-color:#7b98b8;background:#e9f0f8;color:#2e4e70}.empty-workspace{max-width:680px}@media(max-width:980px){.app-shell,.workspace-grid{grid-template-columns:1fr}.app-sidebar{border-right:0;border-bottom:1px solid #d3c9b8}.role-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.workflow-panel,.workflow-steps,.session-console-body.has-translation,.translation-settings-grid,.translation-prompt-editor-grid{grid-template-columns:1fr}}@media(max-width:560px){.app-main,.app-sidebar{padding:12px}.workspace-header,.inline-form,.inline-form.has-recent-paths{grid-template-columns:1fr;display:grid}.role-tabs{grid-template-columns:1fr}.terminal-frame,.terminal-empty{min-height:300px;height:54vh}.permission-mode-field{grid-template-columns:1fr;width:100%}}