@autopo/mcp 0.1.1 → 0.4.0
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 +17 -2
- package/dist/api.d.ts +12 -1
- package/dist/api.js +25 -3
- package/dist/api.js.map +1 -1
- package/dist/calllog.d.ts +4 -0
- package/dist/calllog.js +59 -0
- package/dist/calllog.js.map +1 -0
- package/dist/cli.js +7 -2
- package/dist/cli.js.map +1 -1
- package/dist/files.d.ts +70 -0
- package/dist/files.js +378 -0
- package/dist/files.js.map +1 -0
- package/dist/guides.d.ts +3 -2
- package/dist/guides.js +60 -0
- package/dist/guides.js.map +1 -1
- package/dist/http.d.ts +2 -0
- package/dist/http.js +1 -1
- package/dist/http.js.map +1 -1
- package/dist/kit.d.ts +3 -0
- package/dist/kit.js +2 -0
- package/dist/kit.js.map +1 -1
- package/dist/prompts.js +1 -0
- package/dist/prompts.js.map +1 -1
- package/dist/resources.js +15 -1
- package/dist/resources.js.map +1 -1
- package/dist/server.d.ts +3 -1
- package/dist/server.js +6 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/studio.d.ts +5 -0
- package/dist/tools/studio.js +329 -9
- package/dist/tools/studio.js.map +1 -1
- package/dist/zip.d.ts +26 -0
- package/dist/zip.js +85 -0
- package/dist/zip.js.map +1 -0
- package/package.json +1 -1
package/dist/files.js
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Your own files into the Studio. When the server runs on the person's machine (stdio, `npx -y @autopo/mcp`), a tool
|
|
3
|
+
* can take paths: the server reads them itself and uploads in 8 MB chunks through the Studio's upload API, the same
|
|
4
|
+
* way the web app does. Hosted, it takes URLs. Nothing travels through the MCP connection, which carries only JSON.
|
|
5
|
+
*/
|
|
6
|
+
import { open, readdir, readFile, stat } from 'node:fs/promises';
|
|
7
|
+
import { homedir } from 'node:os';
|
|
8
|
+
import { basename, extname, join, relative, resolve } from 'node:path';
|
|
9
|
+
import { ApiError } from './api.js';
|
|
10
|
+
import { ToolError } from './kit.js';
|
|
11
|
+
import { bufferRange, handleRange, isZip, zipDataOffset, zipEntries, zipRead } from './zip.js';
|
|
12
|
+
export const MEDIA_TYPES = {
|
|
13
|
+
'.mp4': 'video/mp4', '.m4v': 'video/mp4', '.mov': 'video/quicktime', '.webm': 'video/webm', '.mkv': 'video/x-matroska', '.avi': 'video/x-msvideo',
|
|
14
|
+
'.mp3': 'audio/mpeg', '.wav': 'audio/wav', '.m4a': 'audio/mp4', '.aac': 'audio/aac', '.ogg': 'audio/ogg', '.flac': 'audio/flac', '.aif': 'audio/aiff', '.aiff': 'audio/aiff',
|
|
15
|
+
'.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.gif': 'image/gif', '.heic': 'image/heic', '.avif': 'image/avif', '.bmp': 'image/bmp', '.tif': 'image/tiff', '.tiff': 'image/tiff',
|
|
16
|
+
};
|
|
17
|
+
export function mediaType(name) {
|
|
18
|
+
return MEDIA_TYPES[extname(name).toLowerCase()];
|
|
19
|
+
}
|
|
20
|
+
const MAX_IN_MEMORY = 512 * 1024 * 1024;
|
|
21
|
+
export function expandHome(path) {
|
|
22
|
+
return path.replace(/^~(?=$|\/)/, homedir());
|
|
23
|
+
}
|
|
24
|
+
const byName = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
|
|
25
|
+
/** A file, or a folder's media files in name order (2 before 10). */
|
|
26
|
+
export async function expandPath(path) {
|
|
27
|
+
const full = resolve(expandHome(path));
|
|
28
|
+
const info = await stat(full).catch(() => null);
|
|
29
|
+
if (!info)
|
|
30
|
+
throw new ToolError(`${path}: no such file or folder on this machine (paths are read where the server runs; absolute paths are safest).`);
|
|
31
|
+
if (info.isFile())
|
|
32
|
+
return [full];
|
|
33
|
+
const names = (await readdir(full, { withFileTypes: true }))
|
|
34
|
+
.filter((d) => d.isFile() && !d.name.startsWith('.') && mediaType(d.name))
|
|
35
|
+
.map((d) => d.name)
|
|
36
|
+
.sort(byName);
|
|
37
|
+
if (names.length === 0)
|
|
38
|
+
throw new ToolError(`${path}: no images, clips or audio files in that folder.`);
|
|
39
|
+
return names.map((n) => join(full, n));
|
|
40
|
+
}
|
|
41
|
+
export async function pathSource(path) {
|
|
42
|
+
const full = resolve(expandHome(path));
|
|
43
|
+
const info = await stat(full).catch(() => null);
|
|
44
|
+
if (!info?.isFile())
|
|
45
|
+
throw new ToolError(`${path}: no such file on this machine.`);
|
|
46
|
+
const type = mediaType(full) ?? '';
|
|
47
|
+
return {
|
|
48
|
+
name: basename(full),
|
|
49
|
+
size: info.size,
|
|
50
|
+
type,
|
|
51
|
+
async *chunks(size) {
|
|
52
|
+
const handle = await open(full, 'r');
|
|
53
|
+
try {
|
|
54
|
+
let offset = 0;
|
|
55
|
+
while (offset < info.size) {
|
|
56
|
+
const want = Math.min(size, info.size - offset);
|
|
57
|
+
const part = await handleRange(handle, info.size).read(offset, want);
|
|
58
|
+
if (part.length === 0)
|
|
59
|
+
break;
|
|
60
|
+
offset += part.length;
|
|
61
|
+
yield part;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
await handle.close();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function nameFromResponse(url, response) {
|
|
71
|
+
const disposition = response.headers.get('content-disposition') ?? '';
|
|
72
|
+
const m = /filename\*?=(?:UTF-8'')?"?([^";]+)"?/i.exec(disposition);
|
|
73
|
+
if (m?.[1])
|
|
74
|
+
return decodeURIComponent(m[1]);
|
|
75
|
+
const last = new URL(url).pathname.split('/').filter(Boolean).pop();
|
|
76
|
+
return last ? decodeURIComponent(last) : 'download';
|
|
77
|
+
}
|
|
78
|
+
/** A public link: streamed when its size is known, read whole (up to 512 MB) when it is not. */
|
|
79
|
+
export async function urlSource(url, fetchImpl = globalThis.fetch) {
|
|
80
|
+
let parsed;
|
|
81
|
+
try {
|
|
82
|
+
parsed = new URL(url);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
throw new ToolError(`${url}: not a URL.`);
|
|
86
|
+
}
|
|
87
|
+
if (!['http:', 'https:'].includes(parsed.protocol))
|
|
88
|
+
throw new ToolError(`${url}: only http(s) links can be fetched.`);
|
|
89
|
+
const response = await fetchImpl(url);
|
|
90
|
+
if (!response.ok || !response.body)
|
|
91
|
+
throw new ToolError(`${url}: HTTP ${response.status}.`);
|
|
92
|
+
const name = nameFromResponse(url, response);
|
|
93
|
+
const header = (response.headers.get('content-type') ?? '').split(';')[0].trim();
|
|
94
|
+
const type = /^(image|video|audio)\//.test(header) ? header : (mediaType(name) ?? '');
|
|
95
|
+
const length = Number(response.headers.get('content-length'));
|
|
96
|
+
if (Number.isFinite(length) && length > 0) {
|
|
97
|
+
const body = response.body;
|
|
98
|
+
return {
|
|
99
|
+
name,
|
|
100
|
+
size: length,
|
|
101
|
+
type,
|
|
102
|
+
async *chunks(size) {
|
|
103
|
+
const reader = body.getReader();
|
|
104
|
+
let pending = [];
|
|
105
|
+
let have = 0;
|
|
106
|
+
for (;;) {
|
|
107
|
+
const { done, value } = await reader.read();
|
|
108
|
+
if (value) {
|
|
109
|
+
pending.push(value);
|
|
110
|
+
have += value.length;
|
|
111
|
+
}
|
|
112
|
+
while (have >= size || (done && have > 0)) {
|
|
113
|
+
const out = Buffer.concat(pending);
|
|
114
|
+
const piece = out.subarray(0, Math.min(size, out.length));
|
|
115
|
+
const rest = out.subarray(piece.length);
|
|
116
|
+
pending = rest.length ? [rest] : [];
|
|
117
|
+
have = rest.length;
|
|
118
|
+
yield piece;
|
|
119
|
+
}
|
|
120
|
+
if (done)
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const data = Buffer.from(await response.arrayBuffer());
|
|
127
|
+
if (data.length > MAX_IN_MEMORY)
|
|
128
|
+
throw new ToolError(`${url}: over 512 MB with no Content-Length; upload it from a machine instead.`);
|
|
129
|
+
return bytesSource(name, data, type);
|
|
130
|
+
}
|
|
131
|
+
export function bytesSource(name, data, type = mediaType(name) ?? '') {
|
|
132
|
+
return {
|
|
133
|
+
name,
|
|
134
|
+
size: data.length,
|
|
135
|
+
type,
|
|
136
|
+
async *chunks(size) {
|
|
137
|
+
for (let offset = 0; offset < data.length; offset += size)
|
|
138
|
+
yield data.subarray(offset, Math.min(offset + size, data.length));
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** A zip entry: streamed by range when stored, inflated whole when deflated. */
|
|
143
|
+
export function zipSource(range, entry) {
|
|
144
|
+
const name = basename(entry.name);
|
|
145
|
+
return {
|
|
146
|
+
name,
|
|
147
|
+
size: entry.size,
|
|
148
|
+
type: mediaType(name) ?? '',
|
|
149
|
+
async *chunks(size) {
|
|
150
|
+
if (entry.method === 0) {
|
|
151
|
+
const start = await zipDataOffset(range, entry);
|
|
152
|
+
for (let offset = 0; offset < entry.size; offset += size)
|
|
153
|
+
yield await range.read(start + offset, Math.min(size, entry.size - offset));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const data = await zipRead(range, entry);
|
|
157
|
+
for (let offset = 0; offset < data.length; offset += size)
|
|
158
|
+
yield data.subarray(offset, Math.min(offset + size, data.length));
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/** Progress notifications to the host, when it asked for them (a progressToken on the request). */
|
|
163
|
+
export function progressOf(ctx) {
|
|
164
|
+
const token = ctx.mcpReq._meta?.progressToken;
|
|
165
|
+
return async (progress, total, message) => {
|
|
166
|
+
if (token === undefined || token === null)
|
|
167
|
+
return;
|
|
168
|
+
try {
|
|
169
|
+
await ctx.mcpReq.notify({ method: 'notifications/progress', params: { progressToken: token, progress, ...(total !== undefined ? { total } : {}), message } });
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
/* a host that takes no progress loses nothing */
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export const mb = (n) => `${(n / (1024 * 1024)).toFixed(n < 10 * 1024 * 1024 ? 1 : 0)} MB`;
|
|
177
|
+
/** One file into the library: begin, the chunks in order, complete. Returns the media (processing, soon ready). */
|
|
178
|
+
export async function upload(s, companyId, source, options = {}) {
|
|
179
|
+
if (source.size <= 0)
|
|
180
|
+
throw new ToolError(`${source.name}: the file is empty.`);
|
|
181
|
+
const begun = await s.api.post(`/api/companies/${companyId}/studio/uploads`, {
|
|
182
|
+
filename: source.name,
|
|
183
|
+
content_type: source.type,
|
|
184
|
+
byte_size: source.size,
|
|
185
|
+
...(options.production ? { production: options.production } : {}),
|
|
186
|
+
});
|
|
187
|
+
const id = begun.media.id;
|
|
188
|
+
const chunkBytes = begun.chunk_bytes && begun.chunk_bytes > 0 ? begun.chunk_bytes : 8 * 1024 * 1024;
|
|
189
|
+
let offset = 0;
|
|
190
|
+
for await (const part of source.chunks(chunkBytes)) {
|
|
191
|
+
if (options.signal?.aborted)
|
|
192
|
+
throw new ToolError(`${source.name}: upload cancelled.`);
|
|
193
|
+
const bytes = new Uint8Array(part.buffer, part.byteOffset, part.byteLength);
|
|
194
|
+
await s.api.send('PUT', `/api/studio/uploads/${id}`, bytes, 'application/octet-stream', { offset });
|
|
195
|
+
offset += part.byteLength;
|
|
196
|
+
await options.onBytes?.(offset, source.size);
|
|
197
|
+
}
|
|
198
|
+
if (offset !== source.size)
|
|
199
|
+
throw new ToolError(`${source.name}: read ${offset} of ${source.size} bytes; the file changed while uploading.`);
|
|
200
|
+
let media = await s.api.post(`/api/studio/uploads/${id}/complete`);
|
|
201
|
+
if (options.title && options.title !== media.title)
|
|
202
|
+
media = await s.api.patch(`/api/studio/media/${id}`, { title: options.title });
|
|
203
|
+
return media;
|
|
204
|
+
}
|
|
205
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
206
|
+
/** Wait until uploads are ready (the Studio reads each file's shape and makes a thumbnail; recordings become web video). */
|
|
207
|
+
export async function waitReady(s, ids, options = {}) {
|
|
208
|
+
const out = {};
|
|
209
|
+
const deadline = Date.now() + (options.timeoutMs ?? 240_000);
|
|
210
|
+
let waiting = [...ids];
|
|
211
|
+
while (waiting.length > 0) {
|
|
212
|
+
const still = [];
|
|
213
|
+
for (const id of waiting) {
|
|
214
|
+
const media = await s.api.get(`/api/studio/media/${id}`);
|
|
215
|
+
if (media.status === 'ready')
|
|
216
|
+
out[id] = media;
|
|
217
|
+
else if (media.status === 'failed')
|
|
218
|
+
throw new ToolError(`${media.title ?? id} couldn't be read: ${media.error ?? 'the Studio could not process it'}.`);
|
|
219
|
+
else
|
|
220
|
+
still.push(id);
|
|
221
|
+
}
|
|
222
|
+
waiting = still;
|
|
223
|
+
if (waiting.length === 0)
|
|
224
|
+
break;
|
|
225
|
+
if (options.signal?.aborted)
|
|
226
|
+
throw new ToolError('Cancelled while the Studio was processing the files.');
|
|
227
|
+
if (Date.now() > deadline)
|
|
228
|
+
throw new ToolError(`${waiting.length} file(s) are still processing; try again in a minute (list_media shows their state).`);
|
|
229
|
+
await options.progress?.(ids.length - waiting.length, ids.length, `Processing ${ids.length - waiting.length}/${ids.length} files…`);
|
|
230
|
+
await sleep(2000);
|
|
231
|
+
}
|
|
232
|
+
return out;
|
|
233
|
+
}
|
|
234
|
+
export const FILE_REF = 'file:';
|
|
235
|
+
export const ICON_REF = 'icon:';
|
|
236
|
+
/** The plan's `file:…` and `icon:…` references, found like the platform does: exact path, else the file's name, else its stem. */
|
|
237
|
+
export function findFile(files, ref) {
|
|
238
|
+
const name = ref.slice(ref.indexOf(':') + 1).trim();
|
|
239
|
+
if (name in files)
|
|
240
|
+
return name;
|
|
241
|
+
const wanted = basename(name);
|
|
242
|
+
const stem = wanted.replace(/\.[^.]+$/, '');
|
|
243
|
+
for (const key of Object.keys(files)) {
|
|
244
|
+
const base = basename(key);
|
|
245
|
+
if (base === wanted || base.replace(/\.[^.]+$/, '') === stem)
|
|
246
|
+
return key;
|
|
247
|
+
}
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
export function isFileRef(value) {
|
|
251
|
+
return typeof value === 'string' && (value.startsWith(FILE_REF) || value.startsWith(ICON_REF));
|
|
252
|
+
}
|
|
253
|
+
/** Every file reference in a plan, deep, in order of first appearance. */
|
|
254
|
+
export function fileRefs(value, out = []) {
|
|
255
|
+
if (isFileRef(value)) {
|
|
256
|
+
if (!out.includes(value))
|
|
257
|
+
out.push(value);
|
|
258
|
+
}
|
|
259
|
+
else if (Array.isArray(value)) {
|
|
260
|
+
for (const v of value)
|
|
261
|
+
fileRefs(v, out);
|
|
262
|
+
}
|
|
263
|
+
else if (value && typeof value === 'object') {
|
|
264
|
+
for (const v of Object.values(value))
|
|
265
|
+
fileRefs(v, out);
|
|
266
|
+
}
|
|
267
|
+
return out;
|
|
268
|
+
}
|
|
269
|
+
/** The plan with each file reference replaced by the id it became. */
|
|
270
|
+
export function rewriteRefs(value, ids) {
|
|
271
|
+
if (isFileRef(value))
|
|
272
|
+
return (ids[value] ?? value);
|
|
273
|
+
if (Array.isArray(value))
|
|
274
|
+
return value.map((v) => rewriteRefs(v, ids));
|
|
275
|
+
if (value && typeof value === 'object') {
|
|
276
|
+
const out = {};
|
|
277
|
+
for (const [k, v] of Object.entries(value))
|
|
278
|
+
out[k] = rewriteRefs(v, ids);
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
281
|
+
return value;
|
|
282
|
+
}
|
|
283
|
+
function parsePlan(text, where) {
|
|
284
|
+
let plan;
|
|
285
|
+
try {
|
|
286
|
+
plan = JSON.parse(text);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
throw new ToolError(`${where}: the plan isn't valid JSON (${error.message}).`);
|
|
290
|
+
}
|
|
291
|
+
if (!plan || typeof plan !== 'object' || Array.isArray(plan))
|
|
292
|
+
throw new ToolError(`${where}: the plan is an object {title, shots, …}.`);
|
|
293
|
+
return plan;
|
|
294
|
+
}
|
|
295
|
+
async function walk(dir, root = dir, out = []) {
|
|
296
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
297
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules')
|
|
298
|
+
continue;
|
|
299
|
+
const full = join(dir, entry.name);
|
|
300
|
+
if (entry.isDirectory())
|
|
301
|
+
await walk(full, root, out);
|
|
302
|
+
else if (entry.isFile())
|
|
303
|
+
out.push(relative(root, full).split('\\').join('/'));
|
|
304
|
+
}
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
async function zipBundle(range, where, close) {
|
|
308
|
+
const entries = await zipEntries(range);
|
|
309
|
+
const planEntry = entries.find((e) => basename(e.name) === 'plan.json');
|
|
310
|
+
if (!planEntry) {
|
|
311
|
+
await close();
|
|
312
|
+
throw new ToolError(`${where}: the zip has no plan.json.`);
|
|
313
|
+
}
|
|
314
|
+
const root = planEntry.name.slice(0, -'plan.json'.length);
|
|
315
|
+
const plan = parsePlan((await zipRead(range, planEntry)).toString('utf8'), where);
|
|
316
|
+
const files = {};
|
|
317
|
+
for (const entry of entries) {
|
|
318
|
+
if (entry === planEntry || basename(entry.name).startsWith('.'))
|
|
319
|
+
continue;
|
|
320
|
+
const key = entry.name.startsWith(root) ? entry.name.slice(root.length) : entry.name;
|
|
321
|
+
files[key] = async () => zipSource(range, entry);
|
|
322
|
+
}
|
|
323
|
+
return { plan, files, close };
|
|
324
|
+
}
|
|
325
|
+
/** A plan from this machine: a zip, a plan.json (the files beside it come along), or a folder holding plan.json. */
|
|
326
|
+
export async function planFromPath(path) {
|
|
327
|
+
const full = resolve(expandHome(path));
|
|
328
|
+
const info = await stat(full).catch(() => null);
|
|
329
|
+
if (!info)
|
|
330
|
+
throw new ToolError(`${path}: no such file or folder on this machine.`);
|
|
331
|
+
let dir = full;
|
|
332
|
+
let planPath = full;
|
|
333
|
+
if (info.isDirectory()) {
|
|
334
|
+
planPath = join(full, 'plan.json');
|
|
335
|
+
if (!(await stat(planPath).catch(() => null)))
|
|
336
|
+
throw new ToolError(`${path}: no plan.json in that folder.`);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
const handle = await open(full, 'r');
|
|
340
|
+
const range = handleRange(handle, info.size);
|
|
341
|
+
if (await isZip(range))
|
|
342
|
+
return zipBundle(range, path, () => handle.close());
|
|
343
|
+
await handle.close();
|
|
344
|
+
dir = resolve(full, '..');
|
|
345
|
+
}
|
|
346
|
+
const plan = parsePlan(await readFile(planPath, 'utf8'), path);
|
|
347
|
+
const files = {};
|
|
348
|
+
for (const rel of await walk(dir)) {
|
|
349
|
+
if (join(dir, rel) === planPath)
|
|
350
|
+
continue;
|
|
351
|
+
files[rel] = () => pathSource(join(dir, rel));
|
|
352
|
+
}
|
|
353
|
+
return { plan, files, close: async () => { } };
|
|
354
|
+
}
|
|
355
|
+
/** A plan from a link: a zip or a plan.json, read whole (up to 512 MB). */
|
|
356
|
+
export async function planFromUrl(url, fetchImpl = globalThis.fetch) {
|
|
357
|
+
const response = await fetchImpl(url);
|
|
358
|
+
if (!response.ok)
|
|
359
|
+
throw new ToolError(`${url}: HTTP ${response.status}.`);
|
|
360
|
+
const data = Buffer.from(await response.arrayBuffer());
|
|
361
|
+
if (data.length > MAX_IN_MEMORY)
|
|
362
|
+
throw new ToolError(`${url}: over 512 MB; import it from a machine with the file instead.`);
|
|
363
|
+
const range = bufferRange(data);
|
|
364
|
+
if (await isZip(range))
|
|
365
|
+
return zipBundle(range, url, async () => { });
|
|
366
|
+
return { plan: parsePlan(data.toString('utf8'), url), files: {}, close: async () => { } };
|
|
367
|
+
}
|
|
368
|
+
/** Why a path can't be read on this connection, with the way out. */
|
|
369
|
+
export function noLocalFiles(s, companyId) {
|
|
370
|
+
const studio = companyId ? ` or drop the files into the Studio library (${s.link(`/c/${companyId}/studio`)}) and use their media ids` : '';
|
|
371
|
+
return new ToolError(`This connection runs in the cloud, so it can't read files on your computer. Give public URLs instead, run the server on your machine (npx -y @autopo/mcp, see https://docs.autopoiesis.app/clients)${studio}.`);
|
|
372
|
+
}
|
|
373
|
+
export function describeApiError(error) {
|
|
374
|
+
if (error instanceof ApiError)
|
|
375
|
+
return `${error.message} (HTTP ${error.status})`;
|
|
376
|
+
return error instanceof Error ? error.message : String(error);
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAW,SAAS,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,UAAU,CAAA;AAE7H,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,iBAAiB;IACjJ,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY;IAC5K,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,Y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M,GAAG,CAAA;IAC/E,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
|
package/dist/guides.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/** Guides served as resources and read by the prompts: short, in plain words, the way the platform writes. */
|
|
2
|
-
export declare const STUDIO_GUIDE = "# The Studio, in short\n\nThe Studio makes images, clips, voice lines and music, and cuts them into videos. A video is a storyboard: shots in\norder, each with a picture (generated, footage you have, a title card, or a presenter), a line of voice-over, text on\nscreen, a length in seconds, and direction for the critic.\n\n## Who does what\n- **You** say what the video is for and how it should feel. One paragraph is enough: who it is for, what it must show,\n the one thing to feel.\n- **The platform** drafts the storyboard from that brief for free (create_video with draft on).\n- **Rose, the Creative Director** (ask_agent creative, with production set to the video id) tightens shots, writes\n better lines, picks looks and models, and proposes changes you apply with apply_chat_action.\n- **The critic** (critique_video) judges takes against each shot's direction and keeps the best.\n\n## Models and money\nstudio_overview lists every model the company can run with its price per image, per second of clip, per voice line or\nper track. update_video {style: {models: {clip, keyframe, voice, music}}} picks them for one video; studio_settings\nsets the defaults. Keyframes (one still per shot) cost cents and lock the look before clips, which cost the most. Every\ntool that spends asks you first, through your tool's own dialog, with the amount.\n\n## The order that works\n1. create_video \u2192 2. get_video, read the shots \u2192 3. ask_agent creative to tighten \u2192 4. update_video models if needed \u2192\n5. video_keyframes \u2192 wait_for_video \u2192 critique_video keyframes \u2192 6. make_video_media all \u2192 wait_for_video \u2192\ncritique_video clips \u2192 7. render_video \u2192 wait_for_video \u2192 the render link, or open_in_app video.\n\n## Shapes and lengths\n16:9 for the web and decks, 9:16 for Reels, Shorts and TikTok, 1:1 and 4:5 for feeds. Teasers run 15 to 30 seconds;\na product walkthrough 60 to 90. Fewer, longer shots read better than many short ones.\n\n## When something is missing\nget_video and wait_for_video list what still blocks a render: a shot without media, a voice line not made, music not\ncomposed. make_video_media takes a `what` (visuals, voice, music or all) to fill only that gap. A failed generation can\nbe retried with update_media {action: retry}.\n";
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const STUDIO_GUIDE = "# The Studio, in short\n\nThe Studio makes images, clips, voice lines and music, and cuts them into videos. A video is a storyboard: shots in\norder, each with a picture (generated, footage you have, a title card, or a presenter), a line of voice-over, text on\nscreen, a length in seconds, and direction for the critic.\n\n## Who does what\n- **You** say what the video is for and how it should feel. One paragraph is enough: who it is for, what it must show,\n the one thing to feel.\n- **The platform** drafts the storyboard from that brief for free (create_video with draft on).\n- **Rose, the Creative Director** (ask_agent creative, with production set to the video id) tightens shots, writes\n better lines, picks looks and models, and proposes changes you apply with apply_chat_action.\n- **The critic** (critique_video) judges takes against each shot's direction and keeps the best.\n\n## Models and money\nstudio_overview lists every model the company can run with its price per image, per second of clip, per voice line or\nper track. update_video {style: {models: {clip, keyframe, voice, music}}} picks them for one video; studio_settings\nsets the defaults. Keyframes (one still per shot) cost cents and lock the look before clips, which cost the most. Every\ntool that spends asks you first, through your tool's own dialog, with the amount.\n\n## The order that works\n1. create_video \u2192 2. get_video, read the shots \u2192 3. ask_agent creative to tighten \u2192 4. update_video models if needed \u2192\n5. video_keyframes \u2192 wait_for_video \u2192 critique_video keyframes \u2192 6. make_video_media all \u2192 wait_for_video \u2192\ncritique_video clips \u2192 7. render_video \u2192 wait_for_video \u2192 the render link, or open_in_app video.\n\n## Shapes and lengths\n16:9 for the web and decks, 9:16 for Reels, Shorts and TikTok, 1:1 and 4:5 for feeds. Teasers run 15 to 30 seconds;\na product walkthrough 60 to 90. Fewer, longer shots read better than many short ones.\n\n## Your own files\nRecordings, screen captures, photos, a voice track, music: upload_media puts them in the library. When the server runs\non your machine (npx -y @autopo/mcp, what Claude Code, Codex and Cursor launch), each file is a path, or a folder of\nthem; hosted, each is a public URL. With a video, in_order puts the files on the shots that have no picture yet, and\nshot puts one file on one shot (a clip or image as its footage, audio as its voice line); attach_media does the same\nfor something already in the library. A whole plan with its files (a zip with plan.json, or the folder) goes in with\nimport_video_plan {path}. Files never travel through the MCP connection: the server uploads them to the platform.\n\n## When something is missing\nget_video and wait_for_video list what still blocks a render: a shot without media, a voice line not made, music not\ncomposed. make_video_media takes a `what` (visuals, voice, music or all) to fill only that gap. A failed generation can\nbe retried with update_media {action: retry}.\n\n## Code films\nA video can be cut in code instead of by the joiner: convert_video_to_code compiles its storyboard into a small Remotion\nproject (src/film.json holds every word, picture and timing; TypeScript scenes under src/ draw the shots). get_video_code\nreads the project or one file, write_video_code writes files (a new version, checked at once: tsc and the lint, with file\nand line), check_video_code checks again, video_frames draws stills to look at, video_code_versions and restore_video_code\ngo back, and render_video renders the last checked version. None of it spends credits. get_video says the engine and where\nthe code stands. The loop from a terminal: autopoiesis://guide/code-film. Rose cuts in code herself on a film task\n(ask_agent creative, with production): ask her for a scene and read what she wrote with get_video_code.\n";
|
|
3
|
+
export declare const CODE_FILM_GUIDE = "# Making a code film from a terminal\n\nA code film is a video whose cut is a small Remotion project instead of the ffmpeg joiner. The storyboard (shots, lines,\nmedia, direction) stays the Studio's and compiles into src/film.json; TypeScript scenes under src/ draw each shot. The\nplatform checks every write (tsc and its lint), builds the preview the web Studio plays, draws stills on request and\nrenders through Remotion. Nothing here spends credits; renders and frames are free.\n\n## The loop, tool by tool\n1. A video with its material: create_video, then ask_agent {agent: \"creative\", production: <video id>, message: ...} so\n Rose tightens the shots; make_video_media and critique_video as for any video (the teaser guide).\n2. convert_video_to_code {video}: the storyboard compiles to version 1 (src/Film.tsx, src/Root.tsx, src/scenes.ts,\n src/film.json). The result lists the files, the scenes with their frames and the first check. A company whose Studio\n default engine is remotion gets this at create_video already; get_video's engine and code say where a video stands.\n3. get_video_code {video} reads the project; get_video_code {video, file: \"src/Film.tsx\"} one file. Read film.json first:\n it is the contract between the storyboard and your scenes, and the compiler owns it.\n4. write_video_code {video, files: [{path: \"src/scenes/Hook.tsx\", content: ...}], note}: a new version, checked at once.\n Read check.ok and check.errors (file, line, message) before anything else; warnings are craft notes (a card over 7\n words, no hook by 2 s, text outside the 9:16 safe box). Point a shot at your scene by naming it in src/scenes.ts.\n5. check_video_code {video} runs the check again without a write (after the storyboard changed, say).\n6. video_frames {video, frames: [0, 45, 90]} or {every_seconds: 2}: up to 12 stills as Studio images, with links to look\n at. Fix, write, check, look again.\n7. render_video {video} renders the last checked version; wait_for_video returns the link. A refusal names the film's own\n problem (\"the code film's check failed: ...\") and the tool to fix it.\n8. video_code_versions and restore_video_code {video, version} go back to any earlier version (a new version, checked).\n\n## The three rules that never bend\n- Words live in film.json, not in code: a line, a card's text or a title comes from the storyboard (set_video_shots), so\n the Studio, the captions and the QC agree with the picture.\n- Product UI is footage: record the real screen (upload_media) and show it in a FootageScene; never draw a fake UI.\n- Only the kit's imports: @autopo/film, react, remotion, @remotion/*, zod and the film's own files. No fetch, timers,\n Math.random, CSS animations or the clock: the lint refuses them and the render would drift.\n\n## Where the depth is\nThe compiler's own files are the best example: read src/Film.tsx and src/film.json with get_video_code. The Film Kit's API\n(@autopo/film: scenes, cards, hooks, media helpers, the numbers a scene is held to) and the film.json contract are the\nCreative Director's guide, served by the hosted server as read_studio_guide {file: \"film-code/references/kit.md\"} and the\nresources autopoiesis://film-kit/kit.md and autopoiesis://film-kit/contract.md; here, api_request GET\n/api/skills/autopoiesis-film-code returns the guide's method and its file list, and autopoiesis://film-kit/SKILL.md serves it.\n";
|
|
4
|
+
export declare const TEASER_GUIDE = "# Making a teaser from a terminal\n\nThe loop, tool by tool (the make_a_teaser prompt runs it for you):\n\n1. brand_brain: the voice, the audience, the enemy.\n2. create_video {title, brief, aspect_ratio, seconds: 20}: a storyboard is drafted for free.\n3. get_video: read the shots. ask_agent {agent: \"creative\", production: <video id>, message: ...}: Rose tightens them;\n apply_chat_action on her proposals, or set_video_shots to write them yourself.\n4. studio_overview, then update_video {style: {models}} only if the defaults don't fit.\n5. video_keyframes: cents per shot, you confirm. wait_for_video. critique_video {stage: \"keyframes\"}.\n6. make_video_media {what: \"all\"}: the clips and voice lines, you confirm the cost. wait_for_video until nothing is\n generating. critique_video {stage: \"clips\"}.\n7. render_video (free). wait_for_video. The render link is in the result; open_in_app {what: \"video\", id} shows it.\n\nFootage you already have (recordings, screen captures): upload_media {video, files: [{path: \"footage/\"}], in_order: true}\nputs the files on the shots in order, so nothing is generated for them; a whole plan with its files comes in with\nimport_video_plan {path: \"teaser.zip\"}. Paths work when the server runs on your machine; hosted, give URLs.\n\nNothing is spent without the dialog. wait_for_video returns what is still missing when it cannot go on.\n";
|
package/dist/guides.js
CHANGED
|
@@ -28,10 +28,66 @@ critique_video clips → 7. render_video → wait_for_video → the render link,
|
|
|
28
28
|
16:9 for the web and decks, 9:16 for Reels, Shorts and TikTok, 1:1 and 4:5 for feeds. Teasers run 15 to 30 seconds;
|
|
29
29
|
a product walkthrough 60 to 90. Fewer, longer shots read better than many short ones.
|
|
30
30
|
|
|
31
|
+
## Your own files
|
|
32
|
+
Recordings, screen captures, photos, a voice track, music: upload_media puts them in the library. When the server runs
|
|
33
|
+
on your machine (npx -y @autopo/mcp, what Claude Code, Codex and Cursor launch), each file is a path, or a folder of
|
|
34
|
+
them; hosted, each is a public URL. With a video, in_order puts the files on the shots that have no picture yet, and
|
|
35
|
+
shot puts one file on one shot (a clip or image as its footage, audio as its voice line); attach_media does the same
|
|
36
|
+
for something already in the library. A whole plan with its files (a zip with plan.json, or the folder) goes in with
|
|
37
|
+
import_video_plan {path}. Files never travel through the MCP connection: the server uploads them to the platform.
|
|
38
|
+
|
|
31
39
|
## When something is missing
|
|
32
40
|
get_video and wait_for_video list what still blocks a render: a shot without media, a voice line not made, music not
|
|
33
41
|
composed. make_video_media takes a \`what\` (visuals, voice, music or all) to fill only that gap. A failed generation can
|
|
34
42
|
be retried with update_media {action: retry}.
|
|
43
|
+
|
|
44
|
+
## Code films
|
|
45
|
+
A video can be cut in code instead of by the joiner: convert_video_to_code compiles its storyboard into a small Remotion
|
|
46
|
+
project (src/film.json holds every word, picture and timing; TypeScript scenes under src/ draw the shots). get_video_code
|
|
47
|
+
reads the project or one file, write_video_code writes files (a new version, checked at once: tsc and the lint, with file
|
|
48
|
+
and line), check_video_code checks again, video_frames draws stills to look at, video_code_versions and restore_video_code
|
|
49
|
+
go back, and render_video renders the last checked version. None of it spends credits. get_video says the engine and where
|
|
50
|
+
the code stands. The loop from a terminal: autopoiesis://guide/code-film. Rose cuts in code herself on a film task
|
|
51
|
+
(ask_agent creative, with production): ask her for a scene and read what she wrote with get_video_code.
|
|
52
|
+
`;
|
|
53
|
+
export const CODE_FILM_GUIDE = `# Making a code film from a terminal
|
|
54
|
+
|
|
55
|
+
A code film is a video whose cut is a small Remotion project instead of the ffmpeg joiner. The storyboard (shots, lines,
|
|
56
|
+
media, direction) stays the Studio's and compiles into src/film.json; TypeScript scenes under src/ draw each shot. The
|
|
57
|
+
platform checks every write (tsc and its lint), builds the preview the web Studio plays, draws stills on request and
|
|
58
|
+
renders through Remotion. Nothing here spends credits; renders and frames are free.
|
|
59
|
+
|
|
60
|
+
## The loop, tool by tool
|
|
61
|
+
1. A video with its material: create_video, then ask_agent {agent: "creative", production: <video id>, message: ...} so
|
|
62
|
+
Rose tightens the shots; make_video_media and critique_video as for any video (the teaser guide).
|
|
63
|
+
2. convert_video_to_code {video}: the storyboard compiles to version 1 (src/Film.tsx, src/Root.tsx, src/scenes.ts,
|
|
64
|
+
src/film.json). The result lists the files, the scenes with their frames and the first check. A company whose Studio
|
|
65
|
+
default engine is remotion gets this at create_video already; get_video's engine and code say where a video stands.
|
|
66
|
+
3. get_video_code {video} reads the project; get_video_code {video, file: "src/Film.tsx"} one file. Read film.json first:
|
|
67
|
+
it is the contract between the storyboard and your scenes, and the compiler owns it.
|
|
68
|
+
4. write_video_code {video, files: [{path: "src/scenes/Hook.tsx", content: ...}], note}: a new version, checked at once.
|
|
69
|
+
Read check.ok and check.errors (file, line, message) before anything else; warnings are craft notes (a card over 7
|
|
70
|
+
words, no hook by 2 s, text outside the 9:16 safe box). Point a shot at your scene by naming it in src/scenes.ts.
|
|
71
|
+
5. check_video_code {video} runs the check again without a write (after the storyboard changed, say).
|
|
72
|
+
6. video_frames {video, frames: [0, 45, 90]} or {every_seconds: 2}: up to 12 stills as Studio images, with links to look
|
|
73
|
+
at. Fix, write, check, look again.
|
|
74
|
+
7. render_video {video} renders the last checked version; wait_for_video returns the link. A refusal names the film's own
|
|
75
|
+
problem ("the code film's check failed: ...") and the tool to fix it.
|
|
76
|
+
8. video_code_versions and restore_video_code {video, version} go back to any earlier version (a new version, checked).
|
|
77
|
+
|
|
78
|
+
## The three rules that never bend
|
|
79
|
+
- Words live in film.json, not in code: a line, a card's text or a title comes from the storyboard (set_video_shots), so
|
|
80
|
+
the Studio, the captions and the QC agree with the picture.
|
|
81
|
+
- Product UI is footage: record the real screen (upload_media) and show it in a FootageScene; never draw a fake UI.
|
|
82
|
+
- Only the kit's imports: @autopo/film, react, remotion, @remotion/*, zod and the film's own files. No fetch, timers,
|
|
83
|
+
Math.random, CSS animations or the clock: the lint refuses them and the render would drift.
|
|
84
|
+
|
|
85
|
+
## Where the depth is
|
|
86
|
+
The compiler's own files are the best example: read src/Film.tsx and src/film.json with get_video_code. The Film Kit's API
|
|
87
|
+
(@autopo/film: scenes, cards, hooks, media helpers, the numbers a scene is held to) and the film.json contract are the
|
|
88
|
+
Creative Director's guide, served by the hosted server as read_studio_guide {file: "film-code/references/kit.md"} and the
|
|
89
|
+
resources autopoiesis://film-kit/kit.md and autopoiesis://film-kit/contract.md; here, api_request GET
|
|
90
|
+
/api/skills/autopoiesis-film-code returns the guide's method and its file list, and autopoiesis://film-kit/SKILL.md serves it.
|
|
35
91
|
`;
|
|
36
92
|
export const TEASER_GUIDE = `# Making a teaser from a terminal
|
|
37
93
|
|
|
@@ -47,6 +103,10 @@ The loop, tool by tool (the make_a_teaser prompt runs it for you):
|
|
|
47
103
|
generating. critique_video {stage: "clips"}.
|
|
48
104
|
7. render_video (free). wait_for_video. The render link is in the result; open_in_app {what: "video", id} shows it.
|
|
49
105
|
|
|
106
|
+
Footage you already have (recordings, screen captures): upload_media {video, files: [{path: "footage/"}], in_order: true}
|
|
107
|
+
puts the files on the shots in order, so nothing is generated for them; a whole plan with its files comes in with
|
|
108
|
+
import_video_plan {path: "teaser.zip"}. Paths work when the server runs on your machine; hosted, give URLs.
|
|
109
|
+
|
|
50
110
|
Nothing is spent without the dialog. wait_for_video returns what is still missing when it cannot go on.
|
|
51
111
|
`;
|
|
52
112
|
//# sourceMappingURL=guides.js.map
|
package/dist/guides.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guides.js","sourceRoot":"","sources":["../src/guides.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,MAAM,CAAC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"guides.js","sourceRoot":"","sources":["../src/guides.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD3B,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC9B,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;CAmB3B,CAAA"}
|
package/dist/http.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface HttpOptions {
|
|
|
12
12
|
appUrl: string;
|
|
13
13
|
publicUrl?: string;
|
|
14
14
|
mediaDomains: string[];
|
|
15
|
+
/** Let tools read paths on this host (only for a server you run for yourself; off for a shared one). */
|
|
16
|
+
local?: boolean;
|
|
15
17
|
/** Hostnames this server answers for; empty: any (a public service behind its own DNS). */
|
|
16
18
|
allowedHosts?: string[];
|
|
17
19
|
/** Seconds a 2025-era session may idle before it is closed. */
|
package/dist/http.js
CHANGED
|
@@ -35,7 +35,7 @@ async function readBody(req) {
|
|
|
35
35
|
}
|
|
36
36
|
export function serveHttp(options) {
|
|
37
37
|
const idleMs = (options.sessionIdleSeconds ?? 1800) * 1000;
|
|
38
|
-
const make = (token) => createServer({ token, apiUrl: options.apiUrl, appUrl: options.appUrl, mediaDomains: options.mediaDomains, ...(options.publicUrl ? { publicUrl: options.publicUrl } : {}) });
|
|
38
|
+
const make = (token) => createServer({ token, apiUrl: options.apiUrl, appUrl: options.appUrl, mediaDomains: options.mediaDomains, local: options.local ?? false, ...(options.publicUrl ? { publicUrl: options.publicUrl } : {}) });
|
|
39
39
|
// modern leg: stateless, a fresh server per request from the caller's token
|
|
40
40
|
const modern = createMcpHandler((ctx) => make(ctx.authInfo?.token ?? ''), { legacy: 'reject', onerror: (e) => console.error('[mcp]', e.message) });
|
|
41
41
|
const modernNode = toNodeHandler(modern, { onerror: (e) => console.error('[mcp]', e.message) });
|
package/dist/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAA6C,MAAM,WAAW,CAAA;AACvG,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAA;AAC/F,OAAO,EAAE,iCAAiC,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC3G,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAA6C,MAAM,WAAW,CAAA;AACvG,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,gBA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C,KAAK,CAAC,mBAAmB,OAAO,cAAc,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,UAAU,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/G,CAAC,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,GAAG,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE;QAAE,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,CAAC,CAAC,CAAA;IACxK,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC1B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IAC3B,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
package/dist/kit.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export interface SessionOptions {
|
|
|
34
34
|
mediaDomains?: string[];
|
|
35
35
|
/** The public address of this server when it is hosted (for the Claude sandbox domain). */
|
|
36
36
|
publicUrl?: string;
|
|
37
|
+
/** True when the server runs on the person's own machine (stdio): tools may then read files by path. */
|
|
38
|
+
local?: boolean;
|
|
37
39
|
}
|
|
38
40
|
/** One person's connection: their API plus a short-lived cache of what tools keep asking for. */
|
|
39
41
|
export declare class Session {
|
|
@@ -41,6 +43,7 @@ export declare class Session {
|
|
|
41
43
|
readonly appUrl: string;
|
|
42
44
|
readonly mediaDomains: string[];
|
|
43
45
|
readonly publicUrl: string | undefined;
|
|
46
|
+
readonly local: boolean;
|
|
44
47
|
private companiesCache;
|
|
45
48
|
private studioCache;
|
|
46
49
|
private schemaCache;
|
package/dist/kit.js
CHANGED
|
@@ -9,6 +9,7 @@ export class Session {
|
|
|
9
9
|
appUrl;
|
|
10
10
|
mediaDomains;
|
|
11
11
|
publicUrl;
|
|
12
|
+
local;
|
|
12
13
|
companiesCache = null;
|
|
13
14
|
studioCache = new Map();
|
|
14
15
|
schemaCache = null;
|
|
@@ -17,6 +18,7 @@ export class Session {
|
|
|
17
18
|
this.appUrl = options.appUrl.replace(/\/+$/, '');
|
|
18
19
|
this.mediaDomains = options.mediaDomains ?? [];
|
|
19
20
|
this.publicUrl = options.publicUrl;
|
|
21
|
+
this.local = options.local ?? false;
|
|
20
22
|
}
|
|
21
23
|
async companies() {
|
|
22
24
|
if (this.companiesCache && Date.now() - this.companiesCache.at < 60_000)
|