@openwop/openwop 1.1.5 → 1.1.6

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/src/types.ts CHANGED
@@ -125,7 +125,12 @@ export interface RunConfigurable {
125
125
  }
126
126
 
127
127
  export interface CreateRunRequest {
128
- workflowId: string;
128
+ /**
129
+ * The workflow to run. Required for a normal run; OMITTED for an eval run
130
+ * (`mode: 'eval'`), which targets `agentId` + `evalSuiteRef` instead
131
+ * (RFC 0081 §B). The server enforces the conditional requirement.
132
+ */
133
+ workflowId?: string;
129
134
  inputs?: Record<string, unknown>;
130
135
  tenantId?: string;
131
136
  scopeId?: string;
@@ -133,6 +138,12 @@ export interface CreateRunRequest {
133
138
  configurable?: RunConfigurable;
134
139
  tags?: readonly string[];
135
140
  metadata?: Record<string, unknown>;
141
+ /** RFC 0081 §B. `'eval'` makes this run an eval-suite projection (see `evalSuiteRef` + `agentId`). Omit for a normal workflow run. */
142
+ mode?: 'eval';
143
+ /** RFC 0081. URI of the `AgentEvalSuite` to run. Required when `mode === 'eval'`. */
144
+ evalSuiteRef?: string;
145
+ /** RFC 0081. The manifest agent the eval suite targets. Required when `mode === 'eval'`. */
146
+ agentId?: string;
136
147
  }
137
148
 
138
149
  export interface CreateRunResponse {
@@ -1054,3 +1065,244 @@ export interface AgentInventoryResponse {
1054
1065
  agents: AgentInventoryEntry[];
1055
1066
  total: number;
1056
1067
  }
1068
+
1069
+ /* ── Standing agent roster + org-chart (RFC 0086 / 0087) ──────────────── */
1070
+
1071
+ /** RFC 0086 §A — a standing agent INSTANCE: a `host:<id>` AgentRef that
1072
+ * references a manifest/deployment and owns a workflow portfolio. */
1073
+ export interface AgentRosterEntry {
1074
+ rosterId: string;
1075
+ persona: string;
1076
+ agentRef: { agentId: string; version?: string; channel?: string };
1077
+ workflows?: string[];
1078
+ owner: { tenantId: string; workspaceId?: string };
1079
+ enabled?: boolean;
1080
+ label?: string;
1081
+ description?: string;
1082
+ }
1083
+
1084
+ /** Response for `GET /v1/agents/roster` (RFC 0086 §B). */
1085
+ export interface AgentRosterResponse {
1086
+ roster: AgentRosterEntry[];
1087
+ total: number;
1088
+ }
1089
+
1090
+ /** RFC 0087 §A — an org-chart department (a tree node via `parentDepartmentId`). */
1091
+ export interface OrgChartDepartment {
1092
+ departmentId: string;
1093
+ name: string;
1094
+ parentDepartmentId: string | null;
1095
+ roles: { roleId: string; name: string }[];
1096
+ }
1097
+
1098
+ /** RFC 0087 §A — an org-chart member (a roster instance placed in a dept/role). */
1099
+ export interface OrgChartMember {
1100
+ rosterId: string;
1101
+ departmentId: string;
1102
+ roleId: string;
1103
+ reportsTo: string | null;
1104
+ }
1105
+
1106
+ /** RFC 0087 §A — the descriptive org-chart over roster members. Carries no
1107
+ * authority-bearing field by design (§B `org-position-no-authority-escalation`). */
1108
+ export interface AgentOrgChart {
1109
+ owner: { tenantId: string; workspaceId?: string };
1110
+ departments: OrgChartDepartment[];
1111
+ members: OrgChartMember[];
1112
+ }
1113
+
1114
+ /** Response for `GET /v1/agents/org-chart/{departmentId}` (RFC 0087 §D) — the
1115
+ * department subtree + the responsibility roll-up (union of member portfolios). */
1116
+ export interface OrgChartResponsibilityView {
1117
+ department: OrgChartDepartment;
1118
+ members: OrgChartMember[];
1119
+ responsibilities: string[];
1120
+ }
1121
+
1122
+ /* ── User-authored agents (sample-extension; non-normative) ─────────────
1123
+ * Backs the workflow-engine sample app's Agents tab. Pack-installed
1124
+ * agents come through `AgentInventoryEntry` above (RFC 0072 §A
1125
+ * normative inventory). The types below mirror the sample-host
1126
+ * `POST /v1/host/sample/agents` create surface — they're scoped to
1127
+ * the sample-extension and may evolve independently of the
1128
+ * normative agent surface. Future RFC promotion would migrate these
1129
+ * to the normative wire shape.
1130
+ */
1131
+
1132
+ /** Body for `POST /v1/host/sample/agents`. The server synthesises
1133
+ * the agentId as `user.<tenantId>.<persona-slug>`. */
1134
+ export interface CreateUserAgentRequest {
1135
+ /** Short name; becomes the `@`-mention slug and chat panel label.
1136
+ * Required, ≤64 chars. */
1137
+ persona: string;
1138
+ /** Longer display name; defaults to the persona when omitted. */
1139
+ label?: string;
1140
+ description?: string;
1141
+ /** One of: `chat`, `reasoning`, `coding`, `extraction`. */
1142
+ modelClass: string;
1143
+ /** Inline system prompt body; ≤16 000 chars. The sample-host stores
1144
+ * it directly (no pack-file ref). */
1145
+ systemPrompt: string;
1146
+ /** Capability ids the agent is allowed to call; ≤32 entries. */
1147
+ toolAllowlist?: string[];
1148
+ memoryShape?: {
1149
+ scratchpad?: boolean;
1150
+ conversation?: boolean;
1151
+ longTerm?: boolean;
1152
+ };
1153
+ /** 0.0-1.0; decisions below this are surfaced as low-confidence. */
1154
+ confidenceThreshold?: number;
1155
+ }
1156
+
1157
+ /** Response body for `POST /v1/host/sample/agents` — shaped to
1158
+ * match `AgentInventoryEntry` minus normative-only fields, so a
1159
+ * follow-up `GET /v1/agents` returns a row of the same shape. */
1160
+ export interface UserAgentRecord {
1161
+ agentId: string;
1162
+ persona: string;
1163
+ label: string;
1164
+ description?: string;
1165
+ modelClass: string;
1166
+ packName: string;
1167
+ packVersion: string;
1168
+ toolAllowlist: string[];
1169
+ memoryShape: {
1170
+ scratchpad: boolean;
1171
+ conversation: boolean;
1172
+ longTerm: boolean;
1173
+ };
1174
+ confidenceThreshold?: number;
1175
+ hasHandoffSchemas: false;
1176
+ }
1177
+
1178
+ /** One installable agent-pack summary from the sample host's local
1179
+ * registry mirror (`GET /v1/host/sample/registry/agent-packs`). */
1180
+ export interface AgentPackSummary {
1181
+ /** Pack name, e.g. `core.openwop.agents.code-reviewer`. */
1182
+ name: string;
1183
+ version: string;
1184
+ description?: string;
1185
+ /** Personas declared by the pack's `agents[]` (per RFC 0003). */
1186
+ personas: string[];
1187
+ /** True when at least one of the pack's agents is registered in
1188
+ * this host's in-process AgentRegistry. */
1189
+ installed: boolean;
1190
+ }
1191
+
1192
+ export interface AgentPackRegistryResponse {
1193
+ packs: AgentPackSummary[];
1194
+ total: number;
1195
+ }
1196
+
1197
+ export interface InstallAgentPackRequest {
1198
+ /** Must start with `core.openwop.agents.` — the sample's install
1199
+ * route filters to that namespace. */
1200
+ name: string;
1201
+ /** Defaults to `1.0.0` when omitted. */
1202
+ version?: string;
1203
+ }
1204
+
1205
+ export interface InstallAgentPackResponse {
1206
+ name: string;
1207
+ version: string;
1208
+ /** True when the pack was newly installed; false when it was
1209
+ * already present in the registry. */
1210
+ installed: boolean;
1211
+ alreadyInstalled: boolean;
1212
+ }
1213
+
1214
+ // ── RFC 0081 — Agent evaluation (eval-summary.schema.json) ─────────────
1215
+
1216
+ /** Abstract model class (RFC 0002 / RFC 0003 manifest vocabulary). */
1217
+ export type AgentModelClass =
1218
+ | 'reasoning'
1219
+ | 'writing'
1220
+ | 'coding'
1221
+ | 'research'
1222
+ | 'classification'
1223
+ | 'general';
1224
+
1225
+ /** A redaction-safe safety finding ({kind, severity} descriptor — never excerpted content). */
1226
+ export interface EvalSafetyFinding {
1227
+ kind: string;
1228
+ severity: 'low' | 'medium' | 'high' | 'critical';
1229
+ }
1230
+
1231
+ /** Per-task result on an `EvalSummary` (content-free: scores + scalars + ids). */
1232
+ export interface EvalTaskResult {
1233
+ taskId: string;
1234
+ score: number;
1235
+ passed: boolean;
1236
+ costUsd?: number;
1237
+ latencyMs?: number;
1238
+ schemaValid?: boolean;
1239
+ safetyFindings?: readonly EvalSafetyFinding[];
1240
+ }
1241
+
1242
+ /** The regression block on an `EvalSummary` (RFC 0081 §D `regression` mode). */
1243
+ export interface EvalRegression {
1244
+ baselineRunId: string;
1245
+ scoreDelta: number;
1246
+ diffRef?: string;
1247
+ }
1248
+
1249
+ /**
1250
+ * RFC 0081 §C — the terminal scorecard of an eval run, read via
1251
+ * `client.runs.evalSummary(runId)`. Content-free: scores, scalars, ids, and
1252
+ * redaction-safe safety descriptors only (`eval-summary-no-content-leak`).
1253
+ */
1254
+ export interface EvalSummary {
1255
+ suiteId: string;
1256
+ suiteVersion: string;
1257
+ evaluatedModelClass?: AgentModelClass;
1258
+ aggregateScore: number;
1259
+ passed: boolean;
1260
+ taskCount: number;
1261
+ passedCount: number;
1262
+ totalCostUsd?: number;
1263
+ tasks: readonly EvalTaskResult[];
1264
+ regression?: EvalRegression;
1265
+ }
1266
+
1267
+ // ── RFC 0082 — Agent deployment lifecycle ─────────────────────────────
1268
+
1269
+ /** The seven-state deployment lifecycle (RFC 0082 §C). */
1270
+ export type DeploymentState =
1271
+ | 'draft'
1272
+ | 'test'
1273
+ | 'staged'
1274
+ | 'active'
1275
+ | 'paused'
1276
+ | 'deprecated'
1277
+ | 'rolled-back';
1278
+
1279
+ /**
1280
+ * RFC 0082 §C — a per-(agentId, version) deployment record, returned by
1281
+ * `client.agents.listDeployments` / `transitionDeployment`. Host-runtime state
1282
+ * distinct from the immutable manifest and the registry's published tags.
1283
+ */
1284
+ export interface AgentDeployment {
1285
+ agentId: string;
1286
+ version: string;
1287
+ state: DeploymentState;
1288
+ canaryPercent?: number;
1289
+ rollbackPointer?: string;
1290
+ channels?: readonly string[];
1291
+ evalRunId?: string;
1292
+ approvalGateId?: string;
1293
+ }
1294
+
1295
+ /**
1296
+ * RFC 0082 §E — the `transitionDeployment` request body. The host authorizes it
1297
+ * fail-closed (RFC 0049 `deploy:*`), runs any RFC 0051 approvalGate, and enforces
1298
+ * RFC 0081 `requiredEval` before emitting `deployment.promoted`.
1299
+ */
1300
+ export interface AgentDeploymentTransition {
1301
+ version: string;
1302
+ transition: 'promote' | 'pause' | 'deprecate' | 'rollback' | 'adjust-canary';
1303
+ toState?: DeploymentState;
1304
+ channel?: string;
1305
+ canaryPercent?: number;
1306
+ evalRunId?: string;
1307
+ reason?: string;
1308
+ }