siclaw 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +268 -0
- package/dist/agentbox/gateway-client.d.ts +41 -0
- package/dist/agentbox/gateway-client.js +108 -0
- package/dist/agentbox/gateway-client.js.map +1 -0
- package/dist/agentbox/http-server.d.ts +12 -0
- package/dist/agentbox/http-server.js +700 -0
- package/dist/agentbox/http-server.js.map +1 -0
- package/dist/agentbox/mcp-sync.d.ts +6 -0
- package/dist/agentbox/mcp-sync.js +26 -0
- package/dist/agentbox/mcp-sync.js.map +1 -0
- package/dist/agentbox/resource-handlers.d.ts +40 -0
- package/dist/agentbox/resource-handlers.js +116 -0
- package/dist/agentbox/resource-handlers.js.map +1 -0
- package/dist/agentbox/resource-sync.d.ts +28 -0
- package/dist/agentbox/resource-sync.js +74 -0
- package/dist/agentbox/resource-sync.js.map +1 -0
- package/dist/agentbox/session.d.ts +145 -0
- package/dist/agentbox/session.js +444 -0
- package/dist/agentbox/session.js.map +1 -0
- package/dist/agentbox-main.d.ts +7 -0
- package/dist/agentbox-main.js +90 -0
- package/dist/agentbox-main.js.map +1 -0
- package/dist/cli-main.d.ts +1 -0
- package/dist/cli-main.js +187 -0
- package/dist/cli-main.js.map +1 -0
- package/dist/cli-setup.d.ts +17 -0
- package/dist/cli-setup.js +247 -0
- package/dist/cli-setup.js.map +1 -0
- package/dist/core/agent-factory.d.ts +52 -0
- package/dist/core/agent-factory.js +547 -0
- package/dist/core/agent-factory.js.map +1 -0
- package/dist/core/brain-session.d.ts +67 -0
- package/dist/core/brain-session.js +15 -0
- package/dist/core/brain-session.js.map +1 -0
- package/dist/core/brains/claude-sdk-brain.d.ts +76 -0
- package/dist/core/brains/claude-sdk-brain.js +403 -0
- package/dist/core/brains/claude-sdk-brain.js.map +1 -0
- package/dist/core/brains/pi-agent-brain.d.ts +28 -0
- package/dist/core/brains/pi-agent-brain.js +84 -0
- package/dist/core/brains/pi-agent-brain.js.map +1 -0
- package/dist/core/config.d.ts +109 -0
- package/dist/core/config.js +294 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/extensions/context-pruning.d.ts +38 -0
- package/dist/core/extensions/context-pruning.js +162 -0
- package/dist/core/extensions/context-pruning.js.map +1 -0
- package/dist/core/extensions/deep-investigation.d.ts +2 -0
- package/dist/core/extensions/deep-investigation.js +541 -0
- package/dist/core/extensions/deep-investigation.js.map +1 -0
- package/dist/core/extensions/memory-flush.d.ts +20 -0
- package/dist/core/extensions/memory-flush.js +120 -0
- package/dist/core/extensions/memory-flush.js.map +1 -0
- package/dist/core/llm-proxy.d.ts +37 -0
- package/dist/core/llm-proxy.js +578 -0
- package/dist/core/llm-proxy.js.map +1 -0
- package/dist/core/mcp-client.d.ts +80 -0
- package/dist/core/mcp-client.js +285 -0
- package/dist/core/mcp-client.js.map +1 -0
- package/dist/core/prompt.d.ts +1 -0
- package/dist/core/prompt.js +64 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/core/tool-adapter.d.ts +45 -0
- package/dist/core/tool-adapter.js +154 -0
- package/dist/core/tool-adapter.js.map +1 -0
- package/dist/cron/cron-api.d.ts +9 -0
- package/dist/cron/cron-api.js +94 -0
- package/dist/cron/cron-api.js.map +1 -0
- package/dist/cron/cron-coordinator.d.ts +29 -0
- package/dist/cron/cron-coordinator.js +150 -0
- package/dist/cron/cron-coordinator.js.map +1 -0
- package/dist/cron/cron-executor.d.ts +15 -0
- package/dist/cron/cron-executor.js +90 -0
- package/dist/cron/cron-executor.js.map +1 -0
- package/dist/cron/cron-matcher.d.ts +19 -0
- package/dist/cron/cron-matcher.js +114 -0
- package/dist/cron/cron-matcher.js.map +1 -0
- package/dist/cron/cron-scheduler.d.ts +42 -0
- package/dist/cron/cron-scheduler.js +91 -0
- package/dist/cron/cron-scheduler.js.map +1 -0
- package/dist/cron/gateway-client.d.ts +32 -0
- package/dist/cron/gateway-client.js +91 -0
- package/dist/cron/gateway-client.js.map +1 -0
- package/dist/cron-main.d.ts +10 -0
- package/dist/cron-main.js +75 -0
- package/dist/cron-main.js.map +1 -0
- package/dist/gateway/agentbox/client.d.ts +187 -0
- package/dist/gateway/agentbox/client.js +314 -0
- package/dist/gateway/agentbox/client.js.map +1 -0
- package/dist/gateway/agentbox/index.d.ts +10 -0
- package/dist/gateway/agentbox/index.js +11 -0
- package/dist/gateway/agentbox/index.js.map +1 -0
- package/dist/gateway/agentbox/k8s-spawner.d.ts +70 -0
- package/dist/gateway/agentbox/k8s-spawner.js +466 -0
- package/dist/gateway/agentbox/k8s-spawner.js.map +1 -0
- package/dist/gateway/agentbox/local-spawner.d.ts +63 -0
- package/dist/gateway/agentbox/local-spawner.js +234 -0
- package/dist/gateway/agentbox/local-spawner.js.map +1 -0
- package/dist/gateway/agentbox/manager.d.ts +121 -0
- package/dist/gateway/agentbox/manager.js +325 -0
- package/dist/gateway/agentbox/manager.js.map +1 -0
- package/dist/gateway/agentbox/process-spawner.d.ts +21 -0
- package/dist/gateway/agentbox/process-spawner.js +168 -0
- package/dist/gateway/agentbox/process-spawner.js.map +1 -0
- package/dist/gateway/agentbox/spawner.d.ts +33 -0
- package/dist/gateway/agentbox/spawner.js +10 -0
- package/dist/gateway/agentbox/spawner.js.map +1 -0
- package/dist/gateway/agentbox/types.d.ts +39 -0
- package/dist/gateway/agentbox/types.js +5 -0
- package/dist/gateway/agentbox/types.js.map +1 -0
- package/dist/gateway/auth/bind-code-store.d.ts +31 -0
- package/dist/gateway/auth/bind-code-store.js +73 -0
- package/dist/gateway/auth/bind-code-store.js.map +1 -0
- package/dist/gateway/auth/index.d.ts +9 -0
- package/dist/gateway/auth/index.js +10 -0
- package/dist/gateway/auth/index.js.map +1 -0
- package/dist/gateway/auth/jwt.d.ts +23 -0
- package/dist/gateway/auth/jwt.js +82 -0
- package/dist/gateway/auth/jwt.js.map +1 -0
- package/dist/gateway/auth/login.d.ts +26 -0
- package/dist/gateway/auth/login.js +74 -0
- package/dist/gateway/auth/login.js.map +1 -0
- package/dist/gateway/auth/middleware.d.ts +23 -0
- package/dist/gateway/auth/middleware.js +67 -0
- package/dist/gateway/auth/middleware.js.map +1 -0
- package/dist/gateway/auth/oauth2.d.ts +57 -0
- package/dist/gateway/auth/oauth2.js +113 -0
- package/dist/gateway/auth/oauth2.js.map +1 -0
- package/dist/gateway/auth/user-store.d.ts +95 -0
- package/dist/gateway/auth/user-store.js +291 -0
- package/dist/gateway/auth/user-store.js.map +1 -0
- package/dist/gateway/channels/channel-manager.d.ts +42 -0
- package/dist/gateway/channels/channel-manager.js +156 -0
- package/dist/gateway/channels/channel-manager.js.map +1 -0
- package/dist/gateway/channels/channel-rpc.d.ts +9 -0
- package/dist/gateway/channels/channel-rpc.js +104 -0
- package/dist/gateway/channels/channel-rpc.js.map +1 -0
- package/dist/gateway/channels/channel-store.d.ts +32 -0
- package/dist/gateway/channels/channel-store.js +114 -0
- package/dist/gateway/channels/channel-store.js.map +1 -0
- package/dist/gateway/channels/discord.d.ts +5 -0
- package/dist/gateway/channels/discord.js +177 -0
- package/dist/gateway/channels/discord.js.map +1 -0
- package/dist/gateway/channels/lark-format.d.ts +41 -0
- package/dist/gateway/channels/lark-format.js +620 -0
- package/dist/gateway/channels/lark-format.js.map +1 -0
- package/dist/gateway/channels/lark.d.ts +5 -0
- package/dist/gateway/channels/lark.js +1000 -0
- package/dist/gateway/channels/lark.js.map +1 -0
- package/dist/gateway/channels/slack.d.ts +5 -0
- package/dist/gateway/channels/slack.js +170 -0
- package/dist/gateway/channels/slack.js.map +1 -0
- package/dist/gateway/channels/telegram.d.ts +5 -0
- package/dist/gateway/channels/telegram.js +173 -0
- package/dist/gateway/channels/telegram.js.map +1 -0
- package/dist/gateway/channels/utils.d.ts +34 -0
- package/dist/gateway/channels/utils.js +115 -0
- package/dist/gateway/channels/utils.js.map +1 -0
- package/dist/gateway/config.d.ts +14 -0
- package/dist/gateway/config.js +12 -0
- package/dist/gateway/config.js.map +1 -0
- package/dist/gateway/cron/notify.d.ts +14 -0
- package/dist/gateway/cron/notify.js +40 -0
- package/dist/gateway/cron/notify.js.map +1 -0
- package/dist/gateway/db/dialect-helpers.d.ts +8 -0
- package/dist/gateway/db/dialect-helpers.js +26 -0
- package/dist/gateway/db/dialect-helpers.js.map +1 -0
- package/dist/gateway/db/index.d.ts +20 -0
- package/dist/gateway/db/index.js +140 -0
- package/dist/gateway/db/index.js.map +1 -0
- package/dist/gateway/db/init-schema.d.ts +8 -0
- package/dist/gateway/db/init-schema.js +385 -0
- package/dist/gateway/db/init-schema.js.map +1 -0
- package/dist/gateway/db/migrate-sqlite.d.ts +8 -0
- package/dist/gateway/db/migrate-sqlite.js +335 -0
- package/dist/gateway/db/migrate-sqlite.js.map +1 -0
- package/dist/gateway/db/repositories/chat-repo.d.ts +64 -0
- package/dist/gateway/db/repositories/chat-repo.js +115 -0
- package/dist/gateway/db/repositories/chat-repo.js.map +1 -0
- package/dist/gateway/db/repositories/config-repo.d.ts +164 -0
- package/dist/gateway/db/repositories/config-repo.js +267 -0
- package/dist/gateway/db/repositories/config-repo.js.map +1 -0
- package/dist/gateway/db/repositories/credential-repo.d.ts +51 -0
- package/dist/gateway/db/repositories/credential-repo.js +70 -0
- package/dist/gateway/db/repositories/credential-repo.js.map +1 -0
- package/dist/gateway/db/repositories/env-repo.d.ts +37 -0
- package/dist/gateway/db/repositories/env-repo.js +74 -0
- package/dist/gateway/db/repositories/env-repo.js.map +1 -0
- package/dist/gateway/db/repositories/mcp-server-repo.d.ts +97 -0
- package/dist/gateway/db/repositories/mcp-server-repo.js +83 -0
- package/dist/gateway/db/repositories/mcp-server-repo.js.map +1 -0
- package/dist/gateway/db/repositories/model-config-repo.d.ts +141 -0
- package/dist/gateway/db/repositories/model-config-repo.js +439 -0
- package/dist/gateway/db/repositories/model-config-repo.js.map +1 -0
- package/dist/gateway/db/repositories/notification-repo.d.ts +50 -0
- package/dist/gateway/db/repositories/notification-repo.js +105 -0
- package/dist/gateway/db/repositories/notification-repo.js.map +1 -0
- package/dist/gateway/db/repositories/permission-repo.d.ts +28 -0
- package/dist/gateway/db/repositories/permission-repo.js +74 -0
- package/dist/gateway/db/repositories/permission-repo.js.map +1 -0
- package/dist/gateway/db/repositories/skill-content-repo.d.ts +29 -0
- package/dist/gateway/db/repositories/skill-content-repo.js +90 -0
- package/dist/gateway/db/repositories/skill-content-repo.js.map +1 -0
- package/dist/gateway/db/repositories/skill-repo.d.ts +170 -0
- package/dist/gateway/db/repositories/skill-repo.js +185 -0
- package/dist/gateway/db/repositories/skill-repo.js.map +1 -0
- package/dist/gateway/db/repositories/skill-review-repo.d.ts +44 -0
- package/dist/gateway/db/repositories/skill-review-repo.js +44 -0
- package/dist/gateway/db/repositories/skill-review-repo.js.map +1 -0
- package/dist/gateway/db/repositories/skill-version-repo.d.ts +30 -0
- package/dist/gateway/db/repositories/skill-version-repo.js +56 -0
- package/dist/gateway/db/repositories/skill-version-repo.js.map +1 -0
- package/dist/gateway/db/repositories/system-config-repo.d.ts +21 -0
- package/dist/gateway/db/repositories/system-config-repo.js +86 -0
- package/dist/gateway/db/repositories/system-config-repo.js.map +1 -0
- package/dist/gateway/db/repositories/user-env-config-repo.d.ts +32 -0
- package/dist/gateway/db/repositories/user-env-config-repo.js +79 -0
- package/dist/gateway/db/repositories/user-env-config-repo.js.map +1 -0
- package/dist/gateway/db/repositories/user-repo.d.ts +59 -0
- package/dist/gateway/db/repositories/user-repo.js +83 -0
- package/dist/gateway/db/repositories/user-repo.js.map +1 -0
- package/dist/gateway/db/repositories/vote-repo.d.ts +26 -0
- package/dist/gateway/db/repositories/vote-repo.js +97 -0
- package/dist/gateway/db/repositories/vote-repo.js.map +1 -0
- package/dist/gateway/db/repositories/workspace-repo.d.ts +27 -0
- package/dist/gateway/db/repositories/workspace-repo.js +145 -0
- package/dist/gateway/db/repositories/workspace-repo.js.map +1 -0
- package/dist/gateway/db/schema-mysql.d.ts +3897 -0
- package/dist/gateway/db/schema-mysql.js +354 -0
- package/dist/gateway/db/schema-mysql.js.map +1 -0
- package/dist/gateway/db/schema-sqlite.d.ts +4147 -0
- package/dist/gateway/db/schema-sqlite.js +345 -0
- package/dist/gateway/db/schema-sqlite.js.map +1 -0
- package/dist/gateway/db/schema.d.ts +3869 -0
- package/dist/gateway/db/schema.js +16 -0
- package/dist/gateway/db/schema.js.map +1 -0
- package/dist/gateway/mcp-config-builder.d.ts +8 -0
- package/dist/gateway/mcp-config-builder.js +39 -0
- package/dist/gateway/mcp-config-builder.js.map +1 -0
- package/dist/gateway/output-redactor.d.ts +27 -0
- package/dist/gateway/output-redactor.js +101 -0
- package/dist/gateway/output-redactor.js.map +1 -0
- package/dist/gateway/plugins/api.d.ts +181 -0
- package/dist/gateway/plugins/api.js +28 -0
- package/dist/gateway/plugins/api.js.map +1 -0
- package/dist/gateway/plugins/channel-bridge.d.ts +72 -0
- package/dist/gateway/plugins/channel-bridge.js +586 -0
- package/dist/gateway/plugins/channel-bridge.js.map +1 -0
- package/dist/gateway/plugins/loader.d.ts +2 -0
- package/dist/gateway/plugins/loader.js +83 -0
- package/dist/gateway/plugins/loader.js.map +1 -0
- package/dist/gateway/plugins/runtime.d.ts +25 -0
- package/dist/gateway/plugins/runtime.js +64 -0
- package/dist/gateway/plugins/runtime.js.map +1 -0
- package/dist/gateway/resource-notifier.d.ts +36 -0
- package/dist/gateway/resource-notifier.js +123 -0
- package/dist/gateway/resource-notifier.js.map +1 -0
- package/dist/gateway/rpc-methods.d.ts +34 -0
- package/dist/gateway/rpc-methods.js +3198 -0
- package/dist/gateway/rpc-methods.js.map +1 -0
- package/dist/gateway/security/cert-manager.d.ts +77 -0
- package/dist/gateway/security/cert-manager.js +280 -0
- package/dist/gateway/security/cert-manager.js.map +1 -0
- package/dist/gateway/security/mtls-middleware.d.ts +33 -0
- package/dist/gateway/security/mtls-middleware.js +89 -0
- package/dist/gateway/security/mtls-middleware.js.map +1 -0
- package/dist/gateway/server.d.ts +54 -0
- package/dist/gateway/server.js +1146 -0
- package/dist/gateway/server.js.map +1 -0
- package/dist/gateway/skill-labels.d.ts +16 -0
- package/dist/gateway/skill-labels.js +79 -0
- package/dist/gateway/skill-labels.js.map +1 -0
- package/dist/gateway/skills/file-writer.d.ts +75 -0
- package/dist/gateway/skills/file-writer.js +320 -0
- package/dist/gateway/skills/file-writer.js.map +1 -0
- package/dist/gateway/skills/script-evaluator.d.ts +42 -0
- package/dist/gateway/skills/script-evaluator.js +204 -0
- package/dist/gateway/skills/script-evaluator.js.map +1 -0
- package/dist/gateway/skills/skill-bundle.d.ts +34 -0
- package/dist/gateway/skills/skill-bundle.js +83 -0
- package/dist/gateway/skills/skill-bundle.js.map +1 -0
- package/dist/gateway/web/dist/assets/index-BF6CtvnV.css +1 -0
- package/dist/gateway/web/dist/assets/index-Dumzqsr-.js +680 -0
- package/dist/gateway/web/dist/assets/index-n4IMHP1Q.js +675 -0
- package/dist/gateway/web/dist/index.html +14 -0
- package/dist/gateway/web/dist/noise.png +1 -0
- package/dist/gateway/web/dist/robots.txt +2 -0
- package/dist/gateway/web/dist/vite.svg +1 -0
- package/dist/gateway/ws-protocol.d.ts +68 -0
- package/dist/gateway/ws-protocol.js +106 -0
- package/dist/gateway/ws-protocol.js.map +1 -0
- package/dist/gateway-main.d.ts +1 -0
- package/dist/gateway-main.js +129 -0
- package/dist/gateway-main.js.map +1 -0
- package/dist/lib/s3-backup.d.ts +28 -0
- package/dist/lib/s3-backup.js +85 -0
- package/dist/lib/s3-backup.js.map +1 -0
- package/dist/lib/s3-storage.d.ts +45 -0
- package/dist/lib/s3-storage.js +210 -0
- package/dist/lib/s3-storage.js.map +1 -0
- package/dist/memory/chunker.d.ts +15 -0
- package/dist/memory/chunker.js +94 -0
- package/dist/memory/chunker.js.map +1 -0
- package/dist/memory/embeddings.d.ts +14 -0
- package/dist/memory/embeddings.js +143 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/index.d.ts +18 -0
- package/dist/memory/index.js +15 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/indexer.d.ts +70 -0
- package/dist/memory/indexer.js +567 -0
- package/dist/memory/indexer.js.map +1 -0
- package/dist/memory/mmr.d.ts +22 -0
- package/dist/memory/mmr.js +82 -0
- package/dist/memory/mmr.js.map +1 -0
- package/dist/memory/schema.d.ts +2 -0
- package/dist/memory/schema.js +85 -0
- package/dist/memory/schema.js.map +1 -0
- package/dist/memory/session-summarizer.d.ts +19 -0
- package/dist/memory/session-summarizer.js +139 -0
- package/dist/memory/session-summarizer.js.map +1 -0
- package/dist/memory/stop-words.d.ts +13 -0
- package/dist/memory/stop-words.js +132 -0
- package/dist/memory/stop-words.js.map +1 -0
- package/dist/memory/temporal-decay.d.ts +20 -0
- package/dist/memory/temporal-decay.js +63 -0
- package/dist/memory/temporal-decay.js.map +1 -0
- package/dist/memory/types.d.ts +40 -0
- package/dist/memory/types.js +2 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/shared/resource-sync.d.ts +80 -0
- package/dist/shared/resource-sync.js +24 -0
- package/dist/shared/resource-sync.js.map +1 -0
- package/dist/tools/command-sets.d.ts +61 -0
- package/dist/tools/command-sets.js +845 -0
- package/dist/tools/command-sets.js.map +1 -0
- package/dist/tools/create-skill.d.ts +2 -0
- package/dist/tools/create-skill.js +169 -0
- package/dist/tools/create-skill.js.map +1 -0
- package/dist/tools/credential-list.d.ts +8 -0
- package/dist/tools/credential-list.js +139 -0
- package/dist/tools/credential-list.js.map +1 -0
- package/dist/tools/deep-search/engine.d.ts +40 -0
- package/dist/tools/deep-search/engine.js +594 -0
- package/dist/tools/deep-search/engine.js.map +1 -0
- package/dist/tools/deep-search/events.d.ts +11 -0
- package/dist/tools/deep-search/events.js +10 -0
- package/dist/tools/deep-search/events.js.map +1 -0
- package/dist/tools/deep-search/format.d.ts +11 -0
- package/dist/tools/deep-search/format.js +143 -0
- package/dist/tools/deep-search/format.js.map +1 -0
- package/dist/tools/deep-search/prompts.d.ts +30 -0
- package/dist/tools/deep-search/prompts.js +237 -0
- package/dist/tools/deep-search/prompts.js.map +1 -0
- package/dist/tools/deep-search/sre-knowledge.d.ts +21 -0
- package/dist/tools/deep-search/sre-knowledge.js +112 -0
- package/dist/tools/deep-search/sre-knowledge.js.map +1 -0
- package/dist/tools/deep-search/sub-agent.d.ts +71 -0
- package/dist/tools/deep-search/sub-agent.js +401 -0
- package/dist/tools/deep-search/sub-agent.js.map +1 -0
- package/dist/tools/deep-search/tool.d.ts +9 -0
- package/dist/tools/deep-search/tool.js +201 -0
- package/dist/tools/deep-search/tool.js.map +1 -0
- package/dist/tools/deep-search/types.d.ts +67 -0
- package/dist/tools/deep-search/types.js +41 -0
- package/dist/tools/deep-search/types.js.map +1 -0
- package/dist/tools/dp-tools.d.ts +47 -0
- package/dist/tools/dp-tools.js +170 -0
- package/dist/tools/dp-tools.js.map +1 -0
- package/dist/tools/fork-skill.d.ts +2 -0
- package/dist/tools/fork-skill.js +93 -0
- package/dist/tools/fork-skill.js.map +1 -0
- package/dist/tools/k8s-checks.d.ts +18 -0
- package/dist/tools/k8s-checks.js +105 -0
- package/dist/tools/k8s-checks.js.map +1 -0
- package/dist/tools/kubeconfig-resolver.d.ts +11 -0
- package/dist/tools/kubeconfig-resolver.js +53 -0
- package/dist/tools/kubeconfig-resolver.js.map +1 -0
- package/dist/tools/kubectl.d.ts +12 -0
- package/dist/tools/kubectl.js +169 -0
- package/dist/tools/kubectl.js.map +1 -0
- package/dist/tools/manage-schedule.d.ts +3 -0
- package/dist/tools/manage-schedule.js +189 -0
- package/dist/tools/manage-schedule.js.map +1 -0
- package/dist/tools/memory-get.d.ts +2 -0
- package/dist/tools/memory-get.js +99 -0
- package/dist/tools/memory-get.js.map +1 -0
- package/dist/tools/memory-search.d.ts +3 -0
- package/dist/tools/memory-search.js +93 -0
- package/dist/tools/memory-search.js.map +1 -0
- package/dist/tools/netns-script.d.ts +3 -0
- package/dist/tools/netns-script.js +394 -0
- package/dist/tools/netns-script.js.map +1 -0
- package/dist/tools/node-exec.d.ts +18 -0
- package/dist/tools/node-exec.js +342 -0
- package/dist/tools/node-exec.js.map +1 -0
- package/dist/tools/node-script.d.ts +3 -0
- package/dist/tools/node-script.js +266 -0
- package/dist/tools/node-script.js.map +1 -0
- package/dist/tools/pod-exec.d.ts +4 -0
- package/dist/tools/pod-exec.js +146 -0
- package/dist/tools/pod-exec.js.map +1 -0
- package/dist/tools/pod-nsenter-exec.d.ts +3 -0
- package/dist/tools/pod-nsenter-exec.js +333 -0
- package/dist/tools/pod-nsenter-exec.js.map +1 -0
- package/dist/tools/pod-script.d.ts +3 -0
- package/dist/tools/pod-script.js +176 -0
- package/dist/tools/pod-script.js.map +1 -0
- package/dist/tools/restricted-bash.d.ts +41 -0
- package/dist/tools/restricted-bash.js +503 -0
- package/dist/tools/restricted-bash.js.map +1 -0
- package/dist/tools/run-skill.d.ts +3 -0
- package/dist/tools/run-skill.js +169 -0
- package/dist/tools/run-skill.js.map +1 -0
- package/dist/tools/sanitize-env.d.ts +14 -0
- package/dist/tools/sanitize-env.js +95 -0
- package/dist/tools/sanitize-env.js.map +1 -0
- package/dist/tools/script-resolver.d.ts +35 -0
- package/dist/tools/script-resolver.js +213 -0
- package/dist/tools/script-resolver.js.map +1 -0
- package/dist/tools/tool-render.d.ts +20 -0
- package/dist/tools/tool-render.js +77 -0
- package/dist/tools/tool-render.js.map +1 -0
- package/dist/tools/update-skill.d.ts +2 -0
- package/dist/tools/update-skill.js +169 -0
- package/dist/tools/update-skill.js.map +1 -0
- package/package.json +106 -0
- package/settings.example.json +74 -0
- package/siclaw.mjs +48 -0
- package/skills/core/cluster-events/SKILL.md +150 -0
- package/skills/core/deep-investigation/SKILL.md +87 -0
- package/skills/core/deep-investigation/default-memory.md +8 -0
- package/skills/core/deployment-rollout-debug/SKILL.md +144 -0
- package/skills/core/dns-debug/SKILL.md +144 -0
- package/skills/core/find-node/SKILL.md +23 -0
- package/skills/core/find-node/scripts/find-node.sh +9 -0
- package/skills/core/hpa-debug/SKILL.md +159 -0
- package/skills/core/image-pull-debug/SKILL.md +151 -0
- package/skills/core/ingress-debug/SKILL.md +189 -0
- package/skills/core/job-debug/SKILL.md +180 -0
- package/skills/core/meta.json +23 -0
- package/skills/core/node-health-check/SKILL.md +150 -0
- package/skills/core/node-logs/SKILL.md +68 -0
- package/skills/core/node-logs/scripts/get-node-logs.sh +78 -0
- package/skills/core/node-ping-gateway/SKILL.md +54 -0
- package/skills/core/node-ping-gateway/scripts/ping-node-gateway.sh +71 -0
- package/skills/core/node-show-gateway/SKILL.md +55 -0
- package/skills/core/node-show-gateway/scripts/show-node-gateway.sh +90 -0
- package/skills/core/pod-crash-debug/SKILL.md +135 -0
- package/skills/core/pod-pending-debug/SKILL.md +146 -0
- package/skills/core/pod-ping-gateway/SKILL.md +44 -0
- package/skills/core/pod-ping-gateway/scripts/ping-gateway.sh +76 -0
- package/skills/core/pod-show-gateway/SKILL.md +54 -0
- package/skills/core/pod-show-gateway/scripts/show-gateway.sh +115 -0
- package/skills/core/pvc-debug/SKILL.md +169 -0
- package/skills/core/service-debug/SKILL.md +164 -0
- package/skills/extension/.gitkeep +0 -0
- package/skills/platform/create-skill/SKILL.md +288 -0
- package/skills/platform/manage-skill/SKILL.md +23 -0
- package/skills/platform/update-skill/SKILL.md +52 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-render.js","sourceRoot":"","sources":["../../src/tools/tool-render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,UAAU,GAAG,IAAI,C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O,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { skillExistsInBundle } from "./script-resolver.js";
|
|
3
|
+
export function createUpdateSkillTool() {
|
|
4
|
+
return {
|
|
5
|
+
name: "update_skill",
|
|
6
|
+
label: "Update Skill",
|
|
7
|
+
description: `Update an existing Siclaw skill definition.
|
|
8
|
+
This tool outputs a structured skill update that the user can preview and confirm. It does NOT persist anything — the user must confirm via the UI.
|
|
9
|
+
|
|
10
|
+
Use this tool (NOT create_skill) when the user asks to modify, update, change, or fix an existing skill. This includes:
|
|
11
|
+
- When the user message contains [Editing Skill: <name> (id:<id>)] context from the UI
|
|
12
|
+
- When the user asks to change a skill that was created earlier in the conversation
|
|
13
|
+
- When the user asks to modify or replace an existing skill
|
|
14
|
+
|
|
15
|
+
**IMPORTANT — Identify the target skill FIRST**:
|
|
16
|
+
Before calling this tool, you MUST know the exact name of the skill to update. Check the Skill Scripts Reference in your context for existing skills. If the user's request is ambiguous (e.g. "update that skill", "update it"), ASK the user to clarify which skill they mean. Never guess — a wrong target will corrupt the wrong skill.
|
|
17
|
+
|
|
18
|
+
Do NOT use read, edit, write, or bash on files under .siclaw/skills/ — the filesystem is read-only. Always use this tool instead.
|
|
19
|
+
|
|
20
|
+
**Approval required**: When scripts are changed, the update enters a "staged" review state and requires admin approval before the new version becomes active. The old version of the skill remains usable during review. After updating, do NOT attempt to test the new version — it will not take effect until an admin approves it. Inform the user that the update is pending review.
|
|
21
|
+
|
|
22
|
+
Parameters:
|
|
23
|
+
- id: The skill ID from [Editing Skill: ... (id:<id>)] context, OR the skill's kebab-case name (for name-based lookup).
|
|
24
|
+
- name: the skill name in kebab-case (cannot be changed after creation).
|
|
25
|
+
- description: one-line summary
|
|
26
|
+
- type: category (Monitoring, Network, Security, Database, Core, Utility, Automation, Custom)
|
|
27
|
+
- specs: full updated SKILL.md content (complete, not a diff)
|
|
28
|
+
- scripts: the COMPLETE list of scripts the skill should have after the update. **Only include scripts the skill actually needs.** Scripts NOT in this list will be DELETED from disk.
|
|
29
|
+
- Changed script: { name: "run.sh", content: "#!/bin/bash\\n..." }
|
|
30
|
+
- Unchanged script: { name: "run.sh" } (name only, server preserves original)
|
|
31
|
+
- To remove a script: simply omit it from the array — it will be deleted
|
|
32
|
+
|
|
33
|
+
## Script Execution Modes
|
|
34
|
+
|
|
35
|
+
When a skill includes scripts, you MUST choose the correct execution tool based on WHERE the script needs to run:
|
|
36
|
+
|
|
37
|
+
| Tool | Runs where | When to use |
|
|
38
|
+
|------|-----------|-------------|
|
|
39
|
+
| \`run_skill\` | Local (AgentBox) | Scripts that call kubectl from outside the cluster (most common) |
|
|
40
|
+
| \`node_script\` | On a K8s node (host namespaces) | Scripts needing host tools, filesystem, /proc, /sys, devices |
|
|
41
|
+
| \`pod_script\` | Inside a pod (kubectl exec) | Scripts running diagnostics inside a running pod |
|
|
42
|
+
| \`pod_netns_script\` | Node + pod's network namespace | Network diagnostics needing host tools + pod's network view |
|
|
43
|
+
|
|
44
|
+
In the SKILL.md, document the tool in a "## Tool" section. Examples:
|
|
45
|
+
|
|
46
|
+
### run_skill (local execution, calls kubectl)
|
|
47
|
+
\`\`\`
|
|
48
|
+
## Tool
|
|
49
|
+
run_skill: skill="find-node", script="find-node.sh", args="<keyword>"
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
### node_script (execute on node)
|
|
53
|
+
\`\`\`
|
|
54
|
+
## Tool
|
|
55
|
+
Use the \`node_script\` tool:
|
|
56
|
+
node_script: node="<node>", skill="node-logs", script="get-node-logs.sh", args="--unit containerd"
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
### pod_script (execute inside pod)
|
|
60
|
+
\`\`\`
|
|
61
|
+
## Tool
|
|
62
|
+
Use the \`pod_script\` tool:
|
|
63
|
+
pod_script: pod="<pod>", namespace="<ns>", skill="pod-diagnose", script="check.sh"
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
### pod_netns_script (pod network namespace + host tools)
|
|
67
|
+
\`\`\`
|
|
68
|
+
## Tool
|
|
69
|
+
Use the \`pod_netns_script\` tool:
|
|
70
|
+
pod_netns_script: pod="<pod>", namespace="<ns>", skill="pod-ping-gateway", script="ping-gateway.sh", args="--interface net1"
|
|
71
|
+
\`\`\``,
|
|
72
|
+
parameters: Type.Object({
|
|
73
|
+
id: Type.Optional(Type.String({
|
|
74
|
+
description: "Skill ID or kebab-case name for lookup.",
|
|
75
|
+
})),
|
|
76
|
+
name: Type.String({
|
|
77
|
+
description: "Skill name in kebab-case (e.g. 'check-pod-oom')",
|
|
78
|
+
}),
|
|
79
|
+
description: Type.String({
|
|
80
|
+
description: "One-line description of what the skill does",
|
|
81
|
+
}),
|
|
82
|
+
type: Type.Optional(Type.String({
|
|
83
|
+
description: "Category: Monitoring, Network, Security, Database, Core, Utility, Automation, Custom",
|
|
84
|
+
})),
|
|
85
|
+
specs: Type.String({
|
|
86
|
+
description: "Full updated SKILL.md content (markdown with YAML frontmatter)",
|
|
87
|
+
}),
|
|
88
|
+
scripts: Type.Optional(Type.Array(Type.Object({
|
|
89
|
+
name: Type.String({
|
|
90
|
+
description: "Script filename (e.g. 'run.sh', 'diagnose.py')",
|
|
91
|
+
}),
|
|
92
|
+
content: Type.Optional(Type.String({
|
|
93
|
+
description: "Updated script content. If omitted, the server preserves the existing file.",
|
|
94
|
+
})),
|
|
95
|
+
}), {
|
|
96
|
+
description: "Scripts for the skill. Provide content for changed scripts, name-only for unchanged. Omit to delete.",
|
|
97
|
+
})),
|
|
98
|
+
labels: Type.Optional(Type.Array(Type.String(), { description: "Labels/tags for the skill (e.g. ['gpu', 'network', 'monitoring'])" })),
|
|
99
|
+
}),
|
|
100
|
+
async execute(_toolCallId, rawParams) {
|
|
101
|
+
const params = rawParams;
|
|
102
|
+
if (!params.name?.trim()) {
|
|
103
|
+
return {
|
|
104
|
+
content: [
|
|
105
|
+
{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: JSON.stringify({ error: "Skill name is required." }),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
details: { error: true },
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (!params.specs?.trim()) {
|
|
114
|
+
return {
|
|
115
|
+
content: [
|
|
116
|
+
{
|
|
117
|
+
type: "text",
|
|
118
|
+
text: JSON.stringify({
|
|
119
|
+
error: "Skill specs (SKILL.md content) is required.",
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
details: { error: true },
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const skillName = params.name.trim();
|
|
127
|
+
// Reject if the target skill doesn't exist in the bundle (personal/team)
|
|
128
|
+
if (!skillExistsInBundle(skillName)) {
|
|
129
|
+
return {
|
|
130
|
+
content: [
|
|
131
|
+
{
|
|
132
|
+
type: "text",
|
|
133
|
+
text: JSON.stringify({
|
|
134
|
+
error: `Skill '${skillName}' not found. Cannot update a skill that doesn't exist. Use 'create_skill' to create a new skill, or check the skill name.`,
|
|
135
|
+
}),
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
details: { error: true },
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
const hasScripts = params.scripts && params.scripts.length > 0;
|
|
142
|
+
const labels = params.labels?.map(l => l.trim()).filter(Boolean);
|
|
143
|
+
const result = {
|
|
144
|
+
skillId: params.id?.trim() || "",
|
|
145
|
+
skill: {
|
|
146
|
+
name: params.name.trim(),
|
|
147
|
+
description: params.description?.trim() || "",
|
|
148
|
+
type: params.type?.trim() || "Custom",
|
|
149
|
+
specs: params.specs,
|
|
150
|
+
scripts: params.scripts?.map((s) => ({
|
|
151
|
+
name: s.name,
|
|
152
|
+
content: s.content,
|
|
153
|
+
})) || [],
|
|
154
|
+
labels: labels && labels.length > 0 ? labels : undefined,
|
|
155
|
+
},
|
|
156
|
+
summary: `Updated skill definition '${params.name.trim()}'. Please review and click Update.`
|
|
157
|
+
+ (hasScripts ? ' Script changes will be staged for admin review. The old version remains active until approved. Do NOT attempt to test the new version until approved.' : ''),
|
|
158
|
+
reviewNote: hasScripts
|
|
159
|
+
? "This update contains scripts and will enter STAGED review status. The OLD version of the skill remains active and usable, but the new version will NOT take effect until an admin approves it. Please inform the user that the update is awaiting admin approval."
|
|
160
|
+
: undefined,
|
|
161
|
+
};
|
|
162
|
+
return {
|
|
163
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
164
|
+
details: {},
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=update-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-skill.js","sourceRoot":"","sources":["../../src/tools/update-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAY3D,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEV;QACH,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;YACtB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC5B,WAAW,EAAE,yCAAyC;aACvD,CAAC,CAAC;YACH,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;gBAChB,WAAW,EAAE,iDAAiD;aAC/D,CAAC;YACF,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;gBACvB,WAAW,EAAE,6CAA6C;a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AI;wBACZ,OAAO,EAAE,CAAC,CAAC,OAAO;qBACnB,CAAC,CAAC,IAAI,EAAE;oBACX,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;iBACzD;gBACD,OAAO,EAAE,6BAA6B,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,oCAAoC;sBACxF,CAAC,UAAU,CAAC,CAAC,CAAC,wJAAwJ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChL,UAAU,EAAE,UAAU;oBACpB,CAAC,CAAC,mQAAmQ;oBACrQ,CAAC,CAAC,SAAS;aACd,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;gBACzD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "siclaw",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-powered SRE copilot for Kubernetes diagnostics via natural language",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"siclaw": "./siclaw.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"siclaw.mjs",
|
|
12
|
+
"skills/",
|
|
13
|
+
"settings.example.json"
|
|
14
|
+
],
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/scitix/siclaw.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/scitix/siclaw#readme",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/scitix/siclaw/issues"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"sre",
|
|
29
|
+
"kubernetes",
|
|
30
|
+
"k8s",
|
|
31
|
+
"ai",
|
|
32
|
+
"copilot",
|
|
33
|
+
"diagnostics",
|
|
34
|
+
"claude",
|
|
35
|
+
"agent"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22.12.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@anthropic-ai/claude-agent-sdk": "^0.1.58",
|
|
42
|
+
"@anthropic-ai/sdk": "^0.71.2",
|
|
43
|
+
"@kubernetes/client-node": "^1.4.0",
|
|
44
|
+
"@mariozechner/pi-coding-agent": "^0.55.3",
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
46
|
+
"@sinclair/typebox": "^0.34.0",
|
|
47
|
+
"diff": "^8.0.3",
|
|
48
|
+
"drizzle-orm": "^0.45.1",
|
|
49
|
+
"js-yaml": "^4.1.1",
|
|
50
|
+
"markdown-it": "^14.1.0",
|
|
51
|
+
"mysql2": "^3.16.3",
|
|
52
|
+
"node-forge": "^1.3.3",
|
|
53
|
+
"sql.js": "^1.12.0",
|
|
54
|
+
"sqlite-vec": "^0.1.7-alpha.2",
|
|
55
|
+
"ws": "^8.18.0",
|
|
56
|
+
"zod": "^3.24.0"
|
|
57
|
+
},
|
|
58
|
+
"optionalDependencies": {
|
|
59
|
+
"@aws-sdk/client-s3": "^3.984.0",
|
|
60
|
+
"@larksuiteoapi/node-sdk": "^1.56.1",
|
|
61
|
+
"@slack/bolt": "^4.6.0",
|
|
62
|
+
"@slack/web-api": "^7.14.1",
|
|
63
|
+
"dingtalk-stream-sdk-nodejs": "^2.0.4",
|
|
64
|
+
"discord.js": "^14.16.0",
|
|
65
|
+
"grammy": "^1.41.1"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/diff": "^7.0.2",
|
|
69
|
+
"@types/js-yaml": "^4.0.9",
|
|
70
|
+
"@types/markdown-it": "^14.1.2",
|
|
71
|
+
"@types/node": "^22.19.8",
|
|
72
|
+
"@types/node-forge": "^1.3.14",
|
|
73
|
+
"@types/react-router-dom": "^5.3.3",
|
|
74
|
+
"@types/sql.js": "^1.4.9",
|
|
75
|
+
"@types/ws": "^8.5.0",
|
|
76
|
+
"autoprefixer": "^10.4.24",
|
|
77
|
+
"clsx": "^2.1.1",
|
|
78
|
+
"drizzle-kit": "^0.31.8",
|
|
79
|
+
"framer-motion": "^12.31.0",
|
|
80
|
+
"lucide-react": "^0.563.0",
|
|
81
|
+
"postcss": "^8.5.6",
|
|
82
|
+
"react-router-dom": "^7.13.0",
|
|
83
|
+
"tailwind-merge": "^3.4.0",
|
|
84
|
+
"tailwindcss": "^4.1.18",
|
|
85
|
+
"tsx": "^4.21.0",
|
|
86
|
+
"typescript": "^5.9.0",
|
|
87
|
+
"vitest": "^3.0.0"
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "tsc && npm run copy:web",
|
|
91
|
+
"build:web": "cd src/gateway/web && npm install && npm run build",
|
|
92
|
+
"copy:web": "node -e \"const fs=require('fs');const p=require('path');const s=p.join('src','gateway','web','dist');const d=p.join('dist','gateway','web','dist');if(fs.existsSync(s)){fs.cpSync(s,d,{recursive:true});console.log('Copied web UI to '+d)}\"",
|
|
93
|
+
"prepublishOnly": "npm run build:web && npm run build",
|
|
94
|
+
"dev": "tsx src/cli-main.ts",
|
|
95
|
+
"dev:gateway": "npm run build:web && tsx src/gateway-main.ts",
|
|
96
|
+
"dev:agentbox": "tsx src/agentbox-main.ts",
|
|
97
|
+
"start": "node siclaw-tui.mjs",
|
|
98
|
+
"start:gateway": "node siclaw-gateway.mjs",
|
|
99
|
+
"start:agentbox": "node dist/agentbox-main.js",
|
|
100
|
+
"test": "vitest run",
|
|
101
|
+
"docker:build:gateway": "docker build -f Dockerfile.gateway -t siclaw-gateway:latest .",
|
|
102
|
+
"docker:build:agentbox": "docker build -f Dockerfile.agentbox -t siclaw-agentbox:latest .",
|
|
103
|
+
"docker:push:gateway": "docker push siclaw-gateway:latest",
|
|
104
|
+
"docker:push:agentbox": "docker push siclaw-agentbox:latest"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Copy this file to .siclaw/config/settings.json and fill in your API key. Or run: npx tsx src/cli-main.ts --setup",
|
|
3
|
+
"providers": {
|
|
4
|
+
"default": {
|
|
5
|
+
"_comment": "Option 1: OpenAI",
|
|
6
|
+
"baseUrl": "https://api.openai.com/v1",
|
|
7
|
+
"apiKey": "sk-YOUR-OPENAI-KEY",
|
|
8
|
+
"api": "openai-completions",
|
|
9
|
+
"authHeader": true,
|
|
10
|
+
"models": [
|
|
11
|
+
{
|
|
12
|
+
"id": "gpt-4o",
|
|
13
|
+
"name": "GPT-4o",
|
|
14
|
+
"reasoning": false,
|
|
15
|
+
"input": ["text"],
|
|
16
|
+
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
|
|
17
|
+
"contextWindow": 128000,
|
|
18
|
+
"maxTokens": 16384,
|
|
19
|
+
"compat": {
|
|
20
|
+
"supportsDeveloperRole": true,
|
|
21
|
+
"supportsUsageInStreaming": true,
|
|
22
|
+
"maxTokensField": "max_tokens"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"_anthropic_example": {
|
|
28
|
+
"_comment": "Option 2: Anthropic — rename this key to 'default' to use",
|
|
29
|
+
"baseUrl": "https://api.anthropic.com/v1",
|
|
30
|
+
"apiKey": "sk-ant-YOUR-ANTHROPIC-KEY",
|
|
31
|
+
"api": "anthropic",
|
|
32
|
+
"authHeader": true,
|
|
33
|
+
"models": [
|
|
34
|
+
{
|
|
35
|
+
"id": "claude-sonnet-4-20250514",
|
|
36
|
+
"name": "Claude Sonnet 4",
|
|
37
|
+
"reasoning": true,
|
|
38
|
+
"input": ["text"],
|
|
39
|
+
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
|
|
40
|
+
"contextWindow": 200000,
|
|
41
|
+
"maxTokens": 16000,
|
|
42
|
+
"compat": {
|
|
43
|
+
"supportsDeveloperRole": false,
|
|
44
|
+
"supportsUsageInStreaming": true,
|
|
45
|
+
"maxTokensField": "max_tokens"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"_compatible_example": {
|
|
51
|
+
"_comment": "Option 3: OpenAI-compatible API (Qwen, DeepSeek, Ollama, vLLM, etc.) — rename to 'default' to use",
|
|
52
|
+
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
53
|
+
"apiKey": "sk-YOUR-KEY",
|
|
54
|
+
"api": "openai-completions",
|
|
55
|
+
"authHeader": true,
|
|
56
|
+
"models": [
|
|
57
|
+
{
|
|
58
|
+
"id": "qwen-plus",
|
|
59
|
+
"name": "Qwen Plus",
|
|
60
|
+
"reasoning": false,
|
|
61
|
+
"input": ["text"],
|
|
62
|
+
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
|
|
63
|
+
"contextWindow": 131072,
|
|
64
|
+
"maxTokens": 8192,
|
|
65
|
+
"compat": {
|
|
66
|
+
"supportsDeveloperRole": true,
|
|
67
|
+
"supportsUsageInStreaming": true,
|
|
68
|
+
"maxTokensField": "max_tokens"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
package/siclaw.mjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf-8"));
|
|
9
|
+
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const subcommand = args[0];
|
|
12
|
+
|
|
13
|
+
function printHelp() {
|
|
14
|
+
console.log(`siclaw v${pkg.version}
|
|
15
|
+
|
|
16
|
+
Usage: siclaw [command] [options]
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
(default) Start interactive TUI session
|
|
20
|
+
local Start local gateway with web UI
|
|
21
|
+
|
|
22
|
+
Options:
|
|
23
|
+
--prompt <text> Run in non-interactive print mode
|
|
24
|
+
--continue Continue the most recent session
|
|
25
|
+
--debug Enable debug logging
|
|
26
|
+
--setup Force provider setup wizard
|
|
27
|
+
--help, -h Show this help
|
|
28
|
+
--version, -v Show version
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
33
|
+
printHelp();
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
38
|
+
console.log(pkg.version);
|
|
39
|
+
process.exit(0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (subcommand === "local") {
|
|
43
|
+
// Remove "local" from argv so gateway-main doesn't see it as an unknown arg
|
|
44
|
+
process.argv.splice(2, 1);
|
|
45
|
+
await import("./dist/gateway-main.js");
|
|
46
|
+
} else {
|
|
47
|
+
await import("./dist/cli-main.js");
|
|
48
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cluster-events
|
|
3
|
+
description: >-
|
|
4
|
+
Analyze cluster-wide Kubernetes events to identify issues and patterns.
|
|
5
|
+
Aggregates Warning events, detects high-frequency patterns, and correlates related events.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Cluster Events Analysis
|
|
9
|
+
|
|
10
|
+
Use this flow to analyze cluster-wide events for identifying issues, patterns, and correlations across resources.
|
|
11
|
+
|
|
12
|
+
**Scope:** This skill is for **analysis and diagnosis only**. It helps you understand what is happening across the cluster by examining events. Do NOT attempt to fix issues directly — identify root causes and either use a specific diagnostic skill or report findings to the user.
|
|
13
|
+
|
|
14
|
+
## Diagnostic Flow
|
|
15
|
+
|
|
16
|
+
### 1. Get recent events
|
|
17
|
+
|
|
18
|
+
Get all events sorted by time, focusing on Warning events:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
kubectl get events -A --sort-by='.lastTimestamp' --field-selector type=Warning
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If you need all event types for context:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
kubectl get events -A --sort-by='.lastTimestamp'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For events in a specific namespace:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
kubectl get events -n <ns> --sort-by='.lastTimestamp'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Identify high-frequency events
|
|
37
|
+
|
|
38
|
+
Look for events with high `COUNT` values — these indicate repeated occurrences and often point to persistent issues.
|
|
39
|
+
|
|
40
|
+
For a structured view:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
kubectl get events -A --field-selector type=Warning -o custom-columns='LAST SEEN:.lastTimestamp,COUNT:.count,KIND:.involvedObject.kind,NAME:.involvedObject.name,NAMESPACE:.involvedObject.namespace,REASON:.reason,MESSAGE:.message'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Correlate events by resource
|
|
47
|
+
|
|
48
|
+
When you find Warning events, check if the same resource has related events that tell a more complete story:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
kubectl get events -n <ns> --field-selector involvedObject.name=<resource-name>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 4. Match event patterns and recommend next steps
|
|
55
|
+
|
|
56
|
+
Match the Warning events against the patterns below. For each matched pattern, recommend the appropriate diagnostic skill or action.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
#### `FailedScheduling` — Pod cannot be scheduled
|
|
61
|
+
|
|
62
|
+
The scheduler cannot place a pod on any node.
|
|
63
|
+
|
|
64
|
+
**Next step:** Use the `pod-pending-debug` skill to diagnose the specific pod.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
#### `BackOff` / `Back-off restarting failed container` — Container crash loop
|
|
69
|
+
|
|
70
|
+
A container is repeatedly crashing and restarting.
|
|
71
|
+
|
|
72
|
+
**Next step:** Use the `pod-crash-debug` skill to diagnose the specific pod.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
#### `Failed` / `ErrImagePull` / `ImagePullBackOff` — Image pull failure
|
|
77
|
+
|
|
78
|
+
The container image cannot be pulled.
|
|
79
|
+
|
|
80
|
+
**Next step:** Use the `image-pull-debug` skill to diagnose the specific pod.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
#### `FailedMount` / `FailedAttachVolume` — Volume mount failure
|
|
85
|
+
|
|
86
|
+
A volume (PVC, ConfigMap, Secret, or other) cannot be mounted.
|
|
87
|
+
|
|
88
|
+
Check the specific error message:
|
|
89
|
+
- `not found` — the referenced ConfigMap/Secret/PVC does not exist
|
|
90
|
+
- `already attached` — the volume is stuck on another node (common with RWO PVs)
|
|
91
|
+
- `timed out waiting` — the storage provisioner is slow or failing
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
#### `Unhealthy` — Probe failure
|
|
96
|
+
|
|
97
|
+
A liveness or readiness probe is failing.
|
|
98
|
+
|
|
99
|
+
Check which probe is failing from the event message:
|
|
100
|
+
- **Liveness probe failed** — the container will be restarted, may lead to CrashLoopBackOff
|
|
101
|
+
- **Readiness probe failed** — the container is removed from service endpoints but not restarted
|
|
102
|
+
- **Startup probe failed** — the container is killed during startup
|
|
103
|
+
|
|
104
|
+
Advise the user to check probe configuration (endpoint, port, timing parameters).
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
#### `NodeNotReady` — Node became unhealthy
|
|
109
|
+
|
|
110
|
+
A node transitioned to NotReady state, which may affect all pods on that node.
|
|
111
|
+
|
|
112
|
+
**Next step:** Use the `node-health-check` skill to diagnose the specific node.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
#### `Evicted` — Pod was evicted
|
|
117
|
+
|
|
118
|
+
A pod was evicted from a node, typically due to resource pressure (DiskPressure, MemoryPressure).
|
|
119
|
+
|
|
120
|
+
Check which node evicted the pod and investigate node health:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
kubectl get pod <pod> -n <ns> -o jsonpath='{.status.reason} {.status.message}'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
#### `FailedCreate` — Controller cannot create pods
|
|
129
|
+
|
|
130
|
+
A ReplicaSet, Job, or other controller cannot create pods. Common causes: resource quota exceeded, admission webhook rejection.
|
|
131
|
+
|
|
132
|
+
Check the controller's events:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
kubectl describe rs <replicaset> -n <ns>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
#### `OOMKilling` — Kernel OOM killer invoked
|
|
141
|
+
|
|
142
|
+
The kernel killed a process due to memory exhaustion. This may affect containers on the node.
|
|
143
|
+
|
|
144
|
+
**Next step:** Use the `pod-crash-debug` skill for the affected pod, or `node-health-check` for the node.
|
|
145
|
+
|
|
146
|
+
## Notes
|
|
147
|
+
|
|
148
|
+
- Kubernetes events have a default TTL of 1 hour. For older events, check monitoring/logging systems.
|
|
149
|
+
- Events with `count > 1` show the first and last timestamp — the actual frequency may be higher than it appears.
|
|
150
|
+
- When multiple Warning events appear simultaneously across different resources, look for a common cause (e.g., a node going down affects all pods on that node).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-investigation
|
|
3
|
+
description: >-
|
|
4
|
+
Structured hypothesis-driven investigation for complex infrastructure issues.
|
|
5
|
+
Triggered by /dp command or [Deep Investigation] UI toggle.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Deep Investigation
|
|
9
|
+
|
|
10
|
+
A structured workflow for deep-diving into complex issues using hypothesis-driven
|
|
11
|
+
validation. When the user explicitly activates Deep Investigation mode (toggle, /dp,
|
|
12
|
+
Ctrl+I), follow this recommended structure. Outside of DP mode, use these tools
|
|
13
|
+
adaptively based on the situation.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Complex issues requiring hypothesis-driven investigation with multiple potential root causes
|
|
18
|
+
- Issues involving RDMA/RoCE, network, or hardware that need systematic validation
|
|
19
|
+
- When the user explicitly requests deep investigation (toggle, /dp, Ctrl+I)
|
|
20
|
+
- When initial triage reveals multiple possible root causes
|
|
21
|
+
|
|
22
|
+
## When NOT to Use
|
|
23
|
+
|
|
24
|
+
- Simple questions answerable with 1-2 kubectl commands
|
|
25
|
+
- When the issue is already clear from initial triage
|
|
26
|
+
|
|
27
|
+
## Recommended Workflow (4 phases)
|
|
28
|
+
|
|
29
|
+
The following phases are a recommended structure. You may skip or merge phases
|
|
30
|
+
when the situation calls for it — e.g., skip straight to deep_search if the user
|
|
31
|
+
gives a clear direction, or end after triage if the answer is already apparent.
|
|
32
|
+
|
|
33
|
+
### Phase 1: Quick Triage
|
|
34
|
+
|
|
35
|
+
Gather environment context and confirm the problem exists.
|
|
36
|
+
|
|
37
|
+
1. Call `manage_checklist` to mark `triage` as `in_progress`.
|
|
38
|
+
2. Run targeted kubectl / diagnostic commands to confirm the symptom.
|
|
39
|
+
3. Call `manage_checklist` to mark `triage` as `done` with a brief summary.
|
|
40
|
+
|
|
41
|
+
### Phase 2: Propose Hypotheses
|
|
42
|
+
|
|
43
|
+
Formulate 3-5 ranked hypotheses based on triage findings.
|
|
44
|
+
|
|
45
|
+
1. Call `manage_checklist` to mark `hypotheses` as `in_progress`.
|
|
46
|
+
2. Call `propose_hypotheses` tool with your formatted hypothesis list.
|
|
47
|
+
3. In DP mode, this is a good point to pause for user input — the user may want
|
|
48
|
+
to adjust hypotheses before committing to an expensive deep_search.
|
|
49
|
+
If the user is actively engaged, wait for their confirmation.
|
|
50
|
+
If the user gave a clear directive, you may proceed directly.
|
|
51
|
+
|
|
52
|
+
### Phase 3: Deep Search Validation
|
|
53
|
+
|
|
54
|
+
Validate hypotheses using parallel sub-agents.
|
|
55
|
+
|
|
56
|
+
1. Call `manage_checklist` to mark `deep_search` as `in_progress`.
|
|
57
|
+
2. Call `deep_search` tool with triageContext and the hypotheses.
|
|
58
|
+
3. When deep_search completes, call `manage_checklist` to mark `deep_search` as `done`.
|
|
59
|
+
|
|
60
|
+
### Phase 4: Present Findings
|
|
61
|
+
|
|
62
|
+
Synthesize the deep_search results into a conclusion.
|
|
63
|
+
|
|
64
|
+
1. Call `manage_checklist` to mark `conclusion` as `in_progress`.
|
|
65
|
+
2. Write a clear conclusion with root cause analysis and recommendations.
|
|
66
|
+
3. Call `manage_checklist` to mark `conclusion` as `done`.
|
|
67
|
+
|
|
68
|
+
## Available Tools
|
|
69
|
+
|
|
70
|
+
| Tool | Purpose |
|
|
71
|
+
|------|---------|
|
|
72
|
+
| `manage_checklist` | Update checklist progress (items: triage, hypotheses, deep_search, conclusion) |
|
|
73
|
+
| `propose_hypotheses` | Present hypotheses to the user — a communication tool for aligning investigation direction |
|
|
74
|
+
| `deep_search` | Launch parallel sub-agent validation of hypotheses |
|
|
75
|
+
| `end_investigation` | End early — auto-skips remaining phases |
|
|
76
|
+
|
|
77
|
+
## Guidelines
|
|
78
|
+
|
|
79
|
+
1. **Use propose_hypotheses for communication**: Always use the tool (not plain text) to present hypotheses — it renders a proper UI card. Think of it as a way to align with the user on investigation direction, not as a mandatory gate.
|
|
80
|
+
2. **Be cost-aware with deep_search**: It launches parallel sub-agents consuming 30-60 tool calls. When the investigation direction is uncertain, use propose_hypotheses to get alignment first.
|
|
81
|
+
3. **Avoid redundant validation**: Let deep_search handle hypothesis validation with its parallel sub-agents. Running the same checks manually is inefficient.
|
|
82
|
+
4. **Use DP-specific tools during DP mode**: Prefer `manage_checklist` over `task_plan` during deep investigation to keep the checklist UI consistent.
|
|
83
|
+
|
|
84
|
+
## Early Exit
|
|
85
|
+
|
|
86
|
+
- If triage alone is sufficient to answer the question, present your findings and ask the user before ending.
|
|
87
|
+
- Call `end_investigation` to cleanly exit — it marks all remaining items as skipped.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## Investigation Patterns (learned)
|
|
2
|
+
|
|
3
|
+
- User is actively discussing (asking questions, giving feedback) → use propose_hypotheses to align direction before committing to deep_search
|
|
4
|
+
- User gives an open-ended request ("help me look into X") → do triage first, then communicate your findings and proposed direction before going deep
|
|
5
|
+
- User gives a specific directive ("validate H1 and H3") → execute immediately, no need to re-confirm
|
|
6
|
+
- deep_search fails or returns insufficient results → discuss with the user and adjust hypotheses before retrying; do not repeatedly call deep_search autonomously
|
|
7
|
+
- Simple issue becomes apparent during triage → present findings directly, suggest ending investigation early rather than forcing the full workflow
|
|
8
|
+
- propose_hypotheses is a communication tool, not a gate → use it whenever presenting investigation thinking to the user, regardless of whether DP mode is active
|