@stratusagent/agents 0.11.9 → 0.11.10

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.
@@ -5,12 +5,20 @@ export declare const MESSAGE_SEND_TOOL_NAME = "message.send";
5
5
  * Delivers one outbound message through the agent's channel. The gateway
6
6
  * implements it over the channel contract's `resolveOutbound`; rejecting is
7
7
  * the way to say a destination cannot be served.
8
+ *
9
+ * Resolves with the channel-native id of the message it posted when the
10
+ * channel reports one (Slack: its `ts`), which is what lets an agent reply
11
+ * under its own post later — the id is the thread to name.
8
12
  */
9
13
  export type OutboundMessenger = (input: {
10
14
  agentId: string;
11
15
  destination: ScheduleDestination;
12
16
  text: string;
13
- }) => Promise<void>;
17
+ /** Channel-native id of the message to reply under, for a threaded post. */
18
+ thread?: string;
19
+ }) => Promise<{
20
+ id?: string;
21
+ } | void>;
14
22
  /**
15
23
  * Post to a channel or DM outside the current conversation — what makes a
16
24
  * scheduled turn observable.
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/tools/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EACL,KAAK,mBAAmB,EAIzB,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,mBAAmB,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,iBAAiB,KAAG,IA+B9D,CAAC;AAEH,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,MAAM,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NAME,
16
- description: 'Send a message to a channel or DM you are not currently talking in. Scheduled turns may post to their schedule\'s approved destination without asking; anywhere else needs approval.',
16
+ description: 'Send a message to a channel or DM you are not currently talking in, at the top level or as a reply in one of its threads. '
17
+ + 'Returns the posted message\'s id, and the thread to name to reply under it: '
18
+ + 'pass that returned thread (never a reply\'s id) to every later send in the same thread. '
19
+ + 'Scheduled turns may post to their schedule\'s approved destination without asking; anywhere else needs approval.',
17
20
  risk: 'gated',
18
21
  parameters: {
19
22
  type: 'object',
@@ -23,6 +26,10 @@ export const createMessageSendTool = (send) => ({
23
26
  description: 'Where to post: the channel kind plus the channel-native conversation id.',
24
27
  },
25
28
  text: { type: 'string', description: 'The message text.' },
29
+ thread: {
30
+ type: 'string',
31
+ description: 'The id of a message in that conversation to reply under (for Slack, its ts, e.g. 1791332967.606559). Omit to post at the top level.',
32
+ },
26
33
  },
27
34
  required: ['destination', 'text'],
28
35
  },
@@ -39,8 +46,25 @@ export const createMessageSendTool = (send) => ({
39
46
  if (!text) {
40
47
  throw new Error('message.send requires a non-empty "text".');
41
48
  }
42
- await send({ agentId: session.agent.id, destination, text });
43
- return { sent: true, destination: canonicalDestination(destination) };
49
+ const thread = optionalId(input, 'thread', MESSAGE_SEND_TOOL_NAME);
50
+ const posted = await send({
51
+ agentId: session.agent.id,
52
+ destination,
53
+ text,
54
+ ...(thread !== undefined ? { thread } : {}),
55
+ });
56
+ const id = posted && typeof posted.id === 'string' && posted.id.length > 0 ? posted.id : undefined;
57
+ // The thread a reply to this post names: the root it went under, or,
58
+ // for a top-level post, the post itself. Always the root, because a
59
+ // reply's own id is not a thread to Slack — chaining sends through
60
+ // each reply's id would leave the thread after the second one.
61
+ const root = thread ?? id;
62
+ return {
63
+ sent: true,
64
+ destination: canonicalDestination(destination),
65
+ ...(id !== undefined ? { id } : {}),
66
+ ...(root !== undefined ? { thread: root } : {}),
67
+ };
44
68
  },
45
69
  });
46
70
  export const MESSAGE_READ_TOOL_NAME = 'message.read';
@@ -57,13 +81,13 @@ const MESSAGE_READ_DEFAULT_LIMIT = 50;
57
81
  */
58
82
  export const MESSAGE_READ_TEXT_BUDGET = 40_000;
59
83
  const TRUNCATED_MARK = ' [... the rest of this message is not shown]';
