vibes-diy 2.6.9 → 2.6.11
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.js +4 -2
- package/cli/cmd-evento.js.map +1 -1
- package/cli/cmds/app-chats-cmd.d.ts +56 -0
- package/cli/cmds/app-chats-cmd.js +143 -0
- package/cli/cmds/app-chats-cmd.js.map +1 -0
- package/cli/cmds/app-chats-cmd.test.d.ts +1 -0
- package/cli/cmds/app-chats-cmd.test.js +189 -0
- package/cli/cmds/app-chats-cmd.test.js.map +1 -0
- package/cli/cmds/chat-response-render.d.ts +1 -0
- package/cli/cmds/chat-response-render.js +24 -1
- package/cli/cmds/chat-response-render.js.map +1 -1
- package/cli/cmds/chats-cmd.d.ts +10 -60
- package/cli/cmds/chats-cmd.js +18 -226
- package/cli/cmds/chats-cmd.js.map +1 -1
- package/cli/cmds/chats-cmd.test.js +40 -67
- package/cli/cmds/chats-cmd.test.js.map +1 -1
- package/cli/cmds/codegen-log-cmd.d.ts +84 -0
- package/cli/cmds/codegen-log-cmd.js +255 -0
- package/cli/cmds/codegen-log-cmd.js.map +1 -0
- package/cli/cmds/codegen-log-cmd.test.d.ts +1 -0
- package/cli/cmds/codegen-log-cmd.test.js +96 -0
- package/cli/cmds/codegen-log-cmd.test.js.map +1 -0
- package/cli/main.js +37 -5
- package/cli/main.js.map +1 -1
- package/package.json +6 -8
package/cli/cmds/chats-cmd.js
CHANGED
|
@@ -1,249 +1,41 @@
|
|
|
1
1
|
import { command, flag, option, optional, positional, string } from "cmd-ts";
|
|
2
|
-
import { Result, Option } from "@adviser/cement";
|
|
3
|
-
import { type } from "arktype";
|
|
4
|
-
import { resListApplicationChatsItem } from "@vibes.diy/api-types";
|
|
5
2
|
import { cmdTsDefaultArgs } from "../cli-ctx.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { extractRawText, extractUserPrompts, reconstructVerbatim, renderJsonl, resolveTurnFiles, turnBlocks, } from "./chat-response-render.js";
|
|
11
|
-
export const ReqChats = type({
|
|
12
|
-
type: "'vibes-diy.cli.chats'",
|
|
13
|
-
appSlug: "string",
|
|
14
|
-
ownerHandle: "string",
|
|
15
|
-
"chatId?": "string",
|
|
16
|
-
apiUrl: "string",
|
|
17
|
-
"response?": "boolean",
|
|
18
|
-
"raw?": "boolean",
|
|
19
|
-
"files?": "boolean",
|
|
20
|
-
"jsonl?": "boolean",
|
|
21
|
-
"user?": "boolean",
|
|
22
|
-
"promptId?": "string",
|
|
23
|
-
});
|
|
24
|
-
export function isReqChats(obj) {
|
|
25
|
-
return !(ReqChats(obj) instanceof type.errors);
|
|
26
|
-
}
|
|
27
|
-
export const ResChatResponse = type({
|
|
28
|
-
type: "'vibes-diy.cli.res-chat-response'",
|
|
29
|
-
output: "string",
|
|
30
|
-
});
|
|
31
|
-
export function isResChatResponse(obj) {
|
|
32
|
-
return !(ResChatResponse(obj) instanceof type.errors);
|
|
33
|
-
}
|
|
34
|
-
export const ResChatsList = type({
|
|
35
|
-
type: "'vibes-diy.cli.res-chats-list'",
|
|
36
|
-
items: resListApplicationChatsItem.array(),
|
|
37
|
-
});
|
|
38
|
-
export function isResChatsList(obj) {
|
|
39
|
-
return !(ResChatsList(obj) instanceof type.errors);
|
|
40
|
-
}
|
|
41
|
-
export const ResChatDetail = type({
|
|
42
|
-
type: "'vibes-diy.cli.res-chat-detail'",
|
|
43
|
-
chatId: "string",
|
|
44
|
-
ownerHandle: "string",
|
|
45
|
-
appSlug: "string",
|
|
46
|
-
prompts: type({
|
|
47
|
-
prompt: "string",
|
|
48
|
-
fsId: "string",
|
|
49
|
-
created: "string",
|
|
50
|
-
}).array(),
|
|
51
|
-
});
|
|
52
|
-
export function isResChatDetail(obj) {
|
|
53
|
-
return !(ResChatDetail(obj) instanceof type.errors);
|
|
54
|
-
}
|
|
55
|
-
export const chatsEvento = {
|
|
56
|
-
hash: "vibes-diy.cli.chats",
|
|
57
|
-
validate: (ctx) => {
|
|
58
|
-
if (isReqChats(ctx.enRequest)) {
|
|
59
|
-
return Promise.resolve(Result.Ok(Option.Some(ctx.enRequest)));
|
|
60
|
-
}
|
|
61
|
-
return Promise.resolve(Result.Ok(Option.None()));
|
|
62
|
-
},
|
|
63
|
-
handle: async (ctx) => {
|
|
64
|
-
const ectx = ctx.ctx.getOrThrow("cliCtx");
|
|
65
|
-
if (ectx.vibesDiyApiFactory === undefined) {
|
|
66
|
-
return Result.Err("Not logged in. Run 'vibes-diy login' first.");
|
|
67
|
-
}
|
|
68
|
-
const args = ctx.validated;
|
|
69
|
-
const api = ectx.vibesDiyApiFactory(args.apiUrl);
|
|
70
|
-
const ownerHandle = await resolveHandle(api, args.ownerHandle === "" ? undefined : args.ownerHandle);
|
|
71
|
-
const wantResponse = args.response === true || args.raw === true || args.files === true || args.jsonl === true || args.user === true;
|
|
72
|
-
if (wantResponse) {
|
|
73
|
-
if (ownerHandle === undefined) {
|
|
74
|
-
return Result.Err("Could not resolve handle. Pass --handle or run 'vibes-diy login'.");
|
|
75
|
-
}
|
|
76
|
-
const rResp = await api.getChatResponse({
|
|
77
|
-
ownerHandle,
|
|
78
|
-
appSlug: args.appSlug,
|
|
79
|
-
...(args.chatId !== undefined ? { chatId: args.chatId } : {}),
|
|
80
|
-
});
|
|
81
|
-
if (rResp.isErr()) {
|
|
82
|
-
return Result.Err(formatErr(rResp.Err()));
|
|
83
|
-
}
|
|
84
|
-
const turns = rResp.Ok().turns;
|
|
85
|
-
if (turns.length === 0) {
|
|
86
|
-
return sendMsg(ctx, {
|
|
87
|
-
type: "vibes-diy.cli.res-chat-response",
|
|
88
|
-
output: "(no response found for this chat)",
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
let turn = turns[0];
|
|
92
|
-
if (args.promptId !== undefined) {
|
|
93
|
-
turn = turns.find((t) => t.promptId === args.promptId);
|
|
94
|
-
if (turn === undefined) {
|
|
95
|
-
return Result.Err(`No turn with promptId ${args.promptId} in this chat.`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else if (turns.length > 1) {
|
|
99
|
-
ectx.output.stderr(`Showing newest turn ${turn.promptId} (${turns.length} turns total — use --turn <promptId> to pick another).\n`);
|
|
100
|
-
}
|
|
101
|
-
const blocks = turnBlocks(turn);
|
|
102
|
-
let body;
|
|
103
|
-
if (args.raw === true) {
|
|
104
|
-
const raw = extractRawText(blocks);
|
|
105
|
-
body =
|
|
106
|
-
raw ??
|
|
107
|
-
"(no raw capture for this turn — byte-faithful text is only stored for generations after raw capture shipped; try --jsonl or the default block-faithful view)";
|
|
108
|
-
}
|
|
109
|
-
else if (args.jsonl === true) {
|
|
110
|
-
body = renderJsonl(blocks);
|
|
111
|
-
}
|
|
112
|
-
else if (args.files === true) {
|
|
113
|
-
const rResolved = await resolveTurnFiles(turns, turn.promptId);
|
|
114
|
-
if (rResolved.isErr()) {
|
|
115
|
-
return Result.Err(`Failed to resolve stored stream: ${rResolved.Err().message}`);
|
|
116
|
-
}
|
|
117
|
-
body = JSON.stringify(rResolved.Ok().files, null, 2);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
body = reconstructVerbatim(blocks);
|
|
121
|
-
}
|
|
122
|
-
let output = body;
|
|
123
|
-
if (args.user === true) {
|
|
124
|
-
const userBlock = extractUserPrompts(blocks)
|
|
125
|
-
.map((p) => p
|
|
126
|
-
.split("\n")
|
|
127
|
-
.map((l) => `> ${l}`)
|
|
128
|
-
.join("\n"))
|
|
129
|
-
.join("\n>\n");
|
|
130
|
-
output = userBlock === "" ? body : `${userBlock}\n\n${body}`;
|
|
131
|
-
}
|
|
132
|
-
return sendMsg(ctx, { type: "vibes-diy.cli.res-chat-response", output });
|
|
133
|
-
}
|
|
134
|
-
switch (true) {
|
|
135
|
-
case args.chatId !== undefined: {
|
|
136
|
-
if (ownerHandle === undefined) {
|
|
137
|
-
return Result.Err("Could not resolve handle. Pass --handle or run 'vibes-diy login'.");
|
|
138
|
-
}
|
|
139
|
-
const rDetail = await api.getChatDetails({
|
|
140
|
-
ownerHandle,
|
|
141
|
-
appSlug: args.appSlug,
|
|
142
|
-
chatId: args.chatId,
|
|
143
|
-
});
|
|
144
|
-
if (rDetail.isErr()) {
|
|
145
|
-
return Result.Err(formatErr(rDetail.Err()));
|
|
146
|
-
}
|
|
147
|
-
const detail = rDetail.Ok();
|
|
148
|
-
return sendMsg(ctx, {
|
|
149
|
-
type: "vibes-diy.cli.res-chat-detail",
|
|
150
|
-
chatId: args.chatId,
|
|
151
|
-
ownerHandle: detail.ownerHandle,
|
|
152
|
-
appSlug: detail.appSlug,
|
|
153
|
-
prompts: detail.prompts,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
default: {
|
|
157
|
-
const items = [];
|
|
158
|
-
let cursor;
|
|
159
|
-
do {
|
|
160
|
-
const rPage = await api.listApplicationChats({
|
|
161
|
-
appSlug: args.appSlug,
|
|
162
|
-
...(ownerHandle !== undefined ? { ownerHandle } : {}),
|
|
163
|
-
limit: 100,
|
|
164
|
-
...(cursor !== undefined ? { cursor } : {}),
|
|
165
|
-
});
|
|
166
|
-
if (rPage.isErr()) {
|
|
167
|
-
return Result.Err(formatErr(rPage.Err()));
|
|
168
|
-
}
|
|
169
|
-
const page = rPage.Ok();
|
|
170
|
-
items.push(...page.items);
|
|
171
|
-
cursor = page.nextCursor;
|
|
172
|
-
} while (cursor !== undefined);
|
|
173
|
-
return sendMsg(ctx, { type: "vibes-diy.cli.res-chats-list", items });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
};
|
|
3
|
+
const SPLIT_MESSAGE = "'vibes-diy chats' has been split into two commands:\n" +
|
|
4
|
+
" vibes-diy codegen-log — the build transcript (what 'chats --response' used to show)\n" +
|
|
5
|
+
" vibes-diy app-chats — the deployed app's runtime in-app chats\n" +
|
|
6
|
+
"Please update your command and re-run.";
|
|
178
7
|
export function chatsCmd(ctx) {
|
|
179
8
|
return command({
|
|
180
9
|
name: "chats",
|
|
181
|
-
description: "
|
|
10
|
+
description: "(removed) Use 'codegen-log' or 'app-chats' instead.",
|
|
182
11
|
args: {
|
|
183
12
|
...cmdTsDefaultArgs(ctx),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
description: "App slug or handle/app-slug",
|
|
187
|
-
type: optional(string),
|
|
188
|
-
}),
|
|
189
|
-
chatId: positional({
|
|
190
|
-
displayName: "chatId",
|
|
191
|
-
description: "Chat ID to show prompt history for (omit to list all chats)",
|
|
192
|
-
type: optional(string),
|
|
193
|
-
}),
|
|
13
|
+
arg1: positional({ displayName: "vibe", description: "ignored", type: optional(string) }),
|
|
14
|
+
arg2: positional({ displayName: "chatId", description: "ignored", type: optional(string) }),
|
|
194
15
|
vibe: option({
|
|
195
16
|
long: "vibe",
|
|
196
|
-
description: "
|
|
17
|
+
description: "ignored",
|
|
197
18
|
type: string,
|
|
198
19
|
defaultValue: () => "",
|
|
199
20
|
defaultValueIsSerializable: true,
|
|
200
21
|
}),
|
|
201
22
|
handle: option({
|
|
202
23
|
long: "handle",
|
|
203
|
-
description: "
|
|
24
|
+
description: "ignored",
|
|
204
25
|
type: string,
|
|
205
26
|
defaultValue: () => "",
|
|
206
27
|
defaultValueIsSerializable: true,
|
|
207
28
|
}),
|
|
208
|
-
response: flag({
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
files: flag({
|
|
218
|
-
long: "files",
|
|
219
|
-
description: "With --response: the resolved path→content map (via the generate/edit resolver)",
|
|
220
|
-
}),
|
|
221
|
-
jsonl: flag({
|
|
222
|
-
long: "jsonl",
|
|
223
|
-
description: "With --response: the raw block events, one JSON object per line",
|
|
224
|
-
}),
|
|
225
|
-
user: flag({
|
|
226
|
-
long: "user",
|
|
227
|
-
description: "With --response: also print the user prompt(s) so the full transcript reads top-down",
|
|
228
|
-
}),
|
|
229
|
-
turn: option({
|
|
230
|
-
long: "turn",
|
|
231
|
-
description: "With --response: select a specific turn by promptId (default: newest)",
|
|
232
|
-
type: optional(string),
|
|
233
|
-
}),
|
|
29
|
+
response: flag({ long: "response", short: "r", description: "ignored" }),
|
|
30
|
+
raw: flag({ long: "raw", description: "ignored" }),
|
|
31
|
+
files: flag({ long: "files", description: "ignored" }),
|
|
32
|
+
jsonl: flag({ long: "jsonl", description: "ignored" }),
|
|
33
|
+
user: flag({ long: "user", description: "ignored" }),
|
|
34
|
+
turn: option({ long: "turn", description: "ignored", type: optional(string) }),
|
|
35
|
+
},
|
|
36
|
+
handler: () => {
|
|
37
|
+
throw new Error(SPLIT_MESSAGE);
|
|
234
38
|
},
|
|
235
|
-
handler: ctx.cliStream.enqueue(({ handle, chatId, vibe, appSlug, turn, ...rest }) => {
|
|
236
|
-
const resolved = resolveVibePositionals({ vibe, handle, positionals: [appSlug, chatId] });
|
|
237
|
-
const resolvedChatId = resolved.trailing[0];
|
|
238
|
-
const base = {
|
|
239
|
-
type: "vibes-diy.cli.chats",
|
|
240
|
-
...rest,
|
|
241
|
-
appSlug: resolved.appSlug,
|
|
242
|
-
ownerHandle: resolved.handle,
|
|
243
|
-
};
|
|
244
|
-
const withChat = resolvedChatId === undefined ? base : { ...base, chatId: resolvedChatId };
|
|
245
|
-
return turn === undefined ? withChat : { ...withChat, promptId: turn };
|
|
246
|
-
}),
|
|
247
39
|
});
|
|
248
40
|
}
|
|
249
41
|
//# sourceMappingURL=chats-cmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats-cmd.js","sourceRoot":"","sources":["../../../jsr/cli/cmds/chats-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"chats-cmd.js","sourceRoot":"","sources":["../../../jsr/cli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CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;YAClD,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;YACtD,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;YACtD,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;YACpD,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;SAC/E;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;QACjC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { run } from "cmd-ts";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
import { cmd_tsStream } from "../cmd-ts-stream.js";
|
|
4
|
-
import { chatsCmd
|
|
4
|
+
import { chatsCmd } from "./chats-cmd.js";
|
|
5
5
|
function makeCtx() {
|
|
6
6
|
const cliStream = cmd_tsStream();
|
|
7
7
|
return {
|
|
@@ -11,79 +11,52 @@ function makeCtx() {
|
|
|
11
11
|
exitCode: 0,
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const first = await firstRead;
|
|
20
|
-
await ctx.cliStream.close();
|
|
21
|
-
expect(first.done).toBe(false);
|
|
22
|
-
const request = first.value.result;
|
|
23
|
-
expect(isReqChats(request)).toBe(true);
|
|
24
|
-
return request;
|
|
25
|
-
}
|
|
26
|
-
describe("chatsCmd", () => {
|
|
27
|
-
it("bare positional vibe lists chats (no chatId)", async () => {
|
|
28
|
-
const request = await runChats(["my-app", "--api-url", "https://example.com/api"]);
|
|
29
|
-
expect(request.appSlug).toBe("my-app");
|
|
30
|
-
expect(request.ownerHandle).toBe("");
|
|
31
|
-
expect(request.chatId).toBeUndefined();
|
|
32
|
-
});
|
|
33
|
-
it("splits handle/app-slug positional into separate fields", async () => {
|
|
34
|
-
const request = await runChats(["jchris/hat-smeller"]);
|
|
35
|
-
expect(request.appSlug).toBe("hat-smeller");
|
|
36
|
-
expect(request.ownerHandle).toBe("jchris");
|
|
37
|
-
});
|
|
38
|
-
it("positional vibe + chatId shows a specific chat", async () => {
|
|
39
|
-
const request = await runChats(["jchris/hat-smeller", "chat-123"]);
|
|
40
|
-
expect(request.appSlug).toBe("hat-smeller");
|
|
41
|
-
expect(request.ownerHandle).toBe("jchris");
|
|
42
|
-
expect(request.chatId).toBe("chat-123");
|
|
43
|
-
});
|
|
44
|
-
it("--vibe works without a positional arg", async () => {
|
|
45
|
-
const request = await runChats(["--vibe", "alice/cool-app"]);
|
|
46
|
-
expect(request.appSlug).toBe("cool-app");
|
|
47
|
-
expect(request.ownerHandle).toBe("alice");
|
|
48
|
-
expect(request.chatId).toBeUndefined();
|
|
49
|
-
});
|
|
50
|
-
it("--vibe shifts the lone positional to chatId", async () => {
|
|
51
|
-
const request = await runChats(["chat-123", "--vibe", "alice/cool-app"]);
|
|
52
|
-
expect(request.appSlug).toBe("cool-app");
|
|
53
|
-
expect(request.ownerHandle).toBe("alice");
|
|
54
|
-
expect(request.chatId).toBe("chat-123");
|
|
14
|
+
describe("chatsCmd (retired stub)", () => {
|
|
15
|
+
it("warns and exits non-zero with no args", async () => {
|
|
16
|
+
const ctx = makeCtx();
|
|
17
|
+
await expect(run(chatsCmd(ctx), [])).rejects.toThrow("'vibes-diy chats' has been split");
|
|
18
|
+
await ctx.cliStream.close();
|
|
55
19
|
});
|
|
56
|
-
it("
|
|
57
|
-
const
|
|
58
|
-
expect(
|
|
59
|
-
|
|
20
|
+
it("warns and exits non-zero with a vibe positional", async () => {
|
|
21
|
+
const ctx = makeCtx();
|
|
22
|
+
await expect(run(chatsCmd(ctx), ["jchris/hat-smeller"])).rejects.toThrow("'vibes-diy chats' has been split");
|
|
23
|
+
await ctx.cliStream.close();
|
|
60
24
|
});
|
|
61
|
-
it("
|
|
62
|
-
const
|
|
63
|
-
expect(
|
|
64
|
-
|
|
65
|
-
expect(request.files).toBeFalsy();
|
|
66
|
-
expect(request.jsonl).toBeFalsy();
|
|
25
|
+
it("warns and exits non-zero with vibe + chatId positionals", async () => {
|
|
26
|
+
const ctx = makeCtx();
|
|
27
|
+
await expect(run(chatsCmd(ctx), ["jchris/hat-smeller", "chat-123"])).rejects.toThrow("'vibes-diy chats' has been split");
|
|
28
|
+
await ctx.cliStream.close();
|
|
67
29
|
});
|
|
68
|
-
it("
|
|
69
|
-
const
|
|
70
|
-
expect(
|
|
71
|
-
|
|
72
|
-
expect(jsonlReq.jsonl).toBe(true);
|
|
30
|
+
it("error message mentions both replacement commands", async () => {
|
|
31
|
+
const ctx = makeCtx();
|
|
32
|
+
await expect(run(chatsCmd(ctx), [])).rejects.toThrow("codegen-log");
|
|
33
|
+
await ctx.cliStream.close();
|
|
73
34
|
});
|
|
74
|
-
it("
|
|
75
|
-
const
|
|
76
|
-
expect(
|
|
77
|
-
|
|
78
|
-
expect(withoutTurn.promptId).toBeUndefined();
|
|
35
|
+
it("error message mentions app-chats", async () => {
|
|
36
|
+
const ctx = makeCtx();
|
|
37
|
+
await expect(run(chatsCmd(ctx), [])).rejects.toThrow("app-chats");
|
|
38
|
+
await ctx.cliStream.close();
|
|
79
39
|
});
|
|
80
|
-
it("--
|
|
81
|
-
const
|
|
82
|
-
expect(
|
|
40
|
+
it("absorbs the legacy --response flag and still shows migration guidance", async () => {
|
|
41
|
+
const ctx = makeCtx();
|
|
42
|
+
await expect(run(chatsCmd(ctx), ["jchris/hat-smeller", "chat-123", "--response"])).rejects.toThrow("'vibes-diy chats' has been split");
|
|
43
|
+
await ctx.cliStream.close();
|
|
83
44
|
});
|
|
84
|
-
it("
|
|
45
|
+
it("absorbs the full legacy flag set without an arg-parse error", async () => {
|
|
85
46
|
const ctx = makeCtx();
|
|
86
|
-
await expect(run(chatsCmd(ctx), [
|
|
47
|
+
await expect(run(chatsCmd(ctx), [
|
|
48
|
+
"jchris/hat-smeller",
|
|
49
|
+
"chat-123",
|
|
50
|
+
"--response",
|
|
51
|
+
"--raw",
|
|
52
|
+
"--files",
|
|
53
|
+
"--jsonl",
|
|
54
|
+
"--user",
|
|
55
|
+
"--turn",
|
|
56
|
+
"prompt-9",
|
|
57
|
+
"--handle",
|
|
58
|
+
"jchris",
|
|
59
|
+
])).rejects.toThrow("'vibes-diy chats' has been split");
|
|
87
60
|
await ctx.cliStream.close();
|
|
88
61
|
});
|
|
89
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats-cmd.test.js","sourceRoot":"","sources":["../../../jsr/cli/cmds/chats-cmd.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,
|
|
1
|
+
{"version":3,"file":"chats-cmd.test.js","sourceRoot":"","sources":["../../../jsr/cli/cmds/chats-cmd.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,SAAS,OAAO;IACd,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC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S;YACT,QAAQ;YACR,QAAQ;YACR,UAAU;YACV,UAAU;YACV,QAAQ;SACT,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;QACtD,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { EventoHandler } from "@adviser/cement";
|
|
2
|
+
import { CliCtx } from "../cli-ctx.js";
|
|
3
|
+
import { WrapCmdTSMsg } from "../cmd-evento.js";
|
|
4
|
+
export declare const ReqCodegenLog: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
5
|
+
type: "vibes-diy.cli.codegen-log";
|
|
6
|
+
appSlug: string;
|
|
7
|
+
ownerHandle: string;
|
|
8
|
+
chatId?: string | undefined;
|
|
9
|
+
apiUrl: string;
|
|
10
|
+
response?: boolean | undefined;
|
|
11
|
+
raw?: boolean | undefined;
|
|
12
|
+
files?: boolean | undefined;
|
|
13
|
+
jsonl?: boolean | undefined;
|
|
14
|
+
user?: boolean | undefined;
|
|
15
|
+
promptId?: string | undefined;
|
|
16
|
+
}, {}>;
|
|
17
|
+
export type ReqCodegenLog = typeof ReqCodegenLog.infer;
|
|
18
|
+
export declare function isReqCodegenLog(obj: unknown): obj is ReqCodegenLog;
|
|
19
|
+
export declare const ResCodegenLogResponse: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
20
|
+
type: "vibes-diy.cli.res-codegen-log-response";
|
|
21
|
+
output: string;
|
|
22
|
+
}, {}>;
|
|
23
|
+
export type ResCodegenLogResponse = typeof ResCodegenLogResponse.infer;
|
|
24
|
+
export declare function isResCodegenLogResponse(obj: unknown): obj is ResCodegenLogResponse;
|
|
25
|
+
export declare const ResCodegenLogList: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
26
|
+
type: "vibes-diy.cli.res-codegen-log-list";
|
|
27
|
+
items: {
|
|
28
|
+
chatId: string;
|
|
29
|
+
appSlug: string;
|
|
30
|
+
ownerHandle: string;
|
|
31
|
+
created: string;
|
|
32
|
+
}[];
|
|
33
|
+
}, {}>;
|
|
34
|
+
export type ResCodegenLogList = typeof ResCodegenLogList.infer;
|
|
35
|
+
export declare function isResCodegenLogList(obj: unknown): obj is ResCodegenLogList;
|
|
36
|
+
export declare const ResCodegenLogDetail: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
37
|
+
type: "vibes-diy.cli.res-codegen-log-detail";
|
|
38
|
+
chatId: string;
|
|
39
|
+
ownerHandle: string;
|
|
40
|
+
appSlug: string;
|
|
41
|
+
prompts: {
|
|
42
|
+
prompt: string;
|
|
43
|
+
fsId: string;
|
|
44
|
+
created: string;
|
|
45
|
+
}[];
|
|
46
|
+
}, {}>;
|
|
47
|
+
export type ResCodegenLogDetail = typeof ResCodegenLogDetail.infer;
|
|
48
|
+
export declare function isResCodegenLogDetail(obj: unknown): obj is ResCodegenLogDetail;
|
|
49
|
+
type ResCodegenLog = ResCodegenLogList | ResCodegenLogDetail | ResCodegenLogResponse;
|
|
50
|
+
export declare const codegenLogEvento: EventoHandler<WrapCmdTSMsg<unknown>, ReqCodegenLog, ResCodegenLog>;
|
|
51
|
+
export declare function codegenLogCmd(ctx: CliCtx): Partial<import("cmd-ts/dist/cjs/argparser.js").Register> & {
|
|
52
|
+
parse(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<{
|
|
53
|
+
appSlug: string | undefined;
|
|
54
|
+
chatId: string | undefined;
|
|
55
|
+
vibe: string;
|
|
56
|
+
handle: string;
|
|
57
|
+
response: boolean;
|
|
58
|
+
raw: boolean;
|
|
59
|
+
files: boolean;
|
|
60
|
+
jsonl: boolean;
|
|
61
|
+
user: boolean;
|
|
62
|
+
turn: string | undefined;
|
|
63
|
+
apiUrl: string;
|
|
64
|
+
json: boolean;
|
|
65
|
+
text: boolean;
|
|
66
|
+
}>>;
|
|
67
|
+
} & import("cmd-ts/dist/cjs/helpdoc.js").PrintHelp & import("cmd-ts/dist/cjs/helpdoc.js").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc.js").Named & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned> & import("cmd-ts/dist/cjs/argparser.js").Register & import("cmd-ts/dist/cjs/runner.js").Handling<{
|
|
68
|
+
appSlug: string | undefined;
|
|
69
|
+
chatId: string | undefined;
|
|
70
|
+
vibe: string;
|
|
71
|
+
handle: string;
|
|
72
|
+
response: boolean;
|
|
73
|
+
raw: boolean;
|
|
74
|
+
files: boolean;
|
|
75
|
+
jsonl: boolean;
|
|
76
|
+
user: boolean;
|
|
77
|
+
turn: string | undefined;
|
|
78
|
+
apiUrl: string;
|
|
79
|
+
json: boolean;
|
|
80
|
+
text: boolean;
|
|
81
|
+
}, never> & {
|
|
82
|
+
run(context: import("cmd-ts/dist/cjs/argparser.js").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser.js").ParsingResult<never>>;
|
|
83
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc.js").Versioned & import("cmd-ts/dist/cjs/helpdoc.js").Descriptive & import("cmd-ts/dist/cjs/helpdoc.js").Aliased>;
|
|
84
|
+
export {};
|