praisonai 1.2.2 → 1.2.3

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 (160) hide show
  1. package/dist/agent/simple.js +1 -1
  2. package/dist/cli/commands/auto.d.ts +12 -0
  3. package/dist/cli/commands/auto.js +109 -0
  4. package/dist/cli/commands/autonomy.d.ts +5 -0
  5. package/dist/cli/commands/autonomy.js +152 -0
  6. package/dist/cli/commands/cache.d.ts +9 -0
  7. package/dist/cli/commands/cache.js +143 -0
  8. package/dist/cli/commands/chat.d.ts +14 -0
  9. package/dist/cli/commands/chat.js +127 -0
  10. package/dist/cli/commands/checkpoints.d.ts +5 -0
  11. package/dist/cli/commands/checkpoints.js +236 -0
  12. package/dist/cli/commands/context.d.ts +11 -0
  13. package/dist/cli/commands/context.js +182 -0
  14. package/dist/cli/commands/cost.d.ts +5 -0
  15. package/dist/cli/commands/cost.js +146 -0
  16. package/dist/cli/commands/db.d.ts +9 -0
  17. package/dist/cli/commands/db.js +149 -0
  18. package/dist/cli/commands/eval.d.ts +17 -0
  19. package/dist/cli/commands/eval.js +247 -0
  20. package/dist/cli/commands/external-agents.d.ts +5 -0
  21. package/dist/cli/commands/external-agents.js +169 -0
  22. package/dist/cli/commands/fast-context.d.ts +5 -0
  23. package/dist/cli/commands/fast-context.js +126 -0
  24. package/dist/cli/commands/flow.d.ts +5 -0
  25. package/dist/cli/commands/flow.js +141 -0
  26. package/dist/cli/commands/git.d.ts +5 -0
  27. package/dist/cli/commands/git.js +178 -0
  28. package/dist/cli/commands/graph-rag.d.ts +9 -0
  29. package/dist/cli/commands/graph-rag.js +131 -0
  30. package/dist/cli/commands/guardrail.d.ts +11 -0
  31. package/dist/cli/commands/guardrail.js +156 -0
  32. package/dist/cli/commands/handoff.d.ts +9 -0
  33. package/dist/cli/commands/handoff.js +133 -0
  34. package/dist/cli/commands/help.d.ts +8 -0
  35. package/dist/cli/commands/help.js +167 -0
  36. package/dist/cli/commands/image.d.ts +13 -0
  37. package/dist/cli/commands/image.js +192 -0
  38. package/dist/cli/commands/interactive.d.ts +6 -0
  39. package/dist/cli/commands/interactive.js +79 -0
  40. package/dist/cli/commands/jobs.d.ts +5 -0
  41. package/dist/cli/commands/jobs.js +282 -0
  42. package/dist/cli/commands/knowledge.d.ts +9 -0
  43. package/dist/cli/commands/knowledge.js +226 -0
  44. package/dist/cli/commands/mcp.d.ts +9 -0
  45. package/dist/cli/commands/mcp.js +243 -0
  46. package/dist/cli/commands/memory.d.ts +10 -0
  47. package/dist/cli/commands/memory.js +198 -0
  48. package/dist/cli/commands/n8n.d.ts +5 -0
  49. package/dist/cli/commands/n8n.js +137 -0
  50. package/dist/cli/commands/observability.d.ts +9 -0
  51. package/dist/cli/commands/observability.js +145 -0
  52. package/dist/cli/commands/planning.d.ts +9 -0
  53. package/dist/cli/commands/planning.js +167 -0
  54. package/dist/cli/commands/prompt-expand.d.ts +11 -0
  55. package/dist/cli/commands/prompt-expand.js +100 -0
  56. package/dist/cli/commands/providers.d.ts +9 -0
  57. package/dist/cli/commands/providers.js +98 -0
  58. package/dist/cli/commands/query-rewrite.d.ts +12 -0
  59. package/dist/cli/commands/query-rewrite.js +102 -0
  60. package/dist/cli/commands/repo-map.d.ts +5 -0
  61. package/dist/cli/commands/repo-map.js +151 -0
  62. package/dist/cli/commands/reranker.d.ts +10 -0
  63. package/dist/cli/commands/reranker.js +144 -0
  64. package/dist/cli/commands/research.d.ts +12 -0
  65. package/dist/cli/commands/research.js +108 -0
  66. package/dist/cli/commands/router.d.ts +11 -0
  67. package/dist/cli/commands/router.js +142 -0
  68. package/dist/cli/commands/run.d.ts +14 -0
  69. package/dist/cli/commands/run.js +111 -0
  70. package/dist/cli/commands/sandbox.d.ts +5 -0
  71. package/dist/cli/commands/sandbox.js +135 -0
  72. package/dist/cli/commands/scheduler.d.ts +5 -0
  73. package/dist/cli/commands/scheduler.js +260 -0
  74. package/dist/cli/commands/session.d.ts +9 -0
  75. package/dist/cli/commands/session.js +238 -0
  76. package/dist/cli/commands/skills.d.ts +9 -0
  77. package/dist/cli/commands/skills.js +256 -0
  78. package/dist/cli/commands/telemetry.d.ts +9 -0
  79. package/dist/cli/commands/telemetry.js +146 -0
  80. package/dist/cli/commands/tools.d.ts +9 -0
  81. package/dist/cli/commands/tools.js +172 -0
  82. package/dist/cli/commands/vector.d.ts +10 -0
  83. package/dist/cli/commands/vector.js +171 -0
  84. package/dist/cli/commands/version.d.ts +8 -0
  85. package/dist/cli/commands/version.js +68 -0
  86. package/dist/cli/commands/voice.d.ts +10 -0
  87. package/dist/cli/commands/voice.js +162 -0
  88. package/dist/cli/commands/workflow.d.ts +13 -0
  89. package/dist/cli/commands/workflow.js +184 -0
  90. package/dist/cli/config/index.d.ts +6 -0
  91. package/dist/cli/config/index.js +22 -0
  92. package/dist/cli/config/load.d.ts +20 -0
  93. package/dist/cli/config/load.js +229 -0
  94. package/dist/cli/config/resolve.d.ts +28 -0
  95. package/dist/cli/config/resolve.js +70 -0
  96. package/dist/cli/config/schema.d.ts +15 -0
  97. package/dist/cli/config/schema.js +65 -0
  98. package/dist/cli/features/autonomy-mode.d.ts +98 -0
  99. package/dist/cli/features/autonomy-mode.js +266 -0
  100. package/dist/cli/features/background-jobs.d.ts +155 -0
  101. package/dist/cli/features/background-jobs.js +416 -0
  102. package/dist/cli/features/checkpoints.d.ts +126 -0
  103. package/dist/cli/features/checkpoints.js +288 -0
  104. package/dist/cli/features/cost-tracker.d.ts +101 -0
  105. package/dist/cli/features/cost-tracker.js +212 -0
  106. package/dist/cli/features/external-agents.d.ts +115 -0
  107. package/dist/cli/features/external-agents.js +294 -0
  108. package/dist/cli/features/fast-context.d.ts +126 -0
  109. package/dist/cli/features/fast-context.js +310 -0
  110. package/dist/cli/features/flow-display.d.ts +100 -0
  111. package/dist/cli/features/flow-display.js +254 -0
  112. package/dist/cli/features/git-integration.d.ts +138 -0
  113. package/dist/cli/features/git-integration.js +374 -0
  114. package/dist/cli/features/index.d.ts +17 -0
  115. package/dist/cli/features/index.js +102 -0
  116. package/dist/cli/features/interactive-tui.d.ts +114 -0
  117. package/dist/cli/features/interactive-tui.js +326 -0
  118. package/dist/cli/features/n8n-integration.d.ts +108 -0
  119. package/dist/cli/features/n8n-integration.js +296 -0
  120. package/dist/cli/features/repo-map.d.ts +101 -0
  121. package/dist/cli/features/repo-map.js +350 -0
  122. package/dist/cli/features/sandbox-executor.d.ts +89 -0
  123. package/dist/cli/features/sandbox-executor.js +314 -0
  124. package/dist/cli/features/scheduler.d.ts +111 -0
  125. package/dist/cli/features/scheduler.js +298 -0
  126. package/dist/cli/features/slash-commands.d.ts +77 -0
  127. package/dist/cli/features/slash-commands.js +316 -0
  128. package/dist/cli/index.d.ts +19 -15
  129. package/dist/cli/index.js +163 -123
  130. package/dist/cli/output/errors.d.ts +32 -0
  131. package/dist/cli/output/errors.js +72 -0
  132. package/dist/cli/output/index.d.ts +6 -0
  133. package/dist/cli/output/index.js +22 -0
  134. package/dist/cli/output/json.d.ts +17 -0
  135. package/dist/cli/output/json.js +54 -0
  136. package/dist/cli/output/pretty.d.ts +21 -0
  137. package/dist/cli/output/pretty.js +106 -0
  138. package/dist/cli/runtime/env.d.ts +12 -0
  139. package/dist/cli/runtime/env.js +49 -0
  140. package/dist/cli/runtime/exit.d.ts +11 -0
  141. package/dist/cli/runtime/exit.js +49 -0
  142. package/dist/cli/runtime/index.d.ts +6 -0
  143. package/dist/cli/runtime/index.js +22 -0
  144. package/dist/cli/runtime/lazy.d.ts +18 -0
  145. package/dist/cli/runtime/lazy.js +85 -0
  146. package/dist/cli/spec/cli-spec.d.ts +87 -0
  147. package/dist/cli/spec/cli-spec.js +478 -0
  148. package/dist/cli/spec/index.d.ts +4 -0
  149. package/dist/cli/spec/index.js +20 -0
  150. package/dist/index.d.ts +4 -1
  151. package/dist/index.js +100 -7
  152. package/dist/memory/auto-memory.d.ts +136 -0
  153. package/dist/memory/auto-memory.js +301 -0
  154. package/dist/memory/file-memory.d.ts +88 -0
  155. package/dist/memory/file-memory.js +287 -0
  156. package/dist/memory/index.d.ts +2 -0
  157. package/dist/memory/index.js +11 -1
  158. package/dist/workflows/loop.d.ts +0 -0
  159. package/dist/workflows/loop.js +1 -0
  160. package/package.json +1 -1
