finCopilot icon

finCopilot

FIN 原生生成式运维服务端 + Copilot 网关 + 驾驶舱前端
finCopilotAxon funcs

Registered StackHub users may elect to receive email notifications whenever a new package version is released.

There are 0 watchers.

v0.4.0

finMcpAddCase
finMcpAddCase(title, symptoms, rootCause, resolution, equipRef: null)

新增一条案例到 Folio(finMcpCase 记录)。admin 限定。 经 KnowledgeStore 写入:配了嵌入端点时顺带向量化,供 recall_cases 语义混合召回(C1)。

Fantom signature:
@Axon { admin=true; } static Dict finMcpAddCase(Str title, Str symptoms, Str rootCause, Str resolution, Str? equipRef := null)
finMcpApprove
finMcpApprove(pointId, value, reason: "", level: null)

人工审批落值(运维已授权)。admin 限定。复用 McpTools.approve(单一写实现)。 value 支持 Number / Bool / Str(枚举档位),由 McpTools.approve 按点位 kind 强制类型。 level=写入优先级(默认 8;护栏拒 1-7,B3)。前端控制卡可传 8-16。

Fantom signature:
@Axon { admin=true; } static Dict finMcpApprove(Str pointId, Obj value, Str reason := "", Number? level := null)
finMcpApprovePackage
finMcpApprovePackage(packageId)

一键批准整包:逐条重过护栏 + 落值,返回汇总 {approved, total, results}。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpApprovePackage(Str packageId)
finMcpApproveProposal
finMcpApproveProposal(id)

批准单条提案:重过护栏 + 落值(复用 McpTools.approve 单一写实现),置状态。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpApproveProposal(Str id)
finMcpAudit
finMcpAudit()

护栏审计日志(每条写决策留痕)→ Grid。纯读,不触碰写路径。

Fantom signature:
@Axon static Grid finMcpAudit()
finMcpBatchResults
finMcpBatchResults(batchId)

Invalid annotation [] [fandoc:1] - ""

取批次结果 → JSON [{custom_id,status,text}](须状态 ended)。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpBatchResults(Str batchId)
finMcpBatchStatus
finMcpBatchStatus(batchId)

查批次状态(processing_status / request_counts)→ JSON。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpBatchStatus(Str batchId)
finMcpBatchSubmit
finMcpBatchSubmit(promptsJson)

提交一批单轮请求 → 批次 id。promptsJson=[{id,prompt,system?,model?,maxTokens?}]。 仅 provider=anthropic(批量为 Anthropic 专属)。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpBatchSubmit(Str promptsJson)
finMcpCarbon
finMcpCarbon(range: "today", factor: null, area: null)

碳核算与碳强度 → JSON。

Fantom signature:
@Axon static Str finMcpCarbon(Str range := "today", Number? factor := null, Number? area := null)
finMcpChatCancel
finMcpChatCancel(sessionId)

协作式取消(轮次边界生效,取消后不再产生写提案)。

Fantom signature:
@Axon static Bool finMcpChatCancel(Str sessionId)
finMcpChatPoll
finMcpChatPoll(sessionId, after)

增量取事件:→ JSON {events, nextAfter, status}。前端按 nextAfter 续取。

Fantom signature:
@Axon static Str finMcpChatPoll(Str sessionId, Number after)
finMcpChatStart
finMcpChatStart(messagesJson, capabilityId: "general", contextJson: null, model: null, effort: null)

Invalid annotation [] [fandoc:1] - "capabilityId 选领域 Agent;contextJson 为前端传的 {targetRef?, scope, projectName?},"

启动一轮会话,返回 sessionId。messagesJson 为 [{role,content}] 的 JSON。 capabilityId 选领域 Agent;contextJson 为前端传的 {targetRef?, scope, projectName?}, 在此请求线程解析为提示词前言(含设备 dis),随会话注入给 Agent。

Fantom signature:
@Axon static Str finMcpChatStart(Str messagesJson, Str capabilityId := "general", Str? contextJson := null, Str? model := null, Str? effort := null)
finMcpCloseWorkOrder
finMcpCloseWorkOrder(id, resolution, outcome: null, crystallize: true)

