@brainervirus/workit-mcp 7.1.0 → 7.3.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 +59 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -23034,7 +23034,7 @@ var workspaceConfigSchema = object2({
23034
23034
  account: nonBlank.optional()
23035
23035
  }).passthrough().optional(),
23036
23036
  autoApprove: union([boolean2(), array(nonBlank)]).optional(),
23037
- defaultEndpoint: _enum(["commit", "pr"]).optional(),
23037
+ defaultEndpoint: unknown().optional(),
23038
23038
  verification: _enum(["self", "independent"]).optional(),
23039
23039
  autonomy: object2(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
23040
23040
  kind,
@@ -24242,10 +24242,51 @@ var DEFAULT_GRANTS = Object.freeze({
24242
24242
  release: false,
24243
24243
  rerun: true
24244
24244
  });
24245
+ var DEFAULT_ENDPOINTS = ["commit", "pr", "green", "merged"];
24245
24246
  var DEFAULT_ENDPOINT = "commit";
24247
+ var isDefaultEndpoint = (value) => typeof value === "string" && DEFAULT_ENDPOINTS.includes(value);
24248
+ function endpointOf(entry) {
24249
+ const raw = entry?.defaultEndpoint;
24250
+ if (raw === undefined)
24251
+ return { raw, endpoint: DEFAULT_ENDPOINT };
24252
+ if (isDefaultEndpoint(raw))
24253
+ return { raw, endpoint: raw };
24254
+ return {
24255
+ raw,
24256
+ endpoint: DEFAULT_ENDPOINT,
24257
+ issue: `defaultEndpoint ${JSON.stringify(raw)} is not one of ${DEFAULT_ENDPOINTS.join(", ")}; using ${DEFAULT_ENDPOINT}`
24258
+ };
24259
+ }
24260
+ function effectiveEndpoint(endpoint, context) {
24261
+ if (endpoint === "commit")
24262
+ return { endpoint };
24263
+ const missing = (kind) => `${kind} grant missing; ${grantHint(context.workspace, kind)}`;
24264
+ if (context.grants.push === false)
24265
+ return { endpoint: "commit", reason: missing("push") };
24266
+ if (context.grants.pr === false)
24267
+ return { endpoint: "commit", reason: missing("pr") };
24268
+ if (context.configured.length > 0 && !context.accountConfigured)
24269
+ return {
24270
+ endpoint: "commit",
24271
+ reason: `vcs.account missing; set vcs.account for workspace "${context.workspace ?? "?"}" in ~/.config/workit/workspaces.json`
24272
+ };
24273
+ if (endpoint === "merged" && context.grants.merge === false)
24274
+ return { endpoint: "green", reason: missing("merge") };
24275
+ return { endpoint };
24276
+ }
24277
+ function endpointView(entry, context) {
24278
+ const { raw, endpoint, issue } = endpointOf(entry);
24279
+ const effective = effectiveEndpoint(endpoint, context);
24280
+ return {
24281
+ defaultEndpoint: endpoint,
24282
+ configuredEndpoint: raw ?? null,
24283
+ effectiveEndpoint: effective.endpoint,
24284
+ ...effective.reason ? { endpointReason: effective.reason } : {},
24285
+ ...issue ? { endpointIssue: issue } : {}
24286
+ };
24287
+ }
24246
24288
  var DEFAULT_VERIFICATION = "self";
24247
24289
  var verificationOf = (entry) => entry?.verification === "independent" ? "independent" : "self";
24248
- var endpointOf = (entry) => entry?.defaultEndpoint === "pr" ? "pr" : "commit";
24249
24290
  var isGrantValue = (value) => value === true || value === false || value === "verified";
24250
24291
  var normalized = (kind, value) => value === "verified" && kind !== "merge" ? true : value;
24251
24292
  var fromAutoApprove = (value) => {
@@ -24286,21 +24327,33 @@ function resolveAutonomy(cwd) {
24286
24327
  source: "default",
24287
24328
  accountConfigured: false,
24288
24329
  defaultEndpoint: DEFAULT_ENDPOINT,
24330
+ configuredEndpoint: null,
24331
+ effectiveEndpoint: DEFAULT_ENDPOINT,
24289
24332
  verification: DEFAULT_VERIFICATION,
24290
24333
  note: override
24291
24334
  };
24292
24335
  const workspace = resolveWorkspaceFrom(cwd, grantsDir(), process.env.WORKFLOW_WORKSPACE_NAME?.trim() || undefined);
24293
24336
  const { grants, source } = configuredGrants(workspace);
24337
+ const full = { ...DEFAULT_GRANTS, ...grants };
24338
+ const configured = GRANT_KINDS.filter((kind) => grants[kind] !== undefined);
24339
+ const accountConfigured = Boolean(workspace?.vcs?.account);
24294
24340
  return {
24295
24341
  workspace: workspace?.name ?? null,
24296
- grants: { ...DEFAULT_GRANTS, ...grants },
24297
- configured: GRANT_KINDS.filter((kind) => grants[kind] !== undefined),
24342
+ grants: full,
24343
+ configured,
24298
24344
  source,
24299
- accountConfigured: Boolean(workspace?.vcs?.account),
24300
- defaultEndpoint: endpointOf(workspace),
24345
+ accountConfigured,
24346
+ ...endpointView(workspace, {
24347
+ workspace: workspace?.name ?? null,
24348
+ grants: full,
24349
+ configured,
24350
+ accountConfigured
24351
+ }),
24301
24352
  verification: verificationOf(workspace)
24302
24353
  };
24303
24354
  }
24355
+ var suggested = (kind) => kind === "merge" ? "verified" : "true";
24356
+ var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
24304
24357
 
24305
24358
  // packages/workit-core/src/core/task-engine.ts
24306
24359
  var workspaceVerification = (root) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-mcp",
3
- "version": "7.1.0",
3
+ "version": "7.3.0",
4
4
  "private": false,
5
5
  "description": "Workit shared MCP transport for the eight task and policy operation families",
6
6
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "build": "bun scripts/build.ts"
43
43
  },
44
44
  "dependencies": {
45
- "@brainervirus/workit-core": "^7.1.0",
45
+ "@brainervirus/workit-core": "^7.3.0",
46
46
  "@modelcontextprotocol/sdk": "1.32.0",
47
47
  "zod": "4.6.5"
48
48
  },