@@ -0,0 +1,478 @@
1
+ "use strict";
2
+ /**
3
+ * PraisonAI CLI Specification - TypeScript Runtime
4
+ * Parsed and validated spec from cli-spec.v1.yaml
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CONFIG_FILES = exports.ENV_VARS = exports.EXIT_CODES = exports.GLOBAL_FLAGS = exports.COMMANDS = exports.CLI_SPEC_VERSION = void 0;
8
+ exports.validateCommand = validateCommand;
9
+ exports.getCommandSpec = getCommandSpec;
10
+ exports.getAllFlags = getAllFlags;
11
+ exports.CLI_SPEC_VERSION = '1.0.0';
12
+ exports.COMMANDS = {
13
+ chat: {
14
+ description: 'Chat with an AI agent',
15
+ args: [
16
+ { name: 'prompt', type: 'string', required: true, position: 0 }
17
+ ],
18
+ flags: [
19
+ { name: 'model', short: 'm', type: 'string', description: 'Model to use (e.g., openai/gpt-4o-mini)' },
20
+ { name: 'stream', short: 's', type: 'boolean', default: false, description: 'Enable streaming output' },
21
+ { name: 'session', type: 'string', description: 'Session ID for conversation continuity' }
22
+ ]
23
+ },
24
+ run: {
25
+ description: 'Run an agent with a task',
26
+ args: [
27
+ { name: 'task', type: 'string', required: true, position: 0 }
28
+ ],
29
+ flags: [
30
+ { name: 'agent', short: 'a', type: 'string', description: 'Agent configuration file or name' },
31
+ { name: 'tools', short: 't', type: 'string', description: 'Comma-separated list of tools' }
32
+ ]
33
+ },
34
+ workflow: {
35
+ description: 'Execute a multi-agent workflow',
36
+ args: [
37
+ { name: 'file', type: 'string', required: true, position: 0, description: 'Workflow YAML file path' }
38
+ ],
39
+ flags: [
40
+ { name: 'parallel', type: 'boolean', default: false, description: 'Run workflow steps in parallel where possible' }
41
+ ]
42
+ },
43
+ eval: {
44
+ description: 'Evaluate agent performance',
45
+ subcommands: {
46
+ accuracy: {
47
+ description: 'Run accuracy evaluation',
48
+ flags: [
49
+ { name: 'input', type: 'string', required: true },
50
+ { name: 'expected', type: 'string', required: true },
51
+ { name: 'iterations', type: 'integer', default: 1 }
52
+ ]
53
+ },
54
+ performance: {
55
+ description: 'Run performance benchmark',
56
+ flags: [
57
+ { name: 'iterations', type: 'integer', default: 10 },
58
+ { name: 'warmup', type: 'integer', default: 2 }
59
+ ]
60
+ },
61
+ reliability: {
62
+ description: 'Run reliability check',
63
+ flags: [
64
+ { name: 'expected-tools', type: 'string', description: 'Comma-separated expected tool calls' }
65
+ ]
66
+ }
67
+ }
68
+ },
69
+ providers: {
70
+ description: 'List available LLM providers',
71
+ flags: []
72
+ },
73
+ tools: {
74
+ description: 'List or manage tools',
75
+ subcommands: {
76
+ list: {
77
+ description: 'List available tools'
78
+ },
79
+ info: {
80
+ description: 'Show tool information',
81
+ args: [
82
+ { name: 'name', type: 'string', required: true, position: 0 }
83
+ ]
84
+ }
85
+ }
86
+ },
87
+ memory: {
88
+ description: 'Manage agent memory',
89
+ subcommands: {
90
+ list: { description: 'List all memories' },
91
+ add: { description: 'Add a new memory', args: [{ name: 'content', type: 'string', required: true, position: 0 }] },
92
+ search: { description: 'Search memories', args: [{ name: 'query', type: 'string', required: true, position: 0 }] },
93
+ clear: { description: 'Clear all memories' }
94
+ }
95
+ },
96
+ session: {
97
+ description: 'Manage agent sessions',
98
+ subcommands: {
99
+ list: { description: 'List all sessions' },
100
+ create: { description: 'Create a new session', args: [{ name: 'id', type: 'string', required: false, position: 0 }] },
101
+ get: { description: 'Get session details', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
102
+ delete: { description: 'Delete a session', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
103
+ export: { description: 'Export session data', args: [{ name: 'id', type: 'string', required: true, position: 0 }] }
104
+ }
105
+ },
106
+ knowledge: {
107
+ description: 'Manage knowledge base',
108
+ subcommands: {
109
+ add: { description: 'Add knowledge from file or text', args: [{ name: 'source', type: 'string', required: true, position: 0 }] },
110
+ search: { description: 'Search knowledge base', args: [{ name: 'query', type: 'string', required: true, position: 0 }] },
111
+ list: { description: 'List all knowledge entries' }
112
+ }
113
+ },
114
+ skills: {
115
+ description: 'Manage agent skills',
116
+ subcommands: {
117
+ list: { description: 'List loaded skills' },
118
+ discover: { description: 'Discover skills in directory', args: [{ name: 'path', type: 'string', required: false, position: 0 }] },
119
+ validate: { description: 'Validate a skill', args: [{ name: 'path', type: 'string', required: true, position: 0 }] },
120
+ info: { description: 'Show skill information', args: [{ name: 'name', type: 'string', required: true, position: 0 }] }
121
+ }
122
+ },
123
+ mcp: {
124
+ description: 'Model Context Protocol management',
125
+ subcommands: {
126
+ list: { description: 'List registered MCP servers' },
127
+ add: { description: 'Add an MCP server', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
128
+ remove: { description: 'Remove an MCP server', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
129
+ start: { description: 'Start an MCP server', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
130
+ stop: { description: 'Stop an MCP server', args: [{ name: 'name', type: 'string', required: true, position: 0 }] }
131
+ }
132
+ },
133
+ auto: {
134
+ description: 'Auto-generate agents from topic',
135
+ args: [{ name: 'topic', type: 'string', required: true, position: 0 }],
136
+ flags: [
137
+ { name: 'pattern', type: 'string', description: 'Agent pattern (sequential, parallel, routing)' },
138
+ { name: 'agents', type: 'integer', description: 'Number of agents to generate' }
139
+ ]
140
+ },
141
+ image: {
142
+ description: 'Image generation and analysis',
143
+ subcommands: {
144
+ generate: { description: 'Generate image from text', args: [{ name: 'prompt', type: 'string', required: true, position: 0 }] },
145
+ analyze: { description: 'Analyze an image', args: [{ name: 'url', type: 'string', required: true, position: 0 }] }
146
+ },
147
+ flags: [
148
+ { name: 'size', type: 'string', description: 'Image size' },
149
+ { name: 'quality', type: 'string', description: 'Image quality' },
150
+ { name: 'style', type: 'string', description: 'Image style' }
151
+ ]
152
+ },
153
+ research: {
154
+ description: 'Deep research on a topic',
155
+ args: [{ name: 'query', type: 'string', required: true, position: 0 }],
156
+ flags: [
157
+ { name: 'depth', type: 'integer', description: 'Research depth (iterations)' },
158
+ { name: 'max-sources', type: 'integer', description: 'Maximum sources to use' }
159
+ ]
160
+ },
161
+ guardrail: {
162
+ description: 'Content validation and safety',
163
+ subcommands: {
164
+ check: { description: 'Check content against guardrails', args: [{ name: 'content', type: 'string', required: true, position: 0 }] }
165
+ },
166
+ flags: [
167
+ { name: 'criteria', type: 'string', description: 'Custom validation criteria' }
168
+ ]
169
+ },
170
+ telemetry: {
171
+ description: 'Usage monitoring and analytics',
172
+ subcommands: {
173
+ status: { description: 'Show telemetry status' },
174
+ enable: { description: 'Enable telemetry' },
175
+ disable: { description: 'Disable telemetry' },
176
+ clear: { description: 'Clear telemetry data' },
177
+ export: { description: 'Export telemetry data' }
178
+ }
179
+ },
180
+ planning: {
181
+ description: 'Task planning and todo management',
182
+ subcommands: {
183
+ create: { description: 'Create a new plan', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
184
+ todo: { description: 'Manage todo items' }
185
+ }
186
+ },
187
+ 'query-rewrite': {
188
+ description: 'Rewrite queries for better search results',
189
+ args: [{ name: 'query', type: 'string', required: true, position: 0 }],
190
+ flags: [
191
+ { name: 'strategy', type: 'string', description: 'Rewrite strategy (expand, simplify, decompose, rephrase, auto)' }
192
+ ]
193
+ },
194
+ 'prompt-expand': {
195
+ description: 'Expand prompts with more detail',
196
+ args: [{ name: 'prompt', type: 'string', required: true, position: 0 }],
197
+ flags: [
198
+ { name: 'strategy', type: 'string', description: 'Expand strategy (detail, context, examples, constraints, auto)' }
199
+ ]
200
+ },
201
+ router: {
202
+ description: 'Route requests to appropriate agents',
203
+ subcommands: {
204
+ analyze: { description: 'Analyze input and suggest routing', args: [{ name: 'input', type: 'string', required: true, position: 0 }] }
205
+ }
206
+ },
207
+ context: {
208
+ description: 'Manage conversation context',
209
+ subcommands: {
210
+ chat: { description: 'Chat with context management', args: [{ name: 'message', type: 'string', required: true, position: 0 }] },
211
+ summarize: { description: 'Summarize context', args: [{ name: 'text', type: 'string', required: true, position: 0 }] }
212
+ },
213
+ flags: [
214
+ { name: 'max-messages', type: 'integer', description: 'Maximum messages in context' }
215
+ ]
216
+ },
217
+ handoff: {
218
+ description: 'Agent handoff management',
219
+ subcommands: {
220
+ info: { description: 'Show handoff feature information' }
221
+ }
222
+ },
223
+ vector: {
224
+ description: 'Vector store management',
225
+ subcommands: {
226
+ info: { description: 'Show vector store information' },
227
+ providers: { description: 'List available vector store providers' }
228
+ }
229
+ },
230
+ observability: {
231
+ description: 'Monitoring and tracing',
232
+ subcommands: {
233
+ info: { description: 'Show observability information' },
234
+ providers: { description: 'List available observability providers' }
235
+ }
236
+ },
237
+ voice: {
238
+ description: 'Text-to-speech and speech-to-text',
239
+ subcommands: {
240
+ info: { description: 'Show voice feature information' },
241
+ providers: { description: 'List available voice providers' }
242
+ }
243
+ },
244
+ reranker: {
245
+ description: 'Document reranking',
246
+ subcommands: {
247
+ info: { description: 'Show reranker information' },
248
+ providers: { description: 'List available reranker providers' }
249
+ }
250
+ },
251
+ 'graph-rag': {
252
+ description: 'Graph-based retrieval augmented generation',
253
+ subcommands: {
254
+ info: { description: 'Show Graph RAG information' }
255
+ }
256
+ },
257
+ cache: {
258
+ description: 'Caching management',
259
+ subcommands: {
260
+ info: { description: 'Show cache information' },
261
+ providers: { description: 'List available cache providers' }
262
+ }
263
+ },
264
+ db: {
265
+ description: 'Database adapter management',
266
+ subcommands: {
267
+ info: { description: 'Show database adapter information' },
268
+ adapters: { description: 'List available database adapters' }
269
+ }
270
+ },
271
+ scheduler: {
272
+ description: 'Agent task scheduling',
273
+ subcommands: {
274
+ create: { description: 'Create a scheduled task', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
275
+ list: { description: 'List all scheduled tasks' },
276
+ run: { description: 'Run a task immediately', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
277
+ remove: { description: 'Remove a scheduled task', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
278
+ enable: { description: 'Enable a task', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
279
+ disable: { description: 'Disable a task', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
280
+ patterns: { description: 'Show common cron patterns' }
281
+ },
282
+ flags: [
283
+ { name: 'cron', type: 'string', description: 'Cron expression' },
284
+ { name: 'interval', type: 'integer', description: 'Interval in seconds' }
285
+ ]
286
+ },
287
+ jobs: {
288
+ description: 'Background job queue management',
289
+ subcommands: {
290
+ add: { description: 'Add a new job', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
291
+ list: { description: 'List all jobs' },
292
+ get: { description: 'Get job details', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
293
+ cancel: { description: 'Cancel a pending job', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
294
+ retry: { description: 'Retry a failed job', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
295
+ process: { description: 'Process a job immediately', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
296
+ stats: { description: 'Show queue statistics' },
297
+ cleanup: { description: 'Clean up old jobs' }
298
+ },
299
+ flags: [
300
+ { name: 'storage', type: 'string', description: 'Path to job storage file' },
301
+ { name: 'priority', type: 'string', description: 'Job priority (low, normal, high, critical)' },
302
+ { name: 'status', type: 'string', description: 'Filter by status' }
303
+ ]
304
+ },
305
+ checkpoints: {
306
+ description: 'Session state checkpointing',
307
+ subcommands: {
308
+ create: { description: 'Create a checkpoint', args: [{ name: 'name', type: 'string', required: false, position: 0 }] },
309
+ list: { description: 'List all checkpoints' },
310
+ get: { description: 'Get checkpoint details', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
311
+ restore: { description: 'Restore from checkpoint', args: [{ name: 'id', type: 'string', required: false, position: 0 }] },
312
+ delete: { description: 'Delete a checkpoint', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
313
+ export: { description: 'Export checkpoint as JSON', args: [{ name: 'id', type: 'string', required: true, position: 0 }] },
314
+ import: { description: 'Import checkpoint from JSON', args: [{ name: 'json', type: 'string', required: true, position: 0 }] }
315
+ },
316
+ flags: [
317
+ { name: 'storage', type: 'string', description: 'Path to checkpoint storage' },
318
+ { name: 'state', type: 'string', description: 'JSON state to save' }
319
+ ]
320
+ },
321
+ 'fast-context': {
322
+ description: 'Fast context retrieval',
323
+ subcommands: {
324
+ query: { description: 'Query for relevant context', args: [{ name: 'query', type: 'string', required: true, position: 0 }] },
325
+ stats: { description: 'Show cache statistics' },
326
+ clear: { description: 'Clear cache and sources' }
327
+ },
328
+ flags: [
329
+ { name: 'max-tokens', type: 'integer', description: 'Maximum tokens in context' },
330
+ { name: 'sources', type: 'string', description: 'Comma-separated source texts' }
331
+ ]
332
+ },
333
+ autonomy: {
334
+ description: 'Autonomy mode management',
335
+ subcommands: {
336
+ status: { description: 'Show current autonomy status' },
337
+ set: { description: 'Set autonomy mode', args: [{ name: 'mode', type: 'string', required: true, position: 0 }] },
338
+ policies: { description: 'Show policies for a mode', args: [{ name: 'mode', type: 'string', required: false, position: 0 }] },
339
+ reset: { description: 'Reset autonomy state' }
340
+ }
341
+ },
342
+ sandbox: {
343
+ description: 'Safe command execution',
344
+ subcommands: {
345
+ exec: { description: 'Execute a command in sandbox', args: [{ name: 'command', type: 'string', required: true, position: 0 }] },
346
+ check: { description: 'Check if command is allowed', args: [{ name: 'command', type: 'string', required: true, position: 0 }] },
347
+ mode: { description: 'List available sandbox modes' }
348
+ },
349
+ flags: [
350
+ { name: 'mode', type: 'string', description: 'Sandbox mode (disabled, basic, strict, network-isolated)' },
351
+ { name: 'timeout', type: 'integer', description: 'Execution timeout in ms' }
352
+ ]
353
+ },
354
+ 'repo-map': {
355
+ description: 'Repository structure visualization',
356
+ subcommands: {
357
+ tree: { description: 'Show repository tree', args: [{ name: 'path', type: 'string', required: false, position: 0 }] },
358
+ symbols: { description: 'Extract code symbols', args: [{ name: 'path', type: 'string', required: false, position: 0 }] }
359
+ },
360
+ flags: [
361
+ { name: 'depth', type: 'integer', description: 'Maximum directory depth' },
362
+ { name: 'symbols', type: 'boolean', description: 'Include symbols in tree' }
363
+ ]
364
+ },
365
+ git: {
366
+ description: 'Git integration (read-only)',
367
+ subcommands: {
368
+ status: { description: 'Show repository status' },
369
+ diff: { description: 'Show changes' },
370
+ log: { description: 'Show recent commits' },
371
+ branches: { description: 'List branches' },
372
+ stash: { description: 'List stashes' }
373
+ },
374
+ flags: [
375
+ { name: 'cwd', type: 'string', description: 'Working directory' },
376
+ { name: 'staged', type: 'boolean', description: 'Show staged changes only' },
377
+ { name: 'limit', type: 'integer', description: 'Number of commits to show' }
378
+ ]
379
+ },
380
+ n8n: {
381
+ description: 'N8N workflow integration',
382
+ subcommands: {
383
+ trigger: { description: 'Trigger an N8N webhook', args: [{ name: 'webhookId', type: 'string', required: true, position: 0 }] },
384
+ export: { description: 'Export workflow to N8N format', args: [{ name: 'name', type: 'string', required: false, position: 0 }] }
385
+ },
386
+ flags: [
387
+ { name: 'base-url', type: 'string', description: 'N8N base URL' },
388
+ { name: 'api-key', type: 'string', description: 'N8N API key' },
389
+ { name: 'steps', type: 'string', description: 'Workflow steps' }
390
+ ]
391
+ },
392
+ 'external-agents': {
393
+ description: 'External AI CLI tool integration',
394
+ subcommands: {
395
+ list: { description: 'List all external agents' },
396
+ check: { description: 'Check agent availability', args: [{ name: 'name', type: 'string', required: true, position: 0 }] },
397
+ run: { description: 'Run with external agent', args: [{ name: 'name', type: 'string', required: true, position: 0 }] }
398
+ },
399
+ flags: [
400
+ { name: 'cwd', type: 'string', description: 'Working directory' }
401
+ ]
402
+ },
403
+ flow: {
404
+ description: 'Workflow flow visualization',
405
+ subcommands: {
406
+ show: { description: 'Display workflow as text', args: [{ name: 'steps', type: 'string', required: false, position: 0 }] },
407
+ dot: { description: 'Export as DOT format', args: [{ name: 'steps', type: 'string', required: false, position: 0 }] }
408
+ },
409
+ flags: [
410
+ { name: 'steps', type: 'string', description: 'Steps as JSON or comma-separated' },
411
+ { name: 'boxes', type: 'boolean', description: 'Display as ASCII boxes' },
412
+ { name: 'compact', type: 'boolean', description: 'Compact display mode' }
413
+ ]
414
+ },
415
+ cost: {
416
+ description: 'Token usage and cost tracking',
417
+ subcommands: {
418
+ summary: { description: 'Show cost summary' },
419
+ add: { description: 'Add token usage', args: [{ name: 'model', type: 'string', required: true, position: 0 }] },
420
+ reset: { description: 'Reset cost tracker' },
421
+ pricing: { description: 'Show model pricing', args: [{ name: 'model', type: 'string', required: false, position: 0 }] }
422
+ }
423
+ },
424
+ interactive: {
425
+ description: 'Interactive TUI mode',
426
+ flags: [
427
+ { name: 'model', short: 'm', type: 'string', description: 'Model to use' },
428
+ { name: 'prompt', type: 'string', description: 'Custom prompt string' },
429
+ { name: 'history', type: 'string', description: 'Path to history file' }
430
+ ]
431
+ },
432
+ version: {
433
+ description: 'Show CLI version',
434
+ flags: []
435
+ },
436
+ help: {
437
+ description: 'Show help information',
438
+ args: [
439
+ { name: 'command', type: 'string', required: false, position: 0 }
440
+ ]
441
+ }
442
+ };
443
+ exports.GLOBAL_FLAGS = [
444
+ { name: 'verbose', short: 'v', type: 'boolean', default: false, description: 'Enable verbose output' },
445
+ { name: 'config', short: 'c', type: 'string', description: 'Path to config file' },
446
+ { name: 'profile', short: 'p', type: 'string', description: 'Profile name to use' },
447
+ { name: 'output', short: 'o', type: 'string', enum: ['json', 'text', 'pretty'], default: 'pretty', description: 'Output format' },
448
+ { name: 'json', type: 'boolean', default: false, description: 'Shorthand for --output json' }
449
+ ];
450
+ exports.EXIT_CODES = {
451
+ SUCCESS: 0,
452
+ RUNTIME_ERROR: 1,
453
+ INVALID_ARGUMENTS: 2,
454
+ CONFIG_ERROR: 3,
455
+ NETWORK_ERROR: 4,
456
+ AUTH_ERROR: 5
457
+ };
458
+ exports.ENV_VARS = {
459
+ PRAISONAI_MODEL: 'PRAISONAI_MODEL',
460
+ PRAISONAI_PROFILE: 'PRAISONAI_PROFILE',
461
+ PRAISONAI_VERBOSE: 'PRAISONAI_VERBOSE',
462
+ PRAISONAI_CONFIG: 'PRAISONAI_CONFIG',
463
+ OPENAI_API_KEY: 'OPENAI_API_KEY',
464
+ ANTHROPIC_API_KEY: 'ANTHROPIC_API_KEY',
465
+ GOOGLE_API_KEY: 'GOOGLE_API_KEY'
466
+ };
467
+ exports.CONFIG_FILES = ['.praisonai.yaml', '.praisonai.json'];
468
+ function validateCommand(command) {
469
+ return command in exports.COMMANDS;
470
+ }
471
+ function getCommandSpec(command) {
472
+ return exports.COMMANDS[command];
473
+ }
474
+ function getAllFlags(command) {
475
+ const cmdSpec = exports.COMMANDS[command];
476
+ const cmdFlags = cmdSpec?.flags || [];
477
+ return [...exports.GLOBAL_FLAGS, ...cmdFlags];
478
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * CLI Spec exports
3
+ */
4
+ export * from './cli-spec';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * CLI Spec exports
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./cli-spec"), exports);
package/dist/index.d.ts CHANGED
@@ -17,8 +17,10 @@ export { KnowledgeBase, createKnowledgeBase, type Document, type SearchResult, t
17
17
  export { accuracyEval, performanceEval, reliabilityEval, EvalSuite, type EvalResult, type PerformanceResult, type AccuracyEvalConfig, type PerformanceEvalConfig, type ReliabilityEvalConfig } from './eval';
18
18
  export { MemoryObservabilityAdapter, ConsoleObservabilityAdapter, setObservabilityAdapter, getObservabilityAdapter, type ObservabilityAdapter, type TraceContext, type SpanContext, type SpanData, type TraceData } from './observability';
19
19
  export { SkillManager, createSkillManager, parseSkillFile, type Skill, type SkillMetadata, type SkillDiscoveryOptions } from './skills';
20
- export { chat, listProviders, version, help } from './cli';
20
+ export { parseArgs, executeCommand, CLI_SPEC_VERSION } from './cli';
21
21
  export { Memory, createMemory, type MemoryEntry, type MemoryConfig, type SearchResult as MemorySearchResult } from './memory/memory';
22
+ export { FileMemory, createFileMemory, type FileMemoryConfig, type FileMemoryEntry } from './memory/file-memory';
23
+ export { AutoMemory, createAutoMemory, createLLMSummarizer, DEFAULT_POLICIES, type AutoMemoryConfig, type AutoMemoryPolicy, type AutoMemoryContext, type VectorStoreAdapter as AutoMemoryVectorStore, type KnowledgeBaseAdapter as AutoMemoryKnowledgeBase } from './memory/auto-memory';
22
24
  export { TelemetryCollector, getTelemetry, enableTelemetry, disableTelemetry, cleanupTelemetry, type TelemetryEvent, type TelemetryConfig } from './telemetry';
23
25
  export { AutoAgents, createAutoAgents, type AgentConfig, type TaskConfig, type TeamStructure, type AutoAgentsConfig } from './auto';
24
26
  export { ImageAgent, createImageAgent, type ImageAgentConfig, type ImageGenerationConfig, type ImageAnalysisConfig } from './agent/image';
@@ -40,3 +42,4 @@ export { BaseVoiceProvider, OpenAIVoiceProvider, ElevenLabsVoiceProvider, create
40
42
  export { BaseReranker, CohereReranker, CrossEncoderReranker, LLMReranker, createCohereReranker, createCrossEncoderReranker, createLLMReranker, type RerankResult, type RerankConfig } from './knowledge/reranker';
41
43
  export { GraphStore, GraphRAG, createGraphRAG, type GraphNode, type GraphEdge, type GraphQueryResult, type GraphRAGConfig } from './knowledge/graph-rag';
42
44
  export { createProvider, getDefaultProvider, parseModelString, isProviderAvailable, getAvailableProviders, OpenAIProvider, AnthropicProvider, GoogleProvider, BaseProvider, type LLMProvider, type ProviderConfig, type ProviderFactory, type GenerateTextOptions, type GenerateTextResult, type StreamTextOptions, type StreamChunk, type GenerateObjectOptions, type GenerateObjectResult, type TokenUsage, type Message as ProviderMessage, type ToolCall, type ToolDefinition as ProviderToolDefinition, } from './llm/providers';
45
+ export { SlashCommandHandler, createSlashCommandHandler, registerCommand, parseSlashCommand, executeSlashCommand, isSlashCommand, type SlashCommand, type SlashCommandContext, type SlashCommandResult, CostTracker, createCostTracker, estimateTokens, formatCost, MODEL_PRICING, type ModelPricing, type TokenUsage as CostTokenUsage, type RequestStats, type SessionStats, InteractiveTUI, createInteractiveTUI, StatusDisplay, createStatusDisplay, HistoryManager, createHistoryManager, type TUIConfig, type TUIState, RepoMap, createRepoMap, getRepoTree, DEFAULT_IGNORE_PATTERNS, type RepoMapConfig, type FileInfo, type SymbolInfo, type RepoMapResult, GitManager, createGitManager, DiffViewer, createDiffViewer, type GitConfig, type GitStatus, type GitCommit, type GitDiff, type GitDiffFile, SandboxExecutor, createSandboxExecutor, sandboxExec, CommandValidator, DEFAULT_BLOCKED_COMMANDS, DEFAULT_BLOCKED_PATHS, type SandboxMode, type SandboxConfig, type ExecutionResult, AutonomyManager, createAutonomyManager, cliApprovalPrompt, MODE_POLICIES, type AutonomyMode, type ActionType, type ApprovalPolicy, type AutonomyConfig, type ActionRequest, type ActionDecision, Scheduler, createScheduler, cronExpressions, type ScheduleConfig, type ScheduledTask, type SchedulerStats, JobQueue, createJobQueue, MemoryJobStorage, FileJobStorage, createFileJobStorage, type Job, type JobStatus, type JobPriority, type JobQueueConfig, type JobStorageAdapter, type JobHandler, type JobContext, CheckpointManager, createCheckpointManager, MemoryCheckpointStorage, FileCheckpointStorage, createFileCheckpointStorage, type CheckpointData, type CheckpointConfig, type CheckpointStorage, FlowDisplay, createFlowDisplay, renderWorkflow, type FlowNode, type FlowGraph, type FlowDisplayConfig, BaseExternalAgent, ClaudeCodeAgent, GeminiCliAgent, CodexCliAgent, AiderAgent, GenericExternalAgent, getExternalAgentRegistry, createExternalAgent, externalAgentAsTool, type ExternalAgentConfig, type ExternalAgentResult, N8NIntegration, createN8NIntegration, triggerN8NWebhook, type N8NConfig, type N8NWebhookPayload, type N8NWorkflow, type N8NWorkflowNode, FastContext, createFastContext, getQuickContext, type FastContextConfig, type ContextSource, type FastContextResult } from './cli/features';