weacpx 0.4.9 → 0.5.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 +25 -0
- package/dist/bridge/bridge-main.js +20 -3
- package/dist/channels/types.d.ts +11 -0
- package/dist/channels/weixin-channel.d.ts +3 -1
- package/dist/cli.js +1237 -83
- package/dist/config/types.d.ts +7 -0
- package/dist/plugin-api.d.ts +1 -1
- package/dist/plugin-api.js +1 -1
- package/dist/plugins/compatibility.d.ts +1 -1
- package/dist/util/private-file.d.ts +26 -0
- package/dist/weixin/agent/interface.d.ts +2 -0
- package/dist/weixin/messaging/scheduled-turn.d.ts +22 -0
- package/package.json +1 -1
package/dist/config/types.d.ts
CHANGED
|
@@ -19,6 +19,13 @@ export interface TransportConfig {
|
|
|
19
19
|
permissionMode: PermissionMode;
|
|
20
20
|
nonInteractivePermissions: NonInteractivePermissions;
|
|
21
21
|
permissionPolicy?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Idle TTL (seconds) passed to acpx as `--ttl` on prompt commands. Governs how
|
|
24
|
+
* long the acpx queue owner (and the warm ACP agent it holds) survives between
|
|
25
|
+
* prompts, so follow-up messages in a conversation skip the agent cold start.
|
|
26
|
+
* `0` keeps the owner alive forever. Defaults to 1800 (30 min).
|
|
27
|
+
*/
|
|
28
|
+
queueOwnerTtlSeconds?: number;
|
|
22
29
|
}
|
|
23
30
|
export type LoggingLevel = "error" | "info" | "debug";
|
|
24
31
|
export interface PerfLogConfig {
|
package/dist/plugin-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ChannelPluginDefinition } from "./channels/plugin.js";
|
|
2
2
|
export type { ChannelFactory, CreateChannelDeps } from "./channels/create-channel.js";
|
|
3
|
-
export type { ChannelStartInput, ConsumerLock, ConsumerLockMetadata, ConsumerLockOptions, CoordinatorMessageInput, MessageChannelRuntime, OrchestrationDeliveryCallbacks, OutboundQuota, ToolUseEvent, ToolUseKind, ToolUseStatus, } from "./channels/types.js";
|
|
3
|
+
export type { ChannelStartInput, ConsumerLock, ConsumerLockMetadata, ConsumerLockOptions, CoordinatorMessageInput, MessageChannelRuntime, ScheduledChannelMessageInput, OrchestrationDeliveryCallbacks, OutboundQuota, ToolUseEvent, ToolUseKind, ToolUseStatus, } from "./channels/types.js";
|
|
4
4
|
export type { ChannelCliInput, ChannelCliIo, ChannelCliParseResult, ChannelCliProvider, ChannelCliValidationIssue, } from "./channels/cli/provider.js";
|
|
5
5
|
export type { ChannelRuntimeConfig } from "./config/types.js";
|
|
6
6
|
export type { AppLogger } from "./logging/app-logger.js";
|
package/dist/plugin-api.js
CHANGED
|
@@ -160,7 +160,7 @@ function validatePluginCompatibility(metadata, context) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
var WEACPX_PLUGIN_API_VERSION = 1, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION = "0.
|
|
163
|
+
var WEACPX_PLUGIN_API_VERSION = 1, WEACPX_PLUGIN_API_SUPPORTED_VERSIONS, WEACPX_PLUGIN_MIN_CORE_VERSION = "0.5.0", SEMVER_RE;
|
|
164
164
|
var init_compatibility = __esm(() => {
|
|
165
165
|
WEACPX_PLUGIN_API_SUPPORTED_VERSIONS = [1];
|
|
166
166
|
SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WEACPX_PLUGIN_API_VERSION: 1;
|
|
2
2
|
export declare const WEACPX_PLUGIN_API_SUPPORTED_VERSIONS: readonly number[];
|
|
3
|
-
export declare const WEACPX_PLUGIN_MIN_CORE_VERSION: "0.
|
|
3
|
+
export declare const WEACPX_PLUGIN_MIN_CORE_VERSION: "0.5.0";
|
|
4
4
|
export declare function normalizeCoreVersionForCompat(version: string): string;
|
|
5
5
|
export declare function compareSemver(a: string, b: string): -1 | 0 | 1;
|
|
6
6
|
export declare function isVersionSatisfied(current: string, requirement: string): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare function writePrivateFileAtomic(path: string, content: string): Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* Synchronous private-file write for hot-path callers that cannot await
|
|
4
|
+
* (e.g. per-message weixin credential/sync-buf/context-token persistence).
|
|
5
|
+
* Atomic via write-file-atomic's temp+rename, created at 0600 so the secret is
|
|
6
|
+
* never momentarily world-readable. No cross-process lock: weixin's per-account
|
|
7
|
+
* consumer lock already serializes the single writing daemon.
|
|
8
|
+
*/
|
|
9
|
+
interface WritePrivateFileSyncDeps {
|
|
10
|
+
platform?: NodeJS.Platform;
|
|
11
|
+
atomicWrite?: (path: string, content: string) => void;
|
|
12
|
+
directWrite?: (path: string, content: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function writePrivateFileSync(path: string, content: string, deps?: WritePrivateFileSyncDeps): void;
|
|
15
|
+
interface RetryTransientWriteOptions {
|
|
16
|
+
platform?: NodeJS.Platform;
|
|
17
|
+
maxAttempts?: number;
|
|
18
|
+
baseDelayMs?: number;
|
|
19
|
+
maxDelayMs?: number;
|
|
20
|
+
delay?: (ms: number) => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function retryTransientWriteErrors(run: () => Promise<void>, options?: RetryTransientWriteOptions): Promise<void>;
|
|
23
|
+
export declare const __privateFileForTests: {
|
|
24
|
+
retryTransientWriteErrors: typeof retryTransientWriteErrors;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -62,6 +62,8 @@ export interface ChatRequestMetadata {
|
|
|
62
62
|
senderName?: string;
|
|
63
63
|
groupId?: string;
|
|
64
64
|
isOwner?: boolean;
|
|
65
|
+
/** Internal weacpx session alias to use for non-interactive scheduled prompts. */
|
|
66
|
+
scheduledSessionAlias?: string;
|
|
65
67
|
}
|
|
66
68
|
export interface ChatResponse {
|
|
67
69
|
/**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AppLogger } from "../../logging/app-logger";
|
|
2
|
+
import type { ScheduledChannelMessageInput } from "../../channels/types";
|
|
3
|
+
import type { Agent } from "../agent/interface";
|
|
4
|
+
import type { PendingFinalChunk } from "./quota-manager";
|
|
5
|
+
import { sendMessageWeixin } from "./send";
|
|
6
|
+
export interface ScheduledTurnDeps {
|
|
7
|
+
agent: Agent;
|
|
8
|
+
listAccountIds: () => string[];
|
|
9
|
+
resolveAccount: (accountId: string) => {
|
|
10
|
+
accountId: string;
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
};
|
|
14
|
+
getContextToken: (accountId: string, userId: string) => string | undefined;
|
|
15
|
+
reserveMidSegment: (chatKey: string) => boolean;
|
|
16
|
+
reserveFinal: (chatKey: string) => boolean;
|
|
17
|
+
finalRemaining?: (chatKey: string) => number;
|
|
18
|
+
enqueuePendingFinal?: (chatKey: string, chunks: PendingFinalChunk[]) => void;
|
|
19
|
+
sendMessage?: typeof sendMessageWeixin;
|
|
20
|
+
logger: AppLogger;
|
|
21
|
+
}
|
|
22
|
+
export declare function executeScheduledTurn(input: ScheduledChannelMessageInput, deps: ScheduledTurnDeps): Promise<void>;
|