coaiajs 0.1.0 → 0.1.2

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 (187) hide show
  1. package/README.md +7 -3
  2. package/dist/mcp/config.d.ts +4 -0
  3. package/dist/mcp/config.d.ts.map +1 -0
  4. package/dist/mcp/config.js +52 -26
  5. package/dist/mcp/config.js.map +1 -0
  6. package/dist/mcp/prompts.d.ts +19 -0
  7. package/dist/mcp/prompts.d.ts.map +1 -0
  8. package/dist/mcp/prompts.js +111 -0
  9. package/dist/mcp/prompts.js.map +1 -0
  10. package/dist/mcp/resources.d.ts +5 -0
  11. package/dist/mcp/resources.d.ts.map +1 -0
  12. package/dist/mcp/resources.js +77 -0
  13. package/dist/mcp/resources.js.map +1 -0
  14. package/dist/mcp/server.d.ts.map +1 -0
  15. package/dist/mcp/server.js +167 -75
  16. package/dist/mcp/server.js.map +1 -0
  17. package/dist/mcp/tools/coaiapy-tools.d.ts.map +1 -0
  18. package/dist/mcp/tools/coaiapy-tools.js +1 -0
  19. package/dist/mcp/tools/coaiapy-tools.js.map +1 -0
  20. package/dist/mcp/tools/index.d.ts.map +1 -0
  21. package/dist/mcp/tools/index.js.map +1 -0
  22. package/dist/src/audio.d.ts.map +1 -0
  23. package/dist/src/audio.js.map +1 -0
  24. package/dist/src/cli-helpers.d.ts.map +1 -0
  25. package/dist/src/cli-helpers.js.map +1 -0
  26. package/dist/src/cli.d.ts.map +1 -0
  27. package/dist/src/cli.js +4 -4
  28. package/dist/src/cli.js.map +1 -0
  29. package/dist/src/config.d.ts +2 -0
  30. package/dist/src/config.d.ts.map +1 -0
  31. package/dist/src/config.js +44 -14
  32. package/dist/src/config.js.map +1 -0
  33. package/dist/src/environment.d.ts.map +1 -0
  34. package/dist/src/environment.js.map +1 -0
  35. package/dist/src/github.d.ts.map +1 -0
  36. package/dist/src/github.js.map +1 -0
  37. package/dist/src/index.d.ts +13 -0
  38. package/dist/src/index.d.ts.map +1 -0
  39. package/dist/src/index.js +13 -0
  40. package/dist/src/index.js.map +1 -0
  41. package/dist/src/langfuse/client.d.ts.map +1 -0
  42. package/dist/src/langfuse/client.js.map +1 -0
  43. package/dist/src/langfuse/comments.d.ts.map +1 -0
  44. package/dist/src/langfuse/comments.js.map +1 -0
  45. package/dist/src/langfuse/datasets.d.ts.map +1 -0
  46. package/dist/src/langfuse/datasets.js.map +1 -0
  47. package/dist/src/langfuse/index.d.ts.map +1 -0
  48. package/dist/src/langfuse/index.js.map +1 -0
  49. package/dist/src/langfuse/media.d.ts.map +1 -0
  50. package/dist/src/langfuse/media.js.map +1 -0
  51. package/dist/src/langfuse/observations.d.ts.map +1 -0
  52. package/dist/src/langfuse/observations.js.map +1 -0
  53. package/dist/src/langfuse/prompts.d.ts.map +1 -0
  54. package/dist/src/langfuse/prompts.js.map +1 -0
  55. package/dist/src/langfuse/scores.d.ts.map +1 -0
  56. package/dist/src/langfuse/scores.js.map +1 -0
  57. package/dist/src/langfuse/traces.d.ts.map +1 -0
  58. package/dist/src/langfuse/traces.js.map +1 -0
  59. package/dist/src/llm.d.ts.map +1 -0
  60. package/dist/src/llm.js.map +1 -0
  61. package/dist/src/narrative/graph-manager.d.ts.map +1 -0
  62. package/dist/src/narrative/graph-manager.js.map +1 -0
  63. package/dist/src/narrative/index.d.ts +32 -1
  64. package/dist/src/narrative/index.d.ts.map +1 -0
  65. package/dist/src/narrative/index.js +97 -1
  66. package/dist/src/narrative/index.js.map +1 -0
  67. package/dist/src/narrative/markdown-export.d.ts.map +1 -0
  68. package/dist/src/narrative/markdown-export.js.map +1 -0
  69. package/dist/src/narrative/tool-definitions.d.ts.map +1 -0
  70. package/dist/src/narrative/tool-definitions.js.map +1 -0
  71. package/dist/src/narrative/tool-handlers.d.ts.map +1 -0
  72. package/dist/src/narrative/tool-handlers.js.map +1 -0
  73. package/dist/src/narrative/types.d.ts.map +1 -0
  74. package/dist/src/narrative/types.js.map +1 -0
  75. package/dist/src/narrative/validation.d.ts.map +1 -0
  76. package/dist/src/narrative/validation.js.map +1 -0
  77. package/dist/src/pde/index.d.ts +4 -0
  78. package/dist/src/pde/index.d.ts.map +1 -0
  79. package/dist/src/pde/index.js +19 -0
  80. package/dist/src/pde/index.js.map +1 -0
  81. package/dist/src/pde/mcp-handlers.d.ts.map +1 -0
  82. package/dist/src/pde/mcp-handlers.js.map +1 -0
  83. package/dist/src/pde/mcp-tools.d.ts.map +1 -0
  84. package/dist/src/pde/mcp-tools.js.map +1 -0
  85. package/dist/src/pde/session-manager.d.ts.map +1 -0
  86. package/dist/src/pde/session-manager.js.map +1 -0
  87. package/dist/src/pde/stc-mapper.d.ts.map +1 -0
  88. package/dist/src/pde/stc-mapper.js.map +1 -0
  89. package/dist/src/pipeline/index.d.ts.map +1 -0
  90. package/dist/src/pipeline/index.js.map +1 -0
  91. package/dist/src/pipeline/template-engine.d.ts.map +1 -0
  92. package/dist/src/pipeline/template-engine.js.map +1 -0
  93. package/dist/src/planning/index.d.ts +3 -0
  94. package/dist/src/planning/index.d.ts.map +1 -0
  95. package/dist/src/planning/index.js +13 -0
  96. package/dist/src/planning/index.js.map +1 -0
  97. package/dist/src/planning/mcp-handlers.d.ts.map +1 -0
  98. package/dist/src/planning/mcp-handlers.js.map +1 -0
  99. package/dist/src/planning/mcp-tools.d.ts.map +1 -0
  100. package/dist/src/planning/mcp-tools.js.map +1 -0
  101. package/dist/src/planning/plan-parser.d.ts.map +1 -0
  102. package/dist/src/planning/plan-parser.js.map +1 -0
  103. package/dist/src/redis.d.ts.map +1 -0
  104. package/dist/src/redis.js +20 -8
  105. package/dist/src/redis.js.map +1 -0
  106. package/dist/src/types.d.ts +1 -0
  107. package/dist/src/types.d.ts.map +1 -0
  108. package/dist/src/types.js.map +1 -0
  109. package/package.json +67 -2
  110. package/rispecs/00-coaiajs-platform.spec.md +23 -10
  111. package/rispecs/01-core-config.spec.md +7 -37
  112. package/rispecs/02-redis-module.spec.md +2 -1
  113. package/rispecs/03-langfuse-module.spec.md +7 -5
  114. package/rispecs/04-narrative-engine.spec.md +9 -9
  115. package/rispecs/05-pde-engine.spec.md +23 -23
  116. package/rispecs/06-planning-engine.spec.md +14 -13
  117. package/rispecs/07-pipeline-templates.spec.md +7 -7
  118. package/rispecs/08-cli-interface.spec.md +13 -25
  119. package/rispecs/09-mcp-server.spec.md +57 -62
  120. package/rispecs/10-audio-module.spec.md +3 -3
  121. package/rispecs/KINSHIP.md +4 -4
  122. package/rispecs/README.md +33 -7
  123. package/articles/academic/creative-orientation-vs-problem-solving.md +0 -177
  124. package/articles/academic/jsonl-knowledge-graphs-agent-memory.md +0 -142
  125. package/articles/academic/langfuse-observability-llm-pipelines.md +0 -144
  126. package/articles/academic/medicine-wheel-software-architecture.md +0 -163
  127. package/articles/academic/mmot-autonomous-agents.md +0 -156
  128. package/articles/academic/model-context-protocol-interagent.md +0 -161
  129. package/articles/academic/pde-prompt-decomposition.md +0 -186
  130. package/articles/academic/structural-tension-in-ai-agents.md +0 -134
  131. package/articles/reviews/mcp-protocol-design-review.md +0 -170
  132. package/articles/reviews/observability-ai-systems-review.md +0 -176
  133. package/articles/reviews/prompt-engineering-decomposition-review.md +0 -184
  134. package/articles/surveys/agent-orchestration-survey.md +0 -186
  135. package/articles/surveys/knowledge-graph-storage-survey.md +0 -204
  136. package/articles/surveys/structural-tension-methodology-survey.md +0 -154
  137. package/articles/technical/aws-sdk-v3-polly.md +0 -270
  138. package/articles/technical/commander-cli-framework.md +0 -262
  139. package/articles/technical/dotenv-config-patterns.md +0 -360
  140. package/articles/technical/ioredis-vs-redis.md +0 -142
  141. package/articles/technical/langfuse-js-sdk-vs-rest.md +0 -191
  142. package/articles/technical/mcp-sdk-typescript.md +0 -291
  143. package/articles/technical/octokit-github-api.md +0 -293
  144. package/articles/technical/openai-sdk-modern.md +0 -231
  145. package/articles/technical/yaml-parsing-node.md +0 -266
  146. package/articles/technical/zod-runtime-validation.md +0 -212
  147. package/mcp/config.ts +0 -196
  148. package/mcp/server.ts +0 -402
  149. package/mcp/tools/coaiapy-tools.ts +0 -364
  150. package/mcp/tools/index.ts +0 -4
  151. package/src/audio.ts +0 -76
  152. package/src/cli-helpers.ts +0 -86
  153. package/src/cli.ts +0 -1223
  154. package/src/config.ts +0 -172
  155. package/src/environment.ts +0 -171
  156. package/src/github.ts +0 -143
  157. package/src/langfuse/client.ts +0 -105
  158. package/src/langfuse/comments.ts +0 -52
  159. package/src/langfuse/datasets.ts +0 -178
  160. package/src/langfuse/index.ts +0 -33
  161. package/src/langfuse/media.ts +0 -193
  162. package/src/langfuse/observations.ts +0 -131
  163. package/src/langfuse/prompts.ts +0 -157
  164. package/src/langfuse/scores.ts +0 -456
  165. package/src/langfuse/traces.ts +0 -276
  166. package/src/llm.ts +0 -106
  167. package/src/narrative/graph-manager.ts +0 -1358
  168. package/src/narrative/index.ts +0 -32
  169. package/src/narrative/markdown-export.ts +0 -535
  170. package/src/narrative/tool-definitions.ts +0 -635
  171. package/src/narrative/tool-handlers.ts +0 -528
  172. package/src/narrative/types.ts +0 -9
  173. package/src/narrative/validation.ts +0 -179
  174. package/src/pde/index.ts +0 -8
  175. package/src/pde/mcp-handlers.ts +0 -359
  176. package/src/pde/mcp-tools.ts +0 -201
  177. package/src/pde/session-manager.ts +0 -248
  178. package/src/pde/stc-mapper.ts +0 -298
  179. package/src/pipeline/index.ts +0 -7
  180. package/src/pipeline/template-engine.ts +0 -398
  181. package/src/planning/index.ts +0 -13
  182. package/src/planning/mcp-handlers.ts +0 -369
  183. package/src/planning/mcp-tools.ts +0 -155
  184. package/src/planning/plan-parser.ts +0 -587
  185. package/src/redis.ts +0 -97
  186. package/src/types.ts +0 -280
  187. package/tsconfig.json +0 -26
