janet-cli 0.3.5__tar.gz → 0.3.8__tar.gz
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.
- {janet_cli-0.3.5/janet_cli.egg-info → janet_cli-0.3.8}/PKG-INFO +2 -2
- {janet_cli-0.3.5 → janet_cli-0.3.8}/README.md +1 -1
- janet_cli-0.3.8/janet/__init__.py +8 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/markdown/generator.py +27 -2
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/sync/readme_generator.py +24 -2
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/sync/sse_watcher.py +4 -1
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/sync/sync_engine.py +8 -2
- {janet_cli-0.3.5 → janet_cli-0.3.8/janet_cli.egg-info}/PKG-INFO +2 -2
- janet_cli-0.3.8/janet_cli.egg-info/top_level.txt +1 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/pyproject.toml +1 -1
- janet_cli-0.3.5/janet/__init__.py +0 -3
- janet_cli-0.3.5/janet_cli.egg-info/top_level.txt +0 -2
- {janet_cli-0.3.5 → janet_cli-0.3.8}/.env.example +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/LICENSE +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/MANIFEST.in +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/__main__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/client.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/models.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/organizations.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/projects.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/api/tickets.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/auth/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/auth/callback_server.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/auth/oauth_flow.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/auth/token_manager.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/cli.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/config/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/config/manager.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/config/models.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/markdown/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/markdown/yjs_converter.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/sync/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/sync/file_manager.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/utils/__init__.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/utils/console.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/utils/errors.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet/utils/paths.py +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet_cli.egg-info/SOURCES.txt +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet_cli.egg-info/dependency_links.txt +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet_cli.egg-info/entry_points.txt +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/janet_cli.egg-info/requires.txt +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/requirements.txt +0 -0
- {janet_cli-0.3.5 → janet_cli-0.3.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: janet-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: CLI tool to sync Janet AI tickets to local markdown files
|
|
5
5
|
Author-email: Janet AI <support@janet-ai.com>
|
|
6
6
|
License: MIT
|
|
@@ -194,7 +194,7 @@ Tickets are organized in a clear hierarchy:
|
|
|
194
194
|
|
|
195
195
|
```
|
|
196
196
|
janet-tickets/
|
|
197
|
-
├──
|
|
197
|
+
├── AI_AGENT_INSTRUCTIONS.md # Instructions for AI coding agents
|
|
198
198
|
└── My Organization/
|
|
199
199
|
├── Backend/
|
|
200
200
|
│ ├── BACK-1.md
|
|
@@ -22,6 +22,8 @@ class MarkdownGenerator:
|
|
|
22
22
|
ticket: Dict,
|
|
23
23
|
organization_members: Optional[List[Dict]] = None,
|
|
24
24
|
attachments: Optional[Dict] = None,
|
|
25
|
+
org_id: Optional[str] = None,
|
|
26
|
+
project_id: Optional[str] = None,
|
|
25
27
|
) -> str:
|
|
26
28
|
"""
|
|
27
29
|
Generate complete markdown document from ticket data.
|
|
@@ -30,18 +32,26 @@ class MarkdownGenerator:
|
|
|
30
32
|
ticket: Ticket dictionary
|
|
31
33
|
organization_members: List of organization members (for name resolution)
|
|
32
34
|
attachments: Dictionary with direct_attachments and indirect_attachments
|
|
35
|
+
org_id: Organization ID for generating frontend link
|
|
36
|
+
project_id: Project ID for generating frontend link
|
|
33
37
|
|
|
34
38
|
Returns:
|
|
35
39
|
Complete markdown string
|
|
36
40
|
"""
|
|
37
41
|
sections = []
|
|
38
42
|
|
|
39
|
-
# 1.
|
|
43
|
+
# 1. Link to Janet frontend (at the very top)
|
|
44
|
+
ticket_id = ticket.get("id")
|
|
45
|
+
if org_id and project_id and ticket_id:
|
|
46
|
+
link = self._generate_frontend_link(org_id, project_id, ticket_id)
|
|
47
|
+
sections.append(f"**View in Janet:** {link}\n")
|
|
48
|
+
|
|
49
|
+
# 2. Title
|
|
40
50
|
ticket_key = ticket.get("ticket_key", "UNKNOWN")
|
|
41
51
|
title = ticket.get("title", "Untitled")
|
|
42
52
|
sections.append(f"# {ticket_key}: {title}\n")
|
|
43
53
|
|
|
44
|
-
#
|
|
54
|
+
# 3. Metadata
|
|
45
55
|
sections.append(self._generate_metadata(ticket, organization_members))
|
|
46
56
|
|
|
47
57
|
# 3. Description (pass attachments for inline image handling)
|
|
@@ -240,6 +250,21 @@ class MarkdownGenerator:
|
|
|
240
250
|
lines.append("") # Empty line after child tasks
|
|
241
251
|
return "\n".join(lines)
|
|
242
252
|
|
|
253
|
+
def _generate_frontend_link(self, org_id: str, project_id: str, ticket_id: str) -> str:
|
|
254
|
+
"""
|
|
255
|
+
Generate link to view ticket in Janet frontend.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
org_id: Organization ID
|
|
259
|
+
project_id: Project ID
|
|
260
|
+
ticket_id: Ticket ID
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
Markdown link to Janet frontend
|
|
264
|
+
"""
|
|
265
|
+
url = f"https://app.tryjanet.ai/dashboard/{org_id}/projects/{project_id}/{ticket_id}"
|
|
266
|
+
return url
|
|
267
|
+
|
|
243
268
|
def _generate_footer(self, ticket_key: str) -> str:
|
|
244
269
|
"""Generate footer section."""
|
|
245
270
|
export_date = self._format_date(datetime.utcnow().isoformat())
|
|
@@ -33,7 +33,7 @@ class ReadmeGenerator:
|
|
|
33
33
|
sections = []
|
|
34
34
|
|
|
35
35
|
# Header - addressing the AI agent directly
|
|
36
|
-
sections.append(f"#
|
|
36
|
+
sections.append(f"# Instructions for AI Coding Agents - {org_name}\n")
|
|
37
37
|
sections.append(
|
|
38
38
|
"This directory contains project management tickets from Janet AI. "
|
|
39
39
|
"Use these tickets to understand requirements, track work, and stay aligned with project goals.\n"
|
|
@@ -83,6 +83,28 @@ class ReadmeGenerator:
|
|
|
83
83
|
sections.append("3. **Follow requirements** - Use ticket descriptions as specifications")
|
|
84
84
|
sections.append("4. **Note priorities** - High/Critical tickets should be addressed first\n")
|
|
85
85
|
|
|
86
|
+
# Important notes for AI agents
|
|
87
|
+
sections.append("## ⚠️ IMPORTANT: Creating Tickets (Required Fields)\n")
|
|
88
|
+
sections.append("### Required Fields for Ticket Creation\n")
|
|
89
|
+
sections.append("**Every** ticket creation command **MUST** include:\n")
|
|
90
|
+
sections.append("1. **Title** - The ticket title (first positional argument)")
|
|
91
|
+
sections.append("2. **Project** - The project key using `--project` or `-p`")
|
|
92
|
+
sections.append("3. **Status** - A valid status using `--status` or `-s`\n")
|
|
93
|
+
|
|
94
|
+
sections.append("### Status Values Are Custom Per Project\n")
|
|
95
|
+
sections.append("Each project has custom status values (see \"Valid Statuses\" in Projects section above).\n")
|
|
96
|
+
sections.append("⚠️ **REQUIRED:** Always use a valid status from the project's \"Valid Statuses\" list.")
|
|
97
|
+
sections.append("⚠️ **If user doesn't specify a status:** Ask which status to use before running the command.")
|
|
98
|
+
sections.append("⚠️ **Never assume or guess status values** - they vary by project (e.g., \"To Do\" vs \"Backlog\" vs \"Open\").\n")
|
|
99
|
+
|
|
100
|
+
sections.append("### Example Workflow\n")
|
|
101
|
+
sections.append('**User prompt:** "Create a bug ticket in BACK for the login issue"\n')
|
|
102
|
+
sections.append("**Your response:** \"Which status should I use for the new ticket? Valid options for BACK are: To Do, In Progress, In Review, Done\"\n")
|
|
103
|
+
sections.append('**After user responds:** Run the command with the specified status:')
|
|
104
|
+
sections.append("```bash")
|
|
105
|
+
sections.append('janet ticket create "Fix login issue" -p BACK --status "To Do" --type Bug')
|
|
106
|
+
sections.append("```\n")
|
|
107
|
+
|
|
86
108
|
# CLI commands for the AI - comprehensive reference
|
|
87
109
|
sections.append("## CLI Commands Reference\n")
|
|
88
110
|
sections.append("Use the `janet` CLI to create and update tickets.\n")
|
|
@@ -264,7 +286,7 @@ class ReadmeGenerator:
|
|
|
264
286
|
readme_content = self.generate(org_name, projects, total_tickets, sync_time, project_statuses)
|
|
265
287
|
|
|
266
288
|
# Write to root of sync directory
|
|
267
|
-
readme_path = sync_dir / "
|
|
289
|
+
readme_path = sync_dir / "AI_AGENT_INSTRUCTIONS.md"
|
|
268
290
|
readme_path.write_text(readme_content, encoding="utf-8")
|
|
269
291
|
|
|
270
292
|
return readme_path
|
|
@@ -109,7 +109,10 @@ class SSEWatcher:
|
|
|
109
109
|
"direct_attachments": ticket_data.get("attachments", []),
|
|
110
110
|
"indirect_attachments": []
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
org_id = self.config.selected_organization.id
|
|
113
|
+
markdown = self.markdown_generator.generate(
|
|
114
|
+
ticket_data, self.org_members, attachments, org_id, project_id
|
|
115
|
+
)
|
|
113
116
|
self.file_manager.write_ticket(
|
|
114
117
|
org_name=self.org_name,
|
|
115
118
|
project_name=project_name,
|
|
@@ -168,8 +168,10 @@ class SyncEngine:
|
|
|
168
168
|
# Get pre-fetched attachments for this ticket
|
|
169
169
|
ticket_attachments = attachments_map.get(ticket_id)
|
|
170
170
|
|
|
171
|
+
org_id = self.config.selected_organization.id
|
|
171
172
|
self._sync_single_ticket_fast(
|
|
172
|
-
merged_ticket, org_name, project_name, org_members, ticket_attachments
|
|
173
|
+
merged_ticket, org_name, project_name, org_members, ticket_attachments,
|
|
174
|
+
org_id, project_id
|
|
173
175
|
)
|
|
174
176
|
synced_count += 1
|
|
175
177
|
except Exception as e:
|
|
@@ -188,6 +190,8 @@ class SyncEngine:
|
|
|
188
190
|
project_name: str,
|
|
189
191
|
org_members: Optional[List[Dict]] = None,
|
|
190
192
|
attachments: Optional[Dict] = None,
|
|
193
|
+
org_id: Optional[str] = None,
|
|
194
|
+
project_id: Optional[str] = None,
|
|
191
195
|
) -> None:
|
|
192
196
|
"""
|
|
193
197
|
Sync a single ticket (optimized - no individual API calls).
|
|
@@ -198,6 +202,8 @@ class SyncEngine:
|
|
|
198
202
|
project_name: Project name
|
|
199
203
|
org_members: Organization members for name resolution
|
|
200
204
|
attachments: Pre-fetched attachments dict (from batch fetch)
|
|
205
|
+
org_id: Organization ID for generating frontend link
|
|
206
|
+
project_id: Project ID for generating frontend link
|
|
201
207
|
"""
|
|
202
208
|
ticket_id = ticket.get("id")
|
|
203
209
|
|
|
@@ -224,7 +230,7 @@ class SyncEngine:
|
|
|
224
230
|
|
|
225
231
|
# Generate markdown
|
|
226
232
|
markdown = self.markdown_generator.generate(
|
|
227
|
-
ticket, org_members, attachments
|
|
233
|
+
ticket, org_members, attachments, org_id, project_id
|
|
228
234
|
)
|
|
229
235
|
|
|
230
236
|
# Write to file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: janet-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: CLI tool to sync Janet AI tickets to local markdown files
|
|
5
5
|
Author-email: Janet AI <support@janet-ai.com>
|
|
6
6
|
License: MIT
|
|
@@ -194,7 +194,7 @@ Tickets are organized in a clear hierarchy:
|
|
|
194
194
|
|
|
195
195
|
```
|
|
196
196
|
janet-tickets/
|
|
197
|
-
├──
|
|
197
|
+
├── AI_AGENT_INSTRUCTIONS.md # Instructions for AI coding agents
|
|
198
198
|
└── My Organization/
|
|
199
199
|
├── Backend/
|
|
200
200
|
│ ├── BACK-1.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
janet
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|