@meltstudio/meltctl 5.27.0 → 5.29.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.
- package/dist/index.js +269 -1
- 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.
|
|
7502
|
+
CLI_VERSION = "5.29.0";
|
|
7503
7503
|
}
|
|
7504
7504
|
});
|
|
7505
7505
|
|
|
@@ -27995,6 +27995,87 @@ 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
|
+
},
|
|
28050
|
+
/**
|
|
28051
|
+
* People exempt from the endpoint check (client-managed machines).
|
|
28052
|
+
* Active ones only, unless `includeInactive`. Manager-gated.
|
|
28053
|
+
*/
|
|
28054
|
+
async listExemptions(includeInactive = false) {
|
|
28055
|
+
const query = includeInactive ? "?all=true" : "";
|
|
28056
|
+
const { data, status } = await apiFetch(config2, `/endpoint-checks/exemptions${query}`);
|
|
28057
|
+
if (status === 403) {
|
|
28058
|
+
throw new Error("Access denied. Only Team Managers can list endpoint exemptions.");
|
|
28059
|
+
}
|
|
28060
|
+
if (status !== 200) {
|
|
28061
|
+
throw new Error(data.error ?? `Failed to list endpoint exemptions (${status})`);
|
|
28062
|
+
}
|
|
28063
|
+
return data;
|
|
28064
|
+
},
|
|
28065
|
+
/**
|
|
28066
|
+
* Set (`active: true`) or clear (`active: false`) a person's exemption.
|
|
28067
|
+
* Clearing keeps the row. Manager-gated.
|
|
28068
|
+
*/
|
|
28069
|
+
async setExemption(input) {
|
|
28070
|
+
const { data, status } = await apiFetch(config2, "/endpoint-checks/exemptions", { method: "PUT", body: JSON.stringify(input) });
|
|
28071
|
+
if (status === 403) {
|
|
28072
|
+
throw new Error("Access denied. Only Team Managers can change endpoint exemptions.");
|
|
28073
|
+
}
|
|
28074
|
+
if (status !== 200) {
|
|
28075
|
+
throw new Error(data.error ?? `Failed to set endpoint exemption (${status})`);
|
|
28076
|
+
}
|
|
28077
|
+
return data.exemption;
|
|
28078
|
+
},
|
|
27998
28079
|
/** Weekly Slack reminder settings (#651). Manager-gated. */
|
|
27999
28080
|
async getReminderSettings() {
|
|
28000
28081
|
const { data, status } = await apiFetch(config2, "/endpoint-reminders/settings");
|
|
@@ -55245,6 +55326,87 @@ function createEndpointChecksResource2(config2) {
|
|
|
55245
55326
|
throw new Error(data.error ?? `Failed to delete endpoint check (${status})`);
|
|
55246
55327
|
}
|
|
55247
55328
|
},
|
|
55329
|
+
/**
|
|
55330
|
+
* The caller's own devices, derived from their checks, with the latest
|
|
55331
|
+
* check and status of each. Self-scoped by the JWT.
|
|
55332
|
+
*/
|
|
55333
|
+
async listMyDevices() {
|
|
55334
|
+
const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/me");
|
|
55335
|
+
if (status !== 200) {
|
|
55336
|
+
throw new Error(data.error ?? `Failed to list your devices (${status})`);
|
|
55337
|
+
}
|
|
55338
|
+
return data;
|
|
55339
|
+
},
|
|
55340
|
+
/**
|
|
55341
|
+
* Ask to retire one of the caller's own devices (status
|
|
55342
|
+
* `retire_requested`). It still counts as active until a manager confirms.
|
|
55343
|
+
*/
|
|
55344
|
+
async requestRetireDevice(input) {
|
|
55345
|
+
const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/me/retire-request", { method: "POST", body: JSON.stringify(input) });
|
|
55346
|
+
if (status !== 200) {
|
|
55347
|
+
throw new Error(data.error ?? `Failed to request device retirement (${status})`);
|
|
55348
|
+
}
|
|
55349
|
+
return data.device;
|
|
55350
|
+
},
|
|
55351
|
+
/**
|
|
55352
|
+
* Every device a person ever checked (or everyone's, without `email`),
|
|
55353
|
+
* with status, last check and any pending retire request. Manager-gated:
|
|
55354
|
+
* the offboarding read.
|
|
55355
|
+
*/
|
|
55356
|
+
async listDevices(email3) {
|
|
55357
|
+
const query = email3 ? `?email=${encodeURIComponent(email3)}` : "";
|
|
55358
|
+
const { data, status } = await apiFetch2(config2, `/endpoint-checks/devices${query}`);
|
|
55359
|
+
if (status === 403) {
|
|
55360
|
+
throw new Error("Access denied. Only Team Managers can list endpoint devices.");
|
|
55361
|
+
}
|
|
55362
|
+
if (status !== 200) {
|
|
55363
|
+
throw new Error(data.error ?? `Failed to list endpoint devices (${status})`);
|
|
55364
|
+
}
|
|
55365
|
+
return data;
|
|
55366
|
+
},
|
|
55367
|
+
/**
|
|
55368
|
+
* Set a device's status (active / retired / wiped). Manager-gated.
|
|
55369
|
+
* Confirming a person's retire request means setting `retired`.
|
|
55370
|
+
*/
|
|
55371
|
+
async setDeviceStatus(input) {
|
|
55372
|
+
const { data, status } = await apiFetch2(config2, "/endpoint-checks/devices/status", { method: "PUT", body: JSON.stringify(input) });
|
|
55373
|
+
if (status === 403) {
|
|
55374
|
+
throw new Error("Access denied. Only Team Managers can change a device status.");
|
|
55375
|
+
}
|
|
55376
|
+
if (status !== 200) {
|
|
55377
|
+
throw new Error(data.error ?? `Failed to set device status (${status})`);
|
|
55378
|
+
}
|
|
55379
|
+
return data.device;
|
|
55380
|
+
},
|
|
55381
|
+
/**
|
|
55382
|
+
* People exempt from the endpoint check (client-managed machines).
|
|
55383
|
+
* Active ones only, unless `includeInactive`. Manager-gated.
|
|
55384
|
+
*/
|
|
55385
|
+
async listExemptions(includeInactive = false) {
|
|
55386
|
+
const query = includeInactive ? "?all=true" : "";
|
|
55387
|
+
const { data, status } = await apiFetch2(config2, `/endpoint-checks/exemptions${query}`);
|
|
55388
|
+
if (status === 403) {
|
|
55389
|
+
throw new Error("Access denied. Only Team Managers can list endpoint exemptions.");
|
|
55390
|
+
}
|
|
55391
|
+
if (status !== 200) {
|
|
55392
|
+
throw new Error(data.error ?? `Failed to list endpoint exemptions (${status})`);
|
|
55393
|
+
}
|
|
55394
|
+
return data;
|
|
55395
|
+
},
|
|
55396
|
+
/**
|
|
55397
|
+
* Set (`active: true`) or clear (`active: false`) a person's exemption.
|
|
55398
|
+
* Clearing keeps the row. Manager-gated.
|
|
55399
|
+
*/
|
|
55400
|
+
async setExemption(input) {
|
|
55401
|
+
const { data, status } = await apiFetch2(config2, "/endpoint-checks/exemptions", { method: "PUT", body: JSON.stringify(input) });
|
|
55402
|
+
if (status === 403) {
|
|
55403
|
+
throw new Error("Access denied. Only Team Managers can change endpoint exemptions.");
|
|
55404
|
+
}
|
|
55405
|
+
if (status !== 200) {
|
|
55406
|
+
throw new Error(data.error ?? `Failed to set endpoint exemption (${status})`);
|
|
55407
|
+
}
|
|
55408
|
+
return data.exemption;
|
|
55409
|
+
},
|
|
55248
55410
|
/** Weekly Slack reminder settings (#651). Manager-gated. */
|
|
55249
55411
|
async getReminderSettings() {
|
|
55250
55412
|
const { data, status } = await apiFetch2(config2, "/endpoint-reminders/settings");
|
|
@@ -56806,6 +56968,58 @@ var submitEndpointCheckSchema = external_exports.object(submitEndpointCheckShape
|
|
|
56806
56968
|
async function submitEndpointCheck(client, input) {
|
|
56807
56969
|
return safe(() => client.endpointChecks.submit(input));
|
|
56808
56970
|
}
|
|
56971
|
+
async function listMyEndpointDevices(client) {
|
|
56972
|
+
return safe(() => client.endpointChecks.listMyDevices());
|
|
56973
|
+
}
|
|
56974
|
+
var requestRetireShape = {
|
|
56975
|
+
deviceKey: external_exports.string().min(1).describe(
|
|
56976
|
+
"The device key from list_my_endpoint_devices (serial, else device name, else model)."
|
|
56977
|
+
),
|
|
56978
|
+
note: external_exports.string().max(500).optional().describe(`Why, in the person's words, e.g. "kept at home, not used for work anymore".`)
|
|
56979
|
+
};
|
|
56980
|
+
var requestRetireEndpointDeviceInputSchema = external_exports.object(requestRetireShape);
|
|
56981
|
+
async function requestRetireEndpointDevice(client, input) {
|
|
56982
|
+
return safe(() => client.endpointChecks.requestRetireDevice(input));
|
|
56983
|
+
}
|
|
56984
|
+
var listDevicesShape = {
|
|
56985
|
+
email: external_exports.string().optional().describe("The person's @meltstudio.co email. Omit to list every person's devices.")
|
|
56986
|
+
};
|
|
56987
|
+
var listEndpointDevicesInputSchema = external_exports.object(listDevicesShape);
|
|
56988
|
+
async function listEndpointDevices(client, input) {
|
|
56989
|
+
return safe(() => client.endpointChecks.listDevices(input.email));
|
|
56990
|
+
}
|
|
56991
|
+
var setStatusShape = {
|
|
56992
|
+
email: external_exports.string().min(1).describe("The device owner's @meltstudio.co email."),
|
|
56993
|
+
deviceKey: external_exports.string().min(1).describe("The device key from list_endpoint_devices."),
|
|
56994
|
+
status: external_exports.enum(["active", "retired", "wiped"]).describe(
|
|
56995
|
+
"active = in use for work; retired = still owned, not used for work (confirms a retire request); wiped = cleaned."
|
|
56996
|
+
),
|
|
56997
|
+
note: external_exports.string().max(500).optional().describe('Optional note, e.g. "wiped on hand-back". Omit to keep the current note.')
|
|
56998
|
+
};
|
|
56999
|
+
var setEndpointDeviceStatusInputSchema = external_exports.object(setStatusShape);
|
|
57000
|
+
async function setEndpointDeviceStatus(client, input) {
|
|
57001
|
+
return safe(() => client.endpointChecks.setDeviceStatus(input));
|
|
57002
|
+
}
|
|
57003
|
+
var listExemptionsShape = {
|
|
57004
|
+
includeInactive: external_exports.boolean().optional().describe("Also list cleared exemptions (kept for history). Defaults to active only.")
|
|
57005
|
+
};
|
|
57006
|
+
var listEndpointExemptionsInputSchema = external_exports.object(listExemptionsShape);
|
|
57007
|
+
async function listEndpointExemptions(client, input) {
|
|
57008
|
+
return safe(() => client.endpointChecks.listExemptions(input.includeInactive ?? false));
|
|
57009
|
+
}
|
|
57010
|
+
var setExemptionShape = {
|
|
57011
|
+
email: external_exports.string().min(1).describe("The person's @meltstudio.co email."),
|
|
57012
|
+
active: external_exports.boolean().describe("true sets the exemption; false clears it (the row is kept)."),
|
|
57013
|
+
reason: external_exports.enum(["client_managed"]).optional().describe(
|
|
57014
|
+
"client_managed = works on a machine the client provides and verifies itself. The default."
|
|
57015
|
+
),
|
|
57016
|
+
clientName: external_exports.string().max(500).optional().describe('The client whose machine it is. Omit to keep the current one; "" clears it.'),
|
|
57017
|
+
note: external_exports.string().max(500).optional().describe('Optional note, e.g. "client runs SOC 2 checks". Omit to keep the current one.')
|
|
57018
|
+
};
|
|
57019
|
+
var setEndpointExemptionInputSchema = external_exports.object(setExemptionShape);
|
|
57020
|
+
async function setEndpointExemption(client, input) {
|
|
57021
|
+
return safe(() => client.endpointChecks.setExemption(input));
|
|
57022
|
+
}
|
|
56809
57023
|
function registerEndpointCheckTools(server, getClient2) {
|
|
56810
57024
|
server.registerTool(
|
|
56811
57025
|
"submit_endpoint_check",
|
|
@@ -56816,6 +57030,60 @@ function registerEndpointCheckTools(server, getClient2) {
|
|
|
56816
57030
|
},
|
|
56817
57031
|
withClientArgs(getClient2, submitEndpointCheck)
|
|
56818
57032
|
);
|
|
57033
|
+
server.registerTool(
|
|
57034
|
+
"list_my_endpoint_devices",
|
|
57035
|
+
{
|
|
57036
|
+
title: "List my endpoint devices",
|
|
57037
|
+
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.",
|
|
57038
|
+
inputSchema: {}
|
|
57039
|
+
},
|
|
57040
|
+
withClient(getClient2, listMyEndpointDevices)
|
|
57041
|
+
);
|
|
57042
|
+
server.registerTool(
|
|
57043
|
+
"request_retire_endpoint_device",
|
|
57044
|
+
{
|
|
57045
|
+
title: "Ask to retire one of my endpoint devices",
|
|
57046
|
+
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.",
|
|
57047
|
+
inputSchema: requestRetireShape
|
|
57048
|
+
},
|
|
57049
|
+
withClientArgs(getClient2, requestRetireEndpointDevice)
|
|
57050
|
+
);
|
|
57051
|
+
server.registerTool(
|
|
57052
|
+
"list_endpoint_devices",
|
|
57053
|
+
{
|
|
57054
|
+
title: "List endpoint devices (manager)",
|
|
57055
|
+
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.",
|
|
57056
|
+
inputSchema: listDevicesShape
|
|
57057
|
+
},
|
|
57058
|
+
withClientArgs(getClient2, listEndpointDevices)
|
|
57059
|
+
);
|
|
57060
|
+
server.registerTool(
|
|
57061
|
+
"set_endpoint_device_status",
|
|
57062
|
+
{
|
|
57063
|
+
title: "Set an endpoint device status (manager)",
|
|
57064
|
+
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.",
|
|
57065
|
+
inputSchema: setStatusShape
|
|
57066
|
+
},
|
|
57067
|
+
withClientArgs(getClient2, setEndpointDeviceStatus)
|
|
57068
|
+
);
|
|
57069
|
+
server.registerTool(
|
|
57070
|
+
"list_endpoint_exemptions",
|
|
57071
|
+
{
|
|
57072
|
+
title: "List endpoint check exemptions (manager)",
|
|
57073
|
+
description: "Lists the people exempt from the endpoint check because they work on a client-managed machine the client verifies itself (SOC 2 and similar): email, reason, client name, note, and who set it and when. Active ones only unless includeInactive. Exempt people get no reminders and are left out of the overdue and coverage numbers. Manager-gated.",
|
|
57074
|
+
inputSchema: listExemptionsShape
|
|
57075
|
+
},
|
|
57076
|
+
withClientArgs(getClient2, listEndpointExemptions)
|
|
57077
|
+
);
|
|
57078
|
+
server.registerTool(
|
|
57079
|
+
"set_endpoint_exemption",
|
|
57080
|
+
{
|
|
57081
|
+
title: "Set or clear an endpoint check exemption (manager)",
|
|
57082
|
+
description: "Exempts a person from Melt's endpoint check (active true) because they work on a client-managed machine, or clears the exemption (active false; the row is kept for history). While active they get no weekly reminder DM, are never escalated and don't count as overdue on the dashboard. Any checks they already submitted stay. Pass the client's name when known. Manager-gated.",
|
|
57083
|
+
inputSchema: setExemptionShape
|
|
57084
|
+
},
|
|
57085
|
+
withClientArgs(getClient2, setEndpointExemption)
|
|
57086
|
+
);
|
|
56819
57087
|
}
|
|
56820
57088
|
async function getSupportEffort(client, input) {
|
|
56821
57089
|
return safe(async () => {
|
package/package.json
CHANGED