dal-code 1.0.56 → 1.0.58
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/CHANGELOG.md +8 -0
- package/dist/bundle/chunks/{anthropic-messages-HHQLDDZH.js → anthropic-messages-FOIJU7LX.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-S7VKEJTH.js → azure-openai-responses-7NBJZKX5.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-QCT6OHUR.js → chunk-3QG7FIE4.js} +1 -1
- package/dist/bundle/chunks/chunk-4BOWD7PQ.js +1 -0
- package/dist/bundle/chunks/{chunk-UULAEZ3H.js → chunk-4PBY6OYS.js} +1 -1
- package/dist/bundle/chunks/{chunk-BIY5HTFI.js → chunk-5MF5GEDD.js} +1 -1
- package/dist/bundle/chunks/{chunk-3XMZ5UC3.js → chunk-B7KZDIWA.js} +1 -1
- package/dist/bundle/chunks/chunk-C5ELI234.js +17 -0
- package/dist/bundle/chunks/{chunk-RX6CC5RH.js → chunk-CCU76UL3.js} +443 -472
- package/dist/bundle/chunks/{chunk-PH42AQ66.js → chunk-DVEPGKL5.js} +1 -1
- package/dist/bundle/chunks/chunk-G5AMLGXC.js +1 -0
- package/dist/bundle/chunks/chunk-HF334NQU.js +21 -0
- package/dist/bundle/chunks/{chunk-Z64M4Q7A.js → chunk-IONGABQF.js} +1 -1
- package/dist/bundle/chunks/{chunk-F37JXTCY.js → chunk-JK74OC6W.js} +1 -1
- package/dist/bundle/chunks/chunk-JUUJCOIR.js +7 -0
- package/dist/bundle/chunks/chunk-JXAFVEE4.js +17 -0
- package/dist/bundle/chunks/chunk-LMZYTWXD.js +14 -0
- package/dist/bundle/chunks/chunk-NJDCSLWK.js +1 -0
- package/dist/bundle/chunks/{chunk-BCFLC6CK.js → chunk-NYSVXLKF.js} +1 -1
- package/dist/bundle/chunks/{chunk-P4IBZA6D.js → chunk-PMFHJN7I.js} +1 -1
- package/dist/bundle/chunks/chunk-QFBU27TM.js +30 -0
- package/dist/bundle/chunks/{chunk-SZZVJTVX.js → chunk-QU2VEHMW.js} +1 -1
- package/dist/bundle/chunks/chunk-SCZEDPDC.js +9 -0
- package/dist/bundle/chunks/{chunk-VGMP27KM.js → chunk-T5PI6B5P.js} +1 -1
- package/dist/bundle/chunks/{chunk-ZR6PGIL7.js → chunk-X7I3V6OA.js} +1 -1
- package/dist/bundle/chunks/{chunk-3HGUIN22.js → chunk-XQF5XDEM.js} +2 -2
- package/dist/bundle/chunks/{cli-TVPE43YN.js → cli-NQ7B7BGV.js} +1 -1
- package/dist/bundle/chunks/{cli-NGGC23SK.js → cli-RY666QAD.js} +1 -1
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-RK2YCJXC.js → cloudflare-workers-ai-system-one-CFGOMWWZ.js} +1 -1
- package/dist/bundle/chunks/{execute-MGTKJB44.js → execute-NJRE4WBO.js} +2 -2
- package/dist/bundle/chunks/{google-generative-ai-ZPA4VBXP.js → google-generative-ai-ZA2RHPNE.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-IWHW2RX7.js → google-vertex-Y2GRWOK7.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-FXJM52Q3.js → llama-cpp-classify-G2JDOFHY.js} +1 -1
- package/dist/bundle/chunks/{mcp-RLFUDVHN.js → mcp-45D7KCZZ.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-JXVPTO5Y.js → mistral-conversations-MLV32BRV.js} +1 -1
- package/dist/bundle/chunks/{office-RTREQQ7W.js → office-UBOUFRAU.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-EYW27UUE.js → openai-codex-responses-BDK3PY6G.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-ROBKXDOC.js → openai-completions-BLXHKAB3.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-4T5LPJRA.js → openai-decisions-IGVID576.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-ZVFZ75QW.js → openai-responses-KHZOEDF2.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-6VJYTLAX.js → openrouter-images-SA6PUASF.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-Y6HBOGKH.js → pi-messages-3VAOLQ2Y.js} +1 -1
- package/dist/bundle/chunks/{review-USSKCVWP.js → review-RZXLHPUZ.js} +2 -2
- package/dist/bundle/chunks/{router-4JLK3BTT.js → router-YBVXODIL.js} +1 -1
- package/dist/bundle/chunks/runtime-FNCZJKOC.js +1 -0
- package/dist/bundle/chunks/sdk-X6RX7FNE.js +1 -0
- package/dist/bundle/chunks/{sync-UCHKAOUU.js → sync-CRV6BXXC.js} +3 -3
- package/dist/bundle/chunks/{typesafe-system-one-XPDE7VYD.js → typesafe-system-one-ER3DLYNF.js} +1 -1
- package/dist/bundle/chunks/usage-LMRFS2HV.js +1 -0
- package/dist/bundle/chunks/virtual-modules-XIUNRFOZ.js +1 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/node_modules/@dalcode/dal-advisor/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-awake/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-capabilities/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-codeindex/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-compat/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-dap/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-goal/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-learn/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-learn/src/engine.js +3 -3
- package/dist/node_modules/@dalcode/dal-learn/src/index.js +11 -11
- package/dist/node_modules/@dalcode/dal-learn/src/lessons.js +4 -4
- package/dist/node_modules/@dalcode/dal-learn/src/project-map.js +2 -2
- package/dist/node_modules/@dalcode/dal-learn/src/signals.js +6 -6
- package/dist/node_modules/@dalcode/dal-learn/src/store.js +3 -3
- package/dist/node_modules/@dalcode/dal-lsp/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-mcp/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/agent-dir.js +1 -0
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/agent-dir.js +1 -0
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-recall/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-remote/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +6 -6
- package/dist/node_modules/@dalcode/dal-rtk/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-statusline/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-structured/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-sync/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-usage/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.d.ts +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/utils/version.js +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-schema/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/bundle/chunks/chunk-3YGHTGYM.js +0 -7
- package/dist/bundle/chunks/chunk-MKMLENQD.js +0 -17
- package/dist/bundle/chunks/chunk-SE42OS3U.js +0 -21
- package/dist/bundle/chunks/chunk-T3TEURLR.js +0 -30
- package/dist/bundle/chunks/chunk-XTN2LDU3.js +0 -9
- package/dist/bundle/chunks/runtime-G7F6UQLA.js +0 -1
- package/dist/bundle/chunks/sdk-CEIRR6KD.js +0 -1
- package/dist/bundle/chunks/usage-3ACOJWR3.js +0 -1
- package/dist/bundle/chunks/virtual-modules-P4JE2EA6.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
`):""}c(y,"k"),a(y,"textOf");function
|
|
3
|
-
`?l():(u==="&"||u==="|")&&
|
|
4
|
-
`),i=
|
|
5
|
-
`);for(;o.length>
|
|
6
|
-
`);return o.slice(0,
|
|
1
|
+
var pt=Object.defineProperty;var c=(t,e)=>pt(t,"name",{value:e,configurable:!0});var ft=Object.defineProperty,a=c((t,e)=>ft(t,"name",{value:e,configurable:!0}),"a");import{isSensitivePath as mt,redact as b}from"./safety.js";const bt=new Set(["bash","powershell","shell"]),gt=4e3;function y(t){return typeof t=="string"?t:Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&e.type==="text").map(e=>e.text).join(`
|
|
2
|
+
`):""}c(y,"k"),a(y,"textOf");function T(t){let e=t.trim(),n;for(;;){const o=/^cd\s+("[^"]+"|'[^']+'|[^\s;&|]+)\s*(?:&&|;)\s*/.exec(e);if(o){const i=o[1].replace(/^["']|["']$/g,"");n=n&&!i.startsWith("/")?`${n}/${i}`:i,e=e.slice(o[0].length);continue}const s=/^(?:[A-Z_][A-Z0-9_]*=(?:"[^"]*"|'[^']*'|\S*)\s+)+/.exec(e);if(s){e=e.slice(s[0].length);continue}break}return{command:e,...n?{cdDir:n}:{}}}c(T,"G"),a(T,"splitCommand");const G=[["typecheck",/\btsc\b(?!.*--build)|\bmypy\b|\bpyright\b|\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:typecheck|type-check|check-types)\b/],["test",/\b(?:vitest|jest|mocha|ava|pytest|tox|rspec|phpunit)\b|\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?test\b|\bnode\s+--test\b|\b(?:go|cargo|dotnet|mix|deno)\s+test\b|\bmake\s+test\b|\bgradlew?\s+test\b|\bmvn\s+test\b/],["lint",/\b(?:eslint|biome|ruff|flake8|pylint|golangci-lint|clippy|prettier\s+--check)\b|\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:lint|check)\b/],["build",/\b(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?build\b|\b(?:cargo|go|dotnet|swift)\s+build\b|\bmake\b(?!\s+test)|\bgradlew?\s+(?:build|assemble)\b|\bmvn\s+(?:package|install)\b|\btsc\s+--build\b|\bvite\s+build\b|\bwebpack\b/],["install",/^(?:npm\s+(?:ci|install|i)|pnpm\s+(?:install|i)|yarn(?:\s+install)?|bun\s+install|pip3?\s+install\s+(?:-r|-e|\.)|poetry\s+install|uv\s+sync|bundle\s+install|composer\s+install|go\s+mod\s+download)(?:\s|$)/]],ht=[/^# fail [1-9]/m,/^npm (?:ERR!|error) (?:code ELIFECYCLE|Lifecycle script|Test failed)/m,/^\s*Tests:\s+\d+ failed/m,/^\s*Test Files\s+\d+ failed/m,/^=+ .*\b\d+ (?:failed|errors?)\b.* =+$/m,/^\s+\d+ failing$/m,/^(?:FAIL|--- FAIL:?)\s/m,/test result: FAILED/,/^make(?:\[\d+\])?: \*\*\* .*Error \d+/m,/\berror TS\d+:/,/^Found \d+ errors? in \d+ files?/m,/^not ok \d+\b(?![^\n]*#\s*(?:TODO|SKIP)\b)/m],kt=[/^# fail 0\b/m,/^\s*Tests:\s+(?:\d+ (?:skipped|todo), )*\d+ passed/m,/^\s*Test Files\s+\d+ passed/m,/^=+ .*\b\d+ passed\b.* =+$/m,/^\s+\d+ passing\b/m,/^ok\s+\S+\s+[\d.]+s$/m,/test result: ok\b/,/^Found 0 errors\b/m],yt=/^(?:tail|head|grep|egrep|fgrep|cat|less|more|tee|wc|sort|uniq|cut|column|sed|awk|nl)\b/,$t=/^(?:head|grep|egrep|fgrep|cut|sed|awk)\b/,wt=/^(?:echo|printf|cat|ls|pwd|true|false|:|#|sed|awk|grep|rg|head|tail|wc|find|git\s+(?:diff|status|log|show|stash|add)|set|export|printenv|which|whereis|type|command\s+-v|test\s|\[|stat|file|(?:node|npm|pnpm|yarn|bun|npx)\s+(?:-v|--version)|(?:npm|pnpm|yarn)\s+(?:ls|list|view|info|bin|root|config|why))(?:\b|(?=\s|$))/;function J(t){const e=t.replace(/<<-?\s*(['"]?)(\w+)\1([^\n]*)\n[\s\S]*?\n[ \t]*\2[ \t]*(?=\n|$)/g,"<<$2$3").replace(/\s*\d*>&\d+/g,""),n=[];let o=[],s="",i;const r=a(()=>{o.push(s.trim()),s=""},"endStage"),l=a(()=>{r();const d=o.filter(Boolean);d.length&&n.push(d),o=[]},"endStatement");for(let d=0;d<e.length;d++){const u=e[d];if(i){if(u==="\\"&&i==='"'){s+=u+(e[d+1]??""),d++;continue}u===i&&(i=void 0),s+=u;continue}u==="'"||u==='"'?(i=u,s+=u):u==="\\"?(s+=u+(e[d+1]??""),d++):u===";"||u===`
|
|
3
|
+
`?l():(u==="&"||u==="|")&&e[d+1]===u?(l(),d++):u==="&"?l():u==="|"?r():s+=u}return l(),n}c(J,"W"),a(J,"splitStatements");function $(t){const e=[];let n=!1;for(const o of J(t)){const s=[...o];let i=!1;for(;s.length>1&&yt.test(s.at(-1));)$t.test(s.at(-1))&&(i=!0),s.pop();const r=s.join(" | ").replace(/\s+/g," ");/^cd\s/.test(r)?e.push(r):!wt.test(r)&&v(r)&&(e.push(r),i&&(n=!0))}for(;e.length&&/^cd\s/.test(e.at(-1));)e.pop();return{statements:e,selected:n}}c($,"E"),a($,"checkParts");function w(t){const{statements:e}=$(t);return e.length?e.join(" && "):void 0}c(w,"R"),a(w,"checkCommand");function A(t){return kt.some(e=>e.test(t))}c(A,"X"),a(A,"reportsPass");function K(t){return w(t)??t.replace(/\s+/g," ").trim()}c(K,"Ct"),a(K,"bareCommand");function O(t){return ht.some(e=>e.test(t))}c(O,"Y"),a(O,"reportsFailure");function v(t){for(const[e,n]of G)if(n.test(t))return e}c(v,"x"),a(v,"intentOf");function R(t){const e=w(t)?.split(" && ").filter(n=>!/^cd\s/.test(n))??[];for(const[n,o]of G)if(e.some(s=>o.test(s)))return n}c(R,"Z"),a(R,"commandIntent");function _(t){const e=new Map;for(const o of t)if(o?.role==="toolResult"&&typeof o.toolCallId=="string"){const s=y(o.content);e.set(o.toolCallId,{isError:o.isError===!0,output:s.slice(0,gt),failing:O(s),passing:A(s)})}const n=[];for(const o of t)if(!(o?.role!=="assistant"||!Array.isArray(o.content)))for(const s of o.content){if(s?.type!=="toolCall"||typeof s.name!="string")continue;const i=typeof s.id=="string"?s.id:"",r=s.arguments&&typeof s.arguments=="object"?s.arguments:{},l=e.get(i);if(!l)continue;const d={id:i,name:s.name,args:r,isError:l.isError,output:l.output};if(bt.has(s.name)&&typeof r.command=="string"){const u=T(r.command);d.command=u.command,u.cdDir&&(d.cdDir=u.cdDir);const m=R(u.command);m&&(d.intent=m),m&&it.has(m)&&!d.isError&&l.failing?(d.isError=!0,d.swallowedFailure=!0):m&&!d.isError&&!l.passing&&$(u.command).selected&&(d.unverifiedPass=!0)}n.push(d)}return n}c(_,"J"),a(_,"toolSteps");const X=120,H=/^(?:at\s|\S+\s\(\S+:\d+:\d+\)$|(?:file:\/\/)?\S+\.(?:[cm]?[jt]sx?|py|go|rs|rb|java|kt|php)(?::\d+){1,2}$|.*\bnode:internal\/|Node\.js v\d)/,Y=/^(?:>?\s*\d+\s*\|.*|[\s|]*\^+[\s^~]*|(?:if|else|for|while|switch|const|let|var|return|function|class|import|export|async|await|def|try|catch)\b.*|\}.*)$|\bthrow new\b|=>|[;{]$/,Q=/^(?:(?:duration_ms|type|location|failureType|code|stack|operator|expected|actual|generatedMessage|name):|\.{3}$|-{3}$|TAP version|Subtest:|1\.\.\d+$|(?:tests|suites|pass|fail|cancelled|skipped|todo|duration_ms)\s+\d|Command exited with code)/,vt=/^(?:E\s+)?(?:Uncaught\s+)?(?:[A-Z][\w.]*(?:Error|Exception)|Error|error(?: TS\d+|\[E\d+\])?)(?:\s*\[[\w-]+\])?:\s*\S|\berror TS\d+:\s*\S/,Et=/^(?:expected\b.*\b(?:received|to (?:be|equal)|but got)\b|(?:Expected|Received)(?: value)?:\s*\S|.+\s!==?\s.+)/i,St=/^(?:FAIL(?:ED)?\b|not ok \d+|[✖×✗]\s|--- FAIL:?)/,xt=/not found|no such|cannot|can't|unable|error|fail|missing|denied|unknown|invalid|找不到|不存在|失败|错误/i;function V(t){const e=t.trim().replace(/^#\s?/,"").trim();return e!==""&&(H.test(e)||Y.test(e)||Q.test(e))}c(V,"vt"),a(V,"isUntellingReason");function tt(t){const e=t.findIndex(s=>Et.test(s));if(e<0)return;const n=t[e],o=/^Expected(?: value)?:/i.test(n)?t.slice(e+1,e+4).find(s=>/^Received(?: value)?:/i.test(s)):void 0;return o?`${n}, ${o}`:n}c(tt,"nt"),a(tt,"comparison");function et(t){const e=b(t).replace(/\s+/g," ").trim();return e.length>X?`${e.slice(0,X-1)}\u2026`:e}c(et,"st"),a(et,"clipReason");function st(t){const e=[];for(let n=0;n<t.length;n++){const o=/^error:\s*(.*)$/.exec(t[n]);if(!o)continue;let s=o[1].replace(/^'(.*)'$/,"$1").replace(/^"(.*)"$/,"$1");if(/^\|-?$/.test(s)){const r=[];for(let l=n+1;l<t.length&&r.length<2&&!/^[a-z_]+:\s/i.test(t[l]);l++)r.push(t[l]);s=r.join(" ")}if(!s||s==="test failed")continue;let i="";for(let r=n+1;r<Math.min(t.length,n+12)&&!/^(?:\.{3}|not ok|ok)\b/.test(t[r]);r++){const l=/^name:\s*'?([\w.]+)'?$/.exec(t[r]);if(l){i=l[1];break}}e.push(i&&!s.startsWith(i)?`${i}: ${s}`:s)}return e}c(st,"ot"),a(st,"tapErrors");function L(t){const e=t.split(/\r?\n/).map(s=>s.trim().replace(/^#\s?/,"").trim()).filter(Boolean),n=e.filter(s=>!H.test(s)&&!Y.test(s)&&!Q.test(s)),o=st(e)[0]??n.find(s=>vt.test(s))??tt(n)??n.find(s=>St.test(s))??n.find(s=>xt.test(s))??"";return et(o)}c(L,"rt"),a(L,"failureReason");function h(t){let e="";const n=[];for(const o of $(t).statements){const s=/^cd\s+("[^"]+"|'[^']+'|\S+)$/.exec(o);if(s){const r=s[1].replace(/^["']|["']$/g,"");e=e&&!r.startsWith("/")?`${e}/${r}`:r;continue}const i=o.replace(/\s+/g," ").trim();n.some(r=>r.dir===e&&r.check===i)||n.push({dir:e,check:i,...v(i)?{intent:v(i)}:{}})}return n}c(h,"h"),a(h,"segmentsOf");function nt(t,e){return t===e||` ${t} `.includes(` ${e} `)||` ${e} `.includes(` ${t} `)}c(nt,"it"),a(nt,"overlaps");function F(t,e){const n=h(t),o=h(e),s=a((p,f)=>p.dir===f.dir&&p.check===f.check,"same"),i=n.filter(p=>!o.some(f=>s(p,f)));if(i.length===0)return;const r=new Set(i.map(p=>p.intent)),l=o.filter(p=>!n.some(f=>s(p,f))||r.has(p.intent)),d=i.filter(p=>l.some(f=>f.intent===p.intent));if(d.length===0||l.length===0||[...d,...l].some(p=>/^(?:\/|~|\$)/.test(p.dir))||d.some(p=>l.some(f=>f.dir===p.dir&&nt(p.check,f.check))))return;const u=a(p=>{const f=p[0].dir;if(p.some(j=>j.dir!==f))return;const Z=p.map(j=>j.check).join(" && ");return f?`cd ${f} && ${Z}`:Z},"joined"),m=u(d),C=u(l);if(!(!m||!C||m===C))return{bad:m,good:C}}c(F,"at"),a(F,"fixCommands");function E(t,e,n=!1){const o=h(t),s=h(e);if(s.length===0)return!1;const i=a((r,l)=>r.some(d=>d.dir===l.dir&&d.check===l.check),"has");return s.every(r=>i(o,r))&&(!n||o.every(r=>i(s,r)))}c(E,"_"),a(E,"runsChecks");function S(t){return t.cdDir?`cd ${t.cdDir} && ${t.command??""}`:t.command??""}c(S,"w"),a(S,"located");const Ct=/\|\||;|\n/;function ot(t,e){let n=!1;for(const o of t){if(!o.command)continue;const s=b(S(o));o.isError?E(s,e,!0)&&(n=!1):!o.unverifiedPass&&!Ct.test(o.command)&&E(s,e)&&(n=!0)}return n}c(ot,"At"),a(ot,"passedLast");const jt=/command not found|: not found|is not (?:set|defined)|Missing script|Cannot find (?:module|package)|ERR_MODULE_NOT_FOUND|ENOENT|No such file|unknown (?:option|command|script|flag)|not recognized as|No test files|No tests found|permission denied|EACCES|找不到|未设置|不存在|未找到/i,Tt=/AssertionError|^\s*(?:Expected|Received)(?: value)?:|\bexpected\b.*\b(?:received|to (?:be|equal)|but got)\b|\s!==?\s|^not ok \d+|^#\s*fail\s+[1-9]|^\s*\d+ (?:failing|failed)\b|Tests?:\s+\d+ failed|\berror TS\d+:|\d+ problems? \(\d+ errors?/im;function P(t){return Tt.test(t)&&!jt.test(t)}c(P,"ut"),a(P,"codeFailed");function D(t){const e=[],n=new Set;for(let o=0;o<t.length;o++){const s=t[o];if(!(!s.isError||!s.intent||!s.command||n.has(s.id))&&!P(s.output))for(let i=o+1;i<t.length;i++){const r=t[i];if(r.intent!==s.intent||!r.command||r.isError||r.unverifiedPass)continue;const l=F(S(s),S(r));if(!l)break;n.add(s.id),e.push({intent:s.intent,failed:s,fixed:r,...l,reason:L(s.output),proven:r.intent!=="install"});break}}return e}c(D,"ft"),a(D,"fixPairs");const At=/(?:^|[\s,.!?,。!?])(?:不对|不是这样|错了|搞错|弄错|别这样|不要这样|我说的是|我的意思是|应该是|你又|还是不行|还是错|并不是|别用|不要用|改用)|\b(?:that'?s (?:not|wrong)|not what I (?:asked|meant|said)|you (?:broke|missed|forgot)|wrong (?:file|approach|command)|I said|still (?:broken|failing|wrong)|don'?t use|use \S+ instead|try again)\b/iu;function I(t){return At.test(t)}c(I,"mt"),a(I,"isCorrection");const Ot=/dal-guard|safety.?net|blocked by|was blocked|refused by|not allowed by|用户已拒绝|已拦截|拦截了|需要交互式审批|已被拦下|保护拒绝/i;function N(t){return t.isError&&Ot.test(t.output)}c(N,"bt"),a(N,"isDenial");const Rt=new Set(["grep","find","ls","glob"]);function M(t){return Rt.has(t.name)?!0:!!t.command&&/^(?:rg|grep|ag|find|fd|ls|git\s+grep)\b/.test(t.command)}c(M,"yt"),a(M,"isSearch");function U(t){return`${t.name}:${JSON.stringify(t.args)}`}c(U,"O"),a(U,"callKey");function q(t){const e=new Map;for(const o of t)e.set(U(o),(e.get(U(o))??0)+1);if([...e.values()].some(o=>o>=3)||t.filter(o=>o.isError).length>=3)return!0;let n=0;for(const o of t)if(n=M(o)?n+1:0,n>=6)return!0;return!1}c(q,"St"),a(q,"isDetour");function rt(t,e){const n=t,o=y(n.find(r=>r?.role==="user")?.content),s=n.filter(r=>r?.role==="assistant").map(r=>y(r.content)).filter(Boolean).join(`
|
|
4
|
+
`),i=_(t);return{userPrompt:o,assistantText:s,steps:i,fixes:D(i),corrected:!!e?.trim()&&I(o),detour:q(i),denials:i.filter(N)}}c(rt,"It"),a(rt,"analyzeRun");function z(t){return t.corrected||t.detour||t.denials.length>0}c(z,"kt"),a(z,"needsModel");const it=new Set(["test","build","lint","typecheck"]);function x(t){const e=t.findLast(n=>n.intent!==void 0&&it.has(n.intent));if(e)return e.isError?"failed":"passed"}c(x,"N"),a(x,"verifiedOutcome");function at(t,e){return e.length>0&&x(t.steps)!==void 0}c(at,"_t"),a(at,"needsReflection");const ct=25;function lt(t){return t.steps.length>=ct&&x(t.steps)==="passed"&&!z(t)}c(lt,"Ot"),a(lt,"longSuccess");const k={user:800,assistant:600,toolCall:300,toolOutput:400},B=12e3;function g(t,e){const n=t.replace(/\s+/g," ").trim();return n.length>e?`${n.slice(0,e)}\u2026`:n}c(g,"b"),a(g,"clip");const _t=/(?:^|\/)(?:package\.json|package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|requirements[^/]*\.txt|pyproject\.toml|poetry\.lock|Pipfile(?:\.lock)?|Cargo\.(?:toml|lock)|go\.(?:mod|sum)|Gemfile(?:\.lock)?|composer\.(?:json|lock)|\.gitlab-ci\.yml|\.github\/workflows\/[^/]+)$/,Lt=/(?:^|[;&|]\s*)(?:npm\s+(?:i|install|add|uninstall|rm)\b(?=[^;&|]*\s[@a-z])|pnpm\s+(?:add|remove|i\s+\S|install\s+\S)|yarn\s+(?:add|remove)\b|bun\s+(?:add|remove)\b|pip3?\s+install\s+(?!-r\b|-e\b|\.)\S|poetry\s+add\b|cargo\s+add\b|go\s+get\b)/,Ft=/(?:>>?|\btee\b|\bsed\s+-i\b|\bnpm\s+pkg\s+set\b)[^;&|]*(?:package\.json|package-lock\.json|pnpm-lock\.yaml|yarn\.lock|requirements[^/\s]*\.txt|pyproject\.toml|Cargo\.toml|go\.mod)/;function dt(t){const e=new Set;for(const n of t){if(n.isError)continue;const o=W(n);o&&/^(?:edit|write|multiedit|apply_patch|str_replace)/i.test(n.name)&&_t.test(o.replace(/\\/g,"/"))&&e.add(o.split(/[\\/]/).at(-1));const s=n.command??(typeof n.args.command=="string"?n.args.command:"");if(!s)continue;Lt.test(s)&&e.add("dependencies");const i=Ft.exec(s);i&&e.add(i[0].match(/[\w.-]+$/)?.[0]??"package.json")}return[...e]}c(dt,"Lt"),a(dt,"protectedChanges");function W(t){const e=t.args.path??t.args.file_path??t.args.file;return typeof e=="string"?e:""}c(W,"F"),a(W,"pathArg");function ut(t,e){const n=[];e&&n.push(`[previous answer] ${g(b(e),k.assistant)}`),n.push(`[user] ${g(b(t.userPrompt),k.user)}`);for(const s of t.steps){const i=s.command??JSON.stringify(s.args),r=mt(W(s))||(s.command?/\.env\b|auth\.json|id_rsa|\.pem\b/.test(s.command):!1);n.push(`[tool ${s.name}] ${g(b(i),k.toolCall)}`);const l=r?"(content of a sensitive file left out)":g(b(s.output),k.toolOutput);n.push(`[tool_output${s.isError?" \xB7 error":""}] ${l}`)}t.assistantText&&n.push(`[assistant] ${g(b(t.assistantText),k.assistant)}`);let o=n.join(`
|
|
5
|
+
`);for(;o.length>B&&n.length>3;)n.splice(e?2:1,1),o=n.join(`
|
|
6
|
+
`);return o.slice(0,B)}c(ut,"Nt"),a(ut,"buildExcerpt");export{ct as LONG_RUN_TOOL_CALLS,B as MAX_EXCERPT_CHARS,rt as analyzeRun,K as bareCommand,ut as buildExcerpt,w as checkCommand,P as codeFailed,R as commandIntent,L as failureReason,F as fixCommands,D as fixPairs,I as isCorrection,N as isDenial,q as isDetour,M as isSearch,V as isUntellingReason,lt as longSuccess,z as needsModel,at as needsReflection,ot as passedLast,dt as protectedChanges,O as reportsFailure,A as reportsPass,E as runsChecks,T as splitCommand,_ as toolSteps,x as verifiedOutcome};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
`,{mode:384}),s})}o(D,"P"),i(D,"updateDoc");function O(t){return
|
|
3
|
-
`,{mode:384})}o(U,"
|
|
1
|
+
var H=Object.defineProperty;var o=(t,e)=>H(t,"name",{value:e,configurable:!0});var Q=Object.defineProperty,i=o((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");import{existsSync as V,mkdirSync as x,readdirSync as W,readFileSync as Z,renameSync as q,rmSync as k,unlinkSync as B}from"node:fs";import{dirname as tt,join as d,resolve as et}from"node:path";import{agentDir as nt,DATA_FORMAT_KEY as E,declaredDataFormat as j,reportNewerDataFormat as R,withFileLockSync as rt,writeFileAtomicSync as N}from"@dalcode/dal-pi-kit";const f=1;function _(t){if(t)return t;const e=process.env.DAL_LEARN_DIR?.trim();return e?et(e):d(nt(),"learned")}o(_,"H"),i(_,"learnedRoot");function F(t){return d(t,"user")}o(F,"Q"),i(F,"userDir");function M(t,e){return d(t,"projects",e)}o(M,"V"),i(M,"projectDir");function y(t){let e;try{e=Z(t,"utf8")}catch{return}try{const n=JSON.parse(e);return n&&typeof n=="object"&&!Array.isArray(n)?n:void 0}catch{return}}o(y,"l"),i(y,"readRaw");function v(t,e){const n=y(t),r=n!==void 0&&j(n)>f;return r&&R(t),{value:e(n),readOnly:r}}o(v,"O"),i(v,"readDoc");function D(t,e,n){return x(tt(t),{recursive:!0,mode:448}),rt(t,()=>{const r=y(t);if(r!==void 0&&j(r)>f){R(t);return}const s=n(e(r));if(s===void 0)return;const a={...r??{},...s,[E]:f};return N(t,`${JSON.stringify(a,null," ")}
|
|
2
|
+
`,{mode:384}),s})}o(D,"P"),i(D,"updateDoc");function O(t){return V(t)}o(O,"W"),i(O,"fileExists");function l(t,e){return typeof t=="string"?t.trim().slice(0,e):""}o(l,"g"),i(l,"str");function c(t){return typeof t=="number"&&Number.isFinite(t)&&t>=0?Math.floor(t):0}o(c,"u"),i(c,"num");function m(t,e,n){return Array.isArray(t)?t.filter(r=>typeof r=="string"&&r.length>0).map(r=>r.slice(0,n)).slice(-e):[]}o(m,"x"),i(m,"strList");function $(t){return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&!Array.isArray(e)):[]}o($,"Z"),i($,"records");function S(t){const e=new Date(t);return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}o(S,"L"),i(S,"dayOf");function b(t){let e=0;for(const n of t)/[⺀-鿿가-豈--]/u.test(n)&&e++;return e+Math.ceil((t.length-e)/4)}o(b,"ee"),i(b,"estimateTokens");function T(t){return{day:l(t?.day,10),runs:c(t?.runs),reflectRuns:c(t?.reflectRuns),inputTokens:c(t?.inputTokens),outputTokens:c(t?.outputTokens)}}o(T,"b"),i(T,"parseUsage");function h(t,e){const n=S(e);return t.day===n?t:{day:n,runs:0,reflectRuns:0,inputTokens:0,outputTokens:0}}o(h,"T"),i(h,"today");function w(t,e){return h(v(d(t,"usage.json"),T).value,e)}o(w,"ne"),i(w,"readUsage");function L(t,e,n,r="draft"){const s=r==="reflect"?"reflectRuns":"runs";return D(d(t,"usage.json"),T,a=>{const u=h(a,n);return u[s]>=e?void 0:{...u,[s]:u[s]+1}})!==void 0}o(L,"te"),i(L,"claimExtraction");function I(t,e,n,r){D(d(t,"usage.json"),T,s=>{const a=h(s,r);return{...a,inputTokens:a.inputTokens+c(e),outputTokens:a.outputTokens+c(n)}})}o(I,"re"),i(I,"recordExtractionTokens");const ot=["draft","reflect","induce"],K=20,G=10080*60*1e3,J=3,st=/^[a-z0-9-]{4,64}\.json$/;function g(t){return d(t,"pending")}o(g,"D"),i(g,"pendingDir");function A(t,e){return d(g(t),`${e}.json`)}o(A,"m"),i(A,"pendingPath");function P(t){if(!t)return;const e=t.reason&&typeof t.reason=="object"?t.reason:{},n=ot.includes(t.kind)?t.kind:"draft",r=m(t.injected,40,16),s={id:l(t.id,64),kind:n,...n==="reflect"?{injected:r,outcome:t.outcome==="failed"?"failed":"passed",...m(t.touched,20,80).length?{touched:m(t.touched,20,80)}:{}}:{},...n==="induce"&&r.length>0?{injected:r}:{},createdAt:c(t.createdAt),attempts:c(t.attempts),projectKey:l(t.projectKey,128),projectRoot:l(t.projectRoot,4096),sessionId:l(t.sessionId,200),excerpt:typeof t.excerpt=="string"?t.excerpt:"",reason:{corrected:e.corrected===!0,detour:e.detour===!0,denials:c(e.denials),fixes:c(e.fixes)}};return s.id&&s.projectKey&&s.excerpt&&s.createdAt>0&&(n!=="reflect"||r.length>0)?s:void 0}o(P,"h"),i(P,"parsePending");function U(t,e){x(g(t),{recursive:!0,mode:448});const n={...e,[E]:f};N(A(t,e.id),`${JSON.stringify(n,null," ")}
|
|
3
|
+
`,{mode:384})}o(U,"ie"),i(U,"writePending");function X(t,e){try{return B(A(t,e)),!0}catch{return!1}}o(X,"oe"),i(X,"removePending");function Y(t,e){const n=g(t),r=[];for(const s of z(n)){if(!st.test(s))continue;const a=d(n,s),u=y(a),p=P(u);if(!p||u!==void 0&&j(u)>f||e-p.createdAt>G||p.attempts>=J||`${p.id}.json`!==s){(!u||j(u)<=f)&&k(a,{force:!0});continue}r.push(p)}for(r.sort((s,a)=>s.createdAt-a.createdAt);r.length>K;){const s=r.shift();s&&k(A(t,s.id),{force:!0})}return r}o(Y,"se"),i(Y,"listPending");function z(t){try{return W(t)}catch{return[]}}o(z,"X"),i(z,"readdirSafe");function C(t,e){const n=A(t,e),r=`${n}.claimed`;try{q(n,r)}catch{return}const s=P(y(r));return k(r,{force:!0}),s}o(C,"ue"),i(C,"claimPending");export{f as LEARNED_FORMAT,K as MAX_PENDING,J as MAX_PENDING_ATTEMPTS,G as PENDING_TTL_MS,L as claimExtraction,C as claimPending,S as dayOf,b as estimateTokens,O as fileExists,_ as learnedRoot,Y as listPending,c as num,g as pendingDir,M as projectDir,v as readDoc,w as readUsage,I as recordExtractionTokens,$ as records,X as removePending,l as str,m as strList,D as updateDoc,F as userDir,U as writePending};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-lsp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@dalcode/dal-bridge": "1.0.
|
|
25
|
-
"@dalcode/dal-dap": "1.0.
|
|
26
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
24
|
+
"@dalcode/dal-bridge": "1.0.58",
|
|
25
|
+
"@dalcode/dal-dap": "1.0.58",
|
|
26
|
+
"@dalcode/dal-pi-kit": "1.0.58",
|
|
27
27
|
"cross-spawn": "7.0.6",
|
|
28
28
|
"typebox": "1.3.7",
|
|
29
29
|
"typescript": "5.9.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@dalcode/dal-bridge": "1.0.
|
|
33
|
-
"@dalcode/dal-guard": "1.0.
|
|
34
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
35
|
-
"@dalcode/deepailab": "1.0.
|
|
36
|
-
"@earendil-works/pi-mcp": "1.0.
|
|
32
|
+
"@dalcode/dal-bridge": "1.0.58",
|
|
33
|
+
"@dalcode/dal-guard": "1.0.58",
|
|
34
|
+
"@dalcode/dal-pi-kit": "1.0.58",
|
|
35
|
+
"@dalcode/deepailab": "1.0.58",
|
|
36
|
+
"@earendil-works/pi-mcp": "1.0.58",
|
|
37
37
|
"cross-spawn": "7.0.6"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-office",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
21
|
+
"@dalcode/dal-pi-kit": "1.0.58",
|
|
22
22
|
"docx": "9.7.1",
|
|
23
23
|
"echarts": "6.1.0",
|
|
24
24
|
"exceljs": "4.4.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;var i=(r,o)=>e(r,"name",{value:o,configurable:!0});import{homedir as t}from"node:os";import{join as n}from"node:path";function a(){const r=process.env.DAL_CODING_AGENT_DIR;return r?r==="~"?t():r.startsWith("~/")||process.platform==="win32"&&r.startsWith("~\\")?n(t(),r.slice(2)):r:n(t(),".dal","agent")}i(a,"agentDir");export{a as agentDir};
|