@zixt/host 0.0.131 → 0.0.133

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/index.js +128 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import { homedir as homedir4 } from "node:os";
28
28
  // package.json
29
29
  var package_default = {
30
30
  name: "@zixt/host",
31
- version: "0.0.131",
31
+ version: "0.0.133",
32
32
  type: "module",
33
33
  exports: {
34
34
  ".": "./src/client.ts",
@@ -16864,6 +16864,14 @@ var ScheduleCadence = external_exports.discriminatedUnion("kind", [
16864
16864
  dayOfWeek: external_exports.number().int().min(0).max(6),
16865
16865
  hourUtc: external_exports.number().int().min(0).max(23),
16866
16866
  minuteUtc: external_exports.number().int().min(0).max(59).default(0)
16867
+ }),
16868
+ external_exports.object({
16869
+ kind: external_exports.literal("monthly"),
16870
+ /** 1–28 (UTC) so the occurrence exists in every month; 29–31 is refused
16871
+ * rather than sliding to a guessed last day (SCH-1). */
16872
+ dayOfMonth: external_exports.number().int().min(1).max(28),
16873
+ hourUtc: external_exports.number().int().min(0).max(23),
16874
+ minuteUtc: external_exports.number().int().min(0).max(59).default(0)
16867
16875
  })
16868
16876
  ]);
