@elisym/mcp 0.15.9 → 0.16.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/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2228,6 +2228,9 @@ var SubmitAndPayJobFromFileSchema = z.object({
|
|
|
2228
2228
|
input_path: z.string().min(1).max(4096).describe(
|
|
2229
2229
|
"Path to a regular file whose contents become the job input. Absolute or relative to the MCP server's working directory."
|
|
2230
2230
|
),
|
|
2231
|
+
prompt: z.string().max(MAX_INPUT_LEN).default("").describe(
|
|
2232
|
+
'Optional text instruction sent alongside the file (e.g. how to edit an image: "make it night", "add a hat"). It rides inline (NIP-44 encrypted) in the job event while the file travels peer-to-peer via iroh. The single attachment slot holds the file, so the prompt cannot spill to a second transfer - keep it short.'
|
|
2233
|
+
),
|
|
2231
2234
|
provider_npub: z.string(),
|
|
2232
2235
|
capability: z.string().min(1).max(64).default("general"),
|
|
2233
2236
|
kind_offset: z.number().int().min(0).max(999).default(DEFAULT_KIND_OFFSET),
|
|
@@ -3089,11 +3092,18 @@ ${wrapped}`);
|
|
|
3089
3092
|
}),
|
|
3090
3093
|
defineTool({
|
|
3091
3094
|
name: "submit_and_pay_job_from_file",
|
|
3092
|
-
description: "Same as submit_and_pay_job, but the job input is read from a file on disk by the MCP server instead of being passed inline by the LLM. Use this when the input is large or binary (images, logs, captured output) and the LLM only needs to forward it - the file content never enters the model's output tokens. input_path may be absolute or relative to the MCP server's working directory. The file is ALWAYS transferred peer-to-peer via iroh, so this needs: a persistent agent, a PAID provider skill (free skills reject file inputs), and the iroh addon. Text files reach the skill on stdin; binary files via ELISYM_INPUT_FILE.",
|
|
3095
|
+
description: "Same as submit_and_pay_job, but the job input is read from a file on disk by the MCP server instead of being passed inline by the LLM. Use this when the input is large or binary (images, logs, captured output) and the LLM only needs to forward it - the file content never enters the model's output tokens. input_path may be absolute or relative to the MCP server's working directory. The file is ALWAYS transferred peer-to-peer via iroh, so this needs: a persistent agent, a PAID provider skill (free skills reject file inputs), and the iroh addon. Text files reach the skill on stdin; binary files via ELISYM_INPUT_FILE. Pass an optional `prompt` to send a text instruction alongside the file (e.g. how to edit an image); it rides inline (encrypted) while the file rides P2P.",
|
|
3093
3096
|
schema: SubmitAndPayJobFromFileSchema,
|
|
3094
3097
|
async handler(ctx, input) {
|
|
3095
3098
|
ctx.toolRateLimiter.check();
|
|
3096
3099
|
checkLen("provider_npub", input.provider_npub, MAX_NPUB_LEN);
|
|
3100
|
+
const PROMPT_INLINE_CAP = 55e3;
|
|
3101
|
+
const trimmedPrompt = input.prompt.trim();
|
|
3102
|
+
if (utf8ByteLength(trimmedPrompt) > PROMPT_INLINE_CAP) {
|
|
3103
|
+
return errorResult(
|
|
3104
|
+
`Prompt is too long to ride inline (max ${PROMPT_INLINE_CAP} bytes); the file occupies the only attachment slot, so shorten the prompt.`
|
|
3105
|
+
);
|
|
3106
|
+
}
|
|
3097
3107
|
let prepared;
|
|
3098
3108
|
try {
|
|
3099
3109
|
prepared = await prepareFileInput(input.input_path, {
|
|
@@ -3127,7 +3137,7 @@ ${wrapped}`);
|
|
|
3127
3137
|
return errorResult(`Failed to seed file for transfer: ${msg}`);
|
|
3128
3138
|
}
|
|
3129
3139
|
return executeSubmitAndPay(ctx, agent, {
|
|
3130
|
-
input:
|
|
3140
|
+
input: trimmedPrompt,
|
|
3131
3141
|
attachment,
|
|
3132
3142
|
providerNpub: input.provider_npub,
|
|
3133
3143
|
providerPubkey: decodeNpub(input.provider_npub),
|