关闭工单并沉淀:置 closed + resolution/outcome;crystallize 时把已验证处置升级为 finMcpCase (复用 store.addCase,配嵌入端点则向量化入 RAG),喂回 recall_cases。返回 JSON {id, status:closed, caseId?, embedded}。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpCloseWorkOrder(Str id, Str resolution, Str? outcome := null, Bool crystallize := true)
finMcpComputeKpi
finMcpComputeKpi(range: "today", elecFilter: null, coolFilter: null, area: null)

系统 KPI(COP/kW·RT⁻¹/输配系数/逐台冷机/EUI/PUE)→ JSON。

Fantom signature:
@Axon static Str finMcpComputeKpi(Str range := "today", Str? elecFilter := null, Str? coolFilter := null, Number? area := null)
finMcpConfirmMemory
finMcpConfirmMemory(memId)

确认一条记忆(pending→confirmed,配端点则补向量)→ JSON。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpConfirmMemory(Str memId)
finMcpCopilotMenu
finMcpCopilotMenu()

把运维 Copilot 注册进 FIN app 启动器菜单。

finMcpCreateWorkOrder
finMcpCreateWorkOrder(symptoms, equipRef: null, linkedSessionId: null, rootCause: null, actionsTaken: null)

起草工单(诊断会话收尾 seed 症状/根因/已采取动作)→ JSON {id, status:open}。admin 限定。 createdBy 取当前 FIN 用户;linkedSessionId 关联诊断会话(可回看轨迹)。

Fantom signature:
@Axon { admin=true; } static Str finMcpCreateWorkOrder(Str symptoms, Str? equipRef := null, Str? linkedSessionId := null, Str? rootCause := null, Str? actionsTaken := null)
finMcpCriticalAlarms
finMcpCriticalAlarms()

仅列出 Critical 级激活报警(驾驶舱告警卡片便捷入口)。底层复用 FinMcpLib.finMcpListAlarms,护栏与权限不变。

finMcpDeleteChat
finMcpDeleteChat(id)

删除一段已保存会话。admin 收口。

Fantom signature:
@Axon { admin=true; } static Bool finMcpDeleteChat(Str id)
finMcpDeleteMemory
finMcpDeleteMemory(memId)

删除一条记忆(弃用/纠错)。admin 限定。

Fantom signature:
@Axon { admin=true; } static Bool finMcpDeleteMemory(Str memId)
finMcpDescribeEntity
finMcpDescribeEntity(ref)

实体详情(上下文检查器用)→ recToJson 的 JSON 字符串(含标签/元数据/协议绑定 B1)。 走 JSON 字符串而非 Grid,避免 Hayson 数字/列表包裹,前端 JSON.parse 即得纯量。

Fantom signature:
@Axon static Str finMcpDescribeEntity(Str ref)
finMcpEmbedStatus
finMcpEmbedStatus()

当前 embedding 配置状态(不回显密钥)+ available(配置是否完整可构造)。

Fantom signature:
@Axon static Dict finMcpEmbedStatus()
finMcpEnergyBaseline
finMcpEnergyBaseline(range: "pastWeek", loadFilter: null, powerFilter: null, predictLoad: null)

能耗-负荷回归基线 → JSON。

Fantom signature:
@Axon static Str finMcpEnergyBaseline(Str range := "pastWeek", Str? loadFilter := null, Str? powerFilter := null, Number? predictLoad := null)
finMcpEnergyBreakdown
finMcpEnergyBreakdown(range: "today", elecFilter: null)

用电分项分解 → JSON。

Fantom signature:
@Axon static Str finMcpEnergyBreakdown(Str range := "today", Str? elecFilter := null)
finMcpEnergyReport
finMcpEnergyReport(range: "thisMonth", priorRange: null, area: null, factor: null)

能效/ESG 报告(DESIGN.md §10-E):确定性装配 KPI+能流+节能+碳+未处理报警一份汇总 → JSON。 range 报告周期(默认 thisMonth);priorRange 给则同比;area 给则附 EUI/碳强度;factor 覆盖排放因子。

Fantom signature:
@Axon static Str finMcpEnergyReport(Str range := "thisMonth", Str? priorRange := null, Number? area := null, Number? factor := null)
finMcpEntityGraphics
finMcpEntityGraphics(ref)

Invalid annotation [] [fandoc:2] - ""

