@struktoai/mirage-agents 0.0.1-alpha.1
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 +230 -0
- package/dist/chunk-KAHWIK63.js +38 -0
- package/dist/chunk-KAHWIK63.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/langchain/index.d.ts +30 -0
- package/dist/langchain/index.js +306 -0
- package/dist/langchain/index.js.map +1 -0
- package/dist/mastra/index.d.ts +45 -0
- package/dist/mastra/index.js +146 -0
- package/dist/mastra/index.js.map +1 -0
- package/dist/openai/index.d.ts +25 -0
- package/dist/openai/index.js +81 -0
- package/dist/openai/index.js.map +1 -0
- package/dist/pi/index.d.ts +21 -0
- package/dist/pi/index.js +142 -0
- package/dist/pi/index.js.map +1 -0
- package/dist/prompt-CbBVJuUY.d.ts +11 -0
- package/dist/vercel/index.d.ts +70 -0
- package/dist/vercel/index.js +235 -0
- package/dist/vercel/index.js.map +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// src/vercel/index.ts
|
|
2
|
+
import { encodeBase64 } from "@struktoai/mirage-core";
|
|
3
|
+
import { tool } from "ai";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
function parentOf(path) {
|
|
6
|
+
const trimmed = path.replace(/\/+$/, "");
|
|
7
|
+
const idx = trimmed.lastIndexOf("/");
|
|
8
|
+
if (idx <= 0) return "/";
|
|
9
|
+
return trimmed.slice(0, idx);
|
|
10
|
+
}
|
|
11
|
+
async function ensureParent(ws, path) {
|
|
12
|
+
const parent = parentOf(path);
|
|
13
|
+
if (parent === "/" || parent === "") return;
|
|
14
|
+
if (await ws.fs.exists(parent)) return;
|
|
15
|
+
await ensureParent(ws, parent);
|
|
16
|
+
try {
|
|
17
|
+
await ws.fs.mkdir(parent);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
if (!await ws.fs.exists(parent)) throw err;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var TEXT_EXTS = /* @__PURE__ */ new Set([
|
|
23
|
+
"txt",
|
|
24
|
+
"md",
|
|
25
|
+
"json",
|
|
26
|
+
"jsonl",
|
|
27
|
+
"yaml",
|
|
28
|
+
"yml",
|
|
29
|
+
"csv",
|
|
30
|
+
"tsv",
|
|
31
|
+
"xml",
|
|
32
|
+
"html",
|
|
33
|
+
"htm",
|
|
34
|
+
"js",
|
|
35
|
+
"mjs",
|
|
36
|
+
"cjs",
|
|
37
|
+
"ts",
|
|
38
|
+
"tsx",
|
|
39
|
+
"jsx",
|
|
40
|
+
"py",
|
|
41
|
+
"rb",
|
|
42
|
+
"rs",
|
|
43
|
+
"go",
|
|
44
|
+
"java",
|
|
45
|
+
"c",
|
|
46
|
+
"cpp",
|
|
47
|
+
"h",
|
|
48
|
+
"hpp",
|
|
49
|
+
"sh",
|
|
50
|
+
"bash",
|
|
51
|
+
"zsh",
|
|
52
|
+
"sql",
|
|
53
|
+
"log",
|
|
54
|
+
"env",
|
|
55
|
+
"ini",
|
|
56
|
+
"toml",
|
|
57
|
+
"conf",
|
|
58
|
+
"cfg"
|
|
59
|
+
]);
|
|
60
|
+
var PRESENTABLE_BINARY = /* @__PURE__ */ new Set([
|
|
61
|
+
"application/pdf",
|
|
62
|
+
"image/jpeg",
|
|
63
|
+
"image/png",
|
|
64
|
+
"image/gif",
|
|
65
|
+
"image/webp"
|
|
66
|
+
]);
|
|
67
|
+
function extOf(path) {
|
|
68
|
+
const dot = path.lastIndexOf(".");
|
|
69
|
+
if (dot < 0) return "";
|
|
70
|
+
return path.slice(dot + 1).toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
function mimeFor(path) {
|
|
73
|
+
const ext = extOf(path);
|
|
74
|
+
if (ext === "json" || ext === "jsonl") return "application/json";
|
|
75
|
+
if (ext === "csv") return "text/csv";
|
|
76
|
+
if (ext === "html" || ext === "htm") return "text/html";
|
|
77
|
+
if (ext === "md") return "text/markdown";
|
|
78
|
+
if (TEXT_EXTS.has(ext)) return "text/plain";
|
|
79
|
+
if (ext === "png") return "image/png";
|
|
80
|
+
if (ext === "jpg" || ext === "jpeg") return "image/jpeg";
|
|
81
|
+
if (ext === "gif") return "image/gif";
|
|
82
|
+
if (ext === "webp") return "image/webp";
|
|
83
|
+
if (ext === "pdf") return "application/pdf";
|
|
84
|
+
return "application/octet-stream";
|
|
85
|
+
}
|
|
86
|
+
function isTextMime(mime) {
|
|
87
|
+
return mime.startsWith("text/") || mime === "application/json";
|
|
88
|
+
}
|
|
89
|
+
function bytesToBase64(bytes) {
|
|
90
|
+
return encodeBase64(bytes);
|
|
91
|
+
}
|
|
92
|
+
function isError(r) {
|
|
93
|
+
return "error" in r;
|
|
94
|
+
}
|
|
95
|
+
function mirageTools(ws) {
|
|
96
|
+
return {
|
|
97
|
+
execute: tool({
|
|
98
|
+
description: "Execute a shell command in the Mirage workspace and return stdout, stderr, and exitCode.",
|
|
99
|
+
inputSchema: z.object({
|
|
100
|
+
command: z.string().describe("The shell command to execute.")
|
|
101
|
+
}),
|
|
102
|
+
execute: async ({ command }) => {
|
|
103
|
+
const io = await ws.execute(command);
|
|
104
|
+
return {
|
|
105
|
+
stdout: io.stdoutText,
|
|
106
|
+
stderr: io.stderrText,
|
|
107
|
+
exitCode: io.exitCode
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}),
|
|
111
|
+
readFile: tool({
|
|
112
|
+
description: "Read a file from the Mirage workspace. Text files (utf-8 source/data) come back as text; PDFs and images (png/jpeg/gif/webp) come back as base64 media that is forwarded to the model as a multimodal attachment; other binaries return a metadata stub.",
|
|
113
|
+
inputSchema: z.object({
|
|
114
|
+
path: z.string().describe("Absolute path inside the workspace.")
|
|
115
|
+
}),
|
|
116
|
+
execute: async ({ path }) => {
|
|
117
|
+
let bytes;
|
|
118
|
+
try {
|
|
119
|
+
bytes = await ws.fs.readFile(path);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
122
|
+
}
|
|
123
|
+
const mimeType = mimeFor(path);
|
|
124
|
+
if (isTextMime(mimeType)) {
|
|
125
|
+
return {
|
|
126
|
+
kind: "text",
|
|
127
|
+
path,
|
|
128
|
+
mimeType,
|
|
129
|
+
content: new TextDecoder("utf-8", { fatal: false }).decode(bytes),
|
|
130
|
+
bytes: bytes.length
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (PRESENTABLE_BINARY.has(mimeType)) {
|
|
134
|
+
return {
|
|
135
|
+
kind: "media",
|
|
136
|
+
path,
|
|
137
|
+
mimeType,
|
|
138
|
+
base64: bytesToBase64(bytes),
|
|
139
|
+
bytes: bytes.length
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
kind: "binary",
|
|
144
|
+
path,
|
|
145
|
+
mimeType,
|
|
146
|
+
bytes: bytes.length,
|
|
147
|
+
note: `Binary file ${path} (${mimeType}, ${String(bytes.length)} bytes). Use the execute tool with shell commands (head, file, wc, od) to inspect.`
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
toModelOutput: ({ output }) => {
|
|
151
|
+
const out = output;
|
|
152
|
+
if (isError(out)) return { type: "error-text", value: out.error };
|
|
153
|
+
if (out.kind === "text") return { type: "text", value: out.content };
|
|
154
|
+
if (out.kind === "media") {
|
|
155
|
+
return {
|
|
156
|
+
type: "content",
|
|
157
|
+
value: [
|
|
158
|
+
{
|
|
159
|
+
type: "text",
|
|
160
|
+
text: `[${out.path}] ${out.mimeType} (${String(out.bytes)} bytes)`
|
|
161
|
+
},
|
|
162
|
+
{ type: "media", data: out.base64, mediaType: out.mimeType }
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return { type: "text", value: out.note };
|
|
167
|
+
}
|
|
168
|
+
}),
|
|
169
|
+
writeFile: tool({
|
|
170
|
+
description: "Write content to a file in the Mirage workspace. Creates missing parent directories.",
|
|
171
|
+
inputSchema: z.object({
|
|
172
|
+
path: z.string().describe("Absolute path inside the workspace."),
|
|
173
|
+
content: z.string().describe("UTF-8 text content to write.")
|
|
174
|
+
}),
|
|
175
|
+
execute: async ({ path, content }) => {
|
|
176
|
+
await ensureParent(ws, path);
|
|
177
|
+
await ws.fs.writeFile(path, content);
|
|
178
|
+
return { path };
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
editFile: tool({
|
|
182
|
+
description: "Replace a string inside an existing file. Errors if the string appears more than once unless replaceAll is true.",
|
|
183
|
+
inputSchema: z.object({
|
|
184
|
+
path: z.string().describe("Absolute path of the file to edit."),
|
|
185
|
+
oldString: z.string().describe("The exact string to replace."),
|
|
186
|
+
newString: z.string().describe("The replacement string."),
|
|
187
|
+
replaceAll: z.boolean().optional().describe("Replace every occurrence rather than requiring a unique match.")
|
|
188
|
+
}),
|
|
189
|
+
execute: async ({ path, oldString, newString, replaceAll }) => {
|
|
190
|
+
let current;
|
|
191
|
+
try {
|
|
192
|
+
current = await ws.fs.readFileText(path);
|
|
193
|
+
} catch {
|
|
194
|
+
return { error: `Error: file '${path}' not found` };
|
|
195
|
+
}
|
|
196
|
+
const count = current.split(oldString).length - 1;
|
|
197
|
+
if (count === 0) {
|
|
198
|
+
return { error: `Error: string not found in file: '${oldString}'` };
|
|
199
|
+
}
|
|
200
|
+
if (count > 1 && replaceAll !== true) {
|
|
201
|
+
return {
|
|
202
|
+
error: `Error: string '${oldString}' appears ${String(count)} times. Use replaceAll=true`
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const next = replaceAll === true ? current.split(oldString).join(newString) : current.replace(oldString, newString);
|
|
206
|
+
await ws.fs.writeFile(path, next);
|
|
207
|
+
return { path, occurrences: replaceAll === true ? count : 1 };
|
|
208
|
+
}
|
|
209
|
+
}),
|
|
210
|
+
ls: tool({
|
|
211
|
+
description: "List entries of a directory in the Mirage workspace.",
|
|
212
|
+
inputSchema: z.object({
|
|
213
|
+
path: z.string().describe("Absolute directory path inside the workspace.")
|
|
214
|
+
}),
|
|
215
|
+
execute: async ({ path }) => {
|
|
216
|
+
let entries;
|
|
217
|
+
try {
|
|
218
|
+
entries = await ws.fs.readdir(path);
|
|
219
|
+
} catch (err) {
|
|
220
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
221
|
+
}
|
|
222
|
+
const files = [];
|
|
223
|
+
for (const entry of entries) {
|
|
224
|
+
const isDir = await ws.fs.isDir(entry);
|
|
225
|
+
files.push({ path: entry, is_dir: isDir });
|
|
226
|
+
}
|
|
227
|
+
return { files };
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
mirageTools
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/vercel/index.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { encodeBase64 } from '@struktoai/mirage-core'\nimport type { Workspace } from '@struktoai/mirage-node'\nimport { tool } from 'ai'\nimport { z } from 'zod'\n\nfunction parentOf(path: string): string {\n const trimmed = path.replace(/\\/+$/, '')\n const idx = trimmed.lastIndexOf('/')\n if (idx <= 0) return '/'\n return trimmed.slice(0, idx)\n}\n\nasync function ensureParent(ws: Workspace, path: string): Promise<void> {\n const parent = parentOf(path)\n if (parent === '/' || parent === '') return\n if (await ws.fs.exists(parent)) return\n await ensureParent(ws, parent)\n try {\n await ws.fs.mkdir(parent)\n } catch (err) {\n if (!(await ws.fs.exists(parent))) throw err\n }\n}\n\nconst TEXT_EXTS = new Set([\n 'txt',\n 'md',\n 'json',\n 'jsonl',\n 'yaml',\n 'yml',\n 'csv',\n 'tsv',\n 'xml',\n 'html',\n 'htm',\n 'js',\n 'mjs',\n 'cjs',\n 'ts',\n 'tsx',\n 'jsx',\n 'py',\n 'rb',\n 'rs',\n 'go',\n 'java',\n 'c',\n 'cpp',\n 'h',\n 'hpp',\n 'sh',\n 'bash',\n 'zsh',\n 'sql',\n 'log',\n 'env',\n 'ini',\n 'toml',\n 'conf',\n 'cfg',\n])\n\nconst PRESENTABLE_BINARY = new Set([\n 'application/pdf',\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n])\n\nfunction extOf(path: string): string {\n const dot = path.lastIndexOf('.')\n if (dot < 0) return ''\n return path.slice(dot + 1).toLowerCase()\n}\n\nfunction mimeFor(path: string): string {\n const ext = extOf(path)\n if (ext === 'json' || ext === 'jsonl') return 'application/json'\n if (ext === 'csv') return 'text/csv'\n if (ext === 'html' || ext === 'htm') return 'text/html'\n if (ext === 'md') return 'text/markdown'\n if (TEXT_EXTS.has(ext)) return 'text/plain'\n if (ext === 'png') return 'image/png'\n if (ext === 'jpg' || ext === 'jpeg') return 'image/jpeg'\n if (ext === 'gif') return 'image/gif'\n if (ext === 'webp') return 'image/webp'\n if (ext === 'pdf') return 'application/pdf'\n return 'application/octet-stream'\n}\n\nfunction isTextMime(mime: string): boolean {\n return mime.startsWith('text/') || mime === 'application/json'\n}\n\nfunction bytesToBase64(bytes: Uint8Array): string {\n return encodeBase64(bytes)\n}\n\ntype ReadFileResult =\n | { kind: 'text'; path: string; mimeType: string; content: string; bytes: number }\n | { kind: 'media'; path: string; mimeType: string; base64: string; bytes: number }\n | { kind: 'binary'; path: string; mimeType: string; bytes: number; note: string }\n | { error: string }\n\nfunction isError(r: ReadFileResult): r is { error: string } {\n return 'error' in r\n}\n\nexport function mirageTools(ws: Workspace) {\n return {\n execute: tool({\n description:\n 'Execute a shell command in the Mirage workspace and return stdout, stderr, and exitCode.',\n inputSchema: z.object({\n command: z.string().describe('The shell command to execute.'),\n }),\n execute: async ({ command }) => {\n const io = await ws.execute(command)\n return {\n stdout: io.stdoutText,\n stderr: io.stderrText,\n exitCode: io.exitCode,\n }\n },\n }),\n\n readFile: tool({\n description:\n 'Read a file from the Mirage workspace. Text files (utf-8 source/data) come back as text; PDFs and images (png/jpeg/gif/webp) come back as base64 media that is forwarded to the model as a multimodal attachment; other binaries return a metadata stub.',\n inputSchema: z.object({\n path: z.string().describe('Absolute path inside the workspace.'),\n }),\n execute: async ({ path }): Promise<ReadFileResult> => {\n let bytes: Uint8Array\n try {\n bytes = await ws.fs.readFile(path)\n } catch (err) {\n return { error: err instanceof Error ? err.message : String(err) }\n }\n const mimeType = mimeFor(path)\n if (isTextMime(mimeType)) {\n return {\n kind: 'text',\n path,\n mimeType,\n content: new TextDecoder('utf-8', { fatal: false }).decode(bytes),\n bytes: bytes.length,\n }\n }\n if (PRESENTABLE_BINARY.has(mimeType)) {\n return {\n kind: 'media',\n path,\n mimeType,\n base64: bytesToBase64(bytes),\n bytes: bytes.length,\n }\n }\n return {\n kind: 'binary',\n path,\n mimeType,\n bytes: bytes.length,\n note: `Binary file ${path} (${mimeType}, ${String(bytes.length)} bytes). Use the execute tool with shell commands (head, file, wc, od) to inspect.`,\n }\n },\n toModelOutput: ({ output }) => {\n const out: ReadFileResult = output\n if (isError(out)) return { type: 'error-text', value: out.error }\n if (out.kind === 'text') return { type: 'text', value: out.content }\n if (out.kind === 'media') {\n return {\n type: 'content',\n value: [\n {\n type: 'text',\n text: `[${out.path}] ${out.mimeType} (${String(out.bytes)} bytes)`,\n },\n { type: 'media', data: out.base64, mediaType: out.mimeType },\n ],\n }\n }\n return { type: 'text', value: out.note }\n },\n }),\n\n writeFile: tool({\n description:\n 'Write content to a file in the Mirage workspace. Creates missing parent directories.',\n inputSchema: z.object({\n path: z.string().describe('Absolute path inside the workspace.'),\n content: z.string().describe('UTF-8 text content to write.'),\n }),\n execute: async ({ path, content }) => {\n await ensureParent(ws, path)\n await ws.fs.writeFile(path, content)\n return { path }\n },\n }),\n\n editFile: tool({\n description:\n 'Replace a string inside an existing file. Errors if the string appears more than once unless replaceAll is true.',\n inputSchema: z.object({\n path: z.string().describe('Absolute path of the file to edit.'),\n oldString: z.string().describe('The exact string to replace.'),\n newString: z.string().describe('The replacement string.'),\n replaceAll: z\n .boolean()\n .optional()\n .describe('Replace every occurrence rather than requiring a unique match.'),\n }),\n execute: async ({ path, oldString, newString, replaceAll }) => {\n let current: string\n try {\n current = await ws.fs.readFileText(path)\n } catch {\n return { error: `Error: file '${path}' not found` }\n }\n const count = current.split(oldString).length - 1\n if (count === 0) {\n return { error: `Error: string not found in file: '${oldString}'` }\n }\n if (count > 1 && replaceAll !== true) {\n return {\n error: `Error: string '${oldString}' appears ${String(count)} times. Use replaceAll=true`,\n }\n }\n const next =\n replaceAll === true\n ? current.split(oldString).join(newString)\n : current.replace(oldString, newString)\n await ws.fs.writeFile(path, next)\n return { path, occurrences: replaceAll === true ? count : 1 }\n },\n }),\n\n ls: tool({\n description: 'List entries of a directory in the Mirage workspace.',\n inputSchema: z.object({\n path: z.string().describe('Absolute directory path inside the workspace.'),\n }),\n execute: async ({ path }) => {\n let entries: string[]\n try {\n entries = await ws.fs.readdir(path)\n } catch (err) {\n return { error: err instanceof Error ? err.message : String(err) }\n }\n const files: { path: string; is_dir: boolean }[] = []\n for (const entry of entries) {\n const isDir = await ws.fs.isDir(entry)\n files.push({ path: entry, is_dir: isDir })\n }\n return { files }\n },\n }),\n }\n}\n"],"mappings":";AAcA,SAAS,oBAAoB;AAE7B,SAAS,YAAY;AACrB,SAAS,SAAS;AAElB,SAAS,SAAS,MAAsB;AACtC,QAAM,UAAU,KAAK,QAAQ,QAAQ,EAAE;AACvC,QAAM,MAAM,QAAQ,YAAY,GAAG;AACnC,MAAI,OA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D;AAAA,IACF,CAAC;AAAA,IAED,IAAI,KAAK;AAAA,MACP,aAAa;AAAA,MACb,aAAa,EAAE,OAAO;AAAA,QACpB,MAAM,EAAE,OAAO,EAAE,SAAS,+CAA+C;AAAA,MAC3E,CAAC;AAAA,MACD,SAAS,OAAO,EAAE,KAAK,MAAM;AAC3B,YAAI;AACJ,YAAI;AACF,oBAAU,MAAM,GAAG,GAAG,QAAQ,IAAI;AAAA,QACpC,SAAS,KAAK;AACZ,iBAAO,EAAE,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE;AAAA,QACnE;AACA,cAAM,QAA6C,CAAC;AACpD,mBAAW,SAAS,SAAS;AAC3B,gBAAM,QAAQ,MAAM,GAAG,GAAG,MAAM,KAAK;AACrC,gBAAM,KAAK,EAAE,MAAM,OAAO,QAAQ,MAAM,CAAC;AAAA,QAC3C;AACA,eAAO,EAAE,MAAM;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@struktoai/mirage-agents",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"description": "A Unified Virtual Filesystem For AI Agents",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bash",
|
|
7
|
+
"fuse",
|
|
8
|
+
"typescript",
|
|
9
|
+
"vfs",
|
|
10
|
+
"ai-agents",
|
|
11
|
+
"agent-sandbox",
|
|
12
|
+
"langchain",
|
|
13
|
+
"virtual-filesystem",
|
|
14
|
+
"llm-agents",
|
|
15
|
+
"agent-tools",
|
|
16
|
+
"claude-code",
|
|
17
|
+
"openai-agents"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/strukto-ai/mirage#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/strukto-ai/mirage/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/strukto-ai/mirage.git",
|
|
26
|
+
"directory": "typescript/packages/agents"
|
|
27
|
+
},
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"author": "Zecheng Zhang <zecheng@strukto.ai>",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"main": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"import": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./openai": {
|
|
42
|
+
"types": "./dist/openai/index.d.ts",
|
|
43
|
+
"import": "./dist/openai/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./langchain": {
|
|
46
|
+
"types": "./dist/langchain/index.d.ts",
|
|
47
|
+
"import": "./dist/langchain/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./pi": {
|
|
50
|
+
"types": "./dist/pi/index.d.ts",
|
|
51
|
+
"import": "./dist/pi/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./vercel": {
|
|
54
|
+
"types": "./dist/vercel/index.d.ts",
|
|
55
|
+
"import": "./dist/vercel/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./mastra": {
|
|
58
|
+
"types": "./dist/mastra/index.d.ts",
|
|
59
|
+
"import": "./dist/mastra/index.js"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"dist"
|
|
64
|
+
],
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"picomatch": "^4.0.4",
|
|
67
|
+
"@struktoai/mirage-core": "0.0.1-alpha.1"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@mariozechner/pi-ai": "^0.70.0",
|
|
71
|
+
"@mariozechner/pi-coding-agent": "^0.70.0",
|
|
72
|
+
"@mastra/core": "^1.29.0",
|
|
73
|
+
"@openai/agents": "^0.8.0",
|
|
74
|
+
"ai": "^6.0.0",
|
|
75
|
+
"deepagents": "^1.9.0",
|
|
76
|
+
"zod": "^4.0.0"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@mariozechner/pi-ai": "^0.70.2",
|
|
80
|
+
"@mariozechner/pi-coding-agent": "^0.70.2",
|
|
81
|
+
"@mastra/core": "^1.29.1",
|
|
82
|
+
"@openai/agents": "^0.8.0",
|
|
83
|
+
"@types/picomatch": "^4.0.3",
|
|
84
|
+
"ai": "^6.0.170",
|
|
85
|
+
"deepagents": "^1.9.0",
|
|
86
|
+
"tsup": "^8.5.0",
|
|
87
|
+
"typescript": "^6.0.0",
|
|
88
|
+
"vitest": "^3.0.0",
|
|
89
|
+
"zod": "^4.0.0",
|
|
90
|
+
"@struktoai/mirage-node": "0.0.1-alpha.1"
|
|
91
|
+
},
|
|
92
|
+
"scripts": {
|
|
93
|
+
"build": "tsup",
|
|
94
|
+
"test": "vitest run",
|
|
95
|
+
"typecheck": "tsc --noEmit"
|
|
96
|
+
}
|
|
97
|
+
}
|