@zixt/host 0.0.132 → 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 +94 -1
  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.132",
31
+ version: "0.0.133",
32
32
  type: "module",
33
33
  exports: {
34
34
  ".": "./src/client.ts",
@@ -38113,6 +38113,56 @@ var TOOLS = [
38113
38113
  required: ["name", "instructions", "cadence_kind"]
38114
38114
  }
38115
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
+ },
38116
38166
  {
38117
38167
  name: "list_schedules",
38118
38168
  description: "List your own schedules (id, name, cadence, enabled, next run).",
@@ -38424,6 +38474,49 @@ function opFor(name, args) {
38424
38474
  ...endsAt ? { endsAt } : {}
38425
38475
  };
38426
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
+ }
38427
38520
  case "list_schedules":
38428
38521
  return { kind: "schedule.list" };
38429
38522
  case "cancel_schedule":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.132",
3
+ "version": "0.0.133",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",