16869
16877
  var ScheduleSkipReason = external_exports.enum([
@@ -19701,7 +19709,7 @@ var UpdateManagerRequest = external_exports.object({
19701
19709
  /** Optimistic concurrency: refuse when another admin saved first. */
19702
19710
  expectedRevision: external_exports.number().int().min(0).optional()
19703
19711
  }).strict().superRefine((value, ctx) => {
19704
- if (value.displayName === void 0 && value.instructions === void 0 && value.model === void 0 && value.reasoningEffort === void 0 && value.slack === void 0) {
19712
+ if (value.displayName === void 0 && value.instructions === void 0 && value.model === void 0 && value.reasoningEffort === void 0 && value.slack === void 0 && value.portrait === void 0) {
19705
19713
  ctx.addIssue({ code: "custom", message: "nothing to update" });
19706
19714
  }
19707
19715
  });
@@ -22291,6 +22299,13 @@ var PlannedCadence = external_exports.discriminatedUnion("kind", [
22291
22299
  hour: external_exports.number().int().min(0).max(23),
22292
22300
  minute: external_exports.number().int().min(0).max(59)
22293
22301
  }),
22302
+ external_exports.object({
22303
+ kind: external_exports.literal("monthly"),
22304
+ /** 1–28, the window every month has (SCH-1); month-start work lives here. */
22305
+ dayOfMonth: external_exports.number().int().min(1).max(28),
22306
+ hour: external_exports.number().int().min(0).max(23),
22307
+ minute: external_exports.number().int().min(0).max(59)
22308
+ }),
22294
22309
  external_exports.object({ kind: external_exports.literal("every"), minutes: external_exports.number().int().min(5).max(1440) })
22295
22310
  ]);
22296
22311
  var PlannedAutomationTrigger = external_exports.enum(["schedule", "webhook"]);
@@ -37918,8 +37933,8 @@ import { createServer as createServer2 } from "node:http";
37918
37933
  var CADENCE_PROPS = {
37919
37934
  cadence_kind: {
37920
37935
  type: "string",
37921
- enum: ["every", "daily", "weekly"],
37922
- description: "every = every N minutes; daily/weekly run at a UTC time."
37936
+ enum: ["every", "daily", "weekly", "monthly"],
37937
+ description: "every = every N minutes; daily/weekly/monthly run at a UTC time."
37923
37938
  },
37924
37939
  minutes: {
37925
37940
  type: "integer",
@@ -37927,9 +37942,16 @@ var CADENCE_PROPS = {
37927
37942
  maximum: 10080,
37928
37943
  description: "every-only: interval in minutes (1 to 10080)."
37929
37944
  },
37930
- hour_utc: { type: "number", description: "daily/weekly: hour 0-23 (UTC)." },
37931
- minute_utc: { type: "number", description: "daily/weekly: minute 0-59 (UTC), default 0." },
37932
- day_of_week: { type: "number", description: "weekly-only: 0 = Sunday \u2026 6 = Saturday." }
37945
+ hour_utc: { type: "number", description: "daily/weekly/monthly: hour 0-23 (UTC)." },
37946
+ minute_utc: {
37947
+ type: "number",
37948
+ description: "daily/weekly/monthly: minute 0-59 (UTC), default 0."
37949
+ },
37950
+ day_of_week: { type: "number", description: "weekly-only: 0 = Sunday \u2026 6 = Saturday." },
37951
+ day_of_month: {
37952
+ type: "number",
37953
+ description: "monthly-only: day 1-28 (UTC); 1-28 exists in every month."
37954
+ }
37933
37955
  };
37934
37956
  var TOOLS = [
37935
37957
  {
@@ -38091,6 +38113,56 @@ var TOOLS = [
38091
38113
  required: ["name", "instructions", "cadence_kind"]
38092
38114
  }
38093
38115
  },
38116
+ {
38117
+ name: "propose_automations",
38118
+ description: 'Recommend recurring Automations WITHOUT creating them: the set is recorded for an organization Admin, who reviews it under Needs attention and on the Automations page and creates or dismisses each item; nothing runs until a person approves. Use this whenever YOU conclude recurring checks would help: after exploring an inbox, an ad account, or a monitoring stack, or after noticing a pattern in your work. Use schedule_task instead only for recurring work this task explicitly asked you to set up. Give each item an honest one-line why. For a system that pushes alerts (Grafana, Sentry, an uptime monitor), propose trigger "webhook" with its name instead of a schedule; the Admin receives the endpoint and secret to paste into it, never you. An empty automations list honestly records that nothing recurring is needed.',
38119
+ inputSchema: {
38120
+ type: "object",
38121
+ properties: {
38122
+ summary: {
38123
+ type: "string",
38124
+ minLength: 1,
38125
+ maxLength: 600,
38126
+ description: "One line: what you explored or noticed, and why these checks."
38127
+ },
38128
+ automations: {
38129
+ type: "array",
38130
+ maxItems: 10,
38131
+ items: {
38132
+ type: "object",
38133
+ properties: {
38134
+ name: { type: "string", minLength: 1, maxLength: 120 },
38135
+ instructions: {
38136
+ type: "string",
38137
+ minLength: 1,
38138
+ maxLength: 1e4,
38139
+ description: "What each run should do; a run with nothing to do ends quietly."
38140
+ },
38141
+ why: {
38142
+ type: "string",
38143
+ minLength: 1,
38144
+ maxLength: 300,
38145
+ description: "Honest one line: why this check helps this business."
38146
+ },
38147
+ trigger: {
38148
+ type: "string",
38149
+ enum: ["schedule", "webhook"],
38150
+ description: "schedule = a cadence below; webhook = an external system pushes."
38151
+ },
38152
+ ...CADENCE_PROPS,
38153
+ webhook_source: {
38154
+ type: "string",
38155
+ maxLength: 120,
38156
+ description: 'webhook-only: the system expected to call (e.g. "Grafana").'
38157
+ }
38158
+ },
38159
+ required: ["name", "instructions", "why", "trigger"]
38160
+ }
38161
+ }
38162
+ },
38163
+ required: ["summary", "automations"]
38164
+ }
38165
+ },
38094
38166
  {
38095
38167
  name: "list_schedules",
38096
38168
  description: "List your own schedules (id, name, cadence, enabled, next run).",
@@ -38377,7 +38449,12 @@ function cadenceFrom(args) {
38377
38449
  if (!Number.isFinite(dayOfWeek)) throw new Error('cadence "weekly" needs `day_of_week`');
38378
38450
  return { kind: "weekly", dayOfWeek, hourUtc, minuteUtc };
38379
38451
  }
38380
- throw new Error("cadence_kind must be every | daily | weekly");
38452
+ if (kind === "monthly") {
38453
+ const dayOfMonth = Number(args["day_of_month"]);
38454
+ if (!Number.isFinite(dayOfMonth)) throw new Error('cadence "monthly" needs `day_of_month`');
38455
+ return { kind: "monthly", dayOfMonth, hourUtc, minuteUtc };
38456
+ }
38457
+ throw new Error("cadence_kind must be every | daily | weekly | monthly");
38381
38458
  }
38382
38459
  function opFor(name, args) {
38383
38460
  const str = (key, required2 = true) => {
@@ -38397,6 +38474,49 @@ function opFor(name, args) {
38397
38474
  ...endsAt ? { endsAt } : {}
38398
38475
  };
38399
38476
  }
38477
+ case "propose_automations": {
38478
+ const rawItems = args["automations"];
38479
+ if (!Array.isArray(rawItems)) throw new Error("missing required argument `automations`");
38480
+ return {
38481
+ kind: "automation.propose",
38482
+ summary: str("summary"),
38483
+ items: rawItems.map((raw, index) => {
38484
+ if (typeof raw !== "object" || raw === null) {
38485
+ throw new Error(`automations[${index}] must be an object`);
38486
+ }
38487
+ const item = raw;
38488
+ const field = (key) => {
38489
+ const value = item[key];
38490
+ if (typeof value !== "string" || value.length === 0) {
38491
+ throw new Error(`automations[${index}] is missing \`${key}\``);
38492
+ }
38493
+ return value;
38494
+ };
38495
+ const trigger = field("trigger");
38496
+ if (trigger === "webhook") {
38497
+ const source = item["webhook_source"];
38498
+ return {
38499
+ name: field("name"),
38500
+ instructions: field("instructions"),
38501
+ why: field("why"),
38502
+ trigger: {
38503
+ kind: "webhook",
38504
+ source: typeof source === "string" && source ? source : null
38505
+ }
38506
+ };
38507
+ }
38508
+ if (trigger !== "schedule") {
38509
+ throw new Error(`automations[${index}] trigger must be schedule | webhook`);
38510
+ }
38511
+ return {
38512
+ name: field("name"),
38513
+ instructions: field("instructions"),
38514
+ why: field("why"),
38515
+ trigger: { kind: "schedule", cadence: cadenceFrom(item) }
38516
+ };
38517
+ })
38518
+ };
38519
+ }
38400
38520
  case "list_schedules":
38401
38521
  return { kind: "schedule.list" };
38402
38522
  case "cancel_schedule":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.131",
3
+ "version": "0.0.133",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",