dsh-model-jury 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.
Files changed (43) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/COMPATIBILITY.md +17 -0
  3. package/CONTRIBUTING.md +31 -0
  4. package/DEMO.md +64 -0
  5. package/LICENSE +21 -0
  6. package/PRE_FLIGHT.md +39 -0
  7. package/README.md +196 -0
  8. package/REAL_DEMO.md +78 -0
  9. package/SECURITY.md +9 -0
  10. package/cordis.patch.yml +30 -0
  11. package/lib/command.d.ts +13 -0
  12. package/lib/command.js +45 -0
  13. package/lib/config.d.ts +35 -0
  14. package/lib/config.js +39 -0
  15. package/lib/council-service.d.ts +33 -0
  16. package/lib/council-service.js +86 -0
  17. package/lib/index.d.ts +13 -0
  18. package/lib/index.js +12 -0
  19. package/lib/persistence/run-store.d.ts +15 -0
  20. package/lib/persistence/run-store.js +55 -0
  21. package/lib/protocol/aggregate.d.ts +40 -0
  22. package/lib/protocol/aggregate.js +87 -0
  23. package/lib/protocol/anonymize.d.ts +20 -0
  24. package/lib/protocol/anonymize.js +60 -0
  25. package/lib/protocol/prompts.d.ts +12 -0
  26. package/lib/protocol/prompts.js +102 -0
  27. package/lib/protocol/report.d.ts +4 -0
  28. package/lib/protocol/report.js +101 -0
  29. package/lib/protocol/schemas.d.ts +66 -0
  30. package/lib/protocol/schemas.js +48 -0
  31. package/lib/protocol/state-machine.d.ts +41 -0
  32. package/lib/protocol/state-machine.js +109 -0
  33. package/lib/seats/codex-seat.d.ts +17 -0
  34. package/lib/seats/codex-seat.js +81 -0
  35. package/lib/seats/llm-seat.d.ts +17 -0
  36. package/lib/seats/llm-seat.js +96 -0
  37. package/lib/seats/structured.d.ts +22 -0
  38. package/lib/seats/structured.js +126 -0
  39. package/lib/seats/types.d.ts +58 -0
  40. package/lib/seats/types.js +16 -0
  41. package/lib/seats/unavailable-seat.d.ts +13 -0
  42. package/lib/seats/unavailable-seat.js +40 -0
  43. package/package.json +80 -0
