@re-cinq/agent-contracts 0.14.0 → 0.16.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 CHANGED
@@ -82,6 +82,22 @@ const finished = await waitForAgent(client, run.metadata!.name!);
82
82
  console.log(finished.status?.phase, finished.status?.prUrl);
83
83
  ```
84
84
 
85
+ An AgentDefinition is a reusable recipe, so a run's own repositories, conversation, output, secrets and
86
+ env go on `spec` of the Agent (`repos`, `conversation`, `output`, `secrets`, `env`) and win over the
87
+ recipe's value when set:
88
+
89
+ ```ts
90
+ await client.createAgent({
91
+ metadata: { generateName: "review-" },
92
+ spec: {
93
+ stationRef: "repo-reviewer",
94
+ repos: [{ name: "app", url: "https://github.com/example/app", token_secret: "RUN_1_TOKEN" }],
95
+ conversation: { id: "eng-101", pin: "eng-101" },
96
+ output: { sinks: [{ type: "http", url: "https://collector.example.com/runs/eng-101" }] },
97
+ },
98
+ });
99
+ ```
100
+
85
101
  `status.prUrl` is set when the Station's AgentDefinition has `spec.delivery.pullRequest`
86
102
  (`DeliverySpec`, `PullRequestDelivery`): the run's commits are pushed and opened as a pull request.
87
103
 
@@ -112,6 +112,15 @@ export interface OutputSpec {
112
112
  sinks?: OutputSink[];
113
113
  watch?: OutputWatch[];
114
114
  }
115
+ /** Where one run's output goes; sinks and select replace the AgentDefinition's when set, watch merges by event. */
116
+ export interface RunOutput {
117
+ /** Sinks for this run; when set they replace the recipe's sinks. */
118
+ sinks?: OutputSink[];
119
+ /** Which events reach the sinks; when set it replaces the recipe's selectors. */
120
+ select?: OutputSelector[];
121
+ /** Files this run produces. An entry replaces the recipe's watch of the same event (so a run can give a recipe's watch its own upload); other events are added. */
122
+ watch?: OutputWatch[];
123
+ }
115
124
  /** Open a pull request from the run's work branch; the push happens outside the agent container. */
116
125
  export interface PullRequestDelivery {
117
126
  /** Branch the pull request merges into. */
@@ -195,7 +204,7 @@ export interface InputFile {
195
204
  /** Secret key holding the header block sent with the download. */
196
205
  headers_secret?: string;
197
206
  }
198
- /** One run of a recipe in a Station. */
207
+ /** One run of a recipe in a Station. The AgentDefinition is the reusable recipe; what belongs to a single run (repos, conversation, output, secrets, env) can be given here and wins over the recipe's value when set, so one AgentDefinition serves many Agents. */
199
208
  export interface AgentSpec {
200
209
  /** The Station to run in (which selects the recipe). */
201
210
  stationRef: string;
@@ -212,6 +221,16 @@ export interface AgentSpec {
212
221
  files?: InputFile[];
213
222
  /** Session id of an earlier realtime run to continue: its saved conversation is restored and the definition's prompt is not sent. */
214
223
  resumeSession?: string;
224
+ /** Repositories to clone for this run; when set they replace the AgentDefinition's resources.repos. */
225
+ repos?: RepoRef[];
226
+ /** Conversation to continue and the id to save under; each field set here wins over the same field of the AgentDefinition's resources.conversation. */
227
+ conversation?: ConversationRef;
228
+ /** Where this run's output goes; see RunOutput for how each field combines with the AgentDefinition's output. */
229
+ output?: RunOutput;
230
+ /** Secrets exposed to this run, such as per-run credentials; an entry replaces the AgentDefinition's resources.secrets entry of the same name, others are added. */
231
+ secrets?: SecretRef[];
232
+ /** Environment values for this run, such as ones derived from its inputs; an entry replaces the AgentDefinition's resources.env entry of the same name, others are added. */
233
+ env?: EnvVar[];
215
234
  }
216
235
  export interface AgentStatus {
217
236
  phase?: Phase;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@re-cinq/agent-contracts",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "TypeScript types + client for the ai-agent-subsystem CRDs (Agent / Station / AgentDefinition). Types are generated from the D source so they cannot drift.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {