vibes-diy 14.3.354 → 14.3.355
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/cli/cmd-evento.d.ts +15 -15
- package/cli/cmds/push-from-dir.d.ts +1 -0
- package/cli/cmds/push-from-dir.js +23 -3
- package/cli/cmds/run/backend-worker/run-backend-entry.js +59 -47
- package/cli/cmds/run/bundle-inputs.json +2 -0
- package/cli/cmds/run/run-bundle.js +156 -110
- package/package.json +8 -8
package/cli/cmd-evento.d.ts
CHANGED
|
@@ -124,31 +124,31 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
|
|
|
124
124
|
type: "vibes.diy.res-error";
|
|
125
125
|
error: {
|
|
126
126
|
message: string;
|
|
127
|
-
code: "
|
|
127
|
+
code: "max-app-slugs-reached";
|
|
128
128
|
};
|
|
129
129
|
} | {
|
|
130
130
|
type: "vibes.diy.res-error";
|
|
131
131
|
error: {
|
|
132
132
|
message: string;
|
|
133
|
-
code: "
|
|
133
|
+
code: "handle-required";
|
|
134
134
|
};
|
|
135
135
|
} | {
|
|
136
136
|
type: "vibes.diy.res-error";
|
|
137
137
|
error: {
|
|
138
138
|
message: string;
|
|
139
|
-
code: "
|
|
139
|
+
code: "from-not-owned";
|
|
140
140
|
};
|
|
141
141
|
} | {
|
|
142
142
|
type: "vibes.diy.res-error";
|
|
143
143
|
error: {
|
|
144
144
|
message: string;
|
|
145
|
-
code: "
|
|
145
|
+
code: "from-carry-failed";
|
|
146
146
|
};
|
|
147
147
|
} | {
|
|
148
148
|
type: "vibes.diy.res-error";
|
|
149
149
|
error: {
|
|
150
150
|
message: string;
|
|
151
|
-
code: "
|
|
151
|
+
code: "auto-enhance-off";
|
|
152
152
|
};
|
|
153
153
|
} | {
|
|
154
154
|
type: "vibes-diy.cli.res-generate";
|
|
@@ -727,31 +727,31 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
|
|
|
727
727
|
type: "vibes.diy.res-error";
|
|
728
728
|
error: {
|
|
729
729
|
message: string;
|
|
730
|
-
code: "
|
|
730
|
+
code: "max-app-slugs-reached";
|
|
731
731
|
};
|
|
732
732
|
} | {
|
|
733
733
|
type: "vibes.diy.res-error";
|
|
734
734
|
error: {
|
|
735
735
|
message: string;
|
|
736
|
-
code: "
|
|
736
|
+
code: "handle-required";
|
|
737
737
|
};
|
|
738
738
|
} | {
|
|
739
739
|
type: "vibes.diy.res-error";
|
|
740
740
|
error: {
|
|
741
741
|
message: string;
|
|
742
|
-
code: "
|
|
742
|
+
code: "from-not-owned";
|
|
743
743
|
};
|
|
744
744
|
} | {
|
|
745
745
|
type: "vibes.diy.res-error";
|
|
746
746
|
error: {
|
|
747
747
|
message: string;
|
|
748
|
-
code: "
|
|
748
|
+
code: "from-carry-failed";
|
|
749
749
|
};
|
|
750
750
|
} | {
|
|
751
751
|
type: "vibes.diy.res-error";
|
|
752
752
|
error: {
|
|
753
753
|
message: string;
|
|
754
|
-
code: "
|
|
754
|
+
code: "auto-enhance-off";
|
|
755
755
|
};
|
|
756
756
|
}> | import("@adviser/cement").EventoHandler<WrapCmdTSMsg<unknown>, {
|
|
757
757
|
type: "vibes-diy.cli.remix";
|
|
@@ -962,31 +962,31 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
|
|
|
962
962
|
type: "vibes.diy.res-error";
|
|
963
963
|
error: {
|
|
964
964
|
message: string;
|
|
965
|
-
code: "
|
|
965
|
+
code: "max-app-slugs-reached";
|
|
966
966
|
};
|
|
967
967
|
} | {
|
|
968
968
|
type: "vibes.diy.res-error";
|
|
969
969
|
error: {
|
|
970
970
|
message: string;
|
|
971
|
-
code: "
|
|
971
|
+
code: "handle-required";
|
|
972
972
|
};
|
|
973
973
|
} | {
|
|
974
974
|
type: "vibes.diy.res-error";
|
|
975
975
|
error: {
|
|
976
976
|
message: string;
|
|
977
|
-
code: "
|
|
977
|
+
code: "from-not-owned";
|
|
978
978
|
};
|
|
979
979
|
} | {
|
|
980
980
|
type: "vibes.diy.res-error";
|
|
981
981
|
error: {
|
|
982
982
|
message: string;
|
|
983
|
-
code: "
|
|
983
|
+
code: "from-carry-failed";
|
|
984
984
|
};
|
|
985
985
|
} | {
|
|
986
986
|
type: "vibes.diy.res-error";
|
|
987
987
|
error: {
|
|
988
988
|
message: string;
|
|
989
|
-
code: "
|
|
989
|
+
code: "auto-enhance-off";
|
|
990
990
|
};
|
|
991
991
|
} | {
|
|
992
992
|
type: "vibes-diy.cli.res-edit";
|
|
@@ -19,6 +19,7 @@ export interface ProjectFiles {
|
|
|
19
19
|
export declare function readProjectFiles(dir: string, opts?: {
|
|
20
20
|
readonly excludeDirs?: readonly string[];
|
|
21
21
|
}): Promise<Result<ProjectFiles>>;
|
|
22
|
+
export declare function assetMimeForUpload(extensionMime: string, head: Uint8Array): string;
|
|
22
23
|
export type PushProgress = (level: "info" | "warn", message: string) => void | Promise<void>;
|
|
23
24
|
export interface PushFromDirOptions {
|
|
24
25
|
posture?: PostureIntent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { readdir, readFile } from "fs/promises";
|
|
1
|
+
import { open, readdir, readFile } from "fs/promises";
|
|
2
2
|
import { extname, join, resolve } from "path";
|
|
3
3
|
import { Result, exception2Result, BuildURI } from "@adviser/cement";
|
|
4
4
|
import { type } from "arktype";
|
|
5
|
-
import { resEnsureAppSlug, isResEnsureAppSlugOk, isResError, PUSH_FROM_NOT_OWNED_CODE, PUSH_FROM_CARRY_FAILED_CODE, ASSET_EXTENSION_MIME, assetMimeForExtension, accessFnReferencesAnonymousWrites, } from "@vibes.diy/api-types";
|
|
5
|
+
import { resEnsureAppSlug, isResEnsureAppSlugOk, isResError, PUSH_FROM_NOT_OWNED_CODE, PUSH_FROM_CARRY_FAILED_CODE, ASSET_EXTENSION_MIME, assetMimeForExtension, accessFnReferencesAnonymousWrites, sniffAssetMime, } from "@vibes.diy/api-types";
|
|
6
6
|
import { sendProgress } from "../cmd-evento.js";
|
|
7
7
|
import { HANDLE_REQUIRED_CLI_MESSAGE, isHandleRequiredError } from "../handle-required.js";
|
|
8
8
|
import { lintVibeFiles } from "./lint-vibe.js";
|
|
@@ -55,6 +55,25 @@ export async function readProjectFiles(dir, opts = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
return Result.Ok({ files: state.files, assets: state.assets, refused: state.refused });
|
|
57
57
|
}
|
|
58
|
+
const ASSET_HEAD_BYTES = 16;
|
|
59
|
+
async function readHead(path) {
|
|
60
|
+
const fh = await open(path, "r");
|
|
61
|
+
try {
|
|
62
|
+
const head = new Uint8Array(ASSET_HEAD_BYTES);
|
|
63
|
+
const { bytesRead } = await fh.read(head, 0, ASSET_HEAD_BYTES, 0);
|
|
64
|
+
return head.subarray(0, bytesRead);
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
await fh.close();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function assetMimeForUpload(extensionMime, head) {
|
|
71
|
+
const sniffed = sniffAssetMime(head);
|
|
72
|
+
if (sniffed === null || sniffed === extensionMime)
|
|
73
|
+
return extensionMime;
|
|
74
|
+
const family = (m) => m.split("/")[0];
|
|
75
|
+
return family(sniffed) === family(extensionMime) ? sniffed : extensionMime;
|
|
76
|
+
}
|
|
58
77
|
async function collectProjectFiles(state) {
|
|
59
78
|
const { baseDir, relDir, files, assets, refused, nestedReserved } = state;
|
|
60
79
|
const entries = await readdir(join(baseDir, relDir), { withFileTypes: true });
|
|
@@ -84,7 +103,8 @@ async function collectProjectFiles(state) {
|
|
|
84
103
|
refused.push(filename);
|
|
85
104
|
continue;
|
|
86
105
|
}
|
|
87
|
-
|
|
106
|
+
const path = join(baseDir, rel);
|
|
107
|
+
assets.push({ filename, path, mimetype: assetMimeForUpload(mimetype, await readHead(path)) });
|
|
88
108
|
continue;
|
|
89
109
|
}
|
|
90
110
|
const content = await readFile(join(baseDir, rel), "utf-8");
|
|
@@ -213365,6 +213365,59 @@ var ASSET_EXTENSION_MIME = /* @__PURE__ */ new Map([
|
|
|
213365
213365
|
[".csv", "text/csv"]
|
|
213366
213366
|
]);
|
|
213367
213367
|
|
|
213368
|
+
// ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/types/asset-magic.ts
|
|
213369
|
+
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
|
|
213370
|
+
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
|
|
213371
|
+
init_performance2();
|
|
213372
|
+
var ASSET_MAGIC = [
|
|
213373
|
+
["image/png", [[0, [137, 80, 78, 71]]]],
|
|
213374
|
+
["image/jpeg", [[0, [255, 216, 255]]]],
|
|
213375
|
+
["image/gif", [[0, [71, 73, 70, 56]]]],
|
|
213376
|
+
[
|
|
213377
|
+
"image/webp",
|
|
213378
|
+
[
|
|
213379
|
+
[0, [82, 73, 70, 70]],
|
|
213380
|
+
[8, [87, 69, 66, 80]]
|
|
213381
|
+
]
|
|
213382
|
+
],
|
|
213383
|
+
["application/pdf", [[0, [37, 80, 68, 70]]]],
|
|
213384
|
+
["audio/mpeg", [[0, [73, 68, 51]]]],
|
|
213385
|
+
[
|
|
213386
|
+
"audio/wav",
|
|
213387
|
+
[
|
|
213388
|
+
[0, [82, 73, 70, 70]],
|
|
213389
|
+
[8, [87, 65, 86, 69]]
|
|
213390
|
+
]
|
|
213391
|
+
],
|
|
213392
|
+
["audio/ogg", [[0, [79, 103, 103, 83]]]],
|
|
213393
|
+
// `ftyp` at offset 4 only says ISO-BMFF — a container shared by MP4 video,
|
|
213394
|
+
// M4A audio, AVIF and HEIF. The MAJOR BRAND at offset 8 decides; a brand
|
|
213395
|
+
// the table does not name (a video, a HEIF) is left unrecognised rather
|
|
213396
|
+
// than mislabelled as audio.
|
|
213397
|
+
[
|
|
213398
|
+
"audio/mp4",
|
|
213399
|
+
[
|
|
213400
|
+
[4, [102, 116, 121, 112]],
|
|
213401
|
+
[8, [77, 52, 65, 32]]
|
|
213402
|
+
// "M4A "
|
|
213403
|
+
]
|
|
213404
|
+
],
|
|
213405
|
+
[
|
|
213406
|
+
"image/avif",
|
|
213407
|
+
[
|
|
213408
|
+
[4, [102, 116, 121, 112]],
|
|
213409
|
+
[8, [97, 118, 105, 102]]
|
|
213410
|
+
// "avif"
|
|
213411
|
+
]
|
|
213412
|
+
],
|
|
213413
|
+
["font/woff2", [[0, [119, 79, 70, 50]]]],
|
|
213414
|
+
["font/ttf", [[0, [0, 1, 0, 0]]]]
|
|
213415
|
+
];
|
|
213416
|
+
function headMatchesMagic(head, magic) {
|
|
213417
|
+
return magic.every(([off2, bytes]) => bytes.every((b4, i3) => head[off2 + i3] === b4));
|
|
213418
|
+
}
|
|
213419
|
+
__name(headMatchesMagic, "headMatchesMagic");
|
|
213420
|
+
|
|
213368
213421
|
// ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/types/report.ts
|
|
213369
213422
|
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_process();
|
|
213370
213423
|
init_virtual_unenv_global_polyfill_cloudflare_unenv_preset_node_console();
|
|
@@ -331260,50 +331313,6 @@ function normalizeMime(mimeType) {
|
|
|
331260
331313
|
return mimeType.split(";")[0].trim().toLowerCase();
|
|
331261
331314
|
}
|
|
331262
331315
|
__name(normalizeMime, "normalizeMime");
|
|
331263
|
-
var MAGIC = [
|
|
331264
|
-
["image/png", [[0, [137, 80, 78, 71]]]],
|
|
331265
|
-
["image/jpeg", [[0, [255, 216, 255]]]],
|
|
331266
|
-
["image/gif", [[0, [71, 73, 70, 56]]]],
|
|
331267
|
-
[
|
|
331268
|
-
"image/webp",
|
|
331269
|
-
[
|
|
331270
|
-
[0, [82, 73, 70, 70]],
|
|
331271
|
-
[8, [87, 69, 66, 80]]
|
|
331272
|
-
]
|
|
331273
|
-
],
|
|
331274
|
-
["application/pdf", [[0, [37, 80, 68, 70]]]],
|
|
331275
|
-
["audio/mpeg", [[0, [73, 68, 51]]]],
|
|
331276
|
-
[
|
|
331277
|
-
"audio/wav",
|
|
331278
|
-
[
|
|
331279
|
-
[0, [82, 73, 70, 70]],
|
|
331280
|
-
[8, [87, 65, 86, 69]]
|
|
331281
|
-
]
|
|
331282
|
-
],
|
|
331283
|
-
["audio/ogg", [[0, [79, 103, 103, 83]]]],
|
|
331284
|
-
// `ftyp` at offset 4 only says ISO-BMFF — a container shared by MP4 video,
|
|
331285
|
-
// M4A audio, AVIF and HEIF. The MAJOR BRAND at offset 8 decides; a brand
|
|
331286
|
-
// the table does not name (a video, a HEIF) is left unrecognised rather
|
|
331287
|
-
// than mislabelled as audio.
|
|
331288
|
-
[
|
|
331289
|
-
"audio/mp4",
|
|
331290
|
-
[
|
|
331291
|
-
[4, [102, 116, 121, 112]],
|
|
331292
|
-
[8, [77, 52, 65, 32]]
|
|
331293
|
-
// "M4A "
|
|
331294
|
-
]
|
|
331295
|
-
],
|
|
331296
|
-
[
|
|
331297
|
-
"image/avif",
|
|
331298
|
-
[
|
|
331299
|
-
[4, [102, 116, 121, 112]],
|
|
331300
|
-
[8, [97, 118, 105, 102]]
|
|
331301
|
-
// "avif"
|
|
331302
|
-
]
|
|
331303
|
-
],
|
|
331304
|
-
["font/woff2", [[0, [119, 79, 70, 50]]]],
|
|
331305
|
-
["font/ttf", [[0, [0, 1, 0, 0]]]]
|
|
331306
|
-
];
|
|
331307
331316
|
var VIDEO_MAGIC = [
|
|
331308
331317
|
...["isom", "iso2", "mp41", "mp42", "avc1", "M4V ", "dash"].map(
|
|
331309
331318
|
(brand2) => [
|
|
@@ -331334,13 +331343,13 @@ var VIDEO_MAGIC = [
|
|
|
331334
331343
|
// EBML header: WebM and Matroska share it.
|
|
331335
331344
|
["video/webm", [[0, [26, 69, 223, 163]]]]
|
|
331336
331345
|
];
|
|
331337
|
-
var ASSET_TYPES =
|
|
331346
|
+
var ASSET_TYPES = ASSET_MAGIC.map(([mime, magic]) => ({
|
|
331338
331347
|
mime,
|
|
331339
331348
|
magic,
|
|
331340
331349
|
gated: isGatedMime(mime)
|
|
331341
331350
|
}));
|
|
331342
331351
|
function sniffMime(head) {
|
|
331343
|
-
const matches3 = /* @__PURE__ */ __name((magic) =>
|
|
331352
|
+
const matches3 = /* @__PURE__ */ __name((magic) => headMatchesMagic(head, magic), "matches");
|
|
331344
331353
|
for (const t3 of ASSET_TYPES) {
|
|
331345
331354
|
if (matches3(t3.magic)) return t3.mime;
|
|
331346
331355
|
}
|
|
@@ -337049,7 +337058,10 @@ async function resolveAgentActor(vctx, args3) {
|
|
|
337049
337058
|
});
|
|
337050
337059
|
}
|
|
337051
337060
|
if (await ownsHandle(vctx, userId, scope2.ownerHandle) === false) {
|
|
337052
|
-
|
|
337061
|
+
const dev = scope2.appSlug === void 0 ? null : await resolveDeveloperAccess(vctx, { ownerHandle: scope2.ownerHandle, appSlug: scope2.appSlug, callerUserId: userId });
|
|
337062
|
+
if (dev === null) {
|
|
337063
|
+
return refuse2({ ok: false, reason: "not-owner", message: `Not signed in as ${scope2.ownerHandle}.` });
|
|
337064
|
+
}
|
|
337053
337065
|
}
|
|
337054
337066
|
return Result.Ok({ userId, ownerHandle: scope2.ownerHandle, scope: scope2 });
|
|
337055
337067
|
}
|
|
@@ -743,6 +743,7 @@
|
|
|
743
743
|
"vibes.diy/api/types/app-name.ts",
|
|
744
744
|
"vibes.diy/api/types/app.ts",
|
|
745
745
|
"vibes.diy/api/types/asset-extensions.ts",
|
|
746
|
+
"vibes.diy/api/types/asset-magic.ts",
|
|
746
747
|
"vibes.diy/api/types/asset-safety.ts",
|
|
747
748
|
"vibes.diy/api/types/asset.ts",
|
|
748
749
|
"vibes.diy/api/types/audience-arms-msg.ts",
|
|
@@ -3445,6 +3446,7 @@
|
|
|
3445
3446
|
"vibes.diy/api/types/app-name.ts",
|
|
3446
3447
|
"vibes.diy/api/types/app.ts",
|
|
3447
3448
|
"vibes.diy/api/types/asset-extensions.ts",
|
|
3449
|
+
"vibes.diy/api/types/asset-magic.ts",
|
|
3448
3450
|
"vibes.diy/api/types/asset-safety.ts",
|
|
3449
3451
|
"vibes.diy/api/types/asset.ts",
|
|
3450
3452
|
"vibes.diy/api/types/audience-arms-msg.ts",
|
|
@@ -16862,6 +16862,69 @@ var init_asset_extensions = __esm({
|
|
|
16862
16862
|
}
|
|
16863
16863
|
});
|
|
16864
16864
|
|
|
16865
|
+
// ../vibes.diy/api/types/asset-magic.ts
|
|
16866
|
+
function headMatchesMagic(head, magic) {
|
|
16867
|
+
return magic.every(([off, bytes]) => bytes.every((b, i) => head[off + i] === b));
|
|
16868
|
+
}
|
|
16869
|
+
function sniffAssetMime(head) {
|
|
16870
|
+
for (const [mime3, magic] of ASSET_MAGIC) {
|
|
16871
|
+
if (headMatchesMagic(head, magic)) return mime3;
|
|
16872
|
+
}
|
|
16873
|
+
return null;
|
|
16874
|
+
}
|
|
16875
|
+
var ASSET_MAGIC;
|
|
16876
|
+
var init_asset_magic = __esm({
|
|
16877
|
+
"../vibes.diy/api/types/asset-magic.ts"() {
|
|
16878
|
+
"use strict";
|
|
16879
|
+
ASSET_MAGIC = [
|
|
16880
|
+
["image/png", [[0, [137, 80, 78, 71]]]],
|
|
16881
|
+
["image/jpeg", [[0, [255, 216, 255]]]],
|
|
16882
|
+
["image/gif", [[0, [71, 73, 70, 56]]]],
|
|
16883
|
+
[
|
|
16884
|
+
"image/webp",
|
|
16885
|
+
[
|
|
16886
|
+
[0, [82, 73, 70, 70]],
|
|
16887
|
+
[8, [87, 69, 66, 80]]
|
|
16888
|
+
]
|
|
16889
|
+
],
|
|
16890
|
+
["application/pdf", [[0, [37, 80, 68, 70]]]],
|
|
16891
|
+
["audio/mpeg", [[0, [73, 68, 51]]]],
|
|
16892
|
+
[
|
|
16893
|
+
"audio/wav",
|
|
16894
|
+
[
|
|
16895
|
+
[0, [82, 73, 70, 70]],
|
|
16896
|
+
[8, [87, 65, 86, 69]]
|
|
16897
|
+
]
|
|
16898
|
+
],
|
|
16899
|
+
["audio/ogg", [[0, [79, 103, 103, 83]]]],
|
|
16900
|
+
// `ftyp` at offset 4 only says ISO-BMFF — a container shared by MP4 video,
|
|
16901
|
+
// M4A audio, AVIF and HEIF. The MAJOR BRAND at offset 8 decides; a brand
|
|
16902
|
+
// the table does not name (a video, a HEIF) is left unrecognised rather
|
|
16903
|
+
// than mislabelled as audio.
|
|
16904
|
+
[
|
|
16905
|
+
"audio/mp4",
|
|
16906
|
+
[
|
|
16907
|
+
[4, [102, 116, 121, 112]],
|
|
16908
|
+
[8, [77, 52, 65, 32]]
|
|
16909
|
+
// "M4A "
|
|
16910
|
+
]
|
|
16911
|
+
],
|
|
16912
|
+
[
|
|
16913
|
+
"image/avif",
|
|
16914
|
+
[
|
|
16915
|
+
[4, [102, 116, 121, 112]],
|
|
16916
|
+
[8, [97, 118, 105, 102]]
|
|
16917
|
+
// "avif"
|
|
16918
|
+
]
|
|
16919
|
+
],
|
|
16920
|
+
["font/woff2", [[0, [119, 79, 70, 50]]]],
|
|
16921
|
+
["font/ttf", [[0, [0, 1, 0, 0]]]]
|
|
16922
|
+
];
|
|
16923
|
+
__name(headMatchesMagic, "headMatchesMagic");
|
|
16924
|
+
__name(sniffAssetMime, "sniffAssetMime");
|
|
16925
|
+
}
|
|
16926
|
+
});
|
|
16927
|
+
|
|
16865
16928
|
// ../vibes.diy/api/types/report.ts
|
|
16866
16929
|
import { type as type69 } from "arktype";
|
|
16867
16930
|
function isResReportGrowthMemberships(obj2) {
|
|
@@ -19469,6 +19532,7 @@ var init_types3 = __esm({
|
|
|
19469
19532
|
init_credits_copy();
|
|
19470
19533
|
init_asset();
|
|
19471
19534
|
init_asset_extensions();
|
|
19535
|
+
init_asset_magic();
|
|
19472
19536
|
init_report();
|
|
19473
19537
|
init_report_activity_engaged();
|
|
19474
19538
|
init_home_feed();
|
|
@@ -26530,9 +26594,9 @@ function moduleSpecifiers(source) {
|
|
|
26530
26594
|
const view = codeView(source);
|
|
26531
26595
|
const out = [];
|
|
26532
26596
|
for (const m of view.matchAll(SPECIFIER_QUOTE)) {
|
|
26533
|
-
const
|
|
26534
|
-
const close = source.indexOf(m[1],
|
|
26535
|
-
if (close >
|
|
26597
|
+
const open3 = (m.index ?? 0) + m[0].length;
|
|
26598
|
+
const close = source.indexOf(m[1], open3);
|
|
26599
|
+
if (close > open3) out.push(source.slice(open3, close));
|
|
26536
26600
|
}
|
|
26537
26601
|
return out;
|
|
26538
26602
|
}
|
|
@@ -27078,6 +27142,7 @@ var init_version_timeline = __esm({
|
|
|
27078
27142
|
var POUF_ENTRY_EXPORTS, POUF_TAUGHT_NAMES;
|
|
27079
27143
|
var init_exports = __esm({
|
|
27080
27144
|
"../vibes.diy/pouf/exports.ts"() {
|
|
27145
|
+
"use strict";
|
|
27081
27146
|
POUF_ENTRY_EXPORTS = {
|
|
27082
27147
|
index: [
|
|
27083
27148
|
"AlertBell",
|
|
@@ -57290,9 +57355,9 @@ async function pickTextNumber(vctx, opts = {}) {
|
|
|
57290
57355
|
}
|
|
57291
57356
|
let best;
|
|
57292
57357
|
for (const phoneNumber of cfg.lines) {
|
|
57293
|
-
const
|
|
57294
|
-
if (
|
|
57295
|
-
if (best === void 0 ||
|
|
57358
|
+
const open3 = await advertisableLine({ vctx, cfg, phoneNumber, now: now3 });
|
|
57359
|
+
if (open3 === void 0) continue;
|
|
57360
|
+
if (best === void 0 || open3.newChats24h < best.newChats) best = { phoneNumber, newChats: open3.newChats24h };
|
|
57296
57361
|
}
|
|
57297
57362
|
numberPick = { key, phoneNumber: best?.phoneNumber, at: now3.getTime() };
|
|
57298
57363
|
return best?.phoneNumber;
|
|
@@ -61119,7 +61184,7 @@ function idbPictureBytes(opts = {}) {
|
|
|
61119
61184
|
const maxBytes = opts.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
61120
61185
|
const now3 = opts.now ?? Date.now;
|
|
61121
61186
|
let dbp;
|
|
61122
|
-
function
|
|
61187
|
+
function open3() {
|
|
61123
61188
|
if (factory === void 0) return Promise.reject(new Error("indexedDB unavailable"));
|
|
61124
61189
|
if (dbp === void 0) {
|
|
61125
61190
|
const r = factory.open(opts.dbName ?? PICTURE_BYTES_DB, 1);
|
|
@@ -61134,13 +61199,13 @@ function idbPictureBytes(opts = {}) {
|
|
|
61134
61199
|
}
|
|
61135
61200
|
return dbp;
|
|
61136
61201
|
}
|
|
61137
|
-
__name(
|
|
61202
|
+
__name(open3, "open");
|
|
61138
61203
|
function forgetFailedOpen() {
|
|
61139
61204
|
dbp = void 0;
|
|
61140
61205
|
}
|
|
61141
61206
|
__name(forgetFailedOpen, "forgetFailedOpen");
|
|
61142
61207
|
async function get(uploadId) {
|
|
61143
|
-
const db = await
|
|
61208
|
+
const db = await open3();
|
|
61144
61209
|
const tx = db.transaction([BYTES, META], "readwrite");
|
|
61145
61210
|
const row = bytesRow(await req(tx.objectStore(BYTES).get(uploadId)));
|
|
61146
61211
|
if (row instanceof type105.errors) {
|
|
@@ -61155,7 +61220,7 @@ function idbPictureBytes(opts = {}) {
|
|
|
61155
61220
|
async function put(uploadId, blob2) {
|
|
61156
61221
|
if (blob2.size > maxBytes) return;
|
|
61157
61222
|
const buf = await blob2.arrayBuffer();
|
|
61158
|
-
const db = await
|
|
61223
|
+
const db = await open3();
|
|
61159
61224
|
const tx = db.transaction([BYTES, META], "readwrite");
|
|
61160
61225
|
const bytes = tx.objectStore(BYTES);
|
|
61161
61226
|
const meta = tx.objectStore(META);
|
|
@@ -64651,8 +64716,8 @@ var init_write_receipts = __esm({
|
|
|
64651
64716
|
* outstanding (the doc then reads `accepted`). */
|
|
64652
64717
|
docState(docId) {
|
|
64653
64718
|
const latest3 = this.latestOp.get(docId);
|
|
64654
|
-
const
|
|
64655
|
-
if (
|
|
64719
|
+
const open3 = latest3 === void 0 ? void 0 : this.ops.get(latest3);
|
|
64720
|
+
if (open3 !== void 0) return open3.receipt;
|
|
64656
64721
|
const refused2 = this.refusedDocs.get(docId);
|
|
64657
64722
|
return refused2 === void 0 ? void 0 : staticWriteSync(refused2);
|
|
64658
64723
|
}
|
|
@@ -70604,12 +70669,12 @@ function HandleLookupView({
|
|
|
70604
70669
|
invalid: invalid2,
|
|
70605
70670
|
busy
|
|
70606
70671
|
}) {
|
|
70607
|
-
const [
|
|
70672
|
+
const [open3, setOpen] = useState8(false);
|
|
70608
70673
|
const [highlight, setHighlight] = useState8(-1);
|
|
70609
70674
|
const rootRef = useRef5(null);
|
|
70610
70675
|
const inputRef = useRef5(null);
|
|
70611
70676
|
useEffect8(() => {
|
|
70612
|
-
if (!
|
|
70677
|
+
if (!open3) return;
|
|
70613
70678
|
function onDocPointerDown(e) {
|
|
70614
70679
|
if (rootRef.current && e.target instanceof Node && !rootRef.current.contains(e.target)) {
|
|
70615
70680
|
setOpen(false);
|
|
@@ -70618,7 +70683,7 @@ function HandleLookupView({
|
|
|
70618
70683
|
__name(onDocPointerDown, "onDocPointerDown");
|
|
70619
70684
|
document.addEventListener("pointerdown", onDocPointerDown);
|
|
70620
70685
|
return () => document.removeEventListener("pointerdown", onDocPointerDown);
|
|
70621
|
-
}, [
|
|
70686
|
+
}, [open3]);
|
|
70622
70687
|
useEffect8(() => {
|
|
70623
70688
|
setHighlight((h) => h >= items.length ? items.length - 1 : h);
|
|
70624
70689
|
}, [items.length]);
|
|
@@ -70703,7 +70768,7 @@ function HandleLookupView({
|
|
|
70703
70768
|
ref: inputRef,
|
|
70704
70769
|
type: "text",
|
|
70705
70770
|
role: "combobox",
|
|
70706
|
-
"aria-expanded":
|
|
70771
|
+
"aria-expanded": open3 && (items.length > 0 || canCommitRaw),
|
|
70707
70772
|
"aria-autocomplete": "list",
|
|
70708
70773
|
"aria-label": placeholder2 ?? "Find a handle",
|
|
70709
70774
|
value: query,
|
|
@@ -70723,7 +70788,7 @@ function HandleLookupView({
|
|
|
70723
70788
|
className: inputClassName,
|
|
70724
70789
|
style: inputClassName === void 0 ? DEFAULT_INPUT_STYLE : void 0
|
|
70725
70790
|
}
|
|
70726
|
-
),
|
|
70791
|
+
), open3 && (items.length > 0 || canCommitRaw) && /* @__PURE__ */ React6.createElement(
|
|
70727
70792
|
"div",
|
|
70728
70793
|
{
|
|
70729
70794
|
role: "listbox",
|
|
@@ -90889,7 +90954,7 @@ function normalizeMime(mimeType) {
|
|
|
90889
90954
|
return mimeType.split(";")[0].trim().toLowerCase();
|
|
90890
90955
|
}
|
|
90891
90956
|
function sniffMime(head) {
|
|
90892
|
-
const matches2 = /* @__PURE__ */ __name((magic) =>
|
|
90957
|
+
const matches2 = /* @__PURE__ */ __name((magic) => headMatchesMagic(head, magic), "matches");
|
|
90893
90958
|
for (const t of ASSET_TYPES) {
|
|
90894
90959
|
if (matches2(t.magic)) return t.mime;
|
|
90895
90960
|
}
|
|
@@ -90976,56 +91041,13 @@ async function peekHead(body, n2 = HEAD_BYTES) {
|
|
|
90976
91041
|
});
|
|
90977
91042
|
return Result107.Ok({ head, stream });
|
|
90978
91043
|
}
|
|
90979
|
-
var
|
|
91044
|
+
var VIDEO_MAGIC, ASSET_TYPES, IMAGE_CAP_BYTES, OTHER_CAP_BYTES, OVER_CAP_MARKER, HEAD_BYTES;
|
|
90980
91045
|
var init_asset_sniff = __esm({
|
|
90981
91046
|
"../vibes.diy/api/svc/intern/asset-sniff.ts"() {
|
|
90982
91047
|
"use strict";
|
|
91048
|
+
init_types3();
|
|
90983
91049
|
__name(isGatedMime, "isGatedMime");
|
|
90984
91050
|
__name(normalizeMime, "normalizeMime");
|
|
90985
|
-
MAGIC = [
|
|
90986
|
-
["image/png", [[0, [137, 80, 78, 71]]]],
|
|
90987
|
-
["image/jpeg", [[0, [255, 216, 255]]]],
|
|
90988
|
-
["image/gif", [[0, [71, 73, 70, 56]]]],
|
|
90989
|
-
[
|
|
90990
|
-
"image/webp",
|
|
90991
|
-
[
|
|
90992
|
-
[0, [82, 73, 70, 70]],
|
|
90993
|
-
[8, [87, 69, 66, 80]]
|
|
90994
|
-
]
|
|
90995
|
-
],
|
|
90996
|
-
["application/pdf", [[0, [37, 80, 68, 70]]]],
|
|
90997
|
-
["audio/mpeg", [[0, [73, 68, 51]]]],
|
|
90998
|
-
[
|
|
90999
|
-
"audio/wav",
|
|
91000
|
-
[
|
|
91001
|
-
[0, [82, 73, 70, 70]],
|
|
91002
|
-
[8, [87, 65, 86, 69]]
|
|
91003
|
-
]
|
|
91004
|
-
],
|
|
91005
|
-
["audio/ogg", [[0, [79, 103, 103, 83]]]],
|
|
91006
|
-
// `ftyp` at offset 4 only says ISO-BMFF — a container shared by MP4 video,
|
|
91007
|
-
// M4A audio, AVIF and HEIF. The MAJOR BRAND at offset 8 decides; a brand
|
|
91008
|
-
// the table does not name (a video, a HEIF) is left unrecognised rather
|
|
91009
|
-
// than mislabelled as audio.
|
|
91010
|
-
[
|
|
91011
|
-
"audio/mp4",
|
|
91012
|
-
[
|
|
91013
|
-
[4, [102, 116, 121, 112]],
|
|
91014
|
-
[8, [77, 52, 65, 32]]
|
|
91015
|
-
// "M4A "
|
|
91016
|
-
]
|
|
91017
|
-
],
|
|
91018
|
-
[
|
|
91019
|
-
"image/avif",
|
|
91020
|
-
[
|
|
91021
|
-
[4, [102, 116, 121, 112]],
|
|
91022
|
-
[8, [97, 118, 105, 102]]
|
|
91023
|
-
// "avif"
|
|
91024
|
-
]
|
|
91025
|
-
],
|
|
91026
|
-
["font/woff2", [[0, [119, 79, 70, 50]]]],
|
|
91027
|
-
["font/ttf", [[0, [0, 1, 0, 0]]]]
|
|
91028
|
-
];
|
|
91029
91051
|
VIDEO_MAGIC = [
|
|
91030
91052
|
...["isom", "iso2", "mp41", "mp42", "avc1", "M4V ", "dash"].map(
|
|
91031
91053
|
(brand) => [
|
|
@@ -91056,7 +91078,7 @@ var init_asset_sniff = __esm({
|
|
|
91056
91078
|
// EBML header: WebM and Matroska share it.
|
|
91057
91079
|
["video/webm", [[0, [26, 69, 223, 163]]]]
|
|
91058
91080
|
];
|
|
91059
|
-
ASSET_TYPES =
|
|
91081
|
+
ASSET_TYPES = ASSET_MAGIC.map(([mime3, magic]) => ({
|
|
91060
91082
|
mime: mime3,
|
|
91061
91083
|
magic,
|
|
91062
91084
|
gated: isGatedMime(mime3)
|
|
@@ -96925,7 +96947,10 @@ async function resolveAgentActor(vctx, args) {
|
|
|
96925
96947
|
});
|
|
96926
96948
|
}
|
|
96927
96949
|
if (await ownsHandle(vctx, userId, scope2.ownerHandle) === false) {
|
|
96928
|
-
|
|
96950
|
+
const dev = scope2.appSlug === void 0 ? null : await resolveDeveloperAccess(vctx, { ownerHandle: scope2.ownerHandle, appSlug: scope2.appSlug, callerUserId: userId });
|
|
96951
|
+
if (dev === null) {
|
|
96952
|
+
return refuse2({ ok: false, reason: "not-owner", message: `Not signed in as ${scope2.ownerHandle}.` });
|
|
96953
|
+
}
|
|
96929
96954
|
}
|
|
96930
96955
|
return Result128.Ok({ userId, ownerHandle: scope2.ownerHandle, scope: scope2 });
|
|
96931
96956
|
}
|
|
@@ -97040,6 +97065,7 @@ var init_agent_actor = __esm({
|
|
|
97040
97065
|
"use strict";
|
|
97041
97066
|
init_types3();
|
|
97042
97067
|
init_guest_principal_owner();
|
|
97068
|
+
init_developer_grants();
|
|
97043
97069
|
AgentRefusalError = class extends Error {
|
|
97044
97070
|
static {
|
|
97045
97071
|
__name(this, "AgentRefusalError");
|
|
@@ -100706,10 +100732,10 @@ function stripComments(css) {
|
|
|
100706
100732
|
const out = [];
|
|
100707
100733
|
let at2 = 0;
|
|
100708
100734
|
for (; ; ) {
|
|
100709
|
-
const
|
|
100710
|
-
if (
|
|
100711
|
-
out.push(css.slice(at2,
|
|
100712
|
-
const close = css.indexOf("*/",
|
|
100735
|
+
const open3 = css.indexOf("/*", at2);
|
|
100736
|
+
if (open3 < 0) break;
|
|
100737
|
+
out.push(css.slice(at2, open3), " ");
|
|
100738
|
+
const close = css.indexOf("*/", open3 + 2);
|
|
100713
100739
|
if (close < 0) return out.join("");
|
|
100714
100740
|
at2 = close + 2;
|
|
100715
100741
|
}
|
|
@@ -101564,9 +101590,9 @@ async function writeVibeLink(vctx, actor, link) {
|
|
|
101564
101590
|
function vibeLinkContextLine(link, now3 = /* @__PURE__ */ new Date()) {
|
|
101565
101591
|
const paused = link.state === "paused" ? link.pausedVia === "stop" ? " (paused by a member's STOP: its posts stay off until a member asks for it back, then add_vibe turns it on)" : " (paused)" : "";
|
|
101566
101592
|
const object = link.objectId === void 0 ? "" : `, the group's own record there: ${link.objectId}`;
|
|
101567
|
-
const
|
|
101593
|
+
const open3 = questionIsOpen(link, now3) ? ", its question is the chat's open one, so a bare answer is for it" : "";
|
|
101568
101594
|
const held2 = link.heldQuestion !== void 0 && vibeLinkWakes(link) ? ", a question of its waits for the floor" : "";
|
|
101569
|
-
return `https://vibes.diy/vibe/${link.ownerHandle}/${link.appSlug}${paused}, added by @${link.addedBy}${object}${
|
|
101595
|
+
return `https://vibes.diy/vibe/${link.ownerHandle}/${link.appSlug}${paused}, added by @${link.addedBy}${object}${open3}${held2}`;
|
|
101570
101596
|
}
|
|
101571
101597
|
function vibeLinkToolDefinitions() {
|
|
101572
101598
|
return [
|
|
@@ -102855,8 +102881,8 @@ function applyVibeQuestions(o) {
|
|
|
102855
102881
|
changed.add(key);
|
|
102856
102882
|
}
|
|
102857
102883
|
if (floor === void 0 || floor === key) {
|
|
102858
|
-
const
|
|
102859
|
-
const repeat = floor === key &&
|
|
102884
|
+
const open3 = link.openQuestion;
|
|
102885
|
+
const repeat = floor === key && open3?.body !== void 0 && sameAsk(open3.body, w.body);
|
|
102860
102886
|
if (!repeat) link.openQuestion = { wakeId: w.id, askedAt: nowIso2, body: w.body };
|
|
102861
102887
|
delete link.heldQuestion;
|
|
102862
102888
|
floor = key;
|
|
@@ -108805,26 +108831,26 @@ function fireproofDestructures(src, view) {
|
|
|
108805
108831
|
});
|
|
108806
108832
|
}
|
|
108807
108833
|
function enclosingBlock(view, at2) {
|
|
108808
|
-
let
|
|
108834
|
+
let open3 = -1;
|
|
108809
108835
|
for (let i = at2 - 1, depth = 0; i >= 0; i--) {
|
|
108810
108836
|
if (view[i] === "}") depth++;
|
|
108811
108837
|
if (view[i] === "{") {
|
|
108812
108838
|
if (depth === 0) {
|
|
108813
|
-
|
|
108839
|
+
open3 = i;
|
|
108814
108840
|
break;
|
|
108815
108841
|
}
|
|
108816
108842
|
depth--;
|
|
108817
108843
|
}
|
|
108818
108844
|
}
|
|
108819
|
-
if (
|
|
108820
|
-
for (let i =
|
|
108845
|
+
if (open3 < 0) return { start: 0, end: view.length };
|
|
108846
|
+
for (let i = open3 + 1, depth = 0; i < view.length; i++) {
|
|
108821
108847
|
if (view[i] === "{") depth++;
|
|
108822
108848
|
if (view[i] === "}") {
|
|
108823
|
-
if (depth === 0) return { start:
|
|
108849
|
+
if (depth === 0) return { start: open3, end: i + 1 };
|
|
108824
108850
|
depth--;
|
|
108825
108851
|
}
|
|
108826
108852
|
}
|
|
108827
|
-
return { start:
|
|
108853
|
+
return { start: open3, end: view.length };
|
|
108828
108854
|
}
|
|
108829
108855
|
function respecFireproof(src, importStarts) {
|
|
108830
108856
|
const notes = [];
|
|
@@ -118886,21 +118912,21 @@ function createStreamingResolver(deps) {
|
|
|
118886
118912
|
};
|
|
118887
118913
|
}
|
|
118888
118914
|
function createBlockAccumulator() {
|
|
118889
|
-
const
|
|
118915
|
+
const open3 = /* @__PURE__ */ new Map();
|
|
118890
118916
|
return {
|
|
118891
118917
|
ingest(msg) {
|
|
118892
118918
|
if (isCodeBegin(msg)) {
|
|
118893
|
-
|
|
118919
|
+
open3.set(msg.blockId, { begin: msg, lines: [] });
|
|
118894
118920
|
return void 0;
|
|
118895
118921
|
}
|
|
118896
118922
|
if (isCodeLine(msg)) {
|
|
118897
|
-
|
|
118923
|
+
open3.get(msg.blockId)?.lines.push(msg);
|
|
118898
118924
|
return void 0;
|
|
118899
118925
|
}
|
|
118900
118926
|
if (isCodeEnd(msg) || isCodeTruncated(msg)) {
|
|
118901
|
-
const acc =
|
|
118927
|
+
const acc = open3.get(msg.blockId);
|
|
118902
118928
|
if (!acc) return void 0;
|
|
118903
|
-
|
|
118929
|
+
open3.delete(msg.blockId);
|
|
118904
118930
|
return { begin: acc.begin, lines: acc.lines, end: msg };
|
|
118905
118931
|
}
|
|
118906
118932
|
return void 0;
|
|
@@ -125982,19 +126008,19 @@ var init_turn_latency = __esm({
|
|
|
125982
126008
|
|
|
125983
126009
|
// ../vibes.diy/api/svc/intern/stream-file-size-watch.ts
|
|
125984
126010
|
function createStreamFileSizeWatch(maxChars = AGENT_SOURCE_FILE_MAX_CHARS) {
|
|
125985
|
-
const
|
|
126011
|
+
const open3 = /* @__PURE__ */ new Map();
|
|
125986
126012
|
return {
|
|
125987
126013
|
observe(msg) {
|
|
125988
126014
|
if (isCodeBegin(msg)) {
|
|
125989
|
-
|
|
126015
|
+
open3.set(msg.blockId, { path: normalizeFilename(msg.path), chars: 0, lines: 0, edit: false });
|
|
125990
126016
|
return void 0;
|
|
125991
126017
|
}
|
|
125992
126018
|
if (isCodeEnd(msg) || isCodeTruncated(msg)) {
|
|
125993
|
-
|
|
126019
|
+
open3.delete(msg.blockId);
|
|
125994
126020
|
return void 0;
|
|
125995
126021
|
}
|
|
125996
126022
|
if (isCodeLine(msg) === false) return void 0;
|
|
125997
|
-
const block =
|
|
126023
|
+
const block = open3.get(msg.blockId);
|
|
125998
126024
|
if (block === void 0 || block.edit) return void 0;
|
|
125999
126025
|
if (isSearchMarkerLine(msg.line)) {
|
|
126000
126026
|
block.edit = true;
|
|
@@ -126003,7 +126029,7 @@ function createStreamFileSizeWatch(maxChars = AGENT_SOURCE_FILE_MAX_CHARS) {
|
|
|
126003
126029
|
block.chars += msg.line.length + (block.lines > 0 ? 1 : 0);
|
|
126004
126030
|
block.lines++;
|
|
126005
126031
|
if (block.chars <= maxChars) return void 0;
|
|
126006
|
-
|
|
126032
|
+
open3.delete(msg.blockId);
|
|
126007
126033
|
return block.path;
|
|
126008
126034
|
}
|
|
126009
126035
|
};
|
|
@@ -136398,9 +136424,9 @@ function checkBuilds(steps, buildAt) {
|
|
|
136398
136424
|
const builds = steps.filter((s) => s.kind === "build");
|
|
136399
136425
|
if (steps.slice(buildAt, buildAt + builds.length).some((s) => s.kind !== "build"))
|
|
136400
136426
|
return Result233.Err("guided.json: build steps go side by side, one build chosen by its when");
|
|
136401
|
-
const
|
|
136402
|
-
if (
|
|
136403
|
-
return Result233.Err(`guided.json: build step "${
|
|
136427
|
+
const open3 = builds.slice(0, -1).find((s) => s.when === void 0);
|
|
136428
|
+
if (open3 !== void 0)
|
|
136429
|
+
return Result233.Err(`guided.json: build step "${open3.id}" has no when, so the build steps after it never run`);
|
|
136404
136430
|
const last = builds[builds.length - 1];
|
|
136405
136431
|
if (last?.when === void 0) return Result233.Ok(void 0);
|
|
136406
136432
|
const keys = [...new Set(builds.flatMap((b) => Object.keys(b.when ?? {})))];
|
|
@@ -146310,13 +146336,13 @@ async function abandonReason(vctx, args, job) {
|
|
|
146310
146336
|
const journal = await readAgentSession(vctx.sql, args.chatId);
|
|
146311
146337
|
if (journal.isErr()) return "turns-unreadable";
|
|
146312
146338
|
if (hasStagedWork(journal.Ok().snapshot)) return "commit-staged";
|
|
146313
|
-
const
|
|
146339
|
+
const open3 = await hasOpenTurnOnChat(vctx.sql, {
|
|
146314
146340
|
chatId: args.chatId,
|
|
146315
146341
|
exceptPromptIds: args.dispatchingSessionPromptId === void 0 ? [args.promptId] : [args.promptId, args.dispatchingSessionPromptId],
|
|
146316
146342
|
nowMs: Date.now()
|
|
146317
146343
|
});
|
|
146318
|
-
if (
|
|
146319
|
-
if (
|
|
146344
|
+
if (open3.isErr()) return "turns-unreadable";
|
|
146345
|
+
if (open3.Ok()) return "build-in-flight";
|
|
146320
146346
|
const head = await chatHeadFsId(vctx, args.chatId);
|
|
146321
146347
|
if (job.aborted) return "deadline";
|
|
146322
146348
|
if (peekBuildLockEntry(vctx.connections, args.chatId) !== void 0) return "build-in-flight";
|
|
@@ -165030,7 +165056,7 @@ var init_llm_chat = __esm({
|
|
|
165030
165056
|
get chatOnly() {
|
|
165031
165057
|
return this.res.chatOnly;
|
|
165032
165058
|
}
|
|
165033
|
-
static async open(
|
|
165059
|
+
static async open(open3, api) {
|
|
165034
165060
|
const rConn = await exception2Result375(() => api.getReadyConnection());
|
|
165035
165061
|
if (rConn.isErr()) {
|
|
165036
165062
|
return Result367.Err(mkResError(`WebSocket connect failed: ${rConn.Err().message}`, "websocket-connect-failed"));
|
|
@@ -165039,7 +165065,7 @@ var init_llm_chat = __esm({
|
|
|
165039
165065
|
const tid = api.cfg.sthis.nextId(12).str;
|
|
165040
165066
|
const sectionEvents = new TransformStream();
|
|
165041
165067
|
let openAcked = false;
|
|
165042
|
-
const initialHistory =
|
|
165068
|
+
const initialHistory = open3.historyLimit === void 0 ? void 0 : [];
|
|
165043
165069
|
const sectionEventsWriter = sectionEvents.writable.getWriter();
|
|
165044
165070
|
const evento = new Evento4(new W3CWebSocketEventEventoEnDecoder());
|
|
165045
165071
|
evento.push({
|
|
@@ -165094,7 +165120,7 @@ var init_llm_chat = __esm({
|
|
|
165094
165120
|
}, "teardown");
|
|
165095
165121
|
conn.onError(teardown2);
|
|
165096
165122
|
conn.onClose(teardown2);
|
|
165097
|
-
const res = await api.request(
|
|
165123
|
+
const res = await api.request(open3, { tid, resMatch: isResOpenChat });
|
|
165098
165124
|
openAcked = true;
|
|
165099
165125
|
if (res.isErr()) {
|
|
165100
165126
|
return Result367.Err(res.Err());
|
|
@@ -168534,9 +168560,9 @@ function runSqlBridge(client) {
|
|
|
168534
168560
|
return [NO_ROWS];
|
|
168535
168561
|
}
|
|
168536
168562
|
if (tx !== void 0 && (TX_COMMIT.test(stmt.sql) || TX_ROLLBACK.test(stmt.sql))) {
|
|
168537
|
-
const
|
|
168563
|
+
const open3 = tx;
|
|
168538
168564
|
tx = void 0;
|
|
168539
|
-
await (TX_COMMIT.test(stmt.sql) ?
|
|
168565
|
+
await (TX_COMMIT.test(stmt.sql) ? open3.commit() : open3.rollback());
|
|
168540
168566
|
return [NO_ROWS];
|
|
168541
168567
|
}
|
|
168542
168568
|
return [await (tx ?? client).execute(stmt)];
|
|
@@ -169785,14 +169811,14 @@ function buildAccessEmail({
|
|
|
169785
169811
|
let subject;
|
|
169786
169812
|
let headline;
|
|
169787
169813
|
let line2;
|
|
169788
|
-
let
|
|
169814
|
+
let open3;
|
|
169789
169815
|
let reason;
|
|
169790
169816
|
switch (op.action) {
|
|
169791
169817
|
case "invite":
|
|
169792
169818
|
subject = `${owner} invited you to ${title} on Vibes DIY`;
|
|
169793
169819
|
headline = `${owner} invited you to join ${title} as ${role}`;
|
|
169794
169820
|
line2 = "Accept and it shows up in your apps, ready to use together.";
|
|
169795
|
-
|
|
169821
|
+
open3 = { href: tagEmailUrl(appUrl2, { lane, term: "button" }), label: `Join ${title}` };
|
|
169796
169822
|
reason = `You get this because ${owner} invited you on Vibes DIY.`;
|
|
169797
169823
|
break;
|
|
169798
169824
|
case "invite-revoked":
|
|
@@ -169805,7 +169831,7 @@ function buildAccessEmail({
|
|
|
169805
169831
|
subject = `You're in: ${owner} approved you for ${title}`;
|
|
169806
169832
|
headline = `You're in! ${owner} approved you as ${role} on ${title}`;
|
|
169807
169833
|
line2 = "It's ready for you now.";
|
|
169808
|
-
|
|
169834
|
+
open3 = { href: tagEmailUrl(appUrl2, { lane, term: "button" }), label: `Open ${title}` };
|
|
169809
169835
|
reason = `You get this because you asked to join ${title} on Vibes DIY.`;
|
|
169810
169836
|
break;
|
|
169811
169837
|
case "req-rejected":
|
|
@@ -169818,17 +169844,17 @@ function buildAccessEmail({
|
|
|
169818
169844
|
const text3 = [
|
|
169819
169845
|
`${headline}.`,
|
|
169820
169846
|
line2,
|
|
169821
|
-
...
|
|
169847
|
+
...open3 === void 0 ? [BRAND_ABOUT, `Make your own app: ${withLinkTerm(home, "make-your-own")}`] : [`${open3.label}: ${open3.href}`],
|
|
169822
169848
|
"\u2014",
|
|
169823
169849
|
reason,
|
|
169824
169850
|
BRAND_POSTAL_TEXT
|
|
169825
169851
|
].join("\n\n");
|
|
169826
|
-
const shot =
|
|
169827
|
-
const action =
|
|
169852
|
+
const shot = open3 === void 0 || app.screenshot === void 0 ? "" : brandShot(esc(withLinkTerm(open3.href, "screenshot")), esc(app.screenshot.content_id), esc(`A look at ${title}`));
|
|
169853
|
+
const action = open3 === void 0 ? "" : brandShotBesideButton({ shotHtml: shot, hrefHtml: esc(open3.href), labelHtml: `${esc(open3.label)} →` });
|
|
169828
169854
|
const html = brandEmailHtml({
|
|
169829
169855
|
titleHtml: esc(subject),
|
|
169830
169856
|
logoHrefHtml: esc(home),
|
|
169831
|
-
bodyHtml: `<div style="font-size:24px;font-weight:700;line-height:1.3;margin:0 0 14px;">${esc(headline)}</div>` + brandParagraph(esc(line2)) + action + (
|
|
169857
|
+
bodyHtml: `<div style="font-size:24px;font-weight:700;line-height:1.3;margin:0 0 14px;">${esc(headline)}</div>` + brandParagraph(esc(line2)) + action + (open3 === void 0 ? brandParagraph(esc(BRAND_ABOUT), true) + brandButton(esc(withLinkTerm(home, "make-your-own")), "Make your own app →") : ""),
|
|
169832
169858
|
footerHtml: esc(reason)
|
|
169833
169859
|
});
|
|
169834
169860
|
return {
|
|
@@ -173584,7 +173610,7 @@ var init_lint_vibe = __esm({
|
|
|
173584
173610
|
});
|
|
173585
173611
|
|
|
173586
173612
|
// cli/cmds/push-from-dir.ts
|
|
173587
|
-
import { readdir as readdir3, readFile as readFile6 } from "fs/promises";
|
|
173613
|
+
import { open as open2, readdir as readdir3, readFile as readFile6 } from "fs/promises";
|
|
173588
173614
|
import { extname as extname2, join as join10, resolve as resolve10 } from "path";
|
|
173589
173615
|
import { Result as Result458, exception2Result as exception2Result413, BuildURI as BuildURI35 } from "@adviser/cement";
|
|
173590
173616
|
import { type as type336 } from "arktype";
|
|
@@ -173622,6 +173648,22 @@ async function readProjectFiles(dir, opts = {}) {
|
|
|
173622
173648
|
}
|
|
173623
173649
|
return Result458.Ok({ files: state3.files, assets: state3.assets, refused: state3.refused });
|
|
173624
173650
|
}
|
|
173651
|
+
async function readHead2(path2) {
|
|
173652
|
+
const fh = await open2(path2, "r");
|
|
173653
|
+
try {
|
|
173654
|
+
const head = new Uint8Array(ASSET_HEAD_BYTES);
|
|
173655
|
+
const { bytesRead } = await fh.read(head, 0, ASSET_HEAD_BYTES, 0);
|
|
173656
|
+
return head.subarray(0, bytesRead);
|
|
173657
|
+
} finally {
|
|
173658
|
+
await fh.close();
|
|
173659
|
+
}
|
|
173660
|
+
}
|
|
173661
|
+
function assetMimeForUpload(extensionMime, head) {
|
|
173662
|
+
const sniffed = sniffAssetMime(head);
|
|
173663
|
+
if (sniffed === null || sniffed === extensionMime) return extensionMime;
|
|
173664
|
+
const family = /* @__PURE__ */ __name((m) => m.split("/")[0], "family");
|
|
173665
|
+
return family(sniffed) === family(extensionMime) ? sniffed : extensionMime;
|
|
173666
|
+
}
|
|
173625
173667
|
async function collectProjectFiles(state3) {
|
|
173626
173668
|
const { baseDir, relDir, files, assets, refused: refused2, nestedReserved } = state3;
|
|
173627
173669
|
const entries = await readdir3(join10(baseDir, relDir), { withFileTypes: true });
|
|
@@ -173647,7 +173689,8 @@ async function collectProjectFiles(state3) {
|
|
|
173647
173689
|
refused2.push(filename);
|
|
173648
173690
|
continue;
|
|
173649
173691
|
}
|
|
173650
|
-
|
|
173692
|
+
const path2 = join10(baseDir, rel);
|
|
173693
|
+
assets.push({ filename, path: path2, mimetype: assetMimeForUpload(mimetype, await readHead2(path2)) });
|
|
173651
173694
|
continue;
|
|
173652
173695
|
}
|
|
173653
173696
|
const content = await readFile6(join10(baseDir, rel), "utf-8");
|
|
@@ -173816,7 +173859,7 @@ async function pushFromDir(opts) {
|
|
|
173816
173859
|
}
|
|
173817
173860
|
return Result458.Ok({ result, publicUrl });
|
|
173818
173861
|
}
|
|
173819
|
-
var ACCESS_FN_FILENAME, NO_ACCESS_FN_REFUSAL_PREFIX, CODE_EXTENSIONS, ALLOWED_EXTENSIONS, NESTED_UNSAFE_BASENAMES, NEW_PUBLIC_APP_NOTICE;
|
|
173862
|
+
var ACCESS_FN_FILENAME, NO_ACCESS_FN_REFUSAL_PREFIX, CODE_EXTENSIONS, ALLOWED_EXTENSIONS, NESTED_UNSAFE_BASENAMES, ASSET_HEAD_BYTES, NEW_PUBLIC_APP_NOTICE;
|
|
173820
173863
|
var init_push_from_dir = __esm({
|
|
173821
173864
|
"cli/cmds/push-from-dir.ts"() {
|
|
173822
173865
|
"use strict";
|
|
@@ -173835,6 +173878,9 @@ var init_push_from_dir = __esm({
|
|
|
173835
173878
|
ALLOWED_EXTENSIONS = /* @__PURE__ */ new Set([...CODE_EXTENSIONS, "css", "html", "json", "md", "txt", "svg"]);
|
|
173836
173879
|
NESTED_UNSAFE_BASENAMES = /* @__PURE__ */ new Set(["App.jsx", "App.tsx", "access.js", "seed.json"]);
|
|
173837
173880
|
__name(readProjectFiles, "readProjectFiles");
|
|
173881
|
+
ASSET_HEAD_BYTES = 16;
|
|
173882
|
+
__name(readHead2, "readHead");
|
|
173883
|
+
__name(assetMimeForUpload, "assetMimeForUpload");
|
|
173838
173884
|
__name(collectProjectFiles, "collectProjectFiles");
|
|
173839
173885
|
__name(formatPushError, "formatPushError");
|
|
173840
173886
|
__name(pushFromNotOwnedMessage, "pushFromNotOwnedMessage");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibes-diy",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.355",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"description": "Command-line tool for vibes.diy — generate, edit, pull, push, and publish AI-built apps",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@neondatabase/serverless": "~1.2.0",
|
|
42
42
|
"@noble/hashes": "~2.4.0",
|
|
43
43
|
"@shadcn/lint": "~0.2.3",
|
|
44
|
-
"@vibes.diy/api-impl": "14.3.
|
|
45
|
-
"@vibes.diy/api-types": "14.3.
|
|
46
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
47
|
-
"@vibes.diy/cmd-harness": "14.3.
|
|
48
|
-
"@vibes.diy/cmd-tools": "14.3.
|
|
49
|
-
"@vibes.diy/identity": "14.3.
|
|
50
|
-
"@vibes.diy/prompts": "14.3.
|
|
44
|
+
"@vibes.diy/api-impl": "14.3.355",
|
|
45
|
+
"@vibes.diy/api-types": "14.3.355",
|
|
46
|
+
"@vibes.diy/call-ai-v2": "14.3.355",
|
|
47
|
+
"@vibes.diy/cmd-harness": "14.3.355",
|
|
48
|
+
"@vibes.diy/cmd-tools": "14.3.355",
|
|
49
|
+
"@vibes.diy/identity": "14.3.355",
|
|
50
|
+
"@vibes.diy/prompts": "14.3.355",
|
|
51
51
|
"acorn": "~8.19.0",
|
|
52
52
|
"acorn-jsx": "~5.3.2",
|
|
53
53
|
"arktype": "~2.2.9",
|