@heybeaux/lattice-adapter-parliament 0.2.1

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,138 @@
1
+ import { TieredCircuitBreakerConfig, TieredCircuitBreaker, ConsensusReducerConfig, StateContract } from '@heybeaux/lattice-core';
2
+
3
+ /**
4
+ * @heybeaux/lattice-adapter-parliament
5
+ *
6
+ * Wraps Parliament's multi-model deliberations with Lattice State Contracts,
7
+ * Circuit Breakers, and ConsensusReducer for coordinated, auditable synthesis.
8
+ */
9
+
10
+ /**
11
+ * A Parliament model participant.
12
+ */
13
+ interface ParliamentModel {
14
+ /** Unique identifier for the model (e.g., 'claude-opus-4-6') */
15
+ id: string;
16
+ /** Role in the deliberation (proposer, expander, pragmatist, etc.) */
17
+ role: string;
18
+ /** Whether this model is adversarial (skeptic, devils-advocate) */
19
+ isAdversarial?: boolean;
20
+ }
21
+ /**
22
+ * Configuration for wrapping a Parliament model.
23
+ */
24
+ interface ParliamentModelConfig {
25
+ /** Circuit breaker configuration (defaults: L1+L2 for cooperative, L1 for adversarial) */
26
+ breaker?: TieredCircuitBreakerConfig;
27
+ /** Whether to redact sensitive data before validation (default: true) */
28
+ redactForValidation?: boolean;
29
+ /** Whether to run in shadow mode (validate but don't block) (default: true) */
30
+ shadowMode?: boolean;
31
+ }
32
+ /**
33
+ * Configuration for the Parliament integration.
34
+ */
35
+ interface ParliamentConfig {
36
+ /** Audit log path (optional — if provided, all deliberations are logged) */
37
+ auditLogPath?: string;
38
+ /** ConsensusReducer configuration */
39
+ reducer?: ConsensusReducerConfig;
40
+ /** Per-model configurations (optional) */
41
+ modelConfigs?: Record<string, ParliamentModelConfig>;
42
+ /** Default model configuration (applied to all models without specific config) */
43
+ defaultModelConfig?: ParliamentModelConfig;
44
+ }
45
+ /**
46
+ * Result from wrapping a Parliament deliberation.
47
+ */
48
+ interface ParliamentDeliberationResult {
49
+ /** State Contracts for each model response */
50
+ modelContracts: StateContract[];
51
+ /** The consensus/synthesis output */
52
+ consensus: unknown;
53
+ /** Conflicts detected between models */
54
+ conflicts: Array<{
55
+ field: string;
56
+ values: Array<{
57
+ agentId: string;
58
+ value: unknown;
59
+ }>;
60
+ resolution: string;
61
+ }>;
62
+ /** Agreement ratio (0-1) */
63
+ agreementRatio: number;
64
+ /** Whether consensus was reached */
65
+ consensusReached: boolean;
66
+ /** Total deliberation time in milliseconds */
67
+ totalDurationMs: number;
68
+ /** Trace ID for the deliberation */
69
+ traceId: string;
70
+ }
71
+ /**
72
+ * Wrap a Parliament model call with Lattice State Contracts and Circuit Breakers.
73
+ *
74
+ * The wrapped model:
75
+ * 1. Executes the original model call
76
+ * 2. Creates a State Contract with the model's response
77
+ * 3. Validates through Circuit Breaker (L1+L2 for cooperative, L1 for adversarial)
78
+ * 4. Returns the State Contract
79
+ *
80
+ * @param model - The Parliament model definition
81
+ * @param modelCall - The model call function: (prompt) => Promise<response>
82
+ * @param config - Configuration for this model
83
+ * @returns A wrapped function that returns StateContract instead of raw response
84
+ */
85
+ declare function wrapParliamentModel(model: ParliamentModel, modelCall: (prompt: string) => Promise<unknown>, config?: ParliamentModelConfig): (prompt: string, traceId?: string) => Promise<{
86
+ contract: StateContract;
87
+ passed: boolean;
88
+ }>;
89
+ /**
90
+ * A pre-configured circuit breaker for Parliament model responses.
91
+ *
92
+ * Cooperative models use L1+L2 validation.
93
+ * Adversarial models use L1 only (they're supposed to be contrarian).
94
+ */
95
+ declare class ParliamentCircuitBreaker {
96
+ private breakers;
97
+ constructor(models: ParliamentModel[], configs?: Record<string, TieredCircuitBreakerConfig>);
98
+ get(agentId: string): TieredCircuitBreaker | undefined;
99
+ }
100
+ /**
101
+ * A ConsensusReducer configured for Parliament synthesis.
102
+ *
103
+ * Detects disagreements between model responses, computes agreement
104
+ * ratios, and flags conflicts for the synthesizer to resolve.
105
+ */
106
+ declare class ParliamentReducer {
107
+ private reducer;
108
+ constructor(config?: ConsensusReducerConfig);
109
+ /**
110
+ * Reduce multiple model responses into a consensus.
111
+ */
112
+ reduce(contracts: StateContract[], traceId?: string): {
113
+ consensus: unknown;
114
+ conflicts: Array<{
115
+ field: string;
116
+ values: Array<{
117
+ agentId: string;
118
+ value: unknown;
119
+ }>;
120
+ resolution: string;
121
+ }>;
122
+ agreementRatio: number;
123
+ consensusReached: boolean;
124
+ reducedContract: StateContract;
125
+ };
126
+ }
127
+ /**
128
+ * Run a full Parliament deliberation with Lattice coordination.
129
+ *
130
+ * @param topic - The deliberation topic
131
+ * @param models - Array of Parliament models to run
132
+ * @param modelCalls - Map of model ID to model call function
133
+ * @param config - Parliament configuration
134
+ * @returns ParliamentDeliberationResult
135
+ */
136
+ declare function runParliamentDeliberation(topic: string, models: ParliamentModel[], modelCalls: Map<string, (prompt: string) => Promise<unknown>>, config?: ParliamentConfig): Promise<ParliamentDeliberationResult>;
137
+
138
+ export { ParliamentCircuitBreaker, type ParliamentConfig, type ParliamentDeliberationResult, type ParliamentModel, type ParliamentModelConfig, ParliamentReducer, runParliamentDeliberation, wrapParliamentModel };
package/dist/index.js ADDED
@@ -0,0 +1,140 @@
1
+ // src/index.ts
2
+ import {
3
+ createContract,
4
+ TieredCircuitBreaker,
5
+ ConsensusReducer,
6
+ ComplianceAuditLog,
7
+ wrapAgent,
8
+ HandoffFailure
9
+ } from "@heybeaux/lattice-core";
10
+ function wrapParliamentModel(model, modelCall, config) {
11
+ const shadowMode = config?.shadowMode ?? true;
12
+ const breakerConfig = config?.breaker ?? (model.isAdversarial ? { tier: "L1" } : { tier: "L1+L2", l2Threshold: 0.7 });
13
+ const wrapped = wrapAgent(
14
+ async (prompt) => modelCall(prompt),
15
+ {
16
+ id: model.id,
17
+ breaker: breakerConfig
18
+ }
19
+ );
20
+ return async (prompt, traceId) => {
21
+ try {
22
+ const contract = await wrapped(prompt, traceId);
23
+ return { contract, passed: true };
24
+ } catch (error) {
25
+ if (error instanceof HandoffFailure) {
26
+ if (shadowMode) {
27
+ return { contract: error.contract, passed: false };
28
+ }
29
+ throw error;
30
+ }
31
+ throw error;
32
+ }
33
+ };
34
+ }
35
+ var ParliamentCircuitBreaker = class {
36
+ breakers = /* @__PURE__ */ new Map();
37
+ constructor(models, configs) {
38
+ for (const model of models) {
39
+ const config = configs?.[model.id] ?? (model.isAdversarial ? { tier: "L1" } : { tier: "L1+L2", l2Threshold: 0.7 });
40
+ this.breakers.set(model.id, new TieredCircuitBreaker(config));
41
+ }
42
+ }
43
+ get(agentId) {
44
+ return this.breakers.get(agentId);
45
+ }
46
+ };
47
+ var ParliamentReducer = class {
48
+ reducer;
49
+ constructor(config) {
50
+ this.reducer = new ConsensusReducer({
51
+ conflictStrategy: config?.conflictStrategy ?? "flag-only",
52
+ minAgreementRatio: config?.minAgreementRatio ?? 0.6,
53
+ consensusFields: config?.consensusFields ?? ["mainPoint", "supportingArguments", "conclusion"],
54
+ includeIndividualOutputs: config?.includeIndividualOutputs ?? true
55
+ });
56
+ }
57
+ /**
58
+ * Reduce multiple model responses into a consensus.
59
+ */
60
+ reduce(contracts, traceId) {
61
+ const result = this.reducer.reduce(contracts);
62
+ const reducedContract = this.reducer.createReducedContract(result, contracts, "parliament-reducer", null);
63
+ return {
64
+ consensus: result.output,
65
+ conflicts: result.conflicts,
66
+ agreementRatio: result.agreementRatio,
67
+ consensusReached: result.consensus,
68
+ reducedContract
69
+ };
70
+ }
71
+ };
72
+ async function runParliamentDeliberation(topic, models, modelCalls, config) {
73
+ const start = Date.now();
74
+ const traceId = createContract({
75
+ fromAgent: "parliament-topic",
76
+ inputs: { topic },
77
+ outputs: {},
78
+ budget: { tokensUsed: 0, callsMade: 0, wallClockMs: 0 }
79
+ }).traceId;
80
+ let auditLog;
81
+ if (config?.auditLogPath) {
82
+ auditLog = new ComplianceAuditLog({ logPath: config.auditLogPath });
83
+ }
84
+ const modelContracts = [];
85
+ const modelResults = [];
86
+ for (const model of models) {
87
+ const modelCall = modelCalls.get(model.id);
88
+ if (!modelCall) {
89
+ continue;
90
+ }
91
+ const modelConfig = config?.modelConfigs?.[model.id] ?? config?.defaultModelConfig;
92
+ const wrappedModel = wrapParliamentModel(model, modelCall, modelConfig);
93
+ const result = await wrappedModel(topic, traceId);
94
+ modelContracts.push(result.contract);
95
+ modelResults.push({ model, result });
96
+ if (auditLog) {
97
+ auditLog.append({
98
+ agentId: model.id,
99
+ modelRole: model.role,
100
+ isAdversarial: model.isAdversarial ?? false,
101
+ passed: result.passed,
102
+ traceId,
103
+ contractId: result.contract.id
104
+ });
105
+ }
106
+ }
107
+ const reducer = new ParliamentReducer(config?.reducer);
108
+ const reduction = reducer.reduce(modelContracts, traceId);
109
+ if (auditLog) {
110
+ auditLog.append({
111
+ type: "consensus",
112
+ traceId,
113
+ agreementRatio: reduction.agreementRatio,
114
+ consensusReached: reduction.consensusReached,
115
+ conflictCount: reduction.conflicts.length,
116
+ modelCount: modelContracts.length,
117
+ validModelCount: modelResults.filter((r) => r.result.passed).length
118
+ });
119
+ }
120
+ return {
121
+ modelContracts,
122
+ consensus: reduction.consensus,
123
+ conflicts: reduction.conflicts.map((c) => ({
124
+ field: c.field,
125
+ values: c.values.map((v) => ({ agentId: v.agentId, value: v.value })),
126
+ resolution: c.resolution
127
+ })),
128
+ agreementRatio: reduction.agreementRatio,
129
+ consensusReached: reduction.consensusReached,
130
+ totalDurationMs: Date.now() - start,
131
+ traceId
132
+ };
133
+ }
134
+ export {
135
+ ParliamentCircuitBreaker,
136
+ ParliamentReducer,
137
+ runParliamentDeliberation,
138
+ wrapParliamentModel
139
+ };
140
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @heybeaux/lattice-adapter-parliament\n *\n * Wraps Parliament's multi-model deliberations with Lattice State Contracts,\n * Circuit Breakers, and ConsensusReducer for coordinated, auditable synthesis.\n */\n\nimport {\n createContract,\n TieredCircuitBreaker,\n ConsensusReducer,\n ComplianceAuditLog,\n wrapAgent,\n HandoffFailure,\n EventEmitter,\n globalEmitter,\n redactContract,\n} from '@heybeaux/lattice-core';\nimport type {\n TieredCircuitBreakerConfig,\n ConsensusReducerConfig,\n StateContract,\n} from '@heybeaux/lattice-core';\n\n// ─── Types ────────────────────────────────────────────────\n\n/**\n * A Parliament model participant.\n */\nexport interface ParliamentModel {\n /** Unique identifier for the model (e.g., 'claude-opus-4-6') */\n id: string;\n /** Role in the deliberation (proposer, expander, pragmatist, etc.) */\n role: string;\n /** Whether this model is adversarial (skeptic, devils-advocate) */\n isAdversarial?: boolean;\n}\n\n/**\n * Configuration for wrapping a Parliament model.\n */\nexport interface ParliamentModelConfig {\n /** Circuit breaker configuration (defaults: L1+L2 for cooperative, L1 for adversarial) */\n breaker?: TieredCircuitBreakerConfig;\n /** Whether to redact sensitive data before validation (default: true) */\n redactForValidation?: boolean;\n /** Whether to run in shadow mode (validate but don't block) (default: true) */\n shadowMode?: boolean;\n}\n\n/**\n * Configuration for the Parliament integration.\n */\nexport interface ParliamentConfig {\n /** Audit log path (optional — if provided, all deliberations are logged) */\n auditLogPath?: string;\n /** ConsensusReducer configuration */\n reducer?: ConsensusReducerConfig;\n /** Per-model configurations (optional) */\n modelConfigs?: Record<string, ParliamentModelConfig>;\n /** Default model configuration (applied to all models without specific config) */\n defaultModelConfig?: ParliamentModelConfig;\n}\n\n/**\n * Result from wrapping a Parliament deliberation.\n */\nexport interface ParliamentDeliberationResult {\n /** State Contracts for each model response */\n modelContracts: StateContract[];\n /** The consensus/synthesis output */\n consensus: unknown;\n /** Conflicts detected between models */\n conflicts: Array<{\n field: string;\n values: Array<{ agentId: string; value: unknown }>;\n resolution: string;\n }>;\n /** Agreement ratio (0-1) */\n agreementRatio: number;\n /** Whether consensus was reached */\n consensusReached: boolean;\n /** Total deliberation time in milliseconds */\n totalDurationMs: number;\n /** Trace ID for the deliberation */\n traceId: string;\n}\n\n// ─── wrapParliamentModel ──────────────────────────────────\n\n/**\n * Wrap a Parliament model call with Lattice State Contracts and Circuit Breakers.\n *\n * The wrapped model:\n * 1. Executes the original model call\n * 2. Creates a State Contract with the model's response\n * 3. Validates through Circuit Breaker (L1+L2 for cooperative, L1 for adversarial)\n * 4. Returns the State Contract\n *\n * @param model - The Parliament model definition\n * @param modelCall - The model call function: (prompt) => Promise<response>\n * @param config - Configuration for this model\n * @returns A wrapped function that returns StateContract instead of raw response\n */\nexport function wrapParliamentModel(\n model: ParliamentModel,\n modelCall: (prompt: string) => Promise<unknown>,\n config?: ParliamentModelConfig,\n) {\n const shadowMode = config?.shadowMode ?? true;\n const breakerConfig = config?.breaker ?? (\n model.isAdversarial\n ? { tier: 'L1' as const }\n : { tier: 'L1+L2' as const, l2Threshold: 0.7 }\n );\n\n const wrapped = wrapAgent(\n async (prompt: string) => modelCall(prompt),\n {\n id: model.id,\n breaker: breakerConfig,\n },\n );\n\n return async (\n prompt: string,\n traceId?: string,\n ): Promise<{ contract: StateContract; passed: boolean }> => {\n try {\n const contract = await wrapped(prompt, traceId);\n return { contract, passed: true };\n } catch (error) {\n if (error instanceof HandoffFailure) {\n // In shadow mode, return the failed contract without blocking\n if (shadowMode) {\n return { contract: error.contract, passed: false };\n }\n throw error;\n }\n throw error;\n }\n };\n}\n\n// ─── ParliamentCircuitBreaker ─────────────────────────────\n\n/**\n * A pre-configured circuit breaker for Parliament model responses.\n *\n * Cooperative models use L1+L2 validation.\n * Adversarial models use L1 only (they're supposed to be contrarian).\n */\nexport class ParliamentCircuitBreaker {\n private breakers: Map<string, TieredCircuitBreaker> = new Map();\n\n constructor(models: ParliamentModel[], configs?: Record<string, TieredCircuitBreakerConfig>) {\n for (const model of models) {\n const config = configs?.[model.id] ?? (\n model.isAdversarial\n ? { tier: 'L1' as const }\n : { tier: 'L1+L2' as const, l2Threshold: 0.7 }\n );\n this.breakers.set(model.id, new TieredCircuitBreaker(config));\n }\n }\n\n get(agentId: string): TieredCircuitBreaker | undefined {\n return this.breakers.get(agentId);\n }\n}\n\n// ─── ParliamentReducer ────────────────────────────────────\n\n/**\n * A ConsensusReducer configured for Parliament synthesis.\n *\n * Detects disagreements between model responses, computes agreement\n * ratios, and flags conflicts for the synthesizer to resolve.\n */\nexport class ParliamentReducer {\n private reducer: ConsensusReducer;\n\n constructor(config?: ConsensusReducerConfig) {\n this.reducer = new ConsensusReducer({\n conflictStrategy: config?.conflictStrategy ?? 'flag-only',\n minAgreementRatio: config?.minAgreementRatio ?? 0.6,\n consensusFields: config?.consensusFields ?? ['mainPoint', 'supportingArguments', 'conclusion'],\n includeIndividualOutputs: config?.includeIndividualOutputs ?? true,\n });\n }\n\n /**\n * Reduce multiple model responses into a consensus.\n */\n reduce(\n contracts: StateContract[],\n traceId?: string,\n ): {\n consensus: unknown;\n conflicts: Array<{\n field: string;\n values: Array<{ agentId: string; value: unknown }>;\n resolution: string;\n }>;\n agreementRatio: number;\n consensusReached: boolean;\n reducedContract: StateContract;\n } {\n const result = this.reducer.reduce(contracts);\n const reducedContract = this.reducer.createReducedContract(result, contracts, 'parliament-reducer', null);\n\n return {\n consensus: result.output,\n conflicts: result.conflicts,\n agreementRatio: result.agreementRatio,\n consensusReached: result.consensus,\n reducedContract,\n };\n }\n}\n\n// ─── ParliamentDeliberation ───────────────────────────────\n\n/**\n * Run a full Parliament deliberation with Lattice coordination.\n *\n * @param topic - The deliberation topic\n * @param models - Array of Parliament models to run\n * @param modelCalls - Map of model ID to model call function\n * @param config - Parliament configuration\n * @returns ParliamentDeliberationResult\n */\nexport async function runParliamentDeliberation(\n topic: string,\n models: ParliamentModel[],\n modelCalls: Map<string, (prompt: string) => Promise<unknown>>,\n config?: ParliamentConfig,\n): Promise<ParliamentDeliberationResult> {\n const start = Date.now();\n const traceId = createContract({\n fromAgent: 'parliament-topic',\n inputs: { topic },\n outputs: {},\n budget: { tokensUsed: 0, callsMade: 0, wallClockMs: 0 },\n }).traceId;\n\n // Set up audit log if configured\n let auditLog: ComplianceAuditLog | undefined;\n if (config?.auditLogPath) {\n auditLog = new ComplianceAuditLog({ logPath: config.auditLogPath });\n }\n\n // Run each model\n const modelContracts: StateContract[] = [];\n const modelResults: Array<{ model: ParliamentModel; result: { contract: StateContract; passed: boolean } }> = [];\n\n for (const model of models) {\n const modelCall = modelCalls.get(model.id);\n if (!modelCall) {\n continue;\n }\n\n const modelConfig = config?.modelConfigs?.[model.id] ?? config?.defaultModelConfig;\n const wrappedModel = wrapParliamentModel(model, modelCall, modelConfig);\n const result = await wrappedModel(topic, traceId);\n\n modelContracts.push(result.contract);\n modelResults.push({ model, result });\n\n // Log to audit if configured\n if (auditLog) {\n auditLog.append({\n agentId: model.id,\n modelRole: model.role,\n isAdversarial: model.isAdversarial ?? false,\n passed: result.passed,\n traceId,\n contractId: result.contract.id,\n });\n }\n }\n\n // Run consensus reduction\n const reducer = new ParliamentReducer(config?.reducer);\n const reduction = reducer.reduce(modelContracts, traceId);\n\n // Log consensus to audit\n if (auditLog) {\n auditLog.append({\n type: 'consensus',\n traceId,\n agreementRatio: reduction.agreementRatio,\n consensusReached: reduction.consensusReached,\n conflictCount: reduction.conflicts.length,\n modelCount: modelContracts.length,\n validModelCount: modelResults.filter(r => r.result.passed).length,\n });\n }\n\n return {\n modelContracts,\n consensus: reduction.consensus,\n conflicts: reduction.conflicts.map(c => ({\n field: c.field,\n values: c.values.map(v => ({ agentId: v.agentId, value: v.value })),\n resolution: c.resolution,\n })),\n agreementRatio: reduction.agreementRatio,\n consensusReached: reduction.consensusReached,\n totalDurationMs: Date.now() - start,\n traceId,\n };\n}\n\n\n"],"mappings":";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAuFA,SAAS,oBACd,OACA,WACA,QACA;AACA,QAAM,aAAa,QAAQ,cAAc;AACzC,QAAM,gBAAgB,QAAQ,YAC5B,MAAM,gBACF,EAAE,MAAM,KAAc,IACtB,EAAE,MAAM,SAAkB,aAAa,IAAI;AAGjD,QAAM,UAAU;AAAA,IACd,OAAO,WAAmB,UAAU,MAAM;AAA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;AACZ,aAAS,OAAO;AAAA,MACd,MAAM;AAAA,MACN;AAAA,MACA,gBAAgB,UAAU;AAAA,MAC1B,kBAAkB,UAAU;AAAA,MAC5B,eAAe,UAAU,UAAU;AAAA,MACnC,YAAY,eAAe;AAAA,MAC3B,iBAAiB,aAAa,OAAO,OAAK,EAAE,OAAO,MAAM,EAAE;AAAA,IAC7D,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA,WAAW,UAAU;AAAA,IACrB,WAAW,UAAU,UAAU,IAAI,QAAM;AAAA,MACvC,OAAO,EAAE;AAAA,MACT,QAAQ,EAAE,OAAO,IAAI,QAAM,EAAE,SAAS,EAAE,SAAS,OAAO,EAAE,MAAM,EAAE;AAAA,MAClE,YAAY,EAAE;AAAA,IAChB,EAAE;AAAA,IACF,gBAAgB,UAAU;AAAA,IAC1B,kBAAkB,UAAU;AAAA,IAC5B,iBAAiB,KAAK,IAAI,IAAI;AAAA,IAC9B;AAAA,EACF;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@heybeaux/lattice-adapter-parliament",
3
+ "version": "0.2.1",
4
+ "description": "Lattice coordination layer for Parliament — wraps multi-model deliberations with State Contracts and Circuit Breakers",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup src/index.ts --format esm --dts --sourcemap",
20
+ "test": "vitest run",
21
+ "typecheck": "tsc --noEmit"
22
+ },
23
+ "keywords": [
24
+ "lattice",
25
+ "parliament",
26
+ "ai-agents",
27
+ "multi-model",
28
+ "coordination",
29
+ "state-contract",
30
+ "circuit-breaker"
31
+ ],
32
+ "author": "heybeaux <https://heybeaux.dev>",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/heybeaux/lattice.git",
37
+ "directory": "packages/adapter-parliament"
38
+ },
39
+ "dependencies": {
40
+ "@heybeaux/lattice-core": "workspace:*"
41
+ },
42
+ "peerDependencies": {
43
+ "zod": "^3.0.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "zod": {
47
+ "optional": true
48
+ }
49
+ },
50
+ "devDependencies": {
51
+ "@types/node": "^22.15.0",
52
+ "tsup": "^8.4.0",
53
+ "typescript": "^5.8.3",
54
+ "vitest": "^3.1.3",
55
+ "zod": "^3.23.0"
56
+ }
57
+ }