@monster-orange/den 0.4.13 → 0.4.14

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.
@@ -439,6 +439,9 @@
439
439
  "ag.new.plainP":
440
440
  "ワークスペースのフォルダーで開くターミナル。エージェントなし。",
441
441
  "ag.new.task": "最初の指示(任意)",
442
+ "ag.new.name": "名前(任意)",
443
+ "ag.new.as": "{id} として開始します",
444
+ "ag.new.openRunning": "実行中のものを開く",
442
445
  "ag.new.taskPh":
443
446
  "例: 空の状態のストーリーを担当。デザインに合わせ、テストを追加する。",
444
447
  "ag.new.adv": "詳細設定: モデルと権限",
@@ -448,6 +451,27 @@
448
451
  "ag.new.modelDef": "ペルソナの既定({m})",
449
452
  "ag.new.ver": "バージョン",
450
453
  "ag.new.verDef": "ペルソナの既定({v})",
454
+ // AG-17.1, Bring in.
455
+ "ag.bring": "取り込む",
456
+ "ag.bring.title": "会話を取り込む",
457
+ "ag.bring.conv": "会話",
458
+ "ag.bring.help":
459
+ "このワークスペースのフォルダーまたはそのリポジトリのフォルダーで、Den の外で始めた会話です。新しい順に並びます。",
460
+ "ag.bring.none":
461
+ "このワークスペースのフォルダーやそのリポジトリのフォルダーに、Den の外で始めた会話はありません。",
462
+ "ag.bring.untitled": "無題の会話",
463
+ "ag.bring.open": "別の場所で開いています",
464
+ "ag.bring.openTip":
465
+ "まだ別のターミナルで開いています。先にそちらで閉じてください",
466
+ "ag.bring.agent": "エージェント {id}",
467
+ "ag.bring.note":
468
+ "実行していたフォルダーで続けます。ここからは Den のツールとガードが適用されます。ペインを閉じても実行は続きます。先にほかのターミナルで閉じてください。Den が開いていると判断できるのは、直近 1 分以内に書き込まれた会話だけです。",
469
+ "ag.bring.go": "取り込む",
470
+ "ag.bring.going": "取り込み中…",
471
+ "ag.bring.done": "{id} として取り込みました",
472
+ "ag.bring.now": "たった今",
473
+ "ag.bring.min": "{n} 分前",
474
+ "ag.bring.h": "{n} 時間前",
451
475
  "ag.new.note":
452
476
  "ワークスペースのフォルダーで開始します。ペインを閉じても実行は続きます。",
453
477
  "ag.new.started": "{w} で {p} を開始しました",
@@ -315,6 +315,20 @@ dialog.pe-dlg::backdrop {
315
315
  text-overflow: ellipsis;
316
316
  white-space: nowrap;
317
317
  }
318
+ /* Bring in: the title is cut, never its badge ("Agent reviewer"). */
319
+ .pr .pn.pnc {
320
+ display: flex;
321
+ align-items: center;
322
+ gap: 6px;
323
+ }
324
+ .pr .pnc .pt {
325
+ min-width: 0;
326
+ overflow: hidden;
327
+ text-overflow: ellipsis;
328
+ }
329
+ .pr .pnc .tagx {
330
+ flex: none;
331
+ }
318
332
  .pr .pn .role,
