@ashx-j/lunr 0.2.20 → 0.2.22
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/CHANGELOG.md +14 -2
- package/README.md +20 -4
- package/dist/builtin-extensions/index.d.ts.map +1 -1
- package/dist/builtin-extensions/index.js +1 -0
- package/dist/builtin-extensions/index.js.map +1 -1
- package/dist/builtin-extensions/lunr-browser.d.ts +3 -0
- package/dist/builtin-extensions/lunr-browser.d.ts.map +1 -0
- package/dist/builtin-extensions/lunr-browser.js +56 -0
- package/dist/builtin-extensions/lunr-browser.js.map +1 -0
- package/dist/builtin-extensions/lunr-todos.d.ts +6 -5
- package/dist/builtin-extensions/lunr-todos.d.ts.map +1 -1
- package/dist/builtin-extensions/lunr-todos.js +24 -7
- package/dist/builtin-extensions/lunr-todos.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js +30 -21
- package/dist/builtin-extensions/pi-intercom/broker/spawn.js.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-intercom/index.js +15 -3
- package/dist/builtin-extensions/pi-intercom/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js +5 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/control-notices.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/fanout-child.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts +8 -7
- package/dist/builtin-extensions/pi-subagents/src/extension/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js +78 -31
- package/dist/builtin-extensions/pi-subagents/src/extension/index.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js +2 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/schemas.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts +4 -3
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js +6 -2
- package/dist/builtin-extensions/pi-subagents/src/extension/tool-description.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts +17 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js +45 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js +4 -11
- package/dist/builtin-extensions/pi-subagents/src/intercom/intercom-bridge.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts +5 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js +186 -58
- package/dist/builtin-extensions/pi-subagents/src/intercom/native-supervisor-channel.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/result-intercom.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js +5 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-ask.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js +3 -2
- package/dist/builtin-extensions/pi-subagents/src/intercom/supervisor-questions.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js +4 -3
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/async-job-tracker.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js +2 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/auto-drain.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts +6 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js +23 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/notify.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/result-watcher.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts +100 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js +46 -31
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-runner.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js +2 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/background/subagent-wait.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts +15 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js +14 -4
- package/dist/builtin-extensions/pi-subagents/src/runs/background/top-level-async.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/background/wait-tool.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/execution.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js +9 -9
- package/dist/builtin-extensions/pi-subagents/src/runs/foreground/subagent-executor.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/completion-guard.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/parallel-utils.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js +5 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/pi-args.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts +1 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-control.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts +2 -2
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js +5 -10
- package/dist/builtin-extensions/pi-subagents/src/runs/shared/task-intent.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js +3 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/async-guidance.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts +6 -0
- package/dist/builtin-extensions/pi-subagents/src/shared/types.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/shared/types.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/delegation-adapters.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts +7 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js +11 -7
- package/dist/builtin-extensions/pi-subagents/src/slash/prompt-workflows.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts +4 -0
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js +22 -23
- package/dist/builtin-extensions/pi-subagents/src/slash/slash-commands.js.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts +18 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.d.ts.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js +47 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/communication.js.map +1 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts +2 -0
- package/dist/builtin-extensions/pi-subagents/src/tui/render.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js +237 -374
- package/dist/builtin-extensions/pi-subagents/src/tui/render.js.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.d.ts.map +1 -1
- package/dist/builtin-extensions/pi-web-access/index.js +11 -7
- package/dist/builtin-extensions/pi-web-access/index.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/install-cli.d.ts.map +1 -1
- package/dist/cli/install-cli.js +15 -45
- package/dist/cli/install-cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +9 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +126 -29
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +20 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/browser/network.d.ts +9 -0
- package/dist/core/browser/network.d.ts.map +1 -0
- package/dist/core/browser/network.js +146 -0
- package/dist/core/browser/network.js.map +1 -0
- package/dist/core/browser/runtime.d.ts +24 -0
- package/dist/core/browser/runtime.d.ts.map +1 -0
- package/dist/core/browser/runtime.js +289 -0
- package/dist/core/browser/runtime.js.map +1 -0
- package/dist/core/browser/schema.d.ts +16 -0
- package/dist/core/browser/schema.d.ts.map +1 -0
- package/dist/core/browser/schema.js +36 -0
- package/dist/core/browser/schema.js.map +1 -0
- package/dist/core/browser/settings.d.ts +8 -0
- package/dist/core/browser/settings.d.ts.map +1 -0
- package/dist/core/browser/settings.js +30 -0
- package/dist/core/browser/settings.js.map +1 -0
- package/dist/core/browser/setup.d.ts +2 -0
- package/dist/core/browser/setup.d.ts.map +1 -0
- package/dist/core/browser/setup.js +16 -0
- package/dist/core/browser/setup.js.map +1 -0
- package/dist/core/customize.d.ts +2 -0
- package/dist/core/customize.d.ts.map +1 -1
- package/dist/core/customize.js +17 -13
- package/dist/core/customize.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +1 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/install-features.d.ts.map +1 -1
- package/dist/core/install-features.js +10 -8
- package/dist/core/install-features.js.map +1 -1
- package/dist/core/memory-cap.d.ts.map +1 -1
- package/dist/core/memory-cap.js +5 -3
- package/dist/core/memory-cap.js.map +1 -1
- package/dist/core/model-tiers.d.ts.map +1 -1
- package/dist/core/model-tiers.js +9 -6
- package/dist/core/model-tiers.js.map +1 -1
- package/dist/core/permissions.d.ts.map +1 -1
- package/dist/core/permissions.js +9 -0
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/plan-mode.d.ts.map +1 -1
- package/dist/core/plan-mode.js +3 -0
- package/dist/core/plan-mode.js.map +1 -1
- package/dist/core/process-registry.d.ts.map +1 -1
- package/dist/core/process-registry.js +6 -4
- package/dist/core/process-registry.js.map +1 -1
- package/dist/core/runtime-scope.d.ts +11 -0
- package/dist/core/runtime-scope.d.ts.map +1 -0
- package/dist/core/runtime-scope.js +3 -0
- package/dist/core/runtime-scope.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +13 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-handoff.d.ts +35 -0
- package/dist/core/session-handoff.d.ts.map +1 -0
- package/dist/core/session-handoff.js +214 -0
- package/dist/core/session-handoff.js.map +1 -0
- package/dist/core/session-manager.d.ts +20 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +184 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-ownership.d.ts +28 -0
- package/dist/core/session-ownership.d.ts.map +1 -0
- package/dist/core/session-ownership.js +138 -0
- package/dist/core/session-ownership.js.map +1 -0
- package/dist/core/session-retention.d.ts.map +1 -1
- package/dist/core/session-retention.js +11 -2
- package/dist/core/session-retention.js.map +1 -1
- package/dist/core/settings-manager.d.ts +11 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +29 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-spinner-setting.d.ts +6 -0
- package/dist/core/subagent-spinner-setting.d.ts.map +1 -0
- package/dist/core/subagent-spinner-setting.js +12 -0
- package/dist/core/subagent-spinner-setting.js.map +1 -0
- package/dist/core/subagent-spinner.d.ts +4 -0
- package/dist/core/subagent-spinner.d.ts.map +1 -0
- package/dist/core/subagent-spinner.js +6 -0
- package/dist/core/subagent-spinner.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/todo-settings.d.ts +5 -0
- package/dist/core/todo-settings.d.ts.map +1 -0
- package/dist/core/todo-settings.js +7 -0
- package/dist/core/todo-settings.js.map +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +4 -4
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +5 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +4 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -4
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +4 -4
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -4
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +11 -2
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +31 -4
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +5 -3
- package/dist/core/usage-service.js.map +1 -1
- package/dist/gateway/adapters/discord.d.ts +12 -1
- package/dist/gateway/adapters/discord.d.ts.map +1 -1
- package/dist/gateway/adapters/discord.js +112 -17
- package/dist/gateway/adapters/discord.js.map +1 -1
- package/dist/gateway/adapters/telegram.d.ts +4 -2
- package/dist/gateway/adapters/telegram.d.ts.map +1 -1
- package/dist/gateway/adapters/telegram.js +34 -11
- package/dist/gateway/adapters/telegram.js.map +1 -1
- package/dist/gateway/agent-bridge.d.ts +14 -3
- package/dist/gateway/agent-bridge.d.ts.map +1 -1
- package/dist/gateway/agent-bridge.js +252 -60
- package/dist/gateway/agent-bridge.js.map +1 -1
- package/dist/gateway/approval.d.ts +1 -0
- package/dist/gateway/approval.d.ts.map +1 -1
- package/dist/gateway/approval.js +60 -18
- package/dist/gateway/approval.js.map +1 -1
- package/dist/gateway/authz.d.ts +2 -0
- package/dist/gateway/authz.d.ts.map +1 -1
- package/dist/gateway/authz.js +13 -0
- package/dist/gateway/authz.js.map +1 -1
- package/dist/gateway/buttons.d.ts +3 -1
- package/dist/gateway/buttons.d.ts.map +1 -1
- package/dist/gateway/buttons.js +18 -3
- package/dist/gateway/buttons.js.map +1 -1
- package/dist/gateway/command.d.ts.map +1 -1
- package/dist/gateway/command.js +49 -4
- package/dist/gateway/command.js.map +1 -1
- package/dist/gateway/commands.d.ts.map +1 -1
- package/dist/gateway/commands.js +18 -3
- package/dist/gateway/commands.js.map +1 -1
- package/dist/gateway/config.d.ts +5 -0
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js +5 -0
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/conversations.d.ts +14 -0
- package/dist/gateway/conversations.d.ts.map +1 -0
- package/dist/gateway/conversations.js +30 -0
- package/dist/gateway/conversations.js.map +1 -0
- package/dist/gateway/download.d.ts +2 -0
- package/dist/gateway/download.d.ts.map +1 -0
- package/dist/gateway/download.js +36 -0
- package/dist/gateway/download.js.map +1 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +85 -26
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/mobile-commands.d.ts +24 -0
- package/dist/gateway/mobile-commands.d.ts.map +1 -0
- package/dist/gateway/mobile-commands.js +422 -0
- package/dist/gateway/mobile-commands.js.map +1 -0
- package/dist/gateway/presenter.d.ts +16 -0
- package/dist/gateway/presenter.d.ts.map +1 -0
- package/dist/gateway/presenter.js +210 -0
- package/dist/gateway/presenter.js.map +1 -0
- package/dist/gateway/router.d.ts +1 -0
- package/dist/gateway/router.d.ts.map +1 -1
- package/dist/gateway/router.js +32 -3
- package/dist/gateway/router.js.map +1 -1
- package/dist/gateway/service.d.ts +46 -0
- package/dist/gateway/service.d.ts.map +1 -0
- package/dist/gateway/service.js +395 -0
- package/dist/gateway/service.js.map +1 -0
- package/dist/gateway/setup.d.ts +4 -0
- package/dist/gateway/setup.d.ts.map +1 -0
- package/dist/gateway/setup.js +146 -0
- package/dist/gateway/setup.js.map +1 -0
- package/dist/gateway/types.d.ts +4 -2
- package/dist/gateway/types.d.ts.map +1 -1
- package/dist/gateway/types.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +11 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +53 -16
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/copyable-text.d.ts +31 -0
- package/dist/modes/interactive/components/copyable-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/copyable-text.js +165 -0
- package/dist/modes/interactive/components/copyable-text.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +8 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +8 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +9 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +111 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/extension-widget-order.d.ts +8 -0
- package/dist/modes/interactive/extension-widget-order.d.ts.map +1 -0
- package/dist/modes/interactive/extension-widget-order.js +37 -0
- package/dist/modes/interactive/extension-widget-order.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +166 -29
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/node-runtime/agent-session-services-NQ6GKOIK.js +49 -0
- package/dist/node-runtime/{builtin-extensions-X4JMM4ZS.js → builtin-extensions-GVC6IFDU.js} +6 -4
- package/dist/node-runtime/{chunk-LTYWTR3V.js → chunk-2MI5OPMN.js} +17 -2
- package/dist/node-runtime/{chunk-W3CVH5RX.js → chunk-2TKODGBZ.js} +11 -6
- package/dist/node-runtime/chunk-4EULYYR4.js +62 -0
- package/dist/node-runtime/chunk-5BNJ4JUH.js +672 -0
- package/dist/node-runtime/{chunk-6N22HULO.js → chunk-5D7LC2ZQ.js} +7 -2
- package/dist/node-runtime/chunk-5ZH3ZFIZ.js +308 -0
- package/dist/node-runtime/{chunk-KBKMCJDU.js → chunk-5ZQXRPMC.js} +19 -4
- package/dist/node-runtime/{chunk-6KDIOJL3.js → chunk-6427XAWG.js} +3 -3
- package/dist/node-runtime/{chunk-BOHIDQT4.js → chunk-6B2POMK7.js} +1 -1
- package/dist/node-runtime/{chunk-RNBHABBA.js → chunk-7QWNYZDI.js} +7 -0
- package/dist/node-runtime/chunk-AZJHNQKQ.js +205 -0
- package/dist/node-runtime/chunk-BFNXONG3.js +521 -0
- package/dist/node-runtime/{chunk-IRPJXI6U.js → chunk-BX2RB477.js} +1 -1
- package/dist/node-runtime/chunk-CCCN2UCX.js +14 -0
- package/dist/node-runtime/{chunk-25I2BHAA.js → chunk-CSUZVNYE.js} +1 -1
- package/dist/node-runtime/{chunk-QZMODZQ2.js → chunk-E24EO34J.js} +2 -1
- package/dist/node-runtime/{chunk-QKFMBRAL.js → chunk-EQ63ANHL.js} +508 -140
- package/dist/node-runtime/{chunk-ELWEXVO5.js → chunk-GJSAD4AB.js} +216 -201
- package/dist/node-runtime/{chunk-AOFXZQKA.js → chunk-GMHJCCEN.js} +8 -8
- package/dist/node-runtime/{chunk-DDWHZ633.js → chunk-GNN7H3B7.js} +1 -1
- package/dist/node-runtime/chunk-GS66LV4M.js +2830 -0
- package/dist/node-runtime/{chunk-6BEIBLQ3.js → chunk-H3XF4UVQ.js} +1 -1
- package/dist/node-runtime/chunk-H4K3JDRB.js +47 -0
- package/dist/node-runtime/{chunk-AROOY4BB.js → chunk-HTFRRDSF.js} +2 -7
- package/dist/node-runtime/chunk-IMLCWLPI.js +9 -0
- package/dist/node-runtime/{chunk-4CSFRBCN.js → chunk-IQIEU7SB.js} +9 -674
- package/dist/node-runtime/{chunk-OPEK5RRY.js → chunk-IVXYUAJE.js} +1 -1
- package/dist/node-runtime/{chunk-AL2FMKKM.js → chunk-IWOWXRWU.js} +58 -48
- package/dist/node-runtime/chunk-KKUTQQV7.js +144 -0
- package/dist/node-runtime/chunk-LISUTZS3.js +19 -0
- package/dist/node-runtime/{chunk-K3646JTM.js → chunk-LMBNLFXQ.js} +25 -314
- package/dist/node-runtime/{chunk-7NBZ5P7I.js → chunk-NAY6UUQZ.js} +1 -1
- package/dist/node-runtime/chunk-OAR4TYZE.js +146 -0
- package/dist/node-runtime/{chunk-STERBGUB.js → chunk-OFKSVRV7.js} +2 -2
- package/dist/node-runtime/{chunk-JZQ7F36T.js → chunk-ORH324EP.js} +19 -3
- package/dist/node-runtime/{chunk-2SJB2AWP.js → chunk-PC2Z5TKZ.js} +3 -3
- package/dist/node-runtime/{chunk-46ECNOLF.js → chunk-QDGKKKUM.js} +97 -162
- package/dist/node-runtime/chunk-R3K2F5GI.js +122 -0
- package/dist/node-runtime/chunk-RMQZU2YU.js +117 -0
- package/dist/node-runtime/{chunk-JYNNB7DU.js → chunk-TDL7UWJ7.js} +283 -2999
- package/dist/node-runtime/{chunk-G6LRAP36.js → chunk-TQGPP4SC.js} +1 -1
- package/dist/node-runtime/chunk-UAEOTO52.js +119 -0
- package/dist/node-runtime/{chunk-4DJ6HEGH.js → chunk-UAFLNHSH.js} +18 -14
- package/dist/node-runtime/{chunk-AY6CAJSL.js → chunk-UJOCPOMX.js} +6 -3
- package/dist/node-runtime/chunk-UP2XBVH5.js +40 -0
- package/dist/node-runtime/{chunk-WJVFOIB5.js → chunk-UQUCFAJ3.js} +1 -1
- package/dist/node-runtime/chunk-URD2SLIT.js +1019 -0
- package/dist/node-runtime/chunk-US544NN6.js +13 -0
- package/dist/node-runtime/chunk-UWPJL22I.js +341 -0
- package/dist/node-runtime/chunk-V2A7CEXK.js +355 -0
- package/dist/node-runtime/chunk-VJPTNWAP.js +708 -0
- package/dist/node-runtime/{chunk-WKDK4C5P.js → chunk-VSSXXL36.js} +38 -164
- package/dist/node-runtime/{chunk-4I23VTC4.js → chunk-VWCE2HSZ.js} +21 -124
- package/dist/node-runtime/{chunk-CBGB57XT.js → chunk-WADV2VDS.js} +32 -1014
- package/dist/node-runtime/{chunk-GKLEQ3I4.js → chunk-XLTL257W.js} +126 -27
- package/dist/node-runtime/chunk-YPHAIRZT.js +10 -0
- package/dist/node-runtime/cli-runtime.js +2 -2
- package/dist/node-runtime/command-3JHHXOPX.js +45 -0
- package/dist/node-runtime/commands-2JVNFGMQ.js +36 -0
- package/dist/node-runtime/{commands-MV5KOZ64.js → commands-KAMO2T6P.js} +10 -10
- package/dist/node-runtime/config-RORQUQFG.js +20 -0
- package/dist/node-runtime/{customize-XEXL2DGQ.js → customize-VFJV3U6A.js} +2 -1
- package/dist/node-runtime/{direct-tool-executor-BK7CLEBX.js → direct-tool-executor-YAVOLDFY.js} +8 -8
- package/dist/node-runtime/{export-html-TEXVV5RP.js → export-html-KBFVV63J.js} +4 -3
- package/dist/node-runtime/{extension-input-O4HSAEM4.js → extension-input-K24TVKVW.js} +4 -4
- package/dist/node-runtime/{extension-selector-X5FCX43D.js → extension-selector-SPNF7EDR.js} +4 -4
- package/dist/node-runtime/{extract-XLQSJN4V.js → extract-EQJE7FZZ.js} +2 -2
- package/dist/node-runtime/{gateway-L4ANRTVE.js → gateway-VFO6SFKK.js} +275 -994
- package/dist/node-runtime/{gemini-search-U7SUMPQA.js → gemini-search-35OCRFLN.js} +1 -1
- package/dist/node-runtime/{gemini-url-context-PXWCBQHK.js → gemini-url-context-UQY3PHHW.js} +2 -2
- package/dist/node-runtime/index.js +105 -64
- package/dist/node-runtime/{init-3C7Z24OI.js → init-X2LIUB2H.js} +3 -3
- package/dist/node-runtime/{install-cli-EXMJQESX.js → install-cli-C3CF7O7N.js} +21 -82
- package/dist/node-runtime/interactive-mode-LOM6AIF6.js +72 -0
- package/dist/node-runtime/{interactive-view-ILS6TAN5.js → interactive-view-IDSCPPK7.js} +8 -8
- package/dist/node-runtime/lunr-browser-YNW7FTYX.js +87 -0
- package/dist/node-runtime/{lunr-cron-NNYTWTGF.js → lunr-cron-BKHGNBKT.js} +19 -5
- package/dist/node-runtime/main.js +45 -30
- package/dist/node-runtime/{memory-cap-3S4XRLNP.js → memory-cap-EL3KL4JJ.js} +2 -1
- package/dist/node-runtime/mobile-commands-HMP25WBC.js +32 -0
- package/dist/node-runtime/model-runtime-PLQKAG4B.js +16 -0
- package/dist/node-runtime/{model-tiers-NJLHUEGK.js → model-tiers-OU3U5CZG.js} +2 -1
- package/dist/node-runtime/{package-manager-cli-7RKSZGEN.js → package-manager-cli-VCK4E2RC.js} +23 -15
- package/dist/node-runtime/{pi-intercom-DDQMRNPJ.js → pi-intercom-HBPK5HSJ.js} +38 -34
- package/dist/node-runtime/{pi-mcp-adapter-GUFZWW54.js → pi-mcp-adapter-E6WULBKF.js} +4 -4
- package/dist/node-runtime/{pi-subagents-T5WMMLBB.js → pi-subagents-FEUDLJOE.js} +476 -412
- package/dist/node-runtime/{pi-web-access-2CQGFLT2.js → pi-web-access-WTGMNZ32.js} +15 -15
- package/dist/node-runtime/process-registry-4FAKZQOL.js +31 -0
- package/dist/node-runtime/{proxy-modes-V6YVFH3C.js → proxy-modes-OSQCWRBI.js} +9 -9
- package/dist/node-runtime/rpc-entry.js +46 -31
- package/dist/node-runtime/{rpc-mode-W5ZTLTMZ.js → rpc-mode-P5ODXPEG.js} +2 -2
- package/dist/node-runtime/runtime-4VA6JKNF.js +373 -0
- package/dist/node-runtime/{runtime-bridges-NJQERQ72.js → runtime-bridges-3XUQ46XW.js} +6 -5
- package/dist/node-runtime/service-ISSP6VHE.js +36 -0
- package/dist/node-runtime/session-handoff-HC7R5E24.js +33 -0
- package/dist/node-runtime/{session-manager-E7AREDTV.js → session-manager-CFN4UFM2.js} +2 -1
- package/dist/node-runtime/{session-selector-FJ7M2AIX.js → session-selector-LHRMJOKT.js} +5 -4
- package/dist/node-runtime/{settings-manager-GHPTUN7R.js → settings-manager-UUZ6NUXI.js} +8 -2
- package/dist/node-runtime/setup-JBKOLJ6F.js +18 -0
- package/dist/node-runtime/setup-NRXVZBLJ.js +155 -0
- package/dist/node-runtime/{subagent-executor-SRFC26SJ.js → subagent-executor-MLUMBWCP.js} +35 -63
- package/dist/node-runtime/theme-U7IGOA7O.js +68 -0
- package/dist/node-runtime/trust-manager-MMISNCYO.js +17 -0
- package/dist/node-runtime/{update-cli-L3JIBH2U.js → update-cli-4TP25CNW.js} +8 -2
- package/dist/node-runtime/usage-service-LFB2SWYV.js +37 -0
- package/dist/node-runtime/{video-extract-OYT5WKS5.js → video-extract-OOZHR7SU.js} +2 -2
- package/dist/node-runtime/{youtube-extract-TQYKGFGS.js → youtube-extract-FNPAUNHU.js} +6 -6
- package/docs/browser.md +86 -0
- package/docs/extensions.md +2 -0
- package/docs/features.md +99 -17
- package/docs/interactive-startup.md +2 -1
- package/docs/sessions.md +10 -0
- package/docs/settings.md +3 -1
- package/docs/tui.md +2 -0
- package/docs/usage.md +16 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +7 -4
- package/scripts/install-browser.mjs +20 -0
- package/dist/node-runtime/agent-session-services-75JKASCW.js +0 -36
- package/dist/node-runtime/chunk-HQCKFM2O.js +0 -56
- package/dist/node-runtime/command-RBTRL55A.js +0 -13
- package/dist/node-runtime/interactive-mode-HPUNH7SV.js +0 -57
- package/dist/node-runtime/{chunk-UWQYRSYQ.js → chunk-YJMMG7C6.js} +25 -25
- package/dist/node-runtime/{mcp-panel-IIGMXQGP.js → mcp-panel-KTTFXJZ4.js} +3 -3
- package/dist/node-runtime/{src-BPQFJR76.js → src-IVPNZ2BX.js} +9 -9
|
@@ -126,6 +126,8 @@ function isCodeRewriteMutating(input) {
|
|
|
126
126
|
return input?.dry_run === !1;
|
|
127
127
|
}
|
|
128
128
|
function planModeBlockReason(toolName, input) {
|
|
129
|
+
if (toolName === "browser" && input?.action === "act")
|
|
130
|
+
return `${PLAN_MODE_BLOCK_MESSAGE} Browser interactions require a non-plan session; observation remains available.`;
|
|
129
131
|
if (BLOCKED_TOOLS.has(toolName) || toolName === "code_rewrite" && isCodeRewriteMutating(input))
|
|
130
132
|
return PLAN_MODE_BLOCK_MESSAGE;
|
|
131
133
|
if (toolName === "bash") {
|
|
@@ -460,6 +462,8 @@ function protectedFileWriteReason(toolName, input, cwd) {
|
|
|
460
462
|
if (normalize(target) === normalize(join(dirname(getAgentDir()), "simple-memory", "memory.md")))
|
|
461
463
|
return MEMORY_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
462
464
|
let globalSettings = normalize(join(getAgentDir(), "settings.json")), projectSettings = normalize(join(cwd, CONFIG_DIR_NAME, "settings.json")), normalizedTarget = normalize(target);
|
|
465
|
+
if (normalizedTarget === normalize(join(getAgentDir(), "install-features.json")))
|
|
466
|
+
return "Optional features are user-managed through lunr features; Browser is managed in /settings. Do not change install-features.json directly.";
|
|
463
467
|
if (normalizedTarget === globalSettings || normalizedTarget === projectSettings)
|
|
464
468
|
return SETTINGS_FILE_DIRECT_WRITE_BLOCK_REASON;
|
|
465
469
|
}
|
|
@@ -490,7 +494,7 @@ function getRequestedChildLaunches(input) {
|
|
|
490
494
|
return collectRequestedChildLaunches(input, launches), launches;
|
|
491
495
|
}
|
|
492
496
|
function requiresManualApproval(toolName, input) {
|
|
493
|
-
return isMutatingTool(toolName) ? !0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
|
|
497
|
+
return toolName === "browser" ? input.action === "act" : isMutatingTool(toolName) ? !0 : toolName === "subagent" ? getRequestedChildLaunches(input).some((launch) => launch.permissions === "full") : toolName === "code_rewrite" && isCodeRewriteMutating(input);
|
|
494
498
|
}
|
|
495
499
|
function firstTaskText(value) {
|
|
496
500
|
return typeof value == "string" && value.trim() ? sanitizeDetail(value) : "";
|
|
@@ -596,7 +600,7 @@ async function gateToolCall(toolName, input, cwd, sessionId, options) {
|
|
|
596
600
|
detail = sanitizeDetail(launches.map((launch) => `${launch.description}
|
|
597
601
|
permissions: ${launch.permissions}`).join(`
|
|
598
602
|
`));
|
|
599
|
-
} else toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
|
|
603
|
+
} else toolName === "browser" ? (action = "browser", detail = sanitizeDetail(`${input.interaction ?? ""} ${input.role ?? ""} ${input.name ?? input.label ?? ""}. Website effects cannot be undone.`)) : toolName === "code_rewrite" ? (action = "code_rewrite", detail = sanitizeDetail(input.path ?? input.pattern)) : (action = toolName, detail = "");
|
|
600
604
|
if (ctx.approvals.has(action))
|
|
601
605
|
return;
|
|
602
606
|
if (!approvalHandler)
|
|
@@ -620,6 +624,7 @@ permissions: ${launch.permissions}`).join(`
|
|
|
620
624
|
|
|
621
625
|
export {
|
|
622
626
|
PLAN_MODE_ADDENDUM,
|
|
627
|
+
PERMISSION_MODES,
|
|
623
628
|
nextPermissionMode,
|
|
624
629
|
isPlanModeActive,
|
|
625
630
|
restorePermissionModeAfterPlan,
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// node_modules/unicode-animations/dist/chunk-F2BWZODB.js
|
|
4
|
+
var BRAILLE_DOT_MAP = [
|
|
5
|
+
[1, 8],
|
|
6
|
+
// row 0
|
|
7
|
+
[2, 16],
|
|
8
|
+
// row 1
|
|
9
|
+
[4, 32],
|
|
10
|
+
// row 2
|
|
11
|
+
[64, 128]
|
|
12
|
+
// row 3
|
|
13
|
+
];
|
|
14
|
+
function gridToBraille(grid) {
|
|
15
|
+
let rows = grid.length, cols = grid[0] ? grid[0].length : 0, charCount = Math.ceil(cols / 2), result = "";
|
|
16
|
+
for (let c = 0; c < charCount; c++) {
|
|
17
|
+
let code = 10240;
|
|
18
|
+
for (let r = 0; r < 4 && r < rows; r++)
|
|
19
|
+
for (let d = 0; d < 2; d++) {
|
|
20
|
+
let col = c * 2 + d;
|
|
21
|
+
col < cols && grid[r] && grid[r][col] && (code |= BRAILLE_DOT_MAP[r][d]);
|
|
22
|
+
}
|
|
23
|
+
result += String.fromCodePoint(code);
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
function makeGrid(rows, cols) {
|
|
28
|
+
return rows <= 0 || cols <= 0 ? [] : Array.from({ length: rows }, () => Array(cols).fill(!1));
|
|
29
|
+
}
|
|
30
|
+
function genScan() {
|
|
31
|
+
let frames = [];
|
|
32
|
+
for (let pos = -1; pos < 9; pos++) {
|
|
33
|
+
let g = makeGrid(4, 8);
|
|
34
|
+
for (let r = 0; r < 4; r++)
|
|
35
|
+
for (let c = 0; c < 8; c++)
|
|
36
|
+
(c === pos || c === pos - 1) && (g[r][c] = !0);
|
|
37
|
+
frames.push(gridToBraille(g));
|
|
38
|
+
}
|
|
39
|
+
return frames;
|
|
40
|
+
}
|
|
41
|
+
function genRain() {
|
|
42
|
+
let frames = [], offsets = [0, 3, 1, 5, 2, 7, 4, 6];
|
|
43
|
+
for (let f = 0; f < 12; f++) {
|
|
44
|
+
let g = makeGrid(4, 8);
|
|
45
|
+
for (let c = 0; c < 8; c++) {
|
|
46
|
+
let row = (f + offsets[c]) % 6;
|
|
47
|
+
row < 4 && (g[row][c] = !0);
|
|
48
|
+
}
|
|
49
|
+
frames.push(gridToBraille(g));
|
|
50
|
+
}
|
|
51
|
+
return frames;
|
|
52
|
+
}
|
|
53
|
+
function genScanLine() {
|
|
54
|
+
let frames = [], positions = [0, 1, 2, 3, 2, 1];
|
|
55
|
+
for (let row of positions) {
|
|
56
|
+
let g = makeGrid(4, 6);
|
|
57
|
+
for (let c = 0; c < 6; c++)
|
|
58
|
+
g[row][c] = !0, row > 0 && (g[row - 1][c] = c % 2 === 0);
|
|
59
|
+
frames.push(gridToBraille(g));
|
|
60
|
+
}
|
|
61
|
+
return frames;
|
|
62
|
+
}
|
|
63
|
+
function genPulse() {
|
|
64
|
+
let frames = [], radii = [0.5, 1.2, 2, 3, 3.5];
|
|
65
|
+
for (let r of radii) {
|
|
66
|
+
let g = makeGrid(4, 6);
|
|
67
|
+
for (let row = 0; row < 4; row++)
|
|
68
|
+
for (let col = 0; col < 6; col++) {
|
|
69
|
+
let dist = Math.sqrt((col - 2.5) ** 2 + (row - 1.5) ** 2);
|
|
70
|
+
Math.abs(dist - r) < 0.9 && (g[row][col] = !0);
|
|
71
|
+
}
|
|
72
|
+
frames.push(gridToBraille(g));
|
|
73
|
+
}
|
|
74
|
+
return frames;
|
|
75
|
+
}
|
|
76
|
+
function genSnake() {
|
|
77
|
+
let path = [];
|
|
78
|
+
for (let r = 0; r < 4; r++)
|
|
79
|
+
if (r % 2 === 0)
|
|
80
|
+
for (let c = 0; c < 4; c++) path.push([r, c]);
|
|
81
|
+
else
|
|
82
|
+
for (let c = 3; c >= 0; c--) path.push([r, c]);
|
|
83
|
+
let frames = [];
|
|
84
|
+
for (let i = 0; i < path.length; i++) {
|
|
85
|
+
let g = makeGrid(4, 4);
|
|
86
|
+
for (let t = 0; t < 4; t++) {
|
|
87
|
+
let idx = (i - t + path.length) % path.length;
|
|
88
|
+
g[path[idx][0]][path[idx][1]] = !0;
|
|
89
|
+
}
|
|
90
|
+
frames.push(gridToBraille(g));
|
|
91
|
+
}
|
|
92
|
+
return frames;
|
|
93
|
+
}
|
|
94
|
+
function genSparkle() {
|
|
95
|
+
let patterns = [
|
|
96
|
+
[1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0],
|
|
97
|
+
[0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0],
|
|
98
|
+
[0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1],
|
|
99
|
+
[1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0],
|
|
100
|
+
[0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1],
|
|
101
|
+
[0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]
|
|
102
|
+
], W = 8, H = 4, frames = [];
|
|
103
|
+
for (let pat of patterns) {
|
|
104
|
+
let g = makeGrid(H, W);
|
|
105
|
+
for (let r = 0; r < H; r++)
|
|
106
|
+
for (let c = 0; c < W; c++)
|
|
107
|
+
g[r][c] = !!pat[r * W + c];
|
|
108
|
+
frames.push(gridToBraille(g));
|
|
109
|
+
}
|
|
110
|
+
return frames;
|
|
111
|
+
}
|
|
112
|
+
function genCascade() {
|
|
113
|
+
let frames = [];
|
|
114
|
+
for (let offset = -2; offset < 12; offset++) {
|
|
115
|
+
let g = makeGrid(4, 8);
|
|
116
|
+
for (let r = 0; r < 4; r++)
|
|
117
|
+
for (let c = 0; c < 8; c++) {
|
|
118
|
+
let diag = c + r;
|
|
119
|
+
(diag === offset || diag === offset - 1) && (g[r][c] = !0);
|
|
120
|
+
}
|
|
121
|
+
frames.push(gridToBraille(g));
|
|
122
|
+
}
|
|
123
|
+
return frames;
|
|
124
|
+
}
|
|
125
|
+
function genColumns() {
|
|
126
|
+
let frames = [];
|
|
127
|
+
for (let col = 0; col < 6; col++)
|
|
128
|
+
for (let fillTo = 3; fillTo >= 0; fillTo--) {
|
|
129
|
+
let g = makeGrid(4, 6);
|
|
130
|
+
for (let pc = 0; pc < col; pc++)
|
|
131
|
+
for (let r = 0; r < 4; r++) g[r][pc] = !0;
|
|
132
|
+
for (let r = fillTo; r < 4; r++) g[r][col] = !0;
|
|
133
|
+
frames.push(gridToBraille(g));
|
|
134
|
+
}
|
|
135
|
+
let full = makeGrid(4, 6);
|
|
136
|
+
for (let r = 0; r < 4; r++) for (let c = 0; c < 6; c++) full[r][c] = !0;
|
|
137
|
+
return frames.push(gridToBraille(full)), frames.push(gridToBraille(makeGrid(4, 6))), frames;
|
|
138
|
+
}
|
|
139
|
+
function genOrbit() {
|
|
140
|
+
let path = [
|
|
141
|
+
[0, 0],
|
|
142
|
+
[0, 1],
|
|
143
|
+
[1, 1],
|
|
144
|
+
[2, 1],
|
|
145
|
+
[3, 1],
|
|
146
|
+
[3, 0],
|
|
147
|
+
[2, 0],
|
|
148
|
+
[1, 0]
|
|
149
|
+
], frames = [];
|
|
150
|
+
for (let i = 0; i < path.length; i++) {
|
|
151
|
+
let g = makeGrid(4, 2);
|
|
152
|
+
g[path[i][0]][path[i][1]] = !0;
|
|
153
|
+
let t1 = (i - 1 + path.length) % path.length;
|
|
154
|
+
g[path[t1][0]][path[t1][1]] = !0, frames.push(gridToBraille(g));
|
|
155
|
+
}
|
|
156
|
+
return frames;
|
|
157
|
+
}
|
|
158
|
+
function genBreathe() {
|
|
159
|
+
let stages = [
|
|
160
|
+
[],
|
|
161
|
+
[[1, 0]],
|
|
162
|
+
[[0, 1], [2, 0]],
|
|
163
|
+
[[0, 0], [1, 1], [3, 0]],
|
|
164
|
+
[[0, 0], [1, 1], [2, 0], [3, 1]],
|
|
165
|
+
[[0, 0], [0, 1], [1, 1], [2, 0], [3, 1]],
|
|
166
|
+
[[0, 0], [0, 1], [1, 0], [2, 1], [3, 0], [3, 1]],
|
|
167
|
+
[[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [3, 0], [3, 1]],
|
|
168
|
+
[[0, 0], [0, 1], [1, 0], [1, 1], [2, 0], [2, 1], [3, 0], [3, 1]]
|
|
169
|
+
], frames = [], sequence = [...stages, ...stages.slice().reverse().slice(1)];
|
|
170
|
+
for (let dots of sequence) {
|
|
171
|
+
let g = makeGrid(4, 2);
|
|
172
|
+
for (let [r, c] of dots) g[r][c] = !0;
|
|
173
|
+
frames.push(gridToBraille(g));
|
|
174
|
+
}
|
|
175
|
+
return frames;
|
|
176
|
+
}
|
|
177
|
+
function genWaveRows() {
|
|
178
|
+
let frames = [];
|
|
179
|
+
for (let f = 0; f < 16; f++) {
|
|
180
|
+
let g = makeGrid(4, 8);
|
|
181
|
+
for (let c = 0; c < 8; c++) {
|
|
182
|
+
let phase = f - c * 0.5, row = Math.round((Math.sin(phase * 0.8) + 1) / 2 * 3);
|
|
183
|
+
g[row][c] = !0, row > 0 && (g[row - 1][c] = (f + c) % 3 === 0);
|
|
184
|
+
}
|
|
185
|
+
frames.push(gridToBraille(g));
|
|
186
|
+
}
|
|
187
|
+
return frames;
|
|
188
|
+
}
|
|
189
|
+
function genCheckerboard() {
|
|
190
|
+
let frames = [];
|
|
191
|
+
for (let phase = 0; phase < 4; phase++) {
|
|
192
|
+
let g = makeGrid(4, 6);
|
|
193
|
+
for (let r = 0; r < 4; r++)
|
|
194
|
+
for (let c = 0; c < 6; c++)
|
|
195
|
+
phase < 2 ? g[r][c] = (r + c + phase) % 2 === 0 : g[r][c] = (r + c + phase) % 3 === 0;
|
|
196
|
+
frames.push(gridToBraille(g));
|
|
197
|
+
}
|
|
198
|
+
return frames;
|
|
199
|
+
}
|
|
200
|
+
function genHelix() {
|
|
201
|
+
let frames = [];
|
|
202
|
+
for (let f = 0; f < 16; f++) {
|
|
203
|
+
let g = makeGrid(4, 8);
|
|
204
|
+
for (let c = 0; c < 8; c++) {
|
|
205
|
+
let phase = (f + c) * (Math.PI / 4), y1 = Math.round((Math.sin(phase) + 1) / 2 * 3), y2 = Math.round((Math.sin(phase + Math.PI) + 1) / 2 * 3);
|
|
206
|
+
g[y1][c] = !0, g[y2][c] = !0;
|
|
207
|
+
}
|
|
208
|
+
frames.push(gridToBraille(g));
|
|
209
|
+
}
|
|
210
|
+
return frames;
|
|
211
|
+
}
|
|
212
|
+
function genFillSweep() {
|
|
213
|
+
let frames = [];
|
|
214
|
+
for (let row = 3; row >= 0; row--) {
|
|
215
|
+
let g = makeGrid(4, 4);
|
|
216
|
+
for (let r = row; r < 4; r++)
|
|
217
|
+
for (let c = 0; c < 4; c++) g[r][c] = !0;
|
|
218
|
+
frames.push(gridToBraille(g));
|
|
219
|
+
}
|
|
220
|
+
let full = makeGrid(4, 4);
|
|
221
|
+
for (let r = 0; r < 4; r++) for (let c = 0; c < 4; c++) full[r][c] = !0;
|
|
222
|
+
frames.push(gridToBraille(full)), frames.push(gridToBraille(full));
|
|
223
|
+
for (let row = 0; row < 4; row++) {
|
|
224
|
+
let g = makeGrid(4, 4);
|
|
225
|
+
for (let r = row + 1; r < 4; r++)
|
|
226
|
+
for (let c = 0; c < 4; c++) g[r][c] = !0;
|
|
227
|
+
frames.push(gridToBraille(g));
|
|
228
|
+
}
|
|
229
|
+
return frames.push(gridToBraille(makeGrid(4, 4))), frames;
|
|
230
|
+
}
|
|
231
|
+
function genDiagonalSwipe() {
|
|
232
|
+
let frames = [];
|
|
233
|
+
for (let d = 0; d <= 6; d++) {
|
|
234
|
+
let g = makeGrid(4, 4);
|
|
235
|
+
for (let r = 0; r < 4; r++)
|
|
236
|
+
for (let c = 0; c < 4; c++)
|
|
237
|
+
r + c <= d && (g[r][c] = !0);
|
|
238
|
+
frames.push(gridToBraille(g));
|
|
239
|
+
}
|
|
240
|
+
let full = makeGrid(4, 4);
|
|
241
|
+
for (let r = 0; r < 4; r++) for (let c = 0; c < 4; c++) full[r][c] = !0;
|
|
242
|
+
frames.push(gridToBraille(full));
|
|
243
|
+
for (let d = 0; d <= 6; d++) {
|
|
244
|
+
let g = makeGrid(4, 4);
|
|
245
|
+
for (let r = 0; r < 4; r++)
|
|
246
|
+
for (let c = 0; c < 4; c++)
|
|
247
|
+
r + c > d && (g[r][c] = !0);
|
|
248
|
+
frames.push(gridToBraille(g));
|
|
249
|
+
}
|
|
250
|
+
return frames.push(gridToBraille(makeGrid(4, 4))), frames;
|
|
251
|
+
}
|
|
252
|
+
var spinners = {
|
|
253
|
+
// === Classic braille single-char ===
|
|
254
|
+
braille: {
|
|
255
|
+
frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"],
|
|
256
|
+
interval: 80
|
|
257
|
+
},
|
|
258
|
+
braillewave: {
|
|
259
|
+
frames: [
|
|
260
|
+
"\u2801\u2802\u2804\u2840",
|
|
261
|
+
"\u2802\u2804\u2840\u2880",
|
|
262
|
+
"\u2804\u2840\u2880\u2820",
|
|
263
|
+
"\u2840\u2880\u2820\u2810",
|
|
264
|
+
"\u2880\u2820\u2810\u2808",
|
|
265
|
+
"\u2820\u2810\u2808\u2801",
|
|
266
|
+
"\u2810\u2808\u2801\u2802",
|
|
267
|
+
"\u2808\u2801\u2802\u2804"
|
|
268
|
+
],
|
|
269
|
+
interval: 100
|
|
270
|
+
},
|
|
271
|
+
dna: {
|
|
272
|
+
frames: [
|
|
273
|
+
"\u280B\u2809\u2819\u281A",
|
|
274
|
+
"\u2809\u2819\u281A\u2812",
|
|
275
|
+
"\u2819\u281A\u2812\u2802",
|
|
276
|
+
"\u281A\u2812\u2802\u2802",
|
|
277
|
+
"\u2812\u2802\u2802\u2812",
|
|
278
|
+
"\u2802\u2802\u2812\u2832",
|
|
279
|
+
"\u2802\u2812\u2832\u2834",
|
|
280
|
+
"\u2812\u2832\u2834\u2824",
|
|
281
|
+
"\u2832\u2834\u2824\u2804",
|
|
282
|
+
"\u2834\u2824\u2804\u280B",
|
|
283
|
+
"\u2824\u2804\u280B\u2809",
|
|
284
|
+
"\u2804\u280B\u2809\u2819"
|
|
285
|
+
],
|
|
286
|
+
interval: 80
|
|
287
|
+
},
|
|
288
|
+
// === Generated braille grid animations ===
|
|
289
|
+
scan: { frames: genScan(), interval: 70 },
|
|
290
|
+
rain: { frames: genRain(), interval: 100 },
|
|
291
|
+
scanline: { frames: genScanLine(), interval: 120 },
|
|
292
|
+
pulse: { frames: genPulse(), interval: 180 },
|
|
293
|
+
snake: { frames: genSnake(), interval: 80 },
|
|
294
|
+
sparkle: { frames: genSparkle(), interval: 150 },
|
|
295
|
+
cascade: { frames: genCascade(), interval: 60 },
|
|
296
|
+
columns: { frames: genColumns(), interval: 60 },
|
|
297
|
+
orbit: { frames: genOrbit(), interval: 100 },
|
|
298
|
+
breathe: { frames: genBreathe(), interval: 100 },
|
|
299
|
+
waverows: { frames: genWaveRows(), interval: 90 },
|
|
300
|
+
checkerboard: { frames: genCheckerboard(), interval: 250 },
|
|
301
|
+
helix: { frames: genHelix(), interval: 80 },
|
|
302
|
+
fillsweep: { frames: genFillSweep(), interval: 100 },
|
|
303
|
+
diagswipe: { frames: genDiagonalSwipe(), interval: 60 }
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export {
|
|
307
|
+
spinners
|
|
308
|
+
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import * as os from "node:os";
|
|
11
11
|
import { basename } from "node:path";
|
|
12
12
|
import { pathToFileURL } from "node:url";
|
|
13
|
-
import { getCapabilities, getImageDimensions, hyperlink, imageFallback } from "@ashx-j/lunr-tui";
|
|
13
|
+
import { getCapabilities, getImageDimensions, hyperlink, imageFallback, Text, truncateToWidth, wrapTextWithAnsi } from "@ashx-j/lunr-tui";
|
|
14
14
|
|
|
15
15
|
// packages/coding-agent/dist/utils/ansi.js
|
|
16
16
|
function ansiRegex({ onlyFirst = !1 } = {}) {
|
|
@@ -71,13 +71,27 @@ function toolGroupRole(continuation, followed) {
|
|
|
71
71
|
function toolGroupTree(context) {
|
|
72
72
|
return !context.expanded;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
var GroupedCallText = class extends Text {
|
|
75
|
+
call;
|
|
76
|
+
formattedWidth;
|
|
77
|
+
setCall(call) {
|
|
78
|
+
this.setText(formatGroupedCall(call)), this.call = call;
|
|
79
|
+
}
|
|
80
|
+
setText(text) {
|
|
81
|
+
this.call = void 0, this.formattedWidth = void 0, super.setText(text);
|
|
82
|
+
}
|
|
83
|
+
render(width) {
|
|
84
|
+
return this.call && this.formattedWidth !== width && (super.setText(formatGroupedCall(this.call, width)), this.formattedWidth = width), super.render(width);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
function formatGroupedCall(opts, width) {
|
|
75
88
|
let detail = opts.detail?.trim() ? opts.detail : "";
|
|
76
89
|
if (!((opts.tree ?? opts.compact === !0) && opts.role !== "singleton" && detail.length > 0))
|
|
77
90
|
return detail ? `${opts.dot} ${opts.title} ${detail}` : `${opts.dot} ${opts.title}`;
|
|
78
|
-
let
|
|
91
|
+
let prefix = ` ${opts.role === "last" ? "\u2514\u2500" : "\u251C\u2500"} `, continuation = opts.role === "last" ? " " : " \u2502 ", leaf = width === void 0 ? `${prefix}${detail}` : wrapTextWithAnsi(replaceTabs(detail), Math.max(1, width - prefix.length)).map((line, index) => truncateToWidth(`${index === 0 ? prefix : continuation}${line}`, width, "")).join(`
|
|
92
|
+
`);
|
|
79
93
|
return opts.role === "first" ? `${opts.dot} ${opts.title}
|
|
80
|
-
|
|
94
|
+
${leaf}` : leaf;
|
|
81
95
|
}
|
|
82
96
|
function toolStatusDot(state, theme) {
|
|
83
97
|
return theme.fg(state === "pending" ? "muted" : state, "\u25CF");
|
|
@@ -117,6 +131,7 @@ export {
|
|
|
117
131
|
invalidArgText,
|
|
118
132
|
toolGroupRole,
|
|
119
133
|
toolGroupTree,
|
|
134
|
+
GroupedCallText,
|
|
120
135
|
formatGroupedCall,
|
|
121
136
|
toolStatusDot,
|
|
122
137
|
toolStatusDotFromContext,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-I6R76AG7.js";
|
|
5
5
|
import {
|
|
6
6
|
DynamicBorder
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6B2POMK7.js";
|
|
8
8
|
import {
|
|
9
9
|
keyHint,
|
|
10
10
|
rawKeyHint
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GNN7H3B7.js";
|
|
12
12
|
import {
|
|
13
13
|
theme
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7QWNYZDI.js";
|
|
15
15
|
|
|
16
16
|
// packages/coding-agent/dist/modes/interactive/components/extension-selector.js
|
|
17
17
|
import { Container, getKeybindings, Spacer, Text } from "@ashx-j/lunr-tui";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
theme
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7QWNYZDI.js";
|
|
5
5
|
|
|
6
6
|
// packages/coding-agent/dist/modes/interactive/components/dynamic-border.js
|
|
7
7
|
var DynamicBorder = class {
|
|
@@ -753,6 +753,9 @@ function getResolvedThemeColors(themeName) {
|
|
|
753
753
|
typeof value == "number" ? cssColors[key] = ansi256ToHex(value) : value === "" ? cssColors[key] = defaultText : cssColors[key] = value;
|
|
754
754
|
return cssColors;
|
|
755
755
|
}
|
|
756
|
+
function isLightTheme(themeName) {
|
|
757
|
+
return themeName === "light";
|
|
758
|
+
}
|
|
756
759
|
function getThemeExportColors(themeName) {
|
|
757
760
|
let name = themeName ?? currentThemeName ?? getDefaultTheme();
|
|
758
761
|
try {
|
|
@@ -957,6 +960,7 @@ export {
|
|
|
957
960
|
FS_WATCH_RETRY_DELAY_MS,
|
|
958
961
|
closeWatcher,
|
|
959
962
|
watchWithErrorHandler,
|
|
963
|
+
DEFAULT_THEME_GLYPHS,
|
|
960
964
|
Theme,
|
|
961
965
|
getAvailableThemes,
|
|
962
966
|
getAvailableThemesWithPaths,
|
|
@@ -964,7 +968,9 @@ export {
|
|
|
964
968
|
getThemeByName,
|
|
965
969
|
parseAutoThemeSetting,
|
|
966
970
|
resolveThemeSetting,
|
|
971
|
+
getThemeForRgbColor,
|
|
967
972
|
detectTerminalBackgroundFromEnv,
|
|
973
|
+
detectTerminalBackgroundTheme,
|
|
968
974
|
detectTerminalThemeForAuto,
|
|
969
975
|
getDefaultTheme,
|
|
970
976
|
theme,
|
|
@@ -976,6 +982,7 @@ export {
|
|
|
976
982
|
getThemeName,
|
|
977
983
|
stopThemeWatcher,
|
|
978
984
|
getResolvedThemeColors,
|
|
985
|
+
isLightTheme,
|
|
979
986
|
getThemeExportColors,
|
|
980
987
|
highlightCode,
|
|
981
988
|
getLanguageFromPath,
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { createRequire as __lunrRequire } from "node:module"; const require = __lunrRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SessionManager
|
|
4
|
+
} from "./chunk-XLTL257W.js";
|
|
5
|
+
import {
|
|
6
|
+
SessionOwnership,
|
|
7
|
+
canonicalSessionPath,
|
|
8
|
+
isSessionOwnerDead,
|
|
9
|
+
readSessionOwner,
|
|
10
|
+
writeSessionJson
|
|
11
|
+
} from "./chunk-UAEOTO52.js";
|
|
12
|
+
import {
|
|
13
|
+
getAgentDir
|
|
14
|
+
} from "./chunk-FQMM2EZ2.js";
|
|
15
|
+
|
|
16
|
+
// packages/coding-agent/dist/core/session-handoff.js
|
|
17
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
18
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
19
|
+
import { join } from "node:path";
|
|
20
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
21
|
+
var HANDOFF_DURATION_MS = 480 * 60 * 1e3;
|
|
22
|
+
function registry(agentDir = getAgentDir()) {
|
|
23
|
+
return join(agentDir, "session-handoffs");
|
|
24
|
+
}
|
|
25
|
+
function recordPath(file, agentDir) {
|
|
26
|
+
return join(registry(agentDir), `${createHash("sha256").update(canonicalSessionPath(file)).digest("hex")}.json`);
|
|
27
|
+
}
|
|
28
|
+
function readRecord(file, agentDir) {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(readFileSync(recordPath(file, agentDir), "utf8"));
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function saveRecord(manager, update, agentDir) {
|
|
36
|
+
manager.assertWritable();
|
|
37
|
+
let file = manager.getSessionFile();
|
|
38
|
+
if (!manager.isPersisted() || !file)
|
|
39
|
+
throw new Error("Only saved sessions can be handed off.");
|
|
40
|
+
let record = {
|
|
41
|
+
version: 1,
|
|
42
|
+
lastTuiActivityAt: 0,
|
|
43
|
+
...readRecord(file, agentDir),
|
|
44
|
+
...update,
|
|
45
|
+
sessionFile: canonicalSessionPath(file),
|
|
46
|
+
sessionId: manager.getSessionId(),
|
|
47
|
+
cwd: manager.getCwd(),
|
|
48
|
+
sessionDir: manager.getSessionDir()
|
|
49
|
+
};
|
|
50
|
+
return mkdirSync(registry(agentDir), { recursive: !0 }), writeSessionJson(recordPath(file, agentDir), record), record;
|
|
51
|
+
}
|
|
52
|
+
function recordTuiActivity(manager, agentDir, now = Date.now()) {
|
|
53
|
+
manager.isPersisted() && saveRecord(manager, { lastTuiActivityAt: now }, agentDir);
|
|
54
|
+
}
|
|
55
|
+
function markSessionHandoff(manager, agentDir, now = Date.now()) {
|
|
56
|
+
if (!manager.getSessionFile() || !existsSync(manager.getSessionFile()))
|
|
57
|
+
throw new Error("Session is not saved yet. Complete a turn before marking it for handoff.");
|
|
58
|
+
return saveRecord(manager, { manualHandoff: { markedAt: now, expiresAt: now + HANDOFF_DURATION_MS }, lastTuiActivityAt: now }, agentDir);
|
|
59
|
+
}
|
|
60
|
+
function cancelSessionHandoff(manager, agentDir) {
|
|
61
|
+
saveRecord(manager, { manualHandoff: void 0 }, agentDir);
|
|
62
|
+
}
|
|
63
|
+
function listRegisteredSessions(agentDir) {
|
|
64
|
+
let directory = registry(agentDir);
|
|
65
|
+
if (!existsSync(directory))
|
|
66
|
+
return [];
|
|
67
|
+
let records = [];
|
|
68
|
+
for (let name of readdirSync(directory).filter((name2) => name2.endsWith(".json")))
|
|
69
|
+
try {
|
|
70
|
+
let record = JSON.parse(readFileSync(join(directory, name), "utf8"));
|
|
71
|
+
if (record.version !== 1 || typeof record.sessionFile != "string" || !Number.isFinite(record.lastTuiActivityAt) || SessionManager.openReadOnly(record.sessionFile).getSessionId() !== record.sessionId)
|
|
72
|
+
continue;
|
|
73
|
+
records.push(record);
|
|
74
|
+
} catch {
|
|
75
|
+
}
|
|
76
|
+
return records;
|
|
77
|
+
}
|
|
78
|
+
function listRegisteredSessionPaths(agentDir) {
|
|
79
|
+
return listRegisteredSessions(agentDir).map((record) => record.sessionFile);
|
|
80
|
+
}
|
|
81
|
+
function listHandoffCandidates(agentDir, now = Date.now()) {
|
|
82
|
+
return listRegisteredSessions(agentDir).filter((record) => record.manualHandoff && record.manualHandoff.expiresAt > now).sort((a, b) => b.manualHandoff.markedAt - a.manualHandoff.markedAt);
|
|
83
|
+
}
|
|
84
|
+
function latestTuiSession(agentDir) {
|
|
85
|
+
return listRegisteredSessions(agentDir).sort((a, b) => b.lastTuiActivityAt - a.lastTuiActivityAt)[0];
|
|
86
|
+
}
|
|
87
|
+
var SessionTransferError = class extends Error {
|
|
88
|
+
code;
|
|
89
|
+
constructor(message, code = "failed") {
|
|
90
|
+
super(message), this.name = "SessionTransferError", this.code = code;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
function transferPath(file) {
|
|
94
|
+
return `${canonicalSessionPath(file)}.transfer.json`;
|
|
95
|
+
}
|
|
96
|
+
async function requestSessionTransfer(file, options = {}) {
|
|
97
|
+
options.signal?.throwIfAborted();
|
|
98
|
+
let owner = readSessionOwner(file);
|
|
99
|
+
if (!owner || isSessionOwnerDead(owner))
|
|
100
|
+
return;
|
|
101
|
+
let path = transferPath(file), request = {
|
|
102
|
+
id: randomUUID(),
|
|
103
|
+
generation: owner.generation,
|
|
104
|
+
requester: `${process.pid}:${randomUUID()}`,
|
|
105
|
+
stop: options.stop === !0,
|
|
106
|
+
expiresAt: Date.now() + (options.timeoutMs ?? 15e3)
|
|
107
|
+
}, publication = new SessionOwnership(`${path}.publication`);
|
|
108
|
+
try {
|
|
109
|
+
if (existsSync(path)) {
|
|
110
|
+
let pending = JSON.parse(readFileSync(path, "utf8"));
|
|
111
|
+
if (!Number.isFinite(pending.expiresAt) || pending.expiresAt > Date.now())
|
|
112
|
+
throw new SessionTransferError("Another transfer request is pending.", "busy");
|
|
113
|
+
unlinkSync(path);
|
|
114
|
+
}
|
|
115
|
+
writeFileSync(path, JSON.stringify(request), { flag: "wx", mode: 384 });
|
|
116
|
+
} finally {
|
|
117
|
+
publication.release();
|
|
118
|
+
}
|
|
119
|
+
let responsePath = `${path}.${request.id}.response`;
|
|
120
|
+
try {
|
|
121
|
+
for (; Date.now() < request.expiresAt; ) {
|
|
122
|
+
options.signal?.throwIfAborted();
|
|
123
|
+
let current = readSessionOwner(file);
|
|
124
|
+
if (!current || isSessionOwnerDead(current))
|
|
125
|
+
return;
|
|
126
|
+
if (current.generation !== owner.generation)
|
|
127
|
+
throw new SessionTransferError("Another runtime acquired the session. Retry the transfer.", "changed");
|
|
128
|
+
if (existsSync(responsePath)) {
|
|
129
|
+
let response = JSON.parse(readFileSync(responsePath, "utf8"));
|
|
130
|
+
throw new SessionTransferError(response.error ?? "Owner did not release the session.", response.code ?? "failed");
|
|
131
|
+
}
|
|
132
|
+
await delay(100, void 0, { signal: options.signal });
|
|
133
|
+
}
|
|
134
|
+
throw new SessionTransferError("Owner did not release the session. It may be busy or running an older lunR. Close it normally or retry; no takeover occurred.", "timeout");
|
|
135
|
+
} finally {
|
|
136
|
+
try {
|
|
137
|
+
let cleanup = new SessionOwnership(`${path}.publication`);
|
|
138
|
+
try {
|
|
139
|
+
existsSync(path) && JSON.parse(readFileSync(path, "utf8")).id === request.id && unlinkSync(path);
|
|
140
|
+
} finally {
|
|
141
|
+
cleanup.release();
|
|
142
|
+
}
|
|
143
|
+
} catch {
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
unlinkSync(responsePath);
|
|
147
|
+
} catch {
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function registerTransferHandler(manager, handler) {
|
|
152
|
+
let owner = manager.getOwnership()?.owner;
|
|
153
|
+
if (!owner)
|
|
154
|
+
return () => {
|
|
155
|
+
};
|
|
156
|
+
let path = transferPath(owner.file), handling = !1, lastId, timer = setInterval(() => {
|
|
157
|
+
if (handling || !existsSync(path))
|
|
158
|
+
return;
|
|
159
|
+
let request;
|
|
160
|
+
try {
|
|
161
|
+
request = JSON.parse(readFileSync(path, "utf8"));
|
|
162
|
+
} catch {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (request.id === lastId || request.generation !== owner.generation || request.expiresAt <= Date.now())
|
|
166
|
+
return;
|
|
167
|
+
lastId = request.id, handling = !0;
|
|
168
|
+
let controller = new AbortController(), watchRequest = setInterval(() => {
|
|
169
|
+
try {
|
|
170
|
+
(Date.now() >= request.expiresAt || JSON.parse(readFileSync(path, "utf8")).id !== request.id) && controller.abort();
|
|
171
|
+
} catch {
|
|
172
|
+
controller.abort();
|
|
173
|
+
}
|
|
174
|
+
}, 50);
|
|
175
|
+
watchRequest.unref(), (async () => {
|
|
176
|
+
try {
|
|
177
|
+
if (manager.assertWritable(), await handler({ stop: request.stop === !0, signal: controller.signal }), readSessionOwner(owner.file)?.generation === owner.generation)
|
|
178
|
+
throw new SessionTransferError("Owner did not release the session.");
|
|
179
|
+
} catch (error) {
|
|
180
|
+
existsSync(path) && writeSessionJson(`${path}.${request.id}.response`, {
|
|
181
|
+
error: error instanceof Error ? error.message : String(error),
|
|
182
|
+
code: error instanceof SessionTransferError ? error.code : "failed"
|
|
183
|
+
});
|
|
184
|
+
} finally {
|
|
185
|
+
clearInterval(watchRequest), handling = !1;
|
|
186
|
+
}
|
|
187
|
+
})().catch(() => {
|
|
188
|
+
});
|
|
189
|
+
}, 100);
|
|
190
|
+
return timer.unref(), () => clearInterval(timer);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export {
|
|
194
|
+
HANDOFF_DURATION_MS,
|
|
195
|
+
recordTuiActivity,
|
|
196
|
+
markSessionHandoff,
|
|
197
|
+
cancelSessionHandoff,
|
|
198
|
+
listRegisteredSessions,
|
|
199
|
+
listRegisteredSessionPaths,
|
|
200
|
+
listHandoffCandidates,
|
|
201
|
+
latestTuiSession,
|
|
202
|
+
SessionTransferError,
|
|
203
|
+
requestSessionTransfer,
|
|
204
|
+
registerTransferHandler
|
|
205
|
+
};
|