Skip to content

improvement(mship): add enrichment tool, clean up dead tools - #5058

Merged
Sg312 merged 6 commits into
stagingfrom
dev
Jun 15, 2026
Merged

improvement(mship): add enrichment tool, clean up dead tools#5058
Sg312 merged 6 commits into
stagingfrom
dev

Conversation

@Sg312

@Sg312Sg312 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds enrichment tool, cleans up dead tools

Type of Change

  • Other

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sg312 added 5 commits June 14, 2026 22:27
Implement the Sim-side handler for the copilot enrichment_run tool: runs the
enrichment provider cascade for a single entity and returns the result inline,
surfacing the hosted-key cost as _serviceCost for per-round billing (matching
the media tools). Registered in the server-tool router.
Regenerate the copilot tool catalog/schemas to include enrichment_run.
touch_plan was removed from the copilot tool catalog earlier, but the Sim side
still referenced it. Regenerating the generated tool catalog (for enrichment_run)
synced it to the current contract and dropped the stale TouchPlan export, which
broke the build where router.ts still imported it.
Remove the dead touch_plan server tool and its test, drop its router
registration and WRITE_ACTIONS entry, simplify getServerToolRegistry (no more
beta-gated server tools), and clean up stale "use touch_plan" guidance strings.
@vercel

vercelBot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
docsReadyReadyPreview, CommentJun 15, 2026 5:51pm

Request Review

@greptile-apps

greptile-appsBot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a new enrichment_run copilot tool that performs a one-off entity enrichment lookup (work email, phone number, company domain/info, email verification) using the same provider cascade as table enrichments, and cleans up the now-dead touch_plan tool along with its associated catalog entries, schemas, test file, and stale build scripts.

  • New enrichment_run tool: registered in the server tool registry with WRITE_ACTIONS['*'], matching the billing model of the media tools; surfaces _serviceCost for hosted-key charging and gates on workspaceId before execution.
  • touch_plan removal: server tool, catalog entry, runtime schema, test file, and the "Create the plan with touch_plan first." error hint in resource-writer.ts are all removed together; the underlying VFS plan-alias backing logic in resource-writer.ts is untouched.
  • Housekeeping: dead trace-contracts:generate/check npm scripts and sync-request-trace-contract.ts removed; VFS path examples in ffmpeg/function_execute/generate_* tool descriptions simplified to drop the deleted .plans alias examples.

Confidence Score: 5/5

Safe to merge — the new enrichment tool is fully gated behind write permission and correctly wired into the billing path; the touch_plan removal is complete across all layers.

The write-permission gate for the cost-incurring enrichment_run tool is properly set in WRITE_ACTIONS, matching the pattern of the existing media tools. The touch_plan cleanup is thorough: catalog entry, runtime schema, server tool, test file, error message reference, and build scripts are all removed consistently. No partial deletions or dangling references were found.

No files require special attention.

Important Files Changed

FilenameOverview
apps/sim/lib/copilot/tools/server/enrichment/enrichment-run.tsNew server tool implementing a one-off enrichment lookup; correctly validates workspaceId, delegates to the shared runEnrichment cascade, and surfaces _serviceCost for billing.
apps/sim/lib/copilot/tools/server/router.tsenrichmentRunServerTool registered in both the tool registry and WRITE_ACTIONS with ['*'], correctly requiring write permission for every invocation and matching the billing model of the media tools.
apps/sim/lib/copilot/generated/tool-catalog-v1.tsAdds EnrichmentRun catalog entry (requiredPermission: 'write') and removes the TouchPlan entry; VFS path examples for ffmpeg/function_execute/generate_* simplified to drop the deleted .plans alias examples.
apps/sim/lib/copilot/generated/tool-schemas-v1.tsAdds enrichment_run runtime schema (matching the catalog), removes touch_plan schema, and reformats all object keys to bracket notation (generated-file housekeeping).
apps/sim/lib/copilot/vfs/resource-writer.tsError message for a missing plan backing directory updated to remove the now-deleted touch_plan reference; plan alias resolution logic itself is unchanged.
scripts/generate-mship-contracts.tsDead sync-request-trace-contract.ts script removed from the GENERATORS list; FORMAT_EXCLUDE set and runCheck logic otherwise unchanged.
package.jsonRemoves trace-contracts:generate and trace-contracts:check scripts that pointed at the now-deleted sync-request-trace-contract.ts.

Sequence Diagram

sequenceDiagram
participant LLM as Copilot LLM
participant Router as ServerToolRouter
participant WA as WRITE_ACTIONS check
participant Tool as enrichmentRunServerTool
participant Reg as getEnrichment()
participant Run as runEnrichment()
LLM->>Router: "routeExecution("enrichment_run", {enrichmentId, inputs})"
Router->>WA: isWriteAction("enrichment_run", action)
WA-->>Router: "true (wildcard *)"
Router->>Router: isWritePermission(context.userPermission)?
alt "userPermission != write/admin"
Router-->>LLM: Error: Permission denied
else has write permission
Router->>Router: validateGeneratedToolPayload(params)
Router->>Tool: "execute({enrichmentId, inputs}, context)"
Tool->>Tool: validate workspaceId
Tool->>Reg: getEnrichment(enrichmentId)
Reg-->>Tool: enrichment config
Tool->>Run: "runEnrichment(enrichment, inputs, {workspaceId})"
Run-->>Tool: "{result, cost, error, provider}"
alt all providers failed
Tool-->>Router: throw Error(error)
else matched or no-match
Tool-->>Router: "{matched, result, provider, _serviceCost?}"
end
Router->>Router: validateGeneratedToolPayload(result, resultSchema)
Router-->>LLM: "{success: true, result}"
end
Loading

Reviews (2): Last reviewed commit: "fix(contracts): fix mship contracts" | Re-trigger Greptile

Comment threadapps/sim/lib/copilot/tools/server/router.ts
@Sg312

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@Sg312
Sg312 merged commit cefb2dc into stagingJun 15, 2026
27 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Sg312