impel-cli 0.20.1 → 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.
- package/package.json +1 -1
- package/src/agents.js +409 -184
- package/src/apps.js +5 -3
- package/src/commands/mcp.js +167 -2
- package/src/nativeAgentTransport.js +1962 -0
- package/src/selfInvocation.js +28 -0
package/src/selfInvocation.js
CHANGED
|
@@ -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,6 +88,33 @@ 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;
|