ctxr-cli 0.36.0 → 0.37.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 (71) hide show
  1. package/LICENSE +21 -201
  2. package/README.md +14 -9
  3. package/dist/commands/plugin-build.d.ts +21 -11
  4. package/dist/commands/plugin-build.d.ts.map +1 -1
  5. package/dist/commands/plugin-build.js +45 -24
  6. package/dist/commands/plugin-build.js.map +1 -1
  7. package/dist/core/command.d.ts +5 -3
  8. package/dist/core/command.d.ts.map +1 -1
  9. package/dist/core/mcp/surface.js +1 -1
  10. package/dist/core/mcp/surface.js.map +1 -1
  11. package/dist/core/mcp/sync.d.ts +4 -1
  12. package/dist/core/mcp/sync.d.ts.map +1 -1
  13. package/dist/core/mcp/sync.js +6 -5
  14. package/dist/core/mcp/sync.js.map +1 -1
  15. package/dist/core/mcp/tool-map.d.ts +13 -11
  16. package/dist/core/mcp/tool-map.d.ts.map +1 -1
  17. package/dist/core/mcp/tool-map.js +13 -11
  18. package/dist/core/mcp/tool-map.js.map +1 -1
  19. package/dist/core/mcp/tools/gather.d.ts.map +1 -1
  20. package/dist/core/mcp/tools/gather.js +5 -4
  21. package/dist/core/mcp/tools/gather.js.map +1 -1
  22. package/dist/core/mcp/tools/index.d.ts +9 -1
  23. package/dist/core/mcp/tools/index.d.ts.map +1 -1
  24. package/dist/core/mcp/tools/index.js +20 -3
  25. package/dist/core/mcp/tools/index.js.map +1 -1
  26. package/dist/core/plugin/build.d.ts +53 -26
  27. package/dist/core/plugin/build.d.ts.map +1 -1
  28. package/dist/core/plugin/build.js +153 -50
  29. package/dist/core/plugin/build.js.map +1 -1
  30. package/dist/core/plugin/commands.d.ts +11 -0
  31. package/dist/core/plugin/commands.d.ts.map +1 -0
  32. package/dist/core/plugin/commands.js +23 -0
  33. package/dist/core/plugin/commands.js.map +1 -0
  34. package/dist/core/plugin/routes.d.ts +11 -7
  35. package/dist/core/plugin/routes.d.ts.map +1 -1
  36. package/dist/core/plugin/routes.js +27 -24
  37. package/dist/core/plugin/routes.js.map +1 -1
  38. package/dist/core/session/submit.d.ts.map +1 -1
  39. package/dist/core/session/submit.js +6 -3
  40. package/dist/core/session/submit.js.map +1 -1
  41. package/dist/core/shared-stores.d.ts +5 -0
  42. package/dist/core/shared-stores.d.ts.map +1 -1
  43. package/dist/core/shared-stores.js +10 -0
  44. package/dist/core/shared-stores.js.map +1 -1
  45. package/dist/core/skill-placeholders.d.ts +51 -0
  46. package/dist/core/skill-placeholders.d.ts.map +1 -0
  47. package/dist/core/skill-placeholders.js +55 -0
  48. package/dist/core/skill-placeholders.js.map +1 -0
  49. package/dist/core/skills.d.ts +37 -12
  50. package/dist/core/skills.d.ts.map +1 -1
  51. package/dist/core/skills.js +78 -89
  52. package/dist/core/skills.js.map +1 -1
  53. package/dist/run.d.ts.map +1 -1
  54. package/dist/run.js +25 -6
  55. package/dist/run.js.map +1 -1
  56. package/dist/version.d.ts +1 -1
  57. package/dist/version.js +1 -1
  58. package/package.json +3 -2
  59. package/templates/mcp/server-instructions.md +16 -0
  60. package/templates/plugin/README.md +30 -8
  61. package/templates/plugin/chatgpt-README.md +16 -0
  62. package/templates/plugin/claude-plugin.json +9 -1
  63. package/templates/plugin/command.md +7 -0
  64. package/templates/plugin/page.html +19 -8
  65. package/templates/skills/_surfaces.md +30 -0
  66. package/templates/skills/ctxr-placement.md +1 -1
  67. package/templates/skills/ctxr-session-lifecycle.md +6 -5
  68. package/templates/skills/mcp/_layer-step.md +18 -0
  69. package/templates/skills/mcp/_relation-grouping-step.md +5 -0
  70. package/templates/plugin/claude-mcp.json +0 -8
  71. package/templates/skills/mcp/_preamble.md +0 -44
@@ -22,10 +22,11 @@ session's worktree is gone. The name becomes a git ref and a directory, so keep
22
22
  that should not be written down.
23
23
 
24
24
  Before starting, bring the store's canonical clone up to date — the repository's main worktree, not
25
- whichever checkout you are standing in. From the canonical clone: `git fetch origin`, then
26
- `git merge --ff-only origin/__DEFAULT_BRANCH__`. If it is on another branch, carries uncommitted
27
- changes, or the fast-forward fails because it has diverged from origin, report exactly that and start
28
- the session anyway — never check it out, reset it, stash, or force the merge to make it comply. The
25
+ whichever checkout you are standing in. In a shell, run `ctxr sync`; through the store's server, skip
26
+ this step, because the server keeps its own clone current. It fetches `__DEFAULT_BRANCH__` and
27
+ fast-forwards the canonical clone, and leaves it alone when it is on another branch, carries uncommitted
28
+ changes, or has diverged from origin. If it reports that, report exactly that and start the session
29
+ anyway — never check it out, reset it, stash, or force the merge to make it comply. The
29
30
  session's base is unaffected either way, because `ctxr session start` branches from the
