runbios-sdk 0.2.1-dev.120 → 0.2.1-dev.123

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/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export declare const VERSION = "0.2.1-dev.120";
39
+ export declare const VERSION = "0.2.1-dev.123";
40
40
  export declare class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  readonly models: Models;
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import { Loop } from './resources/loop.js';
36
36
  * SDK version. Sent as part of the User-Agent header.
37
37
  * Must match package.json "version" -- enforced by a contract test.
38
38
  */
39
- export const VERSION = '0.2.1-dev.120';
39
+ export const VERSION = '0.2.1-dev.123';
40
40
  export class RunBiOS {
41
41
  /** Search models, fetch configs, check adapter compatibility. */
42
42
  models;
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
2
+ import type { LoopTrace, LoopTraceListResponse, LoopTraceListParams, LoopCaptureParams, LoopCaptureResult, LoopImportParams, LoopImportResult, LoopSignal, LoopSignalParams, LoopCandidate, LoopCandidateParams, LoopGrader, LoopGraderParams, LoopLabel, LoopLabelCount, LoopGradeResult, LoopDataset, LoopDatasetListParams, LoopDatasetItem, LoopDatasetCreateParams, LoopConfig, LoopConfigParams, LoopBuildRule, LoopBuildRuleParams, LoopStats, LoopJudge, LoopJudgeParams, LoopJudgeRun, LoopJudgeWork, LoopJudgeVerdict, LoopJudgeVerdictResult } from '../types.js';
3
3
  /**
4
4
  * The Conscious Loop -- capture what your model was asked and answered, record
5
5
  * whether it was right, and turn those judgements into training data.
@@ -238,6 +238,32 @@ export declare class Loop {
238
238
  */
239
239
  createDataset(params: LoopDatasetCreateParams): Promise<LoopDataset>;
240
240
  /** List training sets, newest first. */
241
+ /**
242
+ * Stand up a rule that builds a set whenever enough new work exists.
243
+ *
244
+ * The manual path asks somebody to notice that enough conversations have
245
+ * been reviewed, remember which filters describe the slice they want, and
246
+ * press build — every time. A rule is that instruction, stored.
247
+ *
248
+ * `spec` is the same selection `createDataset` takes and is replayed
249
+ * verbatim, so an automatic set is identical to a hand-made one.
250
+ *
251
+ * `min_new_rows` counts only work reviewed SINCE THE LAST BUILD. Counting
252
+ * the whole corpus would fire the rule every interval forever, because a
253
+ * total that has crossed a threshold stays across it.
254
+ */
255
+ createBuildRule(params: LoopBuildRuleParams): Promise<LoopBuildRule>;
256
+ /**
257
+ * Every build rule, with what each one last did and why.
258
+ *
259
+ * `last_reason` is the field worth reading: a rule quiet because it is
260
+ * waiting looks exactly like one quiet because it is broken.
261
+ */
262
+ listBuildRules(): Promise<LoopBuildRule[]>;
263
+ /** Stop a standing build rule. Sets it already produced are untouched. */
264
+ deleteBuildRule(id: string): Promise<{
265
+ deleted: boolean;
266
+ }>;
241
267
  listDatasets(params?: LoopDatasetListParams): Promise<LoopDataset[]>;
242
268
  /** Read one training set and its curation report. */
243
269
  getDataset(id: string): Promise<LoopDataset>;
@@ -113,6 +113,10 @@ export class Loop {
113
113
  if (k && v)
114
114
  q.append('attr', `${k}:${v}`);
115
115
  }
116
+ if (params.model)
117
+ q.set('model', params.model);
118
+ if (params.origin)
119
+ q.set('origin', params.origin);
116
120
  if (params.unlabelled)
117
121
  q.set('unlabelled', 'true');
118
122
  if (params.limit != null)
@@ -309,6 +313,39 @@ export class Loop {
309
313
  return res.dataset;
310
314
  }
311
315
  /** List training sets, newest first. */
316
+ // ── build rules ───────────────────────────────────────────────────────
317
+ /**
318
+ * Stand up a rule that builds a set whenever enough new work exists.
319
+ *
320
+ * The manual path asks somebody to notice that enough conversations have
321
+ * been reviewed, remember which filters describe the slice they want, and
322
+ * press build — every time. A rule is that instruction, stored.
323
+ *
324
+ * `spec` is the same selection `createDataset` takes and is replayed
325
+ * verbatim, so an automatic set is identical to a hand-made one.
326
+ *
327
+ * `min_new_rows` counts only work reviewed SINCE THE LAST BUILD. Counting
328
+ * the whole corpus would fire the rule every interval forever, because a
329
+ * total that has crossed a threshold stays across it.
330
+ */
331
+ async createBuildRule(params) {
332
+ const res = await this._http.fetchPost('/api/loop/build-rules', params);
333
+ return res.rule;
334
+ }
335
+ /**
336
+ * Every build rule, with what each one last did and why.
337
+ *
338
+ * `last_reason` is the field worth reading: a rule quiet because it is
339
+ * waiting looks exactly like one quiet because it is broken.
340
+ */
341
+ async listBuildRules() {
342
+ const res = await this._http.fetchGet('/api/loop/build-rules');
343
+ return res.rules ?? [];
344
+ }
345
+ /** Stop a standing build rule. Sets it already produced are untouched. */
346
+ async deleteBuildRule(id) {
347
+ return this._http.fetchDelete(`/api/loop/build-rules/${encodeURIComponent(id)}`);
348
+ }
312
349
  async listDatasets(params = {}) {
313
350
  const q = new URLSearchParams();
314
351
  if (params.method)
package/dist/types.d.ts CHANGED
@@ -2286,6 +2286,10 @@ export interface LoopTraceListParams {
2286
2286
  unlabelled?: boolean;
2287
2287
  limit?: number;
2288
2288
  offset?: number;
2289
+ /** Only what ONE model answered — the filter distillation is made of. */
2290
+ model?: string;
2291
+ /** `captured` (our model's own behaviour) or `imported` (a file somebody brought). */
2292
+ origin?: 'captured' | 'imported';
2289
2293
  }
2290
2294
  export interface LoopTraceListResponse {
2291
2295
  traces: LoopTrace[];
@@ -2314,6 +2318,10 @@ export interface LoopDatasetCreateParams {
2314
2318
  attributes?: Record<string, string>;
2315
2319
  /** Only the conversations nobody has described yet. */
2316
2320
  unlabelled?: boolean;
2321
+ /** Only what ONE model answered — the filter distillation is made of. */
2322
+ model?: string;
2323
+ /** `captured` (our model's own behaviour) or `imported` (a file somebody brought). */
2324
+ origin?: 'captured' | 'imported';
2317
2325
  }
2318
2326
  export interface LoopDataset {
2319
2327
  id: string;
@@ -2357,12 +2365,54 @@ export interface LoopConfig {
2357
2365
  enabled_by: string | null;
2358
2366
  enabled_at: string | null;
2359
2367
  updated_at: string;
2368
+ auto_grade: boolean;
2369
+ }
2370
+ export interface LoopBuildRuleParams {
2371
+ name: string;
2372
+ method: string;
2373
+ /**
2374
+ * How many rows reviewed SINCE THE LAST BUILD must exist before this fires
2375
+ * again. Minimum 10. Counting the whole corpus instead would fire the rule
2376
+ * every interval forever, because a total that has crossed a threshold stays
2377
+ * across it.
2378
+ */
2379
+ min_new_rows?: number;
2380
+ enabled?: boolean;
2381
+ /** The same selection `createDataset` takes, replayed verbatim. */
2382
+ spec?: LoopDatasetCreateParams;
2383
+ }
2384
+ export interface LoopBuildRule {
2385
+ id: string;
2386
+ workspace_id: string;
2387
+ name: string;
2388
+ method: string;
2389
+ spec: Record<string, unknown>;
2390
+ min_new_rows: number;
2391
+ enabled: boolean;
2392
+ last_built_at: string | null;
2393
+ last_dataset_id: string | null;
2394
+ /**
2395
+ * Why the rule did not fire last time it was checked. A rule quiet because
2396
+ * it is waiting looks exactly like one quiet because it is broken; this is
2397
+ * the difference.
2398
+ */
2399
+ last_reason: string | null;
2400
+ last_checked_at: string | null;
2401
+ created_by: string | null;
2402
+ created_at: string;
2403
+ updated_at: string;
2360
2404
  }
2361
2405
  export interface LoopConfigParams {
2362
2406
  enabled: boolean;
2363
2407
  retention_days?: number;
2364
2408
  /** Deterministic per conversation, so turns are never split. 0 < rate <= 1. */
2365
2409
  sample_rate?: number;
2410
+ /**
2411
+ * Continuous rule-based scoring for this source. OMITTED MEANS UNCHANGED:
2412
+ * a caller saving retention must not switch grading off for a workspace
2413
+ * that turned it on.
2414
+ */
2415
+ auto_grade?: boolean;
2366
2416
  }
2367
2417
  /** One thing a judge scores, separately from the others. */
2368
2418
  export interface LoopJudgeDimension {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbios-sdk",
3
- "version": "0.2.1-dev.120",
3
+ "version": "0.2.1-dev.123",
4
4
  "description": "Official TypeScript SDK for the Run BiOS training and deployment platform API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",