@mosse-ai/cli 0.1.1 → 0.1.3
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/index.js +249 -11
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
package/dist/index.js
CHANGED
|
@@ -21397,7 +21397,7 @@ var BoardUpdateTask = defineCapability({
|
|
|
21397
21397
|
id: "board.update_task",
|
|
21398
21398
|
summary: "Update task fields.",
|
|
21399
21399
|
usageRules: [
|
|
21400
|
-
"expectedUpdatedAt guards status/assignee/reviewer/
|
|
21400
|
+
"expectedUpdatedAt guards status/assignee/reviewer/due fields; always pass it. Others: last-write-wins, reread first. todos/acceptanceChecks REPLACE the whole list (max 50 each): read full/fields; retain items with IDs, new items without IDs; omissions delete. Tick via {{board.check_todo}}. Unchecked todos block review/done. Project completion/review rules apply. Done: {{board.reopen_task}} first. Scheduling: dueTime needs dueDate; durationMin needs dueTime; clearing dueDate clears both.",
|
|
21401
21401
|
{ text: "A project admin other than the assignee can override designated review.", principal: "human" },
|
|
21402
21402
|
{ text: "Cannot mark your assigned task done; a person confirms.", principal: "agent" }
|
|
21403
21403
|
],
|
|
@@ -21411,6 +21411,18 @@ var BoardUpdateTask = defineCapability({
|
|
|
21411
21411
|
assignee: memberRef.nullable().optional(),
|
|
21412
21412
|
reviewer: memberRef.nullable().optional(),
|
|
21413
21413
|
dueDate: external_exports.string().nullable().optional(),
|
|
21414
|
+
/** 钟点 "HH:MM"(本地墙上时间;要求 dueDate 非空)。 */
|
|
21415
|
+
dueTime: external_exports.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/).nullable().optional(),
|
|
21416
|
+
/** 预计时长(分钟,1–10080;要求 dueTime 非空)。 */
|
|
21417
|
+
durationMin: external_exports.number().int().min(1).max(10080).nullable().optional(),
|
|
21418
|
+
/** 重复预设:完成时生成下一次(同一套 task,不另建实体)。 */
|
|
21419
|
+
recurrence: external_exports.enum(["daily", "weekly", "monthly"]).nullable().optional(),
|
|
21420
|
+
/** 重复结束日期(YYYY-MM-DD,含当天)。 */
|
|
21421
|
+
recurrenceUntil: external_exports.string().date().nullable().optional(),
|
|
21422
|
+
/** 到点提醒提前量(分钟;0 = 准点,5/10/15/30/60/120)。 */
|
|
21423
|
+
reminderLeadMin: external_exports.union([external_exports.literal(0), external_exports.literal(5), external_exports.literal(10), external_exports.literal(15), external_exports.literal(30), external_exports.literal(60), external_exports.literal(120)]).optional(),
|
|
21424
|
+
/** 跳过一次重复:当前任务置 canceled 并生成下一次(不能与 status 同时给)。 */
|
|
21425
|
+
skipOccurrence: external_exports.boolean().optional(),
|
|
21414
21426
|
todos: todoItems.optional(),
|
|
21415
21427
|
acceptanceChecks: acceptanceCheckItems.optional(),
|
|
21416
21428
|
/** 管理员绕过(完成规则 v2 §3:档 3 只绕过「只有审阅人能通过」;项目管理员、本人不是负责人;原因选填)。Agent 一律拒(策略表)。 */
|
|
@@ -21476,7 +21488,7 @@ var BoardCreateTask = defineCapability({
|
|
|
21476
21488
|
id: "board.create_task",
|
|
21477
21489
|
summary: "Create one backlog/todo task.",
|
|
21478
21490
|
usageRules: [
|
|
21479
|
-
"Reuse clientId. parentTaskId: same-project
|
|
21491
|
+
"Reuse clientId. parentTaskId: same-project, one level. Scheduling: dueTime needs dueDate; durationMin needs dueTime; recurrence (daily/weekly/monthly) spawns next on completion; recurrenceUntil caps. Todos/checks/labels/links/deps via their actions.",
|
|
21480
21492
|
{
|
|
21481
21493
|
text: "Prefer {{board.create_tasks}} for discussed work; partner confirms.",
|
|
21482
21494
|
principal: "agent"
|
|
@@ -21491,6 +21503,18 @@ var BoardCreateTask = defineCapability({
|
|
|
21491
21503
|
reviewer: memberRef.nullable().optional(),
|
|
21492
21504
|
priority: external_exports.enum(TASK_PRIORITIES).optional(),
|
|
21493
21505
|
dueDate: external_exports.string().nullable().optional(),
|
|
21506
|
+
/** 钟点 "HH:MM"(本地墙上时间;要求 dueDate 非空)。 */
|
|
21507
|
+
dueTime: external_exports.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/).nullable().optional(),
|
|
21508
|
+
/** 预计时长(分钟,1–10080;要求 dueTime 非空)。 */
|
|
21509
|
+
durationMin: external_exports.number().int().min(1).max(10080).nullable().optional(),
|
|
21510
|
+
/** 重复预设(MD-512 P3):daily / weekly / monthly;完成时生成下一次。 */
|
|
21511
|
+
recurrence: external_exports.enum(["daily", "weekly", "monthly"]).nullable().optional(),
|
|
21512
|
+
/** 重复结束日期(YYYY-MM-DD,含当天)。 */
|
|
21513
|
+
recurrenceUntil: external_exports.string().date().nullable().optional(),
|
|
21514
|
+
/** 到点提醒提前量(分钟;0 = 准点)。 */
|
|
21515
|
+
reminderLeadMin: external_exports.union([external_exports.literal(0), external_exports.literal(5), external_exports.literal(10), external_exports.literal(15), external_exports.literal(30), external_exports.literal(60), external_exports.literal(120)]).optional(),
|
|
21516
|
+
/** 跳过一次重复(当前任务置 canceled 并生成下一次;不能与 status 同时给)。 */
|
|
21517
|
+
skipOccurrence: external_exports.boolean().optional(),
|
|
21494
21518
|
parentTaskId: uuid8.nullable().optional(),
|
|
21495
21519
|
clientId: external_exports.string().max(200).nullable().optional(),
|
|
21496
21520
|
/** 来源消息(任务回链到它,进展回到它的 thread)。系统内 Agent 不给,由会话派生(与 create_tasks 同一规则)。 */
|
|
@@ -21536,6 +21560,21 @@ var BoardCreateTasks = defineCapability({
|
|
|
21536
21560
|
title: external_exports.string(),
|
|
21537
21561
|
description: external_exports.string().optional(),
|
|
21538
21562
|
priority: external_exports.enum(TASK_PRIORITIES).optional(),
|
|
21563
|
+
/** 每张任务各自的时间(与 create_task 同一套字段/约束)。 */
|
|
21564
|
+
dueDate: external_exports.string().nullable().optional(),
|
|
21565
|
+
dueTime: external_exports.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/).nullable().optional(),
|
|
21566
|
+
durationMin: external_exports.number().int().min(1).max(10080).nullable().optional(),
|
|
21567
|
+
recurrence: external_exports.enum(["daily", "weekly", "monthly"]).nullable().optional(),
|
|
21568
|
+
recurrenceUntil: external_exports.string().date().nullable().optional(),
|
|
21569
|
+
reminderLeadMin: external_exports.union([
|
|
21570
|
+
external_exports.literal(0),
|
|
21571
|
+
external_exports.literal(5),
|
|
21572
|
+
external_exports.literal(10),
|
|
21573
|
+
external_exports.literal(15),
|
|
21574
|
+
external_exports.literal(30),
|
|
21575
|
+
external_exports.literal(60),
|
|
21576
|
+
external_exports.literal(120)
|
|
21577
|
+
]).optional(),
|
|
21539
21578
|
todos: external_exports.array(external_exports.strictObject({ text: external_exports.string() })).optional(),
|
|
21540
21579
|
acceptanceChecks: external_exports.array(external_exports.strictObject({ desc: external_exports.string() })).optional(),
|
|
21541
21580
|
dependsOn: external_exports.array(external_exports.number().int().min(0)).optional(),
|
|
@@ -22562,6 +22601,84 @@ var ChatSetPinBarVisibility = defineCapability({
|
|
|
22562
22601
|
effect: "write",
|
|
22563
22602
|
idempotent: true
|
|
22564
22603
|
});
|
|
22604
|
+
var ChatListChannels = defineCapability({
|
|
22605
|
+
id: "chat.list_channels",
|
|
22606
|
+
summary: "List the channels and one-to-one DMs you belong to, with unread counts, last activity and your role. Start here when you need a channelId for reading or sending messages.",
|
|
22607
|
+
input: external_exports.strictObject({}),
|
|
22608
|
+
effect: "read",
|
|
22609
|
+
idempotent: true,
|
|
22610
|
+
cli: { path: ["chat", "channels"] }
|
|
22611
|
+
});
|
|
22612
|
+
var ChatListMessages = defineCapability({
|
|
22613
|
+
id: "chat.list_messages",
|
|
22614
|
+
summary: "Read a page of messages in a conversation you belong to (oldest first). Page backwards with beforeSeq or catch up with afterSeq; excludeDeleted drops tombstones, topLevelOnly hides thread replies.",
|
|
22615
|
+
input: external_exports.strictObject({
|
|
22616
|
+
channelId: channelId2,
|
|
22617
|
+
beforeSeq: external_exports.number().int().min(0).optional(),
|
|
22618
|
+
afterSeq: external_exports.number().int().min(0).optional(),
|
|
22619
|
+
limit: external_exports.number().int().min(1).max(200).optional(),
|
|
22620
|
+
topLevelOnly: external_exports.boolean().optional()
|
|
22621
|
+
}),
|
|
22622
|
+
effect: "read",
|
|
22623
|
+
idempotent: true,
|
|
22624
|
+
cli: { path: ["chat", "messages", "list"] }
|
|
22625
|
+
});
|
|
22626
|
+
var ChatSearchMessages = defineCapability({
|
|
22627
|
+
id: "chat.search_messages",
|
|
22628
|
+
summary: "Search message text across channels you belong to (optionally limited to one channel). Only messages visible to you are returned; deleted messages are excluded.",
|
|
22629
|
+
input: external_exports.strictObject({
|
|
22630
|
+
q: external_exports.string().trim().min(1).max(200),
|
|
22631
|
+
channelId: channelId2.optional(),
|
|
22632
|
+
limit: external_exports.number().int().min(1).max(100).optional()
|
|
22633
|
+
}),
|
|
22634
|
+
effect: "read",
|
|
22635
|
+
idempotent: true,
|
|
22636
|
+
cli: { path: ["chat", "messages", "search"] }
|
|
22637
|
+
});
|
|
22638
|
+
var ChatSendMessage = defineCapability({
|
|
22639
|
+
id: "chat.send_message",
|
|
22640
|
+
summary: "Send a text message to a conversation you belong to, as the token owner (or as the in-product Agent). Use replyToId to quote a message and threadRootId to reply in a thread. Reuse clientId after an unknown result so a retry does not post twice.",
|
|
22641
|
+
input: external_exports.strictObject({
|
|
22642
|
+
channelId: channelId2,
|
|
22643
|
+
text: external_exports.string().trim().min(1).max(2e4),
|
|
22644
|
+
replyToId: messageId.optional(),
|
|
22645
|
+
threadRootId: messageId.optional(),
|
|
22646
|
+
clientId: external_exports.uuid().optional()
|
|
22647
|
+
}),
|
|
22648
|
+
effect: "write",
|
|
22649
|
+
idempotent: true,
|
|
22650
|
+
cli: { path: ["chat", "messages", "send"] }
|
|
22651
|
+
});
|
|
22652
|
+
var ChatThreadList = defineCapability({
|
|
22653
|
+
id: "chat.thread_list",
|
|
22654
|
+
summary: "Read the replies of a message thread you can see, oldest first. Page with beforeSeq / afterSeq; the thread root message is included.",
|
|
22655
|
+
input: external_exports.strictObject({
|
|
22656
|
+
messageId,
|
|
22657
|
+
beforeSeq: external_exports.number().int().min(0).optional(),
|
|
22658
|
+
afterSeq: external_exports.number().int().min(0).optional(),
|
|
22659
|
+
limit: external_exports.number().int().min(1).max(200).optional(),
|
|
22660
|
+
newestFirst: external_exports.boolean().optional()
|
|
22661
|
+
}),
|
|
22662
|
+
effect: "read",
|
|
22663
|
+
idempotent: true,
|
|
22664
|
+
cli: { path: ["chat", "thread", "list"] }
|
|
22665
|
+
});
|
|
22666
|
+
var ChatAddReaction = defineCapability({
|
|
22667
|
+
id: "chat.add_reaction",
|
|
22668
|
+
summary: "Add an emoji reaction to a visible message as the token owner. Repeating the same reaction is a no-op.",
|
|
22669
|
+
input: external_exports.strictObject({ messageId, emoji: external_exports.string().trim().min(1).max(32) }),
|
|
22670
|
+
effect: "write",
|
|
22671
|
+
idempotent: true,
|
|
22672
|
+
cli: { path: ["chat", "reaction", "add"] }
|
|
22673
|
+
});
|
|
22674
|
+
var ChatRemoveReaction = defineCapability({
|
|
22675
|
+
id: "chat.remove_reaction",
|
|
22676
|
+
summary: "Remove your own emoji reaction from a visible message.",
|
|
22677
|
+
input: external_exports.strictObject({ messageId, emoji: external_exports.string().trim().min(1).max(32) }),
|
|
22678
|
+
effect: "write",
|
|
22679
|
+
idempotent: true,
|
|
22680
|
+
cli: { path: ["chat", "reaction", "remove"] }
|
|
22681
|
+
});
|
|
22565
22682
|
var ChatResolveMessageContext = defineCapability({
|
|
22566
22683
|
id: "chat.resolve_message_context",
|
|
22567
22684
|
summary: "Locate a visible message in a bounded context window (at most 100 messages), including old thread replies. The server resolves its conversation stream and thread root. Follow direction/cursor to extend before or after; never scan every old history page to find the target.",
|
|
@@ -22577,6 +22694,13 @@ var ChatResolveMessageContext = defineCapability({
|
|
|
22577
22694
|
idempotent: true
|
|
22578
22695
|
});
|
|
22579
22696
|
var CHAT_CAPABILITIES = [
|
|
22697
|
+
ChatListChannels,
|
|
22698
|
+
ChatListMessages,
|
|
22699
|
+
ChatSearchMessages,
|
|
22700
|
+
ChatSendMessage,
|
|
22701
|
+
ChatThreadList,
|
|
22702
|
+
ChatAddReaction,
|
|
22703
|
+
ChatRemoveReaction,
|
|
22580
22704
|
ChatListPins,
|
|
22581
22705
|
ChatPinMessage,
|
|
22582
22706
|
ChatUnpinMessage,
|
|
@@ -23159,7 +23283,7 @@ function buildCommandTree(options = {}) {
|
|
|
23159
23283
|
}
|
|
23160
23284
|
|
|
23161
23285
|
// src/api.ts
|
|
23162
|
-
var CLI_VERSION = true ? "0.1.
|
|
23286
|
+
var CLI_VERSION = true ? "0.1.3" : "0.0.0";
|
|
23163
23287
|
var CLI_USER_AGENT = `mosse-cli/${CLI_VERSION}`;
|
|
23164
23288
|
async function callApi(request) {
|
|
23165
23289
|
const headers = {
|
|
@@ -23564,7 +23688,13 @@ var SKILL_COMMAND_PATHS = [
|
|
|
23564
23688
|
["board", "task", "dependency-remove"],
|
|
23565
23689
|
["board", "task", "link-add"],
|
|
23566
23690
|
["board", "activity", "list"],
|
|
23567
|
-
["knowledge", "search"]
|
|
23691
|
+
["knowledge", "search"],
|
|
23692
|
+
["chat", "channels"],
|
|
23693
|
+
["chat", "messages", "list"],
|
|
23694
|
+
["chat", "messages", "search"],
|
|
23695
|
+
["chat", "messages", "send"],
|
|
23696
|
+
["chat", "thread", "list"],
|
|
23697
|
+
["chat", "reaction", "add"]
|
|
23568
23698
|
];
|
|
23569
23699
|
function renderSkill(tree) {
|
|
23570
23700
|
const line = (path, suffix) => {
|
|
@@ -23596,7 +23726,7 @@ function renderSkill(tree) {
|
|
|
23596
23726
|
...missing.length ? ["", `[warn] skill references missing commands: ${missing.map((p) => p.join(" ")).join(", ")}`] : []
|
|
23597
23727
|
].join("\n");
|
|
23598
23728
|
}
|
|
23599
|
-
var SKILL_DESCRIPTION = "Use the Mosse CLI (mosse) to read and write Mosse boards: tasks and checklists, dependencies, links, activity, projects, and knowledge search. Use when the user asks about Mosse tasks or
|
|
23729
|
+
var SKILL_DESCRIPTION = "Use the Mosse CLI (mosse) to read and write Mosse boards and chat: tasks and checklists, dependencies, links, activity, projects, sending and searching messages, reactions and threads, and knowledge search. Use when the user asks about Mosse tasks, projects, channels or messages, or when a mosse command is needed.";
|
|
23600
23730
|
var skillVersionMark = (version3) => `<!-- mosse-skill-version: ${version3} -->`;
|
|
23601
23731
|
function renderSkillMd(tree, version3 = CLI_VERSION) {
|
|
23602
23732
|
return [
|
|
@@ -23629,6 +23759,8 @@ var LOCAL_COMMANDS = [
|
|
|
23629
23759
|
"skill upgrade",
|
|
23630
23760
|
"doctor",
|
|
23631
23761
|
"completions",
|
|
23762
|
+
"update",
|
|
23763
|
+
"help",
|
|
23632
23764
|
"inbox list",
|
|
23633
23765
|
"inbox read",
|
|
23634
23766
|
"workspace list"
|
|
@@ -23747,6 +23879,42 @@ function renderCompletions(tree, shell) {
|
|
|
23747
23879
|
return fishScript(words);
|
|
23748
23880
|
}
|
|
23749
23881
|
|
|
23882
|
+
// src/help.ts
|
|
23883
|
+
function editDistance(a, b) {
|
|
23884
|
+
const rows = a.length + 1;
|
|
23885
|
+
const cols = b.length + 1;
|
|
23886
|
+
let prev = Array.from({ length: cols }, (_, i) => i);
|
|
23887
|
+
for (let i = 1; i < rows; i += 1) {
|
|
23888
|
+
const next = [i];
|
|
23889
|
+
for (let j = 1; j < cols; j += 1) {
|
|
23890
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
23891
|
+
next[j] = Math.min(prev[j] + 1, next[j - 1] + 1, prev[j - 1] + cost);
|
|
23892
|
+
}
|
|
23893
|
+
prev = next;
|
|
23894
|
+
}
|
|
23895
|
+
return prev[b.length];
|
|
23896
|
+
}
|
|
23897
|
+
function suggestCommands(tree, tokens, limit2 = 3) {
|
|
23898
|
+
const typed = tokens.join(" ");
|
|
23899
|
+
if (!typed) return [];
|
|
23900
|
+
const typedTokens = new Set(tokens);
|
|
23901
|
+
const scored = tree.commands.map((command) => {
|
|
23902
|
+
const path = command.path.join(" ");
|
|
23903
|
+
const overlap = command.path.filter((segment) => typedTokens.has(segment)).length;
|
|
23904
|
+
const distance = editDistance(typed, path);
|
|
23905
|
+
const startsWith = path.startsWith(typed) ? 1 : 0;
|
|
23906
|
+
return { command, score: distance - overlap * 2 - startsWith * 2 };
|
|
23907
|
+
}).filter((entry) => entry.score <= 4).sort((a, b) => a.score - b.score || a.command.path.length - b.command.path.length);
|
|
23908
|
+
return scored.slice(0, limit2).map((entry) => entry.command);
|
|
23909
|
+
}
|
|
23910
|
+
function searchCommands(tree, query) {
|
|
23911
|
+
const q = query.trim().toLowerCase();
|
|
23912
|
+
if (!q) return [];
|
|
23913
|
+
return tree.commands.filter(
|
|
23914
|
+
(command) => command.path.join(" ").includes(q) || command.summary.toLowerCase().includes(q)
|
|
23915
|
+
);
|
|
23916
|
+
}
|
|
23917
|
+
|
|
23750
23918
|
// src/cli.ts
|
|
23751
23919
|
var EXIT_USAGE = 2;
|
|
23752
23920
|
var EXIT_AUTH = 3;
|
|
@@ -23850,12 +24018,12 @@ function suggestFlag(name, flags) {
|
|
|
23850
24018
|
let best = null;
|
|
23851
24019
|
for (const flag of flags) {
|
|
23852
24020
|
const candidate = flag.name.replace(/^--/, "").replace(/-/g, "");
|
|
23853
|
-
const distance =
|
|
24021
|
+
const distance = editDistance2(target, candidate);
|
|
23854
24022
|
if (distance <= 2 && (!best || distance < best.distance)) best = { name: flag.name, distance };
|
|
23855
24023
|
}
|
|
23856
24024
|
return best ? `; did you mean ${best.name}?` : "";
|
|
23857
24025
|
}
|
|
23858
|
-
function
|
|
24026
|
+
function editDistance2(a, b) {
|
|
23859
24027
|
const rows = a.length + 1;
|
|
23860
24028
|
const cols = b.length + 1;
|
|
23861
24029
|
let prev = Array.from({ length: cols }, (_, j) => j);
|
|
@@ -24038,18 +24206,24 @@ async function runCli(argv, deps) {
|
|
|
24038
24206
|
return 0;
|
|
24039
24207
|
}
|
|
24040
24208
|
const { head, tail } = splitHead(effective);
|
|
24041
|
-
|
|
24042
|
-
deps.stdout(`${tree.rootHelp}
|
|
24209
|
+
const rootHelp = () => `${tree.rootHelp}
|
|
24043
24210
|
Local commands:
|
|
24044
24211
|
auth <login|logout|status|token> credentials (not part of the tool surface)
|
|
24045
24212
|
skill [install|status|upgrade] agent cheatsheet (mosse skill for the one-pager)
|
|
24046
24213
|
doctor local environment check
|
|
24047
24214
|
completions <bash|zsh|fish> shell completion script
|
|
24048
24215
|
workspace list list workspaces (alias of auth whoami)
|
|
24049
|
-
|
|
24216
|
+
inbox wait [--timeout-ms <ms>] long-poll one inbox notification (exit 4 on timeout)
|
|
24217
|
+
update check npm for a newer @mosse-ai/cli
|
|
24218
|
+
help [query] search commands by path / description
|
|
24219
|
+
`;
|
|
24220
|
+
if (!head.length) {
|
|
24221
|
+
deps.stdout(rootHelp());
|
|
24050
24222
|
return 0;
|
|
24051
24223
|
}
|
|
24052
24224
|
if (head[0] === "inbox" && head[1] === "wait") return handleInboxWait(rest.slice(2), deps, config2, globals);
|
|
24225
|
+
if (head[0] === "update") return handleUpdate(rest.slice(1), deps, globals);
|
|
24226
|
+
if (head[0] === "help") return handleHelpSearch(rest.slice(1), deps, tree, rootHelp());
|
|
24053
24227
|
if (head[0] === "completions") return handleCompletions(rest.slice(1), deps, tree, globals);
|
|
24054
24228
|
if (head[0] === "skill") return handleSkill(rest.slice(1), deps, configPath, config2, tree, globals);
|
|
24055
24229
|
if (head[0] === "doctor") return handleDoctor(deps, config2, globals);
|
|
@@ -24061,7 +24235,11 @@ Local commands:
|
|
|
24061
24235
|
deps.stdout(renderGroupHelp(tree.commands, head));
|
|
24062
24236
|
return 0;
|
|
24063
24237
|
}
|
|
24064
|
-
|
|
24238
|
+
const suggestions = suggestCommands(tree, head);
|
|
24239
|
+
const hint = suggestions.length ? `; did you mean: ${suggestions.map((item) => `mosse ${item.path.join(" ")}`).join(", ")}` : "";
|
|
24240
|
+
deps.stderr(
|
|
24241
|
+
structuredError(globals, EXIT_USAGE, "unknown_command", `no such command: mosse ${head.join(" ")}${hint}`)
|
|
24242
|
+
);
|
|
24065
24243
|
deps.stderr(tree.rootHelp);
|
|
24066
24244
|
return EXIT_USAGE;
|
|
24067
24245
|
}
|
|
@@ -24224,6 +24402,66 @@ function sessionPath(tool, input2) {
|
|
|
24224
24402
|
return encodeURIComponent(String(value));
|
|
24225
24403
|
});
|
|
24226
24404
|
}
|
|
24405
|
+
async function handleUpdate(args, deps, globals) {
|
|
24406
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
24407
|
+
deps.stdout("mosse update\n\n\u68C0\u67E5 npm \u4E0A\u7684\u6700\u65B0\u7248;\u4E0D\u81EA\u52A8\u5B89\u88C5,\u53EA\u6253\u5370\u5347\u7EA7\u547D\u4EE4\u3002\n");
|
|
24408
|
+
return 0;
|
|
24409
|
+
}
|
|
24410
|
+
const registry2 = "https://registry.npmjs.org/@mosse-ai/cli/latest";
|
|
24411
|
+
let latest;
|
|
24412
|
+
try {
|
|
24413
|
+
const response = await deps.fetch(registry2, { headers: { accept: "application/json" } });
|
|
24414
|
+
if (!response.ok) throw new Error(`registry responded ${response.status}`);
|
|
24415
|
+
const body = await response.json();
|
|
24416
|
+
if (!body.version) throw new Error("registry response has no version");
|
|
24417
|
+
latest = body.version;
|
|
24418
|
+
} catch (error62) {
|
|
24419
|
+
deps.stderr(
|
|
24420
|
+
structuredError(
|
|
24421
|
+
globals,
|
|
24422
|
+
1,
|
|
24423
|
+
"update_check_failed",
|
|
24424
|
+
`could not check the npm registry: ${error62.message}`
|
|
24425
|
+
)
|
|
24426
|
+
);
|
|
24427
|
+
return 1;
|
|
24428
|
+
}
|
|
24429
|
+
const upToDate = compareVersions(latest, CLI_VERSION) <= 0;
|
|
24430
|
+
if (globals.json !== void 0) {
|
|
24431
|
+
deps.stdout(renderOutput({ current: CLI_VERSION, latest, upToDate }, outputOptions(globals)));
|
|
24432
|
+
} else {
|
|
24433
|
+
deps.stdout(
|
|
24434
|
+
upToDate ? `mosse ${CLI_VERSION} is up to date (latest ${latest})` : `mosse ${CLI_VERSION} \u2192 ${latest} available
|
|
24435
|
+
npm i -g @mosse-ai/cli@${latest}
|
|
24436
|
+
# or: npx @mosse-ai/cli@latest <command>`
|
|
24437
|
+
);
|
|
24438
|
+
}
|
|
24439
|
+
return 0;
|
|
24440
|
+
}
|
|
24441
|
+
function compareVersions(a, b) {
|
|
24442
|
+
const pa = a.split(".").map((part) => Number(part) || 0);
|
|
24443
|
+
const pb = b.split(".").map((part) => Number(part) || 0);
|
|
24444
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i += 1) {
|
|
24445
|
+
const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
24446
|
+
if (diff !== 0) return diff;
|
|
24447
|
+
}
|
|
24448
|
+
return 0;
|
|
24449
|
+
}
|
|
24450
|
+
async function handleHelpSearch(args, deps, tree, root) {
|
|
24451
|
+
const query = args.filter((arg) => !arg.startsWith("-")).join(" ").trim();
|
|
24452
|
+
if (!query) {
|
|
24453
|
+
deps.stdout(root);
|
|
24454
|
+
return 0;
|
|
24455
|
+
}
|
|
24456
|
+
const matches = searchCommands(tree, query);
|
|
24457
|
+
if (!matches.length) {
|
|
24458
|
+
deps.stderr(`no commands match "${query}" (try \`mosse --help\`)`);
|
|
24459
|
+
return 0;
|
|
24460
|
+
}
|
|
24461
|
+
deps.stdout(matches.map((command) => `mosse ${command.path.join(" ")}
|
|
24462
|
+
${command.summary}`).join("\n\n"));
|
|
24463
|
+
return 0;
|
|
24464
|
+
}
|
|
24227
24465
|
async function handleInboxWait(args, deps, config2, globals) {
|
|
24228
24466
|
if (args[0] === "--help" || args[0] === "-h") {
|
|
24229
24467
|
deps.stdout(
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mosse
|
|
3
|
-
description: "Use the Mosse CLI (mosse) to read and write Mosse boards: tasks and checklists, dependencies, links, activity, projects, and knowledge search. Use when the user asks about Mosse tasks or
|
|
3
|
+
description: "Use the Mosse CLI (mosse) to read and write Mosse boards and chat: tasks and checklists, dependencies, links, activity, projects, sending and searching messages, reactions and threads, and knowledge search. Use when the user asks about Mosse tasks, projects, channels or messages, or when a mosse command is needed."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- mosse-skill-version: 0.0.0 -->
|