@nylorun/agents 0.32.0-beta → 0.34.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @nylorun/agents
2
2
 
3
+ ## 0.34.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - 714bee2: The triggers capability (Host feature `agent-triggers`): an agent-folder/2 folder declares `engine: { triggers: true }` (the root agent's only; `engine.instructions.triggers` replaces its wording), which compiles to `harness.engine.triggers` and offers the root agent the `triggers` tool (`list`, `create`, `delete`) and the text block `triggers@1`. The Runtime serves each call as a `runtime` effect (operation `triggers`, `turn.start.agent.triggers`, Harness API v5.3): a trigger an agent makes is the Agent's (`origin: "agent"`, with its title and the session that made it), runs in the calling session (`session: "this"`) or one of its own (`"own"`, `<session>_t_<id>`), is checked against the limits in force (`runtime.limits.triggers` within the Tenant's), survives upgrades and waits paused while a version lacks the capability; a turn a trigger started can't create one. Tool rules take `kind: "runtime"`, so an `ask` rule can hold a `triggers` call (its interaction carries `metadata.input`); `DELETE /v1/agents/{id}/triggers/{triggerId}` deletes an agent's trigger (`409 trigger_from_manifest` for a manifest's); `GET /v1/runs/stream` serves the Tenant's runs as server-sent events from a cursor (`410 cursor_expired` across a reset). `client.agents.deleteTrigger`, `client.runs.stream` and `nylorun agents triggers rm` follow. The JSON Schemas are republished as `agent-manifest/v8.3`, `harness-manifest/v1.3`, `runtime-manifest/v1.2`, `agent-folder/v1/agent-md.3`, `agent-folder/v1/runtime.2` and `harness-api/v5.3`.
8
+
9
+ ### Patch Changes
10
+
11
+ - Pin core to the tested release.
12
+ - Updated dependencies [714bee2]
13
+ - @nylorun/core@0.35.0-beta
14
+
15
+ ## 0.33.0-beta
16
+
17
+ ### Minor Changes
18
+
19
+ - 78787e2: A2A `SendMessage` takes `message.metadata.removeTools` (Host feature `remove-tools`): the tools a new message's turn may not use, by name, as a session message's `removeTools`. `createA2aClient`'s `send` takes `removeTools`.
20
+
3
21
  ## 0.32.0-beta
4
22
 
5
23
  ### Minor Changes
