vibes-diy 14.3.364 → 14.3.365
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
CHANGED
|
@@ -475,6 +475,7 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
|
|
|
475
475
|
updatedAt: string;
|
|
476
476
|
claimId?: string | undefined;
|
|
477
477
|
asker?: boolean | undefined;
|
|
478
|
+
guestAskerUserId?: string | undefined;
|
|
478
479
|
} | {
|
|
479
480
|
type: "groupSponsor";
|
|
480
481
|
sponsorUserId: string;
|
|
@@ -1470,6 +1471,7 @@ export declare function cliEventoHandlers(): (import("@adviser/cement").EventoHa
|
|
|
1470
1471
|
guest?: boolean | undefined;
|
|
1471
1472
|
asker?: boolean | undefined;
|
|
1472
1473
|
sponsored?: boolean | undefined;
|
|
1474
|
+
guestAsker?: string | undefined;
|
|
1473
1475
|
members?: string | undefined;
|
|
1474
1476
|
}, {
|
|
1475
1477
|
type: "vibes-diy.cli.res-phone-link-pay-for-group";
|
|
@@ -57,6 +57,7 @@ export declare const ReqPhoneLinkPayForGroupCli: import("arktype/internal/varian
|
|
|
57
57
|
guest?: boolean | undefined;
|
|
58
58
|
asker?: boolean | undefined;
|
|
59
59
|
sponsored?: boolean | undefined;
|
|
60
|
+
guestAsker?: string | undefined;
|
|
60
61
|
members?: string | undefined;
|
|
61
62
|
}, {}>;
|
|
62
63
|
export type ReqPhoneLinkPayForGroupCli = typeof ReqPhoneLinkPayForGroupCli.infer;
|
|
@@ -322,6 +323,7 @@ export declare function phoneLinkSubcommands(ctx: CliCtx): Partial<import("cmd-t
|
|
|
322
323
|
guest: boolean;
|
|
323
324
|
asker: boolean;
|
|
324
325
|
sponsored: boolean;
|
|
326
|
+
guestAsker: string;
|
|
325
327
|
members: string;
|
|
326
328
|
};
|
|
327
329
|
} | {
|
|
@@ -443,6 +445,7 @@ export declare function phoneLinkSubcommands(ctx: CliCtx): Partial<import("cmd-t
|
|
|
443
445
|
guest: boolean;
|
|
444
446
|
asker: boolean;
|
|
445
447
|
sponsored: boolean;
|
|
448
|
+
guestAsker: string;
|
|
446
449
|
members: string;
|
|
447
450
|
};
|
|
448
451
|
} | {
|
|
@@ -154,6 +154,7 @@ export const ReqPhoneLinkPayForGroupCli = type({
|
|
|
154
154
|
"guest?": "boolean",
|
|
155
155
|
"asker?": "boolean",
|
|
156
156
|
"sponsored?": "boolean",
|
|
157
|
+
"guestAsker?": "string",
|
|
157
158
|
"members?": "string",
|
|
158
159
|
});
|
|
159
160
|
export function isReqPhoneLinkPayForGroupCli(obj) {
|
|
@@ -188,6 +189,7 @@ export const phoneLinkPayForGroupEvento = {
|
|
|
188
189
|
...(args.guest === true ? { guest: true } : {}),
|
|
189
190
|
...(args.asker === true ? { asker: true } : {}),
|
|
190
191
|
...(args.sponsored === true ? { sponsored: true } : {}),
|
|
192
|
+
...(args.sponsored === true && args.guestAsker !== undefined ? { guestAsker: args.guestAsker } : {}),
|
|
191
193
|
...(args.members === undefined || args.members.trim() === ""
|
|
192
194
|
? {}
|
|
193
195
|
: {
|
|
@@ -240,6 +242,13 @@ function phoneLinkPayForGroupCmd(ctx) {
|
|
|
240
242
|
description: "Bridge accounts only: a member who hasn't linked asked in a sponsored chat, so the turn runs on the sponsor's credits.",
|
|
241
243
|
defaultValue: () => ctx.sthis.env.get("VIBES_PAY_SPONSORED") === "1",
|
|
242
244
|
}),
|
|
245
|
+
guestAsker: option({
|
|
246
|
+
long: "guest-asker",
|
|
247
|
+
description: "With --sponsored: that member's own one-to-one phone-guest principal (group:<id>), so their yes to a text-later offer is theirs.",
|
|
248
|
+
type: string,
|
|
249
|
+
defaultValue: () => ctx.sthis.env.get("VIBES_PAY_GUEST_ASKER") ?? "",
|
|
250
|
+
defaultValueIsSerializable: true,
|
|
251
|
+
}),
|
|
243
252
|
members: option({
|
|
244
253
|
long: "members",
|
|
245
254
|
description: "The chat's linked members by handle, comma separated, for your own list of group chats.",
|
|
@@ -256,6 +265,7 @@ function phoneLinkPayForGroupCmd(ctx) {
|
|
|
256
265
|
...(args.guest ? { guest: true } : {}),
|
|
257
266
|
...(args.asker ? { asker: true } : {}),
|
|
258
267
|
...(args.sponsored ? { sponsored: true } : {}),
|
|
268
|
+
...(args.sponsored && args.guestAsker.trim() !== "" ? { guestAsker: args.guestAsker.trim() } : {}),
|
|
259
269
|
...(args.members === "" ? {} : { members: args.members }),
|
|
260
270
|
};
|
|
261
271
|
}),
|
|
@@ -208589,6 +208589,14 @@ var reqSetGroupPayer = lazyType(
|
|
|
208589
208589
|
* sponsored group, so the turn runs on the sponsor's credits, acting as nobody.
|
|
208590
208590
|
*/
|
|
208591
208591
|
"sponsored?": "boolean",
|
|
208592
|
+
/**
|
|
208593
|
+
* With `sponsored` only (issue #10043, Chris 2026-11-18): the member who hasn't linked, named by
|
|
208594
|
+
* their own one-to-one phone-guest principal (`group:<id>`, the one a direct chat with their
|
|
208595
|
+
* number gets). Their yes to a text-later offer on this turn is recorded under it, and that one
|
|
208596
|
+
* tool runs as it, so its later text reaches them one to one, never the group. Acts as nobody
|
|
208597
|
+
* anywhere else.
|
|
208598
|
+
*/
|
|
208599
|
+
"guestAsker?": "string",
|
|
208592
208600
|
/** The bridge's view of the chat's other linked members, by handle, for the caller's group list. */
|
|
208593
208601
|
"memberHandles?": "string[]"
|
|
208594
208602
|
})
|
|
@@ -209872,7 +209880,13 @@ var userSettingGroupPayer = lazyType(
|
|
|
209872
209880
|
* bridge runs on their credits. Only then may the group act as them inside other people's
|
|
209873
209881
|
* vibes (`with_vibe`'s asker lane). Absent: billing only.
|
|
209874
209882
|
*/
|
|
209875
|
-
"asker?": "boolean"
|
|
209883
|
+
"asker?": "boolean",
|
|
209884
|
+
/**
|
|
209885
|
+
* A sponsored turn from a member who hasn't linked (issue #10043): their own one-to-one
|
|
209886
|
+
* phone-guest principal, named by the bridge. Read only for a text-later yes
|
|
209887
|
+
* (`resolveTextConsentSpeaker`) and the one tool that yes runs; never an asker elsewhere.
|
|
209888
|
+
*/
|
|
209889
|
+
"guestAskerUserId?": "string"
|
|
209876
209890
|
})
|
|
209877
209891
|
);
|
|
209878
209892
|
var userSettingGroupSponsor = lazyType(
|
|
@@ -292481,7 +292495,8 @@ async function writeGroupPayer(sql2, args3) {
|
|
|
292481
292495
|
payerUserId: args3.payerUserId,
|
|
292482
292496
|
updatedAt: now3,
|
|
292483
292497
|
claimId,
|
|
292484
|
-
...args3.asker === true ? { asker: true } : {}
|
|
292498
|
+
...args3.asker === true ? { asker: true } : {},
|
|
292499
|
+
...args3.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args3.guestAskerUserId }
|
|
292485
292500
|
}
|
|
292486
292501
|
];
|
|
292487
292502
|
if (row === void 0) {
|
|
@@ -292508,6 +292523,15 @@ async function readGroupAsker(sql2, args3) {
|
|
|
292508
292523
|
});
|
|
292509
292524
|
}
|
|
292510
292525
|
__name(readGroupAsker, "readGroupAsker");
|
|
292526
|
+
async function readGroupGuestAsker(sql2, groupUserId) {
|
|
292527
|
+
return exception2Result(async () => {
|
|
292528
|
+
const settings = await readSettings2(sql2, groupUserId);
|
|
292529
|
+
const id = settings?.find(isUserSettingGroupPayer)?.guestAskerUserId;
|
|
292530
|
+
if (id === void 0 || id === groupUserId || !isGroupPrincipal(id)) return void 0;
|
|
292531
|
+
return id;
|
|
292532
|
+
});
|
|
292533
|
+
}
|
|
292534
|
+
__name(readGroupGuestAsker, "readGroupGuestAsker");
|
|
292511
292535
|
async function replaceSettingsItem(sql2, args3) {
|
|
292512
292536
|
return exception2Result(async () => {
|
|
292513
292537
|
const t3 = sql2.tables.userSettings;
|
|
@@ -339249,11 +339273,25 @@ async function resolveTextConsentSpeaker(vctx, args3) {
|
|
|
339249
339273
|
return { ok: false, message: "Could not tell who said yes just now, so the tool did not run. Nothing was done." };
|
|
339250
339274
|
}
|
|
339251
339275
|
const writer = rWriter.Ok();
|
|
339252
|
-
if (writer.kind === "no-asker") return
|
|
339276
|
+
if (writer.kind === "no-asker") return guestSpeaker(vctx, args3.actorUserId);
|
|
339253
339277
|
if (writer.kind === "several-handles") return { ok: false, message: GROUP_ASKER_SEVERAL_HANDLES_MESSAGE };
|
|
339254
339278
|
return { ok: true, userId: writer.userId, ownerHandle: writer.ownerHandle };
|
|
339255
339279
|
}
|
|
339256
339280
|
__name(resolveTextConsentSpeaker, "resolveTextConsentSpeaker");
|
|
339281
|
+
async function guestSpeaker(vctx, groupUserId) {
|
|
339282
|
+
const unreadable = {
|
|
339283
|
+
ok: false,
|
|
339284
|
+
message: "Could not tell who said yes just now, so the tool did not run. Nothing was done."
|
|
339285
|
+
};
|
|
339286
|
+
const rGuest = await readGroupGuestAsker(vctx.sql, groupUserId);
|
|
339287
|
+
if (rGuest.isErr()) return unreadable;
|
|
339288
|
+
const guestUserId = rGuest.Ok();
|
|
339289
|
+
if (guestUserId === void 0) return { ok: false, message: TEXT_CONSENT_NO_SPEAKER_MESSAGE };
|
|
339290
|
+
const rHandle = await resolveAgentActor(vctx, { userId: guestUserId });
|
|
339291
|
+
if (rHandle.isErr()) return unreadable;
|
|
339292
|
+
return { ok: true, userId: guestUserId, ownerHandle: rHandle.Ok().ownerHandle, runsAsSpeaker: true };
|
|
339293
|
+
}
|
|
339294
|
+
__name(guestSpeaker, "guestSpeaker");
|
|
339257
339295
|
|
|
339258
339296
|
// ../../home/runner/work/vibes.diy/vibes.diy/vibes.diy/api/svc/intern/backend-notify-callback.ts
|
|
339259
339297
|
var MAX_BODY_CHARS = 500;
|
|
@@ -352319,6 +352357,20 @@ async function noteMemberTurn(vctx, groupUserId) {
|
|
|
352319
352357
|
if (r2.isErr()) vctx.logger.Warn().Err(r2).Str("groupUserId", groupUserId).Msg("vibe-outreach: member turn not noted");
|
|
352320
352358
|
}
|
|
352321
352359
|
__name(noteMemberTurn, "noteMemberTurn");
|
|
352360
|
+
async function phoneGuestAsker(vctx, groupUserId, guestAsker) {
|
|
352361
|
+
if (guestAsker === void 0) return void 0;
|
|
352362
|
+
if (guestAsker === groupUserId || !isGroupPrincipal(guestAsker)) {
|
|
352363
|
+
vctx.logger.Warn().Str("groupUserId", groupUserId).Msg("group-payer: guest asker is no phone guest");
|
|
352364
|
+
return void 0;
|
|
352365
|
+
}
|
|
352366
|
+
const own2 = await readGroupPayer(vctx.sql, guestAsker);
|
|
352367
|
+
if (own2.isErr() || own2.Ok() !== guestAsker) {
|
|
352368
|
+
vctx.logger.Warn().Str("groupUserId", groupUserId).Msg("group-payer: guest asker is no phone guest");
|
|
352369
|
+
return void 0;
|
|
352370
|
+
}
|
|
352371
|
+
return guestAsker;
|
|
352372
|
+
}
|
|
352373
|
+
__name(phoneGuestAsker, "phoneGuestAsker");
|
|
352322
352374
|
function refuse7(code2, message5) {
|
|
352323
352375
|
return { type: "vibes.diy.res-error", error: { message: message5, code: code2 } };
|
|
352324
352376
|
}
|
|
@@ -352401,7 +352453,12 @@ async function setGroupPayer(vctx, args3) {
|
|
|
352401
352453
|
sponsorUserId = args3.callerUserId;
|
|
352402
352454
|
vctx.logger.Info().Str("groupUserId", args3.groupUserId).Str("payerUserId", sponsorUserId).Msg("group-payer: bridge sponsor");
|
|
352403
352455
|
}
|
|
352404
|
-
const
|
|
352456
|
+
const guestAskerUserId = await phoneGuestAsker(vctx, args3.groupUserId, args3.guestAsker);
|
|
352457
|
+
const written2 = await writeGroupPayer(vctx.sql, {
|
|
352458
|
+
groupUserId: args3.groupUserId,
|
|
352459
|
+
payerUserId: sponsorUserId,
|
|
352460
|
+
...guestAskerUserId === void 0 ? {} : { guestAskerUserId }
|
|
352461
|
+
});
|
|
352405
352462
|
if (written2.isErr()) {
|
|
352406
352463
|
vctx.logger.Error().Err(written2.Err()).Str("groupUserId", args3.groupUserId).Msg("group-payer: sponsored write failed");
|
|
352407
352464
|
return refuse7(GROUP_PAYER_ERROR.unavailable, "Couldn't record that. Try again in a moment.");
|
|
@@ -352464,6 +352521,7 @@ var setGroupPayerEvento = {
|
|
|
352464
352521
|
...req2.guest === true ? { guest: true } : {},
|
|
352465
352522
|
...req2.asker === true ? { asker: true } : {},
|
|
352466
352523
|
...req2.sponsored === true ? { sponsored: true } : {},
|
|
352524
|
+
...req2.guestAsker === void 0 ? {} : { guestAsker: req2.guestAsker },
|
|
352467
352525
|
...req2.memberHandles === void 0 ? {} : { memberHandles: req2.memberHandles.slice(0, 20) }
|
|
352468
352526
|
});
|
|
352469
352527
|
await ctx.send.send(ctx, res);
|
|
@@ -384361,17 +384419,21 @@ function createVibeToolInnerExecutor(host, target2) {
|
|
|
384361
384419
|
const listed2 = rListed.isOk() ? rListed.Ok().find((t3) => t3.name === toolName) : void 0;
|
|
384362
384420
|
const wireName = vibeToolWireName(target2.appSlug, toolName);
|
|
384363
384421
|
if (listed2 === void 0) return json5(vibeToolCallAnswer(wireName, { reason: "no_tool" }));
|
|
384422
|
+
let runAs = {
|
|
384423
|
+
callerUserId: target2.callerUserId,
|
|
384424
|
+
...target2.payerUserId === void 0 ? {} : { payerUserId: target2.payerUserId }
|
|
384425
|
+
};
|
|
384364
384426
|
if (isTextLaterOffer(listed2)) {
|
|
384365
|
-
const
|
|
384366
|
-
if (
|
|
384427
|
+
const yes = await recordTextLaterYes({ host, target: target2, wireName, toolName });
|
|
384428
|
+
if (yes.ok === false) return json5(yes.refusal);
|
|
384429
|
+
if (yes.runsAs !== void 0) runAs = { callerUserId: yes.runsAs, payerUserId: target2.payerUserId ?? target2.callerUserId };
|
|
384367
384430
|
}
|
|
384368
384431
|
const outcome = await host.call({
|
|
384369
384432
|
ownerHandle: target2.ownerHandle,
|
|
384370
384433
|
appSlug: target2.appSlug,
|
|
384371
|
-
callerUserId: target2.callerUserId,
|
|
384372
384434
|
toolName,
|
|
384373
384435
|
input: args3.input ?? {},
|
|
384374
|
-
...
|
|
384436
|
+
...runAs
|
|
384375
384437
|
});
|
|
384376
384438
|
return json5(vibeToolCallAnswer(wireName, outcome));
|
|
384377
384439
|
}
|
|
@@ -384379,19 +384441,39 @@ function createVibeToolInnerExecutor(host, target2) {
|
|
|
384379
384441
|
};
|
|
384380
384442
|
}
|
|
384381
384443
|
__name(createVibeToolInnerExecutor, "createVibeToolInnerExecutor");
|
|
384382
|
-
async function recordTextLaterYes(
|
|
384444
|
+
async function recordTextLaterYes({
|
|
384445
|
+
host,
|
|
384446
|
+
target: target2,
|
|
384447
|
+
wireName,
|
|
384448
|
+
toolName
|
|
384449
|
+
}) {
|
|
384450
|
+
const refuse16 = /* @__PURE__ */ __name((refusal5) => ({ ok: false, refusal: refusal5 }), "refuse");
|
|
384383
384451
|
const consent = target2.textLater;
|
|
384384
384452
|
if (consent === void 0) {
|
|
384385
|
-
return {
|
|
384453
|
+
return refuse16({
|
|
384386
384454
|
ok: false,
|
|
384387
384455
|
reason: "no-consent-record",
|
|
384388
384456
|
tool: wireName,
|
|
384389
384457
|
message: "This tool texts the person later, and their yes can't be recorded here, so it did not run. Nothing was done."
|
|
384390
|
-
};
|
|
384458
|
+
});
|
|
384391
384459
|
}
|
|
384392
384460
|
const rWho = await exception2Result(() => consent.speaker());
|
|
384393
384461
|
const who = rWho.isOk() ? rWho.Ok() : { ok: false, message: "Could not tell who said yes just now, so the tool did not run. Nothing was done." };
|
|
384394
|
-
if (who.ok === false) return { ok: false, reason: "no-speaker", tool: wireName, message: who.message };
|
|
384462
|
+
if (who.ok === false) return refuse16({ ok: false, reason: "no-speaker", tool: wireName, message: who.message });
|
|
384463
|
+
const runsAs = who.runsAsSpeaker === true && who.userId !== target2.callerUserId ? who.userId : void 0;
|
|
384464
|
+
if (runsAs !== void 0) {
|
|
384465
|
+
const rTheirs = await exception2Result(
|
|
384466
|
+
() => host.list({ ownerHandle: target2.ownerHandle, appSlug: target2.appSlug, callerUserId: runsAs })
|
|
384467
|
+
);
|
|
384468
|
+
if (!rTheirs.isOk() || !rTheirs.Ok().some((t3) => t3.name === toolName)) {
|
|
384469
|
+
return refuse16({
|
|
384470
|
+
ok: false,
|
|
384471
|
+
reason: "no-tool",
|
|
384472
|
+
tool: wireName,
|
|
384473
|
+
message: "This vibe doesn't offer that tool to the person who said yes, so it did not run. Nothing was done."
|
|
384474
|
+
});
|
|
384475
|
+
}
|
|
384476
|
+
}
|
|
384395
384477
|
const rAnswer = await exception2Result(() => consent.answer());
|
|
384396
384478
|
const answer13 = rAnswer.isOk() ? rAnswer.Ok() : { method: "typed", text: null };
|
|
384397
384479
|
const rQuestion = await exception2Result(() => consent.offerQuestion());
|
|
@@ -384408,13 +384490,13 @@ async function recordTextLaterYes(target2, wireName) {
|
|
|
384408
384490
|
answerText: personAnswerText(answer13.text)
|
|
384409
384491
|
})
|
|
384410
384492
|
);
|
|
384411
|
-
if (rRecorded.isOk() && rRecorded.Ok() === true) return void 0;
|
|
384412
|
-
return {
|
|
384493
|
+
if (rRecorded.isOk() && rRecorded.Ok() === true) return runsAs === void 0 ? { ok: true } : { ok: true, runsAs };
|
|
384494
|
+
return refuse16({
|
|
384413
384495
|
ok: false,
|
|
384414
384496
|
reason: "consent-not-recorded",
|
|
384415
384497
|
tool: wireName,
|
|
384416
384498
|
message: "Their yes could not be saved just now, so the tool did not run. Nothing was done; try again in a moment."
|
|
384417
|
-
};
|
|
384499
|
+
});
|
|
384418
384500
|
}
|
|
384419
384501
|
__name(recordTextLaterYes, "recordTextLaterYes");
|
|
384420
384502
|
function withVibeToolCalls(vibeTools, rest) {
|
|
@@ -10991,6 +10991,14 @@ var init_group_principal = __esm({
|
|
|
10991
10991
|
* sponsored group, so the turn runs on the sponsor's credits, acting as nobody.
|
|
10992
10992
|
*/
|
|
10993
10993
|
"sponsored?": "boolean",
|
|
10994
|
+
/**
|
|
10995
|
+
* With `sponsored` only (issue #10043, Chris 2026-11-18): the member who hasn't linked, named by
|
|
10996
|
+
* their own one-to-one phone-guest principal (`group:<id>`, the one a direct chat with their
|
|
10997
|
+
* number gets). Their yes to a text-later offer on this turn is recorded under it, and that one
|
|
10998
|
+
* tool runs as it, so its later text reaches them one to one, never the group. Acts as nobody
|
|
10999
|
+
* anywhere else.
|
|
11000
|
+
*/
|
|
11001
|
+
"guestAsker?": "string",
|
|
10994
11002
|
/** The bridge's view of the chat's other linked members, by handle, for the caller's group list. */
|
|
10995
11003
|
"memberHandles?": "string[]"
|
|
10996
11004
|
})
|
|
@@ -12519,7 +12527,13 @@ var init_settings = __esm({
|
|
|
12519
12527
|
* bridge runs on their credits. Only then may the group act as them inside other people's
|
|
12520
12528
|
* vibes (`with_vibe`'s asker lane). Absent: billing only.
|
|
12521
12529
|
*/
|
|
12522
|
-
"asker?": "boolean"
|
|
12530
|
+
"asker?": "boolean",
|
|
12531
|
+
/**
|
|
12532
|
+
* A sponsored turn from a member who hasn't linked (issue #10043): their own one-to-one
|
|
12533
|
+
* phone-guest principal, named by the bridge. Read only for a text-later yes
|
|
12534
|
+
* (`resolveTextConsentSpeaker`) and the one tool that yes runs; never an asker elsewhere.
|
|
12535
|
+
*/
|
|
12536
|
+
"guestAskerUserId?": "string"
|
|
12523
12537
|
})
|
|
12524
12538
|
);
|
|
12525
12539
|
userSettingGroupSponsor = lazyType(
|
|
@@ -57821,7 +57835,8 @@ async function writeGroupPayer(sql43, args) {
|
|
|
57821
57835
|
payerUserId: args.payerUserId,
|
|
57822
57836
|
updatedAt: now3,
|
|
57823
57837
|
claimId,
|
|
57824
|
-
...args.asker === true ? { asker: true } : {}
|
|
57838
|
+
...args.asker === true ? { asker: true } : {},
|
|
57839
|
+
...args.guestAskerUserId === void 0 ? {} : { guestAskerUserId: args.guestAskerUserId }
|
|
57825
57840
|
}
|
|
57826
57841
|
];
|
|
57827
57842
|
if (row === void 0) {
|
|
@@ -57846,6 +57861,14 @@ async function readGroupAsker(sql43, args) {
|
|
|
57846
57861
|
return id;
|
|
57847
57862
|
});
|
|
57848
57863
|
}
|
|
57864
|
+
async function readGroupGuestAsker(sql43, groupUserId) {
|
|
57865
|
+
return exception2Result98(async () => {
|
|
57866
|
+
const settings = await readSettings2(sql43, groupUserId);
|
|
57867
|
+
const id = settings?.find(isUserSettingGroupPayer)?.guestAskerUserId;
|
|
57868
|
+
if (id === void 0 || id === groupUserId || !isGroupPrincipal(id)) return void 0;
|
|
57869
|
+
return id;
|
|
57870
|
+
});
|
|
57871
|
+
}
|
|
57849
57872
|
async function replaceSettingsItem(sql43, args) {
|
|
57850
57873
|
return exception2Result98(async () => {
|
|
57851
57874
|
const t = sql43.tables.userSettings;
|
|
@@ -58048,6 +58071,7 @@ var init_group_payer = __esm({
|
|
|
58048
58071
|
__name(readGroupPayer, "readGroupPayer");
|
|
58049
58072
|
__name(writeGroupPayer, "writeGroupPayer");
|
|
58050
58073
|
__name(readGroupAsker, "readGroupAsker");
|
|
58074
|
+
__name(readGroupGuestAsker, "readGroupGuestAsker");
|
|
58051
58075
|
__name(replaceSettingsItem, "replaceSettingsItem");
|
|
58052
58076
|
GROUP_ROSTER_KEPT = 50;
|
|
58053
58077
|
__name(readGroupRoster, "readGroupRoster");
|
|
@@ -99225,16 +99249,30 @@ async function resolveTextConsentSpeaker(vctx, args) {
|
|
|
99225
99249
|
return { ok: false, message: "Could not tell who said yes just now, so the tool did not run. Nothing was done." };
|
|
99226
99250
|
}
|
|
99227
99251
|
const writer = rWriter.Ok();
|
|
99228
|
-
if (writer.kind === "no-asker") return
|
|
99252
|
+
if (writer.kind === "no-asker") return guestSpeaker(vctx, args.actorUserId);
|
|
99229
99253
|
if (writer.kind === "several-handles") return { ok: false, message: GROUP_ASKER_SEVERAL_HANDLES_MESSAGE };
|
|
99230
99254
|
return { ok: true, userId: writer.userId, ownerHandle: writer.ownerHandle };
|
|
99231
99255
|
}
|
|
99256
|
+
async function guestSpeaker(vctx, groupUserId) {
|
|
99257
|
+
const unreadable = {
|
|
99258
|
+
ok: false,
|
|
99259
|
+
message: "Could not tell who said yes just now, so the tool did not run. Nothing was done."
|
|
99260
|
+
};
|
|
99261
|
+
const rGuest = await readGroupGuestAsker(vctx.sql, groupUserId);
|
|
99262
|
+
if (rGuest.isErr()) return unreadable;
|
|
99263
|
+
const guestUserId = rGuest.Ok();
|
|
99264
|
+
if (guestUserId === void 0) return { ok: false, message: TEXT_CONSENT_NO_SPEAKER_MESSAGE };
|
|
99265
|
+
const rHandle = await resolveAgentActor(vctx, { userId: guestUserId });
|
|
99266
|
+
if (rHandle.isErr()) return unreadable;
|
|
99267
|
+
return { ok: true, userId: guestUserId, ownerHandle: rHandle.Ok().ownerHandle, runsAsSpeaker: true };
|
|
99268
|
+
}
|
|
99232
99269
|
var TEXT_LATER_CONSENT, TEXT_CONSENT_NO_SPEAKER_MESSAGE;
|
|
99233
99270
|
var init_text_consents = __esm({
|
|
99234
99271
|
"../vibes.diy/api/svc/intern/text-consents.ts"() {
|
|
99235
99272
|
"use strict";
|
|
99236
99273
|
init_types3();
|
|
99237
99274
|
init_group_asker_writer();
|
|
99275
|
+
init_agent_actor();
|
|
99238
99276
|
init_group_payer();
|
|
99239
99277
|
TEXT_LATER_CONSENT = "text-later";
|
|
99240
99278
|
__name(recordTextConsent, "recordTextConsent");
|
|
@@ -99243,6 +99281,7 @@ var init_text_consents = __esm({
|
|
|
99243
99281
|
__name(personAnswerText, "personAnswerText");
|
|
99244
99282
|
TEXT_CONSENT_NO_SPEAKER_MESSAGE = "A later text needs the yes of the person it goes to, and no linked member is asking on this turn, so nobody's yes can be recorded. Ask the person who wants it to say yes themselves. Nothing ran.";
|
|
99245
99283
|
__name(resolveTextConsentSpeaker, "resolveTextConsentSpeaker");
|
|
99284
|
+
__name(guestSpeaker, "guestSpeaker");
|
|
99246
99285
|
}
|
|
99247
99286
|
});
|
|
99248
99287
|
|
|
@@ -102527,6 +102566,19 @@ async function noteMemberTurn(vctx, groupUserId) {
|
|
|
102527
102566
|
const r = await noteGroupMemberTurn(vctx, rActor.Ok());
|
|
102528
102567
|
if (r.isErr()) vctx.logger.Warn().Err(r).Str("groupUserId", groupUserId).Msg("vibe-outreach: member turn not noted");
|
|
102529
102568
|
}
|
|
102569
|
+
async function phoneGuestAsker(vctx, groupUserId, guestAsker) {
|
|
102570
|
+
if (guestAsker === void 0) return void 0;
|
|
102571
|
+
if (guestAsker === groupUserId || !isGroupPrincipal(guestAsker)) {
|
|
102572
|
+
vctx.logger.Warn().Str("groupUserId", groupUserId).Msg("group-payer: guest asker is no phone guest");
|
|
102573
|
+
return void 0;
|
|
102574
|
+
}
|
|
102575
|
+
const own = await readGroupPayer(vctx.sql, guestAsker);
|
|
102576
|
+
if (own.isErr() || own.Ok() !== guestAsker) {
|
|
102577
|
+
vctx.logger.Warn().Str("groupUserId", groupUserId).Msg("group-payer: guest asker is no phone guest");
|
|
102578
|
+
return void 0;
|
|
102579
|
+
}
|
|
102580
|
+
return guestAsker;
|
|
102581
|
+
}
|
|
102530
102582
|
function refuse7(code2, message3) {
|
|
102531
102583
|
return { type: "vibes.diy.res-error", error: { message: message3, code: code2 } };
|
|
102532
102584
|
}
|
|
@@ -102585,7 +102637,12 @@ async function setGroupPayer(vctx, args) {
|
|
|
102585
102637
|
sponsorUserId = args.callerUserId;
|
|
102586
102638
|
vctx.logger.Info().Str("groupUserId", args.groupUserId).Str("payerUserId", sponsorUserId).Msg("group-payer: bridge sponsor");
|
|
102587
102639
|
}
|
|
102588
|
-
const
|
|
102640
|
+
const guestAskerUserId = await phoneGuestAsker(vctx, args.groupUserId, args.guestAsker);
|
|
102641
|
+
const written2 = await writeGroupPayer(vctx.sql, {
|
|
102642
|
+
groupUserId: args.groupUserId,
|
|
102643
|
+
payerUserId: sponsorUserId,
|
|
102644
|
+
...guestAskerUserId === void 0 ? {} : { guestAskerUserId }
|
|
102645
|
+
});
|
|
102589
102646
|
if (written2.isErr()) {
|
|
102590
102647
|
vctx.logger.Error().Err(written2.Err()).Str("groupUserId", args.groupUserId).Msg("group-payer: sponsored write failed");
|
|
102591
102648
|
return refuse7(GROUP_PAYER_ERROR.unavailable, "Couldn't record that. Try again in a moment.");
|
|
@@ -102667,6 +102724,7 @@ var init_group_principal2 = __esm({
|
|
|
102667
102724
|
init_agent_actor();
|
|
102668
102725
|
init_agent_vibe_outreach();
|
|
102669
102726
|
__name(noteMemberTurn, "noteMemberTurn");
|
|
102727
|
+
__name(phoneGuestAsker, "phoneGuestAsker");
|
|
102670
102728
|
__name(refuse7, "refuse");
|
|
102671
102729
|
__name(groupPrincipalIdOf, "groupPrincipalIdOf");
|
|
102672
102730
|
__name(mintGroupPrincipal, "mintGroupPrincipal");
|
|
@@ -102709,6 +102767,7 @@ var init_group_principal2 = __esm({
|
|
|
102709
102767
|
...req2.guest === true ? { guest: true } : {},
|
|
102710
102768
|
...req2.asker === true ? { asker: true } : {},
|
|
102711
102769
|
...req2.sponsored === true ? { sponsored: true } : {},
|
|
102770
|
+
...req2.guestAsker === void 0 ? {} : { guestAsker: req2.guestAsker },
|
|
102712
102771
|
...req2.memberHandles === void 0 ? {} : { memberHandles: req2.memberHandles.slice(0, 20) }
|
|
102713
102772
|
});
|
|
102714
102773
|
await ctx.send.send(ctx, res);
|
|
@@ -135646,36 +135705,60 @@ function createVibeToolInnerExecutor(host, target2) {
|
|
|
135646
135705
|
const listed = rListed.isOk() ? rListed.Ok().find((t) => t.name === toolName) : void 0;
|
|
135647
135706
|
const wireName = vibeToolWireName(target2.appSlug, toolName);
|
|
135648
135707
|
if (listed === void 0) return json2(vibeToolCallAnswer(wireName, { reason: "no_tool" }));
|
|
135708
|
+
let runAs = {
|
|
135709
|
+
callerUserId: target2.callerUserId,
|
|
135710
|
+
...target2.payerUserId === void 0 ? {} : { payerUserId: target2.payerUserId }
|
|
135711
|
+
};
|
|
135649
135712
|
if (isTextLaterOffer(listed)) {
|
|
135650
|
-
const
|
|
135651
|
-
if (
|
|
135713
|
+
const yes = await recordTextLaterYes({ host, target: target2, wireName, toolName });
|
|
135714
|
+
if (yes.ok === false) return json2(yes.refusal);
|
|
135715
|
+
if (yes.runsAs !== void 0) runAs = { callerUserId: yes.runsAs, payerUserId: target2.payerUserId ?? target2.callerUserId };
|
|
135652
135716
|
}
|
|
135653
135717
|
const outcome = await host.call({
|
|
135654
135718
|
ownerHandle: target2.ownerHandle,
|
|
135655
135719
|
appSlug: target2.appSlug,
|
|
135656
|
-
callerUserId: target2.callerUserId,
|
|
135657
135720
|
toolName,
|
|
135658
135721
|
input: args.input ?? {},
|
|
135659
|
-
...
|
|
135722
|
+
...runAs
|
|
135660
135723
|
});
|
|
135661
135724
|
return json2(vibeToolCallAnswer(wireName, outcome));
|
|
135662
135725
|
}
|
|
135663
135726
|
return Result227.Err(`not a vibe-tool call: ${input.call.name}`);
|
|
135664
135727
|
};
|
|
135665
135728
|
}
|
|
135666
|
-
async function recordTextLaterYes(
|
|
135729
|
+
async function recordTextLaterYes({
|
|
135730
|
+
host,
|
|
135731
|
+
target: target2,
|
|
135732
|
+
wireName,
|
|
135733
|
+
toolName
|
|
135734
|
+
}) {
|
|
135735
|
+
const refuse16 = /* @__PURE__ */ __name((refusal5) => ({ ok: false, refusal: refusal5 }), "refuse");
|
|
135667
135736
|
const consent = target2.textLater;
|
|
135668
135737
|
if (consent === void 0) {
|
|
135669
|
-
return {
|
|
135738
|
+
return refuse16({
|
|
135670
135739
|
ok: false,
|
|
135671
135740
|
reason: "no-consent-record",
|
|
135672
135741
|
tool: wireName,
|
|
135673
135742
|
message: "This tool texts the person later, and their yes can't be recorded here, so it did not run. Nothing was done."
|
|
135674
|
-
};
|
|
135743
|
+
});
|
|
135675
135744
|
}
|
|
135676
135745
|
const rWho = await exception2Result295(() => consent.speaker());
|
|
135677
135746
|
const who = rWho.isOk() ? rWho.Ok() : { ok: false, message: "Could not tell who said yes just now, so the tool did not run. Nothing was done." };
|
|
135678
|
-
if (who.ok === false) return { ok: false, reason: "no-speaker", tool: wireName, message: who.message };
|
|
135747
|
+
if (who.ok === false) return refuse16({ ok: false, reason: "no-speaker", tool: wireName, message: who.message });
|
|
135748
|
+
const runsAs = who.runsAsSpeaker === true && who.userId !== target2.callerUserId ? who.userId : void 0;
|
|
135749
|
+
if (runsAs !== void 0) {
|
|
135750
|
+
const rTheirs = await exception2Result295(
|
|
135751
|
+
() => host.list({ ownerHandle: target2.ownerHandle, appSlug: target2.appSlug, callerUserId: runsAs })
|
|
135752
|
+
);
|
|
135753
|
+
if (!rTheirs.isOk() || !rTheirs.Ok().some((t) => t.name === toolName)) {
|
|
135754
|
+
return refuse16({
|
|
135755
|
+
ok: false,
|
|
135756
|
+
reason: "no-tool",
|
|
135757
|
+
tool: wireName,
|
|
135758
|
+
message: "This vibe doesn't offer that tool to the person who said yes, so it did not run. Nothing was done."
|
|
135759
|
+
});
|
|
135760
|
+
}
|
|
135761
|
+
}
|
|
135679
135762
|
const rAnswer = await exception2Result295(() => consent.answer());
|
|
135680
135763
|
const answer13 = rAnswer.isOk() ? rAnswer.Ok() : { method: "typed", text: null };
|
|
135681
135764
|
const rQuestion = await exception2Result295(() => consent.offerQuestion());
|
|
@@ -135692,13 +135775,13 @@ async function recordTextLaterYes(target2, wireName) {
|
|
|
135692
135775
|
answerText: personAnswerText(answer13.text)
|
|
135693
135776
|
})
|
|
135694
135777
|
);
|
|
135695
|
-
if (rRecorded.isOk() && rRecorded.Ok() === true) return void 0;
|
|
135696
|
-
return {
|
|
135778
|
+
if (rRecorded.isOk() && rRecorded.Ok() === true) return runsAs === void 0 ? { ok: true } : { ok: true, runsAs };
|
|
135779
|
+
return refuse16({
|
|
135697
135780
|
ok: false,
|
|
135698
135781
|
reason: "consent-not-recorded",
|
|
135699
135782
|
tool: wireName,
|
|
135700
135783
|
message: "Their yes could not be saved just now, so the tool did not run. Nothing was done; try again in a moment."
|
|
135701
|
-
};
|
|
135784
|
+
});
|
|
135702
135785
|
}
|
|
135703
135786
|
function withVibeToolCalls(vibeTools, rest) {
|
|
135704
135787
|
return (input) => input.call.name === LIST_VIBE_TOOLS_TOOL_NAME || input.call.name === CALL_VIBE_TOOL_TOOL_NAME ? vibeTools(input) : rest(input);
|
|
@@ -174331,6 +174414,7 @@ var init_phone_link_cmd = __esm({
|
|
|
174331
174414
|
"guest?": "boolean",
|
|
174332
174415
|
"asker?": "boolean",
|
|
174333
174416
|
"sponsored?": "boolean",
|
|
174417
|
+
"guestAsker?": "string",
|
|
174334
174418
|
"members?": "string"
|
|
174335
174419
|
});
|
|
174336
174420
|
ResPhoneLinkPayForGroupCli = type336({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibes-diy",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.365",
|
|
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.365",
|
|
45
|
+
"@vibes.diy/api-types": "14.3.365",
|
|
46
|
+
"@vibes.diy/call-ai-v2": "14.3.365",
|
|
47
|
+
"@vibes.diy/cmd-harness": "14.3.365",
|
|
48
|
+
"@vibes.diy/cmd-tools": "14.3.365",
|
|
49
|
+
"@vibes.diy/identity": "14.3.365",
|
|
50
|
+
"@vibes.diy/prompts": "14.3.365",
|
|
51
51
|
"acorn": "~8.19.0",
|
|
52
52
|
"acorn-jsx": "~5.3.2",
|
|
53
53
|
"arktype": "~2.2.9",
|