pipebrain-mcp 0.35.0 → 0.36.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/main.js +145 -6
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -15101,6 +15101,9 @@ var issueRefSchema = external_exports.string().min(1, { message: "issue referenc
15101
15101
  var requirementRefSchema = external_exports.string().min(1, {
15102
15102
  message: "requirement reference must not be empty \u2014 use a display id (`DWB-R4`) or uuid"
15103
15103
  });
15104
+ var conventionRefSchema = external_exports.string().min(1, {
15105
+ message: "convention reference must not be empty \u2014 use a display id (`CONV-3`) or uuid"
15106
+ });
15104
15107
  var decisionRefSchema = external_exports.string().min(1, {
15105
15108
  message: "decision reference must not be empty \u2014 use a display id (`DWB-D7`) or uuid"
15106
15109
  });
@@ -15167,6 +15170,36 @@ function parseDeliverableDisplayId(value) {
15167
15170
  return { key: match[1], number: Number(match[2]), platform: match[3] };
15168
15171
  }
15169
15172
 
15173
+ // ../../libs/domain/dist/project-scope.js
15174
+ var CODE_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
15175
+ "cjs",
15176
+ "css",
15177
+ "go",
15178
+ "java",
15179
+ "js",
15180
+ "jsx",
15181
+ "mjs",
15182
+ "py",
15183
+ "rb",
15184
+ "rs",
15185
+ "sh",
15186
+ "sql",
15187
+ "ts",
15188
+ "tsx"
15189
+ ]);
15190
+ var DOCUMENT_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
15191
+ "html",
15192
+ "json",
15193
+ "md",
15194
+ "toml",
15195
+ "yaml",
15196
+ "yml"
15197
+ ]);
15198
+ var SOURCE_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
15199
+ ...CODE_FILE_EXTENSIONS,
15200
+ ...DOCUMENT_FILE_EXTENSIONS
15201
+ ]);
15202
+
15170
15203
  // ../../libs/domain/dist/entities.js
