@jitera/connect 1.4.0 → 2.0.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 (81) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +89 -51
  4. package/content/instructions.md +7 -4
  5. package/content/session-start-unbound.md +12 -0
  6. package/content/session-start.md +14 -5
  7. package/dist/adapters/codex.d.ts.map +1 -1
  8. package/dist/adapters/codex.js +3 -0
  9. package/dist/adapters/codex.js.map +1 -1
  10. package/dist/adapters/cursor.d.ts.map +1 -1
  11. package/dist/adapters/cursor.js +3 -2
  12. package/dist/adapters/cursor.js.map +1 -1
  13. package/dist/adapters/types.d.ts +1 -0
  14. package/dist/adapters/types.d.ts.map +1 -1
  15. package/dist/bin/cli.js +4 -0
  16. package/dist/bin/cli.js.map +1 -1
  17. package/dist/bin/connect.js +3 -0
  18. package/dist/bin/connect.js.map +1 -1
  19. package/dist/bin/init.js +84 -3
  20. package/dist/bin/init.js.map +1 -1
  21. package/dist/bin/login.js +61 -14
  22. package/dist/bin/login.js.map +1 -1
  23. package/dist/bin/proxy.js +7 -2
  24. package/dist/bin/proxy.js.map +1 -1
  25. package/dist/bin/statusline.d.ts +3 -0
  26. package/dist/bin/statusline.d.ts.map +1 -0
  27. package/dist/bin/statusline.js +22 -0
  28. package/dist/bin/statusline.js.map +1 -0
  29. package/dist/cli-session.d.ts +12 -0
  30. package/dist/cli-session.d.ts.map +1 -0
  31. package/dist/cli-session.js +39 -0
  32. package/dist/cli-session.js.map +1 -0
  33. package/dist/device-flow.d.ts +10 -1
  34. package/dist/device-flow.d.ts.map +1 -1
  35. package/dist/device-flow.js +25 -1
  36. package/dist/device-flow.js.map +1 -1
  37. package/dist/graphql.d.ts +5 -0
  38. package/dist/graphql.d.ts.map +1 -1
  39. package/dist/graphql.js +15 -11
  40. package/dist/graphql.js.map +1 -1
  41. package/dist/hook-io.d.ts +2 -0
  42. package/dist/hook-io.d.ts.map +1 -1
  43. package/dist/hook-io.js +3 -0
  44. package/dist/hook-io.js.map +1 -1
  45. package/dist/hooks/session-start.js +24 -5
  46. package/dist/hooks/session-start.js.map +1 -1
  47. package/dist/hooks/stop.js +7 -1
  48. package/dist/hooks/stop.js.map +1 -1
  49. package/dist/hooks/user-prompt-submit.js +83 -18
  50. package/dist/hooks/user-prompt-submit.js.map +1 -1
  51. package/dist/install/statusline.d.ts +12 -0
  52. package/dist/install/statusline.d.ts.map +1 -0
  53. package/dist/install/statusline.js +30 -0
  54. package/dist/install/statusline.js.map +1 -0
  55. package/dist/mcp-client.d.ts +2 -1
  56. package/dist/mcp-client.d.ts.map +1 -1
  57. package/dist/mcp-client.js +2 -1
  58. package/dist/mcp-client.js.map +1 -1
  59. package/dist/project-marker.d.ts.map +1 -1
  60. package/dist/project-marker.js +14 -2
  61. package/dist/project-marker.js.map +1 -1
  62. package/dist/proxy.d.ts +3 -1
  63. package/dist/proxy.d.ts.map +1 -1
  64. package/dist/proxy.js +11 -2
  65. package/dist/proxy.js.map +1 -1
  66. package/dist/select.d.ts +11 -0
  67. package/dist/select.d.ts.map +1 -1
  68. package/dist/select.js +33 -0
  69. package/dist/select.js.map +1 -1
  70. package/dist/session-status.d.ts +11 -0
  71. package/dist/session-status.d.ts.map +1 -0
  72. package/dist/session-status.js +46 -0
  73. package/dist/session-status.js.map +1 -0
  74. package/dist/statusline.d.ts +8 -0
  75. package/dist/statusline.d.ts.map +1 -0
  76. package/dist/statusline.js +36 -0
  77. package/dist/statusline.js.map +1 -0
  78. package/package.json +3 -3
  79. package/skills/jitera-context/SKILL.md +22 -0
  80. package/skills/jitera-memory/SKILL.md +14 -2
  81. package/templates/AGENTS.md.tmpl +10 -4
