@segmentstream/agent 0.71.0 → 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 +19 -0
- package/README.md +2 -2
- package/dist/_chunks/{build-metadata-DliB5P2p.mjs → build-metadata-Ls4SfzKv.mjs} +1 -1
- package/dist/extension/config.d.ts +12 -14
- package/dist/extension/config.mjs +6 -14
- package/dist/extension/lib/agent-tools.d.ts +3 -3
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/telegram/adapter.mjs +1 -1
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/lifecycle.mjs +1 -1
- package/dist/extension/lib/web-search.d.ts +1 -1
- package/dist/extension/tools/web_search.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
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
|
+
|
|
18
|
+
## 0.71.1
|
|
19
|
+
|
|
20
|
+
Pins @segmentstream/ontology 0.146.1.
|
|
21
|
+
|
|
3
22
|
## 0.71.0
|
|
4
23
|
|
|
5
24
|
Tool calls an agent makes in a Slack or WhatsApp chat carry `context.runtime.source`, as Telegram's
|
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`;
|
|
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` |
|
|
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.
|
|
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
|
|
157
|
-
*
|
|
158
|
-
*
|
|
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
|
-
|
|
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
|
|
616
|
-
*
|
|
617
|
-
*
|
|
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
|
-
|
|
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
|
|
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
|
|
5
|
-
* the ontology's roles say who gets
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
*
|
|
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) =>
|
|
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.
|
|
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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@chat-adapter/state-memory": "4.42.0",
|
|
81
81
|
"@chat-adapter/telegram": "4.41.0",
|
|
82
82
|
"@chat-adapter/whatsapp": "4.42.0",
|
|
83
|
-
"@segmentstream/ontology": "0.146.
|
|
83
|
+
"@segmentstream/ontology": "0.146.1",
|
|
84
84
|
"@vercel/oidc": "^3.8.4",
|
|
85
85
|
"ai": "^7.0.172",
|
|
86
86
|
"chat": "4.42.0",
|