osagent 0.1.78 → 0.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.js +327 -528
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -322,6 +322,12 @@ packages/
322
322
 
323
323
  ## Recent Updates
324
324
 
325
+ ### v0.1.79 - IDE Terminal Compatibility
326
+ - Migrated all dialogs from custom `useKeypress` to Ink's `useInput` hook
327
+ - Fixes arrow key issues in VS Code, Cursor, and other IDE terminals
328
+ - Arrow keys no longer print escape sequences (`^[[A^[[B`) in dialogs
329
+ - Improved compatibility with IDE terminals that don't support raw mode
330
+
325
331
  ### v0.1.66 - Focus Management
326
332
  - New `useFocusedKeypress` hook for enforced focus management
327
333
  - Prevents keypress conflicts between dialogs and main UI
package/dist/cli.js CHANGED
@@ -146587,7 +146587,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
146587
146587
  };
146588
146588
  }
146589
146589
  async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
146590
- const version3 = "0.1.78";
146590
+ const version3 = "0.1.80";
146591
146591
  const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
146592
146592
  const baseHeaders = {
146593
146593
  "User-Agent": userAgent2
@@ -230896,120 +230896,7 @@ Follow conventional commits when appropriate.`,
230896
230896
  isBuiltin: true
230897
230897
  }
230898
230898
  ];
230899
- PROJECT_AGENTS = [
230900
- {
230901
- id: "businessos-frontend",
230902
- name: "businessos-frontend",
230903
- displayName: "BusinessOS Frontend",
230904
- description: "Specialist for BusinessOS Svelte frontend patterns and conventions",
230905
- systemPrompt: `You are the BusinessOS Frontend specialist. You understand:
230906
- 1. The BusinessOS Svelte/SvelteKit architecture
230907
- 2. Component patterns used in the project
230908
- 3. Store patterns for state management
230909
- 4. SSE streaming for real-time updates
230910
- 5. Form actions and data loading patterns
230911
-
230912
- Project conventions:
230913
- - Use $lib for imports
230914
- - Follow existing component patterns
230915
- - Use project-specific stores
230916
- - Handle SSE connections properly
230917
- - Follow the established theming system`,
230918
- capabilities: [
230919
- { name: "businessos-frontend", keywords: ["businessos", "frontend", "svelte"], confidence: 0.95 }
230920
- ],
230921
- priority: 90,
230922
- tier: "project",
230923
- model: "sonnet",
230924
- projectPatterns: ["**/BusinessOS-frontend/**", "**/businessos-frontend/**"],
230925
- enabled: true,
230926
- isBuiltin: true
230927
- },
230928
- {
230929
- id: "businessos-backend",
230930
- name: "businessos-backend",
230931
- displayName: "BusinessOS Backend",
230932
- description: "Specialist for BusinessOS Go backend patterns and conventions",
230933
- systemPrompt: `You are the BusinessOS Backend specialist. You understand:
230934
- 1. The BusinessOS Go service architecture
230935
- 2. Chi router patterns and middleware
230936
- 3. Agent service patterns
230937
- 4. Database access patterns with sqlx
230938
- 5. SSE streaming implementation
230939
-
230940
- Project conventions:
230941
- - Use context propagation
230942
- - Follow slog logging patterns
230943
- - Use proper error handling
230944
- - Follow the service layer pattern
230945
- - Use the established agent patterns`,
230946
- capabilities: [
230947
- { name: "businessos-backend", keywords: ["businessos", "backend", "go"], confidence: 0.95 }
230948
- ],
230949
- priority: 90,
230950
- tier: "project",
230951
- model: "sonnet",
230952
- projectPatterns: ["**/BusinessOS-backend/**", "**/businessos-backend/**"],
230953
- enabled: true,
230954
- isBuiltin: true
230955
- },
230956
- {
230957
- id: "miosa-specialist",
230958
- name: "miosa-specialist",
230959
- displayName: "MIOSA Specialist",
230960
- description: "Specialist for MIOSA platform architecture with E2B sandbox",
230961
- systemPrompt: `You are the MIOSA platform specialist. You understand:
230962
- 1. MIOSA multi-agent architecture
230963
- 2. E2B sandbox integration
230964
- 3. Agent orchestration patterns
230965
- 4. Consultation system design
230966
- 5. Terminal and UI patterns
230967
-
230968
- Project conventions:
230969
- - Follow the agent pattern established
230970
- - Use E2B for code execution
230971
- - Handle agent communication properly
230972
- - Follow the consultation flow
230973
- - Use the established UI patterns`,
230974
- capabilities: [
230975
- { name: "miosa", keywords: ["miosa", "e2b", "sandbox", "multi-agent"], confidence: 0.95 }
230976
- ],
230977
- priority: 90,
230978
- tier: "project",
230979
- model: "sonnet",
230980
- projectPatterns: ["**/miosa/**", "**/MIOSA/**"],
230981
- enabled: true,
230982
- isBuiltin: true
230983
- },
230984
- {
230985
- id: "osa-terminal",
230986
- name: "osa-terminal",
230987
- displayName: "OSA Terminal",
230988
- description: "Specialist for OSA Terminal React/Ink patterns",
230989
- systemPrompt: `You are the OSA Terminal specialist. You understand:
230990
- 1. React/Ink terminal UI patterns
230991
- 2. The OSA CLI architecture
230992
- 3. Context and provider patterns
230993
- 4. Hook patterns for terminal interaction
230994
- 5. Streaming and async patterns
230995
-
230996
- Project conventions:
230997
- - Follow existing component patterns
230998
- - Use the established context system
230999
- - Handle terminal input/output properly
231000
- - Follow the hook patterns established
231001
- - Use proper TypeScript types`,
231002
- capabilities: [
231003
- { name: "osa-terminal", keywords: ["osa", "terminal", "ink", "cli"], confidence: 0.95 }
231004
- ],
231005
- priority: 90,
231006
- tier: "project",
231007
- model: "sonnet",
231008
- projectPatterns: ["**/osagent/**", "**/osa-terminal/**"],
231009
- enabled: true,
231010
- isBuiltin: true
231011
- }
231012
- ];
230899
+ PROJECT_AGENTS = [];
231013
230900
  BUILTIN_AGENTS = [
231014
230901
  ...ORCHESTRATOR_AGENTS,
231015
230902
  ...FRONTEND_SPECIALISTS,
@@ -232256,71 +232143,7 @@ var init_context_manager = __esm({
232256
232143
  priority: 100
232257
232144
  }
232258
232145
  ];
232259
- PROJECT_RULES = {
232260
- "**/BusinessOS-frontend/**": [
232261
- {
232262
- id: "businessos-frontend",
232263
- level: "project",
232264
- type: "directory",
232265
- pattern: "**/BusinessOS-frontend/**",
232266
- agentIds: ["frontend-svelte", "businessos-frontend", "tailwind-expert"],
232267
- skillIds: ["test-driven-development", "code-review-checklist"],
232268
- contextData: {
232269
- framework: "svelte",
232270
- styling: "tailwind",
232271
- project: "BusinessOS"
232272
- },
232273
- priority: 90
232274
- }
232275
- ],
232276
- "**/BusinessOS-backend/**": [
232277
- {
232278
- id: "businessos-backend",
232279
- level: "project",
232280
- type: "directory",
232281
- pattern: "**/BusinessOS-backend/**",
232282
- agentIds: ["backend-go", "businessos-backend", "database-specialist"],
232283
- skillIds: ["test-driven-development", "systematic-debugging"],
232284
- contextData: {
232285
- language: "go",
232286
- router: "chi",
232287
- project: "BusinessOS"
232288
- },
232289
- priority: 90
232290
- }
232291
- ],
232292
- "**/osagent/**": [
232293
- {
232294
- id: "osagent",
232295
- level: "project",
232296
- type: "directory",
232297
- pattern: "**/osagent/**",
232298
- agentIds: ["osa-terminal", "frontend-react", "typescript-expert"],
232299
- skillIds: ["test-driven-development"],
232300
- contextData: {
232301
- framework: "react-ink",
232302
- project: "OSAgent"
232303
- },
232304
- priority: 90
232305
- }
232306
- ],
232307
- "**/miosa/**": [
232308
- {
232309
- id: "miosa",
232310
- level: "project",
232311
- type: "directory",
232312
- pattern: "**/miosa/**",
232313
- agentIds: ["miosa-specialist", "architect"],
232314
- skillIds: ["architecture-decision", "parallel-dispatch"],
232315
- contextData: {
232316
- architecture: "multi-agent",
232317
- sandbox: "e2b",
232318
- project: "MIOSA"
232319
- },
232320
- priority: 90
232321
- }
232322
- ]
232323
- };
232146
+ PROJECT_RULES = {};
232324
232147
  FILE_RULES = {
232325
232148
  "*.svelte": [
232326
232149
  {
@@ -335720,7 +335543,7 @@ __name(getPackageJson, "getPackageJson");
335720
335543
  // packages/cli/src/utils/version.ts
335721
335544
  async function getCliVersion() {
335722
335545
  const pkgJson = await getPackageJson();
335723
- return "0.1.78";
335546
+ return "0.1.80";
335724
335547
  }
335725
335548
  __name(getCliVersion, "getCliVersion");
335726
335549
 
@@ -339907,8 +339730,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
339907
339730
 
339908
339731
  // packages/cli/src/generated/git-commit.ts
339909
339732
  init_esbuild_shims();
339910
- var GIT_COMMIT_INFO2 = "cf0b01c";
339911
- var CLI_VERSION2 = "0.1.78";
339733
+ var GIT_COMMIT_INFO2 = "127dce6";
339734
+ var CLI_VERSION2 = "0.1.80";
339912
339735
 
339913
339736
  // packages/cli/src/utils/systemInfo.ts
339914
339737
  async function getNpmVersion() {
@@ -367932,23 +367755,22 @@ function useSelectionList({
367932
367755
  },
367933
367756
  []
367934
367757
  );
367935
- useKeypress(
367936
- (key) => {
367937
- const { sequence, name: name3 } = key;
367938
- const isNumeric = showNumbers && /^[0-9]$/.test(sequence);
367758
+ use_input_default(
367759
+ (input, key) => {
367760
+ const isNumeric = showNumbers && /^[0-9]$/.test(input);
367939
367761
  if (!isNumeric && numberInputTimer.current) {
367940
367762
  clearTimeout(numberInputTimer.current);
367941
367763
  numberInputRef.current = "";
367942
367764
  }
367943
- if (name3 === "k" || name3 === "up") {
367765
+ if (key.upArrow || input === "k") {
367944
367766
  dispatch({ type: "MOVE_UP", payload: { items } });
367945
367767
  return;
367946
367768
  }
367947
- if (name3 === "j" || name3 === "down") {
367769
+ if (key.downArrow || input === "j") {
367948
367770
  dispatch({ type: "MOVE_DOWN", payload: { items } });
367949
367771
  return;
367950
367772
  }
367951
- if (name3 === "return") {
367773
+ if (key.return) {
367952
367774
  dispatch({ type: "SELECT_CURRENT", payload: { items } });
367953
367775
  return;
367954
367776
  }
@@ -367956,7 +367778,7 @@ function useSelectionList({
367956
367778
  if (numberInputTimer.current) {
367957
367779
  clearTimeout(numberInputTimer.current);
367958
367780
  }
367959
- const newNumberInput = numberInputRef.current + sequence;
367781
+ const newNumberInput = numberInputRef.current + input;
367960
367782
  numberInputRef.current = newNumberInput;
367961
367783
  const targetIndex = Number.parseInt(newNumberInput, 10) - 1;
367962
367784
  if (newNumberInput === "0") {
@@ -368236,164 +368058,6 @@ __name(GenerationMethodSelector, "GenerationMethodSelector");
368236
368058
  init_esbuild_shims();
368237
368059
  var import_react52 = __toESM(require_react(), 1);
368238
368060
 
368239
- // packages/cli/src/ui/keyMatchers.ts
368240
- init_esbuild_shims();
368241
-
368242
- // packages/cli/src/config/keyBindings.ts
368243
- init_esbuild_shims();
368244
- var Command = /* @__PURE__ */ ((Command2) => {
368245
- Command2["RETURN"] = "return";
368246
- Command2["ESCAPE"] = "escape";
368247
- Command2["HOME"] = "home";
368248
- Command2["END"] = "end";
368249
- Command2["KILL_LINE_RIGHT"] = "killLineRight";
368250
- Command2["KILL_LINE_LEFT"] = "killLineLeft";
368251
- Command2["CLEAR_INPUT"] = "clearInput";
368252
- Command2["DELETE_WORD_BACKWARD"] = "deleteWordBackward";
368253
- Command2["CLEAR_SCREEN"] = "clearScreen";
368254
- Command2["HISTORY_UP"] = "historyUp";
368255
- Command2["HISTORY_DOWN"] = "historyDown";
368256
- Command2["NAVIGATION_UP"] = "navigationUp";
368257
- Command2["NAVIGATION_DOWN"] = "navigationDown";
368258
- Command2["ACCEPT_SUGGESTION"] = "acceptSuggestion";
368259
- Command2["COMPLETION_UP"] = "completionUp";
368260
- Command2["COMPLETION_DOWN"] = "completionDown";
368261
- Command2["SUBMIT"] = "submit";
368262
- Command2["NEWLINE"] = "newline";
368263
- Command2["OPEN_EXTERNAL_EDITOR"] = "openExternalEditor";
368264
- Command2["PASTE_CLIPBOARD_IMAGE"] = "pasteClipboardImage";
368265
- Command2["SHOW_ERROR_DETAILS"] = "showErrorDetails";
368266
- Command2["TOGGLE_TOOL_DESCRIPTIONS"] = "toggleToolDescriptions";
368267
- Command2["TOGGLE_IDE_CONTEXT_DETAIL"] = "toggleIDEContextDetail";
368268
- Command2["QUIT"] = "quit";
368269
- Command2["EXIT"] = "exit";
368270
- Command2["SHOW_MORE_LINES"] = "showMoreLines";
368271
- Command2["REVERSE_SEARCH"] = "reverseSearch";
368272
- Command2["SUBMIT_REVERSE_SEARCH"] = "submitReverseSearch";
368273
- Command2["ACCEPT_SUGGESTION_REVERSE_SEARCH"] = "acceptSuggestionReverseSearch";
368274
- Command2["TOGGLE_SHELL_INPUT_FOCUS"] = "toggleShellInputFocus";
368275
- Command2["EXPAND_SUGGESTION"] = "expandSuggestion";
368276
- Command2["COLLAPSE_SUGGESTION"] = "collapseSuggestion";
368277
- Command2["TOGGLE_TODO_VISIBILITY"] = "toggleTodoVisibility";
368278
- return Command2;
368279
- })(Command || {});
368280
- var defaultKeyBindings = {
368281
- // Basic bindings
368282
- ["return" /* RETURN */]: [{ key: "return" }],
368283
- ["escape" /* ESCAPE */]: [{ key: "escape" }],
368284
- // Cursor movement
368285
- ["home" /* HOME */]: [{ key: "a", ctrl: true }],
368286
- ["end" /* END */]: [{ key: "e", ctrl: true }],
368287
- // Text deletion
368288
- ["killLineRight" /* KILL_LINE_RIGHT */]: [{ key: "k", ctrl: true }],
368289
- ["killLineLeft" /* KILL_LINE_LEFT */]: [{ key: "u", ctrl: true }],
368290
- ["clearInput" /* CLEAR_INPUT */]: [{ key: "c", ctrl: true }],
368291
- // Added command (meta/alt/option) for mac compatibility
368292
- ["deleteWordBackward" /* DELETE_WORD_BACKWARD */]: [
368293
- { key: "backspace", ctrl: true },
368294
- { key: "backspace", command: true }
368295
- ],
368296
- // Screen control
368297
- ["clearScreen" /* CLEAR_SCREEN */]: [{ key: "l", ctrl: true }],
368298
- // History navigation
368299
- ["historyUp" /* HISTORY_UP */]: [{ key: "p", ctrl: true }],
368300
- ["historyDown" /* HISTORY_DOWN */]: [{ key: "n", ctrl: true }],
368301
- ["navigationUp" /* NAVIGATION_UP */]: [{ key: "up" }],
368302
- ["navigationDown" /* NAVIGATION_DOWN */]: [{ key: "down" }],
368303
- // Auto-completion
368304
- ["acceptSuggestion" /* ACCEPT_SUGGESTION */]: [{ key: "tab" }, { key: "return", ctrl: false }],
368305
- // Completion navigation (arrow or Ctrl+P/N)
368306
- ["completionUp" /* COMPLETION_UP */]: [{ key: "up" }, { key: "p", ctrl: true }],
368307
- ["completionDown" /* COMPLETION_DOWN */]: [{ key: "down" }, { key: "n", ctrl: true }],
368308
- // Text input
368309
- // Must also exclude shift to allow shift+enter for newline
368310
- ["submit" /* SUBMIT */]: [
368311
- {
368312
- key: "return",
368313
- ctrl: false,
368314
- command: false,
368315
- paste: false,
368316
- shift: false
368317
- }
368318
- ],
368319
- // Split into multiple data-driven bindings
368320
- // Now also includes shift+enter for multi-line input
368321
- ["newline" /* NEWLINE */]: [
368322
- { key: "return", ctrl: true },
368323
- { key: "return", command: true },
368324
- { key: "return", paste: true },
368325
- { key: "return", shift: true },
368326
- { key: "j", ctrl: true }
368327
- ],
368328
- // External tools
368329
- ["openExternalEditor" /* OPEN_EXTERNAL_EDITOR */]: [
368330
- { key: "x", ctrl: true },
368331
- { sequence: "", ctrl: true }
368332
- ],
368333
- ["pasteClipboardImage" /* PASTE_CLIPBOARD_IMAGE */]: [{ key: "v", ctrl: true }],
368334
- // App level bindings
368335
- ["showErrorDetails" /* SHOW_ERROR_DETAILS */]: [{ key: "o", ctrl: true }],
368336
- ["toggleToolDescriptions" /* TOGGLE_TOOL_DESCRIPTIONS */]: [{ key: "t", ctrl: true }],
368337
- ["toggleIDEContextDetail" /* TOGGLE_IDE_CONTEXT_DETAIL */]: [{ key: "g", ctrl: true }],
368338
- ["quit" /* QUIT */]: [{ key: "c", ctrl: true }],
368339
- ["exit" /* EXIT */]: [{ key: "d", ctrl: true }],
368340
- ["showMoreLines" /* SHOW_MORE_LINES */]: [{ key: "s", ctrl: true }],
368341
- // Shell commands
368342
- ["reverseSearch" /* REVERSE_SEARCH */]: [{ key: "r", ctrl: true }],
368343
- // Note: original logic ONLY checked ctrl=false, ignored meta/shift/paste
368344
- ["submitReverseSearch" /* SUBMIT_REVERSE_SEARCH */]: [{ key: "return", ctrl: false }],
368345
- ["acceptSuggestionReverseSearch" /* ACCEPT_SUGGESTION_REVERSE_SEARCH */]: [{ key: "tab" }],
368346
- ["toggleShellInputFocus" /* TOGGLE_SHELL_INPUT_FOCUS */]: [{ key: "f", ctrl: true }],
368347
- // Suggestion expansion
368348
- ["expandSuggestion" /* EXPAND_SUGGESTION */]: [{ key: "right" }],
368349
- ["collapseSuggestion" /* COLLAPSE_SUGGESTION */]: [{ key: "left" }],
368350
- // UI toggles
368351
- ["toggleTodoVisibility" /* TOGGLE_TODO_VISIBILITY */]: [{ key: "y", ctrl: true }]
368352
- };
368353
-
368354
- // packages/cli/src/ui/keyMatchers.ts
368355
- function matchKeyBinding(keyBinding, key) {
368356
- let keyMatches = false;
368357
- if (keyBinding.key !== void 0) {
368358
- keyMatches = keyBinding.key === key.name;
368359
- } else if (keyBinding.sequence !== void 0) {
368360
- keyMatches = keyBinding.sequence === key.sequence;
368361
- } else {
368362
- return false;
368363
- }
368364
- if (!keyMatches) {
368365
- return false;
368366
- }
368367
- if (keyBinding.ctrl !== void 0 && key.ctrl !== keyBinding.ctrl) {
368368
- return false;
368369
- }
368370
- if (keyBinding.shift !== void 0 && key.shift !== keyBinding.shift) {
368371
- return false;
368372
- }
368373
- if (keyBinding.command !== void 0 && key.meta !== keyBinding.command) {
368374
- return false;
368375
- }
368376
- if (keyBinding.paste !== void 0 && key.paste !== keyBinding.paste) {
368377
- return false;
368378
- }
368379
- return true;
368380
- }
368381
- __name(matchKeyBinding, "matchKeyBinding");
368382
- function matchCommand(command2, key, config2 = defaultKeyBindings) {
368383
- const bindings = config2[command2];
368384
- return bindings.some((binding) => matchKeyBinding(binding, key));
368385
- }
368386
- __name(matchCommand, "matchCommand");
368387
- function createKeyMatchers(config2 = defaultKeyBindings) {
368388
- const matchers = {};
368389
- for (const command2 of Object.values(Command)) {
368390
- matchers[command2] = (key) => matchCommand(command2, key, config2);
368391
- }
368392
- return matchers;
368393
- }
368394
- __name(createKeyMatchers, "createKeyMatchers");
368395
- var keyMatchers = createKeyMatchers(defaultKeyBindings);
368396
-
368397
368061
  // packages/cli/src/ui/components/shared/TextInput.tsx
368398
368062
  init_esbuild_shims();
368399
368063
 
@@ -370470,6 +370134,164 @@ function useTextBuffer({
370470
370134
  }
370471
370135
  __name(useTextBuffer, "useTextBuffer");
370472
370136
 
370137
+ // packages/cli/src/ui/keyMatchers.ts
370138
+ init_esbuild_shims();
370139
+
370140
+ // packages/cli/src/config/keyBindings.ts
370141
+ init_esbuild_shims();
370142
+ var Command = /* @__PURE__ */ ((Command2) => {
370143
+ Command2["RETURN"] = "return";
370144
+ Command2["ESCAPE"] = "escape";
370145
+ Command2["HOME"] = "home";
370146
+ Command2["END"] = "end";
370147
+ Command2["KILL_LINE_RIGHT"] = "killLineRight";
370148
+ Command2["KILL_LINE_LEFT"] = "killLineLeft";
370149
+ Command2["CLEAR_INPUT"] = "clearInput";
370150
+ Command2["DELETE_WORD_BACKWARD"] = "deleteWordBackward";
370151
+ Command2["CLEAR_SCREEN"] = "clearScreen";
370152
+ Command2["HISTORY_UP"] = "historyUp";
370153
+ Command2["HISTORY_DOWN"] = "historyDown";
370154
+ Command2["NAVIGATION_UP"] = "navigationUp";
370155
+ Command2["NAVIGATION_DOWN"] = "navigationDown";
370156
+ Command2["ACCEPT_SUGGESTION"] = "acceptSuggestion";
370157
+ Command2["COMPLETION_UP"] = "completionUp";
370158
+ Command2["COMPLETION_DOWN"] = "completionDown";
370159
+ Command2["SUBMIT"] = "submit";
370160
+ Command2["NEWLINE"] = "newline";
370161
+ Command2["OPEN_EXTERNAL_EDITOR"] = "openExternalEditor";
370162
+ Command2["PASTE_CLIPBOARD_IMAGE"] = "pasteClipboardImage";
370163
+ Command2["SHOW_ERROR_DETAILS"] = "showErrorDetails";
370164
+ Command2["TOGGLE_TOOL_DESCRIPTIONS"] = "toggleToolDescriptions";
370165
+ Command2["TOGGLE_IDE_CONTEXT_DETAIL"] = "toggleIDEContextDetail";
370166
+ Command2["QUIT"] = "quit";
370167
+ Command2["EXIT"] = "exit";
370168
+ Command2["SHOW_MORE_LINES"] = "showMoreLines";
370169
+ Command2["REVERSE_SEARCH"] = "reverseSearch";
370170
+ Command2["SUBMIT_REVERSE_SEARCH"] = "submitReverseSearch";
370171
+ Command2["ACCEPT_SUGGESTION_REVERSE_SEARCH"] = "acceptSuggestionReverseSearch";
370172
+ Command2["TOGGLE_SHELL_INPUT_FOCUS"] = "toggleShellInputFocus";
370173
+ Command2["EXPAND_SUGGESTION"] = "expandSuggestion";
370174
+ Command2["COLLAPSE_SUGGESTION"] = "collapseSuggestion";
370175
+ Command2["TOGGLE_TODO_VISIBILITY"] = "toggleTodoVisibility";
370176
+ return Command2;
370177
+ })(Command || {});
370178
+ var defaultKeyBindings = {
370179
+ // Basic bindings
370180
+ ["return" /* RETURN */]: [{ key: "return" }],
370181
+ ["escape" /* ESCAPE */]: [{ key: "escape" }],
370182
+ // Cursor movement
370183
+ ["home" /* HOME */]: [{ key: "a", ctrl: true }],
370184
+ ["end" /* END */]: [{ key: "e", ctrl: true }],
370185
+ // Text deletion
370186
+ ["killLineRight" /* KILL_LINE_RIGHT */]: [{ key: "k", ctrl: true }],
370187
+ ["killLineLeft" /* KILL_LINE_LEFT */]: [{ key: "u", ctrl: true }],
370188
+ ["clearInput" /* CLEAR_INPUT */]: [{ key: "c", ctrl: true }],
370189
+ // Added command (meta/alt/option) for mac compatibility
370190
+ ["deleteWordBackward" /* DELETE_WORD_BACKWARD */]: [
370191
+ { key: "backspace", ctrl: true },
370192
+ { key: "backspace", command: true }
370193
+ ],
370194
+ // Screen control
370195
+ ["clearScreen" /* CLEAR_SCREEN */]: [{ key: "l", ctrl: true }],
370196
+ // History navigation
370197
+ ["historyUp" /* HISTORY_UP */]: [{ key: "p", ctrl: true }],
370198
+ ["historyDown" /* HISTORY_DOWN */]: [{ key: "n", ctrl: true }],
370199
+ ["navigationUp" /* NAVIGATION_UP */]: [{ key: "up" }],
370200
+ ["navigationDown" /* NAVIGATION_DOWN */]: [{ key: "down" }],
370201
+ // Auto-completion
370202
+ ["acceptSuggestion" /* ACCEPT_SUGGESTION */]: [{ key: "tab" }, { key: "return", ctrl: false }],
370203
+ // Completion navigation (arrow or Ctrl+P/N)
370204
+ ["completionUp" /* COMPLETION_UP */]: [{ key: "up" }, { key: "p", ctrl: true }],
370205
+ ["completionDown" /* COMPLETION_DOWN */]: [{ key: "down" }, { key: "n", ctrl: true }],
370206
+ // Text input
370207
+ // Must also exclude shift to allow shift+enter for newline
370208
+ ["submit" /* SUBMIT */]: [
370209
+ {
370210
+ key: "return",
370211
+ ctrl: false,
370212
+ command: false,
370213
+ paste: false,
370214
+ shift: false
370215
+ }
370216
+ ],
370217
+ // Split into multiple data-driven bindings
370218
+ // Now also includes shift+enter for multi-line input
370219
+ ["newline" /* NEWLINE */]: [
370220
+ { key: "return", ctrl: true },
370221
+ { key: "return", command: true },
370222
+ { key: "return", paste: true },
370223
+ { key: "return", shift: true },
370224
+ { key: "j", ctrl: true }
370225
+ ],
370226
+ // External tools
370227
+ ["openExternalEditor" /* OPEN_EXTERNAL_EDITOR */]: [
370228
+ { key: "x", ctrl: true },
370229
+ { sequence: "", ctrl: true }
370230
+ ],
370231
+ ["pasteClipboardImage" /* PASTE_CLIPBOARD_IMAGE */]: [{ key: "v", ctrl: true }],
370232
+ // App level bindings
370233
+ ["showErrorDetails" /* SHOW_ERROR_DETAILS */]: [{ key: "o", ctrl: true }],
370234
+ ["toggleToolDescriptions" /* TOGGLE_TOOL_DESCRIPTIONS */]: [{ key: "t", ctrl: true }],
370235
+ ["toggleIDEContextDetail" /* TOGGLE_IDE_CONTEXT_DETAIL */]: [{ key: "g", ctrl: true }],
370236
+ ["quit" /* QUIT */]: [{ key: "c", ctrl: true }],
370237
+ ["exit" /* EXIT */]: [{ key: "d", ctrl: true }],
370238
+ ["showMoreLines" /* SHOW_MORE_LINES */]: [{ key: "s", ctrl: true }],
370239
+ // Shell commands
370240
+ ["reverseSearch" /* REVERSE_SEARCH */]: [{ key: "r", ctrl: true }],
370241
+ // Note: original logic ONLY checked ctrl=false, ignored meta/shift/paste
370242
+ ["submitReverseSearch" /* SUBMIT_REVERSE_SEARCH */]: [{ key: "return", ctrl: false }],
370243
+ ["acceptSuggestionReverseSearch" /* ACCEPT_SUGGESTION_REVERSE_SEARCH */]: [{ key: "tab" }],
370244
+ ["toggleShellInputFocus" /* TOGGLE_SHELL_INPUT_FOCUS */]: [{ key: "f", ctrl: true }],
370245
+ // Suggestion expansion
370246
+ ["expandSuggestion" /* EXPAND_SUGGESTION */]: [{ key: "right" }],
370247
+ ["collapseSuggestion" /* COLLAPSE_SUGGESTION */]: [{ key: "left" }],
370248
+ // UI toggles
370249
+ ["toggleTodoVisibility" /* TOGGLE_TODO_VISIBILITY */]: [{ key: "y", ctrl: true }]
370250
+ };
370251
+
370252
+ // packages/cli/src/ui/keyMatchers.ts
370253
+ function matchKeyBinding(keyBinding, key) {
370254
+ let keyMatches = false;
370255
+ if (keyBinding.key !== void 0) {
370256
+ keyMatches = keyBinding.key === key.name;
370257
+ } else if (keyBinding.sequence !== void 0) {
370258
+ keyMatches = keyBinding.sequence === key.sequence;
370259
+ } else {
370260
+ return false;
370261
+ }
370262
+ if (!keyMatches) {
370263
+ return false;
370264
+ }
370265
+ if (keyBinding.ctrl !== void 0 && key.ctrl !== keyBinding.ctrl) {
370266
+ return false;
370267
+ }
370268
+ if (keyBinding.shift !== void 0 && key.shift !== keyBinding.shift) {
370269
+ return false;
370270
+ }
370271
+ if (keyBinding.command !== void 0 && key.meta !== keyBinding.command) {
370272
+ return false;
370273
+ }
370274
+ if (keyBinding.paste !== void 0 && key.paste !== keyBinding.paste) {
370275
+ return false;
370276
+ }
370277
+ return true;
370278
+ }
370279
+ __name(matchKeyBinding, "matchKeyBinding");
370280
+ function matchCommand(command2, key, config2 = defaultKeyBindings) {
370281
+ const bindings = config2[command2];
370282
+ return bindings.some((binding) => matchKeyBinding(binding, key));
370283
+ }
370284
+ __name(matchCommand, "matchCommand");
370285
+ function createKeyMatchers(config2 = defaultKeyBindings) {
370286
+ const matchers = {};
370287
+ for (const command2 of Object.values(Command)) {
370288
+ matchers[command2] = (key) => matchCommand(command2, key, config2);
370289
+ }
370290
+ return matchers;
370291
+ }
370292
+ __name(createKeyMatchers, "createKeyMatchers");
370293
+ var keyMatchers = createKeyMatchers(defaultKeyBindings);
370294
+
370473
370295
  // packages/cli/src/ui/colors.ts
370474
370296
  init_esbuild_shims();
370475
370297
  var Colors = {
@@ -370727,20 +370549,17 @@ function DescriptionInput({
370727
370549
  config2,
370728
370550
  handleGenerate
370729
370551
  ]);
370730
- const handleGenerationKeypress = (0, import_react52.useCallback)(
370731
- (key) => {
370732
- if (keyMatchers["escape" /* ESCAPE */](key)) {
370552
+ use_input_default(
370553
+ (_input, key) => {
370554
+ if (key.escape) {
370733
370555
  if (abortControllerRef.current) {
370734
370556
  abortControllerRef.current.abort();
370735
370557
  dispatch({ type: "SET_GENERATING", isGenerating: false });
370736
370558
  }
370737
370559
  }
370738
370560
  },
370739
- [dispatch]
370561
+ { isActive: state.isGenerating }
370740
370562
  );
370741
- useKeypress(handleGenerationKeypress, {
370742
- isActive: state.isGenerating
370743
- });
370744
370563
  const placeholder = t2(
370745
370564
  "e.g., Expert code reviewer that reviews code based on best practices..."
370746
370565
  );
@@ -371195,14 +371014,14 @@ function CreationSummary({
371195
371014
  state.location,
371196
371015
  launchEditor
371197
371016
  ]);
371198
- useKeypress(
371199
- (key) => {
371017
+ use_input_default(
371018
+ (input, key) => {
371200
371019
  if (saveSuccess) return;
371201
- if (key.name === "return" || key.sequence === "s") {
371020
+ if (key.return || input === "s") {
371202
371021
  handleSave();
371203
371022
  return;
371204
371023
  }
371205
- if (key.sequence === "e") {
371024
+ if (input === "e") {
371206
371025
  handleEdit();
371207
371026
  return;
371208
371027
  }
@@ -371341,9 +371160,9 @@ function AgentCreationWizard({
371341
371160
  dispatch({ type: "RESET_WIZARD" });
371342
371161
  onClose();
371343
371162
  }, [onClose]);
371344
- useKeypress(
371345
- (key) => {
371346
- if (key.name !== "escape") {
371163
+ use_input_default(
371164
+ (_input, key) => {
371165
+ if (!key.escape) {
371347
371166
  return;
371348
371167
  }
371349
371168
  const kind = getStepKind(state.generationMethod, state.currentStep);
@@ -371630,10 +371449,9 @@ var AgentSelectionStep = /* @__PURE__ */ __name(({
371630
371449
  setNavigation((prev) => ({ ...prev, currentBlock: "builtin" }));
371631
371450
  }
371632
371451
  }, [projectAgents, userAgents, builtinAgents]);
371633
- useKeypress(
371634
- (key) => {
371635
- const { name: name3 } = key;
371636
- if (name3 === "up" || name3 === "k") {
371452
+ use_input_default(
371453
+ (input, key) => {
371454
+ if (key.upArrow || input === "k") {
371637
371455
  setNavigation((prev) => {
371638
371456
  if (prev.currentBlock === "project") {
371639
371457
  if (prev.projectIndex > 0) {
@@ -371691,7 +371509,7 @@ var AgentSelectionStep = /* @__PURE__ */ __name(({
371691
371509
  }
371692
371510
  }
371693
371511
  });
371694
- } else if (name3 === "down" || name3 === "j") {
371512
+ } else if (key.downArrow || input === "j") {
371695
371513
  setNavigation((prev) => {
371696
371514
  if (prev.currentBlock === "project") {
371697
371515
  if (prev.projectIndex < projectAgents.length - 1) {
@@ -371725,7 +371543,7 @@ var AgentSelectionStep = /* @__PURE__ */ __name(({
371725
371543
  }
371726
371544
  }
371727
371545
  });
371728
- } else if (name3 === "return" || name3 === "space") {
371546
+ } else if (key.return || input === " ") {
371729
371547
  let globalIndex;
371730
371548
  if (navigation.currentBlock === "project") {
371731
371549
  globalIndex = navigation.projectIndex;
@@ -372001,16 +371819,18 @@ function AgentDeleteStep({
372001
371819
  onNavigateBack,
372002
371820
  isFocused = true
372003
371821
  }) {
372004
- useKeypress(
372005
- async (key) => {
371822
+ use_input_default(
371823
+ (input, key) => {
372006
371824
  if (!selectedAgent) return;
372007
- if (key.name === "y" || key.name === "return") {
372008
- try {
372009
- await onDelete(selectedAgent);
372010
- } catch (error2) {
372011
- console.error("Failed to delete agent:", error2);
372012
- }
372013
- } else if (key.name === "n") {
371825
+ if (input === "y" || key.return) {
371826
+ (async () => {
371827
+ try {
371828
+ await onDelete(selectedAgent);
371829
+ } catch (error2) {
371830
+ console.error("Failed to delete agent:", error2);
371831
+ }
371832
+ })();
371833
+ } else if (input === "n") {
372014
371834
  onNavigateBack();
372015
371835
  }
372016
371836
  },
@@ -372085,9 +371905,9 @@ function AgentsManagerDialog({
372085
371905
  },
372086
371906
  [config2, loadAgents]
372087
371907
  );
372088
- useKeypress(
372089
- (key) => {
372090
- if (key.name !== "escape") {
371908
+ use_input_default(
371909
+ (_input, key) => {
371910
+ if (!key.escape) {
372091
371911
  return;
372092
371912
  }
372093
371913
  const currentStep = getCurrentStep();
@@ -372776,13 +372596,13 @@ var AgentExecutionDisplay = /* @__PURE__ */ __name(({
372776
372596
  }
372777
372597
  return "";
372778
372598
  }, [displayMode, data]);
372779
- useKeypress(
372780
- (key) => {
372781
- if (key.ctrl && key.name === "e") {
372599
+ use_input_default(
372600
+ (input, key) => {
372601
+ if (key.ctrl && input === "e") {
372782
372602
  setDisplayMode(
372783
372603
  (current) => current === "compact" ? "default" : "compact"
372784
372604
  );
372785
- } else if (key.ctrl && key.name === "f") {
372605
+ } else if (key.ctrl && input === "f") {
372786
372606
  setDisplayMode(
372787
372607
  (current) => current === "default" ? "verbose" : "default"
372788
372608
  );
@@ -373548,16 +373368,6 @@ var useConfig = /* @__PURE__ */ __name(() => {
373548
373368
  // packages/cli/src/ui/components/subagents/runtime/MultiAgentSummary.tsx
373549
373369
  init_esbuild_shims();
373550
373370
  var import_react71 = __toESM(require_react(), 1);
373551
-
373552
- // packages/cli/src/ui/hooks/useFocusedKeypress.ts
373553
- init_esbuild_shims();
373554
- function useFocusedKeypress(onKeypress, options2) {
373555
- const { isFocused, when = true } = options2;
373556
- useKeypress(onKeypress, { isActive: isFocused && when });
373557
- }
373558
- __name(useFocusedKeypress, "useFocusedKeypress");
373559
-
373560
- // packages/cli/src/ui/components/subagents/runtime/MultiAgentSummary.tsx
373561
373371
  var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
373562
373372
  var MultiAgentSummary = /* @__PURE__ */ __name(({
373563
373373
  agents,
@@ -373612,10 +373422,7 @@ var MultiAgentSummary = /* @__PURE__ */ __name(({
373612
373422
  },
373613
373423
  [expandable]
373614
373424
  );
373615
- useFocusedKeypress(handleKeypress, {
373616
- isFocused,
373617
- when: expandable
373618
- });
373425
+ useKeypress(handleKeypress, { isActive: isFocused && expandable });
373619
373426
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "column", children: [
373620
373427
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "row", children: [
373621
373428
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Text3, { color: statusColor, children: "\u25CF " }),
@@ -375616,9 +375423,9 @@ function IdeIntegrationNudge({
375616
375423
  onComplete,
375617
375424
  isFocused = true
375618
375425
  }) {
375619
- useKeypress(
375620
- (key) => {
375621
- if (key.name === "escape") {
375426
+ use_input_default(
375427
+ (_input, key) => {
375428
+ if (key.escape) {
375622
375429
  onComplete({
375623
375430
  userSelection: "no",
375624
375431
  isExtensionPreInstalled: false
@@ -375687,9 +375494,9 @@ function LoopDetectionConfirmation({
375687
375494
  onComplete
375688
375495
  }) {
375689
375496
  const { isFocused } = useFocusScope(FocusIds.LOOP_DETECTION_DIALOG);
375690
- useKeypress(
375691
- (key) => {
375692
- if (key.name === "escape") {
375497
+ use_input_default(
375498
+ (_input, key) => {
375499
+ if (key.escape) {
375693
375500
  onComplete({
375694
375501
  userSelection: "keep"
375695
375502
  });
@@ -375804,9 +375611,9 @@ var FolderTrustDialog = /* @__PURE__ */ __name(({
375804
375611
  }, "doRelaunch");
375805
375612
  doRelaunch();
375806
375613
  }, [isRestarting]);
375807
- useKeypress(
375808
- (key) => {
375809
- if (key.name === "escape") {
375614
+ use_input_default(
375615
+ (_input, key) => {
375616
+ if (key.escape) {
375810
375617
  onSelect("do_not_trust" /* DO_NOT_TRUST */);
375811
375618
  }
375812
375619
  },
@@ -375867,9 +375674,9 @@ var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
375867
375674
  var ShellConfirmationDialog = /* @__PURE__ */ __name(({ request: request4 }) => {
375868
375675
  const { isFocused } = useFocusScope(FocusIds.SHELL_CONFIRMATION_DIALOG);
375869
375676
  const { commands, onConfirm } = request4;
375870
- useKeypress(
375871
- (key) => {
375872
- if (key.name === "escape") {
375677
+ use_input_default(
375678
+ (_input, key) => {
375679
+ if (key.escape) {
375873
375680
  onConfirm(ToolConfirmationOutcome.Cancel);
375874
375681
  }
375875
375682
  },
@@ -376282,12 +376089,12 @@ function ThemeDialog({
376282
376089
  [onSelect, highlightedThemeName]
376283
376090
  );
376284
376091
  const [mode, setMode] = (0, import_react80.useState)("theme");
376285
- useKeypress(
376286
- (key) => {
376287
- if (key.name === "tab") {
376092
+ use_input_default(
376093
+ (_input, key) => {
376094
+ if (key.tab) {
376288
376095
  setMode((prev) => prev === "theme" ? "scope" : "theme");
376289
376096
  }
376290
- if (key.name === "escape") {
376097
+ if (key.escape) {
376291
376098
  onSelect(void 0, selectedScope);
376292
376099
  }
376293
376100
  },
@@ -376798,20 +376605,20 @@ function SettingsDialog({
376798
376605
  );
376799
376606
  const showScrollUp = items.length > effectiveMaxItemsToShow;
376800
376607
  const showScrollDown = items.length > effectiveMaxItemsToShow;
376801
- useKeypress(
376802
- (key) => {
376803
- const { name: name3, ctrl } = key;
376804
- if (name3 === "tab" && showScopeSelection) {
376608
+ use_input_default(
376609
+ (input, key) => {
376610
+ const ctrl = key.ctrl;
376611
+ if (key.tab && showScopeSelection) {
376805
376612
  setFocusSection((prev) => prev === "settings" ? "scope" : "settings");
376806
376613
  }
376807
376614
  if (focusSection === "settings") {
376808
376615
  if (editingKey) {
376809
376616
  const definition = getSettingDefinition(editingKey);
376810
376617
  const type = definition?.type;
376811
- if (key.paste && key.sequence) {
376812
- let pasted = key.sequence;
376618
+ if (input && input.length > 1) {
376619
+ let pasted = input;
376813
376620
  if (type === "number") {
376814
- pasted = key.sequence.replace(/[^0-9\-+.]/g, "");
376621
+ pasted = input.replace(/[^0-9\-+.]/g, "");
376815
376622
  }
376816
376623
  if (pasted) {
376817
376624
  setEditBuffer((b) => {
@@ -376823,15 +376630,15 @@ function SettingsDialog({
376823
376630
  }
376824
376631
  return;
376825
376632
  }
376826
- if (name3 === "backspace" || name3 === "delete") {
376827
- if (name3 === "backspace" && editCursorPos > 0) {
376633
+ if (key.backspace || key.delete) {
376634
+ if (key.backspace && editCursorPos > 0) {
376828
376635
  setEditBuffer((b) => {
376829
376636
  const before = cpSlice(b, 0, editCursorPos - 1);
376830
376637
  const after = cpSlice(b, editCursorPos);
376831
376638
  return before + after;
376832
376639
  });
376833
376640
  setEditCursorPos((pos2) => pos2 - 1);
376834
- } else if (name3 === "delete" && editCursorPos < cpLen(editBuffer)) {
376641
+ } else if (key.delete && editCursorPos < cpLen(editBuffer)) {
376835
376642
  setEditBuffer((b) => {
376836
376643
  const before = cpSlice(b, 0, editCursorPos);
376837
376644
  const after = cpSlice(b, editCursorPos + 1);
@@ -376840,15 +376647,15 @@ function SettingsDialog({
376840
376647
  }
376841
376648
  return;
376842
376649
  }
376843
- if (name3 === "escape") {
376650
+ if (key.escape) {
376844
376651
  commitEdit(editingKey);
376845
376652
  return;
376846
376653
  }
376847
- if (name3 === "return") {
376654
+ if (key.return) {
376848
376655
  commitEdit(editingKey);
376849
376656
  return;
376850
376657
  }
376851
- let ch = key.sequence;
376658
+ let ch = input || "";
376852
376659
  let isValidChar = false;
376853
376660
  if (type === "number") {
376854
376661
  isValidChar = /[0-9\-+.]/.test(ch);
@@ -376865,25 +376672,17 @@ function SettingsDialog({
376865
376672
  setEditCursorPos((pos2) => pos2 + 1);
376866
376673
  return;
376867
376674
  }
376868
- if (name3 === "left") {
376675
+ if (key.leftArrow) {
376869
376676
  setEditCursorPos((pos2) => Math.max(0, pos2 - 1));
376870
376677
  return;
376871
376678
  }
376872
- if (name3 === "right") {
376679
+ if (key.rightArrow) {
376873
376680
  setEditCursorPos((pos2) => Math.min(cpLen(editBuffer), pos2 + 1));
376874
376681
  return;
376875
376682
  }
376876
- if (name3 === "home") {
376877
- setEditCursorPos(0);
376878
- return;
376879
- }
376880
- if (name3 === "end") {
376881
- setEditCursorPos(cpLen(editBuffer));
376882
- return;
376883
- }
376884
376683
  return;
376885
376684
  }
376886
- if (name3 === "up" || name3 === "k") {
376685
+ if (key.upArrow || input === "k") {
376887
376686
  if (editingKey) {
376888
376687
  commitEdit(editingKey);
376889
376688
  }
@@ -376896,7 +376695,7 @@ function SettingsDialog({
376896
376695
  } else if (newIndex < scrollOffset) {
376897
376696
  setScrollOffset(newIndex);
376898
376697
  }
376899
- } else if (name3 === "down" || name3 === "j") {
376698
+ } else if (key.downArrow || input === "j") {
376900
376699
  if (editingKey) {
376901
376700
  commitEdit(editingKey);
376902
376701
  }
@@ -376907,19 +376706,19 @@ function SettingsDialog({
376907
376706
  } else if (newIndex >= scrollOffset + effectiveMaxItemsToShow) {
376908
376707
  setScrollOffset(newIndex - effectiveMaxItemsToShow + 1);
376909
376708
  }
376910
- } else if (name3 === "return" || name3 === "space") {
376709
+ } else if (key.return || input === " ") {
376911
376710
  const currentItem = items[activeSettingIndex];
376912
376711
  if (currentItem?.type === "number" || currentItem?.type === "string") {
376913
376712
  startEditing(currentItem.value);
376914
376713
  } else {
376915
376714
  currentItem?.toggle();
376916
376715
  }
376917
- } else if (/^[0-9]$/.test(key.sequence || "") && !editingKey) {
376716
+ } else if (/^[0-9]$/.test(input || "") && !editingKey) {
376918
376717
  const currentItem = items[activeSettingIndex];
376919
376718
  if (currentItem?.type === "number") {
376920
- startEditing(currentItem.value, key.sequence);
376719
+ startEditing(currentItem.value, input);
376921
376720
  }
376922
- } else if (ctrl && (name3 === "c" || name3 === "l")) {
376721
+ } else if (ctrl && (input === "c" || input === "l")) {
376923
376722
  const currentSetting = items[activeSettingIndex];
376924
376723
  if (currentSetting) {
376925
376724
  const defaultValue = getDefaultValue(currentSetting.value);
@@ -376996,7 +376795,7 @@ function SettingsDialog({
376996
376795
  }
376997
376796
  }
376998
376797
  }
376999
- if (showRestartPrompt && name3 === "r") {
376798
+ if (showRestartPrompt && input === "r") {
377000
376799
  const restartRequiredSettings = getRestartRequiredFromModified(modifiedSettings);
377001
376800
  const restartRequiredSet = new Set(restartRequiredSettings);
377002
376801
  if (restartRequiredSet.size > 0) {
@@ -377009,8 +376808,8 @@ function SettingsDialog({
377009
376808
  setGlobalPendingChanges((prev) => {
377010
376809
  if (prev.size === 0) return prev;
377011
376810
  const next = new Map(prev);
377012
- for (const key2 of restartRequiredSet) {
377013
- next.delete(key2);
376811
+ for (const settingKey of restartRequiredSet) {
376812
+ next.delete(settingKey);
377014
376813
  }
377015
376814
  return next;
377016
376815
  });
@@ -377019,7 +376818,7 @@ function SettingsDialog({
377019
376818
  setRestartRequiredSettings(/* @__PURE__ */ new Set());
377020
376819
  if (onRestartRequest) onRestartRequest();
377021
376820
  }
377022
- if (name3 === "escape") {
376821
+ if (key.escape) {
377023
376822
  if (editingKey) {
377024
376823
  commitEdit(editingKey);
377025
376824
  } else {
@@ -377402,11 +377201,11 @@ function OSAOAuthProgress({
377402
377201
  const [timeRemaining, setTimeRemaining] = (0, import_react84.useState)(defaultTimeout);
377403
377202
  const [dots, setDots] = (0, import_react84.useState)("");
377404
377203
  const [qrCodeData, setQrCodeData] = (0, import_react84.useState)(null);
377405
- useKeypress(
377406
- (key) => {
377204
+ use_input_default(
377205
+ (input, key) => {
377407
377206
  if (authStatus === "timeout" || authStatus === "error") {
377408
377207
  onCancel();
377409
- } else if (key.name === "escape" || key.ctrl && key.name === "c") {
377208
+ } else if (key.escape || key.ctrl && input === "c") {
377410
377209
  onCancel();
377411
377210
  }
377412
377211
  },
@@ -377552,9 +377351,9 @@ var ModelSwitchDialog = /* @__PURE__ */ __name(({
377552
377351
  onSelect
377553
377352
  }) => {
377554
377353
  const { isFocused } = useFocusScope(FocusIds.MODEL_SWITCH_DIALOG);
377555
- useKeypress(
377556
- (key) => {
377557
- if (key.name === "escape") {
377354
+ use_input_default(
377355
+ (_input, key) => {
377356
+ if (key.escape) {
377558
377357
  onSelect("persist" /* ContinueWithCurrentModel */);
377559
377358
  }
377560
377359
  },
@@ -377659,16 +377458,13 @@ function OpenAIKeyPrompt({
377659
377458
  }
377660
377459
  }
377661
377460
  }, "validateAndSubmit");
377662
- useKeypress(
377663
- (key) => {
377664
- if (key.kittyProtocol && !key.name) {
377665
- return;
377666
- }
377667
- if (key.name === "escape") {
377461
+ use_input_default(
377462
+ (input, key) => {
377463
+ if (key.escape) {
377668
377464
  onCancel();
377669
377465
  return;
377670
377466
  }
377671
- if (key.name === "return") {
377467
+ if (key.return) {
377672
377468
  if (currentField === "apiKey") {
377673
377469
  setCurrentField("baseUrl");
377674
377470
  } else if (currentField === "baseUrl") {
@@ -377682,7 +377478,7 @@ function OpenAIKeyPrompt({
377682
377478
  }
377683
377479
  return;
377684
377480
  }
377685
- if (key.name === "tab") {
377481
+ if (key.tab) {
377686
377482
  if (key.shift) {
377687
377483
  if (currentField === "baseUrl") {
377688
377484
  setCurrentField("apiKey");
@@ -377702,7 +377498,7 @@ function OpenAIKeyPrompt({
377702
377498
  }
377703
377499
  return;
377704
377500
  }
377705
- if (key.name === "up") {
377501
+ if (key.upArrow) {
377706
377502
  if (currentField === "baseUrl") {
377707
377503
  setCurrentField("apiKey");
377708
377504
  } else if (currentField === "model") {
@@ -377710,7 +377506,7 @@ function OpenAIKeyPrompt({
377710
377506
  }
377711
377507
  return;
377712
377508
  }
377713
- if (key.name === "down") {
377509
+ if (key.downArrow) {
377714
377510
  if (currentField === "apiKey") {
377715
377511
  setCurrentField("baseUrl");
377716
377512
  } else if (currentField === "baseUrl") {
@@ -377718,13 +377514,13 @@ function OpenAIKeyPrompt({
377718
377514
  }
377719
377515
  return;
377720
377516
  }
377721
- if (key.name === "left" || key.name === "right") {
377517
+ if (key.leftArrow || key.rightArrow) {
377722
377518
  return;
377723
377519
  }
377724
- if (["home", "end", "pageup", "pagedown", "insert"].includes(key.name)) {
377520
+ if (key.pageUp || key.pageDown) {
377725
377521
  return;
377726
377522
  }
377727
- if (key.name === "backspace" || key.name === "delete") {
377523
+ if (key.backspace || key.delete) {
377728
377524
  if (currentField === "apiKey") {
377729
377525
  setApiKey((prev) => prev.slice(0, -1));
377730
377526
  } else if (currentField === "baseUrl") {
@@ -377734,25 +377530,11 @@ function OpenAIKeyPrompt({
377734
377530
  }
377735
377531
  return;
377736
377532
  }
377737
- if (key.paste && key.sequence) {
377738
- let cleanInput = key.sequence.replace(/\u001b\[[0-9;]*[a-zA-Z~]/g, "").replace(/\[200~/g, "").replace(/\[201~/g, "").replace(/^\[|~$/g, "");
377739
- cleanInput = cleanInput.split("").filter((ch) => ch.charCodeAt(0) >= 32).join("");
377740
- if (cleanInput.length > 0) {
377741
- if (currentField === "apiKey") {
377742
- setApiKey((prev) => prev + cleanInput);
377743
- } else if (currentField === "baseUrl") {
377744
- setBaseUrl((prev) => prev + cleanInput);
377745
- } else if (currentField === "model") {
377746
- setModel((prev) => prev + cleanInput);
377747
- }
377748
- }
377749
- return;
377750
- }
377751
377533
  if (key.ctrl || key.meta) {
377752
377534
  return;
377753
377535
  }
377754
- if (key.sequence) {
377755
- const cleanInput = key.sequence.replace(/\u001b\[[0-9;]*[a-zA-Z~]/g, "").split("").filter((ch) => ch.charCodeAt(0) >= 32).join("");
377536
+ if (input && input.length > 0) {
377537
+ const cleanInput = input.split("").filter((ch) => ch.charCodeAt(0) >= 32).join("");
377756
377538
  if (cleanInput.length > 0) {
377757
377539
  if (currentField === "apiKey") {
377758
377540
  setApiKey((prev) => prev + cleanInput);
@@ -377907,9 +377689,9 @@ function AuthDialog() {
377907
377689
  const index = items.findIndex((item) => item.value === authMethod);
377908
377690
  setSelectedIndex(index);
377909
377691
  }, "handleHighlight");
377910
- useKeypress(
377911
- (key) => {
377912
- if (key.name === "escape") {
377692
+ use_input_default(
377693
+ (_input, key) => {
377694
+ if (key.escape) {
377913
377695
  if (errorMessage) {
377914
377696
  return;
377915
377697
  }
@@ -378027,12 +377809,12 @@ function EditorSettingsDialog({
378027
377809
  const [focusedSection, setFocusedSection] = (0, import_react88.useState)(
378028
377810
  "editor"
378029
377811
  );
378030
- useKeypress(
378031
- (key) => {
378032
- if (key.name === "tab") {
377812
+ use_input_default(
377813
+ (_input, key) => {
377814
+ if (key.tab) {
378033
377815
  setFocusedSection((prev) => prev === "editor" ? "scope" : "editor");
378034
377816
  }
378035
- if (key.name === "escape") {
377817
+ if (key.escape) {
378036
377818
  onExit();
378037
377819
  }
378038
377820
  },
@@ -378175,9 +377957,9 @@ function WorkspaceMigrationDialog(props) {
378175
377957
  setFailedExtensions(failed);
378176
377958
  setMigrationComplete(true);
378177
377959
  }, "onMigrate");
378178
- useKeypress(
378179
- (key) => {
378180
- if (migrationComplete && key.sequence === "q") {
377960
+ use_input_default(
377961
+ (input, _key) => {
377962
+ if (migrationComplete && input === "q") {
378181
377963
  process.exit(0);
378182
377964
  }
378183
377965
  },
@@ -378267,9 +378049,9 @@ function ProQuotaDialog({
378267
378049
  const handleSelect = /* @__PURE__ */ __name((choice2) => {
378268
378050
  onChoice(choice2);
378269
378051
  }, "handleSelect");
378270
- useKeypress(
378271
- (key) => {
378272
- if (key.name === "escape") {
378052
+ use_input_default(
378053
+ (_input, key) => {
378054
+ if (key.escape) {
378273
378055
  onChoice("continue");
378274
378056
  }
378275
378057
  },
@@ -378409,12 +378191,12 @@ function PermissionsModifyTrustDialog({
378409
378191
  updateTrustLevel,
378410
378192
  commitTrustLevelChange
378411
378193
  } = usePermissionsModifyTrust(onExit, addItem);
378412
- useKeypress(
378413
- (key) => {
378414
- if (key.name === "escape") {
378194
+ use_input_default(
378195
+ (input, key) => {
378196
+ if (key.escape) {
378415
378197
  onExit();
378416
378198
  }
378417
- if (needsRestart && key.name === "r") {
378199
+ if (needsRestart && input === "r") {
378418
378200
  commitTrustLevelChange();
378419
378201
  relaunchApp();
378420
378202
  onExit();
@@ -378533,9 +378315,9 @@ function ModelDialog({ onClose }) {
378533
378315
  [availableModels]
378534
378316
  );
378535
378317
  const preferredModel = config2?.getModel() || MAINLINE_CODER;
378536
- useKeypress(
378537
- (key) => {
378538
- if (key.name === "escape") {
378318
+ use_input_default(
378319
+ (_input, key) => {
378320
+ if (key.escape) {
378539
378321
  onClose();
378540
378322
  }
378541
378323
  },
@@ -378642,12 +378424,12 @@ function ApprovalModeDialog({
378642
378424
  [onSelect, highlightedMode]
378643
378425
  );
378644
378426
  const [focusSection, setFocusSection] = (0, import_react92.useState)("mode");
378645
- useKeypress(
378646
- (key) => {
378647
- if (key.name === "tab") {
378427
+ use_input_default(
378428
+ (_input, key) => {
378429
+ if (key.tab) {
378648
378430
  setFocusSection((prev) => prev === "mode" ? "scope" : "mode");
378649
378431
  }
378650
- if (key.name === "escape") {
378432
+ if (key.escape) {
378651
378433
  onSelect(void 0, selectedScope);
378652
378434
  }
378653
378435
  },
@@ -378724,9 +378506,9 @@ import process34 from "node:process";
378724
378506
  init_esbuild_shims();
378725
378507
  var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
378726
378508
  var IdeTrustChangeDialog = /* @__PURE__ */ __name(({ reason, isFocused = true }) => {
378727
- useKeypress(
378728
- (key) => {
378729
- if (key.name === "r" || key.name === "R") {
378509
+ use_input_default(
378510
+ (input, _key) => {
378511
+ if (input === "r" || input === "R") {
378730
378512
  relaunchApp();
378731
378513
  }
378732
378514
  },
@@ -378757,9 +378539,9 @@ function WelcomeBackDialog({
378757
378539
  onClose
378758
378540
  }) {
378759
378541
  const { isFocused } = useFocusScope(FocusIds.WELCOME_BACK_DIALOG);
378760
- useKeypress(
378761
- (key) => {
378762
- if (key.name === "escape") {
378542
+ use_input_default(
378543
+ (_input, key) => {
378544
+ if (key.escape) {
378763
378545
  onClose();
378764
378546
  }
378765
378547
  },
@@ -378842,9 +378624,9 @@ var QuitConfirmationDialog = /* @__PURE__ */ __name(({
378842
378624
  onSelect
378843
378625
  }) => {
378844
378626
  const { isFocused } = useFocusScope(FocusIds.QUIT_CONFIRMATION_DIALOG);
378845
- useKeypress(
378846
- (key) => {
378847
- if (key.name === "escape") {
378627
+ use_input_default(
378628
+ (_input, key) => {
378629
+ if (key.escape) {
378848
378630
  onSelect("cancel" /* CANCEL */);
378849
378631
  }
378850
378632
  },
@@ -381433,8 +381215,8 @@ var InputPrompt = /* @__PURE__ */ __name(({
381433
381215
  commandSearchCompletion
381434
381216
  ]
381435
381217
  );
381436
- useFocusedKeypress(handleInput, {
381437
- isFocused: focus && !isEmbeddedShellFocused && noDialogHasFocus
381218
+ useKeypress(handleInput, {
381219
+ isActive: focus && !isEmbeddedShellFocused && noDialogHasFocus
381438
381220
  });
381439
381221
  const linesToRender = buffer.viewportVisualLines;
381440
381222
  const [cursorVisualRowAbsolute, cursorVisualColAbsolute] = buffer.visualCursor;
@@ -383236,33 +383018,50 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config2, addItem) => {
383236
383018
  }
383237
383019
  if (authType === AuthType2.OLLAMA_CLOUD) {
383238
383020
  if (credentials) {
383021
+ const effectiveBaseUrl = credentials.baseUrl || "https://ollama.com/v1";
383022
+ const effectiveModel = credentials.model || "qwen3-coder:480b-cloud";
383239
383023
  config2.updateCredentials({
383240
383024
  apiKey: credentials.apiKey,
383241
- baseUrl: credentials.baseUrl || "https://ollama.com/v1",
383242
- model: credentials.model || "qwen3-coder:480b-cloud"
383025
+ baseUrl: effectiveBaseUrl,
383026
+ model: effectiveModel
383027
+ });
383028
+ await performAuth(authType, scope, {
383029
+ ...credentials,
383030
+ baseUrl: effectiveBaseUrl,
383031
+ model: effectiveModel
383243
383032
  });
383244
- await performAuth(authType, scope, credentials);
383245
383033
  }
383246
383034
  return;
383247
383035
  }
383248
383036
  if (authType === AuthType2.OLLAMA_LOCAL) {
383037
+ const effectiveBaseUrl = getEffectiveOllamaLocalUrl();
383038
+ const effectiveModel = credentials?.model || "qwen2.5-coder:32b";
383249
383039
  config2.updateCredentials({
383250
383040
  apiKey: "ollama",
383251
- baseUrl: getEffectiveOllamaLocalUrl(),
383252
- model: credentials?.model || "qwen2.5-coder:32b"
383041
+ baseUrl: effectiveBaseUrl,
383042
+ model: effectiveModel
383043
+ });
383044
+ await performAuth(authType, scope, {
383045
+ apiKey: "ollama",
383046
+ baseUrl: effectiveBaseUrl,
383047
+ model: effectiveModel
383253
383048
  });
383254
- await performAuth(authType, scope, credentials);
383255
383049
  return;
383256
383050
  }
383257
383051
  if (authType === AuthType2.USE_GROQ) {
383258
383052
  if (credentials) {
383053
+ const effectiveBaseUrl = "https://api.groq.com/openai/v1";
383054
+ const effectiveModel = credentials.model || "moonshotai/kimi-k2-instruct-0905";
383259
383055
  config2.updateCredentials({
383260
383056
  apiKey: credentials.apiKey,
383261
- // Always use GROQ endpoint - ignore user-provided baseUrl
383262
- baseUrl: "https://api.groq.com/openai/v1",
383263
- model: credentials.model || "moonshotai/kimi-k2-instruct-0905"
383057
+ baseUrl: effectiveBaseUrl,
383058
+ model: effectiveModel
383059
+ });
383060
+ await performAuth(authType, scope, {
383061
+ ...credentials,
383062
+ baseUrl: effectiveBaseUrl,
383063
+ model: effectiveModel
383264
383064
  });
383265
- await performAuth(authType, scope, credentials);
383266
383065
  }
383267
383066
  return;
383268
383067
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osagent",
3
- "version": "0.1.78",
3
+ "version": "0.1.80",
4
4
  "description": "OS Agent - AI-powered CLI for autonomous coding with Ollama Cloud and Qwen models",
5
5
  "author": "Roberto Luna",
6
6
  "license": "Apache-2.0",