@saadnvd1/agent-os 0.3.738 → 0.3.743

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.
Files changed (41) hide show
  1. package/components/Chat/Activity.test.ts +2 -1
  2. package/components/Chat/Activity.tsx +102 -64
  3. package/components/Chat/ChatPanel.tsx +4 -0
  4. package/components/Chat/LiveOutput.test.ts +36 -0
  5. package/components/Chat/Tools.tsx +42 -5
  6. package/data/chat/useChat.ts +10 -1
  7. package/lib/chat/demo.ts +42 -4
  8. package/lib/chat/drivers/claude-mapper.ts +10 -0
  9. package/lib/chat/drivers/claude.ts +9 -1
  10. package/lib/chat/drivers/demo-script.ts +148 -0
  11. package/lib/chat/drivers/demo.ts +21 -4
  12. package/lib/chat/drivers/edit-guard.ts +311 -0
  13. package/lib/chat/drivers/index.ts +2 -2
  14. package/lib/chat/drivers/opencode-config.ts +111 -0
  15. package/lib/chat/drivers/opencode-mapper.ts +125 -13
  16. package/lib/chat/drivers/opencode-plugin.ts +78 -0
  17. package/lib/chat/drivers/opencode-server.ts +7 -2
  18. package/lib/chat/drivers/opencode.ts +108 -9
  19. package/lib/chat/drivers/pi-edit-guard.ts +87 -0
  20. package/lib/chat/drivers/pi-mapper.ts +74 -1
  21. package/lib/chat/drivers/pi.ts +82 -3
  22. package/lib/chat/drivers/transient-retry.ts +87 -0
  23. package/lib/chat/drivers/turn-items.ts +74 -1
  24. package/lib/chat/drivers/turn-outcome.ts +48 -1
  25. package/lib/chat/events.ts +15 -1
  26. package/lib/chat/model-wait-live.ts +19 -0
  27. package/lib/chat/model-wait.ts +88 -0
  28. package/lib/chat/progress.ts +169 -0
  29. package/lib/chat/registry.ts +5 -0
  30. package/lib/chat/runner-watch.ts +71 -0
  31. package/lib/chat/runner.ts +4 -70
  32. package/lib/chat/tools.ts +14 -0
  33. package/lib/security/demo.ts +8 -0
  34. package/lib/tasks/move-testing.ts +6 -1
  35. package/package.json +1 -1
  36. package/scripts/screenshots/run.ts +27 -3
  37. package/scripts/screenshots/running-turn.ts +54 -0
  38. package/scripts/screenshots/seed.ts +15 -3
  39. package/scripts/screenshots/shoot.ts +3 -1
  40. package/scripts/screenshots/shots.ts +5 -0
  41. package/server.ts +10 -2
@@ -44,6 +44,9 @@ interface SessionSeed {
44
44
  minutesAgo: number;
45
45
  task?: { prompt: string; status: "running" | "merged"; branch: string };
46
46
  chat?: (start: number) => ChatItem[];
47
+ // Seeded only for the on-demand shots (shots.ts), so it never shows in the
48
+ // README's sidebar.
49
+ onDemand?: boolean;
47
50
  }
48
51
 