15171
15204
  var organizationSchema = external_exports.object({
15172
15205
  id: uuidSchema,
@@ -15376,6 +15409,42 @@ var requirementApprovalSchema = external_exports.object({
15376
15409
  approvedBy: uuidSchema,
15377
15410
  createdAt: external_exports.iso.datetime({ offset: true })
15378
15411
  });
15412
+ var conventionSchema = external_exports.object({
15413
+ id: uuidSchema,
15414
+ displayId: external_exports.string().min(1),
15415
+ orgId: uuidSchema,
15416
+ number: positiveIntSchema,
15417
+ approvedRevisionId: uuidSchema.nullable(),
15418
+ lifecycle: requirementLifecycleSchema,
15419
+ supersededById: uuidSchema.nullable(),
15420
+ supersededAt: external_exports.iso.datetime({ offset: true }).nullable(),
15421
+ createdBy: uuidSchema.nullable(),
15422
+ createdAt: external_exports.iso.datetime({ offset: true }),
15423
+ updatedAt: external_exports.iso.datetime({ offset: true }),
15424
+ deletedAt: external_exports.iso.datetime({ offset: true }).nullable()
15425
+ });
15426
+ var conventionRevisionSchema = external_exports.object({
15427
+ id: uuidSchema,
15428
+ orgId: uuidSchema,
15429
+ conventionId: uuidSchema,
15430
+ revisionNumber: positiveIntSchema,
15431
+ title: external_exports.string().min(1),
15432
+ body: markdownSchema,
15433
+ note: external_exports.string().nullable(),
15434
+ createdBy: uuidSchema.nullable(),
15435
+ viaTokenId: uuidSchema.nullable(),
15436
+ createdAt: external_exports.iso.datetime({ offset: true })
15437
+ });
15438
+ var conventionApprovalSchema = external_exports.object({
15439
+ id: uuidSchema,
15440
+ orgId: uuidSchema,
15441
+ conventionId: uuidSchema,
15442
+ revisionId: uuidSchema,
15443
+ approvedBy: uuidSchema,
15444
+ viaTokenId: uuidSchema.nullable(),
15445
+ supersededId: uuidSchema.nullable(),
15446
+ createdAt: external_exports.iso.datetime({ offset: true })
15447
+ });
15379
15448
  var issueRequirementLinkSchema = external_exports.object({
15380
15449
  id: uuidSchema,
15381
15450
  orgId: uuidSchema,
@@ -15821,6 +15890,25 @@ var approveRequirementInputSchema = external_exports.strictObject({
15821
15890
  // → requirement_revisions.revision_number, an `integer` column (PIPE-149).
15822
15891
  revision: int4Schema.optional()
15823
15892
  });
15893
+ var createConventionInputSchema = external_exports.strictObject({
15894
+ title: external_exports.string().min(1, { message: "convention title must not be empty" }),
15895
+ body: markdownSchema,
15896
+ note: external_exports.string().optional(),
15897
+ outlivesAnyProject: external_exports.literal(true, {
15898
+ message: "set outlivesAnyProject: true to assert this statement outlives any single project \u2014 if it stops being true when one project ends it is a cross-cutting requirement on that project, not a convention"
15899
+ })
15900
+ });
15901
+ var updateConventionInputSchema = external_exports.strictObject({
15902
+ convention: conventionRefSchema,
15903
+ title: external_exports.string().min(1, { message: "convention title must not be empty" }).optional(),
15904
+ body: markdownSchema.optional(),
15905
+ note: external_exports.string().min(1, { message: "note must not be empty \u2014 omit it if there is nothing to record" }).optional()
15906
+ }).refine((v) => v.title !== void 0 || v.body !== void 0, {
15907
+ message: "empty edit: supply at least one of `title` or `body`"
15908
+ });
15909
+ var listConventionsFilterSchema = external_exports.strictObject({
15910
+ text: external_exports.string().optional()
15911
+ });
15824
15912
  var createDecisionInputSchema = external_exports.strictObject({
15825
15913
  project: projectRefSchema,
15826
15914
  title: external_exports.string().min(1, { message: "decision title must not be empty" }),
@@ -15899,9 +15987,10 @@ var createOrgInputSchema = external_exports.strictObject({
15899
15987
  });
15900
15988
  var updateOrgInputSchema = external_exports.strictObject({
15901
15989
  name: external_exports.string().min(1, { message: "organization name must not be empty" }).optional(),
15902
- slug: orgSlugSchema.optional()
15903
- }).refine((v) => v.name !== void 0 || v.slug !== void 0, {
15904
- message: "empty edit: supply at least one of `name` or `slug`"
15990
+ slug: orgSlugSchema.optional(),
15991
+ conventionWarningThreshold: int4Schema.nullable().optional()
15992
+ }).refine((v) => v.name !== void 0 || v.slug !== void 0 || v.conventionWarningThreshold !== void 0, {
15993
+ message: "empty edit: supply at least one of `name`, `slug`, or `conventionWarningThreshold`"
15905
15994
  });
15906
15995
  var createInvitationInputSchema = external_exports.strictObject({
15907
15996
  email: emailSchema,
@@ -16401,6 +16490,33 @@ var ApiClient = class _ApiClient {
16401
16490
  body: revision === void 0 ? {} : { revision }
16402
16491
  });
16403
16492
  }
16493
+ // --- organization conventions (PIPE-193) -----------------------------------
16494
+ //
16495
+ // FOUR methods, and the absence of a fifth is the design: there is deliberately NO
16496
+ // `approveConvention` here, and there must not be one. Approving is a signed-in
16497
+ // person's act in the browser (AC-1) — the API refuses the route to a bearer caller —
16498
+ // and this client is what the agent surface calls, so a method for it would only ever
16499
+ // be a door an agent walks into a 403 through. The web app posts that route directly.
16500
+ /**
16501
+ * The whole list, superseded conventions included, with the delivered count and the
16502
+ * threshold that warns about it. NOT `requestList`: the response is a named object
16503
+ * rather than an `{ items }` envelope, because the count and the threshold are answers
16504
+ * to the same question the list is and belong in the same read.
16505
+ */
16506
+ listConventions(filter = {}) {
16507
+ return this.request("GET", "/api/v1/conventions", { query: filter });
16508
+ }
16509
+ getConvention(ref) {
16510
+ return this.request("GET", `/api/v1/conventions/${enc(ref)}`);
16511
+ }
16512
+ createConvention(input) {
16513
+ return this.request("POST", "/api/v1/conventions", { body: input });
16514
+ }
16515
+ updateConvention(ref, fields) {
16516
+ return this.request("PATCH", `/api/v1/conventions/${enc(ref)}`, {
16517
+ body: fields
16518
+ });
16519
+ }
16404
16520
  // --- decision records (PIPE-84) --------------------------------------------
16405
16521
  //
16406
16522
  // Five routes, no DELETE: PIPE-73 made four record kinds deletable and this epic
@@ -17118,7 +17234,7 @@ function createMcpServer(client2, apiBaseUrl, orgInstructions2 = /* @__PURE__ */
17118
17234
  // one description loaded into EVERY session by `anthropic/alwaysLoad`. The clauses
17119
17235
  // that went were the ones arguing for the rule rather than stating it; what a caller
17120
17236
  // needs to predict a refusal all stayed.
17121
- description: "Everything a session needs before it starts work, in ONE read \u2014 assembled by the API and returned verbatim, with the BINDING GUIDANCE appended after it: the product doctrine and this organization\u2019s own writing rules, in full. This is the one call that returns them; every other read only names it. CALL IT FIRST, before you write anything. Addressed by `issue` OR by `project`, never both and never neither: an issue names its own project, so the pair is refused rather than resolved for you (\xA77). Given an ISSUE: that issue\u2019s full detail \u2014 the same payload `get_issue` returns \u2014 PLUS the BODY TEXT of every requirement it links, at the revision the link is pinned at. That text is the round trip this removes: `get_issue` names which documents bind the work and at which revision, never what they SAY. Comments come CAPPED at the newest `commentLimit`, with `commentCount` \u2014 the issue\u2019s TRUE total \u2014 beside them; read the issue directly for the rest. Given a PROJECT: `available`, the work a session could START right now. It EXCLUDES finished and abandoned work (`done`, `killed`), work another person has claimed, and anything blocked \u2014 the status guard would refuse to start that. Your OWN claims stay, and so does unscheduled work carrying no milestone. `available` comes CAPPED at `availableLimit` rows, with `availableCount` \u2014 the project\u2019s TRUE total of startable work \u2014 beside it. The item form carries no `available`; the project form carries no item. BOTH forms also carry the project half: the release currently being worked (the active milestone) and the project\u2019s cross-cutting requirements WITH their text \u2014 they bind every epic automatically. READ-ONLY \u2014 this claims nothing, moves nothing and writes nothing.",
17237
+ description: "Everything a session needs before it starts work, in ONE read \u2014 assembled by the API and returned verbatim, with the BINDING GUIDANCE appended after it: the product doctrine and this organization\u2019s own writing rules, in full. This is the one call that returns them; every other read only names it. CALL IT FIRST, before you write anything. Addressed by `issue` OR by `project`, never both and never neither: an issue names its own project, so the pair is refused rather than resolved for you (\xA77). Given an ISSUE: that issue\u2019s full detail \u2014 the same payload `get_issue` returns \u2014 PLUS the BODY TEXT of every requirement it links, at the revision the link is pinned at. That text is the round trip this removes: `get_issue` names which documents bind the work and at which revision, never what they SAY. Comments come CAPPED at the newest `commentLimit`, with `commentCount` \u2014 the issue\u2019s TRUE total \u2014 beside them; read the issue directly for the rest. Given a PROJECT: `available`, the work a session could START right now. It EXCLUDES finished and abandoned work (`done`, `killed`), work another person has claimed, and anything blocked \u2014 the status guard would refuse to start that. Your OWN claims stay, and so does unscheduled work carrying no milestone. `available` comes CAPPED at `availableLimit` rows, with `availableCount` \u2014 the project\u2019s TRUE total of startable work \u2014 beside it. The item form carries no `available`; the project form carries no item. BOTH forms also carry the project half: the release currently being worked (the active milestone) and the project\u2019s cross-cutting requirements WITH their text \u2014 they bind every epic automatically \u2014 and this organization\u2019s approved conventions in full, standing guidance that binds work in EVERY project here, not just this one. READ-ONLY \u2014 this claims nothing, moves nothing and writes nothing.",
17122
17238
  // The WHOLE domain schema rather than its `.shape`: the exactly-one-of rule is a
17123
17239
  // refinement on the OBJECT, and a raw shape drops it — the SDK validates against
17124
17240
  // what it is handed, so the shape alone would quietly accept both arguments and
@@ -17234,7 +17350,7 @@ function createMcpServer(client2, apiBaseUrl, orgInstructions2 = /* @__PURE__ */
17234
17350
  (args) => run(() => client2.listIssues(args.status === void 0 ? { ...args, status: [...OPEN_STATUSES] } : args), GUIDANCE_POINTER)
17235
17351
  );
17236
17352
  server2.registerTool("get_issue", {
17237
- description: "Full issue detail by display id or uuid: body, criteria (states, modes, evidence), explicit requirement links (pinned revision + staleness), the project\u2019s cross-cutting requirements at their latest approved revision, children, and comments (\xA77). Carries `terminal`: true when the issue is finished (`done`) or deliberately abandoned (`killed`) and is therefore NOT buildable work \u2014 check it before acting on an issue you were handed by key. Reading criterion state: `state_evidence` is required only when a TOKEN sets one, so a `manual` criterion \u2014 settable only from a web session \u2014 carries none by design, and the attribution the server already stores (who set it, and when) IS its record. What this payload tells you about ANOTHER issue goes stale. Reference that issue by key and say what you need from it; never restate its status, its criteria, or whether those criteria passed \u2014 such a sentence is true when written and wrong later, and a terminal issue is never revisited to correct it, so the stale reading is what the next reader inherits.",
17353
+ description: "Full issue detail by display id or uuid: body, criteria (states, modes, evidence), explicit requirement links (pinned revision + staleness), the project\u2019s cross-cutting requirements at their latest approved revision, this organization\u2019s approved conventions \u2014 standing guidance that BINDS work in every project here, delivered in full at the revision a person approved \u2014 children, and comments (\xA77). Carries `terminal`: true when the issue is finished (`done`) or deliberately abandoned (`killed`) and is therefore NOT buildable work \u2014 check it before acting on an issue you were handed by key. Reading criterion state: `state_evidence` is required only when a TOKEN sets one, so a `manual` criterion \u2014 settable only from a web session \u2014 carries none by design, and the attribution the server already stores (who set it, and when) IS its record. What this payload tells you about ANOTHER issue goes stale. Reference that issue by key and say what you need from it; never restate its status, its criteria, or whether those criteria passed \u2014 such a sentence is true when written and wrong later, and a terminal issue is never revisited to correct it, so the stale reading is what the next reader inherits.",
17238
17354
  inputSchema: { issue: issueRefSchema }
17239
17355
  }, (args) => run(() => client2.getIssue(args.issue), GUIDANCE_POINTER));
17240
17356
  server2.registerTool("create_issue", {
@@ -17367,6 +17483,29 @@ function createMcpServer(client2, apiBaseUrl, orgInstructions2 = /* @__PURE__ */
17367
17483
  description: "Approve (pin) a requirement\u2019s latest revision, or a specified `revision`, recording it in approvals history and advancing the approved revision that downstream links and reads build against (\xA75, \xA77).",
17368
17484
  inputSchema: approveRequirementInputSchema.shape
17369
17485
  }, (args) => run(() => client2.approveRequirement(args.requirement, args.revision)));
17486
+ server2.registerTool("list_conventions", {
17487
+ description: "List this organization\u2019s conventions \u2014 standing guidance that binds work in EVERY project here, unlike a requirement, which binds one project. Returns display id (`CONV-{n}`), title, the standing text, lifecycle (draft/approved/amended), latest + approved revision numbers, and whether it has been superseded and by which convention. Optional `text` matches over title and body. Retired conventions are INCLUDED and marked, so you can see what the organization used to require rather than proposing it again. Only APPROVED, unretired conventions are actually delivered to agents \u2014 every `get_issue` and `get_work_context` read carries them.",
17488
+ inputSchema: listConventionsFilterSchema.shape
17489
+ }, (args) => run(() => client2.listConventions(args), GUIDANCE_POINTER));
17490
+ server2.registerTool("get_convention", {
17491
+ description: "Get one convention by display id (`CONV-{n}`) or uuid: the standing text at the approved revision, its full revision history with who wrote each and when, its approval history, and \u2014 when it has been retired \u2014 which convention replaced it. A convention that was never approved is readable here and is delivered to nobody.",
17492
+ inputSchema: { convention: conventionRefSchema }
17493
+ }, (args) => run(() => client2.getConvention(args.convention), GUIDANCE_POINTER));
17494
+ server2.registerTool("create_convention", {
17495
+ description: "Write a convention: organization-wide standing guidance, with no project attached. THE GOVERNING TEST \u2014 if it stops being true when this project ends it is a cross-cutting requirement; if it would still be true on the next project it is a convention. You must assert that test by passing `outlivesAnyProject: true`; the write is refused without it. A statement naming one specific project \u2014 its key, a display id built on it, a repository path, or a database object \u2014 is also refused (422 `convention_names_project_scope`), and the message says to file it as a cross-cutting requirement on that project instead. IT BINDS NOBODY UNTIL IT IS APPROVED, and approval is NOT available on this surface: it requires a signed-in person in the browser, so there is no tool for it here and asking for one is asking for a tool that deliberately does not exist. A new convention starts as a draft; write it, then ask a person to review and approve it. Writing guidance for this tool lives in the product doctrine, which `get_work_context` returns \u2014 see \u201CSearch before you create\u201D and \u201CLink by key; never paste another record\u2019s text\u201D.",
17496
+ inputSchema: createConventionInputSchema.shape
17497
+ }, (args) => run(() => client2.createConvention(args)));
17498
+ server2.registerTool("update_convention", {
17499
+ description: "Amend a convention: `title` and/or `body` APPEND a new revision \u2014 nothing is ever edited in place \u2014 and optional `note` records why. Supplying neither is an empty edit (400); a note alone amends nothing. The same project-scope refusal applies as on create, over the amended text. THE AMENDMENT BINDS NOBODY UNTIL IT IS ITSELF APPROVED: until then agents keep receiving the approved revision, so amending is not a way to change what is being delivered \u2014 a signed-in person approving the new revision is.",
17500
+ // Inline shape (updateConventionInputSchema is a refine, so it has no `.shape`);
17501
+ // the empty-edit rule is enforced by the API, not by this shape.
17502
+ inputSchema: {
17503
+ convention: conventionRefSchema,
17504
+ title: external_exports.string().min(1).optional(),
17505
+ body: markdownSchema.optional(),
17506
+ note: external_exports.string().min(1).optional()
17507
+ }
17508
+ }, ({ convention, ...fields }) => run(() => client2.updateConvention(convention, fields)));
17370
17509
  server2.registerTool("create_decision", {
17371
17510
  description: "Record ONE decision as a project-scoped decision record (`KEY-D{n}`): `title` names the decision and `body` says what was decided and why. A new record starts `proposed`; moving it to `accepted` IS the acceptance \u2014 there is no separate approval step. Returns the created record. Title and body can be corrected only while the record is `proposed`; from `accepted` onward it is frozen, and the way to change a decision is to write a NEW record and `supersede_decision` the old one \u2014 which leaves the original readable and says where the current decision went. Nothing on any surface deletes one. Writing guidance for this tool lives in the product doctrine, which `get_work_context` returns \u2014 see \u201CA decision record is written once\u201D and \u201CSearch before you create\u201D.",
17372
17511
  inputSchema: createDecisionInputSchema.shape
@@ -17577,7 +17716,7 @@ function loadMcpConfig() {
17577
17716
  }
17578
17717
 
17579
17718
  // src/version.ts
17580
- var VERSION = "0.35.0";
17719
+ var VERSION = "0.36.0";
17581
17720
 
17582
17721
  // src/main.ts
17583
17722
  var config2 = loadMcpConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pipebrain-mcp",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Pipebrain MCP server for Claude Code and Claude Desktop — issues, requirements, content, assets, and metadata-only secrets over the Pipebrain API.",
5
5
  "type": "module",
6
6
  "license": "MIT",