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,126 @@
1
+ "use strict";
2
+ /**
3
+ * CLI command: fast-context
4
+ * Fast context retrieval and summarization
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.execute = execute;
8
+ const fast_context_1 = require("../features/fast-context");
9
+ async function execute(args, options) {
10
+ const subcommand = args[0] || 'help';
11
+ const isJson = Boolean(options.output === 'json' || options.json);
12
+ switch (subcommand) {
13
+ case 'query':
14
+ await handleQuery(args.slice(1), options, isJson);
15
+ break;
16
+ case 'stats':
17
+ await handleStats(isJson);
18
+ break;
19
+ case 'clear':
20
+ await handleClear(isJson);
21
+ break;
22
+ case 'help':
23
+ default:
24
+ showHelp(isJson);
25
+ }
26
+ }
27
+ let globalContext = null;
28
+ function getContext(maxTokens) {
29
+ if (!globalContext) {
30
+ globalContext = (0, fast_context_1.createFastContext)({ maxTokens, cacheEnabled: true });
31
+ }
32
+ return globalContext;
33
+ }
34
+ async function handleQuery(args, options, isJson) {
35
+ const query = args.join(' ');
36
+ if (!query) {
37
+ console.error('Error: Query is required');
38
+ process.exit(1);
39
+ }
40
+ const maxTokens = options['max-tokens'];
41
+ const sources = options.sources;
42
+ const fc = getContext(maxTokens);
43
+ // Add sources if provided
44
+ if (sources) {
45
+ const sourceList = sources.split(',').map(s => s.trim());
46
+ fc.registerSource('cli-sources', 'custom', sourceList);
47
+ }
48
+ const result = await fc.getContext(query);
49
+ if (isJson) {
50
+ console.log(JSON.stringify({ success: true, ...result }, null, 2));
51
+ }
52
+ else {
53
+ console.log('Fast Context Result:');
54
+ console.log(` Query: ${query}`);
55
+ console.log(` Token count: ${result.tokenCount}`);
56
+ console.log(` Sources used: ${result.sources.length}`);
57
+ console.log(` Cached: ${result.cached}`);
58
+ console.log(` Latency: ${result.latencyMs}ms`);
59
+ console.log('\nContext:');
60
+ console.log(result.context || '(empty)');
61
+ }
62
+ }
63
+ async function handleStats(isJson) {
64
+ const fc = getContext();
65
+ const stats = fc.getCacheStats();
66
+ if (isJson) {
67
+ console.log(JSON.stringify({ success: true, stats }, null, 2));
68
+ }
69
+ else {
70
+ console.log('Fast Context Cache Stats:');
71
+ console.log(` Cache size: ${stats.size}`);
72
+ console.log(` Total hits: ${stats.totalHits}`);
73
+ }
74
+ }
75
+ async function handleClear(isJson) {
76
+ const fc = getContext();
77
+ fc.clearCache();
78
+ fc.clearSources();
79
+ if (isJson) {
80
+ console.log(JSON.stringify({ success: true, message: 'Cache and sources cleared' }));
81
+ }
82
+ else {
83
+ console.log('✓ Cache and sources cleared');
84
+ }
85
+ }
86
+ function showHelp(isJson) {
87
+ const help = {
88
+ command: 'fast-context',
89
+ description: 'Fast context retrieval and summarization',
90
+ subcommands: {
91
+ query: 'Query for relevant context',
92
+ stats: 'Show cache statistics',
93
+ clear: 'Clear cache and sources'
94
+ },
95
+ flags: {
96
+ '--max-tokens': 'Maximum tokens in context (default: 4000)',
97
+ '--sources': 'Comma-separated source texts',
98
+ '--json': 'Output in JSON format'
99
+ },
100
+ examples: [
101
+ 'praisonai-ts fast-context query "What is the main topic?"',
102
+ 'praisonai-ts fast-context query "summarize" --sources "text1,text2,text3"',
103
+ 'praisonai-ts fast-context query "find relevant" --max-tokens 2000',
104
+ 'praisonai-ts fast-context stats',
105
+ 'praisonai-ts fast-context clear'
106
+ ]
107
+ };
108
+ if (isJson) {
109
+ console.log(JSON.stringify(help, null, 2));
110
+ }
111
+ else {
112
+ console.log('Fast Context - Fast context retrieval\n');
113
+ console.log('Subcommands:');
114
+ for (const [cmd, desc] of Object.entries(help.subcommands)) {
115
+ console.log(` ${cmd.padEnd(12)} ${desc}`);
116
+ }
117
+ console.log('\nFlags:');
118
+ for (const [flag, desc] of Object.entries(help.flags)) {
119
+ console.log(` ${flag.padEnd(14)} ${desc}`);
120
+ }
121
+ console.log('\nExamples:');
122
+ for (const ex of help.examples) {
123
+ console.log(` ${ex}`);
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * CLI command: flow
3
+ * Workflow flow visualization
4
+ */
5
+ export declare function execute(args: string[], options: Record<string, unknown>): Promise<void>;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ /**
3
+ * CLI command: flow
4
+ * Workflow flow visualization
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.execute = execute;
8
+ const flow_display_1 = require("../features/flow-display");
9
+ async function execute(args, options) {
10
+ const subcommand = args[0] || 'help';
11
+ const isJson = Boolean(options.output === 'json' || options.json);
12
+ switch (subcommand) {
13
+ case 'show':
14
+ await handleShow(args.slice(1), options, isJson);
15
+ break;
16
+ case 'dot':
17
+ await handleDot(args.slice(1), options, isJson);
18
+ break;
19
+ case 'help':
20
+ default:
21
+ showHelp(isJson);
22
+ }
23
+ }
24
+ async function handleShow(args, options, isJson) {
25
+ const stepsStr = args[0] || options.steps;
26
+ let steps = [];
27
+ if (stepsStr) {
28
+ try {
29
+ steps = JSON.parse(stepsStr);
30
+ }
31
+ catch {
32
+ // Parse simple format: "step1,step2,step3"
33
+ steps = stepsStr.split(',').map(s => {
34
+ const [name, type] = s.split(':');
35
+ return { name: name.trim(), type: type?.trim() };
36
+ });
37
+ }
38
+ }
39
+ else {
40
+ // Default example
41
+ steps = [
42
+ { name: 'Input', type: 'start' },
43
+ { name: 'Process', type: 'agent' },
44
+ { name: 'Validate', type: 'condition' },
45
+ { name: 'Output', type: 'end' }
46
+ ];
47
+ }
48
+ const display = (0, flow_display_1.createFlowDisplay)({
49
+ showStatus: Boolean(options.status),
50
+ compact: Boolean(options.compact)
51
+ });
52
+ display.fromWorkflowSteps(steps);
53
+ if (isJson) {
54
+ const graph = display.getGraph();
55
+ console.log(JSON.stringify({
56
+ success: true,
57
+ nodes: Array.from(graph.nodes.values()),
58
+ edges: graph.edges
59
+ }, null, 2));
60
+ }
61
+ else {
62
+ if (options.boxes) {
63
+ console.log(display.renderBoxes());
64
+ }
65
+ else {
66
+ console.log(display.render());
67
+ }
68
+ }
69
+ }
70
+ async function handleDot(args, options, isJson) {
71
+ const stepsStr = args[0] || options.steps;
72
+ let steps = [];
73
+ if (stepsStr) {
74
+ try {
75
+ steps = JSON.parse(stepsStr);
76
+ }
77
+ catch {
78
+ steps = stepsStr.split(',').map(s => {
79
+ const [name, type] = s.split(':');
80
+ return { name: name.trim(), type: type?.trim() };
81
+ });
82
+ }
83
+ }
84
+ else {
85
+ steps = [
86
+ { name: 'Start', type: 'start' },
87
+ { name: 'Agent', type: 'agent' },
88
+ { name: 'End', type: 'end' }
89
+ ];
90
+ }
91
+ const display = (0, flow_display_1.createFlowDisplay)();
92
+ display.fromWorkflowSteps(steps);
93
+ const dot = display.toDot();
94
+ if (isJson) {
95
+ console.log(JSON.stringify({ success: true, dot }));
96
+ }
97
+ else {
98
+ console.log(dot);
99
+ }
100
+ }
101
+ function showHelp(isJson) {
102
+ const help = {
103
+ command: 'flow',
104
+ description: 'Workflow flow visualization',
105
+ subcommands: {
106
+ show: 'Display workflow as text tree or boxes',
107
+ dot: 'Export workflow as DOT format (for Graphviz)'
108
+ },
109
+ flags: {
110
+ '--steps': 'Steps as JSON or "name:type,name:type"',
111
+ '--status': 'Show status indicators',
112
+ '--compact': 'Compact display mode',
113
+ '--boxes': 'Display as ASCII boxes',
114
+ '--json': 'Output in JSON format'
115
+ },
116
+ examples: [
117
+ 'praisonai-ts flow show "Input,Process,Output"',
118
+ 'praisonai-ts flow show "Start:start,Agent:agent,End:end"',
119
+ 'praisonai-ts flow show --boxes',
120
+ 'praisonai-ts flow dot "Step1,Step2,Step3" > workflow.dot'
121
+ ]
122
+ };
123
+ if (isJson) {
124
+ console.log(JSON.stringify(help, null, 2));
125
+ }
126
+ else {
127
+ console.log('Flow - Workflow visualization\n');
128
+ console.log('Subcommands:');
129
+ for (const [cmd, desc] of Object.entries(help.subcommands)) {
130
+ console.log(` ${cmd.padEnd(12)} ${desc}`);
131
+ }
132
+ console.log('\nFlags:');
133
+ for (const [flag, desc] of Object.entries(help.flags)) {
134
+ console.log(` ${flag.padEnd(12)} ${desc}`);
135
+ }
136
+ console.log('\nExamples:');
137
+ for (const ex of help.examples) {
138
+ console.log(` ${ex}`);
139
+ }
140
+ }
141
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * CLI command: git
3
+ * Git integration for repository operations
4
+ */
5
+ export declare function execute(args: string[], options: Record<string, unknown>): Promise<void>;
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ /**
3
+ * CLI command: git
4
+ * Git integration for repository operations
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.execute = execute;
8
+ const git_integration_1 = require("../features/git-integration");
9
+ async function execute(args, options) {
10
+ const subcommand = args[0] || 'help';
11
+ const isJson = Boolean(options.output === 'json' || options.json);
12
+ const cwd = options.cwd || process.cwd();
13
+ switch (subcommand) {
14
+ case 'status':
15
+ await handleStatus(cwd, isJson);
16
+ break;
17
+ case 'diff':
18
+ await handleDiff(options, cwd, isJson);
19
+ break;
20
+ case 'log':
21
+ await handleLog(options, cwd, isJson);
22
+ break;
23
+ case 'branches':
24
+ await handleBranches(cwd, isJson);
25
+ break;
26
+ case 'stash':
27
+ await handleStash(args.slice(1), cwd, isJson);
28
+ break;
29
+ case 'help':
30
+ default:
31
+ showHelp(isJson);
32
+ }
33
+ }
34
+ async function handleStatus(cwd, isJson) {
35
+ const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
36
+ if (!await git.isRepo()) {
37
+ console.error('Error: Not a git repository');
38
+ process.exit(1);
39
+ }
40
+ const status = await git.getStatus();
41
+ if (isJson) {
42
+ console.log(JSON.stringify({ success: true, ...status }, null, 2));
43
+ }
44
+ else {
45
+ console.log(await git.getStatusString());
46
+ }
47
+ }
48
+ async function handleDiff(options, cwd, isJson) {
49
+ const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
50
+ const staged = Boolean(options.staged);
51
+ if (!await git.isRepo()) {
52
+ console.error('Error: Not a git repository');
53
+ process.exit(1);
54
+ }
55
+ const diff = await git.getDiff(staged);
56
+ if (isJson) {
57
+ console.log(JSON.stringify({ success: true, ...diff }, null, 2));
58
+ }
59
+ else {
60
+ if (diff.files.length === 0) {
61
+ console.log(staged ? 'No staged changes' : 'No changes');
62
+ }
63
+ else {
64
+ console.log(`Changes (${diff.files.length} files):\n`);
65
+ for (const file of diff.files) {
66
+ console.log(` ${file.path} (+${file.additions}/-${file.deletions})`);
67
+ }
68
+ if (options.full) {
69
+ console.log('\n' + diff.summary);
70
+ }
71
+ }
72
+ }
73
+ }
74
+ async function handleLog(options, cwd, isJson) {
75
+ const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
76
+ const limit = options.limit || 10;
77
+ if (!await git.isRepo()) {
78
+ console.error('Error: Not a git repository');
79
+ process.exit(1);
80
+ }
81
+ const commits = await git.getLog(limit);
82
+ if (isJson) {
83
+ console.log(JSON.stringify({ success: true, commits }, null, 2));
84
+ }
85
+ else {
86
+ console.log('Recent commits:\n');
87
+ for (const commit of commits) {
88
+ console.log(` ${commit.shortHash} ${commit.message}`);
89
+ console.log(` by ${commit.author} on ${commit.date.toLocaleDateString()}`);
90
+ }
91
+ }
92
+ }
93
+ async function handleBranches(cwd, isJson) {
94
+ const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
95
+ if (!await git.isRepo()) {
96
+ console.error('Error: Not a git repository');
97
+ process.exit(1);
98
+ }
99
+ const branches = await git.getBranches();
100
+ if (isJson) {
101
+ console.log(JSON.stringify({ success: true, branches }, null, 2));
102
+ }
103
+ else {
104
+ console.log('Branches:\n');
105
+ for (const branch of branches) {
106
+ const marker = branch.current ? '* ' : ' ';
107
+ console.log(`${marker}${branch.name}`);
108
+ }
109
+ }
110
+ }
111
+ async function handleStash(args, cwd, isJson) {
112
+ const git = (0, git_integration_1.createGitManager)({ cwd, safe: true });
113
+ if (!await git.isRepo()) {
114
+ console.error('Error: Not a git repository');
115
+ process.exit(1);
116
+ }
117
+ const stashes = await git.getStashList();
118
+ if (isJson) {
119
+ console.log(JSON.stringify({ success: true, stashes }, null, 2));
120
+ }
121
+ else {
122
+ if (stashes.length === 0) {
123
+ console.log('No stashes');
124
+ }
125
+ else {
126
+ console.log('Stashes:\n');
127
+ for (const stash of stashes) {
128
+ console.log(` ${stash}`);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ function showHelp(isJson) {
134
+ const help = {
135
+ command: 'git',
136
+ description: 'Git integration for repository operations (read-only by default)',
137
+ subcommands: {
138
+ status: 'Show repository status',
139
+ diff: 'Show changes',
140
+ log: 'Show recent commits',
141
+ branches: 'List branches',
142
+ stash: 'List stashes'
143
+ },
144
+ flags: {
145
+ '--cwd': 'Working directory (default: current)',
146
+ '--staged': 'Show staged changes only (for diff)',
147
+ '--full': 'Show full diff output',
148
+ '--limit': 'Number of commits to show (default: 10)',
149
+ '--json': 'Output in JSON format'
150
+ },
151
+ examples: [
152
+ 'praisonai-ts git status',
153
+ 'praisonai-ts git diff',
154
+ 'praisonai-ts git diff --staged',
155
+ 'praisonai-ts git log --limit 5',
156
+ 'praisonai-ts git branches',
157
+ 'praisonai-ts git stash'
158
+ ]
159
+ };
160
+ if (isJson) {
161
+ console.log(JSON.stringify(help, null, 2));
162
+ }
163
+ else {
164
+ console.log('Git - Repository operations (read-only)\n');
165
+ console.log('Subcommands:');
166
+ for (const [cmd, desc] of Object.entries(help.subcommands)) {
167
+ console.log(` ${cmd.padEnd(12)} ${desc}`);
168
+ }
169
+ console.log('\nFlags:');
170
+ for (const [flag, desc] of Object.entries(help.flags)) {
171
+ console.log(` ${flag.padEnd(12)} ${desc}`);
172
+ }
173
+ console.log('\nExamples:');
174
+ for (const ex of help.examples) {
175
+ console.log(` ${ex}`);
176
+ }
177
+ }
178
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Graph RAG command - Graph-based retrieval augmented generation
3
+ */
4
+ export interface GraphRagOptions {
5
+ verbose?: boolean;
6
+ output?: 'json' | 'text' | 'pretty';
7
+ json?: boolean;
8
+ }
9
+ export declare function execute(args: string[], options: GraphRagOptions): Promise<void>;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ /**
3
+ * Graph RAG command - Graph-based retrieval augmented generation
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 'info':
50
+ await showInfo(outputFormat);
51
+ break;
52
+ case 'help':
53
+ default:
54
+ await showHelp(outputFormat);
55
+ break;
56
+ }
57
+ }
58
+ catch (error) {
59
+ if (outputFormat === 'json') {
60
+ (0, json_1.outputJson)((0, json_1.formatError)(errors_1.ERROR_CODES.UNKNOWN, error instanceof Error ? error.message : String(error)));
61
+ }
62
+ else {
63
+ await pretty.error(error instanceof Error ? error.message : String(error));
64
+ }
65
+ process.exit(cli_spec_1.EXIT_CODES.RUNTIME_ERROR);
66
+ }
67
+ }
68
+ async function showInfo(outputFormat) {
69
+ const info = {
70
+ feature: 'Graph RAG',
71
+ description: 'Graph-based retrieval augmented generation for complex knowledge queries',
72
+ capabilities: [
73
+ 'Build knowledge graphs from documents',
74
+ 'Query relationships between entities',
75
+ 'Combine graph traversal with vector search',
76
+ 'Extract entities and relationships',
77
+ 'Support for complex multi-hop queries'
78
+ ],
79
+ sdkUsage: `
80
+ import { createGraphRAG, GraphStore } from 'praisonai';
81
+
82
+ // Create a graph RAG instance
83
+ const graphRag = createGraphRAG({
84
+ llm: 'openai/gpt-4o-mini',
85
+ graphStore: new GraphStore()
86
+ });
87
+
88
+ // Add documents
89
+ await graphRag.addDocument('Document content...');
90
+
91
+ // Query with graph context
92
+ const result = await graphRag.query('What is the relationship between X and Y?');
93
+ `
94
+ };
95
+ if (outputFormat === 'json') {
96
+ (0, json_1.outputJson)((0, json_1.formatSuccess)(info));
97
+ }
98
+ else {
99
+ await pretty.heading('Graph RAG');
100
+ await pretty.plain(info.description);
101
+ await pretty.newline();
102
+ await pretty.plain('Capabilities:');
103
+ for (const cap of info.capabilities) {
104
+ await pretty.plain(` • ${cap}`);
105
+ }
106
+ await pretty.newline();
107
+ await pretty.dim('Use the SDK for full Graph RAG functionality');
108
+ }
109
+ }
110
+ async function showHelp(outputFormat) {
111
+ const help = {
112
+ command: 'graph-rag',
113
+ description: 'Graph-based retrieval augmented generation',
114
+ subcommands: [
115
+ { name: 'info', description: 'Show Graph RAG feature information' },
116
+ { name: 'help', description: 'Show this help' }
117
+ ]
118
+ };
119
+ if (outputFormat === 'json') {
120
+ (0, json_1.outputJson)((0, json_1.formatSuccess)(help));
121
+ }
122
+ else {
123
+ await pretty.heading('Graph RAG Command');
124
+ await pretty.plain(help.description);
125
+ await pretty.newline();
126
+ await pretty.plain('Subcommands:');
127
+ for (const cmd of help.subcommands) {
128
+ await pretty.plain(` ${cmd.name.padEnd(20)} ${cmd.description}`);
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Guardrail command - Content validation and safety
3
+ */
4
+ export interface GuardrailOptions {
5
+ model?: string;
6
+ verbose?: boolean;
7
+ output?: 'json' | 'text' | 'pretty';
8
+ json?: boolean;
9
+ criteria?: string;
10
+ }
11
+ export declare function execute(args: string[], options: GuardrailOptions): Promise<void>;