chore(publish): MIT license + dist build + OIDC trusted publishing workflow

This commit is contained in:
John Smith committed 2026-10-15 21:00:39 -04:00
1 parent 079af4dc29
commit a96b16d7df
8 files changed
+155 -21

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
name: publish
on:
push:
tags:
- "v*"
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck
run: bun run check
- name: Test
run: bun test
- name: Build
run: bun run build
- name: Publish to npm
run: npm publish --provenance --access public
+14
View File
@@ -0,0 +1,14 @@
# Defense-in-depth: `files` in package.json is the primary allowlist.
# This file excludes junk from the published tarball even if the
# allowlist is ever loosened.
test/
docs/reports/
docs/evidence/
scripts/accept/
worktrees/
.github/
*.log
bun.lock
coverage/
.nyc_output/
*.tsbuildinfo
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Heretek-AI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+47 -4
View File
@@ -2,14 +2,57 @@
"name": "@heretek-ai/opencode-harness",
"version": "1.0.0",
"description": "Lean OpenCode v2 in-process harness plugin: Hashline edits, AST codemods, KV-cache-safe context budgeting, permission guards, and DOM geometry auditing.",
"type": "module",
"main": "./src/index.ts",
"exports": {
".": "./src/index.ts"
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/Heretek-AI/opencode-harness.git"
},
"homepage": "https://github.com/Heretek-AI/opencode-harness",
"bugs": {
"url": "https://github.com/Heretek-AI/opencode-harness/issues"
},
"author": "Heretek-AI",
"keywords": [
"opencode",
"opencode-plugin",
"hashline",
"ast-codemod",
"permission-guard",
"circuit-breaker",
"context-budget",
"dom-audit"
],
"engines": {
"bun": ">=1.0.0",
"node": ">=22.0.0"
},
"sideEffects": false,
"publishConfig": {
"access": "public",
"provenance": true
},
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src",
"README.md",
"LICENSE",
"AGENTS.md"
],
"scripts": {
"check": "tsc --noEmit",
"test": "bun test",
"build": "tsc -p tsconfig.build.json",
"prepublishOnly": "bun run check && bun test && npm run build",
"accept": "bash scripts/accept/run.sh"
},
"dependencies": {
+1 -1
View File
@@ -14,7 +14,7 @@
*/
import { createRequire } from "node:module";
import { resolveSafePath } from "./hashline-tools";
import { resolveSafePath } from "./hashline-tools.js";
export type AstLanguage =
| "typescript"
+1 -1
View File
@@ -25,7 +25,7 @@
import {
classifyShellCommand,
isDestructiveShellCommand,
} from "./shell-parse";
} from "./shell-parse.js";
export const DEFAULT_LOCKED_CONTRACT_GLOBS: string[] = [
"**/contracts/**",
+15 -15
View File
@@ -32,50 +32,50 @@ import {
astRewriteFile,
astSearch,
type AstLanguage,
} from "./editors/ast-codemod";
} from "./editors/ast-codemod.js";
import {
hashEditFile,
hashReadFile,
type HashEditHunk,
} from "./editors/hashline-tools";
} from "./editors/hashline-tools.js";
import {
defaultGuardConfig,
evaluateBoardGuard,
type GuardPolicyConfig,
type GuardRequest,
type GuardVerdict,
} from "./guards/permission-guard";
} from "./guards/permission-guard.js";
import {
commandPrefixOf,
recordToolAttempt,
type CircuitBreakerVerdict,
} from "./guards/circuit-breaker";
} from "./guards/circuit-breaker.js";
import {
buildDynamicContextBlocks,
injectContextBudgetIntoMessages,
packBlocks,
type LessonInput,
type SessionEvent,
} from "./context/context-budget";
} from "./context/context-budget.js";
import {
auditLivePageWithPlaywright,
evaluateDomGeometryInPage,
type DomElementInput,
type ViewportInput,
} from "./ui-auditor/dom-auditor";
} from "./ui-auditor/dom-auditor.js";
export * from "./editors/hashline-tools";
export * from "./editors/ast-codemod";
export * from "./guards/shell-parse";
export * from "./guards/permission-guard";
export * from "./guards/circuit-breaker";
export * from "./context/context-budget";
export * from "./ui-auditor/dom-auditor";
export { getRecommendedMcpConfig } from "./ui-auditor/mcp-defaults";
export * from "./editors/hashline-tools.js";
export * from "./editors/ast-codemod.js";
export * from "./guards/shell-parse.js";
export * from "./guards/permission-guard.js";
export * from "./guards/circuit-breaker.js";
export * from "./context/context-budget.js";
export * from "./ui-auditor/dom-auditor.js";
export { getRecommendedMcpConfig } from "./ui-auditor/mcp-defaults.js";
export type {
McpServerEntry,
RecommendedMcpConfig,
} from "./ui-auditor/mcp-defaults";
} from "./ui-auditor/mcp-defaults.js";
export const HARNESS_NAME = "@heretek-ai/opencode-harness";
export const HARNESS_VERSION = "1.0.0";
+15
View File
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"noEmit": false,
"module": "ESNext",
"moduleResolution": "bundler"
},
"include": ["src/**/*"],
"exclude": ["test", "scripts", "docs"]
}