319
333
  .prow .pn .role {
320
334
  color: var(--faint);
@@ -537,3 +551,13 @@ dialog.pe-dlg::backdrop {
537
551
  padding: 2px 9px;
538
552
  font-size: 12.5px;
539
553
  }
554
+
555
+ /* AG-17.1, Bring in: a conversation that can't be picked (open elsewhere,
556
+ or an agent already continues it). */
557
+ .pr[aria-disabled="true"] {
558
+ opacity: 0.6;
559
+ cursor: default;
560
+ }
561
+ .pr[aria-disabled="true"]:hover {
562
+ background: none;
563
+ }
@@ -566,6 +566,9 @@
566
566
  "ag.new.plain": "Plain session",
567
567
  "ag.new.plainP": "A terminal in the workspace folder. No agent.",
568
568
  "ag.new.task": "First instruction (optional)",
569
+ "ag.new.name": "Name (optional)",
570
+ "ag.new.as": "Starts as {id}",
571
+ "ag.new.openRunning": "Open the running one",
569
572
  "ag.new.taskPh":
570
573
  "e.g. Take the empty-state story. Match the design and add a test.",
571
574
  "ag.new.adv": "Advanced: model and permissions",
@@ -575,6 +578,26 @@
575
578
  "ag.new.modelDef": "Persona default ({m})",
576
579
  "ag.new.ver": "Version",
577
580
  "ag.new.verDef": "Persona default ({v})",
581
+ // AG-17.1, Bring in.
582
+ "ag.bring": "Bring in",
583
+ "ag.bring.title": "Bring in a conversation",
584
+ "ag.bring.conv": "Conversation",
585
+ "ag.bring.help":
586
+ "Conversations started outside Den in this workspace's folder or its repos' folders, newest first.",
587
+ "ag.bring.none":
588
+ "No conversations started outside Den in this workspace's folder or its repos' folders.",
589
+ "ag.bring.untitled": "Untitled conversation",
590
+ "ag.bring.open": "Open elsewhere",
591
+ "ag.bring.openTip": "Still open in another terminal. Close it there first",
592
+ "ag.bring.agent": "Agent {id}",
593
+ "ag.bring.note":
594
+ "Continues it in the folder it ran in, with Den's tools and guards from now on. It keeps running if you close the pane. Close it in any other terminal first: Den only sees a conversation as open if it was written in the last minute.",
595
+ "ag.bring.go": "Bring in",
596
+ "ag.bring.going": "Bringing in…",
597
+ "ag.bring.done": "Brought in as {id}",
598
+ "ag.bring.now": "just now",
599
+ "ag.bring.min": "{n} min ago",
600
+ "ag.bring.h": "{n} h ago",
578
601
  "ag.new.note":
579
602
  "Starts in the workspace folder. It keeps running if you close the pane.",
580
603
  "ag.new.started": "Started {p} in {w}",
@@ -17,9 +17,9 @@
17
17
  * and sign-in (/api/web/*, /auth, /api/session/logout), the lock (R8:
18
18
  * /api/sudo-password*), or a shell-grade route other than its own
19
19
  * session's /api/sessions/<id>/*: agent start and resume mint tokens.
20
- * 403 `agent_forbidden`. One exception (AG-14.4): MCP agent_resume,
21
- * when mcp.actions lists it, for another agent of its own workspace
22
- * or a granted one (agent-resume-grant.ts). WS-3a (0.4.2) adds the workspace check at
20
+ * 403 `agent_forbidden`. Two exceptions: MCP agent_resume (AG-14.4)
21
+ * and agent_import (AG-17.1), each when mcp.actions lists it, inside
22
+ * its own workspace or a granted one (agent-resume-grant.ts). WS-3a (0.4.2) adds the workspace check at
23
23
  * agentRefusal's seam.
24
24
  * - Sign-in (§4, route-classes.ts): beyond loopback (a LAN name, a peer
25
25
  * that isn't loopback, or the edge hostname for a client on another
@@ -61,7 +61,12 @@
61
61
  import { randomBytes, timingSafeEqual, createHash } from "crypto";
62
62
  import type * as http from "http";
63
63
  import { readMcpConfig } from "../../shared/den-config.js";
64
- import { agentResumeRefusal, agentResumeTarget } from "./agent-resume-grant.js";
64
+ import {
65
+ agentImportRefusal,
66
+ agentImportTarget,
67
+ agentResumeRefusal,
68
+ agentResumeTarget,
69
+ } from "./agent-resume-grant.js";
65
70
  import * as net from "net";
66
71
  import * as os from "os";
67
72
  import {
@@ -718,6 +723,14 @@ export function agentRefusal(
718
723
  agentResumeRefusal(p, target.ws, target.id, mcpActions()) ??
719
724
  workspaceRefusal(p, pathname)
720
725
  );
726
+ // AG-17.1: MCP agent_import, opted in, inside the agent's scope (its
727
+ // list as well as its import: conversation titles are a person's).
728
+ const imp = agentImportTarget(pathname);
729
+ if (imp)
730
+ return (
731
+ agentImportRefusal(p, imp.ws, mcpActions()) ??
732
+ workspaceRefusal(p, pathname)
733
+ );
721
734
  if (cls === "shell-grade")
722
735
  return `${p.actor} can't ${method === "GET" ? "open" : "use"} ${pathname}: starting or resuming an agent, and the browser sessions, are a person's.`;
723
736
  return workspaceRefusal(p, pathname);
@@ -159,6 +159,10 @@ export const ROUTES: readonly RouteEntry[] = [
159
159
  "/api/personas/:id",
160
160
  "edits or deletes a person's own persona (AG-10.7); never an agent's token",
161
161
  ),
162
+ R(
163
+ "/api/workspaces/:ws/conversations",
164
+ "lists a runtime's own conversations in the workspace's folder: titles only, the ends of each file (AG-17.1)",
165
+ ),
162
166
  R(
163
167
  "/api/workspaces/:ws/agents/:id/paths",
164
168
  "which paths an agent printed exist in its workspace (stat only, AG-4b)",
@@ -353,6 +357,11 @@ export const ROUTES: readonly RouteEntry[] = [
353
357
  "/api/workspaces/:ws/agents",
354
358
  "starts an agent: a runtime in a PTY",
355
359
  ),
360
+ S(
361
+ ["POST"],
362
+ "/api/workspaces/:ws/conversations/:id/import",
363
+ "brings in a conversation: its runtime's resume in a PTY (AG-17.1)",
364
+ ),
356
365
  S(
357
366
  ["POST"],
358
367
  "/api/workspaces/:ws/sessions",
@@ -438,6 +447,10 @@ export const REGEX_ROUTES: Readonly<Record<string, readonly string[]>> = {
438
447
  "agent-routes.ts:RUNTIME_PATH": ["/api/agents/runtimes/:id/path"],
439
448
  "agent-routes.ts:PERSONA_PATH": ["/api/personas/:id"],
440
449
  "agent-routes.ts:PLAIN_PATH": ["/api/workspaces/:ws/sessions"],
450
+ "agent-routes.ts:CONVERSATIONS_PATH": [
451
+ "/api/workspaces/:ws/conversations",
452
+ "/api/workspaces/:ws/conversations/:id/import",
453
+ ],
441
454
  "session-routes.ts:IO_PATH": ["/api/sessions/:id/io"],
442
455
  "github-routes.ts:SIGNIN_PATH": ["/api/github/signin/:id"],
443
456
  "github-routes.ts:LINK_PATH": ["/api/web/owner/link/:id"],