micro-models-agent 0.6.4 → 0.7.1
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 +286 -436
- package/dist/main.js +11706 -0
- package/dist/skills/builtin/git.md +36 -0
- package/dist/skills/builtin/typescript.md +35 -0
- package/package.json +41 -47
- package/dist/agent/context.d.ts +0 -73
- package/dist/agent/context.d.ts.map +0 -1
- package/dist/agent/context.js +0 -262
- package/dist/agent/context.js.map +0 -1
- package/dist/agent/error-escalation.d.ts +0 -19
- package/dist/agent/error-escalation.d.ts.map +0 -1
- package/dist/agent/error-escalation.js +0 -168
- package/dist/agent/error-escalation.js.map +0 -1
- package/dist/agent/loop.d.ts +0 -46
- package/dist/agent/loop.d.ts.map +0 -1
- package/dist/agent/loop.js +0 -1043
- package/dist/agent/loop.js.map +0 -1
- package/dist/agent/memory.d.ts +0 -40
- package/dist/agent/memory.d.ts.map +0 -1
- package/dist/agent/memory.js +0 -231
- package/dist/agent/memory.js.map +0 -1
- package/dist/agent/modes/applier.d.ts +0 -43
- package/dist/agent/modes/applier.d.ts.map +0 -1
- package/dist/agent/modes/applier.js +0 -30
- package/dist/agent/modes/applier.js.map +0 -1
- package/dist/agent/modes/registry.d.ts +0 -35
- package/dist/agent/modes/registry.d.ts.map +0 -1
- package/dist/agent/modes/registry.js +0 -169
- package/dist/agent/modes/registry.js.map +0 -1
- package/dist/agent/modes/types.d.ts +0 -61
- package/dist/agent/modes/types.d.ts.map +0 -1
- package/dist/agent/modes/types.js +0 -13
- package/dist/agent/modes/types.js.map +0 -1
- package/dist/agent/react-loop.d.ts +0 -65
- package/dist/agent/react-loop.d.ts.map +0 -1
- package/dist/agent/react-loop.js +0 -101
- package/dist/agent/react-loop.js.map +0 -1
- package/dist/agent/system-prompt.d.ts +0 -26
- package/dist/agent/system-prompt.d.ts.map +0 -1
- package/dist/agent/system-prompt.js +0 -478
- package/dist/agent/system-prompt.js.map +0 -1
- package/dist/agent/tool-executor.d.ts +0 -36
- package/dist/agent/tool-executor.d.ts.map +0 -1
- package/dist/agent/tool-executor.js +0 -346
- package/dist/agent/tool-executor.js.map +0 -1
- package/dist/agent/user-profile.d.ts +0 -26
- package/dist/agent/user-profile.d.ts.map +0 -1
- package/dist/agent/user-profile.js +0 -169
- package/dist/agent/user-profile.js.map +0 -1
- package/dist/agent/write-enforcer.d.ts +0 -7
- package/dist/agent/write-enforcer.d.ts.map +0 -1
- package/dist/agent/write-enforcer.js +0 -8
- package/dist/agent/write-enforcer.js.map +0 -1
- package/dist/cli/config.d.ts +0 -13
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -82
- package/dist/cli/config.js.map +0 -1
- package/dist/cli/model.d.ts +0 -13
- package/dist/cli/model.d.ts.map +0 -1
- package/dist/cli/model.js +0 -170
- package/dist/cli/model.js.map +0 -1
- package/dist/cli/provider.d.ts +0 -12
- package/dist/cli/provider.d.ts.map +0 -1
- package/dist/cli/provider.js +0 -90
- package/dist/cli/provider.js.map +0 -1
- package/dist/cli/update.d.ts +0 -12
- package/dist/cli/update.d.ts.map +0 -1
- package/dist/cli/update.js +0 -69
- package/dist/cli/update.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -310
- package/dist/cli.js.map +0 -1
- package/dist/config/config.d.ts +0 -59
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/config.js +0 -232
- package/dist/config/config.js.map +0 -1
- package/dist/config/types.d.ts +0 -122
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -13
- package/dist/config/types.js.map +0 -1
- package/dist/file-loader.d.ts +0 -20
- package/dist/file-loader.d.ts.map +0 -1
- package/dist/file-loader.js +0 -121
- package/dist/file-loader.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/indexer/cache.d.ts +0 -34
- package/dist/indexer/cache.d.ts.map +0 -1
- package/dist/indexer/cache.js +0 -221
- package/dist/indexer/cache.js.map +0 -1
- package/dist/indexer/code-index.d.ts +0 -27
- package/dist/indexer/code-index.d.ts.map +0 -1
- package/dist/indexer/code-index.js +0 -219
- package/dist/indexer/code-index.js.map +0 -1
- package/dist/indexer/project-map.d.ts +0 -23
- package/dist/indexer/project-map.d.ts.map +0 -1
- package/dist/indexer/project-map.js +0 -264
- package/dist/indexer/project-map.js.map +0 -1
- package/dist/llm/lmstudio-native.d.ts +0 -10
- package/dist/llm/lmstudio-native.d.ts.map +0 -1
- package/dist/llm/lmstudio-native.js +0 -179
- package/dist/llm/lmstudio-native.js.map +0 -1
- package/dist/llm/openai-compat.d.ts +0 -11
- package/dist/llm/openai-compat.d.ts.map +0 -1
- package/dist/llm/openai-compat.js +0 -161
- package/dist/llm/openai-compat.js.map +0 -1
- package/dist/llm/provider.d.ts +0 -46
- package/dist/llm/provider.d.ts.map +0 -1
- package/dist/llm/provider.js +0 -13
- package/dist/llm/provider.js.map +0 -1
- package/dist/llm/token-counter.d.ts +0 -15
- package/dist/llm/token-counter.d.ts.map +0 -1
- package/dist/llm/token-counter.js +0 -51
- package/dist/llm/token-counter.js.map +0 -1
- package/dist/logger.d.ts +0 -24
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -156
- package/dist/logger.js.map +0 -1
- package/dist/plugins/adapters/hooks-adapter.d.ts +0 -12
- package/dist/plugins/adapters/hooks-adapter.d.ts.map +0 -1
- package/dist/plugins/adapters/hooks-adapter.js +0 -23
- package/dist/plugins/adapters/hooks-adapter.js.map +0 -1
- package/dist/plugins/builtin/lint-on-write/index.d.ts +0 -12
- package/dist/plugins/builtin/lint-on-write/index.d.ts.map +0 -1
- package/dist/plugins/builtin/lint-on-write/index.js +0 -98
- package/dist/plugins/builtin/lint-on-write/index.js.map +0 -1
- package/dist/plugins/builtin/lint-on-write/index.ts +0 -97
- package/dist/plugins/builtin/lint-on-write/manifest.json +0 -13
- package/dist/plugins/builtin/notify/index.d.ts +0 -11
- package/dist/plugins/builtin/notify/index.d.ts.map +0 -1
- package/dist/plugins/builtin/notify/index.js +0 -102
- package/dist/plugins/builtin/notify/index.js.map +0 -1
- package/dist/plugins/builtin/notify/index.ts +0 -105
- package/dist/plugins/builtin/notify/manifest.json +0 -16
- package/dist/plugins/loader.d.ts +0 -18
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js +0 -182
- package/dist/plugins/loader.js.map +0 -1
- package/dist/plugins/manager.d.ts +0 -55
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -190
- package/dist/plugins/manager.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -76
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -8
- package/dist/plugins/types.js.map +0 -1
- package/dist/repl/commands.d.ts +0 -63
- package/dist/repl/commands.d.ts.map +0 -1
- package/dist/repl/commands.js +0 -1070
- package/dist/repl/commands.js.map +0 -1
- package/dist/repl/history.d.ts +0 -32
- package/dist/repl/history.d.ts.map +0 -1
- package/dist/repl/history.js +0 -40
- package/dist/repl/history.js.map +0 -1
- package/dist/repl/index.d.ts +0 -14
- package/dist/repl/index.d.ts.map +0 -1
- package/dist/repl/index.js +0 -235
- package/dist/repl/index.js.map +0 -1
- package/dist/session/store.d.ts +0 -46
- package/dist/session/store.d.ts.map +0 -1
- package/dist/session/store.js +0 -154
- package/dist/session/store.js.map +0 -1
- package/dist/setup-wizard.d.ts +0 -3
- package/dist/setup-wizard.d.ts.map +0 -1
- package/dist/setup-wizard.js +0 -410
- package/dist/setup-wizard.js.map +0 -1
- package/dist/skills/builtin/agent-test/SKILL.md +0 -68
- package/dist/skills/builtin/cli-expert/SKILL.md +0 -848
- package/dist/skills/builtin/code-review/SKILL.md +0 -424
- package/dist/skills/builtin/git-expert/SKILL.md +0 -522
- package/dist/skills/builtin/grill-me/SKILL.md +0 -46
- package/dist/skills/builtin/jest-testing-expert/SKILL.md +0 -957
- package/dist/skills/builtin/nodejs-expert/SKILL.md +0 -192
- package/dist/skills/builtin/systematic-debugging/SKILL.md +0 -296
- package/dist/skills/builtin/test-driven-development/SKILL.md +0 -371
- package/dist/skills/builtin/typescript-expert/SKILL.md +0 -429
- package/dist/skills/builtin/web-scraping/SKILL.md +0 -422
- package/dist/skills/loader.d.ts +0 -49
- package/dist/skills/loader.d.ts.map +0 -1
- package/dist/skills/loader.js +0 -401
- package/dist/skills/loader.js.map +0 -1
- package/dist/styling/engine.d.ts +0 -39
- package/dist/styling/engine.d.ts.map +0 -1
- package/dist/styling/engine.js +0 -122
- package/dist/styling/engine.js.map +0 -1
- package/dist/styling/index.d.ts +0 -15
- package/dist/styling/index.d.ts.map +0 -1
- package/dist/styling/index.js +0 -40
- package/dist/styling/index.js.map +0 -1
- package/dist/styling/loader.d.ts +0 -9
- package/dist/styling/loader.d.ts.map +0 -1
- package/dist/styling/loader.js +0 -169
- package/dist/styling/loader.js.map +0 -1
- package/dist/styling/types.d.ts +0 -64
- package/dist/styling/types.d.ts.map +0 -1
- package/dist/styling/types.js +0 -12
- package/dist/styling/types.js.map +0 -1
- package/dist/subagent/chat.d.ts +0 -19
- package/dist/subagent/chat.d.ts.map +0 -1
- package/dist/subagent/chat.js +0 -279
- package/dist/subagent/chat.js.map +0 -1
- package/dist/subagent/context.d.ts +0 -9
- package/dist/subagent/context.d.ts.map +0 -1
- package/dist/subagent/context.js +0 -75
- package/dist/subagent/context.js.map +0 -1
- package/dist/subagent/definition.d.ts +0 -7
- package/dist/subagent/definition.d.ts.map +0 -1
- package/dist/subagent/definition.js +0 -26
- package/dist/subagent/definition.js.map +0 -1
- package/dist/subagent/errors.d.ts +0 -24
- package/dist/subagent/errors.d.ts.map +0 -1
- package/dist/subagent/errors.js +0 -85
- package/dist/subagent/errors.js.map +0 -1
- package/dist/subagent/validation.d.ts +0 -17
- package/dist/subagent/validation.d.ts.map +0 -1
- package/dist/subagent/validation.js +0 -83
- package/dist/subagent/validation.js.map +0 -1
- package/dist/tools/adapters/bash-to-fs.d.ts +0 -20
- package/dist/tools/adapters/bash-to-fs.d.ts.map +0 -1
- package/dist/tools/adapters/bash-to-fs.js +0 -74
- package/dist/tools/adapters/bash-to-fs.js.map +0 -1
- package/dist/tools/adapters/content-sanitizer.d.ts +0 -13
- package/dist/tools/adapters/content-sanitizer.d.ts.map +0 -1
- package/dist/tools/adapters/content-sanitizer.js +0 -73
- package/dist/tools/adapters/content-sanitizer.js.map +0 -1
- package/dist/tools/adapters/grounding-fixer.d.ts +0 -15
- package/dist/tools/adapters/grounding-fixer.d.ts.map +0 -1
- package/dist/tools/adapters/grounding-fixer.js +0 -57
- package/dist/tools/adapters/grounding-fixer.js.map +0 -1
- package/dist/tools/adapters/index.d.ts +0 -6
- package/dist/tools/adapters/index.d.ts.map +0 -1
- package/dist/tools/adapters/index.js +0 -5
- package/dist/tools/adapters/index.js.map +0 -1
- package/dist/tools/adapters/pipeline.d.ts +0 -34
- package/dist/tools/adapters/pipeline.d.ts.map +0 -1
- package/dist/tools/adapters/pipeline.js +0 -58
- package/dist/tools/adapters/pipeline.js.map +0 -1
- package/dist/tools/adapters/types.d.ts +0 -46
- package/dist/tools/adapters/types.d.ts.map +0 -1
- package/dist/tools/adapters/types.js +0 -2
- package/dist/tools/adapters/types.js.map +0 -1
- package/dist/tools/approve.d.ts +0 -27
- package/dist/tools/approve.d.ts.map +0 -1
- package/dist/tools/approve.js +0 -45
- package/dist/tools/approve.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -25
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -292
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/fs/copy-file.d.ts +0 -13
- package/dist/tools/fs/copy-file.d.ts.map +0 -1
- package/dist/tools/fs/copy-file.js +0 -54
- package/dist/tools/fs/copy-file.js.map +0 -1
- package/dist/tools/fs/create-dir.d.ts +0 -13
- package/dist/tools/fs/create-dir.d.ts.map +0 -1
- package/dist/tools/fs/create-dir.js +0 -44
- package/dist/tools/fs/create-dir.js.map +0 -1
- package/dist/tools/fs/delete-file.d.ts +0 -13
- package/dist/tools/fs/delete-file.d.ts.map +0 -1
- package/dist/tools/fs/delete-file.js +0 -52
- package/dist/tools/fs/delete-file.js.map +0 -1
- package/dist/tools/fs/edit-file.d.ts +0 -15
- package/dist/tools/fs/edit-file.d.ts.map +0 -1
- package/dist/tools/fs/edit-file.js +0 -95
- package/dist/tools/fs/edit-file.js.map +0 -1
- package/dist/tools/fs/file-info.d.ts +0 -13
- package/dist/tools/fs/file-info.d.ts.map +0 -1
- package/dist/tools/fs/file-info.js +0 -50
- package/dist/tools/fs/file-info.js.map +0 -1
- package/dist/tools/fs/glob-search.d.ts +0 -13
- package/dist/tools/fs/glob-search.d.ts.map +0 -1
- package/dist/tools/fs/glob-search.js +0 -112
- package/dist/tools/fs/glob-search.js.map +0 -1
- package/dist/tools/fs/grep-search.d.ts +0 -14
- package/dist/tools/fs/grep-search.d.ts.map +0 -1
- package/dist/tools/fs/grep-search.js +0 -135
- package/dist/tools/fs/grep-search.js.map +0 -1
- package/dist/tools/fs/list-dir.d.ts +0 -13
- package/dist/tools/fs/list-dir.d.ts.map +0 -1
- package/dist/tools/fs/list-dir.js +0 -74
- package/dist/tools/fs/list-dir.js.map +0 -1
- package/dist/tools/fs/move-file.d.ts +0 -13
- package/dist/tools/fs/move-file.d.ts.map +0 -1
- package/dist/tools/fs/move-file.js +0 -54
- package/dist/tools/fs/move-file.js.map +0 -1
- package/dist/tools/fs/path-utils.d.ts +0 -51
- package/dist/tools/fs/path-utils.d.ts.map +0 -1
- package/dist/tools/fs/path-utils.js +0 -103
- package/dist/tools/fs/path-utils.js.map +0 -1
- package/dist/tools/fs/read-file.d.ts +0 -13
- package/dist/tools/fs/read-file.d.ts.map +0 -1
- package/dist/tools/fs/read-file.js +0 -64
- package/dist/tools/fs/read-file.js.map +0 -1
- package/dist/tools/fs/tree.d.ts +0 -13
- package/dist/tools/fs/tree.d.ts.map +0 -1
- package/dist/tools/fs/tree.js +0 -89
- package/dist/tools/fs/tree.js.map +0 -1
- package/dist/tools/fs/types.d.ts +0 -14
- package/dist/tools/fs/types.d.ts.map +0 -1
- package/dist/tools/fs/types.js +0 -11
- package/dist/tools/fs/types.js.map +0 -1
- package/dist/tools/fs/write-file.d.ts +0 -14
- package/dist/tools/fs/write-file.d.ts.map +0 -1
- package/dist/tools/fs/write-file.js +0 -83
- package/dist/tools/fs/write-file.js.map +0 -1
- package/dist/tools/hooks.d.ts +0 -44
- package/dist/tools/hooks.d.ts.map +0 -1
- package/dist/tools/hooks.js +0 -217
- package/dist/tools/hooks.js.map +0 -1
- package/dist/tools/id-gen.d.ts +0 -4
- package/dist/tools/id-gen.d.ts.map +0 -1
- package/dist/tools/id-gen.js +0 -12
- package/dist/tools/id-gen.js.map +0 -1
- package/dist/tools/mcp.d.ts +0 -36
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mcp.js +0 -93
- package/dist/tools/mcp.js.map +0 -1
- package/dist/tools/native/approve.d.ts +0 -11
- package/dist/tools/native/approve.d.ts.map +0 -1
- package/dist/tools/native/approve.js +0 -39
- package/dist/tools/native/approve.js.map +0 -1
- package/dist/tools/native/plan.d.ts +0 -10
- package/dist/tools/native/plan.d.ts.map +0 -1
- package/dist/tools/native/plan.js +0 -115
- package/dist/tools/native/plan.js.map +0 -1
- package/dist/tools/native/project-map.d.ts +0 -15
- package/dist/tools/native/project-map.d.ts.map +0 -1
- package/dist/tools/native/project-map.js +0 -203
- package/dist/tools/native/project-map.js.map +0 -1
- package/dist/tools/native/question.d.ts +0 -11
- package/dist/tools/native/question.d.ts.map +0 -1
- package/dist/tools/native/question.js +0 -41
- package/dist/tools/native/question.js.map +0 -1
- package/dist/tools/native/scaffold.d.ts +0 -5
- package/dist/tools/native/scaffold.d.ts.map +0 -1
- package/dist/tools/native/scaffold.js +0 -246
- package/dist/tools/native/scaffold.js.map +0 -1
- package/dist/tools/native/theme.d.ts +0 -10
- package/dist/tools/native/theme.d.ts.map +0 -1
- package/dist/tools/native/theme.js +0 -101
- package/dist/tools/native/theme.js.map +0 -1
- package/dist/tools/native/todo.d.ts +0 -10
- package/dist/tools/native/todo.d.ts.map +0 -1
- package/dist/tools/native/todo.js +0 -58
- package/dist/tools/native/todo.js.map +0 -1
- package/dist/tools/native/user-profile.d.ts +0 -10
- package/dist/tools/native/user-profile.d.ts.map +0 -1
- package/dist/tools/native/user-profile.js +0 -58
- package/dist/tools/native/user-profile.js.map +0 -1
- package/dist/tools/parse-tool-call.d.ts +0 -11
- package/dist/tools/parse-tool-call.d.ts.map +0 -1
- package/dist/tools/parse-tool-call.js +0 -87
- package/dist/tools/parse-tool-call.js.map +0 -1
- package/dist/tools/plan.d.ts +0 -40
- package/dist/tools/plan.d.ts.map +0 -1
- package/dist/tools/plan.js +0 -143
- package/dist/tools/plan.js.map +0 -1
- package/dist/tools/question.d.ts +0 -33
- package/dist/tools/question.d.ts.map +0 -1
- package/dist/tools/question.js +0 -62
- package/dist/tools/question.js.map +0 -1
- package/dist/tools/registry.d.ts +0 -37
- package/dist/tools/registry.d.ts.map +0 -1
- package/dist/tools/registry.js +0 -97
- package/dist/tools/registry.js.map +0 -1
- package/dist/tools/sanitizer.d.ts +0 -30
- package/dist/tools/sanitizer.d.ts.map +0 -1
- package/dist/tools/sanitizer.js +0 -77
- package/dist/tools/sanitizer.js.map +0 -1
- package/dist/tools/subagent.d.ts +0 -39
- package/dist/tools/subagent.d.ts.map +0 -1
- package/dist/tools/subagent.js +0 -225
- package/dist/tools/subagent.js.map +0 -1
- package/dist/tools/syntax-check.d.ts +0 -32
- package/dist/tools/syntax-check.d.ts.map +0 -1
- package/dist/tools/syntax-check.js +0 -272
- package/dist/tools/syntax-check.js.map +0 -1
- package/dist/tools/todo.d.ts +0 -28
- package/dist/tools/todo.d.ts.map +0 -1
- package/dist/tools/todo.js +0 -125
- package/dist/tools/todo.js.map +0 -1
- package/dist/tools/types.d.ts +0 -51
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/types.js +0 -2
- package/dist/tools/types.js.map +0 -1
- package/dist/tools/web-browse.d.ts +0 -5
- package/dist/tools/web-browse.d.ts.map +0 -1
- package/dist/tools/web-browse.js +0 -757
- package/dist/tools/web-browse.js.map +0 -1
- package/dist/tools/web-fetch.d.ts +0 -19
- package/dist/tools/web-fetch.d.ts.map +0 -1
- package/dist/tools/web-fetch.js +0 -90
- package/dist/tools/web-fetch.js.map +0 -1
- package/dist/tools/web-search.d.ts +0 -19
- package/dist/tools/web-search.d.ts.map +0 -1
- package/dist/tools/web-search.js +0 -97
- package/dist/tools/web-search.js.map +0 -1
- package/dist/ui/components/status-bar.d.ts +0 -11
- package/dist/ui/components/status-bar.d.ts.map +0 -1
- package/dist/ui/components/status-bar.js +0 -20
- package/dist/ui/components/status-bar.js.map +0 -1
- package/dist/ui/index.d.ts +0 -8
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -9
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/ink/components/App.d.ts +0 -98
- package/dist/ui/ink/components/App.d.ts.map +0 -1
- package/dist/ui/ink/components/App.js +0 -212
- package/dist/ui/ink/components/App.js.map +0 -1
- package/dist/ui/ink/components/Conversation.d.ts +0 -20
- package/dist/ui/ink/components/Conversation.d.ts.map +0 -1
- package/dist/ui/ink/components/Conversation.js +0 -15
- package/dist/ui/ink/components/Conversation.js.map +0 -1
- package/dist/ui/ink/components/MessageBlock.d.ts +0 -27
- package/dist/ui/ink/components/MessageBlock.d.ts.map +0 -1
- package/dist/ui/ink/components/MessageBlock.js +0 -41
- package/dist/ui/ink/components/MessageBlock.js.map +0 -1
- package/dist/ui/ink/components/PromptInput.d.ts +0 -25
- package/dist/ui/ink/components/PromptInput.d.ts.map +0 -1
- package/dist/ui/ink/components/PromptInput.js +0 -167
- package/dist/ui/ink/components/PromptInput.js.map +0 -1
- package/dist/ui/ink/components/SelectInput.d.ts +0 -9
- package/dist/ui/ink/components/SelectInput.d.ts.map +0 -1
- package/dist/ui/ink/components/SelectInput.js +0 -30
- package/dist/ui/ink/components/SelectInput.js.map +0 -1
- package/dist/ui/ink/components/StatusBar.d.ts +0 -14
- package/dist/ui/ink/components/StatusBar.d.ts.map +0 -1
- package/dist/ui/ink/components/StatusBar.js +0 -20
- package/dist/ui/ink/components/StatusBar.js.map +0 -1
- package/dist/ui/ink/components/StreamBlock.d.ts +0 -8
- package/dist/ui/ink/components/StreamBlock.d.ts.map +0 -1
- package/dist/ui/ink/components/StreamBlock.js +0 -15
- package/dist/ui/ink/components/StreamBlock.js.map +0 -1
- package/dist/ui/ink/components/Tags.d.ts +0 -26
- package/dist/ui/ink/components/Tags.d.ts.map +0 -1
- package/dist/ui/ink/components/Tags.js +0 -37
- package/dist/ui/ink/components/Tags.js.map +0 -1
- package/dist/ui/ink/components/ToolCallBlock.d.ts +0 -31
- package/dist/ui/ink/components/ToolCallBlock.d.ts.map +0 -1
- package/dist/ui/ink/components/ToolCallBlock.js +0 -17
- package/dist/ui/ink/components/ToolCallBlock.js.map +0 -1
- package/dist/ui/ink/renderer.d.ts +0 -69
- package/dist/ui/ink/renderer.d.ts.map +0 -1
- package/dist/ui/ink/renderer.js +0 -142
- package/dist/ui/ink/renderer.js.map +0 -1
- package/dist/ui/ink/theme.d.ts +0 -28
- package/dist/ui/ink/theme.d.ts.map +0 -1
- package/dist/ui/ink/theme.js +0 -45
- package/dist/ui/ink/theme.js.map +0 -1
- package/dist/ui/md-formatter.d.ts +0 -16
- package/dist/ui/md-formatter.d.ts.map +0 -1
- package/dist/ui/md-formatter.js +0 -448
- package/dist/ui/md-formatter.js.map +0 -1
- package/dist/ui/readline-renderer.d.ts +0 -45
- package/dist/ui/readline-renderer.d.ts.map +0 -1
- package/dist/ui/readline-renderer.js +0 -181
- package/dist/ui/readline-renderer.js.map +0 -1
- package/dist/ui/renderer.d.ts +0 -66
- package/dist/ui/renderer.d.ts.map +0 -1
- package/dist/ui/renderer.js +0 -16
- package/dist/ui/renderer.js.map +0 -1
- package/dist/ui/subagent-renderer.d.ts +0 -58
- package/dist/ui/subagent-renderer.d.ts.map +0 -1
- package/dist/ui/subagent-renderer.js +0 -100
- package/dist/ui/subagent-renderer.js.map +0 -1
- package/dist/updater.d.ts +0 -15
- package/dist/updater.d.ts.map +0 -1
- package/dist/updater.js +0 -166
- package/dist/updater.js.map +0 -1
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: web-scraping
|
|
3
|
-
description: Web scraping and data extraction using headless browser (Playwright) and HTTP fetch. Use for parsing product catalogs, extracting structured data from websites, scraping articles, tables, and any web content. Handles dynamic SPA pages, authentication (cookies/tokens), anti-bot measures, lazy loading. Trigger on mentions of "parse", "scrape", "extract data from website".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Web Scraping & Data Extraction
|
|
7
|
-
|
|
8
|
-
Efficient web scraping via headless browser (Playwright) and HTTP fetch. Minimal turns — maximum data.
|
|
9
|
-
|
|
10
|
-
## Core Rule: 4-Step Pattern
|
|
11
|
-
|
|
12
|
-
Every scraping task reduces to 4 steps:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Step 1: navigate → open the page
|
|
16
|
-
Step 2: discover → find REAL CSS selectors on the page
|
|
17
|
-
Step 3: evaluate → extract data via JS
|
|
18
|
-
Step 4: write_file → save the result
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Step 2 (discover) is MANDATORY.** Never guess selectors — look at the actual HTML.
|
|
22
|
-
|
|
23
|
-
**Never use** extract without a prior evaluate. Extract returns raw HTML/text — you spend tokens on processing what JavaScript does in 1 line.
|
|
24
|
-
|
|
25
|
-
## Decision: web_fetch vs web_browse
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
web_fetch(url) — simple GET, no JS rendering, no cookies/auth
|
|
29
|
-
web_browse(navigate) — need JS, cookies, auth, dynamic content
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Rule**: if the site is SPA (React/Vue/Angular) or requires cookies/auth → **always web_browse**. web_fetch will return empty HTML.
|
|
33
|
-
|
|
34
|
-
## Playwright: Key Facts
|
|
35
|
-
|
|
36
|
-
1. **Stateful session**: `navigate` opens the page, all subsequent actions work with it. Call `close` when done.
|
|
37
|
-
2. **Headless Chromium**: page renders like in a regular browser. JS executes.
|
|
38
|
-
3. **Auto-wait**: `navigate` waits for `domcontentloaded` + 1s. For heavy pages — add `wait` after navigate.
|
|
39
|
-
4. **5-minute idle timeout**: if session is inactive > 5 minutes, browser closes.
|
|
40
|
-
5. **Viewport 1280x720**: some elements may be hidden behind `@media` queries.
|
|
41
|
-
|
|
42
|
-
## Step 2: Discover — Find Real Selectors
|
|
43
|
-
|
|
44
|
-
**Mandatory step.** Don't guess classes — look at the HTML.
|
|
45
|
-
|
|
46
|
-
### Approach A: Quick discover (recommended)
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
// 1. Find all product links
|
|
50
|
-
web_browse evaluate: JSON.stringify(
|
|
51
|
-
Array.from(document.querySelectorAll('a[href]'))
|
|
52
|
-
.filter(a => a.href.includes('/product') || a.href.includes('/catalog/'))
|
|
53
|
-
.slice(0, 5)
|
|
54
|
-
.map(a => ({href: a.href, text: a.textContent.trim().substring(0, 80), parent: a.parentElement?.className}))
|
|
55
|
-
)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
The result shows: what classes the parents have, what URL pattern products use.
|
|
59
|
-
|
|
60
|
-
### Approach B: discover action (if available)
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
web_browse discover
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Returns all unique CSS classes on the page + links.
|
|
67
|
-
|
|
68
|
-
### Approach C: HTML analysis (last resort)
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
// Look at structure around product links
|
|
72
|
-
web_browse evaluate: document.querySelector('a[href*="/product"]')?.parentElement?.parentElement?.outerHTML?.substring(0, 2000)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### After discover: verify the selector
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
78
|
-
web_browse evaluate: document.querySelectorAll('your_real_selector').length
|
|
79
|
-
// Must be > 0, otherwise — try another selector
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Workflow: Product Catalog
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
1. web_browse navigate(url)
|
|
86
|
-
2. web_browse discover (or evaluate to find links/classes)
|
|
87
|
-
3. web_browse evaluate: verify selector (.length > 0)
|
|
88
|
-
4. web_browse evaluate: extract data via JSON
|
|
89
|
-
5. write_file result
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Product extraction template
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
// Step 2: discover — find real links/classes
|
|
96
|
-
JSON.stringify(
|
|
97
|
-
Array.from(document.querySelectorAll('a[href]'))
|
|
98
|
-
.filter(a => a.href.includes('/product'))
|
|
99
|
-
.slice(0, 3)
|
|
100
|
-
.map(a => ({href: a.href, cls: a.closest('div[class]')?.className}))
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
// Step 3: verify selector
|
|
104
|
-
document.querySelectorAll('.the_class_you_found').length
|
|
105
|
-
|
|
106
|
-
// Step 4: extract data (one call — all products)
|
|
107
|
-
JSON.stringify(
|
|
108
|
-
Array.from(document.querySelectorAll('.the_class_you_found')).slice(0, 10).map(el => ({
|
|
109
|
-
name: el.querySelector('a')?.textContent?.trim() || el.querySelector('h2, h3, .title')?.textContent?.trim(),
|
|
110
|
-
price: el.querySelector('.price, .cost, [class*="price"]')?.textContent?.trim(),
|
|
111
|
-
link: el.querySelector('a')?.href,
|
|
112
|
-
image: el.querySelector('img')?.src,
|
|
113
|
-
}))
|
|
114
|
-
)
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Key point**: one `evaluate` with `querySelectorAll` + `map` + `JSON.stringify` saves 5-10 turns compared to `extract`.
|
|
118
|
-
|
|
119
|
-
## Workflow: Article / Blog Post
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
1. web_browse navigate(url)
|
|
123
|
-
2. web_browse evaluate: document.querySelector('article, .post-content, .entry-content')?.innerText
|
|
124
|
-
3. write_file result
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Workflow: Table Data
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
1. web_browse navigate(url)
|
|
131
|
-
2. web_browse evaluate:
|
|
132
|
-
JSON.stringify(
|
|
133
|
-
Array.from(document.querySelectorAll('table tr')).map(row =>
|
|
134
|
-
Array.from(row.querySelectorAll('td, th')).map(cell => cell.textContent.trim())
|
|
135
|
-
)
|
|
136
|
-
)
|
|
137
|
-
3. write_file result
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Authentication & Cookies
|
|
141
|
-
|
|
142
|
-
### Set cookies before navigate
|
|
143
|
-
|
|
144
|
-
```javascript
|
|
145
|
-
// Step 1: Set cookies via evaluate (before navigate to target page)
|
|
146
|
-
web_browse evaluate: document.cookie = "session=abc123; path=/"
|
|
147
|
-
|
|
148
|
-
// Or set multiple cookies
|
|
149
|
-
web_browse evaluate: `
|
|
150
|
-
document.cookie = "token=xyz; path=/; max-age=3600";
|
|
151
|
-
document.cookie = "user_id=42; path=/";
|
|
152
|
-
`
|
|
153
|
-
|
|
154
|
-
// Step 2: Navigate (cookies are now set)
|
|
155
|
-
web_browse navigate: https://example.com/dashboard
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Login flow
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
1. web_browse navigate(url_of_login_page)
|
|
162
|
-
2. web_browse type(selector: 'input[name="email"]', value: 'user@example.com')
|
|
163
|
-
3. web_browse type(selector: 'input[name="password"]', value: 'pass')
|
|
164
|
-
4. web_browse click(selector: 'button[type="submit"]')
|
|
165
|
-
5. web_browse wait(condition: "window.location.href.includes('dashboard')")
|
|
166
|
-
6. web_browse navigate(target_url_to_scrape)
|
|
167
|
-
7. web_browse evaluate: extract data
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### Token-based auth (Authorization header)
|
|
171
|
-
|
|
172
|
-
```javascript
|
|
173
|
-
// Set token via evaluate before navigation
|
|
174
|
-
web_browse evaluate: `
|
|
175
|
-
fetch('/api/data', {
|
|
176
|
-
headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
|
|
177
|
-
}).then(r => r.json()).then(d => JSON.stringify(d))
|
|
178
|
-
`
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Anti-Bot Handling
|
|
182
|
-
|
|
183
|
-
### User-Agent (already set by default)
|
|
184
|
-
|
|
185
|
-
Playwright session uses Chrome user-agent by default. If site blocks headless:
|
|
186
|
-
|
|
187
|
-
```javascript
|
|
188
|
-
// Check if page loaded correctly
|
|
189
|
-
web_browse evaluate: document.title + ' | ' + document.querySelectorAll('body > *').length
|
|
190
|
-
|
|
191
|
-
// If blocked (captcha, empty page), try:
|
|
192
|
-
web_browse evaluate: document.querySelector('.captcha, #challenge, [data-testid="challenge"]') ? 'BLOCKED' : 'OK'
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Rate limiting
|
|
196
|
-
|
|
197
|
-
Don't make more than 5 navigate calls in a row without a pause. If you get 429/503:
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
web_browse wait(timeout: 5000) // wait 5 seconds
|
|
201
|
-
web_browse navigate(url) // retry
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Cloudflare / JS challenges
|
|
205
|
-
|
|
206
|
-
```javascript
|
|
207
|
-
// Wait for challenge to resolve
|
|
208
|
-
web_browse wait(condition: "document.querySelector('#challenge-running') === null", timeout: 15000)
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
## Dynamic Content (SPA / Lazy Loading)
|
|
212
|
-
|
|
213
|
-
### Wait for content to appear
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
1. web_browse navigate(url)
|
|
217
|
-
2. web_browse wait(selector: '.product-card', timeout: 10000) // wait for products to load
|
|
218
|
-
3. web_browse evaluate: extract data
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Infinite scroll
|
|
222
|
-
|
|
223
|
-
```javascript
|
|
224
|
-
// Scroll to bottom to trigger lazy loading
|
|
225
|
-
web_browse scroll(direction: 'down')
|
|
226
|
-
web_browse scroll(direction: 'down')
|
|
227
|
-
web_browse wait(condition: "document.querySelectorAll('.item').length >= 20", timeout: 10000)
|
|
228
|
-
web_browse evaluate: extract all data
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### AJAX/API data (get data from network)
|
|
232
|
-
|
|
233
|
-
```javascript
|
|
234
|
-
// Intercept XHR responses
|
|
235
|
-
web_browse evaluate: `
|
|
236
|
-
new Promise((resolve) => {
|
|
237
|
-
const origFetch = window.fetch;
|
|
238
|
-
window.fetch = async (...args) => {
|
|
239
|
-
const res = await origFetch(...args);
|
|
240
|
-
if (args[0].includes('/api/products')) {
|
|
241
|
-
const data = await res.clone().json();
|
|
242
|
-
resolve(JSON.stringify(data));
|
|
243
|
-
}
|
|
244
|
-
return res;
|
|
245
|
-
};
|
|
246
|
-
// Trigger reload to capture API call
|
|
247
|
-
location.reload();
|
|
248
|
-
})
|
|
249
|
-
`
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Fallback Strategy (when selectors don't work)
|
|
253
|
-
|
|
254
|
-
### If evaluate with selector returned 0 elements:
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
1. web_browse get_links → find all links, check URL patterns
|
|
258
|
-
2. If product links found → extract data from href + text of links
|
|
259
|
-
3. If nothing found → web_browse extract(format: 'html', maxChars: 3000) → analyze HTML
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### If get_links is also empty (AJAX page):
|
|
263
|
-
|
|
264
|
-
```
|
|
265
|
-
1. web_browse wait(selector: 'a[href]', timeout: 15000) // wait for load
|
|
266
|
-
2. web_browse get_links → retry search
|
|
267
|
-
3. If still empty → web_browse scroll(down) 2-3 times → retry get_links
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### If nothing works:
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
1. web_browse screenshot → see what actually renders
|
|
274
|
-
2. web_browse evaluate: document.body.innerHTML.substring(0, 3000) → raw HTML
|
|
275
|
-
3. Analyze HTML and look for data-attributes, JSON in <script>, or API calls
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
## CMS-Agnostic Approach
|
|
279
|
-
|
|
280
|
-
Different CMS use different classes. Don't rely on typical names:
|
|
281
|
-
|
|
282
|
-
| CMS | Typical product classes |
|
|
283
|
-
|-----|------------------------|
|
|
284
|
-
| WooCommerce | `.product`, `.woocommerce-loop-product__title` |
|
|
285
|
-
| 1C-Bitrix | `.catalog-section-item`, `.product-item` |
|
|
286
|
-
| OpenCart | `.product-layout`, `.product-thumb` |
|
|
287
|
-
| Shopify | `.product-card`, `.grid-product` |
|
|
288
|
-
| WordPress/WPShop | `.product-item`, `.woocommerce` |
|
|
289
|
-
|
|
290
|
-
**Rule**: always start with `discover` (find links/classes), not with guessing.
|
|
291
|
-
|
|
292
|
-
## Evaluate: Safe JavaScript
|
|
293
|
-
|
|
294
|
-
### NodeList is NOT an Array
|
|
295
|
-
|
|
296
|
-
`querySelectorAll` returns `NodeList` — `.slice()`, `.map()` do **NOT work** on it.
|
|
297
|
-
|
|
298
|
-
```javascript
|
|
299
|
-
// BAD:
|
|
300
|
-
document.querySelectorAll('.item').slice(0, 10)
|
|
301
|
-
|
|
302
|
-
// CORRECT:
|
|
303
|
-
Array.from(document.querySelectorAll('.item')).slice(0, 10)
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### One call — all data
|
|
307
|
-
|
|
308
|
-
```javascript
|
|
309
|
-
// BAD — 10 evaluate calls:
|
|
310
|
-
web_browse evaluate: document.querySelectorAll('.item')[0]?.textContent
|
|
311
|
-
web_browse evaluate: document.querySelectorAll('.item')[1]?.textContent
|
|
312
|
-
// ...
|
|
313
|
-
|
|
314
|
-
// CORRECT — 1 evaluate:
|
|
315
|
-
JSON.stringify(Array.from(document.querySelectorAll('.item')).slice(0, 10).map(el => el.textContent.trim()))
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### Safe optional chaining
|
|
319
|
-
|
|
320
|
-
```javascript
|
|
321
|
-
// If element might not exist:
|
|
322
|
-
el.querySelector('.price')?.textContent?.trim() ?? 'N/A'
|
|
323
|
-
// NOT:
|
|
324
|
-
el.querySelector('.price').textContent.trim() // TypeError if null
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
## Common Mistakes (What NOT to do)
|
|
328
|
-
|
|
329
|
-
### DON'T: extract without knowing the structure
|
|
330
|
-
|
|
331
|
-
```
|
|
332
|
-
# BAD — spending tokens on raw HTML
|
|
333
|
-
web_browse extract(format: 'html')
|
|
334
|
-
web_browse extract(format: 'text')
|
|
335
|
-
web_browse scroll(direction: 'down') # why?
|
|
336
|
-
web_browse scroll(direction: 'down') # and again?
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
### DON'T: write Node.js scripts for simple tasks
|
|
340
|
-
|
|
341
|
-
```
|
|
342
|
-
# BAD — npm init, npm install, write_file script, syntax error, ...
|
|
343
|
-
bash: npm init -y
|
|
344
|
-
bash: npm install axios
|
|
345
|
-
write_file: parse.js // SyntaxError: missing /
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
### DON'T: guess selectors without discovering
|
|
349
|
-
|
|
350
|
-
```
|
|
351
|
-
# BAD — trying 5 different selectors blindly
|
|
352
|
-
web_browse evaluate: document.querySelectorAll('.product-card').length // 0
|
|
353
|
-
web_browse evaluate: document.querySelectorAll('.item').length // 0
|
|
354
|
-
web_browse evaluate: document.querySelectorAll('.goods').length // 0
|
|
355
|
-
web_browse evaluate: document.querySelectorAll('.product').length // 0
|
|
356
|
-
web_browse evaluate: document.querySelectorAll('.goods-item').length // 0
|
|
357
|
-
# 5 turns wasted!
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### RIGHT: discover once, then extract
|
|
361
|
-
|
|
362
|
-
```
|
|
363
|
-
# CORRECT — discover → verify → extract
|
|
364
|
-
web_browse navigate(url)
|
|
365
|
-
web_browse evaluate: JSON.stringify(Array.from(document.querySelectorAll('a[href]')).filter(a => a.href.includes('/product')).slice(0,3).map(a => ({href: a.href, cls: a.closest('div[class]')?.className})))
|
|
366
|
-
# → see real classes
|
|
367
|
-
web_browse evaluate: document.querySelectorAll('.real_class').length // 27
|
|
368
|
-
web_browse evaluate: JSON.stringify(Array.from(document.querySelectorAll('.real_class')).slice(0,10).map(...))
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
## File Writing Rules
|
|
372
|
-
|
|
373
|
-
- **1 file per turn**: if you need to create multiple files — use a subagent
|
|
374
|
-
- **write_file is blocked** if > 3 files written without subagent
|
|
375
|
-
- If write_file is blocked due to syntax error — **rewrite the file entirely**, don't edit
|
|
376
|
-
- For large data: first `evaluate` returns JSON, then `write_file` formats the result
|
|
377
|
-
|
|
378
|
-
## Debugging: If data is not extracted
|
|
379
|
-
|
|
380
|
-
1. **Check page loaded**: `web_browse evaluate: document.title`
|
|
381
|
-
2. **Check structure**: `web_browse evaluate: document.querySelector('body').children.length`
|
|
382
|
-
3. **Check specific selector**: `web_browse evaluate: document.querySelectorAll('.your-selector').length`
|
|
383
|
-
4. **Look at raw HTML**: `web_browse extract(format: 'html', maxChars: 2000)`
|
|
384
|
-
5. **Check for JS errors**: `web_browse evaluate: window.onerror || 'no errors'`
|
|
385
|
-
|
|
386
|
-
## Quick Reference: Actions
|
|
387
|
-
|
|
388
|
-
| Action | When to use | Parameters |
|
|
389
|
-
|--------|-------------|------------|
|
|
390
|
-
| `navigate` | Open a page | `url` |
|
|
391
|
-
| `evaluate` | Execute JS, get data | `value` (JS code) |
|
|
392
|
-
| `extract` | Get text/html (rarely!) | `selector`, `format`, `maxChars` |
|
|
393
|
-
| `click` | Click an element | `selector` |
|
|
394
|
-
| `type` | Type text into a field | `selector`, `value` |
|
|
395
|
-
| `scroll` | Scroll the page | `direction` |
|
|
396
|
-
| `wait` | Wait for element to appear | `selector` or `condition`, `timeout` |
|
|
397
|
-
| `get_links` | Get all links | — |
|
|
398
|
-
| `discover` | Find all CSS classes + links | — |
|
|
399
|
-
| `screenshot` | Screenshot the page | `selector` |
|
|
400
|
-
| `close` | Close the browser | — |
|
|
401
|
-
|
|
402
|
-
## Example: Real Task
|
|
403
|
-
|
|
404
|
-
**Task**: Scrape 10 bikes from a catalog, save to .md
|
|
405
|
-
|
|
406
|
-
```
|
|
407
|
-
1. web_browse navigate: https://shop.com/bikes
|
|
408
|
-
2. web_browse discover
|
|
409
|
-
→ see real class names (e.g., ".catalog-item", ".product-layout")
|
|
410
|
-
3. web_browse evaluate: document.querySelectorAll('.catalog-item').length
|
|
411
|
-
→ "27" (selector is correct)
|
|
412
|
-
4. web_browse evaluate: JSON.stringify(Array.from(document.querySelectorAll('.catalog-item')).slice(0, 10).map(el => ({
|
|
413
|
-
name: el.querySelector('.item-title a')?.textContent?.trim(),
|
|
414
|
-
price: el.querySelector('.price')?.textContent?.trim(),
|
|
415
|
-
link: el.querySelector('a')?.href
|
|
416
|
-
})))
|
|
417
|
-
→ JSON with 10 products
|
|
418
|
-
5. write_file: bikes.md (formatted result)
|
|
419
|
-
6. web_browse close
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
**Total: 6 turns** instead of 30+ as in the log above.
|
package/dist/skills/loader.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export interface Skill {
|
|
2
|
-
name: string;
|
|
3
|
-
path: string;
|
|
4
|
-
content: string;
|
|
5
|
-
tokens: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function loadAgentsMd(cwd: string): string | null;
|
|
8
|
-
export declare function loadSkill(name: string, cwd: string): Skill | null;
|
|
9
|
-
export declare function loadSkillsFromRefs(text: string, cwd: string): Skill[];
|
|
10
|
-
export interface SkillsBySource {
|
|
11
|
-
builtin: string[];
|
|
12
|
-
project: string[];
|
|
13
|
-
global: string[];
|
|
14
|
-
}
|
|
15
|
-
export declare function listSkillsBySource(cwd: string): SkillsBySource;
|
|
16
|
-
export declare function listInstalledSkills(cwd?: string): string[];
|
|
17
|
-
export declare function installSkillFromUrl(name: string, url: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Ограничивает набор скилов по токен-бюджету.
|
|
20
|
-
* Сортирует по размеру (меньшие优先), обрезает если превышен бюджет.
|
|
21
|
-
* Возвращает обрезанный список + список отброшенных.
|
|
22
|
-
*/
|
|
23
|
-
export declare function enforceSkillBudget(skills: Skill[], tokenBudget: number): {
|
|
24
|
-
allowed: Skill[];
|
|
25
|
-
dropped: string[];
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Возвращает описание скилла из его SKILL.md.
|
|
29
|
-
* Результат кэшируется.
|
|
30
|
-
*/
|
|
31
|
-
export declare function getSkillDescription(name: string, cwd: string): string | null;
|
|
32
|
-
/**
|
|
33
|
-
* Возвращает список всех установленных скиллов с описаниями.
|
|
34
|
-
*/
|
|
35
|
-
export declare function listSkillsWithDescriptions(cwd?: string): {
|
|
36
|
-
name: string;
|
|
37
|
-
description: string | null;
|
|
38
|
-
}[];
|
|
39
|
-
/**
|
|
40
|
-
* Инвалидирует кэш описаний (вызывается при изменении конфига).
|
|
41
|
-
*/
|
|
42
|
-
export declare function invalidateSkillCaches(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Проверяет, просит ли пользователь явно "используй скилл".
|
|
45
|
-
*/
|
|
46
|
-
export declare function isSkillRequest(text: string): boolean;
|
|
47
|
-
export declare function preloadSkillsByKeywords(text: string, cwd: string): Skill[];
|
|
48
|
-
export declare function formatSkillsBlock(skills: Skill[], maxContentLength?: number): string;
|
|
49
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/skills/loader.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBvD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CA6BjE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAWrE;AAaD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiB9D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAI1D;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAetE;AAYD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,KAAK,EAAE,EACf,WAAW,EAAE,MAAM,GAClB;IAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAkBzC;AAsDD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAc5E;AAkBD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,CAQvG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAmED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAoBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAuC1E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CASpF"}
|