60
- const optionalId = (input, key) => {
84
+ const optionalId = (input, key, tool = MESSAGE_READ_TOOL_NAME) => {
61
85
  const value = input[key];
62
86
  if (value === undefined || value === null) {
63
87
  return undefined;
64
88
  }
65
89
  if (typeof value !== 'string' || value.trim().length === 0) {
66
- throw new Error(`message.read: "${key}" must be a non-empty string when given.`);
90
+ throw new Error(`${tool}: "${key}" must be a non-empty string when given.`);
67
91
  }
68
92
  return value.trim();
69
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/tools/message.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAarD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAuB,EAAQ,EAAE,CAAC,CAAC;IACvE,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sLAAsL;IACnM,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,GAAG,qBAAqB;gBACxB,WAAW,EAAE,0EAA0E;aACxF;YACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;SAC3D;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;KAClC;IACD,cAAc,CAAC,KAAiB;QAC9B,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7D,OAAO,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAA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,CAAC,EAAE,CAAC;iBACvF,CAAC;gBACF,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;YACD,IAAI,GAAG,IAAI,CAAC;YACZ,MAAM;QACR,CAAC;QACD,OAAO;YACL,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC;YACpC,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,KAAK,EAAE,QAAQ,CAAC,MAAM;YACtB,IAAI;YACJ,QAAQ;SACK,CAAC;IAClB,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stratusagent/agents",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "node": ">=22.13 <23 || >=23.4"
19
19
  },
20
20
  "dependencies": {
21
- "@stratusagent/core": "0.11.9"
21
+ "@stratusagent/core": "0.11.10"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^24.6.0",
@@ -54,7 +54,7 @@ The config decides which provider and model run, which plugins load, and how app
54
54
 
55
55
  Which provider and model a turn uses: for `stratus run` and `stratus chat`, command-line flags beat `STRATUS_*` environment variables, which beat the soul's `provider`/`model`, which beat the file. Under `stratus serve` a soul's `provider`/`model` beats all of those, because each agent in a roster runs on its own. A changed `provider` or `model` in the config reaches the next turn without a restart.
56
56
 
57
- A project-local `stratus.config.json` ships inside repositories, so it is **untrusted**. It cannot set `plugins`, `approvals`, `principals`, `slack`, `api`, `maxTurns`, `agentMaxTurns`, `apiKeyEnv`, `soul`, `systemPrompt`, `executor`, or `memoryStore`. Those are read only from `~/.stratus/config.json` or a file named by `--config` or `STRATUS_CONFIG`. A project-local file that sets one of them has it ignored, with a warning. For `principals`, `slack`, `maxTurns`, `executor`, and `memoryStore` the daemon uses `~/.stratus/config.json`'s instead; for `plugins`, `approvals`, and `api` it uses none. A project-local file that says nothing about one of those eight leaves the global one in force.
57
+ A project-local `stratus.config.json` ships inside repositories, so it is **untrusted**. It cannot set `plugins`, `approvals`, `principals`, `slack`, `api`, `maxTurns`, `agentMaxTurns`, `autoContinue`, `apiKeyEnv`, `soul`, `systemPrompt`, `executor`, or `memoryStore`. Those are read only from `~/.stratus/config.json` or a file named by `--config` or `STRATUS_CONFIG`. A project-local file that sets one of them has it ignored, with a warning. For `principals`, `slack`, `maxTurns`, `executor`, and `memoryStore` the daemon uses `~/.stratus/config.json`'s instead; for `plugins`, `approvals`, and `api` it uses none. A project-local file that says nothing about one of those eight leaves the global one in force.
58
58
 
59
59
  When a setting "isn't taking", these say why:
60
60
 
@@ -167,7 +167,7 @@ When a stored key "isn't found", check in this order:
167
167
 
168
168
  ## When a reply stops or changes model
169
169
 
170
- - **"Out of steps."** One message may take `maxTurns` rounds of tool calls (default 40, set in the trusted config, restart to change). Past that you are told you are out of steps, get one last call with no tools, and answer with what you did and what is left. Replying "continue" carries on with a fresh allowance. An agent that does long work should have its own budget raised with `agentMaxTurns: { "<id>": 300 }` in the trusted config (restart to change), which leaves the rest of the fleet on `maxTurns`.
170
+ - **"Out of steps."** One message may take `maxTurns` rounds of tool calls (default 40, set in the trusted config, restart to change). Past that you are told you are out of steps, get one last call with no tools, and answer with what you did and what is left. Replying "continue" carries on with a fresh allowance. An agent that does long work should have its own budget raised with `agentMaxTurns: { "<id>": 300 }` in the trusted config (restart to change), which leaves the rest of the fleet on `maxTurns`. With `autoContinue: { "<id>": true }` (or a number, to cap it) an agent is given another budget instead of stopping to ask, until its work is done, its cap is reached, or someone sends it another message meanwhile. Under a kernel-driven provider (Anthropic, OpenAI-compatible), it also stops when stuck on a repeating failure; the `claude-code` runtime runs its own loop and does not have that check, so an uncapped claude-code agent relies on the cap or a new message to stop. It applies to the built-in model loop and the `claude-code` runtime, not yet to `codex`.
171
171
  - **Stopped with no reply.** On a provider that streams (Anthropic, Codex, and plugin providers that say they stream), the daemon's watchdog aborts a turn when the model reports nothing for `--idle-timeout` seconds (default 120). On one that does not, such as an OpenAI-compatible endpoint, there is no watchdog, and a silent request ends only when the provider's own request fails or times out, so `--idle-timeout` neither explains nor fixes it. The session ends failed, with `no activity for 120000ms`, and `stratus logs --agent <id>` names the last thing it heard. A tool that is running, or a call waiting on an approval, never trips it.
172
172
  - **Cut off at the output cap.** A reply longer than the model may write in one turn fails rather than being posted half-finished, and the error says so. With an Anthropic API key that cap is `maxTokens` in the config (default 16000); a Claude subscription run does not take that setting, so raising it changes nothing there. Offer a shorter answer, or, on an API key, ask for the cap to be raised. Never ask for a longer timeout.
173
173
  - **Answering on another model.** When the configured model fails a request and a `fallbackModel` is set, that conversation switches to the fallback and stays on it, even across restarts, so it never silently swaps back. Not every failure switches: a conversation too long for the window is trimmed and retried on the same model, a cancelled turn just stops, and a Codex or Claude subscription turn that fails after its tools already ran surfaces the error instead, since a retry elsewhere would run them twice. Those leave the conversation on the configured model, with nothing to roll over. Your instructions say when you are on the fallback. `stratus logs` shows the error that caused the switch, and `stratus session rollover <session id>` starts the conversation over on the configured model.