@animalabs/agent-framework 0.19.0 → 0.20.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.
- package/README.md +29 -0
- package/dist/src/agent.d.ts +22 -0
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +128 -10
- package/dist/src/agent.js.map +1 -1
- package/dist/src/api/types.d.ts +1 -1
- package/dist/src/api/types.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.d.ts +10 -1
- package/dist/src/code-execution/py-runner.d.ts.map +1 -1
- package/dist/src/code-execution/py-runner.js +27 -2
- package/dist/src/code-execution/py-runner.js.map +1 -1
- package/dist/src/code-execution/tool-definition.d.ts +21 -0
- package/dist/src/code-execution/tool-definition.d.ts.map +1 -1
- package/dist/src/code-execution/tool-definition.js +34 -0
- package/dist/src/code-execution/tool-definition.js.map +1 -1
- package/dist/src/framework.d.ts +153 -2
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +1169 -76
- package/dist/src/framework.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/capability-grant.d.ts +1 -1
- package/dist/src/mcpl/capability-grant.d.ts.map +1 -1
- package/dist/src/mcpl/capability-grant.js +49 -5
- package/dist/src/mcpl/capability-grant.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +59 -2
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +106 -6
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/index.d.ts +3 -0
- package/dist/src/mcpl/index.d.ts.map +1 -1
- package/dist/src/mcpl/index.js +3 -0
- package/dist/src/mcpl/index.js.map +1 -1
- package/dist/src/mcpl/push-coalescer.d.ts +318 -0
- package/dist/src/mcpl/push-coalescer.d.ts.map +1 -0
- package/dist/src/mcpl/push-coalescer.js +709 -0
- package/dist/src/mcpl/push-coalescer.js.map +1 -0
- package/dist/src/mcpl/push-handler.d.ts +7 -2
- package/dist/src/mcpl/push-handler.d.ts.map +1 -1
- package/dist/src/mcpl/push-handler.js +43 -4
- package/dist/src/mcpl/push-handler.js.map +1 -1
- package/dist/src/mcpl/server-connection.d.ts +18 -0
- package/dist/src/mcpl/server-connection.d.ts.map +1 -1
- package/dist/src/mcpl/server-connection.js +44 -1
- package/dist/src/mcpl/server-connection.js.map +1 -1
- package/dist/src/mcpl/tool-classes.d.ts +71 -0
- package/dist/src/mcpl/tool-classes.d.ts.map +1 -0
- package/dist/src/mcpl/tool-classes.js +170 -0
- package/dist/src/mcpl/tool-classes.js.map +1 -0
- package/dist/src/mcpl/tool-glob.d.ts +16 -0
- package/dist/src/mcpl/tool-glob.d.ts.map +1 -0
- package/dist/src/mcpl/tool-glob.js +41 -0
- package/dist/src/mcpl/tool-glob.js.map +1 -0
- package/dist/src/mcpl/tool-lifecycle.d.ts +253 -0
- package/dist/src/mcpl/tool-lifecycle.d.ts.map +1 -0
- package/dist/src/mcpl/tool-lifecycle.js +592 -0
- package/dist/src/mcpl/tool-lifecycle.js.map +1 -0
- package/dist/src/mcpl/transport.d.ts +12 -0
- package/dist/src/mcpl/transport.d.ts.map +1 -1
- package/dist/src/mcpl/transport.js +33 -1
- package/dist/src/mcpl/transport.js.map +1 -1
- package/dist/src/mcpl/types.d.ts +66 -1
- package/dist/src/mcpl/types.d.ts.map +1 -1
- package/dist/src/mcpl/types.js +6 -0
- package/dist/src/mcpl/types.js.map +1 -1
- package/dist/src/modules/discord/index.js +1 -1
- package/dist/src/modules/discord/index.js.map +1 -1
- package/dist/src/modules/history/index.d.ts +85 -0
- package/dist/src/modules/history/index.d.ts.map +1 -1
- package/dist/src/modules/history/index.js +1019 -24
- package/dist/src/modules/history/index.js.map +1 -1
- package/dist/src/modules/history/semantic.d.ts +202 -0
- package/dist/src/modules/history/semantic.d.ts.map +1 -0
- package/dist/src/modules/history/semantic.js +418 -0
- package/dist/src/modules/history/semantic.js.map +1 -0
- package/dist/src/modules/index.d.ts +2 -1
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +82 -0
- package/dist/src/tool-result-guard.d.ts.map +1 -0
- package/dist/src/tool-result-guard.js +306 -0
- package/dist/src/tool-result-guard.js.map +1 -0
- package/dist/src/types/agent.d.ts +14 -0
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +21 -0
- package/dist/src/types/framework.d.ts.map +1 -1
- package/dist/src/types/trace.d.ts +17 -0
- package/dist/src/types/trace.d.ts.map +1 -1
- package/dist/test/channel-registry-routing.test.js +59 -0
- package/dist/test/channel-registry-routing.test.js.map +1 -1
- package/dist/test/code-execution.test.js +139 -0
- package/dist/test/code-execution.test.js.map +1 -1
- package/dist/test/helpers/coalescing-fixture.d.ts +72 -0
- package/dist/test/helpers/coalescing-fixture.d.ts.map +1 -0
- package/dist/test/helpers/coalescing-fixture.js +145 -0
- package/dist/test/helpers/coalescing-fixture.js.map +1 -0
- package/dist/test/helpers/coalescing-kill-child.d.ts +2 -0
- package/dist/test/helpers/coalescing-kill-child.d.ts.map +1 -0
- package/dist/test/helpers/coalescing-kill-child.js +24 -0
- package/dist/test/helpers/coalescing-kill-child.js.map +1 -0
- package/dist/test/history-module-realstore.test.d.ts +2 -0
- package/dist/test/history-module-realstore.test.d.ts.map +1 -0
- package/dist/test/history-module-realstore.test.js +363 -0
- package/dist/test/history-module-realstore.test.js.map +1 -0
- package/dist/test/history-module-semantic.test.d.ts +2 -0
- package/dist/test/history-module-semantic.test.d.ts.map +1 -0
- package/dist/test/history-module-semantic.test.js +213 -0
- package/dist/test/history-module-semantic.test.js.map +1 -0
- package/dist/test/history-module-ux.test.d.ts +2 -0
- package/dist/test/history-module-ux.test.d.ts.map +1 -0
- package/dist/test/history-module-ux.test.js +304 -0
- package/dist/test/history-module-ux.test.js.map +1 -0
- package/dist/test/history-module.test.js +25 -1
- package/dist/test/history-module.test.js.map +1 -1
- package/dist/test/history-semantic-review-findings.test.d.ts +2 -0
- package/dist/test/history-semantic-review-findings.test.d.ts.map +1 -0
- package/dist/test/history-semantic-review-findings.test.js +338 -0
- package/dist/test/history-semantic-review-findings.test.js.map +1 -0
- package/dist/test/history-semantic-sync-converges.test.d.ts +2 -0
- package/dist/test/history-semantic-sync-converges.test.d.ts.map +1 -0
- package/dist/test/history-semantic-sync-converges.test.js +109 -0
- package/dist/test/history-semantic-sync-converges.test.js.map +1 -0
- package/dist/test/mcpl-capability-grant.test.js +3 -1
- package/dist/test/mcpl-capability-grant.test.js.map +1 -1
- package/dist/test/mcpl-child-env.test.d.ts +2 -0
- package/dist/test/mcpl-child-env.test.d.ts.map +1 -0
- package/dist/test/mcpl-child-env.test.js +69 -0
- package/dist/test/mcpl-child-env.test.js.map +1 -0
- package/dist/test/mcpl-coalescing.test.d.ts +2 -0
- package/dist/test/mcpl-coalescing.test.d.ts.map +1 -0
- package/dist/test/mcpl-coalescing.test.js +1050 -0
- package/dist/test/mcpl-coalescing.test.js.map +1 -0
- package/dist/test/mcpl-list-status.test.js +4 -0
- package/dist/test/mcpl-list-status.test.js.map +1 -1
- package/dist/test/mcpl-tool-class-listing.test.d.ts +2 -0
- package/dist/test/mcpl-tool-class-listing.test.d.ts.map +1 -0
- package/dist/test/mcpl-tool-class-listing.test.js +147 -0
- package/dist/test/mcpl-tool-class-listing.test.js.map +1 -0
- package/dist/test/mcpl-tool-classes.test.d.ts +7 -0
- package/dist/test/mcpl-tool-classes.test.d.ts.map +1 -0
- package/dist/test/mcpl-tool-classes.test.js +80 -0
- package/dist/test/mcpl-tool-classes.test.js.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.d.ts +2 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.d.ts.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js +237 -0
- package/dist/test/mcpl-tool-lifecycle-e2e.test.js.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-emitter.test.d.ts +11 -0
- package/dist/test/mcpl-tool-lifecycle-emitter.test.d.ts.map +1 -0
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js +307 -0
- package/dist/test/mcpl-tool-lifecycle-emitter.test.js.map +1 -0
- package/dist/test/mcpl-tool-lifecycle.test.d.ts +11 -0
- package/dist/test/mcpl-tool-lifecycle.test.d.ts.map +1 -0
- package/dist/test/mcpl-tool-lifecycle.test.js +270 -0
- package/dist/test/mcpl-tool-lifecycle.test.js.map +1 -0
- package/dist/test/silent-heartbeat.test.d.ts +2 -0
- package/dist/test/silent-heartbeat.test.d.ts.map +1 -0
- package/dist/test/silent-heartbeat.test.js +154 -0
- package/dist/test/silent-heartbeat.test.js.map +1 -0
- package/dist/test/tool-result-guard.test.d.ts +2 -0
- package/dist/test/tool-result-guard.test.d.ts.map +1 -0
- package/dist/test/tool-result-guard.test.js +1081 -0
- package/dist/test/tool-result-guard.test.js.map +1 -0
- package/dist/test/trunk-channel-routing.test.js +67 -0
- package/dist/test/trunk-channel-routing.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/agent.ts +128 -10
- package/src/api/types.ts +2 -0
- package/src/code-execution/py-runner.ts +34 -2
- package/src/code-execution/tool-definition.ts +46 -0
- package/src/framework.ts +1201 -80
- package/src/index.ts +13 -0
- package/src/mcpl/capability-grant.ts +54 -6
- package/src/mcpl/channel-registry.ts +115 -7
- package/src/mcpl/index.ts +29 -0
- package/src/mcpl/push-coalescer.ts +821 -0
- package/src/mcpl/push-handler.ts +40 -4
- package/src/mcpl/server-connection.ts +48 -2
- package/src/mcpl/tool-classes.ts +188 -0
- package/src/mcpl/tool-glob.ts +36 -0
- package/src/mcpl/tool-lifecycle.ts +730 -0
- package/src/mcpl/transport.ts +35 -1
- package/src/mcpl/types.ts +69 -1
- package/src/modules/discord/index.ts +1 -1
- package/src/modules/history/index.ts +1089 -24
- package/src/modules/history/semantic.ts +473 -0
- package/src/modules/index.ts +2 -1
- package/src/tool-result-guard.ts +318 -0
- package/src/types/agent.ts +15 -0
- package/src/types/framework.ts +23 -0
- package/src/types/trace.ts +17 -0
package/src/mcpl/transport.ts
CHANGED
|
@@ -101,6 +101,40 @@ export abstract class McplTransport extends EventEmitter {
|
|
|
101
101
|
// stdio
|
|
102
102
|
// ---------------------------------------------------------------------------
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Host variables a stdio child gets by default: just enough for an ordinary
|
|
106
|
+
* process to run (find binaries, a home dir, temp dir, locale, TLS roots,
|
|
107
|
+
* a display for GUI helpers). Everything else in the host env — notably API
|
|
108
|
+
* keys and bot tokens — is NOT passed on; a server that needs a variable must
|
|
109
|
+
* declare it in its `env` (recipes can `${VAR}`-substitute from .env), or set
|
|
110
|
+
* `inheritEnv: true` to get the whole host env as before.
|
|
111
|
+
*/
|
|
112
|
+
export const CHILD_ENV_ALLOWLIST = [
|
|
113
|
+
'PATH', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'TERM', 'LANG', 'TZ',
|
|
114
|
+
'TMPDIR', 'TMP', 'TEMP',
|
|
115
|
+
'DISPLAY', 'WAYLAND_DISPLAY',
|
|
116
|
+
'XDG_RUNTIME_DIR', 'XDG_CONFIG_HOME', 'XDG_CACHE_HOME', 'XDG_DATA_HOME',
|
|
117
|
+
'SSL_CERT_FILE', 'SSL_CERT_DIR', 'NODE_EXTRA_CA_CERTS',
|
|
118
|
+
'__CF_USER_TEXT_ENCODING',
|
|
119
|
+
// Windows equivalents, harmless elsewhere.
|
|
120
|
+
'SYSTEMROOT', 'WINDIR', 'COMSPEC', 'PATHEXT', 'APPDATA', 'LOCALAPPDATA', 'USERPROFILE',
|
|
121
|
+
];
|
|
122
|
+
|
|
123
|
+
/** Environment for a stdio child: allowlisted host vars (+ LC_*), then the
|
|
124
|
+
* server's declared `env` on top. `inheritEnv: true` restores full inheritance. */
|
|
125
|
+
export function buildChildEnv(
|
|
126
|
+
config: Pick<McplServerConfig, 'env' | 'inheritEnv'>,
|
|
127
|
+
hostEnv: NodeJS.ProcessEnv = process.env,
|
|
128
|
+
): NodeJS.ProcessEnv {
|
|
129
|
+
if (config.inheritEnv) return { ...hostEnv, ...config.env };
|
|
130
|
+
const env: NodeJS.ProcessEnv = {};
|
|
131
|
+
for (const [key, value] of Object.entries(hostEnv)) {
|
|
132
|
+
if (value === undefined) continue;
|
|
133
|
+
if (CHILD_ENV_ALLOWLIST.includes(key) || key.startsWith('LC_')) env[key] = value;
|
|
134
|
+
}
|
|
135
|
+
return { ...env, ...config.env };
|
|
136
|
+
}
|
|
137
|
+
|
|
104
138
|
export class StdioTransport extends McplTransport {
|
|
105
139
|
readonly kind = 'stdio' as const;
|
|
106
140
|
|
|
@@ -139,7 +173,7 @@ export class StdioTransport extends McplTransport {
|
|
|
139
173
|
}
|
|
140
174
|
const child = spawn(config.command, config.args ?? [], {
|
|
141
175
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
142
|
-
env:
|
|
176
|
+
env: buildChildEnv(config),
|
|
143
177
|
});
|
|
144
178
|
const rl = createInterface({ input: child.stdout! });
|
|
145
179
|
return new StdioTransport(child, rl);
|
package/src/mcpl/types.ts
CHANGED
|
@@ -145,6 +145,10 @@ export interface McplCapabilities {
|
|
|
145
145
|
/** Server consumes inference/lifecycle notifications (§10.5). */
|
|
146
146
|
inferenceLifecycle?: boolean;
|
|
147
147
|
|
|
148
|
+
/** RFC-007 tool lifecycle: observe (metadata) and inputs (requested
|
|
149
|
+
* argument fields). `true` = both leaves. */
|
|
150
|
+
toolLifecycle?: boolean | { observe?: boolean; inputs?: boolean };
|
|
151
|
+
|
|
148
152
|
/** Server supports model/info requests */
|
|
149
153
|
modelInfo?: boolean;
|
|
150
154
|
|
|
@@ -161,6 +165,15 @@ export interface McplCapabilities {
|
|
|
161
165
|
*/
|
|
162
166
|
export interface McplHostCapabilities {
|
|
163
167
|
version: string;
|
|
168
|
+
/** RFC-006 support, independent of capability grants. */
|
|
169
|
+
eventCoalescing?: boolean | {
|
|
170
|
+
pushEvents?: boolean;
|
|
171
|
+
channelsIncoming?: boolean;
|
|
172
|
+
deferred?: boolean;
|
|
173
|
+
channelScopedPush?: boolean;
|
|
174
|
+
/** Retry-window guarantee in ms (integer ≥ 3,600,000; default 3,600,000). */
|
|
175
|
+
retryWindowMs?: number;
|
|
176
|
+
};
|
|
164
177
|
pushEvents?: boolean;
|
|
165
178
|
contextHooks?: {
|
|
166
179
|
beforeInference?: boolean | {
|
|
@@ -170,6 +183,10 @@ export interface McplHostCapabilities {
|
|
|
170
183
|
};
|
|
171
184
|
inferenceRequest?: boolean | { streaming?: boolean };
|
|
172
185
|
inferenceLifecycle?: boolean;
|
|
186
|
+
|
|
187
|
+
/** RFC-007 tool lifecycle: observe (metadata) and inputs (requested
|
|
188
|
+
* argument fields). `true` = both leaves. */
|
|
189
|
+
toolLifecycle?: boolean | { observe?: boolean; inputs?: boolean };
|
|
173
190
|
modelInfo?: boolean;
|
|
174
191
|
featureSets?: boolean;
|
|
175
192
|
channels?: boolean | McplChannelCapabilities;
|
|
@@ -209,9 +226,20 @@ export interface McplServerConfig {
|
|
|
209
226
|
/** Arguments for the command */
|
|
210
227
|
args?: string[];
|
|
211
228
|
|
|
212
|
-
/**
|
|
229
|
+
/**
|
|
230
|
+
* Environment variables for the child process. Stdio children do NOT inherit
|
|
231
|
+
* the host environment wholesale: they get a small allowlist (PATH, HOME,
|
|
232
|
+
* LANG, LC_*, TMPDIR, ... — see CHILD_ENV_ALLOWLIST) plus exactly these.
|
|
233
|
+
*/
|
|
213
234
|
env?: Record<string, string>;
|
|
214
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Escape hatch: pass the host's entire environment (including secrets) to
|
|
238
|
+
* the stdio child, as older versions did. Only for servers that genuinely
|
|
239
|
+
* need it. Default false.
|
|
240
|
+
*/
|
|
241
|
+
inheritEnv?: boolean;
|
|
242
|
+
|
|
215
243
|
/**
|
|
216
244
|
* WebSocket URL for the network transport (`ws://` or `wss://`). Mutually
|
|
217
245
|
* exclusive with `command`. When set (or `transport: 'websocket'`), the host
|
|
@@ -378,6 +406,17 @@ export interface McplServerConfig {
|
|
|
378
406
|
* cumulative per-server byte budget (reference-fetcher.ts defaults apply
|
|
379
407
|
* when absent). */
|
|
380
408
|
autofetch?: { maxBytes?: number; maxTotalBytes?: number };
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* RFC-007 tool lifecycle policy for this server: narrowing for the
|
|
412
|
+
* `toolLifecycle.observe` and `toolLifecycle.inputs` grants, and the
|
|
413
|
+
* `input` size bound. Both paths are DENIED BY DEFAULT; stating a key here
|
|
414
|
+
* (or naming the path in enabledCapabilities) is the explicit grant.
|
|
415
|
+
* `inputs` without a `tools` or `classes` term delivers no arguments, and
|
|
416
|
+
* `comms` or unclassed tools never carry arguments whatever it says.
|
|
417
|
+
* See src/mcpl/tool-lifecycle.ts.
|
|
418
|
+
*/
|
|
419
|
+
toolLifecycle?: import('./tool-lifecycle.js').ToolLifecycleConfig;
|
|
381
420
|
}
|
|
382
421
|
|
|
383
422
|
// ============================================================================
|
|
@@ -623,6 +662,21 @@ export interface StateRollbackResult {
|
|
|
623
662
|
* Spec Section 9.1.
|
|
624
663
|
*/
|
|
625
664
|
export interface PushEventParams {
|
|
665
|
+
/** RFC-006 event coalescing (mcpl PR #5, revision 7). */
|
|
666
|
+
coalesce?: {
|
|
667
|
+
/** Subject key, 1..256 UTF-8 bytes, opaque to the host. */
|
|
668
|
+
key: string;
|
|
669
|
+
/** push/event only: address a registered channel's subject namespace. */
|
|
670
|
+
channelId?: string;
|
|
671
|
+
/** push/event only: deferred mode — the host calls push/render at assembly. */
|
|
672
|
+
deferred?: boolean;
|
|
673
|
+
/** The subject ceased to exist; `payload.content` is the deletion notice. */
|
|
674
|
+
retract?: boolean;
|
|
675
|
+
/** No earlier occurrence of this subject was ever sent (§3.3). */
|
|
676
|
+
initial?: boolean;
|
|
677
|
+
/** deferred only; ≤ 4 KiB serialized; server-private, echoed by push/render. */
|
|
678
|
+
data?: unknown;
|
|
679
|
+
};
|
|
626
680
|
/** Declaring feature set */
|
|
627
681
|
featureSet: string;
|
|
628
682
|
|
|
@@ -650,6 +704,10 @@ export interface PushEventParams {
|
|
|
650
704
|
* Spec Section 9.3.
|
|
651
705
|
*/
|
|
652
706
|
export interface PushEventResult {
|
|
707
|
+
coalesce?: {
|
|
708
|
+
outcome: 'first' | 'replaced' | 'appended' | 'retracted' | 'noted' | 'consumed';
|
|
709
|
+
priorEventId?: string;
|
|
710
|
+
};
|
|
653
711
|
/** Whether the event was accepted */
|
|
654
712
|
accepted: boolean;
|
|
655
713
|
|
|
@@ -1086,6 +1144,8 @@ export interface ChannelsPublishResult {
|
|
|
1086
1144
|
* Spec Section 14.3.
|
|
1087
1145
|
*/
|
|
1088
1146
|
export interface ChannelIncomingMessage {
|
|
1147
|
+
eventId?: string;
|
|
1148
|
+
coalesce?: Omit<NonNullable<PushEventParams['coalesce']>, 'channelId' | 'deferred'>;
|
|
1089
1149
|
/** Channel this message came from */
|
|
1090
1150
|
channelId: string;
|
|
1091
1151
|
|
|
@@ -1133,6 +1193,7 @@ export interface ChannelsIncomingResult {
|
|
|
1133
1193
|
|
|
1134
1194
|
/** Result for a single incoming message. */
|
|
1135
1195
|
export interface ChannelIncomingMessageResult {
|
|
1196
|
+
coalesce?: PushEventResult['coalesce'];
|
|
1136
1197
|
messageId: string;
|
|
1137
1198
|
accepted: boolean;
|
|
1138
1199
|
conversationId?: string;
|
|
@@ -1190,6 +1251,13 @@ export const McplMethod = {
|
|
|
1190
1251
|
// context/afterInference. Metadata only; BEST-EFFORT delivery.
|
|
1191
1252
|
InferenceLifecycle: 'inference/lifecycle',
|
|
1192
1253
|
|
|
1254
|
+
// Tool lifecycle (RFC-007). tools/lifecycle is Host → Server,
|
|
1255
|
+
// Notification, metadata plus (under its own grant) requested argument
|
|
1256
|
+
// fields — never results. tools/observe is Server → Host, Request: the
|
|
1257
|
+
// server's filter over what it is sent (interest, never authority).
|
|
1258
|
+
ToolsLifecycle: 'tools/lifecycle',
|
|
1259
|
+
ToolsObserve: 'tools/observe',
|
|
1260
|
+
|
|
1193
1261
|
// Server manifest changes (§17). manifestChanged is S→H Notification —
|
|
1194
1262
|
// an opaque revision plus changed domains, NO payload, deliberately
|
|
1195
1263
|
// ungated (§17.3: gating it would silence exactly the servers whose
|
|
@@ -153,7 +153,7 @@ export class DiscordModule implements Module {
|
|
|
153
153
|
this.unsubscribeTrace = ctx.onTrace((event: TraceEvent) => {
|
|
154
154
|
const agentName = (event as { agentName?: string }).agentName;
|
|
155
155
|
if (!agentName) return;
|
|
156
|
-
if (event.type === 'inference:started') {
|
|
156
|
+
if (event.type === 'inference:started' && !event.silent) {
|
|
157
157
|
this.startTypingLoop(agentName);
|
|
158
158
|
} else if (TURN_TERMINAL_TRACES.has(event.type)) {
|
|
159
159
|
this.stopTypingLoop(agentName);
|