aai-gateway 0.7.0 → 0.7.2
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/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as logger, h as createDesktopDiscovery, m as AAI_GATEWAY_VERSION, n as createGatewayServer, r as createCliCallerContextFromEnv } from "./server-
|
|
2
|
+
import { _ as logger, h as createDesktopDiscovery, m as AAI_GATEWAY_VERSION, n as createGatewayServer, r as createCliCallerContextFromEnv } from "./server-CFf-3AEY.js";
|
|
3
3
|
//#region src/cli.ts
|
|
4
4
|
function parseArgs(args) {
|
|
5
5
|
const dev = args.includes("--dev");
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as logger, a as SkillExecutor, b as createConsentDialog, c as getMcpExecutor, d as getCliExecutor, f as AcpExecutor, g as SimpleCache, h as createDesktopDiscovery, i as createSecureStorage, l as FileRegistry, m as AAI_GATEWAY_VERSION, n as createGatewayServer, o as getSkillExecutor, p as getAcpExecutor, s as McpExecutor, t as AaiGatewayServer, u as CliExecutor, v as parseAaiJson, x as AaiError, y as ConsentManager } from "./server-
|
|
1
|
+
import { _ as logger, a as SkillExecutor, b as createConsentDialog, c as getMcpExecutor, d as getCliExecutor, f as AcpExecutor, g as SimpleCache, h as createDesktopDiscovery, i as createSecureStorage, l as FileRegistry, m as AAI_GATEWAY_VERSION, n as createGatewayServer, o as getSkillExecutor, p as getAcpExecutor, s as McpExecutor, t as AaiGatewayServer, u as CliExecutor, v as parseAaiJson, x as AaiError, y as ConsentManager } from "./server-CFf-3AEY.js";
|
|
2
2
|
//#region src/executors/registry.ts
|
|
3
3
|
/**
|
|
4
4
|
* Executor Registry
|
|
@@ -1641,8 +1641,8 @@ function formatValidationErrors(result) {
|
|
|
1641
1641
|
var ACP_INITIALIZE_TIMEOUT_MS = 3e4;
|
|
1642
1642
|
var ACP_SESSION_TIMEOUT_MS = 3e4;
|
|
1643
1643
|
var ACP_POLL_WAIT_MS = 3e4;
|
|
1644
|
-
var ACP_TURN_INACTIVITY_TIMEOUT_MS =
|
|
1645
|
-
var ACP_TURN_TTL_MS =
|
|
1644
|
+
var ACP_TURN_INACTIVITY_TIMEOUT_MS = 10 * 6e4;
|
|
1645
|
+
var ACP_TURN_TTL_MS = 15 * 6e4;
|
|
1646
1646
|
var ACP_MAX_OUTPUT_CHARS = 2e5;
|
|
1647
1647
|
function toToolSchemaReference(schema) {
|
|
1648
1648
|
return {
|
|
@@ -4134,7 +4134,6 @@ var TEMPLATE_GUIDE_TOOL_SUMMARY = `{{LOCALIZED_NAME}}. {{SUMMARY}} Guide tool, n
|
|
|
4134
4134
|
var TEMPLATE_APP_GUIDE = `# {{LOCALIZED_NAME}}
|
|
4135
4135
|
|
|
4136
4136
|
- App ID: {{LOCAL_ID}}
|
|
4137
|
-
- Protocol: {{PROTOCOL}}
|
|
4138
4137
|
- Summary: {{SUMMARY}}
|
|
4139
4138
|
|
|
4140
4139
|
## Tools
|
|
@@ -4142,10 +4141,7 @@ var TEMPLATE_APP_GUIDE = `# {{LOCALIZED_NAME}}
|
|
|
4142
4141
|
{{TOOLS}}
|
|
4143
4142
|
|
|
4144
4143
|
{{EXAMPLES_SECTION}}{{NOTES_SECTION}}`;
|
|
4145
|
-
var TEMPLATE_TOOL_ITEM =
|
|
4146
|
-
|
|
4147
|
-
{{DESCRIPTION}}
|
|
4148
|
-
`;
|
|
4144
|
+
var TEMPLATE_TOOL_ITEM = `- {{NAME}}: {{DESCRIPTION}}`;
|
|
4149
4145
|
function generateGuideToolSummary(_appId, descriptor) {
|
|
4150
4146
|
const params = {
|
|
4151
4147
|
LOCALIZED_NAME: getEnglishName(descriptor.app.name),
|
|
@@ -4171,7 +4167,6 @@ function generateAppGuideMarkdown(appId, descriptor, capabilities) {
|
|
|
4171
4167
|
return renderTemplate(TEMPLATE_APP_GUIDE, {
|
|
4172
4168
|
LOCALIZED_NAME: localizedName,
|
|
4173
4169
|
LOCAL_ID: appId,
|
|
4174
|
-
PROTOCOL: protocol,
|
|
4175
4170
|
SUMMARY: descriptor.exposure.summary,
|
|
4176
4171
|
TOOLS: toolsSection,
|
|
4177
4172
|
EXAMPLES_SECTION: examplesSection ? `\n## Examples\n\nExecute via \`aai:exec\` with \`app: "${appId}"\`:\n\n${examplesSection}\n` : "",
|
|
@@ -4180,10 +4175,18 @@ function generateAppGuideMarkdown(appId, descriptor, capabilities) {
|
|
|
4180
4175
|
}
|
|
4181
4176
|
function buildToolsSection(capabilities) {
|
|
4182
4177
|
if (capabilities.tools.length === 0) return "No tools available.";
|
|
4183
|
-
return capabilities.tools.map((tool) =>
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4178
|
+
return capabilities.tools.map((tool) => {
|
|
4179
|
+
const desc = tool.description?.trim();
|
|
4180
|
+
const shortDesc = desc ? truncateDescription(desc) : "No description provided.";
|
|
4181
|
+
return renderTemplate(TEMPLATE_TOOL_ITEM, {
|
|
4182
|
+
NAME: tool.name,
|
|
4183
|
+
DESCRIPTION: shortDesc
|
|
4184
|
+
});
|
|
4185
|
+
}).join("\n");
|
|
4186
|
+
}
|
|
4187
|
+
function truncateDescription(desc) {
|
|
4188
|
+
const firstSentence = desc.split(/(?<=[.!?])\s/)[0];
|
|
4189
|
+
return firstSentence.length <= 120 ? firstSentence : `${firstSentence.slice(0, 117)}...`;
|
|
4187
4190
|
}
|
|
4188
4191
|
function buildExamplesSection(protocol, capabilities) {
|
|
4189
4192
|
switch (protocol) {
|
|
@@ -4197,7 +4200,7 @@ function buildExamplesSection(protocol, capabilities) {
|
|
|
4197
4200
|
function buildNotesSection(protocol, descriptor) {
|
|
4198
4201
|
switch (protocol) {
|
|
4199
4202
|
case "mcp": return ["Execute via `aai:exec` with the app id above.", "If a call fails validation, the error response includes the correct schema."].join("\n");
|
|
4200
|
-
case "acp-agent": return
|
|
4203
|
+
case "acp-agent": return "session/new returns promptCapabilities. turn/start.prompt must match those capabilities.";
|
|
4201
4204
|
case "skill": return ["Execute via `aai:exec` with the app id above.", buildSkillDirSection(descriptor)].join("\n");
|
|
4202
4205
|
case "cli": return "Pass args.argv as a string array and args.stdin as optional text.";
|
|
4203
4206
|
default: return "";
|
|
@@ -4211,20 +4214,19 @@ function buildAcpExamples(capabilities) {
|
|
|
4211
4214
|
return capabilities.tools.map((tool) => {
|
|
4212
4215
|
const example = buildAcpExample(tool.name);
|
|
4213
4216
|
if (!example) return "";
|
|
4214
|
-
return
|
|
4217
|
+
return renderExampleJson(example);
|
|
4215
4218
|
}).filter(Boolean).join("\n\n");
|
|
4216
4219
|
}
|
|
4217
4220
|
function buildSkillExamples(capabilities) {
|
|
4218
4221
|
if (!capabilities.tools.some((tool) => tool.name === "read")) return "";
|
|
4219
|
-
return
|
|
4222
|
+
return renderExampleJson({
|
|
4220
4223
|
tool: "read",
|
|
4221
4224
|
args: {}
|
|
4222
4225
|
});
|
|
4223
4226
|
}
|
|
4224
4227
|
function buildCliExamples(capabilities) {
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
tool: primaryTool,
|
|
4228
|
+
return renderExampleJson({
|
|
4229
|
+
tool: capabilities.tools.find((tool) => tool.name === "run")?.name ?? "run",
|
|
4228
4230
|
args: { argv: ["--help"] }
|
|
4229
4231
|
});
|
|
4230
4232
|
}
|
|
@@ -4266,10 +4268,8 @@ function buildAcpExample(toolName) {
|
|
|
4266
4268
|
default: return null;
|
|
4267
4269
|
}
|
|
4268
4270
|
}
|
|
4269
|
-
function
|
|
4271
|
+
function renderExampleJson(payload) {
|
|
4270
4272
|
return [
|
|
4271
|
-
`### ${name}`,
|
|
4272
|
-
"",
|
|
4273
4273
|
"```json",
|
|
4274
4274
|
JSON.stringify(payload, null, 2),
|
|
4275
4275
|
"```"
|
|
@@ -6072,4 +6072,4 @@ function formatToolPreview(tools) {
|
|
|
6072
6072
|
//#endregion
|
|
6073
6073
|
export { logger as _, SkillExecutor as a, createConsentDialog as b, getMcpExecutor as c, getCliExecutor as d, AcpExecutor as f, SimpleCache as g, createDesktopDiscovery as h, createSecureStorage as i, FileRegistry as l, AAI_GATEWAY_VERSION as m, createGatewayServer as n, getSkillExecutor as o, getAcpExecutor as p, createCliCallerContextFromEnv as r, McpExecutor as s, AaiGatewayServer as t, CliExecutor as u, parseAaiJson as v, AaiError as x, ConsentManager as y };
|
|
6074
6074
|
|
|
6075
|
-
//# sourceMappingURL=server-
|
|
6075
|
+
//# sourceMappingURL=server-CFf-3AEY.js.map
|