@dotdrelle/wiki-manager 0.14.8 → 0.14.9
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.
- package/package.json +1 -6
- package/src/agent/graph.test.js +1 -8
- package/src/cli/wiki-manager.js +1 -1
- package/src/core/buildInfo.json +2 -2
- package/src/core/env.js +9 -2
- package/src/core/mcp.js +1 -1
- package/src/core/skills.js +1 -30
- package/src/runtime/recoveryManager.test.js +1 -1
- package/src/runtime/store.js +4 -1
- package/src/runtime/store.test.js +6 -6
- package/wiki-workspace +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotdrelle/wiki-manager",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.9",
|
|
4
4
|
"description": "Agentic shell and orchestration cockpit for llm-wiki workspaces.",
|
|
5
5
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
6
|
"author": "dotrelle",
|
|
@@ -46,11 +46,6 @@
|
|
|
46
46
|
"cli"
|
|
47
47
|
],
|
|
48
48
|
"packageManager": "pnpm@10.29.2",
|
|
49
|
-
"pnpm": {
|
|
50
|
-
"onlyBuiltDependencies": [
|
|
51
|
-
"bun"
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
49
|
"dependencies": {
|
|
55
50
|
"@langchain/langgraph": "^1.3.2",
|
|
56
51
|
"@opentui/core": "^0.3.2",
|
package/src/agent/graph.test.js
CHANGED
|
@@ -801,16 +801,10 @@ test('buildAgentSystemPrompt forbids inventing slash commands or arguments', ()
|
|
|
801
801
|
assert.doesNotMatch(prompt, /executor:"/);
|
|
802
802
|
});
|
|
803
803
|
|
|
804
|
-
test('workspace
|
|
804
|
+
test('workspace skills are discovered from the fixed .wiki/skills directory', () => {
|
|
805
805
|
const root = mkdtempSync(join(tmpdir(), 'wiki-manager-skills-'));
|
|
806
806
|
try {
|
|
807
807
|
mkdirSync(join(root, '.wiki', 'skills'), { recursive: true });
|
|
808
|
-
writeFileSync(join(root, 'skill.yaml'), [
|
|
809
|
-
'name: basic',
|
|
810
|
-
'description: Demo workspace package',
|
|
811
|
-
'entrypoints:',
|
|
812
|
-
' uiSkillDir: .wiki/skills',
|
|
813
|
-
].join('\n'));
|
|
814
808
|
writeFileSync(join(root, '.wiki', 'skills', 'ingest.md'), [
|
|
815
809
|
'---',
|
|
816
810
|
'name: ingest',
|
|
@@ -820,7 +814,6 @@ test('workspace package manifest is not exposed as an executable skill', () => {
|
|
|
820
814
|
].join('\n'));
|
|
821
815
|
|
|
822
816
|
const prompt = buildAgentSystemPrompt({ session: sessionBase({ workspacePath: root }) });
|
|
823
|
-
assert.doesNotMatch(prompt, /\/basic:/);
|
|
824
817
|
assert.match(prompt, /\/ingest: Ingest pending sources/);
|
|
825
818
|
} finally {
|
|
826
819
|
rmSync(root, { recursive: true, force: true });
|
package/src/cli/wiki-manager.js
CHANGED
package/src/core/buildInfo.json
CHANGED
package/src/core/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { copyFileSync, existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
@@ -13,7 +13,14 @@ export function managerStateDir() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function managerRuntimeDir() {
|
|
16
|
-
|
|
16
|
+
const root = managerStateDir();
|
|
17
|
+
const runtimeDir = join(root, '.wiki', 'runtime');
|
|
18
|
+
const legacyDir = join(root, '.wiki-manager');
|
|
19
|
+
if (!existsSync(runtimeDir) && existsSync(legacyDir)) {
|
|
20
|
+
mkdirSync(join(root, '.wiki'), { recursive: true });
|
|
21
|
+
renameSync(legacyDir, runtimeDir);
|
|
22
|
+
}
|
|
23
|
+
return runtimeDir;
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
export function defaultRuntimeStateDir() {
|
package/src/core/mcp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { managerEnvFile, managerMcpEndpointsFile, readEnvFile } from './env.js';
|
|
3
3
|
|
|
4
|
-
const WIKI_MANAGER_VERSION = '0.14.
|
|
4
|
+
const WIKI_MANAGER_VERSION = '0.14.9';
|
|
5
5
|
|
|
6
6
|
function envValue(key) {
|
|
7
7
|
const filePath = managerEnvFile();
|
package/src/core/skills.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { basename, join } from 'node:path';
|
|
3
|
-
import { parse as parseYaml } from 'yaml';
|
|
4
3
|
|
|
5
4
|
const SKILL_NAME_RE = /^[a-zA-Z0-9_-]{1,80}$/;
|
|
6
5
|
const DEFAULT_UI_SKILL_DIR = '.wiki/skills';
|
|
@@ -51,33 +50,6 @@ export function readOptionalText(filePath) {
|
|
|
51
50
|
return readFileSync(filePath, 'utf8').trim();
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
function safeRelativeEntry(value, fallback) {
|
|
55
|
-
const text = String(value || fallback).trim();
|
|
56
|
-
if (!text || text.startsWith('/') || text.includes('..')) return fallback;
|
|
57
|
-
return text;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function readWorkspaceManifest(workspacePath) {
|
|
61
|
-
const manifestPath = join(workspacePath, 'skill.yaml');
|
|
62
|
-
if (!existsSync(manifestPath)) return null;
|
|
63
|
-
try {
|
|
64
|
-
const manifest = parseYaml(readFileSync(manifestPath, 'utf8'));
|
|
65
|
-
if (!manifest || typeof manifest !== 'object' || Array.isArray(manifest)) return null;
|
|
66
|
-
return { manifest, manifestPath };
|
|
67
|
-
} catch {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function workspaceUiSkillDir(loadedManifest = null) {
|
|
73
|
-
if (!loadedManifest) return DEFAULT_UI_SKILL_DIR;
|
|
74
|
-
const { manifest } = loadedManifest;
|
|
75
|
-
const entrypoints = manifest?.entrypoints && typeof manifest.entrypoints === 'object'
|
|
76
|
-
? manifest.entrypoints
|
|
77
|
-
: {};
|
|
78
|
-
return safeRelativeEntry(entrypoints.uiSkillDir, DEFAULT_UI_SKILL_DIR);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
53
|
function collectDirectorySkills(dir, scope) {
|
|
82
54
|
if (!existsSync(dir)) return [];
|
|
83
55
|
return readdirSync(dir, { withFileTypes: true })
|
|
@@ -92,8 +64,7 @@ function collectDirectorySkills(dir, scope) {
|
|
|
92
64
|
export function listSkills(session = {}) {
|
|
93
65
|
const skills = [];
|
|
94
66
|
if (session.workspacePath) {
|
|
95
|
-
|
|
96
|
-
skills.push(...collectDirectorySkills(join(session.workspacePath, workspaceUiSkillDir(loadedManifest)), 'workspace'));
|
|
67
|
+
skills.push(...collectDirectorySkills(join(session.workspacePath, DEFAULT_UI_SKILL_DIR), 'workspace'));
|
|
97
68
|
}
|
|
98
69
|
|
|
99
70
|
const byName = new Map();
|
|
@@ -81,7 +81,7 @@ test('recoveryManager requeues an active job by idempotencyKey when status is st
|
|
|
81
81
|
|
|
82
82
|
function storeWithActiveTask() {
|
|
83
83
|
const root = mkdtempSync(join(tmpdir(), 'wiki-manager-recovery-'));
|
|
84
|
-
const stateDir = join(root, '.wiki
|
|
84
|
+
const stateDir = join(root, '.wiki', 'runtime');
|
|
85
85
|
const store = openRuntimeStore({ stateDir });
|
|
86
86
|
const runId = 'run-recovery';
|
|
87
87
|
const taskId = 'run-recovery:build-a';
|
package/src/runtime/store.js
CHANGED
|
@@ -1261,7 +1261,10 @@ function ensureRuntimeMeta(metaPath) {
|
|
|
1261
1261
|
|
|
1262
1262
|
function migrateLegacyRuntimeMeta(metaPath) {
|
|
1263
1263
|
if (existsSync(metaPath)) return;
|
|
1264
|
-
const
|
|
1264
|
+
const stateDir = dirname(metaPath);
|
|
1265
|
+
const legacyPath = stateDir.endsWith(join('.wiki', 'runtime'))
|
|
1266
|
+
? join(stateDir, '..', 'meta.json')
|
|
1267
|
+
: join(stateDir, '..', '.wiki', 'meta.json');
|
|
1265
1268
|
if (!existsSync(legacyPath)) return;
|
|
1266
1269
|
mkdirSync(dirname(metaPath), { recursive: true });
|
|
1267
1270
|
renameSync(legacyPath, metaPath);
|
|
@@ -8,7 +8,7 @@ import { createAgentEvent, dispatchAgentEvent } from '../core/agentEvents.js';
|
|
|
8
8
|
import { openRuntimeStore } from './store.js';
|
|
9
9
|
|
|
10
10
|
function runtimeStateDir() {
|
|
11
|
-
return join(mkdtempSync(join(tmpdir(), 'wiki-manager-runtime-')), '.wiki
|
|
11
|
+
return join(mkdtempSync(join(tmpdir(), 'wiki-manager-runtime-')), '.wiki', 'runtime');
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function plannedTask(id) {
|
|
@@ -223,10 +223,10 @@ test('runtime store persists task assignments attempts and results from events',
|
|
|
223
223
|
|
|
224
224
|
test('runtime store writes schema versions to sqlite and meta file', () => {
|
|
225
225
|
const root = mkdtempSync(join(tmpdir(), 'wiki-manager-runtime-'));
|
|
226
|
-
const stateDir = join(root, '.wiki
|
|
226
|
+
const stateDir = join(root, '.wiki', 'runtime');
|
|
227
227
|
const store = openRuntimeStore({ stateDir });
|
|
228
228
|
const version = store.db.prepare('PRAGMA user_version').get().user_version;
|
|
229
|
-
const meta = JSON.parse(readFileSync(join(root, '.wiki
|
|
229
|
+
const meta = JSON.parse(readFileSync(join(root, '.wiki', 'runtime', 'meta.json'), 'utf8'));
|
|
230
230
|
|
|
231
231
|
assert.equal(version, 1);
|
|
232
232
|
assert.equal(meta.schemaVersion, 1);
|
|
@@ -249,7 +249,7 @@ test('runtime store refuses unknown sqlite schema versions', () => {
|
|
|
249
249
|
|
|
250
250
|
test('runtime store refuses unknown runtime metadata versions', () => {
|
|
251
251
|
const root = mkdtempSync(join(tmpdir(), 'wiki-manager-runtime-'));
|
|
252
|
-
const stateDir = join(root, '.wiki
|
|
252
|
+
const stateDir = join(root, '.wiki', 'runtime');
|
|
253
253
|
mkdirSync(stateDir, { recursive: true });
|
|
254
254
|
writeFileSync(join(stateDir, 'meta.json'), '{"schemaVersion":99}\n', 'utf8');
|
|
255
255
|
|
|
@@ -259,9 +259,9 @@ test('runtime store refuses unknown runtime metadata versions', () => {
|
|
|
259
259
|
);
|
|
260
260
|
});
|
|
261
261
|
|
|
262
|
-
test('runtime store migrates legacy .wiki metadata to .wiki
|
|
262
|
+
test('runtime store migrates legacy .wiki metadata to .wiki/runtime', () => {
|
|
263
263
|
const root = mkdtempSync(join(tmpdir(), 'wiki-manager-runtime-'));
|
|
264
|
-
const stateDir = join(root, '.wiki
|
|
264
|
+
const stateDir = join(root, '.wiki', 'runtime');
|
|
265
265
|
mkdirSync(join(root, '.wiki'), { recursive: true });
|
|
266
266
|
writeFileSync(join(root, '.wiki', 'meta.json'), '{"schemaVersion":1,"legacy":true}\n', 'utf8');
|
|
267
267
|
|
package/wiki-workspace
CHANGED
|
@@ -17,7 +17,12 @@ WORKSPACES_DIR="${WIKI_WORKSPACES_DIR:-$DEFAULT_MANAGER_DIR/workspaces}"
|
|
|
17
17
|
MANAGER_ENV_FILE="${WIKI_MANAGER_ENV_FILE:-$DEFAULT_MANAGER_DIR/.env}"
|
|
18
18
|
MANAGER_ENDPOINTS_FILE="${WIKI_MANAGER_ENDPOINTS_FILE:-$DEFAULT_MANAGER_DIR/mcp.endpoints.json}"
|
|
19
19
|
MANAGER_STATE_DIR="$(cd "$(dirname "$MANAGER_ENV_FILE")" && pwd)"
|
|
20
|
-
MANAGER_RUNTIME_DIR="$MANAGER_STATE_DIR/.wiki
|
|
20
|
+
MANAGER_RUNTIME_DIR="$MANAGER_STATE_DIR/.wiki/runtime"
|
|
21
|
+
LEGACY_MANAGER_RUNTIME_DIR="$MANAGER_STATE_DIR/.wiki-manager"
|
|
22
|
+
if [[ ! -e "$MANAGER_RUNTIME_DIR" && -d "$LEGACY_MANAGER_RUNTIME_DIR" ]]; then
|
|
23
|
+
mkdir -p "$MANAGER_STATE_DIR/.wiki"
|
|
24
|
+
mv "$LEGACY_MANAGER_RUNTIME_DIR" "$MANAGER_RUNTIME_DIR"
|
|
25
|
+
fi
|
|
21
26
|
CACERT_PATH="${WIKI_MANAGER_CACERT_PATH:-}"
|
|
22
27
|
|
|
23
28
|
normalize_path() {
|