实体可用 FIN 图形列表(上下文检查器图形加载用)→ JSON [{id,dis}]。 版本敏感的 finGraphicOn 调用在 FinBridge.entityGraphics 内(原则 4),此处仅薄壳暴露。

Fantom signature:
@Axon static Str finMcpEntityGraphics(Str ref)
finMcpEquipTopology
finMcpEquipTopology(equipId)

设备拓扑(AHU→VAV 上下游)→ JSON {root,parents,children,points}。

Fantom signature:
@Axon static Str finMcpEquipTopology(Str equipId)
finMcpEval
finMcpEval()

完整准入评测 = 确定性护栏闸门 + LLM 轨迹评测,合并 JSON。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpEval()
finMcpEvalGuardrails
finMcpEvalGuardrails()

确定性安全回归闸门(DESIGN.md §10-A2 准入闸门的护栏部分)→ JSON。 离线、可重复:对 mock 记录跑护栏决策/类型强制/范围归一三组检验, 对抗项必须 100%、总通过率对照 A2/A3 阈值。模型上岗/自主升级前先过此闸门。

Fantom signature:
@Axon static Str finMcpEvalGuardrails()
finMcpEvalTrajectories
finMcpEvalTrajectories()

LLM 轨迹评测(准入闸门的模型诊断质量部分)→ JSON。金标准查询回放走真实 AgentLoop,按期望工具命中打分。需 LLM 已配置(否则返回 skipped)。

Fantom signature:
@Axon { admin=true; } static Str finMcpEvalTrajectories()
finMcpHealth
finMcpHealth()

健康/状态(面板护栏在线 + 当前模型)。

Fantom signature:
@Axon static Dict finMcpHealth()
finMcpIngestDoc
finMcpIngestDoc(text, docRef: null, equipType: null, equipRef: null)

入库一篇手册/规格/控制序列文档(纯文本/Markdown):分块→嵌入→提交 Folio。admin 限定。 equipType/equipRef 给则打标签供检索预过滤;docRef 为文档标识。 返回 JSON {docRef, chunks, skipped}(未配嵌入端点则 skipped=true)。

Fantom signature:
@Axon { admin=true; } static Str finMcpIngestDoc(Str text, Str? docRef := null, Str? equipType := null, Str? equipRef := null)
finMcpListAlarms
finMcpListAlarms(severity: null)

列出激活报警(FDD 召回的诊断线索)→ Grid。

Fantom signature:
@Axon static Grid finMcpListAlarms(Str? severity := null)
finMcpListChats
finMcpListChats()

Invalid annotation [] [fandoc:1] - "(title 由前端 localStorage 缓存补齐,缺失时再懒加载 finMcpLoadChat)。"

列出已保存会话的元数据 → JSON [{id,mod,size}]。不逐个读文件取 title (title 由前端 localStorage 缓存补齐,缺失时再懒加载 finMcpLoadChat)。

Fantom signature:
@Axon static Str finMcpListChats()
finMcpListDocs
finMcpListDocs()

Invalid annotation [] [fandoc:1] - ""

已入库文档摘要列表(前端文档库用)→ JSON [{docRef, chunks, equipType}]。

Fantom signature:
@Axon static Str finMcpListDocs()
finMcpListJobs
finMcpListJobs()

列出定时任务(含启用态、每日触发时刻、当日触发情况)→ JSON。

Fantom signature:
@Axon static Str finMcpListJobs()
finMcpListMemory
finMcpListMemory(scope: null, status: null)

列记忆(默认列全部;可按 scope / status="pending"|"confirmed" 过滤)→ JSON(已剥离向量)。

Fantom signature:
@Axon static Str finMcpListMemory(Str? scope := null, Str? status := null)
finMcpListProposals
finMcpListProposals(packageId: null, status: null)

列待批/历史提案(可选 packageId / status="pending"|"approved"|"rejected")→ JSON。

Fantom signature:
@Axon static Str finMcpListProposals(Str? packageId := null, Str? status := null)
finMcpListWorkOrders
finMcpListWorkOrders(status: null, equipRef: null)

列工单(可选 status="open"/"closed" 与 equipRef 过滤)→ JSON 列表。只读。

Fantom signature:
@Axon static Str finMcpListWorkOrders(Str? status := null, Str? equipRef := null)
finMcpLlmStatus
finMcpLlmStatus()

