@meltstudio/meltctl 5.27.0 → 5.28.0

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 +173 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7499,7 +7499,7 @@ var CLI_VERSION;
7499
7499
  var init_version = __esm({
7500
7500
  "src/utils/version.ts"() {
7501
7501
  "use strict";
7502
- CLI_VERSION = "5.27.0";
7502
+ CLI_VERSION = "5.28.0";
7503
7503
  }
7504
7504
  });
7505
7505
 
@@ -27995,6 +27995,58 @@ function createEndpointChecksResource(config2) {
27995
27995
  throw new Error(data.error ?? `Failed to delete endpoint check (${status})`);
27996
27996
  }
27997
27997
  },
27998
+ /**
27999
+ * The caller's own devices, derived from their checks, with the latest
28000
+ * check and status of each. Self-scoped by the JWT.
28001
+ */
28002
+ async listMyDevices() {
28003
+ const { data, status } = await apiFetch(config2, "/endpoint-checks/devices/me");
28004
+ if (status !== 200) {
28005
+ throw new Error(data.error ?? `Failed to list your devices (${status})`);
28006
+ }
28007
+ return data;
28008
+ },
28009
+ /**
28010
+ * Ask to retire one of the caller's own devices (status
28011
+ * `retire_requested`). It still counts as active until a manager confirms.
28012
+ */
28013
+ async requestRetireDevice(input) {
28014
+ const { data, status } = await apiFetch(config2, "/endpoint-checks/devices/me/retire-request", { method: "POST", body: JSON.stringify(input) });
28015
+ if (status !== 200) {
28016
+ throw new Error(data.error ?? `Failed to request device retirement (${status})`);
28017
+ }
28018
+ return data.device;
28019
+ },
28020
+ /**
28021
+ * Every device a person ever checked (or everyone's, without `email`),
28022
+ * with status, last check and any pending retire request. Manager-gated:
28023
+ * the offboarding read.
28024
+ */
28025
+ async listDevices(email3) {
28026
+ const query = email3 ? `?email=${encodeURIComponent(email3)}` : "";
28027
+ const { data, status } = await apiFetch(config2, `/endpoint-checks/devices${query}`);
28028
+ if (status === 403) {
28029
+ throw new Error("Access denied. Only Team Managers can list endpoint devices.");
28030
+ }
28031
+ if (status !== 200) {
28032
+ throw new Error(data.error ?? `Failed to list endpoint devices (${status})`);
28033
+ }
28034
+ return data;
28035
+ },
28036
+ /**
28037
+ * Set a device's status (active / retired / wiped). Manager-gated.
28038
+ * Confirming a person's retire request means setting `retired`.
28039
+ */
28040
+ async setDeviceStatus(input) {
28041
+ const { data, status } = await apiFetch(config2, "/endpoint-checks/devices/status", { method: "PUT", body: JSON.stringify(input) });
28042
+ if (status === 403) {
28043
+ throw new Error("Access denied. Only Team Managers can change a device status.");
28044
+ }
28045
+ if (status !== 200) {
28046
+ throw new Error(data.error ?? `Failed to set device status (${status})`);
28047
+ }
28048
+ return data.device;
28049
+ },
27998
28050
  /** Weekly Slack reminder settings (#651). Manager-gated. */
27999
28051
  async getReminderSettings() {
28000
28052
  const { data, status } = await apiFetch(config2, "/endpoint-reminders/settings");
@@ -55245,6 +55297,58 @@ function createEndpointChecksResource2(config2) {
55245
55297
  throw new Error(data.error ?? `Failed to delete endpoint check (${status})`);
55246
55298
  }
55247
55299
  },
