airlock-bot 0.3.2 → 0.4.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/README.md +46 -33
- package/airlock.service +1 -0
- package/dist/airlock/context.d.ts.map +1 -1
- package/dist/airlock/context.js +5 -3
- package/dist/airlock/context.js.map +1 -1
- package/dist/airlock/tools.d.ts +8 -4
- package/dist/airlock/tools.d.ts.map +1 -1
- package/dist/airlock/tools.js +14 -3
- package/dist/airlock/tools.js.map +1 -1
- package/dist/allowlist/engine.d.ts +3 -0
- package/dist/allowlist/engine.d.ts.map +1 -1
- package/dist/allowlist/engine.js +32 -3
- package/dist/allowlist/engine.js.map +1 -1
- package/dist/audit/db.d.ts +0 -1
- package/dist/audit/db.d.ts.map +1 -1
- package/dist/audit/db.js +9 -7
- package/dist/audit/db.js.map +1 -1
- package/dist/audit/logger.d.ts +0 -1
- package/dist/audit/logger.d.ts.map +1 -1
- package/dist/audit/logger.js +0 -3
- package/dist/audit/logger.js.map +1 -1
- package/dist/audit/redactor.d.ts.map +1 -1
- package/dist/audit/redactor.js +6 -6
- package/dist/audit/redactor.js.map +1 -1
- package/dist/backend/airlock-adapter.d.ts +10 -1
- package/dist/backend/airlock-adapter.d.ts.map +1 -1
- package/dist/backend/airlock-adapter.js +219 -6
- package/dist/backend/airlock-adapter.js.map +1 -1
- package/dist/backend/cli/adapter.d.ts +4 -2
- package/dist/backend/cli/adapter.d.ts.map +1 -1
- package/dist/backend/cli/adapter.js +36 -11
- package/dist/backend/cli/adapter.js.map +1 -1
- package/dist/backend/cli/builder.d.ts +1 -1
- package/dist/backend/cli/builder.d.ts.map +1 -1
- package/dist/backend/cli/builder.js +28 -12
- package/dist/backend/cli/builder.js.map +1 -1
- package/dist/backend/exec-adapter.d.ts +1 -1
- package/dist/backend/exec-adapter.d.ts.map +1 -1
- package/dist/backend/exec-adapter.js +1 -5
- package/dist/backend/exec-adapter.js.map +1 -1
- package/dist/backend/factory.d.ts +2 -0
- package/dist/backend/factory.d.ts.map +1 -1
- package/dist/backend/factory.js +17 -9
- package/dist/backend/factory.js.map +1 -1
- package/dist/backend/http-adapter.d.ts +6 -3
- package/dist/backend/http-adapter.d.ts.map +1 -1
- package/dist/backend/http-adapter.js +24 -10
- package/dist/backend/http-adapter.js.map +1 -1
- package/dist/backend/mcp-adapter.d.ts +7 -2
- package/dist/backend/mcp-adapter.d.ts.map +1 -1
- package/dist/backend/mcp-adapter.js +74 -16
- package/dist/backend/mcp-adapter.js.map +1 -1
- package/dist/backend/openapi/adapter.d.ts +8 -2
- package/dist/backend/openapi/adapter.d.ts.map +1 -1
- package/dist/backend/openapi/adapter.js +196 -17
- package/dist/backend/openapi/adapter.js.map +1 -1
- package/dist/backend/openapi/parser.d.ts +15 -1
- package/dist/backend/openapi/parser.d.ts.map +1 -1
- package/dist/backend/openapi/parser.js +153 -11
- package/dist/backend/openapi/parser.js.map +1 -1
- package/dist/backend/types.d.ts +12 -1
- package/dist/backend/types.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +334 -50
- package/dist/config/loader.js.map +1 -1
- package/dist/config/mutator.d.ts.map +1 -1
- package/dist/config/mutator.js +13 -3
- package/dist/config/mutator.js.map +1 -1
- package/dist/config/profiles.d.ts +2 -1
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +50 -2
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/provider-credentials.d.ts +4 -0
- package/dist/config/provider-credentials.d.ts.map +1 -0
- package/dist/config/provider-credentials.js +48 -0
- package/dist/config/provider-credentials.js.map +1 -0
- package/dist/config/schema.d.ts +2795 -8776
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +294 -122
- package/dist/config/schema.js.map +1 -1
- package/dist/config/watcher.d.ts.map +1 -1
- package/dist/config/watcher.js +3 -0
- package/dist/config/watcher.js.map +1 -1
- package/dist/config/yaml-merge.d.ts +9 -0
- package/dist/config/yaml-merge.d.ts.map +1 -0
- package/dist/config/yaml-merge.js +54 -0
- package/dist/config/yaml-merge.js.map +1 -0
- package/dist/configure-agent/cli.d.ts +26 -0
- package/dist/configure-agent/cli.d.ts.map +1 -1
- package/dist/configure-agent/cli.js +70 -35
- package/dist/configure-agent/cli.js.map +1 -1
- package/dist/configure-cli/cli.d.ts +6 -0
- package/dist/configure-cli/cli.d.ts.map +1 -1
- package/dist/configure-cli/cli.js +45 -14
- package/dist/configure-cli/cli.js.map +1 -1
- package/dist/configure-web/assistant.d.ts +49 -0
- package/dist/configure-web/assistant.d.ts.map +1 -0
- package/dist/configure-web/assistant.js +312 -0
- package/dist/configure-web/assistant.js.map +1 -0
- package/dist/configure-web/changes.d.ts +214 -0
- package/dist/configure-web/changes.d.ts.map +1 -0
- package/dist/configure-web/changes.js +317 -0
- package/dist/configure-web/changes.js.map +1 -0
- package/dist/configure-web/cli.d.ts +33 -11
- package/dist/configure-web/cli.d.ts.map +1 -1
- package/dist/configure-web/cli.js +704 -151
- package/dist/configure-web/cli.js.map +1 -1
- package/dist/discover/cli.js +2 -2
- package/dist/discover/cli.js.map +1 -1
- package/dist/discover/index.d.ts.map +1 -1
- package/dist/discover/index.js +16 -22
- package/dist/discover/index.js.map +1 -1
- package/dist/discover/openapi.d.ts.map +1 -1
- package/dist/discover/openapi.js +2 -0
- package/dist/discover/openapi.js.map +1 -1
- package/dist/discover/strategies/completion.d.ts.map +1 -1
- package/dist/discover/strategies/completion.js +19 -2
- package/dist/discover/strategies/completion.js.map +1 -1
- package/dist/discover/strategies/fig.d.ts +10 -1
- package/dist/discover/strategies/fig.d.ts.map +1 -1
- package/dist/discover/strategies/fig.js +24 -10
- package/dist/discover/strategies/fig.js.map +1 -1
- package/dist/discover/strategies/help-parser.d.ts.map +1 -1
- package/dist/discover/strategies/help-parser.js +9 -6
- package/dist/discover/strategies/help-parser.js.map +1 -1
- package/dist/events/payload-inspector.d.ts +25 -0
- package/dist/events/payload-inspector.d.ts.map +1 -0
- package/dist/events/payload-inspector.js +210 -0
- package/dist/events/payload-inspector.js.map +1 -0
- package/dist/events/protocol.d.ts +227 -0
- package/dist/events/protocol.d.ts.map +1 -0
- package/dist/events/protocol.js +422 -0
- package/dist/events/protocol.js.map +1 -0
- package/dist/events/registry.d.ts +57 -0
- package/dist/events/registry.d.ts.map +1 -0
- package/dist/events/registry.js +179 -0
- package/dist/events/registry.js.map +1 -0
- package/dist/events/schema-validator.d.ts +13 -0
- package/dist/events/schema-validator.d.ts.map +1 -0
- package/dist/events/schema-validator.js +54 -0
- package/dist/events/schema-validator.js.map +1 -0
- package/dist/events/service.d.ts +97 -0
- package/dist/events/service.d.ts.map +1 -0
- package/dist/events/service.js +918 -0
- package/dist/events/service.js.map +1 -0
- package/dist/events/stream-manager.d.ts +58 -0
- package/dist/events/stream-manager.d.ts.map +1 -0
- package/dist/events/stream-manager.js +94 -0
- package/dist/events/stream-manager.js.map +1 -0
- package/dist/events/upstream-client.d.ts +88 -0
- package/dist/events/upstream-client.d.ts.map +1 -0
- package/dist/events/upstream-client.js +437 -0
- package/dist/events/upstream-client.js.map +1 -0
- package/dist/gateway.d.ts +14 -0
- package/dist/gateway.d.ts.map +1 -1
- package/dist/gateway.js +197 -24
- package/dist/gateway.js.map +1 -1
- package/dist/hitl/approval-dashboard.d.ts +4 -0
- package/dist/hitl/approval-dashboard.d.ts.map +1 -1
- package/dist/hitl/approval-dashboard.js +62 -21
- package/dist/hitl/approval-dashboard.js.map +1 -1
- package/dist/hitl/approval-stream.d.ts +2 -0
- package/dist/hitl/approval-stream.d.ts.map +1 -1
- package/dist/hitl/approval-stream.js +10 -0
- package/dist/hitl/approval-stream.js.map +1 -1
- package/dist/hitl/engine.d.ts +18 -0
- package/dist/hitl/engine.d.ts.map +1 -1
- package/dist/hitl/engine.js +78 -27
- package/dist/hitl/engine.js.map +1 -1
- package/dist/hitl/formatter.d.ts.map +1 -1
- package/dist/hitl/formatter.js +6 -2
- package/dist/hitl/formatter.js.map +1 -1
- package/dist/hitl/grants.d.ts +8 -1
- package/dist/hitl/grants.d.ts.map +1 -1
- package/dist/hitl/grants.js +25 -4
- package/dist/hitl/grants.js.map +1 -1
- package/dist/hitl/parser.d.ts.map +1 -1
- package/dist/hitl/parser.js +6 -2
- package/dist/hitl/parser.js.map +1 -1
- package/dist/hitl/provider-factory.js +6 -1
- package/dist/hitl/provider-factory.js.map +1 -1
- package/dist/hitl/providers/composite.d.ts +0 -1
- package/dist/hitl/providers/composite.d.ts.map +1 -1
- package/dist/hitl/providers/composite.js +0 -3
- package/dist/hitl/providers/composite.js.map +1 -1
- package/dist/hitl/providers/dashboard.d.ts +1 -0
- package/dist/hitl/providers/dashboard.d.ts.map +1 -1
- package/dist/hitl/providers/dashboard.js +9 -2
- package/dist/hitl/providers/dashboard.js.map +1 -1
- package/dist/hitl/providers/ios.d.ts +0 -1
- package/dist/hitl/providers/ios.d.ts.map +1 -1
- package/dist/hitl/providers/ios.js +14 -27
- package/dist/hitl/providers/ios.js.map +1 -1
- package/dist/hitl/providers/macos.d.ts.map +1 -1
- package/dist/hitl/providers/macos.js +5 -0
- package/dist/hitl/providers/macos.js.map +1 -1
- package/dist/hitl/providers/telegram.d.ts.map +1 -1
- package/dist/hitl/providers/telegram.js +3 -1
- package/dist/hitl/providers/telegram.js.map +1 -1
- package/dist/hitl/providers/tui.d.ts +1 -1
- package/dist/hitl/providers/tui.d.ts.map +1 -1
- package/dist/hitl/providers/tui.js +56 -29
- package/dist/hitl/providers/tui.js.map +1 -1
- package/dist/hitl/providers/types.d.ts +11 -2
- package/dist/hitl/providers/types.d.ts.map +1 -1
- package/dist/hitl/runtime.js +1 -1
- package/dist/hitl/runtime.js.map +1 -1
- package/dist/hook/api.js +2 -1
- package/dist/hook/api.js.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/introspect/cli.d.ts.map +1 -1
- package/dist/introspect/cli.js +5 -2
- package/dist/introspect/cli.js.map +1 -1
- package/dist/mcp-apps/ui.d.ts +69 -0
- package/dist/mcp-apps/ui.d.ts.map +1 -0
- package/dist/mcp-apps/ui.js +143 -0
- package/dist/mcp-apps/ui.js.map +1 -0
- package/dist/middleware/audit-args.d.ts +7 -0
- package/dist/middleware/audit-args.d.ts.map +1 -0
- package/dist/middleware/audit-args.js +23 -0
- package/dist/middleware/audit-args.js.map +1 -0
- package/dist/middleware/chain-builder.d.ts +2 -2
- package/dist/middleware/chain-builder.d.ts.map +1 -1
- package/dist/middleware/chain-builder.js +7 -3
- package/dist/middleware/chain-builder.js.map +1 -1
- package/dist/middleware/core/allowlist.d.ts.map +1 -1
- package/dist/middleware/core/allowlist.js +4 -4
- package/dist/middleware/core/allowlist.js.map +1 -1
- package/dist/middleware/core/arg-policy.d.ts +1 -0
- package/dist/middleware/core/arg-policy.d.ts.map +1 -1
- package/dist/middleware/core/arg-policy.js +34 -37
- package/dist/middleware/core/arg-policy.js.map +1 -1
- package/dist/middleware/core/command-policy.d.ts +4 -1
- package/dist/middleware/core/command-policy.d.ts.map +1 -1
- package/dist/middleware/core/command-policy.js +50 -4
- package/dist/middleware/core/command-policy.js.map +1 -1
- package/dist/middleware/core/exec-policy.d.ts.map +1 -1
- package/dist/middleware/core/exec-policy.js +5 -5
- package/dist/middleware/core/exec-policy.js.map +1 -1
- package/dist/middleware/core/execute.d.ts +5 -1
- package/dist/middleware/core/execute.d.ts.map +1 -1
- package/dist/middleware/core/execute.js +18 -15
- package/dist/middleware/core/execute.js.map +1 -1
- package/dist/middleware/core/hitl-gate.d.ts.map +1 -1
- package/dist/middleware/core/hitl-gate.js +34 -16
- package/dist/middleware/core/hitl-gate.js.map +1 -1
- package/dist/middleware/core/rate-limiter.d.ts.map +1 -1
- package/dist/middleware/core/rate-limiter.js +23 -7
- package/dist/middleware/core/rate-limiter.js.map +1 -1
- package/dist/middleware/core/schema-validator.d.ts +3 -0
- package/dist/middleware/core/schema-validator.d.ts.map +1 -1
- package/dist/middleware/core/schema-validator.js +31 -12
- package/dist/middleware/core/schema-validator.js.map +1 -1
- package/dist/middleware/core/upload-policy.d.ts +18 -0
- package/dist/middleware/core/upload-policy.d.ts.map +1 -0
- package/dist/middleware/core/upload-policy.js +98 -0
- package/dist/middleware/core/upload-policy.js.map +1 -0
- package/dist/middleware/detectors/injection-detector.d.ts.map +1 -1
- package/dist/middleware/detectors/injection-detector.js +8 -6
- package/dist/middleware/detectors/injection-detector.js.map +1 -1
- package/dist/middleware/detectors/sensitivity-classifier.d.ts.map +1 -1
- package/dist/middleware/detectors/sensitivity-classifier.js +19 -5
- package/dist/middleware/detectors/sensitivity-classifier.js.map +1 -1
- package/dist/middleware/post/untrusted-envelope.d.ts.map +1 -1
- package/dist/middleware/post/untrusted-envelope.js +4 -1
- package/dist/middleware/post/untrusted-envelope.js.map +1 -1
- package/dist/middleware/response.d.ts +33 -0
- package/dist/middleware/response.d.ts.map +1 -0
- package/dist/middleware/response.js +110 -0
- package/dist/middleware/response.js.map +1 -0
- package/dist/middleware/types.d.ts +11 -0
- package/dist/middleware/types.d.ts.map +1 -1
- package/dist/mobile/api.d.ts.map +1 -1
- package/dist/mobile/api.js +25 -32
- package/dist/mobile/api.js.map +1 -1
- package/dist/mobile/apns.d.ts +2 -2
- package/dist/mobile/apns.d.ts.map +1 -1
- package/dist/mobile/apns.js +13 -60
- package/dist/mobile/apns.js.map +1 -1
- package/dist/pool/client-credentials.d.ts +2 -0
- package/dist/pool/client-credentials.d.ts.map +1 -1
- package/dist/pool/client-credentials.js +18 -3
- package/dist/pool/client-credentials.js.map +1 -1
- package/dist/pool/credential-health.d.ts +2 -2
- package/dist/pool/credential-health.d.ts.map +1 -1
- package/dist/pool/credential-health.js +7 -2
- package/dist/pool/credential-health.js.map +1 -1
- package/dist/pool/http-client.d.ts +105 -16
- package/dist/pool/http-client.d.ts.map +1 -1
- package/dist/pool/http-client.js +712 -116
- package/dist/pool/http-client.js.map +1 -1
- package/dist/pool/oauth-callback-router.d.ts +35 -0
- package/dist/pool/oauth-callback-router.d.ts.map +1 -0
- package/dist/pool/oauth-callback-router.js +84 -0
- package/dist/pool/oauth-callback-router.js.map +1 -0
- package/dist/pool/oauth-cli.d.ts +10 -0
- package/dist/pool/oauth-cli.d.ts.map +1 -0
- package/dist/pool/oauth-cli.js +318 -0
- package/dist/pool/oauth-cli.js.map +1 -0
- package/dist/pool/oauth-lock.d.ts +149 -0
- package/dist/pool/oauth-lock.d.ts.map +1 -0
- package/dist/pool/oauth-lock.js +575 -0
- package/dist/pool/oauth-lock.js.map +1 -0
- package/dist/pool/oauth-provider.d.ts +231 -27
- package/dist/pool/oauth-provider.d.ts.map +1 -1
- package/dist/pool/oauth-provider.js +802 -142
- package/dist/pool/oauth-provider.js.map +1 -1
- package/dist/pool/oauth-refresh.d.ts +94 -0
- package/dist/pool/oauth-refresh.d.ts.map +1 -0
- package/dist/pool/oauth-refresh.js +477 -0
- package/dist/pool/oauth-refresh.js.map +1 -0
- package/dist/pool/oauth-store.d.ts +304 -0
- package/dist/pool/oauth-store.d.ts.map +1 -0
- package/dist/pool/oauth-store.js +684 -0
- package/dist/pool/oauth-store.js.map +1 -0
- package/dist/pool/pool.d.ts +37 -4
- package/dist/pool/pool.d.ts.map +1 -1
- package/dist/pool/pool.js +170 -8
- package/dist/pool/pool.js.map +1 -1
- package/dist/pool/required-mcps.d.ts +7 -0
- package/dist/pool/required-mcps.d.ts.map +1 -1
- package/dist/pool/required-mcps.js +40 -2
- package/dist/pool/required-mcps.js.map +1 -1
- package/dist/pool/sse-client.d.ts +17 -3
- package/dist/pool/sse-client.d.ts.map +1 -1
- package/dist/pool/sse-client.js +59 -6
- package/dist/pool/sse-client.js.map +1 -1
- package/dist/pool/status.d.ts +53 -0
- package/dist/pool/status.d.ts.map +1 -1
- package/dist/pool/stdio-client.d.ts +23 -3
- package/dist/pool/stdio-client.d.ts.map +1 -1
- package/dist/pool/stdio-client.js +84 -6
- package/dist/pool/stdio-client.js.map +1 -1
- package/dist/registry/airlock-policy.d.ts +1 -1
- package/dist/registry/airlock-policy.d.ts.map +1 -1
- package/dist/registry/registry.d.ts +19 -2
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +161 -9
- package/dist/registry/registry.js.map +1 -1
- package/dist/registry/sanitizer.d.ts +5 -0
- package/dist/registry/sanitizer.d.ts.map +1 -1
- package/dist/registry/sanitizer.js +17 -13
- package/dist/registry/sanitizer.js.map +1 -1
- package/dist/security/request.d.ts +19 -0
- package/dist/security/request.d.ts.map +1 -1
- package/dist/security/request.js +35 -1
- package/dist/security/request.js.map +1 -1
- package/dist/stdio-mode.d.ts.map +1 -1
- package/dist/stdio-mode.js +229 -44
- package/dist/stdio-mode.js.map +1 -1
- package/dist/tools/api.d.ts.map +1 -1
- package/dist/tools/api.js +49 -15
- package/dist/tools/api.js.map +1 -1
- package/dist/tools/exec.d.ts +1 -1
- package/dist/tools/exec.d.ts.map +1 -1
- package/dist/tools/http.d.ts +7 -3
- package/dist/tools/http.d.ts.map +1 -1
- package/dist/tools/http.js +179 -25
- package/dist/tools/http.js.map +1 -1
- package/dist/transport/agent-server.d.ts +29 -2
- package/dist/transport/agent-server.d.ts.map +1 -1
- package/dist/transport/agent-server.js +171 -27
- package/dist/transport/agent-server.js.map +1 -1
- package/dist/transport/http-server.d.ts +17 -4
- package/dist/transport/http-server.d.ts.map +1 -1
- package/dist/transport/http-server.js +106 -153
- package/dist/transport/http-server.js.map +1 -1
- package/dist/transport/keepalive.d.ts +11 -13
- package/dist/transport/keepalive.d.ts.map +1 -1
- package/dist/transport/keepalive.js +11 -13
- package/dist/transport/keepalive.js.map +1 -1
- package/dist/transport/oauth-callback.d.ts +19 -0
- package/dist/transport/oauth-callback.d.ts.map +1 -0
- package/dist/transport/oauth-callback.js +30 -0
- package/dist/transport/oauth-callback.js.map +1 -0
- package/dist/transport/session-limiter.d.ts +8 -3
- package/dist/transport/session-limiter.d.ts.map +1 -1
- package/dist/transport/session-limiter.js +8 -0
- package/dist/transport/session-limiter.js.map +1 -1
- package/dist/transport/sse-server.d.ts.map +1 -1
- package/dist/transport/sse-server.js +54 -24
- package/dist/transport/sse-server.js.map +1 -1
- package/dist/transport/stdio-server.d.ts +6 -0
- package/dist/transport/stdio-server.d.ts.map +1 -1
- package/dist/transport/stdio-server.js +19 -7
- package/dist/transport/stdio-server.js.map +1 -1
- package/dist/types.d.ts +0 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/uploads/api.d.ts +20 -0
- package/dist/uploads/api.d.ts.map +1 -0
- package/dist/uploads/api.js +280 -0
- package/dist/uploads/api.js.map +1 -0
- package/dist/uploads/refs.d.ts +48 -0
- package/dist/uploads/refs.d.ts.map +1 -0
- package/dist/uploads/refs.js +273 -0
- package/dist/uploads/refs.js.map +1 -0
- package/dist/uploads/resolve.d.ts +117 -0
- package/dist/uploads/resolve.d.ts.map +1 -0
- package/dist/uploads/resolve.js +581 -0
- package/dist/uploads/resolve.js.map +1 -0
- package/dist/uploads/store.d.ts +224 -0
- package/dist/uploads/store.d.ts.map +1 -0
- package/dist/uploads/store.js +1908 -0
- package/dist/uploads/store.js.map +1 -0
- package/dist/util/atomic-file.d.ts +6 -0
- package/dist/util/atomic-file.d.ts.map +1 -1
- package/dist/util/atomic-file.js +42 -2
- package/dist/util/atomic-file.js.map +1 -1
- package/dist/util/is-record.d.ts +3 -0
- package/dist/util/is-record.d.ts.map +1 -0
- package/dist/util/is-record.js +5 -0
- package/dist/util/is-record.js.map +1 -0
- package/dist/web/assets/airlock-shield-fPu067nB.png +0 -0
- package/dist/web/assets/favicon-DL7sWXGq.png +0 -0
- package/dist/web/assets/index-B_qY7DgQ.js +225 -0
- package/dist/web/assets/index-Bc_jHlFK.css +1 -0
- package/dist/web/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- package/dist/web/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- package/dist/web/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- package/dist/web/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- package/dist/web/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- package/dist/web/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- package/dist/web/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/web/index.html +17 -0
- package/examples/airlock.yaml +3 -1
- package/examples/claude-code-setup.md +1 -1
- package/examples/docker-compose.yaml +3 -1
- package/examples/docker-gateway.yaml +2 -1
- package/examples/gateway.yaml +1 -1
- package/examples/profiles.yaml +5 -2
- package/examples/sandbox-presets.yaml +4 -1
- package/extensions/openclaw/index.ts +3 -3
- package/extensions/openclaw/openclaw.plugin.json +4 -4
- package/package.json +25 -10
- package/schema.json +2810 -2078
- package/dist/transport/mcp-normalizer.d.ts +0 -9
- package/dist/transport/mcp-normalizer.d.ts.map +0 -1
- package/dist/transport/mcp-normalizer.js +0 -12
- package/dist/transport/mcp-normalizer.js.map +0 -1
- package/extensions/openclaw/package-lock.json +0 -8548
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function r(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(l){if(l.ep)return;l.ep=!0;const i=r(l);fetch(l.href,i)}})();var K,cn,fe,Lt,We,dn,je,hn,mt,it,un,qe={},Ge=[],zr=/^m(i|n|o|s|text|space)$/,Je=Array.isArray,yt=Ge.slice,ye=Object.assign;function He(t){t&&t.parentNode&&t.remove()}function lt(t,n,r){var s,l,i,o={},a=arguments.length;for(i in n)i=="key"?s=n[i]:i=="ref"&&typeof t!="function"?l=n[i]:o[i]=n[i];return a>2&&(o.children=a>3?yt.call(arguments,2):r),Ce(t,o,s,l,null)}function Ce(t,n,r,s,l){var i={type:t,props:n,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:l||++cn,__i:-1,__u:0};return!l&&K.vnode&&K.vnode(i),i}function O(t){return t.children}function Be(t,n){this.props=t,this.context=n,this.__g=0}function ge(t,n){if(n==null)return t.__?ge(t.__,t.__i+1):null;for(var r;n<t.__k.length;n++)if((r=t.__k[n])&&r.__e)return r.__e;return typeof t.type!="function"||t.props.__P?null:ge(t)}function pn(t){if((t=t.__)&&t.__c&&!t.props.__P)return t.__e=null,t.__k.some(function(n){return n&&(t.__e=n.__e)}),pn(t)}function ot(t){(8&t.__g||!(t.__g|=8)||!fe.push(t)||We++)&&Lt==K.debounceRendering||((Lt=K.debounceRendering)||queueMicrotask)(Mr)}function Mr(){var t,n,r,s,l,i,o,a,h;try{for(n=1;fe.length;)fe.length>n&&fe.sort(dn),t=fe.shift(),n=fe.length,8&t.__g&&(s=void 0,l=void 0,i=(l=(r=t).__v).__e,o=[],a=[],(h=r.__P)&&((s=ye({constructor:void 0},l)).__v=l.__v+1,K.vnode&&K.vnode(s),_t(h,s,l,r.__n,h.namespaceURI,32&l.__u?[i]:null,o,i||ge(l),32&l.__u,a),s.__v=l.__v,s.__.__k[s.__i]=s,_n(o,s,a),l.__=l.__e=null,s.__e!=i&&pn(s)))}finally{fe.length=We=0}}function fn(t,n,r,s,l,i,o,a,h,u,c){var v,y,m,g,d,b,f=s.__k||Ge,w=n.length;for(h=Lr(r,n,f,h,w),v=0;v<w;v++)(m=r.__k[v])!=null&&(y=~m.__i&&f[m.__i]||qe,m.__i=v,b=_t(t,m,y,l,i,o,a,h,u,c),g=m.__e,(y.ref!=m.ref||8&y.__u)&&(y.ref&&vt(y.ref,null,m,y),m.ref&&c.push(m.ref,m.__c||g,m)),d=d||g,4&m.__u?(h=gn(m,h,t,!y.__v),y.__e&&(y.__e=null)):typeof m.type=="function"&&b!==void 0?h=b:g&&(h=g.nextSibling),m.__u&=-7);return r.__e=d,h}function Lr(t,n,r,s,l){var i,o,a,h,u,c,v,y,m,g,d=r.length,b=d,f=0,w=!1,p=t.__k=Array(l);for(i=0;i<l;i++)(o=n[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o!="object"||o.constructor==String?o=p[i]=Ce(null,o):Je(o)?o=p[i]=Ce(O,{children:o}):o.constructor===void 0&&o.__b?o=p[i]=Ce(o.type,o.props,o.key,o.ref,o.__v):p[i]=o,h=i+f,o.__=t,o.__b=t.__b+1,a=null,~(u=o.__i=Or(o,r,h,b))&&(b--,(a=r[u])&&(a.__u|=2)),a&&a.__v?(o.__u|=2,u==h-1?f--:u==h+1?f++:u!=h&&(u>h?f--:f++,w=!0)):(~u||(l>d?f--:l<d&&f++),typeof o.type!="function"&&(o.__u|=4))):p[i]=null;if(w){for(c=[],v=[],i=0;i<l;i++)if((o=p[i])&&2&o.__u){for(y=0,m=c.length;y<m;)c[g=y+m>>1]<o.__i?y=g+1:m=g;c[y]=o.__i,v[i]=y+1}for(f=c.length;i--;)v[i]&&(v[i]==f?f--:p[i].__u|=4)}if(b)for(i=0;i<d;i++)!(a=r[i])||2&a.__u||(a.__e==s&&(s=ge(a)),bt(a,a));return s}function gn(t,n,r,s){var l,i,o;if(typeof t.type=="function"){if(t.props.__P)return n;if(l=t.__k)for(i=0;i<l.length;i++)l[i]&&(l[i].__=t,n=gn(l[i],n,r,!1));return n}for(n&&!n.parentNode&&(n=ge(t))&&!n.parentNode&&(n=null),o=n;o&&o.nodeType==8;)o=o.nextSibling;for(t.__e!=o&&(!s&&r.moveBefore&&t.__e.parentNode?r.moveBefore(t.__e,n):r.insertBefore(t.__e,n||null)),n=t.__e;(n=n&&n.nextSibling)&&n.nodeType==8;);return n}function mn(t,n){return n=n||[],t!=null&&typeof t!="boolean"&&(Je(t)?t.some(function(r){mn(r,n)}):n.push(t)),n}function Or(t,n,r,s){var l,i,o,a=t.key,h=t.type,u=n[r],c=u&&!(2&u.__u);if(u===null&&a==null||c&&a==u.key&&h==u.type)return r;if(s>(c?1:0)){for(l=r-1,i=r+1;l>=0||i<n.length;)if((u=n[o=l>=0?l--:i++])&&!(2&u.__u)&&a==u.key&&h==u.type)return o}return-1}function Ot(t,n,r){r==null&&(r=""),n[0]=="-"?t.setProperty(n,r):t[n]=r}function Le(t,n,r,s,l){var i,o;e:if(n=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof s=="string"&&(t.style.cssText=s=""),s)for(n in s)r&&n in r||Ot(t.style,n,"");if(r)for(n in r)s&&r[n]==s[n]||Ot(t.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")(t.__e||(t.__e={}))[n]=r,r&&s||(o=it[n]||(it[n]=Rr(n)),(t.__a||(t.__a={}))[n]=mt,i=n!=(n=n.replace(hn,"$1")),(n=n.slice(2))[0]<"a"&&(n=n.toLowerCase()),r?t.addEventListener(n,o,i):t.removeEventListener(n,o,i));else{if(l=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in t)try{t[n]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?t.removeAttribute(n):t.setAttribute(n,n=="popover"&&r==1?"":r))}}function Rr(t){return function(n){if(this.__e){var r=this.__e[t];if(n[je]==null)n[je]=mt++;else if(n[je]<this.__a[t])return;return r(K.event?K.event(n):n)}}}function _t(t,n,r,s,l,i,o,a,h,u){var c,v,y,m,g,d,b,f,w,p,k,N,I,z,$,_,E,T,S,A,D=n.type;if(n.constructor!==void 0)return null;if(128&r.__u&&(h=32&r.__u,c=r.__c.__z)){if(n.__u|=h,v=i=[],c.nodeType==8)for(y=1,m=c.nextSibling;m;m=m.nextSibling){if(m.nodeType==8){if(m.data.startsWith("$s"))y++;else if(m.data.startsWith("/$s")&&!--y)break}i.push(m)}else i.push(c);a=i[0]}(c=K.__b)&&c(n);e:if(typeof D=="function"){g=o.length;try{if(p=n.props,k=(c=D.prototype)&&c.render,N=(c=D.contextType)&&s[c.__c],I=c?N?N.props.value:c.__:s,r.__c?2&(d=n.__c=r.__c).__g&&(d.__g|=1):(k?n.__c=d=new D(p,I):(n.__c=d=new Be(p,I),d.constructor=D,d.render=Br),N&&N.sub(d),d.state||(d.state={}),d.__n=s,d.__g|=8,d.__h=[],d.__k=[]),k&&(d.__s||(d.__s=d.state),D.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ye({},d.__s)),ye(d.__s,D.getDerivedStateFromProps(p,d.__s)))),b=d.props,f=d.state,d.__v=n,r.__c){if(k&&!D.getDerivedStateFromProps&&p!==b&&d.componentWillReceiveProps&&d.componentWillReceiveProps(p,I),n.__v==r.__v&&!(8&d.__g)||!(4&d.__g)&&d.shouldComponentUpdate&&d.shouldComponentUpdate(p,d.__s,I)===!1){n.__v!=r.__v&&(d.props=p,d.state=d.__s,d.__g&=-9),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(x){x&&(x.__=n)}),Ge.push.apply(d.__h,d.__k),d.__k=[],d.__h.length&&o.push(d),a=ge(r);break e}d.componentWillUpdate&&d.componentWillUpdate(p,d.__s,I),k&&d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(b,f,w)})}else k&&!D.getDerivedStateFromProps&&d.componentWillMount&&d.componentWillMount(),k&&d.componentDidMount&&d.__h.push(d.componentDidMount);if(d.context=I,d.props=p,d.__P=t,d.__g&=-5,z=K.__r,$=0,k)d.state=d.__s,d.__g&=-9,z&&z(n),c=d.render(d.props,d.state,d.context),Ge.push.apply(d.__h,d.__k),d.__k=[];else do d.__g&=-9,z&&z(n),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(8&d.__g&&++$<25);d.state=d.__s,d.getChildContext&&(s=ye({},s,d.getChildContext())),k&&r.__c&&d.getSnapshotBeforeUpdate&&(w=d.getSnapshotBeforeUpdate(b,f)),_=c&&c.type===O&&c.key==null?c.props.children:c,p.__P&&(c=a,l=(t=p.__P).namespaceURI,h=i=null,r.props&&r.props.__P!=t&&(r.__k.some(function(x){x&&bt(x,x)}),r.__k=null),a=r.__k?ge(r,0):null),a=fn(t,Je(_)?_:[_],n,r,s,l,i,o,a,h,u),p.__P&&(n.__e=null,a=c),n.__u&=-161,128&r.__u&&(d.__z=null),v&&v.some(He),d.__h.length&&o.push(d),1&d.__g&&(d.__g&=-4)}catch(x){if(o.length=g,n.__v=null,h||i)if(x.then){if(E=0,n.__u|=h?160:128,i){for(~(S=i.indexOf(a||void 0))||(S=i.length);(A=i[S-1])&&A.nodeType==8;)S--;for(;S<i.length;S++)if(A=i[S]){if(i[S]=null,A.nodeType==8){if(A.data.startsWith("$s"))E++||(T=A);else if(E&&A.data.startsWith("/$s")&&!--E){a=A;break}}else if(!E)break}}if(!T){for(;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;T=a}n.__c.__z||(n.__c.__z=T),n.__e=a}else i&&i.some(He);else n.__e=r.__e;n.__k||(n.__k=r.__k||[]),x.then||yn(n),K.__e(x,n,r)}}else a=n.__e=jr(r.__e,n,r,s,l,i,o,h,u,t);return(c=K.diffed)&&c(n),128&n.__u?void 0:a}function yn(t){t&&(t.__c&&(t.__c.__g|=4),t.__k&&t.__k.some(yn))}function _n(t,n,r){for(var s=0;s<r.length;)vt(r[s++],r[s++],r[s++]);K.__c&&K.__c(n,t),t.some(function(l){try{t=l.__h,l.__h=[],t.some(function(i){i.call(l)})}catch(i){K.__e(i,l.__v)}})}function jr(t,n,r,s,l,i,o,a,h,u){var c,v,y,m,g,d,b,f,w,p=r.props||qe,k=n.props,N=n.type;if(N=="svg"?l="http://www.w3.org/2000/svg":N=="math"?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),i){for(c=0;c<i.length;c++)if((g=i[c])&&(N?g.localName==N:g.nodeType==3)){t=g,i[c]=null;break}}if(!t){if(f=u.ownerDocument||document,!N)return f.createTextNode(k);t=f.createElementNS(l,N,k.is&&k),a&&(K.__m&&K.__m(n,i),a=!1),i=null}if(N){if(u=N=="template"?t.content:t,i=N=="textarea"&&k.defaultValue!=null?null:i&&yt.call(u.childNodes),!a&&i)for(p={},c=0;c<t.attributes.length;c++)p[(g=t.attributes[c]).name]=g.value;for(c in p)g=p[c],c=="dangerouslySetInnerHTML"?y=g:c=="children"||c in k||c=="value"&&"defaultValue"in k||c=="checked"&&"defaultChecked"in k||Le(t,c,null,g,l);for(c in w=1&r.__u,k)g=k[c],c=="children"?m=g:c=="dangerouslySetInnerHTML"?v=g:c=="value"?d=g:c=="checked"?b=g:a&&typeof g!="function"||!(p[c]!==g||w&&g!=null)||Le(t,c,g,p[c],l);v?(a||y&&(v.__html==y.__html||v.__html==t.innerHTML)||(t.innerHTML=v.__html),n.__k=[]):(y&&(t.textContent=""),(N=="foreignObject"||l=="http://www.w3.org/1998/Math/MathML"&&zr.test(N))&&(l="http://www.w3.org/1999/xhtml"),fn(u,Je(m)?m:[m],n,r,s,l,i,o,i?i[0]:r.__k&&ge(r,0),a,h),i&&i.some(He)),a&&N!="textarea"||(c="value",N=="progress"&&d==null?t.removeAttribute(c):d==null||d===t[c]&&(N!="progress"||d)||Le(t,c,d,p[c],l),c="checked",b!=null&&b!=t[c]&&Le(t,c,b,p[c],l))}else p===k||a&&t.data==k||(t.data=k);return t}function vt(t,n,r,s){try{typeof t=="function"?n?n.__x=t(n)||1:s&&(s=s.__c||s.__e)&&(n=s.__x)&&(s.__x=null,typeof n=="function"?n():t(null)):t.current=n}catch(l){K.__e(l,r)}}function bt(t,n,r){var s,l;if(K.unmount&&K.unmount(t),!(s=t.ref)||s.current&&s.current!=t.__e||vt(s,null,n,t),s=t.__c){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(i){K.__e(i,n)}s.__P=s.__n=null}if(s=t.__k)for(l=0;l<s.length;l++)s[l]&&bt(s[l],n,typeof t.type!="function"||r&&!t.props.__P);(s=t.__e)&&(r||He(s),s.__e&&(s.__e=null)),t.__e=t.__c=t.__=null}function Br(t,n,r){return this.constructor(t,r)}function Ur(t,n){var r,s,l,i;K.__&&K.__(t,n),n.nodeType==9&&(n=n.documentElement),s=(r=t&&32&t.__u)?null:n.__k,n.__k=Ce(O,{children:[t]}),l=[],i=[],_t(n,n.__k,s||qe,qe,n.namespaceURI,s?null:n.firstChild?yt.call(n.childNodes):null,l,s?s.__e:n.firstChild,r,i),_n(l,n.__k,i),n.__k.props.children=null}function vn(t){function n(r){var s,l;return this.getChildContext||(s=new Set,(l={})[n.__c]=this,this.getChildContext=function(){return l},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&s.forEach(function(o){o.__g|=4,ot(o)})},this.sub=function(i){s.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){s.delete(i),o&&o.call(i)}}),r.children}return n.__c="__cC"+un++,n.__=t,n.Provider=(n.Consumer=function(r,s){return r.children(s)}).contextType=n,n}K={__e:function(t,n,r,s){for(var l,i,o;n=n.__;)if((l=n.__c)&&!(1&l.__g)){l.__g|=4;try{if((i=l.constructor)&&i.getDerivedStateFromError&&(l.setState(i.getDerivedStateFromError(t)),o=8&l.__g),l.componentDidCatch&&(l.componentDidCatch(t,s||{}),o=8&l.__g),o)return void(l.__g|=2)}catch(a){t=a,o=0}}throw We=0,t}},cn=0,Be.prototype.setState=function(t,n){var r=this.__s;r&&r!=this.state||(r=this.__s=ye({},this.state)),typeof t=="function"&&(t=t(ye({},r),this.props)),t&&(ye(r,t),this.__v&&(n&&this.__k.push(n),ot(this)))},Be.prototype.forceUpdate=function(t){this.__v&&(this.__g|=4,t&&this.__h.push(t),ot(this))},Be.prototype.render=O,fe=[],We=0,dn=function(t,n){return t.__v.__b-n.__v.__b},je=Symbol(),hn=/(PointerCapture)$|Capture$/i,mt=0,it={},un=0;var Kr=0;function e(t,n,r,s,l,i){n||(n={});var o,a,h=n;if("ref"in h&&typeof t!="function")for(a in h={},n)a=="ref"?o=n[a]:h[a]=n[a];var u={type:t,props:h,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Kr,__i:-1,__u:0};return K.vnode&&K.vnode(u),u}var xe,H,Xe,Rt,at=Object.is,Te=0,bn=[],ct=[],G=K,jt=G.__b,Bt=G.__r,Ut=G.diffed,Kt=G.__c,Wt=G.unmount,qt=G.__;function Ve(t,n){G.__h&&G.__h(H,t,Te||n),Te=0;var r=H.__H||(H.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function C(t){return Te=1,Wr(xn,t)}function Wr(t,n,r){var s=Ve(xe++,2);if(s.t=t,!s.__c&&(s.__=[xn(void 0,n),function(i){var o=s.__N?s.__N[0]:s.__[0],a=s.t(o,i);at(o,a)||(s.__N=[a,s.__[1]],s.__c.setState({}))}],s.__c=H,!H.__f)){H.__f=!0;var l=H.shouldComponentUpdate;H.shouldComponentUpdate=function(i,o,a){var h=this.__H;if(!h)return!0;var u=!1,c=this.props!=i;if(h.__.some(function(y){y.__N&&(u=!0,at(y.__[0],y.__N[0])||(c=!0))}),l){var v=l.call(this,i,o,a);return u?v||c:v}return!u||c}}return s.__}function U(t,n){var r=Ve(xe++,3);!G.__s&&wn(r.__H,n)&&(r.__P=!0,r.__=t,r.u=n,H.__H.__h.push(r))}function re(t){return Te=5,ee(function(){return{current:t}},[])}function ee(t,n){var r=Ve(xe++,7);return wn(r.__H,n)&&(r.__=t(),r.__H=n),r.__}function pe(t,n){return Te=8,ee(function(){return t},n)}function kn(t){var n=H.context[t.__c],r=Ve(xe++,9);return r.c=t,n?(r.__==null&&(r.__=!0,n.sub(H)),n.props.value):t.__}function qr(){var t;do{for(;t=ct.shift();)try{Se(t)}catch(r){G.__e(r,{__:(t=t.__P)&&t.__v})}for(;t=bn.shift();){var n=t.__H;if(t.__P&&n)try{n.__h.some(Se),n.__h.some(dt),n.__h=[]}catch(r){n.__h=[],G.__e(r,t.__v)}}}while(ct.length)}G.__b=function(t){H=null,jt&&jt(t)},G.__=function(t,n){t&&n.__k&&n.__k.__m&&(t.__m=n.__k.__m),qt&&qt(t,n)},G.__r=function(t){Bt&&Bt(t),xe=0;var n=(H=t.__c).__H;n&&(Xe==H?H.__h=[]:(n.__h.some(Se),n.__h.some(dt),xe=0),n.__h=[],n.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})),Xe=H},G.diffed=function(t){Ut&&Ut(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&Ht(bn.push(n)),n.__H.__.some(function(r){r.u&&(r.__H=r.u)})),Xe=H=null},G.__c=function(t,n){n.some(function(r){try{r.__h.some(Se),r.__h=r.__h.filter(function(s){return!s.__||dt(s)})}catch(s){n.some(function(l){l.__h&&(l.__h=[])}),n=[],G.__e(s,r.__v)}}),Kt&&Kt(t,n)},G.unmount=function(t){Wt&&Wt(t);var n,r,s=t.__c;s&&s.__H&&(s.__H.__.some(function(l){try{if(l.__P&&l.__c){if(r===void 0){for(r=t.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c}l.__P=r,Ht(ct.push(l))}else Se(l)}catch(i){n=i}}),s.__H=void 0,n&&G.__e(n,s.__v))};var Gt=typeof requestAnimationFrame=="function";function Gr(t){var n,r=function(){clearTimeout(s),Gt&&cancelAnimationFrame(n),setTimeout(t)},s=setTimeout(r,35);Gt&&(n=requestAnimationFrame(r))}function Ht(t){t!=1&&Rt==G.requestAnimationFrame||((Rt=G.requestAnimationFrame)||Gr)(qr)}function Se(t){var n=H,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),H=n}function dt(t){var n=H;t.__c=t.__(),H=n}function wn(t,n){return!t||t.length!=n.length||n.some(function(r,s){return!at(r,t[s])})}function xn(t,n){return typeof n=="function"?n(t):n}/**
|
|
2
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/function Hr(t,n,r=[]){throw new Error("[lucide]: iconNode is required when icon name is used")}/**
|
|
7
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Fr=t=>{let n="",r=!1;for(const s of t){if(s==="-"||s==="_"||s<=" "){r=n.length>0;continue}n.length===0?n+=s.toLowerCase():n+=r?s.toUpperCase():s,r=!1}return n};/**
|
|
12
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Jr=t=>{const n=Fr(t);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
|
17
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ke={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
22
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const ht=(...t)=>{const n=new Set;for(const r of t)if(typeof r=="string")for(const s of r.split(/\s+/))s&&n.add(s);return[...n].join(" ")};/**
|
|
27
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/function Ze(t){return t!=null}function Vr(t,n={}){var y,m;const r=n.attributeNames??{},s=g=>r[g]??g,l=t.size??t.width??ke.width,i=t.size??t.height??ke.height,o=((y=t.aliases)==null?void 0:y.filter(g=>typeof g=="string"&&g.trim()!=="").map(g=>`lucide-${g}`))??[],a=[...t.name?[`lucide-${t.name}`]:[],...o],h=((m=n.className)==null?void 0:m.split(" ").filter(Boolean))??[],u=n.includeDefaultClasses===!1?ht(...h):ht("lucide",...a,...h);let c=n.strokeWidth??ke["stroke-width"];if(n.absoluteStrokeWidth){const g=Number(c)*Number(t.size??t.width??ke.width)/Number(n.size??n.width??ke.width);Number.isFinite(g)&&(c=g)}return["svg",{...Object.entries(ke).reduce((g,[d,b])=>(g[s(d)]=b,g),{}),..."color"in n&&n.color&&{[s("stroke")]:n.color},..."size"in n&&Ze(n.size)&&{[s("width")]:n.size,[s("height")]:n.size},..."width"in n&&Ze(n.width)&&{[s("width")]:n.width},..."height"in n&&Ze(n.height)&&{[s("height")]:n.height},[s("stroke-width")]:c,...u&&{[s("class")]:u},[s("viewBox")]:`0 0 ${l} ${i}`,...n.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in n&&n.attributes},t.node.map(g=>{const[d,b,f]=g,w=n.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...b}:b;return f?[d,w,f]:[d,w]})]}/**
|
|
32
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Yr=t=>{if(t==null||typeof t!="object")return!1;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&(n.startsWith("aria-")||n==="role"||n==="title")&&t[n]!=null)return!0;return!1};/**
|
|
37
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Qr=vn({size:24,color:"currentColor",strokeWidth:2,absoluteStrokeWidth:!1,nonScalingStroke:!1,class:""}),Xr=()=>kn(Qr);/**
|
|
42
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ft=t=>typeof t=="object"?t==null?void 0:t.value:t,Zr=({color:t,size:n,width:r,height:s,strokeWidth:l,absoluteStrokeWidth:i,nonScalingStroke:o,children:a,iconNode:h=[],icon:u={node:h,aliases:[],size:24},class:c="",className:v="",...y})=>{const{size:m=24,strokeWidth:g=2,absoluteStrokeWidth:d=!1,nonScalingStroke:b=!1,color:f="currentColor",class:w=""}=Xr()??{},[p,k,N=[]]=Vr(u,{color:t??f,width:r??n??m,height:s??n??m,strokeWidth:l??g,absoluteStrokeWidth:i??d,nonScalingStroke:o??b,className:ht(w,Ft(c),Ft(v)),hasA11yProp:!!a||Yr(y),attributes:y});return lt(p,{...k},[...N.map(([I,z])=>lt(I,z)),...mn(a)])};/**
|
|
47
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/function B(t,n,r=[]){const s=typeof t=="string"?Hr(t,n,r):t,l=({children:i,...o})=>lt(Zr,{...o,icon:s},i);return s.name&&(l.displayName=Jr(s.name)),l}/**
|
|
52
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const $n={name:"activity",size:24,node:[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]};$n.node;const An=B($n);/**
|
|
57
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Cn={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};Cn.node;const es=B(Cn);/**
|
|
62
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Sn={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};Sn.node;const ts=B(Sn);/**
|
|
67
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Tn={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};Tn.node;const ns=B(Tn);/**
|
|
72
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Dn={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};Dn.node;const rs=B(Dn);/**
|
|
77
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Nn={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};Nn.node;const En=B(Nn);/**
|
|
82
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Pn={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Pn.node;const In=B(Pn);/**
|
|
87
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const zn={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};zn.node;const ss=B(zn);/**
|
|
92
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const Mn={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};Mn.node;const be=B(Mn);/**
|
|
97
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Ln={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Ln.node;const is=B(Ln);/**
|
|
102
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const On={name:"circle-exclamation-point",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle","circle-alert"]};On.node;const Rn=B(On);/**
|
|
107
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const jn={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};jn.node;const Bn=B(jn);/**
|
|
112
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const Un={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};Un.node;const ls=B(Un);/**
|
|
117
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const Kn={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};Kn.node;const Wn=B(Kn);/**
|
|
122
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const qn={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};qn.node;const Gn=B(qn);/**
|
|
127
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Hn={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};Hn.node;const os=B(Hn);/**
|
|
132
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Fn={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};Fn.node;const as=B(Fn);/**
|
|
137
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Jn={name:"message-circle-question-mark",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5",key:"1awbb0"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["message-circle-question"]};Jn.node;const cs=B(Jn);/**
|
|
142
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const Vn={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};Vn.node;const ds=B(Vn);/**
|
|
147
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const Yn={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Yn.node;const hs=B(Yn);/**
|
|
152
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Qn={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Qn.node;const kt=B(Qn);/**
|
|
157
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const Xn={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};Xn.node;const Ee=B(Xn);/**
|
|
162
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const Zn={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};Zn.node;const us=B(Zn);/**
|
|
167
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const er={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};er.node;const tr=B(er);/**
|
|
172
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const nr={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};nr.node;const ps=B(nr);/**
|
|
177
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const rr={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};rr.node;const sr=B(rr);/**
|
|
182
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const ir={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};ir.node;const fs=B(ir);/**
|
|
187
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const lr={name:"triangle-exclamation-point",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle","triangle-alert"]};lr.node;const gs=B(lr);/**
|
|
192
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const or={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};or.node;const ms=B(or);/**
|
|
197
|
+
* @license lucide-preact v1.78.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const ar={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};ar.node;const De=B(ar);class wt extends Error{constructor(n,r,s={}){super(n),this.status=r,this.body=s}}async function oe(t,n){const r=await fetch(t,{...n,headers:{...n!=null&&n.body?{"content-type":"application/json"}:{},...n==null?void 0:n.headers}}),s=await r.text();let l={};try{l=s?JSON.parse(s):{}}catch{l={error:s}}if(!r.ok)throw new wt(String(l.error??`Request failed (${r.status})`),r.status,l);return l}const we=(t,n)=>oe(t,{method:"POST",body:n===void 0?void 0:JSON.stringify(n)}),q={state:()=>oe("/api/state"),meta:()=>oe("/api/meta"),status:()=>oe("/api/status"),tools:()=>oe("/api/tools"),logs:t=>{const n=new URLSearchParams(Object.entries(t).filter(([,r])=>r));return oe("/api/logs"+(n.size?`?${n}`:""))},activity:()=>oe("/api/activity"),grants:t=>{const n=t?`?agent=${encodeURIComponent(t)}`:"";return oe(`/api/grants${n}`)},revokeGrant:t=>oe(`/api/grants/${encodeURIComponent(t)}`,{method:"DELETE"}),preview:t=>we("/api/changes/preview",{ops:t}),apply:(t,n)=>we("/api/changes/apply",{ops:t,version:n}),saveProvider:t=>we("/api/providers",t),deleteProvider:t=>oe(`/api/providers/${encodeURIComponent(t)}`,{method:"DELETE"}),decide:(t,n,r={})=>{const s=new URLSearchParams({code:n});return r.remember&&s.set("remember",r.remember),r.grantScope&&s.set("grant_scope",r.grantScope),r.grantTier&&s.set("grant_tier",r.grantTier),r.grantProfile&&s.set("grant_profile",r.grantProfile),r.durationMs&&s.set("duration_ms",String(r.durationMs)),r.maxUses&&s.set("max_uses",String(r.maxUses)),we(`/${t}?${s}`)},approvalPreview:t=>we(`/approval-preview/${encodeURIComponent(t)}`),chat:t=>we("/api/assistant/chat",{messages:t})},cr=vn(null),dr="airlock:theme";function ys(){try{const t=localStorage.getItem(dr);if(t==="light"||t==="dark"||t==="system")return t}catch{}return"system"}function Jt(t){const n=document.documentElement;t==="system"?delete n.dataset.theme:n.dataset.theme=t}function V(){const t=kn(cr);if(!t)throw new Error("StoreProvider missing");return t}function _s({children:t}){const[n,r]=C(null),[s,l]=C(null),[i,o]=C(null),[a,h]=C([]),[u,c]=C([]),[v,y]=C(!1),[m,g]=C(!1),[d,b]=C([]),[f,w]=C([]),[p,k]=C(!1),[N,I]=C([]),[z,$]=C("readonly"),[_,E]=C(0),[T,S]=C(null),[A,D]=C([]),[x,M]=C([]),[P,W]=C(!1),[ae,Nr]=C(ys),Er=re(0),Tt=pe(j=>{Nr(j),Jt(j);try{localStorage.setItem(dr,j)}catch{}},[]);U(()=>{Jt(ae)},[ae]);const Ae=pe((j,Y="info")=>{const se=++Er.current;D(ie=>[...ie,{id:se,text:j,tone:Y}]),setTimeout(()=>D(ie=>ie.filter(le=>le.id!==se)),Y==="error"?7e3:3200)},[]),Dt=pe(async()=>r(await q.state()),[]),Nt=pe(async()=>o(await q.status()),[]),Et=pe(async()=>{g(!0);try{const j=await q.tools();h((j.tools??[]).filter(Y=>Y.provider!=="airlock")),c(j.errors??[]),y(!0)}finally{g(!1)}},[]),ce=pe(async()=>{try{const j=await q.grants();w(j.grants??[]),k(j.canRevoke!==!1)}catch{}},[]),Pt=pe(async j=>{try{await q.revokeGrant(j),w(Y=>Y.filter(se=>se.id!==j)),Ae("Grant revoked"),ce().catch(()=>{})}catch(Y){Ae(Y.message,"error")}},[Ae,ce]),Me=pe(async()=>{const[j,Y]=await Promise.all([q.logs({limit:"1"}),q.activity()]),se=(j.pending??[]).map(Yt);(j.dbPath!==":memory:"||se.length>0)&&b(ie=>{const le=new Map(ie.map(F=>[F.id,F]));return se.map(F=>{const Q=le.get(F.id);return Q?{...F,expiresAt:F.expiresAt??Q.expiresAt,timeoutMs:F.timeoutMs||Q.timeoutMs,grantOptions:F.grantOptions??Q.grantOptions,batchId:F.batchId??Q.batchId,batchCode:F.batchCode??Q.batchCode,batchSize:F.batchSize??Q.batchSize,tier:F.tier??Q.tier,provider:F.provider??Q.provider,escalated:F.escalated??Q.escalated,mode:F.mode??Q.mode,plan:F.plan??Q.plan}:F})}),I(ie=>{var le;return(le=Y.events)!=null&&le.length?Y.events:ie})},[]);U(()=>{Promise.all([Dt(),q.meta().then(l)]).then(()=>{Nt().catch(()=>{}),Et().catch(j=>Ae(`Could not load tools: ${j.message}`,"error")),Me().catch(()=>{}),ce().catch(()=>{})}).catch(j=>S(j.message))},[]),U(()=>{const j=setInterval(()=>{ce().catch(()=>{})},3e4);return()=>clearInterval(j)},[ce]);const It=(s==null?void 0:s.approvals)===!0;U(()=>{if(!It||!("EventSource"in window)){$("readonly");return}let j=null,Y=1e3,se,ie=!1;const le=new Set,F=()=>{j=new EventSource("/events"),j.onopen=()=>{Y=1e3,$("live"),ie&&Me().catch(()=>{}),ie=!0},j.onmessage=Q=>{var zt,Mt;const te=JSON.parse(Q.data);if(te.type==="new"&&((zt=te.request)!=null&&zt.id)){const J=Yt(te.request);b(ue=>[J,...ue.filter(Ir=>Ir.id!==J.id)]),E(ue=>ue+1),le.has(J.id)||(le.add(J.id),vs(`${J.agentId} wants ${J.tool}`,J.reason??"",J.id))}else te.type==="resolved"?(typeof te.id=="string"&&le.delete(te.id),b(J=>J.filter(ue=>ue.id!==te.id&&ue.code!==te.code)),E(J=>J+1),ce().catch(()=>{})):te.type==="activity"&&((Mt=te.event)!=null&&Mt.id)&&(I(J=>[te.event,...J.filter(ue=>ue.id!==te.event.id)].slice(0,200)),E(J=>J+1))},j.onerror=()=>{$("reconnecting"),j==null||j.close(),se=setTimeout(F,Y=Math.min(Y*2,3e4))}};return F(),()=>{clearTimeout(se),j==null||j.close()}},[It,ce,Me]);const Pr=ee(()=>({state:n,meta:s,status:i,tools:a,toolErrors:u,toolsLoaded:v,toolsLoading:m,pending:d,grants:f,canRevokeGrants:p,activity:N,liveState:z,eventTick:_,loadError:T,setState:r,refreshState:Dt,refreshTools:Et,refreshStatus:Nt,refreshPending:Me,refreshGrants:ce,revokeGrant:Pt,toasts:A,toast:Ae,revealed:x,reveal:j=>M(j),dismissReveal:()=>M([]),assistantOpen:P,setAssistantOpen:W,theme:ae,setTheme:Tt}),[n,s,i,a,u,v,m,d,f,p,N,z,_,T,A,x,P,ae,Tt,ce,Pt]);return e(cr.Provider,{value:Pr,children:t})}function vs(t,n,r){try{if(localStorage.getItem("airlock:notifs")!=="true"||!("Notification"in window)||Notification.permission!=="granted")return;new Notification(`Airlock: ${t}`,{body:n,...r?{tag:r}:{}})}catch{}}function Vt(t){if(t&&typeof t=="object"&&!Array.isArray(t))return t;if(typeof t=="string"&&t.trim())try{const n=JSON.parse(t);if(n&&typeof n=="object"&&!Array.isArray(n))return n}catch{}return{}}function et(t){if(!Array.isArray(t)||t.length===0)return;const n=[];for(const r of t){if(!r||typeof r!="object")continue;const s=r,l=typeof s.tool=="string"?s.tool:"";if(!l)continue;const i=s.args??s.arguments,o=i&&typeof i=="object"&&!Array.isArray(i)?i:{};n.push({tool:l,args:o})}return n.length>0?n:void 0}function Yt(t){const n=t??{};let r=n.args;if(typeof r=="string")try{r=JSON.parse(r)}catch{r={value:r}}const s=r&&typeof r=="object"&&!Array.isArray(r)?{...r}:{},l=Vt(n.meta),i=Vt(l.subject),o=n.context??s._airlock??{};delete s._airlock;const a=_=>typeof _=="string"&&_.trim()?_.trim():void 0,h=String(n.tool??""),u=a(n.kind)??a(l.kind),c=u==="plan"||u==="question"||u==="call"?u:h==="airlock/request_approval"?"plan":h==="airlock/ask_user"?"question":"call",v=a(n.mode)??a(l.mode),y=v==="sync"||v==="async"?v:void 0,m=a(n.tier)??a(i.tier),g=m==="read"||m==="write"||m==="destructive"?m:void 0,d=a(n.provider)??a(i.provider)??(h.includes("/")&&!h.startsWith("airlock/")?h.split("/")[0]:void 0),b=typeof n.escalated=="boolean"?n.escalated:typeof i.escalated=="boolean"?i.escalated:void 0,f=et(n.plan)??et(l.plan)??(c==="plan"?et(s.calls):void 0),p=Array.isArray(n.grantOptions)?n.grantOptions:Array.isArray(l.grantOptions)?l.grantOptions:void 0,k=String(n.createdAt??n.created_at??new Date().toISOString()),N=Number(n.timeoutMs??0),I=a(n.expiresAt)??a(l.expiresAt)??(N>0&&!Number.isNaN(Date.parse(k))?new Date(Date.parse(k)+N).toISOString():void 0),z=a(o.reason)??(c==="plan"?a(s.reason):void 0),$=a(o.note);return{id:String(n.id??""),code:String(n.code??""),agentId:String(n.agentId??n.agent_id??""),tool:h,args:s,reason:z,note:$,createdAt:k,expiresAt:I,timeoutMs:N,kind:c,mode:y,tier:g,provider:d,escalated:b,plan:f,grantOptions:p,batchId:a(n.batchId)??a(l.batchId),batchCode:a(n.batchCode)??a(l.batchCode),batchSize:typeof n.batchSize=="number"?n.batchSize:void 0}}function bs(){const t=()=>window.location.hash.replace(/^#\/?/,"").split("/").filter(Boolean).map(decodeURIComponent),[n,r]=C(t);return U(()=>{let s=window.location.hash;const l=()=>{if(Ue)Ue=!1;else if(_e.size>0){if(!window.confirm(ks)){Ue=!0,window.location.hash=s;return}_e.clear()}s=window.location.hash,r(t())},i=o=>{_e.size>0&&o.preventDefault()};return window.addEventListener("hashchange",l),window.addEventListener("beforeunload",i),()=>{window.removeEventListener("hashchange",l),window.removeEventListener("beforeunload",i)}},[]),n}const ks="Leave this page? Your unsaved changes will be lost.",_e=new Set;let Ue=!1;function hr(t){const n=re(Symbol("unsaved"));U(()=>(t?_e.add(n.current):_e.delete(n.current),()=>{_e.delete(n.current)}),[t])}function Ne(...t){window.location.hash="/"+t.map(encodeURIComponent).join("/")}function ur(...t){_e.clear(),Ue=window.location.hash!=="#/"+t.map(encodeURIComponent).join("/"),Ne(...t)}class ws{diff(n,r,s={}){let l;typeof s=="function"?(l=s,s={}):"callback"in s&&(l=s.callback);const i=this.castInput(n,s),o=this.castInput(r,s),a=this.removeEmpty(this.tokenize(i,s)),h=this.removeEmpty(this.tokenize(o,s));return this.diffWithOptionsObj(a,h,s,l)}diffWithOptionsObj(n,r,s,l){var i;const o=w=>{if(w=this.postProcess(w,s),l){setTimeout(function(){l(w)},0);return}else return w},a=r.length,h=n.length;let u=1,c=a+h;s.maxEditLength!=null&&(c=Math.min(c,s.maxEditLength));const v=(i=s.timeout)!==null&&i!==void 0?i:1/0,y=Date.now()+v,m=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(m[0],r,n,0,s);if(m[0].oldPos+1>=h&&g+1>=a)return o(this.buildValues(m[0].lastComponent,r,n));let d=-1/0,b=1/0;const f=()=>{for(let w=Math.max(d,-u);w<=Math.min(b,u);w+=2){let p;const k=m[w-1],N=m[w+1];k&&(m[w-1]=void 0);let I=!1;if(N){const $=N.oldPos-w;I=N&&0<=$&&$<a}const z=k&&k.oldPos+1<h;if(!I&&!z){m[w]=void 0;continue}if(!z||I&&k.oldPos<N.oldPos?p=this.addToPath(N,!0,!1,0,s):p=this.addToPath(k,!1,!0,1,s),g=this.extractCommon(p,r,n,w,s),p.oldPos+1>=h&&g+1>=a)return o(this.buildValues(p.lastComponent,r,n))||!0;m[w]=p,p.oldPos+1>=h&&(b=Math.min(b,w-1)),g+1>=a&&(d=Math.max(d,w+1))}u++};if(l)(function w(){setTimeout(function(){if(u>c||Date.now()>y)return l(void 0);f()||w()},0)})();else for(;u<=c&&Date.now()<=y;){const w=f();if(w)return w}}addToPath(n,r,s,l,i){const o=n.lastComponent;return o&&!i.oneChangePerToken&&o.added===r&&o.removed===s?{oldPos:n.oldPos+l,lastComponent:{count:o.count+1,added:r,removed:s,previousComponent:o.previousComponent}}:{oldPos:n.oldPos+l,lastComponent:{count:1,added:r,removed:s,previousComponent:o}}}extractCommon(n,r,s,l,i){const o=r.length,a=s.length;let h=n.oldPos,u=h-l,c=0;for(;u+1<o&&h+1<a&&this.equals(s[h+1],r[u+1],i);)u++,h++,c++,i.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(n.lastComponent={count:c,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=h,u}equals(n,r,s){return s.comparator?s.comparator(n,r):n===r||!!s.ignoreCase&&n.toLowerCase()===r.toLowerCase()}removeEmpty(n){const r=[];for(let s=0;s<n.length;s++)n[s]&&r.push(n[s]);return r}castInput(n,r){return n}tokenize(n,r){return Array.from(n)}join(n){return n.join("")}postProcess(n,r){return n}get useLongestToken(){return!1}buildValues(n,r,s){const l=[];let i;for(;n;)l.push(n),i=n.previousComponent,delete n.previousComponent,n=i;l.reverse();const o=l.length;let a=0,h=0,u=0;for(;a<o;a++){const c=l[a];if(c.removed)c.value=this.join(s.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let v=r.slice(h,h+c.count);v=v.map(function(y,m){const g=s[u+m];return g.length>y.length?g:y}),c.value=this.join(v)}else c.value=this.join(r.slice(h,h+c.count));h+=c.count,c.added||(u+=c.count)}}return l}}class xs extends ws{constructor(){super(...arguments),this.tokenize=Cs}equals(n,r,s){return s.ignoreWhitespace?((!s.newlineIsToken||!n.includes(`
|
|
202
|
+
`))&&(n=n.trim()),(!s.newlineIsToken||!r.includes(`
|
|
203
|
+
`))&&(r=r.trim())):s.ignoreNewlineAtEof&&!s.newlineIsToken&&(n.endsWith(`
|
|
204
|
+
`)&&(n=n.slice(0,-1)),r.endsWith(`
|
|
205
|
+
`)&&(r=r.slice(0,-1))),super.equals(n,r,s)}}const $s=new xs;function As(t,n,r){return $s.diff(t,n,r)}function Cs(t,n){n.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
|
206
|
+
`));const r=[],s=t.split(/(\n|\r\n)/);s[s.length-1]||s.pop();for(let l=0;l<s.length;l++){const i=s[l];l%2&&!n.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r}function R(...t){return t.filter(Boolean).join(" ")}function Z(t,n,r=`${n}s`){return`${t} ${t===1?n:r}`}function L({variant:t="default",size:n="md",icon:r,busy:s,class:l,children:i,...o}){return e("button",{type:"button",...o,class:R("btn",t!=="default"&&`btn-${t}`,n!=="md"&&`btn-${n}`,r&&"btn-icon",s&&"is-busy",l),disabled:o.disabled||s,"aria-busy":s||void 0,children:i})}function X({children:t}){return e("kbd",{children:t})}function Pe({value:t,onInput:n,placeholder:r,label:s,pageSearch:l=!0,class:i}){return e("label",{class:R("search",i),children:[e(us,{size:14,"aria-hidden":"true"}),e("input",{type:"search",class:"input",value:t,placeholder:r,"aria-label":s,autocomplete:"off",spellcheck:!1,"data-page-search":l?"true":void 0,onInput:o=>n(o.currentTarget.value),onKeyDown:o=>{o.key==="Escape"&&(t?n(""):o.currentTarget.blur())}}),l&&e("kbd",{"aria-hidden":"true",children:"/"})]})}function Ss({value:t,options:n,onChange:r,label:s,class:l}){return e("div",{class:R("segmented",l),role:"radiogroup","aria-label":s,children:n.map(i=>e("button",{type:"button",role:"radio","aria-checked":t===i.value,title:i.title,"aria-label":i.title,onClick:()=>r(i.value),children:i.label},i.value))})}const tt={allow:"Allow",ask:"Ask",deny:"Deny"};function Qt({own:t,inherited:n,inheritedFrom:r,onChange:s,label:l}){return e("div",{class:"decision",role:"radiogroup","aria-label":l,children:["allow","ask","deny"].map(i=>{const o=t===i,a=!t&&n===i;return e("button",{type:"button",role:"radio","aria-checked":o,class:R(`is-${i}`,a&&"is-ghost"),title:a&&r?`${tt[i]} via ${r}. Click to set it here.`:o?"Click again to clear":tt[i],onClick:()=>s(o?null:i),children:tt[i]},i)})})}function xt({counts:t,total:n}){return e("div",{class:"access-bar",role:"img","aria-label":`${t.allow} allowed, ${t.ask} ask, ${t.deny+t.none} blocked`,children:n>0&&["allow","ask","deny","none"].map(r=>t[r]?e("span",{class:`is-${r}`,style:{flexGrow:t[r]}},r):null)})}function Ts({counts:t}){return e("span",{class:"access-counts",children:[e("span",{children:[e("span",{class:"dot is-allow","aria-hidden":"true"}),e("strong",{children:t.allow})," allow"]}),e("span",{children:[e("span",{class:"dot is-ask","aria-hidden":"true"}),e("strong",{children:t.ask})," ask"]}),e("span",{children:[e("span",{class:"dot","aria-hidden":"true"}),e("strong",{children:t.deny+t.none})," blocked"]})]})}function Xt({selected:t,onClick:n,children:r,title:s}){return e("button",{type:"button",class:"chip","aria-pressed":t,onClick:n,title:s,children:r})}function nt({values:t,onChange:n,placeholder:r,label:s,tone:l}){const[i,o]=C(""),a=()=>{const h=i.trim();h&&!t.includes(h)&&n([...t,h]),o("")};return e("div",{class:"list-input",children:[e("span",{class:"list-input-label",children:[l&&e("span",{class:R("dot",`is-${l}`),"aria-hidden":"true"}),s]}),e("div",{class:"list-input-box",children:[t.map(h=>e("span",{class:"token",children:[e("code",{children:h}),e("button",{type:"button","aria-label":`Remove ${h}`,onClick:()=>n(t.filter(u=>u!==h)),children:e(De,{size:12,"aria-hidden":"true"})})]},h)),e("input",{value:i,placeholder:t.length?"":r,"aria-label":s,autocomplete:"off",spellcheck:!1,onInput:h=>o(h.currentTarget.value),onKeyDown:h=>{h.key==="Enter"||h.key===","?(h.preventDefault(),a()):h.key==="Backspace"&&!i&&t.length&&n(t.slice(0,-1))},onBlur:a})]})]})}function Zt({rows:t,onChange:n,keyPlaceholder:r,valuePlaceholder:s,addLabel:l,label:i}){const o=(a,h,u)=>n(t.map((c,v)=>v===a?{...c,[h]:u}:c));return e("div",{class:"kv-editor",children:[t.map((a,h)=>e("div",{class:"kv-editor-row",children:[e("input",{class:"input",value:a.key,placeholder:r,spellcheck:!1,autocomplete:"off","aria-label":`${i} ${h+1} name`,onInput:u=>o(h,"key",u.currentTarget.value)}),e("input",{class:"input",value:a.value,placeholder:s,spellcheck:!1,autocomplete:"off","aria-label":`${i} ${h+1} value`,onInput:u=>o(h,"value",u.currentTarget.value)}),e(L,{variant:"ghost",icon:!0,"aria-label":`Remove ${a.key||`${i} ${h+1}`}`,onClick:()=>n(t.filter((u,c)=>c!==h)),children:e(De,{size:14,"aria-hidden":"true"})})]},h)),e(L,{size:"sm",variant:"ghost",onClick:()=>n([...t,{key:"",value:""}]),children:[e(kt,{size:14,"aria-hidden":"true"}),l]})]})}function pr({change:t}){const n=s=>s?`${s}
|
|
207
|
+
`:"",r=As(n(t.before),n(t.after));return e("pre",{class:"diff",children:r.flatMap((s,l)=>s.value.replace(/\n$/,"").split(`
|
|
208
|
+
`).map((i,o)=>e("span",{class:R("diff-line",s.added&&"is-added",s.removed&&"is-removed"),children:[e("span",{class:"diff-sign","aria-hidden":"true",children:s.added?"+":s.removed?"−":" "}),i||" "]},`${l}-${o}`)))})}function Fe({open:t,onClose:n,title:r,subtitle:s,children:l,footer:i,wide:o,dialog:a,class:h,labelledBy:u}){const c=re(null),v=re(`sheet-${Math.random().toString(36).slice(2,8)}`).current;return U(()=>{var d,b;if(!t)return;const y=document.activeElement;(b=((d=c.current)==null?void 0:d.querySelector(".sheet-body input:not([disabled]):not([readonly]), .sheet-body textarea"))??c.current)==null||b.focus();const g=f=>{f.key==="Escape"&&(f.stopPropagation(),n())};return window.addEventListener("keydown",g),()=>{var f;window.removeEventListener("keydown",g),(f=y==null?void 0:y.focus)==null||f.call(y)}},[t]),t?e("div",{class:R("scrim",a&&"is-dialog"),onMouseDown:y=>y.target===y.currentTarget&&n(),children:e("div",{class:R("sheet",o&&"is-wide",h),role:"dialog","aria-modal":"true","aria-labelledby":u??v,tabIndex:-1,ref:c,children:[e("header",{class:"sheet-head",children:[e("div",{class:"sheet-head-text",children:[e("h2",{id:v,children:r}),s&&e("div",{class:"sheet-sub",children:s})]}),e(L,{variant:"ghost",icon:!0,size:"sm","aria-label":"Close",onClick:n,children:e(De,{size:16,"aria-hidden":"true"})})]}),e("div",{class:"sheet-body",children:l}),i&&e("footer",{class:"sheet-foot",children:i})]})}):null}function $t({trigger:t,items:n,label:r,placement:s="down-right",heading:l}){const[i,o]=C(!1),a=re(null),[h,u]=s.split("-");return U(()=>{var m;if(!i)return;const c=(m=a.current)==null?void 0:m.querySelector('[role="menuitem"]');c==null||c.focus();const v=g=>{var d;(d=a.current)!=null&&d.contains(g.target)||o(!1)},y=g=>{var d,b,f,w;if(g.key==="Escape"){g.stopPropagation(),o(!1),(b=(d=a.current)==null?void 0:d.querySelector("[aria-haspopup]"))==null||b.focus();return}if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();const p=Array.from(((f=a.current)==null?void 0:f.querySelectorAll('[role="menuitem"]'))??[]),k=p.indexOf(document.activeElement),N=g.key==="ArrowDown"?k+1:k-1;(w=p[(N+p.length)%p.length])==null||w.focus()}};return window.addEventListener("mousedown",v),window.addEventListener("keydown",y,!0),()=>{window.removeEventListener("mousedown",v),window.removeEventListener("keydown",y,!0)}},[i]),e("div",{class:"menu-anchor",ref:a,children:[t({"aria-haspopup":"menu","aria-expanded":i,onClick:()=>o(!i)}),i&&e("div",{class:R("menu",`is-${h}`,`is-${u}`),role:"menu","aria-label":r,children:[l&&e("div",{class:"menu-label",children:l}),n.map(c=>e(O,{children:[c.separatorBefore&&e("div",{class:"menu-sep",role:"separator"}),e("button",{type:"button",role:"menuitem",class:R("menu-item",c.danger&&"is-danger"),onClick:()=>{o(!1),c.onSelect()},children:[e("span",{children:c.label}),c.hint&&e("span",{class:"menu-hint",children:c.hint}),c.sub&&e("small",{children:c.sub})]},c.id)]}))]})]})}function de({title:t,icon:n,children:r}){return e("div",{class:"empty",children:[n,e("p",{class:"empty-title",children:t}),r]})}function ne({tone:t="info",children:n}){return e("div",{class:R("notice",t!=="info"&&`is-${t}`),role:t==="error"?"alert":void 0,children:[t==="error"?e(Rn,{size:15,"aria-hidden":"true"}):t==="warn"?e(gs,{size:15,"aria-hidden":"true"}):null,e("div",{children:n})]})}async function Ds(t){try{await navigator.clipboard.writeText(t);return}catch{}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();const r=document.execCommand("copy");if(n.remove(),!r)throw new Error("Copy failed. Select the text and copy it by hand.")}function en({value:t,label:n="Copy",onCopied:r,variant:s="default",size:l="sm"}){const[i,o]=C(null);return U(()=>{if(!i)return;const a=setTimeout(()=>o(null),2e3);return()=>clearTimeout(a)},[i]),e(L,{variant:s,size:l,onClick:async()=>{try{await Ds(t),o("yes"),r==null||r()}catch{o("failed")}},children:[i==="yes"&&e(In,{size:14,"aria-hidden":"true"}),i==="yes"?"Copied":i==="failed"?"Select and copy":n]})}function fr(t=1e3){const[n,r]=C(()=>Date.now());return U(()=>{const s=setInterval(()=>r(Date.now()),t);return()=>clearInterval(s)},[t]),n}function Ye(t,n=Date.now()){const r=new Date(t);if(Number.isNaN(r.getTime()))return t;const s=Math.round((n-r.getTime())/1e3);return s<45?"just now":s<3600?`${Math.round(s/60)}m ago`:s<86400?`${Math.round(s/3600)}h ago`:new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(r)}const Ns=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),Es=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"});function Ps(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:Ns.format(n)}function ve(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:Es.format(n)}function tn(t){if(!Number.isFinite(t)||t<0)return"—";if(t<1e3)return`${Math.round(t)}ms`;const n=t/1e3;if(n<60)return`${n<10?n.toFixed(1).replace(/\.0$/,""):Math.round(n)}s`;const r=Math.round(n/60);if(r<60)return`${r}m`;const s=Math.floor(r/60),l=r%60;return l?`${s}h ${l}m`:`${s}h`}function At(t,n){if(!t)return null;const r=Date.parse(t);if(Number.isNaN(r))return null;const s=Math.ceil((r-n)/1e3);if(s<=0)return{label:"Expired",urgent:!0,expired:!0};if(s<60)return{label:`${s}s`,urgent:!0,expired:!1};const l=Math.floor(s/60),i=s%60;if(l<60)return{label:l<10&&i>0?`${l}m ${String(i).padStart(2,"0")}s`:`${l}m`,urgent:l<2,expired:!1};const o=Math.floor(l/60),a=l%60;return{label:a>0?`${o}h ${a}m`:`${o}h`,urgent:!1,expired:!1}}function gr(t,n,r){if(!n)return null;const s=Date.parse(t),l=Date.parse(n);return Number.isNaN(s)||Number.isNaN(l)||l<=s?null:Math.min(1,Math.max(0,(l-r)/(l-s)))}function Is(t){const n=t.indexOf("/");return n<=0?{provider:null,name:t}:{provider:t.slice(0,n),name:t.slice(n+1)}}function Ie({tool:t,class:n}){const{provider:r,name:s}=Is(t);return e("code",{class:R("tool",n),children:[r&&e("span",{class:"tool-prov",children:[r,"/"]}),s]})}function mr(t){switch(t.kind){case"call":return{kindLabel:"Exact call",target:t.tool};case"tool":return{kindLabel:"Tool",target:t.tool};case"tier":return{kindLabel:t.tier==="read"?"Read-only tools":"Non-destructive tools",target:t.provider?`${t.provider}/*`:"all providers"};case"provider":return{kindLabel:"Provider",target:`${t.provider}/*`};case"profile":return{kindLabel:"Profile",target:t.profile}}}function yr(t,n=72){if(t===null)return"null";if(t===void 0)return"—";if(typeof t=="string"){const s=t.replace(/\s+/g," ").trim();return s.length>n?`${s.slice(0,n-1)}…`:s}if(typeof t=="number"||typeof t=="boolean")return String(t);const r=JSON.stringify(t);return r.length>n?`${r.slice(0,n-1)}…`:r}function zs(t,n=3){return Object.entries(t).filter(([r])=>r!=="_airlock").slice(0,n).map(([r,s])=>`${r}=${yr(s,48)}`).join(" ")}function Ms(t){if(t&&typeof t=="object")return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(String(t)),null,2)}catch{return String(t??"")}}function Ls(t){if(t&&typeof t=="object"&&!Array.isArray(t))return t;if(typeof t=="string"&&t.trim())try{const n=JSON.parse(t);if(n&&typeof n=="object"&&!Array.isArray(n))return n}catch{return null}return null}function Os({value:t}){return Array.isArray(t)&&t.length<=12&&t.every(n=>n===null||typeof n!="object")?e("span",{class:"arr",children:t.map((n,r)=>e("span",{children:String(n)},r))}):t!==null&&typeof t=="object"?e("pre",{children:JSON.stringify(t,null,2)}):e(O,{children:t===void 0?"—":String(t)})}function Ct({value:t,title:n="Arguments",bare:r}){const[s,l]=C(!1),i=Ls(t),o=i?Object.entries(i).filter(([h])=>h!=="_airlock"):null,a=!o||s?e("pre",{class:"code-block",children:Ms(i??t)}):o.length===0?e("p",{class:"ink-3",children:"No arguments"}):e("dl",{class:"kv",children:o.map(([h,u])=>e("div",{children:[e("dt",{children:h}),e("dd",{children:e(Os,{value:u})})]},h))});return r?a:e("section",{children:[e("h3",{class:"block-title",children:[n,o&&o.length>0&&e("span",{class:"ink-3",children:o.length}),o&&o.length>0&&e("button",{type:"button",class:"text-btn",onClick:()=>l(!s),children:s?"Table":"JSON"})]}),a]})}function ut(t){const n=t.toLowerCase();return/error|timeout|disconnected|canary/.test(n)?"error":/denied|injection|blocked/.test(n)?"denied":/hitl|ask|pending|plan/.test(n)?"approval":"allowed"}const Rs=[{id:"all",label:"All"},{id:"allowed",label:"Allowed"},{id:"approval",label:"Approvals"},{id:"denied",label:"Denied"},{id:"error",label:"Errors"}],js={allowed:"is-allow",approval:"is-ask",denied:"is-deny",error:"is-deny"},nn={allowed:"Allowed",denied:"Denied",hitl_approved:"Approved",hitl_denied:"Rejected",injection_blocked:"Injection blocked",error:"Error"};function Bs(t){if(nn[t])return nn[t];const n=t.replace(/_/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}function Us(){const{state:t,pending:n,activity:r,eventTick:s}=V(),[l,i]=C([]),[o,a]=C(""),[h,u]=C(!1),[c,v]=C(null),[y,m]=C(""),[g,d]=C(""),[b,f]=C("all"),[w,p]=C(!1),[k,N]=C(!1),I=()=>(p(!0),q.logs({agent:y,limit:"250"}).then(x=>{i(x.entries??[]),a(x.dbPath),v(x.error??null)}).catch(x=>v(x.message)).finally(()=>{p(!1),u(!0)}));U(()=>{const x=setTimeout(()=>void I(),120);return()=>clearTimeout(x)},[y,s,n.length]);const z=g.trim().toLowerCase(),$=ee(()=>z?l.filter(x=>`${x.tool} ${x.agent_id} ${x.result} ${x.hitl_code??""} ${x.error??""} ${typeof x.args=="string"?x.args:JSON.stringify(x.args??"")}`.toLowerCase().includes(z)):l,[l,z]),_=ee(()=>{const x={all:$.length,allowed:0,approval:0,denied:0,error:0};for(const M of $)x[ut(M.result)]+=1;return x},[$]),E=b==="all"?$:$.filter(x=>ut(x.result)===b),T=r.filter(x=>!y||x.agentId===y),S=k?T.slice(0,20):T.slice(0,3),A=Array.from(new Set([...Object.keys((t==null?void 0:t.agents)??{}),...l.map(x=>x.agent_id)])).sort(),D=n.filter(x=>!y||x.agentId===y).length;return e(O,{children:[e("header",{class:"topbar",children:[e("div",{class:"topbar-title",children:[e("h1",{children:"Activity"}),e("span",{class:"topbar-meta",children:[h?Z(l.length,"call"):"Loading…",D>0&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("a",{class:"link",href:"#/inbox",children:[D," waiting in Inbox"]})]})]})]}),e("div",{class:"topbar-actions",children:[e(Ks,{}),e(L,{variant:"ghost",icon:!0,busy:w,"aria-label":"Refresh activity",title:"Refresh",onClick:()=>void I(),children:e(Ee,{size:14,"aria-hidden":"true"})})]})]}),e("div",{class:"page",children:[T.length>0&&e("section",{"aria-label":"Agent notes",children:[e("h2",{class:"section-label",children:["Agent notes ",e("span",{class:"ink-3",children:T.length})]}),e("ul",{class:"notes",children:S.map(x=>e("li",{class:"note",children:[e("span",{class:R("dot",x.severity==="error"?"is-deny":x.severity==="warning"?"is-ask":x.severity==="success"?"is-allow":""),"aria-hidden":"true"}),e("span",{class:"note-title",children:x.title}),e("span",{class:"note-meta",title:ve(x.createdAt),children:[x.agentId," · ",Ye(x.createdAt)]}),x.body&&e("span",{class:"note-body",children:x.body})]},x.id))}),T.length>3&&e("button",{type:"button",class:"text-btn",style:{margin:"-18px 0 28px"},onClick:()=>N(!k),children:k?"Show fewer notes":`Show ${T.length-3} more`})]}),e("div",{class:"toolbar",children:[e("div",{class:"segmented",role:"tablist","aria-label":"Filter by result",children:Rs.map(x=>e("button",{type:"button",role:"tab","aria-selected":b===x.id,onClick:()=>f(x.id),children:[x.label,e("span",{class:"seg-count",children:_[x.id]})]},x.id))}),e("span",{class:"toolbar-spacer"}),A.length>1&&e("select",{class:"select",value:y,onChange:x=>m(x.currentTarget.value),"aria-label":"Filter by agent",children:[e("option",{value:"",children:"All agents"}),A.map(x=>e("option",{value:x,children:x},x))]}),e(Pe,{value:g,onInput:d,placeholder:"Search tool, args, code",label:"Search activity"})]}),c&&e("p",{class:"notice is-warn",style:{marginBottom:"16px"},children:c}),h?E.length===0?e(de,{title:l.length===0?"No tool calls yet":"No calls match these filters",icon:e(An,{size:22,"aria-hidden":"true"}),children:l.length>0?e(L,{size:"sm",onClick:()=>{d(""),f("all"),m("")},children:"Clear filters"}):o&&e("p",{children:["Reading ",e("code",{children:o})]})}):e("div",{class:"table-scroll",children:e("table",{class:"log",children:[e("thead",{children:e("tr",{children:[e("th",{scope:"col",children:"Time"}),e("th",{scope:"col",children:"Result"}),e("th",{scope:"col",class:"hide-sm",children:"Agent"}),e("th",{scope:"col",children:"Tool"}),e("th",{scope:"col",class:"col-num hide-sm",children:"Duration"})]})}),e("tbody",{children:E.map((x,M)=>e(Ws,{entry:x},x.id??`${x.ts}-${M}`))})]})}):e("div",{"aria-busy":"true",children:[0,1,2,3,4].map(x=>e("div",{style:{padding:"12px 4px",borderBottom:"1px solid var(--line)"},children:e("span",{class:"skeleton",style:{width:`${60-x*7}%`}})},x))})]})]})}function Ks(){const t=()=>{try{return localStorage.getItem("airlock:notifs")==="true"&&"Notification"in window&&Notification.permission==="granted"}catch{return!1}},[n,r]=C(t);return"Notification"in window?e(L,{variant:"ghost",size:"sm","aria-pressed":n,title:n?"Desktop alerts are on":"Get a desktop alert for new requests",onClick:async()=>{const l=!n&&await Notification.requestPermission()==="granted";try{localStorage.setItem("airlock:notifs",String(l))}catch{}r(l)},children:[n?e(rs,{size:14,"aria-hidden":"true"}):e(ns,{size:14,"aria-hidden":"true"}),n?"Alerts on":"Alerts off"]}):null}function Ws({entry:t}){const[n,r]=C(!1),s=ut(t.result),l=s==="error"||/injection/.test(t.result)?"is-bad":"",i=()=>r(!n);return e(O,{children:[e("tr",{class:R("row",n&&"is-open"),tabIndex:0,"aria-expanded":n,onClick:i,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),i())},children:[e("td",{class:"col-time",title:ve(t.ts),children:Ps(t.ts)}),e("td",{class:"col-result",children:e("span",{class:R("result",l),children:[e("span",{class:R("dot",js[s]),"aria-hidden":"true"}),Bs(t.result)]})}),e("td",{class:"col-agent hide-sm",children:t.agent_id}),e("td",{class:"col-tool",children:[e(Ie,{tool:t.tool}),t.error&&!n&&e("span",{class:"err",children:t.error})]}),e("td",{class:"col-num hide-sm",children:t.duration_ms!=null?tn(t.duration_ms):"—"})]}),n&&e("tr",{class:"log-detail",children:e("td",{colSpan:5,children:e("div",{class:"log-detail-inner",children:[e("div",{class:"log-facts",children:[e("span",{children:ve(t.ts)}),e("span",{children:["Agent ",e("code",{children:t.agent_id})]}),t.hitl_code&&e("span",{children:["Approval ",e("code",{children:t.hitl_code})]}),t.request_id&&e("span",{children:["Request ",e("code",{children:t.request_id})]}),t.duration_ms!=null&&e("span",{children:["Took ",e("code",{children:tn(t.duration_ms)})]})]}),t.error&&e("p",{class:"notice is-error",children:t.error}),e(Ct,{value:t.args})]})})})]})}const qs={create:"New",update:"Changed",delete:"Removed",rotate:"New key for"};function _r({preview:t}){return e("div",{class:"change-list",children:[t.changes.map(n=>e("section",{class:"change",children:[e("header",{class:"change-head",children:[e("span",{class:R("action",`is-${n.action}`),children:qs[n.action]}),e("span",{class:"ink-3",children:n.kind}),e("code",{children:n.id})]}),e(pr,{change:n})]},`${n.kind}:${n.id}`)),e(vr,{preview:t})]})}function vr({preview:t}){const n=t.diagnostics.filter(r=>r.level==="error");return e(O,{children:[n.length>0&&e(ne,{tone:"error",children:e("ul",{children:n.map((r,s)=>e("li",{children:[r.agent?e("strong",{children:[r.agent,": "]}):null,r.message]},s))})}),t.warnings.length>0&&e(ne,{tone:"warn",children:e("ul",{children:t.warnings.map(r=>e("li",{children:r},r))})})]})}function Gs({ops:t,title:n,open:r,onClose:s,onApplied:l,applyLabel:i="Apply changes",danger:o,successMessage:a="Saved. The gateway reloads its config on its own.",note:h,initialPreview:u}){const{setState:c,reveal:v,toast:y}=V(),[m,g]=C(u??null),[d,b]=C(null),[f,w]=C(!1);U(()=>{r&&(b(null),q.preview(t).then(g,k=>b(k.message)))},[r,JSON.stringify(t)]);const p=async()=>{if(m){w(!0),b(null);try{const k=await q.apply(t,m.version);if(c(k.state),k.createdKeys.length){const N=new Set(t.filter(I=>I.op==="rotate_agent_key").map(I=>I.id));v(k.createdKeys.map(I=>({...I,rotated:N.has(I.agentId)})))}else y(a);l==null||l(k),s()}catch(k){k instanceof wt&&k.status===409?(b(`${k.message} The diff below is fresh; check it and apply again.`),q.preview(t).then(g,()=>{})):b(k.message)}finally{w(!1)}}};return e(Fe,{open:r,onClose:s,title:n,subtitle:"Changes to airlock.yaml. The gateway picks them up on its own.",wide:!0,footer:e(O,{children:[e(L,{variant:"ghost",onClick:s,children:"Cancel"}),e(L,{variant:o?"danger":"primary",busy:f,disabled:!(m!=null&&m.ok),onClick:p,children:i})]}),children:e("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[h&&e(ne,{tone:"warn",children:h}),d&&e(ne,{tone:"error",children:d}),m?e(_r,{preview:m}):!d&&e("p",{class:"ink-3",children:"Preparing the diff…"})]})})}const Hs=["Make a read-only agent for Claude Code on my laptop","Create a profile for GitHub that reads freely but asks before writing","Which of my agents can delete things without asking?"],Fs={get_config:"Read your agents and profiles",list_tools:"Looked through the tool list",preview_changes:"Checked a draft against the config",propose_changes:"Prepared a proposal","propose_changes:failed":"A draft did not pass validation","preview_changes:failed":"A draft did not pass validation"};function Js(){const{assistantOpen:t,setAssistantOpen:n,meta:r,setState:s,reveal:l,toast:i}=V(),[o,a]=C([]),[h,u]=C([]),[c,v]=C(""),[y,m]=C(!1),[g,d]=C(null),[b,f]=C({}),[w,p]=C(null),k=re(null),N=re(null);U(()=>{t&&setTimeout(()=>{var $;return($=N.current)==null?void 0:$.focus()},50)},[t]),U(()=>{var $;($=k.current)==null||$.scrollTo({top:k.current.scrollHeight,behavior:"smooth"})},[h.length,y]),U(()=>{if(!t)return;const $=_=>_.key==="Escape"&&n(!1);return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[t]);const I=async $=>{const _=$.trim();if(!_||y)return;const E={role:"user",content:_},T=[...o,E];a(T),u(S=>[...S,{message:E,proposals:[]}]),v(""),m(!0),d(null);try{const S=await q.chat(T);a([...T,...S.messages]);const A=S.messages.filter(P=>P.role==="assistant"),D=new Set(S.messages.filter(P=>{var W;return P.role==="tool"&&((W=P.content)==null?void 0:W.startsWith('{"error"'))}).map(P=>P.tool_call_id)),x=S.messages.filter(P=>{var W;return P.role==="assistant"&&((W=P.tool_calls)==null?void 0:W.length)}).flatMap(P=>P.tool_calls.map(W=>D.has(W.id)?`${W.function.name}:failed`:W.function.name)),M=[...A].reverse().find(P=>{var W;return(W=P.content)==null?void 0:W.trim()});u(P=>[...P,{message:{role:"assistant",content:(M==null?void 0:M.content)??"",tool_calls:x.map((W,ae)=>({id:String(ae),type:"function",function:{name:W,arguments:""}}))},proposals:S.proposals}])}catch(S){d(S.message)}finally{m(!1)}},z=async $=>{p($.id);try{const _=await q.apply($.ops,$.preview.version);s(_.state),f(T=>({...T,[$.id]:"applied"})),_.createdKeys.length?l(_.createdKeys):i(`Applied: ${$.title}`);const E=$.ops.find(T=>T.op==="create_agent")??$.ops.find(T=>T.op==="create_profile");E&&Ne(E.op==="create_agent"?"agents":"profiles",E.id),a(T=>[...T,{role:"user",content:`(I applied "${$.title}".)`}])}catch(_){i(`${_.message} Ask the assistant to refresh its proposal.`,"error")}finally{p(null)}};return e("aside",{class:R("assistant",t&&"is-open"),"aria-hidden":!t,inert:!t,"aria-label":"Policy assistant",children:[e("header",{class:"sheet-head",children:[e("div",{class:"sheet-head-text",children:[e("h2",{children:"Policy assistant"}),(r==null?void 0:r.assistant.model)&&e("p",{class:"sheet-sub",children:r.assistant.model})]}),e(L,{variant:"ghost",icon:!0,size:"sm","aria-label":"Close assistant",onClick:()=>n(!1),children:e(De,{size:16,"aria-hidden":"true"})})]}),r!=null&&r.assistant.enabled?e(O,{children:[e("div",{class:"assistant-log",ref:k,"aria-live":"polite",children:[h.length===0&&e("div",{class:"assistant-intro",children:[e("p",{children:"Describe the agent or profile you want. I'll check your tools and draft it for you to review."}),e("ul",{class:"starters",children:Hs.map($=>e("li",{children:e("button",{type:"button",onClick:()=>I($),children:[e(ts,{size:14,"aria-hidden":"true"}),$]})},$))})]}),h.map(($,_)=>{var E;return e("div",{class:R("turn",`is-${$.message.role}`),children:[(E=$.message.tool_calls)!=null&&E.length?e("ul",{class:"assistant-steps",children:Array.from(new Set($.message.tool_calls.map(T=>T.function.name))).map(T=>e("li",{class:R(T.endsWith(":failed")&&"is-failed"),children:[T.endsWith(":failed")?e(De,{size:13,"aria-hidden":"true"}):e(In,{size:13,"aria-hidden":"true"}),Fs[T]??T.replace(":failed"," failed")]},T))}):null,$.message.content&&e("p",{class:"bubble",children:$.message.content}),$.proposals.map(T=>{const S=b[T.id]??"open";return e("article",{class:R("proposal",`is-${S}`),children:[e("h3",{children:T.title}),T.summary&&e("p",{children:T.summary}),e(_r,{preview:T.preview}),e("footer",{class:"proposal-foot",children:S==="open"?e(O,{children:[e(L,{size:"sm",variant:"ghost",onClick:()=>{f(A=>({...A,[T.id]:"dismissed"})),a(A=>[...A,{role:"user",content:`(I dismissed "${T.title}".)`}])},children:"Dismiss"}),e(L,{size:"sm",variant:"primary",busy:w===T.id,onClick:()=>z(T),children:"Apply"})]}):e("span",{class:"ink-3",children:S==="applied"?"Applied":"Dismissed"})})]},T.id)})]},_)}),y&&e("p",{class:"thinking",children:"Working on it…"}),g&&e(ne,{tone:"error",children:g})]}),e("form",{class:"assistant-input",onSubmit:$=>{$.preventDefault(),I(c)},children:[e("textarea",{ref:N,class:"textarea",name:"assistant-message",rows:3,value:c,placeholder:"An agent for Codex on my build server that reads GitHub and asks before writing…","aria-label":"Message",onInput:$=>v($.currentTarget.value),onKeyDown:$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),I(c))}}),e("div",{class:"assistant-input-foot",children:[e("span",{children:"Nothing changes until you apply a proposal."}),e(L,{type:"submit",variant:"primary",size:"sm",busy:y,disabled:!c.trim(),children:"Send"})]})]})]}):e("div",{class:"assistant-setup",children:[e("p",{children:"The assistant drafts agents and profiles from a plain description. It reads your rules and the tool list, never your keys, and it cannot call any tool. Every change it suggests waits for you to apply it."}),e("p",{children:"Point the dashboard at any OpenAI-compatible endpoint and restart it:"}),e("pre",{class:"code-block",children:`AIRLOCK_ASSISTANT_BASE_URL=https://openrouter.ai/api/v1
|
|
209
|
+
AIRLOCK_ASSISTANT_MODEL=your-model-id
|
|
210
|
+
AIRLOCK_ASSISTANT_API_KEY=your-api-key`})]})]})}const Oe={deny:3,ask:2,allow:1};function St(t,n){if(t===n)return t.length+1;if(t.endsWith("/*")){const r=t.slice(0,-1);return n.startsWith(r)&&!n.slice(r.length).includes("/")?r.length:-1}if(t.endsWith("*")){const r=t.slice(0,-1);return n.startsWith(r)?r.length:-1}return-1}function rt(t,n){let r=null;for(const s of t){const l=St(s,n);l>=0&&(!r||l>r.score)&&(r={pattern:s,score:l})}return r}function $e(t,n){const r=rt(t.deny,n),s=rt(t.ask,n),l=rt(t.allow,n),i=Math.max((r==null?void 0:r.score)??-1,(s==null?void 0:s.score)??-1,(l==null?void 0:l.score)??-1);return i<0?{decision:"none"}:r&&r.score===i?{decision:"deny",pattern:r.pattern}:s&&s.score===i?{decision:"ask",pattern:s.pattern}:{decision:"allow",pattern:l.pattern}}function br(t,n,r,s,l=new Set,i){for(const o of t){if(l.has(o))continue;l.add(o);const a=n[o];if(!a)continue;br(a.extends,n,r,s,l,i);const h=o===i?`default profile "${o}"`:`profile "${o}"`;for(const u of["deny","ask","allow"])for(const c of a[u]){const v=St(c,r);v>=0&&s.push({decision:u,pattern:c,score:v,exact:c===r,source:h})}}}function Vs(t,n,r,s,l="own rules"){const i=r.trim();if(!i)return{tool:"",decision:"none",matches:[],reason:"Enter a tool name to test access."};const o=[],a=s&&!t.extends.includes(s)?[s,...t.extends]:t.extends;br(a,n,i,o,new Set,s);for(const d of["deny","ask","allow"])for(const b of t[d]){const f=St(b,i);f>=0&&o.push({decision:d,pattern:b,score:f,exact:b===i,source:l})}if(o.length===0)return{tool:i,decision:"none",matches:[],reason:"No allow, ask, or deny rule matched — Airlock blocks unmatched tools by default."};const h=[],u=new Set;for(const d of o){const b=`${d.decision}\0${d.pattern}\0${d.source}`;u.has(b)||(u.add(b),h.push(d))}h.sort((d,b)=>b.score!==d.score?b.score-d.score:Oe[b.decision]!==Oe[d.decision]?Oe[b.decision]-Oe[d.decision]:d.source===l&&b.source!==l?-1:b.source===l&&d.source!==l?1:d.source.localeCompare(b.source));const c=h.map((d,b)=>({...d,isWinner:b===0})),v=c[0],y=c.filter(d=>d.score===v.score&&d.decision!==v.decision),m=v.exact?"exact match":`wildcard (specificity ${v.score})`;let g=`${v.decision.toUpperCase()} via "${v.pattern}" (${m}) from ${v.source}.`;if(y.length>0){const d=Array.from(new Set(y.map(b=>b.decision))).join(", ");g+=` Tied specificity broke by precedence (deny > ask > allow) over ${d}.`}return{tool:i,decision:v.decision,winner:v,matches:c,reason:g}}function ze(t,n,r=new Set){const s={allow:[],ask:[],deny:[]};for(const l of t){if(r.has(l))continue;r.add(l);const i=n[l];if(!i)continue;const o=ze(i.extends,n,r);for(const a of["allow","ask","deny"])s[a].push(...o[a],...i[a])}return s}function kr(t,n,r){const s=r&&!t.extends.includes(r)?[r,...t.extends]:t.extends,l=ze(s,n);return{allow:[...l.allow,...t.allow],ask:[...l.ask,...t.ask],deny:[...l.deny,...t.deny]}}function Qe(t,n){const r={allow:0,ask:0,deny:0,none:0};for(const s of n)r[$e(t,s.name).decision]++;return r}function wr(t,n,r){const s={...t,allow:t.allow.filter(l=>l!==n),ask:t.ask.filter(l=>l!==n),deny:t.deny.filter(l=>l!==n)};return r&&(s[r]=[...s[r],n]),s}function Ys(t,n,r){const s=i=>i===`${n}/*`||i.startsWith(`${n}/`),l={...t,allow:t.allow.filter(i=>!s(i)),ask:t.ask.filter(i=>!s(i)),deny:t.deny.filter(i=>!s(i))};return r&&(l[r]=[...l[r],`${n}/*`]),l}function Qs(t,n){let r=t;for(const s of n)r=wr(r,s.name,s.recommended);return r}function Xs(t){const n=new Map;for(const r of t){const s=n.get(r.provider)??[];s.push(r),n.set(r.provider,s)}return Array.from(n.entries()).sort(([r],[s])=>r.localeCompare(s))}const Zs=/^[A-Za-z0-9_.-]+$/;function Ke(t,n){return t.length===n.length&&t.every((r,s)=>r===n[s])}function pt(){return{extends:[],allow:[],ask:[],deny:[],inheritDefault:!0,approvalMode:null,exec:{allow:[],ask:[],deny:[]},http:{domainAllowlist:[]}}}function xr(t,n){const{state:r}=V();return ee(()=>{const s=(r==null?void 0:r.profiles)??{},l=t==="agent"&&n.inheritDefault?r==null?void 0:r.defaultProfile:void 0,i=kr(n,s,l),o=c=>c.filter(v=>v.endsWith("*")),a=l&&!n.extends.includes(l)?[l,...n.extends]:n.extends,h=ze(a,s),u={allow:[...h.allow,...o(n.allow)],ask:[...h.ask,...o(n.ask)],deny:[...h.deny,...o(n.deny)]};return{effective:i,background:u,defaultProfile:l}},[t,n,r])}const ft={allow:"Allow",ask:"Ask",deny:"Deny"};function $r({kind:t,selfId:n,draft:r,onChange:s,aside:l}){const{state:i,tools:o,toolsLoaded:a,toolsLoading:h,toolErrors:u,refreshTools:c}=V(),v=(i==null?void 0:i.profiles)??{},{effective:y,background:m,defaultProfile:g}=xr(t,r),d=ee(()=>Qe(y,o),[y,o]),b=o.some(p=>p.name==="exec/run")||!!(i!=null&&i.providers.exec),f=["none","deny"].includes($e(y,"exec/run").decision)&&r.exec.allow.length+r.exec.ask.length+r.exec.deny.length>0,w=o.some(p=>p.provider==="http")||!!(i!=null&&i.providers.http);return e("div",{class:"policy-layout",children:[e("div",{class:"policy",children:[e("section",{class:"policy-section",children:[e("div",{class:"policy-section-head",children:e("div",{children:[e("h2",{children:"Inherits"}),e("p",{children:"Profiles are shared rule sets. Rules below override them by specificity."})]})}),e(ti,{kind:t,selfId:n,draft:r,onChange:s,profiles:v,tools:o})]}),e("section",{class:"policy-section",children:[e("div",{class:"policy-section-head",children:[e("div",{children:[e("h2",{children:"Tools"}),e("p",{children:"Allow runs right away, Ask waits for you, Deny blocks. Anything unmatched is blocked."})]}),e(L,{variant:"ghost",size:"sm",busy:h,onClick:()=>c(),title:"Ask each provider for its tools again",children:[e(Ee,{size:13,"aria-hidden":"true"}),"Reload"]})]}),u.length>0&&e("div",{style:{marginBottom:"12px"},children:e(ne,{tone:"warn",children:e("ul",{children:u.map(p=>e("li",{children:p},p))})})}),a?e(ni,{draft:r,onChange:s,tools:o,effective:y,background:m,profiles:v}):e("div",{"aria-busy":"true",children:[0,1,2].map(p=>e("div",{style:{padding:"14px 0",borderTop:"1px solid var(--line)"},children:e("span",{class:"skeleton",style:{width:`${40-p*8}%`}})},p))}),e("details",{class:"disclosure",children:[e("summary",{children:[e(be,{size:13,"aria-hidden":"true"}),"Raw patterns"]}),e("div",{class:"disclosure-body",children:[e("p",{class:"field-help",style:{marginBottom:"12px"},children:[e("code",{children:"github/*"})," matches every GitHub tool and ",e("code",{children:"github/list*"})," a prefix. The most specific pattern wins; ties go deny, then ask, then allow."]}),e("div",{class:"pattern-grid",children:["allow","ask","deny"].map(p=>e(nt,{tone:p,label:ft[p],placeholder:"provider/tool",values:r[p],onChange:k=>s({...r,[p]:k})},p))})]})]})]}),t==="agent"&&b&&e("section",{class:"policy-section",children:[e("div",{class:"policy-section-head",children:e("div",{children:[e("h2",{children:"Shell commands"}),e("p",{children:["Narrow what ",e("code",{children:"exec/run"})," may execute by command prefix. Leave empty to use the tool rule alone."]})]})}),f&&e("div",{style:{marginBottom:"12px"},children:e(ne,{tone:"warn",children:[e("code",{children:"exec/run"})," is blocked for this agent, so these rules do nothing. Set it to Allow or Ask above."]})}),e("div",{class:"pattern-grid",children:["allow","ask","deny"].map(p=>e(nt,{tone:p,label:ft[p],placeholder:p==="deny"?"rm -rf*":p==="ask"?"git push*":"git status*",values:r.exec[p],onChange:k=>s({...r,exec:{...r.exec,[p]:k}})},p))})]}),t==="agent"&&w&&e("section",{class:"policy-section",children:[e("div",{class:"policy-section-head",children:e("div",{children:[e("h2",{children:"Web requests"}),e("p",{children:"Domains the HTTP tool may reach. Empty means no extra domain restriction."})]})}),e(nt,{label:"Allowed domains",placeholder:"api.github.com",values:r.http.domainAllowlist,onChange:p=>s({...r,http:{domainAllowlist:p}})})]}),t==="agent"&&e("section",{class:"policy-section",children:[e("div",{class:"policy-section-head",children:e("div",{children:[e("h2",{children:"While you decide"}),e("p",{children:"What the agent gets back when a call needs your approval."})]})}),e("div",{class:"radio-list",role:"radiogroup","aria-label":"Approval mode",children:[[null,"Gateway default","Follow approvals.mode in the config."],["sync","Hold the call","The tool call waits until you approve or deny it."],["async","Answer right away","Returns “approval pending” at once so the agent can retry later."]].map(([p,k,N])=>e("label",{class:"radio-option",children:[e("input",{type:"radio",name:"approval-mode",checked:r.approvalMode===p,onChange:()=>s({...r,approvalMode:p})}),e("strong",{children:k}),e("span",{children:N})]},String(p)))})]})]}),e("aside",{class:"policy-aside","aria-label":"Effective access",children:[e("div",{class:"aside-block",children:[e("h3",{children:"Effective access"}),o.length>0?e(O,{children:[e("div",{class:"posture",children:[e("div",{children:[e("span",{class:"dot is-allow","aria-hidden":"true"}),e("strong",{children:d.allow})," allow"]}),e("div",{children:[e("span",{class:"dot is-ask","aria-hidden":"true"}),e("strong",{children:d.ask})," ask"]}),e("div",{children:[e("span",{class:"dot is-deny","aria-hidden":"true"}),e("strong",{children:d.deny})," deny"]}),e("div",{children:[e("span",{class:"dot","aria-hidden":"true"}),e("strong",{children:d.none})," unmatched"]})]}),e(xt,{counts:d,total:o.length}),e("p",{class:"field-help",children:["Across ",Z(o.length,"tool")," from your providers."]})]}):e("p",{class:"field-help",children:"Counts appear once providers report their tools."})]}),e(ei,{draft:r,profiles:v,defaultProfile:g,tools:o,selfLabel:n?`${t} ${n}`:`this ${t}`}),l]})]})}function ei({draft:t,profiles:n,defaultProfile:r,tools:s,selfLabel:l}){const[i,o]=C(""),a=ee(()=>i.trim()?Vs(t,n,i,r,l):null,[t,n,i,r,l]),h=(a==null?void 0:a.decision)==="none"?"Blocked":a?ft[a.decision]:"";return e("div",{class:"aside-block simulator",children:[e("h3",{children:"Test a tool"}),e("label",{class:"search",children:[e("span",{class:"visually-hidden",children:"Tool name to test"}),e("input",{type:"search",class:"input is-mono",list:"airlock-tool-list",value:i,spellcheck:!1,autocomplete:"off",placeholder:"github/delete_repo",style:{paddingLeft:"10px"},onInput:u=>o(u.currentTarget.value)})]}),e("datalist",{id:"airlock-tool-list",children:s.map(u=>e("option",{value:u.name},u.name))}),a?e("div",{class:"sim-result","aria-live":"polite",children:[e("div",{class:R("sim-verdict",`is-${a.decision}`),children:[e("span",{class:R("dot",a.decision==="allow"?"is-allow":a.decision==="ask"?"is-ask":"is-deny"),"aria-hidden":"true"}),h]}),e("p",{class:"sim-reason",children:a.reason}),a.matches.length>0&&e("ul",{class:"sim-matches",children:a.matches.map((u,c)=>e("li",{class:R(!u.isWinner&&"is-loser"),children:[e("span",{class:R("dec",`c-${u.decision}`),children:u.decision}),e("code",{children:u.pattern}),e("span",{class:"src",children:[u.source,u.exact?", exact":`, specificity ${u.score}`]})]},c))})]}):e("p",{class:"field-help",style:{marginTop:"8px"},children:"See which rule decides a tool, including inherited profiles and tie-breaks."})]})}function ti({kind:t,selfId:n,draft:r,onChange:s,profiles:l,tools:i}){const{state:o}=V(),a=Object.keys(l).filter(u=>u!==n),h=t==="agent"?o==null?void 0:o.defaultProfile:void 0;return a.length===0?e("p",{class:"field-help",children:["No profiles yet. Rules here apply to this ",t," only."]}):e("div",{class:"toggle-list",role:"group","aria-label":"Inherited profiles",children:a.map(u=>{const c=r.extends.includes(u),v=u===h,y=c||v&&r.inheritDefault,m=i.length?Qe(ze([u],l),i):null;return e("label",{class:"toggle-row",children:[e("input",{type:"checkbox",checked:y,onChange:()=>{if(v&&!c){s({...r,inheritDefault:!r.inheritDefault});return}s({...r,extends:c?r.extends.filter(g=>g!==u):[...r.extends,u]})}}),e("span",{children:[e("span",{class:"name",children:u}),v&&e("span",{class:"toggle-note",children:"Default for every agent"})]}),m&&e("span",{class:"access-counts",children:[e("span",{children:[e("strong",{children:m.allow})," allow"]}),e("span",{children:[e("strong",{children:m.ask})," ask"]}),m.deny>0&&e("span",{children:[e("strong",{children:m.deny})," deny"]})]})]},u)})})}const rn=["destructive","injection","open-world"];function ni({draft:t,onChange:n,tools:r,effective:s,background:l,profiles:i}){const[o,a]=C(""),[h,u]=C("all"),[c,v]=C({}),y=o.trim().toLowerCase(),m=ee(()=>r.filter(p=>y&&!`${p.name} ${p.description} ${p.tags.join(" ")}`.toLowerCase().includes(y)?!1:h==="all"?!0:h==="risky"?p.tags.some(k=>rn.includes(k)):$e(s,p.name).decision===h),[r,y,h,s]),g=Xs(m),d=new Set([...t.allow,...t.ask,...t.deny]),b=!!y||h!=="all",f=g.length>0&&g.every(([p])=>c[p]??b),w=p=>{if(!p)return;if(d.has(p)||[...t.allow,...t.ask,...t.deny].includes(p))return`your rule ${p}`;const k=Object.entries(i).find(([,N])=>[...N.allow,...N.ask,...N.deny].includes(p));return k?`${k[0]} (${p})`:p};return r.length===0?e("p",{class:"field-help",children:"No tools found. Add a provider, then reload."}):e("div",{class:"matrix",children:[e("div",{class:"matrix-bar",children:[e(Pe,{value:o,onInput:a,placeholder:`Search ${Z(r.length,"tool")}`,label:"Search tools"}),e("select",{class:"select",value:h,"aria-label":"Show tools",onChange:p=>u(p.currentTarget.value),children:[e("option",{value:"all",children:"All tools"}),e("option",{value:"allow",children:"Allowed"}),e("option",{value:"ask",children:"Ask first"}),e("option",{value:"deny",children:"Denied"}),e("option",{value:"none",children:"Unmatched"}),e("option",{value:"risky",children:"Risky"})]}),e(L,{size:"sm",variant:"ghost",onClick:()=>{const p={};for(const[k]of g)p[k]=!f;v(p)},children:f?"Collapse all":"Expand all"}),e(L,{size:"sm",onClick:()=>n({...t,...Qs(t,m)}),title:"Set each tool to Airlock's suggestion from its annotations",children:["Use recommended",b?" for these":""]})]}),g.length===0?e("p",{class:"field-help",style:{padding:"12px 0"},children:"No tools match."}):g.map(([p,k])=>{const N=Qe(s,k),I=c[p]??b,z=["allow","ask","deny"].find($=>t[$].includes(`${p}/*`))??null;return e("div",{class:"prov-group",children:[e("div",{class:"prov-row",children:[e("button",{type:"button",class:"prov-toggle","aria-expanded":I,onClick:()=>v({...c,[p]:!I}),children:[e(be,{size:14,"aria-hidden":"true"}),e("span",{class:"name",children:p}),e("span",{class:"count",children:Z(k.length,"tool")})]}),e(xt,{counts:N,total:k.length}),e(Qt,{label:`Every ${p} tool`,own:z,inherited:"none",onChange:$=>n({...t,...Ys(t,p,$)})})]}),I&&e("ul",{class:"tool-rows",children:k.map($=>{const _=d.has($.name)?["allow","ask","deny"].find(S=>t[S].includes($.name))??null:null,E=$e(l,$.name),T=$.tags.filter(S=>S!=="idempotent");return e("li",{class:"tool-row",children:[e("div",{class:"tool-row-main",children:[e("div",{class:"tool-row-name",children:[e(Ie,{tool:$.shortName}),T.length>0&&e("span",{class:"tool-row-tags",children:T.map((S,A)=>e(O,{children:[A>0&&", ",e("span",{class:R(rn.includes(S)&&"is-risk"),children:S==="readonly"?"read-only":S})]}))})]}),$.description&&e("p",{class:"tool-row-desc",title:$.description,children:$.description})]}),e(Qt,{label:$.name,own:_,inherited:E.decision,inheritedFrom:w(E.pattern),onChange:S=>n({...t,...wr(t,$.name,S)})})]},$.name)})})]},p)})]})}function Ar(t){return{extends:[...t.extends],allow:[...t.allow],ask:[...t.ask],deny:[...t.deny],inheritDefault:t.inheritDefault,approvalMode:t.approvalMode??null,exec:{allow:[...t.exec.allow],ask:[...t.exec.ask],deny:[...t.exec.deny]},http:{domainAllowlist:[...t.http.domainAllowlist]}}}function Cr(t){return{...pt(),extends:[...t.extends],allow:[...t.allow],ask:[...t.ask],deny:[...t.deny]}}function ri(t){const n=gt({extends:t.extends,allow:t.allow,ask:t.ask,deny:t.deny})??{};t.inheritDefault||(n.inherit_default=!1),t.approvalMode&&(n.approval_mode=t.approvalMode);const r=gt({allow:t.exec.allow,ask:t.exec.ask,deny:t.exec.deny});return r&&(n.exec=r),t.http.domainAllowlist.length&&(n.http={domain_allowlist:t.http.domainAllowlist}),n}function si(t,n){const r={};for(const l of["extends","allow","ask","deny"])Ke(t[l],n[l])||(r[l]=n[l]);t.inheritDefault!==n.inheritDefault&&(r.inherit_default=n.inheritDefault),t.approvalMode!==n.approvalMode&&(r.approval_mode=n.approvalMode);const s={};for(const l of["allow","ask","deny"])Ke(t.exec[l],n.exec[l])||(s[l]=n.exec[l]);return Object.keys(s).length&&(r.exec=s),Ke(t.http.domainAllowlist,n.http.domainAllowlist)||(r.http={domain_allowlist:n.http.domainAllowlist}),r}function ii(t){return gt({extends:t.extends,allow:t.allow,ask:t.ask,deny:t.deny})??{}}function li(t,n){const r={};for(const s of["extends","allow","ask","deny"])Ke(t[s],n[s])||(r[s]=n[s]);return r}function gt(t){const n=Object.entries(t).filter(([,r])=>r.length>0);return n.length?Object.fromEntries(n):void 0}function oi({kind:t,baseId:n}){const{state:r,tools:s,setState:l,reveal:i,toast:o}=V(),a=t==="agent"?r==null?void 0:r.agents:r==null?void 0:r.profiles,h=t==="agent"?"agents":"profiles",[u,c]=C(()=>n?I(n):""),[v,y]=C(n),[m,g]=C(()=>z(t,n)),[d,b]=C(null),[f,w]=C(!1),[p,k]=C(null),N=re(null);function I(M){const P=a??{};for(let W=1;;W++){const ae=W===1?`${M}-copy`:`${M}-copy-${W}`;if(!P[ae])return ae}}function z(M,P){return P&&M==="agent"&&(r!=null&&r.agents[P])?Ar(r.agents[P]):P&&M==="profile"&&(r!=null&&r.profiles[P])?Cr(r.profiles[P]):pt()}U(()=>{var M;window.matchMedia("(pointer: fine)").matches&&((M=N.current)==null||M.focus())},[]);const $=u.trim(),_=$?Zs.test($)?a!=null&&a[$]?`There is already ${t==="agent"?"an agent":"a profile"} called ${$}.`:null:"Use letters, numbers, dots, dashes, or underscores.":null,E=!!$&&!_,T=ee(()=>JSON.stringify(z(t,n)),[]);hr(!f&&(JSON.stringify(m)!==T||!n&&!!$));const S=ee(()=>t==="agent"?[{op:"create_agent",id:$||"new-agent",agent:ri(m)}]:[{op:"create_profile",id:$||"new-profile",profile:ii(m)}],[t,$,m]);U(()=>{if(_)return;const M=setTimeout(()=>{q.preview(S).then(b,()=>{})},300);return()=>clearTimeout(M)},[JSON.stringify(S),_]);const A=async()=>{var M;if(!E){(M=N.current)==null||M.focus(),k($?_:`Give the ${t} a name first.`);return}w(!0),k(null);try{const P=await q.apply(S,d==null?void 0:d.version);l(P.state),P.createdKeys.length?i(P.createdKeys):o(`Created ${t} ${$}`),ur(h,$)}catch(P){k(P instanceof wt&&P.status===409?"The config changed on disk. Check the preview and try again.":P.message),q.preview(S).then(b,()=>{})}finally{w(!1)}};U(()=>{const M=P=>{(P.metaKey||P.ctrlKey)&&P.key==="Enter"&&(P.preventDefault(),A())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)});const D=Object.keys(a??{}),x=t==="agent"?"agent":"profile";return e(O,{children:[e("header",{class:"topbar",children:[e("nav",{class:"crumb","aria-label":"Breadcrumb",children:[e("a",{href:`#/${h}`,children:t==="agent"?"Agents":"Profiles"}),e(be,{size:13,"aria-hidden":"true"}),e("span",{class:"current","aria-current":"page",children:["New ",x]})]}),e("div",{class:"topbar-actions",children:e(L,{variant:"primary",busy:f,onClick:A,children:["Create ",x,e(X,{children:"⌘ ↵"})]})})]}),e("div",{class:"page",children:[e("section",{class:"composer-name",children:[e("label",{for:"entity-name",class:"field-label",children:"Name"}),e("input",{id:"entity-name",ref:N,class:"input name-input",name:`${x}-name`,value:u,placeholder:t==="agent"?"codex-ci…":"github-read…",autocomplete:"off",spellcheck:!1,onInput:M=>{c(M.currentTarget.value.replace(/\s+/g,"-")),k(null)},"aria-invalid":!!_,"aria-describedby":"entity-name-help"}),e("p",{id:"entity-name-help",class:R("field-help",_&&"is-error"),children:_??(t==="agent"?e(O,{children:["One client, like Claude Code on your laptop. It connects at"," ",e("code",{children:["/agents/",$||"name","/mcp"]})]}):"A reusable rule set. Agents refer to it by this name.")}),D.length>0&&e("div",{class:"copy-from",role:"group","aria-label":"Copy rules from",children:[e("span",{class:"label",children:"Start from"}),e(Xt,{selected:!v,onClick:()=>{y(void 0),g(pt())},children:"Empty"}),D.map(M=>e(Xt,{selected:v===M,onClick:()=>{y(M),g(z(t,M))},children:M},M))]}),p&&e("div",{style:{marginTop:"8px"},children:e(ne,{tone:"error",children:p})})]}),e($r,{kind:t,draft:m,onChange:g,aside:e(ai,{kind:t,draft:m,tools:s,preview:d})})]})]})}function ai({kind:t,draft:n,tools:r,preview:s}){const{effective:l}=xr(t,n),i=r.filter(h=>$e(l,h.name).decision==="ask"),o=r.filter(h=>$e(l,h.name).decision==="allow"),a=s==null?void 0:s.changes[0];return e("div",{class:"aside-block peek",children:[r.length>0&&o.length+i.length===0?e("p",{class:"field-help",children:"Nothing is reachable yet. Inherit a profile or allow some tools."}):e(O,{children:[e(sn,{title:"Asks you first",tools:i}),e(sn,{title:"Runs right away",tools:o})]}),a&&e("details",{class:"disclosure",children:[e("summary",{children:[e(be,{size:13,"aria-hidden":"true"}),"YAML to be written"]}),e("div",{class:"disclosure-body",children:e(pr,{change:a})})]}),s&&e("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginTop:"12px"},children:e(vr,{preview:s})})]})}function sn({title:t,tools:n}){if(!n.length)return null;const r=n.slice(0,6);return e("div",{children:[e("h4",{children:t}),e("ul",{children:r.map(s=>e("li",{children:e("code",{children:s.name})},s.name))}),n.length>r.length&&e("p",{class:"field-help",children:["and ",n.length-r.length," more"]})]})}function ci({kind:t}){const{state:n,tools:r,toolsLoaded:s,pending:l,grants:i,setAssistantOpen:o,meta:a}=V(),[h,u]=C("");if(!n)return null;const c=t==="agent",v=c?"agents":"profiles",y=c?"agent":"profile",m=Object.entries(c?n.agents:n.profiles),g=h.trim().toLowerCase(),d=g?m.filter(([b,f])=>`${b} ${f.extends.join(" ")} ${f.allow.join(" ")} ${f.ask.join(" ")}`.toLowerCase().includes(g)):m;return e(O,{children:[e("header",{class:"topbar",children:[e("div",{class:"topbar-title",children:[e("h1",{children:c?"Agents":"Profiles"}),e("span",{class:"topbar-meta",children:m.length||""})]}),e("div",{class:"topbar-actions",children:[(a==null?void 0:a.assistant.enabled)&&e(L,{variant:"ghost",onClick:()=>o(!0),children:[e(sr,{size:14,"aria-hidden":"true"}),"Describe it"]}),e(L,{variant:"primary",onClick:()=>Ne(v,"new"),children:[e(kt,{size:14,"aria-hidden":"true"}),"New ",y]})]})]}),e("div",{class:"page",children:[e("p",{class:"lede",style:{marginBottom:"20px"},children:c?"Each agent is one client with its own key, approval mode, and tool policy.":"Reusable rule sets that agents and other profiles inherit."}),m.length===0?e(de,{title:`No ${y}s yet`,icon:c?e(En,{size:22,"aria-hidden":"true"}):e(Gn,{size:22,"aria-hidden":"true"}),children:[e("p",{children:c?"Create one for each client that should reach your tools through Airlock.":"Profiles save you repeating the same rules across agents."}),e(L,{variant:"primary",onClick:()=>Ne(v,"new"),children:["New ",y]})]}):e(O,{children:[m.length>5&&e("div",{class:"toolbar",children:e(Pe,{value:h,onInput:u,placeholder:`Search ${y}s`,label:`Search ${y}s`})}),d.length===0?e(de,{title:`No ${y}s match “${h}”`,children:e(L,{size:"sm",onClick:()=>u(""),children:"Clear search"})}):e("div",{class:"table-scroll",children:e("table",{class:"table",children:[e("thead",{children:e("tr",{children:[e("th",{scope:"col",children:"Name"}),e("th",{scope:"col",class:"hide-sm",children:"Inherits"}),e("th",{scope:"col",style:{width:"34%"},children:"Access"}),c&&e("th",{scope:"col",class:"hide-sm",children:"Key"}),e("th",{scope:"col",class:"col-actions",children:e("span",{class:"visually-hidden",children:"Open"})})]})}),e("tbody",{children:d.map(([b,f])=>{const w=c?kr(f,n.profiles,f.inheritDefault?n.defaultProfile:void 0):(()=>{const _=ze(f.extends,n.profiles);return{allow:[..._.allow,...f.allow],ask:[..._.ask,...f.ask],deny:[..._.deny,...f.deny]}})(),p=Qe(w,r),k=l.filter(_=>_.agentId===b).length,N=i.filter(_=>_.agentId===b).length,I=c?0:Object.values(n.agents).filter(_=>_.extends.includes(b)).length+Object.values(n.profiles).filter(_=>_.extends.includes(b)).length,z=`#/${v}/${encodeURIComponent(b)}`,$=c?[k>0&&`${k} waiting`,N>0&&Z(N,"grant"),f.approvalMode&&(f.approvalMode==="async"?"Answers right away":"Holds calls")].filter(Boolean).join(" · "):[n.defaultProfile===b&&"Default",I>0?`Used by ${I}`:"Not used yet"].filter(Boolean).join(" · ");return e("tr",{class:"is-clickable",onClick:_=>{_.target.closest("a")||(window.location.hash=z.slice(1))},children:[e("th",{scope:"row",children:[e("a",{href:z,class:"cell-title",children:b}),$&&e("span",{class:"cell-sub",children:[k>0&&e("span",{class:"dot is-ask",style:{marginRight:"6px"},"aria-hidden":"true"}),$]})]}),e("td",{class:"hide-sm ink-2",children:f.extends.length?f.extends.join(", "):e("span",{class:"ink-3",children:"—"})}),e("td",{children:s?e("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[e(Ts,{counts:p}),e(xt,{counts:p,total:r.length})]}):e("span",{class:"skeleton",style:{width:"70%"}})}),c&&e("td",{class:"hide-sm",children:f.hasToken?e("span",{class:"ink-2",children:"Own key"}):e("span",{class:"ink-3",children:"Gateway secret"})}),e("td",{class:"col-actions ink-3",children:e(be,{size:14,"aria-hidden":"true"})})]},b)})})]})})]})]})]})}function di({kind:t,id:n}){const{state:r,pending:s,grants:l}=V(),i=t==="agent"?r==null?void 0:r.agents[n]:r==null?void 0:r.profiles[n],o=ee(()=>i?t==="agent"?Ar(i):Cr(i):null,[i,t]),[a,h]=C(o),[u,c]=C(null);U(()=>h(o),[o]);const v=!!(a&&o)&&JSON.stringify(a)!==JSON.stringify(o);hr(v);const y=t==="agent"?"agents":"profiles";if(!r)return null;if(!i||!a||!o)return e("div",{class:"page",children:e(de,{title:`No ${t} called ${n}`,children:e("a",{class:"link",href:`#/${y}`,children:["Back to ",y]})})});const m=t==="profile"?[...Object.entries(r.agents).filter(([,w])=>w.extends.includes(n)).map(([w])=>w),...Object.entries(r.profiles).filter(([,w])=>w.extends.includes(n)).map(([w])=>`${w} (profile)`)]:[],g=t==="agent"&&i.hasToken,d=s.filter(w=>w.agentId===n).length,b=l.filter(w=>w.agentId===n).length,f=()=>t==="agent"?[{op:"update_agent",id:n,agent:si(o,a)}]:[{op:"update_profile",id:n,profile:li(o,a)}];return e(O,{children:[e("header",{class:"topbar",children:[e("nav",{class:"crumb","aria-label":"Breadcrumb",children:[e("a",{href:`#/${y}`,children:t==="agent"?"Agents":"Profiles"}),e(be,{size:13,"aria-hidden":"true"}),e("span",{class:"current","aria-current":"page",children:n})]}),e("div",{class:"topbar-actions",children:[t==="agent"&&e(L,{onClick:()=>c({ops:[{op:"rotate_agent_key",id:n}],title:g?`Rotate the key for ${n}`:`Give ${n} its own key`,label:g?"Rotate key":"Create key"}),children:g?"Rotate key":"Create key"}),e($t,{label:`${n} actions`,trigger:w=>e(L,{...w,icon:!0,"aria-label":`More actions for ${n}`,children:e(Bn,{size:15,"aria-hidden":"true"})}),items:[{id:"duplicate",label:`Duplicate ${t}`,sub:"Start a new one with the same rules",onSelect:()=>Ne(y,"new",n)},{id:"delete",label:`Delete ${t}`,danger:!0,separatorBefore:!0,onSelect:()=>c({ops:[{op:t==="agent"?"delete_agent":"delete_profile",id:n}],title:`Delete ${n}`,label:`Delete ${t}`,danger:!0,successMessage:`Deleted ${n}`})}]})]})]}),e("div",{class:"page",children:[e("div",{class:"entity-head",children:e("div",{children:[e("h1",{children:n}),e("p",{class:"entity-meta",children:t==="agent"?e(O,{children:[e("code",{children:["/agents/",n,"/mcp"]}),e("span",{class:"sep",children:"·"}),e("span",{class:"key-state",children:[e("span",{class:g?"dot is-ok":"dot is-ask","aria-hidden":"true"}),g?"Own key":"No key, uses the gateway secret"]}),d>0&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("a",{class:"link",href:"#/inbox",children:[d," waiting"]})]}),b>0&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("a",{class:"link",href:"#/grants",children:Z(b,"active grant")})]})]}):e("span",{children:[m.length?`Used by ${m.join(", ")}`:"Not inherited by anything yet",r.defaultProfile===n&&" · Default for every agent"]})})]})}),e($r,{kind:t,selfId:n,draft:a,onChange:h})]}),v&&e("div",{class:"savebar",role:"region","aria-label":"Unsaved changes",children:[e("span",{class:"savebar-text",children:"Unsaved changes"}),e(L,{variant:"ghost",onClick:()=>h(o),children:"Discard"}),e(L,{variant:"primary",onClick:()=>c({ops:f(),title:`Save ${n}`,label:"Save to airlock.yaml"}),children:"Review changes"})]}),u&&e(Gs,{open:!0,ops:u.ops,title:u.title,applyLabel:u.label,danger:u.danger,successMessage:u.successMessage,note:u.danger&&m.length>0?e(O,{children:[n," is used by ",m.join(", "),". Remove it from them first, then delete it."]}):void 0,onClose:()=>c(null),onApplied:()=>{u.ops[0].op.startsWith("delete")&&ur(y)}})]})}const hi={approval:"Approval",plan:"Plan",async:"Async retry",operator:"Operator"};function ui(){const{state:t,grants:n,canRevokeGrants:r,revokeGrant:s,refreshGrants:l}=V(),i=fr(1e3),[o,a]=C(""),[h,u]=C(""),[c,v]=C(!1),[y,m]=C(null),g=h.trim().toLowerCase(),d=n.filter(f=>{if(o&&f.agentId!==o)return!1;if(!g)return!0;const w=mr(f.scope);return`${f.agentId} ${w.kindLabel} ${w.target} ${f.label??""} ${f.source}`.toLowerCase().includes(g)}),b=Array.from(new Set([...Object.keys((t==null?void 0:t.agents)??{}),...n.map(f=>f.agentId)])).sort();return e(O,{children:[e("header",{class:"topbar",children:[e("div",{class:"topbar-title",children:[e("h1",{children:"Grants"}),e("span",{class:"topbar-meta",children:n.length?`${n.length} active`:"None active"})]}),e("div",{class:"topbar-actions",children:e(L,{variant:"ghost",icon:!0,busy:c,"aria-label":"Refresh grants",title:"Refresh",onClick:async()=>{v(!0);try{await l()}finally{v(!1)}},children:e(Ee,{size:14,"aria-hidden":"true"})})})]}),e("div",{class:"page",children:n.length===0?e(de,{title:"No active grants",icon:e(Wn,{size:22,"aria-hidden":"true"}),children:e("p",{children:"Time-boxed and single-use permissions from approvals, plans, and async retries show up here until they expire or you revoke them."})}):e(O,{children:[e("div",{class:"toolbar",children:[e(Pe,{value:h,onInput:u,placeholder:"Search scope or tool",label:"Search grants"}),b.length>1&&e("select",{class:"select",value:o,onChange:f=>a(f.currentTarget.value),"aria-label":"Filter by agent",children:[e("option",{value:"",children:"All agents"}),b.map(f=>e("option",{value:f,children:f},f))]})]}),d.length===0?e(de,{title:"No grants match",children:e(L,{size:"sm",onClick:()=>{u(""),a("")},children:"Clear filters"})}):e("div",{class:"table-scroll",children:e("table",{class:"table",children:[e("thead",{children:e("tr",{children:[e("th",{scope:"col",children:"Scope"}),e("th",{scope:"col",children:"Agent"}),e("th",{scope:"col",class:"hide-sm",children:"Source"}),e("th",{scope:"col",class:"hide-sm",children:"Uses left"}),e("th",{scope:"col",children:"Expires"}),r&&e("th",{scope:"col",class:"col-actions",children:e("span",{class:"visually-hidden",children:"Actions"})})]})}),e("tbody",{children:d.map(f=>e(pi,{grant:f,now:i,canRevoke:r,busy:y===f.id,onRevoke:async()=>{m(f.id);try{await s(f.id)}finally{m(null)}}},f.id))})]})})]})})]})}function pi({grant:t,now:n,canRevoke:r,busy:s,onRevoke:l}){const i=mr(t.scope),o=At(t.expiresAt,n),a=gr(t.createdAt,t.expiresAt,n);return e("tr",{children:[e("td",{children:[e("code",{class:"tool",children:i.target}),e("span",{class:"scope-kind",children:[i.kindLabel,t.label?` · ${t.label}`:""]})]}),e("td",{children:e("a",{class:"link",href:`#/agents/${encodeURIComponent(t.agentId)}`,children:t.agentId})}),e("td",{class:"hide-sm ink-2",title:`Created ${ve(t.createdAt)}`,children:[hi[t.source]??t.source,e("span",{class:"cell-sub",children:Ye(t.createdAt,n)})]}),e("td",{class:"hide-sm num ink-2",children:t.usesRemaining!==void 0?Z(t.usesRemaining,"use"):"Unlimited"}),e("td",{children:o?e("span",{class:R("time-left",o.urgent&&"is-urgent"),title:t.expiresAt?ve(t.expiresAt):void 0,children:[o.label,a!==null&&e("span",{class:"track","aria-hidden":"true",children:e("span",{style:{transform:`scaleX(${a})`}})})]}):e("span",{class:"ink-3",children:"No expiry"})}),r&&e("td",{class:"col-actions",children:e(L,{size:"sm",variant:"ghost",class:"btn-revoke",busy:s,onClick:l,"aria-label":`Revoke ${i.target} for ${t.agentId}`,children:"Revoke"})})]})}function he(t){return t.kind==="plan"||t.tool==="airlock/request_approval"}function me(t){return t.kind==="question"||t.tool==="airlock/ask_user"}function Sr(t){const n=t.args.question??t.args.title??t.args.message;return typeof n=="string"&&n.trim()?n.trim():"Question from agent"}function fi(t){return t.provider??(t.tool.includes("/")?t.tool.split("/")[0]:void 0)}const Tr=6e4,Re=60*Tr;function gi(t){var r;if(t.kind!=="call"||he(t)||me(t)||t.escalated)return[];const n=[{id:"tool-15m",label:"This tool for 15 minutes",sub:t.tool,options:{grantScope:"tool",durationMs:15*Tr},toast:`Allowed ${t.tool} for 15m`},{id:"tool-1h",label:"This tool for 1 hour",options:{grantScope:"tool",durationMs:Re},toast:`Allowed ${t.tool} for 1h`}];if(!t.tool.startsWith("event:")){const s=fi(t),l=(r=t.grantOptions)==null?void 0:r.find(o=>o.scope==="tier"),i=(l==null?void 0:l.tier)??(t.tier==="read"?"read":t.tier==="write"?"write":void 0);i&&s&&n.push({id:`tier-${i}`,label:i==="read"?`Read-only ${s} tools for 1 hour`:`Non-destructive ${s} tools for 1 hour`,options:{grantScope:"tier",grantTier:i,durationMs:Re},toast:`Allowed ${i==="read"?"read-only":"non-destructive"} ${s} tools for 1h`}),s&&n.push({id:"provider-1h",label:`Every ${s} tool for 1 hour`,sub:`${s}/*`,options:{grantScope:"provider",durationMs:Re},toast:`Allowed ${s}/* for 1h`});for(const o of t.grantOptions??[])o.scope==="profile"&&o.profile&&n.push({id:`profile-${o.profile}`,label:`Profile ${o.profile} for 1 hour`,options:{grantScope:"profile",grantProfile:o.profile,durationMs:Re},toast:`Allowed profile ${o.profile} for 1h`})}return t.tool.startsWith("event:")||n.push({id:"always",label:"Always allow",sub:"Adds an allow rule to airlock.yaml",options:{remember:"always"},toast:`Always allowing ${t.tool}`,permanent:!0}),n}function mi(t){return me(t)?"Confirm":he(t)?"Approve plan":"Approve once"}function yi(t){return me(t)?"Decline":he(t)?"Deny plan":"Deny"}function _i(){const{refreshPending:t,refreshGrants:n,refreshState:r,toast:s}=V(),[l,i]=C(null);return{decide:async(a,h,u={},c)=>{var v;i(a.id);try{await q.decide(h,a.code,u);const y=he(a)?"plan":me(a)?"question":a.tool;return s(c??(h==="deny"?`Denied ${y}`:he(a)?`Approved ${Z(((v=a.plan)==null?void 0:v.length)??0,"planned call")}`:`Approved ${y}`)),await Promise.all([t(),n(),...u.remember==="always"?[r()]:[]]),!0}catch(y){return s(y.message,"error"),!1}finally{i(null)}},busyId:l}}function vi(t){const n=r=>Date.parse(r.expiresAt??"")||Date.parse(r.createdAt)+1e12;return[...t].sort((r,s)=>n(r)-n(s))}function bi({p:t}){return t.escalated||t.tier==="destructive"?e(ps,{size:15,"aria-hidden":"true"}):he(t)?e(os,{size:15,"aria-hidden":"true"}):me(t)?e(cs,{size:15,"aria-hidden":"true"}):e(ms,{size:15,"aria-hidden":"true"})}function ki(t){var n;return he(t)?e("span",{children:["Plan of ",Z(((n=t.plan)==null?void 0:n.length)??0,"call")]}):me(t)?e("span",{children:Sr(t)}):e(Ie,{tool:t.tool})}function wi(t){const n=t.escalated?"Flagged":t.tier==="destructive"?"Destructive":null;let r;return he(t)?r=t.reason??(t.plan??[]).map(s=>s.tool).join(", "):me(t)?r=typeof t.args.context=="string"?t.args.context:"Waiting for your answer":r=t.reason??(zs(t.args,2)||"No arguments"),e(O,{children:[n&&e(O,{children:[e("span",{class:"q-flag",children:n}),e("span",{class:"sep",children:"·"})]}),r]})}function ln(){const{state:t,meta:n,pending:r,grants:s,refreshPending:l,refreshGrants:i}=V(),o=(n==null?void 0:n.approvals)===!0,a=fr(1e3),{decide:h,busyId:u}=_i(),[c,v]=C(""),[y,m]=C(null),[g,d]=C(!1),[b,f]=C(!1),w=re(null),p=ee(()=>vi(r.filter(A=>!c||A.agentId===c)),[r,c]),k=re(0),N=p.findIndex(A=>A.id===y),I=N>=0?N:Math.min(k.current,Math.max(0,p.length-1)),z=p[I]??null;U(()=>{z?(k.current=I,z.id!==y&&m(z.id)):d(!1)},[p,z==null?void 0:z.id]);const $=A=>{var x,M;const D=p[Math.max(0,Math.min(p.length-1,A))];D&&(m(D.id),(M=(x=w.current)==null?void 0:x.querySelector(`[data-id="${CSS.escape(D.id)}"]`))==null||M.scrollIntoView({block:"nearest"}))},_=async(A,D,x,M)=>{k.current=p.findIndex(W=>W.id===A.id),await h(A,D,x,M)&&d(!1)};U(()=>{const A=D=>{if(D.metaKey||D.ctrlKey||D.altKey||D.defaultPrevented)return;const x=D.target;["INPUT","TEXTAREA","SELECT"].includes(x.tagName)||x.isContentEditable||document.querySelector(".scrim, .menu, .assistant.is-open")||p.length&&(D.key==="j"||D.key==="ArrowDown"?(D.preventDefault(),$(I+1)):D.key==="k"||D.key==="ArrowUp"?(D.preventDefault(),$(I-1)):D.key==="Enter"&&x.tagName!=="BUTTON"&&x.tagName!=="A"?(D.preventDefault(),d(!0)):D.key==="Escape"&&g?d(!1):o&&z&&u!==z.id&&(D.key==="a"?(D.preventDefault(),_(z,"approve")):D.key==="d"&&(D.preventDefault(),_(z,"deny"))))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)});const E=Array.from(new Set([...Object.keys((t==null?void 0:t.agents)??{}),...r.map(A=>A.agentId)])).sort(),T=async()=>{f(!0);try{await Promise.all([l(),i()])}finally{f(!1)}},S=e("header",{class:"topbar",children:[e("div",{class:"topbar-title",children:[e("h1",{children:"Inbox"}),e("span",{class:"topbar-meta",children:[p.length?`${p.length} waiting`:"Clear",s.length>0&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("a",{class:"link",href:"#/grants",children:Z(s.length,"active grant")})]})]})]}),e("div",{class:"topbar-actions",children:e(L,{variant:"ghost",icon:!0,busy:b,"aria-label":"Refresh inbox",title:"Refresh",onClick:T,children:e(Ee,{size:14,"aria-hidden":"true"})})})]});return r.length===0?e("div",{class:"inbox-page",children:[S,e("div",{class:"inspector-empty",style:{height:"calc(100dvh - 53px)"},children:e(xi,{canDecide:o})})]}):e("div",{class:"inbox",children:[e("section",{class:"queue","aria-label":"Pending requests",children:[S,E.length>1&&e("div",{class:"queue-filter",children:e("select",{class:"select",value:c,onChange:A=>v(A.currentTarget.value),"aria-label":"Filter by agent",children:[e("option",{value:"",children:"All agents"}),E.map(A=>e("option",{value:A,children:A},A))]})}),e("div",{class:"queue-list",ref:w,role:"listbox","aria-label":"Requests",children:p.length===0?e("div",{class:"empty",children:[e("p",{class:"empty-title",children:["Nothing from ",c]}),e(L,{size:"sm",onClick:()=>v(""),children:"Show all agents"})]}):p.map((A,D)=>{const x=At(A.expiresAt,a),M=gr(A.createdAt,A.expiresAt,a);return e("button",{type:"button",role:"option","data-id":A.id,"aria-selected":D===I,class:R("q-row",(A.escalated||A.tier==="destructive")&&"is-hot"),onClick:()=>{m(A.id),d(!0)},children:[e("span",{class:"q-icon",children:e(bi,{p:A})}),e("span",{class:"q-head",children:[e("span",{class:"q-agent",children:A.agentId}),e("span",{class:"q-subject",children:ki(A)})]}),e("span",{class:R("q-time",(x==null?void 0:x.urgent)&&"is-urgent"),title:A.expiresAt?`Expires ${ve(A.expiresAt)}`:void 0,children:x?x.label:Ye(A.createdAt,a)}),e("span",{class:"q-line",children:wi(A)}),M!==null&&e("span",{class:R("expiry",(x==null?void 0:x.urgent)&&"is-urgent"),"aria-hidden":"true",children:e("span",{style:{transform:`scaleX(${M})`}})})]},A.id)})}),o&&e("footer",{class:"queue-foot","aria-hidden":"true",children:[e("span",{children:[e(X,{children:"J"}),e(X,{children:"K"})," move"]}),e("span",{children:[e(X,{children:"A"})," approve"]}),e("span",{children:[e(X,{children:"D"})," deny"]}),e("span",{children:[e(X,{children:"?"})," help"]})]})]}),e("section",{class:R("inspector",g&&"is-open"),"aria-label":"Request details","aria-live":"polite",children:[e("div",{class:"inspector-back",children:e(L,{variant:"ghost",size:"sm",onClick:()=>d(!1),children:[e(es,{size:14,"aria-hidden":"true"}),"Inbox"]})}),z?e($i,{request:z,now:a,canDecide:o,busy:u===z.id,onDecide:_},z.id):null]})]})}function xi({canDecide:t}){return e("div",{class:"inbox-zero",children:[e("span",{class:"brand-mark mark-lg","aria-hidden":"true"}),e("p",{class:"empty-title",children:"Nothing waiting"}),e("p",{children:"When an agent hits an ask rule, submits a plan, or asks you a question, it lands here instantly."}),t?e("div",{class:"shortcut-row","aria-hidden":"true",children:[e("span",{children:[e(X,{children:"J"}),e(X,{children:"K"})," move"]}),e("span",{children:[e(X,{children:"A"})," approve"]}),e("span",{children:[e(X,{children:"D"})," deny"]})]}):e("p",{class:"ink-3",style:{marginTop:"8px"},children:"This view is read-only. Decide from the gateway dashboard or the companion app."})]})}function $i({request:t,now:n,canDecide:r,busy:s,onDecide:l}){var d,b;const[i,o]=C(null),[a,h]=C(null),u=he(t),c=me(t),v=At(t.expiresAt,n),y=r?gi(t):[];U(()=>{if(c||u||!r)return;let f=!0;return q.approvalPreview(t.id).then(w=>f&&o(w),w=>f&&w.status!==404&&!String(w.message).includes("Not Found")&&h(w.message)),()=>{f=!1}},[t.id,c,u,r]);const m=Array.isArray(i==null?void 0:i.fields)?i.fields:[],g=y.map((f,w)=>({id:f.id,label:f.label,sub:f.sub,hint:f.hint,separatorBefore:f.permanent&&w>0,onSelect:()=>l(t,"approve",f.options,f.toast)}));return e(O,{children:[e("div",{class:"inspector-scroll",children:[e("header",{class:"inspector-head",children:[e("h2",{class:R("inspector-title",c&&"question-text"),children:c?Sr(t):u?`Plan of ${Z(((d=t.plan)==null?void 0:d.length)??0,"call")}`:e(Ie,{tool:t.tool})}),e("p",{class:"inspector-meta",children:[e("strong",{children:t.agentId}),e("span",{class:"sep",children:"·"}),e("span",{title:ve(t.createdAt),children:["Requested ",Ye(t.createdAt,n)]}),v&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("span",{class:R(v.urgent&&"c-ask"),children:v.expired?"Expired":`Expires in ${v.label}`})]}),t.mode&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("span",{children:t.mode==="sync"?"Call is held open":"Agent will retry"})]}),t.tier&&!u&&!c&&t.tier!=="destructive"&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("span",{children:t.tier==="read"?"Read-only":"Writes"})]}),t.tier==="destructive"&&!u&&!c&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("span",{class:"risk",children:"Destructive"})]}),e("span",{class:"sep",children:"·"}),e("code",{title:"Approval code",children:t.code})]})]}),e("div",{class:"inspector-body",children:[t.escalated&&e(ne,{tone:"error",children:"Flagged by a detector or command policy. Scoped and permanent grants are off for this call; check the exact arguments before approving once."}),t.reason&&e("section",{children:[e("h3",{class:"block-title",children:"Reason"}),e("p",{class:"reason",children:t.reason})]}),c&&typeof t.args.context=="string"&&t.args.context.trim()&&e("section",{children:[e("h3",{class:"block-title",children:"Context"}),e("p",{class:"reason",children:t.args.context})]}),t.note&&e("section",{children:[e("h3",{class:"block-title",children:"Note"}),e("p",{class:"reason",children:t.note})]}),(i==null?void 0:i.status)==="ready"&&e("section",{children:[e("h3",{class:"block-title",children:["Live preview",e("span",{class:"ink-3",children:["via ",e("code",{children:String(i.tool)}),i.truncated?", truncated":""]})]}),m.length?e("dl",{class:"kv",children:m.map(f=>e("div",{children:[e("dt",{children:f.label}),e("dd",{class:"is-text",children:f.value})]},f.label))}):e("pre",{class:"code-block",children:String(i.text??"")})]}),i&&i.status!=="ready"&&i.status!=="unavailable"&&e(ne,{tone:"warn",children:String(i.message??"Preview unavailable.")}),a&&e(ne,{tone:"warn",children:a}),u&&((b=t.plan)!=null&&b.length)?e(Ai,{request:t}):c?null:e(Ct,{value:t.args})]})]}),e("footer",{class:"decision-bar",children:r?e(O,{children:[e(L,{busy:s,onClick:()=>l(t,"deny"),children:[yi(t),e(X,{children:"D"})]}),e("span",{class:"spacer"}),u&&e("span",{class:"ink-3 hint-keys",children:"Each call gets a single-use grant"}),e("div",{class:"btn-group",children:[e(L,{variant:"primary",busy:s,onClick:()=>l(t,"approve"),children:[mi(t),e(X,{children:"A"})]}),g.length>0&&e($t,{label:"Approve and allow",heading:"Approve and allow",placement:"up-right",items:g,trigger:f=>e(L,{...f,variant:"primary",icon:!0,busy:s,"aria-label":"Approve with a scoped grant",children:e(ss,{size:14,"aria-hidden":"true"})})})]})]}):e("span",{class:"ink-3",children:"Read-only here. Decide from the gateway dashboard or the companion app."})})]})}function Ai({request:t}){const n=t.plan??[],[r,s]=C({0:!0}),[l,i]=C(!1),o=n.every((a,h)=>r[h]);return e("section",{children:[e("h3",{class:"block-title",children:["Steps",e("span",{class:"ink-3",children:n.length}),e("span",{style:{marginLeft:"auto",display:"inline-flex",gap:"14px"},children:[!l&&e("button",{type:"button",class:"text-btn",onClick:()=>s(o?{}:Object.fromEntries(n.map((a,h)=>[h,!0]))),children:o?"Collapse all":"Expand all"}),e("button",{type:"button",class:"text-btn",onClick:()=>i(!l),children:l?"Steps":"JSON"})]})]}),l?e("pre",{class:"code-block",children:JSON.stringify(t.args,null,2)}):e("ol",{class:"steps",children:n.map((a,h)=>{const u=!!r[h],c=Object.entries(a.args).slice(0,3).map(([v,y])=>`${v}=${yr(y,40)}`).join(" ");return e("li",{class:R("step",u&&"is-open"),children:[e("button",{type:"button",class:"step-head","aria-expanded":u,onClick:()=>s({...r,[h]:!u}),children:[e("span",{class:"step-num",children:h+1}),e("span",{class:"step-main",children:[e(Ie,{tool:a.tool}),!u&&c&&e("span",{class:"step-summary",children:c})]}),e(be,{size:14,class:"step-chevron","aria-hidden":"true"})]}),u&&e("div",{class:"step-body",children:e(Ct,{value:a.args,bare:!0})})]},h)})})]})}const Dr="airlock:gatewayUrl";function Ci(){try{return localStorage.getItem(Dr)??""}catch{return""}}function Si(){return`${window.location.protocol}//${window.location.hostname}:4111`}const Ti=[{id:"claude",label:"Claude Code"},{id:"codex",label:"Codex"},{id:"openclaw",label:"OpenClaw"},{id:"json",label:"MCP JSON"},{id:"curl",label:"curl"}];function Di(t,n,r,s){const l=n.replace(/\/+$/,""),i=`${l}/agents/${r}/mcp`,o=`airlock-${r}`,a=`AIRLOCK_KEY_${r.toUpperCase().replace(/[^A-Z0-9]+/g,"_")}`;switch(t){case"claude":return{note:"Run once on the machine where Claude Code runs.",text:`claude mcp add --transport http ${o} ${i} \\
|
|
211
|
+
--header "Authorization: Bearer ${s}"`};case"codex":return{note:"Add to ~/.codex/config.toml, and export the key where Codex runs.",text:`[mcp_servers.${o.replace(/[^A-Za-z0-9_-]/g,"_")}]
|
|
212
|
+
url = "${i}"
|
|
213
|
+
bearer_token_env_var = "${a}"
|
|
214
|
+
|
|
215
|
+
# in your shell profile
|
|
216
|
+
export ${a}=${s}`};case"openclaw":return{note:"Configures the airlock-bridge plugin. AIRLOCK_URL, AIRLOCK_AGENT and AIRLOCK_SECRET in its environment take precedence.",text:`openclaw config set extensions.airlock-bridge.url ${l}
|
|
217
|
+
openclaw config set extensions.airlock-bridge.agent ${r}
|
|
218
|
+
openclaw config set extensions.airlock-bridge.secret ${s}`};case"json":return{note:"For .mcp.json, Cursor, and other clients that take an mcpServers block.",text:JSON.stringify({mcpServers:{[o]:{type:"http",url:i,headers:{Authorization:`Bearer ${s}`}}}},null,2)};case"curl":return{note:"Checks the key works. Expect a JSON-RPC result with serverInfo.",text:`curl -sS ${i} \\
|
|
219
|
+
-H "Authorization: Bearer ${s}" \\
|
|
220
|
+
-H "Content-Type: application/json" \\
|
|
221
|
+
-H "Accept: application/json, text/event-stream" \\
|
|
222
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'`}}}function Ni(){const{revealed:t,dismissReveal:n}=V(),[r,s]=C(0);if(U(()=>s(0),[t]),!t.length)return null;const l=t[Math.min(r,t.length-1)],i=r>=t.length-1;return e(Ei,{item:l,position:t.length>1?`${r+1} of ${t.length}`:void 0,onDone:()=>i?n():s(r+1),doneLabel:i?"Done":"Next key"},l.agentId)}function Ei({item:t,onDone:n,doneLabel:r,position:s}){const{meta:l}=V(),[i,o]=C("claude"),[a,h]=C(!1),[u,c]=C(!1),[v,y]=C(()=>(l==null?void 0:l.publicGatewayUrl)||Ci()||Si()),m=re(null),g=re(null),d=!!(l!=null&&l.publicGatewayUrl),{text:b,note:f}=Di(i,v,t.agentId,t.key);U(()=>{var p;(p=g.current)==null||p.focus()},[]);const w=()=>{if(!a&&!u){c(!0);return}n()};return e("div",{class:"scrim is-dialog",style:{paddingTop:"8vh"},children:e("div",{class:"sheet reveal",role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",tabIndex:-1,ref:g,onKeyDown:p=>p.key==="Escape"&&w(),children:[e("header",{class:"sheet-head",children:e("div",{class:"sheet-head-text",children:[e("h2",{id:"reveal-title",children:[t.rotated?"New key for":"Key for"," ",t.agentId,s?e("span",{class:"ink-3",children:[" · ",s]}):null]}),e("p",{class:"sheet-sub",children:["Shown once. Airlock keeps only a hash.",t.rotated?" The previous key has stopped working.":""]})]})}),e("div",{class:"sheet-body",children:[e("div",{class:"key-plate",children:[e("code",{ref:m,class:"key-value",onClick:()=>Pi(m.current),children:t.key}),e(en,{value:t.key,label:"Copy key",variant:"primary",onCopied:()=>h(!0)})]}),e("section",{children:[e("div",{class:"connect-head",children:[e("h3",{children:"Connect a client"}),e("label",{class:"gateway-url",children:[e("span",{children:"Gateway"}),e("input",{class:"input",name:"gateway-url",type:"url",autocomplete:"off",value:v,spellcheck:!1,readOnly:d,title:d?"Set by --public-url":"Remembered in this browser. Set --public-url on the dashboard to fix it for everyone.",onInput:p=>{const k=p.currentTarget.value;y(k);try{localStorage.setItem(Dr,k)}catch{}}})]})]}),e("div",{class:"segmented",role:"tablist","aria-label":"Client",children:Ti.map(p=>e("button",{type:"button",role:"tab","aria-selected":i===p.id,onClick:()=>o(p.id),children:p.label},p.id))}),e("div",{class:"snippet",role:"tabpanel",children:[e("pre",{class:"code-block",children:b}),e("div",{class:"snippet-foot",children:[e("span",{children:f}),e(en,{value:b,onCopied:()=>h(!0)})]})]})]})]}),e("footer",{class:"sheet-foot",children:[e("label",{class:"check",style:{marginRight:"auto"},children:[e("input",{type:"checkbox",checked:a,onChange:p=>h(p.currentTarget.checked)}),"I stored this key somewhere safe"]}),e(L,{variant:a?"primary":u?"danger":"default",onClick:w,children:a||!u?r:"Close without the key"})]}),u&&!a?e("p",{class:"reveal-warn",style:{padding:"0 20px 14px",textAlign:"right"},children:"Closing loses this key for good. You can rotate a new one from the agent page."}):null]})})}function Pi(t){if(!t)return;const n=document.createRange();n.selectNodeContents(t);const r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(n)}function on(t){return t?Object.entries(t).map(([n,r])=>({key:n,value:r})):[]}function an(t){const n={};for(const r of t){const s=r.key.trim();s&&(n[s]=r.value)}return n}function st(){return{id:"",type:"stdio",enabled:!0,command:"",args:"",env:[],url:"",headers:[],oauth:!1,bearerTokenFile:"",isNew:!0}}function Ii(t,n){return{id:t,type:n.type,enabled:n.enabled,command:n.command??"",args:(n.args??[]).join(`
|
|
223
|
+
`),env:on(n.env),url:n.url??"",headers:on(n.headers),oauth:!!n.oauth,bearerTokenFile:n.bearerTokenFile??"",isNew:!1}}const zi={builtin:"Built-in",stdio:"Local process",http:"HTTP",sse:"SSE"};function Mi(){const{state:t,status:n,setState:r,refreshStatus:s,refreshTools:l,toast:i}=V(),[o,a]=C(null),[h,u]=C(null),[c,v]=C(!1),[y,m]=C(!1),[g,d]=C(null),[b,f]=C("");if(U(()=>{const _=()=>a(st());return window.addEventListener("airlock:new-provider",_),()=>window.removeEventListener("airlock:new-provider",_)},[]),!t)return null;const w=Object.entries(t.providers),p=b.trim().toLowerCase(),k=p?w.filter(([_,E])=>`${_} ${E.type} ${E.command??""} ${E.url??""}`.toLowerCase().includes(p)):w,N=async(_,E)=>{r(_),i(E),s().catch(()=>{}),l().catch(()=>{})},I=async()=>{if(o){v(!0),d(null);try{const _={id:o.id.trim(),type:o.type,enabled:o.enabled};o.type==="stdio"?(_.command=o.command,_.args=o.args.split(`
|
|
224
|
+
`).map(T=>T.trim()).filter(Boolean),_.env=an(o.env)):(o.type==="http"||o.type==="sse")&&(_.url=o.url,_.headers=an(o.headers),o.type==="http"&&(_.oauth=o.oauth,_.bearer_token_file=o.bearerTokenFile.trim()));const E=await q.saveProvider(_);a(null),await N(E,`Saved ${o.id.trim()}`)}catch(_){d(_.message)}finally{v(!1)}}},z=async(_,E)=>{try{const T=await q.saveProvider({id:_,type:E.type,enabled:!E.enabled});await N(T,`${E.enabled?"Disabled":"Enabled"} ${_}`)}catch(T){i(T.message,"error")}},$=(n==null?void 0:n.summary.down)??0;return e(O,{children:[e("header",{class:"topbar",children:[e("div",{class:"topbar-title",children:[e("h1",{children:"Providers"}),e("span",{class:"topbar-meta",children:n?e(O,{children:[Z(n.summary.tools,"tool"),$>0&&e(O,{children:[e("span",{class:"sep",children:"·"}),e("span",{class:"c-deny",children:[$," down"]})]})]}):w.length||""})]}),e("div",{class:"topbar-actions",children:[e(L,{variant:"ghost",busy:y,onClick:async()=>{m(!0);try{await Promise.all([s(),l()])}finally{m(!1)}},children:[e(Ee,{size:14,"aria-hidden":"true"}),"Check health"]}),e(L,{variant:"primary",onClick:()=>a(st()),children:[e(kt,{size:14,"aria-hidden":"true"}),"Add provider"]})]})]}),e("div",{class:"page",children:w.length===0?e(de,{title:"No providers yet",icon:e(tr,{size:22,"aria-hidden":"true"}),children:[e("p",{children:"Add an MCP server or a built-in provider so agents have tools to call."}),e(L,{variant:"primary",onClick:()=>a(st()),children:"Add provider"})]}):e(O,{children:[w.length>6&&e("div",{class:"toolbar",children:e(Pe,{value:b,onInput:f,placeholder:"Filter providers",label:"Filter providers"})}),k.length===0?e(de,{title:`No providers match “${b}”`,children:e(L,{size:"sm",onClick:()=>f(""),children:"Clear filter"})}):e("div",{class:"table-scroll",children:e("table",{class:"table",children:[e("thead",{children:e("tr",{children:[e("th",{scope:"col",children:"Provider"}),e("th",{scope:"col",class:"hide-sm",children:"Transport"}),e("th",{scope:"col",children:"Status"}),e("th",{scope:"col",class:"col-num",children:"Tools"}),e("th",{scope:"col",class:"col-actions",children:e("span",{class:"visually-hidden",children:"Actions"})})]})}),e("tbody",{children:k.map(([_,E])=>{const T=n==null?void 0:n.providers.find(P=>P.id===_),S=E.enabled?(T==null?void 0:T.status)??"unknown":"disabled",A=Object.keys(E.env??{}).length,D=Object.keys(E.headers??{}).length,x=E.type==="stdio"?[E.command,...E.args??[]].join(" "):E.type==="builtin"?"Runs inside the gateway":E.url??"",M=[E.oauth&&"OAuth",A>0&&Z(A,"env var"),D>0&&Z(D,"header")].filter(Boolean);return e("tr",{class:R(!E.enabled&&"is-off"),children:[e("th",{scope:"row",style:{maxWidth:0,width:"50%"},children:[e("span",{class:"prov-name",children:[e("span",{class:"cell-title",children:_}),(T==null?void 0:T.serverInfo)&&e("span",{class:"ink-3",style:{fontSize:"12px"},children:[T.serverInfo.name," ",T.serverInfo.version]})]}),e("span",{class:"prov-detail",title:x,children:[x,M.length>0&&e("span",{style:{fontFamily:"var(--font)"},children:[" · ",M.join(" · ")]})]}),(T==null?void 0:T.error)&&(S==="down"||S==="degraded")&&e("span",{class:"prov-error",children:T.error})]}),e("td",{class:"hide-sm ink-2",children:zi[E.type]}),e("td",{children:e("span",{class:"result",style:{color:S==="down"?"var(--deny-ink)":S==="degraded"?"var(--ask-ink)":void 0},children:[e("span",{class:R("dot",S==="ok"&&"is-ok",(S==="down"||S==="degraded")&&"is-down",S==="disabled"&&"is-off"),"aria-hidden":"true"}),S==="ok"?"Healthy":S==="degraded"?"Degraded":S==="down"?"Down":S==="disabled"?"Disabled":"Checking…"]})}),e("td",{class:"col-num ink-2",children:S==="disabled"?"—":(T==null?void 0:T.toolCount)??"—"}),e("td",{class:"col-actions",children:e("span",{style:{display:"inline-flex",gap:"4px"},children:[E.type!=="builtin"&&e(L,{size:"sm",variant:"ghost",onClick:()=>a(Ii(_,E)),"aria-label":`Edit ${_}`,children:"Edit"}),e($t,{label:`${_} actions`,trigger:P=>e(L,{...P,size:"sm",variant:"ghost",icon:!0,"aria-label":`More actions for ${_}`,children:e(Bn,{size:14,"aria-hidden":"true"})}),items:[{id:"toggle",label:E.enabled?"Disable":"Enable",sub:E.enabled?"Agents lose its tools until you turn it back on":"Start it with the gateway again",onSelect:()=>void z(_,E)},{id:"remove",label:"Remove provider",danger:!0,separatorBefore:!0,onSelect:()=>u(_)}]})]})})]},_)})})]})})]})}),o&&e(Fe,{open:!0,onClose:()=>{a(null),d(null)},title:o.isNew?"Add provider":`Edit ${o.id}`,subtitle:"Saved to airlock.yaml. Use ${VAR} to reference secrets from the gateway's environment.",footer:e(O,{children:[e("label",{class:"check",style:{marginRight:"auto"},children:[e("input",{type:"checkbox",checked:o.enabled,onChange:_=>a({...o,enabled:_.currentTarget.checked})}),"Enabled"]}),e(L,{variant:"ghost",onClick:()=>{a(null),d(null)},children:"Cancel"}),e(L,{variant:"primary",busy:c,onClick:I,children:o.isNew?"Add provider":"Save provider"})]}),children:e("div",{class:"form",children:[g&&e(ne,{tone:"error",children:g}),e("label",{class:"field",children:[e("span",{class:"field-label",children:"ID"}),e("input",{class:"input is-mono",name:"provider-id",value:o.id,disabled:!o.isNew,placeholder:"github…",autocomplete:"off",spellcheck:!1,onInput:_=>a({...o,id:_.currentTarget.value})}),e("span",{class:"field-help",children:["Its tools are named ",e("code",{children:[o.id||"id","/tool"]}),"."]})]}),e("fieldset",{class:"field",children:[e("legend",{class:"field-label",style:{marginBottom:"6px"},children:"Transport"}),e("div",{class:"radio-list",role:"radiogroup",children:[["stdio","Local process","Airlock starts an MCP server command."],["http","Streamable HTTP","A remote MCP server over HTTP."],["sse","Server-sent events","An older remote MCP endpoint."]].map(([_,E,T])=>e("label",{class:"radio-option",children:[e("input",{type:"radio",name:"transport",checked:o.type===_,onChange:()=>a({...o,type:_})}),e("strong",{children:E}),e("span",{children:T})]},_))})]}),o.type==="stdio"?e(O,{children:[e("label",{class:"field",children:[e("span",{class:"field-label",children:"Command"}),e("input",{class:"input is-mono",name:"command",value:o.command,placeholder:"npx…",autocomplete:"off",spellcheck:!1,onInput:_=>a({...o,command:_.currentTarget.value})})]}),e("label",{class:"field",children:[e("span",{class:"field-label",children:"Arguments"}),e("textarea",{class:"textarea is-mono",name:"args",rows:3,value:o.args,spellcheck:!1,placeholder:`-y
|
|
225
|
+
@modelcontextprotocol/server-github`,onInput:_=>a({...o,args:_.currentTarget.value})}),e("span",{class:"field-help",children:"One per line."})]}),e("div",{class:"field",children:[e("span",{class:"field-label",children:"Environment"}),e(Zt,{label:"Variable",rows:o.env,onChange:_=>a({...o,env:_}),keyPlaceholder:"GITHUB_TOKEN",valuePlaceholder:"${GITHUB_TOKEN}",addLabel:"Add variable"})]})]}):e(O,{children:[e("label",{class:"field",children:[e("span",{class:"field-label",children:"URL"}),e("input",{class:"input is-mono",type:"url",name:"url",value:o.url,placeholder:"https://mcp.example.com/mcp…",autocomplete:"off",spellcheck:!1,onInput:_=>a({...o,url:_.currentTarget.value})})]}),o.type==="http"&&e(O,{children:[e("label",{class:"check",children:[e("input",{type:"checkbox",checked:o.oauth,onChange:_=>a({...o,oauth:_.currentTarget.checked})}),"Sign in with OAuth"]}),e("label",{class:"field",children:[e("span",{class:"field-label",children:"Bearer token file (optional)"}),e("input",{class:"input is-mono",name:"bearer-token-file",value:o.bearerTokenFile,placeholder:"/config/secrets/provider.token",autocomplete:"off",spellcheck:!1,onInput:_=>a({...o,bearerTokenFile:_.currentTarget.value})}),e("span",{class:"field-help",children:"Path to a file containing a single bearer token (mutually exclusive with OAuth or an Authorization header)."})]})]}),e("div",{class:"field",children:[e("span",{class:"field-label",children:"Headers"}),e(Zt,{label:"Header",rows:o.headers,onChange:_=>a({...o,headers:_}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer ${API_TOKEN}",addLabel:"Add header"})]})]})]})}),h&&e(Fe,{open:!0,dialog:!0,onClose:()=>u(null),title:`Remove ${h}?`,footer:e(O,{children:[e(L,{variant:"ghost",onClick:()=>u(null),children:"Keep it"}),e(L,{variant:"danger",onClick:async()=>{try{const _=await q.deleteProvider(h);u(null),await N(_,`Removed ${h}`)}catch(_){i(_.message,"error")}},children:"Remove provider"})]}),children:e("p",{class:"ink-2",children:["Agents lose its tools immediately. Rules that mention ",e("code",{children:[h,"/*"]})," ","stay in airlock.yaml until you remove them."]})})]})}const Li="/assets/airlock-shield-fPu067nB.png";function Oi(){return e(_s,{children:e(ji,{})})}const Ri={"":"inbox",overview:"inbox",approvals:"inbox"};function ji(){const t=bs(),{state:n,loadError:r,pending:s,grants:l,status:i,meta:o,liveState:a,toasts:h,assistantOpen:u,setAssistantOpen:c,theme:v,setTheme:y}=V(),[m,g]=C(!1),[d,b]=C(!1),[f="",w,p]=t,k=Ri[f]??f,N=t.join("/");U(()=>{window.scrollTo(0,0),b(!1)},[N]),U(()=>{document.title=s.length?`(${s.length}) Airlock`:"Airlock"},[s.length]),U(()=>{var A;const S=getComputedStyle(document.body).backgroundColor;(A=document.querySelector('meta[name="theme-color"]'))==null||A.setAttribute("content",S)},[v]),U(()=>{let S=0;const A=D=>{const x=D.target,M=["INPUT","TEXTAREA","SELECT"].includes(x.tagName)||x.isContentEditable;if(!(D.metaKey||D.ctrlKey||D.altKey||M)){if(S&&Date.now()-S<900){const P={i:"inbox",g:"grants",l:"activity",a:"agents",p:"profiles",v:"providers"};if(S=0,P[D.key]){D.preventDefault(),D.stopPropagation(),window.location.hash=`/${P[D.key]}`;return}}if(D.key==="g"&&!document.querySelector(".scrim, .menu, .assistant.is-open")){S=Date.now(),D.preventDefault(),D.stopPropagation();return}if(D.key==="/"){const P=document.querySelector('[data-page-search="true"]');P&&(D.preventDefault(),P.focus(),P.select());return}if(D.key==="?"){D.preventDefault(),g(P=>!P);return}D.key==="n"&&((k==="agents"||k==="profiles")&&!w?(D.preventDefault(),window.location.hash=`/${k}/new`):k==="providers"&&(D.preventDefault(),window.dispatchEvent(new CustomEvent("airlock:new-provider"))))}};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[k,w]);const I=(i==null?void 0:i.summary.down)??0,z=[{id:"inbox",label:"Inbox",icon:e(ls,{size:16,"aria-hidden":"true"}),attention:s.length},{id:"grants",label:"Grants",icon:e(Wn,{size:16,"aria-hidden":"true"}),count:l.length||void 0},{id:"activity",label:"Activity",icon:e(An,{size:16,"aria-hidden":"true"})}],$=[{id:"agents",label:"Agents",icon:e(En,{size:16,"aria-hidden":"true"}),count:n?Object.keys(n.agents).length:void 0},{id:"profiles",label:"Profiles",icon:e(Gn,{size:16,"aria-hidden":"true"}),count:n?Object.keys(n.profiles).length:void 0},{id:"providers",label:"Providers",icon:e(tr,{size:16,"aria-hidden":"true"}),count:n?Object.keys(n.providers).length:void 0,attention:I,danger:!0}];let _=null;if(r)_=e("div",{class:"page",children:e(de,{title:"Airlock could not read its config",children:e("p",{children:r})})});else if(!n)_=e("div",{class:"boot","aria-busy":"true"});else if(k==="inbox")_=e(ln,{});else if(k==="grants")_=e(ui,{});else if(k==="activity")_=e(Us,{});else if(k==="agents"||k==="profiles"){const S=k==="agents"?"agent":"profile";_=w==="new"?e(oi,{kind:S,baseId:p},`${S}-new-${p??""}`):w?e(di,{kind:S,id:w},`${S}-${w}`):e(ci,{kind:S})}else k==="providers"?_=e(Mi,{}):_=e(ln,{});const E=S=>e("ul",{class:"rail-nav",children:S.map(A=>e("li",{children:e("a",{href:`#/${A.id}`,class:"rail-link","aria-current":k===A.id?"page":void 0,children:[A.icon,e("span",{class:"rail-link-label",children:A.label}),A.attention?e("span",{class:R("rail-count","is-attention",A.danger&&"is-danger"),"aria-label":A.danger?`${A.attention} down`:`${A.attention} waiting`,children:A.attention}):A.count!==void 0?e("span",{class:"rail-count",children:A.count}):null]})},A.id))}),T={"--mark":`url(${Li})`};return e("div",{class:"shell",style:T,children:[e("a",{class:"skip-link",href:"#main",children:"Skip to content"}),e("div",{class:"mobile-bar",children:[e(L,{variant:"ghost",icon:!0,"aria-label":"Open navigation","aria-expanded":d,onClick:()=>b(!0),children:e(as,{size:16,"aria-hidden":"true"})}),e("a",{class:"brand",href:"#/inbox",children:[e("span",{class:"brand-mark","aria-hidden":"true"}),"Airlock"]}),s.length>0&&k!=="inbox"&&e("a",{href:"#/inbox",class:"rail-count is-attention",children:[s.length," waiting"]})]}),d&&e("div",{class:"rail-scrim",onClick:()=>b(!1)}),e("nav",{class:R("rail",d&&"is-open"),"aria-label":"Main",children:[e("a",{class:"brand",href:"#/inbox","aria-label":"Airlock, go to Inbox",children:[e("span",{class:"brand-mark","aria-hidden":"true"}),"Airlock"]}),E(z),e("div",{class:"rail-divider",role:"separator"}),E($),e("div",{class:"rail-foot",children:[e("a",{href:"#/assistant",class:"rail-link","aria-pressed":u,onClick:S=>{S.preventDefault(),c(!u)},children:[e(sr,{size:16,"aria-hidden":"true"}),e("span",{class:"rail-link-label",children:"Policy assistant"})]}),e(Ss,{label:"Theme",class:"is-icons",value:v,onChange:y,options:[{value:"system",label:e(ds,{size:14,"aria-hidden":"true"}),title:"System theme"},{value:"light",label:e(fs,{size:14,"aria-hidden":"true"}),title:"Light theme"},{value:"dark",label:e(hs,{size:14,"aria-hidden":"true"}),title:"Dark theme"}]}),e("div",{class:"rail-meta",children:[e("span",{class:R("dot",`is-${a}`),"aria-hidden":"true"}),e("span",{children:a==="live"?"Live":a==="reconnecting"?"Reconnecting…":"Config only"}),o&&e("span",{children:["· v",o.version]}),e("span",{class:"rail-meta-spacer"}),e(L,{variant:"ghost",size:"sm",icon:!0,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts (?)",onClick:()=>g(!0),children:e(X,{children:"?"})})]}),n&&e("p",{class:"rail-config truncate",title:n.configPath,children:n.configPath.split("/").slice(-2).join("/")})]})]}),e("main",{class:"stage",id:"main",children:_}),e(Js,{}),e(Ni,{}),e(Fe,{open:m,dialog:!0,onClose:()=>g(!1),title:"Keyboard shortcuts",children:e("dl",{class:"shortcuts",children:[[["J","K"],"Next and previous request"],[["A"],"Approve once"],[["D"],"Deny"],[["Enter"],"Open request (on small screens)"],[["/"],"Search this page"],[["N"],"New agent, profile, or provider"],[["G","I"],"Go to Inbox"],[["G","L"],"Go to Activity"],[["G","A"],"Go to Agents"],[["Esc"],"Close panel or menu"]].map(([S,A])=>e("div",{children:[e("dt",{children:A}),e("dd",{children:S.map(D=>e(X,{children:D},D))})]},A))})}),e("div",{class:"toasts",role:"status","aria-live":"polite",children:h.map(S=>e("div",{class:R("toast",S.tone==="error"&&"is-error"),children:[S.tone==="error"?e(Rn,{size:15,"aria-hidden":"true"}):e(is,{size:15,"aria-hidden":"true"}),S.text]},S.id))})]})}Ur(e(Oi,{}),document.getElementById("app"));
|