perstack 0.0.134 → 0.0.136
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/bin/cli.js +46 -14
- package/dist/bin/cli.js.map +1 -1
- package/dist/{dist-Bcjkpp4l.js → dist-B-pbUImR.js} +9 -3
- package/dist/dist-B-pbUImR.js.map +1 -0
- package/dist/{resolve-expert-DYcSPPjK.js → resolve-expert-Lim3XOx2.js} +2 -2
- package/dist/{resolve-expert-DYcSPPjK.js.map → resolve-expert-Lim3XOx2.js.map} +1 -1
- package/package.json +4 -4
- package/dist/dist-Bcjkpp4l.js.map +0 -1
package/dist/bin/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../chunk-DORXReHP.js";
|
|
3
|
-
import { $ as discriminatedUnion, A as stopRunByInteractiveTool, At as $constructor, B as knownModels, C as runParamsSchema, Ct as parse$1, D as startRun, Dt as clone, E as startGeneration, Et as safeParseAsync$1, F as jobSchema, Ft as createId, G as ZodOptional$1, H as resolveModelTierWithFallback, I as expertSchema, J as _null, K as _enum, L as isCoordinatorExpert, M as startCommandInputSchema, Mt as PerstackError, N as perstackConfigSchema, O as stopRunByDelegate, Ot as defineLazy, P as lockfileSchema, Q as custom, R as validateDelegation, S as retry, St as $ZodType, T as skipDelegates, Tt as safeParse$1, U as number$1, V as resolveModelTier, W as ZodIssueCode$1, X as array$1, Y as any, Z as boolean, _ as finishToolCall, _t as datetime, a as createFilteredEventListener, at as number, b as resolveToolResults, ct as preprocess, d as callTools, dt as string, et as intersection, f as completeRun, ft as tuple, g as finishMcpTools, gt as safeParseAsync$2, h as createStreamingEvent, ht as url, i as truncateText$1, it as never, j as runCommandInputSchema, jt as NEVER, k as stopRunByError, kt as normalizeParams, l as createBaseToolActivity, lt as record, m as createRuntimeEvent, mt as unknown, n as formatZodError, nt as literal, o as validateEventFilter, ot as object$2, p as continueToNextStep, pt as union, q as _instanceof, r as parseWithFriendlyError, rt as looseObject, s as getFilteredEnv, st as optional, t as createApiClient, tt as lazy, u as createGeneralToolActivity, ut as strictObject, v as parseExpertKey, vt as toJSONSchema, w as runSettingSchema, wt as parseAsync, x as resumeFromStop, xt as $ZodObject, y as proceedToInteractiveTools, z as checkpointSchema } from "../dist-
|
|
3
|
+
import { $ as discriminatedUnion, A as stopRunByInteractiveTool, At as $constructor, B as knownModels, C as runParamsSchema, Ct as parse$1, D as startRun, Dt as clone, E as startGeneration, Et as safeParseAsync$1, F as jobSchema, Ft as createId, G as ZodOptional$1, H as resolveModelTierWithFallback, I as expertSchema, J as _null, K as _enum, L as isCoordinatorExpert, M as startCommandInputSchema, Mt as PerstackError, N as perstackConfigSchema, O as stopRunByDelegate, Ot as defineLazy, P as lockfileSchema, Q as custom, R as validateDelegation, S as retry, St as $ZodType, T as skipDelegates, Tt as safeParse$1, U as number$1, V as resolveModelTier, W as ZodIssueCode$1, X as array$1, Y as any, Z as boolean, _ as finishToolCall, _t as datetime, a as createFilteredEventListener, at as number, b as resolveToolResults, ct as preprocess, d as callTools, dt as string, et as intersection, f as completeRun, ft as tuple, g as finishMcpTools, gt as safeParseAsync$2, h as createStreamingEvent, ht as url, i as truncateText$1, it as never, j as runCommandInputSchema, jt as NEVER, k as stopRunByError, kt as normalizeParams, l as createBaseToolActivity, lt as record, m as createRuntimeEvent, mt as unknown, n as formatZodError, nt as literal, o as validateEventFilter, ot as object$2, p as continueToNextStep, pt as union, q as _instanceof, r as parseWithFriendlyError, rt as looseObject, s as getFilteredEnv, st as optional, t as createApiClient, tt as lazy, u as createGeneralToolActivity, ut as strictObject, v as parseExpertKey, vt as toJSONSchema, w as runSettingSchema, wt as parseAsync, x as resumeFromStop, xt as $ZodObject, y as proceedToInteractiveTools, z as checkpointSchema } from "../dist-B-pbUImR.js";
|
|
4
4
|
import { t as require_token_error } from "../token-error-Bru5BVnt.js";
|
|
5
5
|
import fs, { constants, lstat, mkdir, open, readFile, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import path, { dirname, extname } from "node:path";
|
|
@@ -79539,7 +79539,7 @@ function validateRuntimeVersion(experts) {
|
|
|
79539
79539
|
//#endregion
|
|
79540
79540
|
//#region ../../packages/runtime/src/helpers/setup-experts.ts
|
|
79541
79541
|
async function setupExperts(setting, resolveExpertToRun) {
|
|
79542
|
-
const resolveFn = resolveExpertToRun ?? (await import("../resolve-expert-
|
|
79542
|
+
const resolveFn = resolveExpertToRun ?? (await import("../resolve-expert-Lim3XOx2.js")).resolveExpertToRun;
|
|
79543
79543
|
const { expertKey } = setting;
|
|
79544
79544
|
const experts = { ...setting.experts };
|
|
79545
79545
|
const clientOptions = {
|
|
@@ -79567,16 +79567,39 @@ async function setupExperts(setting, resolveExpertToRun) {
|
|
|
79567
79567
|
* Used to preserve thinking blocks in conversation history for providers
|
|
79568
79568
|
* that require them (Anthropic, Google).
|
|
79569
79569
|
*
|
|
79570
|
-
*
|
|
79571
|
-
*
|
|
79570
|
+
* The signature and its provider namespace are preserved so that
|
|
79571
|
+
* the correct providerOptions can be set when converting back to
|
|
79572
|
+
* AI SDK messages for multi-turn conversations.
|
|
79572
79573
|
*/
|
|
79573
79574
|
function extractThinkingParts(reasoning) {
|
|
79574
79575
|
if (!reasoning) return [];
|
|
79575
|
-
return reasoning.map((r) =>
|
|
79576
|
-
|
|
79577
|
-
|
|
79578
|
-
|
|
79579
|
-
|
|
79576
|
+
return reasoning.map((r) => {
|
|
79577
|
+
const { signature, signatureProvider } = extractSignature(r);
|
|
79578
|
+
return {
|
|
79579
|
+
type: "thinkingPart",
|
|
79580
|
+
thinking: r.text,
|
|
79581
|
+
signature,
|
|
79582
|
+
signatureProvider
|
|
79583
|
+
};
|
|
79584
|
+
});
|
|
79585
|
+
}
|
|
79586
|
+
function extractSignature(r) {
|
|
79587
|
+
if (r.providerMetadata?.anthropic?.signature) return {
|
|
79588
|
+
signature: r.providerMetadata.anthropic.signature,
|
|
79589
|
+
signatureProvider: "anthropic"
|
|
79590
|
+
};
|
|
79591
|
+
if (r.providerMetadata?.google?.thoughtSignature) return {
|
|
79592
|
+
signature: r.providerMetadata.google.thoughtSignature,
|
|
79593
|
+
signatureProvider: "google"
|
|
79594
|
+
};
|
|
79595
|
+
if (r.providerMetadata?.vertex?.thoughtSignature) return {
|
|
79596
|
+
signature: r.providerMetadata.vertex.thoughtSignature,
|
|
79597
|
+
signatureProvider: "vertex"
|
|
79598
|
+
};
|
|
79599
|
+
return {
|
|
79600
|
+
signature: void 0,
|
|
79601
|
+
signatureProvider: void 0
|
|
79602
|
+
};
|
|
79580
79603
|
}
|
|
79581
79604
|
/**
|
|
79582
79605
|
* Extract thinking text from AI SDK reasoning as a single string.
|
|
@@ -92109,14 +92132,21 @@ function toolCallPartToCoreToolCallPart(part) {
|
|
|
92109
92132
|
type: "tool-call",
|
|
92110
92133
|
toolCallId: part.toolCallId,
|
|
92111
92134
|
toolName: part.toolName,
|
|
92112
|
-
input: part.args
|
|
92135
|
+
input: part.args,
|
|
92136
|
+
providerOptions: part.providerMetadata
|
|
92113
92137
|
};
|
|
92114
92138
|
}
|
|
92115
92139
|
function thinkingPartToCoreThinkingPart(part) {
|
|
92140
|
+
if (!part.signature) return {
|
|
92141
|
+
type: "reasoning",
|
|
92142
|
+
text: part.thinking
|
|
92143
|
+
};
|
|
92144
|
+
const provider = part.signatureProvider ?? "anthropic";
|
|
92145
|
+
const signatureKey = provider === "anthropic" ? "signature" : "thoughtSignature";
|
|
92116
92146
|
return {
|
|
92117
92147
|
type: "reasoning",
|
|
92118
92148
|
text: part.thinking,
|
|
92119
|
-
providerOptions:
|
|
92149
|
+
providerOptions: { [provider]: { [signatureKey]: part.signature } }
|
|
92120
92150
|
};
|
|
92121
92151
|
}
|
|
92122
92152
|
function toolResultPartToCoreToolResultPart(part) {
|
|
@@ -92275,7 +92305,8 @@ function classifyToolCalls(toolCalls, skillManager) {
|
|
|
92275
92305
|
toolCallId: tc.toolCallId,
|
|
92276
92306
|
toolName: tc.toolName,
|
|
92277
92307
|
input: tc.input,
|
|
92278
|
-
adapter
|
|
92308
|
+
adapter,
|
|
92309
|
+
providerMetadata: tc.providerMetadata
|
|
92279
92310
|
};
|
|
92280
92311
|
});
|
|
92281
92312
|
}
|
|
@@ -92292,7 +92323,8 @@ function buildToolCallParts(toolCalls) {
|
|
|
92292
92323
|
type: "toolCallPart",
|
|
92293
92324
|
toolCallId: tc.toolCallId,
|
|
92294
92325
|
toolName: tc.toolName,
|
|
92295
|
-
args: tc.input
|
|
92326
|
+
args: tc.input,
|
|
92327
|
+
providerMetadata: tc.providerMetadata
|
|
92296
92328
|
}));
|
|
92297
92329
|
}
|
|
92298
92330
|
function buildToolCalls(toolCalls) {
|
|
@@ -124611,7 +124643,7 @@ async function startHandler(expertKey, query, options, handlerOptions) {
|
|
|
124611
124643
|
//#endregion
|
|
124612
124644
|
//#region package.json
|
|
124613
124645
|
var name = "perstack";
|
|
124614
|
-
var version = "0.0.
|
|
124646
|
+
var version = "0.0.136";
|
|
124615
124647
|
var description = "PerStack CLI";
|
|
124616
124648
|
//#endregion
|
|
124617
124649
|
//#region bin/cli.ts
|