@matthias-hausberger/beige 0.2.0 → 1.0.0-beta3

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 (120) hide show
  1. package/config.schema.json +23 -83
  2. package/dist/cli.d.ts +1 -1
  3. package/dist/cli.js +204 -92
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config/loader.d.ts.map +1 -1
  6. package/dist/config/loader.js +9 -49
  7. package/dist/config/loader.js.map +1 -1
  8. package/dist/config/schema.d.ts +18 -61
  9. package/dist/config/schema.d.ts.map +1 -1
  10. package/dist/config/schema.js +46 -71
  11. package/dist/config/schema.js.map +1 -1
  12. package/dist/gateway/agent-manager.d.ts +76 -5
  13. package/dist/gateway/agent-manager.d.ts.map +1 -1
  14. package/dist/gateway/agent-manager.js +400 -46
  15. package/dist/gateway/agent-manager.js.map +1 -1
  16. package/dist/gateway/api.d.ts +2 -2
  17. package/dist/gateway/api.d.ts.map +1 -1
  18. package/dist/gateway/api.js +24 -2
  19. package/dist/gateway/api.js.map +1 -1
  20. package/dist/gateway/error-logger.d.ts +52 -0
  21. package/dist/gateway/error-logger.d.ts.map +1 -0
  22. package/dist/gateway/error-logger.js +213 -0
  23. package/dist/gateway/error-logger.js.map +1 -0
  24. package/dist/gateway/gateway.d.ts +4 -5
  25. package/dist/gateway/gateway.d.ts.map +1 -1
  26. package/dist/gateway/gateway.js +74 -44
  27. package/dist/gateway/gateway.js.map +1 -1
  28. package/dist/gateway/llm-errors.d.ts +54 -0
  29. package/dist/gateway/llm-errors.d.ts.map +1 -0
  30. package/dist/gateway/llm-errors.js +208 -0
  31. package/dist/gateway/llm-errors.js.map +1 -0
  32. package/dist/gateway/policy.d.ts +2 -1
  33. package/dist/gateway/policy.d.ts.map +1 -1
  34. package/dist/gateway/policy.js +12 -3
  35. package/dist/gateway/policy.js.map +1 -1
  36. package/dist/gateway/sessions.d.ts +7 -5
  37. package/dist/gateway/sessions.d.ts.map +1 -1
  38. package/dist/gateway/sessions.js +13 -7
  39. package/dist/gateway/sessions.js.map +1 -1
  40. package/dist/gateway/system-prompt.template.md +7 -5
  41. package/dist/index.d.ts +5 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +5 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/install.d.ts +2 -3
  46. package/dist/install.d.ts.map +1 -1
  47. package/dist/install.js +14 -65
  48. package/dist/install.js.map +1 -1
  49. package/dist/plugins/context.d.ts +31 -0
  50. package/dist/plugins/context.d.ts.map +1 -0
  51. package/dist/plugins/context.js +222 -0
  52. package/dist/plugins/context.js.map +1 -0
  53. package/dist/plugins/index.d.ts +10 -0
  54. package/dist/plugins/index.d.ts.map +1 -0
  55. package/dist/plugins/index.js +7 -0
  56. package/dist/plugins/index.js.map +1 -0
  57. package/dist/plugins/installer.d.ts +80 -0
  58. package/dist/plugins/installer.d.ts.map +1 -0
  59. package/dist/{tools → plugins}/installer.js +231 -278
  60. package/dist/plugins/installer.js.map +1 -0
  61. package/dist/plugins/loader.d.ts +41 -0
  62. package/dist/plugins/loader.d.ts.map +1 -0
  63. package/dist/plugins/loader.js +136 -0
  64. package/dist/plugins/loader.js.map +1 -0
  65. package/dist/plugins/registry.d.ts +40 -0
  66. package/dist/plugins/registry.d.ts.map +1 -0
  67. package/dist/plugins/registry.js +171 -0
  68. package/dist/plugins/registry.js.map +1 -0
  69. package/dist/plugins/types.d.ts +455 -0
  70. package/dist/plugins/types.d.ts.map +1 -0
  71. package/dist/plugins/types.js +15 -0
  72. package/dist/plugins/types.js.map +1 -0
  73. package/dist/sandbox/manager.d.ts +5 -26
  74. package/dist/sandbox/manager.d.ts.map +1 -1
  75. package/dist/sandbox/manager.js +32 -53
  76. package/dist/sandbox/manager.js.map +1 -1
  77. package/dist/socket/protocol.d.ts +2 -0
  78. package/dist/socket/protocol.d.ts.map +1 -1
  79. package/dist/socket/protocol.js.map +1 -1
  80. package/dist/socket/server.d.ts +3 -1
  81. package/dist/socket/server.d.ts.map +1 -1
  82. package/dist/socket/server.js +5 -1
  83. package/dist/socket/server.js.map +1 -1
  84. package/dist/test/fixtures.d.ts +9 -7
  85. package/dist/test/fixtures.d.ts.map +1 -1
  86. package/dist/test/fixtures.js +17 -29
  87. package/dist/test/fixtures.js.map +1 -1
  88. package/dist/tools/runner.d.ts +26 -27
  89. package/dist/tools/runner.d.ts.map +1 -1
  90. package/dist/tools/runner.js +114 -11
  91. package/dist/tools/runner.js.map +1 -1
  92. package/dist/types/session.d.ts +17 -0
  93. package/dist/types/session.d.ts.map +1 -1
  94. package/dist/types/session.js +10 -14
  95. package/dist/types/session.js.map +1 -1
  96. package/package.json +2 -4
  97. package/sandbox/Dockerfile +6 -0
  98. package/sandbox/tool-client.ts +19 -0
  99. package/dist/channels/registry.d.ts +0 -14
  100. package/dist/channels/registry.d.ts.map +0 -1
  101. package/dist/channels/registry.js +0 -14
  102. package/dist/channels/registry.js.map +0 -1
  103. package/dist/channels/telegram.d.ts +0 -92
  104. package/dist/channels/telegram.d.ts.map +0 -1
  105. package/dist/channels/telegram.js +0 -469
  106. package/dist/channels/telegram.js.map +0 -1
  107. package/dist/tools/installer.d.ts +0 -93
  108. package/dist/tools/installer.d.ts.map +0 -1
  109. package/dist/tools/installer.js.map +0 -1
  110. package/dist/tools/registry.d.ts +0 -20
  111. package/dist/tools/registry.d.ts.map +0 -1
  112. package/dist/tools/registry.js +0 -124
  113. package/dist/tools/registry.js.map +0 -1
  114. package/tools/README.md +0 -1
  115. package/tools/kv/README.md +0 -150
  116. package/tools/kv/index.ts +0 -154
  117. package/tools/kv/tool.json +0 -23
  118. package/tools/message/README.md +0 -53
  119. package/tools/message/index.ts +0 -183
  120. package/tools/message/tool.json +0 -11