55300
+ /**
55301
+ * The caller's own devices, derived from their checks, with the latest
55302
+ * check and status of each. Self-scoped by the JWT.
55303
+ */
55304
+ async listMyDevices() {
55305
+ const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/me");
55306
+ if (status !== 200) {
55307
+ throw new Error(data.error ?? `Failed to list your devices (${status})`);
55308
+ }
55309
+ return data;
55310
+ },
55311
+ /**
55312
+ * Ask to retire one of the caller's own devices (status
55313
+ * `retire_requested`). It still counts as active until a manager confirms.
55314
+ */
55315
+ async requestRetireDevice(input) {
55316
+ const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/me/retire-request", { method: "POST", body: JSON.stringify(input) });
55317
+ if (status !== 200) {
55318
+ throw new Error(data.error ?? `Failed to request device retirement (${status})`);
55319
+ }
55320
+ return data.device;
55321
+ },
55322
+ /**
55323
+ * Every device a person ever checked (or everyone's, without `email`),
55324
+ * with status, last check and any pending retire request. Manager-gated:
55325
+ * the offboarding read.
55326
+ */
55327
+ async listDevices(email3) {
55328
+ const query = email3 ? `?email=${encodeURIComponent(email3)}` : "";
55329
+ const { data, status } = await apiFetch2(config2, `/endpoint-checks/devices${query}`);
55330
+ if (status === 403) {
55331
+ throw new Error("Access denied. Only Team Managers can list endpoint devices.");
55332
+ }
55333
+ if (status !== 200) {
55334
+ throw new Error(data.error ?? `Failed to list endpoint devices (${status})`);
55335
+ }
55336
+ return data;
55337
+ },
55338
+ /**
55339
+ * Set a device's status (active / retired / wiped). Manager-gated.
55340
+ * Confirming a person's retire request means setting `retired`.
55341
+ */
55342
+ async setDeviceStatus(input) {
55343
+ const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/status", { method: "PUT", body: JSON.stringify(input) });
55344
+ if (status === 403) {
55345
+ throw new Error("Access denied. Only Team Managers can change a device status.");
55346
+ }
55347
+ if (status !== 200) {
55348
+ throw new Error(data.error ?? `Failed to set device status (${status})`);
55349
+ }
55350
+ return data.device;
55351
+ },
55248
55352
  /** Weekly Slack reminder settings (#651). Manager-gated. */
