@kybernesis/arp-create-adapter 0.1.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.
@@ -0,0 +1,32 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { withArp } from '../src/index.js';
3
+ import type { {{frameworkPascal}}Like } from '../src/types.js';
4
+
5
+ /**
6
+ * Baseline conformance test.
7
+ *
8
+ * Runs `withArp` against a minimal framework fake and verifies the hooks
9
+ * were registered. The real conformance test — pairing with the ARP
10
+ * reference agents and running `@kybernesis/arp-testkit audit` — lives in
11
+ * the ARP monorepo's `tests/phase-6` suite. Point that at this adapter
12
+ * once the framework-specific wiring is done.
13
+ */
14
+
15
+ class Fake{{frameworkPascal}} implements {{frameworkPascal}}Like {
16
+ public readonly id = 'fake-{{framework}}';
17
+ public toolHookRegistered = false;
18
+ public peerHookRegistered = false;
19
+ useToolMiddleware() { this.toolHookRegistered = true; }
20
+ onPeerMessage() { this.peerHookRegistered = true; }
21
+ async start() {}
22
+ async stop() {}
23
+ }
24
+
25
+ describe('@kybernesis/arp-adapter-{{framework}} conformance (scaffold)', () => {
26
+ it('withArp registers tool-middleware + peer-message hooks', () => {
27
+ const fw = new Fake{{frameworkPascal}}();
28
+ withArp(fw, { handoff: { /* stubbed */ } as unknown as never });
29
+ expect(fw.toolHookRegistered).toBe(true);
30
+ expect(fw.peerHookRegistered).toBe(true);
31
+ });
32
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "esModuleInterop": true,
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "resolveJsonModule": true,
10
+ "declaration": true,
11
+ "outDir": "dist",
12
+ "noEmit": true
13
+ },
14
+ "include": ["src/**/*.ts", "tests/**/*.ts"]
15
+ }
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: { index: 'src/index.ts' },
5
+ format: ['esm', 'cjs'],
6
+ dts: { entry: { index: 'src/index.ts' } },
7
+ clean: true,
8
+ sourcemap: true,
9
+ target: 'es2022',
10
+ outDir: 'dist',
11
+ splitting: false,
12
+ treeshake: true,
13
+ });