htmlgraph 0.3.2__tar.gz → 0.3.3__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.
Files changed (62) hide show
  1. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/PKG-INFO +1 -1
  2. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/packages/gemini-extension/gemini-extension.json +1 -1
  3. {htmlgraph-0.3.2/src/python/htmlgraph/extensions/gemini → htmlgraph-0.3.3/packages/gemini-extension}/hooks/scripts/post-tool.sh +3 -6
  4. {htmlgraph-0.3.2/src/python/htmlgraph/extensions/gemini → htmlgraph-0.3.3/packages/gemini-extension}/hooks/scripts/session-end.sh +2 -0
  5. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/packages/gemini-extension/hooks/scripts/session-start.sh +2 -0
  6. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/pyproject.toml +1 -1
  7. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/__init__.py +1 -1
  8. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/cli.py +69 -1
  9. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/extensions/gemini/GEMINI.md +3 -1
  10. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/extensions/gemini/gemini-extension.json +1 -1
  11. {htmlgraph-0.3.2/packages/gemini-extension → htmlgraph-0.3.3/src/python/htmlgraph/extensions/gemini}/hooks/scripts/post-tool.sh +3 -6
  12. {htmlgraph-0.3.2/packages/gemini-extension → htmlgraph-0.3.3/src/python/htmlgraph/extensions/gemini}/hooks/scripts/session-end.sh +2 -0
  13. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/extensions/gemini/hooks/scripts/session-start.sh +2 -0
  14. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/session_manager.py +14 -4
  15. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/.gitignore +0 -0
  16. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/README.md +0 -0
  17. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/create_auth_track_demo.py +0 -0
  18. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/create_htmlgraph_dev_track.py +0 -0
  19. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/sdk_demo.py +0 -0
  20. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/demo.py +0 -0
  21. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/index.html +0 -0
  22. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/styles.css +0 -0
  23. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/task-001.html +0 -0
  24. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/task-002.html +0 -0
  25. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/task-003.html +0 -0
  26. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/task-004.html +0 -0
  27. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/examples/todo-list/task-005.html +0 -0
  28. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/packages/gemini-extension/GEMINI.md +0 -0
  29. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/packages/gemini-extension/README.md +0 -0
  30. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/packages/gemini-extension/hooks/hooks.json +0 -0
  31. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/agents.py +0 -0
  32. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/analytics_index.py +0 -0
  33. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/converter.py +0 -0
  34. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/dashboard.html +0 -0
  35. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/event_log.py +0 -0
  36. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/event_migration.py +0 -0
  37. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/extensions/gemini/README.md +0 -0
  38. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/extensions/gemini/hooks/hooks.json +0 -0
  39. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/file_watcher.py +0 -0
  40. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/git_events.py +0 -0
  41. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/graph.py +0 -0
  42. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/mcp_server.py +0 -0
  43. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/models.py +0 -0
  44. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/parser.py +0 -0
  45. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/planning.py +0 -0
  46. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/sdk.py +0 -0
  47. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/server.py +0 -0
  48. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/setup.py +0 -0
  49. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/styles.css +0 -0
  50. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/track_builder.py +0 -0
  51. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/track_manager.py +0 -0
  52. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/src/python/htmlgraph/watch.py +0 -0
  53. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/__init__.py +0 -0
  54. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_claiming.py +0 -0
  55. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_cli_commands.py +0 -0
  56. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_cross_agent_attribution.py +0 -0
  57. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_dashboard_ui.py +0 -0
  58. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_event_index.py +0 -0
  59. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_git_events.py +0 -0
  60. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_mcp_server.py +0 -0
  61. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_mcp_stdio_transport.py +0 -0
  62. {htmlgraph-0.3.2 → htmlgraph-0.3.3}/tests/python/test_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: htmlgraph
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: HTML is All You Need - Graph database on web standards
5
5
  Project-URL: Homepage, https://github.com/Shakes-tzd/htmlgraph
6
6
  Project-URL: Documentation, https://github.com/Shakes-tzd/htmlgraph#readme
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmlgraph",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "HtmlGraph session tracking and documentation for Gemini CLI. Ensures proper activity attribution, feature awareness, and continuous work tracking.",
5
5
  "author": "Shakes",
6
6
  "license": "MIT",
@@ -34,12 +34,9 @@ else
34
34
  HTMLGRAPH_CMD="htmlgraph"
35
35
  fi
36
36
 
37
+ export HTMLGRAPH_AGENT=gemini
38
+
37
39
  # Track the tool usage event
38
- # This is a simplified version - just log to events
39
- $HTMLGRAPH_CMD session track-activity \
40
- --type tool_use \
41
- --tool "$TOOL_NAME" \
42
- --timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
43
- &> /dev/null &
40
+ $HTMLGRAPH_CMD activity "$TOOL_NAME" "Tool used: $TOOL_NAME" &> /dev/null &
44
41
 
