@kikimoradev/kcloud 1.5.1 → 1.5.2

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.
Files changed (2) hide show
  1. package/dist/main.js +27 -5
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1602,11 +1602,13 @@ const agentAdmissionSchema = z.object({
1602
1602
  monitor: agentAdmissionStateSchema.nullable(),
1603
1603
  executor: agentAdmissionStateSchema.nullable()
1604
1604
  }).meta({ id: "AgentAdmission" });
1605
+ const nodeUpdateAwaits = ["start", "end"];
1605
1606
  const admissionHoldSchema = z.object({
1606
1607
  pools: z.array(sessionRoleSchema),
1607
1608
  sessions: z.int().nonnegative(),
1608
1609
  target: z.string().nullable(),
1609
- updating: z.boolean()
1610
+ updating: z.boolean(),
1611
+ awaits: z.enum(nodeUpdateAwaits)
1610
1612
  }).meta({ id: "AdmissionHold" });
1611
1613
  const nodeStateSchema = z.enum([
1612
1614
  "pending",
@@ -1679,7 +1681,12 @@ const poolUsageSchema = z.object({
1679
1681
  memoryMaxBytes: z.int().nonnegative().nullable(),
1680
1682
  cpus: z.number().nonnegative().nullable(),
1681
1683
  memoryKills: z.int().nonnegative(),
1682
- processors: z.int().positive().nullable().optional()
1684
+ processors: z.int().positive().nullable().optional(),
1685
+ earlierRun: z.object({
1686
+ memoryBytes: z.int().nonnegative().nullable(),
1687
+ holds: z.boolean()
1688
+ }).meta({ id: "EarlierPoolRun" }).nullable().optional(),
1689
+ limitRaised: z.boolean().optional()
1683
1690
  }).meta({ id: "PoolUsage" });
1684
1691
  const nodePoolSchema = z.object({
1685
1692
  slots: z.int().nonnegative(),
@@ -1790,6 +1797,7 @@ const nodeUpdateSchema = z.object({
1790
1797
  sessions: z.int().nonnegative(),
1791
1798
  since: z.iso.datetime().nullable(),
1792
1799
  held: z.array(sessionRoleSchema),
1800
+ awaits: z.enum(nodeUpdateAwaits),
1793
1801
  last: z.object({
1794
1802
  outcome: z.enum([
1795
1803
  "updated",
@@ -4507,7 +4515,11 @@ const sessionFailures = {
4507
4515
  launcherRefused: "refused by the session starter"
4508
4516
  };
4509
4517
  const sessionFailureText = (reason) => reason === null ? "-" : sessionFailures[reason] ?? reason;
4510
- const unsupportedReasons = { node_outdated: "the node runs a version that reports no pools" };
4518
+ const unsupportedReasons = {
4519
+ node_outdated: "the node runs a version that reports no pools",
4520
+ configure_failed: "the host did not take the limits",
4521
+ configure_failing: "the node keeps failing to apply the limits, so sessions run without them until it succeeds"
4522
+ };
4511
4523
  const enforcementText = ({ state, reason }) => {
4512
4524
  switch (state) {
4513
4525
  case "enforced": return "The node holds each pool to the CPU and memory of its split.";
@@ -4538,6 +4550,12 @@ const memoryOf$1 = (pool) => {
4538
4550
  return memoryMaxBytes === null ? bytesOf(memoryBytes) : `${bytesOf(memoryBytes)} of ${bytesOf(memoryMaxBytes)}`;
4539
4551
  };
4540
4552
  const roles = ["monitor", "executor"];
4553
+ const earlierRunTexts = (pools) => roles.flatMap((role) => {
4554
+ const earlier = pools[role].usage?.earlierRun ?? null;
4555
+ if (earlier === null) return [];
4556
+ return [`The ${role} pool shares its memory with the sessions of the earlier run of the node, which use ${earlier.memoryBytes === null ? "an unknown amount" : bytesOf(earlier.memoryBytes)}${earlier.holds ? "; new sessions wait until they end" : ""}.`];
4557
+ });
4558
+ const limitRaisedTexts = (pools) => roles.filter((role) => pools[role].usage?.limitRaised === true).map((role) => `The ${role} pool keeps its memory limit above its share while its sessions use more; new sessions wait until they use less.`);
4541
4559
  const workOf = (role, { taskId, taskTitle, readable }) => {
4542
4560
  if (readable === false) return "another project";
4543
4561
  if (taskId === null) return role === "monitor" ? "monitor cycle" : "-";
@@ -4593,6 +4611,8 @@ const poolsText = (pools, split) => {
4593
4611
  ...pools.agentsSlice == null ? [] : [agentsSliceText(pools.agentsSlice)],
4594
4612
  ...pools.refused == null ? [] : [refusedText(pools.refused)],
4595
4613
  ...pools.layout == null ? [] : layoutTexts(pools.layout, split),
4614
+ ...earlierRunTexts(pools),
4615
+ ...limitRaisedTexts(pools),
4596
4616
  renderTable([
4597
4617
  { header: "POOL" },
4598
4618
  { header: "SLOTS IN USE" },
@@ -4831,7 +4851,7 @@ const admissionRowsOf = (agent) => {
4831
4851
  const admissionHoldRowsOf = ({ runtime }) => {
4832
4852
  const hold = runtime.admissionHold;
4833
4853
  if (hold == null) return [];
4834
- if (hold.updating) return [["admissions", `held while the node updates to ${hold.target ?? "-"}`]];
4854
+ if (hold.updating || hold.awaits === "start") return [["admissions", `held while the node updates to ${hold.target ?? "-"}`]];
4835
4855
  const all = hold.pools.includes("monitor");
4836
4856
  const noun = all ? "session" : "executor session";
4837
4857
  const waits = `${String(hold.sessions)} ${noun}${hold.sessions === 1 ? "" : "s"}`;
@@ -9923,7 +9943,9 @@ const updateOf = ({ update }) => {
9923
9943
  if (update === null) return "not reported";
9924
9944
  switch (update.state) {
9925
9945
  case "current": return "current";
9926
- case "waiting": return heldPoolsOf(update).includes("monitor") ? `admissions held for ${update.target ?? "-"}, waits for ${sessionsText(update.sessions, "session")}` : `executor admissions held for ${update.target ?? "-"}, waits for ${sessionsText(update.sessions, "executor session")}; monitors go on until the executor pool is empty`;
9946
+ case "waiting":
9947
+ if (update.awaits === "start") return `admissions held while the node updates to ${update.target ?? "-"}`;
9948
+ return heldPoolsOf(update).includes("monitor") ? `admissions held for ${update.target ?? "-"}, waits for ${sessionsText(update.sessions, "session")}` : `executor admissions held for ${update.target ?? "-"}, waits for ${sessionsText(update.sessions, "executor session")}; monitors go on until the executor pool is empty`;
9927
9949
  case "updating": return `updating to ${update.target ?? "-"}`;
9928
9950
  case "failed": return `failed to reach ${update.target ?? "-"}, runs its previous version`;
9929
9951
  case "unmanaged": return "updated with its platform";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "version": "1.5.1",
18
+ "version": "1.5.2",
19
19
  "dependencies": {
20
20
  "@clack/prompts": "1.8.1",
21
21
  "@modelcontextprotocol/server": "2.1.0",