hoomanjs 1.36.0 → 1.37.1

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 (82) hide show
  1. package/README.md +17 -13
  2. package/dist/acp/acp-agent.js +128 -2
  3. package/dist/acp/acp-agent.js.map +1 -1
  4. package/dist/acp/commands.js +5 -0
  5. package/dist/acp/commands.js.map +1 -1
  6. package/dist/acp/session-config.d.ts +2 -0
  7. package/dist/acp/session-config.js +27 -0
  8. package/dist/acp/session-config.js.map +1 -1
  9. package/dist/chat/app.js +130 -1
  10. package/dist/chat/app.js.map +1 -1
  11. package/dist/chat/components/BottomChrome.d.ts +3 -1
  12. package/dist/chat/components/BottomChrome.js +2 -2
  13. package/dist/chat/components/BottomChrome.js.map +1 -1
  14. package/dist/chat/components/ChromePicker.d.ts +3 -2
  15. package/dist/chat/components/ChromePicker.js +15 -1
  16. package/dist/chat/components/ChromePicker.js.map +1 -1
  17. package/dist/chat/components/ReasoningStrip.js +3 -1
  18. package/dist/chat/components/ReasoningStrip.js.map +1 -1
  19. package/dist/chat/components/StatusBar.d.ts +2 -1
  20. package/dist/chat/components/StatusBar.js +18 -3
  21. package/dist/chat/components/StatusBar.js.map +1 -1
  22. package/dist/chat/components/ThoughtEvent.d.ts +3 -1
  23. package/dist/chat/components/ThoughtEvent.js +6 -2
  24. package/dist/chat/components/ThoughtEvent.js.map +1 -1
  25. package/dist/chat/components/Transcript.d.ts +5 -2
  26. package/dist/chat/components/Transcript.js +4 -4
  27. package/dist/chat/components/Transcript.js.map +1 -1
  28. package/dist/cli.js +23 -0
  29. package/dist/cli.js.map +1 -1
  30. package/dist/configure/app.js +287 -68
  31. package/dist/configure/app.js.map +1 -1
  32. package/dist/configure/components/MenuScreen.js +29 -5
  33. package/dist/configure/components/MenuScreen.js.map +1 -1
  34. package/dist/configure/types.d.ts +8 -2
  35. package/dist/core/agent/index.js +3 -2
  36. package/dist/core/agent/index.js.map +1 -1
  37. package/dist/core/config.d.ts +352 -22
  38. package/dist/core/config.js +40 -0
  39. package/dist/core/config.js.map +1 -1
  40. package/dist/core/models/anthropic.d.ts +7 -1
  41. package/dist/core/models/anthropic.js +36 -7
  42. package/dist/core/models/anthropic.js.map +1 -1
  43. package/dist/core/models/azure.js +13 -0
  44. package/dist/core/models/azure.js.map +1 -1
  45. package/dist/core/models/bedrock.js +33 -0
  46. package/dist/core/models/bedrock.js.map +1 -1
  47. package/dist/core/models/google.js +5 -0
  48. package/dist/core/models/google.js.map +1 -1
  49. package/dist/core/models/groq.js +14 -0
  50. package/dist/core/models/groq.js.map +1 -1
  51. package/dist/core/models/minimax.js +2 -2
  52. package/dist/core/models/minimax.js.map +1 -1
  53. package/dist/core/models/moonshot.js +5 -0
  54. package/dist/core/models/moonshot.js.map +1 -1
  55. package/dist/core/models/ollama/index.js +5 -3
  56. package/dist/core/models/ollama/index.js.map +1 -1
  57. package/dist/core/models/openai.js +21 -1
  58. package/dist/core/models/openai.js.map +1 -1
  59. package/dist/core/models/openrouter.d.ts +2 -2
  60. package/dist/core/models/openrouter.js +28 -10
  61. package/dist/core/models/openrouter.js.map +1 -1
  62. package/dist/core/models/reasoning-effort.d.ts +55 -0
  63. package/dist/core/models/reasoning-effort.js +91 -0
  64. package/dist/core/models/reasoning-effort.js.map +1 -0
  65. package/dist/core/models/types.d.ts +759 -51
  66. package/dist/core/models/types.js +43 -7
  67. package/dist/core/models/types.js.map +1 -1
  68. package/dist/core/models/xai.js +12 -0
  69. package/dist/core/models/xai.js.map +1 -1
  70. package/dist/core/prompts/harness/execution.md +1 -0
  71. package/dist/core/session-config.d.ts +10 -1
  72. package/dist/core/session-config.js +16 -0
  73. package/dist/core/session-config.js.map +1 -1
  74. package/dist/core/sessions/tolerant-file-storage.d.ts +24 -0
  75. package/dist/core/sessions/tolerant-file-storage.js +81 -0
  76. package/dist/core/sessions/tolerant-file-storage.js.map +1 -0
  77. package/dist/core/skills/built-in/hooman-config/SKILL.md +20 -12
  78. package/dist/core/state/todos.d.ts +4 -4
  79. package/dist/core/tools/todo.d.ts +1 -1
  80. package/dist/core/tools/web-search.js +56 -1
  81. package/dist/core/tools/web-search.js.map +1 -1
  82. package/package.json +2 -1
