impel-cli 0.20.0 → 0.20.2-beta.0

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.
@@ -66,6 +66,7 @@ export function impelCliInvocation(args = [], options = {}) {
66
66
 
67
67
  export const IMPEL_MANAGED_MCP_ENV = brandedEnvironmentName("MANAGED_MCP");
68
68
  export const IMPEL_TASKS_MCP_SERVER_NAME = `${RUNTIME_BRAND.cli.providerId}-tasks`;
69
+ export const IMPEL_NATIVE_AGENT_MCP_TARGET = "native-agent";
69
70
 
70
71
  export function impelMcpInvocation(args = [], options = {}) {
71
72
  return {
@@ -87,11 +88,42 @@ export function impelTasksMcpInvocation(tenantId, options = {}) {
87
88
  return impelMcpInvocation(["--target", "tasks", "--tenant", tenantId], options);
88
89
  }
89
90
 
91
+ /**
92
+ * Build the fixed local composite transport used by one generated native-agent
93
+ * definition. All routing values are process arguments written by impel-cli;
94
+ * the model-facing tools consequently have no agent, scope, or tenant selector.
95
+ */
96
+ export function impelNativeAgentMcpInvocation({
97
+ tenantId,
98
+ agentId,
99
+ scopeParam,
100
+ policyFingerprint,
101
+ recoveryOnly = false,
102
+ }, options = {}) {
103
+ for (const [field, value] of Object.entries({ tenantId, agentId, scopeParam, policyFingerprint })) {
104
+ if (typeof value !== "string" || !value.trim()) {
105
+ throw new Error(`${field} is required for the managed native-agent MCP invocation`);
106
+ }
107
+ }
108
+ return impelMcpInvocation([
109
+ "--target", IMPEL_NATIVE_AGENT_MCP_TARGET,
110
+ "--tenant", tenantId,
111
+ "--agent-id", agentId,
112
+ "--scope-param", scopeParam,
113
+ "--policy-fingerprint", policyFingerprint,
114
+ ...(recoveryOnly ? ["--recovery-only"] : []),
115
+ ], options);
116
+ }
117
+
90
118
  /** Recognize only the marker-bearing Tasks invocation that impel-cli owns. */
91
119
  export function isImpelTasksMcpInvocation(value) {
92
120
  if (!value || typeof value !== "object" || !Array.isArray(value.args)) return false;
93
121
  const suffix = value.args.slice(-5);
94
- return value.type === "stdio"
122
+ // Claude Desktop persists stdio servers without the optional `type` field.
123
+ // Accept that vendor-normalized form so the next Impel update can still
124
+ // recognize, re-pin, and repair its own tenant-bound entry. Any explicit
125
+ // non-stdio type remains foreign and fails closed.
126
+ return (value.type === undefined || value.type === "stdio")
95
127
  && value.env?.[IMPEL_MANAGED_MCP_ENV] === "1"
96
128
  && suffix[0] === "mcp"
97
129
  && suffix[1] === "--target"