@polydeukes/adapter-grok

中文文档
0.20.1发布于 2026/10/22MITTypeScriptES Module零依赖构建来源已验证

Polydeukes adapter for Grok — up-translates PreToolUse hook payloads into the agent-neutral covenant input IR and registers the session surface. Beta.

此软件包已被标记为弃用

Grok support ended on 2026-11-02. A project registered with pdks adapter grok init refuses every Grok tool call after upgrading; delete .grok/hooks/covenant-pretooluse.json from your terminal.

原始使用文档
文档目录3 节
  1. Overview
  2. Examples
  3. See also

@polydeukes/adapter-grok

English · 한국어

Translates Grok events into covenant input IR. It is included in the installed pdks executable. Connect a project with:

pdks adapter grok init

The single executable includes all three adapters and the Node runtime. It works without a separate Node, npm, or adapter installation. The npm package supports JavaScript module integrations.

Overview

All three adapters provide the same three functions. Each accepts one spec object and returns a named outcome.

FunctionRole
prepareHookTranslate host events and collect available evidence
registerHookMerge project hook registrations
renderHookResponseRender the host’s allow or deny response

The common pdks runtime invokes covenant check through the current executable. The shared judge owns judgment and telemetry; the adapter owns translation and registration.

Examples

import { prepareHook } from '@polydeukes/adapter-grok';

const outcome = prepareHook({
  repoRoot: process.cwd(),
  rawPayload: JSON.stringify(event),
});

event is the complete event received from the host. The outcome is check, recorded, or unavailable; this call does not execute the tool.

See also

版本与发布记录

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

版本发布日期距今
0.20.1latest2026/10/2212 天前
0.20.02026/10/2113 天前
0.19.12026/10/1420 天前
0.19.02026/10/1321 天前
0.18.02026/10/1123 天前
0.17.02026/10/1123 天前

关于 @polydeukes/adapter-grok 的常见问题

@polydeukes/adapter-grok 是什么?

用于Grok - up的Polydeukes适配器将PreToolUse钩子载荷转换为代理中立的契约输入IR并注册会话表面。β。注意:该包已被作者标记为弃用——Grok support ended on 2026-11-02. A project registered with pdks adapter grok init refuses every Grok tool call after upgrading; delete .grok/hooks/covenant-pretooluse.json from your terminal.

如何安装 @polydeukes/adapter-grok?

在项目目录运行 npm install @polydeukes/adapter-grok,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@polydeukes/core(^0.20.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@polydeukes/adapter-grok 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@polydeukes/adapter-grok 支持 ESM 还是 CommonJS?

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

@polydeukes/adapter-grok 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@polydeukes/adapter-grok 可以商用吗?

@polydeukes/adapter-grok 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@polydeukes/adapter-grok 还在维护吗?

最新版本 0.20.1 发布于 2026/10/22(12 天前);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/09/15。作者已将其标记为弃用,新项目建议寻找替代方案。