@opticell/workflow-companion 1.8.1 → 1.8.2

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.
Files changed (2) hide show
  1. package/index.js +37 -28
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,7 +27,7 @@ const path = require("path");
27
27
  const os = require("os");
28
28
 
29
29
  const PROTOCOL_VERSION = "2024-11-05";
30
- const SERVER_INFO = { name: "workflow", version: "1.8.1" };
30
+ const SERVER_INFO = { name: "workflow", version: "1.8.2" };
31
31
  // Who the agent is in WorkFlow: the assignee its queue follows, the @name
32
32
  // that calls it, the signature on what it writes. On the Mac it's Claude.
33
33
  // A companion goes by the name chosen at setup (default "Companion"), so a
@@ -629,7 +629,11 @@ function showTask(t) {
629
629
  function queueItems(snap) {
630
630
  const shared = new Set((snap.projects || []).filter(p => p.isShared).map(p => p.name));
631
631
  const mine = t => (t.assignee || "").toLowerCase() === AGENT.name.toLowerCase();
632
- const rows = (snap.tasks || []).filter(t => t.status !== "Completed" && !t.isHidden && (mine(t) || addressedToMe(t, shared) || watchOf(t)));
632
+ // Nothing in a shared project, however it got there: a collaborator can
633
+ // assign tasks and write comments there, so it isn't only the owner asking
634
+ // (the Mac's rule too; the shared cases in Tools/agent-rules check both).
635
+ const rows = (snap.tasks || []).filter(t => t.status !== "Completed" && !t.isHidden && !(t.project && shared.has(t.project))
636
+ && (mine(t) || addressedToMe(t, shared) || watchOf(t)));
633
637
  const notes = (snap.notes || []).filter(n => !n.isArchived && !n.convertedAt && mentionsMe(`${n.title || ""}\n${n.body || ""}`));
634
638
  return { rows, notes, mine };
635
639
  }
@@ -2628,29 +2632,34 @@ Needs WorkFlow 5.2+ on an iPhone, iPad or Mac, with the companion switched on in
2628
2632
  Install in one line: see https://github.com/TeamDzX/workflow-companion#install
2629
2633
  `;
2630
2634
 
2631
- if (argv.includes("--print-config")) printConfig();
2632
- else if (argv.includes("--help") || verb === "help") process.stdout.write(HELP);
2633
- else if (verb === "setup") setup().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2634
- else if (verb === "doctor") doctorReport().then(r => { console.log(r.text); process.exitCode = r.problems ? 1 : 0; }, e => { console.error(e.message || e); process.exitCode = 1; });
2635
- else if (verb === "status") cloudStateText().then(t => console.log(t), e => { console.error(e.message || e); process.exitCode = 1; });
2636
- else if (verb === "keepalive") keepAlive().then(c => { process.exitCode = c; });
2637
- else if (verb === "update") updateNow().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2638
- else if (verb === "auto-update") process.exitCode = setAutoUpdate(argv[argv.indexOf("auto-update") + 1] !== "off");
2639
- else if (verb === "wake") wake().then(c => { process.exitCode = c; }, e => { logWake(`failed: ${e.message || e}`); process.exitCode = 1; });
2640
- else if (verb === "wake-on" || verb === "wake-off") wakeSetup(verb === "wake-on").then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2641
- else if (verb === "monitor") monitorCLI().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2642
- else if (verb === "approvals") process.exitCode = setFlag("approvalsEnabled", argv[argv.indexOf("approvals") + 1] === "on",
2643
- "Approvals are on. An assistant can ask to run one exact command on this computer; it runs only after you reply \"approve CODE\" on the task in WorkFlow, once, within 24 hours. Turn off with: workflow-companion approvals off",
2644
- "Approvals are off. Requests are refused and approved ones won't run.");
2645
- else if (verb === "inbox-on" || verb === "inbox-off") inboxCLI(verb === "inbox-on").then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2646
- else if (verb === "notifications") process.exitCode = setFlag("notifications", argv[argv.indexOf("notifications") + 1] !== "off",
2647
- "Notifications are on.", "Notifications are off.");
2648
- else if (verb === "reports") process.exitCode = setFlag("reports", argv[argv.indexOf("reports") + 1] !== "off",
2649
- "Session reports are on: each session attaches a short report to its task.", "Session reports are off.");
2650
- else if (verb === "notify-test") { notify("WorkFlow companion", `Notifications work on ${os.hostname()}.`); console.log("Sent a test notification."); }
2651
- else if (verb === "signout") {
2652
- removeSchedule();
2653
- removeWakeSchedule();
2654
- for (const f of Object.values(CP)) try { fs.unlinkSync(f); } catch (_) {}
2655
- console.log(`Signed out: removed the token, the settings and the keep-alive from ${COMPANION.home}.`);
2656
- } else serve();
2635
+ // Loaded by the shared rule tests (Tools/agent-rules) rather than run.
2636
+ if (require.main !== module) {
2637
+ module.exports = { wakeItems, queueItems, addressingComment, assignedHandoff, agent: () => AGENT };
2638
+ } else {
2639
+ if (argv.includes("--print-config")) printConfig();
2640
+ else if (argv.includes("--help") || verb === "help") process.stdout.write(HELP);
2641
+ else if (verb === "setup") setup().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2642
+ else if (verb === "doctor") doctorReport().then(r => { console.log(r.text); process.exitCode = r.problems ? 1 : 0; }, e => { console.error(e.message || e); process.exitCode = 1; });
2643
+ else if (verb === "status") cloudStateText().then(t => console.log(t), e => { console.error(e.message || e); process.exitCode = 1; });
2644
+ else if (verb === "keepalive") keepAlive().then(c => { process.exitCode = c; });
2645
+ else if (verb === "update") updateNow().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2646
+ else if (verb === "auto-update") process.exitCode = setAutoUpdate(argv[argv.indexOf("auto-update") + 1] !== "off");
2647
+ else if (verb === "wake") wake().then(c => { process.exitCode = c; }, e => { logWake(`failed: ${e.message || e}`); process.exitCode = 1; });
2648
+ else if (verb === "wake-on" || verb === "wake-off") wakeSetup(verb === "wake-on").then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2649
+ else if (verb === "monitor") monitorCLI().then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2650
+ else if (verb === "approvals") process.exitCode = setFlag("approvalsEnabled", argv[argv.indexOf("approvals") + 1] === "on",
2651
+ "Approvals are on. An assistant can ask to run one exact command on this computer; it runs only after you reply \"approve CODE\" on the task in WorkFlow, once, within 24 hours. Turn off with: workflow-companion approvals off",
2652
+ "Approvals are off. Requests are refused and approved ones won't run.");
2653
+ else if (verb === "inbox-on" || verb === "inbox-off") inboxCLI(verb === "inbox-on").then(c => { process.exitCode = c; }, e => { console.error(e.message || e); process.exitCode = 1; });
2654
+ else if (verb === "notifications") process.exitCode = setFlag("notifications", argv[argv.indexOf("notifications") + 1] !== "off",
2655
+ "Notifications are on.", "Notifications are off.");
2656
+ else if (verb === "reports") process.exitCode = setFlag("reports", argv[argv.indexOf("reports") + 1] !== "off",
2657
+ "Session reports are on: each session attaches a short report to its task.", "Session reports are off.");
2658
+ else if (verb === "notify-test") { notify("WorkFlow companion", `Notifications work on ${os.hostname()}.`); console.log("Sent a test notification."); }
2659
+ else if (verb === "signout") {
2660
+ removeSchedule();
2661
+ removeWakeSchedule();
2662
+ for (const f of Object.values(CP)) try { fs.unlinkSync(f); } catch (_) {}
2663
+ console.log(`Signed out: removed the token, the settings and the keep-alive from ${COMPANION.home}.`);
2664
+ } else serve();
2665
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opticell/workflow-companion",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "mcpName": "io.github.TeamDzX/workflow-companion",
5
5
  "description": "Lets Claude on Windows or Linux work in your WorkFlow tasks, notes and projects, through WorkFlow for Mac and your own iCloud. An MCP server.",
6
6
  "keywords": [