@ascegu/teamily 1.0.25 → 1.0.26
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/package.json +1 -1
- package/src/channel.ts +1 -1
- package/src/upload.ts +42 -1
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -72,7 +72,7 @@ export const teamilyPlugin: ChannelPlugin<ResolvedTeamilyAccount> = {
|
|
|
72
72
|
},
|
|
73
73
|
agentPrompt: {
|
|
74
74
|
messageToolHints: () => [
|
|
75
|
-
"- To send a local file or image to the user, use MEDIA:./relative-path in your reply (e.g. MEDIA:./image.png). The path must be relative to the workspace.
|
|
75
|
+
"- To send a local file or image to the user, use MEDIA:./relative-path in your reply (e.g. MEDIA:./image.png or MEDIA:./data.json). The path must be relative to the workspace. Avoid absolute paths and ~ paths — they are blocked for security. If the user asks you to send a file outside the workspace (e.g. ~/.openclaw/openclaw.json), first copy it into the workspace (e.g. cp ~/.openclaw/openclaw.json ./openclaw.json), then use MEDIA:./openclaw.json to send it.",
|
|
76
76
|
],
|
|
77
77
|
},
|
|
78
78
|
reload: { configPrefixes: ["channels.teamily"] },
|
package/src/upload.ts
CHANGED
|
@@ -12,7 +12,17 @@ export function detectMediaCategory(filePath: string): MediaCategory {
|
|
|
12
12
|
const ext = path.extname(filePath).toLowerCase();
|
|
13
13
|
if ([".mp4", ".mov", ".webm"].includes(ext)) return "video";
|
|
14
14
|
if ([".mp3", ".m4a", ".wav", ".ogg"].includes(ext)) return "audio";
|
|
15
|
-
if (
|
|
15
|
+
if (
|
|
16
|
+
[
|
|
17
|
+
".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx",
|
|
18
|
+
".zip", ".rar", ".7z", ".tar", ".gz", ".tgz",
|
|
19
|
+
".txt", ".csv", ".json", ".xml", ".yaml", ".yml",
|
|
20
|
+
".log", ".md", ".html", ".css", ".js", ".ts",
|
|
21
|
+
".py", ".go", ".rs", ".java", ".c", ".cpp", ".h",
|
|
22
|
+
".sh", ".bat", ".sql", ".toml", ".ini", ".cfg",
|
|
23
|
+
].includes(ext)
|
|
24
|
+
)
|
|
25
|
+
return "file";
|
|
16
26
|
return "image";
|
|
17
27
|
}
|
|
18
28
|
|
|
@@ -41,6 +51,37 @@ export function guessContentType(filePath: string): string {
|
|
|
41
51
|
".doc": "application/msword",
|
|
42
52
|
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
43
53
|
".zip": "application/zip",
|
|
54
|
+
".rar": "application/vnd.rar",
|
|
55
|
+
".7z": "application/x-7z-compressed",
|
|
56
|
+
".tar": "application/x-tar",
|
|
57
|
+
".gz": "application/gzip",
|
|
58
|
+
".tgz": "application/gzip",
|
|
59
|
+
".txt": "text/plain",
|
|
60
|
+
".csv": "text/csv",
|
|
61
|
+
".json": "application/json",
|
|
62
|
+
".xml": "application/xml",
|
|
63
|
+
".yaml": "text/yaml",
|
|
64
|
+
".yml": "text/yaml",
|
|
65
|
+
".log": "text/plain",
|
|
66
|
+
".md": "text/markdown",
|
|
67
|
+
".html": "text/html",
|
|
68
|
+
".css": "text/css",
|
|
69
|
+
".js": "application/javascript",
|
|
70
|
+
".ts": "application/typescript",
|
|
71
|
+
".py": "text/x-python",
|
|
72
|
+
".go": "text/x-go",
|
|
73
|
+
".rs": "text/x-rust",
|
|
74
|
+
".java": "text/x-java",
|
|
75
|
+
".c": "text/x-c",
|
|
76
|
+
".cpp": "text/x-c++",
|
|
77
|
+
".h": "text/x-c",
|
|
78
|
+
".sh": "text/x-shellscript",
|
|
79
|
+
".sql": "application/sql",
|
|
80
|
+
".toml": "application/toml",
|
|
81
|
+
".xls": "application/vnd.ms-excel",
|
|
82
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
83
|
+
".ppt": "application/vnd.ms-powerpoint",
|
|
84
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
44
85
|
};
|
|
45
86
|
return map[ext] ?? "application/octet-stream";
|
|
46
87
|
}
|