@godspeedai/cognate-profile-harness

中文文档
0.10.0发布于 2026/11/16Apache-2.0ES Module构建来源已验证近 30 天下载 3233

调用参考简介:模型提供者,工具注册,代理循环,会话,存储,技能,调度,沙盒,可替换服务,子代理(spec §29.2). 无内核添加.

中文使用文档
文档目录6 节
  1. 安装
  2. 快开始
  3. 绳子是怎样的
  4. 限制
  5. 相关软件包
  6. 许可证

@godspideai/cognate-profile-harness (英语)

Harness参考简介:一个即时运行的自主代理——模型提供者,工具注册,代理循环,会话,耐用键值存储,技能,调度器,代码沙盒,以及子代理——完全由现有的运行时原始人组成. 没有新的内核机械.

安全警报. 此配置文件的参考配置授权 每个 能力援引和 每个 动作:其政策默认是允许的,不能通过选项收紧。 这是本地单一用户设置的参考和演示工具。 不要让它暴露在无人信任的呼叫者或网络中. 就实际部署而言,以 @godspeedai/cognate-runtime-bun 直接通过自己的 policy 财务报告和审定财务报表 actions 改为 createRuntime。 。 。 .

何时使用此软件包 : 您想要一个工作自主循环(模型选择工具,工具运行,循环持续到解答),持久会话和排程运行,沙盒代码执行,以及父/子子子代理组成——在编组自己之前运行作为-is或研究. 关于交互式聊天副驾驶,参见 @godspeedai/cognate-profile-copilot。 。 。 .

安装

bun add @godspeedai/cognate-profile-harness

要求数 阿宝 1.4.0 (沙盒产卵) bun -e 子进程)。 继续 @godspeedai/cognate-runtime-bun, (中文(简体) ), @godspeedai/cognate-capabilities,以及 @godspeedai/cognate-kernel-api。 。 。 .

快开始

import {
  createHarness,
  providerComponent,
  toolComponent,
} from "@godspeedai/cognate-profile-harness";
import { openAICompatible } from "@godspeedai/cognate-provider-openai-compatible";

const harness = await createHarness({
  store: "./harness.sqlite", // durable runs, sessions, schedules, and kv records
  instructions: "You are a build assistant.",
  maxSteps: 8, // model/tool iterations per run
});

// Mount a model provider (replaceable live: dispose one, mount another).
await harness.mount(providerComponent(
  openAICompatible({ id: "main", baseURL: process.env.MODEL_BASE_URL!, model: "my-model", apiKey: () => process.env.MODEL_API_KEY! }),
));

// Mount a tool; the loop discovers it from the registry on the next run.
await harness.mount(toolComponent({
  name: "reverse",
  description: "Reverse a string",
  inputSchema: { type: "object" },
  handler: (input) => ({ reversed: [...String((input as { text: string }).text)].reverse().join("") }),
}));

const runId = await harness.send("session-1", "please reverse this");
// ... the run executes; poll or subscribe for completion
const runs = await harness.session("session-1"); // [{ runId, status, output }]
await harness.close();

绳子是怎样的

关切行为
代理循环agent.loop 电话 model.generate,执行从活式登记册中请求的工具,反馈结果,并在模型解答时停止(由 maxSteps(中文(简体) )
工具登记toolComponent 挂载一个工具; skillComponent 挂载一个命名的捆绑; 工具在组件挂载和处置时显示/消失, 工具可以声明能力 requires 所以它等待着它的依附
会议send(sessionId, message) 启动关联运行 session:<id>· ; session(sessionId) 列出最古老的
存储内置 storage.kv 能力 - get编号 :set编号 :delete 以耐用记录为后盾,由打电话者的房客分割
调度器schedule(agent, input, at) 记录一个耐用的时间表; 循环开始应运行( 完全可以, 安全地跨越重启)
沙盒页:1 sandbox.exec 能力运行代码在一个 bun -e 带有擦拭环境的子进程(没有继承的秘密)、超时和输出封顶
副剂spawnSubagent(ctx, id, agent, input) 开始一个孩子在跑道内持久地运行 等待它的输出 —— 等待在重启后存活

spawnSubagent 是一个在特工内部运行的作品:

import { spawnSubagent } from "@godspeedai/cognate-profile-harness";

const myAgent = {
  id: "agent.researcher",
  version: "1.0.0",
  async run(input, ctx) {
    const summary = await spawnSubagent(ctx, "search", "agent.search", { query: input.topic });
    return { summary };
  },
};
// pass it via createHarness({ agents: [myAgent], ... })

spawnSubagent 需要两件事:a subagent.start 供养者,让父母开始生孩子,以及 结算 run_completion 续行. createHarness 提供两者。 一个编曲的应用 createRuntime 直接 挂载导出的 subagentStartComponent(runtime) 打开 runtime.kernel,电话 watchSubagentCompletions(runtime, caller) 一次,并保留返回的处理功能以进行拆解。 没有两者,父母就永远等待.

导出 harnessProfile 财务报告和审定财务报表 harnessRegistry 按名称申报组成(可用 resolveProfile 从 @godspeedai/cognate-profile)),上面的每一种行为都是普通组件,代理定义,或可再组装的耐用存储/服务呼叫.

限制

  • 允许所有的授权被烤入参考配置 (见上文警告);需要多租户或最低优惠的部署 createRuntime 以真正的政策代替.
  • 调度器是一个进程内间隔回路:调度是可持久性的,但启动它们需要运行的牵引程序.
  • 沙盒只能通过洗涤后的环境、超时和输出盖来隔离——它不是抵御敌对密码的安全边界.
  • 模式提供商合同只有一个插槽:通过处置挂载的交换供应商并挂起下一个交换机(经核实的实时交换);不提供同时提供商之间的线路.

许可证

阿帕奇 - 2.0

版本与发布记录

@godspeedai/cognate-profile-harness 共发布 20 个版本,首次发布于 2026/10/09;过去 12 个月发布了 20 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.10.0latest2026/11/16今天
0.9.22026/11/152 天前
0.9.12026/11/143 天前
0.9.02026/11/0610 天前
0.8.02026/10/2720 天前
0.7.12026/10/2523 天前

关于 @godspeedai/cognate-profile-harness 的常见问题

@godspeedai/cognate-profile-harness 是什么?

调用参考简介:模型提供者,工具注册,代理循环,会话,存储,技能,调度,沙盒,可替换服务,子代理(spec §29.2). 无内核添加.

如何安装 @godspeedai/cognate-profile-harness?

在项目目录运行 npm install @godspeedai/cognate-profile-harness,或使用 pnpm add / yarn add / bun add。

@godspeedai/cognate-profile-harness 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/godspeedai__cognate-profile-harness 是否存在。

@godspeedai/cognate-profile-harness 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@godspeedai/cognate-profile-harness 可以商用吗?

@godspeedai/cognate-profile-harness 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@godspeedai/cognate-profile-harness 的下载量有多少?

根据 npm 官方下载统计,@godspeedai/cognate-profile-harness 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,233 次,日均约 108 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@godspeedai/cognate-profile-harness 还在维护吗?

最新版本 0.10.0 发布于 2026/11/16(今天);至今共发布 20 个版本,其中过去 12 个月发布了 20 个;首次发布于 2026/10/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。