jac-coder 0.2.2__tar.gz → 0.2.4__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 (120) hide show
  1. {jac_coder-0.2.2 → jac_coder-0.2.4}/PKG-INFO +1 -1
  2. {jac_coder-0.2.2 → jac_coder-0.2.4}/README.md +3 -3
  3. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/api.impl.jac +74 -35
  4. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/api.jac +3 -0
  5. jac_coder-0.2.4/jac_coder/cli.impl.jac +696 -0
  6. jac_coder-0.2.4/jac_coder/cli.jac +180 -0
  7. jac_coder-0.2.4/jac_coder/cli_entry.py +27 -0
  8. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/core/nodes.impl.jac +13 -5
  9. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/core/nodes.jac +44 -0
  10. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/core/walkers.impl.jac +18 -42
  11. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/config.impl.jac +8 -0
  12. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/config.jac +5 -0
  13. jac_coder-0.2.4/jac_coder/infra/events.jac +268 -0
  14. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/mcp_manager.impl.jac +7 -1
  15. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/lib/coder.impl.jac +302 -30
  16. jac_coder-0.2.4/jac_coder/runtime/compaction.jac +301 -0
  17. jac_coder-0.2.4/jac_coder/runtime/file_logger.jac +235 -0
  18. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/server.jac +14 -1
  19. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/ROADMAP.md +1 -0
  20. jac_coder-0.2.4/jac_coder/skills/jac-cl-auth/SKILL.md +134 -0
  21. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-cl-components/SKILL.md +37 -13
  22. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-cl-organization/SKILL.md +27 -2
  23. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-cl-routing/SKILL.md +2 -5
  24. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-cl-styling/SKILL.md +2 -0
  25. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-core-cheatsheet/SKILL.md +25 -3
  26. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-fullstack-patterns/SKILL.md +1 -0
  27. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-node-edge-patterns/SKILL.md +24 -3
  28. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-npm-packages/SKILL.md +2 -0
  29. jac_coder-0.2.4/jac_coder/skills/jac-shadcn-components/SKILL.md +340 -0
  30. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-sv-auth/SKILL.md +9 -9
  31. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-sv-endpoints/SKILL.md +8 -8
  32. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-sv-persistence/SKILL.md +16 -16
  33. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-types/SKILL.md +27 -0
  34. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-walker-patterns/SKILL.md +5 -5
  35. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/filesystem.impl.jac +34 -10
  36. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/jac_tools.impl.jac +38 -19
  37. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/PKG-INFO +1 -1
  38. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/SOURCES.txt +6 -0
  39. {jac_coder-0.2.2 → jac_coder-0.2.4}/pyproject.toml +1 -1
  40. jac_coder-0.2.2/jac_coder/cli_entry.py +0 -25
  41. jac_coder-0.2.2/jac_coder/skills/jac-cl-auth/SKILL.md +0 -93
  42. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/__init__.jac +0 -0
  43. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/__init__.py +0 -0
  44. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/core/__init__.jac +0 -0
  45. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/core/walkers.jac +0 -0
  46. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/__init__.jac +0 -0
  47. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/kv.jac +0 -0
  48. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/infra/mcp_manager.jac +0 -0
  49. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/lib/__init__.jac +0 -0
  50. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/lib/coder.jac +0 -0
  51. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/__init__.jac +0 -0
  52. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/context.impl.jac +0 -0
  53. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/context.jac +0 -0
  54. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/cost_tracker.impl.jac +0 -0
  55. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/cost_tracker.jac +0 -0
  56. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/events.jac +0 -0
  57. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/memory.impl.jac +0 -0
  58. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/memory.jac +0 -0
  59. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/permission.impl.jac +0 -0
  60. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/permission.jac +0 -0
  61. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/prompt.impl.jac +0 -0
  62. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/prompt.jac +0 -0
  63. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/skills.impl.jac +0 -0
  64. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/runtime/skills.jac +0 -0
  65. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/serve_entry.jac +0 -0
  66. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-by-llm/SKILL.md +0 -0
  67. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-has-fields/SKILL.md +0 -0
  68. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-impl-files/SKILL.md +0 -0
  69. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/skills/jac-scaffold/SKILL.md +0 -0
  70. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/__init__.jac +0 -0
  71. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/git.impl.jac +0 -0
  72. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/git.jac +0 -0
  73. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/mcp.impl.jac +0 -0
  74. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/mcp.jac +0 -0
  75. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/__init__.jac +0 -0
  76. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/delegation.impl.jac +0 -0
  77. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/delegation.jac +0 -0
  78. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/question.impl.jac +0 -0
  79. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/question.jac +0 -0
  80. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/task.impl.jac +0 -0
  81. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/task.jac +0 -0
  82. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/think.impl.jac +0 -0
  83. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/think.jac +0 -0
  84. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/todo.impl.jac +0 -0
  85. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/todo.jac +0 -0
  86. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/validate.impl.jac +0 -0
  87. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/meta/validate.jac +0 -0
  88. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/net/__init__.jac +0 -0
  89. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/net/preview.impl.jac +0 -0
  90. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/net/preview.jac +0 -0
  91. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/net/web.impl.jac +0 -0
  92. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/net/web.jac +0 -0
  93. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/__init__.jac +0 -0
  94. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/filesystem.jac +0 -0
  95. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/jac_analyzer.impl.jac +0 -0
  96. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/jac_analyzer.jac +0 -0
  97. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/load_jac_skill.impl.jac +0 -0
  98. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/load_jac_skill.jac +0 -0
  99. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/search.impl.jac +0 -0
  100. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/read/search.jac +0 -0
  101. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/__init__.jac +0 -0
  102. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/guarded.impl.jac +0 -0
  103. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/guarded.jac +0 -0
  104. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/jac_tools.jac +0 -0
  105. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/shell.impl.jac +0 -0
  106. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/run/shell.jac +0 -0
  107. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/write/__init__.jac +0 -0
  108. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/write/checked.impl.jac +0 -0
  109. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/tool/write/checked.jac +0 -0
  110. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/__init__.jac +0 -0
  111. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/colors.jac +0 -0
  112. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/sandbox.impl.jac +0 -0
  113. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/sandbox.jac +0 -0
  114. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/tool_output.impl.jac +0 -0
  115. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder/util/tool_output.jac +0 -0
  116. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/dependency_links.txt +0 -0
  117. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/entry_points.txt +0 -0
  118. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/requires.txt +0 -0
  119. {jac_coder-0.2.2 → jac_coder-0.2.4}/jac_coder.egg-info/top_level.txt +0 -0
  120. {jac_coder-0.2.2 → jac_coder-0.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jac-coder
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: AI coding agent backend for Jac, powered by jac-byllm
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: python-dotenv>=1.0.0
@@ -40,13 +40,13 @@ Dependencies (auto-installed): `jaclang`, `byllm`, `mcp>=1.0.0`, `jac-mcp`, `pyt
40
40
  export OPENAI_API_KEY="sk-..."
41
41
 
42
42
  # Interactive REPL
43
- jac cli.jac
43
+ jac-coder
44
44
 
45
45
  # Single prompt (non-interactive)
46
- jac cli.jac run "build a hello world jac app at /tmp/myapp"
46
+ jac-coder run "build a hello world jac app at /tmp/myapp"
47
47
 
48
48
  # Resume a session
49
- jac cli.jac session <id-prefix>
49
+ jac-coder session <id-prefix>
50
50
  ```
51
51
 
52
52
  ## Architecture
@@ -257,15 +257,24 @@ impl chat(
257
257
  # role=system dicts to session.chat_history without them persisting stale.
258
258
  prefix_parts: list[str] = [];
259
259
 
260
- if session.project_summary {
261
- is_progress_file = session.project_summary.lstrip().startswith("#");
262
- label = (
263
- "Project progress (.jaccoder/progress.md)"
264
- if is_progress_file
265
- else "Project context"
260
+ # Tell the LLM the actual working directory — without this, relative
261
+ # paths are unresolvable and the model guesses (e.g. "/home/user").
262
+ if work_dir {
263
+ prefix_parts.append(
264
+ f"Working directory: {work_dir}\n"
265
+ "Default to this directory: resolve relative paths and deictic "
266
+ "references (e.g. 'here', 'this folder', '.', './sub') against it. "
267
+ "Use absolute paths for anything outside it."
266
268
  );
269
+ }
270
+
271
+ if session.project_summary {
267
272
  prefix_parts.append(
268
- f"[INTERNAL — do NOT present this to the user unless they ask about the project. This is your background knowledge for making informed decisions.]\n{label}:\n{session.project_summary}"
273
+ "[INTERNAL — background context from .jaccoder/progress.md. "
274
+ "Do NOT acknowledge, summarize, or volunteer this to the user "
275
+ "unless they explicitly ask about the project. Use it only to "
276
+ "inform your decisions on real work prompts.]\n"
277
+ f"Project progress (.jaccoder/progress.md):\n{session.project_summary}"
269
278
  );
270
279
  }
271
280
  if session.active_files {
@@ -373,13 +382,18 @@ impl chat(
373
382
  } else {
374
383
  session.pending_errors = [];
375
384
  }
376
- if files_modified and session.directory {
377
- memory = find_or_create_memory(session.directory);
378
- if memory {
379
- update_memory_from_session(
380
- memory, files_modified, response_text[:500]
381
- );
382
- session.project_summary = memory.summarize();
385
+ if session.directory {
386
+ _progress_path = os.path.join(session.directory, ".jaccoder", "progress.md");
387
+ if os.path.isfile(_progress_path) {
388
+ try {
389
+ with open(_progress_path, "r", encoding="utf-8") as _pf {
390
+ _pc = _pf.read();
391
+ }
392
+ if len(_pc) > 4000 {
393
+ _pc = _pc[:4000] + "\n\n[... truncated]";
394
+ }
395
+ session.project_summary = _pc;
396
+ } except Exception { }
383
397
  }
384
398
  }
385
399
 
@@ -443,21 +457,19 @@ def _ensure_memory(session: Session, work_dir: str) -> None {
443
457
  if not work_dir or session.project_summary {
444
458
  return;
445
459
  }
446
- memory = find_or_create_memory(work_dir);
447
- if not memory {
460
+ progress_path = os.path.join(work_dir, ".jaccoder", "progress.md");
461
+ if not os.path.isfile(progress_path) {
448
462
  return;
449
463
  }
450
- has_project = (
451
- os.path.exists(os.path.join(work_dir, "jac.toml"))
452
- or os.path.exists(os.path.join(work_dir, "main.jac"))
453
- );
454
- if not memory.architecture and not memory.scan_attempted and has_project {
455
- _init_memory(memory, work_dir);
456
- }
457
- summary = memory.summarize();
458
- if summary {
459
- session.project_summary = summary;
460
- }
464
+ try {
465
+ with open(progress_path, "r", encoding="utf-8") as f {
466
+ content = f.read();
467
+ }
468
+ if len(content) > 4000 {
469
+ content = content[:4000] + "\n\n[... truncated]";
470
+ }
471
+ session.project_summary = content;
472
+ } except Exception { }
461
473
  }
462
474
 
463
475
 
@@ -484,14 +496,19 @@ def _post_process(session: Session, response_obj: Any) -> None {
484
496
  session.pending_errors = [];
485
497
  }
486
498
 
487
- # Update memory
488
- if response_obj.files_modified and session.directory {
489
- memory = find_or_create_memory(session.directory);
490
- if memory {
491
- update_memory_from_session(
492
- memory, response_obj.files_modified, response_obj.content[:500]
493
- );
494
- session.project_summary = memory.summarize();
499
+ # Refresh project_summary from progress.md (agent may have updated it).
500
+ if session.directory {
501
+ progress_path = os.path.join(session.directory, ".jaccoder", "progress.md");
502
+ if os.path.isfile(progress_path) {
503
+ try {
504
+ with open(progress_path, "r", encoding="utf-8") as f {
505
+ pc = f.read();
506
+ }
507
+ if len(pc) > 4000 {
508
+ pc = pc[:4000] + "\n\n[... truncated]";
509
+ }
510
+ session.project_summary = pc;
511
+ } except Exception { }
495
512
  }
496
513
  }
497
514
 
@@ -524,6 +541,28 @@ impl api_get_model() -> dict {
524
541
  return _get_model();
525
542
  }
526
543
 
544
+ impl api_check_local_setup(alias: str) -> dict {
545
+ runtime: bool = False;
546
+ try {
547
+ import llama_cpp;
548
+ runtime = True;
549
+ } except ImportError { }
550
+
551
+ model: bool = False;
552
+ valid_alias: bool = False;
553
+ try {
554
+ import from byllm.local_runtime { LOCAL_MODELS }
555
+ import from byllm.model_cache { is_downloaded }
556
+ spec = LOCAL_MODELS.get(alias);
557
+ if spec is not None {
558
+ valid_alias = True;
559
+ model = is_downloaded(alias, spec);
560
+ }
561
+ } except Exception { }
562
+
563
+ return {"runtime": runtime, "model": model, "valid_alias": valid_alias};
564
+ }
565
+
527
566
 
528
567
  # ---------------------------------------------------------------------------
529
568
  # MCP management API
@@ -78,6 +78,9 @@ def api_set_model(model: str) -> dict;
78
78
  """Get current model info."""
79
79
  def api_get_model() -> dict;
80
80
 
81
+ """Check if local model runtime and model weights are ready for a given alias."""
82
+ def api_check_local_setup(alias: str) -> dict;
83
+
81
84
  # --- MCP management API ---
82
85
  """Add or update an MCP server."""
83
86
  def api_mcp_add(name: str, config: dict) -> dict;