enya-agent 0.1.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.
- package/.env.example +20 -0
- package/.github/workflows/ci.yml +70 -0
- package/.github/workflows/publish.yml +250 -0
- package/.gitmodules +3 -0
- package/Cargo.lock +3584 -0
- package/Cargo.toml +97 -0
- package/crates/enact/Cargo.toml +27 -0
- package/crates/enact/src/lib.rs +60 -0
- package/crates/enact-a2a/Cargo.toml +25 -0
- package/crates/enact-a2a/src/lib.rs +411 -0
- package/crates/enact-channels/Cargo.toml +64 -0
- package/crates/enact-channels/examples/README.md +80 -0
- package/crates/enact-channels/examples/channel_bot.rs +169 -0
- package/crates/enact-channels/examples/telegram-echo.rs +34 -0
- package/crates/enact-channels/examples/whatsapp-echo.rs +142 -0
- package/crates/enact-channels/src/config.rs +213 -0
- package/crates/enact-channels/src/lib.rs +25 -0
- package/crates/enact-channels/src/runtime.rs +237 -0
- package/crates/enact-channels/src/security/mod.rs +5 -0
- package/crates/enact-channels/src/security/pairing.rs +205 -0
- package/crates/enact-channels/src/teams.rs +601 -0
- package/crates/enact-channels/src/telegram.rs +2833 -0
- package/crates/enact-channels/src/traits.rs +200 -0
- package/crates/enact-channels/src/webhook.rs +262 -0
- package/crates/enact-channels/src/whatsapp.rs +310 -0
- package/crates/enact-cli/Cargo.toml +40 -0
- package/crates/enact-cli/src/commands/doctor.rs +62 -0
- package/crates/enact-cli/src/commands/mod.rs +3 -0
- package/crates/enact-cli/src/commands/run.rs +69 -0
- package/crates/enact-cli/src/commands/serve.rs +81 -0
- package/crates/enact-cli/src/config.rs +2 -0
- package/crates/enact-cli/src/main.rs +79 -0
- package/crates/enact-config/Cargo.toml +36 -0
- package/crates/enact-config/ENV_VAR_MAPPING.md +135 -0
- package/crates/enact-config/QUICK_REFERENCE.md +92 -0
- package/crates/enact-config/README.md +107 -0
- package/crates/enact-config/TESTING.md +161 -0
- package/crates/enact-config/examples/test-env-vars.rs +100 -0
- package/crates/enact-config/src/config.rs +399 -0
- package/crates/enact-config/src/encrypted_store.rs +211 -0
- package/crates/enact-config/src/lib.rs +298 -0
- package/crates/enact-config/src/secrets.rs +149 -0
- package/crates/enact-config/src/sync.rs +260 -0
- package/crates/enact-config/test-env-vars.sh +34 -0
- package/crates/enact-config/tests/README.md +99 -0
- package/crates/enact-config/tests/config_integration_test.rs +202 -0
- package/crates/enact-config/tests/security_test.rs +140 -0
- package/crates/enact-context/Cargo.toml +41 -0
- package/crates/enact-context/src/budget.rs +314 -0
- package/crates/enact-context/src/calibrator.rs +535 -0
- package/crates/enact-context/src/compactor.rs +392 -0
- package/crates/enact-context/src/condenser.rs +826 -0
- package/crates/enact-context/src/lib.rs +94 -0
- package/crates/enact-context/src/segment.rs +238 -0
- package/crates/enact-context/src/step_context.rs +645 -0
- package/crates/enact-context/src/token_counter.rs +148 -0
- package/crates/enact-context/src/window.rs +372 -0
- package/crates/enact-core/Cargo.toml +42 -0
- package/crates/enact-core/README.md +98 -0
- package/crates/enact-core/src/background/executor.rs +524 -0
- package/crates/enact-core/src/background/mod.rs +48 -0
- package/crates/enact-core/src/background/target_binding.rs +390 -0
- package/crates/enact-core/src/background/trigger.rs +511 -0
- package/crates/enact-core/src/callable/callable.rs +152 -0
- package/crates/enact-core/src/callable/composite.rs +817 -0
- package/crates/enact-core/src/callable/graph.rs +104 -0
- package/crates/enact-core/src/callable/llm.rs +211 -0
- package/crates/enact-core/src/callable/mod.rs +64 -0
- package/crates/enact-core/src/callable/registry.rs +206 -0
- package/crates/enact-core/src/context/execution_context.rs +757 -0
- package/crates/enact-core/src/context/invocation.rs +99 -0
- package/crates/enact-core/src/context/mod.rs +50 -0
- package/crates/enact-core/src/context/tenant.rs +175 -0
- package/crates/enact-core/src/context/trace.rs +127 -0
- package/crates/enact-core/src/flow/conditional.rs +293 -0
- package/crates/enact-core/src/flow/mod.rs +43 -0
- package/crates/enact-core/src/flow/parallel.rs +437 -0
- package/crates/enact-core/src/flow/repeat.rs +534 -0
- package/crates/enact-core/src/flow/sequential.rs +248 -0
- package/crates/enact-core/src/graph/checkpoint.rs +79 -0
- package/crates/enact-core/src/graph/checkpoint_store.rs +76 -0
- package/crates/enact-core/src/graph/compiled.rs +189 -0
- package/crates/enact-core/src/graph/edge.rs +59 -0
- package/crates/enact-core/src/graph/graph_schema.rs +218 -0
- package/crates/enact-core/src/graph/loader.rs +155 -0
- package/crates/enact-core/src/graph/mod.rs +18 -0
- package/crates/enact-core/src/graph/node/function.rs +49 -0
- package/crates/enact-core/src/graph/node/mod.rs +48 -0
- package/crates/enact-core/src/graph/schema.rs +62 -0
- package/crates/enact-core/src/inbox/message.rs +405 -0
- package/crates/enact-core/src/inbox/mod.rs +31 -0
- package/crates/enact-core/src/inbox/store.rs +355 -0
- package/crates/enact-core/src/kernel/artifact/filesystem.rs +546 -0
- package/crates/enact-core/src/kernel/artifact/metadata.rs +283 -0
- package/crates/enact-core/src/kernel/artifact/mod.rs +27 -0
- package/crates/enact-core/src/kernel/artifact/store.rs +427 -0
- package/crates/enact-core/src/kernel/enforcement.rs +1315 -0
- package/crates/enact-core/src/kernel/error.rs +1200 -0
- package/crates/enact-core/src/kernel/event.rs +1394 -0
- package/crates/enact-core/src/kernel/execution_model.rs +831 -0
- package/crates/enact-core/src/kernel/execution_state.rs +189 -0
- package/crates/enact-core/src/kernel/execution_strategy.rs +117 -0
- package/crates/enact-core/src/kernel/ids.rs +2086 -0
- package/crates/enact-core/src/kernel/interrupt.rs +125 -0
- package/crates/enact-core/src/kernel/kernel.rs +1283 -0
- package/crates/enact-core/src/kernel/mod.rs +205 -0
- package/crates/enact-core/src/kernel/persistence/event_store.rs +270 -0
- package/crates/enact-core/src/kernel/persistence/message_store.rs +908 -0
- package/crates/enact-core/src/kernel/persistence/mod.rs +102 -0
- package/crates/enact-core/src/kernel/persistence/state_store.rs +228 -0
- package/crates/enact-core/src/kernel/persistence/vector_store.rs +299 -0
- package/crates/enact-core/src/kernel/reducer.rs +808 -0
- package/crates/enact-core/src/kernel/replay.rs +153 -0
- package/crates/enact-core/src/lib.rs +413 -0
- package/crates/enact-core/src/memory/episodic.rs +0 -0
- package/crates/enact-core/src/memory/mod.rs +6 -0
- package/crates/enact-core/src/memory/semantic.rs +0 -0
- package/crates/enact-core/src/memory/trait.rs +0 -0
- package/crates/enact-core/src/memory/vector_db.rs +0 -0
- package/crates/enact-core/src/memory/working.rs +0 -0
- package/crates/enact-core/src/policy/execution_policy.rs +292 -0
- package/crates/enact-core/src/policy/filters.rs +458 -0
- package/crates/enact-core/src/policy/input_processor.rs +407 -0
- package/crates/enact-core/src/policy/long_running.rs +134 -0
- package/crates/enact-core/src/policy/mod.rs +193 -0
- package/crates/enact-core/src/policy/pii_input.rs +274 -0
- package/crates/enact-core/src/policy/tenant_policy.rs +453 -0
- package/crates/enact-core/src/policy/tool_policy.rs +407 -0
- package/crates/enact-core/src/providers/mod.rs +63 -0
- package/crates/enact-core/src/providers/trait.rs +292 -0
- package/crates/enact-core/src/runner/callbacks.rs +6 -0
- package/crates/enact-core/src/runner/execution_runner.rs +476 -0
- package/crates/enact-core/src/runner/loop.rs +117 -0
- package/crates/enact-core/src/runner/mod.rs +58 -0
- package/crates/enact-core/src/runner/protected_runner.rs +280 -0
- package/crates/enact-core/src/signal/inmemory.rs +231 -0
- package/crates/enact-core/src/signal/mod.rs +108 -0
- package/crates/enact-core/src/streaming/event_logger.rs +195 -0
- package/crates/enact-core/src/streaming/event_stream.rs +1423 -0
- package/crates/enact-core/src/streaming/mod.rs +108 -0
- package/crates/enact-core/src/streaming/pause_cancel.rs +0 -0
- package/crates/enact-core/src/streaming/protected_emitter.rs +173 -0
- package/crates/enact-core/src/streaming/protection/context.rs +136 -0
- package/crates/enact-core/src/streaming/protection/encryption.rs +289 -0
- package/crates/enact-core/src/streaming/protection/mod.rs +43 -0
- package/crates/enact-core/src/streaming/protection/pii_protection.rs +243 -0
- package/crates/enact-core/src/streaming/protection/processor.rs +166 -0
- package/crates/enact-core/src/streaming/sse.rs +0 -0
- package/crates/enact-core/src/telemetry/exporter.rs +0 -0
- package/crates/enact-core/src/telemetry/init.rs +0 -0
- package/crates/enact-core/src/telemetry/mod.rs +49 -0
- package/crates/enact-core/src/telemetry/spans.rs +245 -0
- package/crates/enact-core/src/tool/agent_tool.rs +177 -0
- package/crates/enact-core/src/tool/browser/mod.rs +0 -0
- package/crates/enact-core/src/tool/browser/webdriver.rs +0 -0
- package/crates/enact-core/src/tool/cost.rs +247 -0
- package/crates/enact-core/src/tool/discovery.rs +0 -0
- package/crates/enact-core/src/tool/dispatcher.rs +347 -0
- package/crates/enact-core/src/tool/filesystem.rs +231 -0
- package/crates/enact-core/src/tool/function.rs +99 -0
- package/crates/enact-core/src/tool/git.rs +162 -0
- package/crates/enact-core/src/tool/http.rs +214 -0
- package/crates/enact-core/src/tool/mcp/client.rs +0 -0
- package/crates/enact-core/src/tool/mcp/mod.rs +0 -0
- package/crates/enact-core/src/tool/mod.rs +51 -0
- package/crates/enact-core/src/tool/reasoning/debugging.rs +0 -0
- package/crates/enact-core/src/tool/reasoning/mcts.rs +0 -0
- package/crates/enact-core/src/tool/reasoning/mod.rs +0 -0
- package/crates/enact-core/src/tool/reasoning/sequential.rs +0 -0
- package/crates/enact-core/src/tool/sandbox/dagger.rs +0 -0
- package/crates/enact-core/src/tool/sandbox/mod.rs +0 -0
- package/crates/enact-core/src/tool/shell.rs +147 -0
- package/crates/enact-core/src/tool/trait.rs +33 -0
- package/crates/enact-core/src/tool/web_search.rs +277 -0
- package/crates/enact-core/src/util/config.rs +0 -0
- package/crates/enact-core/src/util/errors.rs +0 -0
- package/crates/enact-core/src/util/mod.rs +6 -0
- package/crates/enact-core/tests/airgapped_e2e_test.rs +291 -0
- package/crates/enact-core/tests/e2e_agentic_loop.rs +119 -0
- package/crates/enact-core/tests/e2e_test.rs +259 -0
- package/crates/enact-core/tests/graph_test.rs +130 -0
- package/crates/enact-core/tests/stream_event_id_validation.rs +435 -0
- package/crates/enact-cron/Cargo.toml +28 -0
- package/crates/enact-cron/src/lib.rs +44 -0
- package/crates/enact-cron/src/schedule.rs +156 -0
- package/crates/enact-cron/src/store.rs +589 -0
- package/crates/enact-cron/src/types.rs +148 -0
- package/crates/enact-gateway/Cargo.toml +31 -0
- package/crates/enact-gateway/README.md +30 -0
- package/crates/enact-gateway/examples/whatsapp-gateway-runner-mock.rs +59 -0
- package/crates/enact-gateway/examples/whatsapp-gateway.rs +42 -0
- package/crates/enact-gateway/src/lib.rs +582 -0
- package/crates/enact-mcp/Cargo.toml +24 -0
- package/crates/enact-mcp/src/lib.rs +178 -0
- package/crates/enact-memory/Cargo.toml +25 -0
- package/crates/enact-memory/src/backend.rs +20 -0
- package/crates/enact-memory/src/chunker.rs +230 -0
- package/crates/enact-memory/src/embeddings.rs +221 -0
- package/crates/enact-memory/src/lib.rs +67 -0
- package/crates/enact-memory/src/markdown.rs +127 -0
- package/crates/enact-memory/src/none.rs +61 -0
- package/crates/enact-memory/src/sqlite.rs +276 -0
- package/crates/enact-memory/src/traits.rs +65 -0
- package/crates/enact-memory/src/vector.rs +198 -0
- package/crates/enact-oauth/Cargo.toml +27 -0
- package/crates/enact-oauth/src/lib.rs +584 -0
- package/crates/enact-observability/Cargo.toml +22 -0
- package/crates/enact-observability/src/lib.rs +197 -0
- package/crates/enact-providers/Cargo.toml +33 -0
- package/crates/enact-providers/examples/hello-agent.rs +33 -0
- package/crates/enact-providers/src/anthropic.rs +182 -0
- package/crates/enact-providers/src/azure.rs +96 -0
- package/crates/enact-providers/src/bridge.rs +221 -0
- package/crates/enact-providers/src/gemini.rs +227 -0
- package/crates/enact-providers/src/http.rs +78 -0
- package/crates/enact-providers/src/lib.rs +53 -0
- package/crates/enact-providers/src/openai_compatible.rs +167 -0
- package/crates/enact-providers/src/openrouter.rs +33 -0
- package/crates/enact-runner/Cargo.toml +24 -0
- package/crates/enact-runner/README.md +76 -0
- package/crates/enact-runner/src/compaction.rs +225 -0
- package/crates/enact-runner/src/config.rs +118 -0
- package/crates/enact-runner/src/lib.rs +63 -0
- package/crates/enact-runner/src/loop_driver.rs +414 -0
- package/crates/enact-runner/src/parser.rs +421 -0
- package/crates/enact-runner/src/retry.rs +262 -0
- package/crates/enact-runner/tests/integration.rs +278 -0
- package/crates/enact-security/Cargo.toml +22 -0
- package/crates/enact-security/src/audit.rs +375 -0
- package/crates/enact-security/src/lib.rs +37 -0
- package/crates/enact-security/src/policy.rs +406 -0
- package/crates/enact-skills/Cargo.toml +25 -0
- package/crates/enact-skills/src/lib.rs +506 -0
- package/crates/enact-tools/Cargo.toml +22 -0
- package/crates/enact-tools/src/file_read.rs +166 -0
- package/crates/enact-tools/src/file_write.rs +216 -0
- package/crates/enact-tools/src/git_operations.rs +513 -0
- package/crates/enact-tools/src/http_request.rs +417 -0
- package/crates/enact-tools/src/lib.rs +104 -0
- package/crates/enact-tools/src/security.rs +227 -0
- package/crates/enact-tools/src/shell.rs +191 -0
- package/crates/enact-tools/src/traits.rs +159 -0
- package/docs/Makefile +74 -0
- package/docs/config.toml +62 -0
- package/docs/content/_index.md +174 -0
- package/docs/content/a2a/_index.md +431 -0
- package/docs/content/api/_index.md +323 -0
- package/docs/content/channels/_index.md +160 -0
- package/docs/content/channels/teams.md +205 -0
- package/docs/content/channels/telegram.md +182 -0
- package/docs/content/channels/webhook.md +423 -0
- package/docs/content/channels/whatsapp.md +240 -0
- package/docs/content/cli/_index.md +261 -0
- package/docs/content/concepts/_index.md +273 -0
- package/docs/content/configuration/_index.md +241 -0
- package/docs/content/cron/_index.md +248 -0
- package/docs/content/developers/_index.md +278 -0
- package/docs/content/getting-started/_index.md +180 -0
- package/docs/content/installation/_index.md +186 -0
- package/docs/content/installation/uninstall.md +101 -0
- package/docs/content/installation/updating.md +120 -0
- package/docs/content/mcp/_index.md +215 -0
- package/docs/content/memory/_index.md +163 -0
- package/docs/content/oauth/_index.md +515 -0
- package/docs/content/providers/_index.md +206 -0
- package/docs/content/roadmap/_index.md +199 -0
- package/docs/content/security/_index.md +219 -0
- package/docs/content/skills/_index.md +228 -0
- package/docs/content/tools/_index.md +485 -0
- package/docs/content/troubleshooting/_index.md +259 -0
- package/docs/content/yaml-schema/_index.md +294 -0
- package/docs/static/giallo-dark.css +91 -0
- package/docs/static/giallo-light.css +91 -0
- package/docs/themes/tanuki/.github/workflows/deploy.yml +44 -0
- package/docs/themes/tanuki/LICENSE +21 -0
- package/docs/themes/tanuki/README.md +166 -0
- package/docs/themes/tanuki/examples/blog/config.toml +58 -0
- package/docs/themes/tanuki/examples/blog/content/_index.md +4 -0
- package/docs/themes/tanuki/examples/blog/content/about.md +33 -0
- package/docs/themes/tanuki/examples/blog/content/blog/_index.md +7 -0
- package/docs/themes/tanuki/examples/blog/content/blog/api-design-best-practices.md +245 -0
- package/docs/themes/tanuki/examples/blog/content/blog/building-accessible-websites.md +147 -0
- package/docs/themes/tanuki/examples/blog/content/blog/css-grid-vs-flexbox.md +165 -0
- package/docs/themes/tanuki/examples/blog/content/blog/customizing-catppuccin-colors.md +137 -0
- package/docs/themes/tanuki/examples/blog/content/blog/dark-mode-best-practices.md +82 -0
- package/docs/themes/tanuki/examples/blog/content/blog/docker-essentials.md +301 -0
- package/docs/themes/tanuki/examples/blog/content/blog/getting-started-with-zola.md +129 -0
- package/docs/themes/tanuki/examples/blog/content/blog/git-workflow-for-content.md +112 -0
- package/docs/themes/tanuki/examples/blog/content/blog/introduction-to-webassembly.md +183 -0
- package/docs/themes/tanuki/examples/blog/content/blog/modern-javascript-features.md +234 -0
- package/docs/themes/tanuki/examples/blog/content/blog/testing-strategies.md +311 -0
- package/docs/themes/tanuki/examples/blog/content/blog/typography-for-developers.md +104 -0
- package/docs/themes/tanuki/examples/blog/content/blog/welcome-to-tanuki.md +67 -0
- package/docs/themes/tanuki/examples/blog/content/blog/why-static-sites.md +85 -0
- package/docs/themes/tanuki/examples/blog/content/projects.md +64 -0
- package/docs/themes/tanuki/examples/book/config.toml +17 -0
- package/docs/themes/tanuki/examples/book/content/_index.md +12 -0
- package/docs/themes/tanuki/examples/book/content/chapter-1.md +90 -0
- package/docs/themes/tanuki/examples/book/content/chapter-2.md +143 -0
- package/docs/themes/tanuki/examples/book/content/chapter-3.md +217 -0
- package/docs/themes/tanuki/examples/book/content/chapter-4.md +224 -0
- package/docs/themes/tanuki/examples/book/content/chapter-5.md +297 -0
- package/docs/themes/tanuki/examples/book/content/print.md +6 -0
- package/docs/themes/tanuki/examples/docs/config.toml +28 -0
- package/docs/themes/tanuki/examples/docs/content/_index.md +20 -0
- package/docs/themes/tanuki/examples/docs/content/components.md +156 -0
- package/docs/themes/tanuki/examples/docs/content/configuration.md +94 -0
- package/docs/themes/tanuki/examples/docs/content/customization.md +202 -0
- package/docs/themes/tanuki/examples/docs/content/deployment.md +204 -0
- package/docs/themes/tanuki/examples/docs/content/installation.md +59 -0
- package/docs/themes/tanuki/examples/docs/content/print.md +6 -0
- package/docs/themes/tanuki/examples/docs/static/img/tanuki-icon.avif +0 -0
- package/docs/themes/tanuki/examples/index.html +2104 -0
- package/docs/themes/tanuki/mise.toml +108 -0
- package/docs/themes/tanuki/sass/base/_catppuccin.scss +164 -0
- package/docs/themes/tanuki/sass/base/_fonts.scss +64 -0
- package/docs/themes/tanuki/sass/base/_reset.scss +152 -0
- package/docs/themes/tanuki/sass/base/_typography.scss +523 -0
- package/docs/themes/tanuki/sass/components/_buttons.scss +209 -0
- package/docs/themes/tanuki/sass/components/_code.scss +457 -0
- package/docs/themes/tanuki/sass/components/_landing.scss +633 -0
- package/docs/themes/tanuki/sass/components/_layout.scss +294 -0
- package/docs/themes/tanuki/sass/components/_navigation.scss +1200 -0
- package/docs/themes/tanuki/sass/components/_print.scss +237 -0
- package/docs/themes/tanuki/sass/components/_search.scss +224 -0
- package/docs/themes/tanuki/sass/components/_sidebar.scss +473 -0
- package/docs/themes/tanuki/sass/components/_theme-toggle.scss +186 -0
- package/docs/themes/tanuki/sass/modes/_blog.scss +366 -0
- package/docs/themes/tanuki/sass/modes/_product.scss +875 -0
- package/docs/themes/tanuki/sass/modes/_raskell.scss +1696 -0
- package/docs/themes/tanuki/sass/patterns/_buttons.scss +183 -0
- package/docs/themes/tanuki/sass/patterns/_cards.scss +144 -0
- package/docs/themes/tanuki/sass/patterns/_index.scss +9 -0
- package/docs/themes/tanuki/sass/patterns/_lists.scss +259 -0
- package/docs/themes/tanuki/sass/patterns/_sections.scss +243 -0
- package/docs/themes/tanuki/sass/style.scss +47 -0
- package/docs/themes/tanuki/sass/tokens/_colors.scss +139 -0
- package/docs/themes/tanuki/sass/tokens/_spacing.scss +100 -0
- package/docs/themes/tanuki/sass/tokens/_typography.scss +186 -0
- package/docs/themes/tanuki/screenshot.png +0 -0
- package/docs/themes/tanuki/sentinel.kdl +59 -0
- package/docs/themes/tanuki/static/elasticlunr.min.js +10 -0
- package/docs/themes/tanuki/static/fonts/GEIST-LICENSE.txt +92 -0
- package/docs/themes/tanuki/static/fonts/Geist-Variable.woff2 +0 -0
- package/docs/themes/tanuki/static/fonts/GeistMono-Variable.woff2 +0 -0
- package/docs/themes/tanuki/static/img/tanuki-icon.avif +0 -0
- package/docs/themes/tanuki/static/img/tanuki-icon.png +0 -0
- package/docs/themes/tanuki/static/js/anchors.js +18 -0
- package/docs/themes/tanuki/static/js/app.js +274 -0
- package/docs/themes/tanuki/static/js/code.js +394 -0
- package/docs/themes/tanuki/static/js/navigation.js +778 -0
- package/docs/themes/tanuki/static/js/scroll-to-top.js +33 -0
- package/docs/themes/tanuki/static/js/search-raskell.js +240 -0
- package/docs/themes/tanuki/static/js/search.js +215 -0
- package/docs/themes/tanuki/static/js/theme.js +169 -0
- package/docs/themes/tanuki/static/syntax-dark.css +151 -0
- package/docs/themes/tanuki/static/syntax-light.css +151 -0
- package/docs/themes/tanuki/static/wasm/sentinel_playground_wasm.js +486 -0
- package/docs/themes/tanuki/static/wasm/sentinel_playground_wasm_bg.wasm +0 -0
- package/docs/themes/tanuki/templates/404.html +52 -0
- package/docs/themes/tanuki/templates/base.html +428 -0
- package/docs/themes/tanuki/templates/blog.html +66 -0
- package/docs/themes/tanuki/templates/home.html +108 -0
- package/docs/themes/tanuki/templates/index.html +178 -0
- package/docs/themes/tanuki/templates/landing.html +168 -0
- package/docs/themes/tanuki/templates/macros/nav.html +128 -0
- package/docs/themes/tanuki/templates/macros/posts.html +101 -0
- package/docs/themes/tanuki/templates/macros/ui.html +159 -0
- package/docs/themes/tanuki/templates/page.html +135 -0
- package/docs/themes/tanuki/templates/partials/footer.html +38 -0
- package/docs/themes/tanuki/templates/partials/header.html +366 -0
- package/docs/themes/tanuki/templates/partials/nav-buttons.html +55 -0
- package/docs/themes/tanuki/templates/partials/nav-overlay.html +81 -0
- package/docs/themes/tanuki/templates/partials/page-toc-panel.html +43 -0
- package/docs/themes/tanuki/templates/partials/search.html +52 -0
- package/docs/themes/tanuki/templates/partials/sidebar.html +107 -0
- package/docs/themes/tanuki/templates/partials/theme-toggle.html +35 -0
- package/docs/themes/tanuki/templates/partials/toc-overlay.html +146 -0
- package/docs/themes/tanuki/templates/partials/version-picker.html +38 -0
- package/docs/themes/tanuki/templates/print.html +244 -0
- package/docs/themes/tanuki/templates/section.html +186 -0
- package/docs/themes/tanuki/templates/taxonomy_list.html +18 -0
- package/docs/themes/tanuki/templates/taxonomy_single.html +31 -0
- package/docs/themes/tanuki/theme.toml +58 -0
- package/examples/hello-agent.rs +55 -0
- package/package.json +36 -0
- package/proto/config.proto +60 -0
- package/proto/events.proto +0 -0
- package/proto/runtime.proto +215 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Quick test script for ENACT_* environment variable support
|
|
3
|
+
|
|
4
|
+
echo "=== Testing ENACT_* Environment Variable Support ==="
|
|
5
|
+
echo ""
|
|
6
|
+
|
|
7
|
+
# Test 1: Run unit tests
|
|
8
|
+
echo "1. Running unit tests..."
|
|
9
|
+
cargo test -p enact-config keychain::tests --lib
|
|
10
|
+
echo ""
|
|
11
|
+
|
|
12
|
+
# Test 2: Test with environment variable set inline
|
|
13
|
+
echo "2. Testing with inline environment variable..."
|
|
14
|
+
ENACT_PROVIDERS_AZURE_APIKEY=test-key-from-env cargo test -p enact-config keychain::tests::test_get_from_env_var --lib -- --nocapture
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
# Test 3: Test the example program
|
|
18
|
+
echo "3. Running example program (without env vars)..."
|
|
19
|
+
cargo run --example test-env-vars 2>/dev/null || echo " (This will show env vars are not set)"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
echo "4. Running example program (with env vars)..."
|
|
23
|
+
ENACT_PROVIDERS_AZURE_APIKEY=my-azure-key \
|
|
24
|
+
ENACT_PROVIDERS_ANTHROPIC_APIKEY=my-anthropic-key \
|
|
25
|
+
ENACT_PROVIDERS_OPENAI_APIKEY=my-openai-key \
|
|
26
|
+
cargo run --example test-env-vars
|
|
27
|
+
echo ""
|
|
28
|
+
|
|
29
|
+
echo "=== Test Complete ==="
|
|
30
|
+
echo ""
|
|
31
|
+
echo "To test manually:"
|
|
32
|
+
echo " export ENACT_PROVIDERS_AZURE_APIKEY=your-key"
|
|
33
|
+
echo " cargo run --example test-env-vars"
|
|
34
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Config Management Tests
|
|
2
|
+
|
|
3
|
+
This directory contains comprehensive tests for the config management system.
|
|
4
|
+
|
|
5
|
+
## Test Structure
|
|
6
|
+
|
|
7
|
+
### Unit Tests (in `src/`)
|
|
8
|
+
- `lib.rs` - Basic config manager tests
|
|
9
|
+
- `keychain.rs` - Keychain operation tests
|
|
10
|
+
- `encrypted_store.rs` - Encryption/decryption tests
|
|
11
|
+
|
|
12
|
+
### Integration Tests (in `tests/`)
|
|
13
|
+
- `config_integration_test.rs` - End-to-end config lifecycle tests
|
|
14
|
+
- `security_test.rs` - Security and encryption tests
|
|
15
|
+
|
|
16
|
+
## Running Tests
|
|
17
|
+
|
|
18
|
+
### All Tests
|
|
19
|
+
```bash
|
|
20
|
+
cd crates/enact-config
|
|
21
|
+
cargo test
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Specific Test Suite
|
|
25
|
+
```bash
|
|
26
|
+
# Integration tests only
|
|
27
|
+
cargo test --test config_integration_test
|
|
28
|
+
|
|
29
|
+
# Security tests only
|
|
30
|
+
cargo test --test security_test
|
|
31
|
+
|
|
32
|
+
# With output
|
|
33
|
+
cargo test -- --nocapture
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Test Coverage
|
|
37
|
+
```bash
|
|
38
|
+
# Install cargo-tarpaulin if not already installed
|
|
39
|
+
cargo install cargo-tarpaulin
|
|
40
|
+
|
|
41
|
+
# Run with coverage
|
|
42
|
+
cargo tarpaulin --out Html
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Test Categories
|
|
46
|
+
|
|
47
|
+
### 1. Config Lifecycle Tests
|
|
48
|
+
- Default config creation
|
|
49
|
+
- Save and load operations
|
|
50
|
+
- Config persistence across restarts
|
|
51
|
+
- Runtime mode transitions
|
|
52
|
+
|
|
53
|
+
### 2. Secret Management Tests
|
|
54
|
+
- Secret storage in keychain
|
|
55
|
+
- Secret retrieval
|
|
56
|
+
- Secret deletion
|
|
57
|
+
- Secret isolation (not in config file)
|
|
58
|
+
|
|
59
|
+
### 3. Storage Backend Tests
|
|
60
|
+
- Event store configuration
|
|
61
|
+
- State store configuration
|
|
62
|
+
- Vector store configuration (SQLite/Qdrant)
|
|
63
|
+
- Artifact store configuration
|
|
64
|
+
|
|
65
|
+
### 4. Tools Configuration Tests
|
|
66
|
+
- PDF engine selection
|
|
67
|
+
- OCR engine selection
|
|
68
|
+
- Embeddings engine selection
|
|
69
|
+
- Language configuration
|
|
70
|
+
|
|
71
|
+
### 5. Air-Gapped Mode Tests
|
|
72
|
+
- Sync disabled in air-gapped mode
|
|
73
|
+
- Network blocking enforcement
|
|
74
|
+
- Local-only feature availability
|
|
75
|
+
|
|
76
|
+
### 6. Security Tests
|
|
77
|
+
- Encryption verification (no plaintext in files)
|
|
78
|
+
- Secret isolation (secrets not in config file)
|
|
79
|
+
- Multiple secrets isolation
|
|
80
|
+
- Encryption key management
|
|
81
|
+
|
|
82
|
+
### 7. Sync Tests
|
|
83
|
+
- Sync status computation
|
|
84
|
+
- Sync enabled/disabled logic
|
|
85
|
+
- Air-gapped mode sync blocking
|
|
86
|
+
|
|
87
|
+
## Test Environment
|
|
88
|
+
|
|
89
|
+
Tests use `tempfile` for isolated test directories and don't require:
|
|
90
|
+
- Real keychain access (uses test keychain)
|
|
91
|
+
- Network connectivity
|
|
92
|
+
- Database connections
|
|
93
|
+
|
|
94
|
+
## Known Limitations
|
|
95
|
+
|
|
96
|
+
- Keychain tests may require user interaction on some platforms
|
|
97
|
+
- Some tests may need to be run with appropriate permissions
|
|
98
|
+
- Integration tests with cloud sync require mock HTTP server
|
|
99
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
//! Integration tests for config management
|
|
2
|
+
|
|
3
|
+
use enact_config::{Config, ConfigManager, RuntimeMode, SyncManager, SyncStatus};
|
|
4
|
+
use std::sync::Once;
|
|
5
|
+
use tempfile::TempDir;
|
|
6
|
+
|
|
7
|
+
fn use_mock_secrets() {
|
|
8
|
+
static INIT: Once = Once::new();
|
|
9
|
+
INIT.call_once(|| {
|
|
10
|
+
std::env::set_var("ENACT_USE_MOCK_SECRET_STORE", "1");
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#[tokio::test]
|
|
15
|
+
async fn test_config_lifecycle() {
|
|
16
|
+
use_mock_secrets();
|
|
17
|
+
let temp_dir = TempDir::new().unwrap();
|
|
18
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
19
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
20
|
+
|
|
21
|
+
// Test default config
|
|
22
|
+
let config = manager.load().await.unwrap();
|
|
23
|
+
assert_eq!(config.runtime.mode, RuntimeMode::Local);
|
|
24
|
+
assert_eq!(config.runtime.max_concurrent_executions, 10);
|
|
25
|
+
assert!(config.runtime.enable_telemetry);
|
|
26
|
+
|
|
27
|
+
// Test save and load
|
|
28
|
+
let mut config = Config::default();
|
|
29
|
+
config.runtime.mode = RuntimeMode::AirGapped;
|
|
30
|
+
config.runtime.allow_network = false;
|
|
31
|
+
config.storage.vector_store.r#type = "qdrant".to_string();
|
|
32
|
+
manager.save(&config).await.unwrap();
|
|
33
|
+
|
|
34
|
+
let loaded = manager.load().await.unwrap();
|
|
35
|
+
assert_eq!(loaded.runtime.mode, RuntimeMode::AirGapped);
|
|
36
|
+
assert!(!loaded.runtime.allow_network);
|
|
37
|
+
assert_eq!(loaded.storage.vector_store.r#type, "qdrant");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#[tokio::test]
|
|
41
|
+
async fn test_secret_management() {
|
|
42
|
+
use_mock_secrets();
|
|
43
|
+
let temp_dir = TempDir::new().unwrap();
|
|
44
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
45
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
46
|
+
|
|
47
|
+
// Test set and get secret
|
|
48
|
+
manager
|
|
49
|
+
.set_secret("providers.azure.apiKey", "test-key-123")
|
|
50
|
+
.await
|
|
51
|
+
.unwrap();
|
|
52
|
+
let value = manager.get_secret("providers.azure.apiKey").await.unwrap();
|
|
53
|
+
assert_eq!(value, Some("test-key-123".to_string()));
|
|
54
|
+
|
|
55
|
+
// Test delete
|
|
56
|
+
manager
|
|
57
|
+
.delete_secret("providers.azure.apiKey")
|
|
58
|
+
.await
|
|
59
|
+
.unwrap();
|
|
60
|
+
let value = manager.get_secret("providers.azure.apiKey").await.unwrap();
|
|
61
|
+
assert_eq!(value, None);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#[tokio::test]
|
|
65
|
+
async fn test_airgapped_mode_sync_disabled() {
|
|
66
|
+
use_mock_secrets();
|
|
67
|
+
let temp_dir = TempDir::new().unwrap();
|
|
68
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
69
|
+
let manager = ConfigManager::with_sync(
|
|
70
|
+
&config_path,
|
|
71
|
+
Some("https://api.example.com".to_string()),
|
|
72
|
+
Some("tenant-123".to_string()),
|
|
73
|
+
true, // auto_sync enabled
|
|
74
|
+
RuntimeMode::AirGapped, // but air-gapped mode
|
|
75
|
+
)
|
|
76
|
+
.await
|
|
77
|
+
.unwrap();
|
|
78
|
+
|
|
79
|
+
// Sync should be disabled in air-gapped mode
|
|
80
|
+
assert_eq!(manager.sync_status(), SyncStatus::Disabled);
|
|
81
|
+
|
|
82
|
+
let config = manager.load().await.unwrap();
|
|
83
|
+
assert_eq!(config.runtime.mode, RuntimeMode::AirGapped);
|
|
84
|
+
|
|
85
|
+
// Attempting sync should return None (disabled)
|
|
86
|
+
let result = manager.sync_to_cloud(&config).await.unwrap();
|
|
87
|
+
assert_eq!(result, None);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#[tokio::test]
|
|
91
|
+
async fn test_storage_config_persistence() {
|
|
92
|
+
use_mock_secrets();
|
|
93
|
+
let temp_dir = TempDir::new().unwrap();
|
|
94
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
95
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
96
|
+
|
|
97
|
+
let mut config = manager.load().await.unwrap();
|
|
98
|
+
|
|
99
|
+
// Set storage backends
|
|
100
|
+
config.storage.event_store.r#type = "postgres".to_string();
|
|
101
|
+
config.storage.event_store.dsn = Some("postgres://localhost/enact".to_string());
|
|
102
|
+
config.storage.vector_store.r#type = "qdrant".to_string();
|
|
103
|
+
config.storage.vector_store.url = Some("http://localhost:6333".to_string());
|
|
104
|
+
config.storage.artifact_store.compression = "zstd".to_string();
|
|
105
|
+
|
|
106
|
+
manager.save(&config).await.unwrap();
|
|
107
|
+
|
|
108
|
+
// Reload and verify
|
|
109
|
+
let loaded = manager.load().await.unwrap();
|
|
110
|
+
assert_eq!(loaded.storage.event_store.r#type, "postgres");
|
|
111
|
+
assert_eq!(
|
|
112
|
+
loaded.storage.event_store.dsn,
|
|
113
|
+
Some("postgres://localhost/enact".to_string())
|
|
114
|
+
);
|
|
115
|
+
assert_eq!(loaded.storage.vector_store.r#type, "qdrant");
|
|
116
|
+
assert_eq!(
|
|
117
|
+
loaded.storage.vector_store.url,
|
|
118
|
+
Some("http://localhost:6333".to_string())
|
|
119
|
+
);
|
|
120
|
+
assert_eq!(loaded.storage.artifact_store.compression, "zstd");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#[tokio::test]
|
|
124
|
+
async fn test_tools_config_persistence() {
|
|
125
|
+
use_mock_secrets();
|
|
126
|
+
let temp_dir = TempDir::new().unwrap();
|
|
127
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
128
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
129
|
+
|
|
130
|
+
let mut config = manager.load().await.unwrap();
|
|
131
|
+
|
|
132
|
+
// Set ingestion tools
|
|
133
|
+
config.tools.ingestion.pdf.engine = "poppler".to_string();
|
|
134
|
+
config.tools.ingestion.ocr.engine = "paddle".to_string();
|
|
135
|
+
config.tools.ingestion.ocr.languages = vec!["eng".to_string(), "fra".to_string()];
|
|
136
|
+
config.tools.ingestion.embeddings.engine = "openai".to_string();
|
|
137
|
+
config.tools.ingestion.embeddings.model = Some("text-embedding-3-small".to_string());
|
|
138
|
+
|
|
139
|
+
manager.save(&config).await.unwrap();
|
|
140
|
+
|
|
141
|
+
// Reload and verify
|
|
142
|
+
let loaded = manager.load().await.unwrap();
|
|
143
|
+
assert_eq!(loaded.tools.ingestion.pdf.engine, "poppler");
|
|
144
|
+
assert_eq!(loaded.tools.ingestion.ocr.engine, "paddle");
|
|
145
|
+
assert_eq!(loaded.tools.ingestion.ocr.languages.len(), 2);
|
|
146
|
+
assert_eq!(loaded.tools.ingestion.embeddings.engine, "openai");
|
|
147
|
+
assert_eq!(
|
|
148
|
+
loaded.tools.ingestion.embeddings.model,
|
|
149
|
+
Some("text-embedding-3-small".to_string())
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#[tokio::test]
|
|
154
|
+
async fn test_runtime_mode_transitions() {
|
|
155
|
+
use_mock_secrets();
|
|
156
|
+
let temp_dir = TempDir::new().unwrap();
|
|
157
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
158
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
159
|
+
|
|
160
|
+
// Test all runtime modes
|
|
161
|
+
for mode in [
|
|
162
|
+
RuntimeMode::Local,
|
|
163
|
+
RuntimeMode::AirGapped,
|
|
164
|
+
RuntimeMode::Cloud,
|
|
165
|
+
] {
|
|
166
|
+
let mut config = manager.load().await.unwrap();
|
|
167
|
+
config.runtime.mode = mode;
|
|
168
|
+
manager.save(&config).await.unwrap();
|
|
169
|
+
|
|
170
|
+
let loaded = manager.load().await.unwrap();
|
|
171
|
+
assert_eq!(loaded.runtime.mode, mode);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#[tokio::test]
|
|
176
|
+
async fn test_sync_manager_status() {
|
|
177
|
+
use_mock_secrets();
|
|
178
|
+
// Test sync enabled
|
|
179
|
+
let sync_enabled = SyncManager::new(
|
|
180
|
+
Some("https://api.example.com".to_string()),
|
|
181
|
+
Some("tenant-123".to_string()),
|
|
182
|
+
true,
|
|
183
|
+
RuntimeMode::Local,
|
|
184
|
+
);
|
|
185
|
+
assert!(sync_enabled.is_enabled());
|
|
186
|
+
assert_eq!(sync_enabled.status(), SyncStatus::Enabled);
|
|
187
|
+
|
|
188
|
+
// Test sync disabled - air-gapped
|
|
189
|
+
let sync_airgapped = SyncManager::new(
|
|
190
|
+
Some("https://api.example.com".to_string()),
|
|
191
|
+
Some("tenant-123".to_string()),
|
|
192
|
+
true,
|
|
193
|
+
RuntimeMode::AirGapped,
|
|
194
|
+
);
|
|
195
|
+
assert!(!sync_airgapped.is_enabled());
|
|
196
|
+
assert_eq!(sync_airgapped.status(), SyncStatus::Disabled);
|
|
197
|
+
|
|
198
|
+
// Test sync disabled - no auth
|
|
199
|
+
let sync_no_auth = SyncManager::new(None, None, true, RuntimeMode::Local);
|
|
200
|
+
assert!(!sync_no_auth.is_enabled());
|
|
201
|
+
assert_eq!(sync_no_auth.status(), SyncStatus::Disabled);
|
|
202
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
//! Security tests for config management
|
|
2
|
+
|
|
3
|
+
use enact_config::{ConfigManager, RuntimeMode};
|
|
4
|
+
use std::sync::Once;
|
|
5
|
+
use tempfile::TempDir;
|
|
6
|
+
|
|
7
|
+
fn use_mock_secrets() {
|
|
8
|
+
static INIT: Once = Once::new();
|
|
9
|
+
INIT.call_once(|| {
|
|
10
|
+
std::env::set_var("ENACT_USE_MOCK_SECRET_STORE", "1");
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#[tokio::test]
|
|
15
|
+
async fn test_encryption_persistence() {
|
|
16
|
+
use_mock_secrets();
|
|
17
|
+
let temp_dir = TempDir::new().unwrap();
|
|
18
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
19
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
20
|
+
|
|
21
|
+
let mut config = manager.load().await.unwrap();
|
|
22
|
+
config.runtime.mode = RuntimeMode::AirGapped;
|
|
23
|
+
config.storage.vector_store.r#type = "qdrant".to_string();
|
|
24
|
+
manager.save(&config).await.unwrap();
|
|
25
|
+
|
|
26
|
+
// Verify file is encrypted (should not contain plaintext)
|
|
27
|
+
let file_contents = std::fs::read_to_string(manager.config_path()).unwrap();
|
|
28
|
+
assert!(!file_contents.contains("airgapped"));
|
|
29
|
+
assert!(!file_contents.contains("qdrant"));
|
|
30
|
+
assert!(file_contents.contains("nonce") || file_contents.contains("ciphertext"));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#[tokio::test]
|
|
34
|
+
async fn test_secret_isolation() {
|
|
35
|
+
use_mock_secrets();
|
|
36
|
+
let temp_dir = TempDir::new().unwrap();
|
|
37
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
38
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
39
|
+
|
|
40
|
+
// Set a secret
|
|
41
|
+
let secret_value = "super-secret-api-key-12345";
|
|
42
|
+
manager
|
|
43
|
+
.set_secret("providers.azure.apiKey", secret_value)
|
|
44
|
+
.await
|
|
45
|
+
.unwrap();
|
|
46
|
+
|
|
47
|
+
// Verify secret is NOT in the encrypted config file
|
|
48
|
+
let config = manager.load().await.unwrap();
|
|
49
|
+
let config_json = serde_json::to_string(&config).unwrap();
|
|
50
|
+
assert!(!config_json.contains(secret_value));
|
|
51
|
+
|
|
52
|
+
// Verify we can still retrieve it from keychain
|
|
53
|
+
let retrieved = manager.get_secret("providers.azure.apiKey").await.unwrap();
|
|
54
|
+
assert_eq!(retrieved, Some(secret_value.to_string()));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
#[tokio::test]
|
|
58
|
+
async fn test_airgapped_network_blocking() {
|
|
59
|
+
use_mock_secrets();
|
|
60
|
+
let temp_dir = TempDir::new().unwrap();
|
|
61
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
62
|
+
|
|
63
|
+
// Create manager with sync enabled but air-gapped mode
|
|
64
|
+
let manager = ConfigManager::with_sync(
|
|
65
|
+
&config_path,
|
|
66
|
+
Some("https://api.example.com".to_string()),
|
|
67
|
+
Some("tenant-123".to_string()),
|
|
68
|
+
true,
|
|
69
|
+
RuntimeMode::AirGapped,
|
|
70
|
+
)
|
|
71
|
+
.await
|
|
72
|
+
.unwrap();
|
|
73
|
+
|
|
74
|
+
let config = manager.load().await.unwrap();
|
|
75
|
+
assert_eq!(config.runtime.mode, RuntimeMode::AirGapped);
|
|
76
|
+
assert!(!config.runtime.allow_network);
|
|
77
|
+
|
|
78
|
+
// Sync should be disabled
|
|
79
|
+
assert_eq!(manager.sync_status(), enact_config::SyncStatus::Disabled);
|
|
80
|
+
|
|
81
|
+
// Attempting sync should not make network calls
|
|
82
|
+
let result = manager.sync_to_cloud(&config).await.unwrap();
|
|
83
|
+
assert_eq!(result, None);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#[tokio::test]
|
|
87
|
+
async fn test_multiple_secrets_isolation() {
|
|
88
|
+
use_mock_secrets();
|
|
89
|
+
let temp_dir = TempDir::new().unwrap();
|
|
90
|
+
let config_path = temp_dir.path().join("test_config.encrypted");
|
|
91
|
+
let manager = ConfigManager::new(&config_path).await.unwrap();
|
|
92
|
+
|
|
93
|
+
// Set multiple secrets
|
|
94
|
+
manager
|
|
95
|
+
.set_secret("providers.azure.apiKey", "azure-key-123")
|
|
96
|
+
.await
|
|
97
|
+
.unwrap();
|
|
98
|
+
manager
|
|
99
|
+
.set_secret("providers.anthropic.apiKey", "anthropic-key-456")
|
|
100
|
+
.await
|
|
101
|
+
.unwrap();
|
|
102
|
+
manager
|
|
103
|
+
.set_secret("providers.openai.apiKey", "openai-key-789")
|
|
104
|
+
.await
|
|
105
|
+
.unwrap();
|
|
106
|
+
|
|
107
|
+
// Verify each secret is isolated
|
|
108
|
+
assert_eq!(
|
|
109
|
+
manager.get_secret("providers.azure.apiKey").await.unwrap(),
|
|
110
|
+
Some("azure-key-123".to_string())
|
|
111
|
+
);
|
|
112
|
+
assert_eq!(
|
|
113
|
+
manager
|
|
114
|
+
.get_secret("providers.anthropic.apiKey")
|
|
115
|
+
.await
|
|
116
|
+
.unwrap(),
|
|
117
|
+
Some("anthropic-key-456".to_string())
|
|
118
|
+
);
|
|
119
|
+
assert_eq!(
|
|
120
|
+
manager.get_secret("providers.openai.apiKey").await.unwrap(),
|
|
121
|
+
Some("openai-key-789".to_string())
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
// Delete one and verify others remain
|
|
125
|
+
manager
|
|
126
|
+
.delete_secret("providers.azure.apiKey")
|
|
127
|
+
.await
|
|
128
|
+
.unwrap();
|
|
129
|
+
assert_eq!(
|
|
130
|
+
manager.get_secret("providers.azure.apiKey").await.unwrap(),
|
|
131
|
+
None
|
|
132
|
+
);
|
|
133
|
+
assert_eq!(
|
|
134
|
+
manager
|
|
135
|
+
.get_secret("providers.anthropic.apiKey")
|
|
136
|
+
.await
|
|
137
|
+
.unwrap(),
|
|
138
|
+
Some("anthropic-key-456".to_string())
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "enact-context"
|
|
3
|
+
version.workspace = true
|
|
4
|
+
edition.workspace = true
|
|
5
|
+
license.workspace = true
|
|
6
|
+
description = "Context window management and compaction for Enact"
|
|
7
|
+
repository.workspace = true
|
|
8
|
+
homepage.workspace = true
|
|
9
|
+
keywords = ["context", "token", "compaction", "window"]
|
|
10
|
+
categories.workspace = true
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
# Core dependencies
|
|
14
|
+
enact-core = { workspace = true }
|
|
15
|
+
|
|
16
|
+
# Async runtime
|
|
17
|
+
tokio.workspace = true
|
|
18
|
+
async-trait.workspace = true
|
|
19
|
+
|
|
20
|
+
# Serialization
|
|
21
|
+
serde.workspace = true
|
|
22
|
+
serde_json.workspace = true
|
|
23
|
+
|
|
24
|
+
# Token counting
|
|
25
|
+
tiktoken-rs.workspace = true
|
|
26
|
+
|
|
27
|
+
# Error handling
|
|
28
|
+
thiserror.workspace = true
|
|
29
|
+
anyhow.workspace = true
|
|
30
|
+
|
|
31
|
+
# Tracing
|
|
32
|
+
tracing.workspace = true
|
|
33
|
+
|
|
34
|
+
# Time
|
|
35
|
+
chrono.workspace = true
|
|
36
|
+
|
|
37
|
+
# UUID
|
|
38
|
+
uuid.workspace = true
|
|
39
|
+
|
|
40
|
+
[dev-dependencies]
|
|
41
|
+
tokio = { workspace = true, features = ["test-util"] }
|