@bike4mind/cli 0.2.5-ja-fix-confluence-table-data-5752.17103 → 0.2.7-basic-cli-shortcuts.17131
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/README.md +50 -4
- package/dist/ImageStore-RQZ7OF7P.js +225 -0
- package/dist/{artifactExtractor-ZU5BBMLI.js → artifactExtractor-DNE5C6DY.js} +1 -1
- package/dist/{chunk-3TADOGT5.js → chunk-3CCBDIFR.js} +2 -2
- package/dist/{chunk-WPD676KY.js → chunk-DNSBC3LO.js} +1 -1
- package/dist/{chunk-QCULHLGT.js → chunk-H6SHASMZ.js} +66 -118
- package/dist/{chunk-ZYMOZ2IB.js → chunk-LIRY24M5.js} +2 -2
- package/dist/{chunk-GVI2BQAN.js → chunk-YXHQN7SK.js} +2 -2
- package/dist/{create-BLOW4E4S.js → create-PNU64QSF.js} +3 -3
- package/dist/index.js +1478 -314
- package/dist/{llmMarkdownGenerator-NMCN2NWQ.js → llmMarkdownGenerator-UQXKK2AS.js} +1 -1
- package/dist/{markdownGenerator-JZOBTDGP.js → markdownGenerator-FLLZFXMT.js} +1 -1
- package/dist/{mementoService-KP72H2HX.js → mementoService-LVFQ5XAW.js} +3 -3
- package/dist/{src-OZRIS46Z.js → src-OH5AAQEW.js} +2 -2
- package/dist/{src-43E2427F.js → src-OYQXRLTM.js} +5 -7
- package/dist/{subtractCredits-D4WRBUDQ.js → subtractCredits-75VT7HP2.js} +3 -3
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -172,13 +172,15 @@ export SERPER_API_KEY="your-key-here"
|
|
|
172
172
|
|
|
173
173
|
MCP (Model Context Protocol) servers provide additional tools and capabilities. Configure them in `~/.bike4mind/config.json`:
|
|
174
174
|
|
|
175
|
+
#### Internal MCP Servers (Node.js)
|
|
176
|
+
|
|
177
|
+
For MCP servers bundled with the monorepo, you can omit `command` and `args` - the CLI will automatically discover them:
|
|
178
|
+
|
|
175
179
|
```json
|
|
176
180
|
{
|
|
177
181
|
"mcpServers": [
|
|
178
182
|
{
|
|
179
183
|
"name": "github",
|
|
180
|
-
"command": "node",
|
|
181
|
-
"args": ["path/to/mcp/server.js"],
|
|
182
184
|
"env": {
|
|
183
185
|
"GITHUB_ACCESS_TOKEN": "ghp_..."
|
|
184
186
|
},
|
|
@@ -188,12 +190,56 @@ MCP (Model Context Protocol) servers provide additional tools and capabilities.
|
|
|
188
190
|
}
|
|
189
191
|
```
|
|
190
192
|
|
|
191
|
-
|
|
193
|
+
#### External MCP Servers (Docker)
|
|
194
|
+
|
|
195
|
+
You can run MCP servers in Docker containers for isolation and portability:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"mcpServers": [
|
|
200
|
+
{
|
|
201
|
+
"name": "github",
|
|
202
|
+
"command": "docker",
|
|
203
|
+
"args": ["run", "-i", "--rm", "-e", "GITHUB_TOKEN", "ghcr.io/github/github-mcp-server"],
|
|
204
|
+
"env": {
|
|
205
|
+
"GITHUB_TOKEN": "ghp_..."
|
|
206
|
+
},
|
|
207
|
+
"enabled": true
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Docker Configuration Notes:**
|
|
214
|
+
- The `-i` flag is required for stdin communication with the MCP server
|
|
215
|
+
- Use `-e VAR_NAME` (without value) to pass environment variables from the host
|
|
216
|
+
- The `--rm` flag ensures containers are cleaned up after use
|
|
217
|
+
- Requires Docker to be installed and running
|
|
218
|
+
|
|
219
|
+
#### External MCP Servers (npx/Custom Commands)
|
|
220
|
+
|
|
221
|
+
You can also run any MCP server via npx or custom executables:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"mcpServers": [
|
|
226
|
+
{
|
|
227
|
+
"name": "filesystem",
|
|
228
|
+
"command": "npx",
|
|
229
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"],
|
|
230
|
+
"env": {},
|
|
231
|
+
"enabled": true
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Available Built-in MCP Servers:**
|
|
192
238
|
- 🔧 **GitHub** - Repository management, issues, PRs (requires `GITHUB_ACCESS_TOKEN`)
|
|
193
239
|
- 🔧 **LinkedIn** - Post management, analytics (requires `LINKEDIN_ACCESS_TOKEN`, `COMPANY_NAME`)
|
|
194
240
|
- 🔧 **Atlassian** - Jira/Confluence integration (requires `ATLASSIAN_ACCESS_TOKEN`, `ATLASSIAN_CLOUD_ID`, `ATLASSIAN_SITE_URL`)
|
|
195
241
|
|
|
196
|
-
**Note:** MCP servers must be built and available in the `b4m-core/packages/mcp/dist/src/` directory. The CLI will automatically find them if you're running from the monorepo.
|
|
242
|
+
**Note:** Internal MCP servers must be built and available in the `b4m-core/packages/mcp/dist/src/` directory. The CLI will automatically find them if you're running from the monorepo. For Docker-based servers, ensure Docker is installed and the image is accessible.
|
|
197
243
|
|
|
198
244
|
## Session Storage
|
|
199
245
|
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./chunk-PDX44BCA.js";
|
|
3
|
+
|
|
4
|
+
// src/storage/ImageStore.ts
|
|
5
|
+
import { createHash } from "crypto";
|
|
6
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync, unlinkSync } from "fs";
|
|
7
|
+
import { join, extname, resolve } from "path";
|
|
8
|
+
import { homedir } from "os";
|
|
9
|
+
import Database from "better-sqlite3";
|
|
10
|
+
import sharp from "sharp";
|
|
11
|
+
var ImageStore = class _ImageStore {
|
|
12
|
+
static {
|
|
13
|
+
this.BASE_DIR = join(homedir(), ".bike4mind", "cli");
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.IMAGES_DIR = join(_ImageStore.BASE_DIR, "images");
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.DB_PATH = join(_ImageStore.BASE_DIR, "images.db");
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.RETENTION_DAYS = 7;
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
// Target max size before base64 encoding. Base64 adds ~33% overhead.
|
|
26
|
+
// To stay under 1MB after base64, we need images < 750KB
|
|
27
|
+
this.MAX_RAW_SIZE = 750 * 1024;
|
|
28
|
+
}
|
|
29
|
+
static {
|
|
30
|
+
// 750KB
|
|
31
|
+
// Maximum size before compression to prevent OOM with very large images
|
|
32
|
+
this.MAX_PRECOMPRESS_SIZE = 50 * 1024 * 1024;
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
this.ensureDirectories();
|
|
36
|
+
this.db = new Database(_ImageStore.DB_PATH);
|
|
37
|
+
this.initDatabase();
|
|
38
|
+
try {
|
|
39
|
+
this.cleanupOldImages();
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.warn("Failed to cleanup old images:", err);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
ensureDirectories() {
|
|
45
|
+
mkdirSync(_ImageStore.BASE_DIR, { recursive: true });
|
|
46
|
+
mkdirSync(_ImageStore.IMAGES_DIR, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
initDatabase() {
|
|
49
|
+
this.db.exec(`
|
|
50
|
+
CREATE TABLE IF NOT EXISTS images (
|
|
51
|
+
hash TEXT PRIMARY KEY,
|
|
52
|
+
format TEXT NOT NULL,
|
|
53
|
+
size INTEGER NOT NULL,
|
|
54
|
+
timestamp INTEGER NOT NULL,
|
|
55
|
+
uploaded INTEGER NOT NULL DEFAULT 0,
|
|
56
|
+
s3_url TEXT,
|
|
57
|
+
original_filename TEXT
|
|
58
|
+
)
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Store an image locally with content-based hashing for deduplication
|
|
63
|
+
*/
|
|
64
|
+
async store(imageData, originalFilename) {
|
|
65
|
+
const { buffer: processedData, format: processedFormat } = await this.processImage(imageData, originalFilename);
|
|
66
|
+
const hash = this.generateHash(processedData);
|
|
67
|
+
const format = processedFormat;
|
|
68
|
+
const ext = format.toLowerCase();
|
|
69
|
+
const localPath = join(_ImageStore.IMAGES_DIR, `${hash}.${ext}`);
|
|
70
|
+
const existing = this.getMetadata(hash);
|
|
71
|
+
if (existing) {
|
|
72
|
+
return {
|
|
73
|
+
hash,
|
|
74
|
+
placeholder: "",
|
|
75
|
+
// Will be set by caller
|
|
76
|
+
localPath,
|
|
77
|
+
metadata: existing
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
writeFileSync(localPath, processedData);
|
|
81
|
+
const metadata = {
|
|
82
|
+
hash,
|
|
83
|
+
format,
|
|
84
|
+
size: processedData.length,
|
|
85
|
+
timestamp: Date.now(),
|
|
86
|
+
uploaded: false,
|
|
87
|
+
originalFilename
|
|
88
|
+
};
|
|
89
|
+
this.db.prepare(
|
|
90
|
+
`INSERT INTO images (hash, format, size, timestamp, uploaded, original_filename)
|
|
91
|
+
VALUES (?, ?, ?, ?, ?, ?)`
|
|
92
|
+
).run(hash, format, metadata.size, metadata.timestamp, 0, originalFilename || null);
|
|
93
|
+
return {
|
|
94
|
+
hash,
|
|
95
|
+
placeholder: "",
|
|
96
|
+
localPath,
|
|
97
|
+
metadata
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get image metadata by hash
|
|
102
|
+
*/
|
|
103
|
+
getMetadata(hash) {
|
|
104
|
+
const row = this.db.prepare("SELECT * FROM images WHERE hash = ?").get(hash);
|
|
105
|
+
if (!row) return null;
|
|
106
|
+
return {
|
|
107
|
+
hash: row.hash,
|
|
108
|
+
format: row.format,
|
|
109
|
+
size: row.size,
|
|
110
|
+
timestamp: row.timestamp,
|
|
111
|
+
uploaded: Boolean(row.uploaded),
|
|
112
|
+
s3Url: row.s3_url,
|
|
113
|
+
originalFilename: row.original_filename
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Read image data from local cache
|
|
118
|
+
*/
|
|
119
|
+
readImage(hash) {
|
|
120
|
+
const metadata = this.getMetadata(hash);
|
|
121
|
+
if (!metadata) return null;
|
|
122
|
+
const localPath = join(_ImageStore.IMAGES_DIR, `${hash}.${metadata.format.toLowerCase()}`);
|
|
123
|
+
const normalizedPath = resolve(localPath);
|
|
124
|
+
if (!normalizedPath.startsWith(resolve(_ImageStore.IMAGES_DIR))) {
|
|
125
|
+
throw new Error("Invalid image path");
|
|
126
|
+
}
|
|
127
|
+
if (!existsSync(localPath)) return null;
|
|
128
|
+
return readFileSync(localPath);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Generate content hash for deduplication
|
|
132
|
+
*/
|
|
133
|
+
generateHash(data) {
|
|
134
|
+
return createHash("sha256").update(data).digest("hex").substring(0, 16);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Process image: compress if needed to stay under size limit
|
|
138
|
+
*/
|
|
139
|
+
async processImage(data, originalFilename) {
|
|
140
|
+
if (data.length > _ImageStore.MAX_PRECOMPRESS_SIZE) {
|
|
141
|
+
throw new Error(
|
|
142
|
+
`Image too large to process (${Math.round(data.length / 1024 / 1024)}MB). Maximum size is ${_ImageStore.MAX_PRECOMPRESS_SIZE / 1024 / 1024}MB.`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
const originalFormat = this.detectFormat(data, originalFilename);
|
|
146
|
+
if (data.length <= _ImageStore.MAX_RAW_SIZE) {
|
|
147
|
+
return { buffer: data, format: originalFormat };
|
|
148
|
+
}
|
|
149
|
+
let image = sharp(data);
|
|
150
|
+
const metadata = await image.metadata();
|
|
151
|
+
if (!metadata.width || !metadata.height) {
|
|
152
|
+
throw new Error("Unable to read image dimensions");
|
|
153
|
+
}
|
|
154
|
+
const maxDimension = 2048;
|
|
155
|
+
let width = metadata.width;
|
|
156
|
+
let height = metadata.height;
|
|
157
|
+
if (width > maxDimension || height > maxDimension) {
|
|
158
|
+
if (width > height) {
|
|
159
|
+
height = Math.round(height * maxDimension / width);
|
|
160
|
+
width = maxDimension;
|
|
161
|
+
} else {
|
|
162
|
+
width = Math.round(width * maxDimension / height);
|
|
163
|
+
height = maxDimension;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
image = image.resize(width, height);
|
|
167
|
+
let quality = 85;
|
|
168
|
+
let buffer = await image.jpeg({ quality }).toBuffer();
|
|
169
|
+
while (buffer.length > _ImageStore.MAX_RAW_SIZE && quality > 30) {
|
|
170
|
+
quality -= 10;
|
|
171
|
+
buffer = await image.jpeg({ quality }).toBuffer();
|
|
172
|
+
}
|
|
173
|
+
if (buffer.length > _ImageStore.MAX_RAW_SIZE) {
|
|
174
|
+
throw new Error(`Unable to compress image below ${_ImageStore.MAX_RAW_SIZE / 1024}KB limit`);
|
|
175
|
+
}
|
|
176
|
+
return { buffer, format: "jpg" };
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Detect image format from buffer or filename
|
|
180
|
+
*/
|
|
181
|
+
detectFormat(data, filename) {
|
|
182
|
+
if (data[0] === 137 && data[1] === 80 && data[2] === 78 && data[3] === 71) {
|
|
183
|
+
return "png";
|
|
184
|
+
}
|
|
185
|
+
if (data[0] === 255 && data[1] === 216 && data[2] === 255) {
|
|
186
|
+
return "jpg";
|
|
187
|
+
}
|
|
188
|
+
if (data[0] === 71 && data[1] === 73 && data[2] === 70) {
|
|
189
|
+
return "gif";
|
|
190
|
+
}
|
|
191
|
+
if (data[0] === 82 && data[1] === 73 && data[2] === 70 && data[3] === 70) {
|
|
192
|
+
return "webp";
|
|
193
|
+
}
|
|
194
|
+
if (filename) {
|
|
195
|
+
const ext = extname(filename).substring(1).toLowerCase();
|
|
196
|
+
if (["png", "jpg", "jpeg", "gif", "webp"].includes(ext)) {
|
|
197
|
+
return ext === "jpeg" ? "jpg" : ext;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return "png";
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Clean up images older than retention period
|
|
204
|
+
*/
|
|
205
|
+
cleanupOldImages() {
|
|
206
|
+
const cutoffTime = Date.now() - _ImageStore.RETENTION_DAYS * 24 * 60 * 60 * 1e3;
|
|
207
|
+
const oldImages = this.db.prepare("SELECT hash, format FROM images WHERE timestamp < ?").all(cutoffTime);
|
|
208
|
+
for (const { hash, format } of oldImages) {
|
|
209
|
+
const localPath = join(_ImageStore.IMAGES_DIR, `${hash}.${format.toLowerCase()}`);
|
|
210
|
+
if (existsSync(localPath)) {
|
|
211
|
+
unlinkSync(localPath);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
this.db.prepare("DELETE FROM images WHERE timestamp < ?").run(cutoffTime);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Close database connection
|
|
218
|
+
*/
|
|
219
|
+
close() {
|
|
220
|
+
this.db.close();
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
export {
|
|
224
|
+
ImageStore
|
|
225
|
+
};
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DNSBC3LO.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H6SHASMZ.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
dayjsConfig_default,
|
|
17
17
|
extractSnippetMeta,
|
|
18
18
|
settingsMap
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-H6SHASMZ.js";
|
|
20
20
|
|
|
21
21
|
// ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
|
|
22
22
|
import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
|
@@ -3745,6 +3745,35 @@ var ToolHealthSchema = z21.object({
|
|
|
3745
3745
|
lastExecutionTime: z21.number().optional(),
|
|
3746
3746
|
successRate: z21.number().optional()
|
|
3747
3747
|
});
|
|
3748
|
+
var CitableSourceSchema = z21.object({
|
|
3749
|
+
/** Unique identifier - can be URL, UUID, or composite key */
|
|
3750
|
+
id: z21.string(),
|
|
3751
|
+
/** Source classification for UI rendering */
|
|
3752
|
+
type: z21.enum(["web_url", "document", "dataset", "mcp"]),
|
|
3753
|
+
/** Human-readable title/name */
|
|
3754
|
+
title: z21.string(),
|
|
3755
|
+
/** Navigation target (external URL, deep link, or hash route) */
|
|
3756
|
+
url: z21.string().optional(),
|
|
3757
|
+
/** Brief description or excerpt (1-2 sentences) */
|
|
3758
|
+
description: z21.string().optional(),
|
|
3759
|
+
/** ISO 8601 timestamp for freshness indication */
|
|
3760
|
+
timestamp: z21.string().optional(),
|
|
3761
|
+
/** Attribution for non-report sources */
|
|
3762
|
+
author: z21.string().optional(),
|
|
3763
|
+
/** Processing status for real-time updates */
|
|
3764
|
+
status: z21.enum(["pending", "processing", "complete", "error"]).optional(),
|
|
3765
|
+
/** Extensibility metadata */
|
|
3766
|
+
metadata: z21.object({
|
|
3767
|
+
sourceSystem: z21.string().optional(),
|
|
3768
|
+
icon: z21.string().optional(),
|
|
3769
|
+
tags: z21.array(z21.string()).optional(),
|
|
3770
|
+
confidence: z21.number().optional(),
|
|
3771
|
+
practiceAreas: z21.array(z21.string()).optional(),
|
|
3772
|
+
chunkId: z21.string().optional(),
|
|
3773
|
+
relevanceScore: z21.number().optional(),
|
|
3774
|
+
fullContext: z21.string().optional()
|
|
3775
|
+
}).passthrough().optional()
|
|
3776
|
+
});
|
|
3748
3777
|
var PromptMetaZodSchema = z21.object({
|
|
3749
3778
|
model: PromptMetaModelSchema.optional(),
|
|
3750
3779
|
tokenUsage: PromptMetaTokenUsageSchema.optional(),
|
|
@@ -3787,7 +3816,9 @@ var PromptMetaZodSchema = z21.object({
|
|
|
3787
3816
|
failedSteps: z21.array(z21.string()).optional()
|
|
3788
3817
|
}).optional(),
|
|
3789
3818
|
// Phase 2: Tool health tracking
|
|
3790
|
-
toolHealth: z21.array(ToolHealthSchema).optional()
|
|
3819
|
+
toolHealth: z21.array(ToolHealthSchema).optional(),
|
|
3820
|
+
// Citable sources referenced in AI responses (from web_search, deep_research, RAG, MCP)
|
|
3821
|
+
citables: z21.array(CitableSourceSchema).optional()
|
|
3791
3822
|
});
|
|
3792
3823
|
|
|
3793
3824
|
// ../../b4m-core/packages/common/dist/src/schemas/analytics/events/ai.js
|
|
@@ -5010,74 +5041,6 @@ function formatUserList(users) {
|
|
|
5010
5041
|
}
|
|
5011
5042
|
|
|
5012
5043
|
// ../../b4m-core/packages/common/dist/src/jira/api.js
|
|
5013
|
-
function wikiMarkupToAdf(text) {
|
|
5014
|
-
const lines = text.split("\n");
|
|
5015
|
-
const content = [];
|
|
5016
|
-
let currentTableRows = [];
|
|
5017
|
-
let inTable = false;
|
|
5018
|
-
for (const line of lines) {
|
|
5019
|
-
const trimmedLine = line.trim();
|
|
5020
|
-
if (trimmedLine.startsWith("||") && trimmedLine.endsWith("||")) {
|
|
5021
|
-
inTable = true;
|
|
5022
|
-
const cells = trimmedLine.slice(2, -2).split("||").map((cell) => cell.trim());
|
|
5023
|
-
const headerRow = {
|
|
5024
|
-
type: "tableRow",
|
|
5025
|
-
content: cells.map((cell) => ({
|
|
5026
|
-
type: "tableHeader",
|
|
5027
|
-
attrs: {},
|
|
5028
|
-
content: [{ type: "paragraph", content: [{ type: "text", text: cell || " " }] }]
|
|
5029
|
-
}))
|
|
5030
|
-
};
|
|
5031
|
-
currentTableRows.push(headerRow);
|
|
5032
|
-
continue;
|
|
5033
|
-
}
|
|
5034
|
-
if (trimmedLine.startsWith("|") && trimmedLine.endsWith("|") && !trimmedLine.startsWith("||")) {
|
|
5035
|
-
inTable = true;
|
|
5036
|
-
const cells = trimmedLine.slice(1, -1).split("|").map((cell) => cell.trim());
|
|
5037
|
-
const dataRow = {
|
|
5038
|
-
type: "tableRow",
|
|
5039
|
-
content: cells.map((cell) => ({
|
|
5040
|
-
type: "tableCell",
|
|
5041
|
-
attrs: {},
|
|
5042
|
-
content: [{ type: "paragraph", content: [{ type: "text", text: cell || " " }] }]
|
|
5043
|
-
}))
|
|
5044
|
-
};
|
|
5045
|
-
currentTableRows.push(dataRow);
|
|
5046
|
-
continue;
|
|
5047
|
-
}
|
|
5048
|
-
if (inTable && currentTableRows.length > 0) {
|
|
5049
|
-
const table = {
|
|
5050
|
-
type: "table",
|
|
5051
|
-
attrs: { isNumberColumnEnabled: false, layout: "default" },
|
|
5052
|
-
content: currentTableRows
|
|
5053
|
-
};
|
|
5054
|
-
content.push(table);
|
|
5055
|
-
currentTableRows = [];
|
|
5056
|
-
inTable = false;
|
|
5057
|
-
}
|
|
5058
|
-
if (trimmedLine) {
|
|
5059
|
-
content.push({
|
|
5060
|
-
type: "paragraph",
|
|
5061
|
-
content: [{ type: "text", text: trimmedLine }]
|
|
5062
|
-
});
|
|
5063
|
-
}
|
|
5064
|
-
}
|
|
5065
|
-
if (currentTableRows.length > 0) {
|
|
5066
|
-
const table = {
|
|
5067
|
-
type: "table",
|
|
5068
|
-
attrs: { isNumberColumnEnabled: false, layout: "default" },
|
|
5069
|
-
content: currentTableRows
|
|
5070
|
-
};
|
|
5071
|
-
content.push(table);
|
|
5072
|
-
}
|
|
5073
|
-
if (content.length === 0) {
|
|
5074
|
-
content.push({ type: "paragraph", content: [{ type: "text", text: " " }] });
|
|
5075
|
-
}
|
|
5076
|
-
return { type: "doc", version: 1, content };
|
|
5077
|
-
}
|
|
5078
|
-
function containsWikiTable(text) {
|
|
5079
|
-
return /^\|\|.+\|\|$/m.test(text) || /^\|(?!\|).+\|$/m.test(text);
|
|
5080
|
-
}
|
|
5081
5044
|
var JiraApi = class {
|
|
5082
5045
|
config;
|
|
5083
5046
|
constructor(config) {
|
|
@@ -5157,21 +5120,16 @@ var JiraApi = class {
|
|
|
5157
5120
|
...customFields
|
|
5158
5121
|
};
|
|
5159
5122
|
if (description) {
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
content: [{ type: "text", text: description }]
|
|
5171
|
-
}
|
|
5172
|
-
]
|
|
5173
|
-
};
|
|
5174
|
-
}
|
|
5123
|
+
fields.description = {
|
|
5124
|
+
type: "doc",
|
|
5125
|
+
version: 1,
|
|
5126
|
+
content: [
|
|
5127
|
+
{
|
|
5128
|
+
type: "paragraph",
|
|
5129
|
+
content: [{ type: "text", text: description }]
|
|
5130
|
+
}
|
|
5131
|
+
]
|
|
5132
|
+
};
|
|
5175
5133
|
}
|
|
5176
5134
|
if (assignee) {
|
|
5177
5135
|
fields.assignee = { id: assignee };
|
|
@@ -5197,21 +5155,16 @@ var JiraApi = class {
|
|
|
5197
5155
|
fields.summary = summary;
|
|
5198
5156
|
}
|
|
5199
5157
|
if (description) {
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
content: [{ type: "text", text: description }]
|
|
5211
|
-
}
|
|
5212
|
-
]
|
|
5213
|
-
};
|
|
5214
|
-
}
|
|
5158
|
+
fields.description = {
|
|
5159
|
+
type: "doc",
|
|
5160
|
+
version: 1,
|
|
5161
|
+
content: [
|
|
5162
|
+
{
|
|
5163
|
+
type: "paragraph",
|
|
5164
|
+
content: [{ type: "text", text: description }]
|
|
5165
|
+
}
|
|
5166
|
+
]
|
|
5167
|
+
};
|
|
5215
5168
|
}
|
|
5216
5169
|
if (labels) {
|
|
5217
5170
|
fields.labels = labels;
|
|
@@ -5371,21 +5324,16 @@ var JiraApi = class {
|
|
|
5371
5324
|
issuetype: { name: issueTypeName }
|
|
5372
5325
|
};
|
|
5373
5326
|
if (description) {
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
content: [{ type: "text", text: description }]
|
|
5385
|
-
}
|
|
5386
|
-
]
|
|
5387
|
-
};
|
|
5388
|
-
}
|
|
5327
|
+
fields.description = {
|
|
5328
|
+
type: "doc",
|
|
5329
|
+
version: 1,
|
|
5330
|
+
content: [
|
|
5331
|
+
{
|
|
5332
|
+
type: "paragraph",
|
|
5333
|
+
content: [{ type: "text", text: description }]
|
|
5334
|
+
}
|
|
5335
|
+
]
|
|
5336
|
+
};
|
|
5389
5337
|
}
|
|
5390
5338
|
if (assignee) {
|
|
5391
5339
|
fields.assignee = { id: assignee };
|
|
@@ -5510,8 +5458,8 @@ var MCP_PROVIDER_METADATA = {
|
|
|
5510
5458
|
defaultToolDescriptions: {
|
|
5511
5459
|
// Core GitHub tools (must match b4m-core/packages/mcp/src/github/index.ts)
|
|
5512
5460
|
create_issue: "Create a new issue in a GitHub repository. Requires repository owner, repository name, issue title, and optional body, labels, and assignees.",
|
|
5513
|
-
update_issue: "Update an existing GitHub issue. Can modify title, body, state (open/closed), labels, and
|
|
5514
|
-
list_issues:
|
|
5461
|
+
update_issue: "Update an existing GitHub issue. Can modify title, body, state (open/closed), labels, assignees, and issue type (native GitHub issue types like Bug/Feature/Task). Use list_org_issue_types to see available types. Requires repository owner, repository name, and issue number.",
|
|
5462
|
+
list_issues: 'List issues for a GitHub repository with optional filters (state, labels, assignee, type). Can filter by native issue type like "Bug" or "Feature". Returns issue details including title, body, status, and metadata.',
|
|
5515
5463
|
get_issue: "Get detailed information about a specific GitHub issue by number. Returns full issue details including body, comments count, milestone, and timestamps.",
|
|
5516
5464
|
search_code: "Search for code across GitHub repositories using GitHub code search syntax. Returns matching code snippets with file paths, line numbers, and repository information.",
|
|
5517
5465
|
// Repository discovery and management
|
|
@@ -5525,6 +5473,7 @@ var MCP_PROVIDER_METADATA = {
|
|
|
5525
5473
|
// Commit tools
|
|
5526
5474
|
list_commits: "List commit history for a GitHub repository with optional filters (branch, file path, author). Returns commit SHA, message, author, date, and statistics.",
|
|
5527
5475
|
get_commit: "Get detailed information about a specific commit including full message, author, committer, file changes, and diff statistics.",
|
|
5476
|
+
list_org_issue_types: "List available native GitHub issue types for an organization (Bug, Feature, Task, etc.). Use this to discover what issue types can be set on issues in the organization.",
|
|
5528
5477
|
// Legacy tool names (for backwards compatibility)
|
|
5529
5478
|
github_list_repositories: "List GitHub repositories accessible to the connected account.",
|
|
5530
5479
|
github_get_repository: "Fetch detailed information about a specific GitHub repository.",
|
|
@@ -6142,6 +6091,7 @@ export {
|
|
|
6142
6091
|
API_SERVICE_GROUPS,
|
|
6143
6092
|
settingsMap,
|
|
6144
6093
|
StringBooleanSchema,
|
|
6094
|
+
CitableSourceSchema,
|
|
6145
6095
|
PromptMetaZodSchema,
|
|
6146
6096
|
AiEvents,
|
|
6147
6097
|
ApiKeyEvents,
|
|
@@ -6199,8 +6149,6 @@ export {
|
|
|
6199
6149
|
formatUser,
|
|
6200
6150
|
formatTransitionResult,
|
|
6201
6151
|
formatUserList,
|
|
6202
|
-
wikiMarkupToAdf,
|
|
6203
|
-
containsWikiTable,
|
|
6204
6152
|
JiraApi,
|
|
6205
6153
|
getErrorMessage,
|
|
6206
6154
|
getAtlassianConfig,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DNSBC3LO.js";
|
|
6
6
|
import {
|
|
7
7
|
GenericCreditDeductTransaction,
|
|
8
8
|
ImageEditUsageTransaction,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
RealtimeVoiceUsageTransaction,
|
|
11
11
|
TextGenerationUsageTransaction,
|
|
12
12
|
TransferCreditTransaction
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-H6SHASMZ.js";
|
|
14
14
|
|
|
15
15
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
16
16
|
import { z } from "zod";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DNSBC3LO.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H6SHASMZ.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createFabFile,
|
|
4
4
|
createFabFileSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-YXHQN7SK.js";
|
|
6
|
+
import "./chunk-DNSBC3LO.js";
|
|
7
7
|
import "./chunk-AMDXHL6S.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-H6SHASMZ.js";
|
|
9
9
|
import "./chunk-PDX44BCA.js";
|
|
10
10
|
export {
|
|
11
11
|
createFabFile,
|