vibes-diy 14.3.487 → 14.3.488

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.
@@ -1,5 +1,5 @@
1
1
  import { command, flag, option, optional, positional, string } from "cmd-ts";
2
- import { BuildURI, Result, Option } from "@adviser/cement";
2
+ import { BuildURI, Result, exception2Result, Option, } from "@adviser/cement";
3
3
  import { type } from "arktype";
4
4
  import { cmdTsDefaultArgs } from "../cli-ctx.js";
5
5
  import { sendMsg, sendProgress } from "../cmd-evento.js";
@@ -143,22 +143,21 @@ async function runEditTurnOn(ctx, args, api) {
143
143
  const announcedModel = args.model;
144
144
  await sendProgress(ctx, "info", announcedModel ? `Editing with ${announcedModel}...` : "Editing...");
145
145
  const ownerHandle = await resolveHandle(api, args.ownerHandle === "" ? undefined : args.ownerHandle);
146
- let session;
147
- try {
148
- session = await openChatSession({
149
- api: api,
150
- openReq: { ownerHandle, appSlug: args.appSlug, mode: "codegen" },
151
- decode: { keepBlock: true },
152
- renderError: (e) => formatErr(e),
153
- });
154
- }
155
- catch (e) {
146
+ const rSession = await exception2Result(() => openChatSession({
147
+ api: api,
148
+ openReq: { ownerHandle, appSlug: args.appSlug, mode: "codegen" },
149
+ decode: { keepBlock: true },
150
+ renderError: (e) => formatErr(e),
151
+ }));
152
+ if (rSession.isErr()) {
153
+ const e = rSession.Err();
156
154
  if (e instanceof OpenChatSessionError && e.stage === "overloaded") {
157
155
  return Result.Err("Every codegen shard for this account is at capacity, so the server started no build. " +
158
156
  "Nothing was edited — wait for your other builds to finish and re-run.");
159
157
  }
160
158
  return Result.Err(`Failed to open chat: ${e instanceof Error ? e.message : String(e)}`);
161
159
  }
160
+ const session = rSession.Ok();
162
161
  await sendProgress(ctx, "info", `Editing ${session.ownerHandle}/${session.appSlug}`);
163
162
  const feed = makeChatEventFeed(session, {
164
163
  onReopen: (count) => {