30
31
  `origin/__DEFAULT_BRANCH__` it fetches itself. What a stale clone costs is the context you read out of
31
32
  it: notes, catalog sections, the graph document, and AGENTS.md would all be the versions it last had.
@@ -56,7 +57,7 @@ It reports each session with its open pull request and the decision made on the
56
57
 
57
58
  Skip this section when the store mounts no other stores under `shared/`.
58
59
 
59
- - After you bring the canonical clone up to date, run `ctxr shared-stores sync`. It clones a missing mount and fast-forwards the others.
60
+ - After you bring the canonical clone up to date, run `ctxr shared-stores sync` in a shell; through the store's server, skip this step, because the server keeps no mounts. It clones a missing mount and fast-forwards the others.
60
61
  - Report a mount that sync left alone, with its reason. Do not reset, stash or force it. Why: local work in a mount is somebody's session.
61
62
  - To write into a mount for the work of this store's session, change into `shared/<name>`. Run `ctxr session start --joins <session>` there, with this store's session name. Why: the mount's session then joins this one, and one decision covers both pull requests.
62
63
  - The command refuses outside a mount, or for a session this store does not have. Report the refusal. Do not start a plain session instead.
@@ -0,0 +1,18 @@
1
+ ## 1. Which layer?
2
+
3
+ The connector's instructions list this store's layers, each with its description, under *This store*;
4
+ AGENTS.md's "Placing a new note" section lists them too. Choose by what the content fundamentally IS, not by
5
+ surface keywords; a label on a location says nothing about what is actually kept there.
6
+
7
+ - A layer whose description names an end state, a finish line or a deadline takes only what has a finish
8
+ line: if it never closes, it does not belong there. An item in that layer that can never close is a smell
9
+ — it either clutters the layer as open-forever or gets retired prematurely. Never create one on purpose;
10
+ an ongoing responsibility with a standard to maintain belongs in a layer whose description says so.
11
+ - A layer whose description says it holds completed, abandoned or inactive items is where the other layers'
12
+ finished or dropped items go — never a first placement. Retire a note with `ctxr archive <path>` (a
13
+ tracked move; frontmatter untouched).
14
+
15
+ If the store lists no layers, there is no layer decision: place the note next to the notes it will link to
16
+ most (`ctxr graph query neighbors <path>` on the closest existing note shows that cluster) and let wikilinks
17
+ carry the structure. If no layer fits, use the catch-all location AGENTS.md names and revisit the placement
18
+ later.
@@ -0,0 +1,5 @@
1
+ 5. Group proposals by the relation vocabulary the connector's instructions list under *This store*, each
2
+ with its definition. The section headings carrying these names are what `ctxr graph build` types edges
3
+ from, so a link written under the right heading becomes a typed edge on the next build. Format each item
4
+ as `[[Note]]` — reason. Choose between two adjacent relations by their definitions, not their names, and
5
+ remember that an edge is recorded only on the note carrying the link.
@@ -1,8 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "__NAME__": {
4
- "type": "http",
5
- "url": "__MCP_URL__"
6
- }
7
- }
8
- }
@@ -1,44 +0,0 @@
1
- ## Before this skill: the store's tools stand in for a checkout
2
-
3
- You are working through this store's server, not in a checkout of it. Nothing runs a shell here, so no
4
- `git`, `gh` or `ctxr` command runs as written. The skill below was written for an agent with a checkout:
5
- follow it as written, and take each step it names through the tool these tables give.
6
-
7
- ### Commands
8
-
9
- __COMMAND_TABLE__
10
-
11
- A command marked none has no counterpart here: skip that step and say nothing about it. Each other tool takes its command's options as fields, each named for its option without the leading
12
- dashes, and the session the command names as `session`: the session worktree's directory name, which
13
- `session_start` returns and `session_list` lists. `session_start` takes the session's name as `label`.
14
-
15
- Every other `ctxr` step runs through the `ctxr` tool when the command only reads, and through `ctxr_write`
16
- when it writes. Pass the words after `ctxr` as `args`, one word per entry: a step that says to run
17
- `ctxr lint` is the `ctxr` tool with `args` set to `["lint"]`. Name a session as `session` to run the command
18
- in that session's working tree; `ctxr_write` always needs one. When a command reads a file you prepared,
19
- pass the file's text as `input` and write `@input` in `args` where its path goes.
20
-
21
- ### Git steps
22
-
23
- __GIT_STEP_TABLE__
24
-
25
- Commits, pushes and pull requests happen only in `session_submit`. A step marked none is the server's own
26
- work: it keeps the store's clone current, and `session_start` branches from the freshly fetched default
27
- branch. Skip that step and say nothing about it.
28
-
29
- ### Paths
30
-
31
- `session_start` returns the session's root, a path such as `__WORKTREES_PATH__<directory>/`. Every path the
32
- skill names is relative to the store; inside a session it goes under that root, so the note `work/a.md` in
33
- that session is `__WORKTREES_PATH__<directory>/work/a.md` for `Read`, `Edit`, `Write`, `Move`, `Delete`,
34
- `Grep` and `Glob`. A path without a session root reads the store as it was last approved, and a write to one
35
- is refused. A change rests uncommitted in its session until `session_submit`.
36
-
37
- ### Sessions across conversations
38
-
39
- The server keeps a session between conversations, but it cannot tell two conversations apart. At the
40
- start of a conversation, call `session_list` and mention each open session: what it holds uncommitted,
41
- and any requested changes on its pull request. Work in the session the person names, or start one.
42
-
43
- Where the skill hands off to a skill this environment does not carry, such as landing or upgrading, or
44
- asks you to work inside a store mounted under `shared/`, that step is not yours here: a person lands an approved change from the store's approval page.