runbios-mcp 0.2.16 → 0.2.17-dev.268
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 +22 -11
- package/dist/capabilities.d.ts +20 -9
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +3 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/config.d.ts +30 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +25 -2
- package/dist/config.js.map +1 -1
- package/dist/http/assistant.d.ts +25 -0
- package/dist/http/assistant.d.ts.map +1 -1
- package/dist/http/assistant.js +202 -47
- package/dist/http/assistant.js.map +1 -1
- package/dist/http/main.js +2 -0
- package/dist/http/main.js.map +1 -1
- package/dist/http/mcp-handler.d.ts.map +1 -1
- package/dist/http/mcp-handler.js +6 -1
- package/dist/http/mcp-handler.js.map +1 -1
- package/dist/http/metadata.js +1 -1
- package/dist/http/metadata.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +58 -71
- package/dist/server.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-handler.d.ts","sourceRoot":"","sources":["../../src/http/mcp-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;GAMG;AAEH;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,YAAY,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB;AAgBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,IAGnB,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"mcp-handler.d.ts","sourceRoot":"","sources":["../../src/http/mcp-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C;;;;;;GAMG;AAEH;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,YAAY,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB;AAgBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,IAGnB,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CA2FhF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CASlE"}
|
package/dist/http/mcp-handler.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
2
2
|
import { BiosClient } from "../api-client.js";
|
|
3
3
|
import { withoutAbsentCapabilities } from "../capabilities.js";
|
|
4
|
-
import { sessionLaunchGates } from "../config.js";
|
|
4
|
+
import { sessionLaunchGates, withoutLaunchGatedTools } from "../config.js";
|
|
5
5
|
import { createBiosMcpServer, VERSION } from "../server.js";
|
|
6
6
|
import { validateAccessToken } from "./oauth.js";
|
|
7
7
|
function unauthorized(res, cfg) {
|
|
@@ -59,6 +59,11 @@ export function createMcpPostHandler(deps) {
|
|
|
59
59
|
allowedTools.delete(name);
|
|
60
60
|
}
|
|
61
61
|
allowedTools.delete("upload_dataset");
|
|
62
|
+
// The environment decides first (the Conscious Loop is development-only,
|
|
63
|
+
// RUNBIOS_LOOP_COMING_SOON on this task definition), then the probe drops
|
|
64
|
+
// any family whose backend this environment does not answer for. The
|
|
65
|
+
// order matters: a family the gate has already removed is never probed.
|
|
66
|
+
withoutLaunchGatedTools(allowedTools, launchGates);
|
|
62
67
|
await withoutAbsentCapabilities(client, allowedTools);
|
|
63
68
|
const server = createBiosMcpServer(client, {
|
|
64
69
|
onToolCall: (info) => audit.emit("mcp_tool_call", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-handler.js","sourceRoot":"","sources":["../../src/http/mcp-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-handler.js","sourceRoot":"","sources":["../../src/http/mcp-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAuBjD,SAAS,YA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,CAAC;YACP,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACnB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE;oBACzD,EAAE,EAAE,IAAI;iBACT,CAAC,CAAC;YACL,CAAC;iBAAM,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;gBAC9B,GAAG,CAAC,GAAG,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAY,EAAE,GAAa;IAC1D,GAAG;SACA,MAAM,CAAC,GAAG,CAAC;SACX,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC;SACpB,IAAI,CAAC;QACJ,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,8DAA8D,EAAE;QAChG,EAAE,EAAE,IAAI;KACT,CAAC,CAAC;AACP,CAAC"}
|
package/dist/http/metadata.js
CHANGED
|
@@ -2,7 +2,7 @@ import { CANONICAL_SCOPES } from "./oauth.js";
|
|
|
2
2
|
// Docs live on the console; the origin is derived per environment from the
|
|
3
3
|
// hosted config's public base when available, with the production console as
|
|
4
4
|
// the default for published builds (customers use prod).
|
|
5
|
-
const DOCS_URL = `${(process.env.RUNBIOS_PLATFORM_ORIGIN || process.env.BIOS_PLATFORM_ORIGIN || "https://platform.runbios.ai").replace(/\/$/, "")}/docs/mcp`;
|
|
5
|
+
const DOCS_URL = `${(process.env.RUNBIOS_PLATFORM_ORIGIN || process.env.BIOS_PLATFORM_ORIGIN || "https://platform-dev.runbios.ai").replace(/\/$/, "")}/docs/mcp`;
|
|
6
6
|
/** RFC 9728 protected resource metadata. */
|
|
7
7
|
export function protectedResourceMetadata(cfg) {
|
|
8
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/http/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,2EAA2E;AAC3E,6EAA6E;AAC7E,yDAAyD;AACzD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/http/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,2EAA2E;AAC3E,6EAA6E;AAC7E,yDAAyD;AACzD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,iCAAiC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC;AAEjK,4CAA4C;AAC5C,MAAM,UAAU,yBAAyB,CAAC,GAAiB;IACzD,OAAO;QACL,QAAQ,EAAE,GAAG,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,aAAa,EAAE;QACpD,qBAAqB,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC;QAC1C,gBAAgB,EAAE,CAAC,GAAG,gBAAgB,CAAC;QACvC,wBAAwB,EAAE,CAAC,QAAQ,CAAC;QACpC,aAAa,EAAE,UAAU;QACzB,sBAAsB,EAAE,QAAQ;KACjC,CAAC;AACJ,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,2BAA2B,CAAC,GAAiB;IAC3D,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,aAAa;QACzB,sBAAsB,EAAE,GAAG,GAAG,CAAC,aAAa,sBAAsB;QAClE,cAAc,EAAE,GAAG,GAAG,CAAC,aAAa,kBAAkB;QACtD,qBAAqB,EAAE,GAAG,GAAG,CAAC,aAAa,qBAAqB;QAChE,wBAAwB,EAAE,CAAC,MAAM,CAAC;QAClC,qBAAqB,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QAC9D,gCAAgC,EAAE,CAAC,MAAM,CAAC;QAC1C,qCAAqC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,CAAC;QAC5F,gBAAgB,EAAE,CAAC,GAAG,gBAAgB,CAAC;QACvC,qBAAqB,EAAE,QAAQ;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ function platformOriginFromApiBase(apiBase) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
catch { /* fall through */ }
|
|
24
|
-
return "https://platform.runbios.ai";
|
|
24
|
+
return "https://platform-dev.runbios.ai";
|
|
25
25
|
}
|
|
26
26
|
const API_KEY = envValue("API_KEY");
|
|
27
27
|
const ACCESS_TOKEN = envValue("ACCESS_TOKEN");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,8EAA8E;AAC9E,sDAAsD;AACtD,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,IAAI,EAAE,C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EAA6E;KAC5E,EAAE,MAAM,kBAAkB,CAAC,YAAY,EAAE,GAAG,EAAE,CAC7C,MAAM,CAAC,GAAG,CACR,sBAAsB,kBAAkB,CAAC,YAAY,CAAC,WAAW,CAClE,CACF,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkDpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkDpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAwC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;CAC3C;AAUD,MAAM,WAAW,sBAAsB;IAErC,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA6CD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CA0BpE;AAyWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAkDrE;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAiD/D;AAID,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,KAAK,CAAC,EAAE,WAAW,EACnB,cAAc,CAAC,EAAE,sBAAsB,EAOvC,WAAW,GAAE,WAAkC,EAC/C,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,SAAS,CAulHX"}
|
package/dist/server.js
CHANGED
|
@@ -22,7 +22,7 @@ const RAW_FAILURE_TEXT_FIELDS = [
|
|
|
22
22
|
"last_error",
|
|
23
23
|
"stage_detail",
|
|
24
24
|
];
|
|
25
|
-
import { resolveLaunchGates } from "./config.js";
|
|
25
|
+
import { LOOP_TOOL_PREFIX, resolveLaunchGates } from "./config.js";
|
|
26
26
|
import { VERSION } from "./version.js";
|
|
27
27
|
export { VERSION };
|
|
28
28
|
/**
|
|
@@ -715,10 +715,54 @@ launchGates = resolveLaunchGates(), allowedTools) {
|
|
|
715
715
|
overlong_policy: z.enum(["truncate", "drop"]).optional()
|
|
716
716
|
.describe("SFT only. 'truncate' trims oldest context while preserving a trainable answer; 'drop' skips overlong samples. CPT packs raw text and does not use this policy."),
|
|
717
717
|
};
|
|
718
|
+
// The platform guide's Conscious Loop section. Where the loop is not offered
|
|
719
|
+
// (launchGates.loop) no loop tool is registered, so the guide says nothing about
|
|
720
|
+
// the loop at all: an agent that reads a tool name will try it. The alias tools
|
|
721
|
+
// are inference tools that stay registered either way, so they keep a line of
|
|
722
|
+
// their own there.
|
|
723
|
+
const loopGuideSection = launchGates.loop
|
|
724
|
+
? `## Inference Aliases
|
|
725
|
+
- set_inference_alias / list_inference_aliases / delete_inference_alias - Re-pointable public handles: a name customers call that can be moved to different weights without them changing anything.`
|
|
726
|
+
: `## Conscious Loop MCP Tools
|
|
727
|
+
The loop turns what a deployed model actually did into what it learns next.
|
|
728
|
+
NOTHING IS RECORDED until loop_set_capture turns a source on — capture is a
|
|
729
|
+
consent decision, not a default, and these tools cannot bypass it.
|
|
730
|
+
1. loop_set_capture - Turn recording on or off for a source and set how long conversations are kept. Start here; every other loop tool is inert until this is done.
|
|
731
|
+
2. loop_capture_trace / loop_import_rows - Record one exchange as it happens (what the model was asked, what it answered, any tool calls), whoever served the model — Run BiOS, another provider, or your own servers. loop_import_rows brings in data that already exists instead: an export, a spreadsheet of past answers, preference pairs. Imported rows arrive as conversations NEEDING REVIEW, never as finished training data.
|
|
732
|
+
3. loop_list_traces / loop_get_trace - Read what has been recorded. Credentials and personal details are stripped before storage, never after.
|
|
733
|
+
4. loop_add_signal - Record whether an answer was right. Append-only. Verdict 'edited' with a correction is the most valuable feedback there is.
|
|
734
|
+
5. loop_add_candidate / loop_list_candidates - Submit ALTERNATIVE answers to a recorded prompt. Sampling the model N times and scoring the samples produces DPO pairs without a human writing each one; a stronger model's answers do distillation the same way.
|
|
735
|
+
6. loop_label_trace / loop_remove_label / loop_list_labels - Carve the corpus into slices. A bare tag with a parent makes a master group; NAMED DIMENSIONS (category, task, language, anything you like) are what let ONE captured corpus become a DIFFERENT dataset for every task, because filters on different dimensions AND together and nothing has to be re-labelled.
|
|
736
|
+
7. loop_create_judge / loop_list_judges - A RUBRIC a model applies, for the question no rule can answer: was this actually helpful. The rubric doubles as a GRPO reward function, which makes prompts with no checkable answer trainable.
|
|
737
|
+
8. loop_start_judge_run then loop_take_judge_work then loop_post_judge_verdicts - Run a rubric over a slice. By default YOU call the model: take the rendered prompt, send it, post the scores back. A judge created with auto=true is run by the platform's agent instead, on the workspace's own serverless account. loop_list_judge_run_items says what happened to each conversation in a run and why a failed one failed, which the work list cannot: it hands out only what is still pending, so a finished run answers it with nothing. loop_stop_judge_run closes a run that will NOT finish, which is what unblocks the judge — an open run blocks the next one, and closing it by posting an empty verdict list with finish set writes 'done' on a pass that covered three of forty.
|
|
738
|
+
9. loop_create_grader / loop_list_graders - Deterministic rules that score answers with no person reading them, weighted so the criteria that matter count more, and aimable at one label so a rule about shipping does not mark down every billing answer.
|
|
739
|
+
10. loop_grade_trace - Apply those rules to an answer AND its samples in one pass. This is what closes the loop automatically.
|
|
740
|
+
11. loop_build_dataset / loop_create_build_rule / loop_list_build_rules / loop_delete_build_rule - Curate the feedback into an sft, dpo, grpo or kto training set, once or STANDING. Always reports why rows were left out. kto takes a bare thumbs-down, which the other three cannot use at all. A build rule is the same curation left running: it fires when enough NEW reviewed work exists, and last_reason says why it did not — a rule quiet because it is waiting reads exactly like one that is broken.
|
|
741
|
+
12. loop_agent_status / loop_enable_agent / loop_disable_agent - The AGENT: the worker that calls a model for the workspace (automatic judges, sample answers). It spends through the workspace's OWN serverless key, so every call is billed like one of theirs; enabling it is SPEND CONSENT and you say so first. Status tells you whether an agent exists in this environment at all.
|
|
742
|
+
13. loop_create_sample_run / loop_list_sample_runs - Have the agent write N alternative answers to each conversation in a slice and score them with a judge. This is how DPO pairs and GRPO groups are made with no human writing each one. State the upper bound of model calls (sample × n × 2) before starting.
|
|
743
|
+
14. loop_list_datasets - The sets built so far, each with how many rows it kept and why the rest were dropped.
|
|
744
|
+
15. loop_preview_dataset / loop_register_dataset_for_training - Read the actual rows before anyone trains on them; each carries the address of the conversation it came from. Registering hands a built set to training as a real dataset id, keeping the link back to the conversations, verdicts and judges that produced it — the alternative is downloading the file and uploading it again as an unrelated dataset, which throws that link away. Register "train" and "holdout" separately when the job should be scored on rows it never saw. The set is then validated like any upload, so poll get_dataset_status before training on it.
|
|
745
|
+
16. loop_stats - How much is recorded, how much is reviewed, and what each method could use right now.
|
|
746
|
+
17. loop_preflight_training_rule - PRICE a standing training rule without creating anything: the pinned revision, the worst hourly price each GPU ladder can reach, how many hours each ceiling buys, the refusals, and terms_text — the sentence the member is agreeing to, with their own figures in it. Always first.
|
|
747
|
+
18. loop_create_training_rule - Create it. SPEND CONSENT, and recorded: accept_terms is the member's signature on that sentence. Read the estimate and terms_text back VERBATIM, wait for an explicit yes, and never state a ceiling, a price cap or an hour count preflight did not return.
|
|
748
|
+
19. loop_list_training_rules / loop_get_training_rule / loop_update_training_rule / loop_consent_training_rule / loop_run_training_rule / loop_delete_training_rule - Read, edit, re-consent, fire now, retire. A money-bearing edit bumps the rule's revision, drops the consent and STOPS FUTURE FIRINGS until somebody accepts the new terms.
|
|
749
|
+
20. loop_list_training_runs / loop_get_training_run / loop_list_pipelines / loop_get_pipeline - What each firing did, its timeline, and available_actions — which says what this reader may actually do next, rather than what the state looks like it allows. The pipeline tools read a rule as the versions it produced: which one serves, how many of max_versions are made, the run in flight, and the month's spend against its limit.
|
|
750
|
+
21. loop_get_evaluation / loop_list_evaluation_items / loop_get_judge_agreement - The comparison behind a verdict: the win rate and the per-dimension means, the paired conversations themselves, and how far the judge already agrees with this workspace's own reviewers. Read the warnings out, not just the verdict.
|
|
751
|
+
22. loop_promote_training_run / loop_reject_training_run / loop_rollback_training_run / loop_cancel_training_run - The decision. Promotion re-points the serving name at the candidate and changes what real customers get; it is undoable for 30 days.
|
|
752
|
+
23. loop_get_agent_settings / loop_update_agent_settings / loop_update_build_rule - The agent's default model, its system prompts and the monthly evaluation cap; and the standing curation rule a training rule draws from.
|
|
753
|
+
24. set_inference_alias / list_inference_aliases / delete_inference_alias - The re-pointable public handles a promotion writes: a name customers call that can be moved to different weights without them changing anything.
|
|
754
|
+
|
|
755
|
+
END TO END: capture what a model was asked and answered, have people or judges say whether it was right, write ONE training rule that curates the reviewed work and trains on it, let the platform compare the result against what serves today, read the comparison, then decide — promote, reject, or leave it. Everything before the rule costs nothing; the rule is where money starts, which is why it carries a recorded consent. Two fields carry the state a user actually asks about and BOTH must be read back in plain words rather than summarised as 'fine': last_reason says why a quiet rule is quiet, because a rule waiting for rows looks identical to a broken one; and accepted_revision against revision (with paused_reason) says whether the rule still has a consent to spend under, because a money-bearing edit pauses it until somebody agrees again.`;
|
|
718
756
|
const server = {
|
|
719
757
|
tool(name, description, paramsSchema, cb) {
|
|
720
758
|
if (allowedTools && !allowedTools.has(name))
|
|
721
759
|
return;
|
|
760
|
+
// PRE-LAUNCH GATE (launchGates.loop — src/config.ts): the Conscious Loop is
|
|
761
|
+
// offered on development only, so where it is gated the WHOLE family stays
|
|
762
|
+
// unregistered, reads included. Nothing about it is offered there, and a
|
|
763
|
+
// listed read would only answer 403 LOOP_COMING_SOON.
|
|
764
|
+
if (launchGates.loop && name.startsWith(LOOP_TOOL_PREFIX))
|
|
765
|
+
return;
|
|
722
766
|
mcp.tool(name, description, paramsSchema, wrapToolHandler(name, cb, hooks?.onToolCall));
|
|
723
767
|
registeredTools.add(name);
|
|
724
768
|
},
|
|
@@ -878,36 +922,7 @@ get_inference_status instead of asserting them.
|
|
|
878
922
|
- get_serverless_savings - Read the authenticated user and workspace's model-promotion savings
|
|
879
923
|
Only the current workspace is readable with analytics:read; serverless inference scope alone is not analytics. Key creation, per-key usage, org-wide totals, and all RPM/spend mutations remain authenticated-console-only.
|
|
880
924
|
|
|
881
|
-
|
|
882
|
-
The loop turns what a deployed model actually did into what it learns next.
|
|
883
|
-
NOTHING IS RECORDED until loop_set_capture turns a source on — capture is a
|
|
884
|
-
consent decision, not a default, and these tools cannot bypass it.
|
|
885
|
-
1. loop_set_capture - Turn recording on or off for a source and set how long conversations are kept. Start here; every other loop tool is inert until this is done.
|
|
886
|
-
2. loop_capture_trace / loop_import_rows - Record one exchange as it happens (what the model was asked, what it answered, any tool calls), whoever served the model — Run BiOS, another provider, or your own servers. loop_import_rows brings in data that already exists instead: an export, a spreadsheet of past answers, preference pairs. Imported rows arrive as conversations NEEDING REVIEW, never as finished training data.
|
|
887
|
-
3. loop_list_traces / loop_get_trace - Read what has been recorded. Credentials and personal details are stripped before storage, never after.
|
|
888
|
-
4. loop_add_signal - Record whether an answer was right. Append-only. Verdict 'edited' with a correction is the most valuable feedback there is.
|
|
889
|
-
5. loop_add_candidate / loop_list_candidates - Submit ALTERNATIVE answers to a recorded prompt. Sampling the model N times and scoring the samples produces DPO pairs without a human writing each one; a stronger model's answers do distillation the same way.
|
|
890
|
-
6. loop_label_trace / loop_remove_label / loop_list_labels - Carve the corpus into slices. A bare tag with a parent makes a master group; NAMED DIMENSIONS (category, task, language, anything you like) are what let ONE captured corpus become a DIFFERENT dataset for every task, because filters on different dimensions AND together and nothing has to be re-labelled.
|
|
891
|
-
7. loop_create_judge / loop_list_judges - A RUBRIC a model applies, for the question no rule can answer: was this actually helpful. The rubric doubles as a GRPO reward function, which makes prompts with no checkable answer trainable.
|
|
892
|
-
8. loop_start_judge_run then loop_take_judge_work then loop_post_judge_verdicts - Run a rubric over a slice. By default YOU call the model: take the rendered prompt, send it, post the scores back. A judge created with auto=true is run by the platform's agent instead, on the workspace's own serverless account. loop_list_judge_run_items says what happened to each conversation in a run and why a failed one failed, which the work list cannot: it hands out only what is still pending, so a finished run answers it with nothing. loop_stop_judge_run closes a run that will NOT finish, which is what unblocks the judge — an open run blocks the next one, and closing it by posting an empty verdict list with finish set writes 'done' on a pass that covered three of forty.
|
|
893
|
-
9. loop_create_grader / loop_list_graders - Deterministic rules that score answers with no person reading them, weighted so the criteria that matter count more, and aimable at one label so a rule about shipping does not mark down every billing answer.
|
|
894
|
-
10. loop_grade_trace - Apply those rules to an answer AND its samples in one pass. This is what closes the loop automatically.
|
|
895
|
-
11. loop_build_dataset / loop_create_build_rule / loop_list_build_rules / loop_delete_build_rule - Curate the feedback into an sft, dpo, grpo or kto training set, once or STANDING. Always reports why rows were left out. kto takes a bare thumbs-down, which the other three cannot use at all. A build rule is the same curation left running: it fires when enough NEW reviewed work exists, and last_reason says why it did not — a rule quiet because it is waiting reads exactly like one that is broken.
|
|
896
|
-
12. loop_agent_status / loop_enable_agent / loop_disable_agent - The AGENT: the worker that calls a model for the workspace (automatic judges, sample answers). It spends through the workspace's OWN serverless key, so every call is billed like one of theirs; enabling it is SPEND CONSENT and you say so first. Status tells you whether an agent exists in this environment at all.
|
|
897
|
-
13. loop_create_sample_run / loop_list_sample_runs - Have the agent write N alternative answers to each conversation in a slice and score them with a judge. This is how DPO pairs and GRPO groups are made with no human writing each one. State the upper bound of model calls (sample × n × 2) before starting.
|
|
898
|
-
14. loop_list_datasets - The sets built so far, each with how many rows it kept and why the rest were dropped.
|
|
899
|
-
15. loop_preview_dataset / loop_register_dataset_for_training - Read the actual rows before anyone trains on them; each carries the address of the conversation it came from. Registering hands a built set to training as a real dataset id, keeping the link back to the conversations, verdicts and judges that produced it — the alternative is downloading the file and uploading it again as an unrelated dataset, which throws that link away. Register "train" and "holdout" separately when the job should be scored on rows it never saw. The set is then validated like any upload, so poll get_dataset_status before training on it.
|
|
900
|
-
16. loop_stats - How much is recorded, how much is reviewed, and what each method could use right now.
|
|
901
|
-
17. loop_preflight_training_rule - PRICE a standing training rule without creating anything: the pinned revision, the worst hourly price each GPU ladder can reach, how many hours each ceiling buys, the refusals, and terms_text — the sentence the member is agreeing to, with their own figures in it. Always first.
|
|
902
|
-
18. loop_create_training_rule - Create it. SPEND CONSENT, and recorded: accept_terms is the member's signature on that sentence. Read the estimate and terms_text back VERBATIM, wait for an explicit yes, and never state a ceiling, a price cap or an hour count preflight did not return.
|
|
903
|
-
19. loop_list_training_rules / loop_get_training_rule / loop_update_training_rule / loop_consent_training_rule / loop_run_training_rule / loop_delete_training_rule - Read, edit, re-consent, fire now, retire. A money-bearing edit bumps the rule's revision, drops the consent and STOPS FUTURE FIRINGS until somebody accepts the new terms.
|
|
904
|
-
20. loop_list_training_runs / loop_get_training_run / loop_list_pipelines / loop_get_pipeline - What each firing did, its timeline, and available_actions — which says what this reader may actually do next, rather than what the state looks like it allows. The pipeline tools read a rule as the versions it produced: which one serves, how many of max_versions are made, the run in flight, and the month's spend against its limit.
|
|
905
|
-
21. loop_get_evaluation / loop_list_evaluation_items / loop_get_judge_agreement - The comparison behind a verdict: the win rate and the per-dimension means, the paired conversations themselves, and how far the judge already agrees with this workspace's own reviewers. Read the warnings out, not just the verdict.
|
|
906
|
-
22. loop_promote_training_run / loop_reject_training_run / loop_rollback_training_run / loop_cancel_training_run - The decision. Promotion re-points the serving name at the candidate and changes what real customers get; it is undoable for 30 days.
|
|
907
|
-
23. loop_get_agent_settings / loop_update_agent_settings / loop_update_build_rule - The agent's default model, its system prompts and the monthly evaluation cap; and the standing curation rule a training rule draws from.
|
|
908
|
-
24. set_inference_alias / list_inference_aliases / delete_inference_alias - The re-pointable public handles a promotion writes: a name customers call that can be moved to different weights without them changing anything.
|
|
909
|
-
|
|
910
|
-
END TO END: capture what a model was asked and answered, have people or judges say whether it was right, write ONE training rule that curates the reviewed work and trains on it, let the platform compare the result against what serves today, read the comparison, then decide — promote, reject, or leave it. Everything before the rule costs nothing; the rule is where money starts, which is why it carries a recorded consent. Two fields carry the state a user actually asks about and BOTH must be read back in plain words rather than summarised as 'fine': last_reason says why a quiet rule is quiet, because a rule waiting for rows looks identical to a broken one; and accepted_revision against revision (with paused_reason) says whether the rule still has a consent to spend under, because a money-bearing edit pauses it until somebody agrees again.`;
|
|
925
|
+
${loopGuideSection}`;
|
|
911
926
|
const guides = {
|
|
912
927
|
overview: `# Run BiOS Fine-Tuning Platform
|
|
913
928
|
|
|
@@ -916,8 +931,8 @@ Run BiOS provides serverless inference, dedicated GPU deployments, datasets, and
|
|
|
916
931
|
## Choose the workflow before calling tools
|
|
917
932
|
- **Need an answer now from a published serverless model?** Use serverless inference: model id + chat_with_inference. No GPU booking or deployment object; billed per token.
|
|
918
933
|
- **Need dedicated capacity or a durable endpoint?** Use dedicated deployment: GPU options -> preflight -> explicit approval -> create -> wait for running -> chat -> stop/delete. Billed per second of GPU time.
|
|
919
|
-
- **Need custom weights?** Prepare a dataset -> preflight and run training -> monitor -> select a verified checkpoint -> deploy that checkpoint through the dedicated workflow.
|
|
920
|
-
- **Need continuous improvement from real conversations?** Use the Conscious Loop workflow; capture is opt-in and automated model calls spend through the workspace's own serverless account
|
|
934
|
+
- **Need custom weights?** Prepare a dataset -> preflight and run training -> monitor -> select a verified checkpoint -> deploy that checkpoint through the dedicated workflow.${launchGates.loop ? "" : `
|
|
935
|
+
- **Need continuous improvement from real conversations?** Use the Conscious Loop workflow; capture is opt-in and automated model calls spend through the workspace's own serverless account.`}
|
|
921
936
|
|
|
922
937
|
## Training Workflow
|
|
923
938
|
1. **Upload/import a dataset** — use upload_dataset for a local JSONL file or import_huggingface_dataset for a Hub source. Poll get_dataset_status until ready, then preview_dataset before training. A created row is not proof that processing succeeded.
|
|
@@ -935,7 +950,7 @@ Run BiOS provides serverless inference, dedicated GPU deployments, datasets, and
|
|
|
935
950
|
## Identity, account and scope
|
|
936
951
|
- Every MCP call uses the API key's bound organization and workspace. Start with introspect_api_key and repeat the resolved identity before any paid or destructive action.
|
|
937
952
|
- Never ask an agent to choose an arbitrary account id; tool responses are scoped server-side. A different workspace requires a different authorized credential.
|
|
938
|
-
- get_wallet_balance describes the same billing owner that training, dedicated deployment, and automated Loop calls spend from.
|
|
953
|
+
- get_wallet_balance describes the same billing owner that training${launchGates.loop ? " and dedicated deployment spend" : ", dedicated deployment, and automated Loop calls spend"} from.
|
|
939
954
|
|
|
940
955
|
## What the PLATFORM decides for you (do not try to set these)
|
|
941
956
|
Serving settings are derived from the model itself and are immutable. They are
|
|
@@ -1016,36 +1031,7 @@ get_inference_status instead of asserting them.
|
|
|
1016
1031
|
- get_serverless_savings - Read the authenticated user and workspace's model-promotion savings
|
|
1017
1032
|
Only the current workspace is readable with analytics:read; serverless inference scope alone is not analytics. Key creation, per-key usage, org-wide totals, and all RPM/spend mutations remain authenticated-console-only.
|
|
1018
1033
|
|
|
1019
|
-
|
|
1020
|
-
The loop turns what a deployed model actually did into what it learns next.
|
|
1021
|
-
NOTHING IS RECORDED until loop_set_capture turns a source on — capture is a
|
|
1022
|
-
consent decision, not a default, and these tools cannot bypass it.
|
|
1023
|
-
1. loop_set_capture - Turn recording on or off for a source and set how long conversations are kept. Start here; every other loop tool is inert until this is done.
|
|
1024
|
-
2. loop_capture_trace / loop_import_rows - Record one exchange as it happens (what the model was asked, what it answered, any tool calls), whoever served the model — Run BiOS, another provider, or your own servers. loop_import_rows brings in data that already exists instead: an export, a spreadsheet of past answers, preference pairs. Imported rows arrive as conversations NEEDING REVIEW, never as finished training data.
|
|
1025
|
-
3. loop_list_traces / loop_get_trace - Read what has been recorded. Credentials and personal details are stripped before storage, never after.
|
|
1026
|
-
4. loop_add_signal - Record whether an answer was right. Append-only. Verdict 'edited' with a correction is the most valuable feedback there is.
|
|
1027
|
-
5. loop_add_candidate / loop_list_candidates - Submit ALTERNATIVE answers to a recorded prompt. Sampling the model N times and scoring the samples produces DPO pairs without a human writing each one; a stronger model's answers do distillation the same way.
|
|
1028
|
-
6. loop_label_trace / loop_remove_label / loop_list_labels - Carve the corpus into slices. A bare tag with a parent makes a master group; NAMED DIMENSIONS (category, task, language, anything you like) are what let ONE captured corpus become a DIFFERENT dataset for every task, because filters on different dimensions AND together and nothing has to be re-labelled.
|
|
1029
|
-
7. loop_create_judge / loop_list_judges - A RUBRIC a model applies, for the question no rule can answer: was this actually helpful. The rubric doubles as a GRPO reward function, which makes prompts with no checkable answer trainable.
|
|
1030
|
-
8. loop_start_judge_run then loop_take_judge_work then loop_post_judge_verdicts - Run a rubric over a slice. By default YOU call the model: take the rendered prompt, send it, post the scores back. A judge created with auto=true is run by the platform's agent instead, on the workspace's own serverless account. loop_list_judge_run_items says what happened to each conversation in a run and why a failed one failed, which the work list cannot: it hands out only what is still pending, so a finished run answers it with nothing. loop_stop_judge_run closes a run that will NOT finish, which is what unblocks the judge — an open run blocks the next one, and closing it by posting an empty verdict list with finish set writes 'done' on a pass that covered three of forty.
|
|
1031
|
-
9. loop_create_grader / loop_list_graders - Deterministic rules that score answers with no person reading them, weighted so the criteria that matter count more, and aimable at one label so a rule about shipping does not mark down every billing answer.
|
|
1032
|
-
10. loop_grade_trace - Apply those rules to an answer AND its samples in one pass. This is what closes the loop automatically.
|
|
1033
|
-
11. loop_build_dataset / loop_create_build_rule / loop_list_build_rules / loop_delete_build_rule - Curate the feedback into an sft, dpo, grpo or kto training set, once or STANDING. Always reports why rows were left out. kto takes a bare thumbs-down, which the other three cannot use at all. A build rule is the same curation left running: it fires when enough NEW reviewed work exists, and last_reason says why it did not — a rule quiet because it is waiting reads exactly like one that is broken.
|
|
1034
|
-
12. loop_agent_status / loop_enable_agent / loop_disable_agent - The AGENT: the worker that calls a model for the workspace (automatic judges, sample answers). It spends through the workspace's OWN serverless key, so every call is billed like one of theirs; enabling it is SPEND CONSENT and you say so first. Status tells you whether an agent exists in this environment at all.
|
|
1035
|
-
13. loop_create_sample_run / loop_list_sample_runs - Have the agent write N alternative answers to each conversation in a slice and score them with a judge. This is how DPO pairs and GRPO groups are made with no human writing each one. State the upper bound of model calls (sample × n × 2) before starting.
|
|
1036
|
-
14. loop_list_datasets - The sets built so far, each with how many rows it kept and why the rest were dropped.
|
|
1037
|
-
15. loop_preview_dataset / loop_register_dataset_for_training - Read the actual rows before anyone trains on them; each carries the address of the conversation it came from. Registering hands a built set to training as a real dataset id, keeping the link back to the conversations, verdicts and judges that produced it — the alternative is downloading the file and uploading it again as an unrelated dataset, which throws that link away. Register "train" and "holdout" separately when the job should be scored on rows it never saw. The set is then validated like any upload, so poll get_dataset_status before training on it.
|
|
1038
|
-
16. loop_stats - How much is recorded, how much is reviewed, and what each method could use right now.
|
|
1039
|
-
17. loop_preflight_training_rule - PRICE a standing training rule without creating anything: the pinned revision, the worst hourly price each GPU ladder can reach, how many hours each ceiling buys, the refusals, and terms_text — the sentence the member is agreeing to, with their own figures in it. Always first.
|
|
1040
|
-
18. loop_create_training_rule - Create it. SPEND CONSENT, and recorded: accept_terms is the member's signature on that sentence. Read the estimate and terms_text back VERBATIM, wait for an explicit yes, and never state a ceiling, a price cap or an hour count preflight did not return.
|
|
1041
|
-
19. loop_list_training_rules / loop_get_training_rule / loop_update_training_rule / loop_consent_training_rule / loop_run_training_rule / loop_delete_training_rule - Read, edit, re-consent, fire now, retire. A money-bearing edit bumps the rule's revision, drops the consent and STOPS FUTURE FIRINGS until somebody accepts the new terms.
|
|
1042
|
-
20. loop_list_training_runs / loop_get_training_run / loop_list_pipelines / loop_get_pipeline - What each firing did, its timeline, and available_actions — which says what this reader may actually do next, rather than what the state looks like it allows. The pipeline tools read a rule as the versions it produced: which one serves, how many of max_versions are made, the run in flight, and the month's spend against its limit.
|
|
1043
|
-
21. loop_get_evaluation / loop_list_evaluation_items / loop_get_judge_agreement - The comparison behind a verdict: the win rate and the per-dimension means, the paired conversations themselves, and how far the judge already agrees with this workspace's own reviewers. Read the warnings out, not just the verdict.
|
|
1044
|
-
22. loop_promote_training_run / loop_reject_training_run / loop_rollback_training_run / loop_cancel_training_run - The decision. Promotion re-points the serving name at the candidate and changes what real customers get; it is undoable for 30 days.
|
|
1045
|
-
23. loop_get_agent_settings / loop_update_agent_settings / loop_update_build_rule - The agent's default model, its system prompts and the monthly evaluation cap; and the standing curation rule a training rule draws from.
|
|
1046
|
-
24. set_inference_alias / list_inference_aliases / delete_inference_alias - The re-pointable public handles a promotion writes: a name customers call that can be moved to different weights without them changing anything.
|
|
1047
|
-
|
|
1048
|
-
END TO END: capture what a model was asked and answered, have people or judges say whether it was right, write ONE training rule that curates the reviewed work and trains on it, let the platform compare the result against what serves today, read the comparison, then decide — promote, reject, or leave it. Everything before the rule costs nothing; the rule is where money starts, which is why it carries a recorded consent. Two fields carry the state a user actually asks about and BOTH must be read back in plain words rather than summarised as 'fine': last_reason says why a quiet rule is quiet, because a rule waiting for rows looks identical to a broken one; and accepted_revision against revision (with paused_reason) says whether the rule still has a consent to spend under, because a money-bearing edit pauses it until somebody agrees again.`,
|
|
1034
|
+
${loopGuideSection}`,
|
|
1049
1035
|
quick_start: `# Quick Start Guide
|
|
1050
1036
|
|
|
1051
1037
|
## Fastest path to a fine-tuned model:
|
|
@@ -1223,7 +1209,9 @@ Serverless is the immediate, per-token inference product. It does NOT create or
|
|
|
1223
1209
|
- Do not retry an empty completion blindly: finish_reason=length means max_tokens was exhausted, not that the endpoint lost data.
|
|
1224
1210
|
|
|
1225
1211
|
## Billing
|
|
1226
|
-
Serverless is billed per token to the API key's bound workspace.
|
|
1212
|
+
Serverless is billed per token to the API key's bound workspace. ${launchGates.loop
|
|
1213
|
+
? "It is distinct from dedicated GPU billing."
|
|
1214
|
+
: "It is distinct from dedicated GPU billing and from the Loop agent, even though the Loop agent spends through that workspace's serverless account."}`,
|
|
1227
1215
|
dedicated_deployment: `# Dedicated Model Deployment
|
|
1228
1216
|
|
|
1229
1217
|
A dedicated deployment reserves GPU capacity and creates a durable endpoint. Use it for dedicated capacity, custom/trained checkpoints, or lifecycle control. It bills GPU time per second and is NOT required for serverless inference.
|
|
@@ -1256,9 +1244,9 @@ Capacity errors include bookable alternatives. Never silently substitute a GPU o
|
|
|
1256
1244
|
|
|
1257
1245
|
Every MCP tool acts inside the API key's bound organization and workspace.
|
|
1258
1246
|
1. Call introspect_api_key first. Read user/workspace/org, scopes, allowed tools and feature grants from the result.
|
|
1259
|
-
2. Call get_wallet_balance before any training, dedicated deployment or automated Loop action that spends.
|
|
1247
|
+
2. Call get_wallet_balance before any training${launchGates.loop ? " or dedicated deployment" : ", dedicated deployment or automated Loop action"} that spends.
|
|
1260
1248
|
3. Never invent, guess or substitute another org/workspace/account id. A different workspace requires a different authorized credential.
|
|
1261
|
-
4. Serverless calls, dedicated deployments, training jobs, datasets and Loop artifacts remain scoped to that resolved workspace. Empty lists may mean this workspace has no resources; they do not prove the platform has none globally.
|
|
1249
|
+
4. Serverless calls, dedicated deployments, training jobs${launchGates.loop ? " and datasets" : ", datasets and Loop artifacts"} remain scoped to that resolved workspace. Empty lists may mean this workspace has no resources; they do not prove the platform has none globally.
|
|
1262
1250
|
5. Repeat the resolved workspace and cost owner before asking for spend or destructive consent, without exposing the credential itself.`,
|
|
1263
1251
|
end_to_end: launchGates.training || launchGates.datasets
|
|
1264
1252
|
? `# End-to-End Availability\n\nServerless inference and dedicated deployment are fully live. Start with identity_and_scope, then choose serverless_inference or dedicated_deployment. Dataset/training creation is gated in this deployment; do not invent a workaround. Existing datasets, jobs and checkpoints remain readable and manageable through their lifecycle tools.`
|
|
@@ -1270,8 +1258,7 @@ Every MCP tool acts inside the API key's bound organization and workspace.
|
|
|
1270
1258
|
4. Consent and train: explicit spend approval -> create_training_job -> status/metrics/evals/logs -> verified checkpoint.
|
|
1271
1259
|
5. Deploy checkpoint: preflight_inference(source_type=checkpoint) -> explicit deployment approval -> create_inference -> status=running.
|
|
1272
1260
|
6. Infer: chat_with_inference -> metrics/notifications.
|
|
1273
|
-
7. Improve: optional Conscious Loop capture/review/evaluation/training rule; capture and spending are separate opt-ins.
|
|
1274
|
-
8. Clean up: stop/delete deployment, checkpoint or dataset only as separate explicit irreversible actions.
|
|
1261
|
+
${launchGates.loop ? "" : "7. Improve: optional Conscious Loop capture/review/evaluation/training rule; capture and spending are separate opt-ins.\n"}${launchGates.loop ? 7 : 8}. Clean up: stop/delete deployment, checkpoint or dataset only as separate explicit irreversible actions.
|
|
1275
1262
|
|
|
1276
1263
|
At every step use returned ids and available_actions. Never infer the next action from a status label alone, never report success before the authoritative terminal state, and never substitute a GPU/model/price without approval.`,
|
|
1277
1264
|
inference: `# Model Inference Guide
|
|
@@ -2973,7 +2960,7 @@ create (1-5 choices), and the queue itself stays opt-in.`,
|
|
|
2973
2960
|
author: z.string().optional(),
|
|
2974
2961
|
labels: z.array(z.string()).optional().describe("Which training pipeline this feedback feeds, named HERE rather than in a second call. A build rule selects conversations by label and a training rule trains from that build rule, so a label is the pipeline a conversation goes down. Sent with the verdict it is written in one transaction: either both land or neither does. A separate labelling call is the one that gets skipped, and what it leaves is a reviewed conversation in no pipeline — counted in every 'reviewed' total and selected by nothing."),
|
|
2975
2962
|
attributes: z.record(z.string(), z.string()).optional().describe("The same, by named dimension: {\"category\": \"billing\"}. Dimensions AND together when a set is built, which is what lets one corpus become a different dataset per task."),
|
|
2976
|
-
parent: z.string().optional().describe("The master group the bare labels belong to, so selecting the group picks them up without anybody maintaining a list."),
|
|
2963
|
+
parent: z.string().optional().describe("The master group the bare labels belong to, so selecting the group picks them up without anybody maintaining a list. Leave it out and a label the conversation already carries keeps the group it has; send an empty string to take the labels out of their group."),
|
|
2977
2964
|
}, async ({ trace_id, verdict, source, correction, score, ground_truth, reason, author, labels, attributes, parent }) => {
|
|
2978
2965
|
const data = await client.api(`/api/loop/traces/${encodeURIComponent(trace_id)}/signals`, {
|
|
2979
2966
|
method: "POST",
|
|
@@ -3011,7 +2998,7 @@ create (1-5 choices), and the queue itself stays opt-in.`,
|
|
|
3011
2998
|
trace_id: z.string(),
|
|
3012
2999
|
labels: z.array(z.string()).optional().describe("Bare tags, e.g. ['refunds','escalated']. Lowercase letters, digits, dot, dash or underscore."),
|
|
3013
3000
|
attributes: z.record(z.string(), z.string()).optional().describe("NAMED DIMENSIONS, e.g. {\"category\":\"billing\",\"task\":\"refund-handling\",\"language\":\"es\"}. This is what lets one captured corpus become a different dataset for every task somebody trains for: filters on different dimensions AND together, and a dimension is matched EXACTLY within its key, so source=support never matches team=support. Setting one dimension leaves the others untouched, so correcting a mistake needs no delete first."),
|
|
3014
|
-
parent: z.string().optional().describe("The master group
|
|
3001
|
+
parent: z.string().optional().describe("The master group the bare labels belong to, e.g. 'billing'. It applies to 'labels' only; sent with attributes and no labels it groups nothing and is refused. LEAVE IT OUT to keep whatever group a label the conversation already carries is in — re-sending 'refunds' without it does not take 'refunds' out of 'billing'. Send an empty string to take the labels out of their group; the labels themselves stay."),
|
|
3015
3002
|
}, async ({ trace_id, labels, attributes, parent }) => {
|
|
3016
3003
|
const data = await client.api(`/api/loop/traces/${encodeURIComponent(trace_id)}/labels`, {
|
|
3017
3004
|
method: "POST", body: { labels, attributes, parent },
|