@yukino.js/yukino 0.0.4 → 0.0.6
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/README.md +90 -64
- package/dist/acp-U7GA5YRP.js +14 -0
- package/dist/anthropic-3TRLGKHZ.js +4 -0
- package/dist/{bwrap-MLSZLWHD.js → bwrap-BZ7Q2A5B.js} +1 -1
- package/dist/chunk-3OULXPVI.js +5 -0
- package/dist/chunk-E7FXB7TA.js +61 -0
- package/dist/{chunk-GYBJR2RB.js → chunk-IW5L5276.js} +2 -2
- package/dist/chunk-KILUTRHM.js +4 -0
- package/dist/chunk-ME5UYXP4.js +1031 -0
- package/dist/chunk-NAQRFHUX.js +4 -0
- package/dist/chunk-P6DHMU7R.js +4 -0
- package/dist/{chunk-JNCMSXQZ.js → chunk-SYLHBECV.js} +2 -2
- package/dist/chunk-TPWRDFEX.js +4 -0
- package/dist/chunk-VM4YKTHC.js +10 -0
- package/dist/chunk-WVT2D5AR.js +4 -0
- package/dist/chunk-XFVM5ZZL.js +241 -0
- package/dist/{devtools-YWVUN4HX.js → devtools-UVGRIXO2.js} +1 -1
- package/dist/esm-5V3TYPZK.js +229 -0
- package/dist/lib/{anthropic-MSGL4VBM.js → anthropic-GAD2PGEN.js} +2 -5
- package/dist/lib/{bwrap-2OL7VPSO.js → bwrap-STOJ4TEH.js} +1 -1
- package/dist/lib/chunk-3ONNRNKQ.js +1335 -0
- package/dist/lib/{chunk-FLKB4BK7.js → chunk-6NYUYSER.js} +16 -4
- package/dist/lib/{chunk-P3HXGEQQ.js → chunk-CBBSDV2D.js} +1 -1
- package/dist/lib/{chunk-ENTAZT2J.js → chunk-D3SXNTPZ.js} +449 -60
- package/dist/lib/{chunk-YIWNQ7OA.js → chunk-MGPT7DWP.js} +1 -0
- package/dist/lib/{chunk-24L3QT3J.js → chunk-OYQY3Q45.js} +68 -27
- package/dist/lib/{chunk-E6VFL5IO.js → chunk-RVSLQCZ5.js} +101 -59
- package/dist/lib/index.d.ts +3390 -2240
- package/dist/lib/index.js +19719 -13372
- package/dist/lib/{openai-DL5VBJR4.js → openai-BYOGAZU5.js} +2 -3
- package/dist/lib/{providers-SMRZVJ7O.js → providers-YHVXG3PP.js} +1 -1
- package/dist/lib/{seatbelt-WO7YWKLR.js → seatbelt-VE3I3EGH.js} +1 -1
- package/dist/lib/{tool-filter-PY6XY254.js → tool-filter-HUVHJN3O.js} +3 -3
- package/dist/main.js +203 -194
- package/dist/{openai-AQNX24XU.js → openai-PYPO6SKD.js} +15 -15
- package/dist/{providers-FZUDVU4M.js → providers-6UOA2HYN.js} +1 -1
- package/dist/{seatbelt-JOCANLYS.js → seatbelt-3YN3GMQO.js} +1 -1
- package/dist/server-NXQ6REG3.js +4 -0
- package/dist/tool-filter-XZ7I6KU7.js +4 -0
- package/package.json +69 -32
- package/dist/acp-JCR6GVC3.js +0 -14
- package/dist/agent-56R4TACG.js +0 -4
- package/dist/anthropic-CEUDAJL2.js +0 -4
- package/dist/chunk-6DXHDARX.js +0 -607
- package/dist/chunk-77W2UPS2.js +0 -4
- package/dist/chunk-7DLUKIPE.js +0 -5
- package/dist/chunk-HLE7243Q.js +0 -4
- package/dist/chunk-K4BYVVW7.js +0 -5
- package/dist/chunk-L2BWSPCF.js +0 -10
- package/dist/chunk-OFC2GD5K.js +0 -4
- package/dist/chunk-RCXKUD3Y.js +0 -4
- package/dist/chunk-SAJCBGHL.js +0 -4
- package/dist/chunk-U2CS2E2F.js +0 -237
- package/dist/chunk-UPNNYP7M.js +0 -60
- package/dist/chunk-XO7ITAWR.js +0 -4
- package/dist/chunk-ZETIYALB.js +0 -164
- package/dist/esm-NCEEJIH3.js +0 -229
- package/dist/lib/agent-INEHZXP3.js +0 -16
- package/dist/lib/chunk-6AKRDUQF.js +0 -259
- package/dist/lib/chunk-7SU77J32.js +0 -599
- package/dist/lib/chunk-BMODZ6SU.js +0 -673
- package/dist/lib/chunk-DF3ITW4K.js +0 -3470
- package/dist/lib/chunk-F2YJG72O.js +0 -150
- package/dist/lib/chunk-MDX24JQ5.js +0 -619
- package/dist/lib/permissions-Q4FBU5VD.js +0 -19
- package/dist/permissions-VCDMNX3L.js +0 -4
- package/dist/server-VLJWUETV.js +0 -4
- package/dist/tool-filter-BQZDV3TF.js +0 -4
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__export
|
|
3
|
-
} from "./chunk-MLKGABMK.js";
|
|
4
|
-
|
|
5
|
-
// src/tools/types.ts
|
|
6
|
-
var types_exports = {};
|
|
7
|
-
__export(types_exports, {
|
|
8
|
-
SKIP_DIRS: () => SKIP_DIRS,
|
|
9
|
-
isToolResultContentBlock: () => isToolResultContentBlock,
|
|
10
|
-
normalizeToolResultContentBlock: () => normalizeToolResultContentBlock
|
|
11
|
-
});
|
|
12
|
-
function isRecord(value) {
|
|
13
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14
|
-
}
|
|
15
|
-
var IMAGE_MEDIA_TYPES = /* @__PURE__ */ new Set([
|
|
16
|
-
"image/jpeg",
|
|
17
|
-
"image/png",
|
|
18
|
-
"image/gif",
|
|
19
|
-
"image/webp"
|
|
20
|
-
]);
|
|
21
|
-
function isImageMediaType(value) {
|
|
22
|
-
return IMAGE_MEDIA_TYPES.has(value);
|
|
23
|
-
}
|
|
24
|
-
function normalizeTextBlock(value) {
|
|
25
|
-
return isRecord(value) && value.type === "text" && typeof value.text === "string" ? { type: "text", text: value.text } : null;
|
|
26
|
-
}
|
|
27
|
-
function normalizeImageBlock(value) {
|
|
28
|
-
if (!isRecord(value) || value.type !== "image" || !isRecord(value.source)) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
if (value.source.type === "url" && typeof value.source.url === "string") {
|
|
32
|
-
return { type: "image", source: { type: "url", url: value.source.url } };
|
|
33
|
-
}
|
|
34
|
-
if (value.source.type === "base64" && typeof value.source.media_type === "string" && isImageMediaType(value.source.media_type) && typeof value.source.data === "string") {
|
|
35
|
-
return {
|
|
36
|
-
type: "image",
|
|
37
|
-
source: {
|
|
38
|
-
type: "base64",
|
|
39
|
-
media_type: value.source.media_type,
|
|
40
|
-
data: value.source.data
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function normalizeDocumentBlock(value) {
|
|
47
|
-
if (value.type !== "document" || !isRecord(value.source)) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
let source = null;
|
|
51
|
-
if (value.source.type === "url" && typeof value.source.url === "string") {
|
|
52
|
-
source = { type: "url", url: value.source.url };
|
|
53
|
-
} else if (value.source.type === "base64" && value.source.media_type === "application/pdf" && typeof value.source.data === "string") {
|
|
54
|
-
source = {
|
|
55
|
-
type: "base64",
|
|
56
|
-
media_type: "application/pdf",
|
|
57
|
-
data: value.source.data
|
|
58
|
-
};
|
|
59
|
-
} else if (value.source.type === "text" && value.source.media_type === "text/plain" && typeof value.source.data === "string") {
|
|
60
|
-
source = {
|
|
61
|
-
type: "text",
|
|
62
|
-
media_type: "text/plain",
|
|
63
|
-
data: value.source.data
|
|
64
|
-
};
|
|
65
|
-
} else if (value.source.type === "content") {
|
|
66
|
-
if (typeof value.source.content === "string") {
|
|
67
|
-
source = { type: "content", content: value.source.content };
|
|
68
|
-
} else if (Array.isArray(value.source.content)) {
|
|
69
|
-
const content = [];
|
|
70
|
-
for (const raw of value.source.content) {
|
|
71
|
-
const block = normalizeTextBlock(raw) ?? normalizeImageBlock(raw);
|
|
72
|
-
if (!block) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
content.push(block);
|
|
76
|
-
}
|
|
77
|
-
source = { type: "content", content };
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (!source) {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
type: "document",
|
|
85
|
-
source,
|
|
86
|
-
...typeof value.title === "string" || value.title === null ? { title: value.title } : {},
|
|
87
|
-
...typeof value.context === "string" || value.context === null ? { context: value.context } : {}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function normalizeToolResultContentBlock(value) {
|
|
91
|
-
const text = normalizeTextBlock(value);
|
|
92
|
-
if (text) {
|
|
93
|
-
return text;
|
|
94
|
-
}
|
|
95
|
-
const image = normalizeImageBlock(value);
|
|
96
|
-
if (image) {
|
|
97
|
-
return image;
|
|
98
|
-
}
|
|
99
|
-
if (!isRecord(value)) {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
if (value.type === "tool_reference" && typeof value.tool_name === "string") {
|
|
103
|
-
return { type: "tool_reference", tool_name: value.tool_name };
|
|
104
|
-
}
|
|
105
|
-
if (value.type === "search_result" && typeof value.source === "string" && typeof value.title === "string" && Array.isArray(value.content)) {
|
|
106
|
-
const content = [];
|
|
107
|
-
for (const raw of value.content) {
|
|
108
|
-
const block = normalizeTextBlock(raw);
|
|
109
|
-
if (!block) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
content.push(block);
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
type: "search_result",
|
|
116
|
-
source: value.source,
|
|
117
|
-
title: value.title,
|
|
118
|
-
content
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return normalizeDocumentBlock(value);
|
|
122
|
-
}
|
|
123
|
-
function isToolResultContentBlock(value) {
|
|
124
|
-
return normalizeToolResultContentBlock(value) !== null;
|
|
125
|
-
}
|
|
126
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
127
|
-
".agents",
|
|
128
|
-
".git",
|
|
129
|
-
// Git
|
|
130
|
-
".yukino",
|
|
131
|
-
// Yukino
|
|
132
|
-
".next",
|
|
133
|
-
// Next.js
|
|
134
|
-
".venv",
|
|
135
|
-
// Python venv
|
|
136
|
-
".mypy_cache",
|
|
137
|
-
// Python mypy
|
|
138
|
-
"__pycache__",
|
|
139
|
-
// Python
|
|
140
|
-
"dist",
|
|
141
|
-
// Webpack, Vite
|
|
142
|
-
"node_modules"
|
|
143
|
-
// Node.js
|
|
144
|
-
]);
|
|
145
|
-
|
|
146
|
-
export {
|
|
147
|
-
normalizeToolResultContentBlock,
|
|
148
|
-
SKIP_DIRS,
|
|
149
|
-
types_exports
|
|
150
|
-
};
|