@sleep2agi/agent-network 2.3.0-preview.26 → 2.3.0-preview.261
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 +35 -324
- package/build-info.json +7 -0
- package/dist/bin/anet.cjs +104 -0
- package/dist/bin/cli.d.ts +1 -1
- package/dist/bin/cli.js +20 -1
- package/dist/src/active-network-task.d.ts +28 -0
- package/dist/src/batch-workdir.d.ts +9 -0
- package/dist/src/bootstrap-password-db.d.ts +13 -0
- package/dist/src/build-info.d.ts +26 -0
- package/dist/src/channel-attachments.d.ts +29 -0
- package/dist/src/channel-inbox-wake.d.ts +21 -0
- package/dist/src/channel-meta.d.ts +10 -0
- package/dist/src/channel-peer-reply.d.ts +41 -0
- package/dist/src/channel-task-trace.d.ts +14 -0
- package/dist/src/claude-vendor-env.d.ts +28 -0
- package/dist/src/cli-args.d.ts +8 -0
- package/dist/src/cli-auth-session.d.ts +47 -0
- package/dist/src/cli-errors.d.ts +41 -0
- package/dist/src/cli-exit.d.ts +11 -0
- package/dist/src/cli-help.d.ts +10 -0
- package/dist/src/cli-version-display.d.ts +16 -0
- package/dist/src/client-task-trace.d.ts +9 -0
- package/dist/src/client.js +1 -1
- package/dist/src/codex-adopt.d.ts +46 -0
- package/dist/src/codex-auth-fingerprint.d.ts +211 -0
- package/dist/src/codex-bin-pin.d.ts +23 -0
- package/dist/src/codex-commhub-mcp.d.ts +22 -0
- package/dist/src/codex-copresence-bridge-log.d.ts +44 -0
- package/dist/src/codex-copresence-env.d.ts +5 -0
- package/dist/src/codex-copresence-login-gate.d.ts +18 -0
- package/dist/src/codex-copresence-model.d.ts +23 -0
- package/dist/src/codex-copresence-preflight.d.ts +78 -0
- package/dist/src/codex-copresence-profile.d.ts +126 -0
- package/dist/src/codex-copresence-recovery.d.ts +70 -0
- package/dist/src/codex-copresence-resume-timeout.d.ts +28 -0
- package/dist/src/codex-copresence-rollout-guard.d.ts +36 -0
- package/dist/src/codex-copresence-rpc.d.ts +17 -0
- package/dist/src/codex-copresence-thread.d.ts +13 -0
- package/dist/src/codex-copresence-yolo.d.ts +16 -0
- package/dist/src/codex-external-appserver.d.ts +130 -0
- package/dist/src/codex-fork-recovery.d.ts +52 -0
- package/dist/src/codex-home-enforce.d.ts +88 -0
- package/dist/src/codex-lifecycle-account.d.ts +104 -0
- package/dist/src/codex-lifecycle-canary.d.ts +20 -0
- package/dist/src/codex-lifecycle-facts.d.ts +53 -0
- package/dist/src/codex-lifecycle-fork.d.ts +91 -0
- package/dist/src/codex-lifecycle-preflight.d.ts +79 -0
- package/dist/src/codex-lifecycle-receipt.d.ts +53 -0
- package/dist/src/codex-lifecycle-restart.d.ts +88 -0
- package/dist/src/codex-login-share-guard.d.ts +146 -0
- package/dist/src/codex-menu.d.ts +99 -0
- package/dist/src/codex-model-default.d.ts +6 -0
- package/dist/src/codex-node-login.d.ts +98 -0
- package/dist/src/codex-pending-thread-restart.d.ts +69 -0
- package/dist/src/codex-reasoning-effort.d.ts +17 -0
- package/dist/src/codex-recovery-lease.d.ts +39 -0
- package/dist/src/codex-recovery-resource-gate.d.ts +15 -0
- package/dist/src/codex-resume.d.ts +89 -0
- package/dist/src/codex-rollout-history-guard.d.ts +84 -0
- package/dist/src/codex-tui-client-health.d.ts +30 -0
- package/dist/src/commhub-response.d.ts +1 -0
- package/dist/src/controlled-upload.d.ts +83 -0
- package/dist/src/copresence-deps.d.ts +22 -0
- package/dist/src/copresence-identity.d.ts +363 -0
- package/dist/src/copresence-startup-diagnosis.d.ts +17 -0
- package/dist/src/daemon-adopt.d.ts +14 -0
- package/dist/src/daemon-anet-bin.d.ts +32 -0
- package/dist/src/daemon-capability-display.d.ts +110 -0
- package/dist/src/daemon-capability-display.js +21 -0
- package/dist/src/daemon-codex-inventory.d.ts +65 -0
- package/dist/src/daemon-inherited-env.d.ts +9 -0
- package/dist/src/daemon-provider-account-custody.d.ts +28 -0
- package/dist/src/daemon-provider-account-readback.d.ts +3 -0
- package/dist/src/daemon-provider-application.d.ts +36 -0
- package/dist/src/daemon-provider-apply-command.d.ts +9 -0
- package/dist/src/daemon-provider-collect.d.ts +29 -0
- package/dist/src/daemon-provider-command.d.ts +7 -0
- package/dist/src/daemon-provider-initialize.d.ts +27 -0
- package/dist/src/daemon-provider-lifecycle.d.ts +4 -0
- package/dist/src/daemon-provider-store.d.ts +104 -0
- package/dist/src/daemon-runtime-path-preflight.d.ts +22 -0
- package/dist/src/daemon-runtime-staleness.d.ts +13 -0
- package/dist/src/dashboard-managed-process.d.ts +35 -0
- package/dist/src/display-width.d.ts +27 -0
- package/dist/src/doctor-node-count.d.ts +28 -0
- package/dist/src/grok-attach-client.d.ts +129 -0
- package/dist/src/grok-build-drift.d.ts +15 -0
- package/dist/src/grok-copresence-disclosure.d.ts +11 -0
- package/dist/src/grok-copresence-orchestration.d.ts +75 -0
- package/dist/src/grok-copresence-profile.d.ts +65 -0
- package/dist/src/grok-create-mode.d.ts +19 -0
- package/dist/src/host-telemetry.d.ts +14 -0
- package/dist/src/hub-health-timeout.d.ts +4 -0
- package/dist/src/hub-server-version.d.ts +64 -0
- package/dist/src/hub-stop.d.ts +74 -0
- package/dist/src/hub-time-display.d.ts +20 -0
- package/dist/src/hub-version-skew.d.ts +19 -0
- package/dist/src/im/correlation-store.d.ts +34 -0
- package/dist/src/im/feishu/adapter.d.ts +47 -0
- package/dist/src/im/feishu/bridge.d.ts +72 -14
- package/dist/src/im/feishu/chat-context.d.ts +44 -0
- package/dist/src/im/feishu/config.d.ts +15 -1
- package/dist/src/im/feishu/hub-upload.d.ts +1 -1
- package/dist/src/im/feishu/queue-notice.d.ts +2 -0
- package/dist/src/im/feishu/worker-lifecycle.d.ts +13 -0
- package/dist/src/im/feishu/worker.js +171 -154
- package/dist/src/inbox-drain.d.ts +20 -0
- package/dist/src/local-process-state.d.ts +12 -0
- package/dist/src/locale-diagnostic.d.ts +12 -0
- package/dist/src/login-client-label.d.ts +6 -0
- package/dist/src/ls-columns.d.ts +15 -0
- package/dist/src/mock-llm.d.ts +12 -0
- package/dist/src/node-activity-log.d.ts +4 -0
- package/dist/src/node-clone.d.ts +134 -0
- package/dist/src/node-delete-hub.d.ts +42 -0
- package/dist/src/node-files.d.ts +62 -0
- package/dist/src/node-locate.d.ts +60 -0
- package/dist/src/node-ls-all.d.ts +80 -0
- package/dist/src/node-menu.d.ts +40 -0
- package/dist/src/node-not-found.d.ts +1 -0
- package/dist/src/node-perm.d.ts +74 -0
- package/dist/src/node-remote.d.ts +180 -0
- package/dist/src/node-running-guard.d.ts +9 -0
- package/dist/src/node-secret-file.d.ts +32 -0
- package/dist/src/node-server-identity.d.ts +35 -0
- package/dist/src/node-server-payload.d.ts +66 -0
- package/dist/src/node-server-rules-file.d.ts +14 -0
- package/dist/src/node-server-secrets.d.ts +60 -0
- package/dist/src/node-server-version.d.ts +39 -0
- package/dist/src/node-server.d.ts +0 -12
- package/dist/src/node-server.js +8 -1
- package/dist/src/node-skills.d.ts +57 -0
- package/dist/src/normalize-runtime.d.ts +28 -9
- package/dist/src/offline-age.d.ts +29 -0
- package/dist/src/one-line-cell.d.ts +20 -0
- package/dist/src/opencode-agent-node-pair.d.ts +52 -0
- package/dist/src/opencode-auth-login.d.ts +43 -0
- package/dist/src/opencode-free-tier.d.ts +27 -0
- package/dist/src/opencode-generation-create.d.ts +27 -0
- package/dist/src/opencode-generation-record.d.ts +24 -0
- package/dist/src/opencode-launch-env.d.ts +13 -0
- package/dist/src/opencode-owner-mode.d.ts +6 -0
- package/dist/src/opencode-package-binary.d.ts +44 -0
- package/dist/src/opencode-pin.d.ts +28 -8
- package/dist/src/opencode-preset.d.ts +42 -8
- package/dist/src/opencode-runtime-binding.d.ts +30 -0
- package/dist/src/opencode-safe-root.d.ts +36 -0
- package/dist/src/opencode-shared-server-create.d.ts +5 -0
- package/dist/src/opencode-smoke-env.d.ts +1 -0
- package/dist/src/opencode-start-mode.d.ts +8 -0
- package/dist/src/opencode-v2-configured-model.d.ts +34 -0
- package/dist/src/opencode-v2-create-align.d.ts +18 -0
- package/dist/src/opencode-versions.d.ts +44 -0
- package/dist/src/os-user.d.ts +4 -0
- package/dist/src/outbound-attachments.d.ts +60 -0
- package/dist/src/outbound-tool-names.d.ts +1 -0
- package/dist/src/owned-roots.d.ts +58 -0
- package/dist/src/owner-env-file.d.ts +2 -0
- package/dist/src/package-mode-preflight.d.ts +41 -0
- package/dist/src/posix-codex-copresence.d.ts +33 -0
- package/dist/src/posix-modes.d.ts +36 -0
- package/dist/src/primary-network.d.ts +23 -0
- package/dist/src/private-state.d.ts +18 -0
- package/dist/src/process-telemetry.d.ts +12 -0
- package/dist/src/profile-merge.d.ts +12 -0
- package/dist/src/profile-serialize.d.ts +1 -0
- package/dist/src/provider-application-contract.d.ts +11 -0
- package/dist/src/provider-apply.d.ts +28 -0
- package/dist/src/provider-presets.d.ts +76 -0
- package/dist/src/reply-local-links.d.ts +47 -0
- package/dist/src/reply-originator.d.ts +20 -0
- package/dist/src/resume-runtime-infer.d.ts +18 -0
- package/dist/src/rules-file.d.ts +76 -0
- package/dist/src/scoped-secrets.d.ts +56 -0
- package/dist/src/secret-shell-guidance.d.ts +4 -0
- package/dist/src/session-status-class.d.ts +48 -0
- package/dist/src/shared/opencode-borrowed-launch-health.d.ts +29 -0
- package/dist/src/shared/private-file.d.ts +65 -0
- package/dist/src/shared/provider-collection.d.ts +9 -0
- package/dist/src/shared/provider-initialization.d.ts +7 -0
- package/dist/src/shared/reserved-env.d.ts +3 -0
- package/dist/src/shared/scoped-secret-contract.d.ts +1 -0
- package/dist/src/shared/scoped-secret-env.d.ts +3 -0
- package/dist/src/sibling-agent-node.d.ts +23 -0
- package/dist/src/stale-socket.d.ts +118 -0
- package/dist/src/standalone-bin.d.ts +101 -0
- package/dist/src/standalone-build-stamp.d.ts +33 -0
- package/dist/src/start-resource-gate.d.ts +146 -0
- package/dist/src/stopped-receipt.d.ts +8 -0
- package/dist/src/subcommand-redirect.d.ts +26 -0
- package/dist/src/task-trace.d.ts +33 -0
- package/dist/src/tmux-attach.d.ts +11 -0
- package/dist/src/tmux-capability.d.ts +58 -0
- package/dist/src/tmux-exact-target.d.ts +36 -0
- package/dist/src/tmux-format.d.ts +20 -0
- package/dist/src/tmux-pane-prompt.d.ts +22 -0
- package/dist/src/tmux.d.ts +44 -0
- package/dist/src/token-cli.d.ts +13 -0
- package/dist/src/tool-allowlist.d.ts +28 -0
- package/dist/src/unsafe-package-path-reason.d.ts +31 -0
- package/dist/src/upgrade-channel.d.ts +31 -0
- package/dist/src/win-launcher.d.ts +20 -0
- package/dist/src/windows-codex-copresence.d.ts +254 -0
- package/dist/src/windows-rename-retry.d.ts +13 -0
- package/dist/src/windows-runtime.d.ts +63 -0
- package/dist/src/windows-sdk-stop-evidence.d.ts +24 -0
- package/package.json +19 -9
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ActiveNetworkTask {
|
|
2
|
+
taskId: string;
|
|
3
|
+
from: string;
|
|
4
|
+
startedAt: number;
|
|
5
|
+
}
|
|
6
|
+
/** 运行时崩溃没来得及删标记时的兜底:超过这个年龄的标记当不存在。 */
|
|
7
|
+
export declare const ACTIVE_NETWORK_TASK_MAX_AGE_MS: number;
|
|
8
|
+
export declare function parseActiveNetworkTask(raw: string | null | undefined, now: number, maxAgeMs?: number): ActiveNetworkTask | null;
|
|
9
|
+
export type OutboundTool = "commhub_send_task" | "commhub_send_message";
|
|
10
|
+
export type OutboundRewrite = {
|
|
11
|
+
kind: "pass";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "progress_of_active_task";
|
|
14
|
+
taskId: string;
|
|
15
|
+
from: string;
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 只在「目标 alias 恰好是当前网络任务的发起方」时改写;发给别人的照常放行——
|
|
20
|
+
* 模型替任务派活给第三方是合法的协作,不能一刀切。
|
|
21
|
+
*/
|
|
22
|
+
export declare function decideOutboundRewrite(tool: OutboundTool, args: {
|
|
23
|
+
alias?: unknown;
|
|
24
|
+
task?: unknown;
|
|
25
|
+
message?: unknown;
|
|
26
|
+
} | null | undefined, active: ActiveNetworkTask | null): OutboundRewrite;
|
|
27
|
+
/** outbound-only 模式下模型不能自选 high(#1770 第三条):降为 normal,其余原样。 */
|
|
28
|
+
export declare function clampOutboundPriority(priority: unknown, outboundOnly: boolean): "high" | "normal" | "low" | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve one batch workdir before any mkdir/chdir loop starts.
|
|
3
|
+
*
|
|
4
|
+
* Node does not expand shell tildes. Leaving `~/team` relative means every
|
|
5
|
+
* iteration can resolve it from the previous node's cwd and create paths such
|
|
6
|
+
* as `/work/~/team/~/team`. Only the current user's `~` form is supported;
|
|
7
|
+
* `~other` is rejected instead of being written as a literal directory.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeBatchWorkdir(input: string, cwd?: string, home?: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface BootstrapPasswordUpdateInvocation {
|
|
2
|
+
argv: string[];
|
|
3
|
+
env: NodeJS.ProcessEnv;
|
|
4
|
+
script: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the database selected for the local Hub into an explicit absolute
|
|
8
|
+
* path before launching the bootstrap helper. The helper must never infer a
|
|
9
|
+
* database from its own HOME/cwd: those can differ from the parent process.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveBootstrapDatabasePath(env: NodeJS.ProcessEnv, home: string, cwd: string): string;
|
|
12
|
+
export declare const BOOTSTRAP_PASSWORD_UPDATE_SCRIPT: string;
|
|
13
|
+
export declare function buildBootstrapPasswordUpdateInvocation(userId: string, dbPath: string, baseEnv?: NodeJS.ProcessEnv): BootstrapPasswordUpdateInvocation;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type BuildInfo = {
|
|
2
|
+
schema: 1;
|
|
3
|
+
commit: string;
|
|
4
|
+
dirty: boolean;
|
|
5
|
+
built_at: string;
|
|
6
|
+
source?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const BUILD_INFO_FILE = "build-info.json";
|
|
9
|
+
export declare function validateBuildInfo(raw: unknown): BuildInfo | null;
|
|
10
|
+
export type BuildInfoRead = {
|
|
11
|
+
kind: "present";
|
|
12
|
+
info: BuildInfo;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "absent";
|
|
15
|
+
} | {
|
|
16
|
+
kind: "invalid";
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function readBuildInfo(dir: string): BuildInfoRead;
|
|
20
|
+
/**
|
|
21
|
+
* 从**这个模块所在包**读 build-info。`bin/cli.ts` 与 `dist/bin/cli.js` 的层级不同,
|
|
22
|
+
* 所以向上找不超过 3 层,命中即返回;找不到返回 absent。
|
|
23
|
+
*/
|
|
24
|
+
export declare function readPackageBuildInfo(): BuildInfoRead;
|
|
25
|
+
/** `anet --version` 里那一行的文本:三个状态各有各的说法,绝不把「没有」显示成「没问题」。 */
|
|
26
|
+
export declare function formatBuildLine(r: BuildInfoRead): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface AttachmentDescriptor {
|
|
2
|
+
type?: unknown;
|
|
3
|
+
file_id?: unknown;
|
|
4
|
+
path?: unknown;
|
|
5
|
+
mime?: unknown;
|
|
6
|
+
name?: unknown;
|
|
7
|
+
size?: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface ChannelAttachmentDeps {
|
|
10
|
+
hubUrl: string;
|
|
11
|
+
authToken: string;
|
|
12
|
+
cacheDir: string;
|
|
13
|
+
fetch?: typeof fetch;
|
|
14
|
+
maxBytes?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ChannelAttachmentResult {
|
|
17
|
+
paths: string[];
|
|
18
|
+
failures: Array<{
|
|
19
|
+
fileId: string;
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare function readableAttachmentsFromInbox(message: any): AttachmentDescriptor[];
|
|
25
|
+
export declare function channelAttachmentCacheDir(home: string, alias: string): string;
|
|
26
|
+
export declare function downloadChannelAttachments(message: any, deps: ChannelAttachmentDeps): Promise<ChannelAttachmentResult>;
|
|
27
|
+
export declare const downloadChannelImageAttachments: typeof downloadChannelAttachments;
|
|
28
|
+
export declare function appendChannelAttachmentPaths(content: string, paths: readonly string[]): string;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** SSE event types that mean "there is something new in your inbox". */
|
|
2
|
+
export declare const INBOX_WAKE_EVENTS: ReadonlySet<string>;
|
|
3
|
+
export declare function isInboxWakeEvent(type: unknown): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Single-flight runner: at most one drain runs at a time, and wakeups that
|
|
6
|
+
* arrive mid-drain collapse into exactly one rerun. Two concurrent drains
|
|
7
|
+
* would both fetch the same unacked rows and inject each task twice.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createSingleFlight(run: () => Promise<void>): () => Promise<void>;
|
|
10
|
+
export declare const DEFAULT_INBOX_POLL_MS = 60000;
|
|
11
|
+
/** ANET_CHANNEL_INBOX_POLL_MS: poll period in ms; "0" disables the safety net. */
|
|
12
|
+
export declare function inboxPollIntervalMs(raw: string | undefined): number;
|
|
13
|
+
/**
|
|
14
|
+
* Periodically run the drain so a missed push costs at most one period.
|
|
15
|
+
* Returns a stop function. The timer never keeps the process alive.
|
|
16
|
+
*/
|
|
17
|
+
export declare function startInboxSafetyNet(opts: {
|
|
18
|
+
intervalMs: number;
|
|
19
|
+
drain: () => Promise<void>;
|
|
20
|
+
onError?: (error: unknown) => void;
|
|
21
|
+
}): () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** One inbound inbox row → the meta Claude Code renders as `<channel …>` attrs.
|
|
2
|
+
*
|
|
3
|
+
* Pure so the attribute set is assertable; it used to be inline in the SSE
|
|
4
|
+
* handler, where nothing could see it. */
|
|
5
|
+
export declare function inboundChannelMeta(msg: {
|
|
6
|
+
id: string;
|
|
7
|
+
from_session?: string | null;
|
|
8
|
+
priority?: string | null;
|
|
9
|
+
created_at?: string | null;
|
|
10
|
+
}): Record<string, string>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const PEER_REPLY_TOOL_NAME = "commhub_send_peer_reply";
|
|
2
|
+
export interface ChannelPeerReplyInput {
|
|
3
|
+
task_id?: unknown;
|
|
4
|
+
text?: unknown;
|
|
5
|
+
status?: unknown;
|
|
6
|
+
alias?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface ChannelPeerReplyDeps {
|
|
9
|
+
/** One Hub MCP tool call. Returns the parsed tool payload (ok:false on rejection); may throw on transport failure. */
|
|
10
|
+
call: (tool: string, args: Record<string, unknown>) => Promise<any>;
|
|
11
|
+
fromAlias: string;
|
|
12
|
+
/** Sender alias the channel recorded when it injected this task_id (in-memory; may be unknown after a restart). */
|
|
13
|
+
originatorOf?: (taskId: string) => string | undefined;
|
|
14
|
+
/** channel meta task_id is the inbox ROW id; map it to the logical tasks.task_id when known. */
|
|
15
|
+
logicalTaskIdOf?: (taskId: string) => string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export type ChannelPeerReplyRoute = "atomic" | "wake-then-close" | "reply-only";
|
|
18
|
+
export interface ChannelPeerReplyResult {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
route?: ChannelPeerReplyRoute;
|
|
21
|
+
/** The original task is now terminal. */
|
|
22
|
+
closed: boolean;
|
|
23
|
+
/** A wake was delivered to the peer (atomic result row or fallback send_task). */
|
|
24
|
+
woke: boolean;
|
|
25
|
+
task_id?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
message?: string;
|
|
28
|
+
wake_task_id?: string | null;
|
|
29
|
+
fallback_reason?: string;
|
|
30
|
+
upstream?: unknown;
|
|
31
|
+
}
|
|
32
|
+
/** The Hub rejected the ATOMIC route for a capability reason and wrote nothing. */
|
|
33
|
+
export declare function peerReplyFallbackReason(payload: any): string | null;
|
|
34
|
+
export declare function validatePeerReplyInput(input: ChannelPeerReplyInput): {
|
|
35
|
+
ok: true;
|
|
36
|
+
taskId: string;
|
|
37
|
+
text: string;
|
|
38
|
+
status: "completed" | "failed";
|
|
39
|
+
alias?: string;
|
|
40
|
+
} | ChannelPeerReplyResult;
|
|
41
|
+
export declare function sendChannelPeerReply(input: ChannelPeerReplyInput, deps: ChannelPeerReplyDeps): Promise<ChannelPeerReplyResult>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function sendChannelTaskWithTrace(input: {
|
|
2
|
+
alias: string;
|
|
3
|
+
task: string;
|
|
4
|
+
priority?: string;
|
|
5
|
+
fromAlias: string;
|
|
6
|
+
networkId?: string | null;
|
|
7
|
+
/** Structured task metadata forwarded verbatim, e.g. { attachments: [...] }.
|
|
8
|
+
* Omitted from the outbound body when absent, so a call without it is
|
|
9
|
+
* unchanged. */
|
|
10
|
+
meta?: Record<string, unknown>;
|
|
11
|
+
}, deps: {
|
|
12
|
+
send: (args: Record<string, unknown>) => Promise<any>;
|
|
13
|
+
log: (line: string) => void;
|
|
14
|
+
}): Promise<any>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const CLAUDE_VENDOR_ENV_KEYS: readonly ["ANTHROPIC_BASE_URL", "ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_API_KEY"];
|
|
2
|
+
export type PlainSecretEnvRewrite = {
|
|
3
|
+
key: string;
|
|
4
|
+
refName: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Plan the values that the node-create writer will move into its line-oriented
|
|
9
|
+
* `.env` file. This is deliberately side-effect free: callers can run it as a
|
|
10
|
+
* preflight before creating a node directory, changing process.env, or writing
|
|
11
|
+
* config.json. Keeping the line-break rejection here makes it cover every
|
|
12
|
+
* caller of the dotenv writer, including the no-name interactive wizard.
|
|
13
|
+
*/
|
|
14
|
+
export declare function planPlainSecretEnvRewrites(input: {
|
|
15
|
+
env: unknown;
|
|
16
|
+
nodeId: string;
|
|
17
|
+
}): PlainSecretEnvRewrite[];
|
|
18
|
+
/**
|
|
19
|
+
* Persist the exact Anthropic-compatible vendor environment used by an
|
|
20
|
+
* explicit claude-agent-sdk create. Explicit --env values retain precedence;
|
|
21
|
+
* ambient shell values only fill missing known keys. Other environment values
|
|
22
|
+
* are intentionally ignored so node create never snapshots the whole shell.
|
|
23
|
+
*/
|
|
24
|
+
export declare function collectClaudeVendorEnvForCreate(input: {
|
|
25
|
+
runtime: string;
|
|
26
|
+
explicitEnv: readonly string[];
|
|
27
|
+
shellEnv: Readonly<Record<string, string | undefined>>;
|
|
28
|
+
}): string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ParsedCliOptions = {
|
|
2
|
+
[key: string]: string | string[];
|
|
3
|
+
_channels: string[];
|
|
4
|
+
_envs: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const BOOLEAN_FLAGS: Set<string>;
|
|
7
|
+
export declare function parseCliOptions(argv: string[]): ParsedCliOptions;
|
|
8
|
+
export declare function positionalArgs(argv: string[]): string[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type RevokeOutcome =
|
|
2
|
+
/** 服务端已撤销 */
|
|
3
|
+
{
|
|
4
|
+
kind: "revoked";
|
|
5
|
+
tokenId: string;
|
|
6
|
+
}
|
|
7
|
+
/** Hub 回 401:这个 token 在服务端本来就无效了(过期/已撤/改过密码),没东西可撤 */
|
|
8
|
+
| {
|
|
9
|
+
kind: "already_invalid";
|
|
10
|
+
}
|
|
11
|
+
/** 不是登录会话(显式 API 令牌 / 节点令牌):按设计不撤,仍有效 */
|
|
12
|
+
| {
|
|
13
|
+
kind: "not_a_session";
|
|
14
|
+
tokenId?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Hub 没有 /api/auth/sessions(早于 #2114 的旧版本 → 404) */
|
|
17
|
+
| {
|
|
18
|
+
kind: "unsupported";
|
|
19
|
+
status: number;
|
|
20
|
+
}
|
|
21
|
+
/** 连不上 Hub(DNS / 拒绝连接 / 超时) */
|
|
22
|
+
| {
|
|
23
|
+
kind: "unreachable";
|
|
24
|
+
error: string;
|
|
25
|
+
}
|
|
26
|
+
/** 其他意外响应 */
|
|
27
|
+
| {
|
|
28
|
+
kind: "failed";
|
|
29
|
+
status?: number;
|
|
30
|
+
error: string;
|
|
31
|
+
};
|
|
32
|
+
export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
33
|
+
export declare function normalizeHubUrl(url: string): string;
|
|
34
|
+
export declare function sameHub(a?: string | null, b?: string | null): boolean;
|
|
35
|
+
/** 本地登录态字段。hub 不在里面:退出登录不等于忘掉 Hub 地址。 */
|
|
36
|
+
export declare const LOCAL_CREDENTIAL_KEYS: readonly ["token", "user", "network_id", "network_name"];
|
|
37
|
+
export declare function clearLocalCredentials(gc: Record<string, any>): Record<string, any>;
|
|
38
|
+
/** 在 `hub` 上撤销 `token` 所代表的登录会话。只把 token 发给 `hub` 本身。 */
|
|
39
|
+
export declare function revokeCurrentLoginSession(hub: string, token: string, opts?: {
|
|
40
|
+
fetchImpl?: FetchLike;
|
|
41
|
+
timeoutMs?: number;
|
|
42
|
+
}): Promise<RevokeOutcome>;
|
|
43
|
+
/** 把撤销结果翻成给人看的行。`ok=false` 表示服务端令牌**仍然有效**,调用方按警告打印。 */
|
|
44
|
+
export declare function describeRevokeOutcome(o: RevokeOutcome, hub: string): {
|
|
45
|
+
ok: boolean;
|
|
46
|
+
lines: string[];
|
|
47
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 把一个密钥变成 `<前缀>…<末 4 位>`。
|
|
3
|
+
* utok_abcdef…(40 字符)…wxyz → utok_…wxyz
|
|
4
|
+
* 太短(去掉前缀后不足 12 个字符)时连末 4 位也不给:短密钥露 4 位等于露了一大半。
|
|
5
|
+
*/
|
|
6
|
+
export declare function maskSecret(value: unknown): string;
|
|
7
|
+
/** 把任意文本里看得出的密钥都换成掩码。用在一切「把别处来的字符串打出来」的地方。 */
|
|
8
|
+
export declare function redactSecrets(text: string): string;
|
|
9
|
+
/** 深拷贝一个对象,键名像密钥的字符串值换成掩码,其余字符串值走 redactSecrets。 */
|
|
10
|
+
export declare function redactSecretFields<T>(value: T): T;
|
|
11
|
+
/** 任意「错误」值 → 一句可读文本。对象取 message / error.message / code,实在没有就 JSON。 */
|
|
12
|
+
export declare function errorText(x: unknown): string;
|
|
13
|
+
/**
|
|
14
|
+
* Hub 的失败响应体 → 一句话。hub 的 REST 路由回 `{ ok:false, error:"<字符串>" }`,
|
|
15
|
+
* 但 500 兜底(server/src/serve-error.ts)回 `{ error:{ code, message }, message }` ——
|
|
16
|
+
* 直接 `${res.error}` 就是 `[object Object]`。
|
|
17
|
+
*/
|
|
18
|
+
export declare function hubErrorText(res: unknown): string;
|
|
19
|
+
/** Doctor must not suggest retrying an implicit ownership claim. */
|
|
20
|
+
export declare function nodeTokenReissueError(res: unknown): string;
|
|
21
|
+
export interface CliErrorReport {
|
|
22
|
+
/** 第一行:出了什么事。 */
|
|
23
|
+
summary: string;
|
|
24
|
+
/** 下一步该敲的命令(每条一行)。 */
|
|
25
|
+
next: string[];
|
|
26
|
+
/** 为日志解析保留的 `FATAL: Error: CODE` 形状(只在消息本身是错误码时)。 */
|
|
27
|
+
fatalCode?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function isDebugEnabled(env?: Record<string, string | undefined>): boolean;
|
|
30
|
+
export declare function isNetworkError(err: any): boolean;
|
|
31
|
+
export declare function describeCliError(err: any, ctx?: {
|
|
32
|
+
hub?: string;
|
|
33
|
+
configPath?: string;
|
|
34
|
+
}): CliErrorReport;
|
|
35
|
+
/** 顶层 catch 用:产出要打到 stderr 的全部行(已脱敏)。stack 只在 ANET_DEBUG=1 时附上。 */
|
|
36
|
+
export declare function formatTopLevelError(err: any, opts?: {
|
|
37
|
+
hub?: string;
|
|
38
|
+
env?: Record<string, string | undefined>;
|
|
39
|
+
}): string[];
|
|
40
|
+
/** 「连 hub 失败」的原因,一句短语。用在已经写了 `Cannot reach <hub>:` 的地方。 */
|
|
41
|
+
export declare function hubReachReason(err: any): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const ANET_EXIT: {
|
|
2
|
+
readonly OK: 0;
|
|
3
|
+
readonly FAILURE: 1;
|
|
4
|
+
readonly USAGE: 2;
|
|
5
|
+
};
|
|
6
|
+
/** 命令打印了错误、不再继续 —— 记下失败码,让 main() 的终结器用它退出。 */
|
|
7
|
+
export declare function markFailed(): void;
|
|
8
|
+
/** 用法错误(缺参数 / 未知子命令 / 非法取值)。 */
|
|
9
|
+
export declare function markUsageError(): void;
|
|
10
|
+
/** main() 正常返回后的退出码:命令记下过的码,没记过就是 0。 */
|
|
11
|
+
export declare function finalExitCode(): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const NODE_DELETE_USAGE = "Usage: anet node delete <node-id|node-name> [--force]\n anet node delete <node_id> --hub-only [--hub <url>]\n\nStop the node, delete its local config (.anet/nodes/<id>/), then remove its\nrow on the Hub so it no longer shows as offline.\n\n --force Required to actually delete (without it, prints what would go)\n --hub-only Only remove the Hub row (the retry command printed when the Hub\n could not be reached); takes the node_id from that warning\n --hub <url> Hub to use with --hub-only (default: your login's Hub)\n\nThe Hub row is matched by node_id only \u2014 never by name \u2014 so a node elsewhere\nthat reuses the same name is left untouched.\nIf the Hub is unreachable or refuses, the local files are still deleted, a\nwarning prints the exact retry command, and the exit code is 1.";
|
|
2
|
+
/** path (space-joined) → usage text. `{cmd}` is replaced by the word the user typed (hub/server). */
|
|
3
|
+
export declare const COMMAND_HELP: Record<string, string>;
|
|
4
|
+
/**
|
|
5
|
+
* The most specific help entry for argv (e.g. ["node","delete","x","--help"]).
|
|
6
|
+
* Only the leading positional words are the command path; the longest prefix
|
|
7
|
+
* with an entry wins. `minDepth` lets the caller skip bare group entries when a
|
|
8
|
+
* richer group printer exists in bin/cli.ts.
|
|
9
|
+
*/
|
|
10
|
+
export declare function lookupCommandHelp(argv: string[], minDepth?: number): string | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1645 —— `anet doctor` 原先对三个 runtime CLI **只检查「在不在」**:
|
|
3
|
+
*
|
|
4
|
+
* try { execSync("codex --version", …); check("Codex CLI", true); } catch { … }
|
|
5
|
+
*
|
|
6
|
+
* 于是一个**装着、但太旧**的 CLI 会拿到一个 ✅。实测过一次:`codex-cli 0.149.1`
|
|
7
|
+
* 解不动上游 models 响应(`unknown variant \`max\``,它只认到 `xhigh`),
|
|
8
|
+
* rmcp worker 致命退出,用户看到的是 300s 超时 —— 而 doctor 说一切正常。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 **这里只把版本摆出来,不做最低版本判定。**
|
|
11
|
+
* 「多少版本才够」由上游返回什么决定,不是我们能钉死的常量;猜一个下限,
|
|
12
|
+
* 会在别人升级 CLI、上游又改动之后变成误报。而一个会误报的检查,
|
|
13
|
+
* 第一周就会被人关掉。摆出实际版本,让读的人自己对得上号,是这一格
|
|
14
|
+
* 现在能诚实做到的全部。
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatCliVersion(raw: unknown): string;
|
package/dist/src/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x207ba8=a0_0xb317;(function(_0x3b19df,_0x200a85){const _0x20e34a=a0_0xb317,_0x27403e=_0x3b19df();while(!![]){try{const _0x1df244=parseInt(_0x20e34a(0x196))/0x1+parseInt(_0x20e34a(0x1ce))/0x2*(parseInt(_0x20e34a(0x1b1))/0x3)+parseInt(_0x20e34a(0x1d5))/0x4*(-parseInt(_0x20e34a(0x1cf))/0x5)+parseInt(_0x20e34a(0x1b3))/0x6+-parseInt(_0x20e34a(0x19c))/0x7+-parseInt(_0x20e34a(0x1d6))/0x8*(-parseInt(_0x20e34a(0x1b7))/0x9)+-parseInt(_0x20e34a(0x1c7))/0xa*(parseInt(_0x20e34a(0x1c4))/0xb);if(_0x1df244===_0x200a85)break;else _0x27403e['push'](_0x27403e['shift']());}catch(_0x5d1b1d){_0x27403e['push'](_0x27403e['shift']());}}}(a0_0x4a6c,0x8217c));import{EventEmitter as a0_0x3b927b}from'events';import{hostname as a0_0x3e26be}from'os';function a0_0x4a6c(){const _0x362514=['pop','processInbox','disconnected','heartbeat\x20failed:\x20','872063lpsakg','2.0','replace','send','reply','text/event-stream','1096193fnosFi','abort','log','new_message','getReader','registered','message','sseAbort','normal','url','agent','emit','Bearer\x20','get_all_status','getAllStatus','error','/mcp','server','content','ack_inbox','application/json','3JrdMKn','Authorization','147348wPhCDk','POST','toTimeString','new_task','17181mBXUlf','slice','disconnect','result','SSE\x20failed:\x20','completed',']\x20[commhub:','body','broadcast','split','running','connected','resumeId','49434xGnUza','alias','SSE\x20reconnecting\x20in\x20','1170vWvFxv','get_inbox','match','signal','inbox\x20error:\x20','from_session','call','1333118QpukGo','3639070zfThAC','text','/events/','AbortError','send_message','reconnectDelay','4CcaYfn','1592xyrURf','min','s...','sleep','SSE\x20error:\x20','name','parse','connect','send_reply','read','heartbeatInterval','status','connectSSE','sdk','heartbeatTimer','type','send_task','stringify','token'];a0_0x4a6c=function(){return _0x362514;};return a0_0x4a6c();}class T extends a0_0x3b927b{[a0_0x207ba8(0x1a5)];[a0_0x207ba8(0x1c5)];['token'];[a0_0x207ba8(0x1a6)];[a0_0x207ba8(0x1c3)];['heartbeatInterval'];[a0_0x207ba8(0x1d4)];[a0_0x207ba8(0x18d)];['sseAbort'];[a0_0x207ba8(0x1c1)]=!0x1;constructor(_0x5054ab){const _0x1474c2=a0_0x207ba8;super();if(this[_0x1474c2(0x1a5)]=_0x5054ab[_0x1474c2(0x1a5)][_0x1474c2(0x198)](/\/$/,''),this[_0x1474c2(0x1c5)]=_0x5054ab[_0x1474c2(0x1c5)],this[_0x1474c2(0x191)]=_0x5054ab[_0x1474c2(0x191)],this[_0x1474c2(0x1a6)]=_0x5054ab[_0x1474c2(0x1a6)]||_0x1474c2(0x18c),this[_0x1474c2(0x1c3)]='sdk-'+_0x5054ab['alias']+'-'+Date['now']()['toString'](0x24),this['heartbeatInterval']=_0x5054ab[_0x1474c2(0x189)]??0x2bf20,this[_0x1474c2(0x1d4)]=_0x5054ab['reconnectDelay']??0xbb8,_0x5054ab['autoConnect']!==!0x1)this['connect']();}[a0_0x207ba8(0x19e)](_0x4f4a62){const _0x53bcb1=a0_0x207ba8;console[_0x53bcb1(0x19e)]('['+new Date()[_0x53bcb1(0x1b5)]()[_0x53bcb1(0x1b8)](0x0,0x8)+_0x53bcb1(0x1bd)+this[_0x53bcb1(0x1c5)]+']\x20'+_0x4f4a62);}async['call'](_0x296e18,_0x23821c){const _0x31bcb7=a0_0x207ba8;let _0x3f51ee={'Content-Type':_0x31bcb7(0x1b0),'Accept':'application/json,\x20text/event-stream'};if(this[_0x31bcb7(0x191)])_0x3f51ee[_0x31bcb7(0x1b2)]=_0x31bcb7(0x1a8)+this[_0x31bcb7(0x191)];let _0x1b71b3=await(await fetch(this[_0x31bcb7(0x1a5)]+_0x31bcb7(0x1ac),{'method':_0x31bcb7(0x1b4),'headers':_0x3f51ee,'body':JSON[_0x31bcb7(0x190)]({'jsonrpc':_0x31bcb7(0x197),'id':Date['now'](),'method':'tools/call','params':{'name':_0x296e18,'arguments':_0x23821c}})}))[_0x31bcb7(0x1d0)](),_0xe8bbd3=_0x1b71b3[_0x31bcb7(0x1c9)](/data: (.+)/),_0x289e12=_0xe8bbd3?JSON[_0x31bcb7(0x1dc)](_0xe8bbd3[0x1]):JSON[_0x31bcb7(0x1dc)](_0x1b71b3),_0x91f3d=_0x289e12?.[_0x31bcb7(0x1ba)]?.[_0x31bcb7(0x1ae)]?.[0x0]?.[_0x31bcb7(0x1d0)];return _0x91f3d?JSON[_0x31bcb7(0x1dc)](_0x91f3d):_0x289e12;}async[a0_0x207ba8(0x1dd)](){const _0x5929c7=a0_0x207ba8;if(this[_0x5929c7(0x1c1)])return;this[_0x5929c7(0x1c1)]=!0x0,await this['status']('idle'),this['log'](_0x5929c7(0x1a1)),this[_0x5929c7(0x18d)]=setInterval(()=>{const _0x340be8=_0x5929c7;this[_0x340be8(0x18a)]('idle')['catch'](_0x127b1d=>this[_0x340be8(0x19e)](_0x340be8(0x195)+_0x127b1d[_0x340be8(0x1a2)]));},this[_0x5929c7(0x189)]),this['connectSSE']();}async[a0_0x207ba8(0x1b9)](){const _0x14a408=a0_0x207ba8;if(this['running']=!0x1,this[_0x14a408(0x1a3)]?.[_0x14a408(0x19d)](),this[_0x14a408(0x18d)])clearInterval(this[_0x14a408(0x18d)]);await this[_0x14a408(0x18a)]('offline')['catch'](()=>{}),this[_0x14a408(0x19e)](_0x14a408(0x194));}async[a0_0x207ba8(0x199)](_0x3c1de7,_0x2c4077,_0x4a982d=a0_0x207ba8(0x1a4)){const _0x446524=a0_0x207ba8;return this[_0x446524(0x1cd)](_0x446524(0x18f),{'alias':_0x3c1de7,'task':_0x2c4077,'priority':_0x4a982d,'from_session':this['alias']});}async[a0_0x207ba8(0x1a2)](_0x924501,_0x27c3f2){const _0x58a9d9=a0_0x207ba8;return this[_0x58a9d9(0x1cd)](_0x58a9d9(0x1d3),{'alias':_0x924501,'message':_0x27c3f2,'from_session':this[_0x58a9d9(0x1c5)]});}async[a0_0x207ba8(0x19a)](_0x13af1d,_0x333ba2,_0x534fc4=a0_0x207ba8(0x1bc)){const _0x47b3d6=a0_0x207ba8;return this[_0x47b3d6(0x1cd)](_0x47b3d6(0x1de),{'in_reply_to':_0x13af1d,'text':_0x333ba2,'status':_0x534fc4});}async[a0_0x207ba8(0x18a)](_0x4988c9,_0x4b4fc5){const _0x3a3c64=a0_0x207ba8;return this[_0x3a3c64(0x1cd)]('report_status',{'resume_id':this['resumeId'],'alias':this[_0x3a3c64(0x1c5)],'status':_0x4988c9,'server':a0_0x3e26be(),'hostname':a0_0x3e26be(),'agent':this[_0x3a3c64(0x1a6)],'project_dir':process['cwd'](),..._0x4b4fc5});}async[a0_0x207ba8(0x1aa)](){const _0x115b02=a0_0x207ba8;return this[_0x115b02(0x1cd)](_0x115b02(0x1a9),{});}async['broadcast'](_0x5f3666,_0x1c5ed2){const _0x1ad14f=a0_0x207ba8;return this['call']('broadcast',{'message':_0x5f3666,'filter_server':_0x1c5ed2?.[_0x1ad14f(0x1ad)],'filter_status':_0x1c5ed2?.[_0x1ad14f(0x18a)]});}async[a0_0x207ba8(0x18b)](){const _0x27c5d5=a0_0x207ba8;let _0x1bb9ae=encodeURIComponent(this[_0x27c5d5(0x1c5)]),_0x217b7d=this[_0x27c5d5(0x1a5)]+_0x27c5d5(0x1d1)+_0x1bb9ae,_0x5143cd=this[_0x27c5d5(0x1d4)];while(this[_0x27c5d5(0x1c1)]){try{this[_0x27c5d5(0x1a3)]=new AbortController();let _0x39eec6={'Accept':_0x27c5d5(0x19b)};if(this['token'])_0x39eec6[_0x27c5d5(0x1b2)]=_0x27c5d5(0x1a8)+this[_0x27c5d5(0x191)];let _0x4dde27=await fetch(_0x217b7d,{'headers':_0x39eec6,'signal':this[_0x27c5d5(0x1a3)][_0x27c5d5(0x1ca)]});if(!_0x4dde27['ok']||!_0x4dde27[_0x27c5d5(0x1be)]){this[_0x27c5d5(0x19e)](_0x27c5d5(0x1bb)+_0x4dde27[_0x27c5d5(0x18a)]),await this[_0x27c5d5(0x1d9)](_0x5143cd),_0x5143cd=Math[_0x27c5d5(0x1d7)](_0x5143cd*1.5,0xea60);continue;}_0x5143cd=this[_0x27c5d5(0x1d4)];let _0xfa0403=_0x4dde27[_0x27c5d5(0x1be)][_0x27c5d5(0x1a0)](),_0x2b27ea=new TextDecoder(),_0x2043e9='';while(this[_0x27c5d5(0x1c1)]){let {done:_0x82e737,value:_0x508446}=await _0xfa0403[_0x27c5d5(0x1df)]();if(_0x82e737)break;_0x2043e9+=_0x2b27ea['decode'](_0x508446,{'stream':!0x0});let _0x49d281=_0x2043e9[_0x27c5d5(0x1c0)]('\x0a');_0x2043e9=_0x49d281[_0x27c5d5(0x192)]()||'';for(let _0x256ab3 of _0x49d281){if(!_0x256ab3['startsWith']('data:\x20'))continue;try{let _0x26221f=JSON[_0x27c5d5(0x1dc)](_0x256ab3[_0x27c5d5(0x1b8)](0x6));if(_0x26221f[_0x27c5d5(0x18e)]==='connected'){this[_0x27c5d5(0x19e)]('SSE\x20connected'),this[_0x27c5d5(0x1a7)](_0x27c5d5(0x1c2));continue;}if(_0x26221f[_0x27c5d5(0x18e)]===_0x27c5d5(0x1b6)||_0x26221f['type']===_0x27c5d5(0x19f)||_0x26221f['type']===_0x27c5d5(0x1bf))await this[_0x27c5d5(0x193)]();}catch{}}}}catch(_0x227bc3){if(_0x227bc3[_0x27c5d5(0x1db)]===_0x27c5d5(0x1d2))break;this[_0x27c5d5(0x1a7)](_0x27c5d5(0x1ab),_0x227bc3),this[_0x27c5d5(0x19e)](_0x27c5d5(0x1da)+_0x227bc3[_0x27c5d5(0x1a2)]);}if(this['running'])this[_0x27c5d5(0x1a7)](_0x27c5d5(0x194)),this[_0x27c5d5(0x19e)](_0x27c5d5(0x1c6)+_0x5143cd/0x3e8+_0x27c5d5(0x1d8)),await this[_0x27c5d5(0x1d9)](_0x5143cd),_0x5143cd=Math[_0x27c5d5(0x1d7)](_0x5143cd*1.5,0xea60);}}async[a0_0x207ba8(0x193)](){const _0x16d6b1=a0_0x207ba8;try{let _0x1cc421=(await this[_0x16d6b1(0x1cd)](_0x16d6b1(0x1c8),{'alias':this[_0x16d6b1(0x1c5)],'limit':0xa}))?.['messages']||[];for(let _0x529c6d of _0x1cc421)await this['call'](_0x16d6b1(0x1af),{'alias':this[_0x16d6b1(0x1c5)],'message_id':_0x529c6d['id']}),this['log']('←\x20'+_0x529c6d[_0x16d6b1(0x1cc)]+':\x20'+_0x529c6d['content'][_0x16d6b1(0x1b8)](0x0,0x3c)),this[_0x16d6b1(0x1a7)]('task',_0x529c6d),this[_0x16d6b1(0x1a7)]('message',_0x529c6d);}catch(_0x1011f4){this[_0x16d6b1(0x19e)](_0x16d6b1(0x1cb)+_0x1011f4[_0x16d6b1(0x1a2)]);}}[a0_0x207ba8(0x1d9)](_0x2fd696){return new Promise(_0x455c8f=>setTimeout(_0x455c8f,_0x2fd696));}}var $=T;function a0_0xb317(_0x27394e,_0x214bed){_0x27394e=_0x27394e-0x189;const _0x4a6c38=a0_0x4a6c();let _0xb317a0=_0x4a6c38[_0x27394e];return _0xb317a0;}export{$ as default,T as CommHub};
|
|
1
|
+
const a0_0xf3c5e9=a0_0x2d5d;function a0_0x47d7(){const _0x697288=['task.ack','send_message','type','\x20error=','task.send.failed','\x20to=','body','AbortError','9448341nYALbi','idle','send_task','cwd','<unknown>','json','result','task.started','send_failed','lifecycleTracking','heartbeatInterval','stringify','connectSSE','alias','string','inbox\x20error:\x20','toTimeString','offline','heartbeatTimer','<pending>','task','url','report_status','reconnectDelay','614248rdtapu','application/json','task_id','catch','sdk-','connected','sseAbort','transport','unknown\x20error','failed',']\x20[commhub:','read','emit','processInbox','574FPMAMP','pop','error_code','message','match','get_all_status','SSE\x20connected','heartbeat\x20failed:\x20','getAllStatus','ack_inbox','[REDACTED]','\x20network_id=','status','startsWith','log','new_message','broadcast','SSE\x20error:\x20','parentTaskId','\x20task_id=','new_task','now','registered','SSE\x20failed:\x20','replace','autoConnect','name','fromAlias','/mcp','connect','agent','duration_ms','delivered','application/json,\x20text/event-stream','disconnect','get_inbox','sleep','mcp_http','networkId','text','send_reply','2459XSqmyn','toString','27139984GbvYuf','Bearer\x20','2.0','token','call','message_id','\x20lifecycle=','signal','getReader','completed','not_tracked','tools/call','Authorization','abort','send','text/event-stream','resumeId','parse','sdk','\x20parent_task_id=','disconnected','7641702zHEBZr','server','decode','reply','task.send.start','running','1596005xWMCYl','error_message','messages','split','4129902HvnzpC','slice','to_alias','error','SSE\x20reconnecting\x20in\x20','task.expired','parent_task_id','send_rejected','\x20transport='];a0_0x47d7=function(){return _0x697288;};return a0_0x47d7();}(function(_0x519baf,_0x19bc32){const _0x44da6c=a0_0x2d5d,_0x1c6c0d=_0x519baf();while(!![]){try{const _0x294412=parseInt(_0x44da6c(0x180))/0x1*(-parseInt(_0x44da6c(0x157))/0x2)+-parseInt(_0x44da6c(0x120))/0x3+-parseInt(_0x44da6c(0x149))/0x4+-parseInt(_0x44da6c(0x11c))/0x5+parseInt(_0x44da6c(0x116))/0x6+-parseInt(_0x44da6c(0x131))/0x7+parseInt(_0x44da6c(0x182))/0x8;if(_0x294412===_0x19bc32)break;else _0x1c6c0d['push'](_0x1c6c0d['shift']());}catch(_0x56aa82){_0x1c6c0d['push'](_0x1c6c0d['shift']());}}}(a0_0x47d7,0xb9d86));function a0_0x2d5d(_0x897c99,_0x2f95da){_0x897c99=_0x897c99-0x104;const _0x47d7fa=a0_0x47d7();let _0x2d5d46=_0x47d7fa[_0x897c99];return _0x2d5d46;}import{EventEmitter as a0_0x1b9ac9}from'events';import{hostname as a0_0x34540d}from'os';var K=/(?:atok|ntok|utok|ghp|github_pat)_[A-Za-z0-9_-]+|Bearer\s+\S+/gi,L=(_0xdff4c,_0x5550c7)=>(_0xdff4c??_0x5550c7)[a0_0xf3c5e9(0x16f)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[a0_0xf3c5e9(0x121)](0x0,0xf0);function N(_0x166a59){const _0x3afda0=a0_0xf3c5e9;return(_0x166a59 instanceof Error?_0x166a59[_0x3afda0(0x15a)]:String(_0x166a59??_0x3afda0(0x151)))[_0x3afda0(0x16f)](K,_0x3afda0(0x161))[_0x3afda0(0x16f)](/[\r\n\x00-\x1f\x7f]/g,'\x20')[_0x3afda0(0x121)](0x0,0xf0);}function O(_0x18c641,_0x5b45bd=process.env.ANET_TASK_TRACE_FORMAT===a0_0xf3c5e9(0x136)){const _0x7a026e=a0_0xf3c5e9;if(_0x5b45bd)return JSON[_0x7a026e(0x13c)](_0x18c641);let _0x50e314=L(_0x18c641[_0x7a026e(0x126)],'<missing>'),_0x150f44=L(_0x18c641['task_id'],_0x7a026e(0x144)),_0x3efa61=_0x18c641[_0x7a026e(0x159)]?_0x7a026e(0x12c)+_0x18c641[_0x7a026e(0x159)]+':'+(_0x18c641[_0x7a026e(0x11d)]??''):'';return'[commhub:task]\x20'+_0x18c641[_0x7a026e(0x163)]+'\x20from='+L(_0x18c641['from_alias'],_0x7a026e(0x135))+_0x7a026e(0x12e)+L(_0x18c641[_0x7a026e(0x122)],_0x7a026e(0x135))+_0x7a026e(0x16a)+_0x150f44+_0x7a026e(0x114)+_0x50e314+_0x7a026e(0x162)+L(_0x18c641['network_id'],'<unknown>')+_0x7a026e(0x128)+_0x18c641[_0x7a026e(0x150)]+'\x20duration_ms='+_0x18c641[_0x7a026e(0x176)]+_0x7a026e(0x107)+_0x18c641['lifecycle_tracking']+_0x3efa61;}function U(_0x2e6619){const _0x4b5c6a=a0_0xf3c5e9;return{'event':{'sending':_0x4b5c6a(0x11a),'delivered':'task.send.delivered','failed':_0x4b5c6a(0x12d),'acked':_0x4b5c6a(0x129),'started':_0x4b5c6a(0x138),'replied':'task.replied','expired':_0x4b5c6a(0x125)}[_0x2e6619[_0x4b5c6a(0x163)]],..._0x2e6619};}function j(_0x2dcdf8){const _0x1560af=a0_0xf3c5e9;let _0x4a17c5=_0x2dcdf8?.[_0x1560af(0x14b)]||_0x2dcdf8?.[_0x1560af(0x106)]||_0x2dcdf8?.['id'];if(_0x4a17c5)return String(_0x4a17c5);let _0x1e47b4=_0x2dcdf8?.['content']?.[0x0]?.['text'];if(typeof _0x1e47b4!==_0x1560af(0x13f))return null;try{let _0x10f87e=JSON['parse'](_0x1e47b4);return _0x10f87e?.[_0x1560af(0x14b)]||_0x10f87e?.[_0x1560af(0x106)]||_0x10f87e?.['id']||null;}catch{return null;}}async function X(_0x98019b,_0x368bff){const _0x369a9a=a0_0xf3c5e9;let _0x229c26=_0x368bff[_0x369a9a(0x16c)]??Date[_0x369a9a(0x16c)],_0x2d4f77=_0x229c26(),_0x597bc7=(_0x51ba24,_0x79448b,_0x353439,_0x3a8062)=>{const _0x4fee3c=_0x369a9a;_0x368bff['log'](O(U({'from_alias':_0x98019b[_0x4fee3c(0x172)],'to_alias':_0x98019b['toAlias'],'task_id':_0x79448b,'parent_task_id':_0x98019b['parentTaskId'],'network_id':_0x98019b[_0x4fee3c(0x17d)],'transport':_0x98019b[_0x4fee3c(0x150)],'status':_0x51ba24,'duration_ms':_0x229c26()-_0x2d4f77,'lifecycle_tracking':_0x98019b[_0x4fee3c(0x13a)],..._0x353439!==void 0x0?{'error_code':_0x3a8062||_0x4fee3c(0x139),'error_message':N(_0x353439)}:{}})));};_0x597bc7('sending',null);try{let _0x41f60a=await _0x368bff[_0x369a9a(0x10f)](),_0x16590d=j(_0x41f60a);if(_0x16590d)_0x597bc7(_0x369a9a(0x177),_0x16590d);else{if(_0x41f60a?.['ok']===!0x1||_0x41f60a?.[_0x369a9a(0x123)])_0x597bc7(_0x369a9a(0x152),_0x16590d,_0x41f60a?.[_0x369a9a(0x123)]||'CommHub\x20rejected\x20task',_0x369a9a(0x127));else _0x597bc7(_0x369a9a(0x152),null,'CommHub\x20response\x20omitted\x20task_id','missing_task_id');}return _0x41f60a;}catch(_0x1ec0c9){throw _0x597bc7(_0x369a9a(0x152),null,_0x1ec0c9,'send_failed'),_0x1ec0c9;}}async function Y(_0x1ffab3,_0xaa9d9c){const _0x2500bd=a0_0xf3c5e9;return X({'fromAlias':_0x1ffab3[_0x2500bd(0x172)],'toAlias':_0x1ffab3[_0x2500bd(0x13e)],'parentTaskId':_0x1ffab3[_0x2500bd(0x169)]||null,'networkId':_0x1ffab3['networkId']||null,'transport':_0x2500bd(0x17c),'lifecycleTracking':_0x2500bd(0x10b)},_0xaa9d9c);}class $ extends a0_0x1b9ac9{[a0_0xf3c5e9(0x146)];['alias'];[a0_0xf3c5e9(0x104)];[a0_0xf3c5e9(0x175)];[a0_0xf3c5e9(0x111)];[a0_0xf3c5e9(0x13b)];[a0_0xf3c5e9(0x148)];[a0_0xf3c5e9(0x143)];['sseAbort'];[a0_0xf3c5e9(0x11b)]=!0x1;constructor(_0x252871){const _0x222e67=a0_0xf3c5e9;super();if(this['url']=_0x252871[_0x222e67(0x146)][_0x222e67(0x16f)](/\/$/,''),this[_0x222e67(0x13e)]=_0x252871[_0x222e67(0x13e)],this[_0x222e67(0x104)]=_0x252871[_0x222e67(0x104)],this[_0x222e67(0x175)]=_0x252871['agent']||_0x222e67(0x113),this['resumeId']=_0x222e67(0x14d)+_0x252871[_0x222e67(0x13e)]+'-'+Date[_0x222e67(0x16c)]()[_0x222e67(0x181)](0x24),this[_0x222e67(0x13b)]=_0x252871[_0x222e67(0x13b)]??0x2bf20,this[_0x222e67(0x148)]=_0x252871[_0x222e67(0x148)]??0xbb8,_0x252871[_0x222e67(0x170)]!==!0x1)this[_0x222e67(0x174)]();}[a0_0xf3c5e9(0x165)](_0x516e16){const _0x176a3f=a0_0xf3c5e9;console[_0x176a3f(0x165)]('['+new Date()[_0x176a3f(0x141)]()[_0x176a3f(0x121)](0x0,0x8)+_0x176a3f(0x153)+this['alias']+']\x20'+_0x516e16);}async[a0_0xf3c5e9(0x105)](_0x13f657,_0x5ec450){const _0x5d346a=a0_0xf3c5e9;let _0x54b3b1={'Content-Type':_0x5d346a(0x14a),'Accept':_0x5d346a(0x178)};if(this[_0x5d346a(0x104)])_0x54b3b1[_0x5d346a(0x10d)]=_0x5d346a(0x183)+this[_0x5d346a(0x104)];let _0x57b3bf=await(await fetch(this[_0x5d346a(0x146)]+_0x5d346a(0x173),{'method':'POST','headers':_0x54b3b1,'body':JSON[_0x5d346a(0x13c)]({'jsonrpc':_0x5d346a(0x184),'id':Date[_0x5d346a(0x16c)](),'method':_0x5d346a(0x10c),'params':{'name':_0x13f657,'arguments':_0x5ec450}})}))[_0x5d346a(0x17e)](),_0x4278f7=_0x57b3bf[_0x5d346a(0x15b)](/data: (.+)/),_0x50c98a=_0x4278f7?JSON[_0x5d346a(0x112)](_0x4278f7[0x1]):JSON['parse'](_0x57b3bf),_0x50569d=_0x50c98a?.[_0x5d346a(0x137)]?.['content']?.[0x0]?.[_0x5d346a(0x17e)];return _0x50569d?JSON[_0x5d346a(0x112)](_0x50569d):_0x50c98a;}async[a0_0xf3c5e9(0x174)](){const _0x4d0016=a0_0xf3c5e9;if(this[_0x4d0016(0x11b)])return;this[_0x4d0016(0x11b)]=!0x0,await this[_0x4d0016(0x163)]('idle'),this[_0x4d0016(0x165)](_0x4d0016(0x16d)),this[_0x4d0016(0x143)]=setInterval(()=>{const _0x295463=_0x4d0016;this['status'](_0x295463(0x132))[_0x295463(0x14c)](_0x50c25b=>this[_0x295463(0x165)](_0x295463(0x15e)+_0x50c25b['message']));},this['heartbeatInterval']),this[_0x4d0016(0x13d)]();}async[a0_0xf3c5e9(0x179)](){const _0x52628e=a0_0xf3c5e9;if(this[_0x52628e(0x11b)]=!0x1,this['sseAbort']?.[_0x52628e(0x10e)](),this['heartbeatTimer'])clearInterval(this[_0x52628e(0x143)]);await this['status'](_0x52628e(0x142))[_0x52628e(0x14c)](()=>{}),this[_0x52628e(0x165)](_0x52628e(0x115));}async[a0_0xf3c5e9(0x10f)](_0x35276f,_0x3dd7eb,_0x238bf1='normal'){const _0x268c79=a0_0xf3c5e9;return Y({'alias':_0x35276f,'fromAlias':this[_0x268c79(0x13e)]},{'log':_0x165f20=>console['log'](_0x165f20),'send':()=>this[_0x268c79(0x105)](_0x268c79(0x133),{'alias':_0x35276f,'task':_0x3dd7eb,'priority':_0x238bf1,'from_session':this[_0x268c79(0x13e)]})});}async[a0_0xf3c5e9(0x15a)](_0x14003c,_0x504b73){const _0x237dc3=a0_0xf3c5e9;return this[_0x237dc3(0x105)](_0x237dc3(0x12a),{'alias':_0x14003c,'message':_0x504b73,'from_session':this[_0x237dc3(0x13e)]});}async[a0_0xf3c5e9(0x119)](_0x79aa8c,_0x584b6f,_0x619fc6=a0_0xf3c5e9(0x10a)){const _0xc23dcf=a0_0xf3c5e9;return this[_0xc23dcf(0x105)](_0xc23dcf(0x17f),{'in_reply_to':_0x79aa8c,'text':_0x584b6f,'status':_0x619fc6});}async[a0_0xf3c5e9(0x163)](_0xea17a0,_0x50eaf4){const _0x3f4ec8=a0_0xf3c5e9;return this['call'](_0x3f4ec8(0x147),{'resume_id':this[_0x3f4ec8(0x111)],'alias':this[_0x3f4ec8(0x13e)],'status':_0xea17a0,'server':a0_0x34540d(),'hostname':a0_0x34540d(),'agent':this[_0x3f4ec8(0x175)],'project_dir':process[_0x3f4ec8(0x134)](),..._0x50eaf4});}async[a0_0xf3c5e9(0x15f)](){const _0x303f0f=a0_0xf3c5e9;return this[_0x303f0f(0x105)](_0x303f0f(0x15c),{});}async['broadcast'](_0x415428,_0x320542){const _0x31becd=a0_0xf3c5e9;return this[_0x31becd(0x105)]('broadcast',{'message':_0x415428,'filter_server':_0x320542?.[_0x31becd(0x117)],'filter_status':_0x320542?.['status']});}async[a0_0xf3c5e9(0x13d)](){const _0x54405c=a0_0xf3c5e9;let _0x1e8236=encodeURIComponent(this[_0x54405c(0x13e)]),_0x46ada4=this['url']+'/events/'+_0x1e8236,_0x55758a=this[_0x54405c(0x148)];while(this[_0x54405c(0x11b)]){try{this[_0x54405c(0x14f)]=new AbortController();let _0x230f6c={'Accept':_0x54405c(0x110)};if(this[_0x54405c(0x104)])_0x230f6c[_0x54405c(0x10d)]=_0x54405c(0x183)+this['token'];let _0x455c8a=await fetch(_0x46ada4,{'headers':_0x230f6c,'signal':this[_0x54405c(0x14f)][_0x54405c(0x108)]});if(!_0x455c8a['ok']||!_0x455c8a[_0x54405c(0x12f)]){this['log'](_0x54405c(0x16e)+_0x455c8a[_0x54405c(0x163)]),await this[_0x54405c(0x17b)](_0x55758a),_0x55758a=Math['min'](_0x55758a*1.5,0xea60);continue;}_0x55758a=this[_0x54405c(0x148)];let _0x34cb41=_0x455c8a[_0x54405c(0x12f)][_0x54405c(0x109)](),_0x4c3f47=new TextDecoder(),_0x198604='';while(this['running']){let {done:_0x387774,value:_0x3944a9}=await _0x34cb41[_0x54405c(0x154)]();if(_0x387774)break;_0x198604+=_0x4c3f47[_0x54405c(0x118)](_0x3944a9,{'stream':!0x0});let _0x334582=_0x198604[_0x54405c(0x11f)]('\x0a');_0x198604=_0x334582[_0x54405c(0x158)]()||'';for(let _0x5547b2 of _0x334582){if(!_0x5547b2[_0x54405c(0x164)]('data:\x20'))continue;try{let _0x46c508=JSON['parse'](_0x5547b2['slice'](0x6));if(_0x46c508[_0x54405c(0x12b)]===_0x54405c(0x14e)){this['log'](_0x54405c(0x15d)),this[_0x54405c(0x155)](_0x54405c(0x14e));continue;}if(_0x46c508['type']===_0x54405c(0x16b)||_0x46c508[_0x54405c(0x12b)]===_0x54405c(0x166)||_0x46c508[_0x54405c(0x12b)]===_0x54405c(0x167))await this[_0x54405c(0x156)]();}catch{}}}}catch(_0x37454f){if(_0x37454f[_0x54405c(0x171)]===_0x54405c(0x130))break;this['emit'](_0x54405c(0x123),_0x37454f),this['log'](_0x54405c(0x168)+_0x37454f[_0x54405c(0x15a)]);}if(this[_0x54405c(0x11b)])this[_0x54405c(0x155)](_0x54405c(0x115)),this[_0x54405c(0x165)](_0x54405c(0x124)+_0x55758a/0x3e8+'s...'),await this[_0x54405c(0x17b)](_0x55758a),_0x55758a=Math['min'](_0x55758a*1.5,0xea60);}}async[a0_0xf3c5e9(0x156)](){const _0x15013e=a0_0xf3c5e9;try{let _0x821095=(await this[_0x15013e(0x105)](_0x15013e(0x17a),{'alias':this[_0x15013e(0x13e)],'limit':0xa}))?.[_0x15013e(0x11e)]||[];for(let _0xc4983b of _0x821095)await this[_0x15013e(0x105)](_0x15013e(0x160),{'alias':this[_0x15013e(0x13e)],'message_id':_0xc4983b['id']}),this[_0x15013e(0x165)]('←\x20'+_0xc4983b['from_session']+':\x20'+_0xc4983b['content']['slice'](0x0,0x3c)),this[_0x15013e(0x155)](_0x15013e(0x145),_0xc4983b),this['emit'](_0x15013e(0x15a),_0xc4983b);}catch(_0x5d6d9d){this[_0x15013e(0x165)](_0x15013e(0x140)+_0x5d6d9d['message']);}}[a0_0xf3c5e9(0x17b)](_0x48c690){return new Promise(_0x20f938=>setTimeout(_0x20f938,_0x48c690));}}var F=$;export{F as default,$ as CommHub};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** A prefix is hex digits and dashes. Shorter than this matches too much to be a deliberate choice. */
|
|
2
|
+
export declare const MIN_THREAD_PREFIX = 4;
|
|
3
|
+
export interface ExternalThread {
|
|
4
|
+
readonly threadId: string;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly bytes: number;
|
|
7
|
+
readonly inode: number | bigint;
|
|
8
|
+
readonly mtimeMs: number;
|
|
9
|
+
/** session_meta timestamp (falls back to the file's mtime when missing). */
|
|
10
|
+
readonly startedAt: string;
|
|
11
|
+
readonly cwd: string | null;
|
|
12
|
+
readonly firstPrompt: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** The first thing the human typed: event_msg user_message, else a user message item that is not injected context. */
|
|
15
|
+
export declare function firstPromptOf(lines: readonly string[]): string | null;
|
|
16
|
+
export declare function threadFactsOf(path: string, threadId: string, mtimeMs: number, headBytes?: number): {
|
|
17
|
+
startedAt: string;
|
|
18
|
+
cwd: string | null;
|
|
19
|
+
firstPrompt: string | null;
|
|
20
|
+
};
|
|
21
|
+
/** Every rollout under `<codexHome>/sessions` (read-only), newest first. */
|
|
22
|
+
export declare function listExternalThreads(codexHome: string): ExternalThread[];
|
|
23
|
+
export type ThreadResolution = {
|
|
24
|
+
kind: "ok";
|
|
25
|
+
thread: ExternalThread;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "invalid";
|
|
28
|
+
reason: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "none";
|
|
31
|
+
}
|
|
32
|
+
/** The prefix names more than one thread. */
|
|
33
|
+
| {
|
|
34
|
+
kind: "ambiguous";
|
|
35
|
+
matches: readonly ExternalThread[];
|
|
36
|
+
}
|
|
37
|
+
/** One thread id, but more than one rollout file carries it — which one is the conversation is a guess. */
|
|
38
|
+
| {
|
|
39
|
+
kind: "duplicate";
|
|
40
|
+
matches: readonly ExternalThread[];
|
|
41
|
+
};
|
|
42
|
+
export declare function resolveExternalThread(threads: readonly ExternalThread[], query: string): ThreadResolution;
|
|
43
|
+
/** Shortest prefix (≥ minLen) of each id that no other id in the list shares. */
|
|
44
|
+
export declare function shortIds(ids: readonly string[], minLen?: number): Map<string, string>;
|
|
45
|
+
/** Numbered table for the picker / the non-TTY listing. Local time is not used: the stamp is the UTC one codex wrote. */
|
|
46
|
+
export declare function formatThreadList(threads: readonly ExternalThread[], limit?: number): string[];
|