@fangyb/ahchat-bridge 0.1.42 → 0.1.43
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/dist/cli.cjs +2415 -1378
- package/dist/feedbackWorkerCli.cjs +55 -4
- package/dist/index.js +2353 -1317
- package/dist/seedanceMcpCli.cjs +14 -1
- package/dist/seedreamMcpCli.cjs +14 -1
- package/dist/visionMcpCli.cjs +14 -1
- package/package.json +12 -12
|
@@ -3696,6 +3696,7 @@ function parseLogLevel(value, fallback = "INFO") {
|
|
|
3696
3696
|
|
|
3697
3697
|
// ../logger/src/logger.ts
|
|
3698
3698
|
var REDACTED = "***";
|
|
3699
|
+
var REDACTED_PATH = "[path]";
|
|
3699
3700
|
var SENSITIVE_KEY_RE = /(token|apikey|authorization|password|secret|cookie)/i;
|
|
3700
3701
|
function shouldRedactKey(key) {
|
|
3701
3702
|
const normalized = key.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
@@ -3703,8 +3704,20 @@ function shouldRedactKey(key) {
|
|
|
3703
3704
|
if (normalized.endsWith("hash")) return false;
|
|
3704
3705
|
return SENSITIVE_KEY_RE.test(normalized);
|
|
3705
3706
|
}
|
|
3707
|
+
function redactFilesystemPaths(value) {
|
|
3708
|
+
return value.replace(/\b[A-Za-z]:\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(/\\\\[^\\\s"'`<>|]+\\[^\s"'`<>|]+/g, REDACTED_PATH).replace(
|
|
3709
|
+
/(^|[\s"'`(=])\/(?:home|Users)\/[^\s"'`<>]+/g,
|
|
3710
|
+
(_match, prefix) => `${prefix}${REDACTED_PATH}`
|
|
3711
|
+
);
|
|
3712
|
+
}
|
|
3706
3713
|
function redactString(value) {
|
|
3707
|
-
return value.replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(
|
|
3714
|
+
return redactFilesystemPaths(value).replace(/([?&](?:token|api_?key|access_token|refresh_token)=)[^&#\s"']+/gi, `$1${REDACTED}`).replace(
|
|
3715
|
+
/("(?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)"\s*:\s*")[^"]*/gi,
|
|
3716
|
+
`$1${REDACTED}`
|
|
3717
|
+
).replace(
|
|
3718
|
+
/((?:apiKey|token|bridgeToken|authorization|password|secret|cookie|access_token|refresh_token)=)[^\s&"']+/gi,
|
|
3719
|
+
`$1${REDACTED}`
|
|
3720
|
+
).replace(/\b(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi, `$1${REDACTED}`).replace(/\bsk-[A-Za-z0-9._-]{6,}\b/g, "sk-***");
|
|
3708
3721
|
}
|
|
3709
3722
|
function serializeError(err) {
|
|
3710
3723
|
if (err instanceof Error) {
|
|
@@ -5497,10 +5510,25 @@ EXCEPTION \u2014 inner-voice envelope overrides no-reply:
|
|
|
5497
5510
|
asks for diagnostics.
|
|
5498
5511
|
- For media submission or completion, write a short natural sentence only,
|
|
5499
5512
|
such as "\u5DF2\u5F00\u59CB\u751F\u6210\uFF0C\u6211\u4F1A\u5728\u8FD9\u91CC\u66F4\u65B0\u7ED3\u679C\u3002" or "\u751F\u6210\u597D\u4E86\uFF0C\u53EF\u4EE5\u5728\u5361\u7247\u91CC\u67E5\u770B\u3002"
|
|
5513
|
+
- ALLCAN balance changes over time. Do not decide that media generation is
|
|
5514
|
+
impossible from old chat history, old tool errors, or remembered balances.
|
|
5515
|
+
For a fresh media-generation request, call the official media MCP tool once
|
|
5516
|
+
and let AHChat's real-time preflight return the current balance / shortage.
|
|
5500
5517
|
- Do not use Bash, sleep loops, Monitor, curl polling, or background tasks just
|
|
5501
5518
|
to wait for Seedream / Seedance. Seedream returns final images directly.
|
|
5502
5519
|
Seedance is tracked by AHChat after one create_task call.
|
|
5503
5520
|
|
|
5521
|
+
# File attachment replies
|
|
5522
|
+
- When the user asks you to send, attach, share, or hand over an existing or
|
|
5523
|
+
generated file, first locate it in the current scope workdir with
|
|
5524
|
+
mcp__neural__find_workdir_files when needed, then call
|
|
5525
|
+
mcp__neural__send_workdir_file with the returned relative path.
|
|
5526
|
+
- Do not say a file "has been attached/sent" unless send_workdir_file succeeded
|
|
5527
|
+
in this turn. If the file is missing or send_workdir_file fails, say that
|
|
5528
|
+
plainly and ask for the correct file/path.
|
|
5529
|
+
- For successful file attachments, keep the visible reply short and let the
|
|
5530
|
+
AHChat attachment card provide preview and download actions.
|
|
5531
|
+
|
|
5504
5532
|
# Group chat \u2014 shared task board
|
|
5505
5533
|
AHChat group conversations have a shared kanban board that is fed by structured
|
|
5506
5534
|
task tools (TodoWrite when available; otherwise TaskCreate / TaskUpdate). Treat
|
|
@@ -5518,6 +5546,12 @@ handoff, review, follow-up, blockers, or progress:
|
|
|
5518
5546
|
- Create one task item per concrete subtask or deliverable.
|
|
5519
5547
|
- Update existing task items when status changes; do not create duplicates
|
|
5520
5548
|
just to restate the same task.
|
|
5549
|
+
- If the same work was already completed, do not create a fresh pending task
|
|
5550
|
+
for recap, handoff, retest, or final-delivery wording. Use list_group_tasks
|
|
5551
|
+
and update_group_task to close the existing item, or say the work is done.
|
|
5552
|
+
- Before telling the user a group project is delivered, check or update the
|
|
5553
|
+
shared board so no actionable pending/in_progress items remain unless you
|
|
5554
|
+
explicitly call them out as remaining work.
|
|
5521
5555
|
- If a P0/P1/P2/etc. task already exists on the board, update that task instead
|
|
5522
5556
|
of creating another similar task under yourself or another Agent.
|
|
5523
5557
|
- Mark work as in_progress when you start it, completed when it is done, and keep
|
|
@@ -5537,7 +5571,8 @@ Do NOT use task tools for pure small talk, one-off factual answers, or messages
|
|
|
5537
5571
|
where you intentionally stay silent with \`<no-reply/>\`.
|
|
5538
5572
|
|
|
5539
5573
|
\u7FA4\u91CC\u7684\u95EE\u9898\u9762\u677F\u548C\u516C\u5F00\u6C89\u6DC0\u90FD\u6709\u7ED3\u6784\u5316\u5165\u53E3\uFF1A
|
|
5540
|
-
- \u7528\u6237\u53CD\u9988\uFF0C\u6216\u4F60\u5728\u5F00\u53D1\u3001\u6D4B\u8BD5\u3001\u8054\u8C03\u3001\u9A8C\u6536\u4E2D\u786E\u8BA4\u4E14\u5DF2\u63A5\u624B\u7684\u7F3A\u9677 / \u963B\u585E / \u8E29\u5751\uFF0C\u7528 \`create_group_issue\` \u8BB0\u5F55\uFF1B\
|
|
5574
|
+
- \u7528\u6237\u53CD\u9988\uFF0C\u6216\u4F60\u5728\u5F00\u53D1\u3001\u6D4B\u8BD5\u3001\u8054\u8C03\u3001\u9A8C\u6536\u4E2D\u786E\u8BA4\u4E14\u5DF2\u63A5\u624B\u7684\u7F3A\u9677 / \u963B\u585E / \u8E29\u5751\uFF0C\u7528 \`create_group_issue\` \u8BB0\u5F55\uFF1B\u6D4B\u8BD5\u62A5\u544A\u91CC\u7684 P0/P1/P2/P3 \u7B49\u786E\u8BA4\u7F3A\u9677\u3001\u963B\u585E\u6216\u9700\u8981\u540E\u7EED\u8DDF\u8FDB\u7684\u95EE\u9898\uFF0C\u5FC5\u987B\u5148\u5199\u5165\u95EE\u9898\u9762\u677F\u518D\u5728\u7FA4\u91CC\u6C47\u62A5\u3002
|
|
5575
|
+
- \u5DF2\u5F53\u573A\u6F84\u6E05\u7684\u8BEF\u62A5\u3001\u7EAF\u5EFA\u8BAE\u3001\u5DF2\u5728\u540C\u4E00\u8F6E\u4FEE\u590D\u5E76\u9A8C\u8BC1\u901A\u8FC7\u4E14\u4E0D\u518D\u9700\u8981\u8DDF\u8FDB\u7684\u95EE\u9898\u4E0D\u8981\u5199\u5165\uFF0C\u4FEE\u590D\u9A8C\u8BC1\u540E\u7528 \`resolve_group_issue\` \u5173\u95ED\u3002
|
|
5541
5576
|
- \u5982\u679C\u5F53\u524D\u8FD0\u884C\u65F6\u6CA1\u6709\u95EE\u9898 MCP \u5DE5\u5177\uFF0C\u4EFB\u52A1\u5DE5\u5177\u91CC\u7684 \`[\u95EE\u9898:\u7C7B\u578B]\` \u524D\u7F00\u4ECD\u662F\u517C\u5BB9\u5165\u53E3\u3002
|
|
5542
5577
|
- \`post_to_forum\` \u53EA\u7528\u4E8E\u7528\u6237\u660E\u786E\u8981\u6C42\u516C\u5F00\u53D1\u5E16\u3001\u5E7F\u573A\u8BA8\u8BBA\u3001\u62DB\u52DF\u6216\u516C\u5F00\u7ECF\u9A8C\u6C89\u6DC0\u7684\u573A\u666F\u3002
|
|
5543
5578
|
|
|
@@ -5612,8 +5647,9 @@ self_note / \u4EFB\u52A1\u5DE5\u5177\u2014\u2014**\u6C89\u6DC0\u662F\u9ED8\u5199
|
|
|
5612
5647
|
## \u4E0E\u95EE\u9898\u9762\u677F / \u516C\u5F00\u6C89\u6DC0\u7684\u8FB9\u754C\uFF08\u91CD\u8981\uFF09
|
|
5613
5648
|
|
|
5614
5649
|
\u95EE\u9898\u9762\u677F\u4E0D\u662F\u5173\u952E\u8BCD\u89E3\u6790\u5668\uFF0C\u4E5F\u4E0D\u662F\u516C\u5F00\u7ECF\u9A8C\u6D41\u3002\u7528\u6237\u53CD\u9988\uFF0C\u6216\u4F60\u5728\u5F00\u53D1\u3001\u6D4B\u8BD5\u3001\u8054\u8C03\u3001\u9A8C\u6536\u4E2D\u786E\u8BA4\u4E14\u5DF2\u63A5\u624B\u7684\u7F3A\u9677 / \u963B\u585E / \u8E29\u5751\uFF0C
|
|
5615
|
-
\u7528 \`create_group_issue\` \u8BB0\u5F55\uFF0C\u7528 \`resolve_group_issue\` \u5173\u95ED\uFF1B\
|
|
5616
|
-
|
|
5650
|
+
\u7528 \`create_group_issue\` \u8BB0\u5F55\uFF0C\u7528 \`resolve_group_issue\` \u5173\u95ED\uFF1B\u6D4B\u8BD5/\u9A8C\u6536\u62A5\u544A\u91CC\u7684 P0/P1/P2/P3 \u7B49\u786E\u8BA4\u7F3A\u9677\u3001\u963B\u585E\u6216\u9700\u8981\u540E\u7EED\u8DDF\u8FDB\u7684\u95EE\u9898\uFF0C
|
|
5651
|
+
\u5148\u5199\u5165\u95EE\u9898\u9762\u677F\u518D\u6C47\u62A5\u3002\u517C\u5BB9\u65E7\u8FD0\u884C\u65F6\u53EF\u7528
|
|
5652
|
+
\`[\u95EE\u9898:\u7C7B\u578B]\` \u4EFB\u52A1\u524D\u7F00\u3002\u5DF2\u5F53\u573A\u6F84\u6E05\u7684\u8BEF\u62A5\u3001\u7EAF\u5EFA\u8BAE\u3001\u5DF2\u5728\u540C\u4E00\u8F6E\u4FEE\u590D\u9A8C\u8BC1\u4E14\u4E0D\u518D\u9700\u8981\u8DDF\u8FDB\u7684\u95EE\u9898\u4E0D\u8981\u5199\u5165\u3002\u53EF\u516C\u5F00\u590D\u7528\u7684\u7ECF\u9A8C\u3001\u62DB\u52DF\u6216\u5E7F\u573A\u8BA8\u8BBA\uFF0C\u4E14\u7528\u6237\u660E\u786E\u8981\u6C42\u516C\u5F00\u65F6\uFF0C
|
|
5617
5653
|
\u624D\u7528 \`post_to_forum\`\u3002
|
|
5618
5654
|
|
|
5619
5655
|
# \u4F60\u7684\u5DE5\u4F5C\u8BB0\u5FC6 / \u7FFB\u804A\u5929\u8BB0\u5F55
|
|
@@ -5833,6 +5869,10 @@ var PLATFORM_AGENT_RULES_SINGLE = stripGroupOnlySections(
|
|
|
5833
5869
|
PLATFORM_AGENT_RULES,
|
|
5834
5870
|
GROUP_ONLY_SECTION_HEADERS
|
|
5835
5871
|
);
|
|
5872
|
+
var PLATFORM_AGENT_RULES_SMITH = stripGroupOnlySections(
|
|
5873
|
+
PLATFORM_AGENT_RULES,
|
|
5874
|
+
[...GROUP_ONLY_SECTION_HEADERS, "# System directory & forming groups"]
|
|
5875
|
+
);
|
|
5836
5876
|
var FAN_OUT_TRACE_TTL_MS = 10 * 6e4;
|
|
5837
5877
|
var MAX_FILE_SIZE = 20 * 1024 * 1024;
|
|
5838
5878
|
var MAX_IMAGE_SIZE = 10 * 1024 * 1024;
|
|
@@ -6024,6 +6064,17 @@ function validateWSMessageShape(msg) {
|
|
|
6024
6064
|
assertRecordPayloadField(type, payload, "metadata");
|
|
6025
6065
|
return;
|
|
6026
6066
|
}
|
|
6067
|
+
case "agent:workdir_file_attachment": {
|
|
6068
|
+
assertPayloadRecord(type, payload);
|
|
6069
|
+
validateRequiredStrings(type, payload, ["ackId", "agentId", "conversationId", "filePath", "traceId"]);
|
|
6070
|
+
if (payload.toolUseId !== void 0) assertStringPayloadField(type, payload, "toolUseId");
|
|
6071
|
+
if (payload.relativePath !== void 0) assertStringPayloadField(type, payload, "relativePath");
|
|
6072
|
+
if (payload.fileName !== void 0) assertStringPayloadField(type, payload, "fileName");
|
|
6073
|
+
if (payload.mimeType !== void 0) assertStringPayloadField(type, payload, "mimeType");
|
|
6074
|
+
if (payload.size !== void 0) assertOptionalNumberPayloadField(type, payload, "size");
|
|
6075
|
+
assertOptionalStringPayloadOneOf(type, payload, "attachmentSource", ["generated_asset_auto", "agent_explicit_send"]);
|
|
6076
|
+
return;
|
|
6077
|
+
}
|
|
6027
6078
|
case "agent:segment": {
|
|
6028
6079
|
assertPayloadRecord(type, payload);
|
|
6029
6080
|
validateRequiredStrings(type, payload, [
|