decisionmemos 1.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 (40) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +21 -0
  3. package/README.md +191 -0
  4. package/dist/src/clients/anthropic-client.d.ts +16 -0
  5. package/dist/src/clients/anthropic-client.d.ts.map +1 -0
  6. package/dist/src/clients/anthropic-client.js +67 -0
  7. package/dist/src/clients/anthropic-client.js.map +1 -0
  8. package/dist/src/clients/google-client.d.ts +16 -0
  9. package/dist/src/clients/google-client.d.ts.map +1 -0
  10. package/dist/src/clients/google-client.js +59 -0
  11. package/dist/src/clients/google-client.js.map +1 -0
  12. package/dist/src/clients/index.d.ts +10 -0
  13. package/dist/src/clients/index.d.ts.map +1 -0
  14. package/dist/src/clients/index.js +9 -0
  15. package/dist/src/clients/index.js.map +1 -0
  16. package/dist/src/clients/model-interface.d.ts +60 -0
  17. package/dist/src/clients/model-interface.d.ts.map +1 -0
  18. package/dist/src/clients/model-interface.js +109 -0
  19. package/dist/src/clients/model-interface.js.map +1 -0
  20. package/dist/src/clients/openai-client.d.ts +16 -0
  21. package/dist/src/clients/openai-client.d.ts.map +1 -0
  22. package/dist/src/clients/openai-client.js +82 -0
  23. package/dist/src/clients/openai-client.js.map +1 -0
  24. package/dist/src/clients/xai-client.d.ts +16 -0
  25. package/dist/src/clients/xai-client.d.ts.map +1 -0
  26. package/dist/src/clients/xai-client.js +71 -0
  27. package/dist/src/clients/xai-client.js.map +1 -0
  28. package/dist/src/index.d.ts +20 -0
  29. package/dist/src/index.d.ts.map +1 -0
  30. package/dist/src/index.js +20 -0
  31. package/dist/src/index.js.map +1 -0
  32. package/dist/src/multi-model-query.d.ts +97 -0
  33. package/dist/src/multi-model-query.d.ts.map +1 -0
  34. package/dist/src/multi-model-query.js +121 -0
  35. package/dist/src/multi-model-query.js.map +1 -0
  36. package/dist/src/types.d.ts +184 -0
  37. package/dist/src/types.d.ts.map +1 -0
  38. package/dist/src/types.js +5 -0
  39. package/dist/src/types.js.map +1 -0
  40. package/package.json +69 -0
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Core types for the multi-model decision framework
3
+ */
4
+ export interface ModelConfig {
5
+ name: string;
6
+ provider: 'openai' | 'xai' | 'anthropic' | 'google';
7
+ model: string;
8
+ apiKey: string;
9
+ enabled: boolean;
10
+ }
11
+ export interface DecisionContext {
12
+ projectBrief: string;
13
+ constraints: string;
14
+ examples: string;
15
+ specificContext?: string;
16
+ /** Compiled context from the dynamic briefing intake */
17
+ briefingContext?: string;
18
+ }
19
+ export interface DecisionCriteria {
20
+ name: string;
21
+ description: string;
22
+ }
23
+ export interface DecisionQuery {
24
+ question: string;
25
+ context: DecisionContext;
26
+ criteria: DecisionCriteria[];
27
+ category?: string;
28
+ /** Optional localisation hints derived from the request (OS, locale, timezone). */
29
+ hiddenContext?: HiddenPromptContext;
30
+ }
31
+ export interface ModelResponse {
32
+ modelName: string;
33
+ provider: string;
34
+ response: string;
35
+ timestamp: Date;
36
+ tokensUsed?: number;
37
+ latency: number;
38
+ error?: string;
39
+ /** Persona title (e.g. "The Strategist") — set by the aggregator */
40
+ persona?: string;
41
+ }
42
+ export interface ConsensusAnalysis {
43
+ agreements: string[];
44
+ divergences: {
45
+ aspect: string;
46
+ positions: Record<string, string>;
47
+ }[];
48
+ uniqueInsights: Record<string, string[]>;
49
+ }
50
+ export type ConsensusLevel = 'strong' | 'moderate' | 'weak';
51
+ export interface DecisionRecommendation {
52
+ decision: string;
53
+ rationale: string;
54
+ consensusLevel: ConsensusLevel;
55
+ tradeoffs: string[];
56
+ implementation: string[];
57
+ risks: string[];
58
+ }
59
+ export interface ComparisonMatrix {
60
+ query: DecisionQuery;
61
+ responses: ModelResponse[];
62
+ consensus: ConsensusAnalysis;
63
+ recommendation: DecisionRecommendation;
64
+ timestamp: Date;
65
+ }
66
+ export interface DecisionMemo {
67
+ /** Short title derived from the question */
68
+ title: string;
69
+ /** The original question asked */
70
+ question: string;
71
+ /** The panel's synthesised verdict */
72
+ verdict: {
73
+ decision: string;
74
+ rationale: string;
75
+ consensusLevel: ConsensusLevel;
76
+ /** Human-readable consensus string, e.g. "The panel is united." */
77
+ consensusDisplay: string;
78
+ };
79
+ /** Individual advisor perspectives, labelled by archetype title */
80
+ perspectives: {
81
+ advisor: string;
82
+ /** e.g. "strategist", "analyst", "challenger", "architect" */
83
+ advisorId: string;
84
+ response: string;
85
+ latency: number;
86
+ tokensUsed?: number;
87
+ }[];
88
+ /** Points all advisors agree on */
89
+ agreements: string[];
90
+ /** Areas where advisors disagree */
91
+ divergences: {
92
+ aspect: string;
93
+ positions: {
94
+ [advisor: string]: string;
95
+ };
96
+ }[];
97
+ /** Identified trade-offs */
98
+ tradeoffs: string[];
99
+ /** Identified risks and mitigations */
100
+ risks: string[];
101
+ /** Concrete next steps */
102
+ implementationSteps: string[];
103
+ /** Metadata for transparency and cost tracking */
104
+ metadata: {
105
+ timestamp: string;
106
+ totalLatency: number;
107
+ advisorLatencies: {
108
+ advisor: string;
109
+ latency: number;
110
+ }[];
111
+ modelsUsed: {
112
+ advisor: string;
113
+ provider: string;
114
+ model: string;
115
+ }[];
116
+ estimatedCost?: number;
117
+ mode: 'standard' | 'deep';
118
+ };
119
+ }
120
+ export interface HiddenPromptContext {
121
+ /** Client IP (consider redacting or omitting in logs; useful for regional tailoring) */
122
+ clientIp?: string;
123
+ /** Inferred OS from User-Agent (e.g. Windows, macOS, Linux, iOS, Android) */
124
+ inferredOs?: string;
125
+ /** Inferred browser from User-Agent (e.g. Chrome, Safari, Firefox) */
126
+ inferredBrowser?: string;
127
+ /** Raw Accept-Language header (e.g. "en-US,en;q=0.9") */
128
+ acceptLanguage?: string;
129
+ /** Primary locale hint (e.g. "en-US") derived from Accept-Language */
130
+ inferredLocale?: string;
131
+ /** Client-reported timezone (e.g. "America/New_York") if sent via header or body */
132
+ timezone?: string;
133
+ /** Referer URL if present (can indicate in-app vs external) */
134
+ referer?: string;
135
+ /** Request ID for tracing (already in use elsewhere) */
136
+ requestId?: string;
137
+ /** ISO 3166-1 alpha-2 country code from IP geolocation (e.g. "AU") */
138
+ geoCountry?: string;
139
+ /** Full country name resolved from geoCountry (e.g. "Australia") */
140
+ geoCountryName?: string;
141
+ /** Region / state from IP geolocation (e.g. "New South Wales") */
142
+ geoRegion?: string;
143
+ /** City from IP geolocation (e.g. "Sydney") */
144
+ geoCity?: string;
145
+ /** Timezone from IP geolocation (e.g. "Australia/Sydney") */
146
+ geoTimezone?: string;
147
+ /** Whether the IP is located in an EU member state */
148
+ geoIsEU?: boolean;
149
+ }
150
+ export interface DecisionBrief {
151
+ /** Structured situational context: what, who, domain, stakes */
152
+ projectBrief: string;
153
+ /** Extracted constraints: timeline, budget, team, risk, dependencies */
154
+ constraints: string;
155
+ /** Inferred decision framework: type, dimensions, success criteria */
156
+ decisionFramework: string;
157
+ /** The original question rewritten for maximum clarity (same intent, better structure) */
158
+ reengineeredQuestion: string;
159
+ }
160
+ export interface BriefingQuestion {
161
+ id: string;
162
+ prompt: string;
163
+ options: {
164
+ id: string;
165
+ label: string;
166
+ }[];
167
+ allowMultiple: boolean;
168
+ }
169
+ export interface BriefingAnswers {
170
+ [questionId: string]: string[];
171
+ }
172
+ export interface DecisionLog {
173
+ id: string;
174
+ category: string;
175
+ query: DecisionQuery;
176
+ matrix: ComparisonMatrix;
177
+ memo?: DecisionMemo;
178
+ finalDecision: string;
179
+ decisionMaker: 'ai' | 'chairman';
180
+ implementationStatus: 'pending' | 'in-progress' | 'completed';
181
+ createdAt: Date;
182
+ updatedAt: Date;
183
+ }
184
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,WAAW,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C;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAMD,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAMD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzC,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAChC;AAMD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,IAAI,GAAG,UAAU,CAAC;IACjC,oBAAoB,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;IAC9D,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Core types for the multi-model decision framework
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "decisionmemos",
3
+ "version": "1.1.0",
4
+ "description": "Query multiple AI models in parallel — GPT, Claude, Grok, and Gemini in one call. Typed responses, zero boilerplate.",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "dist/src/index.js",
8
+ "types": "dist/src/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/src/index.d.ts",
12
+ "import": "./dist/src/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist/src/index.*",
17
+ "dist/src/multi-model-query.*",
18
+ "dist/src/types.*",
19
+ "dist/src/clients/**/*",
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ "LICENSE"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "consultation": "tsx bin/run-consultation.ts",
27
+ "generate-examples": "tsx scripts/generate-example-consultations.ts",
28
+ "typecheck": "tsc --noEmit",
29
+ "test": "vitest run",
30
+ "test:watch": "vitest"
31
+ },
32
+ "keywords": [
33
+ "ai",
34
+ "multi-model",
35
+ "decisionmemos",
36
+ "decision-support",
37
+ "ai-consultation",
38
+ "consensus",
39
+ "advisory-panel",
40
+ "gpt",
41
+ "claude",
42
+ "grok",
43
+ "gemini",
44
+ "openai",
45
+ "anthropic",
46
+ "structured-output"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/decisionmemos/decisionmemos"
51
+ },
52
+ "homepage": "https://decisionmemos.com",
53
+ "license": "MIT",
54
+ "dependencies": {
55
+ "@anthropic-ai/sdk": "^0.72.1",
56
+ "@google/generative-ai": "^0.24.1",
57
+ "dotenv": "^16.4.7",
58
+ "openai": "^6.17.0"
59
+ },
60
+ "devDependencies": {
61
+ "@types/node": "^22.10.5",
62
+ "tsx": "^4.19.2",
63
+ "typescript": "^5.7.2",
64
+ "vitest": "^4.0.18"
65
+ },
66
+ "engines": {
67
+ "node": ">=20.0.0"
68
+ }
69
+ }