@hcu-lab.me/mcp-device 1.0.9 → 1.0.12
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/PRIVACY.md +21 -0
- package/README.md +58 -3
- package/SECURITY.md +67 -0
- package/config/revoked-approvals.json +1 -0
- package/control-plane/config/mcp-servers.example.toml +52 -0
- package/control-plane/config/mcp-servers.toml +52 -0
- package/control-plane/contracts/device-public-contract-v1.json +733 -0
- package/control-plane/scripts/GATEWAY-LICENSE.txt +7 -0
- package/control-plane/scripts/account-http.mjs +220 -0
- package/control-plane/scripts/account-store.mjs +368 -0
- package/control-plane/scripts/admin.mjs +68 -0
- package/control-plane/scripts/auth-session.mjs +411 -0
- package/control-plane/scripts/authenticated-mcp-wrapper.mjs +1281 -0
- package/control-plane/scripts/benchmark-command.mjs +9 -0
- package/control-plane/scripts/benchmark-mcp-catalog.mjs +174 -0
- package/control-plane/scripts/catalog-budget.mjs +87 -0
- package/control-plane/scripts/check-device-public-contract.mjs +20 -0
- package/control-plane/scripts/custom-tools/index.mjs +221 -0
- package/control-plane/scripts/custom-tools/path-utils.mjs +117 -0
- package/control-plane/scripts/custom-tools/response-utils.mjs +34 -0
- package/control-plane/scripts/dashboard-http.mjs +598 -0
- package/control-plane/scripts/device-access-policy.mjs +205 -0
- package/control-plane/scripts/device-admin.mjs +43 -0
- package/control-plane/scripts/device-audit.mjs +63 -0
- package/control-plane/scripts/device-broker.mjs +1461 -0
- package/control-plane/scripts/device-execution-tool-definitions.mjs +217 -0
- package/control-plane/scripts/device-inventory.mjs +128 -0
- package/control-plane/scripts/device-pairing-http.mjs +109 -0
- package/control-plane/scripts/device-pairing-store.mjs +245 -0
- package/control-plane/scripts/device-public-contract.mjs +165 -0
- package/control-plane/scripts/device-release.mjs +95 -0
- package/control-plane/scripts/device-secure-transport.mjs +128 -0
- package/control-plane/scripts/device-store.mjs +283 -0
- package/control-plane/scripts/device-usage.mjs +657 -0
- package/control-plane/scripts/embedded-device.mjs +149 -0
- package/control-plane/scripts/enduser-ui.mjs +45 -0
- package/control-plane/scripts/external-tool-broker.mjs +179 -0
- package/control-plane/scripts/oauth-authorization-server.mjs +589 -0
- package/control-plane/scripts/operator-dashboard-http.mjs +81 -0
- package/control-plane/scripts/project-inspection.mjs +227 -0
- package/control-plane/scripts/projects/project-id.mjs +69 -0
- package/control-plane/scripts/projects/trusted-roots-projects.mjs +375 -0
- package/control-plane/scripts/prompts/index.mjs +60 -0
- package/control-plane/scripts/remote-process-sessions.mjs +78 -0
- package/control-plane/scripts/remote-tool-result.mjs +9 -0
- package/control-plane/scripts/resources/index.mjs +166 -0
- package/control-plane/scripts/runtime-profile.mjs +54 -0
- package/control-plane/scripts/shell-tool-descriptor.mjs +17 -0
- package/control-plane/scripts/skill-source-safety.mjs +46 -0
- package/control-plane/scripts/skills/README.md +70 -0
- package/control-plane/scripts/skills/_upstream_licenses/anthropic-THIRD_PARTY_NOTICES.md +405 -0
- package/control-plane/scripts/skills/_upstream_licenses/hallmark-LICENSE.txt +21 -0
- package/control-plane/scripts/skills/_upstream_licenses/ponytail-LICENSE.txt +21 -0
- package/control-plane/scripts/skills/_upstream_licenses/stitch-skills-LICENSE.txt +201 -0
- package/control-plane/scripts/skills/_upstream_licenses/superpowers-LICENSE.txt +21 -0
- package/control-plane/scripts/skills/algorithmic-art/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/algorithmic-art/SKILL.md +405 -0
- package/control-plane/scripts/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/control-plane/scripts/skills/algorithmic-art/templates/viewer.html +599 -0
- package/control-plane/scripts/skills/brainstorming/SKILL.md +285 -0
- package/control-plane/scripts/skills/brainstorming/scripts/frame-template.html +213 -0
- package/control-plane/scripts/skills/brainstorming/scripts/helper.js +167 -0
- package/control-plane/scripts/skills/brainstorming/scripts/server.cjs +723 -0
- package/control-plane/scripts/skills/brainstorming/scripts/start-server.sh +209 -0
- package/control-plane/scripts/skills/brainstorming/scripts/stop-server.sh +120 -0
- package/control-plane/scripts/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/control-plane/scripts/skills/brainstorming/visual-companion.md +299 -0
- package/control-plane/scripts/skills/brand-guidelines/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/brand-guidelines/SKILL.md +73 -0
- package/control-plane/scripts/skills/claude-api/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/claude-api/SKILL.md +570 -0
- package/control-plane/scripts/skills/claude-api/csharp/claude-api/README.md +362 -0
- package/control-plane/scripts/skills/claude-api/csharp/claude-api/batches.md +14 -0
- package/control-plane/scripts/skills/claude-api/csharp/claude-api/files-api.md +25 -0
- package/control-plane/scripts/skills/claude-api/csharp/claude-api/streaming.md +28 -0
- package/control-plane/scripts/skills/claude-api/csharp/claude-api/tool-use.md +164 -0
- package/control-plane/scripts/skills/claude-api/curl/examples.md +256 -0
- package/control-plane/scripts/skills/claude-api/curl/managed-agents.md +371 -0
- package/control-plane/scripts/skills/claude-api/go/claude-api/README.md +188 -0
- package/control-plane/scripts/skills/claude-api/go/claude-api/files-api.md +23 -0
- package/control-plane/scripts/skills/claude-api/go/claude-api/streaming.md +43 -0
- package/control-plane/scripts/skills/claude-api/go/claude-api/tool-use.md +220 -0
- package/control-plane/scripts/skills/claude-api/go/managed-agents/README.md +564 -0
- package/control-plane/scripts/skills/claude-api/java/claude-api/README.md +238 -0
- package/control-plane/scripts/skills/claude-api/java/claude-api/files-api.md +27 -0
- package/control-plane/scripts/skills/claude-api/java/claude-api/streaming.md +24 -0
- package/control-plane/scripts/skills/claude-api/java/claude-api/tool-use.md +228 -0
- package/control-plane/scripts/skills/claude-api/java/managed-agents/README.md +443 -0
- package/control-plane/scripts/skills/claude-api/php/claude-api/README.md +174 -0
- package/control-plane/scripts/skills/claude-api/php/claude-api/batches.md +15 -0
- package/control-plane/scripts/skills/claude-api/php/claude-api/files-api.md +13 -0
- package/control-plane/scripts/skills/claude-api/php/claude-api/streaming.md +27 -0
- package/control-plane/scripts/skills/claude-api/php/claude-api/tool-use.md +253 -0
- package/control-plane/scripts/skills/claude-api/php/managed-agents/README.md +443 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/README.md +565 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/batches.md +198 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/files-api.md +170 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/sdk-upgrade.md +286 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/streaming.md +179 -0
- package/control-plane/scripts/skills/claude-api/python/claude-api/tool-use.md +627 -0
- package/control-plane/scripts/skills/claude-api/python/managed-agents/README.md +335 -0
- package/control-plane/scripts/skills/claude-api/ruby/claude-api/README.md +134 -0
- package/control-plane/scripts/skills/claude-api/ruby/claude-api/streaming.md +16 -0
- package/control-plane/scripts/skills/claude-api/ruby/claude-api/tool-use.md +41 -0
- package/control-plane/scripts/skills/claude-api/ruby/managed-agents/README.md +394 -0
- package/control-plane/scripts/skills/claude-api/shared/admin-api.md +179 -0
- package/control-plane/scripts/skills/claude-api/shared/agent-design.md +101 -0
- package/control-plane/scripts/skills/claude-api/shared/anthropic-cli.md +269 -0
- package/control-plane/scripts/skills/claude-api/shared/claude-platform-on-aws.md +59 -0
- package/control-plane/scripts/skills/claude-api/shared/cost-optimization.md +233 -0
- package/control-plane/scripts/skills/claude-api/shared/error-codes.md +262 -0
- package/control-plane/scripts/skills/claude-api/shared/live-sources.md +166 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-api-reference.md +455 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-client-patterns.md +220 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-core.md +359 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-environments.md +226 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-events.md +290 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-memory.md +201 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-multiagent.md +260 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-onboarding.md +82 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-outcomes.md +108 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-overview.md +77 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-scheduled-deployments.md +156 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +282 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-tools.md +504 -0
- package/control-plane/scripts/skills/claude-api/shared/managed-agents-webhooks.md +143 -0
- package/control-plane/scripts/skills/claude-api/shared/model-migration.md +1872 -0
- package/control-plane/scripts/skills/claude-api/shared/models.md +142 -0
- package/control-plane/scripts/skills/claude-api/shared/platform-availability.md +52 -0
- package/control-plane/scripts/skills/claude-api/shared/prompt-audit.md +223 -0
- package/control-plane/scripts/skills/claude-api/shared/prompt-caching.md +292 -0
- package/control-plane/scripts/skills/claude-api/shared/token-counting.md +56 -0
- package/control-plane/scripts/skills/claude-api/shared/tool-use-concepts.md +526 -0
- package/control-plane/scripts/skills/claude-api/typescript/claude-api/README.md +405 -0
- package/control-plane/scripts/skills/claude-api/typescript/claude-api/batches.md +106 -0
- package/control-plane/scripts/skills/claude-api/typescript/claude-api/files-api.md +98 -0
- package/control-plane/scripts/skills/claude-api/typescript/claude-api/streaming.md +178 -0
- package/control-plane/scripts/skills/claude-api/typescript/claude-api/tool-use.md +586 -0
- package/control-plane/scripts/skills/claude-api/typescript/managed-agents/README.md +359 -0
- package/control-plane/scripts/skills/dispatching-parallel-agents/SKILL.md +167 -0
- package/control-plane/scripts/skills/enhance-prompt/README.md +34 -0
- package/control-plane/scripts/skills/enhance-prompt/SKILL.md +204 -0
- package/control-plane/scripts/skills/enhance-prompt/references/KEYWORDS.md +114 -0
- package/control-plane/scripts/skills/executing-plans/SKILL.md +371 -0
- package/control-plane/scripts/skills/executing-plans/scripts/task-done +52 -0
- package/control-plane/scripts/skills/executing-plans/scripts/task-start +28 -0
- package/control-plane/scripts/skills/extract-design-md/SKILL.md +358 -0
- package/control-plane/scripts/skills/extract-design-md/examples/DESIGN.md +210 -0
- package/control-plane/scripts/skills/extract-design-md/references/angular.md +122 -0
- package/control-plane/scripts/skills/extract-design-md/references/plain-css.md +161 -0
- package/control-plane/scripts/skills/extract-design-md/references/react-tailwind.md +157 -0
- package/control-plane/scripts/skills/extract-design-md/references/svelte.md +101 -0
- package/control-plane/scripts/skills/extract-design-md/references/vue.md +107 -0
- package/control-plane/scripts/skills/finishing-a-development-branch/SKILL.md +225 -0
- package/control-plane/scripts/skills/frontend-design/LICENSE.txt +177 -0
- package/control-plane/scripts/skills/frontend-design/SKILL.md +71 -0
- package/control-plane/scripts/skills/hallmark/SKILL.md +558 -0
- package/control-plane/scripts/skills/hallmark/references/anti-patterns.md +418 -0
- package/control-plane/scripts/skills/hallmark/references/assets.md +406 -0
- package/control-plane/scripts/skills/hallmark/references/color.md +95 -0
- package/control-plane/scripts/skills/hallmark/references/component-cookbook.md +263 -0
- package/control-plane/scripts/skills/hallmark/references/components/c1-outlined-chip.md +12 -0
- package/control-plane/scripts/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -0
- package/control-plane/scripts/skills/hallmark/references/components/c3-typographic-link.md +8 -0
- package/control-plane/scripts/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -0
- package/control-plane/scripts/skills/hallmark/references/components/f1-bento-grid.md +20 -0
- package/control-plane/scripts/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -0
- package/control-plane/scripts/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/f4-step-sequence.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/f6-product-card-grid.md +41 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft1-mast-headed.md +13 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft4-dense-typographic.md +10 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft5-statement.md +21 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft6-letter-close.md +19 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft7-newsletter-first.md +27 -0
- package/control-plane/scripts/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -0
- package/control-plane/scripts/skills/hallmark/references/components/h1-marquee.md +15 -0
- package/control-plane/scripts/skills/hallmark/references/components/h2-split-diptych.md +15 -0
- package/control-plane/scripts/skills/hallmark/references/components/h3-quote-led.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/h4-stat-led.md +14 -0
- package/control-plane/scripts/skills/hallmark/references/components/h5-letter-hero.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/h6-photographic-fold.md +16 -0
- package/control-plane/scripts/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -0
- package/control-plane/scripts/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -0
- package/control-plane/scripts/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -0
- package/control-plane/scripts/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -0
- package/control-plane/scripts/skills/hallmark/references/components/n11-mega-menu.md +40 -0
- package/control-plane/scripts/skills/hallmark/references/components/n12-banner-retract.md +34 -0
- package/control-plane/scripts/skills/hallmark/references/components/n13-inline-cmdk-pill.md +39 -0
- package/control-plane/scripts/skills/hallmark/references/components/n1b-saas-three-section.md +35 -0
- package/control-plane/scripts/skills/hallmark/references/components/n2-floating-chip.md +14 -0
- package/control-plane/scripts/skills/hallmark/references/components/n3-side-rail.md +14 -0
- package/control-plane/scripts/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -0
- package/control-plane/scripts/skills/hallmark/references/components/n5-floating-pill.md +28 -0
- package/control-plane/scripts/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -0
- package/control-plane/scripts/skills/hallmark/references/components/n7-brutal-slab.md +22 -0
- package/control-plane/scripts/skills/hallmark/references/components/n8-terminal-command.md +21 -0
- package/control-plane/scripts/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -0
- package/control-plane/scripts/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -0
- package/control-plane/scripts/skills/hallmark/references/components/s2-hanging.md +13 -0
- package/control-plane/scripts/skills/hallmark/references/components/s3-sticky-pinned.md +19 -0
- package/control-plane/scripts/skills/hallmark/references/components/s4-inline-no-break.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/s5-bottom-anchored.md +13 -0
- package/control-plane/scripts/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -0
- package/control-plane/scripts/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -0
- package/control-plane/scripts/skills/hallmark/references/components/t3-single-huge-quote.md +11 -0
- package/control-plane/scripts/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -0
- package/control-plane/scripts/skills/hallmark/references/contract.md +25 -0
- package/control-plane/scripts/skills/hallmark/references/copy.md +182 -0
- package/control-plane/scripts/skills/hallmark/references/custom-craft.md +626 -0
- package/control-plane/scripts/skills/hallmark/references/custom-theme.md +367 -0
- package/control-plane/scripts/skills/hallmark/references/design-md.md +116 -0
- package/control-plane/scripts/skills/hallmark/references/export-formats.md +329 -0
- package/control-plane/scripts/skills/hallmark/references/floating-nav.md +89 -0
- package/control-plane/scripts/skills/hallmark/references/genres/atmospheric.md +69 -0
- package/control-plane/scripts/skills/hallmark/references/genres/editorial.md +72 -0
- package/control-plane/scripts/skills/hallmark/references/genres/modern-minimal.md +71 -0
- package/control-plane/scripts/skills/hallmark/references/genres/playful.md +70 -0
- package/control-plane/scripts/skills/hallmark/references/hero-enrichment.md +475 -0
- package/control-plane/scripts/skills/hallmark/references/imagery-kit.md +170 -0
- package/control-plane/scripts/skills/hallmark/references/interaction-and-states.md +208 -0
- package/control-plane/scripts/skills/hallmark/references/layout-and-space.md +112 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/02-long-document.md +34 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/04-stat-led.md +34 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/05-workbench.md +32 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/07-manifesto.md +32 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/08-photographic.md +34 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/09-quote-led.md +32 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/10-specimen.md +32 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/11-catalogue.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/12-letter.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/13-index-first.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/15-split-studio.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures/21-component-playground.md +23 -0
- package/control-plane/scripts/skills/hallmark/references/macrostructures.md +89 -0
- package/control-plane/scripts/skills/hallmark/references/microinteractions.md +258 -0
- package/control-plane/scripts/skills/hallmark/references/motion.md +109 -0
- package/control-plane/scripts/skills/hallmark/references/preview-examples.md +49 -0
- package/control-plane/scripts/skills/hallmark/references/responsive.md +138 -0
- package/control-plane/scripts/skills/hallmark/references/slop-test.md +192 -0
- package/control-plane/scripts/skills/hallmark/references/structure.md +160 -0
- package/control-plane/scripts/skills/hallmark/references/study.md +509 -0
- package/control-plane/scripts/skills/hallmark/references/themes/carnival.md +301 -0
- package/control-plane/scripts/skills/hallmark/references/themes/cobalt.md +146 -0
- package/control-plane/scripts/skills/hallmark/references/themes/grid.md +161 -0
- package/control-plane/scripts/skills/hallmark/references/themes/hum.md +403 -0
- package/control-plane/scripts/skills/hallmark/references/themes/lumen.md +478 -0
- package/control-plane/scripts/skills/hallmark/references/typography.md +243 -0
- package/control-plane/scripts/skills/hallmark/references/upstream/recipes.md +186 -0
- package/control-plane/scripts/skills/hallmark/references/upstream/study-examples.md +176 -0
- package/control-plane/scripts/skills/hallmark/references/upstream/tokens.css +1221 -0
- package/control-plane/scripts/skills/hallmark/references/verbs/audit.md +25 -0
- package/control-plane/scripts/skills/hallmark/references/verbs/redesign.md +269 -0
- package/control-plane/scripts/skills/human-comms/SKILL.md +29 -0
- package/control-plane/scripts/skills/index.mjs +432 -0
- package/control-plane/scripts/skills/internal-comms/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/internal-comms/SKILL.md +32 -0
- package/control-plane/scripts/skills/internal-comms/examples/3p-updates.md +47 -0
- package/control-plane/scripts/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/control-plane/scripts/skills/internal-comms/examples/faq-answers.md +30 -0
- package/control-plane/scripts/skills/internal-comms/examples/general-comms.md +16 -0
- package/control-plane/scripts/skills/mcp-adapter.mjs +94 -0
- package/control-plane/scripts/skills/mcp-builder/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/mcp-builder/SKILL.md +236 -0
- package/control-plane/scripts/skills/mcp-builder/reference/evaluation.md +602 -0
- package/control-plane/scripts/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/control-plane/scripts/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/control-plane/scripts/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/control-plane/scripts/skills/mcp-builder/scripts/connections.py +151 -0
- package/control-plane/scripts/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/control-plane/scripts/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/control-plane/scripts/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/control-plane/scripts/skills/ponytail/SKILL.md +120 -0
- package/control-plane/scripts/skills/ponytail-audit/SKILL.md +41 -0
- package/control-plane/scripts/skills/ponytail-debt/SKILL.md +44 -0
- package/control-plane/scripts/skills/ponytail-gain/SKILL.md +50 -0
- package/control-plane/scripts/skills/ponytail-help/SKILL.md +71 -0
- package/control-plane/scripts/skills/ponytail-review/SKILL.md +57 -0
- package/control-plane/scripts/skills/receiving-code-review/SKILL.md +205 -0
- package/control-plane/scripts/skills/requesting-code-review/SKILL.md +95 -0
- package/control-plane/scripts/skills/requesting-code-review/code-reviewer.md +198 -0
- package/control-plane/scripts/skills/skill-creator/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/skill-creator/SKILL.md +485 -0
- package/control-plane/scripts/skills/skill-creator/agents/analyzer.md +274 -0
- package/control-plane/scripts/skills/skill-creator/agents/comparator.md +202 -0
- package/control-plane/scripts/skills/skill-creator/agents/grader.md +223 -0
- package/control-plane/scripts/skills/skill-creator/assets/eval_review.html +146 -0
- package/control-plane/scripts/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/control-plane/scripts/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/control-plane/scripts/skills/skill-creator/references/schemas.md +430 -0
- package/control-plane/scripts/skills/skill-creator/scripts/__init__.py +0 -0
- package/control-plane/scripts/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/control-plane/scripts/skills/skill-creator/scripts/generate_report.py +326 -0
- package/control-plane/scripts/skills/skill-creator/scripts/improve_description.py +247 -0
- package/control-plane/scripts/skills/skill-creator/scripts/package_skill.py +136 -0
- package/control-plane/scripts/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/control-plane/scripts/skills/skill-creator/scripts/run_eval.py +310 -0
- package/control-plane/scripts/skills/skill-creator/scripts/run_loop.py +328 -0
- package/control-plane/scripts/skills/skill-creator/scripts/utils.py +47 -0
- package/control-plane/scripts/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/slack-gif-creator/SKILL.md +254 -0
- package/control-plane/scripts/skills/slack-gif-creator/core/easing.py +234 -0
- package/control-plane/scripts/skills/slack-gif-creator/core/frame_composer.py +176 -0
- package/control-plane/scripts/skills/slack-gif-creator/core/gif_builder.py +269 -0
- package/control-plane/scripts/skills/slack-gif-creator/core/validators.py +136 -0
- package/control-plane/scripts/skills/slack-gif-creator/requirements.txt +4 -0
- package/control-plane/scripts/skills/sources.json +401 -0
- package/control-plane/scripts/skills/sources.lock.json +416 -0
- package/control-plane/scripts/skills/subagent-driven-development/SKILL.md +570 -0
- package/control-plane/scripts/skills/subagent-driven-development/implementer-prompt.md +154 -0
- package/control-plane/scripts/skills/subagent-driven-development/re-review-prompt.md +115 -0
- package/control-plane/scripts/skills/subagent-driven-development/scripts/review-package +53 -0
- package/control-plane/scripts/skills/subagent-driven-development/scripts/sdd-workspace +82 -0
- package/control-plane/scripts/skills/subagent-driven-development/scripts/task-brief +43 -0
- package/control-plane/scripts/skills/subagent-driven-development/task-reviewer-prompt.md +207 -0
- package/control-plane/scripts/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/control-plane/scripts/skills/systematic-debugging/SKILL.md +283 -0
- package/control-plane/scripts/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/control-plane/scripts/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/control-plane/scripts/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/control-plane/scripts/skills/systematic-debugging/find-polluter.sh +72 -0
- package/control-plane/scripts/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/control-plane/scripts/skills/systematic-debugging/test-academic.md +14 -0
- package/control-plane/scripts/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/control-plane/scripts/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/control-plane/scripts/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/control-plane/scripts/skills/test-driven-development/SKILL.md +330 -0
- package/control-plane/scripts/skills/test-driven-development/writing-good-tests.md +198 -0
- package/control-plane/scripts/skills/theme-factory/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/theme-factory/SKILL.md +59 -0
- package/control-plane/scripts/skills/theme-factory/theme-showcase.pdf +0 -0
- package/control-plane/scripts/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/desert-rose.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/golden-hour.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/control-plane/scripts/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/control-plane/scripts/skills/using-git-worktrees/SKILL.md +167 -0
- package/control-plane/scripts/skills/verification-before-completion/SKILL.md +120 -0
- package/control-plane/scripts/skills/web-artifacts-builder/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/web-artifacts-builder/SKILL.md +74 -0
- package/control-plane/scripts/skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/control-plane/scripts/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/control-plane/scripts/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/control-plane/scripts/skills/webapp-testing/LICENSE.txt +202 -0
- package/control-plane/scripts/skills/webapp-testing/SKILL.md +96 -0
- package/control-plane/scripts/skills/webapp-testing/examples/console_logging.py +35 -0
- package/control-plane/scripts/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/control-plane/scripts/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/control-plane/scripts/skills/webapp-testing/scripts/with_server.py +106 -0
- package/control-plane/scripts/skills/writing-plans/SKILL.md +192 -0
- package/control-plane/scripts/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/control-plane/scripts/skills/writing-skills/SKILL.md +681 -0
- package/control-plane/scripts/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/control-plane/scripts/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/control-plane/scripts/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/control-plane/scripts/skills/writing-skills/persuasion-principles.md +187 -0
- package/control-plane/scripts/skills/writing-skills/render-graphs.js +169 -0
- package/control-plane/scripts/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/control-plane/scripts/smoke-mcp-schemas.mjs +30 -0
- package/control-plane/scripts/surface-config.mjs +45 -0
- package/control-plane/scripts/sync-skills.mjs +370 -0
- package/control-plane/scripts/tool-metrics.mjs +74 -0
- package/control-plane/scripts/tool-risk.mjs +156 -0
- package/control-plane/scripts/tool-surface-stability.mjs +38 -0
- package/control-plane/scripts/upstreams/catalog-cache.mjs +28 -0
- package/control-plane/scripts/upstreams/config.mjs +158 -0
- package/control-plane/scripts/upstreams/diagnostics.mjs +21 -0
- package/control-plane/scripts/upstreams/http-client.mjs +67 -0
- package/control-plane/scripts/upstreams/manager.mjs +535 -0
- package/control-plane/scripts/upstreams/names.mjs +55 -0
- package/control-plane/scripts/upstreams/presets.mjs +60 -0
- package/control-plane/scripts/upstreams/resource-uri.mjs +29 -0
- package/control-plane/scripts/upstreams/stdio-client.mjs +73 -0
- package/control-plane/scripts/workspace-registry.mjs +147 -0
- package/dist/context/authorization.d.ts +5 -0
- package/dist/context/authorization.js +70 -0
- package/dist/context/capture.d.ts +46 -0
- package/dist/context/capture.js +187 -0
- package/dist/context/cli.d.ts +47 -0
- package/dist/context/cli.js +287 -0
- package/dist/context/device-adapter.d.ts +102 -0
- package/dist/context/device-adapter.js +79 -0
- package/dist/context/gateway.d.ts +354 -0
- package/dist/context/gateway.js +50 -0
- package/dist/context/graph.d.ts +63 -0
- package/dist/context/graph.js +214 -0
- package/dist/context/importer.d.ts +8 -0
- package/dist/context/importer.js +69 -0
- package/dist/context/indexer.d.ts +14 -0
- package/dist/context/indexer.js +57 -0
- package/dist/context/migrations/index.d.ts +4 -0
- package/dist/context/migrations/index.js +87 -0
- package/dist/context/redact.d.ts +15 -0
- package/dist/context/redact.js +43 -0
- package/dist/context/repositories.d.ts +9 -0
- package/dist/context/repositories.js +45 -0
- package/dist/context/search.d.ts +63 -0
- package/dist/context/search.js +207 -0
- package/dist/context/service.d.ts +278 -0
- package/dist/context/service.js +160 -0
- package/dist/context/store.d.ts +134 -0
- package/dist/context/store.js +722 -0
- package/dist/context/text.d.ts +4 -0
- package/dist/context/text.js +14 -0
- package/dist/context/tool-contract.d.ts +534 -0
- package/dist/context/tool-contract.js +45 -0
- package/dist/device/core.d.ts +29 -0
- package/dist/device/core.js +66 -0
- package/dist/device/device.d.ts +5 -0
- package/dist/device/device.js +94 -37
- package/dist/device/gateway-channel.d.ts +8 -1
- package/dist/device/gateway-channel.js +51 -3
- package/dist/device/gateway-tool-adapter.d.ts +11 -3
- package/dist/device/gateway-tool-adapter.js +141 -98
- package/dist/device/official-trust.d.ts +12 -0
- package/dist/device/official-trust.js +25 -1
- package/dist/device/runtime-owner.js +9 -1
- package/dist/distribution.d.ts +4 -0
- package/dist/distribution.js +8 -0
- package/dist/handlers/filesystem-handlers.js +53 -37
- package/dist/handlers/search-handlers.d.ts +1 -0
- package/dist/handlers/search-handlers.js +51 -1
- package/dist/log-palace/cli.d.ts +7 -0
- package/dist/log-palace/cli.js +89 -0
- package/dist/log-palace/formats.d.ts +26 -0
- package/dist/log-palace/formats.js +126 -0
- package/dist/log-palace/store.d.ts +129 -0
- package/dist/log-palace/store.js +856 -0
- package/dist/mcp-device.d.ts +1 -1
- package/dist/mcp-device.js +28 -6
- package/dist/npm-scripts/remote.js +1 -0
- package/dist/platform/activity-journal.d.ts +16 -0
- package/dist/platform/activity-journal.js +68 -0
- package/dist/platform/cli.d.ts +1 -0
- package/dist/platform/cli.js +300 -0
- package/dist/platform/coordination-lock.d.ts +45 -0
- package/dist/platform/coordination-lock.js +233 -0
- package/dist/platform/device-runtime.d.ts +16 -0
- package/dist/platform/device-runtime.js +83 -0
- package/dist/platform/knowledge-contract.d.ts +46 -0
- package/dist/platform/knowledge-contract.js +1 -0
- package/dist/platform/knowledge-mcp.d.ts +29 -0
- package/dist/platform/knowledge-mcp.js +95 -0
- package/dist/platform/knowledge-router.d.ts +64 -0
- package/dist/platform/knowledge-router.js +320 -0
- package/dist/platform/plugin-child.d.ts +1 -0
- package/dist/platform/plugin-child.js +115 -0
- package/dist/platform/plugin-contract.d.ts +76 -0
- package/dist/platform/plugin-contract.js +53 -0
- package/dist/platform/plugin-driver.d.ts +8 -0
- package/dist/platform/plugin-driver.js +443 -0
- package/dist/platform/plugin-host.d.ts +88 -0
- package/dist/platform/plugin-host.js +817 -0
- package/dist/platform/plugin-policy.d.ts +3 -0
- package/dist/platform/plugin-policy.js +29 -0
- package/dist/platform/plugin-services.d.ts +14 -0
- package/dist/platform/plugin-services.js +32 -0
- package/dist/platform/process-identity.d.ts +9 -0
- package/dist/platform/process-identity.js +68 -0
- package/dist/platform/runtime-lease.d.ts +4 -0
- package/dist/platform/runtime-lease.js +58 -0
- package/dist/platform/runtime-root.d.ts +9 -0
- package/dist/platform/runtime-root.js +61 -0
- package/dist/platform/state-backup.d.ts +92 -0
- package/dist/platform/state-backup.js +399 -0
- package/dist/plugins/reference/plugin.d.ts +3 -0
- package/dist/plugins/reference/plugin.js +13 -0
- package/dist/search-manager.d.ts +6 -0
- package/dist/search-manager.js +123 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +7 -3
- package/dist/terminal-manager.d.ts +16 -0
- package/dist/terminal-manager.js +137 -42
- package/dist/tool-dispatcher.d.ts +11 -0
- package/dist/tool-dispatcher.js +228 -0
- package/dist/tools/edit.js +72 -1
- package/dist/tools/filesystem.d.ts +1 -1
- package/dist/tools/filesystem.js +2 -2
- package/dist/tools/improved-process-tools.js +91 -108
- package/dist/tools/schemas.d.ts +94 -2
- package/dist/tools/schemas.js +20 -6
- package/dist/types.d.ts +8 -0
- package/dist/utils/output-budget.d.ts +6 -0
- package/dist/utils/output-budget.js +15 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +29 -6
- package/skills/mcp-device-context/SKILL.md +40 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Match Vietnamese stroked d as well as combining accents on both sides of FTS. */
|
|
2
|
+
export declare function fold(text: string): string;
|
|
3
|
+
/** Return a byte-bounded prefix without splitting UTF-8 code points or surrogate pairs. */
|
|
4
|
+
export declare function utf8Prefix(text: string, cap: number): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Match Vietnamese stroked d as well as combining accents on both sides of FTS. */
|
|
2
|
+
export function fold(text) {
|
|
3
|
+
return text.replace(/[đĐ]/g, 'd').normalize('NFD').replace(/\p{M}/gu, '').toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
/** Return a byte-bounded prefix without splitting UTF-8 code points or surrogate pairs. */
|
|
6
|
+
export function utf8Prefix(text, cap) {
|
|
7
|
+
if (Buffer.byteLength(text) <= cap)
|
|
8
|
+
return text;
|
|
9
|
+
const buffer = Buffer.from(text);
|
|
10
|
+
let end = Math.min(cap, buffer.length);
|
|
11
|
+
while (end > 0 && (buffer[end] & 0xc0) === 0x80)
|
|
12
|
+
end--;
|
|
13
|
+
return buffer.subarray(0, end).toString('utf8');
|
|
14
|
+
}
|
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CONTEXT_INPUTS: {
|
|
3
|
+
readonly local_status: z.ZodObject<{
|
|
4
|
+
check_current: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
job_id: z.ZodOptional<z.ZodString>;
|
|
6
|
+
device_id: z.ZodString;
|
|
7
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
8
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strict", z.ZodTypeAny, {
|
|
10
|
+
device_id: string;
|
|
11
|
+
cwd?: string | undefined;
|
|
12
|
+
check_current?: boolean | undefined;
|
|
13
|
+
job_id?: string | undefined;
|
|
14
|
+
project_id?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
device_id: string;
|
|
17
|
+
cwd?: string | undefined;
|
|
18
|
+
check_current?: boolean | undefined;
|
|
19
|
+
job_id?: string | undefined;
|
|
20
|
+
project_id?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
readonly local_search: z.ZodObject<{
|
|
23
|
+
query: z.ZodString;
|
|
24
|
+
source_types: z.ZodOptional<z.ZodArray<z.ZodEnum<["history", "checkpoint", "activity"]>, "many">>;
|
|
25
|
+
since: z.ZodOptional<z.ZodString>;
|
|
26
|
+
until: z.ZodOptional<z.ZodString>;
|
|
27
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
28
|
+
max_bytes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
29
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
30
|
+
include_related: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
device_id: z.ZodString;
|
|
32
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
33
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strict", z.ZodTypeAny, {
|
|
35
|
+
device_id: string;
|
|
36
|
+
query: string;
|
|
37
|
+
since?: string | undefined;
|
|
38
|
+
cwd?: string | undefined;
|
|
39
|
+
cursor?: string | undefined;
|
|
40
|
+
limit?: number | undefined;
|
|
41
|
+
project_id?: string | undefined;
|
|
42
|
+
source_types?: ("checkpoint" | "history" | "activity")[] | undefined;
|
|
43
|
+
until?: string | undefined;
|
|
44
|
+
max_bytes?: number | undefined;
|
|
45
|
+
include_related?: boolean | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
device_id: string;
|
|
48
|
+
query: string;
|
|
49
|
+
since?: string | undefined;
|
|
50
|
+
cwd?: string | undefined;
|
|
51
|
+
cursor?: string | undefined;
|
|
52
|
+
limit?: number | undefined;
|
|
53
|
+
project_id?: string | undefined;
|
|
54
|
+
source_types?: ("checkpoint" | "history" | "activity")[] | undefined;
|
|
55
|
+
until?: string | undefined;
|
|
56
|
+
max_bytes?: number | undefined;
|
|
57
|
+
include_related?: boolean | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
readonly local_read: z.ZodObject<{
|
|
60
|
+
refs: z.ZodArray<z.ZodString, "many">;
|
|
61
|
+
max_bytes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
62
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
63
|
+
ranges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
ref: z.ZodString;
|
|
65
|
+
start: z.ZodNumber;
|
|
66
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, "strict", z.ZodTypeAny, {
|
|
68
|
+
ref: string;
|
|
69
|
+
start: number;
|
|
70
|
+
end?: number | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
ref: string;
|
|
73
|
+
start: number;
|
|
74
|
+
end?: number | undefined;
|
|
75
|
+
}>, "many">>;
|
|
76
|
+
device_id: z.ZodString;
|
|
77
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
78
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
device_id: string;
|
|
81
|
+
refs: string[];
|
|
82
|
+
cwd?: string | undefined;
|
|
83
|
+
cursor?: string | undefined;
|
|
84
|
+
project_id?: string | undefined;
|
|
85
|
+
max_bytes?: number | undefined;
|
|
86
|
+
ranges?: {
|
|
87
|
+
ref: string;
|
|
88
|
+
start: number;
|
|
89
|
+
end?: number | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
device_id: string;
|
|
93
|
+
refs: string[];
|
|
94
|
+
cwd?: string | undefined;
|
|
95
|
+
cursor?: string | undefined;
|
|
96
|
+
project_id?: string | undefined;
|
|
97
|
+
max_bytes?: number | undefined;
|
|
98
|
+
ranges?: {
|
|
99
|
+
ref: string;
|
|
100
|
+
start: number;
|
|
101
|
+
end?: number | undefined;
|
|
102
|
+
}[] | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
readonly local_graph: z.ZodObject<{
|
|
105
|
+
action: z.ZodEnum<["neighbors", "path", "timeline", "related"]>;
|
|
106
|
+
refs: z.ZodArray<z.ZodString, "many">;
|
|
107
|
+
target: z.ZodOptional<z.ZodString>;
|
|
108
|
+
relations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
direction: z.ZodOptional<z.ZodEnum<["in", "out", "both"]>>;
|
|
110
|
+
max_hops: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
111
|
+
max_nodes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
112
|
+
max_edges: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
113
|
+
max_bytes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
114
|
+
wall_ms: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
115
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
116
|
+
device_id: z.ZodString;
|
|
117
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
118
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
120
|
+
action: "path" | "neighbors" | "timeline" | "related";
|
|
121
|
+
device_id: string;
|
|
122
|
+
refs: string[];
|
|
123
|
+
target?: string | undefined;
|
|
124
|
+
cwd?: string | undefined;
|
|
125
|
+
cursor?: string | undefined;
|
|
126
|
+
project_id?: string | undefined;
|
|
127
|
+
max_bytes?: number | undefined;
|
|
128
|
+
relations?: string[] | undefined;
|
|
129
|
+
direction?: "out" | "in" | "both" | undefined;
|
|
130
|
+
max_hops?: number | undefined;
|
|
131
|
+
max_nodes?: number | undefined;
|
|
132
|
+
max_edges?: number | undefined;
|
|
133
|
+
wall_ms?: number | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
action: "path" | "neighbors" | "timeline" | "related";
|
|
136
|
+
device_id: string;
|
|
137
|
+
refs: string[];
|
|
138
|
+
target?: string | undefined;
|
|
139
|
+
cwd?: string | undefined;
|
|
140
|
+
cursor?: string | undefined;
|
|
141
|
+
project_id?: string | undefined;
|
|
142
|
+
max_bytes?: number | undefined;
|
|
143
|
+
relations?: string[] | undefined;
|
|
144
|
+
direction?: "out" | "in" | "both" | undefined;
|
|
145
|
+
max_hops?: number | undefined;
|
|
146
|
+
max_nodes?: number | undefined;
|
|
147
|
+
max_edges?: number | undefined;
|
|
148
|
+
wall_ms?: number | undefined;
|
|
149
|
+
}>;
|
|
150
|
+
readonly local_index: z.ZodObject<{
|
|
151
|
+
action: z.ZodEnum<["sync", "checkpoint", "rebuild", "cancel"]>;
|
|
152
|
+
budget_profile: z.ZodOptional<z.ZodString>;
|
|
153
|
+
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
154
|
+
job_id: z.ZodOptional<z.ZodString>;
|
|
155
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
156
|
+
evidence_refs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
157
|
+
device_id: z.ZodString;
|
|
158
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
159
|
+
project_id: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, "strict", z.ZodTypeAny, {
|
|
161
|
+
action: "checkpoint" | "sync" | "rebuild" | "cancel";
|
|
162
|
+
device_id: string;
|
|
163
|
+
evidence_refs?: string[] | undefined;
|
|
164
|
+
summary?: string | undefined;
|
|
165
|
+
cwd?: string | undefined;
|
|
166
|
+
job_id?: string | undefined;
|
|
167
|
+
project_id?: string | undefined;
|
|
168
|
+
budget_profile?: string | undefined;
|
|
169
|
+
idempotency_key?: string | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
action: "checkpoint" | "sync" | "rebuild" | "cancel";
|
|
172
|
+
device_id: string;
|
|
173
|
+
evidence_refs?: string[] | undefined;
|
|
174
|
+
summary?: string | undefined;
|
|
175
|
+
cwd?: string | undefined;
|
|
176
|
+
job_id?: string | undefined;
|
|
177
|
+
project_id?: string | undefined;
|
|
178
|
+
budget_profile?: string | undefined;
|
|
179
|
+
idempotency_key?: string | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
readonly local_wiki: z.ZodObject<{
|
|
182
|
+
action: z.ZodEnum<["status"]>;
|
|
183
|
+
}, "strict", z.ZodTypeAny, {
|
|
184
|
+
action: "status";
|
|
185
|
+
}, {
|
|
186
|
+
action: "status";
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
export type ContextToolName = keyof typeof CONTEXT_INPUTS;
|
|
190
|
+
export declare const CONTEXT_TOOL_NAMES: ContextToolName[];
|
|
191
|
+
export declare function buildContextCatalog(): {
|
|
192
|
+
name: "local_status" | "local_search" | "local_read" | "local_graph" | "local_index" | "local_wiki";
|
|
193
|
+
description: string;
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "string";
|
|
196
|
+
minLength?: number;
|
|
197
|
+
maxLength?: number;
|
|
198
|
+
format?: "email" | "idn-email" | "uri" | "uuid" | "date-time" | "ipv4" | "ipv6" | "date" | "time" | "duration";
|
|
199
|
+
pattern?: string;
|
|
200
|
+
allOf?: {
|
|
201
|
+
pattern: string;
|
|
202
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<{
|
|
203
|
+
pattern: string;
|
|
204
|
+
}>;
|
|
205
|
+
}[];
|
|
206
|
+
anyOf?: {
|
|
207
|
+
format: string;
|
|
208
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<{
|
|
209
|
+
format: string;
|
|
210
|
+
}>;
|
|
211
|
+
}[];
|
|
212
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7StringType>;
|
|
213
|
+
contentEncoding?: string;
|
|
214
|
+
title?: string;
|
|
215
|
+
default?: any;
|
|
216
|
+
description?: string;
|
|
217
|
+
markdownDescription?: string;
|
|
218
|
+
definitions?: {
|
|
219
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
220
|
+
} | undefined;
|
|
221
|
+
} | {
|
|
222
|
+
type: "array";
|
|
223
|
+
items?: import("zod-to-json-schema").JsonSchema7Type;
|
|
224
|
+
minItems?: number;
|
|
225
|
+
maxItems?: number;
|
|
226
|
+
errorMessages?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7ArrayType, "items">;
|
|
227
|
+
title?: string;
|
|
228
|
+
default?: any;
|
|
229
|
+
description?: string;
|
|
230
|
+
markdownDescription?: string;
|
|
231
|
+
definitions?: {
|
|
232
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
233
|
+
} | undefined;
|
|
234
|
+
} | {
|
|
235
|
+
type: "number" | "integer";
|
|
236
|
+
minimum?: number;
|
|
237
|
+
exclusiveMinimum?: number;
|
|
238
|
+
maximum?: number;
|
|
239
|
+
exclusiveMaximum?: number;
|
|
240
|
+
multipleOf?: number;
|
|
241
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7NumberType>;
|
|
242
|
+
title?: string;
|
|
243
|
+
default?: any;
|
|
244
|
+
description?: string;
|
|
245
|
+
markdownDescription?: string;
|
|
246
|
+
definitions?: {
|
|
247
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
248
|
+
} | undefined;
|
|
249
|
+
} | {
|
|
250
|
+
type: "integer";
|
|
251
|
+
format: "int64";
|
|
252
|
+
minimum?: BigInt;
|
|
253
|
+
exclusiveMinimum?: BigInt;
|
|
254
|
+
maximum?: BigInt;
|
|
255
|
+
exclusiveMaximum?: BigInt;
|
|
256
|
+
multipleOf?: BigInt;
|
|
257
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7BigintType>;
|
|
258
|
+
title?: string;
|
|
259
|
+
default?: any;
|
|
260
|
+
description?: string;
|
|
261
|
+
markdownDescription?: string;
|
|
262
|
+
definitions?: {
|
|
263
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
264
|
+
} | undefined;
|
|
265
|
+
} | {
|
|
266
|
+
type: "boolean";
|
|
267
|
+
title?: string;
|
|
268
|
+
default?: any;
|
|
269
|
+
description?: string;
|
|
270
|
+
markdownDescription?: string;
|
|
271
|
+
definitions?: {
|
|
272
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
273
|
+
} | undefined;
|
|
274
|
+
} | {
|
|
275
|
+
type: "integer" | "string";
|
|
276
|
+
format: "unix-time" | "date-time" | "date";
|
|
277
|
+
minimum?: number;
|
|
278
|
+
maximum?: number;
|
|
279
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7NumberType>;
|
|
280
|
+
title?: string;
|
|
281
|
+
default?: any;
|
|
282
|
+
description?: string;
|
|
283
|
+
markdownDescription?: string;
|
|
284
|
+
definitions?: {
|
|
285
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
286
|
+
} | undefined;
|
|
287
|
+
} | {
|
|
288
|
+
anyOf: import("zod-to-json-schema").JsonSchema7DateType[];
|
|
289
|
+
title?: string;
|
|
290
|
+
default?: any;
|
|
291
|
+
description?: string;
|
|
292
|
+
markdownDescription?: string;
|
|
293
|
+
definitions?: {
|
|
294
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
295
|
+
} | undefined;
|
|
296
|
+
} | {
|
|
297
|
+
type: "string";
|
|
298
|
+
enum: string[];
|
|
299
|
+
title?: string;
|
|
300
|
+
default?: any;
|
|
301
|
+
description?: string;
|
|
302
|
+
markdownDescription?: string;
|
|
303
|
+
definitions?: {
|
|
304
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
305
|
+
} | undefined;
|
|
306
|
+
} | {
|
|
307
|
+
type: "string" | "number" | "integer" | "boolean";
|
|
308
|
+
const: string | number | boolean;
|
|
309
|
+
title?: string;
|
|
310
|
+
default?: any;
|
|
311
|
+
description?: string;
|
|
312
|
+
markdownDescription?: string;
|
|
313
|
+
definitions?: {
|
|
314
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
315
|
+
} | undefined;
|
|
316
|
+
} | {
|
|
317
|
+
type: "object" | "array";
|
|
318
|
+
title?: string;
|
|
319
|
+
default?: any;
|
|
320
|
+
description?: string;
|
|
321
|
+
markdownDescription?: string;
|
|
322
|
+
definitions?: {
|
|
323
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
324
|
+
} | undefined;
|
|
325
|
+
} | {
|
|
326
|
+
type: "string" | "number" | ["string", "number"];
|
|
327
|
+
enum: (string | number)[];
|
|
328
|
+
title?: string;
|
|
329
|
+
default?: any;
|
|
330
|
+
description?: string;
|
|
331
|
+
markdownDescription?: string;
|
|
332
|
+
definitions?: {
|
|
333
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
334
|
+
} | undefined;
|
|
335
|
+
} | {
|
|
336
|
+
type: "null";
|
|
337
|
+
title?: string;
|
|
338
|
+
default?: any;
|
|
339
|
+
description?: string;
|
|
340
|
+
markdownDescription?: string;
|
|
341
|
+
definitions?: {
|
|
342
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
343
|
+
} | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
type: "object";
|
|
346
|
+
properties: Record<string, import("zod-to-json-schema").JsonSchema7Type>;
|
|
347
|
+
additionalProperties?: boolean | import("zod-to-json-schema").JsonSchema7Type;
|
|
348
|
+
required?: string[];
|
|
349
|
+
title?: string;
|
|
350
|
+
default?: any;
|
|
351
|
+
description?: string;
|
|
352
|
+
markdownDescription?: string;
|
|
353
|
+
definitions?: {
|
|
354
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
355
|
+
} | undefined;
|
|
356
|
+
} | {
|
|
357
|
+
type: "object";
|
|
358
|
+
additionalProperties?: import("zod-to-json-schema").JsonSchema7Type | true;
|
|
359
|
+
propertyNames?: Omit<import("zod-to-json-schema").JsonSchema7StringType, "type"> | Omit<import("zod-to-json-schema").JsonSchema7EnumType, "type">;
|
|
360
|
+
title?: string;
|
|
361
|
+
default?: any;
|
|
362
|
+
description?: string;
|
|
363
|
+
markdownDescription?: string;
|
|
364
|
+
definitions?: {
|
|
365
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
366
|
+
} | undefined;
|
|
367
|
+
} | {
|
|
368
|
+
type: "array";
|
|
369
|
+
minItems: number;
|
|
370
|
+
items: import("zod-to-json-schema").JsonSchema7Type[];
|
|
371
|
+
maxItems: number;
|
|
372
|
+
title?: string;
|
|
373
|
+
default?: any;
|
|
374
|
+
description?: string;
|
|
375
|
+
markdownDescription?: string;
|
|
376
|
+
definitions?: {
|
|
377
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
378
|
+
} | undefined;
|
|
379
|
+
} | {
|
|
380
|
+
type: "array";
|
|
381
|
+
minItems: number;
|
|
382
|
+
items: import("zod-to-json-schema").JsonSchema7Type[];
|
|
383
|
+
additionalItems?: import("zod-to-json-schema").JsonSchema7Type;
|
|
384
|
+
title?: string;
|
|
385
|
+
default?: any;
|
|
386
|
+
description?: string;
|
|
387
|
+
markdownDescription?: string;
|
|
388
|
+
definitions?: {
|
|
389
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
390
|
+
} | undefined;
|
|
391
|
+
} | {
|
|
392
|
+
type: ("string" | "number" | "boolean" | "null" | "integer") | ("string" | "number" | "boolean" | "null" | "integer")[];
|
|
393
|
+
title?: string;
|
|
394
|
+
default?: any;
|
|
395
|
+
description?: string;
|
|
396
|
+
markdownDescription?: string;
|
|
397
|
+
definitions?: {
|
|
398
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
399
|
+
} | undefined;
|
|
400
|
+
} | {
|
|
401
|
+
type: ("string" | "number" | "boolean" | "null" | "integer") | ("string" | "number" | "boolean" | "null" | "integer")[];
|
|
402
|
+
enum: (string | number | bigint | boolean | null)[];
|
|
403
|
+
title?: string;
|
|
404
|
+
default?: any;
|
|
405
|
+
description?: string;
|
|
406
|
+
markdownDescription?: string;
|
|
407
|
+
definitions?: {
|
|
408
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
409
|
+
} | undefined;
|
|
410
|
+
} | {
|
|
411
|
+
anyOf: import("zod-to-json-schema").JsonSchema7Type[];
|
|
412
|
+
title?: string;
|
|
413
|
+
default?: any;
|
|
414
|
+
description?: string;
|
|
415
|
+
markdownDescription?: string;
|
|
416
|
+
definitions?: {
|
|
417
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
418
|
+
} | undefined;
|
|
419
|
+
} | {
|
|
420
|
+
not: import("zod-to-json-schema").JsonSchema7AnyType;
|
|
421
|
+
title?: string;
|
|
422
|
+
default?: any;
|
|
423
|
+
description?: string;
|
|
424
|
+
markdownDescription?: string;
|
|
425
|
+
definitions?: {
|
|
426
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
427
|
+
} | undefined;
|
|
428
|
+
} | {
|
|
429
|
+
$ref: string;
|
|
430
|
+
title?: string;
|
|
431
|
+
default?: any;
|
|
432
|
+
description?: string;
|
|
433
|
+
markdownDescription?: string;
|
|
434
|
+
definitions?: {
|
|
435
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
436
|
+
} | undefined;
|
|
437
|
+
} | {
|
|
438
|
+
not: import("zod-to-json-schema").JsonSchema7AnyType;
|
|
439
|
+
title?: string;
|
|
440
|
+
default?: any;
|
|
441
|
+
description?: string;
|
|
442
|
+
markdownDescription?: string;
|
|
443
|
+
definitions?: {
|
|
444
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
445
|
+
} | undefined;
|
|
446
|
+
} | {
|
|
447
|
+
type: "array";
|
|
448
|
+
maxItems: 125;
|
|
449
|
+
items: {
|
|
450
|
+
type: "array";
|
|
451
|
+
items: [import("zod-to-json-schema").JsonSchema7Type, import("zod-to-json-schema").JsonSchema7Type];
|
|
452
|
+
minItems: 2;
|
|
453
|
+
maxItems: 2;
|
|
454
|
+
};
|
|
455
|
+
title?: string;
|
|
456
|
+
default?: any;
|
|
457
|
+
description?: string;
|
|
458
|
+
markdownDescription?: string;
|
|
459
|
+
definitions?: {
|
|
460
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
461
|
+
} | undefined;
|
|
462
|
+
} | {
|
|
463
|
+
$ref?: string;
|
|
464
|
+
title?: string;
|
|
465
|
+
default?: any;
|
|
466
|
+
description?: string;
|
|
467
|
+
markdownDescription?: string;
|
|
468
|
+
definitions?: {
|
|
469
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
470
|
+
} | undefined;
|
|
471
|
+
} | {
|
|
472
|
+
anyOf: [import("zod-to-json-schema").JsonSchema7Type, import("zod-to-json-schema").JsonSchema7NullType];
|
|
473
|
+
title?: string;
|
|
474
|
+
default?: any;
|
|
475
|
+
description?: string;
|
|
476
|
+
markdownDescription?: string;
|
|
477
|
+
definitions?: {
|
|
478
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
479
|
+
} | undefined;
|
|
480
|
+
} | {
|
|
481
|
+
type: [string, "null"];
|
|
482
|
+
title?: string;
|
|
483
|
+
default?: any;
|
|
484
|
+
description?: string;
|
|
485
|
+
markdownDescription?: string;
|
|
486
|
+
definitions?: {
|
|
487
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
488
|
+
} | undefined;
|
|
489
|
+
} | {
|
|
490
|
+
allOf: import("zod-to-json-schema").JsonSchema7Type[];
|
|
491
|
+
unevaluatedProperties?: boolean;
|
|
492
|
+
title?: string;
|
|
493
|
+
default?: any;
|
|
494
|
+
description?: string;
|
|
495
|
+
markdownDescription?: string;
|
|
496
|
+
definitions?: {
|
|
497
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
498
|
+
} | undefined;
|
|
499
|
+
} | {
|
|
500
|
+
type: "array";
|
|
501
|
+
uniqueItems: true;
|
|
502
|
+
items?: import("zod-to-json-schema").JsonSchema7Type;
|
|
503
|
+
minItems?: number;
|
|
504
|
+
maxItems?: number;
|
|
505
|
+
errorMessage?: import("zod-to-json-schema").ErrorMessages<import("zod-to-json-schema").JsonSchema7SetType>;
|
|
506
|
+
title?: string;
|
|
507
|
+
default?: any;
|
|
508
|
+
description?: string;
|
|
509
|
+
markdownDescription?: string;
|
|
510
|
+
definitions?: {
|
|
511
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
512
|
+
} | undefined;
|
|
513
|
+
};
|
|
514
|
+
annotations: {
|
|
515
|
+
readOnlyHint: boolean;
|
|
516
|
+
idempotentHint: boolean;
|
|
517
|
+
destructiveHint: boolean;
|
|
518
|
+
openWorldHint: boolean;
|
|
519
|
+
};
|
|
520
|
+
risk_lane: "read" | "write";
|
|
521
|
+
}[];
|
|
522
|
+
export declare function validateContextInput(name: string, input: unknown): Record<string, any>;
|
|
523
|
+
export declare const WIKI_DISABLED: {
|
|
524
|
+
readonly ok: false;
|
|
525
|
+
readonly code: "WIKI_DISABLED";
|
|
526
|
+
readonly enabled: false;
|
|
527
|
+
readonly implementation_feature: "003-manual-repo-wiki";
|
|
528
|
+
};
|
|
529
|
+
export declare function contextError(error: unknown): {
|
|
530
|
+
ok: false;
|
|
531
|
+
error: {
|
|
532
|
+
code: string;
|
|
533
|
+
};
|
|
534
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
+
const scope = { device_id: z.string().min(1), cwd: z.string().optional(), project_id: z.string().optional() };
|
|
4
|
+
const strings = z.array(z.string());
|
|
5
|
+
const cap = (maximum, fallback) => z.number().int().min(1).max(maximum).default(fallback).optional();
|
|
6
|
+
export const CONTEXT_INPUTS = {
|
|
7
|
+
local_status: z.object({ ...scope, check_current: z.boolean().optional(), job_id: z.string().optional() }).strict(),
|
|
8
|
+
local_search: z.object({ ...scope, query: z.string().min(1), source_types: z.array(z.enum(['history', 'checkpoint', 'activity'])).optional(), since: z.string().optional(), until: z.string().optional(), limit: cap(50, 8), max_bytes: cap(131072, 32768), cursor: z.string().optional(), include_related: z.boolean().optional() }).strict(),
|
|
9
|
+
local_read: z.object({ ...scope, refs: strings.min(1).max(20), max_bytes: cap(1048576, 262144), cursor: z.string().optional(), ranges: z.array(z.object({ ref: z.string(), start: z.number().int().min(0), end: z.number().int().min(0).optional() }).strict()).max(20).optional() }).strict(),
|
|
10
|
+
local_graph: z.object({ ...scope, action: z.enum(['neighbors', 'path', 'timeline', 'related']), refs: strings, target: z.string().optional(), relations: strings.optional(), direction: z.enum(['in', 'out', 'both']).optional(), max_hops: cap(4, 2), max_nodes: cap(200, 50), max_edges: cap(2000, 500), max_bytes: cap(131072, 65536), wall_ms: cap(100, 25), cursor: z.string().optional() }).strict(),
|
|
11
|
+
local_index: z.object({ ...scope, action: z.enum(['sync', 'checkpoint', 'rebuild', 'cancel']), budget_profile: z.string().optional(), idempotency_key: z.string().optional(), job_id: z.string().optional(), summary: z.string().optional(), evidence_refs: strings.optional() }).strict(),
|
|
12
|
+
local_wiki: z.object({ action: z.enum(['status']) }).strict(),
|
|
13
|
+
};
|
|
14
|
+
export const CONTEXT_TOOL_NAMES = Object.keys(CONTEXT_INPUTS);
|
|
15
|
+
const descriptions = {
|
|
16
|
+
local_status: 'Inspect bounded local context freshness, storage, capture gaps and jobs. No indexing.',
|
|
17
|
+
local_search: 'Search retained history, checkpoints and activity in the published generation. No hidden sync.',
|
|
18
|
+
local_read: 'Read retained evidence in ref order within aggregate byte bounds, never current source substitution.',
|
|
19
|
+
local_graph: 'Query bounded activity/provenance relations, not source-code or causal similarity.',
|
|
20
|
+
local_index: 'Explicit retained-event sync, checkpoint, derived rebuild or job cancel. No destructive administration.',
|
|
21
|
+
local_wiki: 'Reserved disabled wiki status. No provider calls in feature 002.',
|
|
22
|
+
};
|
|
23
|
+
export function buildContextCatalog() {
|
|
24
|
+
return CONTEXT_TOOL_NAMES.map(name => {
|
|
25
|
+
const { $schema: _schema, ...inputSchema } = zodToJsonSchema(CONTEXT_INPUTS[name], { $refStrategy: 'none' });
|
|
26
|
+
return { name, description: descriptions[name], inputSchema, annotations: {
|
|
27
|
+
readOnlyHint: name !== 'local_index', idempotentHint: name !== 'local_index', destructiveHint: false, openWorldHint: false,
|
|
28
|
+
}, risk_lane: name === 'local_index' ? 'write' : 'read' };
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export function validateContextInput(name, input) {
|
|
32
|
+
const schema = CONTEXT_INPUTS[name];
|
|
33
|
+
if (!schema || !schema.safeParse(input).success)
|
|
34
|
+
throw new Error('ACTION_UNSUPPORTED');
|
|
35
|
+
// Validation never materializes schema defaults: preserve CLI/domain defaults.
|
|
36
|
+
return input;
|
|
37
|
+
}
|
|
38
|
+
export const WIKI_DISABLED = { ok: false, code: 'WIKI_DISABLED', enabled: false, implementation_feature: '003-manual-repo-wiki' };
|
|
39
|
+
const SAFE_ERRORS = new Set(['DEVICE_UNSUPPORTED', 'DEVICE_OFFLINE', 'SCOPE_REQUIRED', 'SCOPE_AMBIGUOUS', 'ACCESS_DENIED', 'LOCAL_STATE_UNAVAILABLE', 'REPOSITORY_NOT_FOUND', 'INDEX_MISSING', 'INDEX_INCOMPATIBLE', 'REF_NOT_FOUND', 'EVIDENCE_EXPIRED', 'CURSOR_INVALID', 'CURSOR_STALE', 'BUSY', 'BUDGET_EXCEEDED', 'STORAGE_DEGRADED', 'ACTION_UNSUPPORTED', 'WIKI_DISABLED']);
|
|
40
|
+
export function contextError(error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : '';
|
|
42
|
+
const code = error?.code;
|
|
43
|
+
const safe = SAFE_ERRORS.has(message) ? message : code && SAFE_ERRORS.has(code) ? code : ['EACCES', 'EPERM', 'EROFS', 'ENOTDIR', 'ENOENT'].includes(code ?? '') ? 'LOCAL_STATE_UNAVAILABLE' : 'INTERNAL_ERROR';
|
|
44
|
+
return { ok: false, error: { code: safe } };
|
|
45
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface DeviceCoreOptions {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
/** Must match MCP_DEVICE_CONFIG_DIR before existing Device modules are imported. */
|
|
4
|
+
stateRoot?: string;
|
|
5
|
+
allowedRoots?: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface DeviceCore {
|
|
8
|
+
readonly deviceId: string;
|
|
9
|
+
readonly stateRoot: string;
|
|
10
|
+
readonly runtimeInstanceId: string;
|
|
11
|
+
/** Existing broker capabilities; native tools retain their separate contracts. */
|
|
12
|
+
readonly capabilities: string[];
|
|
13
|
+
invoke(tool: string, args?: unknown): Promise<any>;
|
|
14
|
+
/** The existing rich native surface, without rewriting it into broker arguments. */
|
|
15
|
+
invokeNative(tool: string, args?: unknown): Promise<any>;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The transport-neutral execution owner shared by remote Device and server.
|
|
20
|
+
*
|
|
21
|
+
* No account enrollment, socket, self-MCP child, plugin, or Palace is created
|
|
22
|
+
* here. Authorization belongs to the caller's broker; file/process semantics
|
|
23
|
+
* remain owned by the existing Device handlers and GatewayToolAdapter.
|
|
24
|
+
*
|
|
25
|
+
* Existing native managers are process-scoped. A server must configure its
|
|
26
|
+
* isolated state root before importing them; silently changing a global root
|
|
27
|
+
* after import could write to the user's normal Device state.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createDeviceCore(options: DeviceCoreOptions): Promise<DeviceCore>;
|