@nylorun/agents 0.16.0-beta → 0.17.0-beta
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 +29 -0
- package/README.md +33 -10
- package/dist/session-client.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @nylorun/agents
|
|
2
2
|
|
|
3
|
+
## 0.17.0-beta
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- cf5eb9c: **Protocol 9: the Runtime API is an OAuth 2.1 resource server for your identity provider's tokens.** Nylorun is still never the authorization server. Upgrade every package together; MIGRATION.md has the details.
|
|
8
|
+
|
|
9
|
+
- **Breaking (`@nylorun/runtime`): a refused credential is `401`, not the opaque `404`.** No `Authorization` is `401 credential_required`; an unknown key, or a token no trusted issuer signed or that fails a check, is `401 credential_invalid`. Each carries `WWW-Authenticate: Bearer` (OAuth 2.1 §5.3), naming the protected resource metadata (`resource_metadata`) on the Runtime API when the Runtime has trusted issuers; the Management API's challenge is a bare `Bearer`. `token_expired` and `issuer_unavailable` gain the challenge too. Another Tenant named, a Tenant that could not open and an unsigned capability link stay the opaque `404`.
|
|
10
|
+
- **Breaking (`@nylorun/runtime`): a request with neither `Nylorun-Protocol` nor `Authorization`** on an API route gets that route's `401` challenge instead of `426`, so a generic OAuth client learns where to sign in.
|
|
11
|
+
- `@nylorun/runtime`: a token without a route's scope still gets `403 scope_required`, now with `WWW-Authenticate: Bearer error="insufficient_scope", scope="…"`. The `Bearer` scheme is matched in any case (RFC 9110).
|
|
12
|
+
- `@nylorun/runtime`: `GET /.well-known/oauth-protected-resource` (RFC 9728) serves the resource (`NYLORUN_PUBLIC_URL`, else the request's origin), the identity file's issuers in order and their scopes, with no key or protocol; `404` without an identity file.
|
|
13
|
+
- **Breaking (`@nylorun/runtime`): the identity file drops `maxLifetime`.** The issuer sets its tokens' lifetimes; `exp` is required, `iat` no longer is. A key the file does not define, `maxLifetime` included, is ignored and logged (`identity_file_key_ignored`) instead of stopping the boot. `subject` defaults to `{sub}`, `scopes` to `{ claim: scope }` and `allowedScopes` to every token scope but `studio`.
|
|
14
|
+
- `@nylorun/core`: `PROTOCOL_VERSION` is 9 and `HOST_PROTOCOL` 4–9, with the required feature `resource-server`; `ERROR_CODES` adds `credential_required` and `credential_invalid`. `@nylorun/agents`, `@nylorun/admin` and `@nylorun/cli` send protocol 9.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Pin core to the tested release.
|
|
19
|
+
- Updated dependencies [cf5eb9c]
|
|
20
|
+
- Updated dependencies [2ed5fe0]
|
|
21
|
+
- @nylorun/core@0.16.0-beta
|
|
22
|
+
|
|
23
|
+
## 0.16.1-beta
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- cb29dea: **READMEs for manifest-only agents.** Documentation only; no code changes.
|
|
28
|
+
|
|
29
|
+
- `@nylorun/agents`: the Flow agents example opens the PR with an `http()` tool stage instead of a code tool, and shows how to keep a person's approval: a flow stage cannot take `approval` yet (`flow.approval-unsupported`), so the HTTP tool goes to an agent stage with `approval: "always"`. Requests set `Nylorun-Protocol` 8. The subagents section says `ctx.state`, `ctx.agent` and `ctx.ask`/`ctx.approve` apply only to `tool({ run })` in the local engine.
|
|
30
|
+
- `@nylorun/cli`: no longer says `nylo endpoints` uses the Runtime API or replaces `nylo tenant endpoints`; it was removed with Action endpoints and exits 2.
|
|
31
|
+
|
|
3
32
|
## 0.16.0-beta
|
|
4
33
|
|
|
5
34
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -127,7 +127,7 @@ eval "$(npx @nylorun/cli env)"
|
|
|
127
127
|
# → NYLORUN_RUNTIME_URL, NYLORUN_SERVER_KEY
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
Every request sets `Nylorun-Protocol` (
|
|
130
|
+
Every request sets `Nylorun-Protocol` (8) and no `Nylorun-Tenant`: the Runtime
|
|
131
131
|
serves one Tenant. Before the first authenticated
|
|
132
132
|
request, `Transport` fetches `/health` once, checks protocol compatibility, and
|
|
133
133
|
throws `IncompatibleRuntimeError` / `incompatible_host` when the Host range or
|
|
@@ -218,11 +218,11 @@ const support = Agent({ id: "support" })
|
|
|
218
218
|
.subagents(researcher);
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
The tool is named after the agent's `id` and takes `{ task: string }`; the agent's `description` (required) is what the parent's model reads to decide when to delegate. The child starts with a fresh context: it sees its own instructions and the task, nothing of the parent's conversation, and only its final text (or `outputSchema` result) comes back. It keeps its own tools, skills and MCP servers, saved with the parent, shares the session's sandbox
|
|
221
|
+
The tool is named after the agent's `id` and takes `{ task: string }`; the agent's `description` (required) is what the parent's model reads to decide when to delegate. The child starts with a fresh context: it sees its own instructions and the task, nothing of the parent's conversation, and only its final text (or `outputSchema` result) comes back. It keeps its own tools, skills and MCP servers, saved with the parent, and shares the session's sandbox. Several delegation calls in one model response run in parallel. An empty answer, a failure (with the child's last text marked as evidence) or a cancelled child reaches the parent's model as a failed tool result, never as success. The Runtime emits `delegation.started` and `delegation.completed`; `session.history({ agent })` filters by `delegationId` (one child invocation) or by path such as `support/researcher` (every concurrent child that shares that path).
|
|
222
222
|
|
|
223
223
|
A flow agent can be a subagent too: `.subagents(researchFlow)` with a `description` like any other. Its manifest is inlined in the parent's, so it is saved with the parent. When the model calls it, the flow runs on the Runtime in its own linked session (a fresh one per call, linked from the parent's with a `node.agent` event at `support/<flow id>`), its agents in theirs, and the flow's output comes back as the tool result; a failed flow is a failed tool result. Cancelling the parent cancels the flow. Flow agents as subagents run on the Runtime only, not in a local `run()`. An approval asked for inside the flow waits on the flow's own session.
|
|
224
224
|
|
|
225
|
-
Delegate when the parent should keep the answer. When a specialist should own the rest of the conversation, send the next message with a turn manifest that has the specialist's instructions instead. This version is one level deep and non-interactive: a delegated agent cannot use agents as tools, its tools cannot declare `approval` (keep those on the parent),
|
|
225
|
+
Delegate when the parent should keep the answer. When a specialist should own the rest of the conversation, send the next message with a turn manifest that has the specialist's instructions instead. This version is one level deep and non-interactive: a delegated agent cannot use agents as tools, and its tools cannot declare `approval` (keep those on the parent). In the local engine (`@nylorun/harness/run`), a delegated agent's `tool({ run })` tools start with empty `ctx.state`, can read `ctx.agent` (`{ id, path, delegationId }`), and fail with `delegation.interaction-unsupported` on `ctx.ask`, `ctx.approve`, `ctx.sleep` or `ctx.waitFor`. Delegation is not an approval boundary; approvals live on tools.
|
|
226
226
|
|
|
227
227
|
## Flow agents
|
|
228
228
|
|
|
@@ -239,7 +239,7 @@ gets the previous stage's output. So each agent returns, through its `.output()`
|
|
|
239
239
|
what the next stage needs.
|
|
240
240
|
|
|
241
241
|
```ts
|
|
242
|
-
import { Agent, VerdictSchema,
|
|
242
|
+
import { Agent, VerdictSchema, http } from "@nylorun/agents";
|
|
243
243
|
import { z } from "zod";
|
|
244
244
|
|
|
245
245
|
const planner = Agent({ id: "planner" })
|
|
@@ -258,13 +258,13 @@ const prWriter = Agent({ id: "pr-writer" })
|
|
|
258
258
|
.instructions("Return the summaries you are given as { summaries }.")
|
|
259
259
|
.output(z.object({ summaries: z.array(z.string()) }));
|
|
260
260
|
|
|
261
|
-
|
|
262
|
-
|
|
261
|
+
// Your service serves POST /pull-requests and answers { url }.
|
|
262
|
+
const openPr = http({
|
|
263
|
+
name: "open_pr",
|
|
263
264
|
input: z.object({ summaries: z.array(z.string()) }),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
},
|
|
265
|
+
output: z.object({ url: z.string() }),
|
|
266
|
+
url: "https://ci.example.com/pull-requests",
|
|
267
|
+
credential: "github",
|
|
268
268
|
});
|
|
269
269
|
|
|
270
270
|
export const shipFeature = Agent({ id: "ship-feature" })
|
|
@@ -275,6 +275,29 @@ export const shipFeature = Agent({ id: "ship-feature" })
|
|
|
275
275
|
export const agents = [shipFeature];
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
+
A flow stage cannot take `approval` yet (`flow.approval-unsupported`). To have a person
|
|
279
|
+
approve opening the PR, give the HTTP tool to an agent as the last stage instead: that
|
|
280
|
+
agent's turn pauses until the call is approved, and the flow session's `pending()` lists
|
|
281
|
+
the wait:
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
const prOpener = Agent({ id: "pr-opener" })
|
|
285
|
+
.instructions("Open one pull request with open_pr from the summaries you are given.")
|
|
286
|
+
.tools(
|
|
287
|
+
http({
|
|
288
|
+
name: "open_pr",
|
|
289
|
+
description: "Open a pull request with the given summaries.",
|
|
290
|
+
input: z.object({ summaries: z.array(z.string()) }),
|
|
291
|
+
url: "https://ci.example.com/pull-requests",
|
|
292
|
+
credential: "github",
|
|
293
|
+
approval: "always",
|
|
294
|
+
}),
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// …
|
|
298
|
+
.pipe(prWriter, prOpener);
|
|
299
|
+
```
|
|
300
|
+
|
|
278
301
|
| Stage | Role |
|
|
279
302
|
| --- | --- |
|
|
280
303
|
| **`.pipe(a, b, …)`** | Run agents, tools or `flow()`s in order; each one's output is the next one's input |
|
package/dist/session-client.d.ts
CHANGED
|
@@ -261,7 +261,7 @@ export declare class SessionClient {
|
|
|
261
261
|
time: string;
|
|
262
262
|
schemaVersion: number;
|
|
263
263
|
source: {
|
|
264
|
-
kind: "api" | "controller" | "edge" | "egress-gate" | "evidence" | "harness" | "human" | "init" | "loop" | "model-gate" | "operator" | "
|
|
264
|
+
kind: "api" | "controller" | "edge" | "egress-gate" | "evidence" | "harness" | "human" | "init" | "loop" | "model-gate" | "operator" | "sandboxes" | "supervisor" | "tool-gate";
|
|
265
265
|
id: string;
|
|
266
266
|
};
|
|
267
267
|
evidence: "asserted" | "attested" | "claimed" | "measured" | "observed";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0-beta",
|
|
4
4
|
"description": "Nylorun agent definitions and session client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test": "vitest run --passWithNoTests"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@nylorun/core": "0.
|
|
46
|
+
"@nylorun/core": "0.16.0-beta",
|
|
47
47
|
"gray-matter": "^4.0.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|