perstack 0.0.114 → 0.0.115
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 +117 -36
- package/dist/bin/cli.js.map +1 -1
- package/dist/dist-Dbqn18AZ.js.map +1 -1
- package/package.json +7 -7
package/dist/bin/cli.js
CHANGED
|
@@ -16302,7 +16302,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
16302
16302
|
//#endregion
|
|
16303
16303
|
//#region ../base/package.json
|
|
16304
16304
|
var name$6 = "@perstack/base";
|
|
16305
|
-
var version$2 = "0.0.
|
|
16305
|
+
var version$2 = "0.0.78";
|
|
16306
16306
|
|
|
16307
16307
|
//#endregion
|
|
16308
16308
|
//#region ../base/src/tools/todo.ts
|
|
@@ -21310,7 +21310,7 @@ async function expertVersionsHandler(scopeName, options) {
|
|
|
21310
21310
|
|
|
21311
21311
|
//#endregion
|
|
21312
21312
|
//#region ../../packages/runtime/package.json
|
|
21313
|
-
var version$1 = "0.0.
|
|
21313
|
+
var version$1 = "0.0.131";
|
|
21314
21314
|
|
|
21315
21315
|
//#endregion
|
|
21316
21316
|
//#region ../../packages/runtime/src/helpers/usage.ts
|
|
@@ -93949,6 +93949,7 @@ var CoordinatorExecutor = class {
|
|
|
93949
93949
|
expertName: expertToRun.name,
|
|
93950
93950
|
experts: Object.keys(experts),
|
|
93951
93951
|
model: resolvedModel,
|
|
93952
|
+
providerName: setting.providerConfig.providerName,
|
|
93952
93953
|
maxRetries: setting.maxRetries,
|
|
93953
93954
|
timeout: setting.timeout,
|
|
93954
93955
|
query: setting.input.text,
|
|
@@ -121809,6 +121810,11 @@ function createInitialDelegationTreeState() {
|
|
|
121809
121810
|
nodes: /* @__PURE__ */ new Map(),
|
|
121810
121811
|
rootRunId: void 0,
|
|
121811
121812
|
jobTotalTokens: 0,
|
|
121813
|
+
jobReasoningTokens: 0,
|
|
121814
|
+
jobInputTokens: 0,
|
|
121815
|
+
jobCachedInputTokens: 0,
|
|
121816
|
+
jobOutputTokens: 0,
|
|
121817
|
+
providerName: void 0,
|
|
121812
121818
|
jobStartedAt: void 0,
|
|
121813
121819
|
runIdAliases: /* @__PURE__ */ new Map()
|
|
121814
121820
|
};
|
|
@@ -121918,6 +121924,7 @@ function processDelegationTreeEvent(state, event) {
|
|
|
121918
121924
|
switch (event.type) {
|
|
121919
121925
|
case "initializeRuntime":
|
|
121920
121926
|
if (state.jobStartedAt === void 0) state.jobStartedAt = event.timestamp;
|
|
121927
|
+
if (state.providerName === void 0) state.providerName = event.providerName;
|
|
121921
121928
|
return true;
|
|
121922
121929
|
case "startRun": {
|
|
121923
121930
|
const initCheckpoint = event.initialCheckpoint;
|
|
@@ -121937,6 +121944,7 @@ function processDelegationTreeEvent(state, event) {
|
|
|
121937
121944
|
actionLabel: "Starting...",
|
|
121938
121945
|
actionFileArg: void 0,
|
|
121939
121946
|
contextWindowUsage: initCheckpoint.contextWindowUsage ?? 0,
|
|
121947
|
+
model: event.model,
|
|
121940
121948
|
parentRunId,
|
|
121941
121949
|
childRunIds: [],
|
|
121942
121950
|
totalTokens: 0
|
|
@@ -121964,6 +121972,7 @@ function processDelegationTreeEvent(state, event) {
|
|
|
121964
121972
|
const node = state.nodes.get(nodeId);
|
|
121965
121973
|
if (node) {
|
|
121966
121974
|
node.status = "running";
|
|
121975
|
+
node.model = event.model;
|
|
121967
121976
|
if (checkpoint.contextWindowUsage !== void 0) node.contextWindowUsage = checkpoint.contextWindowUsage;
|
|
121968
121977
|
}
|
|
121969
121978
|
return true;
|
|
@@ -121995,6 +122004,10 @@ function processDelegationTreeEvent(state, event) {
|
|
|
121995
122004
|
node.actionFileArg = fileArg;
|
|
121996
122005
|
node.totalTokens += event.usage.totalTokens;
|
|
121997
122006
|
state.jobTotalTokens += event.usage.totalTokens;
|
|
122007
|
+
state.jobReasoningTokens += event.usage.reasoningTokens;
|
|
122008
|
+
state.jobInputTokens += event.usage.inputTokens;
|
|
122009
|
+
state.jobCachedInputTokens += event.usage.cachedInputTokens;
|
|
122010
|
+
state.jobOutputTokens += event.usage.outputTokens;
|
|
121998
122011
|
}
|
|
121999
122012
|
return true;
|
|
122000
122013
|
}
|
|
@@ -122018,6 +122031,10 @@ function processDelegationTreeEvent(state, event) {
|
|
|
122018
122031
|
node.actionFileArg = void 0;
|
|
122019
122032
|
node.totalTokens += event.usage.totalTokens;
|
|
122020
122033
|
state.jobTotalTokens += event.usage.totalTokens;
|
|
122034
|
+
state.jobReasoningTokens += event.usage.reasoningTokens;
|
|
122035
|
+
state.jobInputTokens += event.usage.inputTokens;
|
|
122036
|
+
state.jobCachedInputTokens += event.usage.cachedInputTokens;
|
|
122037
|
+
state.jobOutputTokens += event.usage.outputTokens;
|
|
122021
122038
|
if (event.checkpoint.contextWindowUsage !== void 0) node.contextWindowUsage = event.checkpoint.contextWindowUsage;
|
|
122022
122039
|
}
|
|
122023
122040
|
return true;
|
|
@@ -122047,6 +122064,10 @@ function processDelegationTreeEvent(state, event) {
|
|
|
122047
122064
|
if (node) {
|
|
122048
122065
|
node.totalTokens += event.usage.totalTokens;
|
|
122049
122066
|
state.jobTotalTokens += event.usage.totalTokens;
|
|
122067
|
+
state.jobReasoningTokens += event.usage.reasoningTokens;
|
|
122068
|
+
state.jobInputTokens += event.usage.inputTokens;
|
|
122069
|
+
state.jobCachedInputTokens += event.usage.cachedInputTokens;
|
|
122070
|
+
state.jobOutputTokens += event.usage.outputTokens;
|
|
122050
122071
|
}
|
|
122051
122072
|
return true;
|
|
122052
122073
|
}
|
|
@@ -122064,7 +122085,13 @@ function useDelegationTree() {
|
|
|
122064
122085
|
state,
|
|
122065
122086
|
processEvent,
|
|
122066
122087
|
statusCounts: getStatusCounts(state),
|
|
122067
|
-
formattedTotalTokens: formatTokenCount(state.jobTotalTokens)
|
|
122088
|
+
formattedTotalTokens: formatTokenCount(state.jobTotalTokens),
|
|
122089
|
+
formattedReasoningTokens: formatTokenCount(state.jobReasoningTokens),
|
|
122090
|
+
formattedInputTokens: formatTokenCount(state.jobInputTokens),
|
|
122091
|
+
formattedCachedInputTokens: formatTokenCount(state.jobCachedInputTokens),
|
|
122092
|
+
formattedOutputTokens: formatTokenCount(state.jobOutputTokens),
|
|
122093
|
+
providerName: state.providerName,
|
|
122094
|
+
cacheHitRate: state.jobInputTokens + state.jobCachedInputTokens > 0 ? (state.jobCachedInputTokens / (state.jobInputTokens + state.jobCachedInputTokens) * 100).toFixed(2) : "0.00"
|
|
122068
122095
|
};
|
|
122069
122096
|
}
|
|
122070
122097
|
|
|
@@ -122163,15 +122190,25 @@ function TreeNodeLine({ flatNode, spinner }) {
|
|
|
122163
122190
|
color: colors.muted,
|
|
122164
122191
|
children: [" ", node.actionFileArg]
|
|
122165
122192
|
}) : null,
|
|
122166
|
-
showUsage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
122167
|
-
|
|
122168
|
-
|
|
122169
|
-
|
|
122170
|
-
|
|
122171
|
-
|
|
122172
|
-
|
|
122173
|
-
|
|
122174
|
-
|
|
122193
|
+
showUsage ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
122194
|
+
node.model ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122195
|
+
dimColor: true,
|
|
122196
|
+
children: " · "
|
|
122197
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122198
|
+
dimColor: true,
|
|
122199
|
+
children: node.model
|
|
122200
|
+
})] }) : null,
|
|
122201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122202
|
+
dimColor: true,
|
|
122203
|
+
children: " · "
|
|
122204
|
+
}),
|
|
122205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
|
|
122206
|
+
usageIcon,
|
|
122207
|
+
" ",
|
|
122208
|
+
usagePercent,
|
|
122209
|
+
"%"
|
|
122210
|
+
] })
|
|
122211
|
+
] }) : null
|
|
122175
122212
|
] });
|
|
122176
122213
|
}
|
|
122177
122214
|
const DelegationTree = ({ state }) => {
|
|
@@ -122186,7 +122223,7 @@ const DelegationTree = ({ state }) => {
|
|
|
122186
122223
|
|
|
122187
122224
|
//#endregion
|
|
122188
122225
|
//#region ../../packages/tui-components/src/execution/components/interface-panel.tsx
|
|
122189
|
-
const InterfacePanel = ({ query, runStatus, onSubmit, delegationTreeState, runningCount, waitingCount,
|
|
122226
|
+
const InterfacePanel = ({ query, runStatus, onSubmit, delegationTreeState, runningCount, waitingCount, formattedReasoningTokens, formattedInputTokens, formattedCachedInputTokens, formattedOutputTokens, providerName, cacheHitRate, elapsedTime }) => {
|
|
122190
122227
|
const { input, handleInput } = useTextInput({
|
|
122191
122228
|
onSubmit,
|
|
122192
122229
|
canSubmit: runStatus !== "running"
|
|
@@ -122205,28 +122242,60 @@ const InterfacePanel = ({ query, runStatus, onSubmit, delegationTreeState, runni
|
|
|
122205
122242
|
isWaiting ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122206
122243
|
color: colors.accent,
|
|
122207
122244
|
children: "Waiting for query..."
|
|
122208
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
122209
|
-
|
|
122210
|
-
|
|
122211
|
-
|
|
122212
|
-
|
|
122213
|
-
|
|
122214
|
-
|
|
122215
|
-
|
|
122216
|
-
|
|
122217
|
-
|
|
122218
|
-
|
|
122219
|
-
|
|
122220
|
-
"
|
|
122221
|
-
waitingCount,
|
|
122222
|
-
|
|
122223
|
-
|
|
122224
|
-
|
|
122225
|
-
|
|
122226
|
-
|
|
122227
|
-
|
|
122228
|
-
|
|
122229
|
-
|
|
122245
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
122246
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
122247
|
+
color: colors.success,
|
|
122248
|
+
wrap: "truncate",
|
|
122249
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122250
|
+
bold: true,
|
|
122251
|
+
children: "Query: "
|
|
122252
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: query || "–" })]
|
|
122253
|
+
}),
|
|
122254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
122255
|
+
dimColor: true,
|
|
122256
|
+
children: [
|
|
122257
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [runningCount, " running"] }),
|
|
122258
|
+
waitingCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
|
|
122259
|
+
" · ",
|
|
122260
|
+
waitingCount,
|
|
122261
|
+
" waiting"
|
|
122262
|
+
] }) : null,
|
|
122263
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: " · " }),
|
|
122264
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: elapsedTime }),
|
|
122265
|
+
providerName ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [" · ", providerName] }) : null
|
|
122266
|
+
]
|
|
122267
|
+
}),
|
|
122268
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
|
|
122269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122270
|
+
dimColor: true,
|
|
122271
|
+
children: "R "
|
|
122272
|
+
}),
|
|
122273
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: formattedReasoningTokens }),
|
|
122274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122275
|
+
dimColor: true,
|
|
122276
|
+
children: " · I "
|
|
122277
|
+
}),
|
|
122278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: formattedInputTokens }),
|
|
122279
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122280
|
+
dimColor: true,
|
|
122281
|
+
children: " · C "
|
|
122282
|
+
}),
|
|
122283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: formattedCachedInputTokens }),
|
|
122284
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
122285
|
+
dimColor: true,
|
|
122286
|
+
children: " · O "
|
|
122287
|
+
}),
|
|
122288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: formattedOutputTokens }),
|
|
122289
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
122290
|
+
dimColor: true,
|
|
122291
|
+
children: [
|
|
122292
|
+
" (cache: ",
|
|
122293
|
+
cacheHitRate,
|
|
122294
|
+
"%)"
|
|
122295
|
+
]
|
|
122296
|
+
})
|
|
122297
|
+
] })
|
|
122298
|
+
] }),
|
|
122230
122299
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DelegationTree, { state: delegationTreeState }),
|
|
122231
122300
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { children: [
|
|
122232
122301
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
@@ -122379,6 +122448,12 @@ const useExecutionState = (options) => {
|
|
|
122379
122448
|
runningCount: delegationTree.statusCounts.running,
|
|
122380
122449
|
waitingCount: delegationTree.statusCounts.waiting,
|
|
122381
122450
|
formattedTotalTokens: delegationTree.formattedTotalTokens,
|
|
122451
|
+
formattedReasoningTokens: delegationTree.formattedReasoningTokens,
|
|
122452
|
+
formattedInputTokens: delegationTree.formattedInputTokens,
|
|
122453
|
+
formattedCachedInputTokens: delegationTree.formattedCachedInputTokens,
|
|
122454
|
+
formattedOutputTokens: delegationTree.formattedOutputTokens,
|
|
122455
|
+
providerName: delegationTree.providerName,
|
|
122456
|
+
cacheHitRate: delegationTree.cacheHitRate,
|
|
122382
122457
|
elapsedTime
|
|
122383
122458
|
};
|
|
122384
122459
|
};
|
|
@@ -122444,6 +122519,12 @@ const ExecutionApp = (props) => {
|
|
|
122444
122519
|
runningCount: state.runningCount,
|
|
122445
122520
|
waitingCount: state.waitingCount,
|
|
122446
122521
|
formattedTotalTokens: state.formattedTotalTokens,
|
|
122522
|
+
formattedReasoningTokens: state.formattedReasoningTokens,
|
|
122523
|
+
formattedInputTokens: state.formattedInputTokens,
|
|
122524
|
+
formattedCachedInputTokens: state.formattedCachedInputTokens,
|
|
122525
|
+
formattedOutputTokens: state.formattedOutputTokens,
|
|
122526
|
+
providerName: state.providerName,
|
|
122527
|
+
cacheHitRate: state.cacheHitRate,
|
|
122447
122528
|
elapsedTime: state.elapsedTime
|
|
122448
122529
|
})]
|
|
122449
122530
|
});
|
|
@@ -122801,7 +122882,7 @@ async function startHandler(expertKey, query, options, handlerOptions) {
|
|
|
122801
122882
|
//#endregion
|
|
122802
122883
|
//#region package.json
|
|
122803
122884
|
var name = "perstack";
|
|
122804
|
-
var version = "0.0.
|
|
122885
|
+
var version = "0.0.115";
|
|
122805
122886
|
var description = "PerStack CLI";
|
|
122806
122887
|
|
|
122807
122888
|
//#endregion
|