@yjjeong/omg 0.1.0
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 +85 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/cli/args.d.ts +39 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +129 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/autoCommit.d.ts +20 -0
- package/dist/cli/autoCommit.d.ts.map +1 -0
- package/dist/cli/autoCommit.js +121 -0
- package/dist/cli/autoCommit.js.map +1 -0
- package/dist/cli/bgTasks.d.ts +57 -0
- package/dist/cli/bgTasks.d.ts.map +1 -0
- package/dist/cli/bgTasks.js +193 -0
- package/dist/cli/bgTasks.js.map +1 -0
- package/dist/cli/compactor.d.ts +48 -0
- package/dist/cli/compactor.d.ts.map +1 -0
- package/dist/cli/compactor.js +73 -0
- package/dist/cli/compactor.js.map +1 -0
- package/dist/cli/doctor.d.ts +77 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +279 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/gitStatus.d.ts +7 -0
- package/dist/cli/gitStatus.d.ts.map +1 -0
- package/dist/cli/gitStatus.js +70 -0
- package/dist/cli/gitStatus.js.map +1 -0
- package/dist/cli/handoff.d.ts +36 -0
- package/dist/cli/handoff.d.ts.map +1 -0
- package/dist/cli/handoff.js +60 -0
- package/dist/cli/handoff.js.map +1 -0
- package/dist/cli/interactive/brokers.d.ts +31 -0
- package/dist/cli/interactive/brokers.d.ts.map +1 -0
- package/dist/cli/interactive/brokers.js +259 -0
- package/dist/cli/interactive/brokers.js.map +1 -0
- package/dist/cli/interactive/index.d.ts +8 -0
- package/dist/cli/interactive/index.d.ts.map +1 -0
- package/dist/cli/interactive/index.js +731 -0
- package/dist/cli/interactive/index.js.map +1 -0
- package/dist/cli/interactive/proxyQuestions.d.ts +15 -0
- package/dist/cli/interactive/proxyQuestions.d.ts.map +1 -0
- package/dist/cli/interactive/proxyQuestions.js +48 -0
- package/dist/cli/interactive/proxyQuestions.js.map +1 -0
- package/dist/cli/interactive/tabManager.d.ts +32 -0
- package/dist/cli/interactive/tabManager.d.ts.map +1 -0
- package/dist/cli/interactive/tabManager.js +244 -0
- package/dist/cli/interactive/tabManager.js.map +1 -0
- package/dist/cli/interactive/teamHint.d.ts +2 -0
- package/dist/cli/interactive/teamHint.d.ts.map +1 -0
- package/dist/cli/interactive/teamHint.js +14 -0
- package/dist/cli/interactive/teamHint.js.map +1 -0
- package/dist/cli/login.d.ts +13 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +53 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/modes/demo.d.ts +12 -0
- package/dist/cli/modes/demo.d.ts.map +1 -0
- package/dist/cli/modes/demo.js +48 -0
- package/dist/cli/modes/demo.js.map +1 -0
- package/dist/cli/modes/doctor.d.ts +28 -0
- package/dist/cli/modes/doctor.d.ts.map +1 -0
- package/dist/cli/modes/doctor.js +79 -0
- package/dist/cli/modes/doctor.js.map +1 -0
- package/dist/cli/modes/login.d.ts +5 -0
- package/dist/cli/modes/login.d.ts.map +1 -0
- package/dist/cli/modes/login.js +40 -0
- package/dist/cli/modes/login.js.map +1 -0
- package/dist/cli/modes/mcpServe.d.ts +9 -0
- package/dist/cli/modes/mcpServe.d.ts.map +1 -0
- package/dist/cli/modes/mcpServe.js +112 -0
- package/dist/cli/modes/mcpServe.js.map +1 -0
- package/dist/cli/modes/orchestrator.d.ts +14 -0
- package/dist/cli/modes/orchestrator.d.ts.map +1 -0
- package/dist/cli/modes/orchestrator.js +64 -0
- package/dist/cli/modes/orchestrator.js.map +1 -0
- package/dist/cli/modes/team.d.ts +14 -0
- package/dist/cli/modes/team.d.ts.map +1 -0
- package/dist/cli/modes/team.js +87 -0
- package/dist/cli/modes/team.js.map +1 -0
- package/dist/cli/registry.d.ts +3 -0
- package/dist/cli/registry.d.ts.map +1 -0
- package/dist/cli/registry.js +15 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/slash/core.d.ts +3 -0
- package/dist/cli/slash/core.d.ts.map +1 -0
- package/dist/cli/slash/core.js +509 -0
- package/dist/cli/slash/core.js.map +1 -0
- package/dist/cli/slash/index.d.ts +3 -0
- package/dist/cli/slash/index.d.ts.map +1 -0
- package/dist/cli/slash/index.js +28 -0
- package/dist/cli/slash/index.js.map +1 -0
- package/dist/cli/slash/modes.d.ts +3 -0
- package/dist/cli/slash/modes.d.ts.map +1 -0
- package/dist/cli/slash/modes.js +530 -0
- package/dist/cli/slash/modes.js.map +1 -0
- package/dist/cli/slash/session.d.ts +3 -0
- package/dist/cli/slash/session.d.ts.map +1 -0
- package/dist/cli/slash/session.js +376 -0
- package/dist/cli/slash/session.js.map +1 -0
- package/dist/cli/slash/shared.d.ts +43 -0
- package/dist/cli/slash/shared.d.ts.map +1 -0
- package/dist/cli/slash/shared.js +6 -0
- package/dist/cli/slash/shared.js.map +1 -0
- package/dist/cli/slash/tabs.d.ts +3 -0
- package/dist/cli/slash/tabs.d.ts.map +1 -0
- package/dist/cli/slash/tabs.js +497 -0
- package/dist/cli/slash/tabs.js.map +1 -0
- package/dist/cli/slash/team.d.ts +3 -0
- package/dist/cli/slash/team.d.ts.map +1 -0
- package/dist/cli/slash/team.js +85 -0
- package/dist/cli/slash/team.js.map +1 -0
- package/dist/cli/slash.d.ts +3 -0
- package/dist/cli/slash.d.ts.map +1 -0
- package/dist/cli/slash.js +8 -0
- package/dist/cli/slash.js.map +1 -0
- package/dist/cli/teamPipeline.d.ts +42 -0
- package/dist/cli/teamPipeline.d.ts.map +1 -0
- package/dist/cli/teamPipeline.js +406 -0
- package/dist/cli/teamPipeline.js.map +1 -0
- package/dist/cli/touchedFiles.d.ts +14 -0
- package/dist/cli/touchedFiles.d.ts.map +1 -0
- package/dist/cli/touchedFiles.js +66 -0
- package/dist/cli/touchedFiles.js.map +1 -0
- package/dist/cli/turn.d.ts +47 -0
- package/dist/cli/turn.d.ts.map +1 -0
- package/dist/cli/turn.js +626 -0
- package/dist/cli/turn.js.map +1 -0
- package/dist/cli/types.d.ts +47 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +5 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/uiSession.d.ts +10 -0
- package/dist/cli/uiSession.d.ts.map +1 -0
- package/dist/cli/uiSession.js +66 -0
- package/dist/cli/uiSession.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +128 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/adapter.d.ts +47 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +48 -0
- package/dist/core/adapter.js.map +1 -0
- package/dist/core/adapters/anthropic.d.ts +35 -0
- package/dist/core/adapters/anthropic.d.ts.map +1 -0
- package/dist/core/adapters/anthropic.js +203 -0
- package/dist/core/adapters/anthropic.js.map +1 -0
- package/dist/core/adapters/claudeCli.d.ts +126 -0
- package/dist/core/adapters/claudeCli.d.ts.map +1 -0
- package/dist/core/adapters/claudeCli.js +584 -0
- package/dist/core/adapters/claudeCli.js.map +1 -0
- package/dist/core/adapters/cliAdapterBase.d.ts +48 -0
- package/dist/core/adapters/cliAdapterBase.d.ts.map +1 -0
- package/dist/core/adapters/cliAdapterBase.js +105 -0
- package/dist/core/adapters/cliAdapterBase.js.map +1 -0
- package/dist/core/adapters/cliStderr.d.ts +35 -0
- package/dist/core/adapters/cliStderr.d.ts.map +1 -0
- package/dist/core/adapters/cliStderr.js +87 -0
- package/dist/core/adapters/cliStderr.js.map +1 -0
- package/dist/core/adapters/codexCli.d.ts +113 -0
- package/dist/core/adapters/codexCli.d.ts.map +1 -0
- package/dist/core/adapters/codexCli.js +424 -0
- package/dist/core/adapters/codexCli.js.map +1 -0
- package/dist/core/adapters/gemini.d.ts +17 -0
- package/dist/core/adapters/gemini.d.ts.map +1 -0
- package/dist/core/adapters/gemini.js +133 -0
- package/dist/core/adapters/gemini.js.map +1 -0
- package/dist/core/adapters/geminiCli.d.ts +91 -0
- package/dist/core/adapters/geminiCli.d.ts.map +1 -0
- package/dist/core/adapters/geminiCli.js +276 -0
- package/dist/core/adapters/geminiCli.js.map +1 -0
- package/dist/core/adapters/nudges.d.ts +21 -0
- package/dist/core/adapters/nudges.d.ts.map +1 -0
- package/dist/core/adapters/nudges.js +75 -0
- package/dist/core/adapters/nudges.js.map +1 -0
- package/dist/core/adapters/openai.d.ts +17 -0
- package/dist/core/adapters/openai.d.ts.map +1 -0
- package/dist/core/adapters/openai.js +138 -0
- package/dist/core/adapters/openai.js.map +1 -0
- package/dist/core/adapters/parseFailures.d.ts +10 -0
- package/dist/core/adapters/parseFailures.d.ts.map +1 -0
- package/dist/core/adapters/parseFailures.js +35 -0
- package/dist/core/adapters/parseFailures.js.map +1 -0
- package/dist/core/adapters/utils.d.ts +11 -0
- package/dist/core/adapters/utils.d.ts.map +1 -0
- package/dist/core/adapters/utils.js +33 -0
- package/dist/core/adapters/utils.js.map +1 -0
- package/dist/core/askBroker.d.ts +11 -0
- package/dist/core/askBroker.d.ts.map +1 -0
- package/dist/core/askBroker.js +78 -0
- package/dist/core/askBroker.js.map +1 -0
- package/dist/core/atomicWrite.d.ts +5 -0
- package/dist/core/atomicWrite.d.ts.map +1 -0
- package/dist/core/atomicWrite.js +18 -0
- package/dist/core/atomicWrite.js.map +1 -0
- package/dist/core/brokers/askBroker.d.ts +11 -0
- package/dist/core/brokers/askBroker.d.ts.map +1 -0
- package/dist/core/brokers/askBroker.js +78 -0
- package/dist/core/brokers/askBroker.js.map +1 -0
- package/dist/core/brokers/permissionBroker.d.ts +7 -0
- package/dist/core/brokers/permissionBroker.d.ts.map +1 -0
- package/dist/core/brokers/permissionBroker.js +63 -0
- package/dist/core/brokers/permissionBroker.js.map +1 -0
- package/dist/core/brokers/socketBroker.d.ts +35 -0
- package/dist/core/brokers/socketBroker.d.ts.map +1 -0
- package/dist/core/brokers/socketBroker.js +74 -0
- package/dist/core/brokers/socketBroker.js.map +1 -0
- package/dist/core/clipboard.d.ts +4 -0
- package/dist/core/clipboard.d.ts.map +1 -0
- package/dist/core/clipboard.js +46 -0
- package/dist/core/clipboard.js.map +1 -0
- package/dist/core/compactor.d.ts +32 -0
- package/dist/core/compactor.d.ts.map +1 -0
- package/dist/core/compactor.js +91 -0
- package/dist/core/compactor.js.map +1 -0
- package/dist/core/consensusEngine.d.ts +21 -0
- package/dist/core/consensusEngine.d.ts.map +1 -0
- package/dist/core/consensusEngine.js +116 -0
- package/dist/core/consensusEngine.js.map +1 -0
- package/dist/core/context/contextCompressor.d.ts +10 -0
- package/dist/core/context/contextCompressor.d.ts.map +1 -0
- package/dist/core/context/contextCompressor.js +54 -0
- package/dist/core/context/contextCompressor.js.map +1 -0
- package/dist/core/context/contextWindows.d.ts +25 -0
- package/dist/core/context/contextWindows.d.ts.map +1 -0
- package/dist/core/context/contextWindows.js +101 -0
- package/dist/core/context/contextWindows.js.map +1 -0
- package/dist/core/context/summarizer.d.ts +65 -0
- package/dist/core/context/summarizer.d.ts.map +1 -0
- package/dist/core/context/summarizer.js +184 -0
- package/dist/core/context/summarizer.js.map +1 -0
- package/dist/core/context/usageCache.d.ts +19 -0
- package/dist/core/context/usageCache.d.ts.map +1 -0
- package/dist/core/context/usageCache.js +157 -0
- package/dist/core/context/usageCache.js.map +1 -0
- package/dist/core/context/usageWindow.d.ts +19 -0
- package/dist/core/context/usageWindow.d.ts.map +1 -0
- package/dist/core/context/usageWindow.js +73 -0
- package/dist/core/context/usageWindow.js.map +1 -0
- package/dist/core/contextCompressor.d.ts +10 -0
- package/dist/core/contextCompressor.d.ts.map +1 -0
- package/dist/core/contextCompressor.js +54 -0
- package/dist/core/contextCompressor.js.map +1 -0
- package/dist/core/contextWindows.d.ts +5 -0
- package/dist/core/contextWindows.d.ts.map +1 -0
- package/dist/core/contextWindows.js +60 -0
- package/dist/core/contextWindows.js.map +1 -0
- package/dist/core/continuum/digest.d.ts +35 -0
- package/dist/core/continuum/digest.d.ts.map +1 -0
- package/dist/core/continuum/digest.js +91 -0
- package/dist/core/continuum/digest.js.map +1 -0
- package/dist/core/continuum/index.d.ts +6 -0
- package/dist/core/continuum/index.d.ts.map +1 -0
- package/dist/core/continuum/index.js +7 -0
- package/dist/core/continuum/index.js.map +1 -0
- package/dist/core/continuum/inject.d.ts +9 -0
- package/dist/core/continuum/inject.d.ts.map +1 -0
- package/dist/core/continuum/inject.js +78 -0
- package/dist/core/continuum/inject.js.map +1 -0
- package/dist/core/continuum/projectId.d.ts +10 -0
- package/dist/core/continuum/projectId.d.ts.map +1 -0
- package/dist/core/continuum/projectId.js +60 -0
- package/dist/core/continuum/projectId.js.map +1 -0
- package/dist/core/continuum/store.d.ts +24 -0
- package/dist/core/continuum/store.d.ts.map +1 -0
- package/dist/core/continuum/store.js +144 -0
- package/dist/core/continuum/store.js.map +1 -0
- package/dist/core/continuum/types.d.ts +87 -0
- package/dist/core/continuum/types.d.ts.map +1 -0
- package/dist/core/continuum/types.js +9 -0
- package/dist/core/continuum/types.js.map +1 -0
- package/dist/core/dag.d.ts +21 -0
- package/dist/core/dag.d.ts.map +1 -0
- package/dist/core/dag.js +71 -0
- package/dist/core/dag.js.map +1 -0
- package/dist/core/director.d.ts +11 -0
- package/dist/core/director.d.ts.map +1 -0
- package/dist/core/director.js +37 -0
- package/dist/core/director.js.map +1 -0
- package/dist/core/hookedToolBroker.d.ts +25 -0
- package/dist/core/hookedToolBroker.d.ts.map +1 -0
- package/dist/core/hookedToolBroker.js +95 -0
- package/dist/core/hookedToolBroker.js.map +1 -0
- package/dist/core/langHint.d.ts +9 -0
- package/dist/core/langHint.d.ts.map +1 -0
- package/dist/core/langHint.js +33 -0
- package/dist/core/langHint.js.map +1 -0
- package/dist/core/mcp/mcpClient.d.ts +42 -0
- package/dist/core/mcp/mcpClient.d.ts.map +1 -0
- package/dist/core/mcp/mcpClient.js +134 -0
- package/dist/core/mcp/mcpClient.js.map +1 -0
- package/dist/core/mcp/mcpConfig.d.ts +58 -0
- package/dist/core/mcp/mcpConfig.d.ts.map +1 -0
- package/dist/core/mcp/mcpConfig.js +148 -0
- package/dist/core/mcp/mcpConfig.js.map +1 -0
- package/dist/core/mcp/mcpManager.d.ts +31 -0
- package/dist/core/mcp/mcpManager.d.ts.map +1 -0
- package/dist/core/mcp/mcpManager.js +83 -0
- package/dist/core/mcp/mcpManager.js.map +1 -0
- package/dist/core/mcpClient.d.ts +42 -0
- package/dist/core/mcpClient.d.ts.map +1 -0
- package/dist/core/mcpClient.js +134 -0
- package/dist/core/mcpClient.js.map +1 -0
- package/dist/core/mcpConfig.d.ts +24 -0
- package/dist/core/mcpConfig.d.ts.map +1 -0
- package/dist/core/mcpConfig.js +74 -0
- package/dist/core/mcpConfig.js.map +1 -0
- package/dist/core/mcpManager.d.ts +31 -0
- package/dist/core/mcpManager.d.ts.map +1 -0
- package/dist/core/mcpManager.js +83 -0
- package/dist/core/mcpManager.js.map +1 -0
- package/dist/core/memory.d.ts +22 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +102 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/omgToolManifest.d.ts +34 -0
- package/dist/core/omgToolManifest.d.ts.map +1 -0
- package/dist/core/omgToolManifest.js +59 -0
- package/dist/core/omgToolManifest.js.map +1 -0
- package/dist/core/orchestration/consensusEngine.d.ts +21 -0
- package/dist/core/orchestration/consensusEngine.d.ts.map +1 -0
- package/dist/core/orchestration/consensusEngine.js +116 -0
- package/dist/core/orchestration/consensusEngine.js.map +1 -0
- package/dist/core/orchestration/dag.d.ts +21 -0
- package/dist/core/orchestration/dag.d.ts.map +1 -0
- package/dist/core/orchestration/dag.js +71 -0
- package/dist/core/orchestration/dag.js.map +1 -0
- package/dist/core/orchestration/director.d.ts +11 -0
- package/dist/core/orchestration/director.d.ts.map +1 -0
- package/dist/core/orchestration/director.js +37 -0
- package/dist/core/orchestration/director.js.map +1 -0
- package/dist/core/orchestration/orchestrator.d.ts +32 -0
- package/dist/core/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/orchestrator.js +214 -0
- package/dist/core/orchestration/orchestrator.js.map +1 -0
- package/dist/core/orchestration/roleRouter.d.ts +28 -0
- package/dist/core/orchestration/roleRouter.d.ts.map +1 -0
- package/dist/core/orchestration/roleRouter.js +64 -0
- package/dist/core/orchestration/roleRouter.js.map +1 -0
- package/dist/core/orchestration/teamRunner.d.ts +69 -0
- package/dist/core/orchestration/teamRunner.d.ts.map +1 -0
- package/dist/core/orchestration/teamRunner.js +477 -0
- package/dist/core/orchestration/teamRunner.js.map +1 -0
- package/dist/core/orchestration/types.d.ts +115 -0
- package/dist/core/orchestration/types.d.ts.map +1 -0
- package/dist/core/orchestration/types.js +71 -0
- package/dist/core/orchestration/types.js.map +1 -0
- package/dist/core/orchestrator.d.ts +32 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +214 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/permissionBroker.d.ts +7 -0
- package/dist/core/permissionBroker.d.ts.map +1 -0
- package/dist/core/permissionBroker.js +63 -0
- package/dist/core/permissionBroker.js.map +1 -0
- package/dist/core/planConfig.d.ts +15 -0
- package/dist/core/planConfig.d.ts.map +1 -0
- package/dist/core/planConfig.js +98 -0
- package/dist/core/planConfig.js.map +1 -0
- package/dist/core/presetPersistence.d.ts +4 -0
- package/dist/core/presetPersistence.d.ts.map +1 -0
- package/dist/core/presetPersistence.js +64 -0
- package/dist/core/presetPersistence.js.map +1 -0
- package/dist/core/roleRouter.d.ts +26 -0
- package/dist/core/roleRouter.d.ts.map +1 -0
- package/dist/core/roleRouter.js +62 -0
- package/dist/core/roleRouter.js.map +1 -0
- package/dist/core/sessionList.d.ts +26 -0
- package/dist/core/sessionList.d.ts.map +1 -0
- package/dist/core/sessionList.js +278 -0
- package/dist/core/sessionList.js.map +1 -0
- package/dist/core/slugify.d.ts +2 -0
- package/dist/core/slugify.d.ts.map +1 -0
- package/dist/core/slugify.js +17 -0
- package/dist/core/slugify.js.map +1 -0
- package/dist/core/socketBroker.d.ts +19 -0
- package/dist/core/socketBroker.d.ts.map +1 -0
- package/dist/core/socketBroker.js +48 -0
- package/dist/core/socketBroker.js.map +1 -0
- package/dist/core/state/agentsMdScaffold.d.ts +15 -0
- package/dist/core/state/agentsMdScaffold.d.ts.map +1 -0
- package/dist/core/state/agentsMdScaffold.js +118 -0
- package/dist/core/state/agentsMdScaffold.js.map +1 -0
- package/dist/core/state/atomicWrite.d.ts +5 -0
- package/dist/core/state/atomicWrite.d.ts.map +1 -0
- package/dist/core/state/atomicWrite.js +18 -0
- package/dist/core/state/atomicWrite.js.map +1 -0
- package/dist/core/state/handoff.d.ts +20 -0
- package/dist/core/state/handoff.d.ts.map +1 -0
- package/dist/core/state/handoff.js +71 -0
- package/dist/core/state/handoff.js.map +1 -0
- package/dist/core/state/mcpCatalog.d.ts +11 -0
- package/dist/core/state/mcpCatalog.d.ts.map +1 -0
- package/dist/core/state/mcpCatalog.js +51 -0
- package/dist/core/state/mcpCatalog.js.map +1 -0
- package/dist/core/state/mcpRecommendations.d.ts +7 -0
- package/dist/core/state/mcpRecommendations.d.ts.map +1 -0
- package/dist/core/state/mcpRecommendations.js +57 -0
- package/dist/core/state/mcpRecommendations.js.map +1 -0
- package/dist/core/state/memory.d.ts +22 -0
- package/dist/core/state/memory.d.ts.map +1 -0
- package/dist/core/state/memory.js +102 -0
- package/dist/core/state/memory.js.map +1 -0
- package/dist/core/state/planConfig.d.ts +15 -0
- package/dist/core/state/planConfig.d.ts.map +1 -0
- package/dist/core/state/planConfig.js +98 -0
- package/dist/core/state/planConfig.js.map +1 -0
- package/dist/core/state/presetPersistence.d.ts +4 -0
- package/dist/core/state/presetPersistence.d.ts.map +1 -0
- package/dist/core/state/presetPersistence.js +67 -0
- package/dist/core/state/presetPersistence.js.map +1 -0
- package/dist/core/state/sessionList.d.ts +26 -0
- package/dist/core/state/sessionList.d.ts.map +1 -0
- package/dist/core/state/sessionList.js +278 -0
- package/dist/core/state/sessionList.js.map +1 -0
- package/dist/core/state/stackDetect.d.ts +8 -0
- package/dist/core/state/stackDetect.d.ts.map +1 -0
- package/dist/core/state/stackDetect.js +40 -0
- package/dist/core/state/stackDetect.js.map +1 -0
- package/dist/core/state/tabPersistence.d.ts +29 -0
- package/dist/core/state/tabPersistence.d.ts.map +1 -0
- package/dist/core/state/tabPersistence.js +65 -0
- package/dist/core/state/tabPersistence.js.map +1 -0
- package/dist/core/tabPersistence.d.ts +29 -0
- package/dist/core/tabPersistence.d.ts.map +1 -0
- package/dist/core/tabPersistence.js +65 -0
- package/dist/core/tabPersistence.js.map +1 -0
- package/dist/core/teamRunner.d.ts +42 -0
- package/dist/core/teamRunner.d.ts.map +1 -0
- package/dist/core/teamRunner.js +248 -0
- package/dist/core/teamRunner.js.map +1 -0
- package/dist/core/toolGate.d.ts +23 -0
- package/dist/core/toolGate.d.ts.map +1 -0
- package/dist/core/toolGate.js +51 -0
- package/dist/core/toolGate.js.map +1 -0
- package/dist/core/toolInterceptor.d.ts +7 -0
- package/dist/core/toolInterceptor.d.ts.map +1 -0
- package/dist/core/toolInterceptor.js +108 -0
- package/dist/core/toolInterceptor.js.map +1 -0
- package/dist/core/tools/hookedToolBroker.d.ts +25 -0
- package/dist/core/tools/hookedToolBroker.d.ts.map +1 -0
- package/dist/core/tools/hookedToolBroker.js +95 -0
- package/dist/core/tools/hookedToolBroker.js.map +1 -0
- package/dist/core/tools/omgToolManifest.d.ts +42 -0
- package/dist/core/tools/omgToolManifest.d.ts.map +1 -0
- package/dist/core/tools/omgToolManifest.js +66 -0
- package/dist/core/tools/omgToolManifest.js.map +1 -0
- package/dist/core/tools/toolGate.d.ts +23 -0
- package/dist/core/tools/toolGate.d.ts.map +1 -0
- package/dist/core/tools/toolGate.js +51 -0
- package/dist/core/tools/toolGate.js.map +1 -0
- package/dist/core/tools/toolInterceptor.d.ts +7 -0
- package/dist/core/tools/toolInterceptor.d.ts.map +1 -0
- package/dist/core/tools/toolInterceptor.js +108 -0
- package/dist/core/tools/toolInterceptor.js.map +1 -0
- package/dist/core/tools/tools.d.ts +34 -0
- package/dist/core/tools/tools.d.ts.map +1 -0
- package/dist/core/tools/tools.js +328 -0
- package/dist/core/tools/tools.js.map +1 -0
- package/dist/core/tools.d.ts +34 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +300 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/types.d.ts +107 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +55 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/usageCache.d.ts +19 -0
- package/dist/core/usageCache.d.ts.map +1 -0
- package/dist/core/usageCache.js +157 -0
- package/dist/core/usageCache.js.map +1 -0
- package/dist/core/usageWindow.d.ts +19 -0
- package/dist/core/usageWindow.d.ts.map +1 -0
- package/dist/core/usageWindow.js +73 -0
- package/dist/core/usageWindow.js.map +1 -0
- package/dist/core/util/bgProtocol.d.ts +5 -0
- package/dist/core/util/bgProtocol.d.ts.map +1 -0
- package/dist/core/util/bgProtocol.js +20 -0
- package/dist/core/util/bgProtocol.js.map +1 -0
- package/dist/core/util/clipboard.d.ts +4 -0
- package/dist/core/util/clipboard.d.ts.map +1 -0
- package/dist/core/util/clipboard.js +46 -0
- package/dist/core/util/clipboard.js.map +1 -0
- package/dist/core/util/clipboardImage.d.ts +3 -0
- package/dist/core/util/clipboardImage.d.ts.map +1 -0
- package/dist/core/util/clipboardImage.js +58 -0
- package/dist/core/util/clipboardImage.js.map +1 -0
- package/dist/core/util/langHint.d.ts +9 -0
- package/dist/core/util/langHint.d.ts.map +1 -0
- package/dist/core/util/langHint.js +33 -0
- package/dist/core/util/langHint.js.map +1 -0
- package/dist/core/util/slugify.d.ts +2 -0
- package/dist/core/util/slugify.d.ts.map +1 -0
- package/dist/core/util/slugify.js +28 -0
- package/dist/core/util/slugify.js.map +1 -0
- package/dist/hooks/hookedToolProxy.mjs +118 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc/dispatcher.d.ts +21 -0
- package/dist/ipc/dispatcher.d.ts.map +1 -0
- package/dist/ipc/dispatcher.js +160 -0
- package/dist/ipc/dispatcher.js.map +1 -0
- package/dist/ipc/events.d.ts +33 -0
- package/dist/ipc/events.d.ts.map +1 -0
- package/dist/ipc/events.js +42 -0
- package/dist/ipc/events.js.map +1 -0
- package/dist/ipc/rpc.d.ts +31 -0
- package/dist/ipc/rpc.d.ts.map +1 -0
- package/dist/ipc/rpc.js +110 -0
- package/dist/ipc/rpc.js.map +1 -0
- package/dist/ipc/stdio.d.ts +11 -0
- package/dist/ipc/stdio.d.ts.map +1 -0
- package/dist/ipc/stdio.js +52 -0
- package/dist/ipc/stdio.js.map +1 -0
- package/dist/mcp/askClient.d.ts +9 -0
- package/dist/mcp/askClient.d.ts.map +1 -0
- package/dist/mcp/askClient.js +70 -0
- package/dist/mcp/askClient.js.map +1 -0
- package/dist/mcp/constants.d.ts +6 -0
- package/dist/mcp/constants.d.ts.map +1 -0
- package/dist/mcp/constants.js +8 -0
- package/dist/mcp/constants.js.map +1 -0
- package/dist/mcp/permissionClient.d.ts +5 -0
- package/dist/mcp/permissionClient.d.ts.map +1 -0
- package/dist/mcp/permissionClient.js +71 -0
- package/dist/mcp/permissionClient.js.map +1 -0
- package/dist/mcp/schemas.d.ts +9 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +121 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +41 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +204 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/policy/loader.d.ts +27 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +89 -0
- package/dist/policy/loader.js.map +1 -0
- package/dist/policy/team-claude-only.yaml +46 -0
- package/dist/policy/team-codex-only.yaml +46 -0
- package/dist/policy/team-codex.yaml +54 -0
- package/dist/policy/team.yaml +104 -0
- package/dist/toolhook/hookedToolProxy.mjs +118 -0
- package/dist/ui/components/App.d.ts +14 -0
- package/dist/ui/components/App.d.ts.map +1 -0
- package/dist/ui/components/App.js +803 -0
- package/dist/ui/components/App.js.map +1 -0
- package/dist/ui/components/AskPicker.d.ts +8 -0
- package/dist/ui/components/AskPicker.d.ts.map +1 -0
- package/dist/ui/components/AskPicker.js +202 -0
- package/dist/ui/components/AskPicker.js.map +1 -0
- package/dist/ui/components/CommandInput.d.ts +63 -0
- package/dist/ui/components/CommandInput.d.ts.map +1 -0
- package/dist/ui/components/CommandInput.js +994 -0
- package/dist/ui/components/CommandInput.js.map +1 -0
- package/dist/ui/components/DiffView.d.ts +19 -0
- package/dist/ui/components/DiffView.d.ts.map +1 -0
- package/dist/ui/components/DiffView.js +93 -0
- package/dist/ui/components/DiffView.js.map +1 -0
- package/dist/ui/components/Dock.d.ts +49 -0
- package/dist/ui/components/Dock.d.ts.map +1 -0
- package/dist/ui/components/Dock.js +52 -0
- package/dist/ui/components/Dock.js.map +1 -0
- package/dist/ui/components/EventLog.d.ts +42 -0
- package/dist/ui/components/EventLog.d.ts.map +1 -0
- package/dist/ui/components/EventLog.js +450 -0
- package/dist/ui/components/EventLog.js.map +1 -0
- package/dist/ui/components/FileSuggest.d.ts +8 -0
- package/dist/ui/components/FileSuggest.d.ts.map +1 -0
- package/dist/ui/components/FileSuggest.js +19 -0
- package/dist/ui/components/FileSuggest.js.map +1 -0
- package/dist/ui/components/HRule.d.ts +27 -0
- package/dist/ui/components/HRule.d.ts.map +1 -0
- package/dist/ui/components/HRule.js +75 -0
- package/dist/ui/components/HRule.js.map +1 -0
- package/dist/ui/components/HintBar.d.ts +2 -0
- package/dist/ui/components/HintBar.d.ts.map +1 -0
- package/dist/ui/components/HintBar.js +19 -0
- package/dist/ui/components/HintBar.js.map +1 -0
- package/dist/ui/components/MarkdownText.d.ts +13 -0
- package/dist/ui/components/MarkdownText.d.ts.map +1 -0
- package/dist/ui/components/MarkdownText.js +255 -0
- package/dist/ui/components/MarkdownText.js.map +1 -0
- package/dist/ui/components/PermissionPrompt.d.ts +8 -0
- package/dist/ui/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/ui/components/PermissionPrompt.js +37 -0
- package/dist/ui/components/PermissionPrompt.js.map +1 -0
- package/dist/ui/components/SessionPicker.d.ts +16 -0
- package/dist/ui/components/SessionPicker.d.ts.map +1 -0
- package/dist/ui/components/SessionPicker.js +116 -0
- package/dist/ui/components/SessionPicker.js.map +1 -0
- package/dist/ui/components/SlashPalette.d.ts +8 -0
- package/dist/ui/components/SlashPalette.d.ts.map +1 -0
- package/dist/ui/components/SlashPalette.js +41 -0
- package/dist/ui/components/SlashPalette.js.map +1 -0
- package/dist/ui/components/Spinner.d.ts +37 -0
- package/dist/ui/components/Spinner.d.ts.map +1 -0
- package/dist/ui/components/Spinner.js +139 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +92 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +268 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/TabChip.d.ts +11 -0
- package/dist/ui/components/TabChip.d.ts.map +1 -0
- package/dist/ui/components/TabChip.js +23 -0
- package/dist/ui/components/TabChip.js.map +1 -0
- package/dist/ui/components/TeamIndicator.d.ts +6 -0
- package/dist/ui/components/TeamIndicator.d.ts.map +1 -0
- package/dist/ui/components/TeamIndicator.js +17 -0
- package/dist/ui/components/TeamIndicator.js.map +1 -0
- package/dist/ui/components/TeamStatusPanel.d.ts +14 -0
- package/dist/ui/components/TeamStatusPanel.d.ts.map +1 -0
- package/dist/ui/components/TeamStatusPanel.js +65 -0
- package/dist/ui/components/TeamStatusPanel.js.map +1 -0
- package/dist/ui/components/ThinkingBlock.d.ts +10 -0
- package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/ui/components/ThinkingBlock.js +21 -0
- package/dist/ui/components/ThinkingBlock.js.map +1 -0
- package/dist/ui/components/TodoIndicator.d.ts +11 -0
- package/dist/ui/components/TodoIndicator.d.ts.map +1 -0
- package/dist/ui/components/TodoIndicator.js +37 -0
- package/dist/ui/components/TodoIndicator.js.map +1 -0
- package/dist/ui/components/ToolCallCard.d.ts +16 -0
- package/dist/ui/components/ToolCallCard.d.ts.map +1 -0
- package/dist/ui/components/ToolCallCard.js +195 -0
- package/dist/ui/components/ToolCallCard.js.map +1 -0
- package/dist/ui/components/Welcome.d.ts +8 -0
- package/dist/ui/components/Welcome.d.ts.map +1 -0
- package/dist/ui/components/Welcome.js +53 -0
- package/dist/ui/components/Welcome.js.map +1 -0
- package/dist/ui/cursorState.d.ts +29 -0
- package/dist/ui/cursorState.d.ts.map +1 -0
- package/dist/ui/cursorState.js +49 -0
- package/dist/ui/cursorState.js.map +1 -0
- package/dist/ui/diff.d.ts +34 -0
- package/dist/ui/diff.d.ts.map +1 -0
- package/dist/ui/diff.js +184 -0
- package/dist/ui/diff.js.map +1 -0
- package/dist/ui/diffLang.d.ts +2 -0
- package/dist/ui/diffLang.d.ts.map +1 -0
- package/dist/ui/diffLang.js +36 -0
- package/dist/ui/diffLang.js.map +1 -0
- package/dist/ui/emoji.d.ts +4 -0
- package/dist/ui/emoji.d.ts.map +1 -0
- package/dist/ui/emoji.js +73 -0
- package/dist/ui/emoji.js.map +1 -0
- package/dist/ui/fileMentions.d.ts +41 -0
- package/dist/ui/fileMentions.d.ts.map +1 -0
- package/dist/ui/fileMentions.js +135 -0
- package/dist/ui/fileMentions.js.map +1 -0
- package/dist/ui/hooks/useLineEditor.d.ts +44 -0
- package/dist/ui/hooks/useLineEditor.d.ts.map +1 -0
- package/dist/ui/hooks/useLineEditor.js +142 -0
- package/dist/ui/hooks/useLineEditor.js.map +1 -0
- package/dist/ui/inputHistory.d.ts +8 -0
- package/dist/ui/inputHistory.d.ts.map +1 -0
- package/dist/ui/inputHistory.js +56 -0
- package/dist/ui/inputHistory.js.map +1 -0
- package/dist/ui/jsonrpc.d.ts +17 -0
- package/dist/ui/jsonrpc.d.ts.map +1 -0
- package/dist/ui/jsonrpc.js +41 -0
- package/dist/ui/jsonrpc.js.map +1 -0
- package/dist/ui/launcher.d.ts +20 -0
- package/dist/ui/launcher.d.ts.map +1 -0
- package/dist/ui/launcher.js +185 -0
- package/dist/ui/launcher.js.map +1 -0
- package/dist/ui/markdown.d.ts +104 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +449 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/mouse.d.ts +22 -0
- package/dist/ui/mouse.d.ts.map +1 -0
- package/dist/ui/mouse.js +31 -0
- package/dist/ui/mouse.js.map +1 -0
- package/dist/ui/outbound.d.ts +20 -0
- package/dist/ui/outbound.d.ts.map +1 -0
- package/dist/ui/outbound.js +49 -0
- package/dist/ui/outbound.js.map +1 -0
- package/dist/ui/screenMode.d.ts +25 -0
- package/dist/ui/screenMode.d.ts.map +1 -0
- package/dist/ui/screenMode.js +43 -0
- package/dist/ui/screenMode.js.map +1 -0
- package/dist/ui/slashCatalog.d.ts +18 -0
- package/dist/ui/slashCatalog.d.ts.map +1 -0
- package/dist/ui/slashCatalog.js +243 -0
- package/dist/ui/slashCatalog.js.map +1 -0
- package/dist/ui/syntax.d.ts +11 -0
- package/dist/ui/syntax.d.ts.map +1 -0
- package/dist/ui/syntax.js +78 -0
- package/dist/ui/syntax.js.map +1 -0
- package/dist/ui/theme.d.ts +165 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +394 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/types.d.ts +203 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +53 -0
- package/dist/ui/types.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Phase 205 (F2.4): the buffer/cursor/undo/paste state machine for
|
|
2
|
+
// CommandInput, lifted out of the 911-LOC component into one hook.
|
|
3
|
+
//
|
|
4
|
+
// CommandInput.tsx still owns history navigation, slash palette, file
|
|
5
|
+
// mention popup, reverse-search, and rendering — those are tied to IO
|
|
6
|
+
// (~/.omg history file, cwd scan) and to UI decisions (popup gating,
|
|
7
|
+
// chip placement). The editor *core* is just the text buffer and the
|
|
8
|
+
// concerns that mutate it: insert, delete-range, undo/redo, and the
|
|
9
|
+
// paste-chip store (Phase 135).
|
|
10
|
+
//
|
|
11
|
+
// The hook exposes a single object so the consumer can capture it in
|
|
12
|
+
// one variable; method names mirror the prior in-component helpers
|
|
13
|
+
// (setBuffer ↔ setBufAndCursor, insert ↔ insertAt, etc.) to keep the
|
|
14
|
+
// integration diff localized.
|
|
15
|
+
import { useRef, useState } from "react";
|
|
16
|
+
const UNDO_LIMIT = 100;
|
|
17
|
+
export function useLineEditor() {
|
|
18
|
+
const [buffer, setBufferState] = useState("");
|
|
19
|
+
const [cursor, setCursorState] = useState(0);
|
|
20
|
+
const undoRef = useRef([]);
|
|
21
|
+
const redoRef = useRef([]);
|
|
22
|
+
const typingRunRef = useRef(false);
|
|
23
|
+
const pasteStore = useRef(new Map());
|
|
24
|
+
const pasteSeq = useRef(0);
|
|
25
|
+
// Phase 340: image-chip store, parallel to the paste store. Maps a
|
|
26
|
+
// `[image#N]` chip token → the absolute image path.
|
|
27
|
+
const imageStore = useRef(new Map());
|
|
28
|
+
const imageSeq = useRef(0);
|
|
29
|
+
const setBuffer = (next, c) => {
|
|
30
|
+
setBufferState(next);
|
|
31
|
+
setCursorState(Math.max(0, Math.min(next.length, c)));
|
|
32
|
+
};
|
|
33
|
+
const setCursor = (next) => {
|
|
34
|
+
setCursorState(Math.max(0, Math.min(buffer.length, next)));
|
|
35
|
+
};
|
|
36
|
+
const recordUndo = (boundary) => {
|
|
37
|
+
if (!boundary && typingRunRef.current)
|
|
38
|
+
return;
|
|
39
|
+
const stack = undoRef.current;
|
|
40
|
+
if (stack.length === 0 || stack[stack.length - 1] !== buffer) {
|
|
41
|
+
stack.push(buffer);
|
|
42
|
+
if (stack.length > UNDO_LIMIT)
|
|
43
|
+
stack.shift();
|
|
44
|
+
}
|
|
45
|
+
redoRef.current = [];
|
|
46
|
+
};
|
|
47
|
+
const insert = (text) => {
|
|
48
|
+
recordUndo(false);
|
|
49
|
+
typingRunRef.current = !/\s/.test(text);
|
|
50
|
+
const next = buffer.slice(0, cursor) + text + buffer.slice(cursor);
|
|
51
|
+
setBuffer(next, cursor + text.length);
|
|
52
|
+
return next;
|
|
53
|
+
};
|
|
54
|
+
const deleteRange = (from, to) => {
|
|
55
|
+
recordUndo(true);
|
|
56
|
+
typingRunRef.current = false;
|
|
57
|
+
const a = Math.max(0, Math.min(from, to));
|
|
58
|
+
const b = Math.min(buffer.length, Math.max(from, to));
|
|
59
|
+
const next = buffer.slice(0, a) + buffer.slice(b);
|
|
60
|
+
setBuffer(next, a);
|
|
61
|
+
};
|
|
62
|
+
const undo = () => {
|
|
63
|
+
const stack = undoRef.current;
|
|
64
|
+
if (stack.length === 0)
|
|
65
|
+
return null;
|
|
66
|
+
redoRef.current.push(buffer);
|
|
67
|
+
const prev = stack.pop();
|
|
68
|
+
setBuffer(prev, prev.length);
|
|
69
|
+
typingRunRef.current = false;
|
|
70
|
+
return prev;
|
|
71
|
+
};
|
|
72
|
+
const redo = () => {
|
|
73
|
+
const r = redoRef.current;
|
|
74
|
+
if (r.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
undoRef.current.push(buffer);
|
|
77
|
+
const next = r.pop();
|
|
78
|
+
setBuffer(next, next.length);
|
|
79
|
+
typingRunRef.current = false;
|
|
80
|
+
return next;
|
|
81
|
+
};
|
|
82
|
+
const reset = () => {
|
|
83
|
+
setBufferState("");
|
|
84
|
+
setCursorState(0);
|
|
85
|
+
undoRef.current = [];
|
|
86
|
+
redoRef.current = [];
|
|
87
|
+
typingRunRef.current = false;
|
|
88
|
+
pasteStore.current.clear();
|
|
89
|
+
pasteSeq.current = 0;
|
|
90
|
+
imageStore.current.clear();
|
|
91
|
+
imageSeq.current = 0;
|
|
92
|
+
};
|
|
93
|
+
const storePaste = (text, lineCount) => {
|
|
94
|
+
pasteSeq.current += 1;
|
|
95
|
+
const token = `[paste#${pasteSeq.current}: ${lineCount} line${lineCount === 1 ? "" : "s"}]`;
|
|
96
|
+
pasteStore.current.set(token, text);
|
|
97
|
+
return token;
|
|
98
|
+
};
|
|
99
|
+
const expandPastes = (s) => {
|
|
100
|
+
let out = s;
|
|
101
|
+
for (const [token, text] of pasteStore.current) {
|
|
102
|
+
if (out.includes(token))
|
|
103
|
+
out = out.split(token).join(text);
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
};
|
|
107
|
+
const storeImage = (absPath) => {
|
|
108
|
+
imageSeq.current += 1;
|
|
109
|
+
const token = `[image#${imageSeq.current}]`;
|
|
110
|
+
imageStore.current.set(token, absPath);
|
|
111
|
+
return token;
|
|
112
|
+
};
|
|
113
|
+
const expandImages = (s) => {
|
|
114
|
+
let text = s;
|
|
115
|
+
const images = [];
|
|
116
|
+
for (const [token, path] of imageStore.current) {
|
|
117
|
+
if (text.includes(token)) {
|
|
118
|
+
images.push(path);
|
|
119
|
+
// Drop the chip token from the text the model receives — the image
|
|
120
|
+
// travels out-of-band (codex -i / claude Read reference).
|
|
121
|
+
text = text.split(token).join("");
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return { text: text.replace(/[ \t]{2,}/g, " ").trim(), images };
|
|
125
|
+
};
|
|
126
|
+
return {
|
|
127
|
+
buffer,
|
|
128
|
+
cursor,
|
|
129
|
+
setBuffer,
|
|
130
|
+
setCursor,
|
|
131
|
+
insert,
|
|
132
|
+
deleteRange,
|
|
133
|
+
undo,
|
|
134
|
+
redo,
|
|
135
|
+
reset,
|
|
136
|
+
storePaste,
|
|
137
|
+
expandPastes,
|
|
138
|
+
storeImage,
|
|
139
|
+
expandImages,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=useLineEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLineEditor.js","sourceRoot":"","sources":["../../../src/ui/hooks/useLineEditor.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,mEAAmE;AACnE,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,qEAAqE;AACrE,qEAAqE;AACrE,oEAAoE;AACpE,gCAAgC;AAChC,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,qEAAqE;AACrE,8BAA8B;AAE9B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,UAAU,GAAG,GAAG,CAAC;AA0CvB,MAAM,UAAU,aAAa;IAC3B,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC9C,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAW,EAAE,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAW,EAAE,CAAC,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,CAAsB,IAAI,GAAG,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3B,mEAAmE;IACnE,oDAAoD;IACpD,MAAM,UAAU,GAAG,MAAM,CAAsB,IAAI,GAAG,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAE3B,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,CAAS,EAAQ,EAAE;QAClD,cAAc,CA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|
1
|
+
export declare function historyFile(home?: string): string;
|
|
2
|
+
/** Load saved history (oldest → newest), trimmed to MAX_ENTRIES.
|
|
3
|
+
* Never throws. */
|
|
4
|
+
export declare function loadInputHistory(home?: string): string[];
|
|
5
|
+
/** Append one entry. Multi-line inputs are stored with escaped
|
|
6
|
+
* newlines so the file stays one-entry-per-line. Best-effort. */
|
|
7
|
+
export declare function appendInputHistory(entry: string, home?: string): void;
|
|
8
|
+
//# sourceMappingURL=inputHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputHistory.d.ts","sourceRoot":"","sources":["../../src/ui/inputHistory.ts"],"names":[],"mappings":"AAkBA,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAuB,GAAG,MAAM,CAEjE;AAOD;oBACoB;AACpB,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAuB,GAAG,MAAM,EAAE,CAYxE;AAED;kEACkE;AAClE,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,MAAuB,GAC5B,IAAI,CAUN"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Phase 114: persistent command-input history.
|
|
2
|
+
//
|
|
3
|
+
// CommandInput's ↑/↓ recall and the Phase-113 ghost-text suggestion
|
|
4
|
+
// both read from an in-memory ring. Persisting it to ~/.omg/input-
|
|
5
|
+
// history.txt means ghost suggestions and history recall span
|
|
6
|
+
// sessions — type "빌드" and the prompt you sent yesterday is offered
|
|
7
|
+
// again, the way claude-code reads ~/.claude/history.jsonl.
|
|
8
|
+
//
|
|
9
|
+
// Plain newline-delimited text, newest last, capped. Best-effort:
|
|
10
|
+
// read/write failures degrade to an empty / non-persisted ring.
|
|
11
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
12
|
+
import { homedir } from "node:os";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
const MAX_ENTRIES = 500;
|
|
15
|
+
const DEFAULT_HOME = () => process.env.HOME ?? homedir();
|
|
16
|
+
export function historyFile(home = DEFAULT_HOME()) {
|
|
17
|
+
return join(home, ".omg", "input-history.txt");
|
|
18
|
+
}
|
|
19
|
+
function ensureDir(file) {
|
|
20
|
+
const dir = file.slice(0, file.lastIndexOf("/"));
|
|
21
|
+
if (!existsSync(dir))
|
|
22
|
+
mkdirSync(dir, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
/** Load saved history (oldest → newest), trimmed to MAX_ENTRIES.
|
|
25
|
+
* Never throws. */
|
|
26
|
+
export function loadInputHistory(home = DEFAULT_HOME()) {
|
|
27
|
+
const file = historyFile(home);
|
|
28
|
+
if (!existsSync(file))
|
|
29
|
+
return [];
|
|
30
|
+
try {
|
|
31
|
+
const lines = readFileSync(file, "utf-8")
|
|
32
|
+
.split("\n")
|
|
33
|
+
.map((l) => l.replace(/\\n/g, "\n")) // restore escaped newlines
|
|
34
|
+
.filter((l) => l.length > 0);
|
|
35
|
+
return lines.slice(-MAX_ENTRIES);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Append one entry. Multi-line inputs are stored with escaped
|
|
42
|
+
* newlines so the file stays one-entry-per-line. Best-effort. */
|
|
43
|
+
export function appendInputHistory(entry, home = DEFAULT_HOME()) {
|
|
44
|
+
const trimmed = entry.trim();
|
|
45
|
+
if (!trimmed)
|
|
46
|
+
return;
|
|
47
|
+
const file = historyFile(home);
|
|
48
|
+
try {
|
|
49
|
+
ensureDir(file);
|
|
50
|
+
appendFileSync(file, trimmed.replace(/\n/g, "\\n") + "\n", "utf-8");
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
/* persistence is best-effort */
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=inputHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputHistory.js","sourceRoot":"","sources":["../../src/ui/inputHistory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AC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,2BAA2B;aAC/D,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;kEACkE;AAClE,MAAM,UAAU,kBAAkB,CAChC,KAAa,EACb,OAAe,YAAY,EAAE;IAE7B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAAC,MAAM,CAAC;QACP,gCAAgC;IAClC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { InboundMessage } from "./types.js";
|
|
2
|
+
export interface JsonRpcReader {
|
|
3
|
+
onMessage(handler: (msg: InboundMessage) => void): void;
|
|
4
|
+
onClose(handler: () => void): void;
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
export declare class InMemoryReader implements JsonRpcReader {
|
|
8
|
+
private queue;
|
|
9
|
+
private messageHandlers;
|
|
10
|
+
private closeHandlers;
|
|
11
|
+
private closed;
|
|
12
|
+
push(msg: InboundMessage): void;
|
|
13
|
+
close(): void;
|
|
14
|
+
onMessage(handler: (msg: InboundMessage) => void): void;
|
|
15
|
+
onClose(handler: () => void): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=jsonrpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"","sources":["../../src/ui/jsonrpc.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI,CAAC;IACxD,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACnC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,qBAAa,cAAe,YAAW,aAAa;IAClD,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,eAAe,CAA4C;IACnE,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,MAAM,CAAS;IAEvB,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAS/B,KAAK,IAAI,IAAI;IAMb,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAOvD,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;CAOnC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// In-process JSON-RPC reader. The Python era used fd-based stdin
|
|
2
|
+
// readers + a subprocess split; B+1 removes that and runs Ink in the
|
|
3
|
+
// same process as the orchestrator. Messages are pushed directly into
|
|
4
|
+
// the reader from the dispatcher writer.
|
|
5
|
+
export class InMemoryReader {
|
|
6
|
+
queue = [];
|
|
7
|
+
messageHandlers = [];
|
|
8
|
+
closeHandlers = [];
|
|
9
|
+
closed = false;
|
|
10
|
+
push(msg) {
|
|
11
|
+
if (this.closed)
|
|
12
|
+
return;
|
|
13
|
+
if (this.messageHandlers.length === 0) {
|
|
14
|
+
this.queue.push(msg);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
for (const h of this.messageHandlers)
|
|
18
|
+
h(msg);
|
|
19
|
+
}
|
|
20
|
+
close() {
|
|
21
|
+
if (this.closed)
|
|
22
|
+
return;
|
|
23
|
+
this.closed = true;
|
|
24
|
+
for (const h of this.closeHandlers)
|
|
25
|
+
h();
|
|
26
|
+
}
|
|
27
|
+
onMessage(handler) {
|
|
28
|
+
this.messageHandlers.push(handler);
|
|
29
|
+
while (this.queue.length > 0) {
|
|
30
|
+
handler(this.queue.shift());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
onClose(handler) {
|
|
34
|
+
if (this.closed) {
|
|
35
|
+
handler();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.closeHandlers.push(handler);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=jsonrpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.js","sourceRoot":"","sources":["../../src/ui/jsonrpc.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,qEAAqE;AACrE,sEAAsE;AACtE,yCAAyC;AAUzC,MAAM,OAAO,cAAc;IACjB,KAAK,GAAqB,EAAE,CAAC;IAC7B,eAAe,GAAyC,EAAE,CAAC;IAC3D,aAAa,GAAsB,EAAE,CAAC;IACtC,MAAM,GAAG,KAAK,CAAC;IAEvB,IAAI,CAAC,GAAmB;QACtB,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,eAAe;YAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,aAAa;YAAE,CAAC,EAAE,CAAC;IAC1C,CAAC;IAED,SAAS,CAAC,OAAsC;QAC9C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAmB;QACzB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type OutboundMessage } from "./outbound.js";
|
|
2
|
+
import type { InboundMessage } from "./types.js";
|
|
3
|
+
export declare const BSU = "\u001B[?2026h";
|
|
4
|
+
export declare const ESU = "\u001B[?2026l";
|
|
5
|
+
export declare const ENTER_ALT = "\u001B[?1049h";
|
|
6
|
+
export declare const EXIT_ALT = "\u001B[?1049l";
|
|
7
|
+
export declare const ENABLE_ALT_SCROLL = "\u001B[?1007h";
|
|
8
|
+
export declare const DISABLE_ALT_SCROLL = "\u001B[?1007l";
|
|
9
|
+
export declare const ENABLE_MOUSE = "\u001B[?1000h\u001B[?1006h";
|
|
10
|
+
export declare const DISABLE_MOUSE = "\u001B[?1006l\u001B[?1000l";
|
|
11
|
+
export declare function withSyncOutput(base: NodeJS.WriteStream): NodeJS.WriteStream;
|
|
12
|
+
export interface InkSession {
|
|
13
|
+
push(msg: InboundMessage): void;
|
|
14
|
+
onOutbound(handler: (msg: OutboundMessage) => void): void;
|
|
15
|
+
close(): void;
|
|
16
|
+
waitUntilExit(): Promise<void>;
|
|
17
|
+
unmount(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function launchInk(): InkSession;
|
|
20
|
+
//# sourceMappingURL=launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/ui/launcher.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAWjD,eAAO,MAAM,GAAG,kBAAa,CAAC;AAC9B,eAAO,MAAM,GAAG,kBAAa,CAAC;AA4B9B,eAAO,MAAM,SAAS,kBAAgB,CAAC;AACvC,eAAO,MAAM,QAAQ,kBAAgB,CAAC;AAOtC,eAAO,MAAM,iBAAiB,kBAAgB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,kBAAgB,CAAC;AAChD,eAAO,MAAM,YAAY,+BAA2B,CAAC;AACrD,eAAO,MAAM,aAAa,+BAA2B,CAAC;AAMtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAe3E;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,GAAG,IAAI,CAAC;IAC1D,KAAK,IAAI,IAAI,CAAC;IACd,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAI/B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,SAAS,IAAI,UAAU,CA4GtC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// In-process Ink launcher (B+1).
|
|
3
|
+
//
|
|
4
|
+
// One process: orchestrator + dispatcher + Ink. No subprocess, no fd
|
|
5
|
+
// splitting, no stderr parsing. The reader is an in-memory queue the
|
|
6
|
+
// dispatcher writer pushes into; outbound user events flow through the
|
|
7
|
+
// outbound EventEmitter the launcher subscribes to.
|
|
8
|
+
import { render } from "ink";
|
|
9
|
+
import { App } from "./components/App.js";
|
|
10
|
+
import { InMemoryReader } from "./jsonrpc.js";
|
|
11
|
+
import { configureOutbound } from "./outbound.js";
|
|
12
|
+
import { wantsAltScreen } from "./screenMode.js";
|
|
13
|
+
// Phase 158: synchronized-output stdout wrapper (Claude Code's anti-flicker
|
|
14
|
+
// approach). Ink writes each frame as a single stdout.write; when the
|
|
15
|
+
// dynamic region's height reaches the terminal's, Ink does a full
|
|
16
|
+
// `clearTerminal + <all static> + <output>` write (ink.js) which flashes
|
|
17
|
+
// old scrollback in terminals without double-buffering. Wrapping each
|
|
18
|
+
// write in Begin/End Synchronized Update (DEC mode 2026) makes the
|
|
19
|
+
// terminal apply the whole frame atomically — no intermediate flash.
|
|
20
|
+
// Terminals that don't support 2026 ignore the private-mode escapes, so
|
|
21
|
+
// it's safe; OMG_NO_SYNC_OUTPUT opts out.
|
|
22
|
+
export const BSU = "[?2026h";
|
|
23
|
+
export const ESU = "[?2026l";
|
|
24
|
+
// Phase 262 → 268: tried multiple homegrown approaches for parking
|
|
25
|
+
// the hardware cursor on the input row so macOS IME compose lands
|
|
26
|
+
// inside the input box — DEC private ESC 7/8 embed (262), CSI
|
|
27
|
+
// ESC [ s/u embed (265), layout reorder (266), module-state +
|
|
28
|
+
// relative cursor move appended by this proxy (267). Each failed
|
|
29
|
+
// for a different reason — embedded escapes lost in Ink's text
|
|
30
|
+
// pipeline, fragile row math, trailing '\n' bookkeeping. The
|
|
31
|
+
// proper fix arrived with the Ink 5 → 6 upgrade (Phase 268): Ink
|
|
32
|
+
// 6.7+ ships a `useCursor` hook that drives an integrated
|
|
33
|
+
// `buildCursorSuffix` in the renderer's commit phase (see
|
|
34
|
+
// node_modules/ink/build/cursor-helpers.js). The renderer accounts
|
|
35
|
+
// for the trailing '\n' AND the per-frame `cliCursor.hide()`
|
|
36
|
+
// correctly. CommandInput.tsx calls `setCursorPosition({x, y})`
|
|
37
|
+
// during render with Y derived from the wrapper's ancestor-summed
|
|
38
|
+
// Yoga origin and X derived from `stringWidth(...)` so CJK wide chars
|
|
39
|
+
// (한글, 漢字) count 2 cols each. The withSync Output wrapper here
|
|
40
|
+
// just keeps the BSU/ESU sync-update brackets — no per-frame cursor
|
|
41
|
+
// escapes anymore.
|
|
42
|
+
// Phase 263 → 274: alt-screen is an explicit opt-in, not the default.
|
|
43
|
+
// OMG is a transcript TUI, so normal-screen mode is the default:
|
|
44
|
+
// settled rows go to native terminal scrollback via <Static> and only
|
|
45
|
+
// the live tail repaints (see screenMode.ts for the full rationale and
|
|
46
|
+
// the two now-fixed bugs that had pushed toward alt-screen). The
|
|
47
|
+
// Codex-style full-frame alternate buffer is still available for users
|
|
48
|
+
// who prefer it via `omg --alt-screen` or `OMG_ALT_SCREEN=1`; these
|
|
49
|
+
// escapes only fire when `wantsAltScreen()` returns true.
|
|
50
|
+
export const ENTER_ALT = "\x1B[?1049h";
|
|
51
|
+
export const EXIT_ALT = "\x1B[?1049l";
|
|
52
|
+
// Codex/crossterm parity:
|
|
53
|
+
// - 1007 ("alternate scroll") lets terminals translate wheel input
|
|
54
|
+
// into application navigation in the alternate buffer.
|
|
55
|
+
// - 1000 + 1006 enables xterm SGR mouse packets, which OMG handles
|
|
56
|
+
// directly so wheel scrolling moves the transcript viewport instead
|
|
57
|
+
// of being inserted into the composer.
|
|
58
|
+
export const ENABLE_ALT_SCROLL = "\x1B[?1007h";
|
|
59
|
+
export const DISABLE_ALT_SCROLL = "\x1B[?1007l";
|
|
60
|
+
export const ENABLE_MOUSE = "\x1B[?1000h\x1B[?1006h";
|
|
61
|
+
export const DISABLE_MOUSE = "\x1B[?1006l\x1B[?1000l";
|
|
62
|
+
function shouldEnableEnhancedKeyboard() {
|
|
63
|
+
return process.env.OMG_NO_ENHANCED_KEYS !== "1";
|
|
64
|
+
}
|
|
65
|
+
export function withSyncOutput(base) {
|
|
66
|
+
if (!base.isTTY || process.env.OMG_NO_SYNC_OUTPUT)
|
|
67
|
+
return base;
|
|
68
|
+
return new Proxy(base, {
|
|
69
|
+
get(target, prop, receiver) {
|
|
70
|
+
if (prop === "write") {
|
|
71
|
+
return (chunk, ...rest) => {
|
|
72
|
+
const w = target.write.bind(target);
|
|
73
|
+
if (typeof chunk !== "string")
|
|
74
|
+
return w(chunk, ...rest);
|
|
75
|
+
return w(BSU + chunk + ESU, ...rest);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const v = Reflect.get(target, prop, receiver);
|
|
79
|
+
return typeof v === "function" ? v.bind(target) : v;
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export function launchInk() {
|
|
84
|
+
const reader = new InMemoryReader();
|
|
85
|
+
let outboundHandler = null;
|
|
86
|
+
configureOutbound((msg) => {
|
|
87
|
+
if (outboundHandler)
|
|
88
|
+
outboundHandler(msg);
|
|
89
|
+
});
|
|
90
|
+
// Phase 261: tell Node's stdin to assemble UTF-8 across chunk
|
|
91
|
+
// boundaries. Without this, raw-mode `data` events emit Buffer
|
|
92
|
+
// objects and Ink's parseKeypress runs `String(buf)` per chunk —
|
|
93
|
+
// which means a 3-byte Hangul scalar (e.g. 한 = ED 95 9C) split
|
|
94
|
+
// across two reads becomes two U+FFFD replacement chars instead of
|
|
95
|
+
// one character, and the buffer "loses" the keystroke until the
|
|
96
|
+
// next chunk arrives. Symptom: Korean (and any CJK) characters
|
|
97
|
+
// appear one keystroke late in CommandInput, matching the long-
|
|
98
|
+
// running ink + claude-code Hangul IME bug. Setting the encoding
|
|
99
|
+
// attaches a StringDecoder inside Node's stream layer so `data`
|
|
100
|
+
// events emit strings with only complete UTF-8 scalars.
|
|
101
|
+
//
|
|
102
|
+
// Gated on isTTY so headless/test stdin (which isn't going through
|
|
103
|
+
// raw-mode input anyway) is left alone — and because setEncoding
|
|
104
|
+
// is process-global, we only flip it when an interactive UI is the
|
|
105
|
+
// consumer.
|
|
106
|
+
if (process.stdin.isTTY) {
|
|
107
|
+
process.stdin.setEncoding("utf8");
|
|
108
|
+
}
|
|
109
|
+
// Phase 263: enter alt-screen *before* Ink mounts so the first
|
|
110
|
+
// frame paints into the alternate buffer. Idempotent guard
|
|
111
|
+
// (`alt` flag) so the matching EXIT_ALT runs at most once even if
|
|
112
|
+
// multiple exit paths fire — without it a double-EXIT_ALT would
|
|
113
|
+
// pop the main screen back twice and leave the user staring at
|
|
114
|
+
// whatever was beneath omg's terminal pane. Cleanup is wired to:
|
|
115
|
+
// - Ink's own waitUntilExit (covers `/quit`, Ctrl-C through
|
|
116
|
+
// Ink's handler),
|
|
117
|
+
// - SIGINT/SIGTERM (covers the rare path where Ink hasn't yet
|
|
118
|
+
// attached its handler — e.g. a crash during render setup),
|
|
119
|
+
// - process "exit" (final fallback so a thrown error still
|
|
120
|
+
// restores the main buffer before the process dies).
|
|
121
|
+
const altScreenOn = wantsAltScreen() && process.stdout.isTTY;
|
|
122
|
+
let alt = false;
|
|
123
|
+
const enterAlt = () => {
|
|
124
|
+
if (altScreenOn && !alt) {
|
|
125
|
+
process.stdout.write(ENTER_ALT + ENABLE_ALT_SCROLL + ENABLE_MOUSE);
|
|
126
|
+
alt = true;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const exitAlt = () => {
|
|
130
|
+
if (alt) {
|
|
131
|
+
process.stdout.write(DISABLE_MOUSE + DISABLE_ALT_SCROLL + EXIT_ALT);
|
|
132
|
+
alt = false;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
enterAlt();
|
|
136
|
+
if (altScreenOn) {
|
|
137
|
+
const onSignal = (signal) => {
|
|
138
|
+
exitAlt();
|
|
139
|
+
// Re-raise with the default disposition so the parent sees a
|
|
140
|
+
// proper signal exit code rather than `process.exit(0)`.
|
|
141
|
+
process.kill(process.pid, signal);
|
|
142
|
+
};
|
|
143
|
+
process.once("SIGINT", onSignal);
|
|
144
|
+
process.once("SIGTERM", onSignal);
|
|
145
|
+
process.once("exit", exitAlt);
|
|
146
|
+
}
|
|
147
|
+
const { unmount, waitUntilExit } = render(_jsx(App, { reader: reader, onClose: () => setImmediate(() => unmount()) }), {
|
|
148
|
+
stdout: withSyncOutput(process.stdout),
|
|
149
|
+
kittyKeyboard: shouldEnableEnhancedKeyboard()
|
|
150
|
+
? {
|
|
151
|
+
mode: process.env.OMG_ENHANCED_KEYS_MODE === "auto"
|
|
152
|
+
? "auto"
|
|
153
|
+
: "enabled",
|
|
154
|
+
flags: [
|
|
155
|
+
"disambiguateEscapeCodes",
|
|
156
|
+
"reportEventTypes",
|
|
157
|
+
"reportAlternateKeys",
|
|
158
|
+
],
|
|
159
|
+
}
|
|
160
|
+
: undefined,
|
|
161
|
+
});
|
|
162
|
+
// Normal exit path: Ink unmounted cleanly, swap the main screen
|
|
163
|
+
// back. The `.catch` mirror handles render errors so a thrown
|
|
164
|
+
// exception still restores the buffer before bubbling.
|
|
165
|
+
void waitUntilExit().then(exitAlt, exitAlt);
|
|
166
|
+
return {
|
|
167
|
+
push: (msg) => reader.push(msg),
|
|
168
|
+
onOutbound: (handler) => {
|
|
169
|
+
outboundHandler = handler;
|
|
170
|
+
},
|
|
171
|
+
close: () => {
|
|
172
|
+
reader.close();
|
|
173
|
+
},
|
|
174
|
+
waitUntilExit: () => waitUntilExit().then(() => undefined),
|
|
175
|
+
unmount: () => {
|
|
176
|
+
// exitAlt also fires via the waitUntilExit().then(exitAlt) above
|
|
177
|
+
// once the tree tears down; calling it here too is idempotent
|
|
178
|
+
// (the `alt` guard) and guarantees the main buffer is back before
|
|
179
|
+
// the child process writes to the terminal.
|
|
180
|
+
exitAlt();
|
|
181
|
+
unmount();
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/ui/launcher.tsx"],"names":[],"mappings":";AAAA,iCAAiC;AACjC,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AAC,KAAK,EAAE,CAAC;QACjB,CAAC;QACD,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;QAC1D,OAAO,EAAE,GAAG,EAAE;YACZ,iEAAiE;YACjE,8DAA8D;YAC9D,kEAAkE;YAClE,4CAA4C;YAC5C,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export type InlineSegment = {
|
|
2
|
+
kind: "text";
|
|
3
|
+
text: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "bold";
|
|
6
|
+
text: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "italic";
|
|
9
|
+
text: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "strike";
|
|
12
|
+
text: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "code";
|
|
15
|
+
text: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "link";
|
|
18
|
+
text: string;
|
|
19
|
+
url: string;
|
|
20
|
+
};
|
|
21
|
+
export type Align = "left" | "center" | "right";
|
|
22
|
+
export type AlertVariant = "NOTE" | "TIP" | "IMPORTANT" | "WARNING" | "CAUTION";
|
|
23
|
+
export interface ListItem {
|
|
24
|
+
segments: InlineSegment[];
|
|
25
|
+
checked?: boolean;
|
|
26
|
+
depth: number;
|
|
27
|
+
ordered: boolean;
|
|
28
|
+
/** For ordered items, the literal number as written (e.g. "2"). */
|
|
29
|
+
marker?: string;
|
|
30
|
+
}
|
|
31
|
+
export type Block = {
|
|
32
|
+
kind: "para";
|
|
33
|
+
segments: InlineSegment[];
|
|
34
|
+
} | {
|
|
35
|
+
kind: "fence";
|
|
36
|
+
lang: string;
|
|
37
|
+
body: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "heading";
|
|
40
|
+
level: 1 | 2 | 3;
|
|
41
|
+
segments: InlineSegment[];
|
|
42
|
+
} | {
|
|
43
|
+
kind: "list";
|
|
44
|
+
ordered: boolean;
|
|
45
|
+
items: ListItem[];
|
|
46
|
+
} | {
|
|
47
|
+
kind: "quote";
|
|
48
|
+
lines: InlineSegment[][];
|
|
49
|
+
} | {
|
|
50
|
+
kind: "alert";
|
|
51
|
+
variant: AlertVariant;
|
|
52
|
+
lines: InlineSegment[][];
|
|
53
|
+
} | {
|
|
54
|
+
kind: "table";
|
|
55
|
+
header: InlineSegment[][];
|
|
56
|
+
align: Align[];
|
|
57
|
+
rows: InlineSegment[][][];
|
|
58
|
+
} | {
|
|
59
|
+
kind: "rule";
|
|
60
|
+
};
|
|
61
|
+
/** Top-level parse: split on fenced blocks first; everything in
|
|
62
|
+
* between is treated as line-based blocks (headings / lists /
|
|
63
|
+
* quotes / rules / paragraphs). */
|
|
64
|
+
export declare function parseBlocks(input: string): Block[];
|
|
65
|
+
/** Phase 208 (F5.3): incremental streaming-aware parser state.
|
|
66
|
+
*
|
|
67
|
+
* During an in-flight assistant turn, EventLog appends each text chunk
|
|
68
|
+
* into a single growing `textBuf` and renders it through MarkdownText
|
|
69
|
+
* on every chunk. The naive path is `parseBlocks(text)` every render,
|
|
70
|
+
* which is O(n) per chunk → O(n²) over the stream. With long fenced
|
|
71
|
+
* code blocks the regex scan dominates render time.
|
|
72
|
+
*
|
|
73
|
+
* The incremental state tracks a "settled boundary" — the largest
|
|
74
|
+
* index in `fullText` where text[0..settledIdx] is a self-contained
|
|
75
|
+
* prefix (no open fence at that point, blocks won't change as more
|
|
76
|
+
* text arrives). The fast path is: reuse the parsed blocks for the
|
|
77
|
+
* settled prefix, re-parse only the unsettled tail.
|
|
78
|
+
*/
|
|
79
|
+
export interface IncrementalParseState {
|
|
80
|
+
fullText: string;
|
|
81
|
+
blocks: Block[];
|
|
82
|
+
settledIdx: number;
|
|
83
|
+
settledBlocks: number;
|
|
84
|
+
}
|
|
85
|
+
export declare const EMPTY_INCREMENTAL_STATE: IncrementalParseState;
|
|
86
|
+
/** Walk `text` line-by-line; return the largest index where
|
|
87
|
+
* text[0..idx] ends in a paragraph break (`\n\n`) AND fence depth is
|
|
88
|
+
* even (no open fence at that point). Returns 0 when no such
|
|
89
|
+
* boundary exists. */
|
|
90
|
+
export declare function findSettledBoundary(text: string): number;
|
|
91
|
+
/** Incrementally parse `text` given a previous state. When `text`
|
|
92
|
+
* monotonically extends `prev.fullText`, reuses settled blocks and
|
|
93
|
+
* only re-parses the unsettled tail. Otherwise falls back to a full
|
|
94
|
+
* parse. The returned state's `.blocks` is always identical to
|
|
95
|
+
* `parseBlocks(text)` — only the per-call cost differs. */
|
|
96
|
+
export declare function parseBlocksIncremental(prev: IncrementalParseState, text: string): IncrementalParseState;
|
|
97
|
+
/** Phase 172: the body of the last fenced code block in some markdown,
|
|
98
|
+
* or undefined when there are no code fences. Used by `/copy` to grab
|
|
99
|
+
* the most recent code block from an assistant turn. */
|
|
100
|
+
export declare function lastFenceBody(markdown: string): string | undefined;
|
|
101
|
+
/** Inline parser. Greedy left-to-right; the first matching delimiter
|
|
102
|
+
* on the cursor wins. Unclosed delimiters degrade to plain text. */
|
|
103
|
+
export declare function parseInline(input: string): InlineSegment[];
|
|
104
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/ui/markdown.ts"],"names":[],"mappings":"AA0BA,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,M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