OmniStacksStaticModules 2.0.0
Loading...
Searching...
No Matches
WorkflowUI.cppm File Reference
module WorkflowUI
#include <array>
#include <cctype>
#include <cstdlib>
#include <filesystem>
#include <string>
#include <string_view>
#include <vector>
#include "json.hpp"
import TaskManager;
import ReminderSync;
import ProjectSync;
import InterfaceLog;
import std;
Include dependency graph for WorkflowUI.cppm:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WorkflowUI::Context
 单次 Alfred 调用所需的运行上下文。 More...
struct  WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::CommandAliases
 八个可配置命令别名;字段初始化发生在每次 Alfred 进程启动时。 More...
struct  WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::ParsedTaskInput
 任务文本字段按“标题|描述|开始|截止|优先级”拆分后的内部值。 More...

Namespaces

namespace  WorkflowUI
namespace  WorkflowUI::anonymous_namespace{WorkflowUI.cppm}

Typedefs

using WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::json = nlohmann::json

Functions

std::string WorkflowUI::filter (const Context &context, std::string_view query)
 生成 Alfred Script Filter JSON;任何业务错误都转换为不可选错误条目。
std::expected< std::string, std::string > WorkflowUI::action (const Context &context, std::string_view token)
 执行 Alfred action token;错误文本直接作为 Alfred Large Type/通知内容。
std::string WorkflowUI::base64url_encode (std::string_view value)
 URL-safe、无 padding 的 Base64 编码,用于 token 中的用户字段。
std::optional< std::string > WorkflowUI::base64url_decode (std::string_view value)
 Base64url 解码;非法字符返回 nullopt,调用方转换为 action 错误。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::trim (std::string value)
 去除 Alfred 查询首尾 ASCII 空白。
std::pair< std::string, std::string > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::split_first (std::string_view value, char separator)
 按首个分隔符拆分,保留其余部分作为 payload。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_path (const Context &context)
 一级命令使用插件品牌图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::system_icon (std::string_view name)
 引用 macOS 系统 CoreTypes 图标,避免随包分发第三方素材。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::app_icon (std::string_view app, std::string_view icon)
 引用系统应用包内图标;调用方保证路径属于内置应用。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::bilingual (std::string_view chinese, std::string_view english)
 统一 Alfred 副标题的双语格式:中文在前、英文在后。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::alias_from_env (std::string_view variable, std::string_view fallback)
 从 Alfred workflow 配置环境变量读取命令别名;空白值回退默认别名。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_project ()
 项目使用文件夹/项目语义图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_stack ()
 清单使用看板语义图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_task ()
 任务使用勾选语义图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_inbox ()
 Inbox 使用收件箱语义图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_week ()
 本周日期使用系统日历图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_timer ()
 计时使用系统时钟图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_sync ()
 同步使用系统同步图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_info ()
 不可选错误/提示使用系统信息图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::icon_note ()
 说明行统一使用插件 Note 图标。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::priority_label (std::string_view value)
 优先级值到中文短标签;未知值原样显示,空值显示“无”。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::item (std::string title, std::string subtitle, std::string argument={}, std::string autocomplete={}, bool valid=true, std::string icon="icons/icon.png")
 构造 Alfred item。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::error_item (std::string message, std::string subtitle={})
 构造不可选、带双语错误说明的 Alfred 错误条目。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::feedback (const json &items)
 序列化 Alfred Script Filter 根对象;skipknowledge 防止非操作行污染排序。
ParsedTaskInput WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::parse_task_fields (std::string_view text)
 最多拆分五个字段,多余分隔符不会自动并入前四个字段。
std::vector< std::string > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::library_paths (const Context &context)
 从 Project.json 读取 library_paths;文件缺失/损坏时返回空列表。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::task_items (const std::vector< TaskManager::TaskRecord > &tasks)
 把 TaskRecord 批量映射为任务条目;无结果时返回统一说明行。
bool WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::fuzzy_match (std::string_view haystack, std::string_view needle)
 大小写无关的“子串优先、子序列兜底”匹配。
std::vector< TaskManager::BoardTarget > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::sorted_matching_boards (const std::vector< TaskManager::BoardTarget > &boards, std::string_view query)
 按项目/清单标题模糊过滤看板,保留 TaskManager 的稳定排序。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::board_items (const std::vector< TaskManager::BoardTarget > &boards, std::string_view query, bool for_add, std::string_view payload={})
 渲染项目/清单选择列表。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::config_items (const Context &context, const CommandAliases &aliases)
 渲染路径配置页:添加、重载与已保存路径说明行。
json WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::task_detail (const TaskManager::TaskRecord &task)
 渲染任务详情页。
std::string WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::provider_label (ReminderSync::Provider provider)
 外部同步提供方的显示名;与 action token 保持同一套英文名称。
std::optional< ReminderSync::Provider > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::parse_provider (std::string_view value)
 将 action token 中的提供方文本解析为强类型枚举。
std::expected< std::string, std::string > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::task_error (TaskManager::TaskError error)
 TaskManager 错误转换为 WorkflowUI 的 string error 通道。
std::expected< std::string, std::string > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::sync_single (const Context &context, std::string_view task_id, ReminderSync::Provider provider, bool dry_run=false)
 读取任务并同步到指定外部应用。
std::expected< std::string, std::string > WorkflowUI::anonymous_namespace{WorkflowUI.cppm}::dispatch_action (const Context &context, std::string_view token)
 将冒号分隔 action token 分发到领域模块。
std::string WorkflowUI::filter_impl (const Context &context, std::string_view raw_query)