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,145 @@
1
+ "use strict";
2
+ /**
3
+ * Observability command - Monitoring and tracing
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.execute = execute;
40
+ const json_1 = require("../output/json");
41
+ const pretty = __importStar(require("../output/pretty"));
42
+ const cli_spec_1 = require("../spec/cli-spec");
43
+ const errors_1 = require("../output/errors");
44
+ async function execute(args, options) {
45
+ const action = args[0] || 'help';
46
+ const outputFormat = options.json ? 'json' : (options.output || 'pretty');
47
+ try {
48
+ switch (action) {
49
+ case 'providers':
50
+ await listProviders(outputFormat);
51
+ break;
52
+ case 'info':
53
+ await showInfo(outputFormat);
54
+ break;
55
+ case 'help':
56
+ default:
57
+ await showHelp(outputFormat);
58
+ break;
59
+ }
60
+ }
61
+ catch (error) {
62
+ if (outputFormat === 'json') {
63
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
64
+ }
65
+ else {
66
+ await pretty.error(error instanceof Error ? error.message : String(error));
67
+ }
68
+ process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
69
+ }
70
+ }
71
+ async function showInfo(outputFormat) {
72
+ const info = {
73
+ feature: 'Observability',
74
+ description: 'Monitoring, tracing, and logging for agent operations',
75
+ providers: [
76
+ { name: 'ConsoleObservabilityProvider', description: 'Console-based logging' },
77
+ { name: 'MemoryObservabilityProvider', description: 'In-memory trace storage' },
78
+ { name: 'LangfuseObservabilityProvider', description: 'Langfuse integration' }
79
+ ],
80
+ capabilities: [
81
+ 'Trace agent executions',
82
+ 'Log LLM calls and responses',
83
+ 'Track tool invocations',
84
+ 'Measure performance metrics',
85
+ 'Export traces to external systems'
86
+ ]
87
+ };
88
+ if (outputFormat === 'json') {
89
+ (0, json_1.outputJson)((0, json_1.formatSuccess)(info));
90
+ }
91
+ else {
92
+ await pretty.heading('Observability');
93
+ await pretty.plain(info.description);
94
+ await pretty.newline();
95
+ await pretty.plain('Providers:');
96
+ for (const p of info.providers) {
97
+ await pretty.plain(` • ${p.name}: ${p.description}`);
98
+ }
99
+ await pretty.newline();
100
+ await pretty.plain('Capabilities:');
101
+ for (const cap of info.capabilities) {
102
+ await pretty.plain(` • ${cap}`);
103
+ }
104
+ }
105
+ }
106
+ async function listProviders(outputFormat) {
107
+ const providers = [
108
+ { name: 'console', description: 'Console logging (default)', available: true },
109
+ { name: 'memory', description: 'In-memory storage', available: true },
110
+ { name: 'langfuse', description: 'Langfuse observability platform', available: true }
111
+ ];
112
+ if (outputFormat === 'json') {
113
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({ providers }));
114
+ }
115
+ else {
116
+ await pretty.heading('Observability Providers');
117
+ for (const p of providers) {
118
+ const status = p.available ? '✓' : '✗';
119
+ await pretty.plain(` ${status} ${p.name.padEnd(15)} ${p.description}`);
120
+ }
121
+ }
122
+ }
123
+ async function showHelp(outputFormat) {
124
+ const help = {
125
+ command: 'observability',
126
+ description: 'Monitoring and tracing for agent operations',
127
+ subcommands: [
128
+ { name: 'info', description: 'Show observability feature information' },
129
+ { name: 'providers', description: 'List available observability providers' },
130
+ { name: 'help', description: 'Show this help' }
131
+ ]
132
+ };
133
+ if (outputFormat === 'json') {
134
+ (0, json_1.outputJson)((0, json_1.formatSuccess)(help));
135
+ }
136
+ else {
137
+ await pretty.heading('Observability Command');
138
+ await pretty.plain(help.description);
139
+ await pretty.newline();
140
+ await pretty.plain('Subcommands:');
141
+ for (const cmd of help.subcommands) {
142
+ await pretty.plain(` ${cmd.name.padEnd(20)} ${cmd.description}`);
143
+ }
144
+ }
145
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Planning command - Task planning and todo management
3
+ */
4
+ export interface PlanningOptions {
5
+ verbose?: boolean;
6
+ output?: 'json' | 'text' | 'pretty';
7
+ json?: boolean;
8
+ }
9
+ export declare function execute(args: string[], options: PlanningOptions): Promise<void>;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ /**
3
+ * Planning command - Task planning and todo management
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.execute = execute;
40
+ const planning_1 = require("../../planning");
41
+ const json_1 = require("../output/json");
42
+ const pretty = __importStar(require("../output/pretty"));
43
+ const cli_spec_1 = require("../spec/cli-spec");
44
+ const errors_1 = require("../output/errors");
45
+ async function execute(args, options) {
46
+ const action = args[0] || 'help';
47
+ const actionArgs = args.slice(1);
48
+ const outputFormat = options.json ? 'json' : (options.output || 'pretty');
49
+ try {
50
+ switch (action) {
51
+ case 'create':
52
+ await createNewPlan(actionArgs, outputFormat);
53
+ break;
54
+ case 'todo':
55
+ await manageTodo(actionArgs, outputFormat);
56
+ break;
57
+ case 'help':
58
+ default:
59
+ await showHelp(outputFormat);
60
+ break;
61
+ }
62
+ }
63
+ catch (error) {
64
+ if (outputFormat === 'json') {
65
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
66
+ }
67
+ else {
68
+ await pretty.error(error instanceof Error ? error.message : String(error));
69
+ }
70
+ process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
71
+ }
72
+ }
73
+ async function createNewPlan(args, outputFormat) {
74
+ const name = args.join(' ');
75
+ if (!name) {
76
+ if (outputFormat === 'json') {
77
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.MISSING_ARG, 'Please provide a name for the plan'));
78
+ }
79
+ else {
80
+ await pretty.error('Please provide a name for the plan');
81
+ }
82
+ process.exit(cli_spec_1.EXIT_CODES.INVALID_ARGUMENTS);
83
+ }
84
+ const plan = (0, planning_1.createPlan)({
85
+ name,
86
+ description: name
87
+ });
88
+ if (outputFormat === 'json') {
89
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({
90
+ id: plan.id,
91
+ name: plan.name,
92
+ status: plan.status
93
+ }));
94
+ }
95
+ else {
96
+ await pretty.success(`Plan created: ${plan.id}`);
97
+ await pretty.plain(`Name: ${name}`);
98
+ }
99
+ }
100
+ async function manageTodo(args, outputFormat) {
101
+ const subAction = args[0] || 'list';
102
+ const todoArgs = args.slice(1);
103
+ const todoList = (0, planning_1.createTodoList)();
104
+ switch (subAction) {
105
+ case 'add':
106
+ const content = todoArgs.join(' ');
107
+ if (!content) {
108
+ if (outputFormat === 'json') {
109
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.MISSING_ARG, 'Please provide todo content'));
110
+ }
111
+ else {
112
+ await pretty.error('Please provide todo content');
113
+ }
114
+ process.exit(cli_spec_1.EXIT_CODES.INVALID_ARGUMENTS);
115
+ }
116
+ const newItem = new planning_1.TodoItem({ content });
117
+ todoList.add(newItem);
118
+ if (outputFormat === 'json') {
119
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({ added: true, id: newItem.id, content: newItem.content }));
120
+ }
121
+ else {
122
+ await pretty.success(`Todo added: ${content}`);
123
+ }
124
+ break;
125
+ case 'list':
126
+ default:
127
+ const items = todoList.items;
128
+ if (outputFormat === 'json') {
129
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({ items, count: items.length }));
130
+ }
131
+ else {
132
+ await pretty.heading('Todo List');
133
+ if (items.length === 0) {
134
+ await pretty.info('No todos');
135
+ }
136
+ else {
137
+ for (const todo of items) {
138
+ const status = todo.status === 'completed' ? '✓' : '○';
139
+ await pretty.plain(` ${status} ${todo.content}`);
140
+ }
141
+ }
142
+ }
143
+ break;
144
+ }
145
+ }
146
+ async function showHelp(outputFormat) {
147
+ const help = {
148
+ command: 'planning',
149
+ subcommands: [
150
+ { name: 'create <goal>', description: 'Create a new plan' },
151
+ { name: 'todo add <title>', description: 'Add a todo item' },
152
+ { name: 'todo list', description: 'List todo items' },
153
+ { name: 'help', description: 'Show this help' }
154
+ ]
155
+ };
156
+ if (outputFormat === 'json') {
157
+ (0, json_1.outputJson)((0, json_1.formatSuccess)(help));
158
+ }
159
+ else {
160
+ await pretty.heading('Planning Command');
161
+ await pretty.plain('Task planning and todo management\n');
162
+ await pretty.plain('Subcommands:');
163
+ for (const cmd of help.subcommands) {
164
+ await pretty.plain(` ${cmd.name.padEnd(25)} ${cmd.description}`);
165
+ }
166
+ }
167
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Prompt Expand command - Expand prompts with more detail
3
+ */
4
+ export interface PromptExpandOptions {
5
+ model?: string;
6
+ verbose?: boolean;
7
+ output?: 'json' | 'text' | 'pretty';
8
+ json?: boolean;
9
+ strategy?: string;
10
+ }
11
+ export declare function execute(args: string[], options: PromptExpandOptions): Promise<void>;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /**
3
+ * Prompt Expand command - Expand prompts with more detail
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.execute = execute;
40
+ const prompt_expander_1 = require("../../agent/prompt-expander");
41
+ const resolve_1 = require("../config/resolve");
42
+ const json_1 = require("../output/json");
43
+ const pretty = __importStar(require("../output/pretty"));
44
+ const cli_spec_1 = require("../spec/cli-spec");
45
+ const errors_1 = require("../output/errors");
46
+ async function execute(args, options) {
47
+ const prompt = args.join(' ');
48
+ const outputFormat = options.json ? 'json' : (options.output || 'pretty');
49
+ const config = (0, resolve_1.resolveConfig)(options);
50
+ if (!prompt) {
51
+ if (outputFormat === 'json') {
52
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.MISSING_ARG, 'Please provide a prompt to expand'));
53
+ }
54
+ else {
55
+ await pretty.error('Please provide a prompt to expand');
56
+ await pretty.dim('Usage: praisonai-ts prompt-expand "your prompt"');
57
+ }
58
+ process.exit(cli_spec_1.EXIT_CODES.INVALID_ARGUMENTS);
59
+ }
60
+ const startTime = Date.now();
61
+ try {
62
+ if (outputFormat !== 'json') {
63
+ await pretty.info(`Expanding prompt: "${prompt}"`);
64
+ }
65
+ const agent = (0, prompt_expander_1.createPromptExpanderAgent)({
66
+ llm: config.model,
67
+ verbose: options.verbose,
68
+ defaultStrategy: options.strategy
69
+ });
70
+ const result = await agent.expand(prompt);
71
+ const duration = Date.now() - startTime;
72
+ if (outputFormat === 'json') {
73
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({
74
+ originalPrompt: prompt,
75
+ expandedPrompt: result.expanded,
76
+ strategy: result.strategy,
77
+ additions: result.additions
78
+ }, {
79
+ duration_ms: duration,
80
+ model: config.model
81
+ }));
82
+ }
83
+ else {
84
+ await pretty.heading('Expanded Prompt');
85
+ await pretty.plain(result.expanded);
86
+ await pretty.newline();
87
+ await pretty.dim(`Strategy: ${result.strategy}`);
88
+ await pretty.success(`Completed in ${duration}ms`);
89
+ }
90
+ }
91
+ catch (error) {
92
+ if (outputFormat === 'json') {
93
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
94
+ }
95
+ else {
96
+ await pretty.error(error instanceof Error ? error.message : String(error));
97
+ }
98
+ process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
99
+ }
100
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Providers command - List available LLM providers
3
+ */
4
+ export interface ProvidersOptions {
5
+ verbose?: boolean;
6
+ output?: 'json' | 'text' | 'pretty';
7
+ json?: boolean;
8
+ }
9
+ export declare function execute(args: string[], options: ProvidersOptions): Promise<void>;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /**
3
+ * Providers command - List available LLM providers
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.execute = execute;
40
+ const providers_1 = require("../../llm/providers");
41
+ const env_1 = require("../runtime/env");
42
+ const json_1 = require("../output/json");
43
+ const pretty = __importStar(require("../output/pretty"));
44
+ const PROVIDER_MODELS = {
45
+ openai: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo'],
46
+ anthropic: ['claude-sonnet-4-20250514', 'claude-3-5-sonnet-20241022', 'claude-3-opus-20240229', 'claude-3-haiku-20240307'],
47
+ google: ['gemini-2.0-flash', 'gemini-1.5-pro', 'gemini-1.5-flash']
48
+ };
49
+ async function execute(args, options) {
50
+ const outputFormat = options.json ? 'json' : (options.output || 'pretty');
51
+ const availableProviders = (0, providers_1.getAvailableProviders)();
52
+ const providers = [
53
+ {
54
+ name: 'openai',
55
+ available: availableProviders.includes('openai'),
56
+ hasApiKey: (0, env_1.hasApiKey)('openai'),
57
+ models: PROVIDER_MODELS.openai
58
+ },
59
+ {
60
+ name: 'anthropic',
61
+ available: availableProviders.includes('anthropic'),
62
+ hasApiKey: (0, env_1.hasApiKey)('anthropic'),
63
+ models: PROVIDER_MODELS.anthropic
64
+ },
65
+ {
66
+ name: 'google',
67
+ available: availableProviders.includes('google'),
68
+ hasApiKey: (0, env_1.hasApiKey)('google'),
69
+ models: PROVIDER_MODELS.google
70
+ }
71
+ ];
72
+ if (outputFormat === 'json') {
73
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({
74
+ providers: providers.map(p => ({
75
+ name: p.name,
76
+ available: p.available,
77
+ has_api_key: p.hasApiKey,
78
+ models: options.verbose ? p.models : undefined
79
+ }))
80
+ }));
81
+ }
82
+ else {
83
+ await pretty.heading('Available Providers');
84
+ for (const provider of providers) {
85
+ const status = provider.available ? '✅' : '❌';
86
+ const keyStatus = provider.hasApiKey ? '🔑' : '⚠️ No API key';
87
+ await pretty.plain(` ${status} ${provider.name} ${keyStatus}`);
88
+ if (options.verbose && provider.models) {
89
+ for (const model of provider.models) {
90
+ await pretty.dim(` - ${model}`);
91
+ }
92
+ }
93
+ }
94
+ await pretty.newline();
95
+ await pretty.info('Set API keys via environment variables:');
96
+ await pretty.dim(' OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY');
97
+ }
98
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Query Rewrite command - Rewrite queries for better search results
3
+ */
4
+ export interface QueryRewriteOptions {
5
+ model?: string;
6
+ verbose?: boolean;
7
+ output?: 'json' | 'text' | 'pretty';
8
+ json?: boolean;
9
+ strategy?: string;
10
+ count?: number;
11
+ }
12
+ export declare function execute(args: string[], options: QueryRewriteOptions): Promise<void>;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ /**
3
+ * Query Rewrite command - Rewrite queries for better search results
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.execute = execute;
40
+ const query_rewriter_1 = require("../../agent/query-rewriter");
41
+ const resolve_1 = require("../config/resolve");
42
+ const json_1 = require("../output/json");
43
+ const pretty = __importStar(require("../output/pretty"));
44
+ const cli_spec_1 = require("../spec/cli-spec");
45
+ const errors_1 = require("../output/errors");
46
+ async function execute(args, options) {
47
+ const query = args.join(' ');
48
+ const outputFormat = options.json ? 'json' : (options.output || 'pretty');
49
+ const config = (0, resolve_1.resolveConfig)(options);
50
+ if (!query) {
51
+ if (outputFormat === 'json') {
52
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.MISSING_ARG, 'Please provide a query to rewrite'));
53
+ }
54
+ else {
55
+ await pretty.error('Please provide a query to rewrite');
56
+ await pretty.dim('Usage: praisonai-ts query-rewrite "your search query"');
57
+ }
58
+ process.exit(cli_spec_1.EXIT_CODES.INVALID_ARGUMENTS);
59
+ }
60
+ const startTime = Date.now();
61
+ try {
62
+ if (outputFormat !== 'json') {
63
+ await pretty.info(`Rewriting query: "${query}"`);
64
+ }
65
+ const agent = (0, query_rewriter_1.createQueryRewriterAgent)({
66
+ llm: config.model,
67
+ verbose: options.verbose,
68
+ defaultStrategy: options.strategy
69
+ });
70
+ const result = await agent.rewrite(query);
71
+ const duration = Date.now() - startTime;
72
+ if (outputFormat === 'json') {
73
+ (0, json_1.outputJson)((0, json_1.formatSuccess)({
74
+ originalQuery: query,
75
+ rewrittenQueries: result.rewritten,
76
+ strategy: result.strategy,
77
+ confidence: result.confidence
78
+ }, {
79
+ duration_ms: duration,
80
+ model: config.model
81
+ }));
82
+ }
83
+ else {
84
+ await pretty.heading('Rewritten Queries');
85
+ for (let i = 0; i < result.rewritten.length; i++) {
86
+ await pretty.plain(` ${i + 1}. ${result.rewritten[i]}`);
87
+ }
88
+ await pretty.newline();
89
+ await pretty.dim(`Strategy: ${result.strategy}`);
90
+ await pretty.success(`Completed in ${duration}ms`);
91
+ }
92
+ }
93
+ catch (error) {
94
+ if (outputFormat === 'json') {
95
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
96
+ }
97
+ else {
98
+ await pretty.error(error instanceof Error ? error.message : String(error));
99
+ }
100
+ process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
101
+ }
102
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * CLI command: repo-map
3
+ * Repository structure visualization and symbol extraction
4
+ */
5
+ export declare function execute(args: string[], options: Record<string, unknown>): Promise<void>;