45
42
  exit 0
@@ -24,6 +24,8 @@ else
24
24
  HTMLGRAPH_CMD="htmlgraph"
25
25
  fi
26
26
 
27
+ export HTMLGRAPH_AGENT=gemini
28
+
27
29
  # Get active session ID
28
30
  SESSION_ID=$($HTMLGRAPH_CMD session list 2>/dev/null | grep -o 'session-[a-z0-9-]*' | head -1)
29
31
 
@@ -26,6 +26,8 @@ else
26
26
  HTMLGRAPH_CMD="htmlgraph"
27
27
  fi
28
28
 
29
+ export HTMLGRAPH_AGENT=gemini
30
+
29
31
  # Start a new session (or resume if one exists)
30
32
  SESSION_ID=$($HTMLGRAPH_CMD session start --agent gemini 2>/dev/null | grep -o 'session-[a-z0-9-]*' | head -1)
31
33
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "htmlgraph"
3
- version = "0.3.2"
3
+ version = "0.3.3"
4
4
  description = "HTML is All You Need - Graph database on web standards"
5
5
  authors = [{name = "Shakes", email = "shakestzd@gmail.com"}]
6
6
  readme = "README.md"
@@ -12,7 +12,7 @@ from htmlgraph.server import serve
12
12
  from htmlgraph.session_manager import SessionManager
13
13
  from htmlgraph.sdk import SDK
14
14
 