55249
55353
  async getReminderSettings() {
55250
55354
  const { data, status } = await apiFetch2(config2, "/endpoint-reminders/settings");
@@ -56806,6 +56910,38 @@ var submitEndpointCheckSchema = external_exports.object(submitEndpointCheckShape
56806
56910
  async function submitEndpointCheck(client, input) {
56807
56911
  return safe(() => client.endpointChecks.submit(input));
56808
56912
  }
56913
+ async function listMyEndpointDevices(client) {
56914
+ return safe(() => client.endpointChecks.listMyDevices());
56915
+ }
56916
+ var requestRetireShape = {
56917
+ deviceKey: external_exports.string().min(1).describe(
56918
+ "The device key from list_my_endpoint_devices (serial, else device name, else model)."
56919
+ ),
56920
+ note: external_exports.string().max(500).optional().describe(`Why, in the person's words, e.g. "kept at home, not used for work anymore".`)
56921
+ };
56922
+ var requestRetireEndpointDeviceInputSchema = external_exports.object(requestRetireShape);
56923
+ async function requestRetireEndpointDevice(client, input) {
56924
+ return safe(() => client.endpointChecks.requestRetireDevice(input));
56925
+ }
56926
+ var listDevicesShape = {
56927
+ email: external_exports.string().optional().describe("The person's @meltstudio.co email. Omit to list every person's devices.")
56928
+ };
56929
+ var listEndpointDevicesInputSchema = external_exports.object(listDevicesShape);
56930
+ async function listEndpointDevices(client, input) {
56931
+ return safe(() => client.endpointChecks.listDevices(input.email));
56932
+ }
56933
+ var setStatusShape = {
56934
+ email: external_exports.string().min(1).describe("The device owner's @meltstudio.co email."),
56935
+ deviceKey: external_exports.string().min(1).describe("The device key from list_endpoint_devices."),
56936
+ status: external_exports.enum(["active", "retired", "wiped"]).describe(
56937
+ "active = in use for work; retired = still owned, not used for work (confirms a retire request); wiped = cleaned."
56938
+ ),
56939
+ note: external_exports.string().max(500).optional().describe('Optional note, e.g. "wiped on hand-back". Omit to keep the current note.')
56940
+ };
56941
+ var setEndpointDeviceStatusInputSchema = external_exports.object(setStatusShape);
56942
+ async function setEndpointDeviceStatus(client, input) {
56943
+ return safe(() => client.endpointChecks.setDeviceStatus(input));
56944
+ }
56809
56945
  function registerEndpointCheckTools(server, getClient2) {
56810
56946
  server.registerTool(
56811
56947
  "submit_endpoint_check",
@@ -56816,6 +56952,42 @@ function registerEndpointCheckTools(server, getClient2) {
56816
56952
  },
56817
56953
  withClientArgs(getClient2, submitEndpointCheck)
56818
56954
  );
56955
+ server.registerTool(
56956
+ "list_my_endpoint_devices",
56957
+ {
56958
+ title: "List my endpoint devices",
56959
+ description: "Lists the calling person's own devices, derived from their endpoint checks: label, deviceKey, model, serial, last check date, number of checks and status (active / retire_requested / retired / wiped). Self-scoped from the JWT. melt-company:verify-endpoint calls it after submitting to spot other devices that haven't been checked in a while.",
56960
+ inputSchema: {}
56961
+ },
56962
+ withClient(getClient2, listMyEndpointDevices)
56963
+ );
56964
+ server.registerTool(
56965
+ "request_retire_endpoint_device",
56966
+ {
56967
+ title: "Ask to retire one of my endpoint devices",
56968
+ description: "Asks to retire one of the calling person's OWN devices: one they still have but no longer use for work. Sets status retire_requested; the device still counts for the weekly reminders until a manager confirms it (set_endpoint_device_status with retired). Self-scoped: only the caller's own device keys (from list_my_endpoint_devices) are accepted. Fails for a device already retired or wiped.",
56969
+ inputSchema: requestRetireShape
56970
+ },
56971
+ withClientArgs(getClient2, requestRetireEndpointDevice)
56972
+ );
56973
+ server.registerTool(
56974
+ "list_endpoint_devices",
56975
+ {
56976
+ title: "List endpoint devices (manager)",
56977
+ description: "Every device a person ever checked (or everyone's, without email), with status, last check, the pending retire request (requestedBy / requestedAt / note) and who last set the status. Nothing is ever deleted, so retired and wiped devices are listed too. Use it when offboarding someone to make sure each of their machines is handled, or to find pending retire requests (status retire_requested). Manager-gated.",
56978
+ inputSchema: listDevicesShape
56979
+ },
56980
+ withClientArgs(getClient2, listEndpointDevices)
56981
+ );
56982
+ server.registerTool(
56983
+ "set_endpoint_device_status",
56984
+ {
56985
+ title: "Set an endpoint device status (manager)",
56986
+ description: "Sets a person's device to active, retired or wiped. retired = still owned but not used for work: left out of the endpoint-check reminders and the overdue math, still listed. Setting retired confirms the person's retire request. wiped = the device was cleaned; who and when are recorded. Get the email and deviceKey from list_endpoint_devices. Manager-gated.",
56987
+ inputSchema: setStatusShape
56988
+ },
56989
+ withClientArgs(getClient2, setEndpointDeviceStatus)
56990
+ );
56819
56991
  }
56820
56992
  async function getSupportEffort(client, input) {
56821
56993
  return safe(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meltstudio/meltctl",
3
- "version": "5.27.0",
3
+ "version": "5.28.0",
4
4
  "description": "AI-first development tooling for Melt teams — companion CLI for the org-distributed Claude Code dev skills",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",