janet-cli 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,3 +1,8 @@
1
1
  """Janet AI CLI - Sync tickets to local markdown files."""
2
2
 
3
- __version__ = "0.3.7"
3
+ from importlib.metadata import version, PackageNotFoundError
4
+
5
+ try:
6
+ __version__ = version("janet-cli")
7
+ except PackageNotFoundError:
8
+ __version__ = "0.0.0" # Fallback for local development
@@ -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. Title
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
- # 2. Metadata
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())
janet/sync/sse_watcher.py CHANGED
@@ -109,7 +109,10 @@ class SSEWatcher:
109
109
  "direct_attachments": ticket_data.get("attachments", []),
110
110
  "indirect_attachments": []
111
111
  }
112
- markdown = self.markdown_generator.generate(ticket_data, self.org_members, attachments)
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,
janet/sync/sync_engine.py CHANGED
@@ -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.7
3
+ Version: 0.3.9
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
@@ -49,7 +49,7 @@ Dynamic: license-file
49
49
 
50
50
  ## What is Janet AI?
51
51
 
52
- [Janet AI](https://tryjanet.ai) is an AI-native project management platform for modern software teams. The Janet CLI allows developers to:
52
+ [Janet AI](https://janet.ai) is an AI-native project management platform for modern software teams. The Janet CLI allows developers to:
53
53
 
54
54
  - **Sync tickets** to local markdown files with real-time updates as changes are made on the platform
55
55
  - **Create tickets** directly from the command line or via AI agents
@@ -345,7 +345,7 @@ The CLI stores configuration at:
345
345
  ## Requirements
346
346
 
347
347
  - Python 3.8 or higher
348
- - Janet AI account ([sign up](https://tryjanet.ai))
348
+ - Janet AI account ([sign up](https://janet.ai))
349
349
 
350
350
  ## License
351
351
 
@@ -353,5 +353,5 @@ MIT License - see [LICENSE](LICENSE) file for details.
353
353
 
354
354
  ## Links
355
355
 
356
- - [Janet AI](https://tryjanet.ai) - AI-native project management
357
- - [Documentation](https://docs.tryjanet.ai)
356
+ - [Janet AI](https://janet.ai) - AI-native project management
357
+ - [Documentation](https://docs.janet.ai)
@@ -1,4 +1,4 @@
1
- janet/__init__.py,sha256=_QbRJk4Hf3jIynt4CrQztN386NAgz3nhYb4AtkXDrqg,82
1
+ janet/__init__.py,sha256=3vOjIbWOQBLG674GzJSTZefIoDGGcnApbUSx4tvZ0mA,255
2
2
  janet/__main__.py,sha256=nxsNRykF1aXRRSYNcMvohre4QDfpUzyr5JMyHRHWrwI,130
3
3
  janet/cli.py,sha256=A4R2-KTlTfBk4VwvMy5N5Zk22bP0abOuGgrCEGXO7cQ,40693
4
4
  janet/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -15,20 +15,20 @@ janet/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  janet/config/manager.py,sha256=Bs5YjHIzWPR-KuAFJyQL47ntU_JN87bGhROaYP0B3r4,3216
16
16
  janet/config/models.py,sha256=lnOcSlFTGVkEjCjNMOzq9OmPZ3KP0y7cvnoEHp5iQJY,2067
17
17
  janet/markdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- janet/markdown/generator.py,sha256=Dj9n72oLvMaJmFsutH_3nFGsMrYheIQ9EIIOOVeMxhQ,11216
18
+ janet/markdown/generator.py,sha256=YLxGh1Sv1bLuXE2e6jPYIOViBqXsBoL8QRqDF3v-4Ow,12171
19
19
  janet/markdown/yjs_converter.py,sha256=9CCInQzyjbpyDciMSKaUXCNh3xPn0hAwWhl1RES0KVc,12768
20
20
  janet/sync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  janet/sync/file_manager.py,sha256=fwV0VYP-0ZpwTAyDVqlVUPn3MB2wK6TvFQq450Lhr0I,5839
22
22
  janet/sync/readme_generator.py,sha256=ol4CC7yXYYoDrSPYbf0VASl-38uNjwKBg5klPNEnwUI,14032
23
- janet/sync/sse_watcher.py,sha256=L7iZfa4n77IImvywSPQf7PYxK9VVb8kjrVOS3qQ5xjQ,11157
24
- janet/sync/sync_engine.py,sha256=l4bV5KDbF86IVDAbMZRbFWwwP65TW--JqVkmJjXDnA4,9369
23
+ janet/sync/sse_watcher.py,sha256=m-Qk0jmAiNTAZjhxvD4VBcY3iLLPMd45j4eUS3I3brw,11277
24
+ janet/sync/sync_engine.py,sha256=u_9iv-ZdPpl-wzGID_8WjgsW0GkLIru8VPjw2yg3isU,9708
25
25
  janet/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  janet/utils/console.py,sha256=zMhX4HUXSco-or9KpqBJmYCzmfH_GWtvq-n2Sy6Dfgc,927
27
27
  janet/utils/errors.py,sha256=yxoVDF7ovMT7ooJA-8cvxJK8_3nWumGv7s1n8povi-4,783
28
28
  janet/utils/paths.py,sha256=JYp5gcSEjIbYNJaUcAwdpz6rmta9m0JzoBARC6_AWmM,1706
29
- janet_cli-0.3.7.dist-info/licenses/LICENSE,sha256=wNChlibp2El7r-zfLH8QhOg2oLPAvGwP7ETnVWyNRio,1065
30
- janet_cli-0.3.7.dist-info/METADATA,sha256=3IraPNmUIw9c1HSjoMdfGlOYAz_ntrcuEdvIf2pU7m4,10323
31
- janet_cli-0.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- janet_cli-0.3.7.dist-info/entry_points.txt,sha256=MeYUkStK_xcqW3AylPNpQh_H5zmfojB1-d8WMhifkvw,40
33
- janet_cli-0.3.7.dist-info/top_level.txt,sha256=Ux5zWeRoPO3Tu87toTRoiwMkIQNQylV9aRO2g7KqNW4,6
34
- janet_cli-0.3.7.dist-info/RECORD,,
29
+ janet_cli-0.3.9.dist-info/licenses/LICENSE,sha256=wNChlibp2El7r-zfLH8QhOg2oLPAvGwP7ETnVWyNRio,1065
30
+ janet_cli-0.3.9.dist-info/METADATA,sha256=yYJcfWZtFE7-lYNZpNrrAGJVTnPyPmvtN0ScN4wl43Y,10311
31
+ janet_cli-0.3.9.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
32
+ janet_cli-0.3.9.dist-info/entry_points.txt,sha256=MeYUkStK_xcqW3AylPNpQh_H5zmfojB1-d8WMhifkvw,40
33
+ janet_cli-0.3.9.dist-info/top_level.txt,sha256=Ux5zWeRoPO3Tu87toTRoiwMkIQNQylV9aRO2g7KqNW4,6
34
+ janet_cli-0.3.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5