@holon-run/agentinbox 1.0.4 → 1.0.5

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.
@@ -302,6 +302,30 @@ class RemoteSourceRuntime {
302
302
  }
303
303
  return module.summarizeDigestThread(items, moduleInputSource(source), grouping);
304
304
  }
305
+ async listSourceOperations(source) {
306
+ if (!REMOTE_SOURCE_TYPES.has(source.sourceType)) {
307
+ return [];
308
+ }
309
+ const module = await this.moduleRegistry.resolve(source, this.homeDir);
310
+ if (typeof module.listSourceOperations !== "function") {
311
+ return [];
312
+ }
313
+ return module.listSourceOperations({ source: moduleInputSource(source) });
314
+ }
315
+ async invokeSourceOperation(source, operation, input) {
316
+ if (!REMOTE_SOURCE_TYPES.has(source.sourceType)) {
317
+ throw new Error(`source operations are not supported for source type ${source.sourceType}`);
318
+ }
319
+ const module = await this.moduleRegistry.resolve(source, this.homeDir);
320
+ if (typeof module.invokeSourceOperation !== "function") {
321
+ throw new Error(`source operations are not supported for source type ${source.sourceType}`);
322
+ }
323
+ return module.invokeSourceOperation({
324
+ source: moduleInputSource(source),
325
+ operation,
326
+ input,
327
+ });
328
+ }
305
329
  async syncAll() {
306
330
  const sources = this.store
307
331
  .listSources()
@@ -111,6 +111,8 @@ function validateModuleContract(module, sourcePath) {
111
111
  validateOptionalHook(module.deriveNotificationGrouping, "deriveNotificationGrouping", sourcePath);
112
112
  validateOptionalHook(module.listDeliveryOperations, "listDeliveryOperations", sourcePath);
113
113
  validateOptionalHook(module.invokeDeliveryOperation, "invokeDeliveryOperation", sourcePath);
114
+ validateOptionalHook(module.listSourceOperations, "listSourceOperations", sourcePath);
115
+ validateOptionalHook(module.invokeSourceOperation, "invokeSourceOperation", sourcePath);
114
116
  validateOptionalHook(module.summarizeDigestThread, "summarizeDigestThread", sourcePath);
115
117
  }
116
118
  function validateOptionalHook(value, name, sourcePath) {
@@ -469,18 +471,22 @@ const FEISHU_BOT_MODULE = {
469
471
  async invokeDeliveryOperation(input) {
470
472
  return (0, feishu_1.invokeFeishuDeliveryOperation)(input.handle, input.operation, input.input);
471
473
  },
474
+ listSourceOperations() {
475
+ return (0, feishu_1.feishuSourceOperations)();
476
+ },
477
+ async invokeSourceOperation(input) {
478
+ return (0, feishu_1.invokeFeishuSourceOperation)(input.source, input.operation, input.input);
479
+ },
472
480
  describeCapabilities() {
473
481
  return {
474
482
  sourceKind: "feishu_bot",
475
483
  aliases: ["feishu_bot"],
476
484
  configSchema: [
477
- { name: "appId", type: "string", required: true, description: "Feishu app ID." },
478
- { name: "appSecret", type: "string", required: true, description: "Feishu app secret." },
485
+ { name: "uxcAuth", type: "string", required: false, description: "Optional UXC auth profile for the Feishu/Lark app." },
479
486
  { name: "eventTypes", type: "string[]", required: false, description: "Optional Feishu event type allowlist." },
480
487
  { name: "chatIds", type: "string[]", required: false, description: "Optional Feishu chat allowlist." },
481
488
  { name: "schemaUrl", type: "string", required: false, description: "Optional Feishu OpenAPI schema URL." },
482
489
  { name: "replyInThread", type: "boolean", required: false, description: "Reply in thread when sending outbound messages." },
483
- { name: "uxcAuth", type: "string", required: false, description: "Optional uxc auth profile." },
484
490
  ],
485
491
  metadataFields: [
486
492
  { name: "eventType", type: "string", description: "Feishu event type." },
@@ -502,6 +508,12 @@ const FEISHU_BOT_MODULE = {
502
508
  validateConfig(source) {
503
509
  (0, feishu_1.parseFeishuSourceConfig)(source);
504
510
  },
511
+ listFollowTemplates() {
512
+ return (0, feishu_1.feishuFollowTemplateSpec)();
513
+ },
514
+ async expandFollowTemplate(input) {
515
+ return (0, feishu_1.expandFeishuFollowTemplate)(input);
516
+ },
505
517
  buildManagedSourceSpec(source) {
506
518
  const config = (0, feishu_1.parseFeishuSourceConfig)(source);
507
519
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holon-run/agentinbox",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Local event subscription and delivery service for agents.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -45,6 +45,7 @@
45
45
  "dependencies": {
46
46
  "@fastify/swagger": "^9.5.2",
47
47
  "@holon-run/uxc-daemon-client": "^0.15.4",
48
+ "commander": "^14.0.3",
48
49
  "fastify": "^5.6.1",
49
50
  "jexl": "^2.3.0",
50
51
  "sql.js": "^1.13.0"
package/skills/README.md CHANGED
@@ -7,12 +7,12 @@ For `AgentInbox`, the preferred first-run path is skill-first onboarding:
7
7
 
8
8
  - hand the bundled `AgentInbox` skill to the agent
9
9
  - let the agent verify `agentinbox`, `uxc`, and GitHub auth
10
- - let the agent register the current session and set up standing subscriptions
10
+ - let the agent register the current runtime/session and set up standing subscriptions
11
11
 
12
12
  <!-- INDEX:START -->
13
13
 
14
14
  - [agentinbox](./agentinbox/)
15
- Use the local AgentInbox service to onboard the current session, connect GitHub through UXC, and operate sources, subscriptions, and the agent inbox.
15
+ Use the local AgentInbox service to onboard the current runtime/session, manage shared sources and subscriptions, connect external providers such as GitHub through UXC, and operate the agent inbox.
16
16
  <!-- mdorigin:index kind=article -->
17
17
 
18
18
  <!-- INDEX:END -->
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: agentinbox
3
- description: Use the local AgentInbox service to onboard the current session, manage shared sources and subscriptions, connect external providers such as GitHub through UXC, and operate the agent inbox.
3
+ description: Use the local AgentInbox service to onboard the current runtime/session, manage shared sources and subscriptions, connect external providers such as GitHub through UXC, and operate the agent inbox.
4
4
  metadata:
5
5
  short-description: Operate AgentInbox sources and subscriptions
6
6
  ---
7
7
 
8
8
  # AgentInbox Skill
9
9
 
10
- Use this skill when the current agent should set up or use the local
11
- `agentinbox` daemon.
10
+ Use this skill when a Codex, Claude Code, Holon, or other supported agent
11
+ runtime should set up or use the local `agentinbox` daemon.
12
12
 
13
13
  Primary docs:
14
14
 
@@ -41,7 +41,7 @@ UXC repository:
41
41
  Recommended first-run sequence:
42
42
 
43
43
  1. if GitHub access is needed and `gh` is already authenticated, import that auth into `uxc`
44
- 2. register the current terminal session
44
+ 2. register the current runtime/session
45
45
  3. follow the required sources or resources using the docs examples
46
46
 
47
47
  If GitHub-backed adapters are needed:
@@ -53,12 +53,21 @@ uxc auth credential import github --from gh
53
53
 
54
54
  This `gh` import path requires `uxc` 0.15.3 or newer.
55
55
 
56
- Register the current terminal/runtime session:
56
+ Register the current runtime/session:
57
57
 
58
58
  ```bash
59
59
  agentinbox agent register
60
60
  ```
61
61
 
62
+ In Holon, the no-arg form uses `HOLON_AGENT_ID` and
63
+ `HOLON_EXTERNAL_TRIGGER_URL` when they are available and registers a webhook
64
+ activation target. If the trigger URL is not in the environment, pass it
65
+ explicitly:
66
+
67
+ ```bash
68
+ agentinbox agent register --agent-id <holonAgentId> --webhook-url <externalTriggerUrl>
69
+ ```
70
+
62
71
  Treat the returned `agentId` as the stable identity for later commands.
63
72
 
64
73
  ## Usage Discipline
@@ -96,19 +105,19 @@ Typical cases:
96
105
 
97
106
  Important boundary:
98
107
 
99
- - inbox items, subscriptions, and timers can outlive the current terminal
108
+ - inbox items, subscriptions, and timers can outlive the current runtime
100
109
  session
101
- - terminal delivery does not automatically survive session boundaries just
102
- because the inbox state does
103
- - if the original runtime/terminal disappears, items may keep accumulating in
104
- the inbox while notifications stop reaching you
110
+ - activation delivery does not automatically survive every session boundary
111
+ just because the inbox state does
112
+ - if the original runtime/terminal or webhook trigger disappears, items may
113
+ keep accumulating in the inbox while notifications stop reaching you
105
114
  - if a later session should resume the same logical agent, re-register or
106
- explicitly rebind that agent to the current terminal before assuming prompt
107
- delivery is live again
115
+ explicitly rebind that agent to the current terminal or webhook target
116
+ before assuming prompt delivery is live again
108
117
 
109
118
  Lifecycle:
110
119
 
111
- 1. register once per live terminal/runtime session
120
+ 1. register once per live runtime/session
112
121
  2. reuse broad shared sources
113
122
  3. add narrow task-scoped follows, subscriptions, or timers
114
123
  4. read inbox items in bounded batches and ack only the reviewed batch
@@ -117,6 +126,9 @@ Lifecycle:
117
126
  For PR and review workflows, prefer `follow` templates. They reuse shared
118
127
  sources, expand the source-specific filters, and attach cleanup behavior:
119
128
 
129
+ For Holon, ensure `HOLON_EXTERNAL_TRIGGER_URL` is set or use `--webhook-url`
130
+ when registering.
131
+
120
132
  ```bash
121
133
  agentinbox agent register
122
134
  agentinbox follow github pr --agent-id <agentId> --arg owner=holon-run --arg repo=agentinbox --arg number=87 --arg withCi=true
@@ -154,6 +166,33 @@ Use `follow` as the default path for GitHub repo, PR, and issue tracking. Drop
154
166
  to `source schema` plus `subscription add` only when you need a custom filter or
155
167
  the source has no follow template.
156
168
 
169
+ Feishu/Lark follows require a UXC credential that can host the Feishu app
170
+ connection. For bot mention workflows, prefer the global mention template so
171
+ the user does not need to discover a group `chat_id` or bot `open_id` first:
172
+
173
+ ```bash
174
+ agentinbox follow feishu mentions --agent-id <agentId> --config-json '{"uxcAuth":"feishu-default"}'
175
+ ```
176
+
177
+ When `openId` is omitted, `AgentInbox` resolves the configured app bot's
178
+ `open_id` through UXC before creating the subscription. Pass `--arg
179
+ openId=<openId>` only when following mentions for a different user or bot.
180
+
181
+ Use the chat-scoped templates when the task is explicitly limited to one group:
182
+
183
+ ```bash
184
+ agentinbox follow feishu chat --agent-id <agentId> --arg chatId=<chatId> --config-json '{"uxcAuth":"feishu-default"}'
185
+ agentinbox follow feishu mention --agent-id <agentId> --arg chatId=<chatId> --arg openId=<botOpenId> --config-json '{"uxcAuth":"feishu-default"}'
186
+ ```
187
+
188
+ Feishu inbox items include `metadata.chatId`, `metadata.messageId`, and a
189
+ `deliveryHandle`. Use `source invoke` for local context before replying:
190
+
191
+ ```bash
192
+ agentinbox source invoke <sourceId> --operation get_message_context --input-json '{"messageId":"<messageId>","chatId":"<chatId>","windowBefore":5,"windowAfter":5}'
193
+ agentinbox deliver invoke --handle-json '<deliveryHandle-json>' --operation send_text --input-json '{"text":"Acknowledged","uxcAuth":"feishu-default"}'
194
+ ```
195
+
157
196
  Advanced source/subscription commands:
158
197
 
159
198
  ```bash
@@ -206,6 +245,11 @@ agentinbox timer remove <scheduleId>
206
245
 
207
246
  Activation targets:
208
247
 
248
+ `agent register` normally creates or refreshes the current runtime activation
249
+ target automatically: a terminal target for terminal-backed runtimes, or a
250
+ webhook target for Holon when a trigger URL is available. Add manual activation
251
+ targets only when needed:
252
+
209
253
  ```bash
210
254
  agentinbox agent target list <agentId>
211
255
  agentinbox agent target add webhook <agentId> --url http://127.0.0.1:8787/webhook
@@ -220,13 +264,14 @@ instead of re-explaining the full architecture here.
220
264
  Do not start every task by checking daemon status; normal CLI commands should
221
265
  auto-connect or surface actionable errors. Use these checks after the first
222
266
  AgentInbox command fails, notifications stop arriving, or you suspect a stale
223
- terminal binding:
267
+ terminal or webhook binding:
224
268
 
225
269
  ```bash
226
270
  agentinbox --version
227
271
  agentinbox daemon status
228
272
  agentinbox daemon start
229
273
  agentinbox agent register --agent-id <agentId> --force-rebind
274
+ agentinbox agent register --agent-id <holonAgentId> --webhook-url <externalTriggerUrl> --force-rebind
230
275
  ```
231
276
 
232
277
  If GitHub-backed sources fail, verify UXC and imported GitHub auth only after