@segmentstream/agent 0.71.1 → 0.72.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.72.0
4
+
5
+ Web search needs no setting: `segmentstream__web_search` is offered to every caller whose roles
6
+ grant `agent_tool:web_search`, so the ontology's permissions alone decide who searches.
7
+ `"web": { "search": … }` in `agent/segmentstream.json` configures nothing; the SDK still accepts it,
8
+ and `configWarnings` (printed by `segmentstream deploy` and shown on the agent page in Cloud) lists
9
+ it at `web.search`. `web` is again only the page reader's `domains`.
10
+
11
+ A role that grants `agent_tool:*` now grants web search too, with each search billed to the
12
+ workspace; name the agent tools it needs instead where the role should not search.
13
+
14
+ Action required: remove `"search"` from `web` in `agent/segmentstream.json`, and remove `web`
15
+ entirely when it held nothing else. Grant `agent_tool:web_search` to the roles that should search.
16
+ The SDK stops accepting `web.search` after 2027-02-08.
17
+
3
18
  ## 0.71.1
4
19
 
5
20
  Pins @segmentstream/ontology 0.146.1.
package/README.md CHANGED
@@ -138,7 +138,7 @@ See [Sandbox](#sandbox).
138
138
  | `ontology.connection` | `true` | Whether the agent reaches the ontology over MCP |
139
139
  | `sandbox` | `false` | `true` adds `bash`, `read_file` and `write_file` in the agent's sandbox without network, for callers who hold `agent_tool:sandbox`; see [Sandbox](#sandbox) |
140
140
  | `workspaceSource` | `false` | `true`, with `"sandbox": true`, gives members `segmentstream__workspace_source`, a read-only copy of the deployed code in the sandbox; see [Sandbox](#sandbox) |
141
- | `web` | none | `{ "domains": ["example.com"] }`: `segmentstream__web_fetch` reads those domains for `agent_tool:web`; `"search": true`: `segmentstream__web_search` searches the web for `agent_tool:web_search`; see [Who gets which tool](#who-gets-which-tool) |
141
+ | `web` | none | `{ "domains": ["example.com"] }`: `segmentstream__web_fetch` reads those domains for `agent_tool:web`; see [Who gets which tool](#who-gets-which-tool) |
142
142
  | `browser` | none | `{}`, with `"sandbox": true`: `segmentstream__browser` drives the agent's own cloud browser for callers who hold `agent_tool:browser` and `agent_tool:sandbox`; `proxy` `{ "type": "residential", "country": "de" }` sends it through a residential proxy |
143
143
  | `personas` | none | `{ "byRole": { role: persona }, "default": persona }`: who the agent is to the person; see [Personas and skills by role](#personas-and-skills-by-role) |
144
144
  | `review` | none | `{ "byRole": { role: { "mode": … } }, "default": { "mode": … } }`: who sends replies; see [Reply review](#reply-review) |
@@ -293,7 +293,7 @@ continue using GET lookup. Starter templates and pins remain unchanged in this s
293
293
  | `segmentstream__ontology_call_file` | `tools` | With `"sandbox": true`, for `agent_tool:sandbox`: calls an ontology tool with the JSON object in a sandbox file, or saves a read's result there. |
294
294
  | `segmentstream__workspace_source` | `tools` | With `"workspaceSource": true`, for members with `agent_tool:sandbox`: copies the deployed commit's code, read as the member, into `/workspace/source`, read-only. |
295
295
  | `segmentstream__web_fetch` | `tools` | With `web.domains`, for `agent_tool:web`: reads one `https://` page of those domains, every redirect checked, as Markdown, text or HTML. |
296
- | `segmentstream__web_search` | `tools` | With `"web": { "search": true }`, for `agent_tool:web_search`: searches the web through AI Gateway and answers the pages found with their excerpts. |
296
+ | `segmentstream__web_search` | `tools` | For `agent_tool:web_search`, with no setting: searches the web through AI Gateway and answers the pages found with their excerpts. |
297
297
  | `segmentstream__browser` | `tools` | With `browser`, for `agent_tool:browser` with `agent_tool:sandbox`: runs a Python script with Browser Harness helpers in the sandbox against the agent's own browser, in the chat's tab. |
298
298
  | browser rules | `instructions` | With `browser`, for the same callers: the helpers, screenshots, and asking before submitting, sending or paying. |
299
299
  | platform rules | `instructions` | Changes go through actions; `*_find` and `list_metrics` say what fields and metrics mean; `discover` ranks by meaning where listed; when to call `no_reply`; attachments |
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- var version = "0.71.1";
7
+ var version = "0.72.0";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -153,14 +153,17 @@ export interface SegmentStreamAgentConfigInput {
153
153
  readonly contextVersion: number;
154
154
  };
155
155
  /**
156
- * The web the agent reaches: with `domains`, `segmentstream__web_fetch` fetches `https://` pages
157
- * of these domains, each also covering its subdomains, for callers who hold `agent_tool:web`;
158
- * with `"search": true`, `segmentstream__web_search` searches the web for callers who hold
159
- * `agent_tool:web_search`. No web tool when absent.
156
+ * The web the agent may read: `segmentstream__web_fetch` fetches `https://` pages of these
157
+ * domains, each also covering its subdomains, for callers who hold `agent_tool:web`. No page
158
+ * reader when absent. Web search has no setting: `agent_tool:web_search` alone grants it.
160
159
  */
161
160
  readonly web?: {
162
161
  readonly domains?: ReadonlyArray<string>;
163
- readonly search?: boolean;
162
+ /**
163
+ * @legacy agent.config-retired-keys
164
+ * Turned web search on in 0.68 and 0.69; it configures nothing now and is warned about.
165
+ */
166
+ readonly search?: unknown;
164
167
  };
165
168
  /**
166
169
  * The agent's own browser: `segmentstream__browser` drives the workspace agent's cloud browser,
@@ -612,17 +615,12 @@ export interface WorkspaceChannelSettings {
612
615
  readonly secret?: string;
613
616
  }
614
617
  /**
615
- * The web the agent reaches. `domains` are bare lower-case host names, such as `example.com`, whose
616
- * pages `segmentstream__web_fetch` reads; each covers itself and its subdomains. Only `https://`
617
- * pages of them are fetched, and every redirect must stay on them. `search` turns on
618
- * `segmentstream__web_search`, which sends queries only to the search provider, never to a site.
619
- * At least one of them is set.
618
+ * The web the agent may read. `domains` are bare lower-case host names, such as `example.com`;
619
+ * each covers itself and its subdomains. Only `https://` pages of them are fetched, and every
620
+ * redirect must stay on them.
620
621
  */
621
622
  export interface WebSettings {
622
- /** The sites the page reader reads; absent without the page reader. */
623
- readonly domains?: ReadonlyArray<string>;
624
- /** Whether the agent searches the web; set only when it does. */
625
- readonly search?: true;
623
+ readonly domains: ReadonlyArray<string>;
626
624
  }
627
625
  /** The most domains `web.domains` lists. */
628
626
  export declare const MAXIMUM_WEB_DOMAINS = 50;
@@ -112,6 +112,10 @@ function configWarnings(value) {
112
112
  message: INAPPLICABLE_THRESHOLD
113
113
  })),
114
114
  ...earlierRoutingNames(root?.groups),
115
+ ...isRecord(root?.web) && root.web.search !== void 0 ? [{
116
+ path: ["web", "search"],
117
+ message: "no longer configures anything: segmentstream__web_search is offered to every caller whose roles grant agent_tool:web_search, so remove it"
118
+ }] : [],
115
119
  ...root?.conversations === void 0 ? [] : [{
116
120
  path: ["conversations"],
117
121
  message: "is now review, with each role's mode and minConfidence directly under it: write \"review\": { \"byRole\": { \"<role>\": { \"mode\": ... } }, \"default\": { ... } }"
@@ -358,17 +362,8 @@ function webSettings(value, issues) {
358
362
  issues
359
363
  });
360
364
  if (web === void 0) return null;
361
- const search = web.search ?? false;
362
- if (typeof search !== "boolean") {
363
- issues.push({
364
- message: "must be true or false",
365
- path: [...path, "search"]
366
- });
367
- return null;
368
- }
369
- const searching = search ? { search: true } : {};
370
365
  const domains = web.domains;
371
- if (domains === void 0 && search) return searching;
366
+ if (domains === void 0 && web.search !== void 0) return null;
372
367
  if (!Array.isArray(domains) || domains.length === 0 || domains.length > 50) {
373
368
  issues.push({
374
369
  message: `must list from 1 to 50 domains, such as ["example.com"]; remove web for no web tools`,
@@ -395,10 +390,7 @@ function webSettings(value, issues) {
395
390
  ]
396
391
  });
397
392
  });
398
- return issues.length > before ? null : {
399
- domains,
400
- ...searching
401
- };
393
+ return issues.length > before ? null : { domains };
402
394
  }
403
395
  function emailSettings(value, issues, path = ["channels", "email"]) {
404
396
  const email = section({
@@ -1,8 +1,8 @@
1
1
  import type { SessionAuthContext } from "eve/context";
2
2
  /**
3
3
  * The agent's own tools, beside the ontology's, are ordinary permissions of the ontology's one
4
- * permission model: `agent_tool:<tool>`. The agent's configuration says which tools the agent has;
5
- * the ontology's roles say who gets them. Wherever the ontology tells the agent whom it acts for,
4
+ * permission model: `agent_tool:<tool>`. The agent's configuration supplies what a tool needs, such
5
+ * as the domains the page reader may read; the ontology's roles say who gets each tool. Wherever the ontology tells the agent whom it acts for,
6
6
  * it names the tools that caller's current roles grant (`agent_tools`), and the channel stamps
7
7
  * them on the session principal as {@link AGENT_TOOLS_ATTRIBUTE}, next to `roles`. A principal
8
8
  * that carries none holds none.
@@ -17,7 +17,7 @@ export declare const WEB_TOOL = "web";
17
17
  * needs {@link SANDBOX_TOOL}.
18
18
  */
19
19
  export declare const BROWSER_TOOL = "browser";
20
- /** Searching the web while `web.search` is on, each search billed to the workspace. */
20
+ /** Searching the web, each search billed to the workspace; no setting turns it on. */
21
21
  export declare const WEB_SEARCH_TOOL = "web_search";
22
22
  export type AgentTool = typeof SANDBOX_TOOL | typeof WEB_TOOL | typeof BROWSER_TOOL | typeof WEB_SEARCH_TOOL;
23
23
  /**
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { t as agentBuild } from "../../_chunks/build-metadata-D83t0hEp.mjs";
7
+ export { t as agentBuild } from "../../_chunks/build-metadata-Ls4SfzKv.mjs";
@@ -10,7 +10,7 @@ import { groupRoutingHealth } from "../group-routing/health.mjs";
10
10
  import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
11
11
  import { handleWorkspaceCallback } from "./callbacks.mjs";
12
12
  import { telegramText, withTelegramTexts } from "./texts.mjs";
13
- import { t as agentBuild } from "../../../_chunks/build-metadata-D83t0hEp.mjs";
13
+ import { t as agentBuild } from "../../../_chunks/build-metadata-Ls4SfzKv.mjs";
14
14
  import { attachmentLifecycle } from "./lifecycle.mjs";
15
15
  import { manifestOf } from "../../config.mjs";
16
16
  import { gatewayAttachmentDescriber } from "./attachment-description.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { t as agentBuild } from "../../../_chunks/build-metadata-D83t0hEp.mjs";
7
+ import { t as agentBuild } from "../../../_chunks/build-metadata-Ls4SfzKv.mjs";
8
8
  import { runtimeRequestFailure } from "./runtime-request.mjs";
9
9
  import { GET } from "eve/channels";
10
10
  const HEALTH_ROUTE = "/eve/v1/telegram/health";
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { E as OntologyActionNotPermitted, Et as principalRuntimeSource, L as needsConfirmation, Ot as runtimeEnvelope, W as member, c as currentInboundRequest, j as ontologyTools, k as actionToolName, kt as telegramRuntimeSource } from "../../../_chunks/principal-BWTq_zuf.mjs";
8
- import { t as agentBuild } from "../../../_chunks/build-metadata-D83t0hEp.mjs";
8
+ import { t as agentBuild } from "../../../_chunks/build-metadata-Ls4SfzKv.mjs";
9
9
  import { object } from "../confirmation-description.mjs";
10
10
  var AttachmentLifecycleNotPermitted = class extends Error {
11
11
  code = "attachment_lifecycle_not_permitted";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * `segmentstream__web_search`: searches the web for a caller who holds `agent_tool:web_search`,
3
- * while `web.search` is on. AI Gateway runs Parallel's search, billed with the workspace's other
3
+ * which alone grants it. AI Gateway runs Parallel's search, billed with the workspace's other
4
4
  * Gateway usage, and the query reaches only the search provider, never a site.
5
5
  *
6
6
  * What the libraries lack: AI Gateway runs its searches only as a tool of a model call, with no
@@ -57,5 +57,5 @@ const webSearchTool = defineTool({
57
57
  return workflowToolResult(result, ctx);
58
58
  }
59
59
  });
60
- var web_search_default = defineDynamic((context) => segmentstream.config.web?.search === true && holdsAgentTool(context.session.auth.current, "web_search") ? webSearchTool : null);
60
+ var web_search_default = defineDynamic((context) => holdsAgentTool(context.session.auth.current, "web_search") ? webSearchTool : null);
61
61
  export { web_search_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/agent",
3
- "version": "0.71.1",
3
+ "version": "0.72.0",
4
4
  "description": "The SegmentStream workspace agent: the ontology as tools, acting as the member who writes, and the browser, Telegram, WhatsApp and Slack through the workspace's connections.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "SegmentStream",