@excitedjs/dreamux 0.9.3 → 0.9.5

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.
@@ -0,0 +1,46 @@
1
+ # Review Cycle
2
+
3
+ ## Trigger
4
+
5
+ An MR/PR or issue proposal needs adversarial review before it can merge or move
6
+ to implementation.
7
+
8
+ Skip this cycle only when the change is trivial, the human already accepted the
9
+ risk, or an equally rigorous independent review already exists on the current
10
+ head.
11
+
12
+ ## Steps
13
+
14
+ 1. Identify the author, branch, MR/PR or issue number, and current head SHA.
15
+ 2. Confirm the target repo and platform visibility. If public, include a
16
+ no-internal-content constraint in the reviewer brief.
17
+ 3. Confirm the change is ready to review: current branch pushed, required
18
+ checks known, and merge state readable.
19
+ 4. Reuse an existing reviewer teammate only if it already owns this exact
20
+ branch or review thread. Otherwise spawn one independent reviewer.
21
+ 5. Give the reviewer an adversarial brief:
22
+ - verify the author's claims instead of trusting them
23
+ - inspect the current diff against the target base
24
+ - run or justify focused verification
25
+ - report P0/P1/P2 findings with file and line references
26
+ - do not edit, commit, push, or merge
27
+ 6. Bucket the verdict:
28
+ - no P0/P1: eligible for merge once required checks are green
29
+ - P0/P1: send the author a fix brief quoting the findings exactly
30
+ - P2 only: merge with follow-up or ask for a cheap one-shot fix
31
+ 7. Recheck with the same reviewer after any force-push. Anchor the recheck on
32
+ the prior findings, new head SHA, and reported fixes.
33
+
34
+ ## Closeout
35
+
36
+ The current head has an independent clean verdict, required checks are green,
37
+ and any remaining non-blocking follow-up is explicit.
38
+
39
+ ## Exceptions
40
+
41
+ | Case | Action |
42
+ |---|---|
43
+ | Base advanced | Ask the author to rebase or merge the target base, then re-run checks. |
44
+ | Reviewer and author disagree | Escalate both positions to the human; do not silently pick a side. |
45
+ | Formal review action is rejected | Post the same verdict as a top-level MR/PR comment. |
46
+ | A reviewed line moved after force-push | Quote the problem statement so the reviewer can relocate it. |
@@ -1,110 +0,0 @@
1
- export const FEISHU_SKILL_FALLBACK_NOTE = 'Parser note: message text may be incomplete. Use the Feishu skill with the chat_id and message_id above to fetch the original message when needed.';
2
- export function formatFeishuMessageForCodex(event, options = {}) {
3
- const attrs = [
4
- ['chat_id', event.chatId],
5
- ['chat_type', event.chatType],
6
- ['message_id', event.messageId],
7
- ['sender_id', event.senderId],
8
- ['sender_name', event.senderName],
9
- ['create_time', formatFeishuCreateTime(event.createTime)],
10
- ];
11
- const body = renderMessageBody(event);
12
- const fallback = shouldAddFallbackNote(event)
13
- ? `\n\n${FEISHU_SKILL_FALLBACK_NOTE}`
14
- : '';
15
- const groupBots = renderGroupBots(options.trustedBots ?? []);
16
- const attrLines = attrs.map(([key, value]) => ` ${key}="${escapeXmlAttribute(value)}"`);
17
- attrLines[attrLines.length - 1] = `${attrLines[attrLines.length - 1]}>`;
18
- return [
19
- '<feishu_message',
20
- ...attrLines,
21
- `${body}${fallback}${groupBots}`,
22
- '</feishu_message>',
23
- ].join('\n');
24
- }
25
- /**
26
- * Render the one-shot trusted-bot discovery block. Empty string when there are
27
- * no trusted bots, so the common path is byte-for-byte unchanged.
28
- */
29
- function renderGroupBots(trustedBots) {
30
- if (trustedBots.length === 0)
31
- return '';
32
- const lines = trustedBots.map((bot) => {
33
- const name = bot.name ?? '';
34
- return ` <bot name="${escapeXmlAttribute(name)}" open_id="${escapeXmlAttribute(bot.openId)}" />`;
35
- });
36
- return [
37
- '\n\n<group_bots note="trusted bots in this group; a bot speaks without @-mentioning us">',
38
- ...lines,
39
- '</group_bots>',
40
- ].join('\n');
41
- }
42
- export function formatFeishuCreateTime(value) {
43
- const trimmed = value.trim();
44
- if (trimmed === '')
45
- return '';
46
- const numeric = Number(trimmed);
47
- if (Number.isFinite(numeric)) {
48
- const epochMs = Math.abs(numeric) < 1_000_000_000_000
49
- ? numeric * 1000
50
- : numeric;
51
- const date = new Date(epochMs);
52
- if (!Number.isNaN(date.getTime()))
53
- return date.toISOString();
54
- }
55
- const date = new Date(trimmed);
56
- if (!Number.isNaN(date.getTime()))
57
- return date.toISOString();
58
- return trimmed;
59
- }
60
- function renderMessageBody(event) {
61
- const rawText = extractRawText(event);
62
- if (rawText !== null) {
63
- return renderTextWithMentions(rawText, event.mentions);
64
- }
65
- return escapeXmlText(event.parsedText);
66
- }
67
- function extractRawText(event) {
68
- if (event.messageType !== 'text')
69
- return null;
70
- let parsed;
71
- try {
72
- parsed = JSON.parse(event.rawContent);
73
- }
74
- catch {
75
- return null;
76
- }
77
- if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
78
- return null;
79
- }
80
- const text = parsed['text'];
81
- return typeof text === 'string' ? text : null;
82
- }
83
- function renderTextWithMentions(text, mentions) {
84
- let out = escapeXmlText(text);
85
- for (const mention of mentions) {
86
- const id = mention.id?.open_id ?? mention.id?.union_id ?? mention.id?.user_id;
87
- if (mention.key === '' || id === undefined || mention.name === undefined) {
88
- continue;
89
- }
90
- out = out.split(escapeXmlText(mention.key)).join(`<at id="${escapeXmlAttribute(id)}">${escapeXmlText(mention.name)}</at>`);
91
- }
92
- return out;
93
- }
94
- function shouldAddFallbackNote(event) {
95
- if (event.parsedText === '(unparseable message)')
96
- return true;
97
- if (event.messageType === 'text' && extractRawText(event) === null)
98
- return true;
99
- return event.parsedText === `(${event.messageType} message)`;
100
- }
101
- function escapeXmlAttribute(value) {
102
- return escapeXmlText(value).replaceAll('"', '&quot;');
103
- }
104
- function escapeXmlText(value) {
105
- return value
106
- .replaceAll('&', '&amp;')
107
- .replaceAll('<', '&lt;')
108
- .replaceAll('>', '&gt;');
109
- }
110
- //# sourceMappingURL=feishu-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"feishu-message.js","sourceRoot":"","sources":["../../src/channel/feishu-message.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,0BAA0B,GACrC,oJAAoJ,CAAC;AAYvJ,MAAM,UAAU,2BAA2B,CACzC,KAAyB,EACzB,UAAsC,EAAE;IAExC,MAAM,KAAK,GAA4B;QACrC,CAAC,S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