@@ -0,0 +1,36 @@
1
+ const GREEN = "";
2
+ const YELLOW = "";
3
+ const DIM = "";
4
+ const RESET = "";
5
+ function compactChars(chars) {
6
+ return chars >= 1000 ? `${(chars / 1000).toFixed(1)}k` : `${chars}ch`;
7
+ }
8
+ function compactMs(ms) {
9
+ return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${ms}ms`;
10
+ }
11
+ export function renderStatusLine({ status, markerEnvironment, bound, }) {
12
+ if (!status)
13
+ return `${DIM}○${RESET} jitera`;
14
+ if (!status.configured)
15
+ return `${DIM}○${RESET} jitera · not connected`;
16
+ // Connected, but this repository is not bound to a project, so the hooks
17
+ // deliberately do nothing here. Carry the command that fixes it.
18
+ if (bound === false) {
19
+ return `${YELLOW}○${RESET} jitera · not initialised · npx @jitera/connect init`;
20
+ }
21
+ const dot = status.recallError ? `${YELLOW}●${RESET}` : `${GREEN}●${RESET}`;
22
+ const parts = [`${dot} jitera`];
23
+ if (status.environment)
24
+ parts.push(status.environment);
25
+ if (status.recallError) {
26
+ parts.push("recall failed");
27
+ }
28
+ else if (typeof status.recallMs === "number" && typeof status.recallChars === "number") {
29
+ parts.push(`recall ${compactChars(status.recallChars)}/${compactMs(status.recallMs)}`);
30
+ }
31
+ if (markerEnvironment && status.environment && markerEnvironment !== status.environment) {
32
+ parts.push(`${YELLOW}repo wants ${markerEnvironment}${RESET}`);
33
+ }
34
+ return parts.join(" · ");
35
+ }
36
+ //# sourceMappingURL=statusline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusline.js","sourceRoot":"","sources":["../src/statusline.ts"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,OAAO,CAAC;AACtB,MAAM,MAAM,GAAG,OAAO,CAAC;AACvB,MAAM,GAAG,GAAG,MAAM,CAAC;AACnB,MAAM,KAAK,GAAG,MAAM,CAAC;AAUrB,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC;AACxE,CAAC;AAED,SAAS,SAAS,CAAC,EAAU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C,WAAW,IAAI,iBAAiB,KAAK,MAAM,CAAC,WAAW,EAAE,CAAC;QACxF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,cAAc,iBAAiB,GAAG,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitera/connect",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Connect AI coding assistants to Jitera projects: documentation, source, and shared project memory",
6
6
  "license": "Apache-2.0",
@@ -20,8 +20,8 @@
20
20
  "node": ">=20"
21
21
  },
22
22
  "bin": {
23
- "connect": "./dist/bin/connect.js",
24
- "jitera-connect": "./dist/bin/connect.js"
23
+ "connect": "dist/bin/connect.js",
24
+ "jitera-connect": "dist/bin/connect.js"
25
25
  },
26
26
  "files": [
27
27
  "dist/",
@@ -17,6 +17,24 @@ Three virtual domains:
17
17
  | `sources/` | Project source code | no |
18
18
  | `uploads/` | Uploaded files | no |
19
19
 
20
+ ## Start with the whole picture
21
+
22
+ ```
23
+ gather_jitera_context(task="how do refunds get issued", budget=6000)
24
+ ```
25
+
26
+ Recalls project memory and searches documentation and source in one call,
27
+ running the widening fallbacks itself: memory falls back to every stored entity
28
+ when keywords match nothing, and search falls back to fuzzy matching when exact
29
+ matching is dry. It also lists the project's agents, so a recalled fact can be
30
+ attributed. Use it before planning or answering, then narrow with the tools
31
+ below.
32
+
33
+ It is not a once-per-session lookup. Call it again whenever the work reaches
34
+ something you have not gathered context for yet: a subsystem you have not
35
+ touched, a name you do not recognise, or a decision about how something should
36
+ work. Checking costs one call; guessing costs the rest of the session.
37
+
20
38
  ## Searching
21
39
 
22
40
  ```
@@ -27,6 +45,10 @@ resource_search(pattern="documents/**/*.md", content="refund", limit=30, offset=
27
45
  domain prefix to search every domain: `resource_search(pattern="**/checkout*.*")`
28
46
  - `content` — a grep-style match inside files, supporting boolean expressions:
29
47
  `content="(api OR rest) AND controller"`
48
+ - `mode` — how `content` is matched. `default` is a case-insensitive substring;
49
+ `regex` treats `content` as a case-insensitive regular expression; `full-text`
50
+ matches fuzzily by trigram similarity, for when you are unsure of the exact
51
+ wording. `pattern` is always a glob, whatever the mode
30
52
  - Results are grouped by domain. Open a match with `resource_read`
31
53
 
32
54
  Search before reading. Do not guess paths.
@@ -31,17 +31,29 @@ failed.
31
31
 
32
32
  ### When the first recall comes back thin
33
33
 
34
- `recall_jitera_memory` filters entities by keywords extracted from `query`. Work
35
- down this ladder, stopping as soon as you have what you need:
34
+ `gather_jitera_context` runs this ladder for you and says when it widened, so
35
+ prefer it for a first look. Reach for `recall_jitera_memory` directly when you
36
+ want memory alone, and work down the ladder yourself:
36
37
 
37
38
  1. `recall_jitera_memory(query="<specific terms from the task>")`
38
39
  2. `recall_jitera_memory(query="<the subsystem or domain>")`
39
40
  3. `recall_jitera_memory()` with no query — returns every stored entity
40
41
 
42
+ Keywords are combined with OR, so *more* terms match more entities. There is no
43
+ narrower rung below step 1 — when it comes back empty, widen rather than
44
+ refine.
45
+
41
46
  Do not conclude that memory is empty until step 3 returns nothing. Results
42
47
  containing `[[id]]` references mean related entities exist, and a broader query
43
48
  will surface them.
44
49
 
50
+ ### Whose memory you are reading
51
+
52
+ Each agent in a project writes to its own partition. A project-level key reads
53
+ across all of them, so a recalled fact may have been written by any agent;
54
+ `list_jitera_agents` names them. A key pinned to one agent sees only that
55
+ agent's own partition.
56
+
45
57
  ## Remember when knowledge is created
46
58
 
47
59
  Persist with `remember_jitera_memory(name, type, attrs)` when:
@@ -4,16 +4,22 @@
4
4
  This repository is connected to a {{BRAND}} project. Documentation, source, and a
5
5
  shared project memory are available through the `jitera` MCP server.
6
6
 
7
- Before planning or implementing anything, call `recall_jitera_memory`. An empty
8
- result is normal and is not an error.
7
+ Before planning or implementing anything, and before answering a question about
8
+ this project, call `gather_jitera_context` with the task in your own words. It
9
+ recalls project memory and searches documentation and source in one pass. An
10
+ empty result is normal and is not an error.
11
+
12
+ Keep using it as the work moves. It is not a once-per-session lookup: call it
13
+ again whenever you reach an area you have not gathered context for yet.
9
14
 
10
15
  Before writing a spec or design, search `documents/` with `resource_search` and
11
16
  read any match with `resource_read`. Update the existing document rather than
12
17
  creating a second one.
13
18
 
14
19
  When a decision is made, a constraint is discovered, or you are corrected,
15
- persist it with `remember_jitera_memory`. Recall the entity first and re-send its
16
- full attribute list, because entities are keyed on name plus type.
20
+ persist it with `remember_jitera_memory`. Recall the entity first with
21
+ `recall_jitera_memory` and re-send its full attribute list, because entities are
22
+ keyed on name plus type.
17
23
 
18
24
  `documents/` is readable and writable. `sources/` and `uploads/` are read-only.
19
25