gemi 0.84.0 → 0.84.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/dist/ai/AgentController.d.ts.map +1 -1
- package/dist/ai/AgentProvider.d.ts +2 -0
- package/dist/ai/AgentProvider.d.ts.map +1 -1
- package/dist/ai/index.js +10 -10
- package/dist/ai/index.js.map +6 -6
- package/dist/ai/providers/call.d.ts +22 -4
- package/dist/ai/providers/call.d.ts.map +1 -1
- package/dist/{chunk-b9dejyaq.js → chunk-0agfx93f.js} +2 -2
- package/dist/{chunk-b9dejyaq.js.map → chunk-0agfx93f.js.map} +1 -1
- package/dist/{chunk-pa0ya991.js → chunk-j5xcfeqx.js} +1 -1
- package/dist/{chunk-ekppwzyg.js → chunk-rp5j1mgk.js} +1 -1
- package/dist/client/index.js +36 -24
- package/dist/client/index.js.map +1 -1
- package/dist/client/useMutation.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-pa0ya991.js.map → chunk-j5xcfeqx.js.map} +0 -0
- /package/dist/{chunk-ekppwzyg.js.map → chunk-rp5j1mgk.js.map} +0 -0
|
@@ -43,12 +43,30 @@ export declare function streamResponses(endpoint: ResponsesEndpoint, body: Respo
|
|
|
43
43
|
signal?: AbortSignal;
|
|
44
44
|
structuredOutput: boolean;
|
|
45
45
|
}): AsyncGenerator<ProviderEvent>;
|
|
46
|
+
/**
|
|
47
|
+
* What a file is uploaded *for*, which decides where its id is accepted.
|
|
48
|
+
*
|
|
49
|
+
* The two providers disagree, and each refuses the other's answer.
|
|
50
|
+
*
|
|
51
|
+
* OpenAI: `user_data`. This is a file a person attached to a message, not a
|
|
52
|
+
* corpus for a retrieval store, and the purpose is what decides which of the
|
|
53
|
+
* two the file can be used for.
|
|
54
|
+
*
|
|
55
|
+
* Azure: `assistants`. MEASURED (gpt-6-sol deployment, `/openai/v1`,
|
|
56
|
+
* `api-version=preview`, 2026-10-01, #682): Azure accepts a `user_data` upload
|
|
57
|
+
* and answers a `file-…` id, and then its Responses API refuses that id in both
|
|
58
|
+
* `input_file` and `input_image` with `400 Invalid
|
|
59
|
+
* 'input[0].content[0].file_id': 'file-…'. Expected an ID that begins with
|
|
60
|
+
* 'assistant'.` The same files uploaded as `assistants` come back as
|
|
61
|
+
* `assistant-…` ids (`expires_at: null`) and work: pdf, txt, md and csv as
|
|
62
|
+
* `input_file`, png as `input_image` with real vision.
|
|
63
|
+
*/
|
|
64
|
+
export type UploadPurpose = "user_data" | "assistants";
|
|
46
65
|
/**
|
|
47
66
|
* Uploads an attachment and returns the id a `FilePart` carries.
|
|
48
67
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* which of the two the file can be used for.
|
|
68
|
+
* The purpose is the caller's because it is a property of the provider, not of
|
|
69
|
+
* the file — see `UploadPurpose`.
|
|
52
70
|
*/
|
|
53
|
-
export declare function uploadFile(endpoint: ResponsesEndpoint, file: File): Promise<string>;
|
|
71
|
+
export declare function uploadFile(endpoint: ResponsesEndpoint, file: File, purpose?: UploadPurpose): Promise<string>;
|
|
54
72
|
//# sourceMappingURL=call.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../ai/providers/call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB;2DACuD;IACvD,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE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EAC3B,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,GAC1D,cAAc,CAAC,aAAa,CAAC,CA8C/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAEvD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,aAA2B,GACnC,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.84.
|
|
2
|
+
import{va as j}from"./chunk-8z37k28d.js";import{createElement as x}from"react";function h(i,n){let s=Object.keys(n).sort((u,r)=>r.length-u.length).map((u)=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),b=new RegExp(s.join("|"),"g");return i.replace(b,(u)=>n[u])}async function J(i,n,s=[]){let b=[...s.map((t)=>`${i}/views/${t}.tsx`),`${i}/views/RootLayout.tsx`],u=new Set;for(let t of b){let e=n.moduleGraph.getModulesByFile(t);if(e)for(let g of e)u.add(g)}let r=[],p=[],l={};for(let t of u)if(t)for(let e of t.importedModules){if(e.file.includes("module.css"))l[e.file]=e.ssrTransformResult.map.sourcesContent.join("");if(e.file.includes(".css"))p.push(e.file)}for(let t of p){let e=await n.transformRequest(t+"?direct"),g=t.includes("module.css"),a="";if(g)a=h(l[t],e.default);r.push({isDev:!0,id:t,content:g?a:e.code})}return r.map((t,e)=>{return x("style",{key:e,type:"text/css","data-vite-dev-id":t.id,dangerouslySetInnerHTML:{__html:t.content}})})}async function L(i=[]){return i.map((n,s)=>{return x("style",{key:s,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as v}from"fs";import{basename as f}from"path";import{networkInterfaces as k}from"os";var y={name:"gemi",version:"0.84.1",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js","gemi-orm-generator":"./dist/bin/orm-generator.js"},files:["dist/**/*","ide/typescript-plugin/package.json","skills/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./ai":"./ai/index.ts","./ai/client":"./ai/client/index.ts","./testing":"./testing/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./i18n":"./i18n/index.ts","./dictionary":"./i18n/dictionaryRuntime.ts","./server":"./server/index.ts","./config":"./config/index.ts","./container":"./container/index.ts","./foundation":"./foundation/index.ts","./database":"./database/index.ts","./orm":"./orm/index.ts","./support":"./support/index.ts","./console/run":"./console/run.ts","./queue/work":"./services/queue/work.ts","./ide/typescript-plugin":"./ide/typescript-plugin/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts"},scripts:{lint:"oxlint",typecheck:"tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json && tsc --noEmit -p ide/typescript-plugin/tsconfig.json",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:ts-plugin && bun run build:client-types && bun run build:augmentation","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --external=typescript --sourcemap ./bin/gemi.ts ./bin/orm-generator.ts && bun ./scripts/prepare-bin.ts","build:client":"rm -rf dist/client dist/testing dist/ai/client dist/chunks && vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:ts-plugin":"bun ./scripts/build-ts-plugin.ts","build:types":"tsc -p tsconfig.build.json","build:client-types":"tsc -p tsconfig.browser.json",test:"bun --bun vitest","test:types":"vitest run --typecheck.only","test:live":"bun --bun vitest run ai/live","test:packaging":"bun --bun vitest run --config vitest.packaging.config.ts","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1","build:augmentation":"bun ./scripts/wire-augmentation.ts"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1","magic-string":"^0.30.17",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@prisma/generator-helper":"^6.5.0","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",typescript:">=5",vite:"^8.0.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0},typescript:{optional:!0}}};var q=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],z=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,c=(i,n)=>z?`\x1B[${i}m${n}\x1B[0m`:n,E=(i)=>c("1",i),d=(i)=>c("2",i),o=(i)=>c("36",i),O=(i)=>c("32",i),T=(i)=>c("35",i);function R(){return y.version??"?"}function _(i){for(let n of Object.values(k()))for(let s of n??[])if((s.family==="IPv4"||s.family===4)&&!s.internal)return`http://${s.address}:${i}`;return null}function G(i){return j(i).filter((n)=>v(n)).map((n)=>f(n))}function A(i){let{port:n,rootDir:s}=i,b=`http://localhost:${n}`,u=_(n),r=G(s),p=(t,e)=>` ${O("\u279C")} ${E(t.padEnd(9))}${e}`,l=["",...q.map((t)=>T(t)),"",` ${d("gemi")} ${o(`v${R()}`)}`,"",p("Local:",o(b)),p("Network:",u?o(u):d("unavailable")),p("Env:",r.length?r.join(", "):d("none")),""];console.log(l.join(`
|
|
3
3
|
`))}
|
|
4
4
|
export{J as h,L as i,A as j};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=954DF78B518F4FFA64756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
"import { existsSync } from \"node:fs\";\nimport { basename } from \"node:path\";\nimport { networkInterfaces } from \"node:os\";\nimport { envFiles } from \"./watchEnv\";\nimport pkg from \"../package.json\";\n\n// \"GEMI\" — ANSI Shadow figlet font.\nconst ART = [\n \" ██████╗ ███████╗███╗ ███╗██╗\",\n \"██╔════╝ ██╔════╝████╗ ████║██║\",\n \"██║ ███╗█████╗ ██╔████╔██║██║\",\n \"██║ ██║██╔══╝ ██║╚██╔╝██║██║\",\n \"╚██████╔╝███████╗██║ ╚═╝ ██║██║\",\n \" ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝\",\n];\n\nconst useColor = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;\nconst paint = (code: string, text: string) =>\n useColor ? `\\x1b[${code}m${text}\\x1b[0m` : text;\nconst bold = (t: string) => paint(\"1\", t);\nconst dim = (t: string) => paint(\"2\", t);\nconst cyan = (t: string) => paint(\"36\", t);\nconst green = (t: string) => paint(\"32\", t);\nconst magenta = (t: string) => paint(\"35\", t);\n\nfunction gemiVersion(): string {\n return (pkg as { version?: string }).version ?? \"?\";\n}\n\nfunction networkUrl(port: number | string): string | null {\n for (const ifaces of Object.values(networkInterfaces())) {\n for (const iface of ifaces ?? []) {\n // Node <18 reported `family` as the number 4; newer Bun/Node use \"IPv4\".\n const isV4 = iface.family === \"IPv4\" || (iface.family as unknown) === 4;\n if (isV4 && !iface.internal) return `http://${iface.address}:${port}`;\n }\n }\n return null;\n}\n\nfunction loadedEnvFiles(rootDir: string): string[] {\n return envFiles(rootDir)\n .filter((file) => existsSync(file))\n .map((file) => basename(file));\n}\n\nexport function printStartupBanner(params: {\n port: number | string;\n rootDir: string;\n}) {\n const { port, rootDir } = params;\n const local = `http://localhost:${port}`;\n const network = networkUrl(port);\n const env = loadedEnvFiles(rootDir);\n\n const row = (label: string, value: string) =>\n ` ${green(\"➜\")} ${bold(label.padEnd(9))}${value}`;\n\n const out = [\n \"\",\n ...ART.map((line) => magenta(line)),\n \"\",\n ` ${dim(\"gemi\")} ${cyan(`v${gemiVersion()}`)}`,\n \"\",\n row(\"Local:\", cyan(local)),\n row(\"Network:\", network ? cyan(network) : dim(\"unavailable\")),\n row(\"Env:\", env.length ? env.join(\", \") : dim(\"none\")),\n \"\",\n ];\n\n console.log(out.join(\"\\n\"));\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";yCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAE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AY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "954DF78B518F4FFA64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{i as k,j as l}from"./chunk-
|
|
2
|
+
import{i as k,j as l}from"./chunk-0agfx93f.js";import{ka as F,oa as L,pa as c}from"./chunk-zq5m4scz.js";import"./chunk-8z37k28d.js";import{gd as I,kd as E,ld as T}from"./chunk-49akdtfe.js";import"./chunk-tdnfhe7x.js";import"./chunk-d0qwdeza.js";import"./chunk-302mkqeq.js";import"./chunk-rmv1jp9p.js";import"./chunk-wkdzz0rx.js";import"./chunk-g6qe6wyb.js";import"./chunk-3z6wkvwj.js";import"./chunk-m4xw99vm.js";import"./chunk-en3mtnsg.js";import"./chunk-v27a4se1.js";import"./chunk-wh728wd6.js";import"./chunk-r8nhndzb.js";import{yg as h}from"./chunk-r5e4vpa1.js";import{zg as P}from"./chunk-kb3xk9r8.js";import"./chunk-zfch4da5.js";import{join as A,resolve as CJ,sep as IJ}from"path";import{Duplex as JJ}from"stream";import{constants as C,createBrotliCompress as $J,createGzip as XJ}from"zlib";var ZJ=["br","gzip"],zJ=1024,GJ=5,jJ=19,xJ=6;function HJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function QJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let X of J.split(",")){let[z,...x]=X.split(";"),W=z.trim().toLowerCase();if(W==="")continue;let Q=1;for(let H of x){let Y=H.indexOf("=");if(Y===-1)continue;if(H.slice(0,Y).trim().toLowerCase()==="q"){Q=HJ(H.slice(Y+1));break}}$.set(W,Q)}return $}function WJ(J,$=ZJ){let X=QJ(J);if(!X)return null;let z=X.get("*"),x=null,W=0;for(let Q of $){let H=X.get(Q)??z??0;if(H>W)x=Q,W=H}return x}function OJ(J,$){if(!J)return!1;return J.split(",").some((X)=>X.trim().toLowerCase().split("=")[0].trim()===$)}function KJ(J,$){if(J==="HEAD")return!1;if(!$.body)return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let X=$.headers.get("Content-Type");if(!X||!/^\s*text\/html\s*(;|$)/i.test(X))return!1;let z=$.headers.get("Content-Encoding");if(z&&z.trim().toLowerCase()!=="identity")return!1;if(OJ($.headers.get("Cache-Control"),"no-transform"))return!1;let x=$.headers.get("Content-Length");if(x!==null&&Number(x)<zJ)return!1;return!0}function UJ(J){let $=J==="br"?$J({params:{[C.BROTLI_PARAM_QUALITY]:GJ,[C.BROTLI_PARAM_LGWIN]:jJ},flush:C.BROTLI_OPERATION_FLUSH}):XJ({level:xJ,flush:C.Z_SYNC_FLUSH});return JJ.toWeb($)}function YJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let X=$.split(",").map((z)=>z.trim().toLowerCase());if(X.includes("*")||X.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function q(J,$){if(!KJ(J.method,$))return $;let X=new Headers($.headers);YJ(X);let z=WJ(J.headers.get("Accept-Encoding"));if(!z)return new Response($.body,{status:$.status,statusText:$.statusText,headers:X});let x;try{x=UJ(z)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:X})}return X.set("Content-Encoding",z),X.delete("Content-Length"),new Response($.body.pipeThrough(x),{status:$.status,statusText:$.statusText,headers:X})}function v(J){let $=J.toString(),X=new Bun.CryptoHasher("sha1");return X.update($),X.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=I;import{stat as SJ}from"fs/promises";var S="app/client.tsx";function f(J,$=F){let X=J[S]?.file;if(!X)return;return{module:L(X,$),preload:R(J,S,$)}}function R(J,$,X=F){let z=[],x=new Set,W=(Q)=>{if(x.has(Q))return;x.add(Q);let H=J[Q];if(!H?.file)return;z.push(L(H.file,X));for(let Y of H.imports??[])W(Y)};return W($),z}var bJ=new RegExp(`^${E}/.+\\.m?js$`);function LJ(J){return bJ.test(J)}function u(J){if(LJ(J))return new Response("window.location.reload();export {}",{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(T(J))return new Response("Not found",{status:404});return}var VJ=`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as b,j as T}from"./chunk-
|
|
2
|
+
import{h as b,j as T}from"./chunk-0agfx93f.js";import{ia as M,ja as N}from"./chunk-53we503k.js";import"./chunk-zq5m4scz.js";import"./chunk-9a8qz3s7.js";import"./chunk-gvkydx8r.js";import"./chunk-8z37k28d.js";import"./chunk-vfrrzr10.js";import{zg as S}from"./chunk-kb3xk9r8.js";import"./chunk-zfch4da5.js";import{join as u}from"path";import{createServer as v}from"vite";import{join as E}from"path";import{IncomingMessage as P,ServerResponse as k}from"http";import{Socket as q}from"net";function w(J){return J.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map((K)=>K.trim()).filter((K)=>K.length>0).join(`
|
|
5
5
|
`).trim()}function D(J){return`
|
package/dist/client/index.js
CHANGED
|
@@ -711,12 +711,13 @@ function useUpload(url, ...args) {
|
|
|
711
711
|
const abortRef = useRef(null);
|
|
712
712
|
const [inputs = {}, options = defaultOptions] = args ?? [];
|
|
713
713
|
const cancel = () => {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
714
|
+
const abort = abortRef.current;
|
|
715
|
+
if (!abort) return;
|
|
716
|
+
abortRef.current = null;
|
|
717
|
+
abort();
|
|
718
|
+
options.onCanceled?.();
|
|
719
|
+
setState("idle");
|
|
720
|
+
setProgress(0);
|
|
720
721
|
};
|
|
721
722
|
const trigger = async (fileList) => {
|
|
722
723
|
if (!fileList) return;
|
|
@@ -731,52 +732,63 @@ function useUpload(url, ...args) {
|
|
|
731
732
|
if (fileList instanceof FileList) for (const file of Array.from(fileList)) data.append("file", file);
|
|
732
733
|
else data.append("file", fileList);
|
|
733
734
|
const xhr = new XMLHttpRequest();
|
|
734
|
-
|
|
735
|
-
|
|
735
|
+
const abort = () => xhr.abort();
|
|
736
|
+
abortRef.current = abort;
|
|
737
|
+
const release = () => {
|
|
738
|
+
if (abortRef.current === abort) abortRef.current = null;
|
|
736
739
|
};
|
|
740
|
+
setState("uploading");
|
|
741
|
+
setProgress(0);
|
|
737
742
|
try {
|
|
738
|
-
const
|
|
739
|
-
xhr.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
resolve(new Response(xhr.response, {
|
|
743
|
+
const outcome = await new Promise((resolve, reject) => {
|
|
744
|
+
xhr.addEventListener("load", () => {
|
|
745
|
+
resolve({
|
|
746
|
+
type: "load",
|
|
743
747
|
status: xhr.status,
|
|
744
|
-
statusText: xhr.statusText
|
|
745
|
-
|
|
746
|
-
|
|
748
|
+
statusText: xhr.statusText,
|
|
749
|
+
body: xhr.responseText
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
xhr.addEventListener("abort", () => resolve({ type: "abort" }));
|
|
747
753
|
xhr.addEventListener("error", () => {
|
|
748
754
|
reject(/* @__PURE__ */ new TypeError("Failed to fetch"));
|
|
749
755
|
});
|
|
756
|
+
xhr.addEventListener("timeout", () => {
|
|
757
|
+
reject(/* @__PURE__ */ new TypeError("Failed to fetch"));
|
|
758
|
+
});
|
|
750
759
|
xhr.upload.addEventListener("loadstart", () => {
|
|
751
760
|
setProgress(0);
|
|
752
761
|
});
|
|
753
|
-
xhr.upload.addEventListener("
|
|
762
|
+
xhr.upload.addEventListener("load", () => {
|
|
754
763
|
setProgress(1);
|
|
755
764
|
});
|
|
756
765
|
xhr.upload.addEventListener("progress", (event) => {
|
|
757
|
-
setProgress(event.loaded / event.total);
|
|
766
|
+
if (event.lengthComputable && event.total > 0) setProgress(event.loaded / event.total);
|
|
758
767
|
});
|
|
759
768
|
xhr.open(method, action, true);
|
|
760
769
|
xhr.send(data);
|
|
761
770
|
});
|
|
762
|
-
|
|
763
|
-
if (
|
|
771
|
+
release();
|
|
772
|
+
if (outcome.type === "abort") return;
|
|
773
|
+
if (outcome.status < 200 || outcome.status > 299) {
|
|
764
774
|
let error = {
|
|
765
775
|
kind: "server_error",
|
|
766
|
-
message:
|
|
776
|
+
message: outcome.statusText
|
|
767
777
|
};
|
|
768
778
|
try {
|
|
769
|
-
error = mutationErrorFromBody(
|
|
770
|
-
} catch
|
|
779
|
+
error = mutationErrorFromBody(JSON.parse(outcome.body), outcome.status);
|
|
780
|
+
} catch {}
|
|
771
781
|
setState("error");
|
|
772
782
|
options?.onError?.(error);
|
|
773
783
|
return;
|
|
774
784
|
}
|
|
775
|
-
const json =
|
|
785
|
+
const json = JSON.parse(outcome.body);
|
|
776
786
|
clearPrefetchCache?.();
|
|
777
787
|
options?.onSuccess?.(json);
|
|
788
|
+
setState("done");
|
|
778
789
|
return json;
|
|
779
790
|
} catch (error) {
|
|
791
|
+
release();
|
|
780
792
|
setState("error");
|
|
781
793
|
options?.onError?.(error);
|
|
782
794
|
return;
|