vibes-diy 14.3.347 → 14.3.348
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.
|
@@ -355573,10 +355573,10 @@ var recordRef = {
|
|
|
355573
355573
|
};
|
|
355574
355574
|
var makePictureInput = lazyType(
|
|
355575
355575
|
() => type({
|
|
355576
|
-
prompt: "string
|
|
355576
|
+
"prompt?": "string",
|
|
355577
355577
|
"photo?": "number.integer >= 1",
|
|
355578
355578
|
"sourceRecord?": type({ ...recordRef, "fileKey?": "string" }).onUndeclaredKey("reject"),
|
|
355579
|
-
"vibe?": type(recordRef).onUndeclaredKey("reject")
|
|
355579
|
+
"vibe?": type({ ...recordRef, "photoKey?": "string > 0" }).onUndeclaredKey("reject")
|
|
355580
355580
|
}).onUndeclaredKey("reject")
|
|
355581
355581
|
);
|
|
355582
355582
|
function makePictureToolDefinition() {
|
|
@@ -355584,11 +355584,14 @@ function makePictureToolDefinition() {
|
|
|
355584
355584
|
type: "function",
|
|
355585
355585
|
function: {
|
|
355586
355586
|
name: AGENT_MAKE_PICTURE_TOOL_NAME,
|
|
355587
|
-
description: `Paint a picture and put it in this conversation: in a text thread it arrives as a photo, on the web it shows under your reply. Use it whenever the thing they asked for is a picture (their photo made into something, a card, a poster, a drawing), so the picture itself is the answer. \`prompt\` describes the picture in plain words. To start from a photo on this message, pass its position as \`photo\` (1 for the first). To start from a picture in a vibe's records, pass that record as \`sourceRecord\`. To also save it into
|
|
355587
|
+
description: `Paint a picture and put it in this conversation: in a text thread it arrives as a photo, on the web it shows under your reply. Use it whenever the thing they asked for is a picture (their photo made into something, a card, a poster, a drawing), so the picture itself is the answer. \`prompt\` describes the picture in plain words; leave it out when \`vibe\` names a record that carries its own \`prompt\` (an ImgGen app's record), and that record's prompt paints it, the way the app would. To start from a photo on this message, pass its position as \`photo\` (1 for the first). To start from a picture in a vibe's records, pass that record as \`sourceRecord\`. To also save it into a vibe, pass the record that shows it as \`vibe\` (its ownerHandle, appSlug, dbName and docId): it becomes that record's picture, the same one the app opens on. That vibe is one of this conversation's own, or one they linked or named whose rules let them add records (someone else's app works the way it would in their browser). When that app's records also keep the photo they started from (an \`original\` in its _files), put_doc the record first with the app's own fields, then pass \`photo\` and \`vibe.photoKey\` set to that _files key, so the photo is saved on the record too. Without \`vibe\` it is a picture in the chat with no app. It takes 10 to 30 seconds and costs credits like an image in an app; at most ${AGENT_MADE_PICTURES_PER_TURN} a turn. The picture goes out where the call is, so write your words around it as usual.`,
|
|
355588
355588
|
parameters: {
|
|
355589
355589
|
type: "object",
|
|
355590
355590
|
properties: {
|
|
355591
|
-
prompt: {
|
|
355591
|
+
prompt: {
|
|
355592
|
+
type: "string",
|
|
355593
|
+
description: "What the picture shows, in plain words. Optional when `vibe` names a record with its own prompt."
|
|
355594
|
+
},
|
|
355592
355595
|
photo: { type: "number", description: "Start from the photo at this position on this message (1 for the first)." },
|
|
355593
355596
|
sourceRecord: {
|
|
355594
355597
|
type: "object",
|
|
@@ -355605,18 +355608,21 @@ function makePictureToolDefinition() {
|
|
|
355605
355608
|
},
|
|
355606
355609
|
vibe: {
|
|
355607
355610
|
type: "object",
|
|
355608
|
-
description: "Also save it as this record's picture, in
|
|
355611
|
+
description: "Also save it as this record's picture, in a vibe this conversation may add records to (its own, or one they linked).",
|
|
355609
355612
|
properties: {
|
|
355610
355613
|
ownerHandle: { type: "string" },
|
|
355611
355614
|
appSlug: { type: "string" },
|
|
355612
355615
|
dbName: { type: "string" },
|
|
355613
|
-
docId: { type: "string" }
|
|
355616
|
+
docId: { type: "string" },
|
|
355617
|
+
photoKey: {
|
|
355618
|
+
type: "string",
|
|
355619
|
+
description: "With `photo`: also save that photo on the record under this _files key (the key the app keeps its starting photo under, such as original). The record must already exist."
|
|
355620
|
+
}
|
|
355614
355621
|
},
|
|
355615
355622
|
required: ["ownerHandle", "appSlug", "dbName", "docId"],
|
|
355616
355623
|
additionalProperties: false
|
|
355617
355624
|
}
|
|
355618
355625
|
},
|
|
355619
|
-
required: ["prompt"],
|
|
355620
355626
|
additionalProperties: false
|
|
355621
355627
|
}
|
|
355622
355628
|
}
|
|
@@ -355633,8 +355639,11 @@ function checkMakePictureArgs(raw) {
|
|
|
355633
355639
|
if (parsed3.photo !== void 0 && parsed3.sourceRecord !== void 0) {
|
|
355634
355640
|
return refusal("invalid-input", "Start from a photo or from a record, not both.");
|
|
355635
355641
|
}
|
|
355636
|
-
|
|
355637
|
-
|
|
355642
|
+
if (parsed3.vibe?.photoKey !== void 0 && parsed3.photo === void 0) {
|
|
355643
|
+
return refusal("invalid-input", "`vibe.photoKey` saves the photo on this message, so pass `photo` with it.");
|
|
355644
|
+
}
|
|
355645
|
+
const prompt = (parsed3.prompt ?? "").trim().slice(0, MAKE_PICTURE_PROMPT_MAX);
|
|
355646
|
+
if (prompt === "" && parsed3.vibe === void 0) return refusal("invalid-input", "Say what the picture shows.");
|
|
355638
355647
|
return { ok: true, args: { ...parsed3, prompt } };
|
|
355639
355648
|
}
|
|
355640
355649
|
__name(checkMakePictureArgs, "checkMakePictureArgs");
|
|
@@ -355744,7 +355753,7 @@ async function modelFor(vctx, space) {
|
|
|
355744
355753
|
if (id.startsWith("prodia/") && (space.editing || vctx.prodiaToken === void 0 || vctx.prodiaToken === "")) {
|
|
355745
355754
|
return { model: RENDER_MODEL };
|
|
355746
355755
|
}
|
|
355747
|
-
const apiKey = !id.startsWith("prodia/") && param2.apiKey !== void 0 && param2.apiKey !== "" ? param2.apiKey : void 0;
|
|
355756
|
+
const apiKey = space.ownKey && !id.startsWith("prodia/") && param2.apiKey !== void 0 && param2.apiKey !== "" ? param2.apiKey : void 0;
|
|
355748
355757
|
return apiKey === void 0 ? { model: id } : { model: id, apiKey };
|
|
355749
355758
|
}
|
|
355750
355759
|
__name(modelFor, "modelFor");
|
|
@@ -355803,25 +355812,104 @@ async function paint(vctx, args3) {
|
|
|
355803
355812
|
return Result.Ok({ bytes: rImage.Ok().bytes, mimeType: rImage.Ok().mimeType, model: args3.model, costCents });
|
|
355804
355813
|
}
|
|
355805
355814
|
__name(paint, "paint");
|
|
355815
|
+
async function keepPhotoOnRecord(vctx, mctx, o4) {
|
|
355816
|
+
const caller = {
|
|
355817
|
+
userId: mctx.actor.userId,
|
|
355818
|
+
ownerHandle: o4.vibe.ownerHandle,
|
|
355819
|
+
appSlug: o4.vibe.appSlug,
|
|
355820
|
+
dbName: o4.vibe.dbName,
|
|
355821
|
+
adminMode: false,
|
|
355822
|
+
actingHandle: mctx.actor.ownerHandle
|
|
355823
|
+
};
|
|
355824
|
+
const rDoc = await exception2Result(() => getDocForCaller(vctx, { ...caller, docId: o4.vibe.docId }));
|
|
355825
|
+
if (rDoc.isErr()) return Result.Err("That record could not be read just now. Try once more.");
|
|
355826
|
+
const got = rDoc.Ok();
|
|
355827
|
+
if (got.kind === "denied") return Result.Err("This conversation can't open that record.");
|
|
355828
|
+
if (got.kind === "not-found") {
|
|
355829
|
+
return Result.Err("No such record yet: put_doc it first with the app's own fields, then call make_picture again.");
|
|
355830
|
+
}
|
|
355831
|
+
const t3 = vctx.sql.tables.assetUploads;
|
|
355832
|
+
const row = await vctx.sql.db.select({ assetURI: t3.assetURI, mimeType: t3.mimeType }).from(t3).where(and(eq(t3.uploadId, o4.uploadId), eq(t3.ownerHandle, mctx.actor.ownerHandle), eq(t3.appSlug, AGENT_CHAT_APP_SLUG))).limit(1).then((r2) => r2[0]);
|
|
355833
|
+
if (row === void 0) return Result.Err("That photo could not be read just now.");
|
|
355834
|
+
const rBytes = await exception2Result(async () => {
|
|
355835
|
+
const fetched = await vctx.storage.fetch(row.assetURI);
|
|
355836
|
+
if (!isFetchOkResult(fetched)) throw new Error(`asset fetch failed: ${row.assetURI}`);
|
|
355837
|
+
return stream2uint8array(fetched.data);
|
|
355838
|
+
});
|
|
355839
|
+
if (rBytes.isErr()) return Result.Err("That photo could not be read just now.");
|
|
355840
|
+
const mimeType = row.mimeType ?? "image/jpeg";
|
|
355841
|
+
const rStored = await storeAndAuditAsset(vctx, {
|
|
355842
|
+
bytes: rBytes.Ok(),
|
|
355843
|
+
userId: mctx.actor.userId,
|
|
355844
|
+
ownerHandle: o4.vibe.ownerHandle,
|
|
355845
|
+
appSlug: o4.vibe.appSlug,
|
|
355846
|
+
mimeType
|
|
355847
|
+
});
|
|
355848
|
+
if (rStored.isErr()) {
|
|
355849
|
+
vctx.logger.Warn().Err(rStored).Str("chatId", mctx.chatId).Msg("make_picture: photo copy failed");
|
|
355850
|
+
return Result.Err("The photo could not be saved on that record just now. Try once more.");
|
|
355851
|
+
}
|
|
355852
|
+
const stored = rStored.Ok();
|
|
355853
|
+
const files = got.doc._files;
|
|
355854
|
+
const meta3 = {
|
|
355855
|
+
uploadId: stored.uploadId,
|
|
355856
|
+
type: stored.mimeType ?? mimeType,
|
|
355857
|
+
size: stored.size,
|
|
355858
|
+
lastModified: Date.now()
|
|
355859
|
+
};
|
|
355860
|
+
const doc = {
|
|
355861
|
+
...got.doc,
|
|
355862
|
+
_files: { ...files !== null && typeof files === "object" ? files : {}, [o4.photoKey]: meta3 }
|
|
355863
|
+
};
|
|
355864
|
+
const rPut = await exception2Result(
|
|
355865
|
+
() => putDocForCaller(vctx, { ...caller, docId: got.docId, doc, fanOutDocChanged: remoteDocChangedFanOut })
|
|
355866
|
+
);
|
|
355867
|
+
if (rPut.isErr()) return Result.Err("The photo could not be saved on that record just now. Try once more.");
|
|
355868
|
+
const put2 = rPut.Ok();
|
|
355869
|
+
if (put2.kind === "denied") return Result.Err(`That app's rules didn't take the photo on that record: ${put2.message}`);
|
|
355870
|
+
return Result.Ok(stored.uploadId);
|
|
355871
|
+
}
|
|
355872
|
+
__name(keepPhotoOnRecord, "keepPhotoOnRecord");
|
|
355806
355873
|
async function makePicture(vctx, mctx, args3) {
|
|
355807
|
-
|
|
355874
|
+
let prompt = args3.prompt;
|
|
355808
355875
|
const vibe2 = args3.vibe === void 0 ? void 0 : {
|
|
355809
355876
|
ownerHandle: normalHandle(args3.vibe.ownerHandle),
|
|
355810
355877
|
appSlug: args3.vibe.appSlug.trim().toLowerCase(),
|
|
355811
355878
|
dbName: args3.vibe.dbName,
|
|
355812
355879
|
docId: args3.vibe.docId
|
|
355813
355880
|
};
|
|
355814
|
-
if (vibe2 !== void 0 &&
|
|
355815
|
-
return refusal(
|
|
355816
|
-
|
|
355817
|
-
|
|
355881
|
+
if (vibe2 !== void 0 && vibe2.appSlug === AGENT_CHAT_APP_SLUG) {
|
|
355882
|
+
return refusal("not-yours", "A conversation's own space is not a vibe. Leave out `vibe` to put the picture in the chat.");
|
|
355883
|
+
}
|
|
355884
|
+
if (prompt === "" && vibe2 !== void 0) {
|
|
355885
|
+
const rRecord = await exception2Result(
|
|
355886
|
+
() => getDocForCaller(vctx, {
|
|
355887
|
+
userId: mctx.actor.userId,
|
|
355888
|
+
ownerHandle: vibe2.ownerHandle,
|
|
355889
|
+
appSlug: vibe2.appSlug,
|
|
355890
|
+
dbName: vibe2.dbName,
|
|
355891
|
+
docId: vibe2.docId,
|
|
355892
|
+
adminMode: false,
|
|
355893
|
+
actingHandle: mctx.actor.ownerHandle
|
|
355894
|
+
})
|
|
355818
355895
|
);
|
|
355896
|
+
const record2 = rRecord.isOk() && rRecord.Ok().kind === "ok" ? rRecord.Ok().doc : void 0;
|
|
355897
|
+
const own2 = typeof record2?.prompt === "string" ? record2.prompt.trim().slice(0, MAKE_PICTURE_PROMPT_MAX) : "";
|
|
355898
|
+
if (own2 === "") {
|
|
355899
|
+
return refusal("invalid-input", "That record has no prompt of its own; say what the picture shows in `prompt`.");
|
|
355900
|
+
}
|
|
355901
|
+
prompt = own2;
|
|
355819
355902
|
}
|
|
355903
|
+
const ownsVibe = vibe2 !== void 0 && await ownsHandle2(vctx, { userId: mctx.actor.userId, handle: vibe2.ownerHandle });
|
|
355820
355904
|
const space = vibe2 ?? { ownerHandle: mctx.actor.ownerHandle, appSlug: AGENT_CHAT_APP_SLUG };
|
|
355821
355905
|
const rInput = await inputPicture(vctx, mctx, args3);
|
|
355822
355906
|
if (rInput.isErr()) return refusal("no-input", rInput.Err().message);
|
|
355823
355907
|
const start2 = rInput.Ok();
|
|
355824
|
-
const { model, apiKey } = await modelFor(vctx, {
|
|
355908
|
+
const { model, apiKey } = await modelFor(vctx, {
|
|
355909
|
+
...space,
|
|
355910
|
+
editing: start2 !== void 0,
|
|
355911
|
+
ownKey: vibe2 === void 0 || ownsVibe
|
|
355912
|
+
});
|
|
355825
355913
|
const byok = apiKey !== void 0;
|
|
355826
355914
|
let payerUserId;
|
|
355827
355915
|
const rCheck = byok ? void 0 : await vctx.billing.checkCredits({ userId: mctx.actor.userId });
|
|
@@ -355852,6 +355940,16 @@ async function makePicture(vctx, mctx, args3) {
|
|
|
355852
355940
|
return refusal("denied", authz.reason ?? "That vibe's rules don't let this picture be saved there.");
|
|
355853
355941
|
}
|
|
355854
355942
|
}
|
|
355943
|
+
let keptPhotoKey;
|
|
355944
|
+
if (vibe2 !== void 0 && args3.vibe?.photoKey !== void 0 && args3.photo !== void 0) {
|
|
355945
|
+
const rKept = await keepPhotoOnRecord(vctx, mctx, {
|
|
355946
|
+
vibe: vibe2,
|
|
355947
|
+
photoKey: args3.vibe.photoKey,
|
|
355948
|
+
uploadId: mctx.inputPhotos[args3.photo - 1] ?? ""
|
|
355949
|
+
});
|
|
355950
|
+
if (rKept.isErr()) return refusal("denied", rKept.Err().message);
|
|
355951
|
+
keptPhotoKey = rKept.Ok();
|
|
355952
|
+
}
|
|
355855
355953
|
const rPaint = await paint(vctx, {
|
|
355856
355954
|
model,
|
|
355857
355955
|
...apiKey === void 0 ? {} : { apiKey },
|
|
@@ -355930,7 +356028,7 @@ async function makePicture(vctx, mctx, args3) {
|
|
|
355930
356028
|
dbName: vibe2.dbName,
|
|
355931
356029
|
docId: vibe2.docId,
|
|
355932
356030
|
regen: true,
|
|
355933
|
-
...start2 === void 0 ? {} : { sourceKey: start2.sourceKey }
|
|
356031
|
+
...keptPhotoKey !== void 0 ? { sourceKey: keptPhotoKey } : start2 === void 0 ? {} : { sourceKey: start2.sourceKey }
|
|
355934
356032
|
},
|
|
355935
356033
|
fileMeta: { uploadId: stored.uploadId, mimeType, size: stored.size },
|
|
355936
356034
|
promptText: prompt,
|
|
@@ -355938,6 +356036,7 @@ async function makePicture(vctx, mctx, args3) {
|
|
|
355938
356036
|
});
|
|
355939
356037
|
const version5 = written === false ? void 0 : await writtenVersion(vctx, { ...vibe2, uploadId: stored.uploadId });
|
|
355940
356038
|
if (version5 !== void 0) {
|
|
356039
|
+
await meter();
|
|
355941
356040
|
const mediaDb = mediaDbName(vibe2.dbName);
|
|
355942
356041
|
return {
|
|
355943
356042
|
ok: true,
|
|
@@ -364952,7 +365051,8 @@ function decideSeededPosturePromotion(input3) {
|
|
|
364952
365051
|
if (input3.publishStatedEnvelopeIntent) return { promote: false, reason: "publish-stated-intent" };
|
|
364953
365052
|
if (input3.posture !== "private") return { promote: false, reason: "posture-not-private" };
|
|
364954
365053
|
if (input3.postureSeeded !== true) return { promote: false, reason: "posture-not-seeded" };
|
|
364955
|
-
if (input3.privacySensitive === true
|
|
365054
|
+
if (input3.privacySensitive === true && input3.ownerIsChatPrincipal !== true)
|
|
365055
|
+
return { promote: false, reason: "privacy-sensitive" };
|
|
364956
365056
|
if (input3.accessRulesBound !== true) return { promote: false, reason: "access-rules-not-bound" };
|
|
364957
365057
|
return { promote: true, reason: "promote" };
|
|
364958
365058
|
}
|
|
@@ -364998,7 +365098,8 @@ async function maybePromoteSeededPosture(vctx, args3) {
|
|
|
364998
365098
|
posture: entry2.posture,
|
|
364999
365099
|
postureSeeded: entry2.postureSeeded,
|
|
365000
365100
|
privacySensitive: entry2.settings.privacySensitive,
|
|
365001
|
-
publishStatedEnvelopeIntent: args3.publishStatedEnvelopeIntent
|
|
365101
|
+
publishStatedEnvelopeIntent: args3.publishStatedEnvelopeIntent,
|
|
365102
|
+
ownerIsChatPrincipal: isGroupPrincipal(args3.ownerUserId)
|
|
365002
365103
|
};
|
|
365003
365104
|
}, "readFacts");
|
|
365004
365105
|
const facts = await readFacts();
|
|
@@ -377041,7 +377142,7 @@ DONE MEANS THEY HAVE IT. Before your first tool call, name what the person will
|
|
|
377041
377142
|
A TEXT CONVERSATION. This conversation is a text thread. The person may be reading it in Messages on their phone or on the web, and both show the same messages, so write every reply the way a friend texts. Each stretch of words you write before a tool call goes out as its own text the moment that call starts, and the words after your last call are the next text.
|
|
377042
377143
|
- Say it, then do it. When a turn starts a build, its first words come before its first tool call: one line, a sentence or two, naming what is on the way, in the person's terms, such as "On it: a 3D racer with drift and a lap timer." or "On it: your own copy of Cabin Weekend, a cost splitter." Then any lookups run silently; a list, a search or a read gets no line of its own.
|
|
377043
377144
|
- One message, sometimes in two texts. Messages often sends a link as its own text, a moment after the words that go with it, so a message that ends mid-sentence ("text me when new events are about to start on") and a bare link are one ask: read them together and answer it once. A vibe link on its own is never a dead end: the link names the vibe, so read it with check_vibe_access, or with with_vibe when it is the person's own, and carry on with what they asked.
|
|
377044
|
-
- Pictures travel both ways. A photo the person sends is in front of you. A picture they ask for (their photo as an alien pilot, a card for Sam) is yours to paint with make_picture, as your first call, in the turn the photo arrives: \`photo\` reaches only photos on the message you are answering. A picture is two texts with the picture between them, and each says what the other did not. The line before the call names your guess in a few words, about eight, the way a friend says it is on the way: "Muppet you, coming up." They sent the photo and the picture will show it, so that line keeps to the idea and leaves the hat, the glasses and the jacket to the picture. The picture lands where you call it. The line after the call is one short sentence that adds something the first line did not say, a detail worth a grin or the next go, in your own fresh words: "Felt eyebrows and all." They are looking at the picture by the time that line arrives, so it reads as a caption under it and opens on the detail itself, the way a friend reacts under a photo they just sent. In a group that line ends by handing one other member the next go by name: "Felt eyebrows and all. Sam, you next?" A question to everyone ("Who's next?") hands it to nobody, so name one of the others. When the ask carries on from a picture you just sent ("and then put me on a movie poster"), it is the same favour still going: paint first, with no line before the call, and one line after. Paint once per ask. When they will want more, start the app that makes them after the paint, and its Done text is "Here's the app if you want more: <link>". One to one, a hero of them (their selfie or their words as a superhero) always brings its app, because that app is how they share their hero with friends: the picture goes out first, and after the paint, start the app that holds it, a page showing that picture with a button to make a friend's hero, with the picture's link in the brief. Its Done text offers it as theirs to share whenever they like, opening with "Here's your hero's app if you want to share it: <link>" in place of "Done:". A photo that never reached you ("did you get my pic?") gets one cheerful line asking them to send it again with whatever they would like made of it, and a superhero is one idea among many (a movie poster, a party invite, a game): name a few, so the choice reads as theirs. A picture saved in a vibe (a greeting card an image button painted, a photo someone added) goes into the chat with send_picture, where it arrives as a photo. Asked to post, send or show one, find its record with with_vibe's query_docs and send it, with a line around it as usual.
|
|
377145
|
+
- Pictures travel both ways. A photo the person sends is in front of you. A picture they ask for (their photo as an alien pilot, a card for Sam) is yours to paint with make_picture, as your first call, in the turn the photo arrives: \`photo\` reaches only photos on the message you are answering. A picture is two texts with the picture between them, and each says what the other did not. The line before the call names your guess in a few words, about eight, the way a friend says it is on the way: "Muppet you, coming up." They sent the photo and the picture will show it, so that line keeps to the idea and leaves the hat, the glasses and the jacket to the picture. The picture lands where you call it. The line after the call is one short sentence that adds something the first line did not say, a detail worth a grin or the next go, in your own fresh words: "Felt eyebrows and all." They are looking at the picture by the time that line arrives, so it reads as a caption under it and opens on the detail itself, the way a friend reacts under a photo they just sent. In a group that line ends by handing one other member the next go by name: "Felt eyebrows and all. Sam, you next?" A question to everyone ("Who's next?") hands it to nobody, so name one of the others. When the ask carries on from a picture you just sent ("and then put me on a movie poster"), it is the same favour still going: paint first, with no line before the call, and one line after. Paint once per ask. When they will want more, start the app that makes them after the paint, and its Done text is "Here's the app if you want more: <link>". One to one, a hero of them (their selfie or their words as a superhero) always brings its app, because that app is how they share their hero with friends: the picture goes out first, and after the paint, start the app that holds it, a page showing that picture with a button to make a friend's hero, with the picture's link in the brief. Its Done text offers it as theirs to share whenever they like, opening with "Here's your hero's app if you want to share it: <link>" in place of "Done:". A photo that never reached you ("did you get my pic?") gets one cheerful line asking them to send it again with whatever they would like made of it, and a superhero is one idea among many (a movie poster, a party invite, a game): name a few, so the choice reads as theirs. When they send a photo with a vibe's link or name ("use this to make me vintage" and someone's portrait app), the picture belongs in that vibe, theirs or someone else's: read a record or two there with with_vibe query_docs to learn its shape, save their new record in that shape with put_doc (written as them, its authorHandle their handle), then call make_picture with photo, the scene and \`vibe\` naming that record, with \`vibe.photoKey\` set to the _files key its records keep their starting photo under (such as original). When its records carry their own prompt (an image app's record), that record is the vibe's own tool: set its prompt the way the app does, and leave \`prompt\` out of make_picture so the record's prompt paints it. The picture still lands in the chat where you call it, and the line after it ends with that vibe's link, where it is saved too. That vibe then stays this chat's picture app: write it down with remember (which vibe, its database, the record shape and its photo key), and every later photo in the chat that asks for a picture goes into it the same way, with no link needed, until someone names another vibe or says to stop using it, which you also write down. A picture saved in a vibe (a greeting card an image button painted, a photo someone added) goes into the chat with send_picture, where it arrives as a photo. Asked to post, send or show one, find its record with with_vibe's query_docs and send it, with a line around it as usual.
|
|
377045
377146
|
- Plain text, in short messages. Whole sentences in short paragraphs, each link written out in full from https://, no headings and no markup. A bit's wink is the one pair of stars a text carries. A reply that still runs long folds as the general instruction says, its summary above a line holding only ${AGENT_FOLD_MARKER}, and that summary is the text the phone receives.
|
|
377046
377147
|
- Their words, not the machinery. Say what happened for them, in their terms. When a step is out of your reach, say the next thing that happens and who does it, like a friend who knows the place: "Tap it; if it's private, you'll see Ask to join." Asked who they are talking to, the whole answer is one sentence like "I'm Vibes, I make and run apps for you. What's on your plate?" This replaces the general instruction's line about models, which comes up only when they ask which model.
|
|
377047
377148
|
|
|
@@ -377059,7 +377160,7 @@ Your tools in this conversation:
|
|
|
377059
377160
|
- list_vibes \u2014 the person's vibes across every handle they hold: handle, address (appSlug), title, last update, and whether it is published. Call it when the person refers to their apps, before naming one, and before a change that spans several vibes.
|
|
377060
377161
|
- check_vibe_access \u2014 who can open any vibe, yours or not, from its ownerHandle and appSlug: whether it is published, its posture, how a visitor joins, and a plain whoCanOpen sentence. Call it before you tell anyone who can open a link.
|
|
377061
377162
|
- send_picture \u2014 put a picture from a vibe's records into this conversation, named by ownerHandle, appSlug, dbName and docId; it arrives as a photo in a text thread. Name an image button's record itself and its picture is found.
|
|
377062
|
-
- make_picture \u2014 paint one picture from \`prompt\` into this conversation, where you call it. \`photo\` starts from a photo on the message you are answering, by position from 1; \`sourceRecord\` from the picture in a record; \`vibe\` also saves it on a record you have read, in a vibe the person owns. Billed like a picture painted in an app; ten to thirty seconds; two a turn at most.
|
|
377163
|
+
- make_picture \u2014 paint one picture from \`prompt\` into this conversation, where you call it. \`photo\` starts from a photo on the message you are answering, by position from 1; \`sourceRecord\` from the picture in a record; \`vibe\` also saves it on a record you have read, in a vibe the person owns or one they linked that lets them add records; \`vibe.photoKey\` also saves the photo on that record, for an app whose records keep the photo they start from. Billed like a picture painted in an app; ten to thirty seconds; two a turn at most.
|
|
377063
377164
|
- list_memberships \u2014 the vibes other people own that the person was let into, with their role there (viewer, submitter or editor). Call it when the person mentions a vibe they use but did not make.
|
|
377064
377165
|
- vibe_activity \u2014 who uses the person's vibes besides them, in one answer across every vibe under every handle: for each vibe, how many other signed-in people saved records in it (otherWriters), the busiest of them by handle, approved members, and access requests waiting for an answer, busiest vibe first. Any question about who uses, shares, joins or visits their vibes starts here, and the answer covers the whole account, so name the vibes it ranks rather than opening them one by one. It counts people who saved something (a reader leaves no record), so any count you give is "people who saved something", and only when they ask how many.
|
|
377065
377166
|
- create_vibe \u2014 start a brand-new vibe under the handle this conversation acts as. Every call makes a new app with its own address.
|
|
@@ -26902,7 +26902,6 @@ var init_version_timeline = __esm({
|
|
|
26902
26902
|
var POUF_ENTRY_EXPORTS, POUF_TAUGHT_NAMES;
|
|
26903
26903
|
var init_exports = __esm({
|
|
26904
26904
|
"../vibes.diy/pouf/exports.ts"() {
|
|
26905
|
-
"use strict";
|
|
26906
26905
|
POUF_ENTRY_EXPORTS = {
|
|
26907
26906
|
index: [
|
|
26908
26907
|
"AlertBell",
|
|
@@ -105875,11 +105874,14 @@ function makePictureToolDefinition() {
|
|
|
105875
105874
|
type: "function",
|
|
105876
105875
|
function: {
|
|
105877
105876
|
name: AGENT_MAKE_PICTURE_TOOL_NAME,
|
|
105878
|
-
description: `Paint a picture and put it in this conversation: in a text thread it arrives as a photo, on the web it shows under your reply. Use it whenever the thing they asked for is a picture (their photo made into something, a card, a poster, a drawing), so the picture itself is the answer. \`prompt\` describes the picture in plain words. To start from a photo on this message, pass its position as \`photo\` (1 for the first). To start from a picture in a vibe's records, pass that record as \`sourceRecord\`. To also save it into
|
|
105877
|
+
description: `Paint a picture and put it in this conversation: in a text thread it arrives as a photo, on the web it shows under your reply. Use it whenever the thing they asked for is a picture (their photo made into something, a card, a poster, a drawing), so the picture itself is the answer. \`prompt\` describes the picture in plain words; leave it out when \`vibe\` names a record that carries its own \`prompt\` (an ImgGen app's record), and that record's prompt paints it, the way the app would. To start from a photo on this message, pass its position as \`photo\` (1 for the first). To start from a picture in a vibe's records, pass that record as \`sourceRecord\`. To also save it into a vibe, pass the record that shows it as \`vibe\` (its ownerHandle, appSlug, dbName and docId): it becomes that record's picture, the same one the app opens on. That vibe is one of this conversation's own, or one they linked or named whose rules let them add records (someone else's app works the way it would in their browser). When that app's records also keep the photo they started from (an \`original\` in its _files), put_doc the record first with the app's own fields, then pass \`photo\` and \`vibe.photoKey\` set to that _files key, so the photo is saved on the record too. Without \`vibe\` it is a picture in the chat with no app. It takes 10 to 30 seconds and costs credits like an image in an app; at most ${AGENT_MADE_PICTURES_PER_TURN} a turn. The picture goes out where the call is, so write your words around it as usual.`,
|
|
105879
105878
|
parameters: {
|
|
105880
105879
|
type: "object",
|
|
105881
105880
|
properties: {
|
|
105882
|
-
prompt: {
|
|
105881
|
+
prompt: {
|
|
105882
|
+
type: "string",
|
|
105883
|
+
description: "What the picture shows, in plain words. Optional when `vibe` names a record with its own prompt."
|
|
105884
|
+
},
|
|
105883
105885
|
photo: { type: "number", description: "Start from the photo at this position on this message (1 for the first)." },
|
|
105884
105886
|
sourceRecord: {
|
|
105885
105887
|
type: "object",
|
|
@@ -105896,18 +105898,21 @@ function makePictureToolDefinition() {
|
|
|
105896
105898
|
},
|
|
105897
105899
|
vibe: {
|
|
105898
105900
|
type: "object",
|
|
105899
|
-
description: "Also save it as this record's picture, in
|
|
105901
|
+
description: "Also save it as this record's picture, in a vibe this conversation may add records to (its own, or one they linked).",
|
|
105900
105902
|
properties: {
|
|
105901
105903
|
ownerHandle: { type: "string" },
|
|
105902
105904
|
appSlug: { type: "string" },
|
|
105903
105905
|
dbName: { type: "string" },
|
|
105904
|
-
docId: { type: "string" }
|
|
105906
|
+
docId: { type: "string" },
|
|
105907
|
+
photoKey: {
|
|
105908
|
+
type: "string",
|
|
105909
|
+
description: "With `photo`: also save that photo on the record under this _files key (the key the app keeps its starting photo under, such as original). The record must already exist."
|
|
105910
|
+
}
|
|
105905
105911
|
},
|
|
105906
105912
|
required: ["ownerHandle", "appSlug", "dbName", "docId"],
|
|
105907
105913
|
additionalProperties: false
|
|
105908
105914
|
}
|
|
105909
105915
|
},
|
|
105910
|
-
required: ["prompt"],
|
|
105911
105916
|
additionalProperties: false
|
|
105912
105917
|
}
|
|
105913
105918
|
}
|
|
@@ -105922,8 +105927,11 @@ function checkMakePictureArgs(raw) {
|
|
|
105922
105927
|
if (parsed.photo !== void 0 && parsed.sourceRecord !== void 0) {
|
|
105923
105928
|
return refusal("invalid-input", "Start from a photo or from a record, not both.");
|
|
105924
105929
|
}
|
|
105925
|
-
|
|
105926
|
-
|
|
105930
|
+
if (parsed.vibe?.photoKey !== void 0 && parsed.photo === void 0) {
|
|
105931
|
+
return refusal("invalid-input", "`vibe.photoKey` saves the photo on this message, so pass `photo` with it.");
|
|
105932
|
+
}
|
|
105933
|
+
const prompt = (parsed.prompt ?? "").trim().slice(0, MAKE_PICTURE_PROMPT_MAX);
|
|
105934
|
+
if (prompt === "" && parsed.vibe === void 0) return refusal("invalid-input", "Say what the picture shows.");
|
|
105927
105935
|
return { ok: true, args: { ...parsed, prompt } };
|
|
105928
105936
|
}
|
|
105929
105937
|
function normalHandle(h) {
|
|
@@ -106026,7 +106034,7 @@ async function modelFor(vctx, space) {
|
|
|
106026
106034
|
if (id.startsWith("prodia/") && (space.editing || vctx.prodiaToken === void 0 || vctx.prodiaToken === "")) {
|
|
106027
106035
|
return { model: RENDER_MODEL };
|
|
106028
106036
|
}
|
|
106029
|
-
const apiKey = !id.startsWith("prodia/") && param4.apiKey !== void 0 && param4.apiKey !== "" ? param4.apiKey : void 0;
|
|
106037
|
+
const apiKey = space.ownKey && !id.startsWith("prodia/") && param4.apiKey !== void 0 && param4.apiKey !== "" ? param4.apiKey : void 0;
|
|
106030
106038
|
return apiKey === void 0 ? { model: id } : { model: id, apiKey };
|
|
106031
106039
|
}
|
|
106032
106040
|
async function paint(vctx, args) {
|
|
@@ -106083,25 +106091,103 @@ async function paint(vctx, args) {
|
|
|
106083
106091
|
});
|
|
106084
106092
|
return Result143.Ok({ bytes: rImage.Ok().bytes, mimeType: rImage.Ok().mimeType, model: args.model, costCents });
|
|
106085
106093
|
}
|
|
106094
|
+
async function keepPhotoOnRecord(vctx, mctx, o) {
|
|
106095
|
+
const caller = {
|
|
106096
|
+
userId: mctx.actor.userId,
|
|
106097
|
+
ownerHandle: o.vibe.ownerHandle,
|
|
106098
|
+
appSlug: o.vibe.appSlug,
|
|
106099
|
+
dbName: o.vibe.dbName,
|
|
106100
|
+
adminMode: false,
|
|
106101
|
+
actingHandle: mctx.actor.ownerHandle
|
|
106102
|
+
};
|
|
106103
|
+
const rDoc = await exception2Result203(() => getDocForCaller(vctx, { ...caller, docId: o.vibe.docId }));
|
|
106104
|
+
if (rDoc.isErr()) return Result143.Err("That record could not be read just now. Try once more.");
|
|
106105
|
+
const got = rDoc.Ok();
|
|
106106
|
+
if (got.kind === "denied") return Result143.Err("This conversation can't open that record.");
|
|
106107
|
+
if (got.kind === "not-found") {
|
|
106108
|
+
return Result143.Err("No such record yet: put_doc it first with the app's own fields, then call make_picture again.");
|
|
106109
|
+
}
|
|
106110
|
+
const t = vctx.sql.tables.assetUploads;
|
|
106111
|
+
const row = await vctx.sql.db.select({ assetURI: t.assetURI, mimeType: t.mimeType }).from(t).where(and109(eq129(t.uploadId, o.uploadId), eq129(t.ownerHandle, mctx.actor.ownerHandle), eq129(t.appSlug, AGENT_CHAT_APP_SLUG))).limit(1).then((r) => r[0]);
|
|
106112
|
+
if (row === void 0) return Result143.Err("That photo could not be read just now.");
|
|
106113
|
+
const rBytes = await exception2Result203(async () => {
|
|
106114
|
+
const fetched = await vctx.storage.fetch(row.assetURI);
|
|
106115
|
+
if (!isFetchOkResult(fetched)) throw new Error(`asset fetch failed: ${row.assetURI}`);
|
|
106116
|
+
return stream2uint8array9(fetched.data);
|
|
106117
|
+
});
|
|
106118
|
+
if (rBytes.isErr()) return Result143.Err("That photo could not be read just now.");
|
|
106119
|
+
const mimeType = row.mimeType ?? "image/jpeg";
|
|
106120
|
+
const rStored = await storeAndAuditAsset(vctx, {
|
|
106121
|
+
bytes: rBytes.Ok(),
|
|
106122
|
+
userId: mctx.actor.userId,
|
|
106123
|
+
ownerHandle: o.vibe.ownerHandle,
|
|
106124
|
+
appSlug: o.vibe.appSlug,
|
|
106125
|
+
mimeType
|
|
106126
|
+
});
|
|
106127
|
+
if (rStored.isErr()) {
|
|
106128
|
+
vctx.logger.Warn().Err(rStored).Str("chatId", mctx.chatId).Msg("make_picture: photo copy failed");
|
|
106129
|
+
return Result143.Err("The photo could not be saved on that record just now. Try once more.");
|
|
106130
|
+
}
|
|
106131
|
+
const stored = rStored.Ok();
|
|
106132
|
+
const files = got.doc._files;
|
|
106133
|
+
const meta = {
|
|
106134
|
+
uploadId: stored.uploadId,
|
|
106135
|
+
type: stored.mimeType ?? mimeType,
|
|
106136
|
+
size: stored.size,
|
|
106137
|
+
lastModified: Date.now()
|
|
106138
|
+
};
|
|
106139
|
+
const doc = {
|
|
106140
|
+
...got.doc,
|
|
106141
|
+
_files: { ...files !== null && typeof files === "object" ? files : {}, [o.photoKey]: meta }
|
|
106142
|
+
};
|
|
106143
|
+
const rPut = await exception2Result203(
|
|
106144
|
+
() => putDocForCaller(vctx, { ...caller, docId: got.docId, doc, fanOutDocChanged: remoteDocChangedFanOut })
|
|
106145
|
+
);
|
|
106146
|
+
if (rPut.isErr()) return Result143.Err("The photo could not be saved on that record just now. Try once more.");
|
|
106147
|
+
const put = rPut.Ok();
|
|
106148
|
+
if (put.kind === "denied") return Result143.Err(`That app's rules didn't take the photo on that record: ${put.message}`);
|
|
106149
|
+
return Result143.Ok(stored.uploadId);
|
|
106150
|
+
}
|
|
106086
106151
|
async function makePicture(vctx, mctx, args) {
|
|
106087
|
-
|
|
106152
|
+
let prompt = args.prompt;
|
|
106088
106153
|
const vibe2 = args.vibe === void 0 ? void 0 : {
|
|
106089
106154
|
ownerHandle: normalHandle(args.vibe.ownerHandle),
|
|
106090
106155
|
appSlug: args.vibe.appSlug.trim().toLowerCase(),
|
|
106091
106156
|
dbName: args.vibe.dbName,
|
|
106092
106157
|
docId: args.vibe.docId
|
|
106093
106158
|
};
|
|
106094
|
-
if (vibe2 !== void 0 &&
|
|
106095
|
-
return refusal(
|
|
106096
|
-
|
|
106097
|
-
|
|
106159
|
+
if (vibe2 !== void 0 && vibe2.appSlug === AGENT_CHAT_APP_SLUG) {
|
|
106160
|
+
return refusal("not-yours", "A conversation's own space is not a vibe. Leave out `vibe` to put the picture in the chat.");
|
|
106161
|
+
}
|
|
106162
|
+
if (prompt === "" && vibe2 !== void 0) {
|
|
106163
|
+
const rRecord = await exception2Result203(
|
|
106164
|
+
() => getDocForCaller(vctx, {
|
|
106165
|
+
userId: mctx.actor.userId,
|
|
106166
|
+
ownerHandle: vibe2.ownerHandle,
|
|
106167
|
+
appSlug: vibe2.appSlug,
|
|
106168
|
+
dbName: vibe2.dbName,
|
|
106169
|
+
docId: vibe2.docId,
|
|
106170
|
+
adminMode: false,
|
|
106171
|
+
actingHandle: mctx.actor.ownerHandle
|
|
106172
|
+
})
|
|
106098
106173
|
);
|
|
106174
|
+
const record = rRecord.isOk() && rRecord.Ok().kind === "ok" ? rRecord.Ok().doc : void 0;
|
|
106175
|
+
const own = typeof record?.prompt === "string" ? record.prompt.trim().slice(0, MAKE_PICTURE_PROMPT_MAX) : "";
|
|
106176
|
+
if (own === "") {
|
|
106177
|
+
return refusal("invalid-input", "That record has no prompt of its own; say what the picture shows in `prompt`.");
|
|
106178
|
+
}
|
|
106179
|
+
prompt = own;
|
|
106099
106180
|
}
|
|
106181
|
+
const ownsVibe = vibe2 !== void 0 && await ownsHandle2(vctx, { userId: mctx.actor.userId, handle: vibe2.ownerHandle });
|
|
106100
106182
|
const space = vibe2 ?? { ownerHandle: mctx.actor.ownerHandle, appSlug: AGENT_CHAT_APP_SLUG };
|
|
106101
106183
|
const rInput = await inputPicture(vctx, mctx, args);
|
|
106102
106184
|
if (rInput.isErr()) return refusal("no-input", rInput.Err().message);
|
|
106103
106185
|
const start = rInput.Ok();
|
|
106104
|
-
const { model, apiKey } = await modelFor(vctx, {
|
|
106186
|
+
const { model, apiKey } = await modelFor(vctx, {
|
|
106187
|
+
...space,
|
|
106188
|
+
editing: start !== void 0,
|
|
106189
|
+
ownKey: vibe2 === void 0 || ownsVibe
|
|
106190
|
+
});
|
|
106105
106191
|
const byok = apiKey !== void 0;
|
|
106106
106192
|
let payerUserId;
|
|
106107
106193
|
const rCheck = byok ? void 0 : await vctx.billing.checkCredits({ userId: mctx.actor.userId });
|
|
@@ -106132,6 +106218,16 @@ async function makePicture(vctx, mctx, args) {
|
|
|
106132
106218
|
return refusal("denied", authz.reason ?? "That vibe's rules don't let this picture be saved there.");
|
|
106133
106219
|
}
|
|
106134
106220
|
}
|
|
106221
|
+
let keptPhotoKey;
|
|
106222
|
+
if (vibe2 !== void 0 && args.vibe?.photoKey !== void 0 && args.photo !== void 0) {
|
|
106223
|
+
const rKept = await keepPhotoOnRecord(vctx, mctx, {
|
|
106224
|
+
vibe: vibe2,
|
|
106225
|
+
photoKey: args.vibe.photoKey,
|
|
106226
|
+
uploadId: mctx.inputPhotos[args.photo - 1] ?? ""
|
|
106227
|
+
});
|
|
106228
|
+
if (rKept.isErr()) return refusal("denied", rKept.Err().message);
|
|
106229
|
+
keptPhotoKey = rKept.Ok();
|
|
106230
|
+
}
|
|
106135
106231
|
const rPaint = await paint(vctx, {
|
|
106136
106232
|
model,
|
|
106137
106233
|
...apiKey === void 0 ? {} : { apiKey },
|
|
@@ -106210,7 +106306,7 @@ async function makePicture(vctx, mctx, args) {
|
|
|
106210
106306
|
dbName: vibe2.dbName,
|
|
106211
106307
|
docId: vibe2.docId,
|
|
106212
106308
|
regen: true,
|
|
106213
|
-
...start === void 0 ? {} : { sourceKey: start.sourceKey }
|
|
106309
|
+
...keptPhotoKey !== void 0 ? { sourceKey: keptPhotoKey } : start === void 0 ? {} : { sourceKey: start.sourceKey }
|
|
106214
106310
|
},
|
|
106215
106311
|
fileMeta: { uploadId: stored.uploadId, mimeType, size: stored.size },
|
|
106216
106312
|
promptText: prompt,
|
|
@@ -106218,6 +106314,7 @@ async function makePicture(vctx, mctx, args) {
|
|
|
106218
106314
|
});
|
|
106219
106315
|
const version = written === false ? void 0 : await writtenVersion(vctx, { ...vibe2, uploadId: stored.uploadId });
|
|
106220
106316
|
if (version !== void 0) {
|
|
106317
|
+
await meter();
|
|
106221
106318
|
const mediaDb = mediaDbName(vibe2.dbName);
|
|
106222
106319
|
return {
|
|
106223
106320
|
ok: true,
|
|
@@ -106334,6 +106431,7 @@ var init_agent_make_picture_tool = __esm({
|
|
|
106334
106431
|
init_types4();
|
|
106335
106432
|
init_agent_turn_allowance();
|
|
106336
106433
|
init_app_documents_write_eventos();
|
|
106434
|
+
init_app_documents_read_eventos();
|
|
106337
106435
|
init_app_documents_broadcast();
|
|
106338
106436
|
init_files_url_mint();
|
|
106339
106437
|
init_store_and_audit_asset();
|
|
@@ -106358,10 +106456,10 @@ var init_agent_make_picture_tool = __esm({
|
|
|
106358
106456
|
};
|
|
106359
106457
|
makePictureInput = lazyType(
|
|
106360
106458
|
() => type141({
|
|
106361
|
-
prompt: "string
|
|
106459
|
+
"prompt?": "string",
|
|
106362
106460
|
"photo?": "number.integer >= 1",
|
|
106363
106461
|
"sourceRecord?": type141({ ...recordRef, "fileKey?": "string" }).onUndeclaredKey("reject"),
|
|
106364
|
-
"vibe?": type141(recordRef).onUndeclaredKey("reject")
|
|
106462
|
+
"vibe?": type141({ ...recordRef, "photoKey?": "string > 0" }).onUndeclaredKey("reject")
|
|
106365
106463
|
}).onUndeclaredKey("reject")
|
|
106366
106464
|
);
|
|
106367
106465
|
__name(makePictureToolDefinition, "makePictureToolDefinition");
|
|
@@ -106375,6 +106473,7 @@ var init_agent_make_picture_tool = __esm({
|
|
|
106375
106473
|
__name(inputPicture, "inputPicture");
|
|
106376
106474
|
__name(modelFor, "modelFor");
|
|
106377
106475
|
__name(paint, "paint");
|
|
106476
|
+
__name(keepPhotoOnRecord, "keepPhotoOnRecord");
|
|
106378
106477
|
__name(makePicture, "makePicture");
|
|
106379
106478
|
__name(createMakePictureTool, "createMakePictureTool");
|
|
106380
106479
|
__name(answer4, "answer");
|
|
@@ -115581,7 +115680,8 @@ function decideSeededPosturePromotion(input) {
|
|
|
115581
115680
|
if (input.publishStatedEnvelopeIntent) return { promote: false, reason: "publish-stated-intent" };
|
|
115582
115681
|
if (input.posture !== "private") return { promote: false, reason: "posture-not-private" };
|
|
115583
115682
|
if (input.postureSeeded !== true) return { promote: false, reason: "posture-not-seeded" };
|
|
115584
|
-
if (input.privacySensitive === true
|
|
115683
|
+
if (input.privacySensitive === true && input.ownerIsChatPrincipal !== true)
|
|
115684
|
+
return { promote: false, reason: "privacy-sensitive" };
|
|
115585
115685
|
if (input.accessRulesBound !== true) return { promote: false, reason: "access-rules-not-bound" };
|
|
115586
115686
|
return { promote: true, reason: "promote" };
|
|
115587
115687
|
}
|
|
@@ -115624,7 +115724,8 @@ async function maybePromoteSeededPosture(vctx, args) {
|
|
|
115624
115724
|
posture: entry2.posture,
|
|
115625
115725
|
postureSeeded: entry2.postureSeeded,
|
|
115626
115726
|
privacySensitive: entry2.settings.privacySensitive,
|
|
115627
|
-
publishStatedEnvelopeIntent: args.publishStatedEnvelopeIntent
|
|
115727
|
+
publishStatedEnvelopeIntent: args.publishStatedEnvelopeIntent,
|
|
115728
|
+
ownerIsChatPrincipal: isGroupPrincipal(args.ownerUserId)
|
|
115628
115729
|
};
|
|
115629
115730
|
}, "readFacts");
|
|
115630
115731
|
const facts = await readFacts();
|
|
@@ -115682,6 +115783,7 @@ async function maybePromoteSeededPosture(vctx, args) {
|
|
|
115682
115783
|
var init_posture_promotion = __esm({
|
|
115683
115784
|
"../vibes.diy/api/svc/public/posture-promotion.ts"() {
|
|
115684
115785
|
"use strict";
|
|
115786
|
+
init_types3();
|
|
115685
115787
|
init_ensure_app_settings();
|
|
115686
115788
|
init_publish_app();
|
|
115687
115789
|
init_personal_details();
|
|
@@ -127995,7 +128097,7 @@ DONE MEANS THEY HAVE IT. Before your first tool call, name what the person will
|
|
|
127995
128097
|
A TEXT CONVERSATION. This conversation is a text thread. The person may be reading it in Messages on their phone or on the web, and both show the same messages, so write every reply the way a friend texts. Each stretch of words you write before a tool call goes out as its own text the moment that call starts, and the words after your last call are the next text.
|
|
127996
128098
|
- Say it, then do it. When a turn starts a build, its first words come before its first tool call: one line, a sentence or two, naming what is on the way, in the person's terms, such as "On it: a 3D racer with drift and a lap timer." or "On it: your own copy of Cabin Weekend, a cost splitter." Then any lookups run silently; a list, a search or a read gets no line of its own.
|
|
127997
128099
|
- One message, sometimes in two texts. Messages often sends a link as its own text, a moment after the words that go with it, so a message that ends mid-sentence ("text me when new events are about to start on") and a bare link are one ask: read them together and answer it once. A vibe link on its own is never a dead end: the link names the vibe, so read it with check_vibe_access, or with with_vibe when it is the person's own, and carry on with what they asked.
|
|
127998
|
-
- Pictures travel both ways. A photo the person sends is in front of you. A picture they ask for (their photo as an alien pilot, a card for Sam) is yours to paint with make_picture, as your first call, in the turn the photo arrives: \`photo\` reaches only photos on the message you are answering. A picture is two texts with the picture between them, and each says what the other did not. The line before the call names your guess in a few words, about eight, the way a friend says it is on the way: "Muppet you, coming up." They sent the photo and the picture will show it, so that line keeps to the idea and leaves the hat, the glasses and the jacket to the picture. The picture lands where you call it. The line after the call is one short sentence that adds something the first line did not say, a detail worth a grin or the next go, in your own fresh words: "Felt eyebrows and all." They are looking at the picture by the time that line arrives, so it reads as a caption under it and opens on the detail itself, the way a friend reacts under a photo they just sent. In a group that line ends by handing one other member the next go by name: "Felt eyebrows and all. Sam, you next?" A question to everyone ("Who's next?") hands it to nobody, so name one of the others. When the ask carries on from a picture you just sent ("and then put me on a movie poster"), it is the same favour still going: paint first, with no line before the call, and one line after. Paint once per ask. When they will want more, start the app that makes them after the paint, and its Done text is "Here's the app if you want more: <link>". One to one, a hero of them (their selfie or their words as a superhero) always brings its app, because that app is how they share their hero with friends: the picture goes out first, and after the paint, start the app that holds it, a page showing that picture with a button to make a friend's hero, with the picture's link in the brief. Its Done text offers it as theirs to share whenever they like, opening with "Here's your hero's app if you want to share it: <link>" in place of "Done:". A photo that never reached you ("did you get my pic?") gets one cheerful line asking them to send it again with whatever they would like made of it, and a superhero is one idea among many (a movie poster, a party invite, a game): name a few, so the choice reads as theirs. A picture saved in a vibe (a greeting card an image button painted, a photo someone added) goes into the chat with send_picture, where it arrives as a photo. Asked to post, send or show one, find its record with with_vibe's query_docs and send it, with a line around it as usual.
|
|
128100
|
+
- Pictures travel both ways. A photo the person sends is in front of you. A picture they ask for (their photo as an alien pilot, a card for Sam) is yours to paint with make_picture, as your first call, in the turn the photo arrives: \`photo\` reaches only photos on the message you are answering. A picture is two texts with the picture between them, and each says what the other did not. The line before the call names your guess in a few words, about eight, the way a friend says it is on the way: "Muppet you, coming up." They sent the photo and the picture will show it, so that line keeps to the idea and leaves the hat, the glasses and the jacket to the picture. The picture lands where you call it. The line after the call is one short sentence that adds something the first line did not say, a detail worth a grin or the next go, in your own fresh words: "Felt eyebrows and all." They are looking at the picture by the time that line arrives, so it reads as a caption under it and opens on the detail itself, the way a friend reacts under a photo they just sent. In a group that line ends by handing one other member the next go by name: "Felt eyebrows and all. Sam, you next?" A question to everyone ("Who's next?") hands it to nobody, so name one of the others. When the ask carries on from a picture you just sent ("and then put me on a movie poster"), it is the same favour still going: paint first, with no line before the call, and one line after. Paint once per ask. When they will want more, start the app that makes them after the paint, and its Done text is "Here's the app if you want more: <link>". One to one, a hero of them (their selfie or their words as a superhero) always brings its app, because that app is how they share their hero with friends: the picture goes out first, and after the paint, start the app that holds it, a page showing that picture with a button to make a friend's hero, with the picture's link in the brief. Its Done text offers it as theirs to share whenever they like, opening with "Here's your hero's app if you want to share it: <link>" in place of "Done:". A photo that never reached you ("did you get my pic?") gets one cheerful line asking them to send it again with whatever they would like made of it, and a superhero is one idea among many (a movie poster, a party invite, a game): name a few, so the choice reads as theirs. When they send a photo with a vibe's link or name ("use this to make me vintage" and someone's portrait app), the picture belongs in that vibe, theirs or someone else's: read a record or two there with with_vibe query_docs to learn its shape, save their new record in that shape with put_doc (written as them, its authorHandle their handle), then call make_picture with photo, the scene and \`vibe\` naming that record, with \`vibe.photoKey\` set to the _files key its records keep their starting photo under (such as original). When its records carry their own prompt (an image app's record), that record is the vibe's own tool: set its prompt the way the app does, and leave \`prompt\` out of make_picture so the record's prompt paints it. The picture still lands in the chat where you call it, and the line after it ends with that vibe's link, where it is saved too. That vibe then stays this chat's picture app: write it down with remember (which vibe, its database, the record shape and its photo key), and every later photo in the chat that asks for a picture goes into it the same way, with no link needed, until someone names another vibe or says to stop using it, which you also write down. A picture saved in a vibe (a greeting card an image button painted, a photo someone added) goes into the chat with send_picture, where it arrives as a photo. Asked to post, send or show one, find its record with with_vibe's query_docs and send it, with a line around it as usual.
|
|
127999
128101
|
- Plain text, in short messages. Whole sentences in short paragraphs, each link written out in full from https://, no headings and no markup. A bit's wink is the one pair of stars a text carries. A reply that still runs long folds as the general instruction says, its summary above a line holding only ${AGENT_FOLD_MARKER}, and that summary is the text the phone receives.
|
|
128000
128102
|
- Their words, not the machinery. Say what happened for them, in their terms. When a step is out of your reach, say the next thing that happens and who does it, like a friend who knows the place: "Tap it; if it's private, you'll see Ask to join." Asked who they are talking to, the whole answer is one sentence like "I'm Vibes, I make and run apps for you. What's on your plate?" This replaces the general instruction's line about models, which comes up only when they ask which model.
|
|
128001
128103
|
|
|
@@ -128013,7 +128115,7 @@ Your tools in this conversation:
|
|
|
128013
128115
|
- list_vibes \u2014 the person's vibes across every handle they hold: handle, address (appSlug), title, last update, and whether it is published. Call it when the person refers to their apps, before naming one, and before a change that spans several vibes.
|
|
128014
128116
|
- check_vibe_access \u2014 who can open any vibe, yours or not, from its ownerHandle and appSlug: whether it is published, its posture, how a visitor joins, and a plain whoCanOpen sentence. Call it before you tell anyone who can open a link.
|
|
128015
128117
|
- send_picture \u2014 put a picture from a vibe's records into this conversation, named by ownerHandle, appSlug, dbName and docId; it arrives as a photo in a text thread. Name an image button's record itself and its picture is found.
|
|
128016
|
-
- make_picture \u2014 paint one picture from \`prompt\` into this conversation, where you call it. \`photo\` starts from a photo on the message you are answering, by position from 1; \`sourceRecord\` from the picture in a record; \`vibe\` also saves it on a record you have read, in a vibe the person owns. Billed like a picture painted in an app; ten to thirty seconds; two a turn at most.
|
|
128118
|
+
- make_picture \u2014 paint one picture from \`prompt\` into this conversation, where you call it. \`photo\` starts from a photo on the message you are answering, by position from 1; \`sourceRecord\` from the picture in a record; \`vibe\` also saves it on a record you have read, in a vibe the person owns or one they linked that lets them add records; \`vibe.photoKey\` also saves the photo on that record, for an app whose records keep the photo they start from. Billed like a picture painted in an app; ten to thirty seconds; two a turn at most.
|
|
128017
128119
|
- list_memberships \u2014 the vibes other people own that the person was let into, with their role there (viewer, submitter or editor). Call it when the person mentions a vibe they use but did not make.
|
|
128018
128120
|
- vibe_activity \u2014 who uses the person's vibes besides them, in one answer across every vibe under every handle: for each vibe, how many other signed-in people saved records in it (otherWriters), the busiest of them by handle, approved members, and access requests waiting for an answer, busiest vibe first. Any question about who uses, shares, joins or visits their vibes starts here, and the answer covers the whole account, so name the vibes it ranks rather than opening them one by one. It counts people who saved something (a reader leaves no record), so any count you give is "people who saved something", and only when they ask how many.
|
|
128019
128121
|
- create_vibe \u2014 start a brand-new vibe under the handle this conversation acts as. Every call makes a new app with its own address.
|
|
@@ -167494,7 +167596,7 @@ function renderRunHostPage(opts) {
|
|
|
167494
167596
|
<style>html,body{margin:0;height:100%;background:#fff}iframe{border:0;width:100%;height:100%;display:block}</style>
|
|
167495
167597
|
</head>
|
|
167496
167598
|
<body>
|
|
167497
|
-
<iframe id="vibe" title="${escapeHtml2(title)}" allow="clipboard-write; camera; microphone; geolocation"></iframe>
|
|
167599
|
+
<iframe id="vibe" title="${escapeHtml2(title)}" allow="clipboard-write; camera; microphone; geolocation; web-share"></iframe>
|
|
167498
167600
|
<script type="module" src="${RUN_HOST_MODULE_PATH}"></script>
|
|
167499
167601
|
</body>
|
|
167500
167602
|
</html>`;
|
|
@@ -33,7 +33,7 @@ export function renderRunHostPage(opts) {
|
|
|
33
33
|
<style>html,body{margin:0;height:100%;background:#fff}iframe{border:0;width:100%;height:100%;display:block}</style>
|
|
34
34
|
</head>
|
|
35
35
|
<body>
|
|
36
|
-
<iframe id="vibe" title="${escapeHtml(title)}" allow="clipboard-write; camera; microphone; geolocation"></iframe>
|
|
36
|
+
<iframe id="vibe" title="${escapeHtml(title)}" allow="clipboard-write; camera; microphone; geolocation; web-share"></iframe>
|
|
37
37
|
<script type="module" src="${RUN_HOST_MODULE_PATH}"></script>
|
|
38
38
|
</body>
|
|
39
39
|
</html>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibes-diy",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.348",
|
|
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.348",
|
|
45
|
+
"@vibes.diy/api-types": "14.3.348",
|
|
46
|
+
"@vibes.diy/call-ai-v2": "14.3.348",
|
|
47
|
+
"@vibes.diy/cmd-harness": "14.3.348",
|
|
48
|
+
"@vibes.diy/cmd-tools": "14.3.348",
|
|
49
|
+
"@vibes.diy/identity": "14.3.348",
|
|
50
|
+
"@vibes.diy/prompts": "14.3.348",
|
|
51
51
|
"acorn": "~8.19.0",
|
|
52
52
|
"acorn-jsx": "~5.3.2",
|
|
53
53
|
"arktype": "~2.2.9",
|