@timeryu/dsh-larklink 0.0.0-stage → 0.3.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 timeryu288
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @timeryu/dsh-larklink
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ DeepSeek Harness 插件:多账号 lark-cli 路由 + 守卫式文档执行。
4
+
5
+ ## 工具
6
+
7
+ | 工具 | 用途 |
8
+ |---|---|
9
+ | `larklink_resolve` | 文档 URL/裸 token → 绑定路由决策(或歧义候选+探测标注) |
10
+ | `larklink_exec` | 守卫式执行文档域 lark-cli 命令(目标比对 / 确认指纹 / timeout-unknown) |
11
+ | `larklink_bindings` | 无敏感绑定管理(adopt/list/health/pin);add/auth/remove 走终端 |
12
+
13
+ 随插件内嵌注册 `larklink` SKILL(多账号防串号硬纪律、写操作纪律、确认流程)。
14
+
15
+ ## genui 面板(web)
16
+
17
+ - 后端:`/larklink/bindings`(GET,`?live=1` 实时核验)、`/larklink/adopt`、`/larklink/health`(POST)——同源栅栏(origin/host + sec-fetch-site)
18
+ - 前端:`lib/client.cjs` 注册 sidebar 右侧「Lark 绑定」页签——绑定状态灯(ready/needs_refresh/unauthorized/incomplete)、账号与品牌、文档 pin 列表、adopt/health 按钮,5s 自动刷新
19
+
20
+ ## 安装(DSH)
21
+
22
+ ```yaml
23
+ # cordis.patch.yml
24
+ - insert:
25
+ - id: larklink
26
+ name: "@timeryu/dsh-larklink"
27
+ ```
28
+
29
+ 前置:lark-cli 已安装并可执行(或设 `LARKLINK_LARK_CLI` 指向原生二进制)。
30
+
31
+ ## 设计
32
+
33
+ 见仓库 [docs/design.md](../../docs/design.md)(决议 Q1-Q10)与 [README](../../README.md)。
@@ -0,0 +1,4 @@
1
+ - insert:
2
+ - id: larklink
3
+ # 必须与发布包名一致(Q9-③);@ 开头需引号(YAML 保留字符)
4
+ name: "@timeryu/dsh-larklink"
package/lib/client.cjs ADDED
@@ -0,0 +1,11 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@timeryu/dsh-larklink",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ "use strict";var D=Object.create;var v=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var P=(e,l)=>{for(var n in l)v(e,n,{get:l[n],enumerable:!0})},S=(e,l,n,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of O(l))!C.call(e,i)&&i!==n&&v(e,i,{get:()=>l[i],enumerable:!(s=B(l,i))||s.enumerable});return e};var F=(e,l,n)=>(n=e!=null?D(_(e)):{},S(l||!e||!e.__esModule?v(n,"default",{value:e,enumerable:!0}):n,e)),N=e=>S(v({},"__esModule",{value:!0}),e);var Q={};P(Q,{apply:()=>J,inject:()=>U});module.exports=N(Q);var t=F(require("react"),1),U=["slots"],w="@timeryu/dsh-larklink/bindings",j="larklink-bindings",b="Lark \u7ED1\u5B9A",x="sidebar.right.pane.tab",R="sidebar.right.pane.tab.title",q="larklink",A="/larklink",$={ready:"#22c55e",needs_refresh:"#f59e0b",unauthorized:"#ef4444",incomplete:"#9ca3af"};function T({size:e=16}){return t.default.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},t.default.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),t.default.createElement("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))}function z(e){let[l,n]=(0,t.useState)(null),[s,i]=(0,t.useState)(!1),[a,o]=(0,t.useState)(null),c=(0,t.useRef)(!0),m=(p=!1)=>{i(!0),fetch(`${A}/bindings${p?"?live=1":""}`).then(f=>f.json()).then(f=>{c.current&&(n(f),o(null))}).catch(f=>{c.current&&o(f.message)}).finally(()=>{c.current&&i(!1)})},y=(p,f)=>fetch(`${A}/${p}`,{method:"POST",headers:f!==void 0?{"content-type":"application/json"}:void 0,body:f!==void 0?JSON.stringify(f):void 0}).then(g=>g.json()).then(g=>(c.current&&g.bindings!==void 0&&(n(g),o(null)),g)).catch(g=>(c.current&&o(g.message),{ok:!1,error:g.message}));return(0,t.useEffect)(()=>{c.current=!0,m(e?.initialLive===!0);let p=setInterval(()=>m(),5e3);return()=>{c.current=!1,clearInterval(p)}},[]),{data:l,loading:s,error:a,refresh:m,act:y}}function V({b:e,onStartAuth:l,busy:n}){let s=$[e.status]??"#9ca3af",i=e.status!=="ready",a=`auth:${e.profile}`;return t.default.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 0",borderBottom:"1px solid rgba(128,128,128,.2)"}},t.default.createElement("span",{title:e.status,style:{width:8,height:8,borderRadius:999,background:s,flexShrink:0}}),t.default.createElement("div",{style:{minWidth:0,flex:1}},t.default.createElement("div",{style:{display:"flex",gap:6,alignItems:"baseline"}},t.default.createElement("strong",{style:{fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.profile),t.default.createElement("span",{style:{fontSize:10,opacity:.7}},e.brand),e.adopted?t.default.createElement("span",{style:{fontSize:10,opacity:.6}},"\u5BFC\u5165"):null,i?h(n===a?"\u53D1\u8D77\u4E2D\u2026":"\u626B\u7801\u767B\u5F55",()=>l(e.profile),n===a):null),t.default.createElement("div",{style:{fontSize:10,opacity:.65,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},`${e.userName??"\uFF08\u672A\u767B\u5F55\u7528\u6237\uFF09"} \xB7 ${e.status}`)))}function I({flow:e,onCompleteAuth:l,busy:n}){return t.default.createElement("div",{style:{marginTop:6,padding:8,borderRadius:8,fontSize:11,border:"1px solid rgba(128,128,128,.35)",display:"flex",flexDirection:"column",gap:6}},t.default.createElement("div",{style:{fontWeight:600}},`\u767B\u5F55\u6388\u6743\u8FDB\u884C\u4E2D\uFF08${e.profile}\uFF09`),e.verificationUrl!==void 0?t.default.createElement("a",{href:e.verificationUrl,target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all",color:"#3b82f6"}},e.browserOpened?"\u5DF2\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u6388\u6743\u9875\uFF08\u70B9\u6B64\u91CD\u5F00\uFF09":"\u70B9\u6B64\u6253\u5F00\u6388\u6743\u9875"):null,e.qrcode!==void 0?t.default.createElement("div",{style:{opacity:.7}},`\u4E8C\u7EF4\u7801\u6587\u4EF6\uFF1A${e.qrcode}`):null,t.default.createElement("div",{style:{opacity:.75}},"\u5728\u6D4F\u89C8\u5668\u786E\u8BA4\u6388\u6743\u540E\uFF0C\u70B9\u300C\u6211\u5DF2\u6388\u6743\u300D\u5B8C\u6210\u767B\u5F55\uFF0810 \u5206\u949F\u5185\u6709\u6548\uFF09\u3002"),h(n==="auth-complete"?"\u5B8C\u6210\u4E2D\u2026":"\u6211\u5DF2\u6388\u6743\uFF0C\u5B8C\u6210\u767B\u5F55",()=>l(e.profile),n==="auth-complete"))}function W(){let{data:e,loading:l,error:n,refresh:s,act:i}=z(),[a,o]=(0,t.useState)(null),[c,m]=(0,t.useState)(null),[y,p]=(0,t.useState)(null),f=(d,r)=>{o(d),i(r).finally(()=>o(null))},g=d=>{o(`auth:${d}`),p(null),i("auth-start",{profile:d}).then(r=>{r.ok===!0?m({profile:d,verificationUrl:typeof r.verificationUrl=="string"?r.verificationUrl:void 0,qrcode:typeof r.qrcode=="string"?r.qrcode:void 0,browserOpened:r.browserOpened===!0}):p(typeof r.message=="string"?r.message:typeof r.error=="string"?r.error:"auth-start \u5931\u8D25")}).finally(()=>o(null))},k=d=>{o("auth-complete"),p(null),i("auth-complete",{profile:d}).then(r=>{r.ok===!0?(m(null),s(!0)):p(typeof r.message=="string"?r.message:typeof r.error=="string"?r.error:"auth-complete \u5931\u8D25\uFF08\u7528\u6237\u662F\u5426\u5DF2\u5728\u6D4F\u89C8\u5668\u786E\u8BA4\uFF1F\uFF09")}).finally(()=>o(null))};return t.default.createElement("div",{style:{padding:10,fontSize:12,display:"flex",flexDirection:"column",gap:8}},t.default.createElement("div",{style:{display:"flex",gap:6}},h("\u540C\u6B65\u72B6\u6001(health)",()=>f("health","health"),a==="health"),h("\u5BFC\u5165 profile(adopt)",()=>f("adopt","adopt"),a==="adopt"),l?t.default.createElement("span",{style:{opacity:.6,alignSelf:"center"}},"\u2026"):null),n!==null?t.default.createElement("div",{style:{color:"#ef4444"}},`\u52A0\u8F7D\u5931\u8D25\uFF1A${n}\uFF08\u63D2\u4EF6\u540E\u7AEF\u672A\u8FD0\u884C\uFF1F\uFF09`):null,y!==null?t.default.createElement("div",{style:{color:"#ef4444"}},y):null,c!==null?t.default.createElement(I,{flow:c,onCompleteAuth:k,busy:a}):null,e?.warnings?.map((d,r)=>t.default.createElement("div",{key:r,style:{color:"#f59e0b",fontSize:11}},d)),e!==null&&e.bindings.length===0?t.default.createElement("div",{style:{opacity:.7}},"\u5C1A\u65E0\u7ED1\u5B9A\u3002\u70B9\u300C\u5BFC\u5165 profile(adopt)\u300D\u5BFC\u5165\u672C\u673A lark-cli profile\uFF0C\u6216\u5728\u7EC8\u7AEF\u8FD0\u884C larklink bindings add \u65B0\u589E\u8D26\u53F7\u3002"):null,e?.bindings.map(d=>t.default.createElement(V,{key:d.profile,b:d,onStartAuth:g,busy:a})),e!==null&&e.pins.length>0?t.default.createElement("div",{style:{marginTop:4}},t.default.createElement("div",{style:{fontWeight:600,marginBottom:4}},`\u6587\u6863\u504F\u597D\uFF08pin\uFF0C${e.pins.length}\uFF09`),e.pins.map(d=>t.default.createElement("div",{key:d.token,style:{fontSize:10,opacity:.7,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},`${d.token.slice(0,14)}\u2026 \u2192 ${d.profile}`))):null,t.default.createElement("div",{style:{fontSize:10,opacity:.55,marginTop:4}},"add / remove \u6D89\u53CA app secret \u6216\u7834\u574F\u6027\u64CD\u4F5C\uFF0C\u9700\u5728\u7EC8\u7AEF\u6267\u884C\uFF1B\u767B\u5F55\u6388\u6743\uFF08\u626B\u7801\uFF09\u53EF\u76F4\u63A5\u5728\u9762\u677F\u6216\u8BA9 Agent \u89E6\u53D1\u3002"))}function h(e,l,n){return t.default.createElement("button",{onClick:l,disabled:n,style:{fontSize:11,padding:"4px 8px",borderRadius:6,cursor:n?"default":"pointer",border:"1px solid rgba(128,128,128,.4)",background:"transparent",opacity:n?.5:1}},e)}var M={ready:"\u53EF\u7528",needs_refresh:"\u9700\u5237\u65B0\u6388\u6743",unauthorized:"\u6388\u6743\u5931\u6548",incomplete:"\u672A\u5B8C\u6210\u6388\u6743"};function H(e){if(e===void 0||e==="")return"\u672A\u77E5\uFF08\u70B9\u300C\u5B9E\u65F6\u6838\u9A8C\u300D\u83B7\u53D6\uFF09";let l=Date.parse(e);if(Number.isNaN(l))return e;let n=new Date(l),s=c=>String(c).padStart(2,"0"),i=`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${s(n.getHours())}:${s(n.getMinutes())}`,a=(l-Date.now())/36e5,o=a<0?"\u5DF2\u8FC7\u671F\uFF0C\u9700\u91CD\u65B0\u6388\u6743":a<48?`\u5269\u4F59 ${a.toFixed(1)} \u5C0F\u65F6`:`\u5269\u4F59 ${(a/24).toFixed(1)} \u5929`;return`${i}\uFF08${o}\uFF09`}function E(e,l,n=!1){return t.default.createElement("div",{style:{display:"flex",gap:8,fontSize:11,lineHeight:1.6}},t.default.createElement("span",{style:{opacity:.55,width:88,flexShrink:0}},e),t.default.createElement("span",{style:{opacity:.9,wordBreak:"break-all",fontFamily:n?"var(--dsh-mono, ui-monospace, monospace)":void 0}},l===void 0||l===""?"\u2014":l))}function K({b:e,onStartAuth:l,busy:n}){let s=$[e.status]??"#9ca3af",i=e.status==="ready";return t.default.createElement("div",{style:{border:"1px solid rgba(128,128,128,.3)",borderRadius:10,padding:"10px 12px",display:"flex",flexDirection:"column",gap:6}},t.default.createElement("div",{style:{display:"flex",alignItems:"center",gap:8}},t.default.createElement("span",{style:{width:9,height:9,borderRadius:999,background:s,flexShrink:0},title:e.status}),t.default.createElement("strong",{style:{fontSize:13,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.profile),t.default.createElement("span",{style:{fontSize:10,opacity:.65,border:"1px solid rgba(128,128,128,.4)",borderRadius:4,padding:"0 4px"}},e.brand==="feishu"?"\u98DE\u4E66":"Lark"),e.adopted?t.default.createElement("span",{style:{fontSize:10,opacity:.55}},"\u5BFC\u5165"):null,t.default.createElement("span",{style:{marginLeft:"auto",fontSize:11,color:s,flexShrink:0}},M[e.status]??e.status),h(i?"\u91CD\u65B0\u6388\u6743":"\u626B\u7801\u767B\u5F55/\u4FEE\u590D",()=>l(e.profile),n===`auth:${e.profile}`)),E("\u767B\u5F55\u7528\u6237",e.userName??"\uFF08\u672A\u767B\u5F55\u7528\u6237\uFF09"),E("open_id",e.openId,!0),E("\u5E94\u7528 App ID",e.appId,!0),E("\u6388\u6743\u6709\u6548\u671F\u81F3",H(e.refreshExpiresAt)))}function Y(){let{data:e,loading:l,error:n,refresh:s,act:i}=z({initialLive:!0}),[a,o]=(0,t.useState)(null),[c,m]=(0,t.useState)(null),[y,p]=(0,t.useState)(null),f=(r,u,L=!1)=>{o(r),i(u).then(()=>{L&&s(!0)}).finally(()=>o(null))},g=r=>{o(`auth:${r}`),p(null),i("auth-start",{profile:r}).then(u=>{u.ok===!0?m({profile:r,verificationUrl:typeof u.verificationUrl=="string"?u.verificationUrl:void 0,qrcode:typeof u.qrcode=="string"?u.qrcode:void 0,browserOpened:u.browserOpened===!0}):p(typeof u.message=="string"?u.message:typeof u.error=="string"?u.error:"auth-start \u5931\u8D25")}).finally(()=>o(null))},k=r=>{o("auth-complete"),p(null),i("auth-complete",{profile:r}).then(u=>{u.ok===!0?(m(null),s(!0)):p(typeof u.message=="string"?u.message:typeof u.error=="string"?u.error:"auth-complete \u5931\u8D25\uFF08\u7528\u6237\u662F\u5426\u5DF2\u5728\u6D4F\u89C8\u5668\u786E\u8BA4\uFF1F\uFF09")}).finally(()=>o(null))},d=e?.bindings.filter(r=>r.status==="ready").length??0;return t.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:12,fontSize:12,maxWidth:640}},t.default.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:10}},t.default.createElement("h3",{style:{margin:0,fontSize:14}},"LarkLink \u8D26\u53F7\u7BA1\u7406"),t.default.createElement("span",{style:{opacity:.65,fontSize:11}},e!==null?`${e.bindings.length} \u4E2A\u7ED1\u5B9A \xB7 ${d} \u4E2A\u53EF\u7528`:l?"\u52A0\u8F7D\u4E2D\u2026":""),t.default.createElement("span",{style:{marginLeft:"auto",display:"flex",gap:6}},h(a==="live"?"\u6838\u9A8C\u4E2D\u2026":"\u5B9E\u65F6\u6838\u9A8C",()=>{o("live"),s(!0),setTimeout(()=>o(null),400)},a==="live"),h("\u5BFC\u5165 profile(adopt)",()=>f("adopt","adopt",!0),a==="adopt"))),n!==null?t.default.createElement("div",{style:{color:"#ef4444"}},`\u52A0\u8F7D\u5931\u8D25\uFF1A${n}\uFF08\u63D2\u4EF6\u540E\u7AEF\u672A\u8FD0\u884C\uFF1F\uFF09`):null,y!==null?t.default.createElement("div",{style:{color:"#ef4444"}},y):null,c!==null?t.default.createElement(I,{flow:c,onCompleteAuth:k,busy:a}):null,e?.warnings?.map((r,u)=>t.default.createElement("div",{key:u,style:{color:"#f59e0b",fontSize:11}},r))??null,e!==null&&e.bindings.length===0?t.default.createElement("div",{style:{opacity:.7,border:"1px dashed rgba(128,128,128,.4)",borderRadius:10,padding:14}},"\u5C1A\u65E0\u7ED1\u5B9A\u3002\u70B9\u300C\u5BFC\u5165 profile(adopt)\u300D\u5BFC\u5165\u672C\u673A lark-cli profile\uFF1B\u5168\u65B0\u673A\u5668\u9700\u5728\u7EC8\u7AEF\u8FD0\u884C larklink bindings add \u65B0\u589E\u8D26\u53F7\uFF08app secret \u4E0D\u7ECF\u754C\u9762\uFF09\u3002"):null,e?.bindings.map(r=>t.default.createElement(K,{key:r.profile,b:r,onStartAuth:g,busy:a})),e!==null&&e.pins.length>0?t.default.createElement("div",{style:{display:"flex",flexDirection:"column",gap:4}},t.default.createElement("div",{style:{fontWeight:600}},`\u6587\u6863\u8D26\u53F7\u504F\u597D\uFF08pin\uFF0C${e.pins.length}\uFF09`),e.pins.map(r=>t.default.createElement("div",{key:r.token,style:{fontSize:11,opacity:.7,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},`${r.token.slice(0,16)}\u2026 \u2192 ${r.profile}`))):null,t.default.createElement("div",{style:{fontSize:10,opacity:.55}},"\u4F1A\u8BDD\u4E2D\u7C98\u8D34\u98DE\u4E66/Lark \u6587\u6863\u94FE\u63A5\u5373\u81EA\u52A8\u8DEF\u7531\uFF1BAgent \u9047\u672A\u767B\u5F55\u4F1A\u81EA\u52A8\u53D1\u8D77\u626B\u7801\u767B\u5F55\u3002\u65B0\u589E\u5E94\u7528\u4E0E\u5220\u9664\u7ED1\u5B9A\u6D89\u53CA app secret / \u7834\u574F\u6027\u64CD\u4F5C\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u6267\u884C larklink bindings add / remove\u3002"))}function G(){return t.default.createElement("span",{style:{display:"inline-flex",alignItems:"center",gap:6}},t.default.createElement(T,null),b)}function J(e){let l=[],n=i=>{typeof i=="function"&&l.push(i)},s=(i,a)=>{typeof a=="function"&&i.push(a)};if(n(e.inject(["sidebarRight","sidebarRightTabs"],i=>{let a=i.get("sidebarRightTabs");if(a===null||typeof a.register!="function")return()=>{};let o=[];return s(o,i.slots.inject(x,()=>i.slots.inject(R,()=>(o.push((()=>{let c=a.register({id:w,kind:j,title:()=>b,guide:[{order:70,title:()=>b,description:()=>"lark \u591A\u8D26\u53F7\u7ED1\u5B9A\u72B6\u6001\u4E0E\u6587\u6863\u8DEF\u7531\u504F\u597D\uFF08adopt / health / pins\uFF09",icon:T}]});return typeof c=="function"?c:()=>{}})()),s(o,i.slots.register({name:x,key:w},()=>t.default.createElement(W))),s(o,i.slots.register({name:R,key:w},()=>t.default.createElement(G))),()=>{for(let c of[...o].reverse())c()})))),()=>{for(let c of[...o].reverse())c()}})),e.slots!=null&&typeof e.slots.register=="function")try{n(e.slots.register({name:"settings.section",id:q,order:50,label:()=>"LarkLink \u8D26\u53F7\u7BA1\u7406"},()=>t.default.createElement(Y)))}catch(i){console.warn("[dsh-larklink] settings.section \u69FD\u4E0D\u53EF\u7528\uFF08\u5BBF\u4E3B\u672A\u58F0\u660E\uFF1F\uFF09\uFF0C\u8BBE\u7F6E\u9875\u5DF2\u8DF3\u8FC7\uFF0C\u4FA7\u680F\u9762\u677F\u4E0D\u53D7\u5F71\u54CD",i)}return()=>{for(let i of[...l].reverse())i()}}
8
+
9
+ return module.exports;
10
+ }
11
+ });
@@ -0,0 +1,52 @@
1
+ import Schema from "@deepseek-ai/schemastery";
2
+ /** 结构等价于 cli 层 LarkRunner(dts 打包不透传子路径类型,故本地声明)。 */
3
+ interface LarkRunnerLike {
4
+ (args: string[], opts?: {
5
+ timeoutMs?: number;
6
+ stdin?: string;
7
+ cwd?: string;
8
+ }): Promise<{
9
+ exitCode: number;
10
+ stdout: string;
11
+ stderr: string;
12
+ durationMs: number;
13
+ timedOut: boolean;
14
+ }>;
15
+ }
16
+ declare const name = "@timeryu/dsh-larklink";
17
+ declare const inject: string[];
18
+ /** 运行时配置(cordis 校验并填充默认值)。 */
19
+ declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
20
+ home: Schema<string, string, "defined">;
21
+ execTimeoutMs: Schema<number, number, "defined">;
22
+ probeTimeoutMs: Schema<number, number, "defined">;
23
+ }>>, Schemastery.ObjectT<NoInfer<{
24
+ home: Schema<string, string, "defined">;
25
+ execTimeoutMs: Schema<number, number, "defined">;
26
+ probeTimeoutMs: Schema<number, number, "defined">;
27
+ }>>, "plain">;
28
+ interface SkillService {
29
+ register(def: {
30
+ name: string;
31
+ description: string;
32
+ content: string;
33
+ source: string;
34
+ }): unknown;
35
+ }
36
+ interface PluginCtx {
37
+ tools: {
38
+ register(tool: unknown): unknown;
39
+ };
40
+ get(service: "skills"): SkillService | null;
41
+ effect(fn: () => () => void): void;
42
+ }
43
+ interface LarklinkPluginOptions {
44
+ /** 测试注入 mock runner。 */
45
+ runner?: LarkRunnerLike;
46
+ }
47
+ declare function apply(ctx: PluginCtx, config?: {
48
+ home?: string;
49
+ execTimeoutMs?: number;
50
+ probeTimeoutMs?: number;
51
+ }, options?: LarklinkPluginOptions): void;
52
+ export { Config, LarklinkPluginOptions, apply, inject, name };