当前 LLM 配置状态(不回显密钥本身,仅报是否已配置)。

Fantom signature:
@Axon static Dict finMcpLlmStatus()
finMcpLlmTest
finMcpLlmTest()

测试当前 LLM 配置可用性:做一次极小一次性调用,返回 {ok, model, error?}。

Fantom signature:
@Axon static Dict finMcpLlmTest()
finMcpLoadChat
finMcpLoadChat(id)

读取一段已保存会话 → 原始 JSON 字符串。

Fantom signature:
@Axon static Str finMcpLoadChat(Str id)
finMcpProposeMemory
finMcpProposeMemory(kind, scope, text)

人工直接提议一条记忆(source=human,仍入 pending 待确认)→ JSON。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpProposeMemory(Str kind, Str scope, Str text)
finMcpProposeWrite
finMcpProposeWrite(pointId, value, reason)

受控写入提案:强制经 L3 护栏(白名单/物理值域/变更预算/风险分级)。 低风险自动执行+审计;中高风险返回 status==pending_approval 转人工审批。 与 MCP/Copilot 同一裁决路径(tools.invoke),绝非另一套写逻辑。 返回 JSON 字符串(非 Dict):pending_approval 分支含嵌套 proposal 子对象, 走 JsonOutStream 序列化可靠,避免经 eval/Hayson 端点时嵌套裸 Map 丢失/变形 (否则前端拿到的 proposal 残缺,审批→下发链路断)。对照 finMcpEquipTopology/finMcpRollback。

Fantom signature:
@Axon static Str finMcpProposeWrite(Str pointId, Obj value, Str reason)
finMcpQuery
finMcpQuery(filter, limit: null)

语义查询:Haystack 过滤器 → 实体 Grid。等价 MCP query_entities。 例:finMcpQuery("vav and equip", 50)

Fantom signature:
@Axon static Grid finMcpQuery(Str filter, Number? limit := null)
finMcpReadCurrent
finMcpReadCurrent(pointIds)

读一组点位当前值(curVal)→ Grid。

Fantom signature:
@Axon static Grid finMcpReadCurrent(Obj?[] pointIds)
finMcpReadHistory
finMcpReadHistory(pointId, range: "today")

读单点历史趋势 → Dict(含 samples 列表)。range 用 Axon 日期语法。

Fantom signature:
@Axon static Dict finMcpReadHistory(Str pointId, Str range := "today")
finMcpRecallCases
finMcpRecallCases(query, limit: null)

案例库检索 → JSON 案例列表。

Fantom signature:
@Axon static Str finMcpRecallCases(Str query, Number? limit := null)
finMcpRejectProposal
finMcpRejectProposal(id)

驳回单条提案(不落值,仅置状态)。admin 限定。

Fantom signature:
@Axon { admin=true; } static Bool finMcpRejectProposal(Str id)
finMcpReport
finMcpReport(template: "energy", range: "thisMonth", priorRange: null, area: null, factor: null)

多模板报告(DESIGN.md §10-E):template=energy(能效/ESG)| leed(LEED EA 信用对标)| well(WELL 室内环境达标率)。前端可选模板渲染并导出 PDF(浏览器打印)。

Fantom signature:
@Axon static Str finMcpReport(Str template := "energy", Str range := "thisMonth", Str? priorRange := null, Number? area := null, Number? factor := null)
finMcpRetrieveDocs
finMcpRetrieveDocs(query, equipType: null, equipRef: null, limit: null)

设备手册语义检索 → JSON 带引用块列表。复用 ext.tools.invoke("retrieve_docs")(三路共用)。

Fantom signature:
@Axon static Str finMcpRetrieveDocs(Str query, Str? equipType := null, Str? equipRef := null, Number? limit := null)
finMcpRollback
finMcpRollback()

一键回退到基线 → JSON {status, restored}。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpRollback()
finMcpRunJob
finMcpRunJob(id)

手动立即触发某定时任务,返回 sessionId(可经 finMcpChatPoll 回看)。admin 限定。

Fantom signature:
@Axon { admin=true; } static Str finMcpRunJob(Str id)
finMcpSaveChat
finMcpSaveChat(id, json)

