@integrity-labs/agt-cli 0.28.1136 → 0.28.1138
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/bin/agt.js +5 -5
- package/dist/{chunk-AMW44JCN.js → chunk-3INFJV37.js} +4 -4
- package/dist/{chunk-773ZNDNR.js → chunk-EIXOI2ZB.js} +20 -1
- package/dist/{chunk-773ZNDNR.js.map → chunk-EIXOI2ZB.js.map} +1 -1
- package/dist/{chunk-PGTZFME3.js → chunk-J6ORWGUB.js} +2 -2
- package/dist/{claude-pair-runtime-6SJHKHRE.js → claude-pair-runtime-VQGEM5AY.js} +2 -2
- package/dist/lib/manager-worker.js +16 -16
- package/dist/mcp/augmented-admin.js +164 -54
- package/dist/mcp/augmented-help-kb.js +164 -54
- package/dist/mcp/augmented-support.js +164 -54
- package/dist/mcp/direct-chat-channel.js +108 -41
- package/dist/mcp/index.js +270 -64
- package/dist/mcp/origami.js +108 -41
- package/dist/mcp/slack-channel.js +108 -41
- package/dist/mcp/teams-channel.js +89 -41
- package/dist/mcp/telegram-channel.js +108 -41
- package/dist/mcp/whatsapp-channel.js +5447 -4340
- package/dist/mcp/whatsapp-link.js +5442 -4383
- package/dist/mcp/xero.js +6048 -2067
- package/dist/{persistent-session-6W6PZGNB.js → persistent-session-ZBKLEYUQ.js} +3 -3
- package/dist/{responsiveness-probe-LLYHYZR7.js → responsiveness-probe-FXDO35IT.js} +3 -3
- package/dist/{session-auth-dead-QZET5C3W.js → session-auth-dead-OGNOSJIB.js} +2 -2
- package/package.json +2 -2
- /package/dist/{chunk-AMW44JCN.js.map → chunk-3INFJV37.js.map} +0 -0
- /package/dist/{chunk-PGTZFME3.js.map → chunk-J6ORWGUB.js.map} +0 -0
- /package/dist/{claude-pair-runtime-6SJHKHRE.js.map → claude-pair-runtime-VQGEM5AY.js.map} +0 -0
- /package/dist/{persistent-session-6W6PZGNB.js.map → persistent-session-ZBKLEYUQ.js.map} +0 -0
- /package/dist/{responsiveness-probe-LLYHYZR7.js.map → responsiveness-probe-FXDO35IT.js.map} +0 -0
- /package/dist/{session-auth-dead-QZET5C3W.js.map → session-auth-dead-OGNOSJIB.js.map} +0 -0
package/dist/mcp/index.js
CHANGED
|
@@ -22462,6 +22462,37 @@ function describeAssignProject(o) {
|
|
|
22462
22462
|
return `${head} ${from} To undo: ${tool} with ${idArg}="${o.leafId}", ${undoArg}.`;
|
|
22463
22463
|
}
|
|
22464
22464
|
|
|
22465
|
+
// src/project-summary-render.ts
|
|
22466
|
+
function projectPastDue(p2, today) {
|
|
22467
|
+
return p2.status === "active" && !!p2.target_date && p2.target_date < today;
|
|
22468
|
+
}
|
|
22469
|
+
function ownerLabel(p2) {
|
|
22470
|
+
if (!p2.owner_person_id) return null;
|
|
22471
|
+
return p2.owner_name ? `${p2.owner_name} (person_id ${p2.owner_person_id})` : `person_id ${p2.owner_person_id}`;
|
|
22472
|
+
}
|
|
22473
|
+
function dueLabel(p2, today) {
|
|
22474
|
+
if (!p2.target_date) return null;
|
|
22475
|
+
return projectPastDue(p2, today) ? `${p2.target_date} (PAST DUE)` : p2.target_date;
|
|
22476
|
+
}
|
|
22477
|
+
function projectListLine(p2, today) {
|
|
22478
|
+
const extra = [
|
|
22479
|
+
ownerLabel(p2) ? `owner ${ownerLabel(p2)}` : null,
|
|
22480
|
+
dueLabel(p2, today) ? `due ${dueLabel(p2, today)}` : null
|
|
22481
|
+
].filter((s) => s !== null);
|
|
22482
|
+
const tail = extra.length ? `, ${extra.join(", ")}` : "";
|
|
22483
|
+
return `- ${p2.name} [${p2.status}] (id: ${p2.id}, created ${p2.created_at}${tail})`;
|
|
22484
|
+
}
|
|
22485
|
+
function projectOwnerDateLines(p2, today) {
|
|
22486
|
+
return [`Owner: ${ownerLabel(p2) ?? "none"}`, `Target date: ${dueLabel(p2, today) ?? "none"}`];
|
|
22487
|
+
}
|
|
22488
|
+
function todayInTz(timeZone, now = /* @__PURE__ */ new Date()) {
|
|
22489
|
+
try {
|
|
22490
|
+
return new Intl.DateTimeFormat("en-CA", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).format(now);
|
|
22491
|
+
} catch {
|
|
22492
|
+
return now.toISOString().slice(0, 10);
|
|
22493
|
+
}
|
|
22494
|
+
}
|
|
22495
|
+
|
|
22465
22496
|
// src/kanban-assign-result.ts
|
|
22466
22497
|
function kanbanAssignResultText(data, fallbackTargetAgent, fallbackTargetTeam) {
|
|
22467
22498
|
if (!data.ok) return `Failed to assign task to ${fallbackTargetAgent}.`;
|
|
@@ -31050,6 +31081,25 @@ var FLAG_REGISTRY = [
|
|
|
31050
31081
|
// it back on for their own org.
|
|
31051
31082
|
platformAdminOnly: true
|
|
31052
31083
|
},
|
|
31084
|
+
{
|
|
31085
|
+
key: "two-factor-settings",
|
|
31086
|
+
description: "Show Settings > Two-factor authentication, where a console user sets up or removes an authenticator app (ENG-11619). Gates SETTING UP only: anyone who already has an authenticator is asked for a code before a console page loads whatever this flag says, so switching it off never turns an existing user's two-factor off. Phase 1: console pages only, not the API.",
|
|
31087
|
+
flagType: "boolean",
|
|
31088
|
+
// PUBLIC (ADR-0022 §2): the nav reads it via usePublicBooleanFlag and the
|
|
31089
|
+
// page via getPublicBooleanFlagServer, so it is in the GET /flags map. No
|
|
31090
|
+
// env override (UI rollout, not an operator gate). Ships dark (default
|
|
31091
|
+
// false). The staff factor reset on the admin organization page is in
|
|
31092
|
+
// place, so a lost phone is recoverable.
|
|
31093
|
+
public: true,
|
|
31094
|
+
defaultValue: false,
|
|
31095
|
+
// Platform admin only until ENG-11619 phase 2. Phase 1 gates console PAGE
|
|
31096
|
+
// LOADS: an enrolled user's password-only (aal1) session is still accepted
|
|
31097
|
+
// by the Hono API and the webapp's /api/* handlers. An org admin switching
|
|
31098
|
+
// this on would reasonably believe a stolen password is now useless, and
|
|
31099
|
+
// it is not yet (Obi Wan be8af20e689c on #7092). Drop this once phase 2
|
|
31100
|
+
// refuses aal1 there too.
|
|
31101
|
+
platformAdminOnly: true
|
|
31102
|
+
},
|
|
31053
31103
|
{
|
|
31054
31104
|
key: "platform-maintenance-mode",
|
|
31055
31105
|
description: 'Platform-wide maintenance mode (ENG-6506; widened to modes by ENG-11436). off = normal operation (ships dark; channels behave exactly as today). tools-offline = every agent KEEPS conversing but every Augmented tool that WRITES to the control plane refuses with a reason, so nothing is created during a window whose database restore would discard it; reads are untouched. fleet-offline = the previous boolean-true behaviour AND the write gate: admitted human inbound gets a "we are offline for maintenance" notice instead of being dispatched, for whole-platform downtime such as DB upgrades. The modes are CUMULATIVE \u2014 fleet-offline gates writes too, because silencing channel inbound does not stop a /loop or a scheduled task filing work. Read host-side per inbound and per tool call from the flags cache (no MCP restart). (Proactive "back online" follow-up is the ENG-6508 fast-follow, not this flag.)',
|
|
@@ -40194,7 +40244,7 @@ function object(shape, params) {
|
|
|
40194
40244
|
return new ZodMiniObject(def);
|
|
40195
40245
|
}
|
|
40196
40246
|
|
|
40197
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
40247
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
40198
40248
|
function isZ4Schema(s) {
|
|
40199
40249
|
const schema = s;
|
|
40200
40250
|
return !!schema._zod;
|
|
@@ -40278,17 +40328,33 @@ function normalizeObjectSchema(schema) {
|
|
|
40278
40328
|
}
|
|
40279
40329
|
return void 0;
|
|
40280
40330
|
}
|
|
40331
|
+
function getDotPath(path) {
|
|
40332
|
+
if (path.length === 0) {
|
|
40333
|
+
return "object root";
|
|
40334
|
+
}
|
|
40335
|
+
return path.reduce((acc, seg, index) => {
|
|
40336
|
+
if (index === 0) {
|
|
40337
|
+
return String(seg);
|
|
40338
|
+
}
|
|
40339
|
+
if (typeof seg === "number") {
|
|
40340
|
+
return `${acc}[${seg}]`;
|
|
40341
|
+
}
|
|
40342
|
+
return `${acc}.${seg}`;
|
|
40343
|
+
}, "");
|
|
40344
|
+
}
|
|
40281
40345
|
function getParseErrorMessage(error2) {
|
|
40282
40346
|
if (error2 && typeof error2 === "object") {
|
|
40347
|
+
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
40348
|
+
return error2.issues.map((i) => {
|
|
40349
|
+
if (!i.path?.length) {
|
|
40350
|
+
return i.message;
|
|
40351
|
+
}
|
|
40352
|
+
return `${i.message} at ${getDotPath(i.path)}`;
|
|
40353
|
+
}).join("\n");
|
|
40354
|
+
}
|
|
40283
40355
|
if ("message" in error2 && typeof error2.message === "string") {
|
|
40284
40356
|
return error2.message;
|
|
40285
40357
|
}
|
|
40286
|
-
if ("issues" in error2 && Array.isArray(error2.issues) && error2.issues.length > 0) {
|
|
40287
|
-
const firstIssue = error2.issues[0];
|
|
40288
|
-
if (firstIssue && typeof firstIssue === "object" && "message" in firstIssue) {
|
|
40289
|
-
return String(firstIssue.message);
|
|
40290
|
-
}
|
|
40291
|
-
}
|
|
40292
40358
|
try {
|
|
40293
40359
|
return JSON.stringify(error2);
|
|
40294
40360
|
} catch {
|
|
@@ -41033,7 +41099,7 @@ function preprocess(fn, schema) {
|
|
|
41033
41099
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
41034
41100
|
config(en_default2());
|
|
41035
41101
|
|
|
41036
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
41102
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
41037
41103
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
41038
41104
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
41039
41105
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
@@ -41043,10 +41109,9 @@ var ProgressTokenSchema = union([string2(), number2().int()]);
|
|
|
41043
41109
|
var CursorSchema = string2();
|
|
41044
41110
|
var TaskCreationParamsSchema = looseObject({
|
|
41045
41111
|
/**
|
|
41046
|
-
*
|
|
41047
|
-
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
41112
|
+
* Requested duration in milliseconds to retain task from creation.
|
|
41048
41113
|
*/
|
|
41049
|
-
ttl:
|
|
41114
|
+
ttl: number2().optional(),
|
|
41050
41115
|
/**
|
|
41051
41116
|
* Time in milliseconds to wait between task status requests.
|
|
41052
41117
|
*/
|
|
@@ -41346,7 +41411,11 @@ var ClientCapabilitiesSchema = object2({
|
|
|
41346
41411
|
/**
|
|
41347
41412
|
* Present if the client supports task creation.
|
|
41348
41413
|
*/
|
|
41349
|
-
tasks: ClientTasksCapabilitySchema.optional()
|
|
41414
|
+
tasks: ClientTasksCapabilitySchema.optional(),
|
|
41415
|
+
/**
|
|
41416
|
+
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
41417
|
+
*/
|
|
41418
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
41350
41419
|
});
|
|
41351
41420
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
41352
41421
|
/**
|
|
@@ -41407,7 +41476,11 @@ var ServerCapabilitiesSchema = object2({
|
|
|
41407
41476
|
/**
|
|
41408
41477
|
* Present if the server supports task creation.
|
|
41409
41478
|
*/
|
|
41410
|
-
tasks: ServerTasksCapabilitySchema.optional()
|
|
41479
|
+
tasks: ServerTasksCapabilitySchema.optional(),
|
|
41480
|
+
/**
|
|
41481
|
+
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
41482
|
+
*/
|
|
41483
|
+
extensions: record(string2(), AssertObjectSchema).optional()
|
|
41411
41484
|
});
|
|
41412
41485
|
var InitializeResultSchema = ResultSchema.extend({
|
|
41413
41486
|
/**
|
|
@@ -41599,6 +41672,12 @@ var ResourceSchema = object2({
|
|
|
41599
41672
|
* The MIME type of this resource, if known.
|
|
41600
41673
|
*/
|
|
41601
41674
|
mimeType: optional(string2()),
|
|
41675
|
+
/**
|
|
41676
|
+
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
41677
|
+
*
|
|
41678
|
+
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
41679
|
+
*/
|
|
41680
|
+
size: optional(number2()),
|
|
41602
41681
|
/**
|
|
41603
41682
|
* Optional annotations for the client.
|
|
41604
41683
|
*/
|
|
@@ -42551,7 +42630,7 @@ var UrlElicitationRequiredError = class extends McpError {
|
|
|
42551
42630
|
}
|
|
42552
42631
|
};
|
|
42553
42632
|
|
|
42554
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
42633
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
42555
42634
|
function isTerminal(status) {
|
|
42556
42635
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
42557
42636
|
}
|
|
@@ -43840,7 +43919,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
43840
43919
|
return combined;
|
|
43841
43920
|
};
|
|
43842
43921
|
|
|
43843
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
43922
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
43844
43923
|
function mapMiniTarget(t) {
|
|
43845
43924
|
if (!t)
|
|
43846
43925
|
return "draft-7";
|
|
@@ -43882,7 +43961,7 @@ function parseWithCompat(schema, data) {
|
|
|
43882
43961
|
return result.data;
|
|
43883
43962
|
}
|
|
43884
43963
|
|
|
43885
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
43964
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
43886
43965
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
|
|
43887
43966
|
var Protocol = class {
|
|
43888
43967
|
constructor(_options) {
|
|
@@ -43923,6 +44002,9 @@ var Protocol = class {
|
|
|
43923
44002
|
this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
|
|
43924
44003
|
const handleTaskResult = async () => {
|
|
43925
44004
|
const taskId = request.params.taskId;
|
|
44005
|
+
if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
|
|
44006
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
44007
|
+
}
|
|
43926
44008
|
if (this._taskMessageQueue) {
|
|
43927
44009
|
let queuedMessage;
|
|
43928
44010
|
while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
|
|
@@ -43953,12 +44035,12 @@ var Protocol = class {
|
|
|
43953
44035
|
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
|
|
43954
44036
|
}
|
|
43955
44037
|
if (!isTerminal(task.status)) {
|
|
43956
|
-
await this._waitForTaskUpdate(taskId, extra.signal);
|
|
44038
|
+
await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
|
|
43957
44039
|
return await handleTaskResult();
|
|
43958
44040
|
}
|
|
43959
44041
|
if (isTerminal(task.status)) {
|
|
43960
44042
|
const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
|
|
43961
|
-
this._clearTaskQueue(taskId);
|
|
44043
|
+
this._clearTaskQueue(taskId, extra.sessionId);
|
|
43962
44044
|
return {
|
|
43963
44045
|
...result,
|
|
43964
44046
|
_meta: {
|
|
@@ -43995,7 +44077,7 @@ var Protocol = class {
|
|
|
43995
44077
|
throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
|
|
43996
44078
|
}
|
|
43997
44079
|
await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
|
|
43998
|
-
this._clearTaskQueue(request.params.taskId);
|
|
44080
|
+
this._clearTaskQueue(request.params.taskId, extra.sessionId);
|
|
43999
44081
|
const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
|
|
44000
44082
|
if (!cancelledTask) {
|
|
44001
44083
|
throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
|
|
@@ -44094,6 +44176,10 @@ var Protocol = class {
|
|
|
44094
44176
|
this._progressHandlers.clear();
|
|
44095
44177
|
this._taskProgressTokens.clear();
|
|
44096
44178
|
this._pendingDebouncedNotifications.clear();
|
|
44179
|
+
for (const info of this._timeoutInfo.values()) {
|
|
44180
|
+
clearTimeout(info.timeoutId);
|
|
44181
|
+
}
|
|
44182
|
+
this._timeoutInfo.clear();
|
|
44097
44183
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
44098
44184
|
controller.abort();
|
|
44099
44185
|
}
|
|
@@ -44119,6 +44205,19 @@ var Protocol = class {
|
|
|
44119
44205
|
const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
|
|
44120
44206
|
const capturedTransport = this._transport;
|
|
44121
44207
|
const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
|
|
44208
|
+
const sessionId = capturedTransport?.sessionId;
|
|
44209
|
+
const store = this._taskStore;
|
|
44210
|
+
let relatedTaskFound = true;
|
|
44211
|
+
let relatedTaskLookup;
|
|
44212
|
+
if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
|
|
44213
|
+
relatedTaskFound = false;
|
|
44214
|
+
relatedTaskLookup = (async () => {
|
|
44215
|
+
if (!await store.getTask(relatedTaskId, sessionId)) {
|
|
44216
|
+
throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
|
|
44217
|
+
}
|
|
44218
|
+
relatedTaskFound = true;
|
|
44219
|
+
})();
|
|
44220
|
+
}
|
|
44122
44221
|
if (handler === void 0) {
|
|
44123
44222
|
const errorResponse = {
|
|
44124
44223
|
jsonrpc: "2.0",
|
|
@@ -44128,7 +44227,10 @@ var Protocol = class {
|
|
|
44128
44227
|
message: "Method not found"
|
|
44129
44228
|
}
|
|
44130
44229
|
};
|
|
44131
|
-
if (relatedTaskId &&
|
|
44230
|
+
if (relatedTaskId && relatedTaskLookup) {
|
|
44231
|
+
const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
|
|
44232
|
+
relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
|
|
44233
|
+
} else if (relatedTaskId && this._taskMessageQueue) {
|
|
44132
44234
|
this._enqueueTaskMessage(relatedTaskId, {
|
|
44133
44235
|
type: "error",
|
|
44134
44236
|
message: errorResponse,
|
|
@@ -44179,7 +44281,10 @@ var Protocol = class {
|
|
|
44179
44281
|
closeSSEStream: extra?.closeSSEStream,
|
|
44180
44282
|
closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
|
|
44181
44283
|
};
|
|
44182
|
-
Promise.resolve().then(() => {
|
|
44284
|
+
(relatedTaskLookup ?? Promise.resolve()).then(() => {
|
|
44285
|
+
if (relatedTaskLookup && abortController.signal.aborted) {
|
|
44286
|
+
throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
|
|
44287
|
+
}
|
|
44183
44288
|
if (taskCreationParams) {
|
|
44184
44289
|
this.assertTaskHandlerCapability(request.method);
|
|
44185
44290
|
}
|
|
@@ -44214,7 +44319,7 @@ var Protocol = class {
|
|
|
44214
44319
|
...error2["data"] !== void 0 && { data: error2["data"] }
|
|
44215
44320
|
}
|
|
44216
44321
|
};
|
|
44217
|
-
if (relatedTaskId && this._taskMessageQueue) {
|
|
44322
|
+
if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
|
|
44218
44323
|
await this._enqueueTaskMessage(relatedTaskId, {
|
|
44219
44324
|
type: "error",
|
|
44220
44325
|
message: errorResponse,
|
|
@@ -44224,7 +44329,9 @@ var Protocol = class {
|
|
|
44224
44329
|
await capturedTransport?.send(errorResponse);
|
|
44225
44330
|
}
|
|
44226
44331
|
}).catch((error2) => this._onerror(new Error(`Failed to send response: ${error2}`))).finally(() => {
|
|
44227
|
-
this._requestHandlerAbortControllers.
|
|
44332
|
+
if (this._requestHandlerAbortControllers.get(request.id) === abortController) {
|
|
44333
|
+
this._requestHandlerAbortControllers.delete(request.id);
|
|
44334
|
+
}
|
|
44228
44335
|
});
|
|
44229
44336
|
}
|
|
44230
44337
|
_onprogress(notification) {
|
|
@@ -44692,7 +44799,7 @@ var Protocol = class {
|
|
|
44692
44799
|
throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
|
|
44693
44800
|
}
|
|
44694
44801
|
const maxQueueSize = this._options?.maxTaskQueueSize;
|
|
44695
|
-
await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
|
|
44802
|
+
await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
|
|
44696
44803
|
}
|
|
44697
44804
|
/**
|
|
44698
44805
|
* Clears the message queue for a task and rejects any pending request resolvers.
|
|
@@ -44721,12 +44828,13 @@ var Protocol = class {
|
|
|
44721
44828
|
* Uses polling to check for updates at the task's configured poll interval.
|
|
44722
44829
|
* @param taskId The task ID to wait for
|
|
44723
44830
|
* @param signal Abort signal to cancel the wait
|
|
44831
|
+
* @param sessionId Session of the request that waits, passed to the task store
|
|
44724
44832
|
* @returns Promise that resolves when an update occurs or rejects if aborted
|
|
44725
44833
|
*/
|
|
44726
|
-
async _waitForTaskUpdate(taskId, signal) {
|
|
44834
|
+
async _waitForTaskUpdate(taskId, signal, sessionId) {
|
|
44727
44835
|
let interval = this._options?.defaultTaskPollInterval ?? 1e3;
|
|
44728
44836
|
try {
|
|
44729
|
-
const task = await this._taskStore?.getTask(taskId);
|
|
44837
|
+
const task = await this._taskStore?.getTask(taskId, sessionId);
|
|
44730
44838
|
if (task?.pollInterval) {
|
|
44731
44839
|
interval = task.pollInterval;
|
|
44732
44840
|
}
|
|
@@ -44830,7 +44938,7 @@ function mergeCapabilities(base, additional) {
|
|
|
44830
44938
|
return result;
|
|
44831
44939
|
}
|
|
44832
44940
|
|
|
44833
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
44941
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
44834
44942
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
44835
44943
|
var import_ajv_formats3 = __toESM(require_dist(), 1);
|
|
44836
44944
|
function createDefaultAjvInstance() {
|
|
@@ -44898,7 +45006,7 @@ var AjvJsonSchemaValidator = class {
|
|
|
44898
45006
|
}
|
|
44899
45007
|
};
|
|
44900
45008
|
|
|
44901
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45009
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
44902
45010
|
var ExperimentalServerTasks = class {
|
|
44903
45011
|
constructor(_server) {
|
|
44904
45012
|
this._server = _server;
|
|
@@ -45111,7 +45219,7 @@ var ExperimentalServerTasks = class {
|
|
|
45111
45219
|
}
|
|
45112
45220
|
};
|
|
45113
45221
|
|
|
45114
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45222
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
45115
45223
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
45116
45224
|
if (!requests) {
|
|
45117
45225
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -45146,7 +45254,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
45146
45254
|
}
|
|
45147
45255
|
}
|
|
45148
45256
|
|
|
45149
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45257
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
45150
45258
|
var Server = class extends Protocol {
|
|
45151
45259
|
/**
|
|
45152
45260
|
* Initializes this server with the given name and version information.
|
|
@@ -45212,16 +45320,7 @@ var Server = class extends Protocol {
|
|
|
45212
45320
|
if (!methodSchema) {
|
|
45213
45321
|
throw new Error("Schema is missing a method literal");
|
|
45214
45322
|
}
|
|
45215
|
-
|
|
45216
|
-
if (isZ4Schema(methodSchema)) {
|
|
45217
|
-
const v4Schema = methodSchema;
|
|
45218
|
-
const v4Def = v4Schema._zod?.def;
|
|
45219
|
-
methodValue = v4Def?.value ?? v4Schema.value;
|
|
45220
|
-
} else {
|
|
45221
|
-
const v3Schema = methodSchema;
|
|
45222
|
-
const legacyDef = v3Schema._def;
|
|
45223
|
-
methodValue = legacyDef?.value ?? v3Schema.value;
|
|
45224
|
-
}
|
|
45323
|
+
const methodValue = getLiteralValue(methodSchema);
|
|
45225
45324
|
if (typeof methodValue !== "string") {
|
|
45226
45325
|
throw new Error("Schema method literal must be a string");
|
|
45227
45326
|
}
|
|
@@ -45526,7 +45625,7 @@ var Server = class extends Protocol {
|
|
|
45526
45625
|
}
|
|
45527
45626
|
};
|
|
45528
45627
|
|
|
45529
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45628
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
45530
45629
|
var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
|
|
45531
45630
|
function isCompletable(schema) {
|
|
45532
45631
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -45540,7 +45639,7 @@ var McpZodTypeKind;
|
|
|
45540
45639
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
45541
45640
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
45542
45641
|
|
|
45543
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45642
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
45544
45643
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
45545
45644
|
function validateToolName(name) {
|
|
45546
45645
|
const warnings = [];
|
|
@@ -45598,7 +45697,7 @@ function validateAndWarnToolName(name) {
|
|
|
45598
45697
|
return result.isValid;
|
|
45599
45698
|
}
|
|
45600
45699
|
|
|
45601
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45700
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
45602
45701
|
var ExperimentalMcpServerTasks = class {
|
|
45603
45702
|
constructor(_mcpServer) {
|
|
45604
45703
|
this._mcpServer = _mcpServer;
|
|
@@ -45613,7 +45712,43 @@ var ExperimentalMcpServerTasks = class {
|
|
|
45613
45712
|
}
|
|
45614
45713
|
};
|
|
45615
45714
|
|
|
45616
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
45715
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
45716
|
+
function toolInputElementCount(value, max) {
|
|
45717
|
+
let count = 0;
|
|
45718
|
+
const stack = [value];
|
|
45719
|
+
while (stack.length > 0) {
|
|
45720
|
+
const node = stack.pop();
|
|
45721
|
+
if (node === null || typeof node !== "object")
|
|
45722
|
+
continue;
|
|
45723
|
+
if (Array.isArray(node)) {
|
|
45724
|
+
for (const child of node) {
|
|
45725
|
+
if (++count > max)
|
|
45726
|
+
return count;
|
|
45727
|
+
if (child !== null && typeof child === "object")
|
|
45728
|
+
stack.push(child);
|
|
45729
|
+
}
|
|
45730
|
+
} else {
|
|
45731
|
+
for (const key in node) {
|
|
45732
|
+
if (!Object.prototype.hasOwnProperty.call(node, key))
|
|
45733
|
+
continue;
|
|
45734
|
+
if (++count > max)
|
|
45735
|
+
return count;
|
|
45736
|
+
const child = node[key];
|
|
45737
|
+
if (child !== null && typeof child === "object")
|
|
45738
|
+
stack.push(child);
|
|
45739
|
+
}
|
|
45740
|
+
}
|
|
45741
|
+
}
|
|
45742
|
+
return count;
|
|
45743
|
+
}
|
|
45744
|
+
function resolveMaxToolInputElements(value) {
|
|
45745
|
+
if (value === void 0 || value === Infinity)
|
|
45746
|
+
return void 0;
|
|
45747
|
+
if (typeof value !== "number" || Number.isNaN(value) || value < 1) {
|
|
45748
|
+
throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
45749
|
+
}
|
|
45750
|
+
return value;
|
|
45751
|
+
}
|
|
45617
45752
|
var McpServer = class {
|
|
45618
45753
|
constructor(serverInfo, options) {
|
|
45619
45754
|
this._registeredResources = {};
|
|
@@ -45625,6 +45760,7 @@ var McpServer = class {
|
|
|
45625
45760
|
this._resourceHandlersInitialized = false;
|
|
45626
45761
|
this._promptHandlersInitialized = false;
|
|
45627
45762
|
this.server = new Server(serverInfo, options);
|
|
45763
|
+
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
45628
45764
|
}
|
|
45629
45765
|
/**
|
|
45630
45766
|
* Access experimental features.
|
|
@@ -45755,12 +45891,15 @@ var McpServer = class {
|
|
|
45755
45891
|
* Validates tool input arguments against the tool's input schema.
|
|
45756
45892
|
*/
|
|
45757
45893
|
async validateToolInput(tool, args, toolName) {
|
|
45894
|
+
if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) {
|
|
45895
|
+
throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
|
|
45896
|
+
}
|
|
45758
45897
|
if (!tool.inputSchema) {
|
|
45759
45898
|
return void 0;
|
|
45760
45899
|
}
|
|
45761
45900
|
const inputObj = normalizeObjectSchema(tool.inputSchema);
|
|
45762
45901
|
const schemaToParse = inputObj ?? tool.inputSchema;
|
|
45763
|
-
const parseResult = await safeParseAsync2(schemaToParse, args);
|
|
45902
|
+
const parseResult = await safeParseAsync2(schemaToParse, args ?? {});
|
|
45764
45903
|
if (!parseResult.success) {
|
|
45765
45904
|
const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
45766
45905
|
const errorMessage = getParseErrorMessage(error2);
|
|
@@ -45998,7 +46137,7 @@ var McpServer = class {
|
|
|
45998
46137
|
}
|
|
45999
46138
|
if (prompt.argsSchema) {
|
|
46000
46139
|
const argsObj = normalizeObjectSchema(prompt.argsSchema);
|
|
46001
|
-
const parseResult = await safeParseAsync2(argsObj, request.params.arguments);
|
|
46140
|
+
const parseResult = await safeParseAsync2(argsObj, request.params.arguments ?? {});
|
|
46002
46141
|
if (!parseResult.success) {
|
|
46003
46142
|
const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
|
|
46004
46143
|
const errorMessage = getParseErrorMessage(error2);
|
|
@@ -46237,6 +46376,9 @@ var McpServer = class {
|
|
|
46237
46376
|
annotations = rest.shift();
|
|
46238
46377
|
}
|
|
46239
46378
|
} else if (typeof firstArg === "object" && firstArg !== null) {
|
|
46379
|
+
if (Object.values(firstArg).some((v) => typeof v === "object" && v !== null)) {
|
|
46380
|
+
throw new Error(`Tool ${name} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);
|
|
46381
|
+
}
|
|
46240
46382
|
annotations = rest.shift();
|
|
46241
46383
|
}
|
|
46242
46384
|
}
|
|
@@ -46355,6 +46497,9 @@ function getZodSchemaObject(schema) {
|
|
|
46355
46497
|
if (isZodRawShapeCompat(schema)) {
|
|
46356
46498
|
return objectFromShape(schema);
|
|
46357
46499
|
}
|
|
46500
|
+
if (!isZodSchemaInstance(schema)) {
|
|
46501
|
+
throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");
|
|
46502
|
+
}
|
|
46358
46503
|
return schema;
|
|
46359
46504
|
}
|
|
46360
46505
|
function promptArgumentsFromSchema(schema) {
|
|
@@ -46399,12 +46544,21 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
46399
46544
|
}
|
|
46400
46545
|
};
|
|
46401
46546
|
|
|
46402
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
46547
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
46403
46548
|
import process2 from "process";
|
|
46404
46549
|
|
|
46405
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
46550
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
46551
|
+
var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
|
|
46406
46552
|
var ReadBuffer = class {
|
|
46553
|
+
constructor(options) {
|
|
46554
|
+
this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
|
|
46555
|
+
}
|
|
46407
46556
|
append(chunk) {
|
|
46557
|
+
const newSize = (this._buffer?.length ?? 0) + chunk.length;
|
|
46558
|
+
if (newSize > this._maxBufferSize) {
|
|
46559
|
+
this.clear();
|
|
46560
|
+
throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
|
|
46561
|
+
}
|
|
46408
46562
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
46409
46563
|
}
|
|
46410
46564
|
readMessage() {
|
|
@@ -46430,20 +46584,26 @@ function serializeMessage(message) {
|
|
|
46430
46584
|
return JSON.stringify(message) + "\n";
|
|
46431
46585
|
}
|
|
46432
46586
|
|
|
46433
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
46587
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
46434
46588
|
var StdioServerTransport = class {
|
|
46435
|
-
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
46589
|
+
constructor(_stdin = process2.stdin, _stdout = process2.stdout, options) {
|
|
46436
46590
|
this._stdin = _stdin;
|
|
46437
46591
|
this._stdout = _stdout;
|
|
46438
|
-
this._readBuffer = new ReadBuffer();
|
|
46439
46592
|
this._started = false;
|
|
46440
46593
|
this._ondata = (chunk) => {
|
|
46441
|
-
|
|
46442
|
-
|
|
46594
|
+
try {
|
|
46595
|
+
this._readBuffer.append(chunk);
|
|
46596
|
+
this.processReadBuffer();
|
|
46597
|
+
} catch (error2) {
|
|
46598
|
+
this.onerror?.(error2);
|
|
46599
|
+
this.close().catch(() => {
|
|
46600
|
+
});
|
|
46601
|
+
}
|
|
46443
46602
|
};
|
|
46444
46603
|
this._onerror = (error2) => {
|
|
46445
46604
|
this.onerror?.(error2);
|
|
46446
46605
|
};
|
|
46606
|
+
this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
|
|
46447
46607
|
}
|
|
46448
46608
|
/**
|
|
46449
46609
|
* Starts listening for messages on stdin.
|
|
@@ -47350,6 +47510,15 @@ var ARTEFACT_KINDS_MCP = [
|
|
|
47350
47510
|
];
|
|
47351
47511
|
|
|
47352
47512
|
// src/kanban-write-outcome.ts
|
|
47513
|
+
function approvalRedirectNotice(data, match = {}) {
|
|
47514
|
+
const entries = data?.approval_wait_redirects;
|
|
47515
|
+
if (!Array.isArray(entries) || entries.length === 0) return "";
|
|
47516
|
+
const relevant = entries.filter((e) => match.id === void 0 || e?.id === void 0 || e.id === match.id);
|
|
47517
|
+
return relevant.map((e) => {
|
|
47518
|
+
if (typeof e?.message === "string" && e.message.trim()) return ` ${e.message.trim()}`;
|
|
47519
|
+
return typeof e?.approval_request_id === "string" ? ` This card is already waiting on approval ${e.approval_request_id}; it stays parked on that approval.` : "";
|
|
47520
|
+
}).filter((m) => m.length > 0).join("");
|
|
47521
|
+
}
|
|
47353
47522
|
function noticeCloseNotice(data) {
|
|
47354
47523
|
const entries = data?.notice_close_warnings;
|
|
47355
47524
|
if (!Array.isArray(entries) || entries.length === 0) return "";
|
|
@@ -47951,6 +48120,19 @@ function describeButtonsRequestResult(resp, channelId, optionCount) {
|
|
|
47951
48120
|
}
|
|
47952
48121
|
|
|
47953
48122
|
// src/approval-tools.ts
|
|
48123
|
+
function describeKanbanLink(requestedCardId, resp) {
|
|
48124
|
+
if (!requestedCardId) return "";
|
|
48125
|
+
if (resp.duplicate) {
|
|
48126
|
+
return ` The card link was not re-checked on this retry; confirm card ${requestedCardId} shows as waiting on the approval with kanban_get.`;
|
|
48127
|
+
}
|
|
48128
|
+
const link = resp.kanban_link;
|
|
48129
|
+
if (link?.linked) return ` Card ${link.kanban_item_id} is now parked on this approval; the approver can decide it from the card.`;
|
|
48130
|
+
const why = link?.reason ?? "not_reported";
|
|
48131
|
+
if (why === "link_stamp_failed") {
|
|
48132
|
+
return ` Card ${requestedCardId} was parked on this approval but the link could not be recorded (link_stamp_failed), so the approver can NOT decide it from the card: they have to use the Approvals page. Do not re-park the card; tell the approver to decide it on the Approvals page.`;
|
|
48133
|
+
}
|
|
48134
|
+
return ` Card ${requestedCardId} was NOT linked to this approval (${why}), so the card is not waiting on it and answering the card will not decide it. Leave the request as is (the approver can still decide it from the Approvals page) and do not park the card as a human Approve/Deny wait.`;
|
|
48135
|
+
}
|
|
47954
48136
|
function statusToOutcome(status) {
|
|
47955
48137
|
switch (status) {
|
|
47956
48138
|
case "active":
|
|
@@ -47976,7 +48158,8 @@ function render(result) {
|
|
|
47976
48158
|
outcome: result.outcome,
|
|
47977
48159
|
...result.reason ? { reason: result.reason } : {},
|
|
47978
48160
|
...result.result_payload != null ? { result_payload: result.result_payload } : {},
|
|
47979
|
-
...result.expires_at ? { expires_at: result.expires_at } : {}
|
|
48161
|
+
...result.expires_at ? { expires_at: result.expires_at } : {},
|
|
48162
|
+
...result.kanban_link ? { kanban_link: result.kanban_link } : {}
|
|
47980
48163
|
})].filter(Boolean);
|
|
47981
48164
|
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
47982
48165
|
}
|
|
@@ -47992,7 +48175,10 @@ function registerApprovalTools(server2, deps) {
|
|
|
47992
48175
|
detail: external_exports.record(external_exports.unknown()).optional().describe(
|
|
47993
48176
|
"Optional structured context for the approver (display + audit only; never executed). When the action is sending an email, include email: { to, from, subject } (to: an address or a list of them; from: the mailbox it goes out from) so the approval card shows From / To / Subject. Asking again with a different detail under the same idempotency_key is a different request."
|
|
47994
48177
|
),
|
|
47995
|
-
ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out (default 3600; clamped to [60, 86400]).")
|
|
48178
|
+
ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out (default 3600; clamped to [60, 86400])."),
|
|
48179
|
+
kanban_item_id: external_exports.string().uuid().optional().describe(
|
|
48180
|
+
'The id of YOUR kanban card this approval is about. Pass it whenever the ask belongs to a card: the platform tries to park that card as waiting on this approval, so the approver can Approve/Deny from the card itself and the answer reaches this request. The result says whether the link happened (kanban_link); if it did not, the reason is given and the card is NOT waiting on the approval. Do NOT also park the card as a "human" wait with your own Approve/Deny choices; that creates a second ask the approval never hears, and the request expires.'
|
|
48181
|
+
)
|
|
47996
48182
|
},
|
|
47997
48183
|
async (params) => {
|
|
47998
48184
|
try {
|
|
@@ -48002,11 +48188,18 @@ function registerApprovalTools(server2, deps) {
|
|
|
48002
48188
|
reason: params.reason,
|
|
48003
48189
|
idempotency_key: params.idempotency_key,
|
|
48004
48190
|
detail: params.detail,
|
|
48005
|
-
ttl_seconds: params.ttl_seconds
|
|
48191
|
+
ttl_seconds: params.ttl_seconds,
|
|
48192
|
+
...params.kanban_item_id ? { kanban_item_id: params.kanban_item_id } : {}
|
|
48006
48193
|
});
|
|
48007
48194
|
const outcome = resp.outcome ?? statusToOutcome(resp.status);
|
|
48008
48195
|
const note = resp.duplicate ? `An open request for this idempotency_key already exists \u2014 re-attached to it (request_id ${resp.request_id}). Poll it with check_approval.` : resp.notification_status === "failed" ? `Approval filed (request_id ${resp.request_id}) but the Manager notification failed (${resp.notification_failure_reason ?? "unknown"}). ${resp.escalated ? "Your org admins were alerted that it is waiting for a decision." : "No human was pinged; tell your operator."} Poll with check_approval.` : `Approval requested (request_id ${resp.request_id}). Your Manager was notified. End your turn; poll with check_approval later.`;
|
|
48009
|
-
return render({
|
|
48196
|
+
return render({
|
|
48197
|
+
request_id: resp.request_id,
|
|
48198
|
+
outcome,
|
|
48199
|
+
expires_at: resp.expires_at ?? null,
|
|
48200
|
+
note: note + describeKanbanLink(params.kanban_item_id, resp),
|
|
48201
|
+
...resp.kanban_link ? { kanban_link: resp.kanban_link } : {}
|
|
48202
|
+
});
|
|
48010
48203
|
} catch (err) {
|
|
48011
48204
|
const msg = err instanceof Error ? err.message : String(err);
|
|
48012
48205
|
return {
|
|
@@ -48906,7 +49099,9 @@ server.tool(
|
|
|
48906
49099
|
data,
|
|
48907
49100
|
{ id: params.id, title: params.title },
|
|
48908
49101
|
label,
|
|
48909
|
-
|
|
49102
|
+
// CS-2178: say so when the server kept the card on its pending approval
|
|
49103
|
+
// instead of the human wait asked for, or the agent re-asks on the card.
|
|
49104
|
+
() => `Moved "${label}" \u2192 ${params.status}.${approvalRedirectNotice(data, { id: params.id })}`
|
|
48910
49105
|
);
|
|
48911
49106
|
return {
|
|
48912
49107
|
content: [{ type: "text", text: outcome.text }],
|
|
@@ -52208,6 +52403,7 @@ server.tool(
|
|
|
52208
52403
|
content: [{ type: "text", text: await resolveArtefactText(params.url) }]
|
|
52209
52404
|
})
|
|
52210
52405
|
);
|
|
52406
|
+
var todayInAgentTz = () => todayInTz();
|
|
52211
52407
|
async function listProjectsText(params) {
|
|
52212
52408
|
const data = await apiPost("/host/my-projects", {
|
|
52213
52409
|
agent_id: AGT_AGENT_ID,
|
|
@@ -52217,7 +52413,8 @@ async function listProjectsText(params) {
|
|
|
52217
52413
|
if (!data.projects.length) {
|
|
52218
52414
|
return "No projects yet. Create one with projects_create (ask the human first), or a human can create one in the console, to group your work under.";
|
|
52219
52415
|
}
|
|
52220
|
-
|
|
52416
|
+
const today = data.today ?? todayInAgentTz();
|
|
52417
|
+
return data.projects.map((p2) => projectListLine(p2, today)).join("\n");
|
|
52221
52418
|
}
|
|
52222
52419
|
async function getProjectText(projectId) {
|
|
52223
52420
|
const data = await apiPost(
|
|
@@ -52229,6 +52426,7 @@ async function getProjectText(projectId) {
|
|
|
52229
52426
|
`Project: ${p2.name} [${p2.status}]`,
|
|
52230
52427
|
`Id: ${p2.id}`,
|
|
52231
52428
|
p2.linear_project_id ? `Linear project: ${p2.linear_project_id}` : null,
|
|
52429
|
+
...projectOwnerDateLines(p2, data.today ?? todayInAgentTz()),
|
|
52232
52430
|
`Created: ${p2.created_at}`,
|
|
52233
52431
|
`Last updated: ${p2.updated_at}`
|
|
52234
52432
|
].filter((s) => s !== null).join("\n");
|
|
@@ -52259,7 +52457,9 @@ async function createProjectText(params) {
|
|
|
52259
52457
|
agent_id: AGT_AGENT_ID,
|
|
52260
52458
|
name: params.name,
|
|
52261
52459
|
status: params.status,
|
|
52262
|
-
linear_project_id: params.linear_project_id
|
|
52460
|
+
linear_project_id: params.linear_project_id,
|
|
52461
|
+
owner_person_id: params.owner_person_id,
|
|
52462
|
+
target_date: params.target_date
|
|
52263
52463
|
});
|
|
52264
52464
|
const p2 = data.project;
|
|
52265
52465
|
return `Created project "${p2.name}" [${p2.status}] (id: ${p2.id}). Tag artefacts with artefacts_assign_project and tasks with kanban_assign_project.`;
|
|
@@ -52270,7 +52470,9 @@ server.tool(
|
|
|
52270
52470
|
{
|
|
52271
52471
|
name: external_exports.string().min(1).max(200).describe('Human-readable project name (e.g. "Q3 launch microsite")'),
|
|
52272
52472
|
status: external_exports.enum(["active", "archived"]).optional().describe('Project status (default "active")'),
|
|
52273
|
-
linear_project_id: external_exports.string().optional().describe("Optional id of a Linear project to deep-link this project to")
|
|
52473
|
+
linear_project_id: external_exports.string().optional().describe("Optional id of a Linear project to deep-link this project to"),
|
|
52474
|
+
owner_person_id: external_exports.string().uuid().optional().describe("Optional: the ONE person accountable for the project (a person_id from directory_lookup, in your organization)"),
|
|
52475
|
+
target_date: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe("Optional: the date the outcome is due, YYYY-MM-DD")
|
|
52274
52476
|
},
|
|
52275
52477
|
async (params) => ({
|
|
52276
52478
|
content: [{ type: "text", text: await createProjectText(params) }]
|
|
@@ -52283,7 +52485,9 @@ async function updateProjectText(params) {
|
|
|
52283
52485
|
agent_id: AGT_AGENT_ID,
|
|
52284
52486
|
name: params.name,
|
|
52285
52487
|
status: params.status,
|
|
52286
|
-
linear_project_id: params.linear_project_id
|
|
52488
|
+
linear_project_id: params.linear_project_id,
|
|
52489
|
+
owner_person_id: params.owner_person_id,
|
|
52490
|
+
target_date: params.target_date
|
|
52287
52491
|
}
|
|
52288
52492
|
);
|
|
52289
52493
|
const p2 = data.project;
|
|
@@ -52291,13 +52495,15 @@ async function updateProjectText(params) {
|
|
|
52291
52495
|
}
|
|
52292
52496
|
server.tool(
|
|
52293
52497
|
"projects_update",
|
|
52294
|
-
'Rename a project, archive or unarchive it, or set/clear its Linear link. Pass only the fields to change. A project is shared by your whole team, so ask the human to confirm before renaming or archiving one, naming the project and the change (e.g. archive "Theoretical Store Profitability"). Archiving hides it from active lists but keeps its tasks and artefacts; set status "active" to undo. Projects have no cover image, so there is nothing to set for one.',
|
|
52498
|
+
'Rename a project, archive or unarchive it, or set/clear its Linear link. Pass only the fields to change. A project is shared by your whole team, so ask the human to confirm before renaming or archiving one, naming the project and the change (e.g. archive "Theoretical Store Profitability"). Archiving hides it from active lists but keeps its tasks and artefacts; set status "active" to undo. Projects have no cover image, so there is nothing to set for one. You can also set or clear its one accountable owner (a person_id from directory_lookup) and its target date (YYYY-MM-DD); pass null to clear either.',
|
|
52295
52499
|
{
|
|
52296
52500
|
project_id: external_exports.string().uuid().describe("The project id returned by projects_list"),
|
|
52297
52501
|
// Trim BEFORE the length check, as the host does (CodeRabbit on #6642).
|
|
52298
52502
|
name: external_exports.string().trim().min(1).max(200).optional().describe("New project name"),
|
|
52299
52503
|
status: external_exports.enum(["active", "archived"]).optional().describe('"archived" to archive, "active" to unarchive'),
|
|
52300
|
-
linear_project_id: external_exports.string().nullable().optional().describe("Linear project id to deep-link, or null to clear the link")
|
|
52504
|
+
linear_project_id: external_exports.string().nullable().optional().describe("Linear project id to deep-link, or null to clear the link"),
|
|
52505
|
+
owner_person_id: external_exports.string().uuid().nullable().optional().describe("The ONE accountable person (a person_id from directory_lookup), or null to clear"),
|
|
52506
|
+
target_date: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional().describe("Date the outcome is due, YYYY-MM-DD, or null to clear")
|
|
52301
52507
|
},
|
|
52302
52508
|
async (params) => ({
|
|
52303
52509
|
content: [{ type: "text", text: await updateProjectText(params) }]
|