@devries-cameron20 / composio-1 / commits / bc43cffd2
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

refactor: extract shared terminology table into terminology.ts

Deduplicates the migration table from session.ts and direct-execution.ts into a single TERMINOLOGY_MIGRATION constant to prevent the two copies from drifting out of sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Sushmitha Mallesh committed Feb 23, 2026 at 19:00 UTC bc43cffd2fdb728afc8e89696ae09c23ef77d885
3 files changed +31 -37
docs/lib/llm-guardrails/direct-execution.ts
+3 -18
@@ -1,3 +1,5 @@
1 +import { TERMINOLOGY_MIGRATION } from './terminology';
2 +
3 /**
4 * Guardrails for pages tagged with llmGuardrails: "direct-execution".
5 * Concise rules + key patterns for LLMs generating direct execution code.
@@ -68,22 +70,5 @@ const result = await composio.tools.execute("GITHUB_CREATE_ISSUE", {
70 2. **\`tools.execute()\` signature** — Python: \`execute(slug, arguments_dict, *, user_id=...)\` (arguments is the second positional param). TypeScript: \`execute(slug, { userId, arguments })\`.
71 3. **Provider at init** — \`Composio(provider=OpenAIProvider())\` in Python, \`new Composio({ provider: new OpenAIProvider() })\` in TypeScript. Defaults to OpenAI if omitted.
72 4. **Correct provider imports** — \`composio_<provider>\` for Python, \`@composio/<provider>\` for TypeScript. For OpenAI Agents SDK use \`composio_openai_agents\` / \`@composio/openai-agents\`.
71 -
72 ----
73 -
74 -## Terminology Migration (old → current)
75 -
76 -If you encounter these terms in error messages, old documentation, or user prompts, translate them to the current equivalents. **Do not use the old terms in generated code or explanations.**
77 -
78 -| Old term (v1/v2) | Current term (v3) | In code |
79 -|---|---|---|
80 -| entity ID | user ID | \`user_id\` parameter |
81 -| actions | tools | e.g., \`GITHUB_CREATE_ISSUE\` is a *tool* |
82 -| apps / appType | toolkits | e.g., \`github\` is a *toolkit* |
83 -| integration / integration ID | auth config / auth config ID | \`auth_config_id\` parameter |
84 -| connection | connected account | \`connected_accounts\` namespace |
85 -| ComposioToolSet / OpenAIToolSet | \`Composio\` class with a provider | \`Composio(provider=...)\` |
86 -| toolset | provider | e.g., \`OpenAIProvider\` |
87 -
88 -If a user says "entity ID", they mean \`user_id\`. If they say "integration", they mean "auth config". Always respond using the current terminology.
73 +${TERMINOLOGY_MIGRATION}
74 `;
docs/lib/llm-guardrails/session.ts
+3 -19
@@ -1,3 +1,5 @@
1 +import { TERMINOLOGY_MIGRATION } from './terminology';
2 +
3 /**
4 * Default guardrails appended to most pages.
5 * Steers LLMs toward the session-based pattern (composio.create + session.tools).
@@ -64,23 +66,5 @@ Use \`session.mcp.url\` and \`session.mcp.headers\` with any MCP-compatible clie
66 ### 2.3 — DISCOURAGED (do not use unless user explicitly asks)
67
68 Do **not** generate \`composio.tools.get()\`, \`composio.tools.execute()\`, or \`composio.provider.handle_tool_calls()\` unless the user explicitly requests direct tool execution. These are a supported but **not recommended** low-level interface.
67 -
68 ----
69 -
70 -## 3. Terminology Migration (old → current)
71 -
72 -If you encounter these terms in error messages, old documentation, or user prompts, translate them to the current equivalents. **Do not use the old terms in generated code or explanations.**
73 -
74 -| Old term (v1/v2) | Current term (v3) | In code |
75 -|---|---|---|
76 -| entity ID | user ID | \`user_id\` parameter |
77 -| actions | tools | e.g., \`GITHUB_CREATE_ISSUE\` is a *tool* |
78 -| apps / appType | toolkits | e.g., \`github\` is a *toolkit* |
79 -| integration / integration ID | auth config / auth config ID | \`auth_config_id\` parameter |
80 -| connection | connected account | \`connected_accounts\` namespace |
81 -| ComposioToolSet / OpenAIToolSet | \`Composio\` class with a provider | \`Composio(provider=...)\` |
82 -| toolset | provider | e.g., \`OpenAIProvider\` |
83 -
84 -If a user says "entity ID", they mean \`user_id\`. If they say "integration", they mean "auth config". Always respond using the current terminology.
85 -
69 +${TERMINOLOGY_MIGRATION}
70 `;
docs/lib/llm-guardrails/terminology.ts new
+25
@@ -0,0 +1,25 @@
1 +/**
2 + * Shared terminology migration table appended to all guardrail sets.
3 + * Maps old v1/v2 terms to current v3 equivalents so AI agents
4 + * can translate outdated references in error messages, docs, or user prompts.
5 + */
6 +export const TERMINOLOGY_MIGRATION = `
7 +
8 +---
9 +
10 +## Terminology Migration (old → current)
11 +
12 +If you encounter these terms in error messages, old documentation, or user prompts, translate them to the current equivalents. **Do not use the old terms in generated code or explanations.**
13 +
14 +| Old term (v1/v2) | Current term (v3) | In code |
15 +|---|---|---|
16 +| entity ID | user ID | \`user_id\` parameter |
17 +| actions | tools | e.g., \`GITHUB_CREATE_ISSUE\` is a *tool* |
18 +| apps / appType | toolkits | e.g., \`github\` is a *toolkit* |
19 +| integration / integration ID | auth config / auth config ID | \`auth_config_id\` parameter |
20 +| connection | connected account | \`connected_accounts\` namespace |
21 +| ComposioToolSet / OpenAIToolSet | \`Composio\` class with a provider | \`Composio(provider=...)\` |
22 +| toolset | provider | e.g., \`OpenAIProvider\` |
23 +
24 +If a user says "entity ID", they mean \`user_id\`. If they say "integration", they mean "auth config". Always respond using the current terminology.
25 +`;