@meltstudio/meltctl 4.150.1 → 4.152.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 +36 -68
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var CLI_VERSION;
14
14
  var init_version = __esm({
15
15
  "src/utils/version.ts"() {
16
16
  "use strict";
17
- CLI_VERSION = "4.150.1";
17
+ CLI_VERSION = "4.152.0";
18
18
  }
19
19
  });
20
20
 
@@ -1014,23 +1014,15 @@ function createPmResource(config) {
1014
1014
  const res = await apiFetch(config, `/pm/project-settings/${projectId}`, { method: "PATCH", body: JSON.stringify(input3) });
1015
1015
  return unwrap("update project settings", res);
1016
1016
  },
1017
- // ─── Audit flags ──────────────────────────────────────────────────────
1018
- async listAuditFlags(projectId, status = "open") {
1019
- const res = await apiFetch(config, `/pm/project-audit-flags?projectId=${projectId}&status=${status}`);
1020
- return unwrap("list audit flags", res);
1021
- },
1022
1017
  /**
1023
- * Cross-project audit-flag listing for the home action-items panel.
1024
- * Same shape as `listAuditFlags` but covers every project the caller can
1025
- * see. Defaults to open flags only.
1018
+ * Read-only project context for the audit skill + other dev-callable
1019
+ * tools (#464). Auth-only (no manager check) so devs can call it from
1020
+ * their own MCP session. Returns project identity + canonical stage
1021
+ * without paying for the full health composition.
1026
1022
  */