49
52
  const WORKSPACES = [
@@ -55,6 +58,14 @@ const WORKSPACES = [
55
58
  ];
56
59
 
57
60
  const SESSIONS: SessionSeed[] = [
61
+ {
62
+ key: "running",
63
+ name: "running-turn",
64
+ project: "storefront",
65
+ view: "chat",
66
+ minutesAgo: 1,
67
+ onDemand: true,
68
+ },
58
69
  {
59
70
  key: "checkout",
60
71
  name: "checkout-totals",
@@ -241,7 +252,7 @@ function tmux(args: string[]): void {
241
252
  execFileSync("tmux", demoTmuxArgs(args), { env: demoEnv(), stdio: "pipe" });
242
253
  }
243
254
 
244
- async function seedDb(): Promise<void> {
255
+ async function seedDb(onDemand: boolean): Promise<void> {
245
256
  process.env.DB_PATH = DB_PATH;
246
257
  const { getDb, insertSessionRow } = await import("../../lib/db");
247
258
  const db = getDb();
@@ -266,6 +277,7 @@ async function seedDb(): Promise<void> {
266
277
  const sessionIds = new Map<string, string>();
267
278
  const now = Date.now();
268
279
  for (const s of SESSIONS) {
280
+ if (s.onDemand && !onDemand) continue;
269
281
  const id = randomUUID();
270
282
  sessionIds.set(s.key, id);
271
283
  const tmuxName = `claude-${id}`;
@@ -441,14 +453,14 @@ function seedLinkedMachine(db: Db): void {
441
453
  ).run(PEER_HOST.id, `http://127.0.0.1:${PEER_PORT}`);
442
454
  }
443
455
 
444
- export async function seed(): Promise<void> {
456
+ export async function seed(onDemand = false): Promise<void> {
445
457
  teardownTmux();
446
458
  fs.rmSync(ROOT, { recursive: true, force: true });
447
459
  fs.mkdirSync(SCREENS, { recursive: true });
448
460
  fs.mkdirSync(TMUX_TMPDIR, { recursive: true, mode: 0o700 });
449
461
  writeHome();
450
462
  createRepos();
451
- await seedDb();
463
+ await seedDb(onDemand);
452
464
  console.log(` seeded ${DB_PATH}`);
453
465
  }
454
466
 
@@ -104,7 +104,9 @@ export async function shoot(only?: string[]): Promise<Raw[]> {
104
104
  const browser = await launch();
105
105
  const results: Raw[] = [];
106
106
  try {
107
- for (const shot of SHOTS.filter((s) => !only || only.includes(s.name))) {
107
+ for (const shot of SHOTS.filter((s) =>
108
+ only ? only.includes(s.name) : !s.onDemand
109
+ )) {
108
110
  results.push({ name: shot.name, files: await take(browser, shot) });
109
111
  }
110
112
  } finally {
@@ -1,4 +1,5 @@
1
1
  import type { Page } from "playwright";
2
+ import { RUNNING_TURN_SHOTS } from "./running-turn";
2
3
 
3
4
  // Each shot is one or more raw captures; frame.ts composes them.
4
5
  export interface Part {
@@ -15,6 +16,9 @@ export interface Part {
15
16
  export interface Shot {
16
17
  name: string;
17
18
  parts: Part[];
19
+ // Only with --only <name>: it changes the demo (a session is added, a turn
20
+ // is started) and is not one of the README's pictures.
21
+ onDemand?: boolean;
18
22
  }
19
23
 
20
24
  const CHAT = "checkout-totals";
@@ -57,6 +61,7 @@ async function openDialog(page: Page, button: RegExp): Promise<void> {
57
61
  }
58
62
 
59
63
  export const SHOTS: Shot[] = [
64
+ ...RUNNING_TURN_SHOTS,
60
65
  {
61
66
  name: "hero",
62
67
  parts: [
package/server.ts CHANGED
@@ -39,6 +39,7 @@ import {
39
39
  assertDemoSandbox,
40
40
  demoAllowsUpgrade,
41
41
  admitDemoSocket,
42
+ demoChatMode,
42
43
  demoMode,
43
44
  gateDemoRequest,
44
45
  refuseDemoUpgrade,
@@ -116,7 +117,9 @@ if (!live) {
116
117
  claimAgentosEnv(port);
117
118
  // Demo mode: seeded data, nothing that runs code (lib/security/demo).
118
119
  const demo = demoMode();
119
- if (demo) assertDemoSandbox();
120
+ // The screenshot server's scripted chat turns: the sandbox, not the lockdown.
121
+ const demoChat = demoChatMode();
122
+ if (demo || demoChat) assertDemoSandbox();
120
123
  // Fixed for this process and handed to the chat workers it starts.
121
124
  buildId();
122
125
  if (!demo) {
@@ -252,7 +255,12 @@ app.prepare().then(async () => {
252
255
  });
253
256
  chatWss.on("connection", (ws: WebSocket, request: IncomingMessage) => {
254
257
  const params = new URL(request.url ?? "", "http://x").searchParams;
255
- serveChatSocket(ws, params, (json) => sendBounded(ws, json), demo);
258
+ serveChatSocket(
259
+ ws,
260
+ params,
261
+ (json) => sendBounded(ws, json),
262
+ demo || demoChat
263
+ );
256
264
  });
257
265
 
258
266
  // Handle WebSocket upgrades