保存一段会话 JSON 到项目 IO 目录。json 为前端 Conversation 的 JSON 字符串。 经 Context.cur.eval 调 ioWriteStr(请求线程内已绑当前用户)。 非 admin:保存自己的对话记录属普通用户操作(id 经 sanitizeId 防路径穿越,写项目 io 安全); 删除(finMcpDeleteChat)仍 admin 收口。**写后回读校验**确实落盘后才返回 id—— 写失败/未生效即抛错,前端据此如实反馈"保存失败"而非误报成功。

Fantom signature:
@Axon static Str finMcpSaveChat(Str id, Str json)
finMcpSavingsPotential
finMcpSavingsPotential(range: "today", priorRange: null, tariff: null)

节能潜力(额定/同比/物理极限)→ JSON。

Fantom signature:
@Axon static Str finMcpSavingsPotential(Str range := "today", Str? priorRange := null, Number? tariff := null)
finMcpSetAgentConfig
finMcpSetAgentConfig(maxSessions: null, ttlMin: null)

配置 Agent 会话参数,写入扩展设置记录(运行期即时生效): maxSessions(活跃会话上限)、ttlMin(会话 TTL 分钟)。 注:池线程数 maxWorkers 在启动期由 env FINCOPILOT_MAX_WORKERS 决定,改后需重启(见 AgentSessionMgr)。

Fantom signature:
@Axon { admin=true; } static Dict finMcpSetAgentConfig(Number? maxSessions := null, Number? ttlMin := null)
finMcpSetEmbed
finMcpSetEmbed(provider, apiKey: null, baseUrl: null, model: null)

配置 embedding 供应商(OpenAI 兼容 /v1/embeddings),运行时即时生效。admin 限定。 密钥写 FIN 加密 passwords 存储(独立槽 rec.id+":embed",不撞 LLM 密钥); provider/baseUrl/model 进扩展设置记录标签。本地 Ollama/vLLM 可不传 key。 例:finMcpSetEmbed("openai", null, "http://localhost:11434/v1", "bge-m3")

Fantom signature:
@Axon { admin=true; } static Dict finMcpSetEmbed(Str provider, Str? apiKey := null, Str? baseUrl := null, Str? model := null)
finMcpSetJobEnabled
finMcpSetJobEnabled(id, enabled)

启用/停用某定时任务(即时生效)。admin 限定(改变自主行为)。 例:finMcpSetJobEnabled("nightlyEnergy", true)

Fantom signature:
@Axon { admin=true; } static Dict finMcpSetJobEnabled(Str id, Bool enabled)
finMcpSetLlm
finMcpSetLlm(provider, apiKey: null, baseUrl: null, model: null)

配置大模型供应商,运行时即时生效(无需重启 / 环境变量)。 密钥写入 FIN 加密 passwords 存储(不落明文 folio);provider/baseUrl/model 作为标签提交到扩展设置记录。优先级高于环境变量。admin 限定(写操作收口)。 例:finMcpSetLlm("anthropic", "sk-ant-...")

finMcpSetLlm("openai", "<key>", "https://api.deepseek.com/v1", "deepseek-chat")
Fantom signature:
@Axon { admin=true; } static Dict finMcpSetLlm(Str provider, Str? apiKey := null, Str? baseUrl := null, Str? model := null)
finMcpSuggest
finMcpSuggest(capabilityId, contextJson: null, lang: null, n: null, historyJson: null)

生成贴合 Agent(能力)+目标设备 的运维问法建议 → JSON 字符串数组。 配 LLM:一次性无工具调用(小 max_tokens,复用 effort 思路),喂设备 grounding + 领域框架; 未配/调用失败/解析空:读设备点位/标签确定性兜底(无 target 返回 [],前端保留静态建议)。 不走 AgentLoop/会话、不产生写——纯只读生成;真正执行仍走带工具/护栏的 AgentLoop。 historyJson 非空时按"对话上下文"生成跟进问法([{role,content}] 的 JSON);空则按 Agent+设备生成。

Fantom signature:
@Axon static Str finMcpSuggest(Str capabilityId, Str? contextJson := null, Str? lang := null, Number? n := null, Str? historyJson := null)
finMcpTagVocab
finMcpTagVocab()

标签词表(前端 # 联想用)→ JSON 字符串数组(B2,DESIGN.md §10-C 配套)。

Fantom signature:
@Axon static Str finMcpTagVocab()