jazz-ai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +182 -0
  3. package/dist/cli/commands/auth.d.ts +18 -0
  4. package/dist/cli/commands/auth.d.ts.map +1 -0
  5. package/dist/cli/commands/auth.js +128 -0
  6. package/dist/cli/commands/auth.js.map +1 -0
  7. package/dist/cli/commands/chat-agent.d.ts +18 -0
  8. package/dist/cli/commands/chat-agent.d.ts.map +1 -0
  9. package/dist/cli/commands/chat-agent.js +421 -0
  10. package/dist/cli/commands/chat-agent.js.map +1 -0
  11. package/dist/cli/commands/edit-agent.d.ts +10 -0
  12. package/dist/cli/commands/edit-agent.d.ts.map +1 -0
  13. package/dist/cli/commands/edit-agent.js +310 -0
  14. package/dist/cli/commands/edit-agent.js.map +1 -0
  15. package/dist/cli/commands/task-agent.d.ts +126 -0
  16. package/dist/cli/commands/task-agent.d.ts.map +1 -0
  17. package/dist/cli/commands/task-agent.js +345 -0
  18. package/dist/cli/commands/task-agent.js.map +1 -0
  19. package/dist/core/agent/agent-prompt.d.ts +47 -0
  20. package/dist/core/agent/agent-prompt.d.ts.map +1 -0
  21. package/dist/core/agent/agent-prompt.js +146 -0
  22. package/dist/core/agent/agent-prompt.js.map +1 -0
  23. package/dist/core/agent/agent-runner.d.ts +63 -0
  24. package/dist/core/agent/agent-runner.d.ts.map +1 -0
  25. package/dist/core/agent/agent-runner.js +346 -0
  26. package/dist/core/agent/agent-runner.js.map +1 -0
  27. package/dist/core/agent/agent-service.d.ts +164 -0
  28. package/dist/core/agent/agent-service.d.ts.map +1 -0
  29. package/dist/core/agent/agent-service.js +463 -0
  30. package/dist/core/agent/agent-service.js.map +1 -0
  31. package/dist/core/agent/gmail-agent.d.ts +17 -0
  32. package/dist/core/agent/gmail-agent.d.ts.map +1 -0
  33. package/dist/core/agent/gmail-agent.js +191 -0
  34. package/dist/core/agent/gmail-agent.js.map +1 -0
  35. package/dist/core/agent/prompts/default/v1.d.ts +2 -0
  36. package/dist/core/agent/prompts/default/v1.d.ts.map +1 -0
  37. package/dist/core/agent/prompts/default/v1.js +202 -0
  38. package/dist/core/agent/prompts/default/v1.js.map +1 -0
  39. package/dist/core/agent/prompts/default/v2.d.ts +2 -0
  40. package/dist/core/agent/prompts/default/v2.d.ts.map +1 -0
  41. package/dist/core/agent/prompts/default/v2.js +72 -0
  42. package/dist/core/agent/prompts/default/v2.js.map +1 -0
  43. package/dist/core/agent/prompts/gmail/v1.d.ts +2 -0
  44. package/dist/core/agent/prompts/gmail/v1.d.ts.map +1 -0
  45. package/dist/core/agent/prompts/gmail/v1.js +206 -0
  46. package/dist/core/agent/prompts/gmail/v1.js.map +1 -0
  47. package/dist/core/agent/prompts/gmail/v2.d.ts +2 -0
  48. package/dist/core/agent/prompts/gmail/v2.d.ts.map +1 -0
  49. package/dist/core/agent/prompts/gmail/v2.js +59 -0
  50. package/dist/core/agent/prompts/gmail/v2.js.map +1 -0
  51. package/dist/core/agent/tools/base-tool.d.ts +161 -0
  52. package/dist/core/agent/tools/base-tool.d.ts.map +1 -0
  53. package/dist/core/agent/tools/base-tool.js +153 -0
  54. package/dist/core/agent/tools/base-tool.js.map +1 -0
  55. package/dist/core/agent/tools/fs-tools.d.ts +21 -0
  56. package/dist/core/agent/tools/fs-tools.d.ts.map +1 -0
  57. package/dist/core/agent/tools/fs-tools.js +1210 -0
  58. package/dist/core/agent/tools/fs-tools.js.map +1 -0
  59. package/dist/core/agent/tools/git-tools.d.ts +63 -0
  60. package/dist/core/agent/tools/git-tools.d.ts.map +1 -0
  61. package/dist/core/agent/tools/git-tools.js +600 -0
  62. package/dist/core/agent/tools/git-tools.js.map +1 -0
  63. package/dist/core/agent/tools/gmail-tools.d.ts +22 -0
  64. package/dist/core/agent/tools/gmail-tools.d.ts.map +1 -0
  65. package/dist/core/agent/tools/gmail-tools.js +779 -0
  66. package/dist/core/agent/tools/gmail-tools.js.map +1 -0
  67. package/dist/core/agent/tools/register-tools.d.ts +13 -0
  68. package/dist/core/agent/tools/register-tools.d.ts.map +1 -0
  69. package/dist/core/agent/tools/register-tools.js +169 -0
  70. package/dist/core/agent/tools/register-tools.js.map +1 -0
  71. package/dist/core/agent/tools/shell-tools.d.ts +19 -0
  72. package/dist/core/agent/tools/shell-tools.d.ts.map +1 -0
  73. package/dist/core/agent/tools/shell-tools.js +367 -0
  74. package/dist/core/agent/tools/shell-tools.js.map +1 -0
  75. package/dist/core/agent/tools/tool-registry.d.ts +62 -0
  76. package/dist/core/agent/tools/tool-registry.d.ts.map +1 -0
  77. package/dist/core/agent/tools/tool-registry.js +187 -0
  78. package/dist/core/agent/tools/tool-registry.js.map +1 -0
  79. package/dist/core/agent/tools/web-search-tools.d.ts +39 -0
  80. package/dist/core/agent/tools/web-search-tools.d.ts.map +1 -0
  81. package/dist/core/agent/tools/web-search-tools.js +220 -0
  82. package/dist/core/agent/tools/web-search-tools.js.map +1 -0
  83. package/dist/core/types/errors.d.ts +300 -0
  84. package/dist/core/types/errors.d.ts.map +1 -0
  85. package/dist/core/types/errors.js +115 -0
  86. package/dist/core/types/errors.js.map +1 -0
  87. package/dist/core/types/index.d.ts +208 -0
  88. package/dist/core/types/index.d.ts.map +1 -0
  89. package/dist/core/types/index.js +30 -0
  90. package/dist/core/types/index.js.map +1 -0
  91. package/dist/core/utils/error-handler.d.ts +114 -0
  92. package/dist/core/utils/error-handler.d.ts.map +1 -0
  93. package/dist/core/utils/error-handler.js +551 -0
  94. package/dist/core/utils/error-handler.js.map +1 -0
  95. package/dist/core/utils/markdown-renderer.d.ts +52 -0
  96. package/dist/core/utils/markdown-renderer.d.ts.map +1 -0
  97. package/dist/core/utils/markdown-renderer.js +134 -0
  98. package/dist/core/utils/markdown-renderer.js.map +1 -0
  99. package/dist/main.d.ts +3 -0
  100. package/dist/main.d.ts.map +1 -0
  101. package/dist/main.js +255 -0
  102. package/dist/main.js.map +1 -0
  103. package/dist/services/config.d.ts +29 -0
  104. package/dist/services/config.d.ts.map +1 -0
  105. package/dist/services/config.js +204 -0
  106. package/dist/services/config.js.map +1 -0
  107. package/dist/services/gmail.d.ts +197 -0
  108. package/dist/services/gmail.d.ts.map +1 -0
  109. package/dist/services/gmail.js +592 -0
  110. package/dist/services/gmail.js.map +1 -0
  111. package/dist/services/llm/ai-sdk-service.d.ts +5 -0
  112. package/dist/services/llm/ai-sdk-service.d.ts.map +1 -0
  113. package/dist/services/llm/ai-sdk-service.js +326 -0
  114. package/dist/services/llm/ai-sdk-service.js.map +1 -0
  115. package/dist/services/llm/context-manager.d.ts +51 -0
  116. package/dist/services/llm/context-manager.d.ts.map +1 -0
  117. package/dist/services/llm/context-manager.js +269 -0
  118. package/dist/services/llm/context-manager.js.map +1 -0
  119. package/dist/services/llm/types.d.ts +114 -0
  120. package/dist/services/llm/types.d.ts.map +1 -0
  121. package/dist/services/llm/types.js +51 -0
  122. package/dist/services/llm/types.js.map +1 -0
  123. package/dist/services/logger.d.ts +28 -0
  124. package/dist/services/logger.d.ts.map +1 -0
  125. package/dist/services/logger.js +267 -0
  126. package/dist/services/logger.js.map +1 -0
  127. package/dist/services/shell.d.ts +37 -0
  128. package/dist/services/shell.d.ts.map +1 -0
  129. package/dist/services/shell.js +197 -0
  130. package/dist/services/shell.js.map +1 -0
  131. package/dist/services/storage/file.d.ts +37 -0
  132. package/dist/services/storage/file.d.ts.map +1 -0
  133. package/dist/services/storage/file.js +221 -0
  134. package/dist/services/storage/file.js.map +1 -0
  135. package/dist/services/storage/inMemory.d.ts +25 -0
  136. package/dist/services/storage/inMemory.d.ts.map +1 -0
  137. package/dist/services/storage/inMemory.js +106 -0
  138. package/dist/services/storage/inMemory.js.map +1 -0
  139. package/dist/services/storage/service.d.ts +26 -0
  140. package/dist/services/storage/service.d.ts.map +1 -0
  141. package/dist/services/storage/service.js +48 -0
  142. package/dist/services/storage/service.js.map +1 -0
  143. package/package.json +92 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 lvndry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,182 @@
