@shrkcrft/mcp-server 0.1.0-alpha.15 → 0.1.0-alpha.17

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.
Files changed (103) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -0
  4. package/dist/server/columnar-format.d.ts +34 -0
  5. package/dist/server/columnar-format.d.ts.map +1 -0
  6. package/dist/server/columnar-format.js +95 -0
  7. package/dist/server/create-mcp-server.d.ts +3 -0
  8. package/dist/server/create-mcp-server.d.ts.map +1 -1
  9. package/dist/server/create-mcp-server.js +5 -2
  10. package/dist/server/fit-array-to-budget.d.ts +24 -0
  11. package/dist/server/fit-array-to-budget.d.ts.map +1 -0
  12. package/dist/server/fit-array-to-budget.js +60 -0
  13. package/dist/server/serialize-tool-data.d.ts +15 -0
  14. package/dist/server/serialize-tool-data.d.ts.map +1 -0
  15. package/dist/server/serialize-tool-data.js +22 -0
  16. package/dist/server/tool-definition.d.ts +15 -0
  17. package/dist/server/tool-definition.d.ts.map +1 -1
  18. package/dist/server/tool-input-validators.d.ts.map +1 -1
  19. package/dist/server/tool-input-validators.js +43 -0
  20. package/dist/tools/agent-brief.tool.d.ts.map +1 -1
  21. package/dist/tools/agent-brief.tool.js +20 -0
  22. package/dist/tools/align-cache.tool.d.ts +11 -0
  23. package/dist/tools/align-cache.tool.d.ts.map +1 -0
  24. package/dist/tools/align-cache.tool.js +76 -0
  25. package/dist/tools/all-tools.d.ts.map +1 -1
  26. package/dist/tools/all-tools.js +7 -0
  27. package/dist/tools/architecture-map.tool.d.ts.map +1 -1
  28. package/dist/tools/architecture-map.tool.js +4 -2
  29. package/dist/tools/code-find-usages.tool.d.ts.map +1 -1
  30. package/dist/tools/code-find-usages.tool.js +15 -10
  31. package/dist/tools/command-catalog.tool.d.ts.map +1 -1
  32. package/dist/tools/command-catalog.tool.js +11 -7
  33. package/dist/tools/compress-context.tool.d.ts +8 -0
  34. package/dist/tools/compress-context.tool.d.ts.map +1 -0
  35. package/dist/tools/compress-context.tool.js +81 -0
  36. package/dist/tools/dashboard-summary.tool.d.ts.map +1 -1
  37. package/dist/tools/dashboard-summary.tool.js +2 -4
  38. package/dist/tools/deps-audit.tool.d.ts.map +1 -1
  39. package/dist/tools/deps-audit.tool.js +36 -2
  40. package/dist/tools/get-code-intelligence-state.tool.d.ts.map +1 -1
  41. package/dist/tools/get-code-intelligence-state.tool.js +8 -7
  42. package/dist/tools/get-graph-callers.tool.d.ts.map +1 -1
  43. package/dist/tools/get-graph-callers.tool.js +9 -8
  44. package/dist/tools/get-graph-context.tool.d.ts.map +1 -1
  45. package/dist/tools/get-graph-context.tool.js +19 -19
  46. package/dist/tools/get-graph-cycles.tool.d.ts.map +1 -1
  47. package/dist/tools/get-graph-cycles.tool.js +11 -10
  48. package/dist/tools/get-graph-impact-analysis.tool.d.ts.map +1 -1
  49. package/dist/tools/get-graph-impact-analysis.tool.js +3 -1
  50. package/dist/tools/get-graph-impact.tool.d.ts.map +1 -1
  51. package/dist/tools/get-graph-impact.tool.js +14 -13
  52. package/dist/tools/get-graph-search.tool.d.ts.map +1 -1
  53. package/dist/tools/get-graph-search.tool.js +9 -8
  54. package/dist/tools/get-graph-unresolved.tool.d.ts.map +1 -1
  55. package/dist/tools/get-graph-unresolved.tool.js +13 -9
  56. package/dist/tools/get-knowledge-graph.tool.d.ts +7 -0
  57. package/dist/tools/get-knowledge-graph.tool.d.ts.map +1 -1
  58. package/dist/tools/get-knowledge-graph.tool.js +62 -3
  59. package/dist/tools/get-relevant-context.tool.d.ts.map +1 -1
  60. package/dist/tools/get-relevant-context.tool.js +30 -6
  61. package/dist/tools/get-task-packet.tool.d.ts.map +1 -1
  62. package/dist/tools/get-task-packet.tool.js +26 -22
  63. package/dist/tools/list-boundary-rules.tool.d.ts.map +1 -1
  64. package/dist/tools/list-boundary-rules.tool.js +20 -16
  65. package/dist/tools/list-knowledge.tool.d.ts.map +1 -1
  66. package/dist/tools/list-knowledge.tool.js +14 -13
  67. package/dist/tools/list-packs.tool.d.ts.map +1 -1
  68. package/dist/tools/list-packs.tool.js +19 -15
  69. package/dist/tools/list-path-conventions.tool.d.ts.map +1 -1
  70. package/dist/tools/list-path-conventions.tool.js +19 -15
  71. package/dist/tools/list-pipelines.tool.d.ts.map +1 -1
  72. package/dist/tools/list-pipelines.tool.js +18 -14
  73. package/dist/tools/list-presets.tool.d.ts.map +1 -1
  74. package/dist/tools/list-presets.tool.js +25 -21
  75. package/dist/tools/list-rules.tool.d.ts.map +1 -1
  76. package/dist/tools/list-rules.tool.js +18 -14
  77. package/dist/tools/list-templates.tool.d.ts.map +1 -1
  78. package/dist/tools/list-templates.tool.js +18 -14
  79. package/dist/tools/primary-tools.d.ts.map +1 -1
  80. package/dist/tools/primary-tools.js +5 -0
  81. package/dist/tools/retrieve-original.tool.d.ts +9 -0
  82. package/dist/tools/retrieve-original.tool.d.ts.map +1 -0
  83. package/dist/tools/retrieve-original.tool.js +47 -0
  84. package/dist/tools/runtime-reports.tool.d.ts.map +1 -1
  85. package/dist/tools/runtime-reports.tool.js +1 -3
  86. package/dist/tools/safety-audit.tool.d.ts.map +1 -1
  87. package/dist/tools/safety-audit.tool.js +1 -4
  88. package/dist/tools/search-knowledge.tool.d.ts.map +1 -1
  89. package/dist/tools/search-knowledge.tool.js +17 -13
  90. package/dist/tools/search.tool.d.ts.map +1 -1
  91. package/dist/tools/search.tool.js +11 -8
  92. package/dist/tools/smart-context-bundle.tool.d.ts.map +1 -1
  93. package/dist/tools/smart-context-bundle.tool.js +4 -2
  94. package/package.json +27 -26
  95. package/dist/tools/r22-extras.tool.d.ts +0 -4
  96. package/dist/tools/r22-extras.tool.d.ts.map +0 -1
  97. package/dist/tools/r22-extras.tool.js +0 -42
  98. package/dist/tools/r26-ingest.tool.d.ts +0 -10
  99. package/dist/tools/r26-ingest.tool.d.ts.map +0 -1
  100. package/dist/tools/r26-ingest.tool.js +0 -174
  101. package/dist/tools/r34-search-unified.tool.d.ts +0 -3
  102. package/dist/tools/r34-search-unified.tool.d.ts.map +0 -1
  103. package/dist/tools/r34-search-unified.tool.js +0 -38
