@comate/zulu 0.4.0 → 0.5.0

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 (77) hide show
  1. package/README.md +4 -0
  2. package/comate-engine/fallbackServer.js +1 -1
  3. package/comate-engine/node_modules/@comate/plugin-engine/dist/index.js +8 -8
  4. package/comate-engine/node_modules/@comate/plugin-host/dist/index.js +1 -1
  5. package/comate-engine/node_modules/@comate/plugin-host/dist/main.js +3 -3
  6. package/comate-engine/node_modules/@comate/plugin-host/dist/user-CcQDM3F-.js +44 -0
  7. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +197 -16
  8. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.js +8 -8
  9. package/comate-engine/node_modules/@comate/preview-proxy/bin/preview.js +1 -0
  10. package/comate-engine/node_modules/@comate/preview-proxy/dist/index.js +53 -53
  11. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.css +1 -1
  12. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.js +1 -1
  13. package/comate-engine/node_modules/better-sqlite3/deps/download.sh +1 -1
  14. package/comate-engine/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +122 -81
  15. package/comate-engine/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +45 -45
  16. package/comate-engine/node_modules/better-sqlite3/lib/database.js +1 -1
  17. package/comate-engine/node_modules/better-sqlite3/node_modules/.bin/prebuild-install +2 -2
  18. package/comate-engine/node_modules/better-sqlite3/package.json +4 -7
  19. package/comate-engine/node_modules/better-sqlite3/src/addon.cpp +47 -0
  20. package/comate-engine/node_modules/better-sqlite3/src/better_sqlite3.cpp +44 -2164
  21. package/comate-engine/node_modules/better-sqlite3/src/objects/backup.cpp +120 -0
  22. package/comate-engine/node_modules/better-sqlite3/src/objects/backup.hpp +36 -0
  23. package/comate-engine/node_modules/better-sqlite3/src/objects/database.cpp +417 -0
  24. package/comate-engine/node_modules/better-sqlite3/src/objects/database.hpp +103 -0
  25. package/comate-engine/node_modules/better-sqlite3/src/objects/statement-iterator.cpp +113 -0
  26. package/comate-engine/node_modules/better-sqlite3/src/objects/statement-iterator.hpp +50 -0
  27. package/comate-engine/node_modules/better-sqlite3/src/objects/statement.cpp +383 -0
  28. package/comate-engine/node_modules/better-sqlite3/src/objects/statement.hpp +58 -0
  29. package/comate-engine/node_modules/better-sqlite3/src/util/bind-map.cpp +73 -0
  30. package/comate-engine/node_modules/better-sqlite3/src/util/binder.cpp +193 -0
  31. package/comate-engine/node_modules/better-sqlite3/src/util/constants.cpp +172 -0
  32. package/comate-engine/node_modules/better-sqlite3/src/util/custom-aggregate.cpp +121 -0
  33. package/comate-engine/node_modules/better-sqlite3/src/util/custom-function.cpp +59 -0
  34. package/comate-engine/node_modules/better-sqlite3/src/util/custom-table.cpp +409 -0
  35. package/comate-engine/node_modules/better-sqlite3/src/util/data-converter.cpp +17 -0
  36. package/comate-engine/node_modules/better-sqlite3/src/util/data.cpp +194 -0
  37. package/comate-engine/node_modules/better-sqlite3/src/util/helpers.cpp +109 -0
  38. package/comate-engine/node_modules/better-sqlite3/src/util/macros.cpp +63 -0
  39. package/comate-engine/node_modules/better-sqlite3/src/util/query-macros.cpp +71 -0
  40. package/comate-engine/node_modules/better-sqlite3/src/util/row-builder.cpp +49 -0
  41. package/comate-engine/package.json +8 -5
  42. package/comate-engine/plugins/demo-feature/dist/index.js +128 -61
  43. package/comate-engine/plugins/demo-feature/dist/providers/renderJsx.js +10 -1
  44. package/comate-engine/plugins/demo-timer/assets/icon.svg +2 -0
  45. package/comate-engine/plugins/demo-timer/dist/index.js +463 -0
  46. package/comate-engine/plugins/demo-timer/package.json +73 -0
  47. package/comate-engine/server.js +136 -53
  48. package/dist/bundle/index.js +8 -8
  49. package/package.json +1 -1
  50. package/comate-engine/node_modules/@comate/plugin-host/dist/user-DQgjkMe9.js +0 -44
  51. package/comate-engine/node_modules/better-sqlite3/src/better_sqlite3.hpp +0 -1036
  52. package/comate-engine/node_modules/sql.js/.devcontainer/Dockerfile +0 -76
  53. package/comate-engine/node_modules/sql.js/.devcontainer/devcontainer.json +0 -20
  54. package/comate-engine/node_modules/sql.js/.eslintrc.js +0 -68
  55. package/comate-engine/node_modules/sql.js/.jsdoc.config.json +0 -38
  56. package/comate-engine/node_modules/sql.js/.nojekyll +0 -0
  57. package/comate-engine/node_modules/sql.js/AUTHORS +0 -8
  58. package/comate-engine/node_modules/sql.js/CONTRIBUTING.md +0 -66
  59. package/comate-engine/node_modules/sql.js/LICENSE +0 -44
  60. package/comate-engine/node_modules/sql.js/README.md +0 -357
  61. package/comate-engine/node_modules/sql.js/dist/sql-asm-debug.js +0 -140661
  62. package/comate-engine/node_modules/sql.js/dist/sql-asm-memory-growth.js +0 -209
  63. package/comate-engine/node_modules/sql.js/dist/sql-asm.js +0 -209
  64. package/comate-engine/node_modules/sql.js/dist/sql-wasm-debug.js +0 -6989
  65. package/comate-engine/node_modules/sql.js/dist/sql-wasm-debug.wasm +0 -0
  66. package/comate-engine/node_modules/sql.js/dist/sql-wasm.js +0 -188
  67. package/comate-engine/node_modules/sql.js/dist/sql-wasm.wasm +0 -0
  68. package/comate-engine/node_modules/sql.js/dist/sqljs-all.zip +0 -0
  69. package/comate-engine/node_modules/sql.js/dist/sqljs-wasm.zip +0 -0
  70. package/comate-engine/node_modules/sql.js/dist/sqljs-worker-wasm.zip +0 -0
  71. package/comate-engine/node_modules/sql.js/dist/worker.sql-asm-debug.js +0 -140784
  72. package/comate-engine/node_modules/sql.js/dist/worker.sql-asm.js +0 -332
  73. package/comate-engine/node_modules/sql.js/dist/worker.sql-wasm-debug.js +0 -7112
  74. package/comate-engine/node_modules/sql.js/dist/worker.sql-wasm.js +0 -311
  75. package/comate-engine/node_modules/sql.js/documentation_index.md +0 -26
  76. package/comate-engine/node_modules/sql.js/logo.svg +0 -13
  77. package/comate-engine/node_modules/sql.js/package.json +0 -51
@@ -1 +1 @@
1
- import{U as t,S as e}from"./user-DQgjkMe9.js";export{B as BackgroundServiceProvider,C as ConfigProvider,F as FallbackProvider,a as FunctionModel,P as PromptProvider,T as TextModel,l as getGitRepositoryUrl}from"./user-DQgjkMe9.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";const s=["comate-sec.baidu-int.com","comate-sec.baidu.com","comate-sec-test.baidu-int.com"];function n(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 i=["10.11.135.35","comate.baidu.com","comate.baidu-int.com"];function o(e,s={}){const n=t.currentAuth,o=new URL(e);if(!i.includes(o.hostname))return Promise.reject(new Error("Unauthorized Host"));const r={"Uuap-login-name":n};return fetch(e,{...s,headers:{...s.headers,...r}})}class r 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 c{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 h{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{h as ElementChunkStream,r as PipeHttpRequestSkillProvider,p as SectionChunkStream,e as SkillProvider,m as StringChunkStream,c as TaskProgressChunkStream,o as authorizedFirstPartyFetch,n as fetch};
1
+ import{U as t,S as e}from"./user-CcQDM3F-.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-CcQDM3F-.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";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};