@bluefly/openstandardagents 0.5.0 → 0.5.1
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/.version.json +3 -3
- package/CHANGELOG.md +43 -12
- package/README.md +31 -26
- package/bin/postinstall +0 -0
- package/dist/.version.json +3 -3
- package/dist/adapters/a2a/a2a-protocol.js +4 -2
- package/dist/adapters/a2a/a2a-tool.js +4 -2
- package/dist/adapters/a2a/mcp-integration.d.ts +2 -1
- package/dist/adapters/a2a/mcp-integration.js +6 -3
- package/dist/adapters/browser/browser-exporter.d.ts +26 -0
- package/dist/adapters/browser/browser-exporter.js +73 -0
- package/dist/adapters/browser/browser-runner.d.ts +23 -0
- package/dist/adapters/browser/browser-runner.js +46 -0
- package/dist/adapters/browser/index.d.ts +9 -0
- package/dist/adapters/browser/index.js +9 -0
- package/dist/adapters/docker/index.d.ts +2 -0
- package/dist/adapters/docker/index.js +2 -0
- package/dist/adapters/docker/openclaw-bridge.d.ts +57 -0
- package/dist/adapters/docker/openclaw-bridge.js +173 -0
- package/dist/adapters/drupal/index.d.ts +1 -0
- package/dist/adapters/drupal/index.js +2 -0
- package/dist/adapters/drupal/twig-renderer.d.ts +23 -0
- package/dist/adapters/drupal/twig-renderer.js +99 -0
- package/dist/adapters/gitlab/agent-generator.js +2 -1
- package/dist/api/index.js +2 -1
- package/dist/api/routes/mcp.router.js +3 -1
- package/dist/api/routes/wizard.router.js +3 -1
- package/dist/cli/commands/agent/discover-type.command.js +1 -1
- package/dist/cli/commands/agent-card.command.js +37 -10
- package/dist/cli/commands/agents-sync.command.d.ts +2 -2
- package/dist/cli/commands/agents-sync.command.js +27 -17
- package/dist/cli/commands/catalog/config.js +1 -1
- package/dist/cli/commands/catalog/validate.command.js +2 -2
- package/dist/cli/commands/config.command.js +2 -2
- package/dist/cli/commands/daemon.command.js +32 -8
- package/dist/cli/commands/discover.d.ts +1 -1
- package/dist/cli/commands/discover.js +16 -8
- package/dist/cli/commands/economics.command.d.ts +9 -0
- package/dist/cli/commands/economics.command.js +113 -0
- package/dist/cli/commands/export.command.js +6 -3
- package/dist/cli/commands/mcp.command.js +3 -1
- package/dist/cli/commands/memory.command.d.ts +18 -0
- package/dist/cli/commands/memory.command.js +168 -0
- package/dist/cli/commands/publish.command.js +7 -4
- package/dist/cli/commands/serve-builder-routes.js +1 -1
- package/dist/cli/commands/usie-skills.command.d.ts +24 -0
- package/dist/cli/commands/usie-skills.command.js +297 -0
- package/dist/cli/commands/validate.command.js +8 -1
- package/dist/cli/commands/verify.d.ts +3 -3
- package/dist/cli/commands/verify.js +12 -6
- package/dist/cli/commands/workspace.command.d.ts +1 -0
- package/dist/cli/commands/workspace.command.js +28 -4
- package/dist/cli/index.js +12 -0
- package/dist/cli/workspace-validate.d.ts +23 -0
- package/dist/cli/workspace-validate.js +117 -0
- package/dist/data/platform-matrix.js +1 -4
- package/dist/generated/types.d.ts +97 -97
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mcp-server/index.js +658 -982
- package/dist/mesh/discovery-gkg.d.ts +26 -0
- package/dist/mesh/discovery-gkg.js +92 -0
- package/dist/messenger/Handler/AgentBatchHandler.js +3 -2
- package/dist/messenger/Handler/AgentExecutionHandler.js +6 -1
- package/dist/package.json +20 -4
- package/dist/sdks/shared/types.d.ts +1 -1
- package/dist/services/agent-card-generator.js +6 -2
- package/dist/services/daemon/audit-log.service.js +3 -1
- package/dist/services/daemon/execution.service.js +8 -4
- package/dist/services/daemon/fs-watcher.service.js +6 -7
- package/dist/services/daemon/pairing.service.js +2 -1
- package/dist/services/daemon/skill-aggregator.service.js +105 -21
- package/dist/services/daemon/sse-endpoints.js +1 -1
- package/dist/services/daemon/ws-server.js +10 -3
- package/dist/services/governance/cedar-provider.js +12 -8
- package/dist/services/governance/cedar-validator.service.js +1 -1
- package/dist/services/mcp/bridge.service.js +40 -9
- package/dist/services/openapi-extensions-validation.d.ts +20 -0
- package/dist/services/openapi-extensions-validation.js +193 -0
- package/dist/services/release-automation/merge-request.service.d.ts +4 -4
- package/dist/services/release-automation/release-buttons.js +3 -3
- package/dist/services/release-automation/schemas/release.schema.d.ts +3 -3
- package/dist/services/runtime/openai.adapter.d.ts +46 -13
- package/dist/services/runtime/openai.adapter.js +169 -131
- package/dist/services/skill-registry.service.d.ts +1 -1
- package/dist/services/skills-pipeline/skills-research.service.js +47 -7
- package/dist/services/trust/trust.service.js +6 -4
- package/dist/services/validation-zod.service.js +3 -22
- package/dist/services/validators/index.d.ts +1 -0
- package/dist/services/validators/index.js +1 -0
- package/dist/services/validators/registry.d.ts +21 -0
- package/dist/services/validators/registry.js +42 -0
- package/dist/skills/test-skill/package.json +1 -1
- package/dist/spec/extensions/cognition.schema.json +87 -0
- package/dist/spec/layer4-economics/duadp-examples.json +44 -0
- package/dist/spec/v0.4/agent.schema.json +14 -0
- package/dist/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/dist/spec/v0.5/agent.schema.json +32 -1
- package/dist/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
- package/dist/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
- package/dist/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
- package/dist/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
- package/dist/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
- package/dist/spec/v0.5/extensions/mcp/README.md +1 -1
- package/dist/spec/v0.5/memory-hierarchy.yaml +120 -0
- package/dist/spec/v1/agent-card.schema.json +254 -0
- package/dist/types/cognition.zod.d.ts +312 -0
- package/dist/types/cognition.zod.js +223 -0
- package/dist/types/identity.zod.d.ts +5 -5
- package/dist/types/index.d.ts +53 -7
- package/dist/types/index.js +4 -2
- package/dist/types/personality.zod.d.ts +3 -3
- package/dist/utils/http-client.d.ts +22 -0
- package/dist/utils/http-client.js +51 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/proxy-resolver.d.ts +36 -0
- package/dist/utils/proxy-resolver.js +59 -0
- package/dist/utils/user-agent.d.ts +11 -0
- package/dist/utils/user-agent.js +17 -0
- package/dist/validation/version-compliance.js +1 -1
- package/examples/agentscope/react-assistant/README.md +1 -1
- package/examples/agentscope/react-assistant/agent.ossa.yaml +1 -1
- package/examples/drupal/drupal-contributor-agent/.eslintrc.json +58 -0
- package/examples/drupal/drupal-contributor-agent/.prettierrc.json +10 -0
- package/examples/drupal/drupal-contributor-agent/package.json +55 -0
- package/examples/drupal/drupal-contributor-agent/src/core/index.ts +10 -0
- package/examples/drupal/drupal-contributor-agent/src/index.ts +17 -0
- package/examples/drupal/drupal-contributor-agent/src/types/index.ts +180 -0
- package/examples/drupal/drupal-contributor-agent/tsconfig.json +36 -0
- package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
- package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
- package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
- package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/reference-implementations/python-client/examples/basic_usage.py +0 -0
- package/examples/reference-implementations/python-client/examples/publish_agent.py +0 -0
- package/openapi/agent-cognition-sessions.yaml +580 -0
- package/openapi/agent-crud.yaml +20 -20
- package/openapi/core/ossa-registry-api.openapi.yaml +1 -1
- package/openapi/ossa-cli-enhancements.openapi.yaml +1 -1
- package/openapi/release-automation.openapi.yaml +1 -1
- package/openapi/schemas/common/economics.yaml +98 -0
- package/openapi/uadp-asyncapi.yaml +1 -1
- package/openapi/uadp-openapi.yaml +2 -2
- package/package.json +114 -96
- package/spec/extensions/cognition.schema.json +87 -0
- package/spec/layer4-economics/duadp-examples.json +44 -0
- package/spec/v0.4/agent.schema.json +14 -0
- package/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/spec/v0.5/agent.schema.json +32 -1
- package/spec/v0.5/extensions/cognition/cognition.schema.json +78 -1
- package/spec/v0.5/extensions/economics/context-pack.schema.json +91 -0
- package/spec/v0.5/extensions/economics/execution-profile.schema.json +148 -0
- package/spec/v0.5/extensions/economics/failure-semantics.schema.json +32 -0
- package/spec/v0.5/extensions/economics/replay-packet.schema.json +120 -0
- package/spec/v0.5/extensions/mcp/README.md +1 -1
- package/spec/v0.5/memory-hierarchy.yaml +120 -0
- package/spec/v1/agent-card.schema.json +254 -0
- package/dist/adapters/a2a/__tests__/mcp-integration.spec.d.ts +0 -5
- package/dist/adapters/a2a/__tests__/mcp-integration.spec.js +0 -268
- package/dist/adapters/a2a/__tests__/mcp-transport.spec.d.ts +0 -5
- package/dist/adapters/a2a/__tests__/mcp-transport.spec.js +0 -203
- package/dist/mcp-server/__tests__/mcp-server.spec.d.ts +0 -8
- package/dist/mcp-server/__tests__/mcp-server.spec.js +0 -566
- package/dist/validation/__tests__/error-codes.test.d.ts +0 -5
- package/dist/validation/__tests__/error-codes.test.js +0 -252
- package/dist/version-management/core/version-manager.test.d.ts +0 -2
- package/dist/version-management/core/version-manager.test.js +0 -210
package/dist/types/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export * from './task.js';
|
|
|
10
10
|
export { createTaskManifest, isOssaTask } from './task.js';
|
|
11
11
|
// Export Workflow types (v0.3.0)
|
|
12
12
|
export * from './workflow.js';
|
|
13
|
-
export { createStep, createWorkflowManifest, expr, isOssaWorkflow } from './workflow.js';
|
|
13
|
+
export { createStep, createWorkflowManifest, expr, isOssaWorkflow, } from './workflow.js';
|
|
14
14
|
// Export Messaging types (v0.3.0)
|
|
15
15
|
export * from './messaging.js';
|
|
16
16
|
// Export Identity & Adapter types (v0.3.6)
|
|
@@ -25,6 +25,8 @@ export { isOssaSkill } from './skill.js';
|
|
|
25
25
|
export { createRoleManifest, isOssaRole } from './role.js';
|
|
26
26
|
// Export MCP server manifest types
|
|
27
27
|
export { isOssaMCPServer } from './mcp-server-manifest.js';
|
|
28
|
-
// Export
|
|
28
|
+
// Export Cognition types (v0.4 — CAOE)
|
|
29
|
+
export * from './cognition.zod.js';
|
|
30
|
+
// v0.5: Protocol Declarations
|
|
29
31
|
export * from './protocols.js';
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -165,9 +165,9 @@ export declare const ExpertiseEntrySchema: z.ZodObject<{
|
|
|
165
165
|
specializations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
166
|
}, z.core.$strip>;
|
|
167
167
|
export declare const UncertaintyHandlingSchema: z.ZodEnum<{
|
|
168
|
+
defer: "defer";
|
|
168
169
|
acknowledge: "acknowledge";
|
|
169
170
|
investigate: "investigate";
|
|
170
|
-
defer: "defer";
|
|
171
171
|
estimate: "estimate";
|
|
172
172
|
}>;
|
|
173
173
|
export declare const ErrorResponseSchema: z.ZodEnum<{
|
|
@@ -202,9 +202,9 @@ export declare const RiskToleranceSchema: z.ZodEnum<{
|
|
|
202
202
|
}>;
|
|
203
203
|
export declare const BehavioralTraitsSchema: z.ZodObject<{
|
|
204
204
|
uncertainty_handling: z.ZodOptional<z.ZodEnum<{
|
|
205
|
+
defer: "defer";
|
|
205
206
|
acknowledge: "acknowledge";
|
|
206
207
|
investigate: "investigate";
|
|
207
|
-
defer: "defer";
|
|
208
208
|
estimate: "estimate";
|
|
209
209
|
}>>;
|
|
210
210
|
error_response: z.ZodOptional<z.ZodEnum<{
|
|
@@ -403,9 +403,9 @@ export declare const PersonalitySpecSchema: z.ZodObject<{
|
|
|
403
403
|
description: z.ZodOptional<z.ZodString>;
|
|
404
404
|
traits: z.ZodOptional<z.ZodObject<{
|
|
405
405
|
uncertainty_handling: z.ZodOptional<z.ZodEnum<{
|
|
406
|
+
defer: "defer";
|
|
406
407
|
acknowledge: "acknowledge";
|
|
407
408
|
investigate: "investigate";
|
|
408
|
-
defer: "defer";
|
|
409
409
|
estimate: "estimate";
|
|
410
410
|
}>>;
|
|
411
411
|
error_response: z.ZodOptional<z.ZodEnum<{
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA HTTP Client — wraps fetch with proxy support and standard user-agent.
|
|
3
|
+
*
|
|
4
|
+
* Two usage patterns:
|
|
5
|
+
* 1. Direct: `import { ossaFetch } from './http-client.js'` — explicit proxy+UA fetch
|
|
6
|
+
* 2. Global: `import { installGlobalFetch } from './http-client.js'` — patches globalThis.fetch
|
|
7
|
+
* so ALL existing fetch() calls automatically get proxy + UA. Call once at startup.
|
|
8
|
+
*/
|
|
9
|
+
export interface OssaFetchOptions extends RequestInit {
|
|
10
|
+
agentName?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Proxy-aware fetch with standard OSSA user-agent header.
|
|
14
|
+
* Drop-in replacement for fetch() — same API, adds proxy + UA automatically.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ossaFetch(url: string | URL, options?: OssaFetchOptions): Promise<Response>;
|
|
17
|
+
/**
|
|
18
|
+
* Patch globalThis.fetch so ALL fetch() calls in the process get proxy + UA.
|
|
19
|
+
* Call once at CLI entry point. Safe to call multiple times (idempotent).
|
|
20
|
+
*/
|
|
21
|
+
export declare function installGlobalFetch(): void;
|
|
22
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA HTTP Client — wraps fetch with proxy support and standard user-agent.
|
|
3
|
+
*
|
|
4
|
+
* Two usage patterns:
|
|
5
|
+
* 1. Direct: `import { ossaFetch } from './http-client.js'` — explicit proxy+UA fetch
|
|
6
|
+
* 2. Global: `import { installGlobalFetch } from './http-client.js'` — patches globalThis.fetch
|
|
7
|
+
* so ALL existing fetch() calls automatically get proxy + UA. Call once at startup.
|
|
8
|
+
*/
|
|
9
|
+
import { getProxyAgent } from './proxy-resolver.js';
|
|
10
|
+
import { getOssaUserAgent } from './user-agent.js';
|
|
11
|
+
/**
|
|
12
|
+
* Proxy-aware fetch with standard OSSA user-agent header.
|
|
13
|
+
* Drop-in replacement for fetch() — same API, adds proxy + UA automatically.
|
|
14
|
+
*/
|
|
15
|
+
export async function ossaFetch(url, options = {}) {
|
|
16
|
+
const { agentName, ...fetchOpts } = options;
|
|
17
|
+
const headers = new Headers(fetchOpts.headers);
|
|
18
|
+
if (!headers.has('user-agent')) {
|
|
19
|
+
headers.set('user-agent', getOssaUserAgent(agentName));
|
|
20
|
+
}
|
|
21
|
+
const dispatcher = getProxyAgent();
|
|
22
|
+
return fetch(url, {
|
|
23
|
+
...fetchOpts,
|
|
24
|
+
headers,
|
|
25
|
+
...(dispatcher ? { dispatcher } : {}),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
let installed = false;
|
|
29
|
+
/**
|
|
30
|
+
* Patch globalThis.fetch so ALL fetch() calls in the process get proxy + UA.
|
|
31
|
+
* Call once at CLI entry point. Safe to call multiple times (idempotent).
|
|
32
|
+
*/
|
|
33
|
+
export function installGlobalFetch() {
|
|
34
|
+
if (installed)
|
|
35
|
+
return;
|
|
36
|
+
installed = true;
|
|
37
|
+
const originalFetch = globalThis.fetch;
|
|
38
|
+
globalThis.fetch = async function patchedFetch(input, init) {
|
|
39
|
+
const headers = new Headers(init?.headers);
|
|
40
|
+
if (!headers.has('user-agent')) {
|
|
41
|
+
headers.set('user-agent', getOssaUserAgent());
|
|
42
|
+
}
|
|
43
|
+
const dispatcher = getProxyAgent();
|
|
44
|
+
return originalFetch(input, {
|
|
45
|
+
...init,
|
|
46
|
+
headers,
|
|
47
|
+
...(dispatcher ? { dispatcher } : {}),
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=http-client.js.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export * from './version.js';
|
|
|
6
6
|
export * from './type-guards.js';
|
|
7
7
|
export * from './constants.js';
|
|
8
8
|
export * from './yaml-parser.js';
|
|
9
|
+
export * from './proxy-resolver.js';
|
|
10
|
+
export * from './user-agent.js';
|
|
11
|
+
export * from './http-client.js';
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -6,4 +6,7 @@ export * from './version.js';
|
|
|
6
6
|
export * from './type-guards.js';
|
|
7
7
|
export * from './constants.js';
|
|
8
8
|
export * from './yaml-parser.js';
|
|
9
|
+
export * from './proxy-resolver.js';
|
|
10
|
+
export * from './user-agent.js';
|
|
11
|
+
export * from './http-client.js';
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxy Resolver — Auto-detect and configure HTTP proxies for all agent HTTP clients.
|
|
3
|
+
*
|
|
4
|
+
* Uses proxy-agent to support HTTP, HTTPS, SOCKS4/5, and PAC proxies.
|
|
5
|
+
* Respects HTTP_PROXY, HTTPS_PROXY, NO_PROXY environment variables.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { getProxyAgent } from './proxy-resolver';
|
|
9
|
+
* const agent = getProxyAgent();
|
|
10
|
+
* fetch(url, { agent });
|
|
11
|
+
*/
|
|
12
|
+
import type { Agent } from 'http';
|
|
13
|
+
/**
|
|
14
|
+
* Get a proxy-aware HTTP agent. Auto-detects from env vars:
|
|
15
|
+
* - HTTP_PROXY / http_proxy
|
|
16
|
+
* - HTTPS_PROXY / https_proxy
|
|
17
|
+
* - NO_PROXY / no_proxy
|
|
18
|
+
* - ALL_PROXY / all_proxy
|
|
19
|
+
*
|
|
20
|
+
* Returns undefined if no proxy is configured (direct connection).
|
|
21
|
+
*/
|
|
22
|
+
export declare function getProxyAgent(): Agent | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a proxy is configured in the environment.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isProxyConfigured(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get proxy configuration summary for diagnostics/logging.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getProxyInfo(): {
|
|
31
|
+
configured: boolean;
|
|
32
|
+
httpProxy?: string;
|
|
33
|
+
httpsProxy?: string;
|
|
34
|
+
noProxy?: string;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=proxy-resolver.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proxy Resolver — Auto-detect and configure HTTP proxies for all agent HTTP clients.
|
|
3
|
+
*
|
|
4
|
+
* Uses proxy-agent to support HTTP, HTTPS, SOCKS4/5, and PAC proxies.
|
|
5
|
+
* Respects HTTP_PROXY, HTTPS_PROXY, NO_PROXY environment variables.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { getProxyAgent } from './proxy-resolver';
|
|
9
|
+
* const agent = getProxyAgent();
|
|
10
|
+
* fetch(url, { agent });
|
|
11
|
+
*/
|
|
12
|
+
import { ProxyAgent } from 'proxy-agent';
|
|
13
|
+
let cachedAgent;
|
|
14
|
+
/**
|
|
15
|
+
* Get a proxy-aware HTTP agent. Auto-detects from env vars:
|
|
16
|
+
* - HTTP_PROXY / http_proxy
|
|
17
|
+
* - HTTPS_PROXY / https_proxy
|
|
18
|
+
* - NO_PROXY / no_proxy
|
|
19
|
+
* - ALL_PROXY / all_proxy
|
|
20
|
+
*
|
|
21
|
+
* Returns undefined if no proxy is configured (direct connection).
|
|
22
|
+
*/
|
|
23
|
+
export function getProxyAgent() {
|
|
24
|
+
const proxyUrl = process.env.HTTP_PROXY ||
|
|
25
|
+
process.env.http_proxy ||
|
|
26
|
+
process.env.HTTPS_PROXY ||
|
|
27
|
+
process.env.https_proxy ||
|
|
28
|
+
process.env.ALL_PROXY ||
|
|
29
|
+
process.env.all_proxy;
|
|
30
|
+
if (!proxyUrl)
|
|
31
|
+
return undefined;
|
|
32
|
+
if (!cachedAgent) {
|
|
33
|
+
cachedAgent = new ProxyAgent();
|
|
34
|
+
}
|
|
35
|
+
return cachedAgent;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a proxy is configured in the environment.
|
|
39
|
+
*/
|
|
40
|
+
export function isProxyConfigured() {
|
|
41
|
+
return !!(process.env.HTTP_PROXY ||
|
|
42
|
+
process.env.http_proxy ||
|
|
43
|
+
process.env.HTTPS_PROXY ||
|
|
44
|
+
process.env.https_proxy ||
|
|
45
|
+
process.env.ALL_PROXY ||
|
|
46
|
+
process.env.all_proxy);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get proxy configuration summary for diagnostics/logging.
|
|
50
|
+
*/
|
|
51
|
+
export function getProxyInfo() {
|
|
52
|
+
return {
|
|
53
|
+
configured: isProxyConfigured(),
|
|
54
|
+
httpProxy: process.env.HTTP_PROXY || process.env.http_proxy,
|
|
55
|
+
httpsProxy: process.env.HTTPS_PROXY || process.env.https_proxy,
|
|
56
|
+
noProxy: process.env.NO_PROXY || process.env.no_proxy,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=proxy-resolver.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Agent — Consistent identification for all OSSA agent HTTP requests.
|
|
3
|
+
*
|
|
4
|
+
* Uses universal-user-agent for cross-runtime compatibility.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the OSSA user-agent string for HTTP requests.
|
|
8
|
+
* Format: ossa-cli/{version} ({agentName}) {runtimeUA}
|
|
9
|
+
*/
|
|
10
|
+
export declare function getOssaUserAgent(agentName?: string): string;
|
|
11
|
+
//# sourceMappingURL=user-agent.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Agent — Consistent identification for all OSSA agent HTTP requests.
|
|
3
|
+
*
|
|
4
|
+
* Uses universal-user-agent for cross-runtime compatibility.
|
|
5
|
+
*/
|
|
6
|
+
import { getUserAgent } from 'universal-user-agent';
|
|
7
|
+
const BASE_USER_AGENT = getUserAgent();
|
|
8
|
+
/**
|
|
9
|
+
* Get the OSSA user-agent string for HTTP requests.
|
|
10
|
+
* Format: ossa-cli/{version} ({agentName}) {runtimeUA}
|
|
11
|
+
*/
|
|
12
|
+
export function getOssaUserAgent(agentName) {
|
|
13
|
+
const version = process.env.npm_package_version || '0.5.1';
|
|
14
|
+
const agent = agentName ? ` (${agentName})` : '';
|
|
15
|
+
return `ossa-cli/${version}${agent} ${BASE_USER_AGENT}`;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=user-agent.js.map
|
|
@@ -71,7 +71,7 @@ agent = ReActAgent(
|
|
|
71
71
|
|
|
72
72
|
The manifest declares two MCP tool servers under `spec.tools`:
|
|
73
73
|
|
|
74
|
-
1. **knowledge-base** -- Graph knowledge base at `gkg.
|
|
74
|
+
1. **knowledge-base** -- Graph knowledge base at `gkg.bluefly.internal` for codebase analysis and structured queries.
|
|
75
75
|
2. **web-search** -- General MCP server at `mcp.blueflyagents.com` for web search and content retrieval.
|
|
76
76
|
|
|
77
77
|
At runtime, the adapter connects to these SSE endpoints, discovers available tools, and registers them with the AgentScope `ReActAgent` tool list.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"ecmaVersion": 2022,
|
|
6
|
+
"sourceType": "module",
|
|
7
|
+
"project": "./tsconfig.json"
|
|
8
|
+
},
|
|
9
|
+
"plugins": ["@typescript-eslint", "import"],
|
|
10
|
+
"extends": [
|
|
11
|
+
"eslint:recommended",
|
|
12
|
+
"plugin:@typescript-eslint/recommended",
|
|
13
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
14
|
+
"plugin:import/recommended",
|
|
15
|
+
"plugin:import/typescript",
|
|
16
|
+
"prettier"
|
|
17
|
+
],
|
|
18
|
+
"rules": {
|
|
19
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
20
|
+
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
21
|
+
"@typescript-eslint/no-unused-vars": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
"argsIgnorePattern": "^_",
|
|
25
|
+
"varsIgnorePattern": "^_"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
29
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
30
|
+
"import/order": [
|
|
31
|
+
"error",
|
|
32
|
+
{
|
|
33
|
+
"groups": [
|
|
34
|
+
"builtin",
|
|
35
|
+
"external",
|
|
36
|
+
"internal",
|
|
37
|
+
"parent",
|
|
38
|
+
"sibling",
|
|
39
|
+
"index"
|
|
40
|
+
],
|
|
41
|
+
"newlines-between": "always",
|
|
42
|
+
"alphabetize": {
|
|
43
|
+
"order": "asc",
|
|
44
|
+
"caseInsensitive": true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"no-console": "warn"
|
|
49
|
+
},
|
|
50
|
+
"settings": {
|
|
51
|
+
"import/resolver": {
|
|
52
|
+
"typescript": {
|
|
53
|
+
"alwaysTryTypes": true,
|
|
54
|
+
"project": "./tsconfig.json"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bluefly/drupal-contributor-agent",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Enterprise-ready autonomous OSSA/DUADP agent for Drupal.org contributions",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"build:watch": "tsc --watch",
|
|
10
|
+
"clean": "rm -rf dist",
|
|
11
|
+
"lint": "eslint src tests --ext .ts",
|
|
12
|
+
"lint:fix": "eslint src tests --ext .ts --fix",
|
|
13
|
+
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
14
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
15
|
+
"test": "vitest --run",
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"test:coverage": "vitest --run --coverage",
|
|
18
|
+
"test:unit": "vitest --run --testPathPattern=tests/unit",
|
|
19
|
+
"test:integration": "vitest --run --testPathPattern=tests/integration",
|
|
20
|
+
"test:properties": "vitest --run --testPathPattern=tests/properties",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"validate": "npm run typecheck && npm run lint && npm run format:check && npm run test"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ossa",
|
|
26
|
+
"duadp",
|
|
27
|
+
"drupal",
|
|
28
|
+
"agent",
|
|
29
|
+
"autonomous",
|
|
30
|
+
"mcp"
|
|
31
|
+
],
|
|
32
|
+
"author": "Bluefly",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@aws-sdk/client-cedar": "^3.0.0",
|
|
39
|
+
"fast-check": "^3.15.0",
|
|
40
|
+
"yaml": "^2.3.4",
|
|
41
|
+
"zod": "^3.22.4"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.11.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
46
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
47
|
+
"@vitest/coverage-v8": "^1.2.0",
|
|
48
|
+
"eslint": "^8.56.0",
|
|
49
|
+
"eslint-config-prettier": "^9.1.0",
|
|
50
|
+
"eslint-plugin-import": "^2.29.1",
|
|
51
|
+
"prettier": "^3.2.4",
|
|
52
|
+
"typescript": "^5.3.3",
|
|
53
|
+
"vitest": "^1.2.0"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drupal Contributor Agent - Main Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Enterprise-ready autonomous OSSA/DUADP agent for Drupal.org contributions.
|
|
5
|
+
* This agent demonstrates the full OSSA/DUADP stack working together to
|
|
6
|
+
* contribute to Drupal.org issues with enterprise governance and security.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './core';
|
|
10
|
+
export * from './discovery';
|
|
11
|
+
export * from './governance';
|
|
12
|
+
export * from './identity';
|
|
13
|
+
export * from './observability';
|
|
14
|
+
export * from './tools';
|
|
15
|
+
export * from './types';
|
|
16
|
+
export * from './workspace';
|
|
17
|
+
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for the Drupal Contributor Agent
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Agent configuration
|
|
7
|
+
*/
|
|
8
|
+
export interface AgentConfig {
|
|
9
|
+
identity: IdentityConfig;
|
|
10
|
+
discovery: DiscoveryConfig;
|
|
11
|
+
governance: GovernanceConfig;
|
|
12
|
+
workspace: WorkspaceConfig;
|
|
13
|
+
observability: ObservabilityConfig;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Identity configuration
|
|
18
|
+
*/
|
|
19
|
+
export interface IdentityConfig {
|
|
20
|
+
gaid: string; // W3C Decentralized Identifier
|
|
21
|
+
manifestPath: string;
|
|
22
|
+
privateKeyPath?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Discovery configuration
|
|
27
|
+
*/
|
|
28
|
+
export interface DiscoveryConfig {
|
|
29
|
+
endpoint: string;
|
|
30
|
+
port: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Governance configuration
|
|
35
|
+
*/
|
|
36
|
+
export interface GovernanceConfig {
|
|
37
|
+
cedarPoliciesPath: string;
|
|
38
|
+
approvalWebhookUrl?: string;
|
|
39
|
+
auditLogPath: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Workspace configuration
|
|
44
|
+
*/
|
|
45
|
+
export interface WorkspaceConfig {
|
|
46
|
+
rootPath: string;
|
|
47
|
+
isolation: 'container' | 'process' | 'none';
|
|
48
|
+
maxDiskUsage: string;
|
|
49
|
+
maxMemory: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Observability configuration
|
|
54
|
+
*/
|
|
55
|
+
export interface ObservabilityConfig {
|
|
56
|
+
metricsPort: number;
|
|
57
|
+
logLevel: 'debug' | 'info' | 'warn' | 'error';
|
|
58
|
+
tracingEnabled: boolean;
|
|
59
|
+
tracingSampleRate: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Agent state
|
|
64
|
+
*/
|
|
65
|
+
export interface AgentState {
|
|
66
|
+
status: 'initializing' | 'ready' | 'processing' | 'error' | 'shutdown';
|
|
67
|
+
currentIssue?: string;
|
|
68
|
+
currentWorkspace?: string;
|
|
69
|
+
lastError?: Error;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Issue processing result
|
|
74
|
+
*/
|
|
75
|
+
export interface IssueResult {
|
|
76
|
+
issueId: string;
|
|
77
|
+
status: 'completed' | 'failed' | 'pending_approval';
|
|
78
|
+
mergeRequestUrl?: string;
|
|
79
|
+
evidence: Evidence[];
|
|
80
|
+
auditTrail: AuditEntry[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Evidence for validation and review
|
|
85
|
+
*/
|
|
86
|
+
export interface Evidence {
|
|
87
|
+
type: 'diff' | 'test_result' | 'analysis' | 'screenshot' | 'log';
|
|
88
|
+
title: string;
|
|
89
|
+
description: string;
|
|
90
|
+
content: {
|
|
91
|
+
format: 'text' | 'json' | 'binary';
|
|
92
|
+
data: string | Buffer;
|
|
93
|
+
encoding?: string;
|
|
94
|
+
};
|
|
95
|
+
metadata: {
|
|
96
|
+
tool: string;
|
|
97
|
+
version: string;
|
|
98
|
+
timestamp: Date;
|
|
99
|
+
checksum: string;
|
|
100
|
+
};
|
|
101
|
+
validation: {
|
|
102
|
+
verified: boolean;
|
|
103
|
+
signature?: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Audit trail entry
|
|
109
|
+
*/
|
|
110
|
+
export interface AuditEntry {
|
|
111
|
+
id: string;
|
|
112
|
+
timestamp: Date;
|
|
113
|
+
tenantId: string;
|
|
114
|
+
workspaceId: string;
|
|
115
|
+
actor: {
|
|
116
|
+
type: 'agent' | 'human';
|
|
117
|
+
id: string;
|
|
118
|
+
gaid?: string;
|
|
119
|
+
};
|
|
120
|
+
action: {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
parameters: Record<string, unknown>;
|
|
124
|
+
};
|
|
125
|
+
resource: {
|
|
126
|
+
type: string;
|
|
127
|
+
id: string;
|
|
128
|
+
path?: string;
|
|
129
|
+
};
|
|
130
|
+
result: {
|
|
131
|
+
status: 'success' | 'failure' | 'pending';
|
|
132
|
+
message?: string;
|
|
133
|
+
evidence?: Evidence[];
|
|
134
|
+
};
|
|
135
|
+
governance: {
|
|
136
|
+
policyEvaluation: AuthorizationResult;
|
|
137
|
+
approvals?: ApprovalRecord[];
|
|
138
|
+
};
|
|
139
|
+
context: {
|
|
140
|
+
correlationId: string;
|
|
141
|
+
traceId: string;
|
|
142
|
+
sessionId: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Authorization result from Cedar policy engine
|
|
148
|
+
*/
|
|
149
|
+
export interface AuthorizationResult {
|
|
150
|
+
decision: 'Allow' | 'Deny';
|
|
151
|
+
reasons: string[];
|
|
152
|
+
requiredApprovals?: ApprovalGate[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Approval gate definition
|
|
157
|
+
*/
|
|
158
|
+
export interface ApprovalGate {
|
|
159
|
+
id: string;
|
|
160
|
+
type: string;
|
|
161
|
+
description: string;
|
|
162
|
+
approvers: string[];
|
|
163
|
+
timeout?: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Approval record
|
|
168
|
+
*/
|
|
169
|
+
export interface ApprovalRecord {
|
|
170
|
+
gateId: string;
|
|
171
|
+
approver: string;
|
|
172
|
+
decision: 'approved' | 'denied';
|
|
173
|
+
timestamp: Date;
|
|
174
|
+
reason?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Event handler function
|
|
179
|
+
*/
|
|
180
|
+
export type EventHandler = (data: unknown) => void | Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022"],
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noImplicitAny": true,
|
|
9
|
+
"strictNullChecks": true,
|
|
10
|
+
"strictFunctionTypes": true,
|
|
11
|
+
"strictBindCallApply": true,
|
|
12
|
+
"strictPropertyInitialization": true,
|
|
13
|
+
"noImplicitThis": true,
|
|
14
|
+
"alwaysStrict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noImplicitReturns": true,
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"noImplicitOverride": true,
|
|
21
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"allowSyntheticDefaultImports": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"forceConsistentCasingInFileNames": true,
|
|
26
|
+
"declaration": true,
|
|
27
|
+
"declarationMap": true,
|
|
28
|
+
"sourceMap": true,
|
|
29
|
+
"outDir": "./dist",
|
|
30
|
+
"removeComments": false,
|
|
31
|
+
"isolatedModules": true,
|
|
32
|
+
"skipLibCheck": true
|
|
33
|
+
},
|
|
34
|
+
"include": ["src/**/*"],
|
|
35
|
+
"exclude": ["node_modules", "dist", "tests"]
|
|
36
|
+
}
|