@@ -0,0 +1,55 @@
1
+ import type { Config } from "../config.js";
2
+ /**
3
+ * Shared reasoning-effort helpers used by both the chat TUI and the ACP agent
4
+ * so the two front-ends cycle/set/persist effort identically.
5
+ *
6
+ * Effort is stored under a provider's `options.reasoning.effort`. Its presence
7
+ * enables thinking; the level is forwarded where the backend supports it. The
8
+ * `undefined` rung means "off" (no reasoning), so a single control can also
9
+ * disable thinking.
10
+ */
11
+ /**
12
+ * Ordered effort rungs cycled by the chat Shift+Tab shortcut and `/effort`.
13
+ * `undefined` is the "off" (no reasoning) rung.
14
+ */
15
+ export declare const REASONING_EFFORT_CYCLE: readonly [undefined, "minimal", "low", "medium", "high"];
16
+ /** Selectable effort levels (the {@link REASONING_EFFORT_CYCLE} minus "off"). */
17
+ export declare const REASONING_EFFORT_LEVELS: readonly ["minimal", "low", "medium", "high"];
18
+ /** Sentinel value used to represent the "off" rung in pickers/config options. */
19
+ export declare const REASONING_EFFORT_OFF = "off";
20
+ /** Advance one rung through {@link REASONING_EFFORT_CYCLE}, wrapping around. */
21
+ export declare function nextReasoningEffort(current: string | undefined, direction: 1 | -1): string | undefined;
22
+ /**
23
+ * Returns provider options with `reasoning.effort` set to `nextEffort`,
24
+ * preserving sibling reasoning keys and collapsing to `undefined` when the
25
+ * reasoning object would end up empty (so we never persist `"reasoning": {}`).
26
+ */
27
+ export declare function withReasoningEffort(options: unknown, nextEffort: string | undefined): Record<string, unknown>;
28
+ /** Read `reasoning.effort` out of a provider's raw options object. */
29
+ export declare function readProviderEffort(options: unknown): string | undefined;
30
+ /** The active (default) named LLM, falling back to the first configured one. */
31
+ export declare function activeLlm(config: Config): {
32
+ name: string;
33
+ provider: string;
34
+ options: {
35
+ model: string;
36
+ temperature?: number | undefined;
37
+ maxTokens?: number | undefined;
38
+ };
39
+ default: boolean;
40
+ } | undefined;
41
+ /** Provider name backing the active LLM, if any is configured. */
42
+ export declare function activeProviderName(config: Config): string | undefined;
43
+ /**
44
+ * The effort currently applied to the active model, read from the fully
45
+ * resolved provider options (so overlay/session values are reflected).
46
+ */
47
+ export declare function currentReasoningEffort(config: Config): string | undefined;
48
+ /**
49
+ * Parse a user-typed effort argument. Recognizes the four levels plus a set of
50
+ * "off" aliases (mapped to `undefined`). Returns `null` for unrecognized input.
51
+ * Callers should handle the empty-argument case before calling this.
52
+ */
53
+ export declare function parseReasoningEffortArg(raw: string): {
54
+ value: string | undefined;
55
+ } | null;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Shared reasoning-effort helpers used by both the chat TUI and the ACP agent
3
+ * so the two front-ends cycle/set/persist effort identically.
4
+ *
5
+ * Effort is stored under a provider's `options.reasoning.effort`. Its presence
6
+ * enables thinking; the level is forwarded where the backend supports it. The
7
+ * `undefined` rung means "off" (no reasoning), so a single control can also
8
+ * disable thinking.
9
+ */
10
+ /**
11
+ * Ordered effort rungs cycled by the chat Shift+Tab shortcut and `/effort`.
12
+ * `undefined` is the "off" (no reasoning) rung.
13
+ */
14
+ export const REASONING_EFFORT_CYCLE = [
15
+ undefined,
16
+ "minimal",
17
+ "low",
18
+ "medium",
19
+ "high",
20
+ ];
21
+ /** Selectable effort levels (the {@link REASONING_EFFORT_CYCLE} minus "off"). */
22
+ export const REASONING_EFFORT_LEVELS = [
23
+ "minimal",
24
+ "low",
25
+ "medium",
26
+ "high",
27
+ ];
28
+ /** Sentinel value used to represent the "off" rung in pickers/config options. */
29
+ export const REASONING_EFFORT_OFF = "off";
30
+ /** Advance one rung through {@link REASONING_EFFORT_CYCLE}, wrapping around. */
31
+ export function nextReasoningEffort(current, direction) {
32
+ const currentIndex = REASONING_EFFORT_CYCLE.indexOf((current ?? undefined));
33
+ const from = currentIndex === -1 ? 0 : currentIndex;
34
+ const length = REASONING_EFFORT_CYCLE.length;
35
+ const nextIndex = (from + direction + length) % length;
36
+ return REASONING_EFFORT_CYCLE[nextIndex];
37
+ }
38
+ /**
39
+ * Returns provider options with `reasoning.effort` set to `nextEffort`,
40
+ * preserving sibling reasoning keys and collapsing to `undefined` when the
41
+ * reasoning object would end up empty (so we never persist `"reasoning": {}`).
42
+ */
43
+ export function withReasoningEffort(options, nextEffort) {
44
+ const base = (options ?? {});
45
+ const reasoning = base.reasoning;
46
+ const merged = { ...(reasoning ?? {}), effort: nextEffort };
47
+ const hasValues = Object.values(merged).some((value) => value !== undefined);
48
+ return { ...base, reasoning: hasValues ? merged : undefined };
49
+ }
50
+ /** Read `reasoning.effort` out of a provider's raw options object. */
51
+ export function readProviderEffort(options) {
52
+ const reasoning = options
53
+ ?.reasoning;
54
+ return reasoning?.effort;
55
+ }
56
+ /** The active (default) named LLM, falling back to the first configured one. */
57
+ export function activeLlm(config) {
58
+ return config.llms.find((entry) => entry.default) ?? config.llms[0];
59
+ }
60
+ /** Provider name backing the active LLM, if any is configured. */
61
+ export function activeProviderName(config) {
62
+ return activeLlm(config)?.provider;
63
+ }
64
+ /**
65
+ * The effort currently applied to the active model, read from the fully
66
+ * resolved provider options (so overlay/session values are reflected).
67
+ */
68
+ export function currentReasoningEffort(config) {
69
+ const active = activeLlm(config);
70
+ if (!active) {
71
+ return undefined;
72
+ }
73
+ const resolved = config.resolveLlm(active.name);
74
+ return readProviderEffort(resolved?.providerOptions);
75
+ }
76
+ /**
77
+ * Parse a user-typed effort argument. Recognizes the four levels plus a set of
78
+ * "off" aliases (mapped to `undefined`). Returns `null` for unrecognized input.
79
+ * Callers should handle the empty-argument case before calling this.
80
+ */
81
+ export function parseReasoningEffortArg(raw) {
82
+ const t = raw.trim().toLowerCase();
83
+ if (["off", "none", "disable", "disabled", "0"].includes(t)) {
84
+ return { value: undefined };
85
+ }
86
+ if (REASONING_EFFORT_LEVELS.includes(t)) {
87
+ return { value: t };
88
+ }
89
+ return null;
90
+ }
91
+ //# sourceMappingURL=reasoning-effort.js.map
@@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