weacpx 0.6.1 → 0.8.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/README.md +10 -564
- package/package.json +10 -72
- package/plugin-api.d.ts +2 -0
- package/plugin-api.js +5 -0
- package/LICENSE +0 -21
- package/config.example.json +0 -44
- package/dist/bridge/bridge-main.js +0 -2120
- package/dist/channels/channel-scope.d.ts +0 -17
- package/dist/channels/cli/provider.d.ts +0 -73
- package/dist/channels/cli/registry.d.ts +0 -7
- package/dist/channels/cli/weixin-provider.d.ts +0 -2
- package/dist/channels/create-channel.d.ts +0 -16
- package/dist/channels/media-store.d.ts +0 -29
- package/dist/channels/media-types.d.ts +0 -28
- package/dist/channels/outbound-media-safety.d.ts +0 -7
- package/dist/channels/plugin.d.ts +0 -9
- package/dist/channels/types.d.ts +0 -115
- package/dist/channels/weixin-channel.d.ts +0 -25
- package/dist/cli.js +0 -46971
- package/dist/commands/command-hints.d.ts +0 -11
- package/dist/commands/command-list.d.ts +0 -3
- package/dist/commands/config-clone.d.ts +0 -2
- package/dist/commands/handlers/agent-handler.d.ts +0 -6
- package/dist/commands/handlers/config-handler.d.ts +0 -5
- package/dist/commands/handlers/later-handler.d.ts +0 -21
- package/dist/commands/handlers/orchestration-handler.d.ts +0 -16
- package/dist/commands/handlers/permission-handler.d.ts +0 -9
- package/dist/commands/handlers/session-handler.d.ts +0 -37
- package/dist/commands/handlers/workspace-handler.d.ts +0 -8
- package/dist/commands/help/help-registry.d.ts +0 -4
- package/dist/commands/help/help-types.d.ts +0 -12
- package/dist/commands/parse-command.d.ts +0 -175
- package/dist/commands/router-types.d.ts +0 -144
- package/dist/commands/workspace-name.d.ts +0 -4
- package/dist/commands/workspace-path.d.ts +0 -4
- package/dist/config/agent-templates.d.ts +0 -4
- package/dist/config/config-store.d.ts +0 -13
- package/dist/config/load-config.d.ts +0 -10
- package/dist/config/resolve-agent-command.d.ts +0 -2
- package/dist/config/types.d.ts +0 -85
- package/dist/formatting/render-text.d.ts +0 -23
- package/dist/logging/app-logger.d.ts +0 -23
- package/dist/logging/rotating-file-writer.d.ts +0 -2
- package/dist/orchestration/async-mutex.d.ts +0 -4
- package/dist/orchestration/build-coordinator-prompt.d.ts +0 -66
- package/dist/orchestration/orchestration-service.d.ts +0 -471
- package/dist/orchestration/orchestration-types.d.ts +0 -181
- package/dist/orchestration/progress-line-parser.d.ts +0 -19
- package/dist/orchestration/render-delegate-group-result.d.ts +0 -6
- package/dist/orchestration/render-delegate-question-package.d.ts +0 -21
- package/dist/orchestration/render-delegate-result.d.ts +0 -2
- package/dist/orchestration/task-watch-timeouts.d.ts +0 -5
- package/dist/perf/perf-log-writer.d.ts +0 -25
- package/dist/perf/perf-tracer.d.ts +0 -54
- package/dist/plugin-api.d.ts +0 -9
- package/dist/plugin-api.js +0 -180
- package/dist/plugins/compatibility.d.ts +0 -16
- package/dist/plugins/known-plugins.d.ts +0 -9
- package/dist/plugins/types.d.ts +0 -18
- package/dist/scheduled/parse-later-time.d.ts +0 -11
- package/dist/scheduled/scheduled-render.d.ts +0 -7
- package/dist/scheduled/scheduled-service.d.ts +0 -41
- package/dist/scheduled/scheduled-types.d.ts +0 -29
- package/dist/sessions/session-service.d.ts +0 -83
- package/dist/state/state-store.d.ts +0 -8
- package/dist/state/types.d.ts +0 -44
- package/dist/transport/tool-event-mode.d.ts +0 -14
- package/dist/transport/types.d.ts +0 -129
- package/dist/util/path.d.ts +0 -4
- package/dist/util/private-file.d.ts +0 -26
- package/dist/util/sanitize.d.ts +0 -10
- package/dist/util/text.d.ts +0 -3
- package/dist/version.d.ts +0 -3
- package/dist/weixin/agent/interface.d.ts +0 -78
- package/dist/weixin/api/api.d.ts +0 -76
- package/dist/weixin/api/config-cache.d.ts +0 -18
- package/dist/weixin/api/session-guard.d.ts +0 -17
- package/dist/weixin/api/types.d.ts +0 -203
- package/dist/weixin/auth/accounts.d.ts +0 -69
- package/dist/weixin/auth/login-qr.d.ts +0 -37
- package/dist/weixin/bot.d.ts +0 -56
- package/dist/weixin/cdn/aes-ecb.d.ts +0 -6
- package/dist/weixin/cdn/cdn-upload.d.ts +0 -17
- package/dist/weixin/cdn/cdn-url.d.ts +0 -11
- package/dist/weixin/cdn/pic-decrypt.d.ts +0 -9
- package/dist/weixin/cdn/upload.d.ts +0 -42
- package/dist/weixin/index.d.ts +0 -6
- package/dist/weixin/media/media-download.d.ts +0 -18
- package/dist/weixin/media/mime.d.ts +0 -6
- package/dist/weixin/media/silk-transcode.d.ts +0 -8
- package/dist/weixin/messaging/conversation-executor.d.ts +0 -7
- package/dist/weixin/messaging/debug-mode.d.ts +0 -9
- package/dist/weixin/messaging/deliver-coordinator-message.d.ts +0 -22
- package/dist/weixin/messaging/deliver-orchestration-task-notice.d.ts +0 -18
- package/dist/weixin/messaging/deliver-orchestration-task-progress.d.ts +0 -16
- package/dist/weixin/messaging/error-notice.d.ts +0 -13
- package/dist/weixin/messaging/execute-chat-turn.d.ts +0 -12
- package/dist/weixin/messaging/final-heads-up.d.ts +0 -5
- package/dist/weixin/messaging/handle-weixin-message-turn.d.ts +0 -32
- package/dist/weixin/messaging/inbound.d.ts +0 -80
- package/dist/weixin/messaging/markdown-filter.d.ts +0 -45
- package/dist/weixin/messaging/orchestration-notice-accounts.d.ts +0 -2
- package/dist/weixin/messaging/quota-errors.d.ts +0 -8
- package/dist/weixin/messaging/quota-manager.d.ts +0 -44
- package/dist/weixin/messaging/scheduled-turn.d.ts +0 -22
- package/dist/weixin/messaging/send-errors.d.ts +0 -39
- package/dist/weixin/messaging/send-media.d.ts +0 -23
- package/dist/weixin/messaging/send-orchestration-notice.d.ts +0 -10
- package/dist/weixin/messaging/send.d.ts +0 -73
- package/dist/weixin/messaging/slash-commands.d.ts +0 -40
- package/dist/weixin/monitor/consumer-lock.d.ts +0 -24
- package/dist/weixin/monitor/monitor.d.ts +0 -30
- package/dist/weixin/storage/ensure-dir.d.ts +0 -1
- package/dist/weixin/storage/state-dir.d.ts +0 -2
- package/dist/weixin/storage/sync-buf.d.ts +0 -20
- package/dist/weixin/util/logger.d.ts +0 -14
- package/dist/weixin/util/random.d.ts +0 -10
- package/dist/weixin/util/redact.d.ts +0 -21
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare function registerKnownChannelId(channelId: string): void;
|
|
2
|
-
export declare function listKnownChannelIds(): string[];
|
|
3
|
-
export declare function getChannelIdFromChatKey(chatKey: string): string;
|
|
4
|
-
export declare function isLegacyWeixinChatKey(chatKey: string): boolean;
|
|
5
|
-
export declare function toInternalSessionAlias(channelId: string, displayAlias: string): string;
|
|
6
|
-
export declare function toDisplaySessionAlias(internalAlias: string): string;
|
|
7
|
-
export declare function isSessionAliasVisibleInChannel(alias: string, channelId: string): boolean;
|
|
8
|
-
export declare function resolveSessionAliasForInput(channelId: string, displayAlias: string, existingAliases: Iterable<string>): string;
|
|
9
|
-
/**
|
|
10
|
-
* Internal alias for a display alias entered in `channelId`. The default
|
|
11
|
-
* channel (weixin) stays unprefixed for backwards compatibility; every other
|
|
12
|
-
* channel is namespaced as `channelId:alias`. Idempotent — an already-scoped
|
|
13
|
-
* alias is not double-prefixed. This is the single home for the rule that
|
|
14
|
-
* handlers must not re-implement inline.
|
|
15
|
-
*/
|
|
16
|
-
export declare function scopeDisplayAliasToInternal(channelId: string, displayAlias: string): string;
|
|
17
|
-
export declare function buildDefaultTransportSession(channelId: string, displayAlias: string): string;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { ChannelRuntimeConfig } from "../../config/types";
|
|
2
|
-
export type ChannelCliInput = Record<string, string | boolean | undefined>;
|
|
3
|
-
export type ChannelCliParseResult = {
|
|
4
|
-
ok: true;
|
|
5
|
-
input: ChannelCliInput;
|
|
6
|
-
} | {
|
|
7
|
-
ok: false;
|
|
8
|
-
message: string;
|
|
9
|
-
};
|
|
10
|
-
export type ChannelCliValidationIssue = {
|
|
11
|
-
kind: "missing-required-field";
|
|
12
|
-
flag: string;
|
|
13
|
-
message: string;
|
|
14
|
-
} | {
|
|
15
|
-
kind: "invalid-config";
|
|
16
|
-
message: string;
|
|
17
|
-
};
|
|
18
|
-
export interface ChannelCliIo {
|
|
19
|
-
print: (line: string) => void;
|
|
20
|
-
stderr: (text: string) => void;
|
|
21
|
-
isInteractive: () => boolean;
|
|
22
|
-
promptText: (message: string) => Promise<string>;
|
|
23
|
-
promptSecret: (message: string) => Promise<string>;
|
|
24
|
-
}
|
|
25
|
-
export interface ChannelCliProvider {
|
|
26
|
-
type: string;
|
|
27
|
-
displayName: string;
|
|
28
|
-
supportsLogin: boolean;
|
|
29
|
-
parseAddArgs(args: string[]): ChannelCliParseResult;
|
|
30
|
-
buildDefaultConfig(input: ChannelCliInput): ChannelRuntimeConfig;
|
|
31
|
-
validateConfig(config: ChannelRuntimeConfig): ChannelCliValidationIssue[];
|
|
32
|
-
renderSummary(config: ChannelRuntimeConfig): string[];
|
|
33
|
-
promptForMissingFields(input: ChannelCliInput, io: ChannelCliIo): Promise<ChannelCliInput>;
|
|
34
|
-
/**
|
|
35
|
-
* Optional: declares this plugin supports the `weacpx channel ... --account <id>`
|
|
36
|
-
* multi-bot CLI surface. Plugins that opt in must also implement
|
|
37
|
-
* {@link buildAccountOverride} and {@link channelLevelOptionKeys}.
|
|
38
|
-
*/
|
|
39
|
-
supportsMultipleAccounts?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Optional: builds the per-account override object that core nests under
|
|
42
|
-
* `options.accounts.<accountId>`. Should NOT include channel-level fields
|
|
43
|
-
* (those live on top-level `options`).
|
|
44
|
-
*/
|
|
45
|
-
buildAccountOverride?(input: ChannelCliInput): Record<string, unknown>;
|
|
46
|
-
/**
|
|
47
|
-
* Optional: option keys that stay on top-level `options` (not duplicated into
|
|
48
|
-
* each account). Used to migrate a legacy flat single-bot config into the
|
|
49
|
-
* accounts shape on first `--account` add.
|
|
50
|
-
*/
|
|
51
|
-
channelLevelOptionKeys?: readonly string[];
|
|
52
|
-
/**
|
|
53
|
-
* Optional: renders summary lines for a single account inside a multi-bot
|
|
54
|
-
* channel. Falls back to {@link renderSummary} on the whole channel when
|
|
55
|
-
* unspecified.
|
|
56
|
-
*/
|
|
57
|
-
renderAccountSummary?(config: ChannelRuntimeConfig, accountId: string): string[] | null;
|
|
58
|
-
}
|
|
59
|
-
export declare function parseBooleanFlag(value: string, flagName: string): {
|
|
60
|
-
ok: true;
|
|
61
|
-
value: boolean;
|
|
62
|
-
} | {
|
|
63
|
-
ok: false;
|
|
64
|
-
message: string;
|
|
65
|
-
};
|
|
66
|
-
export declare function takeFlagValue(args: string[], index: number, flagName: string): {
|
|
67
|
-
ok: true;
|
|
68
|
-
value: string;
|
|
69
|
-
nextIndex: number;
|
|
70
|
-
} | {
|
|
71
|
-
ok: false;
|
|
72
|
-
message: string;
|
|
73
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ChannelCliProvider } from "./provider";
|
|
2
|
-
export declare function registerChannelCliProvider(provider: ChannelCliProvider): void;
|
|
3
|
-
export declare function hasChannelCliProvider(type: string): boolean;
|
|
4
|
-
export declare function getRegisteredChannelCliProviderTypes(): string[];
|
|
5
|
-
export declare function bootstrapBuiltinChannelCliProviders(): void;
|
|
6
|
-
export declare function listChannelCliProviders(): ChannelCliProvider[];
|
|
7
|
-
export declare function getChannelCliProvider(type: string): ChannelCliProvider | null;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ChannelConfig, ChannelRuntimeConfig } from "../config/types.js";
|
|
2
|
-
import type { MessageChannelRuntime } from "./types.js";
|
|
3
|
-
import type { RuntimeMediaStore } from "./media-store.js";
|
|
4
|
-
export declare function getMovedChannelInstallHint(type: string): string | null;
|
|
5
|
-
export interface CreateChannelDeps {
|
|
6
|
-
mediaStore?: RuntimeMediaStore;
|
|
7
|
-
allowedMediaRoots?: string[];
|
|
8
|
-
}
|
|
9
|
-
export type ChannelFactory = (options: Record<string, unknown> | undefined, deps?: CreateChannelDeps) => MessageChannelRuntime;
|
|
10
|
-
export declare function registerChannelFactory(type: string, factory: ChannelFactory): void;
|
|
11
|
-
export declare function hasChannelFactory(type: string): boolean;
|
|
12
|
-
export declare function getRegisteredChannelTypes(): string[];
|
|
13
|
-
export declare function bootstrapBuiltinChannelFactories(): void;
|
|
14
|
-
export declare function createMessageChannel(type: string, config?: Partial<ChannelConfig>, deps?: CreateChannelDeps): MessageChannelRuntime;
|
|
15
|
-
export declare function createMessageChannelFromRuntimeConfig(config: ChannelRuntimeConfig, deps?: CreateChannelDeps): MessageChannelRuntime;
|
|
16
|
-
export declare function createMessageChannels(configs: ChannelRuntimeConfig[], deps?: CreateChannelDeps): MessageChannelRuntime[];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ChannelId, ChannelMediaAttachment, ChannelMediaKind } from "./media-types";
|
|
2
|
-
export declare const DEFAULT_IMAGE_MAX_BYTES: number;
|
|
3
|
-
export declare const DEFAULT_ATTACHMENT_MAX_BYTES: number;
|
|
4
|
-
export declare const DEFAULT_MAX_ATTACHMENTS_PER_MESSAGE = 10;
|
|
5
|
-
export declare const DEFAULT_MEDIA_RETENTION_MS: number;
|
|
6
|
-
export interface RuntimeMediaStoreOptions {
|
|
7
|
-
rootDir: string;
|
|
8
|
-
retentionMs?: number;
|
|
9
|
-
}
|
|
10
|
-
export interface SaveMediaBufferInput {
|
|
11
|
-
channelId: ChannelId;
|
|
12
|
-
accountId: string;
|
|
13
|
-
chatKey: string;
|
|
14
|
-
messageId: string;
|
|
15
|
-
fileName?: string;
|
|
16
|
-
mimeType: string;
|
|
17
|
-
kind: ChannelMediaKind;
|
|
18
|
-
buffer: Buffer;
|
|
19
|
-
sourceResourceId?: string;
|
|
20
|
-
maxBytes: number;
|
|
21
|
-
}
|
|
22
|
-
export declare class RuntimeMediaStore {
|
|
23
|
-
readonly rootDir: string;
|
|
24
|
-
readonly retentionMs: number;
|
|
25
|
-
constructor(options: RuntimeMediaStoreOptions);
|
|
26
|
-
saveMediaBuffer(input: SaveMediaBufferInput): Promise<ChannelMediaAttachment>;
|
|
27
|
-
cleanupExpired(now?: Date): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
export declare function sanitizeMediaFileName(fileName: string, mimeType: string): string;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type ChannelId = string;
|
|
2
|
-
export type ChannelMediaKind = "image" | "file" | "audio" | "video";
|
|
3
|
-
export interface ChannelMediaAttachment {
|
|
4
|
-
kind: ChannelMediaKind;
|
|
5
|
-
/** @deprecated Legacy field — prefer `kind`. Kept for backward compat during migration. */
|
|
6
|
-
type?: string;
|
|
7
|
-
filePath: string;
|
|
8
|
-
mimeType: string;
|
|
9
|
-
fileName?: string;
|
|
10
|
-
sizeBytes: number;
|
|
11
|
-
source: {
|
|
12
|
-
channelId: ChannelId;
|
|
13
|
-
accountId: string;
|
|
14
|
-
chatKey: string;
|
|
15
|
-
messageId: string;
|
|
16
|
-
resourceId?: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface OutboundChannelMedia {
|
|
20
|
-
kind: ChannelMediaKind;
|
|
21
|
-
filePath: string;
|
|
22
|
-
mimeType?: string;
|
|
23
|
-
fileName?: string;
|
|
24
|
-
caption?: string;
|
|
25
|
-
}
|
|
26
|
-
export type MaybeArray<T> = T | T[] | undefined;
|
|
27
|
-
export declare function normalizeMediaArray<T>(media: MaybeArray<T>): T[];
|
|
28
|
-
export declare function firstMediaOrUndefined<T>(media: T[]): T | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve an outbound media file path to a safe absolute realpath.
|
|
3
|
-
* Rejects remote URLs, non-existent paths, symlinks that escape allowed roots,
|
|
4
|
-
* and paths outside all allowed root directories.
|
|
5
|
-
* Returns the resolved realpath on success, or null on rejection.
|
|
6
|
-
*/
|
|
7
|
-
export declare function resolveSafeOutboundMediaPath(mediaPath: string, allowedRoots: string[]): Promise<string | null>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ChannelFactory } from "./create-channel.js";
|
|
2
|
-
import type { ChannelCliProvider } from "./cli/provider.js";
|
|
3
|
-
export interface ChannelPluginDefinition {
|
|
4
|
-
/** Stable channel type used in channels[].type and chatKey prefix. */
|
|
5
|
-
type: string;
|
|
6
|
-
factory: ChannelFactory;
|
|
7
|
-
cliProvider?: ChannelCliProvider;
|
|
8
|
-
}
|
|
9
|
-
export declare function registerChannelPlugin(plugin: ChannelPluginDefinition): void;
|
package/dist/channels/types.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { Agent as ChatAgent } from "../weixin/agent/interface.js";
|
|
2
|
-
import type { CommandHint } from "../commands/command-hints.js";
|
|
3
|
-
import type { OrchestrationTaskRecord } from "../orchestration/orchestration-types.js";
|
|
4
|
-
import type { AppLogger } from "../logging/app-logger.js";
|
|
5
|
-
import type { PendingFinalChunk } from "../weixin/messaging/quota-manager.js";
|
|
6
|
-
import type { PerfTracer } from "../perf/perf-tracer.js";
|
|
7
|
-
export type { ChatAgent };
|
|
8
|
-
export interface OutboundQuota {
|
|
9
|
-
onInbound(chatKey: string): void;
|
|
10
|
-
reserveMidSegment(chatKey: string): boolean;
|
|
11
|
-
reserveFinal(chatKey: string): boolean;
|
|
12
|
-
finalRemaining(chatKey: string): number;
|
|
13
|
-
hasPendingFinal(chatKey: string): boolean;
|
|
14
|
-
drainPendingFinalUpToBudget(chatKey: string, available: number): PendingFinalChunk[];
|
|
15
|
-
prependPendingFinal(chatKey: string, chunks: PendingFinalChunk[]): void;
|
|
16
|
-
enqueuePendingFinal(chatKey: string, chunks: PendingFinalChunk[]): void;
|
|
17
|
-
clearPendingFinal(chatKey: string): void;
|
|
18
|
-
}
|
|
19
|
-
export interface CoordinatorMessageInput {
|
|
20
|
-
coordinatorSession: string;
|
|
21
|
-
chatKey: string;
|
|
22
|
-
accountId?: string;
|
|
23
|
-
replyContextToken?: string;
|
|
24
|
-
text: string;
|
|
25
|
-
}
|
|
26
|
-
export interface ScheduledSessionDescriptor {
|
|
27
|
-
alias: string;
|
|
28
|
-
agent: string;
|
|
29
|
-
workspace: string;
|
|
30
|
-
transportSession: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ScheduledChannelMessageInput {
|
|
33
|
-
chatKey: string;
|
|
34
|
-
taskId?: string;
|
|
35
|
-
sessionAlias: string;
|
|
36
|
-
/**
|
|
37
|
-
* When present, the scheduled prompt runs in a transient session described
|
|
38
|
-
* here (temp mode) instead of the persisted logical session named by
|
|
39
|
-
* `sessionAlias`. `sessionAlias` still records the origin session for display.
|
|
40
|
-
*/
|
|
41
|
-
sessionDescriptor?: ScheduledSessionDescriptor;
|
|
42
|
-
accountId?: string;
|
|
43
|
-
replyContextToken?: string;
|
|
44
|
-
noticeText: string;
|
|
45
|
-
promptText: string;
|
|
46
|
-
abortSignal?: AbortSignal;
|
|
47
|
-
}
|
|
48
|
-
export interface ChannelStartInput {
|
|
49
|
-
agent: ChatAgent;
|
|
50
|
-
abortSignal: AbortSignal;
|
|
51
|
-
quota: OutboundQuota;
|
|
52
|
-
logger: AppLogger;
|
|
53
|
-
perfTracer?: PerfTracer;
|
|
54
|
-
/** weacpx 内置命令目录,供支持输入框命令提示的频道使用。 */
|
|
55
|
-
commandHints?: CommandHint[];
|
|
56
|
-
/** weacpx 核心版本字符串,供需要它的频道(如命令同步元数据)使用。 */
|
|
57
|
-
coreVersion?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface OrchestrationDeliveryCallbacks {
|
|
60
|
-
markTaskNoticeDelivered: (taskId: string, accountId: string) => Promise<void>;
|
|
61
|
-
markTaskNoticeFailed: (taskId: string, errorMessage: string) => Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
export interface ConsumerLockMetadata {
|
|
64
|
-
pid: number;
|
|
65
|
-
mode: "foreground" | "daemon";
|
|
66
|
-
startedAt: string;
|
|
67
|
-
configPath: string;
|
|
68
|
-
statePath: string;
|
|
69
|
-
hostname?: string;
|
|
70
|
-
}
|
|
71
|
-
export interface ConsumerLock {
|
|
72
|
-
acquire(meta: ConsumerLockMetadata): Promise<void>;
|
|
73
|
-
release(): Promise<void>;
|
|
74
|
-
}
|
|
75
|
-
export interface ConsumerLockOptions {
|
|
76
|
-
lockFilePath?: string;
|
|
77
|
-
onDiagnostic?: (event: string, context: Record<string, string | number | boolean | undefined>) => void | Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
export interface MessageChannelRuntime {
|
|
80
|
-
id: string;
|
|
81
|
-
isLoggedIn(): boolean;
|
|
82
|
-
login(): Promise<string>;
|
|
83
|
-
logout(): void;
|
|
84
|
-
start(input: ChannelStartInput): Promise<void>;
|
|
85
|
-
createConsumerLock?(options?: ConsumerLockOptions): ConsumerLock;
|
|
86
|
-
configureOrchestration?(callbacks: OrchestrationDeliveryCallbacks): void;
|
|
87
|
-
notifyTaskCompletion(task: OrchestrationTaskRecord): Promise<void>;
|
|
88
|
-
notifyTaskProgress(task: OrchestrationTaskRecord, text: string): Promise<void>;
|
|
89
|
-
sendCoordinatorMessage(input: CoordinatorMessageInput): Promise<void>;
|
|
90
|
-
sendScheduledMessage?(input: ScheduledChannelMessageInput): Promise<void>;
|
|
91
|
-
/**
|
|
92
|
-
* Preferred render format for `/ssn` native session lists. weixin renders
|
|
93
|
-
* markdown tables poorly and declares "cards"; channels that omit this are
|
|
94
|
-
* treated as "table".
|
|
95
|
-
*/
|
|
96
|
-
nativeSessionListFormat?: "cards" | "table";
|
|
97
|
-
}
|
|
98
|
-
export type ToolUseStatus = "running" | "success" | "error";
|
|
99
|
-
export type ToolUseKind = "read" | "search" | "execute" | "edit" | "think" | "other";
|
|
100
|
-
export interface ToolUseEvent {
|
|
101
|
-
toolCallId: string;
|
|
102
|
-
/** Free-form tool name from the agent (e.g. "Read File", "Bash"). */
|
|
103
|
-
toolName: string;
|
|
104
|
-
/** Coarse classifier produced by the transport from the agent's tool kind; channels use it to pick an icon. */
|
|
105
|
-
kind: ToolUseKind;
|
|
106
|
-
/** Best-effort one-line summary derived from `rawInput`. */
|
|
107
|
-
summary?: string;
|
|
108
|
-
rawInput?: unknown;
|
|
109
|
-
content?: unknown;
|
|
110
|
-
rawOutput?: unknown;
|
|
111
|
-
locations?: unknown;
|
|
112
|
-
status: ToolUseStatus;
|
|
113
|
-
/** Set when status transitions out of "running". */
|
|
114
|
-
durationMs?: number;
|
|
115
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { MessageChannelRuntime, ChannelStartInput, CoordinatorMessageInput, OrchestrationDeliveryCallbacks, ConsumerLock, ConsumerLockOptions, ScheduledChannelMessageInput } from "./types.js";
|
|
2
|
-
import type { RuntimeMediaStore } from "./media-store.js";
|
|
3
|
-
import type { OrchestrationTaskRecord } from "../orchestration/orchestration-types.js";
|
|
4
|
-
export declare class WeixinChannel implements MessageChannelRuntime {
|
|
5
|
-
readonly id = "weixin";
|
|
6
|
-
readonly nativeSessionListFormat: "cards" | "table";
|
|
7
|
-
private agent;
|
|
8
|
-
private quota;
|
|
9
|
-
private logger;
|
|
10
|
-
private markDelivered;
|
|
11
|
-
private markFailed;
|
|
12
|
-
private mediaStore;
|
|
13
|
-
private allowedMediaRoots;
|
|
14
|
-
constructor(mediaStore?: RuntimeMediaStore, allowedMediaRoots?: string[]);
|
|
15
|
-
isLoggedIn(): boolean;
|
|
16
|
-
login(): Promise<string>;
|
|
17
|
-
logout(): void;
|
|
18
|
-
createConsumerLock(options?: ConsumerLockOptions): ConsumerLock;
|
|
19
|
-
configureOrchestration(callbacks: OrchestrationDeliveryCallbacks): void;
|
|
20
|
-
start(input: ChannelStartInput): Promise<void>;
|
|
21
|
-
notifyTaskCompletion(task: OrchestrationTaskRecord): Promise<void>;
|
|
22
|
-
notifyTaskProgress(task: OrchestrationTaskRecord, text: string): Promise<void>;
|
|
23
|
-
sendCoordinatorMessage(input: CoordinatorMessageInput): Promise<void>;
|
|
24
|
-
sendScheduledMessage(input: ScheduledChannelMessageInput): Promise<void>;
|
|
25
|
-
}
|