package/src/types.ts DELETED
@@ -1,280 +0,0 @@
1
- // coaiajs/src/types.ts — Shared types
2
- // Union of coaia-narrative + coaia-pde + coaia-planning type systems
3
-
4
- // ─── Knowledge Graph Core ────────────────────────────────────────────
5
-
6
- export interface Entity {
7
- name: string;
8
- entityType: string;
9
- observations: string[];
10
- metadata?: EntityMetadata;
11
- }
12
-
13
- export interface EntityMetadata {
14
- dueDate?: string;
15
- chartId?: string;
16
- phase?: 'germination' | 'assimilation' | 'completion';
17
- completionStatus?: boolean;
18
- parentChart?: string;
19
- parentActionStep?: string;
20
- level?: number;
21
- createdAt?: string;
22
- updatedAt?: string;
23
- direction?: string;
24
- confidence?: number;
25
- implicit?: boolean;
26
- pdeId?: string;
27
- act?: number;
28
- type_dramatic?: string;
29
- universes?: string[];
30
- timestamp?: string;
31
- elementsOfPerformance?: Array<{ description: string; type: 'DESIGN' | 'EXECUTION' }>;
32
- mmotEvaluations?: Array<{
33
- phase: 'acknowledge' | 'analyze' | 'update' | 'recommit';
34
- assessment: string;
35
- direction?: 'South' | 'East' | 'West' | 'North';
36
- timestamp: string;
37
- }>;
38
- relationalAlignment?: {
39
- assessed: boolean;
40
- score: number | null;
41
- principles: string[];
42
- };
43
- fourDirections?: {
44
- north_vision: string | null;
45
- east_intention: string | null;
46
- south_emotion: string | null;
47
- west_introspection: string | null;
48
- };
49
- narrative?: {
50
- description: string;
51
- prose: string;
52
- lessons: string[];
53
- };
54
- order?: number;
55
- }
56
-
57
- export interface Relation {
58
- from: string;
59
- to: string;
60
- relationType: string;
61
- metadata?: RelationMetadata;
62
- }
63
-
64
- export interface RelationMetadata {
65
- createdAt?: string;
66
- strength?: number;
67
- context?: string;
68
- description?: string;
69
- }
70
-
71
- export interface KnowledgeGraph {
72
- entities: Entity[];
73
- relations: Relation[];
74
- }
75
-
76
- export interface McpToolResult {
77
- content: Array<{ type: string; text: string }>;
78
- isError?: boolean;
79
- }
80
-
81
- // ─── PDE Types ───────────────────────────────────────────────────────
82
-
83
- export type Urgency = 'immediate' | 'session' | 'persistent';
84
- export type Direction = 'east' | 'south' | 'west' | 'north';
85
-
86
- export interface PrimaryIntent {
87
- action: string;
88
- target: string;
89
- urgency: Urgency;
90
- confidence: number;
91
- }
92
-
93
- export interface SecondaryIntent {
94
- action: string;
95
- target: string;
96
- implicit: boolean;
97
- dependency: string | null;
98
- confidence: number;
99
- }
100
-
101
- export interface ContextRequirements {
102
- files_needed: string[];
103
- tools_required: string[];
104
- assumptions: string[];
105
- }
106
-
107
- export interface ExpectedOutputs {
108
- artifacts: string[];
109
- updates: string[];
110
- communications: string[];
111
- }
112
-
113
- export interface DirectionItem {
114
- text: string;
115
- confidence: number;
116
- implicit: boolean;
117
- }
118
-
119
- export type DirectionMap = Record<Direction, DirectionItem[]>;
120
-
121
- export interface ActionItem {
122
- text: string;
123
- direction: Direction;
124
- dependency: string | null;
125
- completed?: boolean;
126
- }
127
-
128
- export interface AmbiguityFlag {
129
- text: string;
130
- suggestion: string;
131
- }
132
-
133
- export interface DecompositionResult {
134
- primary: PrimaryIntent;
135
- secondary: SecondaryIntent[];
136
- context: ContextRequirements;
137
- outputs: ExpectedOutputs;
138
- directions: DirectionMap;
139
- actionStack: ActionItem[];
140
- ambiguities: AmbiguityFlag[];
141
- }
142
-
143
- export interface StoredDecomposition {
144
- id: string;
145
- timestamp: string;
146
- prompt: string;
147
- result: DecompositionResult;
148
- options: DecompositionOptions;
149
- markdownPath?: string;
150
- }
151
-
152
- export interface DecompositionOptions {
153
- extractImplicit: boolean;
154
- mapDependencies: boolean;
155
- }
156
-
157
- export interface PdeSession {
158
- type: 'pde_session';
159
- sessionId: string;
160
- originalPrompt: string;
161
- masterChartId: string;
162
- pdeDecompositionId?: string;
163
- createdAt: string;
164
- updatedAt: string;
165
- status: 'active' | 'completed' | 'abandoned';
166
- metadata?: Record<string, unknown>;
167
- }
168
-
169
- export const URGENCY_DAYS: Record<string, number> = {
170
- immediate: 1,
171
- session: 7,
172
- persistent: 30,
173
- };
174
-
175
- // ─── Plan Parser Types ───────────────────────────────────────────────
176
-
177
- export interface StructuralElement {
178
- type: 'desired_outcome' | 'current_reality' | 'action_step' | 'observation';
179
- content: string;
180
- confidence: number;
181
- sourceLines: { start: number; end: number };
182
- telescopesInto?: StructuralTensionPlan;
183
- }
184
-
185
- export interface StructuralTensionPlan {
186
- title: string;
187
- filePath: string;
188
- desiredOutcome: StructuralElement | null;
189
- currentReality: StructuralElement | null;
190
- actionSteps: StructuralElement[];
191
- observations: string[];
192
- metadata: {
193
- parsedAt: string;
194
- telescopeLevel: number;
195
- parentAction?: string;
196
- dueDate?: string;
197
- completionStatus: 'pending' | 'in_progress' | 'completed';
198
- };
199
- }
200
-
201
- // ─── Langfuse Types ──────────────────────────────────────────────────
202
-
203
- export interface ScoreCategory {
204
- label: string;
205
- value: number;
206
- }
207
-
208
- export interface ScoreConfig {
209
- name: string;
210
- dataType: 'NUMERIC' | 'CATEGORICAL' | 'BOOLEAN';
211
- description?: string;
212
- categories?: ScoreCategory[];
213
- minValue?: number;
214
- maxValue?: number;
215
- isArchived?: boolean;
216
- }
217
-
218
- // ─── Pipeline Types ──────────────────────────────────────────────────
219
-
220
- export interface PipelineVariable {
221
- name: string;
222
- type: string;
223
- required: boolean;
224
- default?: string;
225
- description?: string;
226
- choices?: string[];
227
- }
228
-
229
- export interface PipelineStep {
230
- name: string;
231
- observationType: string;
232
- description?: string;
233
- parent?: string;
234
- variables?: Record<string, string>;
235
- metadata?: Record<string, unknown>;
236
- conditional?: string;
237
- }
238
-
239
- export interface PipelineTemplate {
240
- name: string;
241
- version: string;
242
- description: string;
243
- author?: string;
244
- createdAt?: string;
245
- variables: PipelineVariable[];
246
- steps: PipelineStep[];
247
- extends?: string;
248
- metadata?: Record<string, unknown>;
249
- }
250
-
251
- // ─── Config Types ────────────────────────────────────────────────────
252
-
253
- export interface CoaiaConfig {
254
- redis?: {
255
- url?: string;
256
- host?: string;
257
- port?: number;
258
- password?: string;
259
- upstashUrl?: string;
260
- upstashToken?: string;
261
- };
262
- langfuse?: {
263
- publicKey?: string;
264
- secretKey?: string;
265
- baseUrl?: string;
266
- };
267
- openai?: {
268
- apiKey?: string;
269
- model?: string;
270
- };
271
- aws?: {
272
- accessKeyId?: string;
273
- secretAccessKey?: string;
274
- region?: string;
275
- };
276
- github?: {
277
- token?: string;
278
- };
279
- [key: string]: unknown;
280
- }
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "strict": true,
7
- "esModuleInterop": true,
8
- "outDir": "./dist",
9
- "rootDir": ".",
10
- "declaration": true,
11
- "declarationMap": true,
12
- "sourceMap": true,
13
- "skipLibCheck": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "resolveJsonModule": true
16
- },
17
- "include": [
18
- "src/**/*",
19
- "mcp/**/*"
20
- ],
21
- "exclude": [
22
- "node_modules",
23
- "dist",
24
- "tests"
25
- ]
26
- }