@@ -5,7 +5,6 @@
5
5
  "type": "object",
6
6
  "required": [
7
7
  "llm",
8
- "tools",
9
8
  "agents"
10
9
  ],
11
10
  "properties": {
@@ -59,37 +58,28 @@
59
58
  }
60
59
  }
61
60
  },
62
- "tools": {
63
- "description": "Tool registry. Each key becomes the tool name used in agent configs and /tools/bin/.",
61
+ "plugins": {
62
+ "description": "Plugin registry. Each key becomes the plugin name. Plugins can provide tools, channels, hooks, and skills.",
64
63
  "type": "object",
65
64
  "patternProperties": {
66
65
  "^(.*)$": {
67
- "title": "ToolConfig",
66
+ "title": "PluginConfig",
68
67
  "type": "object",
69
68
  "properties": {
70
69
  "path": {
71
- "description": "Path to the tool package directory. Resolved relative to the config file unless absolute. Auto-resolved for tools installed via 'beige tools install'.",
70
+ "description": "Path to the plugin package directory. Resolved relative to the config file unless absolute.",
72
71
  "type": "string"
73
72
  },
74
- "target": {
75
- "description": "\"gateway\" runs the handler on the host process. \"sandbox\" is planned. Auto-resolved for tools installed via 'beige tools install'.",
76
- "anyOf": [
77
- {
78
- "const": "gateway",
79
- "type": "string"
80
- },
81
- {
82
- "const": "sandbox",
83
- "type": "string"
84
- }
85
- ]
86
- },
87
73
  "config": {
88
- "description": "Arbitrary config object passed to createHandler(config) at startup",
74
+ "description": "Arbitrary config object passed to createPlugin(config, ctx) at startup",
89
75
  "type": "object",
90
76
  "patternProperties": {
91
77
  "^(.*)$": {}
92
78
  }
79
+ },
80
+ "_source": {
81
+ "description": "Install source (e.g. 'npm:@scope/package'). Written by 'beige plugins install', used by 'beige plugins update'. Do not edit manually.",
82
+ "type": "string"
93
83
  }
94
84
  }
95
85
  }
@@ -166,6 +156,11 @@
166
156
  "type": "string"
167
157
  }
168
158
  ]
159
+ },
160
+ "compactionThreshold": {
161
+ "description": "Context token count at which auto-compaction triggers for this model. Must be less than the model's context window. When set, compaction kicks in earlier than the default (contextWindow − 16384 tokens). Example: set to 100000 on a 200k-window model to compact at 100k tokens.",
162
+ "minimum": 1,
163
+ "type": "number"
169
164
  }
