@tano.page/mcp 0.13.0 → 0.15.0
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/tano-mcp.cjs +88 -36
- package/package.json +4 -4
package/dist/tano-mcp.cjs
CHANGED
|
@@ -3404,7 +3404,7 @@ var require_Document = __commonJS({
|
|
|
3404
3404
|
var applyReviver = require_applyReviver();
|
|
3405
3405
|
var createNode = require_createNode();
|
|
3406
3406
|
var directives = require_directives();
|
|
3407
|
-
var
|
|
3407
|
+
var Document2 = class _Document {
|
|
3408
3408
|
constructor(value, replacer, options) {
|
|
3409
3409
|
this.commentBefore = null;
|
|
3410
3410
|
this.comment = null;
|
|
@@ -3694,7 +3694,7 @@ var require_Document = __commonJS({
|
|
|
3694
3694
|
return true;
|
|
3695
3695
|
throw new Error("Expected a YAML collection as document contents");
|
|
3696
3696
|
}
|
|
3697
|
-
exports2.Document =
|
|
3697
|
+
exports2.Document = Document2;
|
|
3698
3698
|
}
|
|
3699
3699
|
});
|
|
3700
3700
|
|
|
@@ -5059,13 +5059,13 @@ var require_compose_node = __commonJS({
|
|
|
5059
5059
|
var require_compose_doc = __commonJS({
|
|
5060
5060
|
"../../node_modules/yaml/dist/compose/compose-doc.js"(exports2) {
|
|
5061
5061
|
"use strict";
|
|
5062
|
-
var
|
|
5062
|
+
var Document2 = require_Document();
|
|
5063
5063
|
var composeNode = require_compose_node();
|
|
5064
5064
|
var resolveEnd = require_resolve_end();
|
|
5065
5065
|
var resolveProps = require_resolve_props();
|
|
5066
5066
|
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
5067
5067
|
const opts = Object.assign({ _directives: directives }, options);
|
|
5068
|
-
const doc = new
|
|
5068
|
+
const doc = new Document2.Document(void 0, opts);
|
|
5069
5069
|
const ctx = {
|
|
5070
5070
|
atKey: false,
|
|
5071
5071
|
atRoot: true,
|
|
@@ -5104,7 +5104,7 @@ var require_composer = __commonJS({
|
|
|
5104
5104
|
"use strict";
|
|
5105
5105
|
var node_process = require("process");
|
|
5106
5106
|
var directives = require_directives();
|
|
5107
|
-
var
|
|
5107
|
+
var Document2 = require_Document();
|
|
5108
5108
|
var errors = require_errors();
|
|
5109
5109
|
var identity = require_identity();
|
|
5110
5110
|
var composeDoc = require_compose_doc();
|
|
@@ -5293,7 +5293,7 @@ ${end.comment}` : end.comment;
|
|
|
5293
5293
|
this.doc = null;
|
|
5294
5294
|
} else if (forceDoc) {
|
|
5295
5295
|
const opts = Object.assign({ _directives: this.directives }, this.options);
|
|
5296
|
-
const doc = new
|
|
5296
|
+
const doc = new Document2.Document(void 0, opts);
|
|
5297
5297
|
if (this.atDirectives)
|
|
5298
5298
|
this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
|
|
5299
5299
|
doc.range = [0, endOffset, endOffset];
|
|
@@ -7215,7 +7215,7 @@ var require_public_api = __commonJS({
|
|
|
7215
7215
|
"../../node_modules/yaml/dist/public-api.js"(exports2) {
|
|
7216
7216
|
"use strict";
|
|
7217
7217
|
var composer = require_composer();
|
|
7218
|
-
var
|
|
7218
|
+
var Document2 = require_Document();
|
|
7219
7219
|
var errors = require_errors();
|
|
7220
7220
|
var log = require_log();
|
|
7221
7221
|
var identity = require_identity();
|
|
@@ -7298,7 +7298,7 @@ var require_public_api = __commonJS({
|
|
|
7298
7298
|
}
|
|
7299
7299
|
if (identity.isDocument(value) && !_replacer)
|
|
7300
7300
|
return value.toString(options);
|
|
7301
|
-
return new
|
|
7301
|
+
return new Document2.Document(value, _replacer, options).toString(options);
|
|
7302
7302
|
}
|
|
7303
7303
|
exports2.parse = parse3;
|
|
7304
7304
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
@@ -7312,7 +7312,7 @@ var require_dist = __commonJS({
|
|
|
7312
7312
|
"../../node_modules/yaml/dist/index.js"(exports2) {
|
|
7313
7313
|
"use strict";
|
|
7314
7314
|
var composer = require_composer();
|
|
7315
|
-
var
|
|
7315
|
+
var Document2 = require_Document();
|
|
7316
7316
|
var Schema = require_Schema();
|
|
7317
7317
|
var errors = require_errors();
|
|
7318
7318
|
var Alias = require_Alias();
|
|
@@ -7328,7 +7328,7 @@ var require_dist = __commonJS({
|
|
|
7328
7328
|
var publicApi = require_public_api();
|
|
7329
7329
|
var visit2 = require_visit();
|
|
7330
7330
|
exports2.Composer = composer.Composer;
|
|
7331
|
-
exports2.Document =
|
|
7331
|
+
exports2.Document = Document2.Document;
|
|
7332
7332
|
exports2.Schema = Schema.Schema;
|
|
7333
7333
|
exports2.YAMLError = errors.YAMLError;
|
|
7334
7334
|
exports2.YAMLParseError = errors.YAMLParseError;
|
|
@@ -35947,7 +35947,7 @@ function parseAssistantSession(value) {
|
|
|
35947
35947
|
throw new Error("\u52A9\u624B\u4E0A\u4E0B\u6587\u683C\u5F0F\u65E0\u6548\uFF0C\u539F\u8BB0\u5F55\u5DF2\u4FDD\u7559");
|
|
35948
35948
|
}
|
|
35949
35949
|
for (const proposal of message.proposals ?? []) {
|
|
35950
|
-
if (!proposal || proposal.workspaceId !== session.workspaceId || !text2(proposal.id, 80) || !text2(proposal.runId, 80) || !["edit", "create", "delete", "rename", "move", "object", "relation"].includes(proposal.kind) || !["ready", "applying", "applied", "rejected", "conflicted", "unknown"].includes(proposal.status) || proposal.execution !== void 0 && proposal.execution !== "direct" || !text2(proposal.path, 220) || !text2(proposal.base, 512e3) || !text2(proposal.content, 512e3) || !text2(proposal.reason, 4e3) || proposal.suggestionGroupId !== void 0 && (proposal.kind !== "edit" || !text2(proposal.suggestionGroupId, 80)) || (["edit", "delete", "rename", "move"].includes(proposal.kind) || proposal.kind === "object" && proposal.base !== "") && !text2(proposal.fileId, 80) || (["rename", "move"].includes(proposal.kind) ? !text2(proposal.destination, 220) || !proposal.destination : proposal.destination !== void 0) || proposal.preview && (!text2(proposal.preview.before, 512e3) || !text2(proposal.preview.after, 512e3) || !text2(proposal.preview.path, 220) || proposal.preview.destination !== void 0 && (!["rename", "move"].includes(proposal.kind) || !text2(proposal.preview.destination, 220)) || proposal.preview.diskHash !== null && !text2(proposal.preview.diskHash, 128)) || proposal.applied && (!text2(proposal.applied.before, 512e3) || !text2(proposal.applied.after, 512e3) || !text2(proposal.applied.hash, 128) || !text2(proposal.applied.fileId, 80)))
|
|
35950
|
+
if (!proposal || proposal.workspaceId !== session.workspaceId || !text2(proposal.id, 80) || !text2(proposal.runId, 80) || !["edit", "create", "delete", "rename", "move", "object", "relation", "plugin", "extension"].includes(proposal.kind) || !["ready", "applying", "applied", "rejected", "conflicted", "unknown"].includes(proposal.status) || proposal.execution !== void 0 && proposal.execution !== "direct" || !text2(proposal.path, 220) || !text2(proposal.base, 512e3) || !text2(proposal.content, 512e3) || !text2(proposal.reason, 4e3) || proposal.suggestionGroupId !== void 0 && (proposal.kind !== "edit" || !text2(proposal.suggestionGroupId, 80)) || (["edit", "delete", "rename", "move"].includes(proposal.kind) || proposal.kind === "object" && proposal.base !== "") && !text2(proposal.fileId, 80) || (proposal.kind === "plugin" ? !proposal.pluginAction || !text2(proposal.pluginAction.pluginId, 80) || !text2(proposal.pluginAction.pluginName, 120) || !text2(proposal.pluginAction.toolName, 80) || !["write", "external"].includes(proposal.pluginAction.effect) || proposal.pluginAction.label !== void 0 && !text2(proposal.pluginAction.label, 80) : proposal.pluginAction !== void 0) || (proposal.kind === "extension" ? !proposal.extensionAction || !text2(proposal.extensionAction.namespace, 80) || !proposal.extensionAction.namespace.trim() || !text2(proposal.extensionAction.action, 80) || !proposal.extensionAction.action.trim() || !["write", "external"].includes(proposal.extensionAction.effect) || proposal.extensionAction.label !== void 0 && !text2(proposal.extensionAction.label, 80) || !proposal.extensionAction.payload || typeof proposal.extensionAction.payload !== "object" || Array.isArray(proposal.extensionAction.payload) : proposal.extensionAction !== void 0) || (["rename", "move"].includes(proposal.kind) ? !text2(proposal.destination, 220) || !proposal.destination : proposal.destination !== void 0) || proposal.preview && (!text2(proposal.preview.before, 512e3) || !text2(proposal.preview.after, 512e3) || !text2(proposal.preview.path, 220) || proposal.preview.destination !== void 0 && (!["rename", "move"].includes(proposal.kind) || !text2(proposal.preview.destination, 220)) || proposal.preview.diskHash !== null && !text2(proposal.preview.diskHash, 128)) || proposal.applied && (!text2(proposal.applied.before, 512e3) || !text2(proposal.applied.after, 512e3) || !text2(proposal.applied.hash, 128) || !text2(proposal.applied.fileId, 80) || proposal.applied.undoSnapshot !== void 0 && !text2(proposal.applied.undoSnapshot, 512e3)))
|
|
35951
35951
|
throw new Error("\u52A9\u624B\u4FEE\u6539\u8BB0\u5F55\u683C\u5F0F\u65E0\u6548\uFF0C\u539F\u8BB0\u5F55\u5DF2\u4FDD\u7559");
|
|
35952
35952
|
}
|
|
35953
35953
|
}
|
|
@@ -36010,6 +36010,19 @@ var themeTokenNames = [...themeColorTokens, ...themeFontTokens, ...themeRadiusTo
|
|
|
36010
36010
|
// ../../packages/protocol/src/short-id.ts
|
|
36011
36011
|
var isShortId = (value) => typeof value === "string" && /^[0-9a-f]{6}$/.test(value);
|
|
36012
36012
|
|
|
36013
|
+
// ../../packages/protocol/src/plan-item.ts
|
|
36014
|
+
var DONE_STATUS_VALUES = /* @__PURE__ */ new Set(["done", "completed", "\u5DF2\u5B8C\u6210"]);
|
|
36015
|
+
function isActionableTask(item) {
|
|
36016
|
+
return item.type === "task" || item.type === "event" && item.properties?.checkable === true;
|
|
36017
|
+
}
|
|
36018
|
+
function isDoneStatus(status) {
|
|
36019
|
+
return typeof status === "string" && DONE_STATUS_VALUES.has(status.trim().toLowerCase());
|
|
36020
|
+
}
|
|
36021
|
+
function isPlanCompleted(item) {
|
|
36022
|
+
if (!isActionableTask(item)) return false;
|
|
36023
|
+
return item.properties?.completed === true || isDoneStatus(item.properties?.status);
|
|
36024
|
+
}
|
|
36025
|
+
|
|
36013
36026
|
// ../../packages/protocol/src/task-review.ts
|
|
36014
36027
|
function parseTaskReview(value) {
|
|
36015
36028
|
const review = value;
|
|
@@ -36019,19 +36032,33 @@ function parseTaskReview(value) {
|
|
|
36019
36032
|
}
|
|
36020
36033
|
|
|
36021
36034
|
// ../../packages/protocol/src/task-repeat.ts
|
|
36035
|
+
var ALLOWED_REPEAT_KEYS = /* @__PURE__ */ new Set([
|
|
36036
|
+
"version",
|
|
36037
|
+
"mode",
|
|
36038
|
+
"frequency",
|
|
36039
|
+
"interval",
|
|
36040
|
+
"anchor",
|
|
36041
|
+
"until",
|
|
36042
|
+
"exdates"
|
|
36043
|
+
]);
|
|
36022
36044
|
function parseTaskRepeat(value) {
|
|
36023
36045
|
const rule = value;
|
|
36024
|
-
if (!rule || typeof rule !== "object" || Array.isArray(rule) || rule.version !== 1 || !["daily", "weekly", "monthly"].includes(rule.frequency) || !Number.isInteger(rule.interval) || rule.interval < 1 || rule.interval > 99 || !validEventDate(rule.anchor) || rule.until !== void 0 && (!validEventDate(rule.until) || rule.until < rule.anchor) || Object.keys(rule).some((key) => !
|
|
36046
|
+
if (!rule || typeof rule !== "object" || Array.isArray(rule) || rule.version !== 1 || rule.mode !== void 0 && !["after_complete", "schedule"].includes(rule.mode) || !["daily", "weekly", "monthly"].includes(rule.frequency) || !Number.isInteger(rule.interval) || rule.interval < 1 || rule.interval > 99 || !validEventDate(rule.anchor) || rule.until !== void 0 && (!validEventDate(rule.until) || rule.until < rule.anchor) || rule.exdates !== void 0 && (!Array.isArray(rule.exdates) || rule.exdates.length > 500 || !rule.exdates.every((day) => validEventDate(day))) || Object.keys(rule).some((key) => !ALLOWED_REPEAT_KEYS.has(key))) {
|
|
36047
|
+
throw new Error("\u91CD\u590D\u4EFB\u52A1\u89C4\u5219\u65E0\u6548");
|
|
36048
|
+
}
|
|
36025
36049
|
return rule;
|
|
36026
36050
|
}
|
|
36027
36051
|
function validateTaskRepeat(type, properties) {
|
|
36028
36052
|
if (properties.repeat !== void 0) {
|
|
36029
|
-
|
|
36030
|
-
|
|
36053
|
+
const rule = parseTaskRepeat(properties.repeat);
|
|
36054
|
+
if (rule.mode !== "schedule" && !isActionableTask({ type, properties })) {
|
|
36055
|
+
throw new Error("\u53EA\u6709\u4EFB\u52A1\u53EF\u4EE5\u8BBE\u7F6E\u91CD\u590D\u89C4\u5219");
|
|
36056
|
+
}
|
|
36031
36057
|
}
|
|
36032
36058
|
if (properties.repeatSourceId !== void 0 || properties.repeatOccurrence !== void 0) {
|
|
36033
|
-
if (!isShortId(properties.repeatSourceId) || !validEventDate(properties.repeatOccurrence) || properties.repeat === void 0)
|
|
36059
|
+
if (!isShortId(properties.repeatSourceId) || !validEventDate(properties.repeatOccurrence) || properties.repeat === void 0) {
|
|
36034
36060
|
throw new Error("\u91CD\u590D\u4EFB\u52A1\u5B9E\u4F8B\u8EAB\u4EFD\u65E0\u6548");
|
|
36061
|
+
}
|
|
36035
36062
|
}
|
|
36036
36063
|
}
|
|
36037
36064
|
|
|
@@ -36043,6 +36070,7 @@ var coreObjectTypes = [
|
|
|
36043
36070
|
level: 2,
|
|
36044
36071
|
category: "core",
|
|
36045
36072
|
storage: "record",
|
|
36073
|
+
legacy: true,
|
|
36046
36074
|
fields: [
|
|
36047
36075
|
{ key: "status", label: "\u72B6\u6001", type: "text" },
|
|
36048
36076
|
{ key: "due", label: "\u622A\u6B62\u65E5\u671F", type: "text" },
|
|
@@ -36050,18 +36078,6 @@ var coreObjectTypes = [
|
|
|
36050
36078
|
{ key: "completed", label: "\u5DF2\u5B8C\u6210", type: "boolean" }
|
|
36051
36079
|
]
|
|
36052
36080
|
},
|
|
36053
|
-
{ type: "project", label: "\u9879\u76EE", level: 2, category: "core", storage: "record", fields: [
|
|
36054
|
-
{ key: "status", label: "\u72B6\u6001", type: "text" },
|
|
36055
|
-
{ key: "goal", label: "\u9879\u76EE\u76EE\u6807", type: "text" },
|
|
36056
|
-
{ key: "due", label: "\u622A\u6B62\u65E5\u671F", type: "text" }
|
|
36057
|
-
] },
|
|
36058
|
-
{ type: "experiment", label: "\u5B9E\u9A8C", level: 2, category: "core", storage: "record", fields: [
|
|
36059
|
-
{ key: "status", label: "\u72B6\u6001", type: "text" },
|
|
36060
|
-
{ key: "hypothesis", label: "\u5047\u8BBE", type: "text" },
|
|
36061
|
-
{ key: "result", label: "\u5B9E\u9A8C\u7ED3\u679C", type: "text" },
|
|
36062
|
-
{ key: "metric", label: "\u6307\u6807", type: "number" },
|
|
36063
|
-
{ key: "runAt", label: "\u8FD0\u884C\u65F6\u95F4", type: "datetime" }
|
|
36064
|
-
] },
|
|
36065
36081
|
{ type: "person", label: "\u4EBA\u7269", level: 2, category: "core", storage: "record", fields: [] },
|
|
36066
36082
|
{ type: "document", label: "\u6587\u6863", level: 2, category: "core", storage: "resource", fields: [] },
|
|
36067
36083
|
{
|
|
@@ -36073,10 +36089,16 @@ var coreObjectTypes = [
|
|
|
36073
36089
|
fields: [
|
|
36074
36090
|
{ key: "checkable", label: "\u9700\u8981\u5B8C\u6210", type: "boolean" },
|
|
36075
36091
|
{ key: "completed", label: "\u5DF2\u5B8C\u6210", type: "boolean" },
|
|
36092
|
+
{ key: "status", label: "\u72B6\u6001", type: "text" },
|
|
36093
|
+
{ key: "priority", label: "\u4F18\u5148\u7EA7", type: "number" },
|
|
36076
36094
|
{ key: "due", label: "\u622A\u6B62\u65E5\u671F", type: "text" },
|
|
36077
36095
|
{ key: "date", label: "\u8BA1\u5212\u65E5\u671F\uFF08\u4E0D\u6307\u5B9A\u65F6\u95F4\uFF09", type: "text" },
|
|
36096
|
+
{ key: "endDate", label: "\u7ED3\u675F\u65E5\u671F", type: "text" },
|
|
36078
36097
|
{ key: "start", label: "\u5F00\u59CB\u65F6\u95F4", type: "datetime" },
|
|
36079
|
-
{ key: "end", label: "\u7ED3\u675F\u65F6\u95F4", type: "datetime" }
|
|
36098
|
+
{ key: "end", label: "\u7ED3\u675F\u65F6\u95F4", type: "datetime" },
|
|
36099
|
+
{ key: "allDay", label: "\u5168\u5929", type: "boolean" },
|
|
36100
|
+
{ key: "timezone", label: "\u65F6\u533A", type: "text" },
|
|
36101
|
+
{ key: "location", label: "\u5730\u70B9", type: "text" }
|
|
36080
36102
|
]
|
|
36081
36103
|
},
|
|
36082
36104
|
{ type: "asset", label: "\u8D44\u4EA7", level: 2, category: "core", storage: "resource", fields: [] }
|
|
@@ -36158,13 +36180,11 @@ function validateObjectProperties(type, properties, registry2 = objectTypeRegist
|
|
|
36158
36180
|
validateTaskRepeat(type, properties);
|
|
36159
36181
|
if (properties.deliveryReview !== void 0) {
|
|
36160
36182
|
const review = parseTaskReview(properties.deliveryReview);
|
|
36161
|
-
if (!(
|
|
36162
|
-
if ((
|
|
36183
|
+
if (!isActionableTask({ type, properties })) throw new Error("\u53EA\u6709\u4EFB\u52A1\u53EF\u4EE5\u63D0\u4EA4\u4EA4\u4ED8\u5BA1\u9605");
|
|
36184
|
+
if (isPlanCompleted({ type, properties }) && review.state !== "approved") throw new Error("\u6B64\u4EFB\u52A1\u9700\u7531\u6307\u5B9A\u5BA1\u9605\u4EBA\u786E\u8BA4\u901A\u8FC7\u540E\u5B8C\u6210");
|
|
36163
36185
|
}
|
|
36164
36186
|
const definition = registry2.get(type);
|
|
36165
36187
|
if (!definition) throw new Error(`\u7C7B\u578B ${type} \u672A\u542F\u7528\uFF0C\u8BF7\u5148\u6CE8\u518C\u5BF9\u5E94\u9886\u57DF\u63D2\u4EF6\uFF1B\u539F\u6587\u4EF6\u5DF2\u4FDD\u7559`);
|
|
36166
|
-
if (definition.retired)
|
|
36167
|
-
throw new Error("\u9879\u76EE\u5BF9\u8C61\u5DF2\u505C\u7528\uFF1B\u8BF7\u4F7F\u7528\u5DE5\u4F5C\u533A\u6587\u4EF6\u5939\u548C Markdown \u6587\u6863\u7EC4\u7EC7\u9879\u76EE\uFF0C\u65E7\u8BB0\u5F55\u53EA\u8BFB\u4FDD\u7559");
|
|
36168
36188
|
if (definition.storage !== "record")
|
|
36169
36189
|
throw new Error("\u6587\u6863\u548C\u8D44\u4EA7\u6765\u81EA\u5DE5\u4F5C\u533A\u6587\u4EF6\uFF0C\u4E0D\u521B\u5EFA\u91CD\u590D\u5185\u5BB9\u5BF9\u8C61");
|
|
36170
36190
|
for (const field of definition.fields) {
|
|
@@ -36179,17 +36199,32 @@ function validateObjectProperties(type, properties, registry2 = objectTypeRegist
|
|
|
36179
36199
|
`${field.label}\u683C\u5F0F\u65E0\u6548${field.type === "datetime" ? "\uFF0C\u8BF7\u4F7F\u7528\u5E26\u65F6\u533A\u7684\u65E5\u671F\u65F6\u95F4" : ""}`
|
|
36180
36200
|
);
|
|
36181
36201
|
}
|
|
36182
|
-
if (
|
|
36202
|
+
if (type === "task" && properties.due !== void 0 && properties.due !== "" && !validEventDate(properties.due)) throw new Error("\u622A\u6B62\u65E5\u671F\u683C\u5F0F\u65E0\u6548\uFF0C\u8BF7\u4F7F\u7528 YYYY-MM-DD");
|
|
36183
36203
|
if (type === "event") {
|
|
36184
36204
|
const hasStart = properties.start !== void 0 && properties.start !== "";
|
|
36185
36205
|
const hasEnd = properties.end !== void 0 && properties.end !== "";
|
|
36186
36206
|
const hasDate = properties.date !== void 0 && properties.date !== "";
|
|
36207
|
+
const hasEndDate = properties.endDate !== void 0 && properties.endDate !== "";
|
|
36187
36208
|
if (hasStart !== hasEnd) throw new Error("\u5F00\u59CB\u65F6\u95F4\u548C\u7ED3\u675F\u65F6\u95F4\u9700\u8981\u4E00\u8D77\u586B\u5199");
|
|
36188
36209
|
if (hasStart && Date.parse(String(properties.end)) < Date.parse(String(properties.start)))
|
|
36189
36210
|
throw new Error("\u7ED3\u675F\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4");
|
|
36190
36211
|
if (hasDate && !validEventDate(properties.date)) throw new Error("\u8BA1\u5212\u65E5\u671F\u683C\u5F0F\u65E0\u6548");
|
|
36212
|
+
if (hasEndDate) {
|
|
36213
|
+
if (!hasDate) throw new Error("\u7ED3\u675F\u65E5\u671F\u9700\u8981\u4E0E\u8BA1\u5212\u65E5\u671F\u4E00\u8D77\u586B\u5199");
|
|
36214
|
+
if (!validEventDate(properties.endDate)) throw new Error("\u7ED3\u675F\u65E5\u671F\u683C\u5F0F\u65E0\u6548");
|
|
36215
|
+
if (String(properties.endDate) < String(properties.date)) throw new Error("\u7ED3\u675F\u65E5\u671F\u4E0D\u80FD\u65E9\u4E8E\u8BA1\u5212\u65E5\u671F");
|
|
36216
|
+
}
|
|
36191
36217
|
if (properties.due !== void 0 && properties.due !== "" && !validEventDate(properties.due)) throw new Error("\u622A\u6B62\u65E5\u671F\u683C\u5F0F\u65E0\u6548\uFF0C\u8BF7\u4F7F\u7528 YYYY-MM-DD");
|
|
36192
36218
|
if (hasDate && hasStart) throw new Error("\u8BA1\u5212\u65E5\u671F\u4E0E\u5177\u4F53\u65F6\u95F4\u6BB5\u53EA\u80FD\u9009\u62E9\u4E00\u79CD\u5B89\u6392\u65B9\u5F0F");
|
|
36219
|
+
if (properties.timezone !== void 0 && properties.timezone !== "" && (typeof properties.timezone !== "string" || properties.timezone.length > 100))
|
|
36220
|
+
throw new Error("\u65F6\u533A\u683C\u5F0F\u65E0\u6548");
|
|
36221
|
+
if (properties.location !== void 0 && properties.location !== "" && (typeof properties.location !== "string" || properties.location.length > 500))
|
|
36222
|
+
throw new Error("\u5730\u70B9\u683C\u5F0F\u65E0\u6548");
|
|
36223
|
+
if (properties.reminders !== void 0) {
|
|
36224
|
+
if (!Array.isArray(properties.reminders) || properties.reminders.length > 5 || !properties.reminders.every((item) => typeof item === "number" && Number.isInteger(item) && item >= 0 && item <= 43200)) {
|
|
36225
|
+
throw new Error("\u63D0\u9192\u8BBE\u7F6E\u65E0\u6548");
|
|
36226
|
+
}
|
|
36227
|
+
}
|
|
36193
36228
|
if (properties.completed === true && properties.checkable !== true)
|
|
36194
36229
|
throw new Error("\u53EA\u6709\u9700\u8981\u5B8C\u6210\u7684\u4E8B\u4EF6\u53EF\u4EE5\u6807\u8BB0\u4E3A\u5DF2\u5B8C\u6210");
|
|
36195
36230
|
}
|
|
@@ -36200,6 +36235,9 @@ var workspacePluginPath = ".tano/plugins.tano.json";
|
|
|
36200
36235
|
var pluginPackageLimit = 4 * 1024 * 1024;
|
|
36201
36236
|
var pluginStorageLimit = 256 * 1024;
|
|
36202
36237
|
var pluginCacheLimit = 64 * 1024 * 1024;
|
|
36238
|
+
var workspacePluginPolicyLimit = 1 * 1024 * 1024;
|
|
36239
|
+
var legacyWorkspacePluginPolicyLimit = 16 * 1024 * 1024;
|
|
36240
|
+
var pluginAttachmentWriteLimit = 400 * 1024;
|
|
36203
36241
|
|
|
36204
36242
|
// ../../packages/protocol/src/workspace-paths.ts
|
|
36205
36243
|
var objectDirectory = ".tano/objects";
|
|
@@ -36406,7 +36444,7 @@ function queryFileDatabase(rows, query) {
|
|
|
36406
36444
|
// ../../packages/protocol/src/view-engine.ts
|
|
36407
36445
|
var defaultObjectViewQuery = () => ({
|
|
36408
36446
|
layout: "table",
|
|
36409
|
-
types: [
|
|
36447
|
+
types: [],
|
|
36410
36448
|
includeArchived: false,
|
|
36411
36449
|
filters: [],
|
|
36412
36450
|
sort: { field: "name", direction: "asc" },
|
|
@@ -36724,6 +36762,20 @@ function dataViewRows(table, view, query = "", evaluate = dataEvaluator(table))
|
|
|
36724
36762
|
});
|
|
36725
36763
|
}
|
|
36726
36764
|
|
|
36765
|
+
// ../../packages/protocol/src/plugin-archive.ts
|
|
36766
|
+
var PLUGIN_ARCHIVE_V2_LIMIT = 16 * 1024 * 1024;
|
|
36767
|
+
var crcTable = (() => {
|
|
36768
|
+
const table = new Uint32Array(256);
|
|
36769
|
+
for (let i = 0; i < 256; i++) {
|
|
36770
|
+
let c = i;
|
|
36771
|
+
for (let j = 0; j < 8; j++) {
|
|
36772
|
+
c = (c & 1) !== 0 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
36773
|
+
}
|
|
36774
|
+
table[i] = c >>> 0;
|
|
36775
|
+
}
|
|
36776
|
+
return table;
|
|
36777
|
+
})();
|
|
36778
|
+
|
|
36727
36779
|
// ../../packages/protocol/src/frontmatter.ts
|
|
36728
36780
|
var import_yaml = __toESM(require_dist(), 1);
|
|
36729
36781
|
function propertyValue(value) {
|
|
@@ -36909,7 +36961,7 @@ var AgentWorkspace = class {
|
|
|
36909
36961
|
db;
|
|
36910
36962
|
rootIdentity;
|
|
36911
36963
|
policy;
|
|
36912
|
-
constructor(root, dataDirectory, policy = { access: "review", directories: [""], objectTypes: ["task", "
|
|
36964
|
+
constructor(root, dataDirectory, policy = { access: "review", directories: [""], objectTypes: ["task", "person", "event"] }) {
|
|
36913
36965
|
if (!["read", "review", "write"].includes(policy.access) || !Array.isArray(policy.directories) || policy.directories.some((path) => path !== "" && !!validatePath(`${path}/scope.md`)) || !Array.isArray(policy.objectTypes) || policy.objectTypes.some((type) => !/^[a-z][a-z0-9.-]{0,79}$/.test(type))) throw new Error("Agent \u6388\u6743\u8303\u56F4\u65E0\u6548");
|
|
36914
36966
|
this.policy = Object.freeze({ ...policy, directories: Object.freeze([...policy.directories]), objectTypes: Object.freeze([...policy.objectTypes]) });
|
|
36915
36967
|
if ((0, import_node_fs.lstatSync)(root).isSymbolicLink()) throw new Error("\u5DE5\u4F5C\u533A\u4E0D\u80FD\u662F\u7B26\u53F7\u94FE\u63A5");
|
|
@@ -45522,7 +45574,7 @@ async function main() {
|
|
|
45522
45574
|
if (!values.workspace || !values["data-dir"])
|
|
45523
45575
|
throw new Error("Usage: node tano-mcp.cjs --workspace <folder> --data-dir <Tano app data>");
|
|
45524
45576
|
if (!["read", "review", "write"].includes(values.access)) throw new Error("--access must be read, review or write");
|
|
45525
|
-
const workspace = new AgentWorkspace(values.workspace, values["data-dir"], { access: values.access, directories: values.directory ?? [""], objectTypes: values["object-type"] ?? ["task", "
|
|
45577
|
+
const workspace = new AgentWorkspace(values.workspace, values["data-dir"], { access: values.access, directories: values.directory ?? [""], objectTypes: values["object-type"] ?? ["task", "person", "event"] });
|
|
45526
45578
|
const server = createAgentServer(workspace);
|
|
45527
45579
|
const transport = new StdioServerTransport();
|
|
45528
45580
|
server.server.onclose = () => workspace.close();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tano.page/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24.12.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
10
|
-
"@tano/protocol": "npm:@tano.page/protocol@0.
|
|
10
|
+
"@tano/protocol": "npm:@tano.page/protocol@0.15.0",
|
|
11
11
|
"zod": "^4.6.5"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"url": "git+https://github.com/Dramwig/Tano.git"
|
|
29
29
|
},
|
|
30
30
|
"tanoCore": {
|
|
31
|
-
"sourceCommit": "
|
|
32
|
-
"version": "0.
|
|
31
|
+
"sourceCommit": "70164f251c3bacf688734a440d682dba28e38eae",
|
|
32
|
+
"version": "0.15.0",
|
|
33
33
|
"importName": "@tano/mcp"
|
|
34
34
|
}
|
|
35
35
|
}
|