重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
migrate-honcho-ts by plastic-labs/honcho
npx skills add https://github.com/plastic-labs/honcho --skill migrate-honcho-ts此技能用于将代码从 @honcho-ai/sdk v1.6.0 迁移至 v2.0.0 版本(适用于 Honcho 3.0.0+)。
主要破坏性变更:
@honcho-ai/core 依赖getConfig/setConfig → getConfiguration/setConfigurationsnake_case → camelCase 命名规范广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
chatStream() 而非 chat({ stream: true })Representation 类(现在直接返回字符串)从 package.json 中移除 @honcho-ai/core。SDK 现在拥有自己的 HTTP 客户端。
.core 替换为 .http// 迁移前
const workspace = await client.core.workspaces.getOrCreate({ id: 'my-workspace' })
// 迁移后
const response = await client.http.post('/v3/workspaces', { body: { id: 'my-workspace' } })
// 迁移前
await honcho.getConfig()
await honcho.setConfig({ key: 'value' })
await peer.getConfig()
await session.getConfig()
// 迁移后
await honcho.getConfiguration()
await honcho.setConfiguration({ reasoning: { enabled: true } })
await peer.getConfiguration()
await session.getConfiguration()
// 迁移前
const peers = await honcho.getPeers()
const sessions = await honcho.getSessions()
const workspaces = await honcho.getWorkspaces() // string[]
// 迁移后
const peers = await honcho.peers()
const sessions = await honcho.sessions()
const workspaces = await honcho.workspaces() // Page<string>
// 迁移前
const stream = await peer.chat('Hello', { stream: true })
// 迁移后
const stream = await peer.chatStream('Hello')
// 迁移前
peer.observations
peer.observationsOf('bob')
maxObservations: 50
includeMostDerived: true
// 迁移后
peer.conclusions
peer.conclusionsOf('bob')
maxConclusions: 50
includeMostFrequent: true
// 迁移前
await honcho.getDeriverStatus({ observer: peer })
await honcho.pollDeriverStatus({ timeoutMs: 60000 }) // 已移除 - 请参阅下方说明
// 迁移后
await honcho.queueStatus({ observer: peer })
// pollDeriverStatus() 没有替代方法 - 请参阅下方说明
重要提示: pollDeriverStatus() 及其轮询模式已被完全移除。不要依赖队列会变空。队列是一个持续处理的系统——新消息可能随时到达,等待"完成"不是一个有效的模式。如果你的代码之前轮询队列完成状态,请重新设计它,使其不再依赖这个假设。
// 迁移前
message.peer_id
message.session_id
message.created_at
message.token_count
{ observe_me: true, observe_others: false }
{ created_at: '2024-01-01' }
// 迁移后
message.peerId
message.sessionId
message.createdAt
message.tokenCount
{ observeMe: true, observeOthers: false }
{ createdAt: '2024-01-01' }
// 迁移前
const rep = await peer.workingRep(session, target, options)
console.log(rep.explicit) // ExplicitObservation[]
console.log(rep.deductive) // DeductiveObservation[]
// 迁移后
const rep = await peer.representation({ session, target, ...options })
console.log(rep) // string
// 迁移前
await honcho.updateMessage(message, metadata, session)
// 迁移后
await session.updateMessage(message, metadata)
| v1.6.0 | v2.0.0 |
|---|---|
client.core | client.http |
getConfig() | getConfiguration() |
setConfig() | setConfiguration() |
getPeers() | peers() |
getSessions() | sessions() |
getWorkspaces() | workspaces() |
getDeriverStatus() | queueStatus() |
pollDeriverStatus() | 已移除 - 请勿轮询 |
peer.chat(q, { stream: true }) | peer.chatStream(q) |
peer.workingRep() | peer.representation() |
peer.getContext() | peer.context() |
peer.observations | peer.conclusions |
peer.observationsOf() | peer.conclusionsOf() |
session.getPeers() | session.peers() |
session.getMessages() | session.messages() |
session.getSummaries() | session.summaries() |
session.getContext() | session.context() |
session.workingRep() | session.representation() |
session.peerConfig() | session.getPeerConfiguration() |
session.setPeerConfig() | session.setPeerConfiguration() |
{ timeoutMs: 60000 } | { timeout: 60 } |
{ maxObservations: 50 } | { maxConclusions: 50 } |
{ includeMostDerived } | { includeMostFrequent } |
{ lastUserMessage } | { searchQuery } |
{ config: ... } | { configuration: ... } |
message.peer_id | message.peerId |
message.created_at | message.createdAt |
Observation | Conclusion |
ObservationScope | ConclusionScope |
有关每个变更的全面详细信息,请参阅:
import {
HonchoError,
AuthenticationError,
BadRequestError,
NotFoundError,
PermissionDeniedError,
RateLimitError,
ConflictError,
UnprocessableEntityError,
ServerError,
ConnectionError,
TimeoutError
} from '@honcho-ai/sdk'
配置现在具有强类型:
await honcho.setConfiguration({
reasoning: {
enabled: true,
customInstructions: 'Be concise'
},
peerCard: { use: true, create: true },
summary: {
enabled: true,
messagesPerShortSummary: 20,
messagesPerLongSummary: 60
},
dream: { enabled: true }
})
每周安装量
44
代码仓库
GitHub 星标数
1.1K
首次出现
2026年1月28日
安全审计
已安装于
codex43
opencode42
cursor42
github-copilot41
gemini-cli41
kimi-cli40
This skill migrates code from @honcho-ai/sdk v1.6.0 to v2.0.0 (required for Honcho 3.0.0+).
Key breaking changes:
@honcho-ai/core dependency removedgetConfig/setConfig → getConfiguration/setConfigurationsnake_case → camelCase throughoutchatStream() instead of chat({ stream: true })Representation class removed (returns string now)Remove @honcho-ai/core from package.json. The SDK now has its own HTTP client.
.core with .http// Before
const workspace = await client.core.workspaces.getOrCreate({ id: 'my-workspace' })
// After
const response = await client.http.post('/v3/workspaces', { body: { id: 'my-workspace' } })
// Before
await honcho.getConfig()
await honcho.setConfig({ key: 'value' })
await peer.getConfig()
await session.getConfig()
// After
await honcho.getConfiguration()
await honcho.setConfiguration({ reasoning: { enabled: true } })
await peer.getConfiguration()
await session.getConfiguration()
// Before
const peers = await honcho.getPeers()
const sessions = await honcho.getSessions()
const workspaces = await honcho.getWorkspaces() // string[]
// After
const peers = await honcho.peers()
const sessions = await honcho.sessions()
const workspaces = await honcho.workspaces() // Page<string>
// Before
const stream = await peer.chat('Hello', { stream: true })
// After
const stream = await peer.chatStream('Hello')
// Before
peer.observations
peer.observationsOf('bob')
maxObservations: 50
includeMostDerived: true
// After
peer.conclusions
peer.conclusionsOf('bob')
maxConclusions: 50
includeMostFrequent: true
// Before
await honcho.getDeriverStatus({ observer: peer })
await honcho.pollDeriverStatus({ timeoutMs: 60000 }) // REMOVE - see note below
// After
await honcho.queueStatus({ observer: peer })
// pollDeriverStatus() has no replacement - see note below
Important: pollDeriverStatus() and its polling pattern have been removed entirely. Do not rely on the queue ever being empty. The queue is a continuous processing system—new messages may arrive at any time, and waiting for "completion" is not a valid pattern. If your code previously polled for queue completion, redesign it to work without that assumption.
// Before
message.peer_id
message.session_id
message.created_at
message.token_count
{ observe_me: true, observe_others: false }
{ created_at: '2024-01-01' }
// After
message.peerId
message.sessionId
message.createdAt
message.tokenCount
{ observeMe: true, observeOthers: false }
{ createdAt: '2024-01-01' }
// Before
const rep = await peer.workingRep(session, target, options)
console.log(rep.explicit) // ExplicitObservation[]
console.log(rep.deductive) // DeductiveObservation[]
// After
const rep = await peer.representation({ session, target, ...options })
console.log(rep) // string
// Before
await honcho.updateMessage(message, metadata, session)
// After
await session.updateMessage(message, metadata)
| v1.6.0 | v2.0.0 |
|---|---|
client.core | client.http |
getConfig() | getConfiguration() |
setConfig() | setConfiguration() |
getPeers() | peers() |
For comprehensive details on each change, see:
import {
HonchoError,
AuthenticationError,
BadRequestError,
NotFoundError,
PermissionDeniedError,
RateLimitError,
ConflictError,
UnprocessableEntityError,
ServerError,
ConnectionError,
TimeoutError
} from '@honcho-ai/sdk'
Configurations are now strongly typed:
await honcho.setConfiguration({
reasoning: {
enabled: true,
customInstructions: 'Be concise'
},
peerCard: { use: true, create: true },
summary: {
enabled: true,
messagesPerShortSummary: 20,
messagesPerLongSummary: 60
},
dream: { enabled: true }
})
Weekly Installs
44
Repository
GitHub Stars
1.1K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex43
opencode42
cursor42
github-copilot41
gemini-cli41
kimi-cli40
lark-cli 共享规则:飞书资源操作指南与权限配置详解
48,600 周安装
Vitest 测试框架最佳实践指南:断言、模拟与异步测试完整教程
291 周安装
Seedance 2.0 视频提示词生成器 | AI视频生成 | 字节跳动即梦平台多模态创作工具
291 周安装
Segment CDP 客户数据平台使用指南:Analytics.js与Node.js追踪最佳实践
292 周安装
Magic UI与React Bits动画组件库:React动画组件开发与性能优化指南
296 周安装
计算机使用智能体开发指南:感知-推理-行动循环与沙盒环境部署
293 周安装
Docker容器化最佳实践指南:生产就绪容器构建、安全优化与CI/CD部署
291 周安装
getSessions() | sessions() |
getWorkspaces() | workspaces() |
getDeriverStatus() | queueStatus() |
pollDeriverStatus() | Removed - do not poll |
peer.chat(q, { stream: true }) | peer.chatStream(q) |
peer.workingRep() | peer.representation() |
peer.getContext() | peer.context() |
peer.observations | peer.conclusions |
peer.observationsOf() | peer.conclusionsOf() |
session.getPeers() | session.peers() |
session.getMessages() | session.messages() |
session.getSummaries() | session.summaries() |
session.getContext() | session.context() |
session.workingRep() | session.representation() |
session.peerConfig() | session.getPeerConfiguration() |
session.setPeerConfig() | session.setPeerConfiguration() |
{ timeoutMs: 60000 } | { timeout: 60 } |
{ maxObservations: 50 } | { maxConclusions: 50 } |
{ includeMostDerived } | { includeMostFrequent } |
{ lastUserMessage } | { searchQuery } |
{ config: ... } | { configuration: ... } |
message.peer_id | message.peerId |
message.created_at | message.createdAt |
Observation | Conclusion |
ObservationScope | ConclusionScope |