@pumblus/okf-harness 0.6.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 +27 -0
- package/dist/opencode.d.ts +3 -0
- package/dist/opencode.js +54 -0
- package/package.json +56 -0
- package/skills/okf-harness-bootstrap/SKILL.md +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# OKF Harness Native Integration
|
|
2
|
+
|
|
3
|
+
This package exposes the global `okf-harness-bootstrap` integration for Pi, OpenCode, and OpenClaw.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pi install npm:@pumblus/okf-harness
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
opencode plugin @pumblus/okf-harness --global
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
openclaw skills install @pumblus/okf-harness --global
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The package does not install or update the OKF Harness runtime. If `okfh` is missing, run Universal setup:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @okf-harness/setup@latest
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Scope
|
|
26
|
+
|
|
27
|
+
The native package only exposes `okf-harness-bootstrap`. Daily workspace-local OKF Harness skills remain installed by the runtime when a workspace supports that agent adapter.
|
package/dist/opencode.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/opencode.ts
|
|
2
|
+
import { copyFile, mkdir, readFile } from "fs/promises";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
var skillName = "okf-harness-bootstrap";
|
|
7
|
+
var managedMarker = 'okf-harness-managed: "true"';
|
|
8
|
+
var OkfHarnessBootstrapPlugin = async () => {
|
|
9
|
+
await syncGlobalBootstrapSkill();
|
|
10
|
+
return {};
|
|
11
|
+
};
|
|
12
|
+
var opencode_default = OkfHarnessBootstrapPlugin;
|
|
13
|
+
async function syncGlobalBootstrapSkill() {
|
|
14
|
+
const source = path.resolve(packageRoot(), "skills", skillName, "SKILL.md");
|
|
15
|
+
const targetDir = path.join(resolveOpenCodeConfigDir(), "skills", skillName);
|
|
16
|
+
const target = path.join(targetDir, "SKILL.md");
|
|
17
|
+
const sourceContents = await readFile(source, "utf8");
|
|
18
|
+
if (await hasUserOwnedSkill(target)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
await mkdir(targetDir, { recursive: true });
|
|
22
|
+
await copyFile(source, target);
|
|
23
|
+
const targetContents = await readFile(target, "utf8");
|
|
24
|
+
if (targetContents !== sourceContents) {
|
|
25
|
+
throw new Error(`Failed to verify synced ${skillName} skill contents.`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function hasUserOwnedSkill(target) {
|
|
29
|
+
try {
|
|
30
|
+
const contents = await readFile(target, "utf8");
|
|
31
|
+
return !contents.includes(managedMarker);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function packageRoot() {
|
|
40
|
+
return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
41
|
+
}
|
|
42
|
+
function resolveOpenCodeConfigDir() {
|
|
43
|
+
if (process.env.OPENCODE_CONFIG_DIR) {
|
|
44
|
+
return process.env.OPENCODE_CONFIG_DIR;
|
|
45
|
+
}
|
|
46
|
+
if (process.env.XDG_CONFIG_HOME) {
|
|
47
|
+
return path.join(process.env.XDG_CONFIG_HOME, "opencode");
|
|
48
|
+
}
|
|
49
|
+
return path.join(homedir(), ".config", "opencode");
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
OkfHarnessBootstrapPlugin,
|
|
53
|
+
opencode_default as default
|
|
54
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pumblus/okf-harness",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Pi, OpenCode, and OpenClaw native bootstrap integration for OKF Harness.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"author": "Eric Zhou",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.0.0"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/pumblus/okf-harness#readme",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/pumblus/okf-harness.git",
|
|
15
|
+
"directory": "packages/native-integration"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/pumblus/okf-harness/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"okf",
|
|
22
|
+
"open-knowledge-format",
|
|
23
|
+
"llm-wiki",
|
|
24
|
+
"agent-skills",
|
|
25
|
+
"pi",
|
|
26
|
+
"pi-package",
|
|
27
|
+
"opencode",
|
|
28
|
+
"openclaw",
|
|
29
|
+
"clawhub"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"main": "./dist/opencode.js",
|
|
35
|
+
"types": "./dist/opencode.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/opencode.d.ts",
|
|
39
|
+
"import": "./dist/opencode.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"skills",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
"pi": {
|
|
48
|
+
"skills": [
|
|
49
|
+
"./skills"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup src/opencode.ts --format esm --dts --clean",
|
|
54
|
+
"prepublishOnly": "pnpm run build"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: okf-harness-bootstrap
|
|
3
|
+
description: Bootstrap OKF Harness from Pi, OpenCode, or OpenClaw before a workspace-local OKF skill exists. Use when the user asks to create, find, select, repair, or enter an OKF Harness workspace. If okfh is missing, point to Universal setup. Do not use for daily workspace answers, generic Markdown editing, or non-OKF knowledge-base work.
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
compatibility: pi, opencode, openclaw
|
|
6
|
+
metadata:
|
|
7
|
+
openclaw:
|
|
8
|
+
homepage: "https://github.com/pumblus/okf-harness"
|
|
9
|
+
okf-harness-managed: "true"
|
|
10
|
+
okf-harness-entrypoint: "bootstrap"
|
|
11
|
+
okf-harness-package: "@pumblus/okf-harness"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# OKF Harness Bootstrap
|
|
15
|
+
|
|
16
|
+
Use this skill only as the global bootstrap entrypoint for OKF Harness.
|
|
17
|
+
|
|
18
|
+
## Runtime Check
|
|
19
|
+
|
|
20
|
+
1. Check whether `okfh` is available before planning workspace actions.
|
|
21
|
+
2. If `okfh` is missing, stop and tell the user to run `npx @okf-harness/setup@latest`.
|
|
22
|
+
3. Do not install, update, or replace the runtime from this skill.
|
|
23
|
+
|
|
24
|
+
## Scope
|
|
25
|
+
|
|
26
|
+
- This package exposes only `okf-harness-bootstrap`.
|
|
27
|
+
- Do not claim that Pi, OpenCode, or OpenClaw workspace-local daily adapters are installed by this package.
|
|
28
|
+
- Once `okfh` is available, use `okfh --json` commands to inspect, create, select, or repair OKF Harness workspaces.
|
|
29
|
+
- Before changing a workspace, prefer JSON-capable checks such as `okfh doctor --json` and workspace status commands when available.
|
|
30
|
+
|
|
31
|
+
## Response Contract
|
|
32
|
+
|
|
33
|
+
- State the runtime status first.
|
|
34
|
+
- If blocked by a missing runtime, give only the exact setup command: `npx @okf-harness/setup@latest`.
|
|
35
|
+
- If continuing, keep actions limited to OKF Harness bootstrap work.
|