agent-sh 0.13.7 → 0.14.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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/agent/agent-loop.d.ts +13 -17
  3. package/dist/agent/agent-loop.js +118 -224
  4. package/dist/agent/conversation-state.d.ts +1 -1
  5. package/dist/agent/events.d.ts +218 -0
  6. package/dist/agent/events.js +1 -0
  7. package/dist/agent/host-types.d.ts +20 -0
  8. package/dist/agent/index.d.ts +5 -9
  9. package/dist/agent/index.js +269 -167
  10. package/dist/agent/llm-facade.d.ts +13 -0
  11. package/dist/{utils → agent}/llm-facade.js +1 -1
  12. package/dist/agent/nuclear-form.d.ts +1 -1
  13. package/dist/agent/providers/deepseek.js +2 -5
  14. package/dist/agent/providers/openai-compatible.js +2 -2
  15. package/dist/agent/providers/openai.js +2 -5
  16. package/dist/agent/providers/openrouter.js +5 -5
  17. package/dist/agent/subagent.d.ts +1 -1
  18. package/dist/agent/tool-protocol.d.ts +1 -1
  19. package/dist/agent/tool-registry.d.ts +1 -1
  20. package/dist/cli/auth/cli.js +11 -6
  21. package/dist/cli/auth/discover.d.ts +5 -0
  22. package/dist/cli/auth/discover.js +25 -0
  23. package/dist/cli/auth/keys.d.ts +5 -2
  24. package/dist/cli/auth/keys.js +22 -2
  25. package/dist/cli/index.d.ts +16 -0
  26. package/dist/cli/index.js +12 -2
  27. package/dist/core/event-bus.d.ts +28 -371
  28. package/dist/core/extension-loader.js +6 -6
  29. package/dist/core/index.d.ts +10 -29
  30. package/dist/core/index.js +32 -84
  31. package/dist/extensions/index.d.ts +2 -1
  32. package/dist/extensions/index.js +1 -1
  33. package/dist/extensions/slash-commands/events.d.ts +18 -0
  34. package/dist/extensions/slash-commands/events.js +1 -0
  35. package/dist/extensions/slash-commands/index.d.ts +15 -0
  36. package/dist/extensions/{slash-commands.js → slash-commands/index.js} +4 -3
  37. package/dist/shell/events.d.ts +85 -0
  38. package/dist/shell/events.js +1 -0
  39. package/dist/shell/index.d.ts +1 -0
  40. package/dist/shell/index.js +6 -0
  41. package/dist/shell/tui-renderer.js +0 -1
  42. package/examples/extensions/ash-acp-bridge/src/index.ts +2 -2
  43. package/examples/extensions/ashi/package.json +1 -1
  44. package/examples/extensions/ollama.ts +47 -42
  45. package/examples/extensions/opencode-bridge/README.md +4 -0
  46. package/examples/extensions/opencode-bridge/index.ts +3 -1
  47. package/examples/extensions/pi-bridge/index.ts +3 -4
  48. package/examples/extensions/zai-coding-plan.ts +2 -6
  49. package/package.json +1 -1
  50. package/dist/extensions/slash-commands.d.ts +0 -2
  51. package/dist/utils/llm-facade.d.ts +0 -11
  52. /package/dist/{utils → agent}/llm-client.d.ts +0 -0
  53. /package/dist/{utils → agent}/llm-client.js +0 -0
@@ -25,14 +25,10 @@ function buildReasoningParams(level: string, _model?: string): Record<string, un
25
25
 
26
26
  export default function activate(ctx: AgentContext): void {
27
27
  const { key } = resolveApiKey(ID);
28
- const apiKey = key ?? process.env.ZAI_API_KEY ?? process.env.ZHIPU_API_KEY;
29
- if (!apiKey) return;
30
-
31
28
  ctx.agent.providers.configure(ID, { reasoningParams: buildReasoningParams });
32
-
33
- ctx.bus.emit("provider:register", {
29
+ ctx.agent.providers.register({
34
30
  id: ID,
35
- apiKey: apiKey,
31
+ apiKey: key ?? process.env.ZAI_API_KEY ?? process.env.ZHIPU_API_KEY,
36
32
  baseURL: BASE_URL,
37
33
  defaultModel: DEFAULT_MODELS[0].id,
38
34
  models: DEFAULT_MODELS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-sh",
3
- "version": "0.13.7",
3
+ "version": "0.14.0",
4
4
  "description": "A shell-first terminal where AI is one keystroke away",
5
5
  "type": "module",
6
6
  "main": "dist/core/index.js",
@@ -1,2 +0,0 @@
1
- import type { ExtensionContext } from "../shell/host-types.js";
2
- export default function activate(ctx: ExtensionContext): void;
@@ -1,11 +0,0 @@
1
- /**
2
- * ctx.llm facade — delegates to an `llm:invoke` handler registered by the
3
- * active backend. No handler → `available` is false and calls reject.
4
- */
5
- import type { LlmInterface } from "../agent/host-types.js";
6
- interface HandlerGate {
7
- list: () => string[];
8
- call: (name: string, ...args: unknown[]) => unknown;
9
- }
10
- export declare function createLlmFacade(handlers: HandlerGate): LlmInterface;
11
- export {};
File without changes
File without changes