@re-cinq/floor-contracts 0.2.0 → 0.4.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.
@@ -92,6 +92,8 @@ export interface StationBody {
92
92
  conversationKey?: string;
93
93
  outcomes: string[];
94
94
  mustChange?: boolean;
95
+ /** Agent kind only: an agent that ends with neither a `LORE_NODE_RESULT:` line nor a `REVIEW_RESULT:` verdict has failed its visit, instead of being read as `success`. */
96
+ resultRequired?: boolean;
95
97
  needs: NeedSpec[];
96
98
  produces: ProduceSpec[];
97
99
  /** Service kind only. */
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type { AgentDefinitionBody, AgentSettings, Brief, Item, ItemKind, LineArgSpec, LineBody, LineEdge, LineNode, LineNodeReport, LineStart, ModelPrice, NeedSpec, ProduceSpec, Report, ScheduleBody, StationBody, StationKind, WhenValue, } from "./definitions.js";
2
- export type { BlobRef, BriefConversation, BriefNeed, BriefSettings, ClaimedEvent, DefinitionKind, ExecutorSettings, FileNeed, GitCredential, GitNeed, McpServerSettings, PodResources, MigrationBody, Problem, PutResult, ValueNeed, VisitBrief, } from "./wire.js";
2
+ export type { AgentPresence, AgentRecipes, BlobRef, BriefConversation, BriefNeed, BriefSettings, ClaimedEvent, ClusterHolding, ClusterPresence, DefinitionKind, ExecutorSettings, FileNeed, GitCredential, GitNeed, McpServerSettings, PodResources, PresenceState, MigrationBody, Problem, PutResult, ValueNeed, VisitBrief, } from "./wire.js";
3
3
  export type { CostsRow, DefinitionRowFields, DefinitionRowView, FloorEventFields, FloorEventView, FloorFrame, LiveFrame, RecordKind, RunFields, RunView, StationRunRecordFields, StationRunRecordView, VisitFields, VisitView, } from "./views.js";
package/dist/wire.d.ts CHANGED
@@ -63,10 +63,12 @@ export interface PodResources {
63
63
  requests?: Record<string, string>;
64
64
  limits?: Record<string, string>;
65
65
  }
66
+ /** `timeoutMinutes` is the definition's own work budget, the same for every visit; `VisitBrief.deadlineMinutes` is what is left of this visit's. */
66
67
  export type BriefSettings = ExecutorSettings & {
67
68
  model?: string;
68
69
  prompt: string;
69
70
  image: string;
71
+ timeoutMinutes?: number;
70
72
  };
71
73
  /** `GET /station-runs/:id/brief`: everything an executor needs to run one visit, and a token that reaches only this visit. */
72
74
  export interface VisitBrief {
@@ -87,15 +89,57 @@ export interface VisitBrief {
87
89
  conversation: BriefConversation;
88
90
  modelSecretKey?: string;
89
91
  }
90
- /** `POST /events/claim` answers only the two events a worker may take, and both name the visit they are about. */
91
- export interface ClaimedEvent {
92
+ interface ClaimedFields {
92
93
  id: string;
94
+ tags: string[];
95
+ attempts: number;
96
+ }
97
+ /** `POST /events/claim` answers only what a worker may take: a visit to dispatch or abort, or an agent definition whose latest version this cluster should hold. */
98
+ export type ClaimedEvent = (ClaimedFields & {
93
99
  name: "station_run.dispatch" | "station_run.abort";
94
100
  payload: {
95
101
  visitId: string;
96
102
  };
97
- tags: string[];
98
- attempts: number;
103
+ }) | (ClaimedFields & {
104
+ name: "agent_definition.changed";
105
+ payload: {
106
+ id: string;
107
+ hash: string;
108
+ };
109
+ });
110
+ /** all: every live cluster holds the latest version. some: a cluster holds a version, but not every one the latest. none: no cluster holds any. */
111
+ export type PresenceState = "all" | "some" | "none";
112
+ export interface ClusterPresence {
113
+ id: string;
114
+ /** The version this cluster's kube holds; null when it holds none. */
115
+ hash: string | null;
116
+ current: boolean;
117
+ }
118
+ /** `GET /agent-definitions/presence`, by agent definition id. */
119
+ export interface AgentPresence {
120
+ state: PresenceState;
121
+ latest: string;
122
+ clusters: ClusterPresence[];
123
+ }
124
+ /** `GET /agent-definitions/{id}/clusters`: what one cluster read back out of its kube. */
125
+ export interface ClusterHolding<Body = unknown> {
126
+ clusterId: string;
127
+ hash: string;
128
+ body: Body;
129
+ appliedAt: string;
130
+ }
131
+ /** `GET /agent-definitions/{id}/recipes`: the latest version, and the settings a visit of each variant is briefed with. `variant` null is the base. */
132
+ export interface AgentRecipes<Body = unknown> {
133
+ id: string;
134
+ hash: string;
135
+ body: Body;
136
+ /** The floor as a pod reaches it, as a visit's brief says it. */
137
+ floorBaseUrl: string;
138
+ recipes: {
139
+ variant: string | null;
140
+ settings: BriefSettings;
141
+ modelSecretKey?: string;
142
+ }[];
99
143
  }
100
144
  /** What a floor answers for bytes it now keeps: `POST /blobs`, and a saved conversation. */
101
145
  export interface BlobRef {
@@ -117,3 +161,4 @@ export interface GitCredential {
117
161
  username: string;
118
162
  password: string;
119
163
  }
164
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@re-cinq/floor-contracts",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "The floor's wire, as types: what its HTTP routes and its live socket take and answer, and nothing else. No runtime, no dependencies.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {