@bike4mind/cli 0.2.19-add-confluence-comments.17816 → 0.2.19-cj-GH6131.17812

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-COI6KWNH.js";
4
+ } from "./chunk-MEZW4NS7.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
7
7
  var ARTIFACT_TAG_REGEX = /<artifact\s+(.*?)>([\s\S]*?)<\/artifact>/gi;
@@ -13,7 +13,7 @@ import {
13
13
  dayjsConfig_default,
14
14
  extractSnippetMeta,
15
15
  settingsMap
16
- } from "./chunk-COI6KWNH.js";
16
+ } from "./chunk-MEZW4NS7.js";
17
17
  import {
18
18
  Logger
19
19
  } from "./chunk-OCYRD7D6.js";
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-D4HHYMVC.js";
9
+ } from "./chunk-7GNM443Q.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-COI6KWNH.js";
14
+ } from "./chunk-MEZW4NS7.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-D4HHYMVC.js";
5
+ } from "./chunk-7GNM443Q.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -11,7 +11,7 @@ import {
11
11
  RealtimeVoiceUsageTransaction,
12
12
  TextGenerationUsageTransaction,
13
13
  TransferCreditTransaction
14
- } from "./chunk-COI6KWNH.js";
14
+ } from "./chunk-MEZW4NS7.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
17
17
  import { z } from "zod";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-D4HHYMVC.js";
10
+ } from "./chunk-7GNM443Q.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-COI6KWNH.js";
14
+ } from "./chunk-MEZW4NS7.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -4517,10 +4517,11 @@ function formatPageResponse(page, siteUrl) {
4517
4517
  link = `${baseUrl}/pages/${page.id}`;
4518
4518
  }
4519
4519
  return {
4520
- id: page.id,
4520
+ pageId: page.id,
4521
4521
  title: page.title,
4522
4522
  status: page.status,
4523
4523
  spaceId: page.spaceId,
4524
+ spaceKey: page.space?.key,
4524
4525
  body: stripHtmlAndNormalizeWhitespace(page.body?.storage?.value || page.body?.view?.value),
4525
4526
  version: page.version?.number,
4526
4527
  parentId: page.parentId,
@@ -4585,49 +4586,12 @@ function formatSpaceList(spacesResponse, siteUrl) {
4585
4586
  results
4586
4587
  };
4587
4588
  }
4588
- function formatCommentResponse(comment, siteUrl) {
4589
- if (!comment || typeof comment !== "object" || comment.error || comment.errors) {
4590
- return comment;
4591
- }
4592
- const baseUrl = comment?._links?.base || siteUrl.replace(/\/$/, "");
4593
- const link = comment._links?.webui ? `${baseUrl}${comment._links.webui}` : "";
4594
- return {
4595
- id: comment.id,
4596
- type: comment.type,
4597
- // 'comment'
4598
- status: comment.status,
4599
- title: comment.title,
4600
- // Usually "Re: Page Title"
4601
- body: stripHtmlAndNormalizeWhitespace(comment.body?.storage?.value || comment.body?.view?.value),
4602
- author: comment.history?.createdBy ? formatUserResponse(comment.history.createdBy) : void 0,
4603
- created: comment.history?.createdDate,
4604
- updated: comment.history?.lastUpdated?.when,
4605
- parentId: comment.container?.id,
4606
- // Page ID
4607
- parentCommentId: comment.ancestors?.length ? comment.ancestors[comment.ancestors.length - 1].id : void 0,
4608
- link,
4609
- inlineProperties: comment.extensions?.inlineProperties
4610
- // For inline comments
4611
- };
4612
- }
4613
- function formatCommentList(commentsResponse, siteUrl) {
4614
- if (!commentsResponse || typeof commentsResponse !== "object" || commentsResponse.error || commentsResponse.errors) {
4615
- return commentsResponse;
4616
- }
4617
- const results = Array.isArray(commentsResponse.results) ? commentsResponse.results.map((comment) => formatCommentResponse(comment, siteUrl)) : [];
4618
- return {
4619
- results,
4620
- start: commentsResponse.start,
4621
- limit: commentsResponse.limit,
4622
- size: commentsResponse.size
4623
- };
4624
- }
4625
4589
  function formatPageList(pagesResponse, siteUrl) {
4626
4590
  if (!pagesResponse || typeof pagesResponse !== "object" || pagesResponse.error || pagesResponse.errors) {
4627
4591
  return pagesResponse;
4628
4592
  }
4629
4593
  const results = Array.isArray(pagesResponse.results) ? pagesResponse.results.map((page) => ({
4630
- id: page.id,
4594
+ pageId: page.id,
4631
4595
  title: page.title,
4632
4596
  status: page.status,
4633
4597
  parentId: page.parentId,
@@ -4964,149 +4928,6 @@ var ConfluenceApi = class {
4964
4928
  const result = await this.getV1("/user/current", { expand: "personalSpace" });
4965
4929
  return formatUserResponse(result);
4966
4930
  }
4967
- /**
4968
- * Get comments for a Confluence page (v1 API)
4969
- */
4970
- async getPageComments(params) {
4971
- const { pageId, limit = 25, start = 0, expand } = params;
4972
- if (!pageId) {
4973
- throw new Error("pageId is required to fetch comments.");
4974
- }
4975
- const comments = await this.getV1(`/content/${pageId}/child/comment`, {
4976
- limit: Math.min(Math.max(limit, 1), 50),
4977
- start,
4978
- expand: expand || "body.storage,history.lastUpdated,history.createdBy,ancestors,extensions.inlineProperties"
4979
- });
4980
- return formatCommentList(comments, this.config.siteUrl);
4981
- }
4982
- /**
4983
- * Get a specific comment (v1 API)
4984
- */
4985
- async getComment(params) {
4986
- const { commentId } = params;
4987
- if (!commentId)
4988
- throw new Error("commentId is required");
4989
- const comment = await this.getV1(`/content/${commentId}`, {
4990
- expand: "body.storage,history.lastUpdated,history.createdBy,ancestors,extensions.inlineProperties,container"
4991
- });
4992
- return formatCommentResponse(comment, this.config.siteUrl);
4993
- }
4994
- /**
4995
- * Add a comment to a page (Uses v2 API for creation)
4996
- */
4997
- async addComment(params) {
4998
- const { pageId, content, parentId, inlineOriginalSelection } = params;
4999
- if (!pageId || !content) {
5000
- throw new Error("pageId and content are required to add a comment.");
5001
- }
5002
- if (inlineOriginalSelection) {
5003
- const payload = {
5004
- pageId,
5005
- body: {
5006
- value: content,
5007
- representation: "storage"
5008
- },
5009
- inlineProperties: {
5010
- originalSelection: inlineOriginalSelection
5011
- }
5012
- };
5013
- const result = await this.post("/inline-comments", payload);
5014
- return formatCommentResponse(result, this.config.siteUrl);
5015
- }
5016
- if (!parentId) {
5017
- const payload = {
5018
- pageId,
5019
- body: {
5020
- value: content,
5021
- representation: "storage"
5022
- }
5023
- };
5024
- try {
5025
- const result = await this.post("/footer-comments", payload);
5026
- return formatCommentResponse(result, this.config.siteUrl);
5027
- } catch (error) {
5028
- console.warn(`Confluence v2 footer-comments failed: ${error.message}. Attempting v1 fallback.`);
5029
- if (error.message?.includes("403") || error.message?.includes("Permission")) {
5030
- throw new Error(`Permission Denied: The app cannot create comments. This usually means the OAuth scope 'write:confluence-content' is missing or the user does not have permission to comment on this page. Please ask the admin to update the app scopes or grant comment permissions.`);
5031
- }
5032
- }
5033
- }
5034
- try {
5035
- const payload = {
5036
- type: "comment",
5037
- container: {
5038
- id: pageId,
5039
- type: "page"
5040
- },
5041
- body: {
5042
- storage: {
5043
- value: content,
5044
- representation: "storage"
5045
- }
5046
- }
5047
- };
5048
- if (parentId) {
5049
- payload.ancestors = [{ id: parentId }];
5050
- }
5051
- const result = await this.postV1("/content", payload);
5052
- return formatCommentResponse(result, this.config.siteUrl);
5053
- } catch (error) {
5054
- if (error.message?.includes("410")) {
5055
- throw new Error("Confluence API v1 is deprecated (410) and v2 does not yet fully support threaded replies. Please create a top-level comment instead.");
5056
- }
5057
- throw error;
5058
- }
5059
- }
5060
- /**
5061
- * Update a comment (v1 API)
5062
- */
5063
- async updateComment(params) {
5064
- const { commentId, content, inlineOriginalSelection } = params;
5065
- if (!commentId || !content) {
5066
- throw new Error("commentId and content are required to update a comment.");
5067
- }
5068
- const currentComment = await this.getV1(`/content/${commentId}`, {
5069
- expand: "version,body.storage"
5070
- });
5071
- const currentVersion = currentComment?.version?.number;
5072
- if (typeof currentVersion !== "number") {
5073
- throw new Error(`Unable to determine current version for comment ${commentId}.`);
5074
- }
5075
- const payload = {
5076
- id: commentId,
5077
- type: "comment",
5078
- status: "current",
5079
- title: currentComment.title,
5080
- // Title usually persists for comments
5081
- version: {
5082
- number: currentVersion + 1
5083
- },
5084
- body: {
5085
- storage: {
5086
- value: content,
5087
- representation: "storage"
5088
- }
5089
- }
5090
- };
5091
- if (inlineOriginalSelection) {
5092
- payload.extensions = {
5093
- inlineProperties: {
5094
- originalSelection: inlineOriginalSelection
5095
- }
5096
- };
5097
- }
5098
- const result = await this.put(`/content/${commentId}`, payload);
5099
- return formatCommentResponse(result, this.config.siteUrl);
5100
- }
5101
- /**
5102
- * Delete a comment (v1 API)
5103
- */
5104
- async deleteComment(params) {
5105
- const { commentId } = params;
5106
- if (!commentId)
5107
- throw new Error("commentId is required");
5108
- await this.requestV1("DELETE", `/content/${commentId}`);
5109
- }
5110
4931
  };
5111
4932
 
5112
4933
  // ../../b4m-core/packages/common/dist/src/jira/format.js
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-4G3MVV4Z.js";
6
- import "./chunk-D4HHYMVC.js";
7
- import "./chunk-COI6KWNH.js";
5
+ } from "./chunk-KXCPZJW3.js";
6
+ import "./chunk-7GNM443Q.js";
7
+ import "./chunk-MEZW4NS7.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,
package/dist/index.js CHANGED
@@ -4,12 +4,12 @@ import {
4
4
  getEffectiveApiKey,
5
5
  getOpenWeatherKey,
6
6
  getSerperKey
7
- } from "./chunk-VXPKOKIP.js";
7
+ } from "./chunk-BWJUEE53.js";
8
8
  import {
9
9
  ConfigStore
10
10
  } from "./chunk-FFJX3FF3.js";
11
- import "./chunk-JA5GUWOA.js";
12
- import "./chunk-4G3MVV4Z.js";
11
+ import "./chunk-IGPJRV64.js";
12
+ import "./chunk-KXCPZJW3.js";
13
13
  import {
14
14
  BFLImageService,
15
15
  BaseStorage,
@@ -21,7 +21,7 @@ import {
21
21
  OpenAIBackend,
22
22
  OpenAIImageService,
23
23
  XAIImageService
24
- } from "./chunk-D4HHYMVC.js";
24
+ } from "./chunk-7GNM443Q.js";
25
25
  import {
26
26
  AiEvents,
27
27
  ApiKeyEvents,
@@ -75,7 +75,7 @@ import {
75
75
  XAI_IMAGE_MODELS,
76
76
  b4mLLMTools,
77
77
  getMcpProviderMetadata
78
- } from "./chunk-COI6KWNH.js";
78
+ } from "./chunk-MEZW4NS7.js";
79
79
  import {
80
80
  Logger
81
81
  } from "./chunk-OCYRD7D6.js";
@@ -11563,7 +11563,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
11563
11563
  // package.json
11564
11564
  var package_default = {
11565
11565
  name: "@bike4mind/cli",
11566
- version: "0.2.19-add-confluence-comments.17816+2adb71de8",
11566
+ version: "0.2.19-cj-GH6131.17812+e4261f1c0",
11567
11567
  type: "module",
11568
11568
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
11569
11569
  license: "UNLICENSED",
@@ -11670,10 +11670,10 @@ var package_default = {
11670
11670
  },
11671
11671
  devDependencies: {
11672
11672
  "@bike4mind/agents": "0.1.0",
11673
- "@bike4mind/common": "2.43.1-add-confluence-comments.17816+2adb71de8",
11674
- "@bike4mind/mcp": "1.23.1-add-confluence-comments.17816+2adb71de8",
11675
- "@bike4mind/services": "2.41.2-add-confluence-comments.17816+2adb71de8",
11676
- "@bike4mind/utils": "2.2.1-add-confluence-comments.17816+2adb71de8",
11673
+ "@bike4mind/common": "2.43.1-cj-GH6131.17812+e4261f1c0",
11674
+ "@bike4mind/mcp": "1.23.1-cj-GH6131.17812+e4261f1c0",
11675
+ "@bike4mind/services": "2.41.2-cj-GH6131.17812+e4261f1c0",
11676
+ "@bike4mind/utils": "2.2.1-cj-GH6131.17812+e4261f1c0",
11677
11677
  "@types/better-sqlite3": "^7.6.13",
11678
11678
  "@types/diff": "^5.0.9",
11679
11679
  "@types/jsonwebtoken": "^9.0.4",
@@ -11690,7 +11690,7 @@ var package_default = {
11690
11690
  optionalDependencies: {
11691
11691
  "@vscode/ripgrep": "^1.17.0"
11692
11692
  },
11693
- gitHead: "2adb71de899522b4cae4208523cc13b2a8667ab6"
11693
+ gitHead: "e4261f1c047efb3952b9a64ccce5d6a8d4beac5d"
11694
11694
  };
11695
11695
 
11696
11696
  // src/config/constants.ts
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-COI6KWNH.js";
4
+ } from "./chunk-MEZW4NS7.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/llmMarkdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-COI6KWNH.js";
4
+ } from "./chunk-MEZW4NS7.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/markdownGenerator.js
7
7
  var DEFAULT_OPTIONS = {
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  findMostSimilarMemento,
4
4
  getRelevantMementos
5
- } from "./chunk-VXPKOKIP.js";
6
- import "./chunk-D4HHYMVC.js";
7
- import "./chunk-COI6KWNH.js";
5
+ } from "./chunk-BWJUEE53.js";
6
+ import "./chunk-7GNM443Q.js";
7
+ import "./chunk-MEZW4NS7.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  findMostSimilarMemento,
@@ -129,8 +129,8 @@ import {
129
129
  validateMermaidSyntax,
130
130
  warmUpSettingsCache,
131
131
  withRetry
132
- } from "./chunk-D4HHYMVC.js";
133
- import "./chunk-COI6KWNH.js";
132
+ } from "./chunk-7GNM443Q.js";
133
+ import "./chunk-MEZW4NS7.js";
134
134
  import {
135
135
  Logger,
136
136
  NotificationDeduplicator,
@@ -299,7 +299,7 @@ import {
299
299
  validateReactArtifactV2,
300
300
  validateSvgArtifactV2,
301
301
  wikiMarkupToAdf
302
- } from "./chunk-COI6KWNH.js";
302
+ } from "./chunk-MEZW4NS7.js";
303
303
  export {
304
304
  ALL_IMAGE_MODELS,
305
305
  ALL_IMAGE_SIZES,
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  SubtractCreditsSchema,
4
4
  subtractCredits
5
- } from "./chunk-JA5GUWOA.js";
6
- import "./chunk-D4HHYMVC.js";
7
- import "./chunk-COI6KWNH.js";
5
+ } from "./chunk-IGPJRV64.js";
6
+ import "./chunk-7GNM443Q.js";
7
+ import "./chunk-MEZW4NS7.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  SubtractCreditsSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.19-add-confluence-comments.17816+2adb71de8",
3
+ "version": "0.2.19-cj-GH6131.17812+e4261f1c0",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -107,10 +107,10 @@
107
107
  },
108
108
  "devDependencies": {
109
109
  "@bike4mind/agents": "0.1.0",
110
- "@bike4mind/common": "2.43.1-add-confluence-comments.17816+2adb71de8",
111
- "@bike4mind/mcp": "1.23.1-add-confluence-comments.17816+2adb71de8",
112
- "@bike4mind/services": "2.41.2-add-confluence-comments.17816+2adb71de8",
113
- "@bike4mind/utils": "2.2.1-add-confluence-comments.17816+2adb71de8",
110
+ "@bike4mind/common": "2.43.1-cj-GH6131.17812+e4261f1c0",
111
+ "@bike4mind/mcp": "1.23.1-cj-GH6131.17812+e4261f1c0",
112
+ "@bike4mind/services": "2.41.2-cj-GH6131.17812+e4261f1c0",
113
+ "@bike4mind/utils": "2.2.1-cj-GH6131.17812+e4261f1c0",
114
114
  "@types/better-sqlite3": "^7.6.13",
115
115
  "@types/diff": "^5.0.9",
116
116
  "@types/jsonwebtoken": "^9.0.4",
@@ -127,5 +127,5 @@
127
127
  "optionalDependencies": {
128
128
  "@vscode/ripgrep": "^1.17.0"
129
129
  },
130
- "gitHead": "2adb71de899522b4cae4208523cc13b2a8667ab6"
130
+ "gitHead": "e4261f1c047efb3952b9a64ccce5d6a8d4beac5d"
131
131
  }