170
165
  }
171
166
  },
@@ -212,19 +207,24 @@
212
207
  "type": "string"
213
208
  }
214
209
  ]
210
+ },
211
+ "compactionThreshold": {
212
+ "description": "Context token count at which auto-compaction triggers for this model. Must be less than the model's context window. When set, compaction kicks in earlier than the default (contextWindow − 16384 tokens). Example: set to 100000 on a 200k-window model to compact at 100k tokens.",
213
+ "minimum": 1,
214
+ "type": "number"
215
215
  }
216
216
  }
217
217
  }
218
218
  },
219
219
  "tools": {
220
- "description": "Tool names from the tools registry that this agent can invoke",
220
+ "description": "Tool names registered by plugins that this agent can invoke",
221
221
  "type": "array",
222
222
  "items": {
223
223
  "type": "string"
224
224
  }
225
225
  },
226
226
  "skills": {
227
- "description": "Skill names from the skills registry mounted into this agent's sandbox",
227
+ "description": "Skill names (from skills registry or plugin-registered) mounted into this agent's sandbox",
228
228
  "type": "array",
229
229
  "items": {
230
230
  "type": "string"
@@ -262,8 +262,8 @@
262
262
  }
263
263
  }
264
264
  },
265
- "toolConfigs": {
266
- "description": "Per-agent tool config overrides. Keys must reference tools in this agent's tools array. Values are deep-merged with the top-level tool config from config.tools.<name>.config.",
265
+ "pluginConfigs": {
266
+ "description": "Per-agent plugin config overrides. Keys must reference plugins in the plugins registry. Values are deep-merged with the top-level plugin config from config.plugins.<name>.config.",
267
267
  "type": "object",
268
268
  "patternProperties": {
269
269
  "^(.*)$": {
@@ -295,66 +295,6 @@
295
295
  "type": "string"
296
296
  }
297
297
  }
298
- },
299
- "channels": {
300
- "title": "ChannelsConfig",
301
- "type": "object",
302
- "properties": {
303
- "telegram": {
304
- "title": "TelegramChannelConfig",
305
- "type": "object",
306
- "required": [
307
- "enabled",
308
- "token",
309
- "allowedUsers",
310
- "agentMapping"
311
- ],
312
- "properties": {
313
- "enabled": {
314
- "description": "Set to true to activate the Telegram bot",
315
- "type": "boolean"
316
- },
317
- "token": {
318
- "description": "Telegram bot token from @BotFather. Use \"${TELEGRAM_BOT_TOKEN}\".",
319
- "type": "string"
320
- },
321
- "allowedUsers": {
322
- "description": "Telegram user IDs permitted to interact with the bot. All others are silently ignored.",
323
- "type": "array",
324
- "items": {
325
- "type": "number"
326
- }
327
- },
328
- "agentMapping": {
329
- "description": "Maps Telegram chats to agents",
330
- "type": "object",
331
- "required": [
332
- "default"
333
- ],
334
- "properties": {
335
- "default": {
336
- "description": "Agent name that handles all incoming messages",
337
- "type": "string"
338
- }
339
- }
340
- },
341
- "defaults": {
342
- "title": "ChannelDefaultSettings",
343
- "type": "object",
344
- "properties": {
345
- "verbose": {
346
- "description": "Send a notification for every tool call the agent makes (e.g. 🔧 exec: ls). Default: false",
347
- "type": "boolean"
348
- },
349
- "streaming": {
350
- "description": "Stream responses to the user in real-time. Default: true",
351
- "type": "boolean"
352
- }
353
- }
354
- }
355
- }
356
- }
357
- }
358
298
  }
359
299
  }
360
300
  }
package/dist/cli.d.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * beige gateway logs Show gateway logs
13
13
  * beige gateway logs -f Follow gateway logs (tail -f)
14
14
  * beige tui [agent] Connect to a running gateway via TUI
15
- * beige tools <command> Manage tools (install, list, update, remove)
15
+ * beige plugins <command> Manage plugins (install, list, update, remove)
16
16
  * beige --config <path> Use a specific config file
17
17
  *
18
18
  * Shell 1: beige ← starts gateway daemon