tines 0.0.282 → 0.0.283
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.js +34 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4225,6 +4225,10 @@ function createApiClient(options) {
|
|
|
4225
4225
|
getSupervisorStats: (q = {}) => get(`/api/v1/supervisor/stats${query(q)}`),
|
|
4226
4226
|
getSupervisorSentBack: (q) => get(`/api/v1/supervisor/stats/sent-back${query(q)}`),
|
|
4227
4227
|
updateSupervisorSettings: (body) => request("PUT", "/api/v1/supervisor/settings", body),
|
|
4228
|
+
getSupervisorRates: () => get("/api/v1/supervisor/rates"),
|
|
4229
|
+
createSupervisorRate: (body) => request("POST", "/api/v1/supervisor/rates", body),
|
|
4230
|
+
repriceSupervisorRate: (model, cursor = null) => request("POST", "/api/v1/supervisor/rates/reprice", { model, cursor }),
|
|
4231
|
+
deleteSupervisorRate: (id2) => request("DELETE", `/api/v1/supervisor/rates/${id2}`),
|
|
4228
4232
|
// API keys (create/revoke require a browser session, not a key)
|
|
4229
4233
|
listApiKeys: (filters = {}) => get(`/api/v1/api-keys${query(filters)}`),
|
|
4230
4234
|
createApiKey: (body) => request("POST", "/api/v1/api-keys", body),
|
|
@@ -5641,7 +5645,26 @@ function isSupportedCodexRolloutVersion(version) {
|
|
|
5641
5645
|
}
|
|
5642
5646
|
|
|
5643
5647
|
// ../shared/src/effort.ts
|
|
5648
|
+
var EFFORT_TOKEN_PATTERN = /^[a-z][a-z0-9_-]{0,31}$/;
|
|
5644
5649
|
var EFFORT_CAPABILITIES_MAX_BYTES = 64 * 1024;
|
|
5650
|
+
var RECOGNIZED_EFFORT_VALUES = ["low", "medium", "high", "xhigh", "max", "ultra"];
|
|
5651
|
+
function admitEffort(allowed, value, assertable) {
|
|
5652
|
+
if (allowed !== null)
|
|
5653
|
+
return allowed.includes(value) ? { ok: true, verification: "verified" } : { ok: false, reason: `unsupported_effort: allows ${allowed.join(", ")}` };
|
|
5654
|
+
if (assertable && isRecognizedEffort(value)) return { ok: true, verification: "asserted" };
|
|
5655
|
+
if (!assertable)
|
|
5656
|
+
return {
|
|
5657
|
+
ok: false,
|
|
5658
|
+
reason: "daemon_upgrade_required: this daemon cannot accept effort for unlisted models"
|
|
5659
|
+
};
|
|
5660
|
+
return { ok: false, reason: "capability_unavailable: exact model support was not reported" };
|
|
5661
|
+
}
|
|
5662
|
+
function isEffortToken(value) {
|
|
5663
|
+
return typeof value === "string" && EFFORT_TOKEN_PATTERN.test(value);
|
|
5664
|
+
}
|
|
5665
|
+
function isRecognizedEffort(value) {
|
|
5666
|
+
return isEffortToken(value) && RECOGNIZED_EFFORT_VALUES.includes(value);
|
|
5667
|
+
}
|
|
5645
5668
|
function supportedEfforts(capabilities, model) {
|
|
5646
5669
|
if (!capabilities || capabilities.version !== 1 || !("models" in capabilities) || !model)
|
|
5647
5670
|
return null;
|
|
@@ -9728,9 +9751,13 @@ function assignmentEffortRejection(assignment, capabilities, harness) {
|
|
|
9728
9751
|
return `effort assignment requires ${capabilities.harness}, but this daemon runs ${harness}`;
|
|
9729
9752
|
if (capabilities.catalog_digest !== assignment.effort.capability_digest)
|
|
9730
9753
|
return "effort capability catalog changed after assignment delivery";
|
|
9731
|
-
const
|
|
9732
|
-
|
|
9733
|
-
|
|
9754
|
+
const admission = admitEffort(
|
|
9755
|
+
supportedEfforts(capabilities, assignment.run.model),
|
|
9756
|
+
assignment.effort.value,
|
|
9757
|
+
assignment.effort.verification === "asserted"
|
|
9758
|
+
);
|
|
9759
|
+
if (!admission.ok)
|
|
9760
|
+
return admission.reason.startsWith("unsupported_effort:") ? `${assignment.run.model ?? "the assigned model"} does not support effort ${assignment.effort.value}` : `${assignment.run.model ?? "the assigned model"}: ${admission.reason}`;
|
|
9734
9761
|
return null;
|
|
9735
9762
|
}
|
|
9736
9763
|
function digest(models) {
|
|
@@ -9789,7 +9816,8 @@ async function discoverClaude(daemonVersion) {
|
|
|
9789
9816
|
harness_version: version.trim().slice(0, 100),
|
|
9790
9817
|
catalog_revision: "claude-effort-v1",
|
|
9791
9818
|
catalog_digest: digest(models),
|
|
9792
|
-
models
|
|
9819
|
+
models,
|
|
9820
|
+
accepts_asserted_effort: true
|
|
9793
9821
|
};
|
|
9794
9822
|
} catch (error) {
|
|
9795
9823
|
return failure(
|
|
@@ -9868,7 +9896,8 @@ async function discoverCodex(daemonVersion) {
|
|
|
9868
9896
|
harness: "codex",
|
|
9869
9897
|
harness_version: harnessVersion,
|
|
9870
9898
|
catalog_digest: digest(models),
|
|
9871
|
-
models
|
|
9899
|
+
models,
|
|
9900
|
+
accepts_asserted_effort: true
|
|
9872
9901
|
});
|
|
9873
9902
|
}
|
|
9874
9903
|
}
|