@bike4mind/cli 0.2.3 → 0.2.4-feat-questmaster-external-integrations.17092
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/dist/{artifactExtractor-GXQ5YZF7.js → artifactExtractor-4IM3MJQF.js} +1 -1
- package/dist/{chunk-LYNNVNEC.js → chunk-2IW5ZJXR.js} +1 -1
- package/dist/{chunk-6AJODFPC.js → chunk-3BPXGCV5.js} +2 -2
- package/dist/{chunk-LEG2UM5Q.js → chunk-7OJVF5WR.js} +2 -2
- package/dist/chunk-AMDXHL6S.js +0 -0
- package/dist/chunk-BDQBOLYG.js +0 -0
- package/dist/chunk-BPFEGDC7.js +0 -0
- package/dist/chunk-PDX44BCA.js +0 -0
- package/dist/{chunk-WR6YZRQV.js → chunk-PVLFZFW3.js} +0 -0
- package/dist/{chunk-WNBKV4FX.js → chunk-UHTQGQB4.js} +2 -2
- package/dist/{create-LOAAI36O.js → create-RWWL6EXD.js} +3 -3
- package/dist/formatConverter-I7EIUVDY.js +0 -0
- package/dist/index.js +535 -141
- package/dist/{llmMarkdownGenerator-4ZR3FLEQ.js → llmMarkdownGenerator-7UGLXJ5K.js} +1 -1
- package/dist/{markdownGenerator-7WE7WKME.js → markdownGenerator-CPWWVGPS.js} +1 -1
- package/dist/{mementoService-XGFAWC5F.js → mementoService-QMM4Y5VF.js} +3 -3
- package/dist/notificationDeduplicator-UW7D75QS.js +0 -0
- package/dist/{src-6J6LFPZ6.js → src-EUJME44O.js} +1 -1
- package/dist/{src-32Z2VZMC.js → src-GX3IH4MQ.js} +2 -2
- package/dist/{subtractCredits-VMGWNJS7.js → subtractCredits-V7WHQTMA.js} +3 -3
- package/dist/utils-JPMDGUBL.js +0 -0
- package/package.json +18 -16
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
dayjsConfig_default,
|
|
17
17
|
extractSnippetMeta,
|
|
18
18
|
settingsMap
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PVLFZFW3.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";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2IW5ZJXR.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PVLFZFW3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2IW5ZJXR.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-PVLFZFW3.js";
|
|
14
14
|
|
|
15
15
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
16
16
|
import { z } from "zod";
|
package/dist/chunk-AMDXHL6S.js
CHANGED
|
File without changes
|
package/dist/chunk-BDQBOLYG.js
CHANGED
|
File without changes
|
package/dist/chunk-BPFEGDC7.js
CHANGED
|
File without changes
|
package/dist/chunk-PDX44BCA.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2IW5ZJXR.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PVLFZFW3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.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-3BPXGCV5.js";
|
|
6
|
+
import "./chunk-2IW5ZJXR.js";
|
|
7
7
|
import "./chunk-AMDXHL6S.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-PVLFZFW3.js";
|
|
9
9
|
import "./chunk-PDX44BCA.js";
|
|
10
10
|
export {
|
|
11
11
|
createFabFile,
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getEffectiveApiKey,
|
|
5
5
|
getOpenWeatherKey,
|
|
6
6
|
getSerperKey
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-UHTQGQB4.js";
|
|
8
|
+
import "./chunk-7OJVF5WR.js";
|
|
9
|
+
import "./chunk-3BPXGCV5.js";
|
|
10
10
|
import {
|
|
11
11
|
BFLImageService,
|
|
12
12
|
BaseStorage,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
OpenAIBackend,
|
|
16
16
|
OpenAIImageService,
|
|
17
17
|
XAIImageService
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2IW5ZJXR.js";
|
|
19
19
|
import {
|
|
20
20
|
Logger
|
|
21
21
|
} from "./chunk-AMDXHL6S.js";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
XAI_IMAGE_MODELS,
|
|
74
74
|
b4mLLMTools,
|
|
75
75
|
getMcpProviderMetadata
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-PVLFZFW3.js";
|
|
77
77
|
import {
|
|
78
78
|
__require
|
|
79
79
|
} from "./chunk-PDX44BCA.js";
|
|
@@ -90,8 +90,10 @@ import { Box as Box9, Text as Text8, Static } from "ink";
|
|
|
90
90
|
// src/components/StatusBar.tsx
|
|
91
91
|
import React from "react";
|
|
92
92
|
import { Box, Text } from "ink";
|
|
93
|
-
var StatusBar = React.memo(function StatusBar2({ sessionName, model, tokenUsage }) {
|
|
94
|
-
|
|
93
|
+
var StatusBar = React.memo(function StatusBar2({ sessionName, model, tokenUsage, quest }) {
|
|
94
|
+
const questDisplay = quest ? `${quest.questTitle || quest.questPlanName} (${quest.progress.completed}/${quest.progress.total})` : null;
|
|
95
|
+
const syncIndicator = quest?.syncStatus === "offline" ? " \u26A0\uFE0F" : quest?.syncStatus === "pending" ? " \u23F3" : "";
|
|
96
|
+
return /* @__PURE__ */ React.createElement(Box, { borderStyle: "single", borderColor: "green", paddingX: 1 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row", justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React.createElement(Box, { gap: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "green", bold: true }, "\u{1F4DD} Session:"), /* @__PURE__ */ React.createElement(Text, null, sessionName)), /* @__PURE__ */ React.createElement(Box, { gap: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "blue", bold: true }, "\u{1F916} Model:"), /* @__PURE__ */ React.createElement(Text, null, model)), /* @__PURE__ */ React.createElement(Box, { gap: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "yellow", bold: true }, "\u{1F4CA} Tokens:"), /* @__PURE__ */ React.createElement(Text, null, tokenUsage.toLocaleString())), questDisplay && /* @__PURE__ */ React.createElement(Box, { gap: 2 }, /* @__PURE__ */ React.createElement(Text, { color: "magenta", bold: true }, "\u{1F3AF} Quest:"), /* @__PURE__ */ React.createElement(Text, null, questDisplay, syncIndicator))));
|
|
95
97
|
});
|
|
96
98
|
|
|
97
99
|
// src/components/InputPrompt.tsx
|
|
@@ -389,6 +391,25 @@ var COMMANDS = [
|
|
|
389
391
|
name: "clear",
|
|
390
392
|
description: "Start a new session",
|
|
391
393
|
aliases: ["new"]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "quest",
|
|
397
|
+
description: "Load a quest into current session",
|
|
398
|
+
args: "<quest-id>",
|
|
399
|
+
aliases: ["q"]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "quest-status",
|
|
403
|
+
description: "Show current quest progress",
|
|
404
|
+
aliases: ["qs"]
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: "quest-unlink",
|
|
408
|
+
description: "Unlink quest from current session"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: "plan",
|
|
412
|
+
description: "Create a QuestMaster plan from current context"
|
|
392
413
|
}
|
|
393
414
|
];
|
|
394
415
|
|
|
@@ -998,6 +1019,7 @@ function App({
|
|
|
998
1019
|
const sessionName = useCliStore((state) => state.session?.name || "New Session");
|
|
999
1020
|
const currentModel = useCliStore((state) => state.session?.model || "claude-sonnet-4-5-20250929");
|
|
1000
1021
|
const totalTokens = useCliStore((state) => state.session?.metadata.totalTokens || 0);
|
|
1022
|
+
const quest = useCliStore((state) => state.session?.quest);
|
|
1001
1023
|
const isThinking = useCliStore((state) => state.isThinking);
|
|
1002
1024
|
const permissionPrompt = useCliStore((state) => state.permissionPrompt);
|
|
1003
1025
|
const showConfigEditor = useCliStore((state) => state.showConfigEditor);
|
|
@@ -1033,7 +1055,7 @@ ${errorBlock}`;
|
|
|
1033
1055
|
},
|
|
1034
1056
|
[onMessage, onCommand, setIsThinking]
|
|
1035
1057
|
);
|
|
1036
|
-
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column" }, /* @__PURE__ */ React9.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens }), showConfigEditor && config && onSaveConfig ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(ConfigEditor, { config, onSave: onSaveConfig, onClose: () => setShowConfigEditor(false) })) : permissionPrompt ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(
|
|
1058
|
+
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column" }, /* @__PURE__ */ React9.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens, quest }), showConfigEditor && config && onSaveConfig ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(ConfigEditor, { config, onSave: onSaveConfig, onClose: () => setShowConfigEditor(false) })) : permissionPrompt ? /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React9.createElement(
|
|
1037
1059
|
PermissionPrompt,
|
|
1038
1060
|
{
|
|
1039
1061
|
toolName: permissionPrompt.toolName,
|
|
@@ -4094,6 +4116,16 @@ var updateQuestStatusSchema = z134.object({
|
|
|
4094
4116
|
completionNote: z134.string().max(500).optional()
|
|
4095
4117
|
});
|
|
4096
4118
|
|
|
4119
|
+
// ../../b4m-core/packages/services/dist/src/questMasterService/syncToGitHub.js
|
|
4120
|
+
import { z as z135 } from "zod";
|
|
4121
|
+
var syncToGitHubSchema = z135.object({
|
|
4122
|
+
repository: z135.string().regex(/^[^/]+\/[^/]+$/, "Repository must be in owner/repo format"),
|
|
4123
|
+
questId: z135.string().optional(),
|
|
4124
|
+
// Optional: sync specific quest, otherwise sync entire plan
|
|
4125
|
+
labels: z135.array(z135.string()).optional(),
|
|
4126
|
+
assignees: z135.array(z135.string()).optional()
|
|
4127
|
+
});
|
|
4128
|
+
|
|
4097
4129
|
// ../../b4m-core/packages/services/dist/src/dataLakeService/opensearchClient.js
|
|
4098
4130
|
import { Client } from "@opensearch-project/opensearch";
|
|
4099
4131
|
import { defaultProvider } from "@aws-sdk/credential-provider-node";
|
|
@@ -4111,63 +4143,63 @@ import { v4 as uuidv44 } from "uuid";
|
|
|
4111
4143
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
4112
4144
|
|
|
4113
4145
|
// ../../b4m-core/packages/services/dist/src/emailIngestionService/types.js
|
|
4114
|
-
import { z as
|
|
4115
|
-
var processIngestedEmailOptionsSchema =
|
|
4116
|
-
platformDomain:
|
|
4117
|
-
isNewsletter:
|
|
4146
|
+
import { z as z136 } from "zod";
|
|
4147
|
+
var processIngestedEmailOptionsSchema = z136.object({
|
|
4148
|
+
platformDomain: z136.string().optional(),
|
|
4149
|
+
isNewsletter: z136.boolean().optional()
|
|
4118
4150
|
}).optional();
|
|
4119
|
-
var emailAttachmentSchema =
|
|
4120
|
-
filename:
|
|
4121
|
-
contentType:
|
|
4122
|
-
contentDisposition:
|
|
4123
|
-
size:
|
|
4124
|
-
content:
|
|
4125
|
-
related:
|
|
4126
|
-
});
|
|
4127
|
-
var parsedEmailObjectSchema =
|
|
4128
|
-
messageId:
|
|
4129
|
-
inReplyTo:
|
|
4130
|
-
references:
|
|
4131
|
-
from:
|
|
4151
|
+
var emailAttachmentSchema = z136.object({
|
|
4152
|
+
filename: z136.string().optional(),
|
|
4153
|
+
contentType: z136.string().optional(),
|
|
4154
|
+
contentDisposition: z136.string().optional(),
|
|
4155
|
+
size: z136.number().min(0),
|
|
4156
|
+
content: z136.instanceof(Buffer),
|
|
4157
|
+
related: z136.boolean().optional()
|
|
4158
|
+
});
|
|
4159
|
+
var parsedEmailObjectSchema = z136.object({
|
|
4160
|
+
messageId: z136.string().optional(),
|
|
4161
|
+
inReplyTo: z136.string().optional(),
|
|
4162
|
+
references: z136.union([z136.string(), z136.array(z136.string())]).optional(),
|
|
4163
|
+
from: z136.any().optional(),
|
|
4132
4164
|
// Complex email address object
|
|
4133
|
-
to:
|
|
4134
|
-
cc:
|
|
4135
|
-
bcc:
|
|
4136
|
-
subject:
|
|
4137
|
-
date:
|
|
4138
|
-
text:
|
|
4139
|
-
html:
|
|
4140
|
-
attachments:
|
|
4141
|
-
});
|
|
4142
|
-
var processIngestedEmailSchema =
|
|
4165
|
+
to: z136.any().optional(),
|
|
4166
|
+
cc: z136.any().optional(),
|
|
4167
|
+
bcc: z136.any().optional(),
|
|
4168
|
+
subject: z136.string().optional(),
|
|
4169
|
+
date: z136.date().optional(),
|
|
4170
|
+
text: z136.string().optional(),
|
|
4171
|
+
html: z136.string().optional(),
|
|
4172
|
+
attachments: z136.array(emailAttachmentSchema).optional()
|
|
4173
|
+
});
|
|
4174
|
+
var processIngestedEmailSchema = z136.object({
|
|
4143
4175
|
parsedEmail: parsedEmailObjectSchema,
|
|
4144
|
-
rawEmailS3Key:
|
|
4176
|
+
rawEmailS3Key: z136.string().min(1, "rawEmailS3Key cannot be empty"),
|
|
4145
4177
|
options: processIngestedEmailOptionsSchema
|
|
4146
4178
|
});
|
|
4147
4179
|
|
|
4148
4180
|
// ../../b4m-core/packages/services/dist/src/emailAnalysisService/types.js
|
|
4149
|
-
import { z as
|
|
4150
|
-
var llmAnalysisResponseSchema =
|
|
4151
|
-
summary:
|
|
4152
|
-
entities:
|
|
4153
|
-
companies:
|
|
4154
|
-
people:
|
|
4155
|
-
products:
|
|
4156
|
-
technologies:
|
|
4181
|
+
import { z as z137 } from "zod";
|
|
4182
|
+
var llmAnalysisResponseSchema = z137.object({
|
|
4183
|
+
summary: z137.string().min(1, "Summary cannot be empty"),
|
|
4184
|
+
entities: z137.object({
|
|
4185
|
+
companies: z137.array(z137.string()).default([]),
|
|
4186
|
+
people: z137.array(z137.string()).default([]),
|
|
4187
|
+
products: z137.array(z137.string()).default([]),
|
|
4188
|
+
technologies: z137.array(z137.string()).default([])
|
|
4157
4189
|
}),
|
|
4158
|
-
sentiment:
|
|
4159
|
-
actionItems:
|
|
4160
|
-
description:
|
|
4161
|
-
deadline:
|
|
4190
|
+
sentiment: z137.enum(["positive", "neutral", "negative", "urgent"]),
|
|
4191
|
+
actionItems: z137.array(z137.object({
|
|
4192
|
+
description: z137.string(),
|
|
4193
|
+
deadline: z137.string().optional()
|
|
4162
4194
|
// ISO date string from LLM
|
|
4163
4195
|
})).default([]),
|
|
4164
|
-
privacyRecommendation:
|
|
4165
|
-
embargoDetected:
|
|
4166
|
-
suggestedTags:
|
|
4196
|
+
privacyRecommendation: z137.enum(["public", "team", "private"]),
|
|
4197
|
+
embargoDetected: z137.boolean().default(false),
|
|
4198
|
+
suggestedTags: z137.array(z137.string()).default([])
|
|
4167
4199
|
});
|
|
4168
4200
|
|
|
4169
4201
|
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletion.js
|
|
4170
|
-
import { z as
|
|
4202
|
+
import { z as z139 } from "zod";
|
|
4171
4203
|
|
|
4172
4204
|
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionInvoke.js
|
|
4173
4205
|
import { fromZodError } from "zod-validation-error";
|
|
@@ -5227,17 +5259,17 @@ var rechartsTool = {
|
|
|
5227
5259
|
};
|
|
5228
5260
|
|
|
5229
5261
|
// ../../b4m-core/packages/services/dist/src/llm/tools/implementation/editFile/index.js
|
|
5230
|
-
import { z as
|
|
5262
|
+
import { z as z138 } from "zod";
|
|
5231
5263
|
import { diffLines as diffLines2 } from "diff";
|
|
5232
|
-
var editFileSchema =
|
|
5233
|
-
fileId:
|
|
5234
|
-
instruction:
|
|
5235
|
-
selection:
|
|
5236
|
-
start:
|
|
5237
|
-
end:
|
|
5264
|
+
var editFileSchema = z138.object({
|
|
5265
|
+
fileId: z138.string().describe("The ID of the file to edit"),
|
|
5266
|
+
instruction: z138.string().describe("Natural language instruction describing the changes to make"),
|
|
5267
|
+
selection: z138.object({
|
|
5268
|
+
start: z138.number().describe("Starting character position of the selection"),
|
|
5269
|
+
end: z138.number().describe("Ending character position of the selection")
|
|
5238
5270
|
}).optional().describe("Optional selection range to edit within the file"),
|
|
5239
|
-
preserveFormatting:
|
|
5240
|
-
returnDiff:
|
|
5271
|
+
preserveFormatting: z138.boolean().optional().default(true).describe("Whether to preserve the original formatting style"),
|
|
5272
|
+
returnDiff: z138.boolean().optional().default(true).describe("Whether to return a diff of the changes")
|
|
5241
5273
|
});
|
|
5242
5274
|
function generateSimpleDiff(original, modified) {
|
|
5243
5275
|
const differences = diffLines2(original, modified);
|
|
@@ -6996,8 +7028,8 @@ var getHeliocentricCoords = (planet, T) => {
|
|
|
6996
7028
|
const sinNode = Math.sin(longNode);
|
|
6997
7029
|
const x = r * (cosNode * cosOmega - sinNode * sinOmega * cosI);
|
|
6998
7030
|
const y = r * (sinNode * cosOmega + cosNode * sinOmega * cosI);
|
|
6999
|
-
const
|
|
7000
|
-
return { x, y, z:
|
|
7031
|
+
const z145 = r * sinOmega * sinI;
|
|
7032
|
+
return { x, y, z: z145, r };
|
|
7001
7033
|
};
|
|
7002
7034
|
var getGeocentricEcliptic = (planet, earth) => {
|
|
7003
7035
|
const dx = planet.x - earth.x;
|
|
@@ -8022,42 +8054,42 @@ var DISABLE_SERVER_THROTTLING = process.env.DISABLE_SERVER_THROTTLING === "true"
|
|
|
8022
8054
|
var questSaveMutex = new Mutex();
|
|
8023
8055
|
|
|
8024
8056
|
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletion.js
|
|
8025
|
-
var QuestStartBodySchema =
|
|
8026
|
-
userId:
|
|
8027
|
-
sessionId:
|
|
8028
|
-
questId:
|
|
8029
|
-
message:
|
|
8030
|
-
messageFileIds:
|
|
8031
|
-
historyCount:
|
|
8032
|
-
fabFileIds:
|
|
8057
|
+
var QuestStartBodySchema = z139.object({
|
|
8058
|
+
userId: z139.string(),
|
|
8059
|
+
sessionId: z139.string(),
|
|
8060
|
+
questId: z139.string(),
|
|
8061
|
+
message: z139.string(),
|
|
8062
|
+
messageFileIds: z139.array(z139.string()),
|
|
8063
|
+
historyCount: z139.number(),
|
|
8064
|
+
fabFileIds: z139.array(z139.string()),
|
|
8033
8065
|
params: ChatCompletionCreateInputSchema,
|
|
8034
8066
|
dashboardParams: DashboardParamsSchema.optional(),
|
|
8035
|
-
enableQuestMaster:
|
|
8036
|
-
enableMementos:
|
|
8037
|
-
enableArtifacts:
|
|
8038
|
-
enableAgents:
|
|
8067
|
+
enableQuestMaster: z139.boolean().optional(),
|
|
8068
|
+
enableMementos: z139.boolean().optional(),
|
|
8069
|
+
enableArtifacts: z139.boolean().optional(),
|
|
8070
|
+
enableAgents: z139.boolean().optional(),
|
|
8039
8071
|
promptMeta: PromptMetaZodSchema,
|
|
8040
|
-
tools:
|
|
8041
|
-
mcpServers:
|
|
8042
|
-
projectId:
|
|
8043
|
-
organizationId:
|
|
8072
|
+
tools: z139.array(z139.union([b4mLLMTools, z139.string()])).optional(),
|
|
8073
|
+
mcpServers: z139.array(z139.string()).optional(),
|
|
8074
|
+
projectId: z139.string().optional(),
|
|
8075
|
+
organizationId: z139.string().nullable().optional(),
|
|
8044
8076
|
questMaster: QuestMasterParamsSchema.optional(),
|
|
8045
|
-
toolPromptId:
|
|
8077
|
+
toolPromptId: z139.string().optional(),
|
|
8046
8078
|
researchMode: ResearchModeParamsSchema.optional(),
|
|
8047
|
-
fallbackModel:
|
|
8048
|
-
embeddingModel:
|
|
8049
|
-
queryComplexity:
|
|
8079
|
+
fallbackModel: z139.string().optional(),
|
|
8080
|
+
embeddingModel: z139.string().optional(),
|
|
8081
|
+
queryComplexity: z139.string(),
|
|
8050
8082
|
imageConfig: GenerateImageToolCallSchema.optional(),
|
|
8051
|
-
deepResearchConfig:
|
|
8052
|
-
maxDepth:
|
|
8053
|
-
duration:
|
|
8083
|
+
deepResearchConfig: z139.object({
|
|
8084
|
+
maxDepth: z139.number().optional(),
|
|
8085
|
+
duration: z139.number().optional(),
|
|
8054
8086
|
// Note: searchers are passed via ToolContext and not through this API schema
|
|
8055
|
-
searchers:
|
|
8087
|
+
searchers: z139.array(z139.any()).optional()
|
|
8056
8088
|
}).optional(),
|
|
8057
|
-
extraContextMessages:
|
|
8058
|
-
role:
|
|
8059
|
-
content:
|
|
8060
|
-
fabFileIds:
|
|
8089
|
+
extraContextMessages: z139.array(z139.object({
|
|
8090
|
+
role: z139.enum(["user", "assistant", "system", "function", "tool"]),
|
|
8091
|
+
content: z139.union([z139.string(), z139.array(z139.any())]),
|
|
8092
|
+
fabFileIds: z139.array(z139.string()).optional()
|
|
8061
8093
|
})).optional()
|
|
8062
8094
|
});
|
|
8063
8095
|
|
|
@@ -8065,30 +8097,9 @@ var QuestStartBodySchema = z138.object({
|
|
|
8065
8097
|
import axios8 from "axios";
|
|
8066
8098
|
import { fileTypeFromBuffer as fileTypeFromBuffer4 } from "file-type";
|
|
8067
8099
|
import { v4 as uuidv47 } from "uuid";
|
|
8068
|
-
import { z as
|
|
8100
|
+
import { z as z140 } from "zod";
|
|
8069
8101
|
import { fromZodError as fromZodError2 } from "zod-validation-error";
|
|
8070
8102
|
var ImageGenerationBodySchema = OpenAIImageGenerationInput.extend({
|
|
8071
|
-
sessionId: z139.string(),
|
|
8072
|
-
questId: z139.string(),
|
|
8073
|
-
userId: z139.string(),
|
|
8074
|
-
prompt: z139.string(),
|
|
8075
|
-
safety_tolerance: z139.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
|
|
8076
|
-
prompt_upsampling: z139.boolean().optional().default(false),
|
|
8077
|
-
seed: z139.number().nullable().optional(),
|
|
8078
|
-
output_format: z139.enum(["jpeg", "png"]).nullable().optional().default("png"),
|
|
8079
|
-
width: z139.number().optional(),
|
|
8080
|
-
height: z139.number().optional(),
|
|
8081
|
-
aspect_ratio: z139.string().optional(),
|
|
8082
|
-
fabFileIds: z139.array(z139.string()).optional()
|
|
8083
|
-
});
|
|
8084
|
-
|
|
8085
|
-
// ../../b4m-core/packages/services/dist/src/llm/ImageEdit.js
|
|
8086
|
-
import axios9 from "axios";
|
|
8087
|
-
import { fileTypeFromBuffer as fileTypeFromBuffer5 } from "file-type";
|
|
8088
|
-
import { v4 as uuidv48 } from "uuid";
|
|
8089
|
-
import { z as z140 } from "zod";
|
|
8090
|
-
import { fromZodError as fromZodError3 } from "zod-validation-error";
|
|
8091
|
-
var ImageEditBodySchema = OpenAIImageGenerationInput.extend({
|
|
8092
8103
|
sessionId: z140.string(),
|
|
8093
8104
|
questId: z140.string(),
|
|
8094
8105
|
userId: z140.string(),
|
|
@@ -8096,35 +8107,56 @@ var ImageEditBodySchema = OpenAIImageGenerationInput.extend({
|
|
|
8096
8107
|
safety_tolerance: z140.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
|
|
8097
8108
|
prompt_upsampling: z140.boolean().optional().default(false),
|
|
8098
8109
|
seed: z140.number().nullable().optional(),
|
|
8099
|
-
output_format: z140.enum(["jpeg", "png"]).optional().default("png"),
|
|
8110
|
+
output_format: z140.enum(["jpeg", "png"]).nullable().optional().default("png"),
|
|
8100
8111
|
width: z140.number().optional(),
|
|
8101
8112
|
height: z140.number().optional(),
|
|
8102
8113
|
aspect_ratio: z140.string().optional(),
|
|
8103
|
-
|
|
8104
|
-
fabFileIds: z140.array(z140.string()).optional(),
|
|
8105
|
-
image: z140.string()
|
|
8114
|
+
fabFileIds: z140.array(z140.string()).optional()
|
|
8106
8115
|
});
|
|
8107
8116
|
|
|
8108
|
-
// ../../b4m-core/packages/services/dist/src/llm/
|
|
8117
|
+
// ../../b4m-core/packages/services/dist/src/llm/ImageEdit.js
|
|
8118
|
+
import axios9 from "axios";
|
|
8119
|
+
import { fileTypeFromBuffer as fileTypeFromBuffer5 } from "file-type";
|
|
8120
|
+
import { v4 as uuidv48 } from "uuid";
|
|
8109
8121
|
import { z as z141 } from "zod";
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8122
|
+
import { fromZodError as fromZodError3 } from "zod-validation-error";
|
|
8123
|
+
var ImageEditBodySchema = OpenAIImageGenerationInput.extend({
|
|
8124
|
+
sessionId: z141.string(),
|
|
8125
|
+
questId: z141.string(),
|
|
8126
|
+
userId: z141.string(),
|
|
8127
|
+
prompt: z141.string(),
|
|
8128
|
+
safety_tolerance: z141.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
|
|
8129
|
+
prompt_upsampling: z141.boolean().optional().default(false),
|
|
8130
|
+
seed: z141.number().nullable().optional(),
|
|
8131
|
+
output_format: z141.enum(["jpeg", "png"]).optional().default("png"),
|
|
8132
|
+
width: z141.number().optional(),
|
|
8133
|
+
height: z141.number().optional(),
|
|
8134
|
+
aspect_ratio: z141.string().optional(),
|
|
8135
|
+
size: z141.string().optional(),
|
|
8136
|
+
fabFileIds: z141.array(z141.string()).optional(),
|
|
8137
|
+
image: z141.string()
|
|
8138
|
+
});
|
|
8139
|
+
|
|
8140
|
+
// ../../b4m-core/packages/services/dist/src/llm/refineText.js
|
|
8141
|
+
import { z as z142 } from "zod";
|
|
8142
|
+
var refineTextLLMSchema = z142.object({
|
|
8143
|
+
text: z142.string(),
|
|
8144
|
+
context: z142.string().optional()
|
|
8113
8145
|
// tone: z.enum(['formal', 'informal', 'neutral']).optional(),
|
|
8114
8146
|
// style: z.enum(['technical', 'creative', 'academic', 'business', 'narrative']).optional(),
|
|
8115
8147
|
});
|
|
8116
8148
|
|
|
8117
8149
|
// ../../b4m-core/packages/services/dist/src/llm/MementoEvaluationService.js
|
|
8118
|
-
import { z as
|
|
8119
|
-
var SingleMementoEvalSchema =
|
|
8120
|
-
importance:
|
|
8150
|
+
import { z as z143 } from "zod";
|
|
8151
|
+
var SingleMementoEvalSchema = z143.object({
|
|
8152
|
+
importance: z143.number().min(1).max(10),
|
|
8121
8153
|
// 1-10 scale for personal info importance
|
|
8122
|
-
summary:
|
|
8123
|
-
tags:
|
|
8154
|
+
summary: z143.string(),
|
|
8155
|
+
tags: z143.array(z143.string()).optional()
|
|
8124
8156
|
});
|
|
8125
|
-
var MementoEvalResponseSchema =
|
|
8126
|
-
isPersonal:
|
|
8127
|
-
mementos:
|
|
8157
|
+
var MementoEvalResponseSchema = z143.object({
|
|
8158
|
+
isPersonal: z143.boolean(),
|
|
8159
|
+
mementos: z143.array(SingleMementoEvalSchema).optional()
|
|
8128
8160
|
// Array of distinct personal information
|
|
8129
8161
|
});
|
|
8130
8162
|
|
|
@@ -8361,8 +8393,8 @@ function generateCliTools(userId, llm, model, permissionManager, showPermissionP
|
|
|
8361
8393
|
}
|
|
8362
8394
|
|
|
8363
8395
|
// src/config/toolSafety.ts
|
|
8364
|
-
import { z as
|
|
8365
|
-
var ToolCategorySchema =
|
|
8396
|
+
import { z as z144 } from "zod";
|
|
8397
|
+
var ToolCategorySchema = z144.enum([
|
|
8366
8398
|
"auto_approve",
|
|
8367
8399
|
// Safe tools that run automatically without permission
|
|
8368
8400
|
"prompt_always",
|
|
@@ -8370,9 +8402,9 @@ var ToolCategorySchema = z143.enum([
|
|
|
8370
8402
|
"prompt_default"
|
|
8371
8403
|
// Tools that prompt by default but can be trusted
|
|
8372
8404
|
]);
|
|
8373
|
-
var ToolSafetyConfigSchema =
|
|
8374
|
-
categories:
|
|
8375
|
-
trustedTools:
|
|
8405
|
+
var ToolSafetyConfigSchema = z144.object({
|
|
8406
|
+
categories: z144.record(z144.string(), ToolCategorySchema),
|
|
8407
|
+
trustedTools: z144.array(z144.string())
|
|
8376
8408
|
});
|
|
8377
8409
|
var DEFAULT_TOOL_CATEGORIES = {
|
|
8378
8410
|
// ===== AUTO APPROVE (Safe tools) =====
|
|
@@ -9016,6 +9048,197 @@ var McpManager = class {
|
|
|
9016
9048
|
}
|
|
9017
9049
|
};
|
|
9018
9050
|
|
|
9051
|
+
// src/utils/QuestTracker.ts
|
|
9052
|
+
var QuestTracker = class {
|
|
9053
|
+
constructor(apiClient) {
|
|
9054
|
+
this.apiClient = apiClient;
|
|
9055
|
+
this.pendingUpdates = [];
|
|
9056
|
+
this.cachedQuests = /* @__PURE__ */ new Map();
|
|
9057
|
+
}
|
|
9058
|
+
/**
|
|
9059
|
+
* Fetch a quest plan from the API
|
|
9060
|
+
*/
|
|
9061
|
+
async fetchQuestPlan(questPlanId) {
|
|
9062
|
+
try {
|
|
9063
|
+
const response = await this.apiClient.get(
|
|
9064
|
+
`/api/quest-plans/${questPlanId}`
|
|
9065
|
+
);
|
|
9066
|
+
if (response.success && response.questPlan) {
|
|
9067
|
+
this.cachedQuests.set(questPlanId, response.questPlan);
|
|
9068
|
+
return response.questPlan;
|
|
9069
|
+
}
|
|
9070
|
+
return null;
|
|
9071
|
+
} catch (error) {
|
|
9072
|
+
const cached = this.cachedQuests.get(questPlanId);
|
|
9073
|
+
if (cached) {
|
|
9074
|
+
console.log("\u26A0\uFE0F Using cached quest data (offline mode)");
|
|
9075
|
+
return cached;
|
|
9076
|
+
}
|
|
9077
|
+
throw error;
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
/**
|
|
9081
|
+
* Create a SessionQuestLink from quest plan data
|
|
9082
|
+
*/
|
|
9083
|
+
createQuestLink(questPlan, questId) {
|
|
9084
|
+
const quest = questId ? questPlan.quests.find((q) => q.id === questId) : null;
|
|
9085
|
+
let total = 0;
|
|
9086
|
+
let completed = 0;
|
|
9087
|
+
if (quest) {
|
|
9088
|
+
total = quest.subQuests.length || 1;
|
|
9089
|
+
completed = quest.subQuests.filter((sq) => sq.status === "completed").length;
|
|
9090
|
+
if (quest.subQuests.length === 0 && quest.status === "completed") {
|
|
9091
|
+
completed = 1;
|
|
9092
|
+
}
|
|
9093
|
+
} else {
|
|
9094
|
+
total = questPlan.quests.length;
|
|
9095
|
+
completed = questPlan.quests.filter((q) => q.status === "completed").length;
|
|
9096
|
+
}
|
|
9097
|
+
return {
|
|
9098
|
+
questPlanId: questPlan.id,
|
|
9099
|
+
questPlanName: questPlan.goal.length > 40 ? questPlan.goal.substring(0, 37) + "..." : questPlan.goal,
|
|
9100
|
+
questId,
|
|
9101
|
+
questTitle: quest?.title,
|
|
9102
|
+
linkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9103
|
+
progress: { total, completed },
|
|
9104
|
+
syncStatus: "synced",
|
|
9105
|
+
lastSyncedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
9106
|
+
};
|
|
9107
|
+
}
|
|
9108
|
+
/**
|
|
9109
|
+
* Update quest status (queues for sync if offline)
|
|
9110
|
+
*/
|
|
9111
|
+
async updateQuestStatus(questPlanId, status, questId, subQuestId) {
|
|
9112
|
+
const update3 = {
|
|
9113
|
+
questPlanId,
|
|
9114
|
+
questId,
|
|
9115
|
+
subQuestId,
|
|
9116
|
+
newStatus: status,
|
|
9117
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
9118
|
+
};
|
|
9119
|
+
try {
|
|
9120
|
+
await this.syncUpdate(update3);
|
|
9121
|
+
return true;
|
|
9122
|
+
} catch (error) {
|
|
9123
|
+
this.pendingUpdates.push(update3);
|
|
9124
|
+
console.log("\u26A0\uFE0F Update queued for sync when online");
|
|
9125
|
+
return false;
|
|
9126
|
+
}
|
|
9127
|
+
}
|
|
9128
|
+
/**
|
|
9129
|
+
* Sync a single update to the server
|
|
9130
|
+
*/
|
|
9131
|
+
async syncUpdate(update3) {
|
|
9132
|
+
const endpoint = update3.subQuestId ? `/api/quest-plans/${update3.questPlanId}/quests/${update3.questId}/sub-quests/${update3.subQuestId}/status` : update3.questId ? `/api/quest-plans/${update3.questPlanId}/quests/${update3.questId}/status` : `/api/quest-plans/${update3.questPlanId}/status`;
|
|
9133
|
+
await this.apiClient.put(endpoint, { status: update3.newStatus });
|
|
9134
|
+
}
|
|
9135
|
+
/**
|
|
9136
|
+
* Sync all pending updates
|
|
9137
|
+
*/
|
|
9138
|
+
async syncPendingUpdates() {
|
|
9139
|
+
let synced = 0;
|
|
9140
|
+
let failed = 0;
|
|
9141
|
+
const remaining = [];
|
|
9142
|
+
for (const update3 of this.pendingUpdates) {
|
|
9143
|
+
try {
|
|
9144
|
+
await this.syncUpdate(update3);
|
|
9145
|
+
synced++;
|
|
9146
|
+
} catch {
|
|
9147
|
+
remaining.push(update3);
|
|
9148
|
+
failed++;
|
|
9149
|
+
}
|
|
9150
|
+
}
|
|
9151
|
+
this.pendingUpdates = remaining;
|
|
9152
|
+
return { synced, failed };
|
|
9153
|
+
}
|
|
9154
|
+
/**
|
|
9155
|
+
* Get pending update count
|
|
9156
|
+
*/
|
|
9157
|
+
getPendingCount() {
|
|
9158
|
+
return this.pendingUpdates.length;
|
|
9159
|
+
}
|
|
9160
|
+
/**
|
|
9161
|
+
* Check if there are pending updates
|
|
9162
|
+
*/
|
|
9163
|
+
hasPendingUpdates() {
|
|
9164
|
+
return this.pendingUpdates.length > 0;
|
|
9165
|
+
}
|
|
9166
|
+
/**
|
|
9167
|
+
* Update progress in a SessionQuestLink
|
|
9168
|
+
*/
|
|
9169
|
+
updateProgress(link, questPlan) {
|
|
9170
|
+
const quest = link.questId ? questPlan.quests.find((q) => q.id === link.questId) : null;
|
|
9171
|
+
let total = 0;
|
|
9172
|
+
let completed = 0;
|
|
9173
|
+
if (quest) {
|
|
9174
|
+
total = quest.subQuests.length || 1;
|
|
9175
|
+
completed = quest.subQuests.filter((sq) => sq.status === "completed").length;
|
|
9176
|
+
if (quest.subQuests.length === 0 && quest.status === "completed") {
|
|
9177
|
+
completed = 1;
|
|
9178
|
+
}
|
|
9179
|
+
} else {
|
|
9180
|
+
total = questPlan.quests.length;
|
|
9181
|
+
completed = questPlan.quests.filter((q) => q.status === "completed").length;
|
|
9182
|
+
}
|
|
9183
|
+
return {
|
|
9184
|
+
...link,
|
|
9185
|
+
progress: { total, completed },
|
|
9186
|
+
syncStatus: this.hasPendingUpdates() ? "pending" : "synced",
|
|
9187
|
+
lastSyncedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
9188
|
+
};
|
|
9189
|
+
}
|
|
9190
|
+
/**
|
|
9191
|
+
* Format quest plan for display
|
|
9192
|
+
*/
|
|
9193
|
+
formatQuestPlan(questPlan) {
|
|
9194
|
+
const lines = [];
|
|
9195
|
+
lines.push(`
|
|
9196
|
+
\u{1F3AF} Quest Plan: ${questPlan.goal}`);
|
|
9197
|
+
lines.push(` Status: ${this.formatStatus(questPlan.status)}`);
|
|
9198
|
+
lines.push("");
|
|
9199
|
+
questPlan.quests.forEach((quest, i) => {
|
|
9200
|
+
const statusIcon = this.getStatusIcon(quest.status);
|
|
9201
|
+
lines.push(` ${i + 1}. ${statusIcon} ${quest.title}`);
|
|
9202
|
+
if (quest.subQuests.length > 0) {
|
|
9203
|
+
quest.subQuests.forEach((sq) => {
|
|
9204
|
+
const sqIcon = this.getStatusIcon(sq.status);
|
|
9205
|
+
lines.push(` ${sqIcon} ${sq.title}`);
|
|
9206
|
+
});
|
|
9207
|
+
}
|
|
9208
|
+
});
|
|
9209
|
+
lines.push("");
|
|
9210
|
+
return lines.join("\n");
|
|
9211
|
+
}
|
|
9212
|
+
formatStatus(status) {
|
|
9213
|
+
switch (status) {
|
|
9214
|
+
case "planning":
|
|
9215
|
+
return "\u{1F4CB} Planning";
|
|
9216
|
+
case "in_progress":
|
|
9217
|
+
return "\u{1F504} In Progress";
|
|
9218
|
+
case "completed":
|
|
9219
|
+
return "\u2705 Completed";
|
|
9220
|
+
case "cancelled":
|
|
9221
|
+
return "\u274C Cancelled";
|
|
9222
|
+
default:
|
|
9223
|
+
return status;
|
|
9224
|
+
}
|
|
9225
|
+
}
|
|
9226
|
+
getStatusIcon(status) {
|
|
9227
|
+
switch (status) {
|
|
9228
|
+
case "pending":
|
|
9229
|
+
return "\u2B1C";
|
|
9230
|
+
case "in_progress":
|
|
9231
|
+
return "\u{1F504}";
|
|
9232
|
+
case "completed":
|
|
9233
|
+
return "\u2705";
|
|
9234
|
+
case "skipped":
|
|
9235
|
+
return "\u23ED\uFE0F";
|
|
9236
|
+
default:
|
|
9237
|
+
return "\u2B1C";
|
|
9238
|
+
}
|
|
9239
|
+
}
|
|
9240
|
+
};
|
|
9241
|
+
|
|
9019
9242
|
// src/llm/ServerLlmBackend.ts
|
|
9020
9243
|
import { createParser } from "eventsource-parser";
|
|
9021
9244
|
import { isAxiosError } from "axios";
|
|
@@ -9402,7 +9625,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
9402
9625
|
// package.json
|
|
9403
9626
|
var package_default = {
|
|
9404
9627
|
name: "@bike4mind/cli",
|
|
9405
|
-
version: "0.2.
|
|
9628
|
+
version: "0.2.4-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
9406
9629
|
type: "module",
|
|
9407
9630
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
9408
9631
|
license: "UNLICENSED",
|
|
@@ -9503,11 +9726,11 @@ var package_default = {
|
|
|
9503
9726
|
zustand: "^4.5.4"
|
|
9504
9727
|
},
|
|
9505
9728
|
devDependencies: {
|
|
9506
|
-
"@bike4mind/agents": "
|
|
9507
|
-
"@bike4mind/common": "
|
|
9508
|
-
"@bike4mind/mcp": "
|
|
9509
|
-
"@bike4mind/services": "
|
|
9510
|
-
"@bike4mind/utils": "
|
|
9729
|
+
"@bike4mind/agents": "0.1.0",
|
|
9730
|
+
"@bike4mind/common": "2.37.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
9731
|
+
"@bike4mind/mcp": "1.19.5-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
9732
|
+
"@bike4mind/services": "2.32.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
9733
|
+
"@bike4mind/utils": "2.1.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
9511
9734
|
"@types/diff": "^5.0.9",
|
|
9512
9735
|
"@types/jsonwebtoken": "^9.0.4",
|
|
9513
9736
|
"@types/node": "^22.9.0",
|
|
@@ -9518,7 +9741,8 @@ var package_default = {
|
|
|
9518
9741
|
tsx: "^4.21.0",
|
|
9519
9742
|
typescript: "^5.9.3",
|
|
9520
9743
|
vitest: "^3.2.4"
|
|
9521
|
-
}
|
|
9744
|
+
},
|
|
9745
|
+
gitHead: "a4c38b0137e98ea3c491cbfe670c42e277ac6afe"
|
|
9522
9746
|
};
|
|
9523
9747
|
|
|
9524
9748
|
// src/config/constants.ts
|
|
@@ -10192,6 +10416,176 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
10192
10416
|
console.log("");
|
|
10193
10417
|
break;
|
|
10194
10418
|
}
|
|
10419
|
+
case "quest":
|
|
10420
|
+
case "q": {
|
|
10421
|
+
const questPlanId = args[0];
|
|
10422
|
+
if (!questPlanId) {
|
|
10423
|
+
console.log("\nUsage: /quest <quest-plan-id>");
|
|
10424
|
+
console.log("Example: /quest abc123");
|
|
10425
|
+
console.log("\nThis will load a quest plan into your current session.\n");
|
|
10426
|
+
break;
|
|
10427
|
+
}
|
|
10428
|
+
const questAuthTokens = await state.configStore.getAuthTokens();
|
|
10429
|
+
if (!questAuthTokens || new Date(questAuthTokens.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
10430
|
+
console.log("\n\u274C Authentication required. Run /login first.\n");
|
|
10431
|
+
break;
|
|
10432
|
+
}
|
|
10433
|
+
console.log("\nLoading quest plan...");
|
|
10434
|
+
try {
|
|
10435
|
+
const config = await state.configStore.get();
|
|
10436
|
+
const apiBaseURL = getApiUrl(config.apiConfig);
|
|
10437
|
+
const apiClient = new ApiClient(apiBaseURL, state.configStore);
|
|
10438
|
+
const questTracker = new QuestTracker(apiClient);
|
|
10439
|
+
const questPlan = await questTracker.fetchQuestPlan(questPlanId);
|
|
10440
|
+
if (!questPlan) {
|
|
10441
|
+
console.log("\n\u274C Quest plan not found.\n");
|
|
10442
|
+
break;
|
|
10443
|
+
}
|
|
10444
|
+
const questLink = questTracker.createQuestLink(questPlan);
|
|
10445
|
+
const updatedSession = {
|
|
10446
|
+
...state.session,
|
|
10447
|
+
quest: questLink,
|
|
10448
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
10449
|
+
};
|
|
10450
|
+
setState((prev) => ({ ...prev, session: updatedSession }));
|
|
10451
|
+
setStoreSession(updatedSession);
|
|
10452
|
+
await state.sessionStore.save(updatedSession);
|
|
10453
|
+
console.log(`
|
|
10454
|
+
\u2705 Quest loaded: ${questPlan.goal}`);
|
|
10455
|
+
console.log(questTracker.formatQuestPlan(questPlan));
|
|
10456
|
+
} catch (error) {
|
|
10457
|
+
if (isAxiosError2(error)) {
|
|
10458
|
+
if (error.response?.status === 404) {
|
|
10459
|
+
console.log("\n\u274C Quest plan not found.\n");
|
|
10460
|
+
} else if (error.response?.status === 403) {
|
|
10461
|
+
console.log("\n\u274C Access denied to this quest plan.\n");
|
|
10462
|
+
} else {
|
|
10463
|
+
console.log(`
|
|
10464
|
+
\u274C Error loading quest: ${error.message}
|
|
10465
|
+
`);
|
|
10466
|
+
}
|
|
10467
|
+
} else if (error instanceof Error) {
|
|
10468
|
+
console.log(`
|
|
10469
|
+
\u274C Error: ${error.message}
|
|
10470
|
+
`);
|
|
10471
|
+
}
|
|
10472
|
+
}
|
|
10473
|
+
break;
|
|
10474
|
+
}
|
|
10475
|
+
case "quest-status":
|
|
10476
|
+
case "qs": {
|
|
10477
|
+
if (!state.session?.quest) {
|
|
10478
|
+
console.log("\n\u26A0\uFE0F No quest linked to this session.");
|
|
10479
|
+
console.log("Use /quest <quest-id> to load a quest.\n");
|
|
10480
|
+
break;
|
|
10481
|
+
}
|
|
10482
|
+
const questLink = state.session.quest;
|
|
10483
|
+
console.log("\n\u{1F3AF} Current Quest Status:");
|
|
10484
|
+
console.log(` Plan: ${questLink.questPlanName}`);
|
|
10485
|
+
if (questLink.questTitle) {
|
|
10486
|
+
console.log(` Quest: ${questLink.questTitle}`);
|
|
10487
|
+
}
|
|
10488
|
+
console.log(` Progress: ${questLink.progress.completed}/${questLink.progress.total}`);
|
|
10489
|
+
console.log(
|
|
10490
|
+
` Sync: ${questLink.syncStatus === "synced" ? "\u2705 Synced" : questLink.syncStatus === "pending" ? "\u23F3 Pending" : "\u26A0\uFE0F Offline"}`
|
|
10491
|
+
);
|
|
10492
|
+
if (questLink.lastSyncedAt) {
|
|
10493
|
+
console.log(` Last Synced: ${new Date(questLink.lastSyncedAt).toLocaleString()}`);
|
|
10494
|
+
}
|
|
10495
|
+
try {
|
|
10496
|
+
const config = await state.configStore.get();
|
|
10497
|
+
const apiBaseURL = getApiUrl(config.apiConfig);
|
|
10498
|
+
const apiClient = new ApiClient(apiBaseURL, state.configStore);
|
|
10499
|
+
const questTracker = new QuestTracker(apiClient);
|
|
10500
|
+
const questPlan = await questTracker.fetchQuestPlan(questLink.questPlanId);
|
|
10501
|
+
if (questPlan) {
|
|
10502
|
+
console.log(questTracker.formatQuestPlan(questPlan));
|
|
10503
|
+
const updatedLink = questTracker.updateProgress(questLink, questPlan);
|
|
10504
|
+
if (updatedLink.progress.completed !== questLink.progress.completed || updatedLink.progress.total !== questLink.progress.total) {
|
|
10505
|
+
const updatedSession = {
|
|
10506
|
+
...state.session,
|
|
10507
|
+
quest: updatedLink,
|
|
10508
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
10509
|
+
};
|
|
10510
|
+
setState((prev) => ({ ...prev, session: updatedSession }));
|
|
10511
|
+
setStoreSession(updatedSession);
|
|
10512
|
+
await state.sessionStore.save(updatedSession);
|
|
10513
|
+
}
|
|
10514
|
+
}
|
|
10515
|
+
} catch {
|
|
10516
|
+
console.log("\n\u26A0\uFE0F Could not fetch latest quest data (showing cached info).\n");
|
|
10517
|
+
}
|
|
10518
|
+
break;
|
|
10519
|
+
}
|
|
10520
|
+
case "quest-unlink": {
|
|
10521
|
+
if (!state.session?.quest) {
|
|
10522
|
+
console.log("\n\u26A0\uFE0F No quest linked to this session.\n");
|
|
10523
|
+
break;
|
|
10524
|
+
}
|
|
10525
|
+
const questName = state.session.quest.questPlanName;
|
|
10526
|
+
const updatedSession = {
|
|
10527
|
+
...state.session,
|
|
10528
|
+
quest: void 0,
|
|
10529
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
10530
|
+
};
|
|
10531
|
+
setState((prev) => ({ ...prev, session: updatedSession }));
|
|
10532
|
+
setStoreSession(updatedSession);
|
|
10533
|
+
await state.sessionStore.save(updatedSession);
|
|
10534
|
+
console.log(`
|
|
10535
|
+
\u2705 Unlinked quest: ${questName}
|
|
10536
|
+
`);
|
|
10537
|
+
break;
|
|
10538
|
+
}
|
|
10539
|
+
case "plan": {
|
|
10540
|
+
const planAuthTokens = await state.configStore.getAuthTokens();
|
|
10541
|
+
if (!planAuthTokens || new Date(planAuthTokens.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
10542
|
+
console.log("\n\u274C Authentication required. Run /login first.\n");
|
|
10543
|
+
break;
|
|
10544
|
+
}
|
|
10545
|
+
if (!state.session || state.session.messages.length === 0) {
|
|
10546
|
+
console.log("\n\u26A0\uFE0F No conversation context to create a plan from.");
|
|
10547
|
+
console.log("Start a conversation first, then use /plan to generate a QuestMaster plan.\n");
|
|
10548
|
+
break;
|
|
10549
|
+
}
|
|
10550
|
+
console.log("\n\u{1F3AF} Creating QuestMaster plan from conversation context...");
|
|
10551
|
+
console.log("\u{1F4A1} This will analyze your conversation and create a structured plan.\n");
|
|
10552
|
+
try {
|
|
10553
|
+
const config = await state.configStore.get();
|
|
10554
|
+
const apiBaseURL = getApiUrl(config.apiConfig);
|
|
10555
|
+
const apiClient = new ApiClient(apiBaseURL, state.configStore);
|
|
10556
|
+
const contextMessages = state.session.messages.slice(-10).map((m) => ({
|
|
10557
|
+
role: m.role,
|
|
10558
|
+
content: m.content
|
|
10559
|
+
}));
|
|
10560
|
+
const response = await apiClient.post("/api/quest-plans", {
|
|
10561
|
+
context: contextMessages,
|
|
10562
|
+
sessionId: state.session.id
|
|
10563
|
+
});
|
|
10564
|
+
if (!response.success) {
|
|
10565
|
+
console.log(`
|
|
10566
|
+
\u274C Failed to create plan: ${response.error}
|
|
10567
|
+
`);
|
|
10568
|
+
break;
|
|
10569
|
+
}
|
|
10570
|
+
console.log(`
|
|
10571
|
+
\u2705 Quest plan created: ${response.questPlan.goal}`);
|
|
10572
|
+
console.log(` Plan ID: ${response.questPlan.id}`);
|
|
10573
|
+
console.log(`
|
|
10574
|
+
\u{1F4A1} Use /quest ${response.questPlan.id} to load this plan into your session.
|
|
10575
|
+
`);
|
|
10576
|
+
} catch (error) {
|
|
10577
|
+
if (isAxiosError2(error)) {
|
|
10578
|
+
console.log(`
|
|
10579
|
+
\u274C Error creating plan: ${error.response?.data?.error || error.message}
|
|
10580
|
+
`);
|
|
10581
|
+
} else if (error instanceof Error) {
|
|
10582
|
+
console.log(`
|
|
10583
|
+
\u274C Error: ${error.message}
|
|
10584
|
+
`);
|
|
10585
|
+
}
|
|
10586
|
+
}
|
|
10587
|
+
break;
|
|
10588
|
+
}
|
|
10195
10589
|
default:
|
|
10196
10590
|
console.log(`Unknown command: /${command}`);
|
|
10197
10591
|
console.log("Type /help for available commands");
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-UHTQGQB4.js";
|
|
6
|
+
import "./chunk-2IW5ZJXR.js";
|
|
7
7
|
import "./chunk-AMDXHL6S.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-PVLFZFW3.js";
|
|
9
9
|
import "./chunk-PDX44BCA.js";
|
|
10
10
|
export {
|
|
11
11
|
findMostSimilarMemento,
|
|
File without changes
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
validateMermaidSyntax,
|
|
121
121
|
warmUpSettingsCache,
|
|
122
122
|
withRetry
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-2IW5ZJXR.js";
|
|
124
124
|
import {
|
|
125
125
|
Logger,
|
|
126
126
|
NotificationDeduplicator,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
postLowCreditsNotificationToSlack,
|
|
130
130
|
postMessageToSlack
|
|
131
131
|
} from "./chunk-AMDXHL6S.js";
|
|
132
|
-
import "./chunk-
|
|
132
|
+
import "./chunk-PVLFZFW3.js";
|
|
133
133
|
import "./chunk-PDX44BCA.js";
|
|
134
134
|
export {
|
|
135
135
|
AWSBackend,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-7OJVF5WR.js";
|
|
6
|
+
import "./chunk-2IW5ZJXR.js";
|
|
7
7
|
import "./chunk-AMDXHL6S.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-PVLFZFW3.js";
|
|
9
9
|
import "./chunk-PDX44BCA.js";
|
|
10
10
|
export {
|
|
11
11
|
SubtractCreditsSchema,
|
package/dist/utils-JPMDGUBL.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -30,6 +30,15 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"bin"
|
|
32
32
|
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "tsx src/index.tsx",
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"start": "node dist/index.js",
|
|
40
|
+
"prepublishOnly": "pnpm build"
|
|
41
|
+
},
|
|
33
42
|
"dependencies": {
|
|
34
43
|
"@anthropic-ai/sdk": "^0.22.0",
|
|
35
44
|
"@aws-sdk/client-apigatewaymanagementapi": "3.654.0",
|
|
@@ -92,6 +101,11 @@
|
|
|
92
101
|
"zustand": "^4.5.4"
|
|
93
102
|
},
|
|
94
103
|
"devDependencies": {
|
|
104
|
+
"@bike4mind/agents": "0.1.0",
|
|
105
|
+
"@bike4mind/common": "2.37.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
106
|
+
"@bike4mind/mcp": "1.19.5-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
107
|
+
"@bike4mind/services": "2.32.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
108
|
+
"@bike4mind/utils": "2.1.1-feat-questmaster-external-integrations.17092+a4c38b013",
|
|
95
109
|
"@types/diff": "^5.0.9",
|
|
96
110
|
"@types/jsonwebtoken": "^9.0.4",
|
|
97
111
|
"@types/node": "^22.9.0",
|
|
@@ -101,19 +115,7 @@
|
|
|
101
115
|
"tsup": "^8.5.1",
|
|
102
116
|
"tsx": "^4.21.0",
|
|
103
117
|
"typescript": "^5.9.3",
|
|
104
|
-
"vitest": "^3.2.4"
|
|
105
|
-
"@bike4mind/agents": "0.1.0",
|
|
106
|
-
"@bike4mind/common": "2.37.0",
|
|
107
|
-
"@bike4mind/mcp": "1.19.4",
|
|
108
|
-
"@bike4mind/services": "2.32.0",
|
|
109
|
-
"@bike4mind/utils": "2.1.0"
|
|
118
|
+
"vitest": "^3.2.4"
|
|
110
119
|
},
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
"build": "tsup",
|
|
114
|
-
"typecheck": "tsc --noEmit",
|
|
115
|
-
"test": "vitest run",
|
|
116
|
-
"test:watch": "vitest",
|
|
117
|
-
"start": "node dist/index.js"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
+
"gitHead": "a4c38b0137e98ea3c491cbfe670c42e277ac6afe"
|
|
121
|
+
}
|