15
- __version__ = "0.3.1"
15
+ __version__ = "0.3.3"
16
16
  __all__ = [
17
17
  "Node",
18
18
  "Edge",
@@ -899,7 +899,8 @@ def cmd_track(args):
899
899
  # Find active session or use specified one
900
900
  session_id = args.session
901
901
  if not session_id:
902
- active = manager.get_active_session()
902
+ agent = os.environ.get("HTMLGRAPH_AGENT")
903
+ active = manager.get_active_session(agent=agent)
903
904
  if not active:
904
905
  print("Error: No active session. Start one with 'htmlgraph session start'.", file=sys.stderr)
905
906
  sys.exit(1)
@@ -1228,6 +1229,67 @@ def cmd_feature_auto_release(args):
1228
1229
  print(f" - {node_id}")
1229
1230
 
1230
1231
 
1232
+ def cmd_publish(args):
1233
+ """Build and publish the package to PyPI (Interoperable)."""
1234
+ import shutil
1235
+ import subprocess
1236
+
1237
+ # Ensure we are in project root
1238
+ if not Path("pyproject.toml").exists():
1239
+ print("Error: pyproject.toml not found. Run this from the project root.", file=sys.stderr)
1240
+ sys.exit(1)
1241
+
1242
+ # 1. Clean dist/
1243
+ dist_dir = Path("dist")
1244
+ if dist_dir.exists():
1245
+ print("Cleaning dist/...")
1246
+ shutil.rmtree(dist_dir)
1247
+
1248
+ # 2. Build
1249
+ print("Building package with uv...")
1250
+ try:
1251
+ subprocess.run(["uv", "build"], check=True)
1252
+ except subprocess.CalledProcessError:
1253
+ print("Error: Build failed.", file=sys.stderr)
1254
+ sys.exit(1)
1255
+ except FileNotFoundError:
1256
+ print("Error: 'uv' command not found.", file=sys.stderr)
1257
+ sys.exit(1)
1258
+
1259
+ # 3. Publish
1260
+ if args.dry_run:
1261
+ print("Dry run: Skipping publish.")
1262
+ return
1263
+
1264
+ print("Publishing to PyPI...")
1265
+ env = os.environ.copy()
1266
+
1267
+ # Smart credential loading from .env
1268
+ # Maps PyPI_API_TOKEN (common in .env) to UV_PUBLISH_TOKEN (needed by uv)
1269
+ if "UV_PUBLISH_TOKEN" not in env:
1270
+ dotenv = Path(".env")
1271
+ if dotenv.exists():
1272
+ try:
1273
+ content = dotenv.read_text()
1274
+ for line in content.splitlines():
1275
+ if line.strip() and not line.startswith("#") and "=" in line:
1276
+ key, val = line.split("=", 1)
1277
+ key = key.strip()
1278
+ val = val.strip().strip("'").strip('"')
1279
+ if key == "PyPI_API_TOKEN":
1280
+ env["UV_PUBLISH_TOKEN"] = val
1281
+ print("Loaded credentials from .env")
1282
+ except Exception:
1283
+ pass
1284
+
1285
+ try:
1286
+ subprocess.run(["uv", "publish"], env=env, check=True)
1287
+ print("\n✅ Successfully published!")
1288
+ except subprocess.CalledProcessError:
1289
+ print("\n❌ Publish failed.", file=sys.stderr)
1290
+ sys.exit(1)
1291
+
1292
+
1231
1293
  def cmd_feature_list(args):
1232
1294
  """List features by status."""
1233
1295
  from htmlgraph.sdk import SDK
@@ -1912,6 +1974,10 @@ curl Examples:
1912
1974
  setup_all_parser = setup_subparsers.add_parser("all", help="Set up for all supported platforms")
1913
1975
  setup_all_parser.add_argument("--auto-install", action="store_true", help="Automatically install when possible")
1914
1976
 
1977
+ # publish
1978
+ publish_parser = subparsers.add_parser("publish", help="Build and publish package to PyPI")
1979
+ publish_parser.add_argument("--dry-run", action="store_true", help="Build only, do not publish")
1980
+
1915
1981
  # install-gemini-extension
1916
1982
  install_gemini_parser = subparsers.add_parser(
1917
1983
  "install-gemini-extension",
@@ -2025,6 +2091,8 @@ curl Examples:
2025
2091
  else:
2026
2092
  setup_parser.print_help()
2027
2093
  sys.exit(1)
2094
+ elif args.command == "publish":
2095
+ cmd_publish(args)
2028
2096
  elif args.command == "install-gemini-extension":
2029
2097
  cmd_install_gemini_extension(args)
2030
2098
  else:
@@ -448,7 +448,9 @@ with sdk.features.edit('feature-123') as f:
448
448
  2. ✅ **VERIFY ATTRIBUTION:** Check that activities are linked to correct feature
449
449
  3. ✅ **CHECK STEPS:** ALL feature steps MUST be marked complete
450
450
  4. ✅ **CLEAN CODE:** Remove all debug code, console.logs, TODOs
451
- 5. ✅ **COMMIT:** Git commit with feature ID in message
451
+ 5. ✅ **COMMIT WORK:** Git commit your changes IMMEDIATELY (allows user rollback)
452
+ - Do this BEFORE marking the feature complete
453
+ - Include the feature ID in the commit message
452
454
  6. ✅ **COMPLETE FEATURE:** `uv run htmlgraph feature complete <id>`
453
455
  7. ✅ **UPDATE EPIC:** If part of epic, mark epic step complete
454
456
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmlgraph",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "HtmlGraph session tracking and documentation for Gemini CLI. Ensures proper activity attribution, feature awareness, and continuous work tracking.",
5
5
  "author": "Shakes",
6
6
  "license": "MIT",
@@ -34,12 +34,9 @@ else
34
34
  HTMLGRAPH_CMD="htmlgraph"
35
35
  fi
36
36
 
37
+ export HTMLGRAPH_AGENT=gemini
38
+
37
39
  # Track the tool usage event
38
- # This is a simplified version - just log to events
39
- $HTMLGRAPH_CMD session track-activity \
40
- --type tool_use \
41
- --tool "$TOOL_NAME" \
42
- --timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
43
- &> /dev/null &
40
+ $HTMLGRAPH_CMD activity "$TOOL_NAME" "Tool used: $TOOL_NAME" &> /dev/null &
44
41
 
45
42
  exit 0
@@ -24,6 +24,8 @@ else
24
24
  HTMLGRAPH_CMD="htmlgraph"
25
25
  fi
26
26
 
27
+ export HTMLGRAPH_AGENT=gemini
28
+
27
29
  # Get active session ID
28
30
  SESSION_ID=$($HTMLGRAPH_CMD session list 2>/dev/null | grep -o 'session-[a-z0-9-]*' | head -1)
29
31
 
@@ -26,6 +26,8 @@ else
26
26
  HTMLGRAPH_CMD="htmlgraph"
27
27
  fi
28
28
 
29
+ export HTMLGRAPH_AGENT=gemini
30
+
29
31
  # Start a new session (or resume if one exists)
30
32
  SESSION_ID=$($HTMLGRAPH_CMD session start --agent gemini 2>/dev/null | grep -o 'session-[a-z0-9-]*' | head -1)
31
33
 
@@ -267,12 +267,22 @@ class SessionManager:
267
267
  return self._active_session
268
268
  return self.session_converter.load(session_id)
269
269
 
270
- def get_active_session(self) -> Session | None:
271
- """Get the currently active session (if any)."""
270
+ def get_active_session(self, agent: str | None = None) -> Session | None:
271
+ """
272
+ Get the currently active session (if any).
273
+
274
+ Args:
275
+ agent: Optional agent filter
276
+ """
272
277
  if self._active_session and self._active_session.status == "active":
273
- return self._active_session
278
+ if not agent or self._active_session.agent == agent:
279
+ return self._active_session
280
+
281
+ sessions = self._list_active_sessions()
282
+ if agent:
283
+ sessions = [s for s in sessions if s.agent == agent]
274
284
 
275
- canonical = self._choose_canonical_active_session(self._list_active_sessions())
285
+ canonical = self._choose_canonical_active_session(sessions)
276
286
  if canonical:
277
287
  self._active_session = canonical
278
288
  return canonical
File without changes
File without changes