@bud.sh/app 0.5.1 → 0.6.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.
- package/README.md +41 -31
- package/dist/client/assets/bud/design.js +1 -1
- package/dist/client/assets/canvas-Bih9EdKJ.js +1 -0
- package/dist/client/assets/difference-worker-Bzg-rizy.js +8 -0
- package/dist/client/assets/dist-CdE5wBkg.js +5 -0
- package/dist/client/assets/files-1dLuoM2f.js +1 -0
- package/dist/client/assets/i18n-CkO6VFI0.js +1 -0
- package/dist/client/assets/index-Cn2mxroU.css +2 -0
- package/dist/client/assets/{index-Dn2pfmXf.js → index-DtISWZp9.js} +2 -2
- package/dist/client/assets/pages-BJ-tNJ4J.js +1 -0
- package/dist/client/assets/{project-branches-CMGRmrqr.js → project-branches-Ce3rXrkc.js} +1 -1
- package/dist/client/assets/project-comments-CPUONfs8.js +1 -0
- package/dist/client/assets/project-thread-links-C-TGkq59.js +1 -0
- package/dist/client/assets/{project-threads-ZbKDh78d.js → project-threads-Bv7IDBgi.js} +105 -105
- package/dist/client/assets/project-work-DAE9-olg.js +1 -0
- package/dist/client/assets/{task-design-BPpc4Gd7.js → task-design-CwySIAOl.js} +3 -3
- package/dist/client/assets/tasks-KWsCLi_h.js +3 -0
- package/dist/client/assets/wasm-inline-DSUyFn1L.js +1 -0
- package/dist/client/assets/workspace-CVdcfaaB.js +2 -0
- package/dist/client/index.html +3 -3
- package/dist/hosted/assets/{canvas-BYTOp1p7.js → canvas-AII16n9i.js} +97 -6
- package/dist/hosted/assets/{comment-data-Cn5y2VxV.js → comment-data-BXfMElfx.js} +1998 -381
- package/dist/hosted/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/hosted/assets/{files-B1P2_24q.js → files-D_1yeAVO.js} +10 -5
- package/dist/hosted/assets/{pages-B0ZlVdci.js → pages-CN_SbKWA.js} +3 -3
- package/dist/hosted/assets/{project-branches-DlCWmfRo.js → project-branches-Bxp0DCwg.js} +1 -1
- package/dist/hosted/assets/{project-thread-links-BZXQ200n.js → project-thread-links-KqQoKBLE.js} +76 -4
- package/dist/{node-host/assets/screen-DapOVrga.js → hosted/assets/screen-DpAcDUKR.js} +25 -1
- package/dist/hosted/assets/tasks-D66LlwxM.js +1423 -0
- package/dist/hosted/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/hosted/hosted.js +7885 -6219
- package/dist/node/assets/Stream-CAm1eJ2n.js +16604 -0
- package/dist/{server/assets/bridge-B_Blt55E.js → node/assets/bridge-DQSBYHmw.js} +124 -290
- package/dist/node/assets/config-9_jWwNBh.js +1067 -0
- package/dist/node/assets/load-config.server-CMVtRVmO.js +261 -0
- package/dist/node/assets/module-3GgtT4Xs.js +308 -0
- package/dist/node/assets/server-DTQFuoX2.js +846 -0
- package/dist/node/assets/src-D-kG1GxB.js +2 -0
- package/dist/node/assets/{src-CerrKjID.js → src-Dwe9APUx.js} +93 -3
- package/dist/node/assets/src-DysjfbM8.js +8592 -0
- package/dist/node/bridge.js +1 -845
- package/dist/node/cli.js +206 -0
- package/dist/node/design.js +811 -8
- package/dist/node/index.js +2 -739
- package/dist/node/plugins.js +5711 -0
- package/dist/node/server.js +1 -6746
- package/dist/node/vite.js +121 -0
- package/dist/{server/assets/canvas-CkMK4hoN.js → node-host/assets/canvas-BeDoufy1.js} +97 -7
- package/dist/node-host/assets/{comment-data-yfWEdDQL.js → comment-data-DE2T9yTj.js} +1974 -355
- package/dist/node-host/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/node-host/assets/{files-anHi-apm.js → files-Dl-PTS09.js} +11 -6
- package/dist/node-host/assets/{pages-CW4aF6dK.js → pages-DL2sk6_U.js} +3 -3
- package/dist/node-host/assets/{project-branches-D7rVCxQX.js → project-branches-DGp5ELct.js} +1 -1
- package/dist/{server/assets/project-thread-links-lLS_rq7c.js → node-host/assets/project-thread-links-CgBV3Jcm.js} +76 -5
- package/dist/{hosted/assets/screen-CfdC3NbR.js → node-host/assets/screen-B55yyVfb.js} +25 -1
- package/dist/node-host/assets/tasks-DZRNkoxe.js +1425 -0
- package/dist/node-host/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/node-host/node-host.js +6127 -4438
- package/dist/server/assets/{branch-previews-ClkoJ0lM.js → branch-previews-DedrpnVR.js} +1555 -673
- package/dist/{node-host/assets/canvas-DxmcFZCh.js → server/assets/canvas-CJWQ-jjv.js} +98 -6
- package/dist/server/assets/{comment-data-NLeHG89b.js → comment-data-Rg42ToTW.js} +1660 -26
- package/dist/server/assets/dist-BCSTeNf4.js +4785 -0
- package/dist/server/assets/{events-iHpLGr3k.js → events-BH_rAu7O.js} +155 -20
- package/dist/server/assets/{files-CRdl489E.js → files-CPJqKeMo.js} +12 -7
- package/dist/server/assets/{listener-BAYn9Q-u.js → listener-D61O6PzF.js} +708 -12
- package/dist/server/assets/{pages-DXVlJlBC.js → pages-KJY_Ba92.js} +4 -4
- package/dist/server/assets/{project-branches-CwTsf6WQ.js → project-branches-qG9ACZvo.js} +2 -2
- package/dist/{node-host/assets/project-thread-links-m-OLpsD9.js → server/assets/project-thread-links-CqK0lqCF.js} +77 -4
- package/dist/{node-host/assets/tasks-request-B0aeNocI.js → server/assets/project-work-DoIwxWMm.js} +87 -2
- package/dist/server/assets/run-BJ8r5jSh.js +572 -0
- package/dist/server/assets/{screen-B1zH_1O3.js → screen-CBrHPFug.js} +26 -2
- package/dist/server/assets/{server-DxK-UB_Z.js → server-Dkbp5stG.js} +1521 -793
- package/dist/server/assets/{services-BRrgXYlT.js → services-BTfig8A8.js} +234 -997
- package/dist/server/assets/tasks-Bgu5Lg9Y.js +1427 -0
- package/dist/server/assets/wasm-inline-Dl9tqabx.js +4 -0
- package/dist/server/capture.js +1 -2
- package/dist/server/migration.js +569 -12
- package/dist/server/runtime.js +7 -5
- package/dist/server/server.js +3 -3
- package/dist/types/assets/{config-DIC2cf_S.d.ts → config-CvcYmE2s.d.ts} +188 -50
- package/dist/types/assets/{contract-CAT-XFNq.d.ts → contract-B7yuuqSn.d.ts} +44 -2
- package/dist/types/assets/{items-CaVkByHk.d.ts → items-BQdaVksf.d.ts} +12 -1
- package/dist/types/assets/memory-state-BBW-FAVA.d.ts +236 -0
- package/dist/types/assets/picker-Be5Gx4WR.d.ts +9 -0
- package/dist/types/assets/{task-design-xJOhRNWh.d.ts → task-design-BDHKFHpp.d.ts} +3 -1
- package/dist/types/bridge.d.ts +1 -1
- package/dist/types/companion.d.ts +3 -3
- package/dist/types/design.d.ts +2 -2
- package/dist/types/hosted.d.ts +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/node-host.d.ts +2 -2
- package/dist/types/plugins.d.ts +445 -0
- package/dist/types/screen.d.ts +2 -2
- package/dist/types/server.d.ts +2 -228
- package/dist/types/vite.d.ts +16 -0
- package/package.json +19 -3
- package/dist/client/assets/canvas-8GXJIuDK.js +0 -1
- package/dist/client/assets/difference-worker-C99ychYw.js +0 -8
- package/dist/client/assets/files-DkWt1l9H.js +0 -1
- package/dist/client/assets/i18n-hH_Ba5QO.js +0 -1
- package/dist/client/assets/index-tpHYVXma.css +0 -2
- package/dist/client/assets/pages-BVd6MQmu.js +0 -1
- package/dist/client/assets/project-comments-D1IIQwsW.js +0 -1
- package/dist/client/assets/project-thread-links-DKwe_SYb.js +0 -1
- package/dist/client/assets/project-work-D4DZqBCZ.js +0 -1
- package/dist/client/assets/tasks-Cn0VOZ9Z.js +0 -1
- package/dist/client/assets/tasks-request-BLyOzokZ.js +0 -1
- package/dist/client/assets/workspace-DGErsSg6.js +0 -2
- package/dist/hosted/assets/tasks-_yKh2Z6q.js +0 -649
- package/dist/hosted/assets/tasks-request-CFPLvLc7.js +0 -113
- package/dist/node-host/assets/tasks-BBK_CybR.js +0 -651
- package/dist/server/assets/project-work-CSZlCwH-.js +0 -88
- package/dist/server/assets/tasks-CGdz-uox.js +0 -652
- package/dist/server/assets/tasks-request-D2NBjCTl.js +0 -115
- package/dist/types/assets/picker-D1Bw3ndx.d.ts +0 -14
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Bn as createMultiMatcher, Di as parseWorkItemRef, ki as parseWorkQuery, mn as t, y as routes } from "./comment-data-Cn5y2VxV.js";
|
|
2
|
-
//#region app/client/tasks-request.ts
|
|
3
|
-
var reads = createMultiMatcher();
|
|
4
|
-
var writes = createMultiMatcher();
|
|
5
|
-
for (let [name, route] of Object.entries(routes.tasksApi)) (route.method === "GET" ? reads : writes).add(route.pattern, name);
|
|
6
|
-
function validEndpoint(url, write) {
|
|
7
|
-
if (!url.startsWith("/") || url.startsWith("//") || url.length > 7e3 || /[\\#\u0000-\u0020]/.test(url)) return false;
|
|
8
|
-
try {
|
|
9
|
-
let match = (write ? writes : reads).match(url, { baseURL: "http://bud.invalid" });
|
|
10
|
-
if (!match || match.url.pathname !== url.split("?")[0]) return false;
|
|
11
|
-
for (let [key, value] of Object.entries(match.params)) if (key === "id" || key === "section") parseWorkItemRef({ id: value });
|
|
12
|
-
if (match.data !== "index" && match.data !== "workspace") return !match.url.search;
|
|
13
|
-
let query = {};
|
|
14
|
-
for (let [key, value] of match.url.searchParams) {
|
|
15
|
-
if (![
|
|
16
|
-
"search",
|
|
17
|
-
"status",
|
|
18
|
-
"limit"
|
|
19
|
-
].includes(key) || Object.hasOwn(query, key)) return false;
|
|
20
|
-
query[key] = key === "limit" ? Number(value) : value;
|
|
21
|
-
}
|
|
22
|
-
parseWorkQuery(query);
|
|
23
|
-
return true;
|
|
24
|
-
} catch {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Reads one local capability-protected endpoint without following redirects or forwarding the
|
|
30
|
-
* token.
|
|
31
|
-
* @param url - Relative app API path generated from the typed route contract.
|
|
32
|
-
* @param token - The selected companion's capability.
|
|
33
|
-
* @param signal - Request cancellation owned by the interactive workspace.
|
|
34
|
-
* @param parse - Browser DTO validator.
|
|
35
|
-
* @param fetcher - Injectable transport for browser-free failure and capability tests.
|
|
36
|
-
* @param write - Optional explicit JSON mutation; omitted for reads.
|
|
37
|
-
* @returns A validated DTO; error responses never become an empty successful view.
|
|
38
|
-
*/
|
|
39
|
-
async function requestTasks(url, token, signal, parse, fetcher = fetch, write) {
|
|
40
|
-
if (!validEndpoint(url, Boolean(write))) throw new Error(t("app.client.tasksRequest.invalidEndpoint"));
|
|
41
|
-
signal.throwIfAborted();
|
|
42
|
-
let response = await fetcher(url, {
|
|
43
|
-
method: write ? "POST" : "GET",
|
|
44
|
-
headers: {
|
|
45
|
-
"X-Bud-Token": token,
|
|
46
|
-
...write ? { "Content-Type": "application/json" } : {}
|
|
47
|
-
},
|
|
48
|
-
...write ? { body: JSON.stringify(write.body) } : {},
|
|
49
|
-
credentials: "same-origin",
|
|
50
|
-
redirect: "error",
|
|
51
|
-
cache: "no-store",
|
|
52
|
-
signal
|
|
53
|
-
});
|
|
54
|
-
let reader = response.body?.getReader();
|
|
55
|
-
if (!reader) throw new Error(t("app.client.tasksRequest.emptyResponse"));
|
|
56
|
-
let chunks = [];
|
|
57
|
-
let size = 0;
|
|
58
|
-
try {
|
|
59
|
-
while (true) {
|
|
60
|
-
signal.throwIfAborted();
|
|
61
|
-
let part = await reader.read();
|
|
62
|
-
if (part.done) break;
|
|
63
|
-
size += part.value.byteLength;
|
|
64
|
-
if (size > 4194304) throw new Error(t("app.client.tasksRequest.responseTooLarge"));
|
|
65
|
-
chunks.push(part.value);
|
|
66
|
-
}
|
|
67
|
-
} catch (cause) {
|
|
68
|
-
await reader.cancel().catch(() => {});
|
|
69
|
-
throw cause;
|
|
70
|
-
} finally {
|
|
71
|
-
reader.releaseLock();
|
|
72
|
-
}
|
|
73
|
-
let bytes = new Uint8Array(size);
|
|
74
|
-
let offset = 0;
|
|
75
|
-
for (let chunk of chunks) {
|
|
76
|
-
bytes.set(chunk, offset);
|
|
77
|
-
offset += chunk.byteLength;
|
|
78
|
-
}
|
|
79
|
-
let value;
|
|
80
|
-
try {
|
|
81
|
-
value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
82
|
-
} catch {
|
|
83
|
-
throw new Error(t("app.client.tasksRequest.invalidResponse"));
|
|
84
|
-
}
|
|
85
|
-
if (!response.ok) {
|
|
86
|
-
let error = value && typeof value === "object" && "error" in value && typeof value.error === "string" ? value.error.slice(0, 1e3) : t("app.client.tasksRequest.loadFailed");
|
|
87
|
-
let code = value && typeof value === "object" && "code" in value && typeof value.code === "string" && /^[a-z][a-z-]{0,63}$/.test(value.code) ? value.code : "request";
|
|
88
|
-
let currentRevision;
|
|
89
|
-
if (value && typeof value === "object" && "currentRevision" in value) {
|
|
90
|
-
let revision = value.currentRevision;
|
|
91
|
-
if (revision !== null && (typeof revision !== "string" || !revision.trim() || revision.length > 256 || revision.includes("\0"))) throw new Error(t("app.client.tasksRequest.invalidConflictResponse"));
|
|
92
|
-
currentRevision = revision;
|
|
93
|
-
}
|
|
94
|
-
throw new TaskRequestError(error, code, currentRevision);
|
|
95
|
-
}
|
|
96
|
-
return parse(value);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* The task service answered with an error: its message, its code and, after a conflict, the
|
|
100
|
-
* item's current revision.
|
|
101
|
-
*/
|
|
102
|
-
var TaskRequestError = class extends Error {
|
|
103
|
-
code;
|
|
104
|
-
currentRevision;
|
|
105
|
-
constructor(message, code, currentRevision) {
|
|
106
|
-
super(message);
|
|
107
|
-
this.name = "TaskRequestError";
|
|
108
|
-
this.code = code;
|
|
109
|
-
this.currentRevision = currentRevision;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
//#endregion
|
|
113
|
-
export { requestTasks as n, TaskRequestError as t };
|