1
+ # Jazz 🎷
2
+
3
+ A powerful agentic automation CLI built with for managing agentic loops in daily life workflows.
4
+
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-100%25-blue.svg)](https://www.typescriptlang.org/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## đŸŽ¯ Overview
9
+
10
+ Jazz is a command-line tool designed to help you create, manage, and execute autonomous agents that can perform complex automation tasks.
11
+
12
+ ### Key Features
13
+
14
+ - **🤖 Agent Management**: Create, configure, and manage autonomous agents
15
+ - **⚡ Task Execution**: Execute various types of tasks (commands, scripts, API calls, file operations)
16
+ - **🔄 Automation**: Schedule and trigger agent executions
17
+ - **📊 Monitoring**: Track agent performance and execution results
18
+ - **đŸ›Ąī¸ Type Safety**: Full TypeScript support with strict type checking
19
+ - **🔧 Extensible**: Plugin system for custom task types and integrations
20
+ - **📝 Structured Logging**: Comprehensive logging with correlation IDs
21
+
22
+ ## 🚀 Quick Start
23
+
24
+ ### Installation
25
+
26
+ ```bash
27
+ bun add -g jazz-cli
28
+
29
+ jazz --help
30
+ ```
31
+
32
+ ### Basic Usage
33
+
34
+ ```bash
35
+ # Create your first agent
36
+ jazz agent create
37
+
38
+ # List all agents
39
+ jazz agent list
40
+
41
+ # Get agent details
42
+ jazz agent get <agent-id>
43
+
44
+ # Run an agent (dry run)
45
+ jazz agent run <agent-id> --dry-run
46
+
47
+ # Delete an agent
48
+ jazz agent delete <agent-id>
49
+ ```
50
+
51
+ ## âš™ī¸ Configuration
52
+
53
+ Jazz uses a JSON configuration file to manage application settings, API keys, and service integrations. The configuration system provides sensible defaults while allowing full customization.
54
+
55
+ ### Configuration File Location
56
+
57
+ Jazz looks for configuration files in the following order:
58
+
59
+ 1. **Environment Variable**: `JAZZ_CONFIG_PATH`
60
+ 2. **Current Directory**: `./jazz.config.json`
61
+ 3. **Home Directory**: `~/.jazz/config.json`
62
+
63
+ ### Basic Configuration
64
+
65
+ Create a `.jazz/config.json` in your home directory:
66
+
67
+ ```json
68
+ // ~/.jazz/config.js
69
+
70
+ {
71
+ "google": {
72
+ "clientId": "your-google-client-id.apps.googleusercontent.com",
73
+ "clientSecret": "your-google-client-secret"
74
+ },
75
+ "llm": {
76
+ "openai": {
77
+ "api_key": "sk-your-openai-api-key"
78
+ },
79
+ "anthropic": {
80
+ "api_key": "sk-ant-your-anthropic-api-key"
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### Configuration Sections
87
+
88
+ #### 🔐 Google OAuth (Optional)
89
+
90
+ Required for Gmail integration and Google services:
91
+
92
+ ```json
93
+ {
94
+ "google": {
95
+ "clientId": "your-client-id.apps.googleusercontent.com",
96
+ "clientSecret": "your-client-secret"
97
+ }
98
+ }
99
+ ```
100
+
101
+ **Setup Instructions:**
102
+
103
+ 1. Go to [Google Cloud Console](https://console.cloud.google.com/)
104
+ 2. Create a new project or select existing one
105
+ 3. Enable Gmail API
106
+ 4. Create OAuth 2.0 credentials
107
+ 5. Add `http://localhost:53682/oauth2callback` as redirect URI
108
+ 6. Copy client ID and secret to your config
109
+
110
+ #### 🤖 LLM Providers
111
+
112
+ Configure model providers for AI agents:
113
+
114
+ ```json
115
+ {
116
+ "llm": {
117
+ "openai": {
118
+ "api_key": "sk-your-openai-api-key"
119
+ },
120
+ "anthropic": {
121
+ "api_key": "sk-ant-your-anthropic-api-key"
122
+ },
123
+ "google": {
124
+ "api_key": "AIza-your-google-api-key"
125
+ },
126
+ "mistral": {
127
+ "api_key": "mist-your-mistral-api-key"
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ### Authentication Management
134
+
135
+ Jazz provides built-in authentication management for services:
136
+
137
+ ```bash
138
+ # Authenticate with Gmail
139
+ jazz auth gmail login
140
+
141
+ # Check authentication status
142
+ jazz auth gmail status
143
+
144
+ # Logout from Gmail
145
+ jazz auth gmail logout
146
+ ```
147
+
148
+ **Token Storage**: Authentication tokens are automatically stored in `.jazz/google/gmail-token.json` and managed securely by Jazz.
149
+
150
+ ```bash
151
+ # Run with verbose logging to see configuration details
152
+ jazz --verbose agent list
153
+ ```
154
+
155
+ ## 📖 Documentation
156
+
157
+ - [Architecture Overview](docs/architecture.md) - Understanding the system design
158
+ - [CLI Reference](docs/cli-reference.md) - Complete command documentation
159
+ - [Agent Development](docs/agent-development.md) - Creating and configuring agents
160
+ - [Task Types](docs/task-types.md) - Available task types and their usage
161
+ - [Configuration](docs/configuration.md) - Application configuration options
162
+ - [API Reference](docs/api-reference.md) - Service interfaces and types
163
+ - [Examples](docs/examples.md) - Practical usage examples
164
+ - [Contributing](CONTRIBUTING.md) - Development guidelines
165
+
166
+ ## 📋 Current Status
167
+
168
+ [TODO.md](./TODO.md)
169
+
170
+ ## 📄 License
171
+
172
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
173
+
174
+ ## 📞 Support
175
+
176
+ - 📖 [Documentation](docs/)
177
+ - 🐛 [Issue Tracker](https://github.com/lvndry/jazz/issues)
178
+ - đŸ’Ŧ [Discussions](https://github.com/lvndry/jazz/discussions)
179
+
180
+ ---
181
+
182
+ **Built with â¤ī¸ by [lvndry](https://github.com/lvndry)**
@@ -0,0 +1,18 @@
1
+ import { FileSystem } from "@effect/platform";
2
+ import { Effect } from "effect";
3
+ import { type ConfigService } from "../../services/config";
4
+ import { GmailAuthenticationError, type GmailService } from "../../services/gmail";
5
+ import { type LoggerService } from "../../services/logger";
6
+ /**
7
+ * Gmail login command - initiates OAuth flow
8
+ */
9
+ export declare function gmailLoginCommand(): Effect.Effect<void, GmailAuthenticationError, GmailService | LoggerService | ConfigService>;
10
+ /**
11
+ * Gmail logout command - removes stored tokens
12
+ */
13
+ export declare function gmailLogoutCommand(): Effect.Effect<void, never, FileSystem.FileSystem | ConfigService | LoggerService>;
14
+ /**
15
+ * Check Gmail authentication status
16
+ */
17
+ export declare function gmailStatusCommand(): Effect.Effect<void, never, FileSystem.FileSystem | ConfigService | LoggerService>;
18
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAmB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAc7E;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,CAChD,IAAI,EACJ,wBAAwB,EACxB,YAAY,GAAG,aAAa,GAAG,aAAa,CAC7C,CAaA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,CACjD,IAAI,EACJ,KAAK,EACL,UAAU,CAAC,UAAU,GAAG,aAAa,GAAG,aAAa,CACtD,CAwCA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,CACjD,IAAI,EACJ,KAAK,EACL,UAAU,CAAC,UAAU,GAAG,aAAa,GAAG,aAAa,CACtD,CAgEA"}
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gmailLoginCommand = gmailLoginCommand;
4
+ exports.gmailLogoutCommand = gmailLogoutCommand;
5
+ exports.gmailStatusCommand = gmailStatusCommand;
6
+ const platform_1 = require("@effect/platform");
7
+ const effect_1 = require("effect");
8
+ const config_1 = require("../../services/config");
9
+ const gmail_1 = require("../../services/gmail");
10
+ const logger_1 = require("../../services/logger");
11
+ /**
12
+ * Gmail login command - initiates OAuth flow
13
+ */
14
+ function gmailLoginCommand() {
15
+ return effect_1.Effect.gen(function* () {
16
+ const logger = yield* logger_1.LoggerServiceTag;
17
+ const gmailService = yield* gmail_1.GmailServiceTag;
18
+ yield* logger.info("Starting Gmail authentication...");
19
+ console.log("🔐 Starting Gmail authentication process...");
20
+ yield* gmailService.authenticate();
21
+ yield* logger.info("Gmail authentication completed successfully");
22
+ console.log("✅ Gmail authentication successful!");
23
+ console.log("You can now use Gmail tools with your agents.");
24
+ });
25
+ }
26
+ /**
27
+ * Gmail logout command - removes stored tokens
28
+ */
29
+ function gmailLogoutCommand() {
30
+ return effect_1.Effect.gen(function* () {
31
+ const logger = yield* logger_1.LoggerServiceTag;
32
+ const fs = yield* platform_1.FileSystem.FileSystem;
33
+ const config = yield* config_1.AgentConfigService;
34
+ yield* logger.info("Starting Gmail logout process...");
35
+ console.log("đŸšĒ Logging out of Gmail...");
36
+ // Get the token file path from config
37
+ const { storage } = yield* config.appConfig;
38
+ const dataDir = storage.type === "file" ? storage.path : "./.jazz";
39
+ const tokenFilePath = `${dataDir}/google/gmail-token.json`;
40
+ // Check if token file exists
41
+ const tokenExists = yield* fs
42
+ .exists(tokenFilePath)
43
+ .pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed(false)));
44
+ if (tokenExists) {
45
+ // Remove the token file
46
+ yield* fs.remove(tokenFilePath).pipe(effect_1.Effect.catchAll((error) => {
47
+ return effect_1.Effect.gen(function* () {
48
+ yield* logger.error("Failed to remove token file", { error });
49
+ console.log("âš ī¸ Warning: Could not remove token file:");
50
+ console.log(` ${error instanceof Error ? error.message : String(error)}`);
51
+ });
52
+ }));
53
+ yield* logger.info("Gmail token removed successfully");
54
+ console.log("✅ Successfully logged out of Gmail");
55
+ console.log("Your authentication tokens have been removed.");
56
+ }
57
+ else {
58
+ yield* logger.info("No Gmail token found to remove");
59
+ console.log("â„šī¸ No Gmail authentication found");
60
+ console.log("You were not logged in to Gmail.");
61
+ }
62
+ });
63
+ }
64
+ /**
65
+ * Check Gmail authentication status
66
+ */
67
+ function gmailStatusCommand() {
68
+ return effect_1.Effect.gen(function* () {
69
+ const logger = yield* logger_1.LoggerServiceTag;
70
+ const fs = yield* platform_1.FileSystem.FileSystem;
71
+ const config = yield* config_1.AgentConfigService;
72
+ yield* logger.info("Checking Gmail authentication status...");
73
+ console.log("🔍 Checking Gmail authentication status...");
74
+ // Get the token file path from config
75
+ const { storage } = yield* config.appConfig;
76
+ const dataDir = storage.type === "file" ? storage.path : "./.jazz";
77
+ const tokenFilePath = `${dataDir}/google/gmail-token.json`;
78
+ // Check if token file exists
79
+ const tokenExists = yield* fs
80
+ .exists(tokenFilePath)
81
+ .pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed(false)));
82
+ if (tokenExists) {
83
+ // Try to read and parse the token
84
+ const tokenContent = yield* fs
85
+ .readFileString(tokenFilePath)
86
+ .pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed("")));
87
+ if (tokenContent) {
88
+ try {
89
+ const token = JSON.parse(tokenContent);
90
+ const expiryDate = token.expiry_date ? new Date(token.expiry_date) : null;
91
+ const isExpired = expiryDate ? expiryDate < new Date() : false;
92
+ yield* logger.info("Gmail token found and parsed", {
93
+ hasAccessToken: !!token.access_token,
94
+ hasRefreshToken: !!token.refresh_token,
95
+ isExpired,
96
+ });
97
+ console.log("✅ Gmail authentication status:");
98
+ console.log(` Status: ${isExpired ? "Expired" : "Active"}`);
99
+ console.log(` Access Token: ${token.access_token ? "Present" : "Missing"}`);
100
+ console.log(` Refresh Token: ${token.refresh_token ? "Present" : "Missing"}`);
101
+ if (expiryDate) {
102
+ console.log(` Expires: ${expiryDate.toLocaleString()}`);
103
+ }
104
+ if (token.scope) {
105
+ console.log(` Scopes: ${token.scope}`);
106
+ }
107
+ }
108
+ catch (parseError) {
109
+ yield* logger.error("Failed to parse Gmail token", { error: parseError });
110
+ console.log("âš ī¸ Gmail token file exists but is corrupted");
111
+ console.log(" Run 'jazz auth gmail logout' to clean up and re-authenticate");
112
+ }
113
+ }
114
+ else {
115
+ yield* logger.info("Gmail token file is empty");
116
+ console.log("âš ī¸ Gmail token file exists but is empty");
117
+ console.log(" Run 'jazz auth gmail logout' to clean up and re-authenticate");
118
+ }
119
+ }
120
+ else {
121
+ yield* logger.info("No Gmail token found");
122
+ console.log("❌ Gmail authentication status:");
123
+ console.log(" Status: Not authenticated");
124
+ console.log(" Run 'jazz auth gmail login' to authenticate");
125
+ }
126
+ });
127
+ }
128
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/cli/commands/auth.ts"],"names":[],"mappings":";;AAqBA,8CAiBC;AAKD,gDA4CC;AAKD,gDAoEC;AAhKD,+CAA8C;AAC9C,mCAAgC;AAChC,kDAA+E;AAC/E,gDAAoG;AACpG,kDAA6E;AAc7E;;GAEG;AACH,SAAgB,iBAAiB;IA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5D,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;gBACjF,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;gBAChD,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;gBACxD,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;YAC9C,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAChE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { FileSystem } from "@effect/platform";
2
+ import { Effect } from "effect";
3
+ import { type AgentService } from "../../core/agent/agent-service";
4
+ import type { ToolRegistry } from "../../core/agent/tools/tool-registry";
5
+ import { AgentAlreadyExistsError, AgentConfigurationError, StorageError, StorageNotFoundError, ValidationError } from "../../core/types/errors";
6
+ import type { ConfigService } from "../../services/config";
7
+ import { LLMConfigurationError, type LLMService } from "../../services/llm/types";
8
+ import { type LoggerService } from "../../services/logger";
9
+ import { type FileSystemContextService } from "../../services/shell";
10
+ /**
11
+ * Interactive AI agent creation command
12
+ */
13
+ export declare function createAIAgentCommand(): Effect.Effect<void, StorageError | AgentAlreadyExistsError | AgentConfigurationError | ValidationError | LLMConfigurationError, AgentService | LLMService | ToolRegistry>;
14
+ /**
15
+ * Chat with an AI agent
16
+ */
17
+ export declare function chatWithAIAgentCommand(agentId: string): Effect.Effect<void, StorageError | StorageNotFoundError, AgentService | ConfigService | LLMService | ToolRegistry | LoggerService | FileSystemContextService | FileSystem.FileSystem>;
18
+ //# sourceMappingURL=chat-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-agent.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/chat-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EACL,qBAAqB,EAIrB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAA+B,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAoBlG;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,CACnD,IAAI,EACF,YAAY,GACZ,uBAAuB,GACvB,uBAAuB,GACvB,eAAe,GACf,qBAAqB,EACvB,YAAY,GAAG,UAAU,GAAG,YAAY,CACzC,CA8EA;AAyID;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,CACd,IAAI,EACJ,YAAY,GAAG,oBAAoB,EACjC,YAAY,GACZ,aAAa,GACb,UAAU,GACV,YAAY,GACZ,aAAa,GACb,wBAAwB,GACxB,UAAU,CAAC,UAAU,CACxB,CA2BA"}