blun-king-cli 9.1.587 → 9.1.588
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/CHANGELOG.md +11 -185
- package/LIESMICH.txt +51 -13
- package/README.md +44 -47
- package/agent-spine-plugin/.codex-plugin/plugin.json +16 -4
- package/agent-spine-plugin/CHANGELOG.md +37 -5
- package/agent-spine-plugin/README.md +3 -3
- package/agent-spine-plugin/blun.plugin.json +45 -10
- package/agent-spine-plugin/docs/artifact-evaluation.md +93 -0
- package/agent-spine-plugin/docs/host-integration.md +42 -27
- package/agent-spine-plugin/docs/preflight-recall.md +4 -2
- package/agent-spine-plugin/docs/session-timeline.md +97 -236
- package/agent-spine-plugin/docs/world-model.md +25 -0
- package/agent-spine-plugin/hooks/codex.json +1 -1
- package/agent-spine-plugin/hooks/hooks.json +1 -1
- package/agent-spine-plugin/package.json +1 -3
- package/agent-spine-plugin/scripts/check-hosts.js +3 -3
- package/agent-spine-plugin/scripts/release-check.js +10 -5
- package/agent-spine-plugin/scripts/run-checks.js +4 -1
- package/agent-spine-plugin/scripts/run-tests-hermetic.js +32 -6
- package/agent-spine-plugin/src/cli-learning.js +15 -0
- package/agent-spine-plugin/src/cli.js +2 -0
- package/agent-spine-plugin/src/hook.js +32 -32
- package/agent-spine-plugin/src/lib/action-lesson-recall.js +73 -8
- package/agent-spine-plugin/src/lib/briefing.js +146 -36
- package/agent-spine-plugin/src/lib/channel-continuity.js +19 -0
- package/agent-spine-plugin/src/lib/delivery-agent-usage.js +14 -7
- package/agent-spine-plugin/src/lib/gateway-group-response.js +128 -0
- package/agent-spine-plugin/src/lib/gateway-runs.js +24 -15
- package/agent-spine-plugin/src/lib/hook-briefing-use.js +13 -3
- package/agent-spine-plugin/src/lib/hook-context.js +16 -3
- package/agent-spine-plugin/src/lib/hook-output.js +129 -5
- package/agent-spine-plugin/src/lib/hook-timeline.js +5 -3
- package/agent-spine-plugin/src/lib/indexed-memory.js +2 -2
- package/agent-spine-plugin/src/lib/learning-artifact-evaluator.js +114 -0
- package/agent-spine-plugin/src/lib/learning-context.js +11 -4
- package/agent-spine-plugin/src/lib/learning-measurements.js +2 -2
- package/agent-spine-plugin/src/lib/mcp-runtime.js +89 -3
- package/agent-spine-plugin/src/lib/mcp-source-context.js +12 -2
- package/agent-spine-plugin/src/lib/mcp-timeline-tools.js +91 -8
- package/agent-spine-plugin/src/lib/mcp-world-tools.js +2 -2
- package/agent-spine-plugin/src/lib/owned-file-lock.js +20 -1
- package/agent-spine-plugin/src/lib/persona-runtime.js +2 -2
- package/agent-spine-plugin/src/lib/preflight-delivery-id.js +27 -0
- package/agent-spine-plugin/src/lib/preflight.js +4 -4
- package/agent-spine-plugin/src/lib/session-timeline-codex.js +15 -0
- package/agent-spine-plugin/src/lib/session-timeline-contract.js +12 -4
- package/agent-spine-plugin/src/lib/session-timeline-event-extract.js +36 -7
- package/agent-spine-plugin/src/lib/session-timeline-host-origin.js +13 -10
- package/agent-spine-plugin/src/lib/session-timeline-invocation.js +1 -1
- package/agent-spine-plugin/src/lib/session-timeline-king.js +14 -0
- package/agent-spine-plugin/src/lib/session-timeline-prior.js +18 -12
- package/agent-spine-plugin/src/lib/session-timeline-provider.js +5 -0
- package/agent-spine-plugin/src/lib/session-timeline-query.js +2 -0
- package/agent-spine-plugin/src/lib/session-timeline-results.js +35 -10
- package/agent-spine-plugin/src/lib/session-timeline-source-open.js +30 -0
- package/agent-spine-plugin/src/lib/session-timeline.js +122 -75
- package/agent-spine-plugin/src/lib/source-roots.js +3 -2
- package/agent-spine-plugin/src/lib/task-knowledge-context.js +22 -1
- package/agent-spine-plugin/src/lib/timeline-continuation-update.js +100 -0
- package/agent-spine-plugin/src/lib/timeline-tool-guard.js +30 -7
- package/agent-spine-plugin/src/lib/timeline-user-feedback.js +217 -0
- package/agent-spine-plugin/src/lib/timeline-world-capture.js +233 -0
- package/agent-spine-plugin/src/lib/world-knowledge.js +59 -2
- package/agent-spine-plugin/src/lib/world-model.js +64 -9
- package/agent-spine-plugin/src/worker.js +13 -1
- package/bin/blun.js +43 -28
- package/bin/core-bootstrap.js +5 -4
- package/bin/king.js +43 -28
- package/bin/launcher-mode.js +1 -10
- package/bin/launcher-runtime.js +128 -295
- package/bin/managed-node.js +0 -0
- package/bin/managed-plugin-selection.cjs +0 -1
- package/bin/native-module-repair.js +0 -0
- package/bin/node-runtime.js +0 -0
- package/bin/node-version.js +0 -0
- package/bin/plugin-bootstrap.js +56 -120
- package/bin/private-paths.js +11 -34
- package/bin/standard-tools-bootstrap.js +34 -114
- package/bin/turn-thinking-policy.cjs +3 -11
- package/bin/update-copy.js +200 -0
- package/bin/update-lease.js +0 -0
- package/bin/update-notice.js +136 -289
- package/bin/verify-agent-behavior.cjs +122 -0
- package/bin/verify-agent-components.cjs +104 -0
- package/bin/verify-bundled-agent-sources.cjs +57 -0
- package/blun.mjs +143076 -135288
- package/bundled-agent-sources.json +701 -0
- package/package.json +12 -15
- package/standard-skills/translate-native/README.md +1293 -0
- package/standard-skills/translate-native/SKILL.md +172 -22
- package/standard-skills/translate-native/VERSION +1 -1
- package/standard-skills/translate-native/agents/openai.yaml +18 -0
- package/standard-skills/translate-native/assets/icon.svg +8 -0
- package/standard-skills/translate-native/docs/BLUN_CODE_INTEGRATION.md +76 -0
- package/standard-skills/translate-native/docs/PREMORTEM.md +489 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION.md +2035 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_API.md +1302 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_EVIDENCE_HTTP.md +136 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_HEALTH_HTTP.md +130 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_HTTP_PROVIDER.md +175 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_RECEIPT_VERIFIER_HTTP.md +86 -0
- package/standard-skills/translate-native/integrations/AGENT_RULES.md +32 -0
- package/standard-skills/translate-native/integrations/adapters/blun-code-language-guard.js +514 -0
- package/standard-skills/translate-native/integrations/adapters/node-language-guard.js +230 -0
- package/standard-skills/translate-native/integrations/audit_log.py +327 -0
- package/standard-skills/translate-native/integrations/claude_language_hook.js +1536 -0
- package/standard-skills/translate-native/integrations/commercial_localization_profile.py +42 -0
- package/standard-skills/translate-native/integrations/delivery-policy.example.json +28 -0
- package/standard-skills/translate-native/integrations/enforced_delivery.py +543 -0
- package/standard-skills/translate-native/integrations/guard_service.py +435 -0
- package/standard-skills/translate-native/integrations/language_gateway.py +67 -0
- package/standard-skills/translate-native/integrations/mcp_auth_headers.py +198 -0
- package/standard-skills/translate-native/integrations/mcp_http_gateway.py +429 -0
- package/standard-skills/translate-native/integrations/non_language_html_entities.js +1485 -0
- package/standard-skills/translate-native/integrations/pre_output_guard.py +65 -0
- package/standard-skills/translate-native/integrations/task_router.py +101 -0
- package/standard-skills/translate-native/integrations/website_localization.py +401 -0
- package/standard-skills/translate-native/integrations/website_localization_api.py +581 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark.py +1885 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_campaign.py +1772 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_candidate.py +506 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_http.py +400 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_review_store.py +781 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_reviewer_http.py +500 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_runtime.py +1107 -0
- package/standard-skills/translate-native/integrations/website_localization_benchmark_suite.py +463 -0
- package/standard-skills/translate-native/integrations/website_localization_cms.py +2835 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_client.py +875 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_dispatch.py +805 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_http.py +588 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_lifecycle_monitor.py +991 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver.py +1441 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver_runtime.py +414 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver_store.py +1073 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_removal_dispatch.py +865 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_client.py +583 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery.py +964 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_runtime.py +665 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_http.py +1153 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_runtime.py +675 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_service.py +1125 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification.py +674 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_http.py +444 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver.py +1469 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver_runtime.py +1142 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_processing_monitor.py +634 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_receiver_client.py +804 -0
- package/standard-skills/translate-native/integrations/website_localization_deepl_baseline.py +922 -0
- package/standard-skills/translate-native/integrations/website_localization_evidence_http.py +482 -0
- package/standard-skills/translate-native/integrations/website_localization_health.py +1541 -0
- package/standard-skills/translate-native/integrations/website_localization_health_http.py +372 -0
- package/standard-skills/translate-native/integrations/website_localization_http_provider.py +297 -0
- package/standard-skills/translate-native/integrations/website_localization_native_reference_http.py +479 -0
- package/standard-skills/translate-native/integrations/website_localization_native_reference_intake.py +363 -0
- package/standard-skills/translate-native/integrations/website_localization_native_reference_queue.py +1449 -0
- package/standard-skills/translate-native/integrations/website_localization_native_reference_store.py +420 -0
- package/standard-skills/translate-native/integrations/website_localization_quality_profiles.py +235 -0
- package/standard-skills/translate-native/integrations/website_localization_queue.py +671 -0
- package/standard-skills/translate-native/integrations/website_localization_receipt_verifier_http.py +516 -0
- package/standard-skills/translate-native/integrations/website_localization_release.py +928 -0
- package/standard-skills/translate-native/integrations/website_localization_release_coordinator.py +1008 -0
- package/standard-skills/translate-native/integrations/website_localization_runner.py +276 -0
- package/standard-skills/translate-native/integrations/website_localization_runtime.py +862 -0
- package/standard-skills/translate-native/integrations/website_localization_service.py +350 -0
- package/standard-skills/translate-native/integrations/website_localization_supervisor.py +511 -0
- package/standard-skills/translate-native/integrations/website_localization_worker.py +663 -0
- package/standard-skills/translate-native/provenance.json +3 -4
- package/standard-skills/translate-native/references/commercial-localization.md +177 -0
- package/standard-skills/translate-native/scripts/blun_language_guard.py +7 -1
- package/standard-skills/translate-native/scripts/check_commercial_review.py +80 -0
- package/standard-skills/translate-native/scripts/commercial_localization_profile.py +333 -0
- package/standard-tools/language-guard/LICENSE +21 -0
- package/standard-tools/language-guard/VERSION +1 -0
- package/standard-tools/language-guard/blun_language_guard.py +7 -1
- package/standard-tools/language-guard/check_commercial_review.py +80 -0
- package/standard-tools/language-guard/commercial_localization_profile.py +333 -0
- package/standard-tools/language-guard/language_gateway.py +62 -0
- package/standard-tools/language-guard/pre_output_guard.py +64 -0
- package/standard-tools/language-guard/provenance.json +4 -11
- package/standard-tools/manifest.json +34 -11
- package/telegram-plugin/commands/access.md +2 -10
- package/telegram-plugin/dist/bridge.mjs +64041 -687
- package/telegram-plugin/dist/mcp-server.mjs +72810 -9027
- package/telegram-plugin/dist/noise.mjs +28 -63511
- package/agent-spine-plugin/CONTRIBUTING.md +0 -52
- package/agent-spine-plugin/SECURITY.md +0 -47
- package/agent-spine-plugin/docs/assignment-continuation.md +0 -48
- package/agent-spine-plugin/docs/releasing.md +0 -85
- package/agent-spine-plugin/docs/structured-completion.md +0 -67
- package/bin/abort-listener-policy.cjs +0 -43
- package/bin/active-steer-priority-policy.cjs +0 -24
- package/bin/agent-api-http-adapter.mjs +0 -446
- package/bin/agent-api-private-http-server.mjs +0 -288
- package/bin/agent-api-runtime.mjs +0 -252
- package/bin/agent-api-service-environment.mjs +0 -236
- package/bin/agent-api-service-host.mjs +0 -209
- package/bin/agent-api-service-process.mjs +0 -171
- package/bin/agent-api-session-registry.mjs +0 -428
- package/bin/agent-api-tool-broker.cjs +0 -248
- package/bin/agent-api-turn-controller.mjs +0 -461
- package/bin/agent-api-usage-journal.cjs +0 -259
- package/bin/agent-resume-snapshot.cjs +0 -241
- package/bin/agentspine-king-goal-inbox.mjs +0 -111
- package/bin/agentspine-king-goal-intake.mjs +0 -106
- package/bin/approval-rejection-stop.cjs +0 -15
- package/bin/assistant-message-offload-policy.cjs +0 -284
- package/bin/baseline-skill-performance-policy.cjs +0 -39
- package/bin/bash-search-scope-policy.cjs +0 -49
- package/bin/codebase-search-runtime.cjs +0 -23
- package/bin/cognitive-action-checkpoint.cjs +0 -1104
- package/bin/cognitive-attention-delivery.cjs +0 -76
- package/bin/cognitive-attention-policy.cjs +0 -143
- package/bin/cognitive-attention-runtime.cjs +0 -91
- package/bin/cognitive-context-projection.cjs +0 -73
- package/bin/cognitive-cross-portal-acceptance.cjs +0 -443
- package/bin/cognitive-effective-view.cjs +0 -77
- package/bin/cognitive-focus-projection.cjs +0 -206
- package/bin/cognitive-focus-scope.cjs +0 -37
- package/bin/cognitive-goal-autostart-policy.cjs +0 -72
- package/bin/cognitive-goal-time-trigger-controller.cjs +0 -146
- package/bin/cognitive-memory-adapter.cjs +0 -282
- package/bin/cognitive-memory-command.cjs +0 -293
- package/bin/cognitive-memory-provider.cjs +0 -92
- package/bin/cognitive-salience-policy.cjs +0 -159
- package/bin/cognitive-state-store.cjs +0 -508
- package/bin/cognitive-turn-lifecycle.cjs +0 -624
- package/bin/cognitive-work-focus.cjs +0 -180
- package/bin/compaction-history-archive.cjs +0 -166
- package/bin/compaction-history-startup.cjs +0 -50
- package/bin/compaction-model-policy.cjs +0 -31
- package/bin/compaction-stage-policy.cjs +0 -21
- package/bin/compaction-transaction-policy.cjs +0 -122
- package/bin/config-write-dedup-policy.cjs +0 -27
- package/bin/context-budget-ledger.cjs +0 -31
- package/bin/context-doctor-policy.cjs +0 -70
- package/bin/context-insight-policy.cjs +0 -36
- package/bin/context-performance-policy.cjs +0 -19
- package/bin/context-pressure-policy.cjs +0 -20
- package/bin/cron-run-output.cjs +0 -45
- package/bin/cron-run-store.cjs +0 -145
- package/bin/curiosity-scout-policy.cjs +0 -49
- package/bin/default-model-output-budget-policy.cjs +0 -28
- package/bin/durable-task-resume-policy.cjs +0 -130
- package/bin/durable-task-resume-runtime.cjs +0 -117
- package/bin/durable-task-resume-store.cjs +0 -88
- package/bin/editable-tool-approval-policy.cjs +0 -540
- package/bin/editable-tool-approval-runtime.cjs +0 -99
- package/bin/effective-system-prompt-cache-policy.cjs +0 -33
- package/bin/error-memory-performance-policy.cjs +0 -113
- package/bin/file-observation-policy.cjs +0 -133
- package/bin/foreground-output-capture-policy.cjs +0 -41
- package/bin/generated-source-health.cjs +0 -142
- package/bin/glob-pattern-policy.cjs +0 -13
- package/bin/goal-completion-evidence-policy.cjs +0 -120
- package/bin/grep-output-limit-policy.cjs +0 -39
- package/bin/historical-media-projection-policy.cjs +0 -48
- package/bin/history-offload-pressure-policy.cjs +0 -33
- package/bin/html-to-research-markdown.cjs +0 -147
- package/bin/identity-context-policy.cjs +0 -764
- package/bin/identity-journal-policy.cjs +0 -107
- package/bin/input-draft-persistence.cjs +0 -77
- package/bin/king-tui-function-contract.json +0 -33
- package/bin/launcher-restart-policy.cjs +0 -150
- package/bin/live-response-repetition-guard.cjs +0 -196
- package/bin/llm-config-log-dedup-policy.cjs +0 -76
- package/bin/loop-event-record-policy.cjs +0 -174
- package/bin/managed-context-startup-policy.cjs +0 -27
- package/bin/media-activity-layout-policy.cjs +0 -34
- package/bin/media-auto-retrieval-policy.cjs +0 -90
- package/bin/media-result-policy.cjs +0 -59
- package/bin/micro-compaction-policy.cjs +0 -145
- package/bin/mistake-relevance-policy.cjs +0 -319
- package/bin/model-retry-progress-policy.cjs +0 -46
- package/bin/native-large-file-io.cjs +0 -42
- package/bin/native-runtime-cache.cjs +0 -76
- package/bin/natural-presence-policy.cjs +0 -28
- package/bin/noninteractive-shell-env-policy.cjs +0 -19
- package/bin/observer-hooks.cjs +0 -14
- package/bin/outbound-claim-provenance.cjs +0 -150
- package/bin/oversized-context-offload-policy.cjs +0 -86
- package/bin/pending-media-policy.cjs +0 -182
- package/bin/pending-token-estimate-policy.cjs +0 -41
- package/bin/personal-memory-consent-policy.cjs +0 -72
- package/bin/personal-memory-performance-policy.cjs +0 -12
- package/bin/personality-choice-policy.cjs +0 -101
- package/bin/personality-memory-adapter.cjs +0 -379
- package/bin/personality-mode.cjs +0 -46
- package/bin/personality-setup-policy.cjs +0 -197
- package/bin/proactive-compaction-policy.cjs +0 -25
- package/bin/profile-identity-resolution.cjs +0 -136
- package/bin/profile-runtime.cjs +0 -318
- package/bin/profile-tool-exclusion-policy.cjs +0 -37
- package/bin/programmatic-context-isolation.cjs +0 -25
- package/bin/programmatic-tool-runtime.mjs +0 -627
- package/bin/provider-idle-timeout-policy.cjs +0 -14
- package/bin/provider-model-refresh-deadline.cjs +0 -53
- package/bin/provider-model-refresh-policy.cjs +0 -107
- package/bin/rate-limit-recovery-policy.cjs +0 -47
- package/bin/read-batch-policy.cjs +0 -32
- package/bin/read-continuation-policy.cjs +0 -59
- package/bin/recurring-cron-history-policy.cjs +0 -124
- package/bin/relationship-continuity-policy.cjs +0 -143
- package/bin/relationship-curiosity-policy.cjs +0 -107
- package/bin/relationship-learning-policy.cjs +0 -168
- package/bin/release-artifact-freeze-policy.cjs +0 -30
- package/bin/reload-plugin-bootstrap.cjs +0 -18
- package/bin/reload-queue-policy.cjs +0 -38
- package/bin/repeated-assistant-response-policy.cjs +0 -232
- package/bin/repeated-injection-projection.cjs +0 -107
- package/bin/repeated-user-message-projection.cjs +0 -8
- package/bin/research-page-result.cjs +0 -74
- package/bin/retry-checkpoint-policy.cjs +0 -13
- package/bin/runtime-exit-ledger.cjs +0 -144
- package/bin/scoped-cron-run-policy.cjs +0 -358
- package/bin/session-checkpoint-policy.cjs +0 -25
- package/bin/session-compaction-policy.cjs +0 -84
- package/bin/session-replay-policy.cjs +0 -20
- package/bin/session-replay-window-policy.cjs +0 -40
- package/bin/session-resume-checkpoint.cjs +0 -254
- package/bin/session-scrollback-archive.cjs +0 -229
- package/bin/skill-activation-performance-policy.cjs +0 -69
- package/bin/skill-listing-performance-policy.cjs +0 -92
- package/bin/soul-organization-policy.cjs +0 -78
- package/bin/soul-preservation-policy.cjs +0 -20
- package/bin/startup-preferences.cjs +0 -131
- package/bin/streaming-flush-performance-policy.cjs +0 -28
- package/bin/structured-agent-swarm-output.cjs +0 -325
- package/bin/structured-subagent-output.cjs +0 -252
- package/bin/subagent-context-fork-policy.cjs +0 -155
- package/bin/subagent-max-tokens-handoff-policy.cjs +0 -69
- package/bin/subagent-parent-responsiveness.cjs +0 -19
- package/bin/subagent-skill-policy.cjs +0 -206
- package/bin/subagent-timeout-policy.cjs +0 -182
- package/bin/subagent-tool-policy.cjs +0 -60
- package/bin/subagent-usage-rollup-policy.cjs +0 -29
- package/bin/system-prompt-context-policy.cjs +0 -124
- package/bin/system-prompt-token-cache-policy.cjs +0 -60
- package/bin/telegram-addressed-focus.cjs +0 -55
- package/bin/telegram-addressed-priority.cjs +0 -12
- package/bin/telegram-approval-relay.cjs +0 -290
- package/bin/telegram-bot-priority.cjs +0 -17
- package/bin/telegram-console-status-policy.cjs +0 -174
- package/bin/telegram-context-projection-policy.cjs +0 -141
- package/bin/telegram-delivery-lifecycle.cjs +0 -125
- package/bin/telegram-direct-focus-policy.cjs +0 -273
- package/bin/telegram-mcp-compatibility.cjs +0 -49
- package/bin/telegram-media-delivery-policy.cjs +0 -42
- package/bin/telegram-private-conversation-policy.cjs +0 -185
- package/bin/telegram-queue-handoff-policy.cjs +0 -73
- package/bin/telegram-remote-status-policy.cjs +0 -120
- package/bin/telegram-session-queue-runtime.mjs +0 -306
- package/bin/telegram-text-chunk-policy.cjs +0 -63
- package/bin/telegram-truncated-reply-policy.cjs +0 -37
- package/bin/telegram-urgent-policy.cjs +0 -45
- package/bin/telemetry-spool-policy.cjs +0 -57
- package/bin/thinking-activity-status-policy.cjs +0 -132
- package/bin/thinking-only-guard.cjs +0 -80
- package/bin/todo-list-turn-policy.cjs +0 -131
- package/bin/tool-call-loop-policy.cjs +0 -51
- package/bin/tool-file-persistence.cjs +0 -141
- package/bin/tool-result-offload-policy.cjs +0 -359
- package/bin/tool-result-offload-telemetry.cjs +0 -12
- package/bin/tool-schema-token-cache-policy.cjs +0 -41
- package/bin/tool-stream-preview-policy.cjs +0 -9
- package/bin/tui-functional-contract.cjs +0 -55
- package/bin/turn-tool-performance-policy.cjs +0 -486
- package/bin/usage-cache-efficiency-policy.cjs +0 -26
- package/bin/user-home-path-policy.cjs +0 -13
- package/bin/user-message-offload-policy.cjs +0 -103
- package/bin/user-prompt-hook-origin-policy.cjs +0 -34
- package/bin/user-tool-record-policy.cjs +0 -7
- package/bin/validated-learning-insight-policy.cjs +0 -58
- package/bin/validated-learning-outcome-trace.cjs +0 -107
- package/bin/validated-learning-performance-policy.cjs +0 -53
- package/bin/validated-learning-signal.cjs +0 -463
- package/bin/windows-bash-dialect-policy.cjs +0 -25
- package/bin/windows-node-crash-dump.cjs +0 -110
- package/bin/write-continuation-policy.cjs +0 -69
- package/codebase-index/README.md +0 -82
- package/codebase-index/codebase_index.py +0 -470
- package/standard-skills/agent-browser/SKILL.md +0 -19
- package/standard-skills/agent-browser/references/runtime.md +0 -8
- package/standard-skills/blun-session-inspector/SKILL.md +0 -41
- package/standard-skills/blun-session-inspector/scripts/inspect-session.cjs +0 -437
- package/standard-skills/design-taste-frontend/SKILL.md +0 -1206
- package/standard-skills/full-output-enforcement/SKILL.md +0 -49
- package/standard-skills/high-end-visual-design/SKILL.md +0 -98
- package/standard-skills/image-to-code/SKILL.md +0 -1228
- package/standard-skills/industrial-brutalist-ui/SKILL.md +0 -92
- package/standard-skills/minimalist-ui/SKILL.md +0 -85
- package/standard-skills/motion-design-taste/SKILL.md +0 -74
- package/standard-skills/playwright-testing/SKILL.md +0 -19
- package/standard-skills/playwright-testing/references/runtime.md +0 -7
- package/standard-skills/premortem/SKILL.md +0 -148
- package/standard-skills/redesign-existing-projects/SKILL.md +0 -178
- package/standard-skills/research-evidence/SKILL.md +0 -39
- package/standard-skills/research-evidence/references/evidence-format.md +0 -104
- package/standard-skills/research-evidence/scripts/evidence-collection.cjs +0 -260
- package/standard-skills/research-evidence/scripts/score-report.cjs +0 -130
- package/standard-skills/screenshot-lesen/SKILL.md +0 -52
- package/standard-skills/stitch-design-taste/DESIGN.md +0 -121
- package/standard-skills/stitch-design-taste/SKILL.md +0 -184
- package/standard-skills/telegram-channel/SKILL.md +0 -18
- package/standard-skills/telegram-channel/references/runtime.md +0 -7
- package/standard-skills/venture-flywheel/SKILL.md +0 -32
- package/standard-skills/venture-flywheel/identity/project-identity.cjs +0 -146
- package/standard-skills/venture-flywheel/policy/capability-engine.cjs +0 -114
- package/standard-skills/venture-flywheel/policy/repository-trust.cjs +0 -229
- package/standard-skills/venture-flywheel/references/BEISPIELE-phase0.md +0 -146
- package/standard-skills/venture-flywheel/references/CAPABILITY-MAP.md +0 -34
- package/standard-skills/venture-flywheel/references/SPEC-phase0-identity-trust.md +0 -77
- package/standard-skills/venture-flywheel/references/SPEC-phase0-state-events.md +0 -93
- package/standard-skills/venture-flywheel/schemas/capability-decision.schema.json +0 -13
- package/standard-skills/venture-flywheel/schemas/execution-event.schema.json +0 -44
- package/standard-skills/venture-flywheel/schemas/project-identity.schema.json +0 -32
- package/standard-skills/venture-flywheel/schemas/repository-trust.schema.json +0 -57
- package/standard-skills/venture-flywheel/schemas/run-transition.schema.json +0 -59
- package/standard-skills/venture-flywheel/state/execution-event.cjs +0 -191
- package/standard-skills/venture-flywheel/state/task-state-machine.cjs +0 -190
- package/standard-skills/web-lesen/SKILL.md +0 -73
- package/standard-skills/web-lesen/scripts/crawl_public.py +0 -379
- package/standard-skills/windows-mcp/SKILL.md +0 -19
- package/standard-skills/windows-mcp/references/runtime.md +0 -9
- package/telegram-plugin/DELIVERY.md +0 -36
- package/telegram-plugin/bin/telegram-approval-relay.cjs +0 -290
- package/telegram-plugin/bin/telegram-console-status-policy.cjs +0 -175
- package/telegram-plugin/bin/telegram-delivery-lifecycle.cjs +0 -125
- package/telegram-plugin/bin/telegram-direct-reply-policy.cjs +0 -48
- package/telegram-plugin/bin/telegram-launcher-status-queue.cjs +0 -122
- package/telegram-plugin/bin/telegram-private-conversation-policy.cjs +0 -186
- package/telegram-plugin/bin/telegram-remote-status-policy.cjs +0 -121
- package/telegram-plugin/bin/telegram-reply-parts.cjs +0 -149
- package/telegram-plugin/bin/telegram-text-chunk-policy.cjs +0 -63
- package/telegram-plugin/bin/telegram-typing-keepalive.cjs +0 -89
- package/telegram-plugin/compat/mcp-server-fa511cd1.mjs +0 -73825
- /package/{bin → scripts}/fix-node-pty-perms.js +0 -0
package/bin/plugin-bootstrap.js
CHANGED
|
@@ -3,62 +3,18 @@
|
|
|
3
3
|
const { randomUUID } = require('node:crypto');
|
|
4
4
|
const fs = require('node:fs');
|
|
5
5
|
const path = require('node:path');
|
|
6
|
-
const {
|
|
6
|
+
const { selectedAgentSpineRoot, describeAgentSpineSelection, copySelectedAgentSpinePlugin } = require('./managed-plugin-selection.cjs');
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
ensurePrivateDirectory,
|
|
10
10
|
securePrivateFile,
|
|
11
|
-
securePrivateTree,
|
|
12
11
|
writePrivateFile,
|
|
13
12
|
} = require('./private-paths');
|
|
14
13
|
|
|
15
|
-
const managedPluginSourceSnapshots = new Map();
|
|
16
|
-
|
|
17
14
|
function isObject(value) {
|
|
18
15
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
19
16
|
}
|
|
20
17
|
|
|
21
|
-
function snapshotManagedPluginSource(root) {
|
|
22
|
-
const resolvedRoot = path.resolve(root);
|
|
23
|
-
const cacheKey = process.platform === 'win32' ? resolvedRoot.toLowerCase() : resolvedRoot;
|
|
24
|
-
if (!managedPluginSourceSnapshots.has(cacheKey)) {
|
|
25
|
-
managedPluginSourceSnapshots.set(cacheKey, snapshotPluginTree(resolvedRoot));
|
|
26
|
-
}
|
|
27
|
-
return managedPluginSourceSnapshots.get(cacheKey);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function pluginTreesAreIdentical(sourceRoot, pluginRoot) {
|
|
31
|
-
try {
|
|
32
|
-
const source = snapshotManagedPluginSource(sourceRoot);
|
|
33
|
-
const installed = snapshotPluginTree(pluginRoot);
|
|
34
|
-
if (source === null || installed === null || source.length !== installed.length) return false;
|
|
35
|
-
return source.every((entry, index) => {
|
|
36
|
-
const other = installed[index];
|
|
37
|
-
return entry.kind === other.kind
|
|
38
|
-
&& entry.path === other.path
|
|
39
|
-
&& (entry.kind !== 'file' || entry.content.equals(other.content));
|
|
40
|
-
});
|
|
41
|
-
} catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function pluginTreeDigest(root) {
|
|
47
|
-
const entries = snapshotManagedPluginSource(root);
|
|
48
|
-
if (entries === null) throw new Error(`Invalid managed plugin tree: ${root}`);
|
|
49
|
-
return digestPluginEntries(entries);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function hasCurrentPluginRecord(installed, pluginRoot, pluginId, mcpServerName) {
|
|
53
|
-
const records = installed.plugins.filter((plugin) => plugin.id === pluginId);
|
|
54
|
-
if (records.length !== 1) return false;
|
|
55
|
-
const [plugin] = records;
|
|
56
|
-
return plugin.root === pluginRoot
|
|
57
|
-
&& plugin.source === 'local-path'
|
|
58
|
-
&& plugin.enabled === true
|
|
59
|
-
&& plugin.capabilities?.mcpServers?.[mcpServerName]?.enabled === true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
18
|
function readInstalledPlugins(filePath) {
|
|
63
19
|
if (!fs.existsSync(filePath)) return { version: 1, plugins: [] };
|
|
64
20
|
|
|
@@ -70,14 +26,14 @@ function readInstalledPlugins(filePath) {
|
|
|
70
26
|
return parsed;
|
|
71
27
|
}
|
|
72
28
|
|
|
73
|
-
function updatedInstalledPlugins(installed, pluginRoot, now, pluginId
|
|
29
|
+
function updatedInstalledPlugins(installed, pluginRoot, now, pluginId = 'telegram') {
|
|
74
30
|
const previous = installed.plugins.find((plugin) => plugin.id === pluginId);
|
|
75
31
|
const previousCapabilities = isObject(previous?.capabilities) ? previous.capabilities : {};
|
|
76
32
|
const previousMcpServers = isObject(previousCapabilities.mcpServers)
|
|
77
33
|
? previousCapabilities.mcpServers : {};
|
|
78
|
-
const
|
|
79
|
-
? previousMcpServers[
|
|
80
|
-
const
|
|
34
|
+
const previousTelegramMcp = isObject(previousMcpServers[pluginId])
|
|
35
|
+
? previousMcpServers[pluginId] : {};
|
|
36
|
+
const telegram = {
|
|
81
37
|
...previous,
|
|
82
38
|
id: pluginId,
|
|
83
39
|
root: pluginRoot,
|
|
@@ -90,7 +46,7 @@ function updatedInstalledPlugins(installed, pluginRoot, now, pluginId, mcpServer
|
|
|
90
46
|
...previousCapabilities,
|
|
91
47
|
mcpServers: {
|
|
92
48
|
...previousMcpServers,
|
|
93
|
-
[
|
|
49
|
+
[pluginId]: { ...previousTelegramMcp, enabled: previousTelegramMcp.enabled === false && pluginId === 'agent-spine' ? false : true },
|
|
94
50
|
},
|
|
95
51
|
},
|
|
96
52
|
};
|
|
@@ -101,11 +57,11 @@ function updatedInstalledPlugins(installed, pluginRoot, now, pluginId, mcpServer
|
|
|
101
57
|
if (plugin.id !== pluginId) {
|
|
102
58
|
plugins.push(plugin);
|
|
103
59
|
} else if (!replaced) {
|
|
104
|
-
plugins.push(
|
|
60
|
+
plugins.push(telegram);
|
|
105
61
|
replaced = true;
|
|
106
62
|
}
|
|
107
63
|
}
|
|
108
|
-
if (!replaced) plugins.push(
|
|
64
|
+
if (!replaced) plugins.push(telegram);
|
|
109
65
|
return { ...installed, version: 1, plugins };
|
|
110
66
|
}
|
|
111
67
|
|
|
@@ -123,100 +79,80 @@ function writeInstalledPlugins(filePath, installed) {
|
|
|
123
79
|
}
|
|
124
80
|
}
|
|
125
81
|
|
|
126
|
-
function
|
|
127
|
-
packageRoot,
|
|
128
|
-
blunDir,
|
|
129
|
-
now = new Date().toISOString(),
|
|
130
|
-
pluginId,
|
|
131
|
-
sourceDirectory,
|
|
132
|
-
mcpServerName,
|
|
133
|
-
displayName,
|
|
134
|
-
}) {
|
|
135
|
-
const sourceRoot = path.join(packageRoot, sourceDirectory);
|
|
82
|
+
function installManagedTelegramPlugin({ packageRoot, blunDir, now = new Date().toISOString() }) {
|
|
83
|
+
const sourceRoot = path.join(packageRoot, 'telegram-plugin');
|
|
136
84
|
const pluginsDir = path.join(blunDir, 'plugins');
|
|
137
85
|
const managedDir = path.join(pluginsDir, 'managed');
|
|
138
|
-
const
|
|
86
|
+
const pluginRoot = path.join(managedDir, 'telegram');
|
|
139
87
|
const installedFile = path.join(pluginsDir, 'installed.json');
|
|
140
88
|
|
|
141
89
|
ensurePrivateDirectory(pluginsDir);
|
|
142
90
|
if (fs.existsSync(installedFile)) securePrivateFile(installedFile);
|
|
143
91
|
const installed = readInstalledPlugins(installedFile);
|
|
92
|
+
const updatedInstalled = updatedInstalledPlugins(installed, pluginRoot, now);
|
|
144
93
|
ensurePrivateDirectory(managedDir);
|
|
145
|
-
if (pluginId === 'agent-spine') {
|
|
146
|
-
const selected = selectedAgentSpineRoot({ installed, blunDir });
|
|
147
|
-
if (selected) return { installedFile, pluginRoot: selected, reused: true, selected: true };
|
|
148
|
-
}
|
|
149
|
-
if (fs.existsSync(legacyPluginRoot)
|
|
150
|
-
&& pluginTreesAreIdentical(sourceRoot, legacyPluginRoot)) {
|
|
151
|
-
if (!hasCurrentPluginRecord(installed, legacyPluginRoot, pluginId, mcpServerName)) {
|
|
152
|
-
const updatedInstalled = updatedInstalledPlugins(
|
|
153
|
-
installed,
|
|
154
|
-
legacyPluginRoot,
|
|
155
|
-
now,
|
|
156
|
-
pluginId,
|
|
157
|
-
mcpServerName,
|
|
158
|
-
);
|
|
159
|
-
writeInstalledPlugins(installedFile, updatedInstalled);
|
|
160
|
-
}
|
|
161
|
-
return { installedFile, pluginRoot: legacyPluginRoot, reused: true };
|
|
162
|
-
}
|
|
163
|
-
const sourceDigest = pluginTreeDigest(sourceRoot);
|
|
164
|
-
const pluginRoot = path.join(managedDir, `${pluginId}-${sourceDigest}`);
|
|
165
|
-
const updatedInstalled = updatedInstalledPlugins(
|
|
166
|
-
installed,
|
|
167
|
-
pluginRoot,
|
|
168
|
-
now,
|
|
169
|
-
pluginId,
|
|
170
|
-
mcpServerName,
|
|
171
|
-
);
|
|
172
|
-
if (fs.existsSync(pluginRoot)) {
|
|
173
|
-
if (!pluginTreesAreIdentical(sourceRoot, pluginRoot)) {
|
|
174
|
-
throw new Error(`Managed ${displayName} plugin digest mismatch: ${pluginRoot}`);
|
|
175
|
-
}
|
|
176
|
-
if (!hasCurrentPluginRecord(installed, pluginRoot, pluginId, mcpServerName)) {
|
|
177
|
-
writeInstalledPlugins(installedFile, updatedInstalled);
|
|
178
|
-
}
|
|
179
|
-
return { installedFile, pluginRoot, reused: true };
|
|
180
|
-
}
|
|
181
94
|
const nonce = `${process.pid}-${randomUUID()}`;
|
|
182
|
-
const stagingRoot = path.join(managedDir,
|
|
95
|
+
const stagingRoot = path.join(managedDir, `.telegram-${nonce}.tmp`);
|
|
96
|
+
const backupRoot = path.join(managedDir, `.telegram-${nonce}.bak`);
|
|
97
|
+
let hadPreviousPlugin = false;
|
|
183
98
|
let installedNewPlugin = false;
|
|
184
99
|
try {
|
|
100
|
+
if (fs.existsSync(pluginRoot)) {
|
|
101
|
+
ensurePrivateDirectory(pluginRoot);
|
|
102
|
+
hadPreviousPlugin = true;
|
|
103
|
+
}
|
|
185
104
|
fs.cpSync(sourceRoot, stagingRoot, { recursive: true, force: true });
|
|
186
|
-
|
|
105
|
+
if (hadPreviousPlugin) fs.renameSync(pluginRoot, backupRoot);
|
|
187
106
|
try {
|
|
188
107
|
fs.renameSync(stagingRoot, pluginRoot);
|
|
189
108
|
installedNewPlugin = true;
|
|
190
109
|
writeInstalledPlugins(installedFile, updatedInstalled);
|
|
191
110
|
} catch (error) {
|
|
192
111
|
if (installedNewPlugin) fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
112
|
+
if (hadPreviousPlugin && fs.existsSync(backupRoot)) {
|
|
113
|
+
fs.renameSync(backupRoot, pluginRoot);
|
|
114
|
+
}
|
|
193
115
|
throw error;
|
|
194
116
|
}
|
|
117
|
+
if (hadPreviousPlugin) fs.rmSync(backupRoot, { recursive: true, force: true });
|
|
195
118
|
} finally {
|
|
196
119
|
fs.rmSync(stagingRoot, { recursive: true, force: true });
|
|
197
120
|
}
|
|
198
121
|
|
|
199
|
-
return { installedFile, pluginRoot
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function installManagedTelegramPlugin(options) {
|
|
203
|
-
return installManagedPlugin({
|
|
204
|
-
...options,
|
|
205
|
-
pluginId: 'telegram',
|
|
206
|
-
sourceDirectory: 'telegram-plugin',
|
|
207
|
-
mcpServerName: 'telegram',
|
|
208
|
-
displayName: 'Telegram',
|
|
209
|
-
});
|
|
122
|
+
return { installedFile, pluginRoot };
|
|
210
123
|
}
|
|
211
124
|
|
|
212
|
-
function installManagedAgentSpinePlugin(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
});
|
|
125
|
+
function installManagedAgentSpinePlugin({ packageRoot, blunDir, now = new Date().toISOString() }) {
|
|
126
|
+
const installedFile = path.join(blunDir, 'plugins', 'installed.json');
|
|
127
|
+
ensurePrivateDirectory(path.dirname(installedFile));
|
|
128
|
+
if (fs.existsSync(installedFile)) securePrivateFile(installedFile);
|
|
129
|
+
const installed = readInstalledPlugins(installedFile);
|
|
130
|
+
const records = installed.plugins.filter(plugin => plugin.id === 'agent-spine');
|
|
131
|
+
if (records.length > 1) throw new Error('Ambiguous AgentSpine registration');
|
|
132
|
+
const selected = selectedAgentSpineRoot({ installed, blunDir });
|
|
133
|
+
if (selected) return { installedFile, pluginRoot: selected, reused: true, selected: true };
|
|
134
|
+
if (records[0]?.enabled === false) {
|
|
135
|
+
return { installedFile, pluginRoot: records[0].root, reused: true, disabled: true };
|
|
136
|
+
}
|
|
137
|
+
if (records[0]) {
|
|
138
|
+
const currentRoot = records[0].root;
|
|
139
|
+
if (typeof currentRoot !== 'string' || !path.isAbsolute(currentRoot)) {
|
|
140
|
+
throw new Error('Invalid AgentSpine registration root');
|
|
141
|
+
}
|
|
142
|
+
const managed = path.resolve(blunDir, 'plugins', 'managed');
|
|
143
|
+
const sameDirectory = (left, right) => process.platform === 'win32'
|
|
144
|
+
? left.toLowerCase() === right.toLowerCase() : left === right;
|
|
145
|
+
if (!sameDirectory(path.dirname(path.resolve(currentRoot)), managed)
|
|
146
|
+
|| !/^agent-spine-[a-f0-9]{64}$/.test(path.basename(currentRoot))) {
|
|
147
|
+
return { installedFile, pluginRoot: currentRoot, reused: true, custom: true };
|
|
148
|
+
}
|
|
149
|
+
// An upgrade must not conceal changes to the previous immutable default.
|
|
150
|
+
describeAgentSpineSelection({ blunDir, pluginRoot: currentRoot });
|
|
151
|
+
}
|
|
152
|
+
const pluginRoot = copySelectedAgentSpinePlugin({ blunDir, sourceRoot: path.join(packageRoot, 'agent-spine-plugin') });
|
|
153
|
+
if (records[0]?.root === pluginRoot) return { installedFile, pluginRoot, reused: true };
|
|
154
|
+
writeInstalledPlugins(installedFile, updatedInstalledPlugins(installed, pluginRoot, now, 'agent-spine'));
|
|
155
|
+
return { installedFile, pluginRoot, reused: false };
|
|
220
156
|
}
|
|
221
157
|
|
|
222
158
|
module.exports = {
|
package/bin/private-paths.js
CHANGED
|
@@ -11,7 +11,6 @@ const PRIVATE_TREE_MAX_DEPTH = 64;
|
|
|
11
11
|
const PRIVATE_TREE_MAX_ENTRIES = 4096;
|
|
12
12
|
const PRIVATE_TREE_MAX_PATH_LENGTH = 4096;
|
|
13
13
|
const WINDOWS_ACL_OK_SENTINEL = 'BLUN_PRIVATE_ACL_OK_V1';
|
|
14
|
-
const WINDOWS_ACL_ERROR_SENTINEL = 'BLUN_PRIVATE_ACL_ERROR_V1';
|
|
15
14
|
const WINDOWS_SID_PATTERN = /S-\d-\d+(?:-\d+)+/gi;
|
|
16
15
|
const WINDOWS_LOCAL_DOS_PATH_PATTERN = /^[A-Za-z]:\\/u;
|
|
17
16
|
const WINDOWS_RESERVED_PATH_SEGMENT = /^(?:CON|PRN|AUX|NUL|CONIN\$|CONOUT\$|COM[1-9]|LPT[1-9])(?:\..*)?$/iu;
|
|
@@ -34,9 +33,6 @@ public static class BlunPrivateAclNative
|
|
|
34
33
|
private const uint READ_CONTROL = 0x00020000;
|
|
35
34
|
private const uint WRITE_DAC = 0x00040000;
|
|
36
35
|
private const uint SYNCHRONIZE = 0x00100000;
|
|
37
|
-
private const uint FILE_SHARE_READ = 0x00000001;
|
|
38
|
-
private const uint FILE_SHARE_WRITE = 0x00000002;
|
|
39
|
-
private const uint FILE_SHARE_DELETE = 0x00000004;
|
|
40
36
|
private const uint CREATE_NEW = 1;
|
|
41
37
|
private const uint OPEN_EXISTING = 3;
|
|
42
38
|
private const uint FILE_ATTRIBUTE_NORMAL = 0x00000080;
|
|
@@ -611,7 +607,7 @@ public static class BlunPrivateAclNative
|
|
|
611
607
|
out ioStatus,
|
|
612
608
|
IntPtr.Zero,
|
|
613
609
|
0,
|
|
614
|
-
|
|
610
|
+
0,
|
|
615
611
|
FILE_OPEN_IF,
|
|
616
612
|
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT,
|
|
617
613
|
IntPtr.Zero,
|
|
@@ -1112,7 +1108,7 @@ const WINDOWS_ACL_SCRIPT = [
|
|
|
1112
1108
|
"[Console]::Out.Write('BLUN_PRIVATE_ACL_OK_V1')",
|
|
1113
1109
|
'exit 0',
|
|
1114
1110
|
'} catch {',
|
|
1115
|
-
"[Console]::Error.Write('BLUN_PRIVATE_ACL_ERROR_V1
|
|
1111
|
+
"[Console]::Error.Write('BLUN_PRIVATE_ACL_ERROR_V1')",
|
|
1116
1112
|
'exit 1',
|
|
1117
1113
|
'}',
|
|
1118
1114
|
].join('\n');
|
|
@@ -1131,18 +1127,9 @@ function windowsSystemDirectory(options) {
|
|
|
1131
1127
|
return path.win32.normalize(directory);
|
|
1132
1128
|
}
|
|
1133
1129
|
|
|
1134
|
-
function windowsHostEnvironment(systemDirectory
|
|
1130
|
+
function windowsHostEnvironment(systemDirectory) {
|
|
1135
1131
|
const systemRoot = path.win32.dirname(systemDirectory);
|
|
1136
|
-
|
|
1137
|
-
if (!temporaryDirectory) {
|
|
1138
|
-
throw new Error('Windows private ACL temporary directory is unavailable.');
|
|
1139
|
-
}
|
|
1140
|
-
return {
|
|
1141
|
-
SystemRoot: systemRoot,
|
|
1142
|
-
WINDIR: systemRoot,
|
|
1143
|
-
TEMP: temporaryDirectory,
|
|
1144
|
-
TMP: env.TMP || temporaryDirectory,
|
|
1145
|
-
};
|
|
1132
|
+
return { SystemRoot: systemRoot, WINDIR: systemRoot };
|
|
1146
1133
|
}
|
|
1147
1134
|
|
|
1148
1135
|
function runWindowsCommand(executable, args, options, env, input) {
|
|
@@ -1203,14 +1190,14 @@ function resolveWindowsPrivateTarget(targetPath) {
|
|
|
1203
1190
|
throw new Error('Invalid Windows private path.');
|
|
1204
1191
|
}
|
|
1205
1192
|
return absoluteTarget;
|
|
1206
|
-
} catch
|
|
1207
|
-
throw new Error('Windows private
|
|
1193
|
+
} catch {
|
|
1194
|
+
throw new Error('Windows private ACL hardening or verification failed.');
|
|
1208
1195
|
}
|
|
1209
1196
|
}
|
|
1210
1197
|
|
|
1211
1198
|
function windowsAclController(options) {
|
|
1212
1199
|
const systemDirectory = windowsSystemDirectory(options);
|
|
1213
|
-
const hostEnvironment = windowsHostEnvironment(systemDirectory
|
|
1200
|
+
const hostEnvironment = windowsHostEnvironment(systemDirectory);
|
|
1214
1201
|
const whoami = path.win32.join(systemDirectory, 'whoami.exe');
|
|
1215
1202
|
const powershell = path.win32.join(
|
|
1216
1203
|
systemDirectory,
|
|
@@ -1248,7 +1235,7 @@ function windowsAclController(options) {
|
|
|
1248
1235
|
if (!path.isAbsolute(absoluteTarget)
|
|
1249
1236
|
|| root.toLowerCase() === absoluteTarget.toLowerCase()
|
|
1250
1237
|
|| !['directory', 'file', 'file-write', 'tree'].includes(kind)) {
|
|
1251
|
-
throw new Error('Windows private ACL
|
|
1238
|
+
throw new Error('Windows private ACL hardening or verification failed.');
|
|
1252
1239
|
}
|
|
1253
1240
|
const env = {
|
|
1254
1241
|
...hostEnvironment,
|
|
@@ -1266,21 +1253,11 @@ function windowsAclController(options) {
|
|
|
1266
1253
|
env,
|
|
1267
1254
|
input,
|
|
1268
1255
|
);
|
|
1269
|
-
} catch
|
|
1270
|
-
|
|
1271
|
-
? error.stderr : Buffer.isBuffer(error?.stderr) ? error.stderr.toString('utf8') : '';
|
|
1272
|
-
const marker = `${WINDOWS_ACL_ERROR_SENTINEL}|`;
|
|
1273
|
-
const rawDetail = stderr.startsWith(marker) ? stderr.slice(marker.length) : '';
|
|
1274
|
-
const detail = rawDetail.replace(/[\u0000-\u001f\u007f]+/gu, ' ').trim().slice(0, 500);
|
|
1275
|
-
throw new Error(
|
|
1276
|
-
detail.length > 0
|
|
1277
|
-
? `Windows private ACL operation failed for ${kind} target "${absoluteTarget}": ${detail}`
|
|
1278
|
-
: `Windows private ACL operation failed for ${kind} target "${absoluteTarget}".`,
|
|
1279
|
-
{ cause: error },
|
|
1280
|
-
);
|
|
1256
|
+
} catch {
|
|
1257
|
+
throw new Error('Windows private ACL hardening or verification failed.');
|
|
1281
1258
|
}
|
|
1282
1259
|
if (output !== WINDOWS_ACL_OK_SENTINEL) {
|
|
1283
|
-
throw new Error('Windows private ACL
|
|
1260
|
+
throw new Error('Windows private ACL hardening or verification failed.');
|
|
1284
1261
|
}
|
|
1285
1262
|
} finally {
|
|
1286
1263
|
input?.fill(0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { randomUUID } = require('node:crypto');
|
|
4
4
|
const fs = require('node:fs');
|
|
5
5
|
const path = require('node:path');
|
|
6
6
|
|
|
@@ -31,9 +31,6 @@ function readCatalogue(packageRoot) {
|
|
|
31
31
|
|| !tool.platforms.every((platform) => platform === 'darwin' || platform === 'win32'))) {
|
|
32
32
|
throw new Error(`Ungueltige Standard-Tool-Plattform: ${name}`);
|
|
33
33
|
}
|
|
34
|
-
if (tool.autoEnable !== undefined && typeof tool.autoEnable !== 'boolean') {
|
|
35
|
-
throw new Error(`Ungueltiger Standard-Tool-Autostart: ${name}`);
|
|
36
|
-
}
|
|
37
34
|
if (tool.owner === 'user-mcp'
|
|
38
35
|
&& (!isObject(tool.config) || typeof tool.config.enabled !== 'boolean')) {
|
|
39
36
|
throw new Error(`Standard-Tool braucht einen Aktivierungszustand: ${name}`);
|
|
@@ -98,24 +95,10 @@ function recognizedBundledServer(name, current, expected) {
|
|
|
98
95
|
&& /^@upstash\/context7-mcp(?:@[^\s]+)?$/u.test(current.args[1] ?? '');
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
function
|
|
98
|
+
function migrateBundledTool(name, current, expected) {
|
|
102
99
|
if (!recognizedBundledServer(name, current, expected)) return false;
|
|
103
100
|
let changed = false;
|
|
104
|
-
if (
|
|
105
|
-
if (expected.blunExplicitlyEnabled === true) {
|
|
106
|
-
if (current.enabled !== true) {
|
|
107
|
-
current.enabled = true;
|
|
108
|
-
changed = true;
|
|
109
|
-
}
|
|
110
|
-
if (current.blunExplicitlyEnabled !== true) {
|
|
111
|
-
current.blunExplicitlyEnabled = true;
|
|
112
|
-
changed = true;
|
|
113
|
-
}
|
|
114
|
-
} else if (current.blunExplicitlyEnabled !== true && current.enabled !== false) {
|
|
115
|
-
current.enabled = false;
|
|
116
|
-
changed = true;
|
|
117
|
-
}
|
|
118
|
-
} else if (current.enabled === false) {
|
|
101
|
+
if (current.enabled === false && name !== 'blun-language-guard') {
|
|
119
102
|
current.enabled = true;
|
|
120
103
|
changed = true;
|
|
121
104
|
}
|
|
@@ -151,16 +134,9 @@ function writeMcpDocument(configPath, document) {
|
|
|
151
134
|
}
|
|
152
135
|
}
|
|
153
136
|
|
|
154
|
-
function bundledToolConfig(name, tool, {
|
|
155
|
-
packageRoot,
|
|
156
|
-
blunDir,
|
|
157
|
-
platform,
|
|
158
|
-
env,
|
|
159
|
-
forceEnable,
|
|
160
|
-
}) {
|
|
137
|
+
function bundledToolConfig(name, tool, { packageRoot, blunDir, platform, env }) {
|
|
161
138
|
const config = structuredClone(tool.config);
|
|
162
|
-
config.enabled =
|
|
163
|
-
if (forceEnable && tool.autoEnable === false) config.blunExplicitlyEnabled = true;
|
|
139
|
+
config.enabled = true;
|
|
164
140
|
if (name === 'blun-language-guard') {
|
|
165
141
|
config.command = platform === 'win32' ? 'python' : 'python3';
|
|
166
142
|
config.args = [
|
|
@@ -209,7 +185,6 @@ function seedStandardTools({
|
|
|
209
185
|
names,
|
|
210
186
|
platform = process.platform,
|
|
211
187
|
env = process.env,
|
|
212
|
-
forceEnable = false,
|
|
213
188
|
}) {
|
|
214
189
|
const catalogue = readCatalogue(packageRoot);
|
|
215
190
|
if (!Array.isArray(names) || names.length === 0) {
|
|
@@ -240,10 +215,9 @@ function seedStandardTools({
|
|
|
240
215
|
blunDir,
|
|
241
216
|
platform,
|
|
242
217
|
env,
|
|
243
|
-
forceEnable,
|
|
244
218
|
});
|
|
245
219
|
if (Object.hasOwn(servers, name)) {
|
|
246
|
-
if (
|
|
220
|
+
if (migrateBundledTool(name, servers[name], expected)) updated.push(name);
|
|
247
221
|
continue;
|
|
248
222
|
}
|
|
249
223
|
if (hasEquivalentServer(servers, name, tool)) continue;
|
|
@@ -251,102 +225,48 @@ function seedStandardTools({
|
|
|
251
225
|
added.push(name);
|
|
252
226
|
}
|
|
253
227
|
|
|
254
|
-
if (added.length > 0 || updated.length > 0)
|
|
228
|
+
if (added.length > 0 || updated.length > 0) {
|
|
229
|
+
writeMcpDocument(configPath, { ...document, mcpServers: servers });
|
|
230
|
+
}
|
|
255
231
|
return { added, updated, configPath };
|
|
256
232
|
}
|
|
257
233
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
234
|
+
function seedStandardDesignSkill({ packageRoot, blunDir }) {
|
|
235
|
+
const sourcePath = path.join(
|
|
236
|
+
packageRoot,
|
|
237
|
+
'standard-skills',
|
|
238
|
+
'blun-app-design-system',
|
|
239
|
+
);
|
|
240
|
+
const sourceStat = fs.lstatSync(sourcePath);
|
|
241
|
+
if (!sourceStat.isDirectory() || sourceStat.isSymbolicLink()) {
|
|
242
|
+
throw new Error(`Ungueltiger BLUN-Standard-Skill: ${sourcePath}`);
|
|
265
243
|
}
|
|
244
|
+
|
|
266
245
|
const skillsDir = path.join(blunDir, 'skills');
|
|
267
246
|
ensurePrivateDirectory(skillsDir);
|
|
268
|
-
const
|
|
269
|
-
const installed =
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
.filter((entry) => entry.isDirectory() && !entry.isSymbolicLink())
|
|
275
|
-
.sort((left, right) => left.name.localeCompare(right.name));
|
|
276
|
-
const fingerprint = createHash('sha256');
|
|
277
|
-
const visit = (directory, relative = '') => {
|
|
278
|
-
for (const entry of fs.readdirSync(directory, { withFileTypes: true })
|
|
279
|
-
.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
280
|
-
const sourcePath = path.join(directory, entry.name);
|
|
281
|
-
const relativePath = path.join(relative, entry.name).replaceAll('\\', '/');
|
|
282
|
-
if (entry.isSymbolicLink()) throw new Error(`Symlink im BLUN-Standard-Skill: ${sourcePath}`);
|
|
283
|
-
fingerprint.update(relativePath);
|
|
284
|
-
if (entry.isDirectory()) visit(sourcePath, relativePath);
|
|
285
|
-
else if (entry.isFile()) fingerprint.update(fs.readFileSync(sourcePath));
|
|
286
|
-
else throw new Error(`Ungueltiger Eintrag im BLUN-Standard-Skill: ${sourcePath}`);
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
visit(sourceRoot);
|
|
290
|
-
const sourceFingerprint = fingerprint.digest('hex');
|
|
291
|
-
let marker = null;
|
|
292
|
-
try {
|
|
293
|
-
marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
|
|
294
|
-
} catch {
|
|
295
|
-
marker = null;
|
|
296
|
-
}
|
|
297
|
-
const allDestinationsExist = entries.every((entry) => {
|
|
298
|
-
const destinationPath = path.join(skillsDir, entry.name);
|
|
299
|
-
destinationPaths.push(destinationPath);
|
|
300
|
-
if (!fs.existsSync(destinationPath)) return false;
|
|
301
|
-
const stat = fs.lstatSync(destinationPath);
|
|
302
|
-
return stat.isDirectory() && !stat.isSymbolicLink();
|
|
303
|
-
});
|
|
304
|
-
if (marker?.fingerprint === sourceFingerprint && allDestinationsExist) {
|
|
305
|
-
return { installed, updated, destinationPaths, unchanged: true };
|
|
306
|
-
}
|
|
307
|
-
destinationPaths.length = 0;
|
|
308
|
-
|
|
309
|
-
for (const entry of entries) {
|
|
310
|
-
const sourcePath = path.join(sourceRoot, entry.name);
|
|
311
|
-
const destinationPath = path.join(skillsDir, entry.name);
|
|
312
|
-
const isInstalled = !fs.existsSync(destinationPath);
|
|
313
|
-
if (!isInstalled) {
|
|
314
|
-
const destinationStat = fs.lstatSync(destinationPath);
|
|
315
|
-
if (!destinationStat.isDirectory() || destinationStat.isSymbolicLink()) {
|
|
316
|
-
throw new Error(`Ungueltiges Ziel fuer BLUN-Standard-Skill: ${destinationPath}`);
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
fs.mkdirSync(destinationPath, { mode: 0o700 });
|
|
247
|
+
const destinationPath = path.join(skillsDir, 'blun-app-design-system');
|
|
248
|
+
const installed = !fs.existsSync(destinationPath);
|
|
249
|
+
if (!installed) {
|
|
250
|
+
const destinationStat = fs.lstatSync(destinationPath);
|
|
251
|
+
if (!destinationStat.isDirectory() || destinationStat.isSymbolicLink()) {
|
|
252
|
+
throw new Error(`Ungueltiges Ziel fuer BLUN-Standard-Skill: ${destinationPath}`);
|
|
320
253
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
recursive: true,
|
|
324
|
-
force: true,
|
|
325
|
-
errorOnExist: false,
|
|
326
|
-
});
|
|
327
|
-
(isInstalled ? installed : updated).push(entry.name);
|
|
328
|
-
destinationPaths.push(destinationPath);
|
|
254
|
+
} else {
|
|
255
|
+
ensurePrivateDirectory(destinationPath);
|
|
329
256
|
}
|
|
330
257
|
|
|
331
|
-
fs.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const name = 'blun-app-design-system';
|
|
339
|
-
return {
|
|
340
|
-
installed: result.installed.includes(name),
|
|
341
|
-
updated: result.updated.includes(name),
|
|
342
|
-
destinationPath: path.join(options.blunDir, 'skills', name),
|
|
343
|
-
};
|
|
258
|
+
fs.cpSync(sourcePath, destinationPath, {
|
|
259
|
+
recursive: true,
|
|
260
|
+
force: true,
|
|
261
|
+
errorOnExist: false,
|
|
262
|
+
});
|
|
263
|
+
securePrivateTree(destinationPath);
|
|
264
|
+
return { installed, updated: !installed, destinationPath };
|
|
344
265
|
}
|
|
345
266
|
|
|
346
267
|
module.exports = {
|
|
347
268
|
availableStandardToolNames,
|
|
348
269
|
readCatalogue,
|
|
349
270
|
seedStandardDesignSkill,
|
|
350
|
-
seedStandardSkills,
|
|
351
271
|
seedStandardTools,
|
|
352
272
|
};
|
|
@@ -36,17 +36,9 @@ function classifyThinkingEffortForTurn(text, originKind) {
|
|
|
36
36
|
const lower = normalized.toLowerCase();
|
|
37
37
|
if (IDENTITY_CHAT.test(lower) || BOSNIAN_STANDALONE_CHAT.test(lower)) return "off";
|
|
38
38
|
if (STANDALONE_CHAT.test(lower)) return "low";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
&& !EXPLICIT_THINKING_INTENT.test(normalized)
|
|
43
|
-
) return "low";
|
|
44
|
-
if (normalized.length > 180 || String(text ?? "").split(/\r?\n/u).length > 2) return undefined;
|
|
45
|
-
if (ACTIONABLE_PROMPT.test(normalized) || EXPLICIT_THINKING_INTENT.test(normalized)) return undefined;
|
|
46
|
-
|
|
47
|
-
const shortQuestion = /[?]\s*$/u.test(normalized)
|
|
48
|
-
|| /^(?:was|wer|wie|warum|wieso|weshalb|wo|wann|welche?r?s?|what|who|how|why|where|when|which|can you|kannst du)\b/iu.test(normalized);
|
|
49
|
-
return shortQuestion ? "low" : undefined;
|
|
39
|
+
// Fast chat drops project context and tools. Brevity or a status question
|
|
40
|
+
// cannot establish that this evidence is unnecessary.
|
|
41
|
+
return undefined;
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
function selectThinkingEffortForTurn(text, originKind, profileEffort) {
|