@sleep2agi/agent-network 2.3.0-preview.110 → 2.3.0-preview.112
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/bin/cli.js +2 -2
- package/dist/src/client.js +1 -1
- package/dist/src/node-server-rules-file.d.ts +14 -0
- package/dist/src/node-server.js +7 -7
- package/dist/src/node-skills.d.ts +32 -0
- package/dist/src/opencode-agent-node-pair.d.ts +6 -6
- package/dist/src/rules-file.d.ts +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const SKILL_FILE_MAX_BYTES: number;
|
|
2
|
+
export declare const SKILLS_LIST_MAX = 300;
|
|
3
|
+
export declare const SKILL_DESCRIPTION_MAX = 300;
|
|
4
|
+
export type SkillScope = "project" | "user" | "system";
|
|
5
|
+
export interface SkillRoot {
|
|
6
|
+
/** 绝对目录(只在节点本机使用,不外传)。 */
|
|
7
|
+
dir: string;
|
|
8
|
+
/** 外传的显示前缀,例如 `.claude/skills`、`~/.claude/skills`、`$CODEX_HOME/skills`。 */
|
|
9
|
+
label: string;
|
|
10
|
+
scope: SkillScope;
|
|
11
|
+
}
|
|
12
|
+
export interface SkillContext {
|
|
13
|
+
workDir: string;
|
|
14
|
+
home?: string;
|
|
15
|
+
codexHome?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillSummary {
|
|
18
|
+
name: string;
|
|
19
|
+
scope: SkillScope;
|
|
20
|
+
path_rel: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function isValidSkillName(name: unknown): name is string;
|
|
24
|
+
/** 按优先级(高 → 低)列出某运行时会加载技能的根目录。同名技能以先出现的为准。 */
|
|
25
|
+
export declare function skillRootsForRuntime(runtime: string | null | undefined, ctx: SkillContext): SkillRoot[];
|
|
26
|
+
/** 从 SKILL.md 开头的 YAML frontmatter 取 description(单行 / 引号 / `|` `>` 块)。 */
|
|
27
|
+
export declare function parseSkillDescription(text: string): string;
|
|
28
|
+
export declare function listSkills(runtime: string | null | undefined, ctx: SkillContext): Promise<SkillSummary[]>;
|
|
29
|
+
export interface SkillReadResult extends SkillSummary {
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function readSkill(runtime: string | null | undefined, ctx: SkillContext, name: unknown): Promise<SkillReadResult>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
2
|
-
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.
|
|
3
|
-
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.
|
|
4
|
-
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.
|
|
5
|
-
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.
|
|
6
|
-
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.
|
|
1
|
+
export declare const PAIRED_AGENT_NETWORK_VERSION = "2.3.0-preview.112";
|
|
2
|
+
export declare const PAIRED_AGENT_NODE_VERSION = "2.5.0-preview.85";
|
|
3
|
+
export declare const PAIRED_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.85";
|
|
4
|
+
export declare const OPENCODE_AGENT_NETWORK_VERSION = "2.3.0-preview.112";
|
|
5
|
+
export declare const OPENCODE_AGENT_NODE_VERSION = "2.5.0-preview.85";
|
|
6
|
+
export declare const OPENCODE_AGENT_NODE_SPEC = "@sleep2agi/agent-node@2.5.0-preview.85";
|
|
7
7
|
export type PairedAgentNodeResolution = {
|
|
8
8
|
spec: string;
|
|
9
9
|
args: string[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const RULES_FILE_MAX_BYTES: number;
|
|
2
|
+
export type RulesFileName = "CLAUDE.md" | "AGENTS.md";
|
|
3
|
+
/** claude 节点读 CLAUDE.md,其余运行时(codex / grok / opencode / codex-app-server)读 AGENTS.md。 */
|
|
4
|
+
export declare function rulesFileNameForRuntime(runtime: string | null | undefined): RulesFileName;
|
|
5
|
+
/**
|
|
6
|
+
* 唯一的路径来源。输入里没有任何调用方可控的路径成分;结果再用 dirname
|
|
7
|
+
* 反查一遍,防止将来有人给 workDir 传进带 `..` 的东西。
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveRulesFilePath(workDir: string, runtime: string | null | undefined): string;
|
|
10
|
+
export interface RulesFileReadResult {
|
|
11
|
+
file_name: RulesFileName;
|
|
12
|
+
exists: boolean;
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function readRulesFile(workDir: string, runtime: string | null | undefined): Promise<RulesFileReadResult>;
|
|
16
|
+
export interface RulesFileWriteResult {
|
|
17
|
+
file_name: RulesFileName;
|
|
18
|
+
bytes: number;
|
|
19
|
+
}
|
|
20
|
+
/** 临时文件 + rename,写一半掉电不会留下半个规则文件。 */
|
|
21
|
+
export declare function writeRulesFile(workDir: string, runtime: string | null | undefined, content: unknown): Promise<RulesFileWriteResult>;
|
|
22
|
+
export interface RulesFileRequest {
|
|
23
|
+
request_id: string;
|
|
24
|
+
/** read/write = 规则文件;skills_list/skill_read = 只读技能(node-skills.ts),content 是技能名。 */
|
|
25
|
+
op: "read" | "write" | "skills_list" | "skill_read";
|
|
26
|
+
content?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ProcessRulesFileDeps {
|
|
29
|
+
callCommHub: (method: string, params: Record<string, unknown>) => Promise<any>;
|
|
30
|
+
runtime: string | null | undefined;
|
|
31
|
+
workDir: string;
|
|
32
|
+
log: (msg: string) => void;
|
|
33
|
+
warn: (msg: string) => void;
|
|
34
|
+
/** 技能根目录用;缺省取 os.homedir() / process.env.CODEX_HOME。 */
|
|
35
|
+
home?: string;
|
|
36
|
+
codexHome?: string;
|
|
37
|
+
}
|
|
38
|
+
/** 一次门铃最多处理这么多条,防止 hub 侧异常堆积把节点拖进死循环。 */
|
|
39
|
+
export declare const RULES_FILE_MAX_PER_DOORBELL = 8;
|
|
40
|
+
/**
|
|
41
|
+
* 门铃处理器:拉 pending 请求直到空,每条 ack done / failed。
|
|
42
|
+
* 返回处理条数(测试用)。
|
|
43
|
+
*/
|
|
44
|
+
export declare function processRulesFileRequests(deps: ProcessRulesFileDeps): Promise<number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleep2agi/agent-network",
|
|
3
|
-
"version": "2.3.0-preview.
|
|
3
|
+
"version": "2.3.0-preview.112",
|
|
4
4
|
"description": "AI Agent Network CLI — Local-first multi-agent orchestration across 6 runtimes (Claude Code CLI / Claude Agent SDK / Codex SDK / Codex app-server / Grok Build ACP / OpenCode CLI) and 8+ LLM providers. Apache 2.0.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/client.js",
|