mulesoft-anypoint-cli-agent-fabric-plugin 1.2.11 → 1.3.1-beta
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/LICENSE.txt +89 -0
- package/README.md +177 -31
- package/bin/run +6 -0
- package/dist/commands/agent-network/project/agent-console.d.ts +16 -0
- package/dist/commands/agent-network/project/agent-console.js +175 -0
- package/dist/commands/agent-network/project/agent-console.js.map +1 -0
- package/dist/commands/agent-network/project/broker/create.d.ts +10 -0
- package/dist/commands/agent-network/project/broker/create.js +192 -0
- package/dist/commands/agent-network/project/broker/create.js.map +1 -0
- package/dist/commands/agent-network/project/build.d.ts +1 -1
- package/dist/commands/agent-network/project/build.js +8 -3
- package/dist/commands/agent-network/project/build.js.map +1 -1
- package/dist/commands/agent-network/project/create.d.ts +13 -1
- package/dist/commands/agent-network/project/create.js +56 -14
- package/dist/commands/agent-network/project/create.js.map +1 -1
- package/dist/commands/agent-network/project/deploy.d.ts +25 -15
- package/dist/commands/agent-network/project/deploy.js +238 -181
- package/dist/commands/agent-network/project/deploy.js.map +1 -1
- package/dist/commands/agent-network/project/export-logs.d.ts +11 -0
- package/dist/commands/agent-network/project/export-logs.js +38 -0
- package/dist/commands/agent-network/project/export-logs.js.map +1 -0
- package/dist/commands/agent-network/project/mcp/introspect.js +13 -5
- package/dist/commands/agent-network/project/mcp/introspect.js.map +1 -1
- package/dist/commands/agent-network/project/publish.d.ts +1 -1
- package/dist/commands/agent-network/project/publish.js +9 -4
- package/dist/commands/agent-network/project/publish.js.map +1 -1
- package/dist/commands/agent-network/project/run-local.d.ts +85 -0
- package/dist/commands/agent-network/project/run-local.js +825 -0
- package/dist/commands/agent-network/project/run-local.js.map +1 -0
- package/dist/commands/agent-network/project/secrets.d.ts +21 -0
- package/dist/commands/agent-network/project/secrets.js +163 -0
- package/dist/commands/agent-network/project/secrets.js.map +1 -0
- package/dist/commands/agent-network/project/stop-local.d.ts +11 -0
- package/dist/commands/agent-network/project/stop-local.js +38 -0
- package/dist/commands/agent-network/project/stop-local.js.map +1 -0
- package/dist/commands/agent-network/project/undeploy.d.ts +3 -2
- package/dist/commands/agent-network/project/undeploy.js +66 -40
- package/dist/commands/agent-network/project/undeploy.js.map +1 -1
- package/dist/commands/agent-network/project/unpublish.d.ts +12 -3
- package/dist/commands/agent-network/project/unpublish.js +212 -62
- package/dist/commands/agent-network/project/unpublish.js.map +1 -1
- package/dist/commands/agent-network/setup/dependencies.js +5 -0
- package/dist/commands/agent-network/setup/dependencies.js.map +1 -1
- package/dist/commands/agent-network/setup/gateways.d.ts +4 -1
- package/dist/commands/agent-network/setup/gateways.js +74 -6
- package/dist/commands/agent-network/setup/gateways.js.map +1 -1
- package/dist/errors/base-error.js +5 -0
- package/dist/errors/base-error.js.map +1 -1
- package/dist/errors/error-factory.d.ts +53 -12
- package/dist/errors/error-factory.js +261 -36
- package/dist/errors/error-factory.js.map +1 -1
- package/dist/helpers/connection-id.js +5 -0
- package/dist/helpers/connection-id.js.map +1 -1
- package/dist/helpers/connection.js +5 -0
- package/dist/helpers/connection.js.map +1 -1
- package/dist/helpers/dependency-manager.js +8 -3
- package/dist/helpers/dependency-manager.js.map +1 -1
- package/dist/helpers/entitlement-utils.js +5 -0
- package/dist/helpers/entitlement-utils.js.map +1 -1
- package/dist/helpers/policy-helper.js +8 -3
- package/dist/helpers/policy-helper.js.map +1 -1
- package/dist/helpers/project/api-project-dependency-fetcher.js +5 -0
- package/dist/helpers/project/api-project-dependency-fetcher.js.map +1 -1
- package/dist/helpers/project/constants.d.ts +1 -0
- package/dist/helpers/project/constants.js +6 -0
- package/dist/helpers/project/constants.js.map +1 -1
- package/dist/helpers/project/debug-messages.js +5 -0
- package/dist/helpers/project/debug-messages.js.map +1 -1
- package/dist/helpers/project/templates.js +5 -0
- package/dist/helpers/project/templates.js.map +1 -1
- package/dist/helpers/project/uris.js +5 -0
- package/dist/helpers/project/uris.js.map +1 -1
- package/dist/helpers/project/validation-commons.js +5 -0
- package/dist/helpers/project/validation-commons.js.map +1 -1
- package/dist/helpers/proxy-agent.d.ts +2 -0
- package/dist/helpers/proxy-agent.js +26 -0
- package/dist/helpers/proxy-agent.js.map +1 -0
- package/dist/helpers/request-logging.js +6 -1
- package/dist/helpers/request-logging.js.map +1 -1
- package/dist/helpers/request-utils.d.ts +2 -1
- package/dist/helpers/request-utils.js +7 -2
- package/dist/helpers/request-utils.js.map +1 -1
- package/dist/helpers/types.js +5 -0
- package/dist/helpers/types.js.map +1 -1
- package/dist/helpers/utils.d.ts +17 -1
- package/dist/helpers/utils.js +32 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/agent-console.html +478 -0
- package/dist/resources/schemas/broker-deployment-settings.schema.json +46 -0
- package/dist/types/agent-network-v2.d.ts +4 -0
- package/dist/types/agent-network-v2.js +5 -0
- package/dist/types/agent-network-v2.js.map +1 -1
- package/dist/types/agent-network.js +5 -0
- package/dist/types/agent-network.js.map +1 -1
- package/dist/types/types.d.ts +31 -34
- package/dist/types/types.js +5 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/access-management.js +5 -0
- package/dist/utils/access-management.js.map +1 -1
- package/dist/utils/builders/builder.js +5 -0
- package/dist/utils/builders/builder.js.map +1 -1
- package/dist/utils/builders/common/agent-metadata.js +5 -0
- package/dist/utils/builders/common/agent-metadata.js.map +1 -1
- package/dist/utils/builders/common/asset-file-resolver.js +5 -0
- package/dist/utils/builders/common/asset-file-resolver.js.map +1 -1
- package/dist/utils/builders/common/connection-facet-helpers.js +5 -0
- package/dist/utils/builders/common/connection-facet-helpers.js.map +1 -1
- package/dist/utils/builders/common/connection-metadata.js +5 -0
- package/dist/utils/builders/common/connection-metadata.js.map +1 -1
- package/dist/utils/builders/common/network-builder-helpers.js +5 -0
- package/dist/utils/builders/common/network-builder-helpers.js.map +1 -1
- package/dist/utils/builders/common/network-metadata.js +5 -0
- package/dist/utils/builders/common/network-metadata.js.map +1 -1
- package/dist/utils/builders/common/registry-entry.js +5 -0
- package/dist/utils/builders/common/registry-entry.js.map +1 -1
- package/dist/utils/builders/common/types.js +5 -0
- package/dist/utils/builders/common/types.js.map +1 -1
- package/dist/utils/builders/component-factory.d.ts +2 -0
- package/dist/utils/builders/component-factory.js +24 -0
- package/dist/utils/builders/component-factory.js.map +1 -0
- package/dist/utils/builders/local-space-resolver.d.ts +18 -0
- package/dist/utils/builders/local-space-resolver.js +43 -0
- package/dist/utils/builders/local-space-resolver.js.map +1 -0
- package/dist/utils/builders/network-lock.d.ts +2 -0
- package/dist/utils/builders/network-lock.js +56 -6
- package/dist/utils/builders/network-lock.js.map +1 -1
- package/dist/utils/builders/policies-factory.d.ts +5 -1
- package/dist/utils/builders/policies-factory.js +15 -2
- package/dist/utils/builders/policies-factory.js.map +1 -1
- package/dist/utils/builders/project-builder-impl.d.ts +17 -3
- package/dist/utils/builders/project-builder-impl.js +34 -1
- package/dist/utils/builders/project-builder-impl.js.map +1 -1
- package/dist/utils/builders/project-builder.d.ts +31 -3
- package/dist/utils/builders/project-builder.js +15 -2
- package/dist/utils/builders/project-builder.js.map +1 -1
- package/dist/utils/builders/remote-space-resolver.d.ts +5 -1
- package/dist/utils/builders/remote-space-resolver.js +120 -45
- package/dist/utils/builders/remote-space-resolver.js.map +1 -1
- package/dist/utils/builders/space-serializer.js +8 -1
- package/dist/utils/builders/space-serializer.js.map +1 -1
- package/dist/utils/builders/stage-diagnostics.d.ts +2 -0
- package/dist/utils/builders/stage-diagnostics.js +27 -0
- package/dist/utils/builders/stage-diagnostics.js.map +1 -0
- package/dist/utils/builders/tooling-metadata.d.ts +4 -4
- package/dist/utils/builders/tooling-metadata.js +32 -15
- package/dist/utils/builders/tooling-metadata.js.map +1 -1
- package/dist/utils/builders/v1/agent-builder.js +5 -0
- package/dist/utils/builders/v1/agent-builder.js.map +1 -1
- package/dist/utils/builders/v1/broker-builder.js +5 -0
- package/dist/utils/builders/v1/broker-builder.js.map +1 -1
- package/dist/utils/builders/v1/connections-builder.js +5 -0
- package/dist/utils/builders/v1/connections-builder.js.map +1 -1
- package/dist/utils/builders/v1/llm-builder.js +5 -0
- package/dist/utils/builders/v1/llm-builder.js.map +1 -1
- package/dist/utils/builders/v1/mcp-builder.js +5 -0
- package/dist/utils/builders/v1/mcp-builder.js.map +1 -1
- package/dist/utils/builders/v1/network-builder.js +7 -1
- package/dist/utils/builders/v1/network-builder.js.map +1 -1
- package/dist/utils/builders/v1/path.js +5 -0
- package/dist/utils/builders/v1/path.js.map +1 -1
- package/dist/utils/builders/v2/agent-builder.js +5 -0
- package/dist/utils/builders/v2/agent-builder.js.map +1 -1
- package/dist/utils/builders/v2/broker-builder.d.ts +1 -0
- package/dist/utils/builders/v2/broker-builder.js +74 -4
- package/dist/utils/builders/v2/broker-builder.js.map +1 -1
- package/dist/utils/builders/v2/connections-builder.js +5 -0
- package/dist/utils/builders/v2/connections-builder.js.map +1 -1
- package/dist/utils/builders/v2/llm-builder.js +5 -0
- package/dist/utils/builders/v2/llm-builder.js.map +1 -1
- package/dist/utils/builders/v2/mcp-builder.js +5 -0
- package/dist/utils/builders/v2/mcp-builder.js.map +1 -1
- package/dist/utils/builders/v2/network-builder.js +8 -3
- package/dist/utils/builders/v2/network-builder.js.map +1 -1
- package/dist/utils/builders/v2/path.js +5 -0
- package/dist/utils/builders/v2/path.js.map +1 -1
- package/dist/utils/constants.d.ts +3 -2
- package/dist/utils/constants.js +13 -5
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/deployment-settings.d.ts +13 -0
- package/dist/utils/deployment-settings.js +97 -0
- package/dist/utils/deployment-settings.js.map +1 -0
- package/dist/utils/dry-run/dry-run-render.d.ts +19 -0
- package/dist/utils/dry-run/dry-run-render.js +137 -0
- package/dist/utils/dry-run/dry-run-render.js.map +1 -0
- package/dist/utils/exchange.js +5 -0
- package/dist/utils/exchange.js.map +1 -1
- package/dist/utils/facets/abstract-facet.d.ts +1 -0
- package/dist/utils/facets/abstract-facet.js +8 -0
- package/dist/utils/facets/abstract-facet.js.map +1 -1
- package/dist/utils/facets/agent-graph-facet.d.ts +14 -1
- package/dist/utils/facets/agent-graph-facet.js +139 -53
- package/dist/utils/facets/agent-graph-facet.js.map +1 -1
- package/dist/utils/facets/api-instance-facet.d.ts +37 -3
- package/dist/utils/facets/api-instance-facet.js +221 -65
- package/dist/utils/facets/api-instance-facet.js.map +1 -1
- package/dist/utils/facets/apim-policy-helpers.d.ts +13 -12
- package/dist/utils/facets/apim-policy-helpers.js +34 -22
- package/dist/utils/facets/apim-policy-helpers.js.map +1 -1
- package/dist/utils/facets/asset-facet.js +12 -9
- package/dist/utils/facets/asset-facet.js.map +1 -1
- package/dist/utils/facets/connection-facet.d.ts +9 -2
- package/dist/utils/facets/connection-facet.js +97 -68
- package/dist/utils/facets/connection-facet.js.map +1 -1
- package/dist/utils/facets/deployment-helpers.d.ts +18 -1
- package/dist/utils/facets/deployment-helpers.js +58 -0
- package/dist/utils/facets/deployment-helpers.js.map +1 -1
- package/dist/utils/facets/deployment-logs.d.ts +5 -0
- package/dist/utils/facets/deployment-logs.js +88 -0
- package/dist/utils/facets/deployment-logs.js.map +1 -0
- package/dist/utils/facets/deployment-runner.d.ts +2 -1
- package/dist/utils/facets/deployment-runner.js +22 -2
- package/dist/utils/facets/deployment-runner.js.map +1 -1
- package/dist/utils/facets/facets.d.ts +2 -0
- package/dist/utils/facets/facets.js +25 -3
- package/dist/utils/facets/facets.js.map +1 -1
- package/dist/utils/facets/mule-application-facet.d.ts +1 -1
- package/dist/utils/facets/mule-application-facet.js +38 -25
- package/dist/utils/facets/mule-application-facet.js.map +1 -1
- package/dist/utils/facets/publication-metadata-patcher.js +5 -0
- package/dist/utils/facets/publication-metadata-patcher.js.map +1 -1
- package/dist/utils/facets/publication-rank.js +5 -0
- package/dist/utils/facets/publication-rank.js.map +1 -1
- package/dist/utils/facets/undeploy-helpers.js +5 -0
- package/dist/utils/facets/undeploy-helpers.js.map +1 -1
- package/dist/utils/facets/unpublish-preflight.js +5 -0
- package/dist/utils/facets/unpublish-preflight.js.map +1 -1
- package/dist/utils/files.d.ts +25 -0
- package/dist/utils/files.js +67 -0
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/gateway-mode.js +5 -0
- package/dist/utils/gateway-mode.js.map +1 -1
- package/dist/utils/gateway.d.ts +6 -2
- package/dist/utils/gateway.js +42 -33
- package/dist/utils/gateway.js.map +1 -1
- package/dist/utils/keychain.d.ts +56 -0
- package/dist/utils/keychain.js +488 -0
- package/dist/utils/keychain.js.map +1 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.js +22 -14
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/mcp/mcp-metadata-mapper.d.ts +8 -0
- package/dist/utils/mcp/mcp-metadata-mapper.js +12 -1
- package/dist/utils/mcp/mcp-metadata-mapper.js.map +1 -1
- package/dist/utils/mcp/project-registrar.js +7 -26
- package/dist/utils/mcp/project-registrar.js.map +1 -1
- package/dist/utils/mcp/registry-key.js +5 -0
- package/dist/utils/mcp/registry-key.js.map +1 -1
- package/dist/utils/naming.d.ts +14 -0
- package/dist/utils/naming.js +41 -0
- package/dist/utils/naming.js.map +1 -1
- package/dist/utils/promise/promiseCreator.js +5 -0
- package/dist/utils/promise/promiseCreator.js.map +1 -1
- package/dist/utils/report/junit-report.js +5 -0
- package/dist/utils/report/junit-report.js.map +1 -1
- package/dist/utils/report/validation-report.js +5 -0
- package/dist/utils/report/validation-report.js.map +1 -1
- package/dist/utils/request-executor.d.ts +5 -5
- package/dist/utils/request-executor.js +5 -0
- package/dist/utils/request-executor.js.map +1 -1
- package/dist/utils/run-local/agent-console-proxy.d.ts +56 -0
- package/dist/utils/run-local/agent-console-proxy.js +182 -0
- package/dist/utils/run-local/agent-console-proxy.js.map +1 -0
- package/dist/utils/run-local/broker-recreate-selector.d.ts +31 -0
- package/dist/utils/run-local/broker-recreate-selector.js +82 -0
- package/dist/utils/run-local/broker-recreate-selector.js.map +1 -0
- package/dist/utils/run-local/build-status.d.ts +73 -0
- package/dist/utils/run-local/build-status.js +210 -0
- package/dist/utils/run-local/build-status.js.map +1 -0
- package/dist/utils/run-local/constants.d.ts +28 -0
- package/dist/utils/run-local/constants.js +36 -0
- package/dist/utils/run-local/constants.js.map +1 -0
- package/dist/utils/run-local/crd-files.d.ts +2 -0
- package/dist/utils/run-local/crd-files.js +24 -0
- package/dist/utils/run-local/crd-files.js.map +1 -0
- package/dist/utils/run-local/index.d.ts +9 -0
- package/dist/utils/run-local/index.js +42 -0
- package/dist/utils/run-local/index.js.map +1 -0
- package/dist/utils/run-local/local-a2a-upstream.d.ts +9 -0
- package/dist/utils/run-local/local-a2a-upstream.js +55 -0
- package/dist/utils/run-local/local-a2a-upstream.js.map +1 -0
- package/dist/utils/run-local/local-deploy-descriptor.d.ts +36 -0
- package/dist/utils/run-local/local-deploy-descriptor.js +70 -0
- package/dist/utils/run-local/local-deploy-descriptor.js.map +1 -0
- package/dist/utils/run-local/local-run-manager.d.ts +51 -0
- package/dist/utils/run-local/local-run-manager.js +220 -0
- package/dist/utils/run-local/local-run-manager.js.map +1 -0
- package/dist/utils/run-local/policy-resolver.d.ts +69 -0
- package/dist/utils/run-local/policy-resolver.js +461 -0
- package/dist/utils/run-local/policy-resolver.js.map +1 -0
- package/dist/utils/run-local/runtime-environment-manager.d.ts +89 -0
- package/dist/utils/run-local/runtime-environment-manager.js +313 -0
- package/dist/utils/run-local/runtime-environment-manager.js.map +1 -0
- package/dist/utils/run-local/secrets-manager.d.ts +66 -0
- package/dist/utils/run-local/secrets-manager.js +181 -0
- package/dist/utils/run-local/secrets-manager.js.map +1 -0
- package/dist/utils/uris.d.ts +5 -0
- package/dist/utils/uris.js +23 -1
- package/dist/utils/uris.js.map +1 -1
- package/dist/utils/variables.d.ts +17 -4
- package/dist/utils/variables.js +57 -7
- package/dist/utils/variables.js.map +1 -1
- package/dist/utils/zip-utils.js +5 -0
- package/dist/utils/zip-utils.js.map +1 -1
- package/package.json +7 -5
- package/scripts/check-gus-ticket-format.sh +29 -0
- package/scripts/resolve-version.sh +241 -0
- package/scripts/resolve-version.test.sh +278 -0
- package/scripts/test-publish-npm.sh +130 -0
- package/templates/agent-network/exchange.json.template +1 -0
- package/templates/agentic-network/brokers/broker1.agent.template +2 -2
- package/templates/agentic-network/exchange.json.template +1 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Agent Console</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--brand: #0176D3;
|
|
10
|
+
--brand-dark: #014486;
|
|
11
|
+
--brand-darker: #032D60;
|
|
12
|
+
--success: #04844B;
|
|
13
|
+
--warning: #FFB75D;
|
|
14
|
+
--error: #EA001E;
|
|
15
|
+
--bg: #F4F6F9;
|
|
16
|
+
--surface: #FFFFFF;
|
|
17
|
+
--border: #DDDBDA;
|
|
18
|
+
--text: #3E3E3C;
|
|
19
|
+
--text-muted: #706E6B;
|
|
20
|
+
--text-light: #FAFAF9;
|
|
21
|
+
--highlight: #E6F7FF;
|
|
22
|
+
--font: 'Salesforce Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
23
|
+
--mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
|
|
24
|
+
--radius: 8px;
|
|
25
|
+
}
|
|
26
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
27
|
+
body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100vh; display: flex; flex-direction: column; }
|
|
28
|
+
|
|
29
|
+
header { background: var(--brand-darker); color: var(--text-light); padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
|
|
30
|
+
header h1 { font-size: 18px; font-weight: 600; }
|
|
31
|
+
header .spacer { flex: 1; }
|
|
32
|
+
header .debug-toggle { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 12px; border-radius: var(--radius); font-size: 12px; cursor: pointer; font-family: var(--font); }
|
|
33
|
+
header .debug-toggle.active { background: var(--brand); }
|
|
34
|
+
|
|
35
|
+
.main { flex: 1; display: flex; overflow: hidden; }
|
|
36
|
+
|
|
37
|
+
/* Left sidebar */
|
|
38
|
+
.sidebar { width: 300px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
|
|
39
|
+
.section-header { padding: 10px 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
|
|
40
|
+
.section-header button { background: var(--brand); color: white; border: none; padding: 3px 8px; border-radius: var(--radius); font-size: 11px; cursor: pointer; font-family: var(--font); }
|
|
41
|
+
|
|
42
|
+
/* Agent entries */
|
|
43
|
+
.agents-section { border-bottom: 1px solid var(--border); }
|
|
44
|
+
button.agent-entry, button.task-item, button.debug-entry-header, button.cancel-task {
|
|
45
|
+
font: inherit; color: inherit; background: none; border: none; border-radius: 0;
|
|
46
|
+
}
|
|
47
|
+
button.agent-entry, button.task-item {
|
|
48
|
+
display: block; width: 100%; text-align: left;
|
|
49
|
+
}
|
|
50
|
+
button.debug-entry-header {
|
|
51
|
+
display: flex; width: 100%; text-align: left;
|
|
52
|
+
}
|
|
53
|
+
button.agent-entry:focus-visible, button.task-item:focus-visible,
|
|
54
|
+
button.debug-entry-header:focus-visible, button.cancel-task:focus-visible,
|
|
55
|
+
.close-btn:focus-visible {
|
|
56
|
+
outline: 2px solid var(--brand); outline-offset: -2px;
|
|
57
|
+
}
|
|
58
|
+
.agent-entry { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
|
|
59
|
+
.agent-entry:last-child { border-bottom: none; }
|
|
60
|
+
.agent-entry:hover { background: var(--bg); }
|
|
61
|
+
.agent-entry.active { background: var(--highlight); border-left: 3px solid var(--brand); }
|
|
62
|
+
.agent-entry .agent-header { display: flex; align-items: center; gap: 8px; }
|
|
63
|
+
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
|
|
64
|
+
.status-dot.checking { background: var(--warning); animation: pulse 1.5s infinite; }
|
|
65
|
+
.status-dot.online { background: var(--success); }
|
|
66
|
+
.status-dot.offline { background: var(--error); }
|
|
67
|
+
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
|
|
68
|
+
.agent-entry .agent-name { font-size: 13px; font-weight: 600; }
|
|
69
|
+
.agent-entry .agent-status-text { font-size: 10px; color: var(--text-muted); margin-left: auto; }
|
|
70
|
+
.agent-entry .agent-desc { font-size: 11px; color: var(--text-muted); line-height: 1.3; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
71
|
+
.agent-entry .skill-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
|
|
72
|
+
.skill-tag { font-size: 9px; padding: 1px 6px; border-radius: 10px; background: var(--highlight); color: var(--brand); font-weight: 500; }
|
|
73
|
+
|
|
74
|
+
/* Task list */
|
|
75
|
+
.task-section { flex: 1; overflow-y: auto; }
|
|
76
|
+
.task-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
|
|
77
|
+
.task-row.active { background: var(--highlight); border-left: 3px solid var(--brand); }
|
|
78
|
+
.task-item { flex: 1; padding: 8px 16px; cursor: pointer; transition: background 0.15s; min-width: 0; }
|
|
79
|
+
.task-item:hover { background: var(--highlight); }
|
|
80
|
+
.task-item .task-preview { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
81
|
+
.task-item .task-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
|
|
82
|
+
.task-item .task-id { font-size: 10px; color: var(--text-muted); font-family: var(--mono); }
|
|
83
|
+
.cancel-task { color: var(--error); font-size: 12px; cursor: pointer; padding: 8px 12px; white-space: nowrap; align-self: center; }
|
|
84
|
+
|
|
85
|
+
.badge { font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
|
|
86
|
+
.badge-completed { background: #e6f4ea; color: var(--success); }
|
|
87
|
+
.badge-working, .badge-submitted { background: var(--highlight); color: var(--brand); }
|
|
88
|
+
.badge-failed, .badge-rejected { background: #fde7e9; color: var(--error); }
|
|
89
|
+
.badge-input-required { background: #fff8e1; color: #6B4F00; }
|
|
90
|
+
.badge-auth-required { background: #fff0e0; color: #8A3400; }
|
|
91
|
+
.badge-canceled { background: #f3f2f2; color: var(--text-muted); }
|
|
92
|
+
|
|
93
|
+
/* Center — chat */
|
|
94
|
+
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
|
|
95
|
+
.messages { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
|
|
96
|
+
.message { max-width: 75%; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
|
|
97
|
+
.message.user { align-self: flex-end; background: var(--brand); color: white; border-bottom-right-radius: 2px; }
|
|
98
|
+
.message.agent { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 2px; }
|
|
99
|
+
.message.system { align-self: center; background: #fff8e1; border: 1px solid var(--warning); font-size: 13px; color: #6B4F00; text-align: center; max-width: 90%; }
|
|
100
|
+
.message.error { align-self: center; background: #fde7e9; border: 1px solid var(--error); font-size: 13px; color: var(--error); text-align: center; max-width: 90%; }
|
|
101
|
+
.message pre { font-family: var(--mono); font-size: 12px; background: rgba(0,0,0,0.04); padding: 8px; border-radius: 4px; overflow-x: auto; margin: 6px 0; }
|
|
102
|
+
.loading { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
|
|
103
|
+
.loading span { width: 8px; height: 8px; background: var(--border); border-radius: 50%; animation: bounce 1.4s infinite; }
|
|
104
|
+
.loading span:nth-child(2) { animation-delay: 0.2s; }
|
|
105
|
+
.loading span:nth-child(3) { animation-delay: 0.4s; }
|
|
106
|
+
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
|
|
107
|
+
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--text-muted); gap: 8px; }
|
|
108
|
+
.empty-state svg { width: 48px; height: 48px; opacity: 0.4; }
|
|
109
|
+
|
|
110
|
+
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
|
111
|
+
.input-bar { padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 8px; align-items: flex-end; position: relative; }
|
|
112
|
+
.input-bar textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-family: var(--font); font-size: 14px; line-height: 1.4; min-height: 42px; max-height: 140px; outline: none; transition: border-color 0.15s; }
|
|
113
|
+
.input-bar textarea:focus { border-color: var(--brand); }
|
|
114
|
+
.input-bar button { background: var(--brand); color: white; border: none; border-radius: var(--radius); padding: 10px 20px; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; white-space: nowrap; }
|
|
115
|
+
.input-bar button:hover { background: var(--brand-dark); }
|
|
116
|
+
.input-bar button:disabled { background: var(--border); cursor: not-allowed; }
|
|
117
|
+
|
|
118
|
+
/* Debug panel */
|
|
119
|
+
.debug-panel { width: 420px; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; transition: width 0.2s; overflow: hidden; }
|
|
120
|
+
.debug-panel.collapsed { width: 0; border-left: none; }
|
|
121
|
+
.debug-panel-header { padding: 8px 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0; min-width: 420px; }
|
|
122
|
+
.debug-panel-header button.close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; margin-left: auto; padding: 0 4px; }
|
|
123
|
+
.debug-tab { padding: 6px 12px; cursor: pointer; border: none; background: none; font-family: var(--font); font-size: 12px; color: var(--text-muted); border-bottom: 2px solid transparent; }
|
|
124
|
+
.debug-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
|
|
125
|
+
.debug-content { flex: 1; overflow-y: auto; min-width: 420px; }
|
|
126
|
+
.debug-content > div { display: none; }
|
|
127
|
+
.debug-content > div.active { display: block; }
|
|
128
|
+
|
|
129
|
+
/* HTTP log entries */
|
|
130
|
+
.debug-entry { border-bottom: 1px solid var(--border); }
|
|
131
|
+
.debug-entry-header { padding: 8px 14px; font-size: 11px; font-family: var(--mono); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
|
|
132
|
+
.debug-entry-header:hover { background: var(--bg); }
|
|
133
|
+
.debug-entry-header .arrow { transition: transform 0.15s; font-size: 10px; }
|
|
134
|
+
.debug-entry-header.open .arrow { transform: rotate(90deg); }
|
|
135
|
+
.debug-entry-header .method { color: var(--brand); font-weight: 600; }
|
|
136
|
+
.debug-entry-header .status-ok { color: var(--success); }
|
|
137
|
+
.debug-entry-header .status-err { color: var(--error); }
|
|
138
|
+
.debug-entry-body { display: none; padding: 0 14px 10px; }
|
|
139
|
+
.debug-entry-body.open { display: block; }
|
|
140
|
+
.debug-entry-body pre { font-family: var(--mono); font-size: 11px; background: var(--bg); padding: 8px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto; }
|
|
141
|
+
.debug-entry-body h4 { font-size: 10px; text-transform: uppercase; color: var(--text-muted); margin: 6px 0 4px; letter-spacing: 0.5px; }
|
|
142
|
+
|
|
143
|
+
/* Agent card view */
|
|
144
|
+
.card-view { padding: 14px; }
|
|
145
|
+
.card-view pre { font-family: var(--mono); font-size: 11px; background: var(--bg); padding: 10px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; overflow-y: auto; }
|
|
146
|
+
.card-view .card-placeholder { color: var(--text-muted); font-size: 13px; padding: 20px; text-align: center; }
|
|
147
|
+
|
|
148
|
+
::-webkit-scrollbar { width: 6px; }
|
|
149
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
150
|
+
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
|
|
151
|
+
</style>
|
|
152
|
+
</head>
|
|
153
|
+
<body>
|
|
154
|
+
|
|
155
|
+
<header>
|
|
156
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="white" stroke-width="2"/><path d="M8 12l3 3 5-5" stroke="white" stroke-width="2" stroke-linecap="round"/></svg>
|
|
157
|
+
<h1>Agent Console</h1>
|
|
158
|
+
<div class="spacer"></div>
|
|
159
|
+
<button class="debug-toggle" id="debugToggle" onclick="toggleDebug()">Debug</button>
|
|
160
|
+
</header>
|
|
161
|
+
|
|
162
|
+
<div class="main">
|
|
163
|
+
<div class="sidebar">
|
|
164
|
+
<div class="agents-section">
|
|
165
|
+
<div class="section-header">Agents</div>
|
|
166
|
+
<div id="agentsList"></div>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="section-header">
|
|
169
|
+
Tasks
|
|
170
|
+
<button onclick="newConversation()">+ New</button>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="task-section" id="taskList">
|
|
173
|
+
<div style="padding:16px;color:var(--text-muted);font-size:12px;text-align:center">No tasks yet</div>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div class="chat-area">
|
|
178
|
+
<div class="messages" id="messages">
|
|
179
|
+
<div class="empty-state">
|
|
180
|
+
<svg viewBox="0 0 24 24" fill="none"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" stroke="currentColor" stroke-width="1.5"/></svg>
|
|
181
|
+
<div>Select an agent to start a conversation</div>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="input-bar">
|
|
185
|
+
<label for="input" class="visually-hidden">Message</label>
|
|
186
|
+
<textarea id="input" placeholder="Type a message..." rows="1" onkeydown="handleKey(event)" oninput="autoResize(this)"></textarea>
|
|
187
|
+
<button id="sendBtn" onclick="sendMessage()">Send</button>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
<div class="debug-panel collapsed" id="debugPanel">
|
|
192
|
+
<div class="debug-panel-header">
|
|
193
|
+
<button class="debug-tab active" onclick="switchDebugTab('http', this)">HTTP Log</button>
|
|
194
|
+
<button class="debug-tab" onclick="switchDebugTab('card', this)">Agent Card</button>
|
|
195
|
+
<button class="close-btn" onclick="toggleDebug()" aria-label="Close debug panel">×</button>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="debug-content">
|
|
198
|
+
<div id="debugHttpTab" class="active">
|
|
199
|
+
<div id="debugEntries"></div>
|
|
200
|
+
</div>
|
|
201
|
+
<div id="debugCardTab">
|
|
202
|
+
<div class="card-view" id="cardView">
|
|
203
|
+
<div class="card-placeholder">Select an agent to view its card</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<script>
|
|
211
|
+
const GATEWAY_URL = '{{GATEWAY_URL}}';
|
|
212
|
+
let agents = [];
|
|
213
|
+
let agentCards = {};
|
|
214
|
+
let agentStatus = {};
|
|
215
|
+
let currentAgent = null;
|
|
216
|
+
let currentContextId = null;
|
|
217
|
+
let currentTaskId = null;
|
|
218
|
+
let tasks = [];
|
|
219
|
+
let sending = false;
|
|
220
|
+
let debugOpen = false;
|
|
221
|
+
let debugLog = [];
|
|
222
|
+
|
|
223
|
+
async function init() {
|
|
224
|
+
try {
|
|
225
|
+
const resp = await fetch('/api/agents');
|
|
226
|
+
agents = await resp.json();
|
|
227
|
+
agents.forEach(a => { agentStatus[a.path] = 'checking'; });
|
|
228
|
+
renderAgentsList();
|
|
229
|
+
if (agents.length > 0) selectAgent(agents[0]);
|
|
230
|
+
agents.forEach(a => loadAgentCard(a));
|
|
231
|
+
setInterval(checkAllAgentStatus, 15000);
|
|
232
|
+
} catch (e) {
|
|
233
|
+
showError('Failed to load agents: ' + e.message);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async function checkAllAgentStatus() {
|
|
238
|
+
await Promise.all(agents.map(async a => {
|
|
239
|
+
try {
|
|
240
|
+
const r = await fetch(`/api/agent-card?path=${encodeURIComponent(a.path)}`);
|
|
241
|
+
const newStatus = r.ok ? 'online' : 'offline';
|
|
242
|
+
if (agentStatus[a.path] !== newStatus) { agentStatus[a.path] = newStatus; renderAgentsList(); }
|
|
243
|
+
} catch {
|
|
244
|
+
if (agentStatus[a.path] !== 'offline') { agentStatus[a.path] = 'offline'; renderAgentsList(); }
|
|
245
|
+
}
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
async function loadAgentCard(agent) {
|
|
250
|
+
try {
|
|
251
|
+
const resp = await fetch(`/api/agent-card?path=${encodeURIComponent(agent.path)}`);
|
|
252
|
+
if (resp.ok) { agentCards[agent.path] = await resp.json(); agentStatus[agent.path] = 'online'; }
|
|
253
|
+
else agentStatus[agent.path] = 'offline';
|
|
254
|
+
} catch { agentStatus[agent.path] = 'offline'; }
|
|
255
|
+
renderAgentsList();
|
|
256
|
+
if (currentAgent?.path === agent.path) renderCardView();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function selectAgent(agent) {
|
|
260
|
+
currentAgent = agent;
|
|
261
|
+
currentContextId = null;
|
|
262
|
+
currentTaskId = null;
|
|
263
|
+
tasks = [];
|
|
264
|
+
renderAgentsList();
|
|
265
|
+
renderTaskList();
|
|
266
|
+
renderCardView();
|
|
267
|
+
showEmpty(`Start a conversation with ${agentCards[agent.path]?.name || agent.name}`);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function renderAgentsList() {
|
|
271
|
+
const el = document.getElementById('agentsList');
|
|
272
|
+
const statusLabels = { checking: 'Starting...', online: 'Online', offline: 'Offline' };
|
|
273
|
+
el.innerHTML = agents.map(a => {
|
|
274
|
+
const active = currentAgent?.path === a.path ? 'active' : '';
|
|
275
|
+
const status = agentStatus[a.path] || 'checking';
|
|
276
|
+
const card = agentCards[a.path];
|
|
277
|
+
const desc = card?.description || '';
|
|
278
|
+
const skills = (card?.skills || []).slice(0, 4).map(s =>
|
|
279
|
+
`<span class="skill-tag">${escHtml(s.name || s.id)}</span>`).join('');
|
|
280
|
+
|
|
281
|
+
return `<button type="button" class="agent-entry ${active}" onclick="selectAgent(agents.find(x=>x.path===${jsAttr(a.path)}))">
|
|
282
|
+
<span class="agent-header">
|
|
283
|
+
<span class="status-dot ${status}"></span>
|
|
284
|
+
<span class="agent-name">${escHtml(card?.name || a.name)}</span>
|
|
285
|
+
<span class="agent-status-text">${statusLabels[status]}</span>
|
|
286
|
+
</span>
|
|
287
|
+
${desc ? `<span class="agent-desc">${escHtml(desc)}</span>` : ''}
|
|
288
|
+
${skills ? `<span class="skill-tags">${skills}</span>` : ''}
|
|
289
|
+
</button>`;
|
|
290
|
+
}).join('');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function renderTaskList() {
|
|
294
|
+
const list = document.getElementById('taskList');
|
|
295
|
+
if (tasks.length === 0) {
|
|
296
|
+
list.innerHTML = '<div style="padding:16px;color:var(--text-muted);font-size:12px;text-align:center">No tasks yet</div>';
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
list.innerHTML = tasks.map(t => {
|
|
300
|
+
const preview = getTaskPreview(t);
|
|
301
|
+
const state = t.status?.state || 'unknown';
|
|
302
|
+
const active = t.id === currentTaskId ? 'active' : '';
|
|
303
|
+
return `<div class="task-row ${active}">
|
|
304
|
+
<button type="button" class="task-item" onclick="selectTask(${jsAttr(t.id)})">
|
|
305
|
+
<span class="task-preview">${escHtml(preview)}</span>
|
|
306
|
+
<span class="task-meta">
|
|
307
|
+
<span class="task-id">${t.id.substring(0, 8)}</span>
|
|
308
|
+
<span class="badge badge-${state.replace('_','-')}">${state.replace('_',' ')}</span>
|
|
309
|
+
</span>
|
|
310
|
+
</button>
|
|
311
|
+
${state === 'working' || state === 'submitted' ? `<button type="button" class="cancel-task" aria-label="Cancel task" onclick="cancelTask(${jsAttr(t.id)})">× cancel</button>` : ''}
|
|
312
|
+
</div>`;
|
|
313
|
+
}).join('');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function renderCardView() {
|
|
317
|
+
const el = document.getElementById('cardView');
|
|
318
|
+
if (!currentAgent) { el.innerHTML = '<div class="card-placeholder">Select an agent to view its card</div>'; return; }
|
|
319
|
+
const card = agentCards[currentAgent.path];
|
|
320
|
+
if (!card) { el.innerHTML = `<div class="card-placeholder">${agentStatus[currentAgent.path] === 'checking' ? 'Loading...' : 'Agent card not available'}</div>`; return; }
|
|
321
|
+
el.innerHTML = `<pre>${escHtml(JSON.stringify(card, null, 2))}</pre>`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function switchDebugTab(tab, btn) {
|
|
325
|
+
document.querySelectorAll('.debug-tab').forEach(t => t.classList.remove('active'));
|
|
326
|
+
btn.classList.add('active');
|
|
327
|
+
document.getElementById('debugHttpTab').classList.toggle('active', tab === 'http');
|
|
328
|
+
document.getElementById('debugCardTab').classList.toggle('active', tab === 'card');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function toggleDebug() {
|
|
332
|
+
debugOpen = !debugOpen;
|
|
333
|
+
document.getElementById('debugPanel').classList.toggle('collapsed', !debugOpen);
|
|
334
|
+
document.getElementById('debugToggle').classList.toggle('active', debugOpen);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function addDebugEntry(method, url, request, response, status) {
|
|
338
|
+
debugLog.unshift({ method, url, request, response, status, time: new Date().toLocaleTimeString() });
|
|
339
|
+
if (debugLog.length > 50) debugLog.pop();
|
|
340
|
+
renderDebugEntries();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function renderDebugEntries() {
|
|
344
|
+
document.getElementById('debugEntries').innerHTML = debugLog.map((e, i) => {
|
|
345
|
+
const sc = e.status && e.status < 400 ? 'status-ok' : 'status-err';
|
|
346
|
+
return `<div class="debug-entry">
|
|
347
|
+
<button type="button" class="debug-entry-header" aria-expanded="false" aria-controls="debugBody${i}" onclick="toggleDebugEntry(${i})">
|
|
348
|
+
<span class="arrow">▶</span>
|
|
349
|
+
<span class="method">${e.method}</span>
|
|
350
|
+
<span>${escHtml(e.url)}</span>
|
|
351
|
+
<span class="${sc}" style="margin-left:auto">${e.status || '---'}</span>
|
|
352
|
+
<span style="color:var(--text-muted)">${e.time}</span>
|
|
353
|
+
</button>
|
|
354
|
+
<div class="debug-entry-body" id="debugBody${i}">
|
|
355
|
+
<h4>Request</h4><pre>${escHtml(JSON.stringify(e.request, null, 2))}</pre>
|
|
356
|
+
<h4>Response</h4><pre>${escHtml(JSON.stringify(e.response, null, 2))}</pre>
|
|
357
|
+
</div>
|
|
358
|
+
</div>`;
|
|
359
|
+
}).join('');
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function toggleDebugEntry(idx) {
|
|
363
|
+
const header = document.querySelectorAll('.debug-entry-header')[idx];
|
|
364
|
+
const body = document.getElementById(`debugBody${idx}`);
|
|
365
|
+
const open = header.classList.toggle('open');
|
|
366
|
+
body.classList.toggle('open', open);
|
|
367
|
+
header.setAttribute('aria-expanded', open ? 'true' : 'false');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function newConversation() {
|
|
371
|
+
if (!currentAgent) return;
|
|
372
|
+
currentContextId = null;
|
|
373
|
+
currentTaskId = null;
|
|
374
|
+
renderTaskList();
|
|
375
|
+
showEmpty(`Start a new conversation with ${agentCards[currentAgent.path]?.name || currentAgent.name}`);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
async function sendMessage() {
|
|
379
|
+
const input = document.getElementById('input');
|
|
380
|
+
const text = input.value.trim();
|
|
381
|
+
if (!text || !currentAgent || sending) return;
|
|
382
|
+
sending = true; updateSendButton();
|
|
383
|
+
input.value = ''; autoResize(input);
|
|
384
|
+
clearEmpty(); appendMessage('user', text); showLoading();
|
|
385
|
+
|
|
386
|
+
const payload = {
|
|
387
|
+
jsonrpc: '2.0', method: 'message/send', id: crypto.randomUUID(),
|
|
388
|
+
params: { message: { messageId: crypto.randomUUID(), role: 'user', parts: [{ kind: 'text', text }] } }
|
|
389
|
+
};
|
|
390
|
+
if (currentContextId) payload.params.contextId = currentContextId;
|
|
391
|
+
|
|
392
|
+
try {
|
|
393
|
+
const resp = await fetch('/api/send', {
|
|
394
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
395
|
+
body: JSON.stringify({ agentId: currentAgent.path, payload }),
|
|
396
|
+
});
|
|
397
|
+
const data = await resp.json();
|
|
398
|
+
hideLoading();
|
|
399
|
+
addDebugEntry('POST', `${currentAgent.path}/`, payload, data, resp.status);
|
|
400
|
+
if (data.error) showError(data.error.message || JSON.stringify(data.error));
|
|
401
|
+
else if (data.result) {
|
|
402
|
+
const task = data.result;
|
|
403
|
+
currentTaskId = task.id;
|
|
404
|
+
currentContextId = task.contextId || currentContextId;
|
|
405
|
+
updateTask(task);
|
|
406
|
+
renderTaskStatus(task);
|
|
407
|
+
}
|
|
408
|
+
} catch (e) {
|
|
409
|
+
hideLoading();
|
|
410
|
+
addDebugEntry('POST', `${currentAgent.path}/`, payload, { error: e.message }, 0);
|
|
411
|
+
showError('Request failed: ' + e.message);
|
|
412
|
+
}
|
|
413
|
+
sending = false; updateSendButton();
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function renderTaskStatus(task) {
|
|
417
|
+
const s = task.status; if (!s) return;
|
|
418
|
+
if (s.message?.parts) {
|
|
419
|
+
for (const p of s.message.parts) {
|
|
420
|
+
if (p.kind === 'text') appendMessage('agent', p.text);
|
|
421
|
+
else if (p.kind === 'data') appendMessage('agent', '', p.data);
|
|
422
|
+
else if (p.kind === 'file') appendMessage('agent', `[File: ${p.file?.name || 'attachment'}]`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
if (s.state === 'input_required') appendSystem('The agent needs additional input to continue.');
|
|
426
|
+
else if (s.state === 'auth_required') appendSystem('Authentication required. Please provide credentials.');
|
|
427
|
+
else if (s.state === 'failed') showError('Task failed' + (s.message?.parts?.[0]?.text ? ': ' + s.message.parts[0].text : ''));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function updateTask(task) {
|
|
431
|
+
const idx = tasks.findIndex(t => t.id === task.id);
|
|
432
|
+
if (idx >= 0) tasks[idx] = task; else tasks.unshift(task);
|
|
433
|
+
renderTaskList();
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function getTaskPreview(task) {
|
|
437
|
+
if (task.history?.length > 0) { const u = task.history.find(m => m.role === 'user'); if (u?.parts) { const t = u.parts.find(p => p.kind === 'text'); if (t) return t.text; } }
|
|
438
|
+
return 'Task ' + task.id.substring(0, 8);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
async function selectTask(taskId) {
|
|
442
|
+
const task = tasks.find(t => t.id === taskId); if (!task) return;
|
|
443
|
+
currentTaskId = task.id; currentContextId = task.contextId;
|
|
444
|
+
const msgs = document.getElementById('messages'); msgs.innerHTML = '';
|
|
445
|
+
if (task.history) { for (const msg of task.history) { const role = msg.role === 'user' ? 'user' : 'agent'; for (const p of (msg.parts || [])) { if (p.kind === 'text') appendMessage(role, p.text); else if (p.kind === 'data') appendMessage(role, '', p.data); } } }
|
|
446
|
+
if (task.status) renderTaskStatus(task);
|
|
447
|
+
renderTaskList();
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
async function cancelTask(taskId) {
|
|
451
|
+
const payload = { jsonrpc: '2.0', method: 'tasks/cancel', id: crypto.randomUUID(), params: { id: taskId } };
|
|
452
|
+
try {
|
|
453
|
+
const resp = await fetch('/api/cancel', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ agentId: currentAgent.path, payload }) });
|
|
454
|
+
const data = await resp.json();
|
|
455
|
+
addDebugEntry('POST', `${currentAgent.path}/ [cancel]`, payload, data, resp.status);
|
|
456
|
+
const task = tasks.find(t => t.id === taskId);
|
|
457
|
+
if (task) { task.status = { state: 'canceled' }; renderTaskList(); }
|
|
458
|
+
} catch (e) { showError('Cancel failed: ' + e.message); }
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function appendMessage(role, text, data) { clearEmpty(); const msgs = document.getElementById('messages'); const div = document.createElement('div'); div.className = `message ${role}`; if (data) div.innerHTML = `<pre>${escHtml(JSON.stringify(data, null, 2))}</pre>`; else div.textContent = text; msgs.appendChild(div); msgs.scrollTop = msgs.scrollHeight; }
|
|
462
|
+
function appendSystem(text) { const msgs = document.getElementById('messages'); const div = document.createElement('div'); div.className = 'message system'; div.textContent = text; msgs.appendChild(div); msgs.scrollTop = msgs.scrollHeight; }
|
|
463
|
+
function showError(text) { const msgs = document.getElementById('messages'); const div = document.createElement('div'); div.className = 'message error'; div.textContent = text; msgs.appendChild(div); msgs.scrollTop = msgs.scrollHeight; }
|
|
464
|
+
function showEmpty(text) { document.getElementById('messages').innerHTML = `<div class="empty-state"><svg viewBox="0 0 24 24" fill="none"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" stroke="currentColor" stroke-width="1.5"/></svg><div>${escHtml(text)}</div></div>`; }
|
|
465
|
+
function showLoading() { clearEmpty(); const msgs = document.getElementById('messages'); const div = document.createElement('div'); div.className = 'loading'; div.id = 'loadingIndicator'; div.innerHTML = '<span></span><span></span><span></span>'; msgs.appendChild(div); msgs.scrollTop = msgs.scrollHeight; }
|
|
466
|
+
function hideLoading() { const el = document.getElementById('loadingIndicator'); if (el) el.remove(); }
|
|
467
|
+
function clearEmpty() { const e = document.querySelector('.empty-state'); if (e) e.remove(); }
|
|
468
|
+
function updateSendButton() { const b = document.getElementById('sendBtn'); b.disabled = sending; b.textContent = sending ? 'Sending...' : 'Send'; }
|
|
469
|
+
function handleKey(e) { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }
|
|
470
|
+
function autoResize(el) { el.style.height = 'auto'; el.style.height = Math.min(el.scrollHeight, 140) + 'px'; }
|
|
471
|
+
function escHtml(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
|
472
|
+
/** JSON.stringify inside a double-quoted HTML attribute: encode quotes so a ' or " in the value cannot break out. */
|
|
473
|
+
function jsAttr(value) { return JSON.stringify(value).replace(/&/g, '&').replace(/"/g, '"'); }
|
|
474
|
+
|
|
475
|
+
init();
|
|
476
|
+
</script>
|
|
477
|
+
</body>
|
|
478
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
3
|
+
"title": "Broker Deployment Settings Specification",
|
|
4
|
+
"$comment": "Owned by this CLI as a deploy-time contract; validated by the CLI's Ajv2019 validator. See docs/adr/0003.",
|
|
5
|
+
"$ref": "#/definitions/DeploymentSettings",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"DeploymentSettings": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"brokers": {
|
|
12
|
+
"$ref": "#/definitions/BrokerDeploymentSettings"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"BrokerDeploymentSettings": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"vCores": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"exclusiveMinimum": 0
|
|
23
|
+
},
|
|
24
|
+
"resources.cpu.reserved": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"resources.cpu.limit": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"resources.memory.reserved": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"resources.memory.limit": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"logging.level": {
|
|
37
|
+
"enum": ["ERROR", "WARN", "INFO", "DEBUG", "TRACE"]
|
|
38
|
+
},
|
|
39
|
+
"runtimeVersion": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[^:]+$"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* For full license text, see the LICENSE.txt file
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.AgentNetworkV2 = void 0;
|
|
4
9
|
// ─── Namespace ───────────────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-network-v2.js","sourceRoot":"","sources":["../../src/types/agent-network-v2.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"agent-network-v2.js","sourceRoot":"","sources":["../../src/types/agent-network-v2.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAmBH,gFAAgF;AAEhF,2DAA2D;AAC3D,IAAiB,cAAc,CA6Z9B;AA7ZD,WAAiB,cAAc;IAyRhB,gCAAiB,GAAG,CAAC,YAA0B,EAAmC,EAAE;QAC/F,OAAO,KAAK,IAAI,YAAY,CAAA;IAC9B,CAAC,CAAA;IAEY,gCAAiB,GAAG,CAAC,YAA0B,EAAmC,EAAE;QAC/F,OAAO,KAAK,IAAI,YAAY,CAAA;IAC9B,CAAC,CAAA;IA6CY,iCAAkB,GAAG,CAAC,UAAsB,EAAkC,EAAE;QAC3F,OAAO,KAAK,IAAI,UAAU,CAAA;IAC5B,CAAC,CAAA;IA4BY,8BAAe,GAAG;QAC7B,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,KAAK;KACF,CAAA;AA+CZ,CAAC,EA7ZgB,cAAc,8BAAd,cAAc,QA6Z9B"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* For full license text, see the LICENSE.txt file
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
8
|
exports.AgentNetwork = void 0;
|
|
4
9
|
// ─── Namespace ───────────────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-network.js","sourceRoot":"","sources":["../../src/types/agent-network.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"agent-network.js","sourceRoot":"","sources":["../../src/types/agent-network.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAkCH,gFAAgF;AAEhF,2DAA2D;AAC3D,IAAiB,YAAY,CAsP5B;AAtPD,WAAiB,YAAY;IAE3B,8EAA8E;IAUjE,4BAAe,GAAG;QAC7B,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,KAAK;KACF,CAAA;AAsOZ,CAAC,EAtPgB,YAAY,4BAAZ,YAAY,QAsP5B"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -151,6 +151,7 @@ export type ExchangeDescriptor = GAV & {
|
|
|
151
151
|
dependencies?: GAV[];
|
|
152
152
|
tags?: string[];
|
|
153
153
|
metadata?: {
|
|
154
|
+
toolingVersion?: number;
|
|
154
155
|
variables?: NestedVariables;
|
|
155
156
|
properties?: {
|
|
156
157
|
[key: string]: string;
|
|
@@ -165,12 +166,35 @@ export type Deployment = {
|
|
|
165
166
|
target: {
|
|
166
167
|
provider: string;
|
|
167
168
|
targetId: string;
|
|
169
|
+
replicas?: number;
|
|
168
170
|
};
|
|
169
171
|
status: string;
|
|
170
172
|
application: {
|
|
171
173
|
status: string;
|
|
174
|
+
desiredState?: string;
|
|
172
175
|
};
|
|
176
|
+
desiredVersion?: string;
|
|
177
|
+
replicas?: DeploymentReplica[];
|
|
173
178
|
};
|
|
179
|
+
export type DeploymentReplica = {
|
|
180
|
+
id: string;
|
|
181
|
+
state: string;
|
|
182
|
+
deploymentLocation?: string;
|
|
183
|
+
currentDeploymentVersion?: string;
|
|
184
|
+
reason?: string;
|
|
185
|
+
};
|
|
186
|
+
export type LogEntry = {
|
|
187
|
+
docId: string;
|
|
188
|
+
timestamp: number;
|
|
189
|
+
message: string;
|
|
190
|
+
replicaId?: string;
|
|
191
|
+
logLevel?: string;
|
|
192
|
+
context?: {
|
|
193
|
+
logger?: string;
|
|
194
|
+
class?: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
export type DeploymentLogsResponse = LogEntry[];
|
|
174
198
|
export type DeploymentsResponse = {
|
|
175
199
|
total: number;
|
|
176
200
|
items: Deployment[];
|
|
@@ -218,40 +242,13 @@ export type CreateAPIResponse = {
|
|
|
218
242
|
};
|
|
219
243
|
autodiscoveryInstanceName: string;
|
|
220
244
|
};
|
|
221
|
-
export type
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
configurationData:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
};
|
|
229
|
-
pointcutData: null | Record<string, unknown>;
|
|
230
|
-
template: {
|
|
231
|
-
groupId: string;
|
|
232
|
-
assetId: string;
|
|
233
|
-
assetVersion: string;
|
|
234
|
-
};
|
|
235
|
-
policyTemplateId: string;
|
|
236
|
-
order: number;
|
|
237
|
-
audit: {
|
|
238
|
-
created: {
|
|
239
|
-
date: string;
|
|
240
|
-
};
|
|
241
|
-
updated: Record<string, unknown>;
|
|
242
|
-
};
|
|
243
|
-
masterOrganizationId: string;
|
|
244
|
-
organizationId: string;
|
|
245
|
-
id: number;
|
|
246
|
-
policyId: number;
|
|
247
|
-
implementationAsset: {
|
|
248
|
-
groupId: string;
|
|
249
|
-
assetId: string;
|
|
250
|
-
version: string;
|
|
251
|
-
minRuntimeVersion: string;
|
|
252
|
-
technology: string;
|
|
253
|
-
};
|
|
254
|
-
apiId: number;
|
|
245
|
+
export type DesiredPolicy = {
|
|
246
|
+
groupId: string;
|
|
247
|
+
assetId: string;
|
|
248
|
+
assetVersion: string;
|
|
249
|
+
configurationData: Record<string, any>;
|
|
250
|
+
pointcutData?: null;
|
|
251
|
+
upstreamId?: string;
|
|
255
252
|
};
|
|
256
253
|
export type RuntimeTargetSpaceType = typeof PRIVATE_SPACE_TARGET_TYPE | typeof RUNTIME_FABRIC_TARGET_TYPE | typeof SHARED_TARGET_TYPE;
|
|
257
254
|
export type RuntimeTargetSpace = {
|