Skip to content

Commit 848047d

Browse files
committed
Add src/index.ts so tsc produces dist/index.js
ClawHub upload rejected the package because package.json#main ('./dist/index.js') pointed at a file that didn't exist — tsc with rootDir: 'src' was compiling src/plugin/*, src/api/*, src/engine/* but not the root index.ts (which lives outside rootDir). src/index.ts mirrors the root index.ts (re-exports the plugin default plus the public API), so tsc emits dist/index.js. The root index.ts stays for TS-direct loading via openclaw.extensions; the compiled dist/index.js satisfies ClawHub and any host without TS support.
1 parent e5a60c9 commit 848047d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Compiled entry. tsc produces dist/index.js from this — what
2+
// `package.json#main` and the OpenClaw loader (when no TS support) consume.
3+
//
4+
// The root `index.ts` (sibling to src/) is the TS-direct entry used by
5+
// openclaw.extensions when the host has TS support; it re-exports from this
6+
// file's source so both paths surface the same API.
7+
8+
export { default } from "./plugin/index.js";
9+
10+
export {
11+
registerResolver,
12+
onAllowAlwaysPersisted,
13+
getAgentPermissionsApi,
14+
} from "./api/resolver.js";
15+
16+
export type {
17+
AgentPermissionsApi,
18+
ResolverRegistration,
19+
ResolveFn,
20+
GateRequest,
21+
AllowAlwaysEvent,
22+
PolicyBucket,
23+
PolicyDecision,
24+
RuleSource,
25+
} from "./api/types.js";

0 commit comments

Comments
 (0)