wayform 0.1.4 → 0.1.5

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.
@@ -8,8 +8,10 @@
8
8
  */
9
9
  export function reviewInstruction(project) {
10
10
  return (`Wayform end-of-turn review for project "${project}". ` +
11
- `Before finishing: did THIS turn settle a deliberate decision, or establish ` +
12
- `durable context, that is not already recorded in the shared store? A settled ` +
11
+ `Before finishing: did THIS turn settle a deliberate decision, establish ` +
12
+ `durable context, or produce a durable conclusion of your own (a design, ` +
13
+ `plan, or non-obvious finding), that is not already recorded in the shared ` +
14
+ `store? A settled ` +
13
15
  `decision is "we decided X because Y" — not an open question, an option still ` +
14
16
  `under discussion, or an intermediate reasoning step. ` +
15
17
  `If yes, call the write_context tool now (project: "${project}", ` +
@@ -1 +1 @@
1
- {"version":3,"file":"review-prompt.js","sourceRoot":"","sources":["../src/review-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,CACL,2CAA2C,OAAO,KAAK;QACvD,6EAA6E;QAC7E,+EAA+E;QAC/E,+EAA+E;QAC/E,uDAAuD;QACvD,sDAAsD,OAAO,KAAK;QAClE,gFAAgF;QAChF,mDAAmD;QACnD,gFAAgF;QAChF,2BAA2B;QAC3B,wDAAwD;QACxD,yCAAyC,CAC1C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"review-prompt.js","sourceRoot":"","sources":["../src/review-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,CACL,2CAA2C,OAAO,KAAK;QACvD,0EAA0E;QAC1E,0EAA0E;QAC1E,4EAA4E;QAC5E,mBAAmB;QACnB,+EAA+E;QAC/E,uDAAuD;QACvD,sDAAsD,OAAO,KAAK;QAClE,gFAAgF;QAChF,mDAAmD;QACnD,gFAAgF;QAChF,2BAA2B;QAC3B,wDAAwD;QACxD,yCAAyC,CAC1C,CAAC;AACJ,CAAC"}
@@ -17,12 +17,7 @@ export function sessionPreamble(project) {
17
17
  `decisions and context as already-known; do not ask the user to re-explain ` +
18
18
  `them.`);
19
19
  }
20
- /**
21
- * Operating rules injected at session start (before the data briefing).
22
- * This is the mid-session pull lever — the briefing alone makes models assume
23
- * they "already have memory" and never call tools again.
24
- */
25
- export function invocationPlaybook(project) {
20
+ export function invocationPlaybook(project, opts = {}) {
26
21
  return [
27
22
  `## MemoryLayer — required tool policy (project "${project}")`,
28
23
  ``,
@@ -34,11 +29,26 @@ export function invocationPlaybook(project) {
34
29
  `- \`search_memory(query)\` BEFORE contradicting, reversing, or re-deciding ` +
35
30
  `anything that might already be settled — and whenever the topic is absent ` +
36
31
  `or unclear in "memory covers", Open questions, or Recent decisions.`,
32
+ `- \`search_memory(query)\` BEFORE asking the user a clarifying question — ` +
33
+ `the answer is often recorded. Only ask if memory comes back empty; never ` +
34
+ `ask for information you could have retrieved.`,
35
+ `- \`search_memory(query)\` BEFORE recommending an action or approach — check ` +
36
+ `whether it was already recommended or already done; acknowledge that ` +
37
+ `instead of repeating it.`,
37
38
  `- \`read_context(project="${project}", query=…)\` for depth on ONE topic ` +
38
39
  `(after search, or when Open questions / Unresolved conflicts touch the work).`,
39
40
  `- \`write_context(project="${project}", type, payload)\` when THIS turn ` +
40
- `settles "we decided X because Y" or durable background not already stored. ` +
41
- `Not for open options or intermediate reasoning.`,
41
+ `settles "we decided X because Y" or durable background not already stored — ` +
42
+ `including durable conclusions YOU produced (a design, plan, or non-obvious ` +
43
+ `finding), written as a condensed summary. Not for open options or ` +
44
+ `intermediate reasoning.`,
45
+ ...(opts.supersedes
46
+ ? [
47
+ `- To UPDATE or CORRECT a recorded decision: \`write_context\` the new ` +
48
+ `version with \`supersedes: [<old fact id from search results>]\` — ` +
49
+ `never write an unlinked near-duplicate.`,
50
+ ]
51
+ : []),
42
52
  `- \`memory_feedback(fact_id, useful|wrong|stale)\` after a retrieved fact ` +
43
53
  `clearly helped or misled (use the fact id from tool results).`,
44
54
  ``,
@@ -58,22 +68,30 @@ export function invocationPlaybook(project) {
58
68
  ].join("\n");
59
69
  }
60
70
  /** Full session-start payload: policy first, then data framing + body. */
61
- export function composeSessionStartText(project, body) {
62
- return (`${invocationPlaybook(project)}\n\n---\n\n` +
71
+ export function composeSessionStartText(project, body, opts = {}) {
72
+ return (`${invocationPlaybook(project, opts)}\n\n---\n\n` +
63
73
  `${sessionPreamble(project)}\n\n${body}`);
64
74
  }
65
75
  /**
66
76
  * Shorter twin for MCP `initialize.instructions` (no briefing present there).
67
77
  * Same forcing rules; names the default project when the agent is unsure.
68
78
  */
69
- export function mcpInstructions(defaultProject) {
79
+ export function mcpInstructions(defaultProject, opts = {}) {
70
80
  return (`This server holds shared planning memory (decisions and durable context) ` +
71
81
  `for collaborators. Default project if unsure: "${defaultProject}". ` +
72
- `MUST: call search_memory before contradicting or re-deciding settled work; ` +
82
+ `MUST: call search_memory before contradicting or re-deciding settled work, ` +
83
+ `before asking the user a clarifying question memory might answer, and ` +
84
+ `before recommending an action that may already be recommended or done; ` +
73
85
  `call read_context(project, query=…) for topic depth (if a session-start ` +
74
86
  `briefing was already injected, do NOT queryless re-read just to refresh); ` +
75
- `call write_context only for deliberate "we decided X because Y" or durable ` +
76
- `background — not every reasoning step; ` +
87
+ `call write_context only for deliberate "we decided X because Y", durable ` +
88
+ `background, or a condensed durable conclusion you produced — not every ` +
89
+ `reasoning step; ` +
90
+ (opts.supersedes
91
+ ? `to update or correct a recorded decision, write_context the new ` +
92
+ `version with supersedes:[old fact id from search results] instead of ` +
93
+ `a near-duplicate; `
94
+ : ``) +
77
95
  `call memory_feedback(fact_id, useful|wrong|stale) when a retrieved fact ` +
78
96
  `helped or misled. Prefer these tools over guessing or asking the user to ` +
79
97
  `re-explain recorded decisions.`);
@@ -1 +1 @@
1
- {"version":3,"file":"session-prompt.js","sourceRoot":"","sources":["../src/session-prompt.ts"],"names":[],"m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C,OAAO,EAAE,IAAI,CAAC,aAAa;QACjD,GAAG,eAAe,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CACzC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,cAAsB,EACtB,OAAqB,EAAE;IAEvB,OAAO,CACL,2EAA2E;QAC3E,kDAAkD,cAAc,KAAK;QACrE,6EAA6E;QAC7E,wEAAwE;QACxE,yEAAyE;QACzE,0EAA0E;QAC1E,4EAA4E;QAC5E,2EAA2E;QAC3E,yEAAyE;QACzE,kBAAkB;QAClB,CAAC,IAAI,CAAC,UAAU;YACd,CAAC,CAAC,kEAAkE;gBAClE,uEAAuE;gBACvE,oBAAoB;YACtB,CAAC,CAAC,EAAE,CAAC;QACP,0EAA0E;QAC1E,2EAA2E;QAC3E,gCAAgC,CACjC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wayform",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Vendor-neutral multiplayer planning memory: a git-backed MCP server that shares planning context across Claude, Cursor, and Codex.",
5
5
  "type": "module",
6
6
  "bin": {