@dotdrelle/wiki-manager 0.6.34 → 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/agent/graph.js +2 -19
- package/src/cli/wiki-manager.js +236 -129
- package/src/commands/slash.js +17 -1
- package/src/commands/slash.test.js +78 -0
- 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 +4 -3
- 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/startupCheck.js +1 -1
- package/src/core/startupCheck.test.js +66 -0
- package/src/core/wikirc.js +2 -2
- 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 +132 -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 +39 -30
package/wiki-workspace
CHANGED
|
@@ -225,9 +225,14 @@ agents_compose() {
|
|
|
225
225
|
mkdir -p "$agents_data_dir/cme" "$agents_data_dir/documents/input" "$agents_data_dir/documents/output" "$agents_data_dir/documents/uploads"
|
|
226
226
|
mkdir -p "$workspaces_root"
|
|
227
227
|
$do_pull && _agents_dc pull
|
|
228
|
-
|
|
228
|
+
local up_args=(up -d)
|
|
229
|
+
if [[ -n "$CACERT_PATH" ]]; then
|
|
230
|
+
up_args+=(--force-recreate)
|
|
231
|
+
fi
|
|
232
|
+
_agents_dc "${up_args[@]}"
|
|
229
233
|
printf 'Workspaces root: %s\n' "$workspaces_root"
|
|
230
234
|
printf 'Agents data: %s\n' "$agents_data_dir"
|
|
235
|
+
[[ -z "$CACERT_PATH" ]] || printf 'CA cert: %s -> /wiki-manager-ca.pem\n' "$CACERT_PATH"
|
|
231
236
|
printf 'Agents: cme=:%s documents=:%s mailer=:%s\n' \
|
|
232
237
|
"${CME_MCP_PORT:-3336}" "${DOCUMENTS_MCP_PORT:-3337}" "${MAILER_MCP_PORT:-3335}"
|
|
233
238
|
;;
|
|
@@ -473,13 +478,14 @@ compose_for_workspace() {
|
|
|
473
478
|
local workspace="$1"
|
|
474
479
|
shift
|
|
475
480
|
need_workspace_env "$workspace"
|
|
476
|
-
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
|
|
477
482
|
workspace_env="$(workspace_env_file "$workspace")"
|
|
478
483
|
ws_path="$(normalize_path "$(workspace_value "$workspace" WIKI_WORKSPACE_PATH)")"
|
|
479
484
|
serve_port="$(workspace_value "$workspace" WIKI_SERVE_PORT 3100)"
|
|
480
485
|
mcp_port="$(workspace_value "$workspace" WIKI_MCP_PORT 3101)"
|
|
481
486
|
prod_port="$(workspace_value "$workspace" PRODUCTION_MCP_PORT 3102)"
|
|
482
487
|
project="$(compose_project "$workspace")"
|
|
488
|
+
agents_data_dir="$(absolute_path "${AGENTS_DATA_DIR:-.agents-data}" "$DEFAULT_MANAGER_DIR")"
|
|
483
489
|
|
|
484
490
|
local compose_env_args=()
|
|
485
491
|
[[ -f "$MANAGER_ENV_FILE" ]] && compose_env_args+=(--env-file "$MANAGER_ENV_FILE")
|
|
@@ -495,6 +501,7 @@ compose_for_workspace() {
|
|
|
495
501
|
WIKI_SERVE_PORT="$serve_port" \
|
|
496
502
|
WIKI_MCP_PORT="$mcp_port" \
|
|
497
503
|
PRODUCTION_MCP_PORT="$prod_port" \
|
|
504
|
+
AGENTS_DATA_DIR="$agents_data_dir" \
|
|
498
505
|
docker compose --project-directory "$DEFAULT_MANAGER_DIR" \
|
|
499
506
|
${compose_env_args[@]+"${compose_env_args[@]}"} -f "$ROOT_DIR/docker-compose.yml" ${cacert_args[@]+"${cacert_args[@]}"} -p "$project" "$@"
|
|
500
507
|
}
|
|
@@ -524,41 +531,41 @@ cacert_compose_args() {
|
|
|
524
531
|
local compose_file="$1"
|
|
525
532
|
local override_name="$2"
|
|
526
533
|
[[ -n "$CACERT_PATH" ]] || return 0
|
|
527
|
-
command -v node >/dev/null 2>&1 || die "--cacert requires node to generate Docker Compose overrides"
|
|
528
534
|
|
|
529
535
|
local services
|
|
530
536
|
services="$(
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
|
|
537
|
+
awk '
|
|
538
|
+
/^[[:space:]]*services:[[:space:]]*$/ { in_services=1; next }
|
|
539
|
+
in_services && /^[^[:space:]#]/ { exit }
|
|
540
|
+
in_services && /^ [A-Za-z0-9_.-]+:[[:space:]]*$/ {
|
|
541
|
+
line=$0
|
|
542
|
+
sub(/^ /, "", line)
|
|
543
|
+
sub(/:[[:space:]]*$/, "", line)
|
|
544
|
+
print line
|
|
545
|
+
}
|
|
546
|
+
' "$compose_file"
|
|
541
547
|
)"
|
|
542
548
|
[[ -n "$services" ]] || return 0
|
|
543
549
|
|
|
544
550
|
mkdir -p "$MANAGER_RUNTIME_DIR"
|
|
545
551
|
local override_path="$MANAGER_RUNTIME_DIR/$override_name"
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
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
|
|
562
569
|
printf '%s\n' -f "$override_path"
|
|
563
570
|
}
|
|
564
571
|
|
|
@@ -685,7 +692,8 @@ config_workspace() {
|
|
|
685
692
|
local env_file="$target_path/.env"
|
|
686
693
|
[[ -f "$env_file" ]] && die "workspace already configured: $env_file"
|
|
687
694
|
|
|
688
|
-
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")"
|
|
689
697
|
port_base="$(find_free_workspace_port_base 3100)"
|
|
690
698
|
serve_port="$port_base"
|
|
691
699
|
mcp_port=$((port_base + 1))
|
|
@@ -720,6 +728,7 @@ config_workspace() {
|
|
|
720
728
|
WIKI_WORKSPACE_PATH="$target_path" \
|
|
721
729
|
WIKI_SERVE_PORT="$serve_port" \
|
|
722
730
|
WIKI_MCP_PORT="$mcp_port" \
|
|
731
|
+
AGENTS_DATA_DIR="$agents_data_dir" \
|
|
723
732
|
docker compose --project-directory "$DEFAULT_MANAGER_DIR" \
|
|
724
733
|
${compose_env_args[@]+"${compose_env_args[@]}"} -f "$ROOT_DIR/docker-compose.yml" ${cacert_args[@]+"${cacert_args[@]}"} run --rm wiki init
|
|
725
734
|
|