@dotdrelle/wiki-manager 0.6.47 → 0.7.3
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/bin/wiki-manager.js +2 -2
- package/docker-compose.yml +25 -1
- package/package.json +2 -2
- package/src/cli/wiki-manager.js +236 -129
- package/src/core/activity.js +14 -0
- package/src/core/agentEvents.js +24 -2
- package/src/core/agentLoop.js +164 -0
- package/src/core/agentLoop.test.js +85 -0
- package/src/core/cacert.js +4 -3
- package/src/core/compose.js +2 -1
- package/src/core/dockerCompose.test.js +14 -0
- package/src/core/documentIntake.test.js +7 -7
- package/src/core/env.js +6 -0
- package/src/core/jobQueue.js +18 -4
- package/src/core/mcp.js +1 -1
- package/src/core/queueStore.js +27 -0
- package/src/core/queueStore.test.js +31 -0
- package/src/core/workspaces.js +8 -1
- package/src/runtime/auth.js +35 -0
- package/src/runtime/auth.test.js +21 -0
- package/src/runtime/client.js +108 -0
- package/src/runtime/lifecycle.js +60 -0
- package/src/runtime/queueStore.js +6 -0
- package/src/runtime/runner.js +73 -0
- package/src/runtime/server.js +160 -0
- package/src/runtime/server.test.js +53 -0
- package/src/runtime/store.js +292 -0
- package/src/runtime/store.test.js +103 -0
- package/src/runtime/supervisor.js +98 -0
- package/src/runtime/supervisor.test.js +99 -0
- package/src/shell/repl.js +131 -17
- package/src/shell/repl.test.js +38 -0
- package/src/shell/tui.tsx +4 -1
- package/src/shell/useAgent.ts +20 -2
- package/src/shell/useSession.ts +146 -11
- package/wiki-workspace +23 -18
package/wiki-workspace
CHANGED
|
@@ -478,13 +478,14 @@ compose_for_workspace() {
|
|
|
478
478
|
local workspace="$1"
|
|
479
479
|
shift
|
|
480
480
|
need_workspace_env "$workspace"
|
|
481
|
-
local workspace_env ws_path serve_port mcp_port prod_port project
|
|
481
|
+
local workspace_env ws_path serve_port mcp_port prod_port project agents_data_dir
|
|
482
482
|
workspace_env="$(workspace_env_file "$workspace")"
|
|
483
483
|
ws_path="$(normalize_path "$(workspace_value "$workspace" WIKI_WORKSPACE_PATH)")"
|
|
484
484
|
serve_port="$(workspace_value "$workspace" WIKI_SERVE_PORT 3100)"
|
|
485
485
|
mcp_port="$(workspace_value "$workspace" WIKI_MCP_PORT 3101)"
|
|
486
486
|
prod_port="$(workspace_value "$workspace" PRODUCTION_MCP_PORT 3102)"
|
|
487
487
|
project="$(compose_project "$workspace")"
|
|
488
|
+
agents_data_dir="$(absolute_path "${AGENTS_DATA_DIR:-.agents-data}" "$DEFAULT_MANAGER_DIR")"
|
|
488
489
|
|
|
489
490
|
local compose_env_args=()
|
|
490
491
|
[[ -f "$MANAGER_ENV_FILE" ]] && compose_env_args+=(--env-file "$MANAGER_ENV_FILE")
|
|
@@ -500,6 +501,7 @@ compose_for_workspace() {
|
|
|
500
501
|
WIKI_SERVE_PORT="$serve_port" \
|
|
501
502
|
WIKI_MCP_PORT="$mcp_port" \
|
|
502
503
|
PRODUCTION_MCP_PORT="$prod_port" \
|
|
504
|
+
AGENTS_DATA_DIR="$agents_data_dir" \
|
|
503
505
|
docker compose --project-directory "$DEFAULT_MANAGER_DIR" \
|
|
504
506
|
${compose_env_args[@]+"${compose_env_args[@]}"} -f "$ROOT_DIR/docker-compose.yml" ${cacert_args[@]+"${cacert_args[@]}"} -p "$project" "$@"
|
|
505
507
|
}
|
|
@@ -547,22 +549,23 @@ cacert_compose_args() {
|
|
|
547
549
|
|
|
548
550
|
mkdir -p "$MANAGER_RUNTIME_DIR"
|
|
549
551
|
local override_path="$MANAGER_RUNTIME_DIR/$override_name"
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
552
|
+
if [[ ! -f "$override_path" ]]; then
|
|
553
|
+
{
|
|
554
|
+
printf '# Generated by wiki-manager. Edit freely; delete to regenerate.\n'
|
|
555
|
+
printf 'services:\n'
|
|
556
|
+
while IFS= read -r service || [[ -n "$service" ]]; do
|
|
557
|
+
[[ -n "$service" ]] || continue
|
|
558
|
+
printf ' %s:\n' "$service"
|
|
559
|
+
printf ' volumes:\n'
|
|
560
|
+
printf ' - %s:/wiki-manager-ca.pem:ro\n' "$CACERT_PATH"
|
|
561
|
+
printf ' environment:\n'
|
|
562
|
+
printf ' NODE_EXTRA_CA_CERTS: /wiki-manager-ca.pem\n'
|
|
563
|
+
printf ' SSL_CERT_FILE: /wiki-manager-ca.pem\n'
|
|
564
|
+
printf ' REQUESTS_CA_BUNDLE: /wiki-manager-ca.pem\n'
|
|
565
|
+
printf ' CURL_CA_BUNDLE: /wiki-manager-ca.pem\n'
|
|
566
|
+
done <<< "$services"
|
|
567
|
+
} > "$override_path"
|
|
568
|
+
fi
|
|
566
569
|
printf '%s\n' -f "$override_path"
|
|
567
570
|
}
|
|
568
571
|
|
|
@@ -689,7 +692,8 @@ config_workspace() {
|
|
|
689
692
|
local env_file="$target_path/.env"
|
|
690
693
|
[[ -f "$env_file" ]] && die "workspace already configured: $env_file"
|
|
691
694
|
|
|
692
|
-
local port_base serve_port mcp_port prod_port wiki_token prod_token
|
|
695
|
+
local port_base serve_port mcp_port prod_port wiki_token prod_token agents_data_dir
|
|
696
|
+
agents_data_dir="$(absolute_path "${AGENTS_DATA_DIR:-.agents-data}" "$DEFAULT_MANAGER_DIR")"
|
|
693
697
|
port_base="$(find_free_workspace_port_base 3100)"
|
|
694
698
|
serve_port="$port_base"
|
|
695
699
|
mcp_port=$((port_base + 1))
|
|
@@ -724,6 +728,7 @@ config_workspace() {
|
|
|
724
728
|
WIKI_WORKSPACE_PATH="$target_path" \
|
|
725
729
|
WIKI_SERVE_PORT="$serve_port" \
|
|
726
730
|
WIKI_MCP_PORT="$mcp_port" \
|
|
731
|
+
AGENTS_DATA_DIR="$agents_data_dir" \
|
|
727
732
|
docker compose --project-directory "$DEFAULT_MANAGER_DIR" \
|
|
728
733
|
${compose_env_args[@]+"${compose_env_args[@]}"} -f "$ROOT_DIR/docker-compose.yml" ${cacert_args[@]+"${cacert_args[@]}"} run --rm wiki init
|
|
729
734
|
|