@@ -62,6 +62,11 @@ export interface A2aSendOptions {
62
62
  * `metadata.delivery`.
63
63
  */
64
64
  delivery?: "queue" | "reject";
65
+ /**
66
+ * The tools this message's turn may not use, by name (Host feature `remove-tools`), as a
67
+ * session message's `removeTools`. Sent as `metadata.removeTools`; a new message only.
68
+ */
69
+ removeTools?: readonly string[];
65
70
  /** Where the agent pushes this task's updates; verify each with `verifyA2aPush`. */
66
71
  push?: PushNotificationConfig;
67
72
  /** Answer at once with the task (`SUBMITTED` or `WORKING`) instead of waiting. */
@@ -128,6 +128,7 @@ export function createA2aClient(options) {
128
128
  const metadata = {
129
129
  ...send.metadata,
130
130
  ...(send.delivery ? { delivery: send.delivery } : {}),
131
+ ...(send.removeTools?.length ? { removeTools: [...send.removeTools] } : {}),
131
132
  };
132
133
  return sendMessage({
133
134
  messageId: send.messageId,
package/dist/agents.d.ts CHANGED
@@ -17,9 +17,11 @@
17
17
  * write-only: no call reads one back.
18
18
  *
19
19
  * Triggers: what its manifest's `runtime.triggers` declares starts its turns with
20
- * no client connected. `triggers(id)` lists them with their status and next run, `pauseTrigger`,
21
- * `resumeTrigger` and `runTrigger` change or run one, `rotateWebhookSecret` makes a webhook
22
- * trigger's signing secret, and `runs(id)` pages what each fire came to.
20
+ * no client connected, and so do the triggers its agents set up with the `triggers` tool
21
+ * (`engine.triggers`, origin `agent`). `triggers(id)` lists them with their status and next run,
22
+ * `pauseTrigger`, `resumeTrigger` and `runTrigger` change or run one, `deleteTrigger` deletes one
23
+ * an agent made, `rotateWebhookSecret` makes a webhook trigger's signing secret, and `runs(id)`
24
+ * pages what each fire came to. `client.runs.stream()` follows every Agent's runs.
23
25
  *
24
26
  * Memory: an Agent whose manifest sets `harness.memory` keeps Markdown files under
25
27
  * `/memories` across sessions. `agents.memories` lists, reads, writes (to seed it), deletes and
@@ -275,6 +277,11 @@ export declare class AgentInstancesClient {
275
277
  versionBytes?: number | undefined;
276
278
  versionEntries?: number | undefined;
277
279
  } | undefined;
280
+ triggers?: {
281
+ count?: number | undefined;
282
+ minIntervalMs?: number | undefined;
283
+ runsPerHour?: number | undefined;
284
+ } | undefined;
278
285
  } | undefined;
279
286
  secrets?: Record<string, {
280
287
  required?: boolean | undefined;
@@ -435,6 +442,14 @@ export declare class AgentInstancesClient {
435
442
  triggers(agentId: string, options?: {
436
443
  signal?: AbortSignal;
437
444
  }): Promise<TriggerView[]>;
445
+ /**
446
+ * Deletes trigger `triggerId`, one of the Agent's agents made with the `triggers` tool (origin
447
+ * `agent`; Host feature `agent-triggers`). One its manifest declares is refused
448
+ * (`409 trigger_from_manifest`): save a version without it, or pause it.
449
+ */
450
+ deleteTrigger(agentId: string, triggerId: string, options?: {
451
+ signal?: AbortSignal;
452
+ }): Promise<void>;
438
453
  /** Pauses trigger `triggerId`: it stops firing until it is resumed. Answers the Agent's triggers. */
439
454
  pauseTrigger(agentId: string, triggerId: string, options?: {
440
455
  signal?: AbortSignal;
package/dist/agents.js CHANGED
@@ -17,9 +17,11 @@
17
17
  * write-only: no call reads one back.
18
18
  *
19
19
  * Triggers: what its manifest's `runtime.triggers` declares starts its turns with
20
- * no client connected. `triggers(id)` lists them with their status and next run, `pauseTrigger`,
21
- * `resumeTrigger` and `runTrigger` change or run one, `rotateWebhookSecret` makes a webhook
22
- * trigger's signing secret, and `runs(id)` pages what each fire came to.
20
+ * no client connected, and so do the triggers its agents set up with the `triggers` tool
21
+ * (`engine.triggers`, origin `agent`). `triggers(id)` lists them with their status and next run,
22
+ * `pauseTrigger`, `resumeTrigger` and `runTrigger` change or run one, `deleteTrigger` deletes one
23
+ * an agent made, `rotateWebhookSecret` makes a webhook trigger's signing secret, and `runs(id)`
24
+ * pages what each fire came to. `client.runs.stream()` follows every Agent's runs.
23
25
  *
24
26
  * Memory: an Agent whose manifest sets `harness.memory` keeps Markdown files under
25
27
  * `/memories` across sessions. `agents.memories` lists, reads, writes (to seed it), deletes and
@@ -292,6 +294,15 @@ export class AgentInstancesClient {
292
294
  const reply = await this.transport.json(`${this.path(agentId)}/triggers`, "GET", undefined, options.signal);
293
295
  return reply.triggers;
294
296
  }
297
+ /**
298
+ * Deletes trigger `triggerId`, one of the Agent's agents made with the `triggers` tool (origin
299
+ * `agent`; Host feature `agent-triggers`). One its manifest declares is refused
300
+ * (`409 trigger_from_manifest`): save a version without it, or pause it.
301
+ */
302
+ async deleteTrigger(agentId, triggerId, options = {}) {
303
+ await this.transport.requireFeature("agent-triggers", options.signal);
304
+ await this.transport.json(`${this.path(agentId)}/triggers/${segment(triggerId)}`, "DELETE", undefined, options.signal);
305
+ }
295
306
  /** Pauses trigger `triggerId`: it stops firing until it is resumed. Answers the Agent's triggers. */
296
307
  async pauseTrigger(agentId, triggerId, options = {}) {
297
308
  const reply = await this.transport.json(`${this.path(agentId)}/triggers/${segment(triggerId)}/pause`, "POST", {}, options.signal);
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { Agent, AgentBuilder } from "./builder.js";
6
6
  export { AgentBuildError, AgentLifecycleError, VerdictSchema, isVerdict, WorkflowBuildError, isBuiltWorkflow, flow, tool, http, defineSchema, ToolError, harnessSectionOf, sectionGaps, } from "@nylorun/core/define";
7
7
  export type { FlowAgentBuilder, Flow, Named, LoopOptions, StageOptions, HttpTarget, } from "@nylorun/core/define";
8
8
  export type { AgentOptions, AgentManifest, BuiltAgent, BuiltWorkflow, Verdict, WorkflowBinding, WorkflowManifest, ToolDefinition, ToolExecutionContext, ToolOutcome, JsonValue, JsonObject, } from "@nylorun/core/define";
9
- export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, SessionModelChoice, SessionModelView, SessionModelRecord, CostSplit, ModelCall, ModelCallsPage, AgentPage, ToolCall, ToolCallsPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, SubjectScope, AgentView, AgentState, AgentAttention, AgentEvent, AgentEventType, EgressRunningTurn, EnvironmentKind, EnvironmentRecipe, EnvironmentSecretSlot, AgentSecretView, AgentSnapshot, AgentRestore, AgentDiskVersions, RestoreAgentRequest, AgentForkPlan, AgentMovePlan, RestartAgentRequest, ForkAgentRequest, ForkAgentResponse, DeleteAgentResponse, PutAgentRequest, PutAgentSecretRequest, PutAgentSecretValueRequest, AgentManifestV8, AgentManifestFile, HarnessManifestFile, RuntimeManifestFile, RuntimeSection, AgentManifestChange, AgentManifestWarning, AgentManifestPlan, AgentManifestSource, AgentManifestSourceDiff, AgentManifestSourceSummary, AgentFolderDiagnostic, AgentManifestView, AgentManifestVersions, SaveAgentManifestResponse, DeleteAgentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, } from "@nylorun/core/contracts";
9
+ export type { SessionPage, SessionListItem, SessionManifestView, HistoryPage, SessionUsageTotals, SessionModelChoice, SessionModelView, SessionModelRecord, CostSplit, ModelCall, ModelCallsPage, AgentPage, ToolCall, ToolCallsPage, LiveEvent, SessionEvent, SessionEventOf, EventType, SessionCommand, SubjectScope, AgentView, AgentState, AgentAttention, AgentEvent, AgentEventType, EgressRunningTurn, EnvironmentKind, EnvironmentRecipe, EnvironmentSecretSlot, AgentSecretView, AgentSnapshot, AgentRestore, AgentDiskVersions, RestoreAgentRequest, AgentForkPlan, AgentMovePlan, RestartAgentRequest, ForkAgentRequest, ForkAgentResponse, DeleteAgentResponse, PutAgentRequest, PutAgentSecretRequest, PutAgentSecretValueRequest, AgentManifestV8, AgentManifestFile, HarnessManifestFile, RuntimeManifestFile, RuntimeSection, AgentManifestChange, AgentManifestWarning, AgentManifestPlan, AgentManifestSource, AgentManifestSourceDiff, AgentManifestSourceSummary, AgentFolderDiagnostic, AgentManifestView, AgentManifestVersions, SaveAgentManifestResponse, DeleteAgentManifestResponse, MessagePart, ArtifactView, ArtifactKind, ArtifactListItem, ArtifactPage, ArtifactVersionView, ArtifactLink, UploadArtifactResponse, DefinitionFileView, ArtifactTree, ArtifactDiff, FolderEntry, TriggerView, TriggerOrigin, TriggerRun, TriggerRunPage, TriggerToolInput, TriggerToolOutput, TenantRun, } from "@nylorun/core/contracts";
10
10
  export { AGENT_EVENT_TYPES, AGENT_FOLDER_MEDIA_TYPE, AGENT_STATES, COMPUTE_STATES, RUNTIME_LIMIT_DEFAULTS, SUBJECT_SCOPES, } from "@nylorun/core/contracts";
11
11
  export type { AgentHarnessSection, HarnessSection, HarnessSkill, HarnessMcpServer, WorkflowHarnessSection, } from "@nylorun/core";
12
12
  export { AgentsClient, SessionClient, createClient } from "./client.js";
@@ -23,6 +23,8 @@ export type { PackedFolder } from "./folder.js";
23
23
  export { packFolder, isAgentFolder, FOLDER_IGNORE_FILE } from "./folder-pack.js";
24
24
  export { ignoreMatcher } from "./folder-ignore.js";
25
25
  export { AccessClient } from "./access.js";
26
+ export { RunsClient } from "./runs.js";
27
+ export type { TenantRunEvent } from "./runs.js";
26
28
  export { resolveConnection, ConnectionError } from "./connection.js";
27
29
  export type { ResolvedConnection } from "./connection.js";
28
30
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ export { ENGINE_BLOCK_NAMES, previewTurn, } from "@nylorun/core/engine";
20
20
  export { packFolder, isAgentFolder, FOLDER_IGNORE_FILE } from "./folder-pack.js";
21
21
  export { ignoreMatcher } from "./folder-ignore.js";
22
22
  export { AccessClient } from "./access.js";
23
+ export { RunsClient } from "./runs.js";
23
24
  export { resolveConnection, ConnectionError } from "./connection.js";
24
25
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
25
26
  export { loadMcpServers, loadPlugin, PluginError } from "./plugins/load.js";
package/dist/runs.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The Tenant's runs (D83, Host feature `agent-triggers`): `client.runs.stream()` follows every
3
+ * run of every Agent's triggers, from a cursor, as `GET /v1/runs/stream` serves them. For an
4
+ * application key that reads Agents (`agents:read`).
5
+ */
6
+ import type { TenantRun } from "@nylorun/core/contracts";
7
+ import type { Transport } from "./http.js";
8
+ /** One run on the stream, and the cursor to resume after it. */
9
+ export interface TenantRunEvent {
10
+ readonly cursor: string;
11
+ readonly run: TenantRun;
12
+ }
13
+ export declare class RunsClient {
14
+ private readonly transport;
15
+ constructor(transport: Transport);
16
+ /**
17
+ * The Tenant's runs from `cursor` (the last one a reader kept; none reads from the oldest the
18
+ * stream keeps, 7 days), following the stream until `signal` aborts. It reconnects from the
19
+ * last run on its own. A run may arrive twice: drop a `runId` already seen. A cursor from before
20
+ * the Tenant's reset throws a `RuntimeError` with status 410 and code `cursor_expired`: read
21
+ * again without one.
22
+ */
23
+ stream(options?: {
24
+ cursor?: string;
25
+ signal?: AbortSignal;
26
+ }): AsyncIterable<TenantRunEvent>;
27
+ }
package/dist/runs.js ADDED
@@ -0,0 +1,26 @@
1
+ import { observeSSE } from "./sse.js";
2
+ export class RunsClient {
3
+ transport;
4
+ constructor(transport) {
5
+ this.transport = transport;
6
+ }
7
+ /**
8
+ * The Tenant's runs from `cursor` (the last one a reader kept; none reads from the oldest the
9
+ * stream keeps, 7 days), following the stream until `signal` aborts. It reconnects from the
10
+ * last run on its own. A run may arrive twice: drop a `runId` already seen. A cursor from before
11
+ * the Tenant's reset throws a `RuntimeError` with status 410 and code `cursor_expired`: read
12
+ * again without one.
13
+ */
14
+ async *stream(options = {}) {
15
+ await this.transport.requireFeature("agent-triggers", options.signal);
16
+ for await (const event of observeSSE(this.transport, "/v1/runs/stream", {
17
+ ...(options.signal ? { signal: options.signal } : {}),
18
+ ...(options.cursor === undefined ? {} : { cursor: options.cursor }),
19
+ })) {
20
+ if (event.event !== "run")
21
+ continue;
22
+ const data = JSON.parse(event.data);
23
+ yield { cursor: data.cursor, run: data.run };
24
+ }
25
+ }
26
+ }
@@ -10,6 +10,7 @@ import { AgentInstancesClient } from "./agents.js";
10
10
  import { AgentManifestsClient } from "./agent-manifests.js";
11
11
  import { ArtifactsClient } from "./artifacts.js";
12
12
  import { FilesClient } from "./files.js";
13
+ import { RunsClient } from "./runs.js";
13
14
  import { Transport, type Destination } from "./http.js";
14
15
  /** Application-principal access to a session's sandbox built-ins (workflows.md §8). */
15
16
  export type SessionSandbox = {
@@ -77,6 +78,8 @@ export declare class AgentsClient {
77
78
  get artifacts(): ArtifactsClient;
78
79
  /** Definition files: the skill files a definition names, by content hash. */
79
80
  get files(): FilesClient;
81
+ /** The Tenant's runs (Host feature `agent-triggers`): `stream()` follows every Agent's trigger runs. */
82
+ get runs(): RunsClient;
80
83
  /** The Runtime's protocol features, including optional ones such as `transcript-events`. */
81
84
  hostFeatures(options?: {
82
85
  signal?: AbortSignal;
@@ -505,6 +508,8 @@ export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
505
508
  export type { Destination, IncompatibleReason } from "./http.js";
506
509
  export type { LiveEvent } from "@nylorun/core/contracts";
507
510
  export { AccessClient } from "./access.js";
511
+ export { RunsClient } from "./runs.js";
512
+ export type { TenantRunEvent } from "./runs.js";
508
513
  export { AgentInstancesClient, AgentMemoriesClient, AgentSecretsClient, runtimeFiles } from "./agents.js";
509
514
  export type { AgentFilter, AgentInput, AgentSecretInput, AgentSecretRouting, RuntimeFileBytes } from "./agents.js";
510
515
  export { AgentManifestsClient, ManifestGapsError, agentManifest, requirementGaps } from "./agent-manifests.js";
@@ -8,6 +8,7 @@ import { AgentInstancesClient } from "./agents.js";
8
8
  import { AgentManifestsClient } from "./agent-manifests.js";
9
9
  import { ArtifactsClient } from "./artifacts.js";
10
10
  import { FilesClient } from "./files.js";
11
+ import { RunsClient } from "./runs.js";
11
12
  import { Transport, id, segment } from "./http.js";
12
13
  import { observeSSE } from "./sse.js";
13
14
  function sessionSandboxOf(transport, sessionId) {
@@ -88,6 +89,10 @@ export class AgentsClient {
88
89
  get files() {
89
90
  return new FilesClient(this.transport);
90
91
  }
92
+ /** The Tenant's runs (Host feature `agent-triggers`): `stream()` follows every Agent's trigger runs. */
93
+ get runs() {
94
+ return new RunsClient(this.transport);
95
+ }
91
96
  /** The Runtime's protocol features, including optional ones such as `transcript-events`. */
92
97
  hostFeatures(options = {}) {
93
98
  return this.transport.hostFeatures(options.signal);
@@ -374,6 +379,7 @@ export class SessionClient {
374
379
  }
375
380
  export { RuntimeError, IncompatibleRuntimeError } from "./http.js";
376
381
  export { AccessClient } from "./access.js";
382
+ export { RunsClient } from "./runs.js";
377
383
  export { AgentInstancesClient, AgentMemoriesClient, AgentSecretsClient, runtimeFiles } from "./agents.js";
378
384
  export { AgentManifestsClient, ManifestGapsError, agentManifest, requirementGaps } from "./agent-manifests.js";
379
385
  export { AGENT_FOLDER_FILE, FolderError, FolderInvalidError, diagnosticLine } from "./folder.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/agents",
3
- "version": "0.32.0-beta",
3
+ "version": "0.34.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.34.0-beta",
46
+ "@nylorun/core": "0.35.0-beta",
47
47
  "gray-matter": "^4.0.3"
48
48
  },
49
49
  "peerDependencies": {