@reserendipity/dsh-superagent 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/NOTICE +50 -0
- package/README.md +212 -2
- package/cordis.patch.yml +214 -0
- package/examples/profile.cordis.patch.yml +31 -0
- package/lib/client.js +7695 -0
- package/lib/feishu-Dvj-1eJf.js +1325 -0
- package/lib/feishu-watch.d.ts +125 -0
- package/lib/feishu-watch.js +2 -0
- package/lib/github-pull-DRiuuSs8.js +597 -0
- package/lib/github-watch.d.ts +2 -0
- package/lib/github-watch.js +836 -0
- package/lib/host-BIWKSB5j.js +124 -0
- package/lib/inbox-watch.d.ts +43 -0
- package/lib/inbox-watch.js +343 -0
- package/lib/index.d.ts +369 -0
- package/lib/index.js +13654 -0
- package/lib/instance-status-Cqaju-dw.js +87 -0
- package/lib/instances-view.d.ts +164 -0
- package/lib/instances-view.js +258 -0
- package/lib/intake-TNIkqilh.d.ts +735 -0
- package/lib/kind--8woUEex.d.ts +1019 -0
- package/lib/poll-Bm5EYA2c.js +819 -0
- package/lib/schemas-MhNERx8d.js +4484 -0
- package/lib/schemas-lx-F2nnt.d.ts +2134 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +159 -4
- package/prompts/admission.md +68 -0
- package/prompts/cli.md +17 -0
- package/prompts/dispatch.md +59 -0
- package/prompts/handoff-orchestrator.md +4 -0
- package/prompts/handoff-worker.md +7 -0
- package/prompts/handoff.md +6 -0
- package/prompts/orchestrator.md +16 -0
- package/prompts/presets/brief/communication.md +4 -0
- package/prompts/presets/brief/delivery.md +3 -0
- package/prompts/presets/brief/scope.md +4 -0
- package/prompts/presets/evidence/communication.md +6 -0
- package/prompts/presets/evidence/delivery.md +4 -0
- package/prompts/presets/evidence/scope.md +5 -0
- package/prompts/presets/result/communication.md +4 -0
- package/prompts/presets/result/delivery.md +3 -0
- package/prompts/presets/result/scope.md +5 -0
- package/prompts/replies.md +35 -0
- package/prompts/shared.md +9 -0
- package/prompts/subscriptions.md +13 -0
- package/prompts/team/communication.md +101 -0
- package/prompts/team/delivery.md +35 -0
- package/prompts/team/scope.md +26 -0
- package/prompts/work.md +49 -0
- package/prompts/worker.md +10 -0
- package/schema/declarative-settings.example.json +26 -0
- package/schema/declarative-settings.schema.json +348 -0
- package/skills/README.md +14 -0
- package/skills/dsh-superagent-feishu/SKILL.md +12 -0
- package/skills/dsh-superagent-github/SKILL.md +14 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { S as $strip, _ as output, b as $loose, c as ZodObject, f as ZodString, h as ZodURL, i as ZodEnum, l as ZodOptional, n as ZodBoolean, r as ZodDefault, s as ZodNumber, t as ZodArray, x as $strict } from "./schemas-lx-F2nnt.js";
|
|
2
|
+
import { F as Thread, U as Trigger } from "./intake-TNIkqilh.js";
|
|
3
|
+
import { _ as Tally, g as SourceRegistry, n as SourceKind, r as SourceContext } from "./kind--8woUEex.js";
|
|
4
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
5
|
+
//#region src/sources/feishu-read.d.ts
|
|
6
|
+
/** Retained source message reference anchoring context reads; `at` is the timestamp around which `chatAround` queries. */
|
|
7
|
+
interface FeishuRef {
|
|
8
|
+
triggerId: string;
|
|
9
|
+
chatId: string;
|
|
10
|
+
messageId: string;
|
|
11
|
+
at?: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/sources/feishu-trigger.d.ts
|
|
15
|
+
declare const SOURCE = "feishu";
|
|
16
|
+
/** A message as the live event consumer prints it; the history and topic-page paths normalize what they read into this shape. */
|
|
17
|
+
declare const EventSchema: ZodObject<{
|
|
18
|
+
message_id: ZodString;
|
|
19
|
+
chat_id: ZodString;
|
|
20
|
+
chat_type: ZodEnum<{
|
|
21
|
+
p2p: "p2p";
|
|
22
|
+
group: "group";
|
|
23
|
+
}>;
|
|
24
|
+
sender_id: ZodString;
|
|
25
|
+
sender_type: ZodEnum<{
|
|
26
|
+
user: "user";
|
|
27
|
+
bot: "bot";
|
|
28
|
+
}>;
|
|
29
|
+
content: ZodString;
|
|
30
|
+
create_time: ZodString;
|
|
31
|
+
mentions: ZodDefault<ZodArray<ZodObject<{
|
|
32
|
+
id: ZodString;
|
|
33
|
+
key: ZodOptional<ZodString>;
|
|
34
|
+
name: ZodOptional<ZodString>;
|
|
35
|
+
}, $strip>>>;
|
|
36
|
+
root_id: ZodOptional<ZodString>;
|
|
37
|
+
parent_id: ZodOptional<ZodString>;
|
|
38
|
+
thread_id: ZodOptional<ZodString>;
|
|
39
|
+
message_app_link: ZodOptional<ZodURL>;
|
|
40
|
+
}, $strip>;
|
|
41
|
+
type FeishuEvent = output<typeof EventSchema>;
|
|
42
|
+
declare const feishuThreadId: (chatId: string, rootId: string | undefined, messageId: string) => string;
|
|
43
|
+
/** Deterministic trigger ID for a Feishu message; every read path for this message produces the same ID. */
|
|
44
|
+
declare const feishuTriggerId: (messageId: string) => string;
|
|
45
|
+
declare const withMentionNames: (text: string, mentions: {
|
|
46
|
+
key?: string | undefined;
|
|
47
|
+
name?: string | undefined;
|
|
48
|
+
}[]) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Parses a Feishu message timestamp into an ISO-8601 string: live events and the history API return epoch milliseconds as a
|
|
51
|
+
* string, whereas topic/thread pages return a local timestamp string such as `2026-09-11 12:00`.
|
|
52
|
+
*/
|
|
53
|
+
declare function feishuTime(value: string): string;
|
|
54
|
+
/** Converts a normalized Feishu event into a Trigger, returning undefined for messages sent by the bot itself. */
|
|
55
|
+
declare function feishuTrigger(input: unknown, botId: string, botAppId: string): Trigger | undefined;
|
|
56
|
+
declare function feishuRef(trigger: Trigger): FeishuRef | undefined;
|
|
57
|
+
/** A message from the history API; a deleted message may have no body/content. */
|
|
58
|
+
declare const HistoricalMessageSchema: ZodObject<{
|
|
59
|
+
message_id: ZodString;
|
|
60
|
+
chat_id: ZodString;
|
|
61
|
+
create_time: ZodString;
|
|
62
|
+
root_id: ZodOptional<ZodString>;
|
|
63
|
+
parent_id: ZodOptional<ZodString>;
|
|
64
|
+
thread_id: ZodOptional<ZodString>;
|
|
65
|
+
deleted: ZodOptional<ZodBoolean>;
|
|
66
|
+
message_app_link: ZodOptional<ZodString>;
|
|
67
|
+
sender: ZodObject<{
|
|
68
|
+
id: ZodDefault<ZodString>;
|
|
69
|
+
sender_type: ZodString;
|
|
70
|
+
}, $loose>;
|
|
71
|
+
body: ZodOptional<ZodObject<{
|
|
72
|
+
content: ZodString;
|
|
73
|
+
}, $loose>>;
|
|
74
|
+
mentions: ZodOptional<ZodArray<ZodObject<{
|
|
75
|
+
id: ZodString;
|
|
76
|
+
key: ZodOptional<ZodString>;
|
|
77
|
+
name: ZodOptional<ZodString>;
|
|
78
|
+
}, $loose>>>;
|
|
79
|
+
}, $loose>;
|
|
80
|
+
type HistoricalMessage = output<typeof HistoricalMessageSchema>;
|
|
81
|
+
declare function historyEvent(message: HistoricalMessage, chatId: string, direct: boolean): unknown;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/sources/feishu-loops.d.ts
|
|
84
|
+
/** Wait before restarting the event consumer: 1s after a run that stayed up for a minute, otherwise exponential backoff up to 60s. */
|
|
85
|
+
declare const consumerRetry: (previous: number | undefined, ranMs: number) => number;
|
|
86
|
+
/** Refreshes the map of joined chats (`chat_id -> name`); throws on failure so the previously stored list remains intact. */
|
|
87
|
+
declare function refreshChatNames(ctx: SourceContext, signal?: AbortSignal): Promise<Record<string, string>>;
|
|
88
|
+
/**
|
|
89
|
+
* Backfills chat messages and active topic replies between `since` and `until` before the caller advances the chat cursor.
|
|
90
|
+
* Topics are stored as `{ id: lastSeenAt }`, and unsubscribed topics older than the polling horizon are pruned.
|
|
91
|
+
*/
|
|
92
|
+
declare function backfillChat(ctx: SourceContext, chatId: string, direct: boolean, since: string, until: string, signal: AbortSignal, tally?: Tally): Promise<void>;
|
|
93
|
+
/** Resolves the retained source message reference for polling a subscribed thread. */
|
|
94
|
+
declare function threadRef(ctx: SourceContext, thread: Thread): FeishuRef | undefined;
|
|
95
|
+
/** Polls subscribed Feishu threads within the polling horizon so replies missed by the live stream become triggers. */
|
|
96
|
+
declare function pollThreads(ctx: SourceContext, signal?: AbortSignal, tally?: Tally): Promise<void>;
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/sources/feishu.d.ts
|
|
99
|
+
declare const FeishuConfigSchema: ZodObject<{
|
|
100
|
+
cli: ZodDefault<ZodString>;
|
|
101
|
+
readPageSize: ZodDefault<ZodNumber>;
|
|
102
|
+
linkTimeoutMs: ZodDefault<ZodNumber>;
|
|
103
|
+
chats: ZodDefault<ZodArray<ZodObject<{
|
|
104
|
+
chatId: ZodString;
|
|
105
|
+
name: ZodOptional<ZodString>;
|
|
106
|
+
listen: ZodEnum<{
|
|
107
|
+
mentions: "mentions";
|
|
108
|
+
all: "all";
|
|
109
|
+
}>;
|
|
110
|
+
}, $strict>>>;
|
|
111
|
+
directMessages: ZodDefault<ZodBoolean>;
|
|
112
|
+
otherChats: ZodDefault<ZodEnum<{
|
|
113
|
+
mentions: "mentions";
|
|
114
|
+
none: "none";
|
|
115
|
+
}>>;
|
|
116
|
+
}, $strict>;
|
|
117
|
+
type FeishuConfig = output<typeof FeishuConfigSchema>;
|
|
118
|
+
declare const feishuKind: SourceKind<FeishuConfig>;
|
|
119
|
+
/** Returns the Feishu Source's settings, falling back to schema defaults while the Feishu plugin is disabled. */
|
|
120
|
+
declare const feishuSettings: (sources: SourceRegistry) => FeishuConfig;
|
|
121
|
+
declare const name = "dsh-superagent-feishu";
|
|
122
|
+
declare const inject: string[];
|
|
123
|
+
declare function apply(ctx: Context): void;
|
|
124
|
+
//#endregion
|
|
125
|
+
export { FeishuConfig, type FeishuEvent, SOURCE, apply, backfillChat, consumerRetry, feishuKind, feishuRef, feishuSettings, feishuThreadId, feishuTime, feishuTrigger, feishuTriggerId, historyEvent, inject, name, pollThreads, refreshChatNames, threadRef, withMentionNames };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { S as withMentionNames, _ as feishuThreadId, a as name, b as feishuTriggerId, c as pollThreads, g as feishuRef, h as SOURCE, i as inject, l as refreshChatNames, n as feishuKind, o as backfillChat, r as feishuSettings, s as consumerRetry, t as apply, u as threadRef, v as feishuTime, x as historyEvent, y as feishuTrigger } from "./feishu-Dvj-1eJf.js";
|
|
2
|
+
export { SOURCE, apply, backfillChat, consumerRetry, feishuKind, feishuRef, feishuSettings, feishuThreadId, feishuTime, feishuTrigger, feishuTriggerId, historyEvent, inject, name, pollThreads, refreshChatNames, threadRef, withMentionNames };
|