@kikimoradev/kcloud 1.0.3 → 1.0.4

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 +21 -4
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -2687,6 +2687,7 @@ z.object({
2687
2687
  //#endregion
2688
2688
  //#region ../../packages/contracts/src/agent-backups.ts
2689
2689
  const agentBackupTriggers = ["nightly", "manual"];
2690
+ const agentBackupUnavailableReasons = ["release_without_export"];
2690
2691
  const agentBackupSchema = z.object({
2691
2692
  id: idSchema,
2692
2693
  agentId: idSchema,
@@ -2699,9 +2700,15 @@ const agentBackupSchema = z.object({
2699
2700
  createdAt: z.iso.datetime(),
2700
2701
  expiresAt: z.iso.datetime()
2701
2702
  }).meta({ id: "AgentBackup" });
2703
+ const agentBackupUnavailableSchema = z.object({
2704
+ reason: z.enum(agentBackupUnavailableReasons),
2705
+ kikimoraVersion: z.string(),
2706
+ requiredVersion: z.string()
2707
+ }).meta({ id: "AgentBackupUnavailable" });
2702
2708
  z.object({
2703
2709
  items: z.array(agentBackupSchema),
2704
- retentionDays: z.int().positive()
2710
+ retentionDays: z.int().positive(),
2711
+ unavailable: agentBackupUnavailableSchema.nullable()
2705
2712
  }).meta({ id: "AgentBackupList" });
2706
2713
  z.object({ state: z.literal("requested") }).meta({ id: "AgentBackupRequested" });
2707
2714
  z.object({
@@ -2774,6 +2781,7 @@ const archiveSkipReasons = [
2774
2781
  "special_file",
2775
2782
  "unreadable"
2776
2783
  ];
2784
+ const omittedAgentReasons = ["remote_node", "unplaced"];
2777
2785
  const maxBackupRetentionDays = 3650;
2778
2786
  const maxPlatformSecretLength = 4096;
2779
2787
  const maxHostOperationOutputLength = 4096;
@@ -2968,6 +2976,12 @@ const archivedAgentSchema = z.object({
2968
2976
  message: "expected no more listed skipped files than skippedTotal",
2969
2977
  path: ["skippedTotal"]
2970
2978
  });
2979
+ const omittedAgentSchema = z.object({
2980
+ agentId: idSchema,
2981
+ slug: slugSchema,
2982
+ nodeId: idSchema.nullable(),
2983
+ reason: z.enum(omittedAgentReasons)
2984
+ });
2971
2985
  z.object({
2972
2986
  version: z.literal(1),
2973
2987
  backupId: idSchema,
@@ -2980,7 +2994,8 @@ z.object({
2980
2994
  cipher: z.literal(backupCipher),
2981
2995
  parts: z.array(backupPartSchema).refine(everyPartOnce, { message: `expected exactly the parts ${backupPartNames.join(", ")}` }),
2982
2996
  database: z.object({ pgVersion: z.string().min(1) }),
2983
- agents: z.array(archivedAgentSchema)
2997
+ agents: z.array(archivedAgentSchema),
2998
+ omitted: z.array(omittedAgentSchema).default([])
2984
2999
  });
2985
3000
  const hostOperationSchema = z.object({
2986
3001
  id: idSchema,
@@ -4247,7 +4262,9 @@ const restoredAgent = async (api, agentId, { backupId, name, node, slug }) => {
4247
4262
  }), restoreHints);
4248
4263
  };
4249
4264
  const keptFor = (days) => `A backup is kept for ${String(days)} ${days === 1 ? "day" : "days"}.`;
4250
- const backupsTable = ({ items, retentionDays }) => items.length === 0 ? `The agent has no backup yet. ${keptFor(retentionDays)}` : [renderTable([
4265
+ const unavailableNote = ({ unavailable }) => unavailable?.reason === "release_without_export" ? [`Kikimora ${unavailable.kikimoraVersion} cannot export the memory of the agent, so its node backs nothing up. Backups need ${unavailable.requiredVersion} or newer: move the agent with kcloud agents set, then kcloud agents update.`] : [];
4266
+ const backupsTable = (list) => [...unavailableNote(list), backupListing(list)].join("\n");
4267
+ const backupListing = ({ items, retentionDays }) => items.length === 0 ? `The agent has no backup yet. ${keptFor(retentionDays)}` : [renderTable([
4251
4268
  { header: "CREATED" },
4252
4269
  { header: "TRIGGER" },
4253
4270
  { header: "NODE" },
@@ -6783,7 +6800,7 @@ const agentBackupTools = [
6783
6800
  defineTool({
6784
6801
  name: "agent_backups_list",
6785
6802
  title: "List the backups of an agent",
6786
- description: "List the backups of the memory of an agent, the newest first, with their trigger, node, Kikimora release, entries, size and expiry, and the days a backup is kept.",
6803
+ description: "List the backups of the memory of an agent, the newest first, with their trigger, node, Kikimora release, entries, size and expiry, the days a backup is kept, and in unavailable why the node makes none, such as a Kikimora release that exports no memory.",
6787
6804
  operations: ["listAgentBackups"],
6788
6805
  safety: "read",
6789
6806
  input: z.object(agentFields),
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "version": "1.0.3",
18
+ "version": "1.0.4",
19
19
  "dependencies": {
20
20
  "@clack/prompts": "1.8.1",
21
21
  "@modelcontextprotocol/server": "2.1.0",