@planu/cli 5.7.5 → 5.7.7
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/CHANGELOG.md +88 -0
- package/README.md +3 -3
- package/dist/.planu-build.json +1 -1
- package/dist/cli/commands/package-handoff.js +30 -5
- package/dist/config/compliance-profiles.json +36 -3
- package/dist/config/environment-schema.json +21 -0
- package/dist/config/hook-templates/planu-review-panel-trigger.sh +2 -3
- package/dist/config/hook-templates/planu-session-safeguard.sh +22 -15
- package/dist/config/official-sdd-tools.d.ts +1 -1
- package/dist/config/official-sdd-tools.js +11 -24
- package/dist/config/registries/hosts/codex.json +14 -30
- package/dist/config/registries/hosts/opencode.json +1 -6
- package/dist/config/server-instructions.js +0 -21
- package/dist/config/skill-templates/planu-context-assets.md +3 -6
- package/dist/config/skill-templates/planu-implement.md +2 -2
- package/dist/config/skill-templates/planu-multi-teammate-review.md +8 -12
- package/dist/config/skill-templates/planu-release.md +2 -7
- package/dist/config/skill-templates/planu-validate.md +3 -3
- package/dist/config/spec-templates/crud-rest-api/template.json +5 -1
- package/dist/config/spec-templates/file-upload-s3/template.json +5 -1
- package/dist/config/spec-templates/stripe-payments/template.json +5 -1
- package/dist/config/spec-templates/webhook-system/template.json +5 -1
- package/dist/config/subagent-templates/planu-challenger.md +4 -9
- package/dist/config/subagent-templates/planu-spec-implementer.md +2 -4
- package/dist/config/subagent-templates/planu-validator.md +5 -8
- package/dist/config/tool-groups.json +6 -144
- package/dist/engine/ambiguity-scorer.js +40 -1
- package/dist/engine/autopilot/bootstrap.js +1 -1
- package/dist/engine/code-impact-analyzer.js +2 -6
- package/dist/engine/context-orchestrator/index.js +2 -2
- package/dist/engine/convention-scanner/codebase-scanner.js +2 -2
- package/dist/engine/dogfooding/runtime-gap-detector.js +2 -2
- package/dist/engine/evidence-gates/artifact-reader.d.ts +1 -0
- package/dist/engine/evidence-gates/artifact-reader.js +1 -1
- package/dist/engine/evidence-gates/evidence-autofill.d.ts +13 -5
- package/dist/engine/evidence-gates/evidence-autofill.js +106 -43
- package/dist/engine/evidence-gates/evidence-skeletons.js +3 -1
- package/dist/engine/evidence-gates/lifecycle-gate.js +7 -4
- package/dist/engine/evidence-index/index-builder.js +21 -4
- package/dist/engine/execution/job-runtime.js +1 -1
- package/dist/engine/execution/package-handoff-job-executor.d.ts +22 -0
- package/dist/engine/execution/package-handoff-job-executor.js +490 -0
- package/dist/engine/execution/validate-job-executor.js +20 -8
- package/dist/engine/git/exec-git.d.ts +4 -0
- package/dist/engine/git/exec-git.js +14 -0
- package/dist/engine/handoff-artifacts/implementation-review-reader.js +15 -2
- package/dist/engine/handoff-artifacts/schemas.d.ts +2 -0
- package/dist/engine/handoff-artifacts/schemas.js +1 -0
- package/dist/engine/handoff-format.d.ts +36 -0
- package/dist/engine/handoff-format.js +314 -0
- package/dist/engine/handoff-packager.d.ts +5 -3
- package/dist/engine/handoff-packager.js +89 -32
- package/dist/engine/host-tool-filter.js +20 -49
- package/dist/engine/human-summary.js +14 -3
- package/dist/engine/implementation-contract/common.d.ts +8 -3
- package/dist/engine/implementation-contract/common.js +9 -6
- package/dist/engine/implementation-contract/evaluator.js +4 -6
- package/dist/engine/implementation-contract/renderer.js +18 -23
- package/dist/engine/project-health-checker.js +2 -2
- package/dist/engine/readiness-checker.js +43 -5
- package/dist/engine/reconcile/apply-changes.js +4 -0
- package/dist/engine/reconcile/propagate-mirrors.d.ts +3 -0
- package/dist/engine/reconcile/propagate-mirrors.js +311 -0
- package/dist/engine/self-healing/healer.js +12 -5
- package/dist/engine/self-healing/strategies/lint-fix.d.ts +1 -1
- package/dist/engine/self-healing/strategies/lint-fix.js +4 -1
- package/dist/engine/self-healing/strategies/test-fix.d.ts +4 -3
- package/dist/engine/self-healing/strategies/test-fix.js +32 -14
- package/dist/engine/self-healing/strategies/typescript-fix.d.ts +1 -1
- package/dist/engine/self-healing/strategies/typescript-fix.js +28 -10
- package/dist/engine/session/checkpoint-writer.js +8 -4
- package/dist/engine/session/session-tracker.d.ts +5 -16
- package/dist/engine/session/session-tracker.js +29 -26
- package/dist/engine/session-state/writer.js +3 -11
- package/dist/engine/skill-generator/workflow-skill-generator.d.ts +4 -2
- package/dist/engine/skill-generator/workflow-skill-generator.js +113 -38
- package/dist/engine/spec-format/bdd-parser.d.ts +1 -11
- package/dist/engine/spec-format/bdd-parser.js +40 -11
- package/dist/engine/spec-format/lean-spec-generator.js +32 -12
- package/dist/engine/spec-format/retired-scaffold.d.ts +3 -0
- package/dist/engine/spec-format/retired-scaffold.js +5 -0
- package/dist/engine/spec-format/technical-md-populator.d.ts +1 -0
- package/dist/engine/spec-format/technical-md-populator.js +27 -0
- package/dist/engine/spec-format/unified-spec-builder.d.ts +1 -0
- package/dist/engine/spec-format/unified-spec-builder.js +30 -20
- package/dist/engine/spec-grounding/contract.d.ts +3 -3
- package/dist/engine/spec-grounding/contract.js +65 -4
- package/dist/engine/spec-grounding/grounding-entry-parser.d.ts +5 -0
- package/dist/engine/spec-grounding/grounding-entry-parser.js +185 -0
- package/dist/engine/spec-quality/generic-output-gate.js +37 -3
- package/dist/engine/technical-enricher/index.js +4 -1
- package/dist/engine/type-safety-gate.js +3 -11
- package/dist/engine/universal-rules/catalog.js +0 -2
- package/dist/engine/universal-rules/rules/planu-workflow.js +1 -1
- package/dist/engine/validation/durable-validation.d.ts +3 -2
- package/dist/engine/validation/durable-validation.js +106 -40
- package/dist/engine/validation/validation-freshness.d.ts +3 -2
- package/dist/engine/validation/validation-freshness.js +22 -16
- package/dist/engine/validation/validation-worktree.js +34 -0
- package/dist/hosts/claude-code/ux/mcp-prompts.js +8 -8
- package/dist/index.js +3 -17
- package/dist/resources/process.js +38 -65
- package/dist/storage/session-state-store.js +2 -0
- package/dist/storage/spec-store.js +8 -1
- package/dist/tools/bump-spec-version.js +5 -5
- package/dist/tools/challenge-spec/scenarios-utils.js +2 -2
- package/dist/tools/configure-checkpoint-policy.js +3 -3
- package/dist/tools/create-spec-helpers.js +2 -5
- package/dist/tools/create-spec.js +21 -4
- package/dist/tools/facilitate.js +3 -6
- package/dist/tools/git/branch-ops.js +16 -4
- package/dist/tools/github-release-handler.js +1 -20
- package/dist/tools/init-project/agents-md-writer.js +6 -6
- package/dist/tools/init-project/claude-md-generator.d.ts +0 -1
- package/dist/tools/init-project/claude-md-generator.js +0 -35
- package/dist/tools/init-project/handler.js +7 -5
- package/dist/tools/init-project/per-client-files-writer.js +5 -5
- package/dist/tools/init-project/planu-workflow-generator.js +2 -13
- package/dist/tools/init-project/portable-index-reconciler.d.ts +2 -1
- package/dist/tools/init-project/portable-index-reconciler.js +7 -2
- package/dist/tools/init-project/rules-generator.d.ts +0 -11
- package/dist/tools/init-project/rules-generator.js +4 -85
- package/dist/tools/init-project/scaffold-writer.d.ts +0 -1
- package/dist/tools/init-project/scaffold-writer.js +1 -12
- package/dist/tools/init-project/skills-multi-teammate-review-writer.js +1 -1
- package/dist/tools/jobs/handlers.d.ts +0 -6
- package/dist/tools/jobs/handlers.js +13 -40
- package/dist/tools/list-specs.js +6 -21
- package/dist/tools/multi-teammate-review.js +1 -14
- package/dist/tools/package-handoff.d.ts +3 -2
- package/dist/tools/package-handoff.js +153 -427
- package/dist/tools/reconcile-session-safeguard-hook.js +22 -15
- package/dist/tools/register-platform-tools/design-stack-tools.js +3 -3
- package/dist/tools/register-sdd-tools.js +0 -23
- package/dist/tools/register-spec-tools/analysis-tools.js +22 -9
- package/dist/tools/register-spec-tools/core-spec-tools.js +115 -70
- package/dist/tools/schemas/index.d.ts +1 -1
- package/dist/tools/schemas/index.js +1 -1
- package/dist/tools/schemas/output-schemas.d.ts +1 -18
- package/dist/tools/schemas/output-schemas.js +1 -11
- package/dist/tools/schemas/package-handoff-output-schema.d.ts +40 -0
- package/dist/tools/schemas/package-handoff-output-schema.js +68 -0
- package/dist/tools/schemas/validate-output-schema.d.ts +1 -2
- package/dist/tools/schemas/validate-output-schema.js +3 -2
- package/dist/tools/session-checkpoint.js +2 -2
- package/dist/tools/skill-registry/index.d.ts +0 -1
- package/dist/tools/skill-registry/index.js +0 -1
- package/dist/tools/sync-spec-state-handler.d.ts +2 -2
- package/dist/tools/sync-spec-state-handler.js +23 -3
- package/dist/tools/tool-registry/core-tools.js +72 -164
- package/dist/tools/tool-registry/group-infra.js +2 -39
- package/dist/tools/tool-registry/group-quality-compliance.js +20 -15
- package/dist/tools/tool-registry-helpers.js +6 -2
- package/dist/tools/update-status/batch.js +17 -0
- package/dist/tools/update-status/dod-gates.js +14 -1
- package/dist/tools/update-status/done-receipt-verifier.d.ts +22 -0
- package/dist/tools/update-status/done-receipt-verifier.js +56 -26
- package/dist/tools/update-status/evidence-gate.js +10 -21
- package/dist/tools/update-status/file-sync.d.ts +1 -0
- package/dist/tools/update-status/file-sync.js +6 -0
- package/dist/tools/update-status/index.d.ts +6 -0
- package/dist/tools/update-status/index.js +39 -44
- package/dist/tools/update-status-actions.js +2 -7
- package/dist/tools/validate.js +34 -28
- package/dist/transports/oauth-validator.js +12 -1
- package/dist/transports/transport-factory.d.ts +2 -1
- package/dist/transports/transport-factory.js +19 -0
- package/dist/types/common/primitives.d.ts +2 -0
- package/dist/types/durable-job.d.ts +45 -0
- package/dist/types/durable-validation.d.ts +1 -1
- package/dist/types/evidence-autofill.d.ts +13 -1
- package/dist/types/handoff-artifacts.d.ts +2 -1
- package/dist/types/readiness.d.ts +8 -1
- package/dist/types/reconcile.d.ts +6 -0
- package/dist/types/skill-registry.d.ts +26 -1
- package/dist/types/spec/core.d.ts +5 -0
- package/dist/types/spec/inputs.d.ts +2 -2
- package/dist/types/spec-format.d.ts +11 -1
- package/dist/types/spec-grounding.d.ts +26 -0
- package/dist/types/transport.d.ts +1 -0
- package/dist/types/validation-receipt.d.ts +27 -0
- package/package.json +3 -2
- package/planu-plugin.json +13 -26
- package/src/i18n/messages/en.json +1 -1
- package/src/i18n/messages/es.json +1 -1
- package/src/i18n/messages/pt.json +1 -1
- package/dist/engine/skill-generator/conventions-hasher.d.ts +0 -7
- package/dist/engine/skill-generator/conventions-hasher.js +0 -24
- package/dist/engine/universal-rules/rules/agent-teams.d.ts +0 -3
- package/dist/engine/universal-rules/rules/agent-teams.js +0 -63
- package/dist/tools/clarify-requirements/multiple-choice.d.ts +0 -30
- package/dist/tools/clarify-requirements/multiple-choice.js +0 -306
- package/dist/tools/clarify-requirements/questions-context.d.ts +0 -9
- package/dist/tools/clarify-requirements/questions-context.js +0 -74
- package/dist/tools/clarify-requirements/questions.d.ts +0 -16
- package/dist/tools/clarify-requirements/questions.js +0 -96
- package/dist/tools/clarify-requirements.d.ts +0 -4
- package/dist/tools/clarify-requirements.js +0 -314
- package/dist/tools/code-graph-handler.d.ts +0 -6
- package/dist/tools/code-graph-handler.js +0 -72
- package/dist/tools/create-rule.d.ts +0 -4
- package/dist/tools/create-rule.js +0 -107
- package/dist/tools/feedback-handler.d.ts +0 -7
- package/dist/tools/feedback-handler.js +0 -150
- package/dist/tools/semantic-search-handler.d.ts +0 -7
- package/dist/tools/semantic-search-handler.js +0 -71
- package/dist/tools/skill-registry/search.d.ts +0 -11
- package/dist/tools/skill-registry/search.js +0 -159
- package/dist/tools/tool-registry/deprecated-stubs.d.ts +0 -19
- package/dist/tools/tool-registry/deprecated-stubs.js +0 -65
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// tools/semantic-search-handler.ts — Handler for semantic_search tool.
|
|
2
|
-
// SPEC-075 AC-07: Generates TF-IDF embedding of query, searches backend.
|
|
3
|
-
import { getOrCreateBackend } from '../storage/vector-store/backend-factory.js';
|
|
4
|
-
import { SemanticIndexStore } from '../storage/semantic-index-store.js';
|
|
5
|
-
/**
|
|
6
|
-
* Handle a semantic_search request.
|
|
7
|
-
* Embeds the query with TF-IDF, then searches the vector backend.
|
|
8
|
-
*/
|
|
9
|
-
export async function handleSemanticSearch(args) {
|
|
10
|
-
const { projectId, query, scope = 'all', topK = 5, threshold = 0.3 } = args;
|
|
11
|
-
if (!projectId) {
|
|
12
|
-
return {
|
|
13
|
-
content: [
|
|
14
|
-
{
|
|
15
|
-
type: 'text',
|
|
16
|
-
text: 'Error: No project ID provided. Run init_project first.',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
isError: true,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
const backend = await getOrCreateBackend(projectId);
|
|
23
|
-
// Build a TF-IDF engine from existing documents so IDF is accurate
|
|
24
|
-
const type = scope === 'all' ? undefined : scope;
|
|
25
|
-
const allDocs = await backend.getAll(type);
|
|
26
|
-
if (allDocs.length === 0) {
|
|
27
|
-
return {
|
|
28
|
-
content: [
|
|
29
|
-
{
|
|
30
|
-
type: 'text',
|
|
31
|
-
text: `No documents found in scope "${scope}". Add specs, patterns, or knowledge first.`,
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
// SPEC-1345: load the persisted TF-IDF index for this scope, incrementally
|
|
37
|
-
// reconciled against the current corpus (no full rebuild for unchanged docs).
|
|
38
|
-
const indexStore = new SemanticIndexStore(projectId, scope);
|
|
39
|
-
const tfidf = await indexStore.loadOrBuild(allDocs.map((doc) => ({ id: doc.id, content: doc.content })));
|
|
40
|
-
// Embed the query
|
|
41
|
-
const queryEmbedding = tfidf.embed(query);
|
|
42
|
-
// Search
|
|
43
|
-
const results = await backend.searchSimilar(queryEmbedding, topK, threshold, type);
|
|
44
|
-
if (results.length === 0) {
|
|
45
|
-
return {
|
|
46
|
-
content: [
|
|
47
|
-
{
|
|
48
|
-
type: 'text',
|
|
49
|
-
text: `No results found for "${query}" in scope "${scope}" with threshold ${String(threshold)}. Try a lower threshold or broader scope.`,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
const formatted = results.map((r, i) => {
|
|
55
|
-
const truncated = r.entry.content.length > 200 ? `${r.entry.content.slice(0, 200)}...` : r.entry.content;
|
|
56
|
-
return [
|
|
57
|
-
`${String(i + 1)}. [${r.entry.type}] ${r.entry.id}`,
|
|
58
|
-
` Similarity: ${r.similarity.toFixed(3)}`,
|
|
59
|
-
` ${truncated}`,
|
|
60
|
-
].join('\n');
|
|
61
|
-
});
|
|
62
|
-
return {
|
|
63
|
-
content: [
|
|
64
|
-
{
|
|
65
|
-
type: 'text',
|
|
66
|
-
text: `Found ${String(results.length)} results for "${query}":\n\n${formatted.join('\n\n')}`,
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=semantic-search-handler.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ToolResult, SkillRegistrySource } from '../../types/index.js';
|
|
2
|
-
export declare function loadRegistries(): SkillRegistrySource[];
|
|
3
|
-
export declare function handleSkillSearch(params: {
|
|
4
|
-
query: string;
|
|
5
|
-
registry?: string;
|
|
6
|
-
stack?: string;
|
|
7
|
-
limit?: number;
|
|
8
|
-
/** SPEC-606: Specific sources to search (universal engine). */
|
|
9
|
-
sources?: string[];
|
|
10
|
-
}): Promise<ToolResult>;
|
|
11
|
-
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
// @crash-shield-ignore-file — config/cache reader for Planu-controlled JSON; writer is this codebase, shape guaranteed by build/seed.
|
|
2
|
-
// tools/skill-registry/search.ts — Handler for skill_search tool (SPEC-150, updated SPEC-606)
|
|
3
|
-
import { searchAllRegistries } from '../../engine/skill-registry/index.js';
|
|
4
|
-
import { searchSkillsUniversal } from '../../engine/skill-discovery/index.js';
|
|
5
|
-
import { formatSuccess, toolResult } from '../response-helpers.js';
|
|
6
|
-
import { ti } from '../../i18n/index.js';
|
|
7
|
-
import { readFileSync } from 'node:fs';
|
|
8
|
-
import { join, dirname } from 'node:path';
|
|
9
|
-
import { fileURLToPath } from 'node:url';
|
|
10
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
const DEFAULT_REGISTRIES = [
|
|
12
|
-
{
|
|
13
|
-
id: 'builtin',
|
|
14
|
-
name: 'Planu Built-in Skills',
|
|
15
|
-
url: 'local://skill-catalog',
|
|
16
|
-
type: 'api',
|
|
17
|
-
priority: 0,
|
|
18
|
-
enabled: true,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: 'anthropic',
|
|
22
|
-
name: 'Anthropic Official Skills',
|
|
23
|
-
url: 'https://github.com/anthropics/skills',
|
|
24
|
-
type: 'github',
|
|
25
|
-
priority: 1,
|
|
26
|
-
enabled: true,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'agentskill',
|
|
30
|
-
name: 'AgentSkill.sh',
|
|
31
|
-
url: 'https://agentskill.sh',
|
|
32
|
-
type: 'api',
|
|
33
|
-
priority: 2,
|
|
34
|
-
enabled: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: 'skillssh',
|
|
38
|
-
name: 'Skills.sh',
|
|
39
|
-
url: 'https://skills.sh',
|
|
40
|
-
type: 'npm',
|
|
41
|
-
priority: 3,
|
|
42
|
-
enabled: true,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
export function loadRegistries() {
|
|
46
|
-
// Try compiled path first (dist/config/), then source path (src/config/)
|
|
47
|
-
const compiledPath = join(__dirname, '../../config/skill-registries.json');
|
|
48
|
-
const sourcePath = join(__dirname, '../../../src/config/skill-registries.json');
|
|
49
|
-
for (const configPath of [compiledPath, sourcePath]) {
|
|
50
|
-
let raw;
|
|
51
|
-
try {
|
|
52
|
-
raw = readFileSync(configPath, 'utf-8');
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
// File not found at this path — try next
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (!raw.trim()) {
|
|
59
|
-
// Empty file — skip, try next path
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
return JSON.parse(raw);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
console.warn('[skill_search] skill-registries.json is corrupted, using defaults');
|
|
67
|
-
return DEFAULT_REGISTRIES;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return DEFAULT_REGISTRIES;
|
|
71
|
-
}
|
|
72
|
-
export async function handleSkillSearch(params) {
|
|
73
|
-
try {
|
|
74
|
-
const registries = loadRegistries();
|
|
75
|
-
// Guard: query must be a non-empty string to avoid returning unfiltered catalog dumps
|
|
76
|
-
const query = typeof params.query === 'string' ? params.query.trim() : '';
|
|
77
|
-
if (query.length === 0) {
|
|
78
|
-
return toolResult(formatSuccess('No query provided', 'Provide a search term to find skills. Example: `skill_search({ query: "testing", projectPath: "..." })`'), { results: [], count: 0 });
|
|
79
|
-
}
|
|
80
|
-
const limit = Math.max(1, Math.min(params.limit ?? 10, 50));
|
|
81
|
-
// SPEC-606: When sources are specified, delegate to the universal discovery engine.
|
|
82
|
-
// Otherwise, use the existing registry-based search for backward compatibility.
|
|
83
|
-
if (params.sources && params.sources.length > 0) {
|
|
84
|
-
const universalResults = await searchSkillsUniversal(query, {
|
|
85
|
-
stack: params.stack,
|
|
86
|
-
limit,
|
|
87
|
-
sources: params.sources,
|
|
88
|
-
});
|
|
89
|
-
const lines = [];
|
|
90
|
-
if (universalResults.length === 0) {
|
|
91
|
-
lines.push(`No skills found matching **"${query}"** in sources: ${params.sources.join(', ')}.`);
|
|
92
|
-
lines.push('');
|
|
93
|
-
lines.push('Try a broader query or remove the sources filter.');
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
lines.push('| # | Skill | Source | Description |');
|
|
97
|
-
lines.push('|---|-------|--------|-------------|');
|
|
98
|
-
universalResults.forEach((r, i) => {
|
|
99
|
-
const desc = r.description.length > 80 ? r.description.slice(0, 77) + '...' : r.description;
|
|
100
|
-
lines.push(`| ${String(i + 1)} | **${r.name}** | ${r.source} | ${desc} |`);
|
|
101
|
-
});
|
|
102
|
-
lines.push('');
|
|
103
|
-
lines.push('Install with: `skill_install({ name: "skill-name", projectPath: "..." })`');
|
|
104
|
-
}
|
|
105
|
-
const markdown = formatSuccess(`Found ${String(universalResults.length)} skill${universalResults.length !== 1 ? 's' : ''} (universal search)`, lines.join('\n'));
|
|
106
|
-
return toolResult(markdown, { results: universalResults, count: universalResults.length });
|
|
107
|
-
}
|
|
108
|
-
const searchParams = {
|
|
109
|
-
query,
|
|
110
|
-
registry: params.registry,
|
|
111
|
-
stack: params.stack,
|
|
112
|
-
limit,
|
|
113
|
-
};
|
|
114
|
-
const enabledCount = registries.filter((r) => {
|
|
115
|
-
if (!r.enabled) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
if (searchParams.registry &&
|
|
119
|
-
searchParams.registry !== 'all' &&
|
|
120
|
-
r.id !== searchParams.registry) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
}).length;
|
|
125
|
-
const results = await searchAllRegistries(searchParams, registries);
|
|
126
|
-
const lines = [];
|
|
127
|
-
if (results.length === 0) {
|
|
128
|
-
if (enabledCount === 0) {
|
|
129
|
-
lines.push('No skill registries are enabled. Check your `skill-registries.json` configuration.');
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
lines.push(`No skills found matching **"${query}"**.`);
|
|
133
|
-
lines.push('');
|
|
134
|
-
lines.push('Suggestions:');
|
|
135
|
-
lines.push('- Try a broader search term (e.g., "test" instead of "unit-testing")');
|
|
136
|
-
lines.push('- Omit the `registry` filter to search all registries');
|
|
137
|
-
lines.push('- Check network connectivity to skill registries');
|
|
138
|
-
lines.push('- Use `sources: ["github"]` for broader universal search (SPEC-606)');
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
lines.push('| # | Skill | Source | Description |');
|
|
143
|
-
lines.push('|---|-------|--------|-------------|');
|
|
144
|
-
results.forEach((r, i) => {
|
|
145
|
-
const desc = r.description.length > 80 ? r.description.slice(0, 77) + '...' : r.description;
|
|
146
|
-
lines.push(`| ${String(i + 1)} | **${r.name}** | ${r.source} | ${desc} |`);
|
|
147
|
-
});
|
|
148
|
-
lines.push('');
|
|
149
|
-
lines.push('Install with: `skill_install({ name: "skill-name", projectPath: "..." })`');
|
|
150
|
-
}
|
|
151
|
-
const markdown = formatSuccess(`Found ${String(results.length)} skill${results.length !== 1 ? 's' : ''}`, lines.join('\n'));
|
|
152
|
-
return toolResult(markdown, { results, count: results.length });
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
156
|
-
return toolResult(ti('errors.internalError', { message: msg }) + (msg ? ` ${msg}` : ''), undefined, true);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=search.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { McpToolEntry } from '../tool-entry.js';
|
|
2
|
-
/** Template for the deprecation message. Interpolated at runtime. */
|
|
3
|
-
export declare const DEPRECATION_MESSAGE_TEMPLATE = "This tool has been migrated to a skill. Use the {skill} skill instead: {path}";
|
|
4
|
-
/**
|
|
5
|
-
* The 5 MCP tool names that have been migrated to skills.
|
|
6
|
-
* Used in smoke tests (Scenario 6) and anywhere a guard on migrated tools is needed.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DEPRECATED_TOOLS: readonly ['execute_sdd_flow', 'implement_plan', 'multi_teammate_review', 'run_healing_loop', 'generate_orchestration_plan'];
|
|
9
|
-
export type DeprecatedToolName = (typeof DEPRECATED_TOOLS)[number];
|
|
10
|
-
/**
|
|
11
|
-
* Create a McpToolEntry-compatible deprecation stub.
|
|
12
|
-
*
|
|
13
|
-
* - Tool stays registered → callers never see "unknown tool".
|
|
14
|
-
* - Description starts with `[Deprecated]` → LLMs stop calling it.
|
|
15
|
-
* - Handler always returns success (no `isError`) regardless of input.
|
|
16
|
-
* - One stderr warning per process per tool (deduped).
|
|
17
|
-
*/
|
|
18
|
-
export declare function makeDeprecationStub(toolName: string, replacementSkillPath: string, replacementSkillName: string): McpToolEntry;
|
|
19
|
-
//# sourceMappingURL=deprecated-stubs.d.ts.map
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// tools/tool-registry/deprecated-stubs.ts — Shared factory for MCP deprecation stubs (SPEC-658).
|
|
2
|
-
//
|
|
3
|
-
// Tools migrated to skills stay registered so callers receive a helpful message
|
|
4
|
-
// instead of "unknown tool". The stub handler never throws and always returns
|
|
5
|
-
// HTTP 200 with a plain-text deprecation notice.
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { compactResult } from '../output-formatter.js';
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Constants
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
/** Template for the deprecation message. Interpolated at runtime. */
|
|
12
|
-
export const DEPRECATION_MESSAGE_TEMPLATE = 'This tool has been migrated to a skill. Use the {skill} skill instead: {path}';
|
|
13
|
-
/**
|
|
14
|
-
* The 5 MCP tool names that have been migrated to skills.
|
|
15
|
-
* Used in smoke tests (Scenario 6) and anywhere a guard on migrated tools is needed.
|
|
16
|
-
*/
|
|
17
|
-
export const DEPRECATED_TOOLS = [
|
|
18
|
-
'execute_sdd_flow',
|
|
19
|
-
'implement_plan',
|
|
20
|
-
'multi_teammate_review',
|
|
21
|
-
'run_healing_loop',
|
|
22
|
-
'generate_orchestration_plan',
|
|
23
|
-
];
|
|
24
|
-
// ---------------------------------------------------------------------------
|
|
25
|
-
// Per-process warning dedup (one stderr line per tool name per process)
|
|
26
|
-
// ---------------------------------------------------------------------------
|
|
27
|
-
const _warned = new Set();
|
|
28
|
-
function warnOnce(toolName, skillPath) {
|
|
29
|
-
if (!_warned.has(toolName)) {
|
|
30
|
-
_warned.add(toolName);
|
|
31
|
-
process.stderr.write(`[planu] DEPRECATION: MCP tool "${toolName}" has been migrated to skill "${skillPath}". ` +
|
|
32
|
-
'Update callers to use the skill directly.\n');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// ---------------------------------------------------------------------------
|
|
36
|
-
// Factory
|
|
37
|
-
// ---------------------------------------------------------------------------
|
|
38
|
-
/**
|
|
39
|
-
* Create a McpToolEntry-compatible deprecation stub.
|
|
40
|
-
*
|
|
41
|
-
* - Tool stays registered → callers never see "unknown tool".
|
|
42
|
-
* - Description starts with `[Deprecated]` → LLMs stop calling it.
|
|
43
|
-
* - Handler always returns success (no `isError`) regardless of input.
|
|
44
|
-
* - One stderr warning per process per tool (deduped).
|
|
45
|
-
*/
|
|
46
|
-
export function makeDeprecationStub(toolName, replacementSkillPath, replacementSkillName) {
|
|
47
|
-
const message = DEPRECATION_MESSAGE_TEMPLATE.replace('{skill}', replacementSkillName).replace('{path}', replacementSkillPath);
|
|
48
|
-
return {
|
|
49
|
-
name: toolName,
|
|
50
|
-
description: `[Deprecated] Migrated to ${replacementSkillName} skill. See ${replacementSkillPath}`,
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
52
|
-
schema: z.object({}).passthrough().shape,
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
handler: (_args) => {
|
|
55
|
-
warnOnce(toolName, replacementSkillPath);
|
|
56
|
-
return Promise.resolve(compactResult(message));
|
|
57
|
-
},
|
|
58
|
-
annotations: {
|
|
59
|
-
readOnlyHint: true,
|
|
60
|
-
title: `[Deprecated] ${toolName}`,
|
|
61
|
-
},
|
|
62
|
-
wrap: 'safe',
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=deprecated-stubs.js.map
|