@@ -0,0 +1,58 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ import type { TokenUsage } from '@deepseek-ai/dsh-llm';
3
+ import type { z } from 'zod';
4
+ /** Stable internal Council seat identifiers. */
5
+ export type CouncilSeatId = 'gpt' | 'glm' | 'deepseek';
6
+ /** Human-readable identity used only outside anonymous review packets. */
7
+ export declare const SEAT_NAMES: Readonly<Record<CouncilSeatId, string>>;
8
+ /** Council protocol round identifiers. */
9
+ export type CouncilRound = 'round1' | 'round2' | 'round3';
10
+ /** One structured request sent to a seat. */
11
+ export interface CouncilSeatRequest<T> {
12
+ readonly round: CouncilRound;
13
+ readonly prompt: string;
14
+ readonly schema: z.ZodType<T>;
15
+ readonly schemaName: string;
16
+ }
17
+ /** Safe metadata for one complete structured invocation. */
18
+ export interface SeatCallMetadata {
19
+ readonly seat: CouncilSeatId;
20
+ readonly provider: string;
21
+ readonly model: string | undefined;
22
+ readonly round: CouncilRound;
23
+ readonly startedAt: string;
24
+ readonly endedAt: string;
25
+ readonly durationMs: number;
26
+ readonly success: boolean;
27
+ readonly retryCount: number;
28
+ readonly repairCount: number;
29
+ readonly tokenUsage: TokenUsage | undefined;
30
+ }
31
+ /** Validated final response from one seat. */
32
+ export interface CouncilSeatResponse<T> {
33
+ readonly value: T;
34
+ readonly raw: string;
35
+ readonly metadata: SeatCallMetadata;
36
+ }
37
+ /** Doctor result for one configured seat. */
38
+ export interface SeatHealth {
39
+ readonly ok: boolean;
40
+ readonly detail: string;
41
+ readonly provider: string;
42
+ readonly model?: string;
43
+ readonly durationMs: number;
44
+ }
45
+ /** Provider-neutral Council seat contract. */
46
+ export interface CouncilSeat {
47
+ readonly id: CouncilSeatId;
48
+ readonly provider: string;
49
+ readonly model: string | undefined;
50
+ invoke<T>(request: CouncilSeatRequest<T>, parent: Agent, signal: AbortSignal): Promise<CouncilSeatResponse<T>>;
51
+ healthCheck(parent: Agent, signal: AbortSignal): Promise<SeatHealth>;
52
+ }
53
+ /** Structured seat failure retaining safe observability metadata. */
54
+ export declare class SeatInvocationError extends Error {
55
+ readonly metadata: SeatCallMetadata;
56
+ constructor(message: string, metadata: SeatCallMetadata, options?: ErrorOptions);
57
+ }
58
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,16 @@
1
+ /** Human-readable identity used only outside anonymous review packets. */
2
+ export const SEAT_NAMES = {
3
+ gpt: 'GPT',
4
+ glm: 'GLM',
5
+ deepseek: 'DeepSeek',
6
+ };
7
+ /** Structured seat failure retaining safe observability metadata. */
8
+ export class SeatInvocationError extends Error {
9
+ metadata;
10
+ constructor(message, metadata, options) {
11
+ super(message, options);
12
+ this.metadata = metadata;
13
+ this.name = 'SeatInvocationError';
14
+ }
15
+ }
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,13 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ import type { CouncilSeat, CouncilSeatId, CouncilSeatRequest, CouncilSeatResponse, SeatHealth } from './types.js';
3
+ /** Explicit failed seat used when external provider/model configuration is incomplete. */
4
+ export declare class UnavailableSeat implements CouncilSeat {
5
+ readonly id: CouncilSeatId;
6
+ readonly provider: string;
7
+ private readonly reason;
8
+ readonly model: undefined;
9
+ constructor(id: CouncilSeatId, provider: string, reason: string);
10
+ invoke<T>(request: CouncilSeatRequest<T>, _parent: Agent, _signal: AbortSignal): Promise<CouncilSeatResponse<T>>;
11
+ healthCheck(_parent: Agent, _signal: AbortSignal): Promise<SeatHealth>;
12
+ }
13
+ //# sourceMappingURL=unavailable-seat.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { SeatInvocationError } from './types.js';
2
+ /** Explicit failed seat used when external provider/model configuration is incomplete. */
3
+ export class UnavailableSeat {
4
+ id;
5
+ provider;
6
+ reason;
7
+ model = undefined;
8
+ constructor(id, provider, reason) {
9
+ this.id = id;
10
+ this.provider = provider;
11
+ this.reason = reason;
12
+ }
13
+ invoke(request, _parent, _signal) {
14
+ const now = new Date().toISOString();
15
+ const metadata = {
16
+ seat: this.id,
17
+ provider: this.provider,
18
+ model: undefined,
19
+ round: request.round,
20
+ startedAt: now,
21
+ endedAt: now,
22
+ durationMs: 0,
23
+ success: false,
24
+ retryCount: 0,
25
+ repairCount: 0,
26
+ tokenUsage: undefined,
27
+ };
28
+ return Promise.reject(new SeatInvocationError(this.reason, metadata));
29
+ }
30
+ healthCheck(_parent, _signal) {
31
+ return Promise.resolve({
32
+ ok: false,
33
+ detail: this.reason,
34
+ provider: this.provider,
35
+ ...(this.model === undefined ? {} : { model: this.model }),
36
+ durationMs: 0,
37
+ });
38
+ }
39
+ }
40
+ //# sourceMappingURL=unavailable-seat.js.map
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "dsh-model-jury",
3
+ "version": "0.1.0",
4
+ "description": "Structured cross-model peer review for DeepSeek Harness",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "lib/**/*.js",
17
+ "lib/**/*.d.ts",
18
+ "cordis.patch.yml",
19
+ "README.md",
20
+ "DEMO.md",
21
+ "REAL_DEMO.md",
22
+ "PRE_FLIGHT.md",
23
+ "COMPATIBILITY.md",
24
+ "SECURITY.md",
25
+ "CONTRIBUTING.md",
26
+ "CHANGELOG.md",
27
+ "LICENSE"
28
+ ],
29
+ "license": "MIT",
30
+ "keywords": [
31
+ "dsh-plugin",
32
+ "deepseek-harness",
33
+ "multi-llm",
34
+ "llm-debate",
35
+ "peer-review",
36
+ "codex",
37
+ "glm",
38
+ "deepseek"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dsh": {
44
+ "bundle": {
45
+ "patch": "./cordis.patch.yml"
46
+ }
47
+ },
48
+ "engines": {
49
+ "node": "^22.19.0 || >=24.0.0"
50
+ },
51
+ "peerDependencies": {
52
+ "@deepseek-ai/cordis": "4.0.2",
53
+ "@deepseek-ai/dsh-agent": "0.1.2-alpha.2",
54
+ "@deepseek-ai/dsh-commands": "0.1.2-alpha.2",
55
+ "@deepseek-ai/dsh-llm": "0.1.2-alpha.2",
56
+ "@deepseek-ai/dsh-subagent": "0.1.2-alpha.2"
57
+ },
58
+ "dependencies": {
59
+ "@deepseek-ai/dsh-subagent-codex": "0.1.2-alpha.2",
60
+ "@deepseek-ai/schemastery": "3.18.2",
61
+ "zod": "^4.1.5"
62
+ },
63
+ "devDependencies": {
64
+ "@deepseek-ai/cordis": "4.0.2",
65
+ "@deepseek-ai/dsh-agent": "0.1.2-alpha.2",
66
+ "@deepseek-ai/dsh-commands": "0.1.2-alpha.2",
67
+ "@deepseek-ai/dsh-llm": "0.1.2-alpha.2",
68
+ "@deepseek-ai/dsh-subagent": "0.1.2-alpha.2",
69
+ "@types/node": "^22.20.0",
70
+ "typescript": "^6.0.3",
71
+ "vitest": "^4.1.8"
72
+ },
73
+ "scripts": {
74
+ "build": "tsc -p tsconfig.build.json",
75
+ "typecheck": "tsc -p tsconfig.json --noEmit",
76
+ "test": "vitest run",
77
+ "test:watch": "vitest",
78
+ "check": "npm run typecheck && npm run test && npm run build"
79
+ }
80
+ }