skydive-cli 0.1.0-beta.180 → 0.1.0-beta.186

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/dist/js/bin.mjs CHANGED
@@ -31,7 +31,7 @@ var __exportAll = (all, no_symbols) => {
31
31
 
32
32
  //#endregion
33
33
  //#region package.json
34
- var version$1 = "0.1.0-beta.180";
34
+ var version$1 = "0.1.0-beta.186";
35
35
 
36
36
  //#endregion
37
37
  //#region src/types.ts
@@ -2152,7 +2152,7 @@ const chatCommand = {
2152
2152
  printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
2153
2153
  process.exit(1);
2154
2154
  }
2155
- const { runChat } = await import("./boot-B-eA8M6t.mjs");
2155
+ const { runChat } = await import("./boot-BEMmVR8C.mjs");
2156
2156
  await runChat({
2157
2157
  appUrl,
2158
2158
  sessionToken: session.value.sessionToken,
@@ -3330,7 +3330,7 @@ const switchCommand = {
3330
3330
  printError("The workspace picker needs the Bun runtime and it could not be set up automatically. Pass a workspace slug instead, or install Bun and retry.");
3331
3331
  process.exit(1);
3332
3332
  }
3333
- const { runWorkspacePicker } = await import("./boot-B-eA8M6t.mjs");
3333
+ const { runWorkspacePicker } = await import("./boot-BEMmVR8C.mjs");
3334
3334
  await runWorkspacePicker(session);
3335
3335
  return;
3336
3336
  }
@@ -1953,6 +1953,30 @@ function parseDroppedPaths(text) {
1953
1953
  }
1954
1954
  return paths;
1955
1955
  }
1956
+ /** Decide how to handle a paste. `kind: 'binary'` events carry the mime of
1957
+ * bytes the terminal forwarded; text events carry the decoded paste text.
1958
+ *
1959
+ * The empty-text case is the fix for "can't paste an image": on macOS the
1960
+ * reflex is Cmd+V, which the terminal turns into a bracketed *text* paste, so
1961
+ * a screenshot on the clipboard arrives as empty bytes. We route that to an OS
1962
+ * clipboard read instead of dropping it, matching the explicit ctrl+v path. */
1963
+ function routePaste(input) {
1964
+ if (input.kind === "binary") {
1965
+ if (input.mimeType?.startsWith("image/")) return {
1966
+ kind: "binary-image",
1967
+ mediaType: input.mimeType
1968
+ };
1969
+ return { kind: "text" };
1970
+ }
1971
+ const paths = parseDroppedPaths(input.text);
1972
+ if (paths) return {
1973
+ kind: "dropped-paths",
1974
+ paths,
1975
+ text: input.text
1976
+ };
1977
+ if (input.text.trim() === "") return { kind: "clipboard-image" };
1978
+ return { kind: "text" };
1979
+ }
1956
1980
  /**
1957
1981
  * Resolve path candidates into images using the filesystem and file magic,
1958
1982
  * not extensions. The whole batch must be regular image files; otherwise the
@@ -5171,31 +5195,40 @@ function ChatScreen({ agent, conversation }) {
5171
5195
  }, [stageImages]);
5172
5196
  usePaste((event) => {
5173
5197
  if (modelPickerOpen || themePickerOpen || helpOpen || credPromptOpen || grantPrompt) return;
5174
- const mime = event.metadata?.mimeType;
5175
- if (event.metadata?.kind === "binary") {
5176
- if (mime?.startsWith("image/")) {
5198
+ const text = event.metadata?.kind === "binary" ? "" : decodePasteBytes(event.bytes);
5199
+ const route = routePaste({
5200
+ kind: event.metadata?.kind,
5201
+ mimeType: event.metadata?.mimeType,
5202
+ text
5203
+ });
5204
+ switch (route.kind) {
5205
+ case "binary-image": {
5177
5206
  event.preventDefault();
5178
- const ext = mime.split("/")[1]?.split("+")[0] ?? "png";
5207
+ const ext = route.mediaType.split("/")[1]?.split("+")[0] ?? "png";
5179
5208
  stageImages([{
5180
5209
  fileName: `pasted-image-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${ext}`,
5181
- mediaType: mime,
5210
+ mediaType: route.mediaType,
5182
5211
  data: event.bytes
5183
5212
  }]);
5184
- }
5185
- return;
5186
- }
5187
- const text = decodePasteBytes(event.bytes);
5188
- const paths = parseDroppedPaths(text);
5189
- if (!paths) return;
5190
- event.preventDefault();
5191
- resolveDroppedImages(paths).then((images) => {
5192
- if (images) {
5193
- stageImages(images);
5194
5213
  return;
5195
5214
  }
5196
- composerRef.current?.insertText(text);
5197
- handleComposerChange();
5198
- });
5215
+ case "clipboard-image":
5216
+ event.preventDefault();
5217
+ pasteImage();
5218
+ return;
5219
+ case "dropped-paths":
5220
+ event.preventDefault();
5221
+ resolveDroppedImages(route.paths).then((images) => {
5222
+ if (images) {
5223
+ stageImages(images);
5224
+ return;
5225
+ }
5226
+ composerRef.current?.insertText(route.text);
5227
+ handleComposerChange();
5228
+ });
5229
+ return;
5230
+ case "text": return;
5231
+ }
5199
5232
  });
5200
5233
  const applyComposerText = useCallback((text, caret) => {
5201
5234
  const composer = composerRef.current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skydive-cli",
3
- "version": "0.1.0-beta.180",
3
+ "version": "0.1.0-beta.186",
4
4
  "description": "Skydive CLI — manage AI agents from the command line",
5
5
  "homepage": "https://skydive.com",
6
6
  "license": "MIT",