@@ -1,19 +1,23 @@
1
+ import { FORMAT_INPUT_PROPERTY, formatRows } from "../server/columnar-format.js";
1
2
  export const listRulesTool = {
2
3
  name: 'list_rules',
3
- description: 'List all rules with compact metadata.',
4
- inputSchema: { type: 'object', properties: {}, additionalProperties: false },
5
- async handler(_input, ctx) {
4
+ description: 'List all rules with compact metadata. Pass `format:"table"` for a token-efficient columnar payload.',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: { ...FORMAT_INPUT_PROPERTY },
8
+ additionalProperties: false,
9
+ },
10
+ async handler(input, ctx) {
6
11
  const rules = ctx.inspection.ruleService.list();
7
- return {
8
- data: rules.map((r) => ({
9
- id: r.id,
10
- title: r.title,
11
- priority: r.priority,
12
- tags: r.tags,
13
- scope: r.scope,
14
- appliesWhen: r.appliesWhen,
15
- summary: r.summary,
16
- })),
17
- };
12
+ const rows = rules.map((r) => ({
13
+ id: r.id,
14
+ title: r.title,
15
+ priority: r.priority,
16
+ tags: r.tags,
17
+ scope: r.scope,
18
+ appliesWhen: r.appliesWhen,
19
+ summary: r.summary,
20
+ }));
21
+ return { data: formatRows(rows, input) };
18
22
  },
19
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"list-templates.tool.d.ts","sourceRoot":"","sources":["../../src/tools/list-templates.tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,iBAAiB,EAAE,eAkB/B,CAAC"}
1
+ {"version":3,"file":"list-templates.tool.d.ts","sourceRoot":"","sources":["../../src/tools/list-templates.tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,eAAO,MAAM,iBAAiB,EAAE,eAqB/B,CAAC"}
@@ -1,19 +1,23 @@
1
+ import { FORMAT_INPUT_PROPERTY, formatRows } from "../server/columnar-format.js";
1
2
  export const listTemplatesTool = {
2
3
  name: 'list_templates',
3
- description: 'List available generator templates.',
4
- inputSchema: { type: 'object', properties: {}, additionalProperties: false },
5
- async handler(_input, ctx) {
4
+ description: 'List available generator templates. Pass `format:"table"` for a token-efficient columnar payload.',
5
+ inputSchema: {
6
+ type: 'object',
7
+ properties: { ...FORMAT_INPUT_PROPERTY },
8
+ additionalProperties: false,
9
+ },
10
+ async handler(input, ctx) {
6
11
  const templates = ctx.inspection.templateRegistry.list();
7
- return {
8
- data: templates.map((t) => ({
9
- id: t.id,
10
- name: t.name,
11
- description: t.description,
12
- tags: t.tags,
13
- scope: t.scope,
14
- appliesWhen: t.appliesWhen,
15
- variableCount: t.variables.length,
16
- })),
17
- };
12
+ const rows = templates.map((t) => ({
13
+ id: t.id,
14
+ name: t.name,
15
+ description: t.description,
16
+ tags: t.tags,
17
+ scope: t.scope,
18
+ appliesWhen: t.appliesWhen,
19
+ variableCount: t.variables.length,
20
+ }));
21
+ return { data: formatRows(rows, input) };
18
22
  },
19
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"primary-tools.d.ts","sourceRoot":"","sources":["../../src/tools/primary-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CA4ChD,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAGpD"}
1
+ {"version":3,"file":"primary-tools.d.ts","sourceRoot":"","sources":["../../src/tools/primary-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAiDhD,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAGpD"}
@@ -58,6 +58,11 @@ export const PRIMARY_MCP_TOOLS = new Set([
58
58
  'search_all',
59
59
  'search_knowledge',
60
60
  'search_commands',
61
+ // Token compression (deterministic, reversible)
62
+ 'compress_context',
63
+ 'retrieve_original',
64
+ 'align_cache',
65
+ 'restore_cache',
61
66
  ]);
62
67
  /**
63
68
  * Should `tools/list` advertise the full catalog instead of the
@@ -0,0 +1,9 @@
1
+ import type { IToolDefinition } from '../server/tool-definition.js';
2
+ /**
3
+ * The retrieve half of Compress-Cache-Retrieve. Given a `<<ccr:KEY>>` key
4
+ * emitted by `compress_context`, return the full uncompressed original. Reads
5
+ * from the server's in-memory store only — never the filesystem — so it stays
6
+ * read-only.
7
+ */
8
+ export declare const retrieveOriginalTool: IToolDefinition;
9
+ //# sourceMappingURL=retrieve-original.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retrieve-original.tool.d.ts","sourceRoot":"","sources":["../../src/tools/retrieve-original.tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAyClC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The retrieve half of Compress-Cache-Retrieve. Given a `<<ccr:KEY>>` key
3
+ * emitted by `compress_context`, return the full uncompressed original. Reads
4
+ * from the server's in-memory store only — never the filesystem — so it stays
5
+ * read-only.
6
+ */
7
+ export const retrieveOriginalTool = {
8
+ name: 'retrieve_original',
9
+ description: 'Retrieve the full, uncompressed original that `compress_context` cached, by its `<<ccr:KEY>>` key. The reverse of compression — use it when a compressed blob elided a detail you now need. Cache lives for the MCP server session. Read-only.',
10
+ inputSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ key: { type: 'string', description: 'The CCR key from a `<<ccr:KEY>>` marker.' },
14
+ },
15
+ required: ['key'],
16
+ additionalProperties: false,
17
+ },
18
+ handler(input, ctx) {
19
+ const key = typeof input.key === 'string' ? input.key.trim() : '';
20
+ if (key.length === 0) {
21
+ return {
22
+ isError: true,
23
+ text: 'retrieve_original requires a "key".',
24
+ error: { code: 'invalid-input', message: 'key is required' },
25
+ };
26
+ }
27
+ if (!ctx.ccrStore) {
28
+ return {
29
+ isError: true,
30
+ text: 'No CCR store is wired on this server.',
31
+ error: { code: 'unavailable', message: 'ccr store not available' },
32
+ };
33
+ }
34
+ const entry = ctx.ccrStore.get(key);
35
+ if (!entry) {
36
+ return {
37
+ isError: true,
38
+ text: `No cached original for key "${key}". It may have been evicted (cache is bounded) or never existed in this session.`,
39
+ error: { code: 'cache-miss', message: `unknown ccr key ${key}` },
40
+ };
41
+ }
42
+ return {
43
+ data: { key: entry.key, bytes: entry.bytes, content: entry.content },
44
+ text: entry.content,
45
+ };
46
+ },
47
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-reports.tool.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-reports.tool.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAYpE,eAAO,MAAM,qBAAqB,EAAE,eAsBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAsBtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAgBtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAqBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAqCrC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,eAU3C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAUxC,CAAC"}
1
+ {"version":3,"file":"runtime-reports.tool.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-reports.tool.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAYpE,eAAO,MAAM,qBAAqB,EAAE,eAsBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAsBtC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,eAgBtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAqBrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAqCrC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,eAU3C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAUxC,CAAC"}
@@ -6,8 +6,6 @@
6
6
  import { existsSync, readFileSync } from 'node:fs';
7
7
  import * as nodePath from 'node:path';
8
8
  import { buildAdoptionReport, buildCoverageReport, buildDriftReport, buildOnboardingAdoptionPlan, buildOnboardingPlan, buildQualityReport, buildSafetyAudit, readAdoptionState, renderAdoptionReportHtml, renderAdoptionReportMarkdown, renderAdoptionReportText, renderDevSessionHtml, renderDevSessionFinalReport, renderReviewComment, renderReviewHtml, renderQualityHtml, renderSafetyHtml, scanDevSession, } from '@shrkcrft/inspector';
9
- // DX#4 — derive audit view from ALL_TOOLS at runtime.
10
- import { ALL_TOOLS } from "./all-tools.js";
11
9
  function pickFormat(input, fallback = 'json') {
12
10
  const f = String(input.format ?? fallback).toLowerCase();
13
11
  if (f === 'text' || f === 'markdown' || f === 'html' || f === 'json')
@@ -95,7 +93,7 @@ export const getSafetyHtmlReportTool = {
95
93
  const audit = buildSafetyAudit({
96
94
  inspection: ctx.inspection,
97
95
  catalog: [],
98
- mcpTools: ALL_TOOLS.map((t) => ({ name: t.name, description: t.description, canWrite: false })),
96
+ mcpTools: (ctx.allTools ?? []).map((t) => ({ name: t.name, description: t.description, canWrite: false })),
99
97
  planSecretEnv: 'SHARKCRAFT_PLAN_SECRET',
100
98
  planSecretConfigured: typeof process.env.SHARKCRAFT_PLAN_SECRET === 'string' && process.env.SHARKCRAFT_PLAN_SECRET.length > 0,
101
99
  });
@@ -1 +1 @@
1
- {"version":3,"file":"safety-audit.tool.d.ts","sourceRoot":"","sources":["../../src/tools/safety-audit.tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQpE,eAAO,MAAM,kBAAkB,EAAE,eAqChC,CAAC"}
1
+ {"version":3,"file":"safety-audit.tool.d.ts","sourceRoot":"","sources":["../../src/tools/safety-audit.tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKpE,eAAO,MAAM,kBAAkB,EAAE,eAqChC,CAAC"}
@@ -1,7 +1,4 @@
1
1
  import { buildSafetyAudit } from '@shrkcrft/inspector';
2
- // DX#4 — derive the audit list at runtime from ALL_TOOLS instead of
3
- // maintaining a parallel static list.
4
- import { ALL_TOOLS } from "./all-tools.js";
5
2
  import { COMMAND_CATALOG_EXPORT } from "./command-catalog.tool.js";
6
3
  const PLAN_SECRET_ENV = 'SHARKCRAFT_PLAN_SECRET';
7
4
  export const getSafetyAuditTool = {
@@ -26,7 +23,7 @@ export const getSafetyAuditTool = {
26
23
  requiresReview: e.requiresReview,
27
24
  mcpAvailable: e.mcpAvailable,
28
25
  }));
29
- const mcpTools = ALL_TOOLS.map((t) => ({
26
+ const mcpTools = (ctx.allTools ?? []).map((t) => ({
30
27
  name: t.name,
31
28
  description: t.description,
32
29
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"search-knowledge.tool.d.ts","sourceRoot":"","sources":["../../src/tools/search-knowledge.tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,eAAO,MAAM,mBAAmB,EAAE,eAwCjC,CAAC"}
1
+ {"version":3,"file":"search-knowledge.tool.d.ts","sourceRoot":"","sources":["../../src/tools/search-knowledge.tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIpE,eAAO,MAAM,mBAAmB,EAAE,eA4CjC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { searchKnowledge } from '@shrkcrft/knowledge';
2
+ import { FORMAT_INPUT_PROPERTY, formatRows } from "../server/columnar-format.js";
2
3
  export const searchKnowledgeTool = {
3
4
  name: 'search_knowledge',
4
- description: 'Search knowledge entries by query/tags/types/scope/appliesWhen.',
5
+ description: 'Search knowledge entries by query/tags/types/scope/appliesWhen. Pass `format:"table"` for a token-efficient columnar payload.',
5
6
  inputSchema: {
6
7
  type: 'object',
7
8
  properties: {
@@ -12,6 +13,7 @@ export const searchKnowledgeTool = {
12
13
  appliesWhen: { type: 'array', items: { type: 'string' } },
13
14
  minPriority: { type: 'string' },
14
15
  limit: { type: 'integer', minimum: 1 },
16
+ ...FORMAT_INPUT_PROPERTY,
15
17
  },
16
18
  additionalProperties: false,
17
19
  },
@@ -26,17 +28,19 @@ export const searchKnowledgeTool = {
26
28
  minPriority: typeof input.minPriority === 'string' ? input.minPriority : undefined,
27
29
  limit,
28
30
  });
29
- return {
30
- data: results.map((r) => ({
31
- id: r.entry.id,
32
- title: r.entry.title,
33
- score: r.score,
34
- type: r.entry.type,
35
- priority: r.entry.priority,
36
- tags: r.entry.tags,
37
- scope: r.entry.scope,
38
- reasons: r.reasons,
39
- })),
40
- };
31
+ const rows = results.map((r) => ({
32
+ id: r.entry.id,
33
+ title: r.entry.title,
34
+ score: r.score,
35
+ type: r.entry.type,
36
+ priority: r.entry.priority,
37
+ tags: r.entry.tags,
38
+ scope: r.entry.scope,
39
+ reasons: r.reasons,
40
+ }));
41
+ // `format:"table"` columnar-encodes the homogeneous hit rows; scalars and
42
+ // string-array cells (tags/scope/reasons) reconstruct losslessly. Default
43
+ // (no format / format:"json") returns the bare array unchanged.
44
+ return { data: formatRows(rows, input) };
41
45
  },
42
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../src/tools/search.tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,eA0C3B,CAAC"}
1
+ {"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../src/tools/search.tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,eAAO,MAAM,aAAa,EAAE,eA4C3B,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { buildSearchIndex, loadConstructs, loadPlaybooks, searchIndex, SearchKind, SearchSource, } from '@shrkcrft/inspector';
2
+ import { FORMAT_INPUT_PROPERTY, formatObjectArrays } from "../server/columnar-format.js";
2
3
  export const searchAllTool = {
3
4
  name: 'search_all',
4
- description: 'Unified, deterministic search across knowledge, rules, paths, templates, pipelines, presets, packs, boundaries, docs, sessions, bundles, constructs, and playbooks. No AI / embeddings — pure ranking. Read-only.',
5
+ description: 'Unified, deterministic search across knowledge, rules, paths, templates, pipelines, presets, packs, boundaries, docs, sessions, bundles, constructs, and playbooks. No AI / embeddings — pure ranking. Pass `format:"table"` for a token-efficient columnar encoding of the `hits` array. Read-only.',
5
6
  inputSchema: {
6
7
  type: 'object',
7
8
  required: ['query'],
@@ -11,6 +12,7 @@ export const searchAllTool = {
11
12
  sources: { type: 'array', items: { type: 'string' } },
12
13
  limit: { type: 'number' },
13
14
  explain: { type: 'boolean' },
15
+ ...FORMAT_INPUT_PROPERTY,
14
16
  },
15
17
  additionalProperties: false,
16
18
  },
@@ -33,13 +35,14 @@ export const searchAllTool = {
33
35
  if (sources.length > 0)
34
36
  opts.sources = sources;
35
37
  const result = searchIndex(index, opts);
36
- return {
37
- data: {
38
- query: result.query,
39
- total: result.total,
40
- truncated: result.truncated,
41
- hits: result.hits,
42
- },
38
+ const data = {
39
+ query: result.query,
40
+ total: result.total,
41
+ truncated: result.truncated,
42
+ hits: result.hits,
43
43
  };
44
+ // `format:"table"` columnar-encodes the homogeneous `hits` array; the
45
+ // scalar fields (query/total/truncated) pass through untouched.
46
+ return { data: formatObjectArrays(data, input) };
44
47
  },
45
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"smart-context-bundle.tool.d.ts","sourceRoot":"","sources":["../../src/tools/smart-context-bundle.tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,eA6EpC,CAAC"}
1
+ {"version":3,"file":"smart-context-bundle.tool.d.ts","sourceRoot":"","sources":["../../src/tools/smart-context-bundle.tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAiFpC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { buildTaskPacket } from '@shrkcrft/inspector';
2
2
  import { SemanticIndex, TaskType, buildFocusedContext, classifyTask, parseTaskTypeOverride, } from '@shrkcrft/embeddings';
3
+ import { FORMAT_INPUT_PROPERTY, formatObjectArrays } from "../server/columnar-format.js";
3
4
  /**
4
5
  * `smart_context_bundle` — read-only MCP surface for the focused
5
6
  * context bundle that `shrk smart-context --focused` builds.
@@ -23,6 +24,7 @@ export const smartContextBundleTool = {
23
24
  task: { type: 'string' },
24
25
  taskType: { type: 'string' },
25
26
  maxBlocks: { type: 'number' },
27
+ ...FORMAT_INPUT_PROPERTY,
26
28
  },
27
29
  required: ['task'],
28
30
  additionalProperties: false,
@@ -70,14 +72,14 @@ export const smartContextBundleTool = {
70
72
  confidence: classification.confidence,
71
73
  signals: classification.signals.slice(0, 6),
72
74
  },
73
- focused: {
75
+ focused: formatObjectArrays({
74
76
  model: focused.model,
75
77
  approxTokens: focused.approxTokens,
76
78
  files: focused.files,
77
79
  rules: focused.rules,
78
80
  docHits: focused.docHits,
79
81
  verificationCommands: focused.verificationCommands,
80
- },
82
+ }, input),
81
83
  nextCommands: nextCommandHints(task, classification.type),
82
84
  notes: [
83
85
  'This bundle is read-only. To turn the recommended MVP into starter files, the human should run `shrk smart-context "<task>" --focused --plan --save` followed by `shrk spike <slug>`.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrkcrft/mcp-server",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.17",
4
4
  "description": "SharkCraft MCP server: 25 tools over @modelcontextprotocol/sdk's stdio transport.",
5
5
  "license": "MIT",
6
6
  "author": "SharkCraft contributors",
@@ -44,31 +44,32 @@
44
44
  "typecheck": "tsc --noEmit -p tsconfig.json"
45
45
  },
46
46
  "dependencies": {
47
- "@shrkcrft/core": "^0.1.0-alpha.15",
48
- "@shrkcrft/config": "^0.1.0-alpha.15",
49
- "@shrkcrft/workspace": "^0.1.0-alpha.15",
50
- "@shrkcrft/knowledge": "^0.1.0-alpha.15",
51
- "@shrkcrft/context": "^0.1.0-alpha.15",
52
- "@shrkcrft/rules": "^0.1.0-alpha.15",
53
- "@shrkcrft/paths": "^0.1.0-alpha.15",
54
- "@shrkcrft/templates": "^0.1.0-alpha.15",
55
- "@shrkcrft/pipelines": "^0.1.0-alpha.15",
56
- "@shrkcrft/presets": "^0.1.0-alpha.15",
57
- "@shrkcrft/boundaries": "^0.1.0-alpha.15",
58
- "@shrkcrft/graph": "^0.1.0-alpha.15",
59
- "@shrkcrft/rule-graph": "^0.1.0-alpha.15",
60
- "@shrkcrft/structural-search": "^0.1.0-alpha.15",
61
- "@shrkcrft/impact-engine": "^0.1.0-alpha.15",
62
- "@shrkcrft/context-planner": "^0.1.0-alpha.15",
63
- "@shrkcrft/architecture-guard": "^0.1.0-alpha.15",
64
- "@shrkcrft/framework-scanners": "^0.1.0-alpha.15",
65
- "@shrkcrft/api-surface-diff": "^0.1.0-alpha.15",
66
- "@shrkcrft/quality-gates": "^0.1.0-alpha.15",
67
- "@shrkcrft/migrate": "^0.1.0-alpha.15",
68
- "@shrkcrft/packs": "^0.1.0-alpha.15",
69
- "@shrkcrft/generator": "^0.1.0-alpha.15",
70
- "@shrkcrft/inspector": "^0.1.0-alpha.15",
71
- "@shrkcrft/embeddings": "^0.1.0-alpha.15",
47
+ "@shrkcrft/core": "^0.1.0-alpha.17",
48
+ "@shrkcrft/compress": "^0.1.0-alpha.17",
49
+ "@shrkcrft/config": "^0.1.0-alpha.17",
50
+ "@shrkcrft/workspace": "^0.1.0-alpha.17",
51
+ "@shrkcrft/knowledge": "^0.1.0-alpha.17",
52
+ "@shrkcrft/context": "^0.1.0-alpha.17",
53
+ "@shrkcrft/rules": "^0.1.0-alpha.17",
54
+ "@shrkcrft/paths": "^0.1.0-alpha.17",
55
+ "@shrkcrft/templates": "^0.1.0-alpha.17",
56
+ "@shrkcrft/pipelines": "^0.1.0-alpha.17",
57
+ "@shrkcrft/presets": "^0.1.0-alpha.17",
58
+ "@shrkcrft/boundaries": "^0.1.0-alpha.17",
59
+ "@shrkcrft/graph": "^0.1.0-alpha.17",
60
+ "@shrkcrft/rule-graph": "^0.1.0-alpha.17",
61
+ "@shrkcrft/structural-search": "^0.1.0-alpha.17",
62
+ "@shrkcrft/impact-engine": "^0.1.0-alpha.17",
63
+ "@shrkcrft/context-planner": "^0.1.0-alpha.17",
64
+ "@shrkcrft/architecture-guard": "^0.1.0-alpha.17",
65
+ "@shrkcrft/framework-scanners": "^0.1.0-alpha.17",
66
+ "@shrkcrft/api-surface-diff": "^0.1.0-alpha.17",
67
+ "@shrkcrft/quality-gates": "^0.1.0-alpha.17",
68
+ "@shrkcrft/migrate": "^0.1.0-alpha.17",
69
+ "@shrkcrft/packs": "^0.1.0-alpha.17",
70
+ "@shrkcrft/generator": "^0.1.0-alpha.17",
71
+ "@shrkcrft/inspector": "^0.1.0-alpha.17",
72
+ "@shrkcrft/embeddings": "^0.1.0-alpha.17",
72
73
  "@modelcontextprotocol/sdk": "^1.0.0",
73
74
  "zod": "^3.25.0 || ^4.0.0"
74
75
  },
@@ -1,4 +0,0 @@
1
- import type { IToolDefinition } from '../server/tool-definition.js';
2
- export declare const getMigrationReadinessTool: IToolDefinition;
3
- export declare const listMigrationProfilesTool: IToolDefinition;
4
- //# sourceMappingURL=r22-extras.tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"r22-extras.tool.d.ts","sourceRoot":"","sources":["../../src/tools/r22-extras.tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,yBAAyB,EAAE,eAuBvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,eAevC,CAAC"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Migration / readiness MCP tools. All read-only.
3
- */
4
- import { buildMigrationReadiness, listMigrationProfiles, listMigrationProfilesFromPacks, } from '@shrkcrft/inspector';
5
- export const getMigrationReadinessTool = {
6
- name: 'get_migration_readiness',
7
- description: 'Migration readiness verdict for a profile id. Read-only — probes local files and env vars; never runs source.',
8
- inputSchema: {
9
- type: 'object',
10
- properties: {
11
- profileId: { type: 'string' },
12
- },
13
- required: ['profileId'],
14
- additionalProperties: false,
15
- },
16
- async handler(input, ctx) {
17
- const profileId = typeof input['profileId'] === 'string' ? input['profileId'] : '';
18
- const packProfiles = await listMigrationProfilesFromPacks(ctx.inspection);
19
- const report = buildMigrationReadiness({
20
- profileId,
21
- projectRoot: ctx.inspection.projectRoot,
22
- customProfiles: packProfiles,
23
- });
24
- return { data: report };
25
- },
26
- };
27
- export const listMigrationProfilesTool = {
28
- name: 'list_migration_profiles',
29
- description: 'List registered migration profiles (built-in + pack-contributed). Read-only.',
30
- inputSchema: { type: 'object', properties: {}, additionalProperties: false },
31
- async handler(_input, ctx) {
32
- const packProfiles = await listMigrationProfilesFromPacks(ctx.inspection);
33
- const profiles = listMigrationProfiles(packProfiles).map((p) => ({
34
- id: p.id,
35
- title: p.title,
36
- description: p.description,
37
- successVerdict: p.successVerdict,
38
- checks: p.checks.length,
39
- }));
40
- return { data: profiles };
41
- },
42
- };
@@ -1,10 +0,0 @@
1
- import type { IToolDefinition } from '../server/tool-definition.js';
2
- export declare const createRepositoryIngestionPlanTool: IToolDefinition;
3
- export declare const getRepositoryKnowledgeModelTool: IToolDefinition;
4
- export declare const getRepositoryIngestionStatusTool: IToolDefinition;
5
- export declare const getRepositoryIngestionReportTool: IToolDefinition;
6
- export declare const getContradictionReportTool: IToolDefinition;
7
- export declare const getGeneratedCodeReportTool: IToolDefinition;
8
- export declare const getStabilityMapTool: IToolDefinition;
9
- export declare const getIngestAdoptionPreviewTool: IToolDefinition;
10
- //# sourceMappingURL=r26-ingest.tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"r26-ingest.tool.d.ts","sourceRoot":"","sources":["../../src/tools/r26-ingest.tool.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAyBpE,eAAO,MAAM,iCAAiC,EAAE,eA4B/C,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,eAyB7C,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,eAiB9C,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,eAiB9C,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAWxC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,eAWxC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAejC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,eAY1C,CAAC"}