Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Install dependencies
run: pnpm install --merge-git-branch-lockfiles

- name: Install Playwright Chromium
run: pnpm exec playwright install --with-deps chromium

- name: Lint
run: pnpm lint

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"vite": "^8.1",
"vite-plugin-node": "^8.0",
"vitest": "^4.1",
"@vitest/coverage-v8": "4.1.9",
"@vitest/browser": "^4.1.9",
"@vitest/browser-playwright": "^4.1.9",
"playwright": "^1.61.0"
"@vitest/coverage-v8": "4.1.9"
}
}
2 changes: 1 addition & 1 deletion packages/claude-status/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ node packages/claude-status/dist/index.js uninstall-hooks

`install-hooks` registers a command on a handful of Claude hook events. On each
event Claude runs the bundled `hook-entry.js` under bare `node`, which maps the
event to a status and signs & POSTs it via `@webhook-objects/client`:
event to a status and signs & POSTs it via [`@gathertown/webhook-object-sdk`](https://www.npmjs.com/package/@gathertown/webhook-object-sdk):

| hook event | status |
| ------------------ | ---------- |
Expand Down
3 changes: 2 additions & 1 deletion packages/claude-status/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
}
],
"dependencies": {
"@webhook-objects/client": "workspace:*"
"@gathertown/webhook-object-sdk": "^0.1.1"
},
"devDependencies": {
"@gathertown/webhook-object-types": "^0.1.1",
"@webhook-objects/z-build-config": "workspace:*"
}
}
18 changes: 6 additions & 12 deletions packages/claude-status/src/hook-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @module
*/
import { Client } from "@webhook-objects/client/node";
import { createWebhookObjectClient } from "@gathertown/webhook-object-sdk";
import { eventToState } from "./hook";

const SEND_TIMEOUT_MS = 3000;
Expand Down Expand Up @@ -40,20 +40,14 @@ const secret = flag("secret");

if (state && url && secret) {
try {
// Use the global fetch (Node 18+) so undici is never imported.
const client = new Client({
// The timeout signal covers the whole send, retries and backoff included,
// so a down/slow receiver can never hold the hook process open.
const client = createWebhookObjectClient({
url,
secret,
fetchImpl: (input, init) => fetch(input, init),
signal: AbortSignal.timeout(SEND_TIMEOUT_MS),
});
await client.send(
{
type: "status.set",
timestamp: new Date().toISOString(),
data: { state },
},
{ signal: AbortSignal.timeout(SEND_TIMEOUT_MS) },
);
await client.send("status.set", { state });
} catch {
// Best effort only.
}
Expand Down
2 changes: 1 addition & 1 deletion packages/claude-status/src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @module
*/
import type { StatusState } from "@webhook-objects/client/node";
import type { StatusSetDataState as StatusState } from "@gathertown/webhook-object-types";

/** The hook events we register, in `settings.json` order. */
export const HOOK_EVENTS = [
Expand Down
4 changes: 3 additions & 1 deletion packages/claude-status/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"extends": "../z-build-config/ts/tsconfig.dom.json",
"compilerOptions": {},
"compilerOptions": {
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts"]
}
8 changes: 3 additions & 5 deletions packages/claude-status/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ export default defineConfig({
},
rolldownOptions: {
// Bundle everything except node builtins so the CLI is a self-contained
// artifact (the client and its deps like standardwebhooks live in other
// packages' node_modules and aren't resolvable from ours at runtime).
// undici stays external: it's the client's optional fetch backend (615kB)
// and we use the global `fetch` instead, so it's never imported.
// artifact (the SDK and its standardwebhooks dep live in node_modules,
// which isn't resolvable from dist at runtime).
// index.ts keeps its own `#!/usr/bin/env node`; hook-entry.js is always
// run via an explicit `node`.
external: (id) => isBuiltin(id) || id === "undici",
external: (id) => isBuiltin(id),
},
},
test: {
Expand Down
1 change: 0 additions & 1 deletion packages/client/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions packages/client/package.json

This file was deleted.

35 changes: 0 additions & 35 deletions packages/client/src/browser.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/client/src/browser.ts

This file was deleted.

Loading
Loading