dsh-connect-workbuddy 4.8.1 → 4.9.0
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/CHANGELOG.md +39 -0
- package/README.en.md +4 -0
- package/README.md +7 -0
- package/lib/bin.js +1 -1
- package/lib/client.js +989 -198
- package/lib/{host-heartbeat-BfAvb1_d.js → host-heartbeat-CS6PxirW.js} +11 -2
- package/lib/index.d.ts +39 -0
- package/lib/index.js +337 -55
- package/package.json +1 -1
|
@@ -1447,6 +1447,7 @@ function declaredTools(bodyJson) {
|
|
|
1447
1447
|
if (!Array.isArray(tools)) return void 0;
|
|
1448
1448
|
const names = /* @__PURE__ */ new Set();
|
|
1449
1449
|
const requiredParameters = /* @__PURE__ */ new Map();
|
|
1450
|
+
const acceptedParameters = /* @__PURE__ */ new Map();
|
|
1450
1451
|
for (const value of tools) {
|
|
1451
1452
|
if (typeof value !== "object" || value === null || Array.isArray(value)) continue;
|
|
1452
1453
|
const fn = value["function"];
|
|
@@ -1457,7 +1458,14 @@ function declaredTools(bodyJson) {
|
|
|
1457
1458
|
names.add(name);
|
|
1458
1459
|
const parameters = definition["parameters"];
|
|
1459
1460
|
if (typeof parameters !== "object" || parameters === null || Array.isArray(parameters)) continue;
|
|
1460
|
-
const
|
|
1461
|
+
const schema = parameters;
|
|
1462
|
+
const accepted = /* @__PURE__ */ new Set();
|
|
1463
|
+
const properties = schema["properties"];
|
|
1464
|
+
if (typeof properties === "object" && properties !== null && !Array.isArray(properties)) {
|
|
1465
|
+
for (const key of Object.keys(properties)) if (key !== "") accepted.add(key);
|
|
1466
|
+
}
|
|
1467
|
+
acceptedParameters.set(name, accepted);
|
|
1468
|
+
const required = schema["required"];
|
|
1461
1469
|
if (!Array.isArray(required)) continue;
|
|
1462
1470
|
const list = required.filter((entry) => typeof entry === "string" && entry !== "");
|
|
1463
1471
|
if (list.length > 0) requiredParameters.set(name, list);
|
|
@@ -1472,6 +1480,7 @@ function declaredTools(bodyJson) {
|
|
|
1472
1480
|
return {
|
|
1473
1481
|
names,
|
|
1474
1482
|
requiredParameters,
|
|
1483
|
+
acceptedParameters,
|
|
1475
1484
|
...pinnedToolName === void 0 ? {} : { pinnedToolName }
|
|
1476
1485
|
};
|
|
1477
1486
|
}
|
|
@@ -3957,7 +3966,7 @@ function generationOf(version) {
|
|
|
3957
3966
|
//#endregion
|
|
3958
3967
|
//#region src/version.ts
|
|
3959
3968
|
/** The npm package version this build was produced from. */
|
|
3960
|
-
const WORKBUDDY_CONNECT_VERSION = "4.
|
|
3969
|
+
const WORKBUDDY_CONNECT_VERSION = "4.9.0";
|
|
3961
3970
|
//#endregion
|
|
3962
3971
|
//#region src/host-heartbeat.ts
|
|
3963
3972
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -1280,6 +1280,12 @@ interface WorkBuddyAdapterOptions {
|
|
|
1280
1280
|
provider?: string;
|
|
1281
1281
|
/** pi-ai provider name and profile display name; defaults to the CN name. */
|
|
1282
1282
|
displayName?: string;
|
|
1283
|
+
/**
|
|
1284
|
+
* Model identity stamped on every model this route serves; defaults to
|
|
1285
|
+
* {@link WORKBUDDY_MODEL_IDENTITY}. Tests override it to model a transcript
|
|
1286
|
+
* recorded by a host that still stamped per-region ids.
|
|
1287
|
+
*/
|
|
1288
|
+
modelIdentity?: string;
|
|
1283
1289
|
/** Resolve the durable attachment service at request time, when present. */
|
|
1284
1290
|
resolveAttachments?: () => AttachmentStore | undefined;
|
|
1285
1291
|
/**
|
|
@@ -2755,6 +2761,16 @@ interface WorkBuddyWebPool {
|
|
|
2755
2761
|
targetModelSource: 'preferred' | 'free' | 'none' | 'stale';
|
|
2756
2762
|
/** The account ids the user has checked into this region's pool. */
|
|
2757
2763
|
memberAccountIds?: readonly string[];
|
|
2764
|
+
/**
|
|
2765
|
+
* The user's hand-ordered pool order, as account ids.
|
|
2766
|
+
*
|
|
2767
|
+
* Independent of {@link memberAccountIds}: an id need not be checked in
|
|
2768
|
+
* (it only takes effect once the account is a member), and ids not listed
|
|
2769
|
+
* sort last. Kept separate from membership so reordering never conflicts
|
|
2770
|
+
* with, or is destroyed by, a membership edit. Only ids that resolve to a
|
|
2771
|
+
* currently listed account are transmitted (see `web-status.ts`).
|
|
2772
|
+
*/
|
|
2773
|
+
orderAccountIds?: readonly string[];
|
|
2758
2774
|
/**
|
|
2759
2775
|
* Tokens each test probe sends, as the user saved it; `0`/absent = default.
|
|
2760
2776
|
*
|
|
@@ -3048,6 +3064,14 @@ interface WorkBuddyPoolDeps {
|
|
|
3048
3064
|
*/
|
|
3049
3065
|
probeInputTokens?: number;
|
|
3050
3066
|
memberAccountIds: readonly string[];
|
|
3067
|
+
/**
|
|
3068
|
+
* The user's hand-ordered pool order, as account ids.
|
|
3069
|
+
*
|
|
3070
|
+
* Optional so a Host that never learnt about the setting still satisfies
|
|
3071
|
+
* this interface — its absence then reads as "no manual order" and the
|
|
3072
|
+
* ranking simply ignores it.
|
|
3073
|
+
*/
|
|
3074
|
+
orderAccountIds?: readonly string[];
|
|
3051
3075
|
};
|
|
3052
3076
|
/** One region's CHECKED accounts, plus their credits and last measurements. */
|
|
3053
3077
|
members(region: WorkBuddyRegion): Promise<readonly WorkBuddyPoolMember[]>;
|
|
@@ -3306,6 +3330,21 @@ interface WorkBuddyPoolPreferences {
|
|
|
3306
3330
|
* the pool covers nothing and both buttons stay disabled.
|
|
3307
3331
|
*/
|
|
3308
3332
|
memberAccountIds?: string[];
|
|
3333
|
+
/**
|
|
3334
|
+
* The user's hand-ordered pool order, as a list of account ids.
|
|
3335
|
+
*
|
|
3336
|
+
* SEPARATE FROM MEMBERSHIP: this is purely a display/preference of what the
|
|
3337
|
+
* user wants the pool to prefer, and it is independent of which accounts are
|
|
3338
|
+
* checked in. An id here need not be in {@link memberAccountIds} — the
|
|
3339
|
+
* ranking only consults this order for accounts that are actually members,
|
|
3340
|
+
* and ids that are not listed simply sort last. Keeping them separate lets
|
|
3341
|
+
* the user reorder first and check accounts in later without the ordering
|
|
3342
|
+
* being destroyed by an unrelated membership edit (see `poolPreferencesOf`,
|
|
3343
|
+
* which must always carry this list through alongside membership). Ids that
|
|
3344
|
+
* no longer resolve to a listed account are dropped on transmit, never
|
|
3345
|
+
* silently merged into membership.
|
|
3346
|
+
*/
|
|
3347
|
+
orderAccountIds?: string[];
|
|
3309
3348
|
}
|
|
3310
3349
|
/** Plugin configuration. */
|
|
3311
3350
|
interface Config {
|