@abelxiaoxing/cadence 2.0.3 → 2.0.5
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 +68 -25
- package/docs/service-management.md +81 -51
- package/package.json +4 -2
- package/src/cadence-service.mjs +4 -0
- package/src/index.ts +3 -3
- package/src/install-config.mjs +2 -25
- package/src/native-build.ts +1 -1
- package/src/native-client.ts +60 -34
- package/src/service/contracts/models.ts +3 -5
- package/src/service-cli.mjs +513 -112
- package/src/service-host.mjs +6 -6
- package/src/task-shell.ts +1 -1
- package/src/worker-public.mjs +3 -0
- package/web/dist/assets/cadence.js +4 -4
- package/web/dist/manifest.json +5 -5
package/src/service-host.mjs
CHANGED
|
@@ -951,7 +951,8 @@ var thinkingLevels = [
|
|
|
951
951
|
"low",
|
|
952
952
|
"medium",
|
|
953
953
|
"high",
|
|
954
|
-
"xhigh"
|
|
954
|
+
"xhigh",
|
|
955
|
+
"max"
|
|
955
956
|
];
|
|
956
957
|
function decodeModelSelector(v) {
|
|
957
958
|
const o = closed(v, ["provider", "model", "api", "thinking"]);
|
|
@@ -4002,7 +4003,7 @@ function decodeModelCandidate(value) {
|
|
|
4002
4003
|
thinking: list(o.thinking, 7, (v) => {
|
|
4003
4004
|
const t = closed(v, ["level", "selectable"]);
|
|
4004
4005
|
return {
|
|
4005
|
-
level: oneOf(t.level,
|
|
4006
|
+
level: oneOf(t.level, thinkingLevels),
|
|
4006
4007
|
selectable: bool(t.selectable)
|
|
4007
4008
|
};
|
|
4008
4009
|
}),
|
|
@@ -4012,7 +4013,7 @@ function decodeModelCandidate(value) {
|
|
|
4012
4013
|
"auth-unavailable"
|
|
4013
4014
|
])
|
|
4014
4015
|
};
|
|
4015
|
-
if (new Set(candidate.thinking.map((t) => t.level)).size !== candidate.thinking.length || candidate.thinking.some((t) => t.selectable && (
|
|
4016
|
+
if (new Set(candidate.thinking.map((t) => t.level)).size !== candidate.thinking.length || candidate.thinking.some((t) => t.selectable && (candidate.api === null || candidate.eligibility !== "candidate")) || candidate.eligibility === "candidate" && !candidate.thinking.some((t) => t.selectable))
|
|
4016
4017
|
invalid();
|
|
4017
4018
|
return candidate;
|
|
4018
4019
|
}
|
|
@@ -16462,8 +16463,7 @@ Content-Length: 0\r
|
|
|
16462
16463
|
}
|
|
16463
16464
|
if (target2 === "/" && req.method === "GET") {
|
|
16464
16465
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
16465
|
-
res.end(
|
|
16466
|
-
`);
|
|
16466
|
+
res.end("Cadence: enter with the private link that `cadence token-link --workspace <path> --reveal` prints on this machine (the `cadence server install` service uses ~/cadence by default).\n");
|
|
16467
16467
|
return;
|
|
16468
16468
|
}
|
|
16469
16469
|
if (target2.startsWith("/local/v1/admin/")) {
|
|
@@ -22608,7 +22608,7 @@ function refuseAt(stage, step) {
|
|
|
22608
22608
|
}
|
|
22609
22609
|
}
|
|
22610
22610
|
async function createServiceHost(value, sourceBuild) {
|
|
22611
|
-
const embedded = "
|
|
22611
|
+
const embedded = "ff017feffc6b6b4521e470d82514d0ca008e15472fa1442ec498b243b0f7cf87";
|
|
22612
22612
|
if (embedded && sourceBuild)
|
|
22613
22613
|
throw new ContractError("unsupported-context");
|
|
22614
22614
|
const contractHash = decodeHash(embedded ?? sourceBuild?.contractHash);
|
package/src/task-shell.ts
CHANGED
|
@@ -590,7 +590,7 @@ export function registerTaskShell(pi: ExtensionAPI): void {
|
|
|
590
590
|
"Exact thinking level • no clamping/fallback",
|
|
591
591
|
model.thinking.filter((t) => t.selectable).map((t) => t.level),
|
|
592
592
|
);
|
|
593
|
-
if (!level
|
|
593
|
+
if (!level) return;
|
|
594
594
|
// Decode via the shared model-choice method; never inspect parent auth.
|
|
595
595
|
const choice = {
|
|
596
596
|
provider: model.provider,
|
package/src/worker-public.mjs
CHANGED
|
@@ -411,6 +411,8 @@ export const modelApis = [
|
|
|
411
411
|
"mistral-conversations",
|
|
412
412
|
"azure-openai-responses",
|
|
413
413
|
];
|
|
414
|
+
// The pinned SDK's ThinkingLevel, including "max" (models whose
|
|
415
|
+
// thinkingLevelMap maps only max, such as some DeepSeek configurations).
|
|
414
416
|
export const thinkingLevels = [
|
|
415
417
|
"off",
|
|
416
418
|
"minimal",
|
|
@@ -418,6 +420,7 @@ export const thinkingLevels = [
|
|
|
418
420
|
"medium",
|
|
419
421
|
"high",
|
|
420
422
|
"xhigh",
|
|
423
|
+
"max",
|
|
421
424
|
];
|
|
422
425
|
export function decodeModelSelector(v) {
|
|
423
426
|
const o = closed(v, ["provider", "model", "api", "thinking"]);
|