1027
- async listAllAuditFlags(status = "open") {
1028
- const res = await apiFetch(config, `/pm/project-audit-flags?status=${status}`);
1029
- return unwrap("list all audit flags", res);
1030
- },
1031
- async getAuditCatalog() {
1032
- const res = await apiFetch(config, `/pm/project-audit-catalog`);
1033
- return unwrap("get audit catalog", res);
1023
+ async getProjectContext(projectId) {
1024
+ const res = await apiFetch(config, `/pm/project-context/${projectId}`);
1025
+ return unwrap("get project context", res);
1034
1026
  },
1035
1027
  // ─── Risk-board mappings ──────────────────────────────────────────────
1036
1028
  /**
@@ -1613,6 +1605,9 @@ var ISSUE_RULES = [
1613
1605
  ];
1614
1606
  var RULE_BY_ID = new Map(ISSUE_RULES.map((r) => [r.id, r]));
1615
1607
 
1608
+ // ../sdk/dist/utils/health-issues-derivation.js
1609
+ var FOURTEEN_DAYS_MS = 14 * 24 * 60 * 60 * 1e3;
1610
+
1616
1611
  // src/utils/api.ts
1617
1612
  async function getToken() {
1618
1613
  const envToken = process.env["MELTCTL_TOKEN"];
@@ -3852,23 +3847,15 @@ function createPmResource2(config) {
3852
3847
  const res = await apiFetch2(config, `/pm/project-settings/${projectId}`, { method: "PATCH", body: JSON.stringify(input3) });
3853
3848
  return unwrap2("update project settings", res);
3854
3849
  },
3855
- // ─── Audit flags ──────────────────────────────────────────────────────
3856
- async listAuditFlags(projectId, status = "open") {
3857
- const res = await apiFetch2(config, `/pm/project-audit-flags?projectId=${projectId}&status=${status}`);
3858
- return unwrap2("list audit flags", res);
3859
- },
3860
3850
  /**
3861
- * Cross-project audit-flag listing for the home action-items panel.
3862
- * Same shape as `listAuditFlags` but covers every project the caller can
3863
- * see. Defaults to open flags only.
3851
+ * Read-only project context for the audit skill + other dev-callable
3852
+ * tools (#464). Auth-only (no manager check) so devs can call it from
3853
+ * their own MCP session. Returns project identity + canonical stage
3854
+ * without paying for the full health composition.
3864
3855
  */
3865
- async listAllAuditFlags(status = "open") {
3866
- const res = await apiFetch2(config, `/pm/project-audit-flags?status=${status}`);
3867
- return unwrap2("list all audit flags", res);
3868
- },
3869
- async getAuditCatalog() {
3870
- const res = await apiFetch2(config, `/pm/project-audit-catalog`);
3871
- return unwrap2("get audit catalog", res);
3856
+ async getProjectContext(projectId) {
3857
+ const res = await apiFetch2(config, `/pm/project-context/${projectId}`);
3858
+ return unwrap2("get project context", res);
3872
3859
  },
3873
3860
  // ─── Risk-board mappings ──────────────────────────────────────────────
3874
3861
  /**
@@ -4437,6 +4424,7 @@ var ISSUE_RULES2 = [
4437
4424
  }
4438
4425
  ];
4439
4426
  var RULE_BY_ID2 = new Map(ISSUE_RULES2.map((r) => [r.id, r]));
4427
+ var FOURTEEN_DAYS_MS2 = 14 * 24 * 60 * 60 * 1e3;
4440
4428
  var AUTH_DIR2 = path8.join(os3.homedir(), ".meltctl");
4441
4429
  var AUTH_FILE2 = path8.join(AUTH_DIR2, "auth.json");
4442
4430
  var API_BASE2 = process.env["MELTCTL_API_URL"] ?? "https://meltctl-api.meltstudio.co";
@@ -4525,6 +4513,9 @@ async function listProjects(client) {
4525
4513
  async function getProjectSettings(client, input3) {
4526
4514
  return safe(() => client.pm.getProjectSettings(input3.projectId));
4527
4515
  }
4516
+ async function getProjectContext(client, input3) {
4517
+ return safe(() => client.pm.getProjectContext(input3.projectId));
4518
+ }
4528
4519
  function registerProjectTools(server, getClient2) {
4529
4520
  server.registerTool(
4530
4521
  "list_projects",
@@ -4546,6 +4537,17 @@ function registerProjectTools(server, getClient2) {
4546
4537
  },
4547
4538
  withClientArgs(getClient2, getProjectSettings)
4548
4539
  );
4540
+ server.registerTool(
4541
+ "get_project_context",
4542
+ {
4543
+ title: "Get project context",
4544
+ description: "Read-only project identity + the PM-owned canonical project stage. Returns: projectId, projectName, client, pmEmail, repos[], projectStage (prototype | early_revenue | growth | scale | null), projectStageSetBy, projectStageSetAt. Call this at the start of an audit run instead of trusting AGENTS.md self-declaration \u2014 the stage drives audit calibration. Auth-only (no manager check), so devs running the audit skill from their own machine can call it directly.",
4545
+ inputSchema: {
4546
+ projectId: z22.number().int().positive().describe("Strapi project id from list_projects.")
4547
+ }
4548
+ },
4549
+ withClientArgs(getClient2, getProjectContext)
4550
+ );
4549
4551
  }
4550
4552
  var SHAPE_DESC = "crawling | walking | running. Target shape is intent (PM sets when creating); current shape is computed from feature stages.";
4551
4553
  async function listPhases(client, input3) {
@@ -4717,49 +4719,15 @@ function registerFeatureTools(server, getClient2) {
4717
4719
  withClientArgs(getClient2, updateFeature)
4718
4720
  );
4719
4721
  }
4720
- var FLAG_STATUS_VALUES = ["open", "resolved", "all"];
4721
- async function listAuditFlags(client, input3) {
4722
- return safe(() => client.pm.listAuditFlags(input3.projectId, input3.status ?? "open"));
4723
- }
4724
- async function getAuditCatalog(client) {
4725
- return safe(() => client.pm.getAuditCatalog());
4726
- }
4727
4722
  async function runProjectAudit(client, input3) {
4728
4723
  return safe(() => client.pm.runProjectAudit(input3.projectId));
4729
4724
  }
4730
- var listAuditFlagsInputSchema = z5.object({
4731
- projectId: z5.number().int().positive(),
4732
- status: z5.enum(FLAG_STATUS_VALUES).optional()
4733
- });
4734
4725
  function registerAuditTools(server, getClient2) {
4735
- server.registerTool(
4736
- "list_audit_flags",
4737
- {
4738
- title: "List project audit flags",
4739
- description: "Lists audit flags the nightly cron has raised for a project. Each entry pairs the flag (id, severity, evidence, entity it points at, first/last seen, occurrence count) with its catalog entry (human-readable title + description + rule type). Default status='open'; pass 'all' to include resolved flags for context.",
4740
- inputSchema: {
4741
- projectId: z5.number().int().positive(),
4742
- status: z5.enum(FLAG_STATUS_VALUES).optional().describe(
4743
- "Default 'open'. 'resolved' = fixed (flag no longer tripping on latest run). 'all' = every flag ever raised on this project."
4744
- )
4745
- }
4746
- },
4747
- withClientArgs(getClient2, listAuditFlags)
4748
- );
4749
- server.registerTool(
4750
- "get_audit_catalog",
4751
- {
4752
- title: "Get audit catalog",
4753
- description: "Returns every audit rule the system knows about (code, category, title, description, severity, rubric version). Use this to explain to a PM what a specific flag means, or to enumerate what kinds of things we audit for. Catalog is read-only \u2014 new entries land via migration.",
4754
- inputSchema: {}
4755
- },
4756
- withClient(getClient2, getAuditCatalog)
4757
- );
4758
4726
  server.registerTool(
4759
4727
  "run_project_audit",
4760
4728
  {
4761
4729
  title: "Run project audit now",
4762
- description: "Triggers an immediate audit run for a single project (same checks the nightly cron performs). Returns {fired, resolved, checkErrors}: how many new flags raised, how many existing flags cleared, and any per-check errors. Useful after a PM fixes something and wants to verify it cleared without waiting for tomorrow's cron.",
4730
+ description: "Triggers an immediate audit run for a single project. Refreshes the cache tables that drive the SDK rule engine (in-progress staleness, PM comment presence) and runs the inactive-codes sweep over any legacy open flag rows. Returns {fired, resolved, checkErrors}. Useful after a PM fixes something and wants the next dashboard load to reflect it without waiting for tomorrow's nightly cron.",
4763
4731
  inputSchema: {
4764
4732
  projectId: z5.number().int().positive()
4765
4733
  }
@@ -4865,7 +4833,7 @@ function registerBoardAuditTools(server, getClient2) {
4865
4833
  "get_board_audit_catalog",
4866
4834
  {
4867
4835
  title: "Get board-audit catalog",
4868
- description: "Returns every board-audit rule the system knows about (code, category, title, description, severity). Complements `get_audit_catalog` (which is for project-level flags); this one covers ticket-tracker hygiene checks.",
4836
+ description: "Returns every board-audit rule the system knows about (code, category, title, description, severity). Covers ticket-tracker hygiene checks (story quality, workflow correctness); project-level health rules live in the SDK rule engine and surface via `get_project_health`.",
4869
4837
  inputSchema: {}
4870
4838
  },
4871
4839
  withClient(getClient2, getBoardAuditCatalog)
@@ -4902,7 +4870,7 @@ function registerPortfolioStatusTools(server, getClient2) {
4902
4870
  "get_my_portfolio_status",
4903
4871
  {
4904
4872
  title: "Get my portfolio status",
4905
- description: "Cross-project ranked answer to 'where do I focus next?'. Returns one entry per project the caller can see, sorted by urgency desc. Each entry includes: 0\u2013100 health score (same formula as the dashboard cards), open audit-flag counts grouped by severity (critical/high/medium/low), up to 3 short topAttentionReasons derived from the highest-severity open flags, latest plan score across the project's repos, and the most recent audit timestamp. Default scope is the caller's own projects; managers can pass `pmEmail` to view another PM's portfolio or omit it to see the org-wide top `limit` projects (default 10). Use this for 'how is my portfolio doing?' and 'which project of <person>'s needs help?' questions \u2014 it pulls in one tool call what would otherwise be `list_projects` + N \xD7 `get_project_health` + N \xD7 `list_audit_flags`.",
4873
+ description: "Cross-project ranked answer to 'where do I focus next?'. Returns one entry per project the caller can see, sorted by urgency desc. Each entry includes: 0\u2013100 health score (same formula as the dashboard cards), open-issue counts grouped by severity (critical/high/medium/low) from the SDK rule engine, up to 3 short topAttentionReasons derived from the highest-severity open issues, latest plan score across the project's repos, and the most recent audit timestamp. Default scope is the caller's own projects; managers can pass `pmEmail` to view another PM's portfolio or omit it to see the org-wide top `limit` projects (default 10). Use this for 'how is my portfolio doing?' and 'which project of <person>'s needs help?' questions \u2014 it pulls in one tool call what would otherwise be `list_projects` + N \xD7 `get_project_health`.",
4906
4874
  inputSchema: {
4907
4875
  pmEmail: z9.string().email().optional().describe(
4908
4876
  "Manager-only override. When set, scopes the response to that PM's projects. Non-managers may only set this to their own email; any other value returns 403."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meltstudio/meltctl",
3
- "version": "4.150.1",
3
+ "version": "4.152.0",
4
4
  "description": "AI-first development tools for teams - set up AGENTS.md, Claude Code, Cursor, and OpenCode standards",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",