@kanyun-ai-infra/agenthub 1.8.0 → 1.9.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 +9 -9
- package/dist/index.cjs +5111 -3009
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +479 -28
- package/dist/index.d.ts +479 -28
- package/dist/index.js +5017 -2917
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skills/agenthub-sdk/SKILL.md +39 -14
package/README.md
CHANGED
|
@@ -50,12 +50,10 @@ const agenthub = new PilotPlatformClient({
|
|
|
50
50
|
// controlPlaneUrl 可省略——默认打线上地址;打 test 等环境再显式传(或设 PILOT_CONTROL_PLANE_URL)。
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
// 1. Project:租户 /
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
defaultRuntimeTemplateRefName: "pilot-v2-pod-agent",
|
|
58
|
-
});
|
|
53
|
+
// 1. Project:租户 / 根分组。模型服务按 Project 归属、目前只能在门户「凭证与集成」→「模型服务」
|
|
54
|
+
// 里配,所以这里用一个已经配好模型服务的 Project。新建用 agenthub.projects.create({ slug,
|
|
55
|
+
// displayName, defaultRuntimeTemplateRefName }),建完先去门户给它配一套模型服务。
|
|
56
|
+
const project = await agenthub.projects.get("<已配好模型服务的 Project id>");
|
|
59
57
|
|
|
60
58
|
// 2. Agent:Project 下一个可运行的 agent。
|
|
61
59
|
await agenthub.agents.create({
|
|
@@ -64,7 +62,6 @@ await agenthub.agents.create({
|
|
|
64
62
|
displayName: "Support Bot",
|
|
65
63
|
kind: "managed_agent",
|
|
66
64
|
defaults: {
|
|
67
|
-
model: "claude-opus-4-7",
|
|
68
65
|
systemPrompt: "You are the Acme support agent.",
|
|
69
66
|
agentPackage: {
|
|
70
67
|
format: "claude_code",
|
|
@@ -87,7 +84,10 @@ const version = await agenthub.agents.publishVersion({
|
|
|
87
84
|
workerContract: { kind: "managed_agent" },
|
|
88
85
|
setDefault: true,
|
|
89
86
|
managedAgentProfileSnapshot: {
|
|
90
|
-
|
|
87
|
+
// 模型服务必填:没声明模型服务的 Agent 建不出会话(SESSION_LLM_PROVIDER_REQUIRED)。
|
|
88
|
+
// 填这个 Project 那套模型服务的 publicId(llmp_ 开头,门户列表里复制)。
|
|
89
|
+
// model 省略 = 用该模型服务声明的默认档位。
|
|
90
|
+
llmProviderRef: "llmp_xxxxxxxxxxxxxxxx",
|
|
91
91
|
systemPrompt: "You are the Acme support agent.",
|
|
92
92
|
},
|
|
93
93
|
});
|
|
@@ -192,7 +192,7 @@ App 里点的"对";`purge(projectId, { subjectKind, subjectId })` 按主体清
|
|
|
192
192
|
| --- | --- |
|
|
193
193
|
| `usage` | 模型用量(`inputTokens` / `outputTokens` / `totalTokens` 等)。其中 `costUsd` 是 Claude Code CLI **自报的列表价估算**(`costSource === "claude_code_cli"`),不是账单实付;`failed` / `aborted` 轮次没有 `usage`(T-INV-13)。`completed` 轮次也可能缺省——用量数据没通过校验时字段不落,并在该轮 `anomalies` 里记 `usage_parse_failed`。 |
|
|
194
194
|
| `traceId` | 这一轮的分布式 trace id(`string \| null`),可拼 Octopus trace-explorer 深链定位整条链路(agenthub → control-worker → agent-worker)。 |
|
|
195
|
-
| `memoryRecall.state` | **只在会话首轮出现**——设计如此,不是版本或故障问题:读服务只给首轮投影这个字段(`session-turns-read-service.ts` 的 `core.turnId === enrichment.firstTurnId` 判据),第 2 轮起 `memoryRecall` 恒为 `undefined`,即便服务端是最新版。值是这一轮的**记忆召回状态**枚举,不是召回内容:`selected`(召回并注入了条目)/ `empty`(功能开着、也查了,本轮无可注入记忆)/ `recall_failed`(召回过程失败)/ `unavailable`(回读时没能解出召回快照)/ `legacy
|
|
195
|
+
| `memoryRecall.state` | **只在会话首轮出现**——设计如此,不是版本或故障问题:读服务只给首轮投影这个字段(`session-turns-read-service.ts` 的 `core.turnId === enrichment.firstTurnId` 判据),第 2 轮起 `memoryRecall` 恒为 `undefined`,即便服务端是最新版。值是这一轮的**记忆召回状态**枚举,不是召回内容:`selected`(召回并注入了条目)/ `empty`(功能开着、也查了,本轮无可注入记忆)/ `recall_failed`(召回过程失败)/ `unavailable`(回读时没能解出召回快照)/ `legacy`(会话早于记忆机制,无快照)。目前只对外暴露状态,不含召回内容。 |
|
|
196
196
|
|
|
197
197
|
三个字段都是可选/可空的:`usage` 与 `memoryRecall` 是可选字段,`traceId` 可空、没有
|
|
198
198
|
链路时为 `null`。写消费代码时一律按「缺失」处理,不要假定它们一定存在。
|