@crewhaus/tool-wiki 0.4.0 → 0.5.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 (2) hide show
  1. package/dist/index.js +26 -2
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -89,21 +89,36 @@ export const GAPS_TAG = "gaps/";
89
89
  // ---------------------------------------------------------------------------
90
90
  // schemas — field-for-field mirrors of thredz-mcp's TOOLS inputSchemas
91
91
  // ---------------------------------------------------------------------------
92
+ /**
93
+ * `space` rides on every wiki tool for cross-backend parity with thredz-mcp
94
+ * 0.3.0, which accepts it on all nine. Locally it is a no-op — the file wiki is
95
+ * a single unspaced corpus — but accepting it means a spec written against the
96
+ * Thredz backend still runs unchanged over files, which is the whole point of
97
+ * the parity contract (`backend-conformance`, and the schema-mirror test).
98
+ */
99
+ const spaceField = z
100
+ .string()
101
+ .optional()
102
+ .describe("Thredz wiki space slug or id (accepted for cross-backend parity, meaningless locally — the local wiki is a single unspaced corpus)");
92
103
  const recallSchema = z.object({
93
104
  query: z.string().min(1).describe("what to recall about"),
94
105
  limit: z.number().int().min(1).max(50).optional().describe("max snippets (default 6)"),
106
+ space: spaceField,
95
107
  });
96
108
  const semanticSearchSchema = z.object({
97
109
  query: z.string().min(1).describe("natural-language query"),
98
110
  limit: z.number().int().min(1).max(50).optional().describe("max results (default 6)"),
99
111
  minScore: z.number().min(0).max(1).optional().describe("similarity floor 0–1 (default 0.05)"),
112
+ space: spaceField,
100
113
  });
101
114
  const searchSchema = z.object({
102
115
  query: z.string().min(1).describe("keyword query"),
116
+ space: spaceField,
103
117
  });
104
118
  const getSchema = z.object({
105
119
  slug: z.string().min(1).describe("article slug"),
106
120
  concise: z.boolean().optional().describe("trim to essentials"),
121
+ space: spaceField,
107
122
  });
108
123
  const articleStatusSchema = z.enum(["draft", "published", "review", "archived"]);
109
124
  const writeSchema = z.object({
@@ -122,6 +137,7 @@ const writeSchema = z.object({
122
137
  .enum(["private", "shared"])
123
138
  .optional()
124
139
  .describe("'private' (default — the local wiki is private by construction) | 'shared' (a Thredz concept; accepted for cross-backend parity, meaningless locally)"),
140
+ space: spaceField,
125
141
  });
126
142
  const listSchema = z.object({
127
143
  query: z.string().optional().describe("optional relevance filter"),
@@ -134,16 +150,21 @@ const listSchema = z.object({
134
150
  .describe("updated | created | title | relevance | popular | trending"),
135
151
  order: z.string().optional().describe("asc | desc"),
136
152
  limit: z.number().int().min(1).max(100).optional().describe("page size (default 25, max 100)"),
153
+ space: spaceField,
137
154
  });
138
155
  const relatedSchema = z.object({
139
156
  slug: z.string().min(1).describe("article slug"),
157
+ space: spaceField,
140
158
  });
141
159
  const setSignalsSchema = z.object({
160
+ space: spaceField,
142
161
  slug: z.string().min(1).describe("article slug"),
143
162
  verified: z.boolean().optional().describe("fact-checked"),
144
163
  confidenceScore: z.number().min(0).max(1).optional().describe("0–1"),
145
164
  });
146
- const statsSchema = z.object({});
165
+ const statsSchema = z.object({
166
+ space: spaceField,
167
+ });
147
168
  const logGapSchema = z.object({
148
169
  topic: z.string().min(1).describe("the topic the expert was weak on"),
149
170
  detail: z.string().optional().describe("what specifically was missing"),
@@ -385,7 +406,10 @@ export function createWikiTools(opts) {
385
406
  const sharedNote = input.visibility === "shared"
386
407
  ? "\nnote: the local wiki is private by construction — 'shared' visibility only applies on the Thredz backend."
387
408
  : "";
388
- return `wiki_write: ${verb} "${result.slug}" at v${result.version}${sharedNote}`;
409
+ const spaceNote = input.space !== undefined
410
+ ? "\nnote: the local wiki is a single unspaced corpus — 'space' only applies on the Thredz backend."
411
+ : "";
412
+ return `wiki_write: ${verb} "${result.slug}" at v${result.version}${sharedNote}${spaceNote}`;
389
413
  }
390
414
  catch (err) {
391
415
  if (err instanceof WikiVersionConflictError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/tool-wiki",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "0.3.0 memory release §3.2 — the thredz-identical wiki tool vocabulary (wiki_recall … log_knowledge_gap) over @crewhaus/wiki-store, with memory-origin boundary classification on every recalled body.",
6
6
  "main": "dist/index.js",
@@ -15,16 +15,16 @@
15
15
  "test": "bun test src"
16
16
  },
17
17
  "dependencies": {
18
- "@crewhaus/boundary-classifier": "0.4.0",
19
- "@crewhaus/event-log": "0.4.0",
20
- "@crewhaus/run-context": "0.4.0",
21
- "@crewhaus/tool-builder": "0.4.0",
22
- "@crewhaus/tool-catalog": "0.4.0",
23
- "@crewhaus/wiki-store": "0.4.0",
18
+ "@crewhaus/boundary-classifier": "0.5.0",
19
+ "@crewhaus/event-log": "0.5.0",
20
+ "@crewhaus/run-context": "0.5.0",
21
+ "@crewhaus/tool-builder": "0.5.0",
22
+ "@crewhaus/tool-catalog": "0.5.0",
23
+ "@crewhaus/wiki-store": "0.5.0",
24
24
  "zod": "^3.23.8"
25
25
  },
26
26
  "devDependencies": {
27
- "@crewhaus/embedder": "0.4.0"
27
+ "@crewhaus/embedder": "workspace:*"
28
28
  },
29
29
  "license": "Apache-2.0",
30
30
  "author": {