@comate/zulu 1.3.3 → 1.3.4-beta.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 (32) hide show
  1. package/comate-engine/assets/skills/auto-commit-comate/SKILL.md +42 -62
  2. package/comate-engine/assets/skills/auto-commit-comate/references/data_structures.md +69 -75
  3. package/comate-engine/assets/skills/auto-commit-comate/references/interaction_instruction.md +220 -0
  4. package/comate-engine/assets/skills/auto-commit-comate/scripts/build_git_commit_payload.py +195 -0
  5. package/comate-engine/assets/skills/auto-commit-comate/scripts/build_icafe_cards_payload.py +80 -0
  6. package/comate-engine/assets/skills/auto-commit-comate/scripts/cache_manager.py +69 -0
  7. package/comate-engine/assets/skills/auto-commit-comate/scripts/git_diff_cli.py +5 -0
  8. package/comate-engine/assets/skills/auto-commit-comate/scripts/match_card_cli.py +5 -1
  9. package/comate-engine/assets/skills/auto-commit-comate/scripts/payload_validators.py +309 -0
  10. package/comate-engine/assets/skills/code-security-comate/SKILL.md +2 -1
  11. package/comate-engine/assets/skills/code-security-comate/references/vul_repair-go_sql_injection.md +627 -5
  12. package/comate-engine/assets/skills/code-security-comate/references/vul_repair-java_sql_injection.md +545 -21
  13. package/comate-engine/assets/skills/code-security-comate/references/vul_repair-php_sql_injection.md +596 -13
  14. package/comate-engine/assets/skills/code-security-comate/references/vul_repair-python_sql_injection.md +480 -82
  15. package/comate-engine/assets/skills/code-security-comate/scripts/http_client.py +10 -2
  16. package/comate-engine/assets/skills/code-security-comate/scripts/repair_vulnerability.py +12 -10
  17. package/comate-engine/assets/skills/code-security-comate/scripts/report_chat.py +1 -1
  18. package/comate-engine/assets/skills/comate-docs-comate/SKILL.md +70 -105
  19. package/comate-engine/assets/skills/comate-docs-comate/references/doc-map-extended.md +52 -7
  20. package/comate-engine/assets/skills/comate-docs-comate/references/models-and-billing.md +45 -26
  21. package/comate-engine/assets/skills/comate-docs-comate/references/product-overview.md +60 -14
  22. package/comate-engine/assets/skills/create-image-comate/SKILL.md +7 -7
  23. package/comate-engine/assets/skills/get-ugate-token-comate/SKILL.md +2 -0
  24. package/comate-engine/node_modules/@comate/plugin-engine/dist/index.js +1 -1
  25. package/comate-engine/node_modules/@comate/plugin-host/dist/index-7HvPXRep.js +1 -0
  26. package/comate-engine/node_modules/@comate/plugin-host/dist/index.js +1 -1
  27. package/comate-engine/node_modules/@comate/plugin-host/dist/main.js +1 -1
  28. package/comate-engine/node_modules/@comate/plugin-host/dist/user-DVjAG3wH.js +44 -0
  29. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.js +8 -8
  30. package/comate-engine/server.js +378 -266
  31. package/dist/bundle/index.js +3 -3
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- import{U as t,S as e}from"./user-DAIE9qbz.js";export{B as BackgroundServiceProvider,C as ConfigProvider,F as FallbackProvider,a as FunctionModel,P as PromptProvider,T as TextModel,n as getGitRepositoryUrl}from"./user-DAIE9qbz.js";import"node:path";import"node:fs/promises";import"node:fs";import"node:process";import"node:url";import"node:stream";import"os";import"path";import"node:crypto";import"node:os";import"node:buffer";import"node:child_process";import"child_process";import"fs";import"node:timers/promises";import"stream";import"node:util";import"constants";import"util";import"assert";import"http";import"https";import"url";import"crypto";import"tty";import"zlib";import"events";import"net";import"tls";import"buffer";import"dns";import"node:tls";import"string_decoder";const s=["comate-sec.baidu-int.com","comate-sec.baidu.com","comate-sec-test.baidu-int.com"];function i(e,n={}){const i=t.currentAuth,o=new URL(e);if(!s.includes(o.hostname))return Promise.reject(new Error("Unauthorized Host"));const r={"X-Comate-Authorization":i};return fetch(e,{...n,headers:{...n.headers,...r}})}const o=["10.11.135.35","comate.baidu.com","comate.baidu-int.com"];function r(e,s={}){const n=t.currentAuth,i=new URL(e);if(!o.includes(i.hostname))return Promise.reject(new Error("Unauthorized Host"));const r={"Uuap-login-name":n};return fetch(e,{...s,headers:{...s.headers,...r}})}class c extends e{async*execute(t){const e=await this.buildRequest(t),s=(n=e.headers,n?.["Content-Type"]??n?.["content-type"]??null)?.includes("application/json");var n;const i=e.timeout?AbortSignal.timeout(e.timeout):null;try{const t=await fetch(e.url,{method:e.method,headers:e.headers,body:e.body?s?JSON.stringify(e.body):e.body:null,signal:i});if(t.ok){const s=await("json"===e.responseType?t.json():t.text());yield{command:"draw",content:this.transformResponseToText(s)}}else yield{command:"fail",content:`非常抱歉,发生了未知的网络错误,状态码为${t.status}。`}}catch{i?.aborted?yield{command:"fail",content:"非常抱歉,网络请求超时。"}:yield{command:"fail",content:"非常抱歉,发生了未知的网络错误。"}}}transformResponseToText(t){return String(t)}}class h{outputType;elements=[];constructor(t={outputType:"string"}){this.outputType=t.outputType}append(t){this.elements.push(this.normalize(t))}flush(t){return t&&this.append(t),{command:"draw",content:this.elements}}async flushStreaming(t){for await(const e of t)this.flush(e)}replaceLast(t){this.elements.length?this.elements[this.elements.length-1]=this.normalize(t):this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}fail(t){return this.elements.length=0,{command:"fail",content:this.normalize(t)}}normalize(t){if("mixed"===this.outputType)return t;if("string"==typeof t)return t;switch(t.type){case"p":return t.children+"\n\n";case"code-block":return"```"+(t.language??"")+"\n"+(e=t.children,(Array.isArray(e)?e:[e]).map((t=>t.toString())).join(""))+(t.closed?"\n```":"");default:return""}var e}}class l{elements=[];append(t){Array.isArray(t)?this.elements.push(...t):this.elements.push(t)}flush(t){return t&&this.append(t),{command:"draw",content:this.elements}}replaceLast(t){this.elements.length?this.elements[this.elements.length-1]=t:this.append(t)}replaceAll(t){this.elements.length?this.elements=Array.isArray(t)?t:[t]:this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}flushReplaceAll(t){return this.replaceAll(t),this.flush()}appendLast(t){const e=this.elements.at(-1);return!!e&&(e.children?!!Array.isArray(e.children)&&(e.children.push(t),!0):(e.children=[t],!0))}flushAppendLast(t){return this.appendLast(t),this.flush()}fail(t){return this.elements.length=0,{command:"fail",content:t}}}class m{chunks=[];append(t){this.chunks.push(t)}flush(t){return t&&this.append(t),{command:"draw",content:this.chunks}}replaceLast(t){this.chunks.length?this.chunks[this.chunks.length-1]=t:this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}fail(t){return this.chunks.length=0,{command:"fail",content:t}}}class p{sections={dynamicSections:[],dynamicFooterSections:[]};content="";actionSet={actions:{},actionConfigs:{}};append(t,e,s){t?.dynamicSections?.length&&this.sections.dynamicSections.push(...t.dynamicSections),t?.dynamicFooterSections?.length&&this.sections.dynamicFooterSections.push(...t.dynamicFooterSections),e&&(this.content=e),s&&(this.actionSet=s)}flush(t,e,s){return(t||e||s)&&this.append(t,e,s),{command:"section",sections:this.sections,content:this.content,actionSet:this.actionSet}}replaceLast(t,e,s){const n=this.sections.dynamicSections.length&&t.dynamicSections?.length,i=this.sections.dynamicFooterSections.length&&t.dynamicFooterSections?.length;n||i?(t.dynamicSections?.length&&(this.sections.dynamicSections=t.dynamicSections),t.dynamicFooterSections?.length&&(this.sections.dynamicFooterSections=t.dynamicFooterSections),this.content=e??"",s&&(this.actionSet=s)):this.append(t,e,s)}flushReplaceLast(t,e,s){return this.replaceLast(t,e,s),this.flush()}}-1===Math.random()&&console.log("THIS IS COMATE");export{l as ElementChunkStream,c as PipeHttpRequestSkillProvider,p as SectionChunkStream,e as SkillProvider,m as StringChunkStream,h as TaskProgressChunkStream,r as authorizedFirstPartyFetch,i as fetch};
1
+ import{U as t,S as e}from"./user-DVjAG3wH.js";export{B as BackgroundServiceProvider,C as ConfigProvider,F as FallbackProvider,a as FunctionModel,P as PromptProvider,T as TextModel,n as getGitRepositoryUrl}from"./user-DVjAG3wH.js";import"node:path";import"node:fs/promises";import"node:fs";import"node:process";import"node:url";import"node:stream";import"os";import"path";import"node:crypto";import"node:os";import"node:buffer";import"node:child_process";import"child_process";import"fs";import"node:timers/promises";import"stream";import"node:util";import"constants";import"util";import"assert";import"http";import"https";import"url";import"crypto";import"tty";import"zlib";import"events";import"net";import"tls";import"buffer";import"dns";import"node:tls";import"string_decoder";const s=["comate-sec.baidu-int.com","comate-sec.baidu.com","comate-sec-test.baidu-int.com"];function i(e,n={}){const i=t.currentAuth,o=new URL(e);if(!s.includes(o.hostname))return Promise.reject(new Error("Unauthorized Host"));const r={"X-Comate-Authorization":i};return fetch(e,{...n,headers:{...n.headers,...r}})}const o=["10.11.135.35","comate.baidu.com","comate.baidu-int.com"];function r(e,s={}){const n=t.currentAuth,i=new URL(e);if(!o.includes(i.hostname))return Promise.reject(new Error("Unauthorized Host"));const r={"Uuap-login-name":n};return fetch(e,{...s,headers:{...s.headers,...r}})}class c extends e{async*execute(t){const e=await this.buildRequest(t),s=(n=e.headers,n?.["Content-Type"]??n?.["content-type"]??null)?.includes("application/json");var n;const i=e.timeout?AbortSignal.timeout(e.timeout):null;try{const t=await fetch(e.url,{method:e.method,headers:e.headers,body:e.body?s?JSON.stringify(e.body):e.body:null,signal:i});if(t.ok){const s=await("json"===e.responseType?t.json():t.text());yield{command:"draw",content:this.transformResponseToText(s)}}else yield{command:"fail",content:`非常抱歉,发生了未知的网络错误,状态码为${t.status}。`}}catch{i?.aborted?yield{command:"fail",content:"非常抱歉,网络请求超时。"}:yield{command:"fail",content:"非常抱歉,发生了未知的网络错误。"}}}transformResponseToText(t){return String(t)}}class h{outputType;elements=[];constructor(t={outputType:"string"}){this.outputType=t.outputType}append(t){this.elements.push(this.normalize(t))}flush(t){return t&&this.append(t),{command:"draw",content:this.elements}}async flushStreaming(t){for await(const e of t)this.flush(e)}replaceLast(t){this.elements.length?this.elements[this.elements.length-1]=this.normalize(t):this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}fail(t){return this.elements.length=0,{command:"fail",content:this.normalize(t)}}normalize(t){if("mixed"===this.outputType)return t;if("string"==typeof t)return t;switch(t.type){case"p":return t.children+"\n\n";case"code-block":return"```"+(t.language??"")+"\n"+(e=t.children,(Array.isArray(e)?e:[e]).map((t=>t.toString())).join(""))+(t.closed?"\n```":"");default:return""}var e}}class l{elements=[];append(t){Array.isArray(t)?this.elements.push(...t):this.elements.push(t)}flush(t){return t&&this.append(t),{command:"draw",content:this.elements}}replaceLast(t){this.elements.length?this.elements[this.elements.length-1]=t:this.append(t)}replaceAll(t){this.elements.length?this.elements=Array.isArray(t)?t:[t]:this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}flushReplaceAll(t){return this.replaceAll(t),this.flush()}appendLast(t){const e=this.elements.at(-1);return!!e&&(e.children?!!Array.isArray(e.children)&&(e.children.push(t),!0):(e.children=[t],!0))}flushAppendLast(t){return this.appendLast(t),this.flush()}fail(t){return this.elements.length=0,{command:"fail",content:t}}}class m{chunks=[];append(t){this.chunks.push(t)}flush(t){return t&&this.append(t),{command:"draw",content:this.chunks}}replaceLast(t){this.chunks.length?this.chunks[this.chunks.length-1]=t:this.append(t)}flushReplaceLast(t){return this.replaceLast(t),this.flush()}fail(t){return this.chunks.length=0,{command:"fail",content:t}}}class p{sections={dynamicSections:[],dynamicFooterSections:[]};content="";actionSet={actions:{},actionConfigs:{}};append(t,e,s){t?.dynamicSections?.length&&this.sections.dynamicSections.push(...t.dynamicSections),t?.dynamicFooterSections?.length&&this.sections.dynamicFooterSections.push(...t.dynamicFooterSections),e&&(this.content=e),s&&(this.actionSet=s)}flush(t,e,s){return(t||e||s)&&this.append(t,e,s),{command:"section",sections:this.sections,content:this.content,actionSet:this.actionSet}}replaceLast(t,e,s){const n=this.sections.dynamicSections.length&&t.dynamicSections?.length,i=this.sections.dynamicFooterSections.length&&t.dynamicFooterSections?.length;n||i?(t.dynamicSections?.length&&(this.sections.dynamicSections=t.dynamicSections),t.dynamicFooterSections?.length&&(this.sections.dynamicFooterSections=t.dynamicFooterSections),this.content=e??"",s&&(this.actionSet=s)):this.append(t,e,s)}flushReplaceLast(t,e,s){return this.replaceLast(t,e,s),this.flush()}}-1===Math.random()&&console.log("THIS IS COMATE");export{l as ElementChunkStream,c as PipeHttpRequestSkillProvider,p as SectionChunkStream,e as SkillProvider,m as StringChunkStream,h as TaskProgressChunkStream,r as authorizedFirstPartyFetch,i as fetch};
@@ -1,4 +1,4 @@
1
- import p from"node:path";import{g as e,P as a,S as d,F as m,B as i,C as l,T as t,L as s,a as o,I as r,i as n,b as v,U as u,c,A as h,d as w,e as f,f as g,h as y,j as N,k as b,l as _,m as S}from"./user-DAIE9qbz.js";import D from"node:fs/promises";import"node:fs";import"node:process";import"node:url";import"node:stream";import"os";import"path";import"node:crypto";import"node:os";import V from"stream";import T from"http";import C from"url";import A from"punycode";import E from"https";import k from"zlib";import"node:buffer";import"node:child_process";import"child_process";import"fs";import"node:timers/promises";import"node:util";import"constants";import"util";import"assert";import"crypto";import"tty";import"events";import"net";import"tls";import"buffer";import"dns";import"node:tls";import"string_decoder";var I="win32"===process.platform;function B(p,e){var a=p[e];return e>0&&("/"===a||I&&"\\"===a)}
1
+ import p from"node:path";import{g as e,P as a,S as d,F as m,B as i,C as l,T as t,L as s,a as o,I as r,i as n,b as v,U as u,c,A as h,d as w,e as f,f as g,h as y,j as N,k as b,l as _,m as S}from"./user-DVjAG3wH.js";import D from"node:fs/promises";import"node:fs";import"node:process";import"node:url";import"node:stream";import"os";import"path";import"node:crypto";import"node:os";import V from"stream";import T from"http";import C from"url";import A from"punycode";import E from"https";import k from"zlib";import"node:buffer";import"node:child_process";import"child_process";import"fs";import"node:timers/promises";import"node:util";import"constants";import"util";import"assert";import"crypto";import"tty";import"events";import"net";import"tls";import"buffer";import"dns";import"node:tls";import"string_decoder";var I="win32"===process.platform;function B(p,e){var a=p[e];return e>0&&("/"===a||I&&"\\"===a)}
2
2
  /*!
3
3
  * normalize-path <https://github.com/jonschlinkert/normalize-path>
4
4
  *