@openduo/channel-feishu 0.2.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/bin/duoduo-feishu +38 -0
- package/config/feishu.md +19 -0
- package/dist/plugin.js +81 -0
- package/package.json +73 -0
- package/scripts/postinstall.mjs +54 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
SCRIPT_PATH="${BASH_SOURCE[0]}"
|
|
5
|
+
while [[ -L "$SCRIPT_PATH" ]]; do
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
7
|
+
LINK_TARGET="$(readlink "$SCRIPT_PATH")"
|
|
8
|
+
if [[ "$LINK_TARGET" == /* ]]; then
|
|
9
|
+
SCRIPT_PATH="$LINK_TARGET"
|
|
10
|
+
else
|
|
11
|
+
SCRIPT_PATH="$SCRIPT_DIR/$LINK_TARGET"
|
|
12
|
+
fi
|
|
13
|
+
done
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_PATH")" && pwd)"
|
|
15
|
+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
16
|
+
|
|
17
|
+
if [[ -f "$ROOT_DIR/dist/plugin.js" ]]; then
|
|
18
|
+
exec node "$ROOT_DIR/dist/plugin.js" "$@"
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [[ -f "$ROOT_DIR/../../dist/release/feishu-gateway.js" ]]; then
|
|
22
|
+
exec node "$ROOT_DIR/../../dist/release/feishu-gateway.js" "$@"
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [[ -x "$ROOT_DIR/node_modules/.bin/tsx" ]]; then
|
|
26
|
+
exec "$ROOT_DIR/node_modules/.bin/tsx" "$ROOT_DIR/src/main.ts" "$@"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
if command -v pnpm >/dev/null 2>&1; then
|
|
30
|
+
exec pnpm --dir "$ROOT_DIR" exec tsx "$ROOT_DIR/src/main.ts" "$@"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
if command -v npx >/dev/null 2>&1; then
|
|
34
|
+
exec npx tsx "$ROOT_DIR/src/main.ts" "$@"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo "tsx not found. Install dependencies first." >&2
|
|
38
|
+
exit 1
|
package/config/feishu.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
# KIND DESCRIPTOR for Feishu channels.
|
|
3
|
+
# See kernel/config/stdio.md for the full reference of all supported keys:
|
|
4
|
+
# new_session_workspace, prompt_mode, allowedTools, disallowedTools,
|
|
5
|
+
# additionalDirectories (and their aliases).
|
|
6
|
+
# Instance descriptors (var/channels/<id>/descriptor.md) override these defaults.
|
|
7
|
+
new_session_workspace: /workspace
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
You are operating through the Feishu (飞书/Lark) messaging channel.
|
|
11
|
+
|
|
12
|
+
Users communicate with you through chat messages — either in group chats or
|
|
13
|
+
direct messages. Messages tend to be brief and conversational.
|
|
14
|
+
|
|
15
|
+
Keep responses concise and well-formatted for chat display. Avoid excessive
|
|
16
|
+
markdown formatting — plain text and simple lists work best in chat contexts.
|
|
17
|
+
|
|
18
|
+
In group chats, multiple users may interact with you. Pay attention to context
|
|
19
|
+
and the flow of conversation.
|