@cavelon/cli 0.2.6 → 0.2.8
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/access.js +4 -0
- package/dist/commands/api.js +16 -2
- package/dist/commands/documents.js +115 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/publication.js +169 -0
- package/dist/commands/solution.js +15 -2
- package/dist/commands/tenants.js +10 -2
- package/dist/commands/work.js +70 -9
- package/dist/invoke.js +6 -2
- package/dist/kit-codes.js +4 -0
- package/dist/mcp.js +1 -0
- package/dist/native-assets/THIRD-PARTY-NOTICES +2 -2
- package/dist/native-assets/kilo-server.mjs +32 -9
- package/dist/native-assets/kilo-tui.mjs +32 -9
- package/dist/native-assets/manifest.json +14 -14
- package/dist/native-assets/omp-extension.mjs +73 -66
- package/dist/native-assets/opencode-server.mjs +32 -9
- package/dist/native-assets/opencode-tui.mjs +32 -9
- package/dist/native-assets/pi-extension.mjs +73 -66
- package/dist/skills/cavelon-authoring/SKILL.md +13 -0
- package/dist/skills/cavelon-loop/SKILL.md +27 -3
- package/dist/skills/cavelon-testing/SKILL.md +30 -0
- package/package.json +2 -2
package/dist/kit-codes.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { printMode } from "./printed.js";
|
|
2
2
|
export const KIT_ERROR_CODES = [
|
|
3
|
+
{ code: "invalid_trace_export", area: "cli", message: "The instance did not return a JSON trace and integrity manifest; no export was kept.", hint: "Retry the export; if it repeats, report the command and instance version without sharing sensitive trace contents." },
|
|
4
|
+
{ code: "publication_state_unknown", area: "cli", message: "The instance did not describe complete version, draft, readiness or affected-run state; nothing was changed.", hint: "Review publication in the Admin or update the instance before publishing from the kit." },
|
|
5
|
+
{ code: "held_for_privacy_review", area: "cli", message: "This document is held for privacy review; it is not indexed or readable.", hint: "A person with knowledge_bases.manage_documents reviews and releases it in the Admin. Tokens and API keys cannot release it; YOLO does not change this." },
|
|
6
|
+
{ code: "document_file_for_a_person", area: "cli", message: "This document file is restricted or not agent-readable.", hint: "A person with knowledge_bases.manage_documents opens it in the Admin. The privacy vault and conversion report are never returned to agents." },
|
|
3
7
|
{ code: "not_logged_in", area: "cli", message: "There is no token for the instance.", hint: "A person runs `cavelon login` (or sets CAVELON_URL and CAVELON_TOKEN); an agent never handles the token." },
|
|
4
8
|
{ code: "no_instance", area: "cli", message: "No Cavelon instance is selected.", hint: "Run `cavelon login --instance <url>`, set CAVELON_URL, or work inside a folder with cavelon.yaml." },
|
|
5
9
|
{ code: "unauthorized", area: "cli", message: "The instance refused the token: expired, revoked, or for another instance.", hint: "A person creates a new token on /account/access-tokens and runs `cavelon login`." },
|
package/dist/mcp.js
CHANGED
|
@@ -28,6 +28,7 @@ const INSTRUCTIONS = "Tools for one Cavelon instance, acting with the token a pe
|
|
|
28
28
|
"Instance confirmation ids remain bound to the exact request and are requested only after person approval; routine automation " +
|
|
29
29
|
"does not manufacture that approval. confirmation_required or confirmation_invalid changed nothing: return to a preview " +
|
|
30
30
|
"and the required person approval. YOLO never overrides person-only access or customer database-write consent. " +
|
|
31
|
+
"Where the instance offers graph publication, apply reports whether scoped edits land in an unpublished draft. Read it with harness_publication and review solution_publish after tests; publishing, rollback and draft discard retain fresh person confirmation in YOLO. Never infer draft isolation on older instances. " +
|
|
31
32
|
"chat sends one message to a solution and returns its answer: the way to try one that is not the default route. " +
|
|
32
33
|
"kb_upload names files that match an active document of the knowledge base; with replace it replaces them, and where the " +
|
|
33
34
|
"instance's upload cannot, it returns what it would deactivate and uploads nothing without its confirm_token. " +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@modelcontextprotocol/sdk 1.
|
|
1
|
+
@modelcontextprotocol/sdk 1.32.1
|
|
2
2
|
MIT License
|
|
3
3
|
|
|
4
4
|
Copyright (c) 2024 Anthropic, PBC
|
|
@@ -277,7 +277,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
277
277
|
|
|
278
278
|
---
|
|
279
279
|
|
|
280
|
-
typebox 1.3.
|
|
280
|
+
typebox 1.3.36
|
|
281
281
|
TypeBox
|
|
282
282
|
|
|
283
283
|
The MIT License (MIT)
|
|
@@ -36355,6 +36355,9 @@ var Protocol = class {
|
|
|
36355
36355
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
36356
36356
|
const handleTaskResult = async () => {
|
|
36357
36357
|
const taskId = request.params.taskId;
|
|
36358
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
36359
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
36360
|
+
}
|
|
36358
36361
|
if (this._taskMessageQueue) {
|
|
36359
36362
|
let queuedMessage;
|
|
36360
36363
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -36385,12 +36388,12 @@ var Protocol = class {
|
|
|
36385
36388
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
36386
36389
|
}
|
|
36387
36390
|
if (!isTerminal(task.status)) {
|
|
36388
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
36391
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
36389
36392
|
return await handleTaskResult();
|
|
36390
36393
|
}
|
|
36391
36394
|
if (isTerminal(task.status)) {
|
|
36392
36395
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
36393
|
-
this._clearTaskQueue(taskId);
|
|
36396
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
36394
36397
|
return {
|
|
36395
36398
|
...result,
|
|
36396
36399
|
_meta: {
|
|
@@ -36427,7 +36430,7 @@ var Protocol = class {
|
|
|
36427
36430
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
36428
36431
|
}
|
|
36429
36432
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
36430
|
-
this._clearTaskQueue(request.params.taskId);
|
|
36433
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
36431
36434
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
36432
36435
|
if (!cancelledTask) {
|
|
36433
36436
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -36555,6 +36558,19 @@ var Protocol = class {
|
|
|
36555
36558
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
36556
36559
|
const capturedTransport = this._transport;
|
|
36557
36560
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
36561
|
+
const sessionId = capturedTransport?.sessionId;
|
|
36562
|
+
const store = this._taskStore;
|
|
36563
|
+
let relatedTaskFound = true;
|
|
36564
|
+
let relatedTaskLookup;
|
|
36565
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
36566
|
+
relatedTaskFound = false;
|
|
36567
|
+
relatedTaskLookup = (async () => {
|
|
36568
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
36569
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
36570
|
+
}
|
|
36571
|
+
relatedTaskFound = true;
|
|
36572
|
+
})();
|
|
36573
|
+
}
|
|
36558
36574
|
if (handler === void 0) {
|
|
36559
36575
|
const errorResponse = {
|
|
36560
36576
|
jsonrpc: "2.0",
|
|
@@ -36564,7 +36580,10 @@ var Protocol = class {
|
|
|
36564
36580
|
message: "Method not found"
|
|
36565
36581
|
}
|
|
36566
36582
|
};
|
|
36567
|
-
if (relatedTaskId &&
|
|
36583
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
36584
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
36585
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error62) => this._onerror(new Error(`Failed to send an error response: ${error62}`)));
|
|
36586
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
36568
36587
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
36569
36588
|
type: "error",
|
|
36570
36589
|
message: errorResponse,
|
|
@@ -36615,7 +36634,10 @@ var Protocol = class {
|
|
|
36615
36634
|
closeSSEStream: extra?.closeSSEStream,
|
|
36616
36635
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
36617
36636
|
};
|
|
36618
|
-
Promise.resolve().then(() => {
|
|
36637
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
36638
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
36639
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
36640
|
+
}
|
|
36619
36641
|
if (taskCreationParams) {
|
|
36620
36642
|
this.assertTaskHandlerCapability(request.method);
|
|
36621
36643
|
}
|
|
@@ -36650,7 +36672,7 @@ var Protocol = class {
|
|
|
36650
36672
|
...error62["data"] !== void 0 && { data: error62["data"] }
|
|
36651
36673
|
}
|
|
36652
36674
|
};
|
|
36653
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
36675
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
36654
36676
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
36655
36677
|
type: "error",
|
|
36656
36678
|
message: errorResponse,
|
|
@@ -37130,7 +37152,7 @@ var Protocol = class {
|
|
|
37130
37152
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
37131
37153
|
}
|
|
37132
37154
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
37133
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
37155
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
37134
37156
|
}
|
|
37135
37157
|
/**
|
|
37136
37158
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -37159,12 +37181,13 @@ var Protocol = class {
|
|
|
37159
37181
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
37160
37182
|
* @param taskId The task ID to wait for
|
|
37161
37183
|
* @param signal Abort signal to cancel the wait
|
|
37184
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
37162
37185
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
37163
37186
|
*/
|
|
37164
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
37187
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
37165
37188
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
37166
37189
|
try {
|
|
37167
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
37190
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
37168
37191
|
if (task?.pollInterval) {
|
|
37169
37192
|
interval = task.pollInterval;
|
|
37170
37193
|
}
|
|
@@ -23052,6 +23052,9 @@ var Protocol = class {
|
|
|
23052
23052
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
23053
23053
|
const handleTaskResult = async () => {
|
|
23054
23054
|
const taskId = request.params.taskId;
|
|
23055
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
23056
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
23057
|
+
}
|
|
23055
23058
|
if (this._taskMessageQueue) {
|
|
23056
23059
|
let queuedMessage;
|
|
23057
23060
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -23082,12 +23085,12 @@ var Protocol = class {
|
|
|
23082
23085
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
23083
23086
|
}
|
|
23084
23087
|
if (!isTerminal(task.status)) {
|
|
23085
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
23088
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
23086
23089
|
return await handleTaskResult();
|
|
23087
23090
|
}
|
|
23088
23091
|
if (isTerminal(task.status)) {
|
|
23089
23092
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
23090
|
-
this._clearTaskQueue(taskId);
|
|
23093
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
23091
23094
|
return {
|
|
23092
23095
|
...result,
|
|
23093
23096
|
_meta: {
|
|
@@ -23124,7 +23127,7 @@ var Protocol = class {
|
|
|
23124
23127
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
23125
23128
|
}
|
|
23126
23129
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
23127
|
-
this._clearTaskQueue(request.params.taskId);
|
|
23130
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
23128
23131
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
23129
23132
|
if (!cancelledTask) {
|
|
23130
23133
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -23252,6 +23255,19 @@ var Protocol = class {
|
|
|
23252
23255
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
23253
23256
|
const capturedTransport = this._transport;
|
|
23254
23257
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
23258
|
+
const sessionId = capturedTransport?.sessionId;
|
|
23259
|
+
const store = this._taskStore;
|
|
23260
|
+
let relatedTaskFound = true;
|
|
23261
|
+
let relatedTaskLookup;
|
|
23262
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
23263
|
+
relatedTaskFound = false;
|
|
23264
|
+
relatedTaskLookup = (async () => {
|
|
23265
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
23266
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
23267
|
+
}
|
|
23268
|
+
relatedTaskFound = true;
|
|
23269
|
+
})();
|
|
23270
|
+
}
|
|
23255
23271
|
if (handler === void 0) {
|
|
23256
23272
|
const errorResponse = {
|
|
23257
23273
|
jsonrpc: "2.0",
|
|
@@ -23261,7 +23277,10 @@ var Protocol = class {
|
|
|
23261
23277
|
message: "Method not found"
|
|
23262
23278
|
}
|
|
23263
23279
|
};
|
|
23264
|
-
if (relatedTaskId &&
|
|
23280
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
23281
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
23282
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
23283
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
23265
23284
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
23266
23285
|
type: "error",
|
|
23267
23286
|
message: errorResponse,
|
|
@@ -23312,7 +23331,10 @@ var Protocol = class {
|
|
|
23312
23331
|
closeSSEStream: extra?.closeSSEStream,
|
|
23313
23332
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
23314
23333
|
};
|
|
23315
|
-
Promise.resolve().then(() => {
|
|
23334
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
23335
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
23336
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
23337
|
+
}
|
|
23316
23338
|
if (taskCreationParams) {
|
|
23317
23339
|
this.assertTaskHandlerCapability(request.method);
|
|
23318
23340
|
}
|
|
@@ -23347,7 +23369,7 @@ var Protocol = class {
|
|
|
23347
23369
|
...error2["data"] !== void 0 && { data: error2["data"] }
|
|
23348
23370
|
}
|
|
23349
23371
|
};
|
|
23350
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
23372
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
23351
23373
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
23352
23374
|
type: "error",
|
|
23353
23375
|
message: errorResponse,
|
|
@@ -23827,7 +23849,7 @@ var Protocol = class {
|
|
|
23827
23849
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
23828
23850
|
}
|
|
23829
23851
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
23830
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
23852
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
23831
23853
|
}
|
|
23832
23854
|
/**
|
|
23833
23855
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -23856,12 +23878,13 @@ var Protocol = class {
|
|
|
23856
23878
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
23857
23879
|
* @param taskId The task ID to wait for
|
|
23858
23880
|
* @param signal Abort signal to cancel the wait
|
|
23881
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
23859
23882
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
23860
23883
|
*/
|
|
23861
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
23884
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
23862
23885
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
23863
23886
|
try {
|
|
23864
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
23887
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
23865
23888
|
if (task?.pollInterval) {
|
|
23866
23889
|
interval = task.pollInterval;
|
|
23867
23890
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"format": 1,
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"entries": {
|
|
5
5
|
"omp": [
|
|
6
6
|
"omp-extension.mjs"
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "kilo-server.mjs",
|
|
28
|
-
"size":
|
|
29
|
-
"sha256": "
|
|
28
|
+
"size": 1494321,
|
|
29
|
+
"sha256": "d17dee519e66697ae62a55d8d2e8d4ac411c682b947cedd235e6bc52a688d06e"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"path": "kilo-tui.mjs",
|
|
33
|
-
"size":
|
|
34
|
-
"sha256": "
|
|
33
|
+
"size": 940457,
|
|
34
|
+
"sha256": "6dce9d0bc29e9a46bb40f98c914a13d5238a9e12e52c842aaa975bcca8e2ce75"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "LICENSE",
|
|
@@ -45,28 +45,28 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "omp-extension.mjs",
|
|
48
|
-
"size":
|
|
49
|
-
"sha256": "
|
|
48
|
+
"size": 1148227,
|
|
49
|
+
"sha256": "99f8e790e70fe7a72cd1affde628ea0e52fd0642db8a0084bf2791ce803e4410"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"path": "opencode-server.mjs",
|
|
53
|
-
"size":
|
|
54
|
-
"sha256": "
|
|
53
|
+
"size": 1493309,
|
|
54
|
+
"sha256": "4829901f1c5bbe0d96156297cd11cc8cfa08f44d1a3110743e6c9316ec3fe09a"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"path": "opencode-tui.mjs",
|
|
58
|
-
"size":
|
|
59
|
-
"sha256": "
|
|
58
|
+
"size": 940363,
|
|
59
|
+
"sha256": "ffc26d95060ec653b81789022496a90a1eb25bac23075a5f05025fa1ba97e038"
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
"path": "pi-extension.mjs",
|
|
63
|
-
"size":
|
|
64
|
-
"sha256": "
|
|
63
|
+
"size": 1148135,
|
|
64
|
+
"sha256": "a45ae3ea3a8de1edb7399ddecac8544d986a73b93a55605685569d6afd711bee"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "THIRD-PARTY-NOTICES",
|
|
68
68
|
"size": 18303,
|
|
69
|
-
"sha256": "
|
|
69
|
+
"sha256": "f12be1a7c8faec83012f2f31ad0d20d1d92cab7d419582c5adb2f71721f6b04e"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"path": "TYPEBOX-LICENSE",
|
|
@@ -15066,6 +15066,7 @@ __export(settings_exports, {
|
|
|
15066
15066
|
// node_modules/typebox/build/guard/guard.mjs
|
|
15067
15067
|
var guard_exports = {};
|
|
15068
15068
|
__export(guard_exports, {
|
|
15069
|
+
CodePointCount: () => CodePointCount2,
|
|
15069
15070
|
Counted: () => Counted,
|
|
15070
15071
|
Entries: () => Entries,
|
|
15071
15072
|
EntriesRegExp: () => EntriesRegExp,
|
|
@@ -15106,16 +15107,13 @@ __export(guard_exports, {
|
|
|
15106
15107
|
Values: () => Values
|
|
15107
15108
|
});
|
|
15108
15109
|
|
|
15109
|
-
// node_modules/typebox/build/guard/
|
|
15110
|
+
// node_modules/typebox/build/guard/unicode/unicode_segment.mjs
|
|
15110
15111
|
function IsBetween(value, min, max) {
|
|
15111
15112
|
return value >= min && value <= max;
|
|
15112
15113
|
}
|
|
15113
15114
|
function IsZeroWidthJoiner(value) {
|
|
15114
15115
|
return value === 8205;
|
|
15115
15116
|
}
|
|
15116
|
-
function IsHighSurrogate(value) {
|
|
15117
|
-
return IsBetween(value, 55296, 56319);
|
|
15118
|
-
}
|
|
15119
15117
|
function IsRegionalIndicator(value) {
|
|
15120
15118
|
return IsBetween(value, 127462, 127487);
|
|
15121
15119
|
}
|
|
@@ -15153,64 +15151,30 @@ function NextGraphemeClusterIndex(value, clusterStart) {
|
|
|
15153
15151
|
}
|
|
15154
15152
|
return clusterEnd;
|
|
15155
15153
|
}
|
|
15156
|
-
function IsGraphemeCodePoint(value) {
|
|
15157
|
-
return value >= 768 && // above special range
|
|
15158
|
-
(IsHighSurrogate(value) || IsCombiningMark(value) || IsVariationSelector(value) || IsZeroWidthJoiner(value));
|
|
15159
|
-
}
|
|
15160
15154
|
function GraphemeCount(value) {
|
|
15161
|
-
let count = 0;
|
|
15162
|
-
let index = 0;
|
|
15155
|
+
let count = 0, index = 0;
|
|
15163
15156
|
while (index < value.length) {
|
|
15164
15157
|
index = NextGraphemeClusterIndex(value, index);
|
|
15165
15158
|
count++;
|
|
15166
15159
|
}
|
|
15167
15160
|
return count;
|
|
15168
15161
|
}
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15162
|
+
|
|
15163
|
+
// node_modules/typebox/build/guard/unicode/unicode.mjs
|
|
15164
|
+
function CodePointCount(value) {
|
|
15165
|
+
let result = 0, index = 0, prev = 0;
|
|
15172
15166
|
while (index < value.length) {
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15167
|
+
const next = value.charCodeAt(index++) >> 10;
|
|
15168
|
+
result += +((prev << 8 | next) !== 13879);
|
|
15169
|
+
prev = next;
|
|
15176
15170
|
}
|
|
15177
|
-
return
|
|
15171
|
+
return result;
|
|
15178
15172
|
}
|
|
15179
|
-
function
|
|
15180
|
-
|
|
15181
|
-
let index = 0;
|
|
15182
|
-
while (index < value.length) {
|
|
15183
|
-
index = NextGraphemeClusterIndex(value, index);
|
|
15184
|
-
if (++count > maxLength)
|
|
15185
|
-
return false;
|
|
15186
|
-
}
|
|
15187
|
-
return true;
|
|
15173
|
+
function IsMaxLength(value, maxLength) {
|
|
15174
|
+
return value.length <= maxLength || value.length <= maxLength << 1 && CodePointCount(value) <= maxLength;
|
|
15188
15175
|
}
|
|
15189
15176
|
function IsMinLength(value, minLength) {
|
|
15190
|
-
|
|
15191
|
-
return true;
|
|
15192
|
-
if (value.length < minLength)
|
|
15193
|
-
return false;
|
|
15194
|
-
let index = 0;
|
|
15195
|
-
while (true) {
|
|
15196
|
-
if (IsGraphemeCodePoint(value.charCodeAt(index))) {
|
|
15197
|
-
return IsMinLengthSegmented(value, minLength);
|
|
15198
|
-
}
|
|
15199
|
-
if (++index >= minLength)
|
|
15200
|
-
return true;
|
|
15201
|
-
}
|
|
15202
|
-
}
|
|
15203
|
-
function IsMaxLength(value, maxLength) {
|
|
15204
|
-
if (value.length <= maxLength)
|
|
15205
|
-
return true;
|
|
15206
|
-
let index = 0;
|
|
15207
|
-
while (true) {
|
|
15208
|
-
if (IsGraphemeCodePoint(value.charCodeAt(index))) {
|
|
15209
|
-
return IsMaxLengthSegmented(value, maxLength);
|
|
15210
|
-
}
|
|
15211
|
-
if (++index > maxLength)
|
|
15212
|
-
return false;
|
|
15213
|
-
}
|
|
15177
|
+
return value.length >= minLength << 1 || value.length >= minLength && CodePointCount(value) >= minLength;
|
|
15214
15178
|
}
|
|
15215
15179
|
|
|
15216
15180
|
// node_modules/typebox/build/guard/guard.mjs
|
|
@@ -15301,11 +15265,14 @@ function IsValueLike(value) {
|
|
|
15301
15265
|
function GraphemeCount2(value) {
|
|
15302
15266
|
return GraphemeCount(value);
|
|
15303
15267
|
}
|
|
15304
|
-
function
|
|
15305
|
-
return
|
|
15268
|
+
function CodePointCount2(value) {
|
|
15269
|
+
return CodePointCount(value);
|
|
15306
15270
|
}
|
|
15307
|
-
function
|
|
15308
|
-
return
|
|
15271
|
+
function IsMaxLength2(value, maxLength) {
|
|
15272
|
+
return IsMaxLength(value, maxLength);
|
|
15273
|
+
}
|
|
15274
|
+
function IsMinLength2(value, minLength) {
|
|
15275
|
+
return IsMinLength(value, minLength);
|
|
15309
15276
|
}
|
|
15310
15277
|
function Every(value, offset, callback) {
|
|
15311
15278
|
return value.every((item, index) => index < offset || callback(item, index));
|
|
@@ -15454,6 +15421,7 @@ function IsMap(value) {
|
|
|
15454
15421
|
var settings = {
|
|
15455
15422
|
immutableTypes: false,
|
|
15456
15423
|
maxErrors: 8,
|
|
15424
|
+
maxParseErrors: 1,
|
|
15457
15425
|
maxInstantiationCount: 128,
|
|
15458
15426
|
useAcceleration: true,
|
|
15459
15427
|
exactOptionalPropertyTypes: false,
|
|
@@ -15464,6 +15432,7 @@ var settings = {
|
|
|
15464
15432
|
function Reset() {
|
|
15465
15433
|
settings.immutableTypes = false;
|
|
15466
15434
|
settings.maxErrors = 8;
|
|
15435
|
+
settings.maxParseErrors = 1;
|
|
15467
15436
|
settings.maxInstantiationCount = 128;
|
|
15468
15437
|
settings.useAcceleration = true;
|
|
15469
15438
|
settings.exactOptionalPropertyTypes = false;
|
|
@@ -17739,8 +17708,14 @@ function TryRestInferable(type) {
|
|
|
17739
17708
|
function TryInferable(type) {
|
|
17740
17709
|
return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
|
|
17741
17710
|
}
|
|
17742
|
-
function TryInferResults(rest, right
|
|
17743
|
-
|
|
17711
|
+
function TryInferResults(rest, right) {
|
|
17712
|
+
const result = [];
|
|
17713
|
+
for (const head of rest) {
|
|
17714
|
+
if (!IsExtendsTrueLike(ExtendsLeft({}, head, right)))
|
|
17715
|
+
return void 0;
|
|
17716
|
+
result.push(head);
|
|
17717
|
+
}
|
|
17718
|
+
return result;
|
|
17744
17719
|
}
|
|
17745
17720
|
function InferTupleResult(inferred, name, left, right) {
|
|
17746
17721
|
const results = TryInferResults(left, right);
|
|
@@ -17784,9 +17759,18 @@ function ExtendsTupleToTuple(inferred, left, right) {
|
|
|
17784
17759
|
const reversed = Reversed(instantiatedRight);
|
|
17785
17760
|
return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
|
|
17786
17761
|
}
|
|
17762
|
+
function ExtendsTupleToArrayReduce(inferred, left, right) {
|
|
17763
|
+
for (const head of left) {
|
|
17764
|
+
const result = ExtendsLeft(inferred, head, right);
|
|
17765
|
+
if (!IsExtendsTrueLike(result))
|
|
17766
|
+
return result;
|
|
17767
|
+
inferred = result.inferred;
|
|
17768
|
+
}
|
|
17769
|
+
return ExtendsTrue(inferred);
|
|
17770
|
+
}
|
|
17787
17771
|
function ExtendsTupleToArray(inferred, left, right) {
|
|
17788
17772
|
const inferrable = TryInferable(right);
|
|
17789
|
-
return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) :
|
|
17773
|
+
return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : ExtendsTupleToArrayReduce(inferred, left, right);
|
|
17790
17774
|
}
|
|
17791
17775
|
function ExtendsTuple(inferred, left, right) {
|
|
17792
17776
|
const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
|
|
@@ -27456,6 +27440,9 @@ var Protocol = class {
|
|
|
27456
27440
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
27457
27441
|
const handleTaskResult = async () => {
|
|
27458
27442
|
const taskId = request.params.taskId;
|
|
27443
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
27444
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
27445
|
+
}
|
|
27459
27446
|
if (this._taskMessageQueue) {
|
|
27460
27447
|
let queuedMessage;
|
|
27461
27448
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -27486,12 +27473,12 @@ var Protocol = class {
|
|
|
27486
27473
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
27487
27474
|
}
|
|
27488
27475
|
if (!isTerminal(task.status)) {
|
|
27489
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
27476
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
27490
27477
|
return await handleTaskResult();
|
|
27491
27478
|
}
|
|
27492
27479
|
if (isTerminal(task.status)) {
|
|
27493
27480
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
27494
|
-
this._clearTaskQueue(taskId);
|
|
27481
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
27495
27482
|
return {
|
|
27496
27483
|
...result,
|
|
27497
27484
|
_meta: {
|
|
@@ -27528,7 +27515,7 @@ var Protocol = class {
|
|
|
27528
27515
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
27529
27516
|
}
|
|
27530
27517
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
27531
|
-
this._clearTaskQueue(request.params.taskId);
|
|
27518
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
27532
27519
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
27533
27520
|
if (!cancelledTask) {
|
|
27534
27521
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -27656,6 +27643,19 @@ var Protocol = class {
|
|
|
27656
27643
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
27657
27644
|
const capturedTransport = this._transport;
|
|
27658
27645
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
27646
|
+
const sessionId = capturedTransport?.sessionId;
|
|
27647
|
+
const store = this._taskStore;
|
|
27648
|
+
let relatedTaskFound = true;
|
|
27649
|
+
let relatedTaskLookup;
|
|
27650
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
27651
|
+
relatedTaskFound = false;
|
|
27652
|
+
relatedTaskLookup = (async () => {
|
|
27653
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
27654
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
27655
|
+
}
|
|
27656
|
+
relatedTaskFound = true;
|
|
27657
|
+
})();
|
|
27658
|
+
}
|
|
27659
27659
|
if (handler === void 0) {
|
|
27660
27660
|
const errorResponse = {
|
|
27661
27661
|
jsonrpc: "2.0",
|
|
@@ -27665,7 +27665,10 @@ var Protocol = class {
|
|
|
27665
27665
|
message: "Method not found"
|
|
27666
27666
|
}
|
|
27667
27667
|
};
|
|
27668
|
-
if (relatedTaskId &&
|
|
27668
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
27669
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
27670
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
27671
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
27669
27672
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
27670
27673
|
type: "error",
|
|
27671
27674
|
message: errorResponse,
|
|
@@ -27716,7 +27719,10 @@ var Protocol = class {
|
|
|
27716
27719
|
closeSSEStream: extra?.closeSSEStream,
|
|
27717
27720
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
27718
27721
|
};
|
|
27719
|
-
Promise.resolve().then(() => {
|
|
27722
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
27723
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
27724
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
27725
|
+
}
|
|
27720
27726
|
if (taskCreationParams) {
|
|
27721
27727
|
this.assertTaskHandlerCapability(request.method);
|
|
27722
27728
|
}
|
|
@@ -27751,7 +27757,7 @@ var Protocol = class {
|
|
|
27751
27757
|
...error2["data"] !== void 0 && { data: error2["data"] }
|
|
27752
27758
|
}
|
|
27753
27759
|
};
|
|
27754
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
27760
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
27755
27761
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
27756
27762
|
type: "error",
|
|
27757
27763
|
message: errorResponse,
|
|
@@ -28231,7 +28237,7 @@ var Protocol = class {
|
|
|
28231
28237
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
28232
28238
|
}
|
|
28233
28239
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
28234
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
28240
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
28235
28241
|
}
|
|
28236
28242
|
/**
|
|
28237
28243
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -28260,12 +28266,13 @@ var Protocol = class {
|
|
|
28260
28266
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
28261
28267
|
* @param taskId The task ID to wait for
|
|
28262
28268
|
* @param signal Abort signal to cancel the wait
|
|
28269
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
28263
28270
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
28264
28271
|
*/
|
|
28265
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
28272
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
28266
28273
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
28267
28274
|
try {
|
|
28268
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
28275
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
28269
28276
|
if (task?.pollInterval) {
|
|
28270
28277
|
interval = task.pollInterval;
|
|
28271
28278
|
}
|