priiisk 0.1.18 → 0.1.20

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.
@@ -1,11 +1,12 @@
1
1
  import { createRequire as __priiiskCreateRequire } from "node:module";
2
2
  const require = __priiiskCreateRequire(import.meta.url);
3
3
  import {
4
+ CliAlreadyReported,
4
5
  TypeId2 as TypeId,
5
6
  directToolBin,
6
7
  error,
7
8
  log
8
- } from "./chunk-3P2OELRJ.js";
9
+ } from "./chunk-QDIMBK33.js";
9
10
  import {
10
11
  _void,
11
12
  cached,
@@ -1615,12 +1616,25 @@ var equipmentLines = (equipment, revision) => [
1615
1616
  ` mcp: ${mcpGrants(equipment.mcp)}`,
1616
1617
  ` skills: ${names([...equipment.skillNames])}`
1617
1618
  ];
1619
+ var usageLines = (usage) => {
1620
+ const context = usage.context === void 0 || usage.context.tokens === null ? "unknown" : `${String(usage.context.tokens)}/${String(usage.context.contextWindow)}${usage.context.percent === null ? "" : ` (${usage.context.percent.toFixed(1)}%)`}`;
1621
+ const cache = usage.latestCacheHitRate === void 0 ? "not reported" : `${usage.latestCacheHitRate.toFixed(1)}%`;
1622
+ return [
1623
+ ` context: ${context}, cache ${cache}`,
1624
+ ` tokens: ${String(usage.tokens.total)} total, ${String(usage.tokens.input)} in, ${String(usage.tokens.output)} out, ${String(usage.tokens.cacheRead)} cache read`,
1625
+ ` cost: $${usage.cost.toFixed(4)}, ${String(usage.totalMessages)} messages, ${String(usage.toolCalls)} tool calls`
1626
+ ];
1627
+ };
1618
1628
  var WORKER_ERROR_LIMIT = 160;
1619
1629
  var formatWorker = (worker) => {
1620
1630
  const alias = worker.alias === void 0 ? "" : ` (${worker.alias})`;
1621
1631
  const failure = worker.error === void 0 ? "" : ` \u2014 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u0445\u043E\u0434: ${worker.error.code}: ${worker.error.message.slice(0, WORKER_ERROR_LIMIT)}`;
1622
1632
  const headline = `${worker.workerId}${alias}: ${worker.state}, session ${worker.sessionState}${failure}`;
1623
- return worker.equipment === void 0 ? headline : [headline, ...equipmentLines(worker.equipment, worker.equipmentVersion)].join("\n");
1633
+ return [
1634
+ headline,
1635
+ ...worker.equipment === void 0 ? [] : equipmentLines(worker.equipment, worker.equipmentVersion),
1636
+ ...worker.usage === void 0 ? [] : usageLines(worker.usage)
1637
+ ].join("\n");
1624
1638
  };
1625
1639
  var printWorkers = (json) => (effect) => effect.pipe(
1626
1640
  flatMap(
@@ -1702,6 +1716,7 @@ var failureLine = (payload) => {
1702
1716
  return `priiisk:${code2} ${String(payload.message)}${action}`;
1703
1717
  };
1704
1718
  var reportCliFailure = (json, error3) => {
1719
+ if (error3 instanceof CliAlreadyReported) return _void;
1705
1720
  if (!json && parserReported(error3)) return _void;
1706
1721
  const payload = errorPayload(error3);
1707
1722
  return error(json ? JSON.stringify(payload) : failureLine(payload));
@@ -3,14 +3,14 @@ const require = __priiiskCreateRequire(import.meta.url);
3
3
  import {
4
4
  errorPayload,
5
5
  makeCapturedConsole
6
- } from "./chunk-HGZJCURC.js";
6
+ } from "./chunk-FBRFN62A.js";
7
7
  import {
8
8
  withCampRpcSession,
9
9
  withConsole
10
- } from "./chunk-3P2OELRJ.js";
10
+ } from "./chunk-QDIMBK33.js";
11
11
  import {
12
12
  PRIIISK_CLI_VERSION
13
- } from "./chunk-CI7E6IQA.js";
13
+ } from "./chunk-XLZHFINK.js";
14
14
  import {
15
15
  _await2 as _await,
16
16
  addFinalizer2 as addFinalizer,