cli-jaw 2.1.1 → 2.1.3
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/README.ja.md +8 -6
- package/README.ko.md +8 -6
- package/README.md +18 -11
- package/README.zh-CN.md +8 -6
- package/dist/bin/cli-jaw.js +19 -3
- package/dist/bin/cli-jaw.js.map +1 -1
- package/dist/bin/commands/browser.js +1 -1
- package/dist/bin/commands/browser.js.map +1 -1
- package/dist/bin/commands/chat-search.js +71 -0
- package/dist/bin/commands/chat-search.js.map +1 -0
- package/dist/bin/commands/chat.js +98 -58
- package/dist/bin/commands/chat.js.map +1 -1
- package/dist/bin/commands/dispatch.js +130 -5
- package/dist/bin/commands/dispatch.js.map +1 -1
- package/dist/bin/commands/goal.js +66 -9
- package/dist/bin/commands/goal.js.map +1 -1
- package/dist/bin/commands/history.js +61 -0
- package/dist/bin/commands/history.js.map +1 -0
- package/dist/bin/commands/lock.js +104 -0
- package/dist/bin/commands/lock.js.map +1 -0
- package/dist/bin/commands/memory.js +23 -2
- package/dist/bin/commands/memory.js.map +1 -1
- package/dist/bin/commands/orchestrate.js.map +1 -1
- package/dist/bin/commands/project.js +4 -1
- package/dist/bin/commands/project.js.map +1 -1
- package/dist/bin/commands/tui/fullscreen-mode.js +237 -0
- package/dist/bin/commands/tui/fullscreen-mode.js.map +1 -0
- package/dist/bin/commands/tui/input-handler.js +139 -52
- package/dist/bin/commands/tui/input-handler.js.map +1 -1
- package/dist/bin/commands/tui/overlays.js +177 -70
- package/dist/bin/commands/tui/overlays.js.map +1 -1
- package/dist/bin/commands/tui/renderer.js +70 -20
- package/dist/bin/commands/tui/renderer.js.map +1 -1
- package/dist/bin/commands/tui/simple-mode.js +1 -2
- package/dist/bin/commands/tui/simple-mode.js.map +1 -1
- package/dist/bin/commands/tui/tui-io.js +8 -0
- package/dist/bin/commands/tui/tui-io.js.map +1 -0
- package/dist/bin/commands/tui/types.js +9 -0
- package/dist/bin/commands/tui/types.js.map +1 -1
- package/dist/bin/commands/tui/ws-handler.js +115 -23
- package/dist/bin/commands/tui/ws-handler.js.map +1 -1
- package/dist/bin/commands/worker.js +159 -0
- package/dist/bin/commands/worker.js.map +1 -0
- package/dist/bin/postinstall.js +0 -76
- package/dist/bin/postinstall.js.map +1 -1
- package/dist/lib/mcp/format-converters.js +21 -2
- package/dist/lib/mcp/format-converters.js.map +1 -1
- package/dist/lib/mcp/mcp-registry.js +75 -0
- package/dist/lib/mcp/mcp-registry.js.map +1 -0
- package/dist/lib/stt.js +1 -1
- package/dist/lib/stt.js.map +1 -1
- package/dist/lib/upload.js +7 -0
- package/dist/lib/upload.js.map +1 -1
- package/dist/scripts/fresh-install-smoke.js +1 -1
- package/dist/scripts/fresh-install-smoke.js.map +1 -1
- package/dist/server.js +151 -22
- package/dist/server.js.map +1 -1
- package/dist/src/agent/agy-runtime.js +1 -0
- package/dist/src/agent/agy-runtime.js.map +1 -1
- package/dist/src/agent/agy-transcript-watcher.js +78 -0
- package/dist/src/agent/agy-transcript-watcher.js.map +1 -0
- package/dist/src/agent/agy-transcript.js +158 -0
- package/dist/src/agent/agy-transcript.js.map +1 -0
- package/dist/src/agent/args.js +51 -5
- package/dist/src/agent/args.js.map +1 -1
- package/dist/src/agent/claude-e-runtime.js +1 -1
- package/dist/src/agent/claude-e-runtime.js.map +1 -1
- package/dist/src/agent/codex-app-client.js +2 -2
- package/dist/src/agent/codex-app-client.js.map +1 -1
- package/dist/src/agent/cursor-runtime.js +1 -0
- package/dist/src/agent/cursor-runtime.js.map +1 -1
- package/dist/src/agent/error-classifier.js +6 -1
- package/dist/src/agent/error-classifier.js.map +1 -1
- package/dist/src/agent/events/claude.js +1 -0
- package/dist/src/agent/events/claude.js.map +1 -1
- package/dist/src/agent/events/codex.js +0 -44
- package/dist/src/agent/events/codex.js.map +1 -1
- package/dist/src/agent/events/helpers.js +52 -5
- package/dist/src/agent/events/helpers.js.map +1 -1
- package/dist/src/agent/events/opencode.js +6 -2
- package/dist/src/agent/events/opencode.js.map +1 -1
- package/dist/src/agent/events/summary.js +3 -2
- package/dist/src/agent/events/summary.js.map +1 -1
- package/dist/src/agent/events/tool-labels.js +8 -5
- package/dist/src/agent/events/tool-labels.js.map +1 -1
- package/dist/src/agent/kiro-auth.js +213 -0
- package/dist/src/agent/kiro-auth.js.map +1 -0
- package/dist/src/agent/kiro-models.js +79 -0
- package/dist/src/agent/kiro-models.js.map +1 -0
- package/dist/src/agent/kiro-runtime.js +314 -0
- package/dist/src/agent/kiro-runtime.js.map +1 -0
- package/dist/src/agent/lifecycle-handler.js +208 -23
- package/dist/src/agent/lifecycle-handler.js.map +1 -1
- package/dist/src/agent/memory-flush-controller.js +3 -4
- package/dist/src/agent/memory-flush-controller.js.map +1 -1
- package/dist/src/agent/resume-classifier.js +18 -1
- package/dist/src/agent/resume-classifier.js.map +1 -1
- package/dist/src/agent/session-persistence.js +2 -2
- package/dist/src/agent/session-persistence.js.map +1 -1
- package/dist/src/agent/smoke-detector.js +3 -0
- package/dist/src/agent/smoke-detector.js.map +1 -1
- package/dist/src/agent/spawn/queue.js +11 -5
- package/dist/src/agent/spawn/queue.js.map +1 -1
- package/dist/src/agent/spawn/resume.js +6 -1
- package/dist/src/agent/spawn/resume.js.map +1 -1
- package/dist/src/agent/spawn-env.js +1 -1
- package/dist/src/agent/spawn-env.js.map +1 -1
- package/dist/src/agent/spawn.js +231 -43
- package/dist/src/agent/spawn.js.map +1 -1
- package/dist/src/agent/watchdog.js +1 -1
- package/dist/src/agent/watchdog.js.map +1 -1
- package/dist/src/browser/actions.js +0 -8
- package/dist/src/browser/actions.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/browser-escalation.js +5 -29
- package/dist/src/browser/adaptive-fetch/browser-escalation.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/browser-runtime.js +5 -14
- package/dist/src/browser/adaptive-fetch/browser-runtime.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/browser-session.js +14 -28
- package/dist/src/browser/adaptive-fetch/browser-session.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/challenge-detector.js +4 -26
- package/dist/src/browser/adaptive-fetch/challenge-detector.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/content-scorer.js +5 -29
- package/dist/src/browser/adaptive-fetch/content-scorer.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/endpoint-resolvers.js +0 -64
- package/dist/src/browser/adaptive-fetch/endpoint-resolvers.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/fetcher.js +4 -19
- package/dist/src/browser/adaptive-fetch/fetcher.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/human-loop.js +0 -26
- package/dist/src/browser/adaptive-fetch/human-loop.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/index.js +74 -145
- package/dist/src/browser/adaptive-fetch/index.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/metadata.js +1 -41
- package/dist/src/browser/adaptive-fetch/metadata.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/output.js +1 -18
- package/dist/src/browser/adaptive-fetch/output.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/reader-adapters.js +43 -75
- package/dist/src/browser/adaptive-fetch/reader-adapters.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/safety.js +5 -48
- package/dist/src/browser/adaptive-fetch/safety.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/third-party-readers.js +0 -11
- package/dist/src/browser/adaptive-fetch/third-party-readers.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/trace.js +3 -18
- package/dist/src/browser/adaptive-fetch/trace.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/transforms.js +0 -23
- package/dist/src/browser/adaptive-fetch/transforms.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/types.js +3 -0
- package/dist/src/browser/adaptive-fetch/types.js.map +1 -0
- package/dist/src/browser/adaptive-fetch/validators.js +0 -17
- package/dist/src/browser/adaptive-fetch/validators.js.map +1 -1
- package/dist/src/browser/adaptive-fetch/waf-profiles.js +0 -10
- package/dist/src/browser/adaptive-fetch/waf-profiles.js.map +1 -1
- package/dist/src/browser/connection.js +1 -1
- package/dist/src/browser/connection.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt-response.js +0 -1
- package/dist/src/browser/web-ai/chatgpt-response.js.map +1 -1
- package/dist/src/browser/web-ai/chatgpt.js +0 -33
- package/dist/src/browser/web-ai/chatgpt.js.map +1 -1
- package/dist/src/browser/web-ai/diagnostics.js +0 -16
- package/dist/src/browser/web-ai/diagnostics.js.map +1 -1
- package/dist/src/browser/web-ai/doctor.js.map +1 -1
- package/dist/src/browser/web-ai/errors.js +1 -1
- package/dist/src/browser/web-ai/errors.js.map +1 -1
- package/dist/src/browser/web-ai/grok-live.js +2 -0
- package/dist/src/browser/web-ai/grok-live.js.map +1 -1
- package/dist/src/cli/claude-models.js +2 -2
- package/dist/src/cli/claude-models.js.map +1 -1
- package/dist/src/cli/command-context.js.map +1 -1
- package/dist/src/cli/commands.js +16 -4
- package/dist/src/cli/commands.js.map +1 -1
- package/dist/src/cli/compact.js +2 -1
- package/dist/src/cli/compact.js.map +1 -1
- package/dist/src/cli/handlers/session-handlers.js +34 -0
- package/dist/src/cli/handlers/session-handlers.js.map +1 -0
- package/dist/src/cli/handlers-project.js.map +1 -1
- package/dist/src/cli/handlers-runtime.js +2 -0
- package/dist/src/cli/handlers-runtime.js.map +1 -1
- package/dist/src/cli/handlers-workflows.js +85 -17
- package/dist/src/cli/handlers-workflows.js.map +1 -1
- package/dist/src/cli/handlers.js +84 -43
- package/dist/src/cli/handlers.js.map +1 -1
- package/dist/src/cli/readiness.js +17 -1
- package/dist/src/cli/readiness.js.map +1 -1
- package/dist/src/cli/registry-live.js +17 -0
- package/dist/src/cli/registry-live.js.map +1 -0
- package/dist/src/cli/registry.js +51 -10
- package/dist/src/cli/registry.js.map +1 -1
- package/dist/src/cli/tui/composer.js +135 -5
- package/dist/src/cli/tui/composer.js.map +1 -1
- package/dist/src/cli/tui/diffview.js +41 -0
- package/dist/src/cli/tui/diffview.js.map +1 -0
- package/dist/src/cli/tui/editor.js +45 -0
- package/dist/src/cli/tui/editor.js.map +1 -0
- package/dist/src/cli/tui/file-mention.js +78 -0
- package/dist/src/cli/tui/file-mention.js.map +1 -0
- package/dist/src/cli/tui/highlight.js +82 -0
- package/dist/src/cli/tui/highlight.js.map +1 -0
- package/dist/src/cli/tui/keymap.js +21 -0
- package/dist/src/cli/tui/keymap.js.map +1 -1
- package/dist/src/cli/tui/markdown.js +124 -0
- package/dist/src/cli/tui/markdown.js.map +1 -0
- package/dist/src/cli/tui/mode.js +26 -0
- package/dist/src/cli/tui/mode.js.map +1 -0
- package/dist/src/cli/tui/overlay.js +121 -98
- package/dist/src/cli/tui/overlay.js.map +1 -1
- package/dist/src/cli/tui/render/frame.js +72 -0
- package/dist/src/cli/tui/render/frame.js.map +1 -0
- package/dist/src/cli/tui/render/layout.js +22 -0
- package/dist/src/cli/tui/render/layout.js.map +1 -0
- package/dist/src/cli/tui/render/mouse.js +25 -0
- package/dist/src/cli/tui/render/mouse.js.map +1 -0
- package/dist/src/cli/tui/render/scheduler.js +37 -0
- package/dist/src/cli/tui/render/scheduler.js.map +1 -0
- package/dist/src/cli/tui/render/viewport.js +82 -0
- package/dist/src/cli/tui/render/viewport.js.map +1 -0
- package/dist/src/cli/tui/renderers.js +37 -0
- package/dist/src/cli/tui/renderers.js.map +1 -1
- package/dist/src/cli/tui/stream.js +48 -0
- package/dist/src/cli/tui/stream.js.map +1 -0
- package/dist/src/cli/tui/text-buffer.js +143 -0
- package/dist/src/cli/tui/text-buffer.js.map +1 -0
- package/dist/src/cli/tui/theme.js +128 -0
- package/dist/src/cli/tui/theme.js.map +1 -0
- package/dist/src/cli/tui/transcript.js +4 -0
- package/dist/src/cli/tui/transcript.js.map +1 -1
- package/dist/src/command-contract/help-renderer.js +1 -1
- package/dist/src/command-contract/help-renderer.js.map +1 -1
- package/dist/src/core/chat-sessions.js +63 -0
- package/dist/src/core/chat-sessions.js.map +1 -0
- package/dist/src/core/cli-detection.js +14 -0
- package/dist/src/core/cli-detection.js.map +1 -1
- package/dist/src/core/compact.js +43 -11
- package/dist/src/core/compact.js.map +1 -1
- package/dist/src/core/config.js +14 -1
- package/dist/src/core/config.js.map +1 -1
- package/dist/src/core/db.js +52 -12
- package/dist/src/core/db.js.map +1 -1
- package/dist/src/core/employees.js +2 -2
- package/dist/src/core/employees.js.map +1 -1
- package/dist/src/core/main-session.js +3 -2
- package/dist/src/core/main-session.js.map +1 -1
- package/dist/src/discord/bot.js.map +1 -1
- package/dist/src/discord/discord-file.js +1 -1
- package/dist/src/discord/discord-file.js.map +1 -1
- package/dist/src/discord/send-only-client.js +1 -3
- package/dist/src/discord/send-only-client.js.map +1 -1
- package/dist/src/goal/heartbeat.js +113 -7
- package/dist/src/goal/heartbeat.js.map +1 -1
- package/dist/src/goal/store.js +44 -5
- package/dist/src/goal/store.js.map +1 -1
- package/dist/src/ide/diff.js +37 -0
- package/dist/src/ide/diff.js.map +1 -1
- package/dist/src/manager/launchd-service.js +1 -1
- package/dist/src/manager/launchd-service.js.map +1 -1
- package/dist/src/manager/lifecycle-helpers.js +14 -0
- package/dist/src/manager/lifecycle-helpers.js.map +1 -1
- package/dist/src/manager/lifecycle-store.js.map +1 -1
- package/dist/src/manager/lifecycle.js +94 -5
- package/dist/src/manager/lifecycle.js.map +1 -1
- package/dist/src/manager/notes/routes.js +0 -31
- package/dist/src/manager/notes/routes.js.map +1 -1
- package/dist/src/manager/notes/ws.js.map +1 -1
- package/dist/src/manager/preview-link-policy.js +11 -4
- package/dist/src/manager/preview-link-policy.js.map +1 -1
- package/dist/src/manager/registry.js.map +1 -1
- package/dist/src/manager/routes/dashboard-memory.js.map +1 -1
- package/dist/src/manager/scan.js +36 -1
- package/dist/src/manager/scan.js.map +1 -1
- package/dist/src/manager/server.js +42 -7
- package/dist/src/manager/server.js.map +1 -1
- package/dist/src/manager/shutdown.js +8 -3
- package/dist/src/manager/shutdown.js.map +1 -1
- package/dist/src/manager/systemd-service.js +1 -1
- package/dist/src/manager/systemd-service.js.map +1 -1
- package/dist/src/memory/indexing.js +49 -1
- package/dist/src/memory/indexing.js.map +1 -1
- package/dist/src/memory/keyword-expand.js +0 -187
- package/dist/src/memory/keyword-expand.js.map +1 -1
- package/dist/src/memory/runtime.js +3 -2
- package/dist/src/memory/runtime.js.map +1 -1
- package/dist/src/memory/shared.js.map +1 -1
- package/dist/src/messaging/send.js +66 -7
- package/dist/src/messaging/send.js.map +1 -1
- package/dist/src/orchestrator/collect.js +3 -2
- package/dist/src/orchestrator/collect.js.map +1 -1
- package/dist/src/orchestrator/distribute.js +9 -3
- package/dist/src/orchestrator/distribute.js.map +1 -1
- package/dist/src/orchestrator/friction.js +59 -0
- package/dist/src/orchestrator/friction.js.map +1 -0
- package/dist/src/orchestrator/gateway.js +4 -4
- package/dist/src/orchestrator/gateway.js.map +1 -1
- package/dist/src/orchestrator/pipeline.js +89 -45
- package/dist/src/orchestrator/pipeline.js.map +1 -1
- package/dist/src/orchestrator/sanitize.js +69 -0
- package/dist/src/orchestrator/sanitize.js.map +1 -0
- package/dist/src/orchestrator/seed.js +50 -0
- package/dist/src/orchestrator/seed.js.map +1 -0
- package/dist/src/orchestrator/state-machine.js +215 -76
- package/dist/src/orchestrator/state-machine.js.map +1 -1
- package/dist/src/orchestrator/worker-monitor.js +1 -1
- package/dist/src/orchestrator/worker-monitor.js.map +1 -1
- package/dist/src/orchestrator/worker-progress.js +29 -0
- package/dist/src/orchestrator/worker-progress.js.map +1 -0
- package/dist/src/orchestrator/worker-registry.js +63 -2
- package/dist/src/orchestrator/worker-registry.js.map +1 -1
- package/dist/src/prompt/builder.js +190 -115
- package/dist/src/prompt/builder.js.map +1 -1
- package/dist/src/prompt/templates/a1-system.md +124 -61
- package/dist/src/prompt/templates/control-system.md +2 -2
- package/dist/src/prompt/templates/employee.md +41 -56
- package/dist/src/prompt/templates/orchestration.md +23 -8
- package/dist/src/prompt/templates/skills.md +6 -0
- package/dist/src/routes/browser.js +3 -3
- package/dist/src/routes/browser.js.map +1 -1
- package/dist/src/routes/employees.js +4 -4
- package/dist/src/routes/employees.js.map +1 -1
- package/dist/src/routes/goal.js +48 -4
- package/dist/src/routes/goal.js.map +1 -1
- package/dist/src/routes/heartbeat.js +1 -1
- package/dist/src/routes/heartbeat.js.map +1 -1
- package/dist/src/routes/i18n.js +1 -1
- package/dist/src/routes/i18n.js.map +1 -1
- package/dist/src/routes/jaw-memory.js +1 -1
- package/dist/src/routes/jaw-memory.js.map +1 -1
- package/dist/src/routes/memory.js.map +1 -1
- package/dist/src/routes/messaging.js +8 -3
- package/dist/src/routes/messaging.js.map +1 -1
- package/dist/src/routes/orchestrate.js +267 -117
- package/dist/src/routes/orchestrate.js.map +1 -1
- package/dist/src/routes/quota-agy-reverse.js +6 -5
- package/dist/src/routes/quota-agy-reverse.js.map +1 -1
- package/dist/src/routes/quota-kiro-reverse.js +187 -0
- package/dist/src/routes/quota-kiro-reverse.js.map +1 -0
- package/dist/src/routes/quota.js +68 -6
- package/dist/src/routes/quota.js.map +1 -1
- package/dist/src/routes/settings.js +37 -8
- package/dist/src/routes/settings.js.map +1 -1
- package/dist/src/routes/skills.js.map +1 -1
- package/dist/src/security/path-guards.js +0 -3
- package/dist/src/security/path-guards.js.map +1 -1
- package/dist/src/security/security-audit-log.js.map +1 -1
- package/dist/src/shared/shell-command-display.js +51 -0
- package/dist/src/shared/shell-command-display.js.map +1 -0
- package/dist/src/telegram/bot.js.map +1 -1
- package/dist/src/trace/store.js +32 -0
- package/dist/src/trace/store.js.map +1 -1
- package/dist/src/types/cli-engine.js +1 -0
- package/dist/src/types/cli-engine.js.map +1 -1
- package/dist/src/workflows/employee-boundary.js +7 -7
- package/dist/src/workflows/employee-boundary.js.map +1 -1
- package/dist/src/workflows/handoff.js +16 -16
- package/dist/src/workflows/handoff.js.map +1 -1
- package/dist/src/workflows/scope-sandbox.js +58 -0
- package/dist/src/workflows/scope-sandbox.js.map +1 -0
- package/package.json +1 -1
- package/public/assets/providers/kiro-color.svg +15 -0
- package/public/assets/providers/kiro.svg +14 -0
- package/public/css/chat.css +27 -0
- package/public/css/modals.css +79 -0
- package/public/css/orc-state.css +10 -6
- package/public/css/sidebar.css +85 -0
- package/public/css/variables.css +6 -2
- package/public/dist/assets/{Agent-CIUGaUVn.js → Agent-DBKNQ6tp.js} +1 -1
- package/public/dist/assets/{DocPanel-C1pGgE-S.js → DocPanel-BU16GUlB.js} +1 -1
- package/public/dist/assets/DocPanel-gU-WkgyA.css +1 -0
- package/public/dist/assets/Employees-F0ssNuO-.js +1 -0
- package/public/dist/assets/{FolderPanel-DSkanaGN.js → FolderPanel-DT0fU8f2.js} +1 -1
- package/public/dist/assets/Heartbeat-fsuLzY9c.js +1 -0
- package/public/dist/assets/Mcp-_Yq4N3Sk.js +4 -0
- package/public/dist/assets/{Memory-BgN8djV4.js → Memory-CRR8kotI.js} +1 -1
- package/public/dist/assets/{ModelProvider-DHQ1Zvw0.js → ModelProvider-DQgISbKw.js} +1 -1
- package/public/dist/assets/agent-meta-C4mauPL5.js +1 -0
- package/public/dist/assets/app-0OQhPpTG.css +1 -0
- package/public/dist/assets/app-CSqIyg9A.js +55 -0
- package/public/dist/assets/constants-BHMkzpN_.js +1 -0
- package/public/dist/assets/{employees-DiNLzEXS.js → employees-CZdWHH-r.js} +7 -7
- package/public/dist/assets/idb-cache-0LNMskFB.js +1 -0
- package/public/dist/assets/idb-cache-5H89a4l8.js +1 -0
- package/public/dist/assets/manager-CGTQ5EIm.js +12 -0
- package/public/dist/assets/manager-UBunDqMH.css +1 -0
- package/public/dist/assets/{memory-B_nn0A4v.js → memory-B3QSmj_e.js} +9 -9
- package/public/dist/assets/memory-DOBqiuPc.js +1 -0
- package/public/dist/assets/{provider-icons-XEfJPGTe.js → provider-icons-Crv6yvlG.js} +35 -6
- package/public/dist/assets/render-J11oxfnl.js +28 -0
- package/public/dist/assets/settings-BV_2Bh0_.js +1 -0
- package/public/dist/assets/settings-m_cim0ov.js +151 -0
- package/public/dist/assets/sidebar-ZBXdBgF7.js +49 -0
- package/public/dist/assets/{skills-COa4iSwL.js → skills-CjaBmIPV.js} +6 -6
- package/public/dist/assets/skills-Xm3fl1zr.js +1 -0
- package/public/dist/assets/{slash-commands-C_ePvrPi.js → slash-commands-71jc07Wf.js} +1 -1
- package/public/dist/assets/slash-commands-BO6ssnAz.js +1 -0
- package/public/dist/assets/{trace-drawer-CY4z_Ie8.js → trace-drawer-Czvf2P2o.js} +1 -1
- package/public/dist/assets/ui-CverZJnd.js +1 -0
- package/public/dist/assets/ui-qKxy-4p9.js +142 -0
- package/public/dist/index.html +113 -86
- package/public/dist/manager/index.html +2 -2
- package/public/index.html +111 -84
- package/public/js/constants.ts +34 -11
- package/public/js/features/chat-messages.ts +13 -2
- package/public/js/features/chat-search.ts +5 -1
- package/public/js/features/chat.ts +86 -44
- package/public/js/features/employees.ts +7 -2
- package/public/js/features/idb-cache.ts +4 -0
- package/public/js/features/media-lightbox.ts +40 -0
- package/public/js/features/message-history.ts +55 -7
- package/public/js/features/pending-queue.ts +28 -4
- package/public/js/features/process-block.ts +32 -17
- package/public/js/features/process-log-adapter.ts +11 -2
- package/public/js/features/settings-cli-status-render.ts +161 -0
- package/public/js/features/settings-cli-status.ts +136 -187
- package/public/js/features/settings-core.ts +5 -1
- package/public/js/features/settings-mcp.ts +513 -7
- package/public/js/features/settings-types.ts +1 -0
- package/public/js/features/settings.ts +1 -1
- package/public/js/features/tool-ui.ts +18 -4
- package/public/js/features/transport-status-row.ts +3 -0
- package/public/js/features/ui-status.ts +5 -1
- package/public/js/main.ts +5 -0
- package/public/js/preview-parent-origin.ts +14 -0
- package/public/js/provider-icons.ts +6 -1
- package/public/js/render/file-links.ts +10 -2
- package/public/js/render/markdown.ts +16 -0
- package/public/js/ui.ts +8 -1
- package/public/js/virtual-scroll.ts +19 -0
- package/public/js/ws.ts +151 -15
- package/public/locales/en.json +9 -2
- package/public/locales/ja.json +9 -2
- package/public/locales/ko.json +9 -2
- package/public/locales/zh.json +9 -2
- package/public/manager/src/App.tsx +13 -70
- package/public/manager/src/InstancePreview.tsx +56 -11
- package/public/manager/src/SidebarRailRouter.tsx +32 -4
- package/public/manager/src/components/InstanceRow.tsx +0 -1
- package/public/manager/src/components/WorkbenchHeader.tsx +17 -7
- package/public/manager/src/doc-panel/DocPanel.tsx +14 -1
- package/public/manager/src/doc-panel/doc-panel.css +16 -0
- package/public/manager/src/folder-panel/FolderPanel.tsx +13 -2
- package/public/manager/src/hooks/useElectronDroppedPaths.ts +89 -0
- package/public/manager/src/hooks/useInstanceMessageEvents.ts +4 -15
- package/public/manager/src/manager-components.css +35 -1
- package/public/manager/src/manager-polish.css +11 -1
- package/public/manager/src/manager-shortcut-runner.ts +107 -0
- package/public/manager/src/manager-shortcuts.ts +15 -0
- package/public/manager/src/panels/desktop-bridge.ts +13 -0
- package/public/manager/src/settings/SettingsSidebar.tsx +1 -1
- package/public/manager/src/settings/components/sidebar-filter.ts +2 -0
- package/public/manager/src/settings/pages/Mcp.tsx +311 -43
- package/public/manager/src/settings/pages/components/McpServerCard.tsx +89 -55
- package/public/manager/src/settings/pages/components/agent/agent-meta.ts +32 -9
- package/public/manager/src/settings/pages/components/employees-helpers.ts +1 -0
- package/public/manager/src/settings/pages/components/heartbeat-helpers.ts +1 -0
- package/public/manager/src/settings/pages/mcp-helpers.ts +54 -12
- package/public/manager/src/settings/types.ts +1 -0
- package/public/manager/src/types.ts +2 -1
- package/scripts/fresh-install-smoke.ts +1 -1
- package/scripts/smoke/agy-transcript-tail-smoke.mjs +89 -0
- package/public/dist/assets/DocPanel-CL1scIfq.css +0 -1
- package/public/dist/assets/Employees-BL9MAzzx.js +0 -1
- package/public/dist/assets/Heartbeat-D64JCg4t.js +0 -1
- package/public/dist/assets/Mcp-wYwJA_61.js +0 -3
- package/public/dist/assets/agent-meta-BhEbjy4P.js +0 -1
- package/public/dist/assets/app-2Rz848bQ.js +0 -48
- package/public/dist/assets/app-BW-Xz2p6.css +0 -1
- package/public/dist/assets/constants-ahKI_aEG.js +0 -1
- package/public/dist/assets/idb-cache-BnZfG5FD.js +0 -1
- package/public/dist/assets/idb-cache-CZ3JdK8r.js +0 -1
- package/public/dist/assets/manager-CfyZloIP.js +0 -12
- package/public/dist/assets/manager-DyrwJLZr.css +0 -1
- package/public/dist/assets/memory-CCjNFWmO.js +0 -1
- package/public/dist/assets/render-CgDEBoCX.js +0 -28
- package/public/dist/assets/settings-CY_6tGuS.js +0 -1
- package/public/dist/assets/settings-DWW4GzNc.js +0 -66
- package/public/dist/assets/sidebar-DQKE5IA1.js +0 -23
- package/public/dist/assets/skills-DYTlqoke.js +0 -1
- package/public/dist/assets/slash-commands-D7CU5oso.js +0 -1
- package/public/dist/assets/ui-Car1OUvV.js +0 -1
- package/public/dist/assets/ui-DK_9ndj0.js +0 -140
- /package/public/dist/assets/{locale-DT1WRaeJ.js → locale-BHMJIzyw.js} +0 -0
package/dist/src/agent/spawn.js
CHANGED
|
@@ -10,6 +10,7 @@ import { settings, UPLOADS_DIR, detectCli } from '../core/config.js';
|
|
|
10
10
|
import { migrateLegacyClaudeValue } from '../cli/claude-models.js';
|
|
11
11
|
import { stripUndefined } from '../core/strip-undefined.js';
|
|
12
12
|
import { clearEmployeeSession, getSession, insertMessage, getRecentMessages, listQueuedMessages, insertQueuedMessage, deleteQueuedMessage, getSessionBucket, clearSessionBucket, } from '../core/db.js';
|
|
13
|
+
import { getActiveChatSession } from '../core/chat-sessions.js';
|
|
13
14
|
import { getSystemPrompt, regenerateB } from '../prompt/builder.js';
|
|
14
15
|
import { extractSessionId, extractFromEvent, extractFromAcpUpdate, extractOutputChunk, logEventSummary, flushClaudeBuffers, flushOpenCodeBuffers } from './events.js';
|
|
15
16
|
import { detectSmokeResponse } from './smoke-detector.js';
|
|
@@ -19,6 +20,7 @@ import { getSessionOwnershipGeneration, persistMainSession, } from './session-pe
|
|
|
19
20
|
import { isCompactMarkerRow } from '../core/compact.js';
|
|
20
21
|
import { isRuntimeSettingsMutationInFlight, waitForRuntimeSettingsIdle } from '../core/runtime-settings-gate.js';
|
|
21
22
|
import { hasBlockingWorkers, hasPendingWorkerReplays, getActiveWorkers, clearAllWorkers } from '../orchestrator/worker-registry.js';
|
|
23
|
+
import { sanitizeWorkerProgressTools } from '../orchestrator/worker-progress.js';
|
|
22
24
|
import { handleAgentExit, setSpawnAgent, setMainMetaHandler } from './lifecycle-handler.js';
|
|
23
25
|
import { buildServicePath } from '../core/runtime-path.js';
|
|
24
26
|
import { resolveOrcScope } from '../orchestrator/scope.js';
|
|
@@ -31,6 +33,10 @@ import { asCliEventRecord, discriminate, fieldString } from '../types/cli-events
|
|
|
31
33
|
import { isJawRuntimeEvent, handleJawRuntimeEvent } from './claude-e-runtime.js';
|
|
32
34
|
import { appendTraceEvent, stampTraceTool, startTraceRun } from '../trace/store.js';
|
|
33
35
|
import { extractAgyConversationId, formatAgyTimeoutMessage, isAgyStaleSessionOutput, isAgyTimeoutOutput } from './agy-runtime.js';
|
|
36
|
+
import { startAgyTranscriptWatcher } from './agy-transcript-watcher.js';
|
|
37
|
+
import { appendAssistantTextSegment } from './events/helpers.js';
|
|
38
|
+
import { listKiroConversationIdsForCwd } from './kiro-auth.js';
|
|
39
|
+
import { captureKiroSessionIdAfterExit, finalizeKiroFullText, flushKiroStdoutContext, isKiroPlainTextCli, isKiroStaleSessionOutput, parseAiESessionIdFromStderr, processKiroStdoutChunk, } from './kiro-runtime.js';
|
|
34
40
|
import { resolveCursorModelVariant } from './cursor-runtime.js';
|
|
35
41
|
// ─── State ───────────────────────────────────────────
|
|
36
42
|
export let activeProcess = null;
|
|
@@ -62,6 +68,59 @@ export function buildAiERuntimeStatusMeta(cli, provider, model) {
|
|
|
62
68
|
};
|
|
63
69
|
}
|
|
64
70
|
import { killProcessTree } from './spawn/process-kill.js';
|
|
71
|
+
function appendParentLiveRunTool(ctx, tool) {
|
|
72
|
+
if (!ctx.parentLiveScope)
|
|
73
|
+
return;
|
|
74
|
+
const [safeTool] = sanitizeWorkerProgressTools([{ ...tool, isEmployee: true }]);
|
|
75
|
+
if (!safeTool)
|
|
76
|
+
return;
|
|
77
|
+
appendLiveRunTool(ctx.parentLiveScope, { ...safeTool, isEmployee: true });
|
|
78
|
+
}
|
|
79
|
+
function emitKiroStreamEvents(events, ctx, agentLabel, cli, empTag, traceAudience) {
|
|
80
|
+
for (const event of events) {
|
|
81
|
+
ctx.kiroLastVisibleAt = Date.now();
|
|
82
|
+
ctx.kiroHeartbeatSent = false;
|
|
83
|
+
ctx.stallWatchdog?.markProgress();
|
|
84
|
+
if (event.kind === 'assistant_delta') {
|
|
85
|
+
const segment = event.text;
|
|
86
|
+
if (!segment)
|
|
87
|
+
continue;
|
|
88
|
+
if (ctx.liveOutputText !== undefined) {
|
|
89
|
+
ctx.liveOutputText += segment;
|
|
90
|
+
}
|
|
91
|
+
ctx.outputTextStarted = true;
|
|
92
|
+
if (ctx.liveScope)
|
|
93
|
+
appendLiveRunText(ctx.liveScope, segment);
|
|
94
|
+
broadcast('agent_output', {
|
|
95
|
+
agentId: agentLabel,
|
|
96
|
+
cli,
|
|
97
|
+
text: segment,
|
|
98
|
+
...empTag,
|
|
99
|
+
}, traceAudience);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const tool = {
|
|
103
|
+
icon: event.icon,
|
|
104
|
+
label: event.label,
|
|
105
|
+
detail: event.detail || '',
|
|
106
|
+
stepRef: event.stepRef,
|
|
107
|
+
status: event.status,
|
|
108
|
+
toolType: 'tool',
|
|
109
|
+
};
|
|
110
|
+
stampTraceTool(tool, ctx, 'tool');
|
|
111
|
+
const existingIdx = ctx.toolLog.findIndex((entry) => entry.stepRef === event.stepRef);
|
|
112
|
+
if (existingIdx >= 0) {
|
|
113
|
+
ctx.toolLog[existingIdx] = { ...ctx.toolLog[existingIdx], ...tool };
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
ctx.toolLog.push(tool);
|
|
117
|
+
}
|
|
118
|
+
if (ctx.liveScope)
|
|
119
|
+
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
120
|
+
appendParentLiveRunTool(ctx, tool);
|
|
121
|
+
broadcast('agent_tool', { agentId: agentLabel, ...tool, ...empTag }, traceAudience);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
65
124
|
export function killAgentById(agentId) {
|
|
66
125
|
const proc = activeProcesses.get(agentId);
|
|
67
126
|
if (!proc)
|
|
@@ -99,6 +158,7 @@ const queueCtrl = createQueueController({
|
|
|
99
158
|
hasBlockingWorkers,
|
|
100
159
|
hasPendingWorkerReplays,
|
|
101
160
|
insertMessage,
|
|
161
|
+
getActiveChatSession,
|
|
102
162
|
insertQueuedMessage,
|
|
103
163
|
deleteQueuedMessage,
|
|
104
164
|
listQueuedMessages: listQueuedMessages,
|
|
@@ -116,6 +176,9 @@ export function setSteerInProgress(v) {
|
|
|
116
176
|
if (was && !v)
|
|
117
177
|
queueMicrotask(() => processQueue());
|
|
118
178
|
}
|
|
179
|
+
export function isSteerInProgress() {
|
|
180
|
+
return steerInProgress;
|
|
181
|
+
}
|
|
119
182
|
export function isAgentBusy() {
|
|
120
183
|
return !!activeProcess || queueCtrl.isRetryPending() || mainSpawnStarting || steerInProgress;
|
|
121
184
|
}
|
|
@@ -129,9 +192,6 @@ const CLAUDE_E_STEER_KILL_ESCALATION_MS = 8_000;
|
|
|
129
192
|
function getActiveMainCli() {
|
|
130
193
|
return typeof currentMainMeta?.cli === 'string' ? currentMainMeta.cli : null;
|
|
131
194
|
}
|
|
132
|
-
function getActiveEffectiveProvider() {
|
|
133
|
-
return typeof currentMainMeta?.effectiveProvider === 'string' ? currentMainMeta.effectiveProvider : null;
|
|
134
|
-
}
|
|
135
195
|
function isActiveAiEPtyRuntime() {
|
|
136
196
|
const cli = getActiveMainCli();
|
|
137
197
|
return cli === 'claude-e' || cli === 'ai-e';
|
|
@@ -189,25 +249,40 @@ export function killActiveAgent(reason = 'user') {
|
|
|
189
249
|
if (activeProcess.pid)
|
|
190
250
|
killReasons.set(activeProcess.pid, reason);
|
|
191
251
|
try {
|
|
192
|
-
activeProcess.
|
|
252
|
+
if (activeProcess.pid) {
|
|
253
|
+
killProcessTree(activeProcess.pid, policy.signal);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
activeProcess.kill(policy.signal);
|
|
257
|
+
}
|
|
193
258
|
}
|
|
194
259
|
catch (e) {
|
|
195
260
|
console.warn(`[agent:kill] ${policy.signal} failed`, { pid: activeProcess?.pid, error: e.message });
|
|
196
261
|
}
|
|
197
262
|
const proc = activeProcess;
|
|
263
|
+
// Immediately sever stdio to stop late output from reaching broadcast handlers
|
|
264
|
+
proc.stdout?.removeAllListeners('data');
|
|
265
|
+
proc.stderr?.removeAllListeners('data');
|
|
198
266
|
setTimeout(() => {
|
|
199
267
|
try {
|
|
200
|
-
if (proc && !proc.killed)
|
|
201
|
-
proc.
|
|
268
|
+
if (proc && !proc.killed) {
|
|
269
|
+
if (proc.pid)
|
|
270
|
+
killProcessTree(proc.pid, 'SIGKILL');
|
|
271
|
+
else
|
|
272
|
+
proc.kill('SIGKILL');
|
|
273
|
+
}
|
|
202
274
|
}
|
|
203
275
|
catch (e) {
|
|
204
276
|
console.warn('[agent:kill] SIGKILL failed', { pid: proc?.pid, error: e.message });
|
|
205
277
|
}
|
|
278
|
+
proc.stdin?.destroy();
|
|
279
|
+
proc.stdout?.destroy();
|
|
280
|
+
proc.stderr?.destroy();
|
|
206
281
|
}, policy.escalationMs);
|
|
207
|
-
// Fix C1: 사용자 stop 시 isAgentBusy()가 즉시 false가 되도록 참조를 동기 해제.
|
|
282
|
+
// Fix C1: 사용자 stop/steer 시 isAgentBusy()가 즉시 false가 되도록 참조를 동기 해제.
|
|
208
283
|
// 실제 child 종료는 위 setTimeout SIGKILL이 백그라운드에서 마무리.
|
|
209
284
|
// exit handler의 setActiveProcess(null) / activeProcesses.delete 는 idempotent.
|
|
210
|
-
if (reason === 'api' || reason === 'user') {
|
|
285
|
+
if (reason === 'api' || reason === 'user' || reason === 'steer') {
|
|
211
286
|
activeProcess = null;
|
|
212
287
|
}
|
|
213
288
|
return true;
|
|
@@ -285,7 +360,7 @@ export async function steerAgent(newPrompt, source) {
|
|
|
285
360
|
const wasRunning = killActiveAgent('steer');
|
|
286
361
|
if (wasRunning)
|
|
287
362
|
await waitForProcessEnd(steerWaitMs);
|
|
288
|
-
insertMessage.run('user', newPrompt, source, '', settings["workingDir"] || null);
|
|
363
|
+
insertMessage.run('user', newPrompt, source, '', settings["workingDir"] || null, getActiveChatSession());
|
|
289
364
|
broadcast('new_message', { role: 'user', content: newPrompt, source });
|
|
290
365
|
broadcast('steer_started', { prompt: newPrompt, origin: source || 'web' });
|
|
291
366
|
const { orchestrate, orchestrateContinue, orchestrateReset, isContinueIntent, isResetIntent } = await import('../orchestrator/pipeline.js');
|
|
@@ -332,7 +407,7 @@ function formatCliUnavailableMessage(cli, detected) {
|
|
|
332
407
|
return `CLI '${cli}' not found in PATH. Run \`jaw doctor --json\`.`;
|
|
333
408
|
}
|
|
334
409
|
function buildHistoryBlock(currentPrompt, workingDir, maxSessions = 10, maxTotalChars = 8000) {
|
|
335
|
-
const recent = getRecentMessages.all(workingDir || null, Math.max(1, maxSessions * 2));
|
|
410
|
+
const recent = getRecentMessages.all(workingDir || null, getActiveChatSession(), Math.max(1, maxSessions * 2));
|
|
336
411
|
if (!recent.length)
|
|
337
412
|
return '';
|
|
338
413
|
const promptText = String(currentPrompt || '').trim();
|
|
@@ -361,12 +436,12 @@ function buildHistoryBlock(currentPrompt, workingDir, maxSessions = 10, maxTotal
|
|
|
361
436
|
break;
|
|
362
437
|
}
|
|
363
438
|
let entry;
|
|
364
|
-
if (
|
|
365
|
-
entry = `[${role || 'user'}] ${content}`;
|
|
366
|
-
}
|
|
367
|
-
else if (role === 'assistant' && row.trace && !isStaleWorklogHistoryArtifact(String(row.trace))) {
|
|
439
|
+
if (role === 'assistant' && row.trace && !isStaleWorklogHistoryArtifact(String(row.trace))) {
|
|
368
440
|
entry = `[assistant trace] ${String(row.trace).slice(0, 2000)}`;
|
|
369
441
|
}
|
|
442
|
+
else if (content && !isStaleWorklogHistoryArtifact(content)) {
|
|
443
|
+
entry = `[${role || 'user'}] ${content}`;
|
|
444
|
+
}
|
|
370
445
|
else {
|
|
371
446
|
entry = '';
|
|
372
447
|
}
|
|
@@ -557,8 +632,8 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
557
632
|
const bucketResumeKey = typeof bucketRow?.resume_key === 'string' ? bucketRow.resume_key : null;
|
|
558
633
|
const bucketUpdatedAt = bucketRow?.updated_at ?? null;
|
|
559
634
|
const resumeKey = buildSessionResumeKey(cli, spawnEnv);
|
|
560
|
-
const providerSupportsResume = !(cli === 'ai-e' && effectiveProvider !== 'claude');
|
|
561
|
-
const canResumeBucketSession = !bucketSessionId || shouldResumeBucketSession(cli, runtimeModel, bucketModel, resumeKey, bucketResumeKey, bucketUpdatedAt);
|
|
635
|
+
const providerSupportsResume = !(cli === 'ai-e' && effectiveProvider !== 'claude' && effectiveProvider !== 'kiro' && effectiveProvider !== 'codex' && effectiveProvider !== 'grok');
|
|
636
|
+
const canResumeBucketSession = !bucketSessionId || shouldResumeBucketSession(cli, runtimeModel, bucketModel, resumeKey, bucketResumeKey, bucketUpdatedAt, Date.now(), effectiveProvider);
|
|
562
637
|
const isResume = empSid
|
|
563
638
|
? true
|
|
564
639
|
: (providerSupportsResume && !opts._skipResume && !forceNew && !!bucketSessionId && canResumeBucketSession);
|
|
@@ -608,10 +683,10 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
608
683
|
const historyBlock = !isResume && !opts._skipHistory
|
|
609
684
|
? buildHistoryBlock(prompt, settings["workingDir"], cli === 'gemini' ? GEMINI_HISTORY_MAX_SESSIONS : 10, cli === 'gemini' ? GEMINI_HISTORY_MAX_CHARS : 8000)
|
|
610
685
|
: '';
|
|
611
|
-
let promptForArgs = (cli === 'agy' || cli === 'cursor' || cli === 'gemini' || cli === 'grok' || cli === 'opencode' || (cli === 'ai-e' && effectiveProvider !== 'claude'))
|
|
686
|
+
let promptForArgs = (cli === 'agy' || cli === 'cursor' || cli === 'kiro-code' || cli === 'gemini' || cli === 'grok' || cli === 'opencode' || (cli === 'ai-e' && effectiveProvider !== 'claude'))
|
|
612
687
|
? withHistoryPrompt(prompt, historyBlock)
|
|
613
688
|
: prompt;
|
|
614
|
-
if (cli === 'agy' && sysPrompt) {
|
|
689
|
+
if ((cli === 'agy' || cli === 'kiro-code' || (cli === 'ai-e' && effectiveProvider === 'kiro')) && sysPrompt) {
|
|
615
690
|
promptForArgs = `[Operational Context — cli-jaw Integration]\nThe following operational guidelines apply to this session. Follow these task rules and use the tools/commands described:\n\n${sysPrompt}\n\n---\n\n${promptForArgs}`;
|
|
616
691
|
}
|
|
617
692
|
const claudeBin = (cli === 'claude-e' || (cli === 'ai-e' && effectiveProvider === 'claude'))
|
|
@@ -782,7 +857,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
782
857
|
processQueue();
|
|
783
858
|
});
|
|
784
859
|
if (mainManaged && !opts.internal && !opts._skipInsert) {
|
|
785
|
-
insertMessage.run('user', prompt, cli, model, settings["workingDir"] || null);
|
|
860
|
+
insertMessage.run('user', prompt, cli, model, settings["workingDir"] || null, getActiveChatSession());
|
|
786
861
|
}
|
|
787
862
|
if (!opts.internal)
|
|
788
863
|
broadcast('agent_status', { status: 'running', cli, agentId: agentLabel, ...empTag }, traceAudience);
|
|
@@ -811,8 +886,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
811
886
|
ctx.toolLog.push(tool);
|
|
812
887
|
if (ctx.liveScope)
|
|
813
888
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
814
|
-
|
|
815
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...tool, isEmployee: true });
|
|
889
|
+
appendParentLiveRunTool(ctx, tool);
|
|
816
890
|
broadcast('agent_tool', { agentId: agentLabel, ...tool, ...empTag }, traceAudience);
|
|
817
891
|
}
|
|
818
892
|
ctx.thinkingBuf = '';
|
|
@@ -846,8 +920,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
846
920
|
ctx.toolLog.push(parsedTool);
|
|
847
921
|
if (ctx.liveScope)
|
|
848
922
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
849
|
-
|
|
850
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...parsedTool, isEmployee: true });
|
|
923
|
+
appendParentLiveRunTool(ctx, parsedTool);
|
|
851
924
|
broadcast('agent_tool', { agentId: agentLabel, ...parsedTool, ...empTag }, traceAudience);
|
|
852
925
|
// Reset heartbeat gate on actually visible broadcast (not 💭)
|
|
853
926
|
lastVisibleBroadcastTs = Date.now();
|
|
@@ -856,10 +929,19 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
856
929
|
}
|
|
857
930
|
if (parsed.text) {
|
|
858
931
|
flushThinking();
|
|
859
|
-
ctx
|
|
860
|
-
if (
|
|
861
|
-
|
|
862
|
-
|
|
932
|
+
const segment = appendAssistantTextSegment(ctx, parsed.text);
|
|
933
|
+
if (segment) {
|
|
934
|
+
if (ctx.liveScope)
|
|
935
|
+
appendLiveRunText(ctx.liveScope, segment);
|
|
936
|
+
broadcast('agent_output', {
|
|
937
|
+
agentId: agentLabel,
|
|
938
|
+
cli,
|
|
939
|
+
text: segment,
|
|
940
|
+
...empTag,
|
|
941
|
+
}, traceAudience);
|
|
942
|
+
lastVisibleBroadcastTs = Date.now();
|
|
943
|
+
heartbeatSent = false;
|
|
944
|
+
}
|
|
863
945
|
}
|
|
864
946
|
opts.lifecycle?.onActivity?.('acp');
|
|
865
947
|
});
|
|
@@ -874,8 +956,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
874
956
|
ctx.toolLog.push(parsed.tool);
|
|
875
957
|
if (ctx.liveScope)
|
|
876
958
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
877
|
-
|
|
878
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...parsed.tool, isEmployee: true });
|
|
959
|
+
appendParentLiveRunTool(ctx, parsed.tool);
|
|
879
960
|
broadcast('agent_tool', { agentId: agentLabel, ...parsed.tool, ...empTag }, traceAudience);
|
|
880
961
|
}
|
|
881
962
|
});
|
|
@@ -890,8 +971,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
890
971
|
ctx.toolLog.push(parsed.tool);
|
|
891
972
|
if (ctx.liveScope)
|
|
892
973
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
893
|
-
|
|
894
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...parsed.tool, isEmployee: true });
|
|
974
|
+
appendParentLiveRunTool(ctx, parsed.tool);
|
|
895
975
|
broadcast('agent_tool', { agentId: agentLabel, ...parsed.tool, ...empTag }, traceAudience);
|
|
896
976
|
}
|
|
897
977
|
});
|
|
@@ -1075,7 +1155,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1075
1155
|
processQueue();
|
|
1076
1156
|
});
|
|
1077
1157
|
if (mainManaged && !opts.internal && !opts._skipInsert) {
|
|
1078
|
-
insertMessage.run('user', prompt, cli, model, settings["workingDir"] || null);
|
|
1158
|
+
insertMessage.run('user', prompt, cli, model, settings["workingDir"] || null, getActiveChatSession());
|
|
1079
1159
|
}
|
|
1080
1160
|
if (!opts.internal)
|
|
1081
1161
|
broadcast('agent_status', { status: 'running', cli, agentId: agentLabel, ...empTag }, traceAudience);
|
|
@@ -1103,8 +1183,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1103
1183
|
ctx.toolLog.push(tool);
|
|
1104
1184
|
if (ctx.liveScope)
|
|
1105
1185
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
1106
|
-
|
|
1107
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...tool, isEmployee: true });
|
|
1186
|
+
appendParentLiveRunTool(ctx, tool);
|
|
1108
1187
|
broadcast('agent_tool', { agentId: agentLabel, ...tool, ...empTag }, traceAudience);
|
|
1109
1188
|
}
|
|
1110
1189
|
ctx.thinkingBuf = '';
|
|
@@ -1136,8 +1215,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1136
1215
|
ctx.toolLog.push(parsedTool);
|
|
1137
1216
|
if (ctx.liveScope)
|
|
1138
1217
|
replaceLiveRunTools(ctx.liveScope, ctx.toolLog);
|
|
1139
|
-
|
|
1140
|
-
appendLiveRunTool(ctx.parentLiveScope, { ...parsedTool, isEmployee: true });
|
|
1218
|
+
appendParentLiveRunTool(ctx, parsedTool);
|
|
1141
1219
|
broadcast('agent_tool', { agentId: agentLabel, ...parsedTool, ...empTag }, traceAudience);
|
|
1142
1220
|
lastVisibleBroadcastTs = Date.now();
|
|
1143
1221
|
heartbeatSent = false;
|
|
@@ -1145,9 +1223,19 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1145
1223
|
}
|
|
1146
1224
|
if (parsed.text) {
|
|
1147
1225
|
flushCodexAppThinking();
|
|
1148
|
-
ctx
|
|
1149
|
-
if (
|
|
1150
|
-
|
|
1226
|
+
const segment = appendAssistantTextSegment(ctx, parsed.text);
|
|
1227
|
+
if (segment) {
|
|
1228
|
+
if (ctx.liveScope)
|
|
1229
|
+
appendLiveRunText(ctx.liveScope, segment);
|
|
1230
|
+
broadcast('agent_output', {
|
|
1231
|
+
agentId: agentLabel,
|
|
1232
|
+
cli,
|
|
1233
|
+
text: segment,
|
|
1234
|
+
...empTag,
|
|
1235
|
+
}, traceAudience);
|
|
1236
|
+
lastVisibleBroadcastTs = Date.now();
|
|
1237
|
+
heartbeatSent = false;
|
|
1238
|
+
}
|
|
1151
1239
|
}
|
|
1152
1240
|
if (parsed.sessionId && !ctx.sessionId) {
|
|
1153
1241
|
ctx.sessionId = parsed.sessionId;
|
|
@@ -1365,7 +1453,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1365
1453
|
processQueue();
|
|
1366
1454
|
});
|
|
1367
1455
|
if (mainManaged && !opts.internal && !opts._skipInsert) {
|
|
1368
|
-
insertMessage.run('user', prompt, cli, runtimeModel, settings["workingDir"] || null);
|
|
1456
|
+
insertMessage.run('user', prompt, cli, runtimeModel, settings["workingDir"] || null, getActiveChatSession());
|
|
1369
1457
|
}
|
|
1370
1458
|
if (cli === 'claude') {
|
|
1371
1459
|
child.stdin.write(withHistoryPrompt(prompt, historyBlock));
|
|
@@ -1383,6 +1471,11 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1383
1471
|
if (!opts.internal)
|
|
1384
1472
|
broadcast('agent_status', { status: 'running', cli, agentId: agentLabel, ...runtimeStatusMeta, ...empTag }, traceAudience);
|
|
1385
1473
|
const traceRunId = startTraceRun({ cli, model: runtimeModel, workingDir: settings["workingDir"] || null, agentLabel, audience: traceAudience });
|
|
1474
|
+
const kiroPlainText = isKiroPlainTextCli(cli, effectiveProvider);
|
|
1475
|
+
const kiroSpawnStartedAt = kiroPlainText ? Date.now() - 1000 : 0;
|
|
1476
|
+
const kiroConversationIdsBefore = (kiroPlainText && !isResume && !empSid)
|
|
1477
|
+
? listKiroConversationIdsForCwd(spawnCwd)
|
|
1478
|
+
: null;
|
|
1386
1479
|
const agyResumeOffset = cli === 'agy' && isResume
|
|
1387
1480
|
? (empSid ? (opts.employeeOutputLen ?? 0) : (bucketRow?.output_len ?? 0))
|
|
1388
1481
|
: 0;
|
|
@@ -1392,7 +1485,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1392
1485
|
toolLog: [],
|
|
1393
1486
|
seenToolKeys: new Set(),
|
|
1394
1487
|
hasClaudeStreamEvents: false,
|
|
1395
|
-
sessionId: null,
|
|
1488
|
+
sessionId: (kiroPlainText && isResume && resumeSessionId) ? resumeSessionId : null,
|
|
1396
1489
|
cost: null,
|
|
1397
1490
|
turns: null,
|
|
1398
1491
|
duration: null,
|
|
@@ -1409,6 +1502,8 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1409
1502
|
geminiResultSeen: false,
|
|
1410
1503
|
...(opencodeSpawnAudit ? { opencodeSpawnAudit: opencodeSpawnAudit } : {}),
|
|
1411
1504
|
...(agyResumeOffset > 0 ? { agyResumeOffset, agyBytesReceived: 0 } : {}),
|
|
1505
|
+
...(kiroPlainText || cli === 'agy' ? { liveOutputText: '' } : {}),
|
|
1506
|
+
...(kiroPlainText ? { kiroLastVisibleAt: Date.now(), kiroHeartbeatSent: false } : {}),
|
|
1412
1507
|
};
|
|
1413
1508
|
let geminiWatchdog = null;
|
|
1414
1509
|
// ─── Subprocess stall watchdog (Phase 1: #178 OAuth2 stall recovery) ───
|
|
@@ -1439,6 +1534,25 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1439
1534
|
}
|
|
1440
1535
|
}, watchdogConfig);
|
|
1441
1536
|
ctx.stallWatchdog = stallWatchdog;
|
|
1537
|
+
let agyTranscriptWatcher = null;
|
|
1538
|
+
if (cli === 'agy') {
|
|
1539
|
+
agyTranscriptWatcher = startAgyTranscriptWatcher({
|
|
1540
|
+
cwd: spawnCwd,
|
|
1541
|
+
getSessionId: () => ctx.sessionId,
|
|
1542
|
+
ctx,
|
|
1543
|
+
agentLabel,
|
|
1544
|
+
cli,
|
|
1545
|
+
empTag,
|
|
1546
|
+
traceAudience,
|
|
1547
|
+
onEmit: (emitCtx, tool, label, _cliName, tag, audience) => {
|
|
1548
|
+
stampTraceTool(tool, emitCtx, tool.toolType || 'tool');
|
|
1549
|
+
if (emitCtx.liveScope)
|
|
1550
|
+
replaceLiveRunTools(emitCtx.liveScope, emitCtx.toolLog);
|
|
1551
|
+
appendParentLiveRunTool(emitCtx, tool);
|
|
1552
|
+
broadcast('agent_tool', { agentId: label, ...tool, ...tag }, audience);
|
|
1553
|
+
},
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1442
1556
|
let buffer = '';
|
|
1443
1557
|
const recordOpencodeEvent = (line, event) => {
|
|
1444
1558
|
if (cli !== 'opencode')
|
|
@@ -1534,13 +1648,16 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1534
1648
|
}, 30_000);
|
|
1535
1649
|
}
|
|
1536
1650
|
const agyUtf8 = cli === 'agy' ? new StringDecoder('utf8') : null;
|
|
1651
|
+
const kiroUtf8 = kiroPlainText ? new StringDecoder('utf8') : null;
|
|
1537
1652
|
child.stdout.on('data', (chunk) => {
|
|
1538
1653
|
opts.lifecycle?.onActivity?.('stdout');
|
|
1539
1654
|
lastOpencodeIoAt = Date.now();
|
|
1540
1655
|
if (cli === 'agy') {
|
|
1541
|
-
const
|
|
1542
|
-
if (!
|
|
1656
|
+
const rawText = agyUtf8.write(chunk);
|
|
1657
|
+
if (!rawText)
|
|
1543
1658
|
return;
|
|
1659
|
+
// Defensive ANSI strip (belt-and-suspenders with NO_COLOR=1)
|
|
1660
|
+
const text = rawText.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, '');
|
|
1544
1661
|
if (ctx.fullText.length < 102_400)
|
|
1545
1662
|
ctx.fullText += text;
|
|
1546
1663
|
else if (ctx.fullText.length < 102_500)
|
|
@@ -1557,6 +1674,9 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1557
1674
|
ctx.agyResumeOffset = 0;
|
|
1558
1675
|
if (!newText)
|
|
1559
1676
|
return;
|
|
1677
|
+
if (ctx.liveOutputText !== undefined)
|
|
1678
|
+
ctx.liveOutputText += newText;
|
|
1679
|
+
ctx.outputTextStarted = true;
|
|
1560
1680
|
if (ctx.liveScope)
|
|
1561
1681
|
appendLiveRunText(ctx.liveScope, newText);
|
|
1562
1682
|
broadcast('agent_output', {
|
|
@@ -1567,6 +1687,9 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1567
1687
|
}, traceAudience);
|
|
1568
1688
|
return;
|
|
1569
1689
|
}
|
|
1690
|
+
if (ctx.liveOutputText !== undefined)
|
|
1691
|
+
ctx.liveOutputText += text;
|
|
1692
|
+
ctx.outputTextStarted = true;
|
|
1570
1693
|
if (ctx.liveScope)
|
|
1571
1694
|
appendLiveRunText(ctx.liveScope, text);
|
|
1572
1695
|
broadcast('agent_output', {
|
|
@@ -1577,6 +1700,17 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1577
1700
|
}, traceAudience);
|
|
1578
1701
|
return;
|
|
1579
1702
|
}
|
|
1703
|
+
if (kiroPlainText) {
|
|
1704
|
+
const text = kiroUtf8.write(chunk);
|
|
1705
|
+
if (!text)
|
|
1706
|
+
return;
|
|
1707
|
+
appendTraceEvent({ runId: ctx.traceRunId, source: 'cli_raw', eventType: 'plain_text', raw: text });
|
|
1708
|
+
const events = processKiroStdoutChunk(ctx, text);
|
|
1709
|
+
if (events.length) {
|
|
1710
|
+
emitKiroStreamEvents(events, ctx, agentLabel, cli, empTag, traceAudience);
|
|
1711
|
+
}
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1580
1714
|
buffer += chunk.toString();
|
|
1581
1715
|
const lines = buffer.split('\n');
|
|
1582
1716
|
buffer = lines.pop() ?? '';
|
|
@@ -1595,6 +1729,7 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1595
1729
|
ctx.stderrBuf += text + '\n';
|
|
1596
1730
|
});
|
|
1597
1731
|
child.on('close', (code) => {
|
|
1732
|
+
agyTranscriptWatcher?.stop();
|
|
1598
1733
|
clearOpencodeIdleTimer();
|
|
1599
1734
|
stallWatchdog.stop();
|
|
1600
1735
|
if (geminiWatchdog) {
|
|
@@ -1616,6 +1751,13 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1616
1751
|
if (remaining)
|
|
1617
1752
|
ctx.fullText += remaining;
|
|
1618
1753
|
}
|
|
1754
|
+
if (kiroUtf8) {
|
|
1755
|
+
const remaining = kiroUtf8.end();
|
|
1756
|
+
if (remaining) {
|
|
1757
|
+
emitKiroStreamEvents(processKiroStdoutChunk(ctx, remaining), ctx, agentLabel, cli, empTag, traceAudience);
|
|
1758
|
+
}
|
|
1759
|
+
emitKiroStreamEvents(flushKiroStdoutContext(ctx), ctx, agentLabel, cli, empTag, traceAudience);
|
|
1760
|
+
}
|
|
1619
1761
|
const agyTotalOutputLen = cli === 'agy' ? ctx.fullText.length : 0;
|
|
1620
1762
|
if (cli === 'agy' && agyResumeOffset > 0) {
|
|
1621
1763
|
ctx.fullText = ctx.fullText.slice(Math.min(agyResumeOffset, ctx.fullText.length));
|
|
@@ -1656,6 +1798,52 @@ export function spawnAgent(prompt, opts = {}) {
|
|
|
1656
1798
|
}
|
|
1657
1799
|
ctx.sessionId = null;
|
|
1658
1800
|
}
|
|
1801
|
+
if (kiroPlainText) {
|
|
1802
|
+
const captured = captureKiroSessionIdAfterExit({
|
|
1803
|
+
cwd: spawnCwd,
|
|
1804
|
+
spawnStartedAt: kiroSpawnStartedAt,
|
|
1805
|
+
beforeIds: kiroConversationIdsBefore,
|
|
1806
|
+
stdout: ctx.fullText,
|
|
1807
|
+
stderr: ctx.stderrBuf,
|
|
1808
|
+
resumeSessionId,
|
|
1809
|
+
isResume,
|
|
1810
|
+
});
|
|
1811
|
+
ctx.sessionId = captured.id;
|
|
1812
|
+
if (captured.source) {
|
|
1813
|
+
console.log(`[jaw:kiro] session capture source=${captured.source} id=${captured.id?.slice(0, 12) ?? 'none'}...`);
|
|
1814
|
+
}
|
|
1815
|
+
if (!ctx.sessionId) {
|
|
1816
|
+
console.warn(`[jaw:kiro] session id capture failed cwd=${spawnCwd}`);
|
|
1817
|
+
}
|
|
1818
|
+
if (isResume && isKiroStaleSessionOutput(ctx.fullText)) {
|
|
1819
|
+
console.log('[jaw:kiro] stale session detected in output — clearing bucket');
|
|
1820
|
+
try {
|
|
1821
|
+
const bucket = resolveSessionBucket(cli, runtimeModel, effectiveProvider);
|
|
1822
|
+
clearSessionBucket.run(bucket);
|
|
1823
|
+
}
|
|
1824
|
+
catch (e) {
|
|
1825
|
+
console.warn('[jaw:kiro] stale bucket clear failed:', e.message);
|
|
1826
|
+
}
|
|
1827
|
+
ctx.sessionId = null;
|
|
1828
|
+
}
|
|
1829
|
+
const parsed = finalizeKiroFullText(ctx.fullText, ctx.kiroLineBuffer);
|
|
1830
|
+
const best = [ctx.liveOutputText, ctx.kiroDisplayedText, parsed]
|
|
1831
|
+
.map((value) => String(value || '').trim())
|
|
1832
|
+
.filter(Boolean)
|
|
1833
|
+
.sort((a, b) => b.length - a.length)[0];
|
|
1834
|
+
if (best)
|
|
1835
|
+
ctx.fullText = best;
|
|
1836
|
+
else if (parsed)
|
|
1837
|
+
ctx.fullText = parsed;
|
|
1838
|
+
}
|
|
1839
|
+
// ai-e codex/grok: capture session ID from stderr footer
|
|
1840
|
+
if (cli === 'ai-e' && !kiroPlainText && effectiveProvider !== 'claude' && !ctx.sessionId) {
|
|
1841
|
+
const fromStderr = parseAiESessionIdFromStderr(ctx.stderrBuf);
|
|
1842
|
+
if (fromStderr) {
|
|
1843
|
+
ctx.sessionId = fromStderr;
|
|
1844
|
+
console.log(`[jaw:ai-e:${effectiveProvider}] session capture id=${fromStderr.slice(0, 16)}...`);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1659
1847
|
const agyTimedOut = cli === 'agy' && isAgyTimeoutOutput(ctx.fullText);
|
|
1660
1848
|
const effectiveExitCode = agyTimedOut ? 124 : code;
|
|
1661
1849
|
if (agyTimedOut) {
|