Skip to content

Commit 9ab23cb

Browse files
authored
Add HTTPS attachment probe skill (#16)
* Require inline bytes for sandbox probe attachments * Clarify probe attachment type coverage * Prevent probe size preflight path fallback * Clarify large attachment probe transport * Add HTTPS attachment probe skill * Validate single Cuey skill package
1 parent b5fca41 commit 9ab23cb

6 files changed

Lines changed: 70 additions & 131 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "cuey",
1010
"source": "./plugins/cuey",
1111
"description": "Cuey is an agentic financial intelligence system that analyzes prompts and Excel workbooks, improves decision accuracy through cross-checking and fact-checking, and delivers evidence-backed recommendations.",
12-
"version": "0.4.10",
12+
"version": "0.4.12",
1313
"author": {
1414
"name": "TensorBlock"
1515
},

plugins/cuey/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cuey",
3-
"version": "0.4.10",
3+
"version": "0.4.12",
44
"description": "Cuey is an agentic financial intelligence system that analyzes prompts and Excel workbooks, improves decision accuracy through cross-checking and fact-checking, and delivers evidence-backed recommendations.",
55
"author": {
66
"name": "TensorBlock",

plugins/cuey/skills/cuey-probe/SKILL.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

plugins/cuey/skills/cuey/SKILL.md

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: cuey
3-
description: Run Cuey only when the user explicitly invokes /cuey. Cuey analyzes prompts and Excel workbooks, cross-checks key claims, fact-checks assumptions, and returns evidence-backed recommendations. Use /cuey probe only for attachment transport diagnostics.
3+
description: Run Cuey only when the user explicitly invokes /cuey. Cuey analyzes prompts and Excel workbooks, cross-checks key claims, fact-checks assumptions, and returns evidence-backed recommendations. Use /cuey probe or /cuey probe https only for attachment transport diagnostics.
44
argument-hint: <question>
55
---
66

@@ -10,13 +10,67 @@ Run this skill only after the user explicitly invokes `/cuey`. Do not invoke Cue
1010

1111
Before using any tool, classify the invocation using this routing table:
1212

13-
1. If `$ARGUMENTS` is exactly `probe`, starts with `probe `, or is an explicit
13+
1. If `$ARGUMENTS` is exactly `probe https` or starts with `probe https `,
14+
this is an HTTPS attachment probe. You must follow **HTTPS Attachment Probe**
15+
and must not call `cuey:ask_cuey`.
16+
2. If `$ARGUMENTS` is exactly `probe`, starts with `probe `, or is an explicit
1417
attachment transport diagnostic request such as `attachment probe`, this is
1518
a probe request. You must follow **Attachment Probe** and must not call
1619
`cuey:ask_cuey`.
17-
2. Otherwise, this is a normal Cuey request. Follow **Ask Cuey** and call
20+
3. Otherwise, this is a normal Cuey request. Follow **Ask Cuey** and call
1821
`cuey:ask_cuey`.
1922

23+
## HTTPS Attachment Probe
24+
25+
This section applies only to `/cuey probe https`. It validates the direct,
26+
large-file transport path. Do not search for or call `cuey:ask_cuey`, do not
27+
build an Ask Cuey payload, and do not analyze the attachment.
28+
29+
Use exactly one raw attachment from the current user message. Never reuse an
30+
attachment from an earlier message. Claude must have a readable raw file path
31+
for that current attachment, normally under `/root/.claude/uploads/...`. If no
32+
such path is available, say that direct upload cannot be tested for this
33+
attachment and stop.
34+
35+
1. Read the file size with `stat -c%s` and SHA-256 with `sha256sum` in the
36+
Claude sandbox. Do not base64 encode or chunk the file.
37+
2. Call only `cuey:probe_claude_attachment_https` with:
38+
39+
```json
40+
{
41+
"action": "begin",
42+
"filename": "original filename",
43+
"mimeType": "original MIME type",
44+
"sizeBytes": 123,
45+
"sha256": "lowercase sha256"
46+
}
47+
```
48+
49+
3. From the returned `upload_url`, `headers`, and `probe_token`, use `curl` in
50+
the Claude sandbox to stream the exact original file:
51+
52+
```bash
53+
curl --fail --silent --show-error --request PUT \
54+
--upload-file "$ATTACHMENT_PATH" \
55+
-H "Content-Type: $MIME_TYPE" \
56+
-H "x-amz-meta-cuey-sha256: $SHA256" \
57+
"$UPLOAD_URL"
58+
```
59+
60+
4. Call only `cuey:probe_claude_attachment_https` again:
61+
62+
```json
63+
{
64+
"action": "complete",
65+
"probeToken": "token returned by begin"
66+
}
67+
```
68+
69+
The upload URL and probe token are short-lived secrets. Use them only in tool
70+
calls and commands; never include either in the user-visible answer. Return the
71+
completion result exactly and stop. This probe does not run fanout, persist a
72+
Cuey document, or produce a normal Ask Cuey answer.
73+
2074
## Attachment Probe
2175

2276
This section applies only to probe requests.
@@ -51,6 +105,13 @@ by the local Cuey MCP runtime. First read that current-message file in Claude's
51105
sandbox and pass its bytes inline as base64. Include the path only as metadata
52106
alongside the base64.
53107

108+
Do not run a size preflight and then decide to send a sandbox path instead of
109+
bytes. For this probe, attempt the MCP call with inline base64 when Claude can
110+
read the current-message attachment bytes. If the attachment is too large for a
111+
single inline MCP tool call, stop and report that this file requires the direct
112+
HTTPS transport path. In that failure case, do not
113+
retry with a `/root/.claude/uploads/...` path-only payload.
114+
54115
Only if Claude exposes a non-sandbox file path or handle that the MCP runtime
55116
can read may you pass a path or handle without base64. If Claude exposes only
56117
extracted text and no raw file reference or bytes, leave `attachments` and

plugins/cuey/skills/probe/SKILL.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

scripts/build-plugin.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ cp -R "$plugin_dir/." "$output_dir/"
1515
archive_entries="$(/usr/bin/unzip -Z1 "$archive")"
1616
grep -qx 'cuey/.claude-plugin/plugin.json' <<<"$archive_entries"
1717
grep -qx 'cuey/skills/cuey/SKILL.md' <<<"$archive_entries"
18-
grep -qx 'cuey/skills/cuey-probe/SKILL.md' <<<"$archive_entries"
19-
grep -qx 'cuey/skills/probe/SKILL.md' <<<"$archive_entries"
18+
if grep -Eq '^cuey/skills/(cuey-probe|probe)/' <<<"$archive_entries"; then
19+
echo "Cuey plugin must package only the /cuey skill." >&2
20+
exit 1
21+
fi
2022
if grep -Eq '^cuey/(\.mcp\.json|mcp/)' <<<"$archive_entries"; then
2123
echo "Cuey plugin must stay skill-only; the Cuey installer owns the global MCP runtime." >&2
2224
exit 1

0 commit comments

Comments
 (0)