@bluefly/openstandardagents 0.4.9 → 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 +35 -4
- package/README.md +77 -62
- 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/claude-code/adapter.js +2 -2
- package/dist/adapters/docker/generators.js +19 -19
- 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/generator.js +76 -76
- 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/adapters/openai-agents/adapter.js +2 -2
- 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/schema-driven/schema-loader.js +5 -5
- 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 +43 -14
- 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/export/langchain/langchain-exporter.js +2 -2
- package/dist/services/export/langchain/memory-generator.js +2 -2
- package/dist/services/export/testing/test-generator.js +1 -1
- 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/taxonomy-service.d.ts +3 -3
- 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/extensions/role-manifest.md +188 -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.4/extensions/mcp/README.md +1 -1
- package/dist/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/dist/spec/v0.5/agent.schema.json +34 -2
- 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/memory-hierarchy.yaml +120 -0
- package/dist/spec/v0.5/role.schema.json +268 -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 +54 -6
- package/dist/types/index.js +6 -2
- package/dist/types/personality.zod.d.ts +3 -3
- package/dist/types/role.d.ts +126 -0
- package/dist/types/role.js +38 -0
- 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/validator.js +1 -1
- package/dist/validation/version-compliance.js +1 -1
- package/examples/agents/01-customer-support-bot/agent.ossa.yaml +24 -31
- package/examples/agents/05-sales-assistant/agent.ossa.yaml +35 -23
- package/examples/agents/07-research-assistant/agent.ossa.yaml +27 -21
- package/examples/agents/10-meeting-assistant/agent.ossa.yaml +27 -35
- package/examples/agents/security-audit-agent.ossa.yaml +234 -0
- package/examples/agentscope/react-assistant/README.md +1 -1
- package/examples/agentscope/react-assistant/agent.ossa.yaml +37 -33
- package/examples/drupal/content-moderator.ossa.yaml +2 -2
- 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/drupal/drupal-contributor.ossa.yaml +247 -0
- package/examples/export/langchain/production-agent-with-memory/README.md +1 -1
- package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +13 -23
- package/examples/export/langchain/production-agent-with-streaming/agent.ossa.yaml +1 -15
- package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +28 -29
- 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/README.md +3 -3
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/gitlab-agents/gitlab-ci-agent.ossa.yaml +221 -0
- package/examples/hierarchical-agent.ossa.yaml +10 -53
- package/examples/kagent/ossa-kagent-anthropic.ossa.yaml +2 -25
- package/examples/kagent/ossa-kagent-mcp-tools.ossa.yaml +2 -30
- package/examples/kagent/ossa-kagent-multi-tool.ossa.yaml +2 -18
- package/examples/kagent/ossa-kagent-poc.ossa.yaml +2 -16
- package/examples/pipeline-agent.ossa.yaml +3 -3
- package/examples/platform-specific/claude-code-subagent.yaml +1 -1
- package/examples/platform-specific/cursor-coding-agent.yaml +1 -1
- package/examples/platform-specific/warp-terminal-agent.yaml +1 -1
- package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +24 -31
- package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +35 -23
- package/examples/production-ready/07-research-assistant/agent.ossa.yaml +27 -19
- package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +27 -35
- package/examples/roles/drupal-developer.role.yaml +37 -0
- package/examples/roles/platform-operator.role.yaml +28 -0
- package/examples/roles/security-auditor.role.yaml +27 -0
- package/examples/swarm-agent.ossa.yaml +13 -51
- package/examples/team-agent.ossa.yaml +12 -61
- package/examples/team-lead-teammate.ossa.yaml +12 -17
- package/openapi/agent-cognition-sessions.yaml +580 -0
- package/openapi/agent-communication.yaml +260 -212
- package/openapi/agent-crud.yaml +237 -207
- package/openapi/agent-discovery.yaml +119 -81
- package/openapi/agent-identity.yaml +219 -187
- package/openapi/agent-taxonomy.yaml +95 -38
- package/openapi/agents-md-service.yaml +103 -30
- package/openapi/cli/openapi.yaml +147 -40
- package/openapi/core/ossa-core-api.openapi.yaml +327 -271
- package/openapi/core/ossa-registry-api.openapi.yaml +299 -236
- package/openapi/core/ossa-registry.openapi.yaml +299 -159
- package/openapi/core/unified-agent-gateway.openapi.yaml +234 -170
- package/openapi/daemon-api.openapi.yaml +323 -181
- package/openapi/dev-cli/openapi.yaml +137 -113
- package/openapi/github-sync.yaml +62 -19
- package/openapi/marketplace-plugin.openapi.yaml +539 -466
- package/openapi/ossa-api.openapi.yaml +354 -213
- package/openapi/ossa-cli-enhancements.openapi.yaml +109 -90
- package/openapi/ossa-cli.yaml +260 -184
- package/openapi/protocols/sse-streams.yaml +66 -74
- package/openapi/protocols/websocket-events.yaml +61 -54
- package/openapi/reference-implementations/aiflow-bridge-api.openapi.yaml +37 -20
- package/openapi/reference-implementations/compliance-agent-api.openapi.yaml +35 -23
- package/openapi/reference-implementations/crewai-agent-api.openapi.yaml +29 -18
- package/openapi/reference-implementations/critic-agent-api.openapi.yaml +45 -19
- package/openapi/reference-implementations/document-analyzer-api.openapi.yaml +30 -24
- package/openapi/reference-implementations/drupal-agent-api.openapi.yaml +101 -50
- package/openapi/reference-implementations/getting-started-hello-world-api.openapi.yaml +33 -22
- package/openapi/reference-implementations/gitlab-ml-recommender-api.openapi.yaml +20 -16
- package/openapi/reference-implementations/governor-agent-api.openapi.yaml +41 -23
- package/openapi/reference-implementations/helm-generator.openapi.yaml +88 -46
- package/openapi/reference-implementations/integrator-agent-api.openapi.yaml +30 -20
- package/openapi/reference-implementations/judge-agent-api.openapi.yaml +22 -16
- package/openapi/reference-implementations/k8s-troubleshooter-api.openapi.yaml +32 -18
- package/openapi/reference-implementations/langchain-agent-api.openapi.yaml +32 -21
- package/openapi/reference-implementations/monitor-agent-api.openapi.yaml +34 -21
- package/openapi/reference-implementations/orchestrator-agent-api.openapi.yaml +49 -27
- package/openapi/reference-implementations/quickstart-support-agent-api.openapi.yaml +27 -19
- package/openapi/reference-implementations/self-evolving-ecosystem.openapi.yaml +427 -293
- package/openapi/reference-implementations/worker-agent-api.openapi.yaml +34 -23
- package/openapi/reference-implementations/workflow-orchestrator-api.openapi.yaml +35 -21
- package/openapi/release-automation.openapi.yaml +48 -14
- package/openapi/schemas/common/agent.yaml +30 -29
- package/openapi/schemas/common/economics.yaml +98 -0
- package/openapi/schemas/common/errors.yaml +13 -3
- package/openapi/schemas/common/metadata.yaml +22 -7
- package/openapi/schemas/common/pagination.yaml +18 -6
- package/openapi/schemas/common/security.yaml +13 -5
- package/openapi/schemas/index.yaml +49 -42
- package/openapi/uadp-asyncapi.yaml +5 -3
- package/openapi/uadp-openapi.yaml +243 -165
- package/openapi/version-management.openapi.yaml +142 -135
- package/package.json +43 -14
- package/spec/extensions/cognition.schema.json +87 -0
- package/spec/extensions/role-manifest.md +188 -0
- package/spec/layer4-economics/duadp-examples.json +44 -0
- package/spec/v0.4/agent.schema.json +14 -0
- package/spec/v0.4/extensions/mcp/README.md +1 -1
- package/spec/v0.5/agent-builder-openapi.yaml +230 -0
- package/spec/v0.5/agent.schema.json +34 -2
- 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/memory-hierarchy.yaml +120 -0
- package/spec/v0.5/role.schema.json +268 -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 -557
- 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)
|
|
@@ -21,8 +21,12 @@ export * from './architect.js';
|
|
|
21
21
|
export * from './security.js';
|
|
22
22
|
// Export Skill types (AgentSkills / OSSA skills)
|
|
23
23
|
export { isOssaSkill } from './skill.js';
|
|
24
|
+
// Export Role types (v0.5 — IDE operator contexts)
|
|
25
|
+
export { createRoleManifest, isOssaRole } from './role.js';
|
|
24
26
|
// Export MCP server manifest types
|
|
25
27
|
export { isOssaMCPServer } from './mcp-server-manifest.js';
|
|
26
|
-
// Export
|
|
28
|
+
// Export Cognition types (v0.4 — CAOE)
|
|
29
|
+
export * from './cognition.zod.js';
|
|
30
|
+
// v0.5: Protocol Declarations
|
|
27
31
|
export * from './protocols.js';
|
|
28
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,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Role Manifest Types
|
|
3
|
+
* Type definitions for role.ossa.yaml manifests (kind: Role)
|
|
4
|
+
*
|
|
5
|
+
* Roles define behavioral overlays for IDE/CLI agents (Claude Code, Cursor, etc.)
|
|
6
|
+
* Unlike Agents (autonomous loops), Roles configure operator context — instructions,
|
|
7
|
+
* tool access, hooks, MCP connections, and activation conditions.
|
|
8
|
+
*/
|
|
9
|
+
export interface OssaRole {
|
|
10
|
+
apiVersion: string;
|
|
11
|
+
kind: 'Role';
|
|
12
|
+
metadata: RoleMetadata;
|
|
13
|
+
spec: RoleSpec;
|
|
14
|
+
extensions?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface RoleMetadata {
|
|
17
|
+
/** DNS-style role name (lowercase, hyphens) */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Semantic version */
|
|
20
|
+
version?: string;
|
|
21
|
+
/** Human-readable description */
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Key-value labels for filtering and categorization */
|
|
24
|
+
labels?: Record<string, string>;
|
|
25
|
+
/** Non-identifying metadata */
|
|
26
|
+
annotations?: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
export interface RoleSpec {
|
|
29
|
+
/** System prompt / persona definition */
|
|
30
|
+
role?: string;
|
|
31
|
+
/** Behavioral instructions */
|
|
32
|
+
instructions?: RoleInstructions;
|
|
33
|
+
/** Tool access configuration */
|
|
34
|
+
tools?: RoleTools;
|
|
35
|
+
/** Lifecycle hooks */
|
|
36
|
+
hooks?: RoleHooks;
|
|
37
|
+
/** Context injection */
|
|
38
|
+
context?: RoleContext;
|
|
39
|
+
/** Protocol connections */
|
|
40
|
+
protocols?: RoleProtocols;
|
|
41
|
+
/** Role composition — inherit from other roles */
|
|
42
|
+
extends?: RoleExtension[];
|
|
43
|
+
/** Activation conditions */
|
|
44
|
+
activation?: RoleActivation;
|
|
45
|
+
}
|
|
46
|
+
export interface RoleInstructions {
|
|
47
|
+
/** Markdown content prepended to every conversation */
|
|
48
|
+
preamble?: string;
|
|
49
|
+
/** Hard rules — MUST/MUST NOT statements */
|
|
50
|
+
constraints?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface RoleTools {
|
|
53
|
+
/** Whitelist of allowed tool names */
|
|
54
|
+
allowed?: string[];
|
|
55
|
+
/** Blacklist of denied tool names (overrides allowed) */
|
|
56
|
+
denied?: string[];
|
|
57
|
+
/** References to OSSA Skill manifests */
|
|
58
|
+
skills?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface RoleHooks {
|
|
61
|
+
/** Run when role is activated */
|
|
62
|
+
on_activate?: string;
|
|
63
|
+
/** Run when switching away from this role */
|
|
64
|
+
on_deactivate?: string;
|
|
65
|
+
/** Run before git commits */
|
|
66
|
+
pre_commit?: string;
|
|
67
|
+
/** Run after file saves */
|
|
68
|
+
post_save?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface RoleContext {
|
|
71
|
+
/** Paths to JSON Schema or OpenAPI spec files */
|
|
72
|
+
schemas?: string[];
|
|
73
|
+
/** Files to include in agent context */
|
|
74
|
+
files?: RoleContextFile[];
|
|
75
|
+
/** Paths to knowledge base documents */
|
|
76
|
+
knowledge?: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface RoleContextFile {
|
|
79
|
+
/** File path or glob pattern */
|
|
80
|
+
path: string;
|
|
81
|
+
/** Description of what this file provides */
|
|
82
|
+
description?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface RoleProtocols {
|
|
85
|
+
/** MCP server connections */
|
|
86
|
+
mcp?: RoleMCPConfig;
|
|
87
|
+
}
|
|
88
|
+
export interface RoleMCPConfig {
|
|
89
|
+
/** MCP servers available when this role is active */
|
|
90
|
+
servers?: RoleMCPServer[];
|
|
91
|
+
}
|
|
92
|
+
export interface RoleMCPServer {
|
|
93
|
+
/** Server identifier */
|
|
94
|
+
name: string;
|
|
95
|
+
/** Transport type */
|
|
96
|
+
transport: 'stdio' | 'sse';
|
|
97
|
+
/** Command to spawn (stdio transport) */
|
|
98
|
+
command?: string;
|
|
99
|
+
/** Command arguments (stdio transport) */
|
|
100
|
+
args?: string[];
|
|
101
|
+
/** Endpoint URL (SSE transport) */
|
|
102
|
+
url?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface RoleExtension {
|
|
105
|
+
/** Name of the parent role to inherit from */
|
|
106
|
+
role: string;
|
|
107
|
+
/** If true, child fields replace parent fields; if false, they merge */
|
|
108
|
+
override?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface RoleActivation {
|
|
111
|
+
/** Glob patterns — activate when matching files are open */
|
|
112
|
+
file_patterns?: string[];
|
|
113
|
+
/** CLI command to activate (e.g., "/role drupal") */
|
|
114
|
+
command?: string;
|
|
115
|
+
/** Environment variable conditions (all must match) */
|
|
116
|
+
env?: Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Type guard for OssaRole
|
|
120
|
+
*/
|
|
121
|
+
export declare function isOssaRole(obj: unknown): obj is OssaRole;
|
|
122
|
+
/**
|
|
123
|
+
* Create a minimal OssaRole manifest
|
|
124
|
+
*/
|
|
125
|
+
export declare function createRoleManifest(name: string, description: string, role?: string): OssaRole;
|
|
126
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Role Manifest Types
|
|
3
|
+
* Type definitions for role.ossa.yaml manifests (kind: Role)
|
|
4
|
+
*
|
|
5
|
+
* Roles define behavioral overlays for IDE/CLI agents (Claude Code, Cursor, etc.)
|
|
6
|
+
* Unlike Agents (autonomous loops), Roles configure operator context — instructions,
|
|
7
|
+
* tool access, hooks, MCP connections, and activation conditions.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Type guard for OssaRole
|
|
11
|
+
*/
|
|
12
|
+
export function isOssaRole(obj) {
|
|
13
|
+
if (!obj || typeof obj !== 'object')
|
|
14
|
+
return false;
|
|
15
|
+
const o = obj;
|
|
16
|
+
return (o.kind === 'Role' &&
|
|
17
|
+
typeof o.apiVersion === 'string' &&
|
|
18
|
+
o.metadata != null &&
|
|
19
|
+
o.spec != null);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a minimal OssaRole manifest
|
|
23
|
+
*/
|
|
24
|
+
export function createRoleManifest(name, description, role) {
|
|
25
|
+
return {
|
|
26
|
+
apiVersion: 'ossa/v0.5',
|
|
27
|
+
kind: 'Role',
|
|
28
|
+
metadata: {
|
|
29
|
+
name,
|
|
30
|
+
version: '1.0.0',
|
|
31
|
+
description,
|
|
32
|
+
},
|
|
33
|
+
spec: {
|
|
34
|
+
...(role ? { role } : {}),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -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
|
|
@@ -22,7 +22,7 @@ export class OSSAValidator {
|
|
|
22
22
|
});
|
|
23
23
|
addFormats(this.ajv);
|
|
24
24
|
// Load schema
|
|
25
|
-
const defaultSchemaPath = join(__dirname, '../spec/v0.
|
|
25
|
+
const defaultSchemaPath = join(__dirname, '../spec/v0.5/agent.schema.json');
|
|
26
26
|
const resolvedPath = schemaPath || defaultSchemaPath;
|
|
27
27
|
try {
|
|
28
28
|
const schemaContent = readFileSync(resolvedPath, 'utf-8');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
apiVersion: ossa/v0.
|
|
1
|
+
apiVersion: ossa/v0.5
|
|
2
2
|
kind: Agent
|
|
3
3
|
metadata:
|
|
4
4
|
name: customer-support-bot
|
|
@@ -26,19 +26,16 @@ spec:
|
|
|
26
26
|
- Clear and concise explanations
|
|
27
27
|
- Proactive in offering solutions
|
|
28
28
|
- Transparent about limitations
|
|
29
|
-
|
|
30
29
|
llm:
|
|
31
30
|
provider: openai
|
|
32
31
|
model: gpt-4o
|
|
33
32
|
temperature: 0.7
|
|
34
33
|
maxTokens: 1500
|
|
35
|
-
|
|
36
34
|
capabilities:
|
|
37
35
|
- search_documentation
|
|
38
36
|
- create_ticket
|
|
39
37
|
- send_email
|
|
40
38
|
- conversation_memory
|
|
41
|
-
|
|
42
39
|
tools:
|
|
43
40
|
- type: function
|
|
44
41
|
name: search_docs
|
|
@@ -55,7 +52,6 @@ spec:
|
|
|
55
52
|
default: 5
|
|
56
53
|
required:
|
|
57
54
|
- query
|
|
58
|
-
|
|
59
55
|
- type: function
|
|
60
56
|
name: create_ticket
|
|
61
57
|
description: Create a support ticket for issues requiring human attention
|
|
@@ -70,7 +66,11 @@ spec:
|
|
|
70
66
|
description: Detailed description of the issue
|
|
71
67
|
priority:
|
|
72
68
|
type: string
|
|
73
|
-
enum:
|
|
69
|
+
enum:
|
|
70
|
+
- low
|
|
71
|
+
- medium
|
|
72
|
+
- high
|
|
73
|
+
- urgent
|
|
74
74
|
description: Priority level of the ticket
|
|
75
75
|
category:
|
|
76
76
|
type: string
|
|
@@ -79,7 +79,6 @@ spec:
|
|
|
79
79
|
- title
|
|
80
80
|
- description
|
|
81
81
|
- priority
|
|
82
|
-
|
|
83
82
|
- type: function
|
|
84
83
|
name: send_email
|
|
85
84
|
description: Send follow-up email to customer
|
|
@@ -98,12 +97,14 @@ spec:
|
|
|
98
97
|
template:
|
|
99
98
|
type: string
|
|
100
99
|
description: Email template to use
|
|
101
|
-
enum:
|
|
100
|
+
enum:
|
|
101
|
+
- follow_up
|
|
102
|
+
- resolution
|
|
103
|
+
- escalation
|
|
102
104
|
required:
|
|
103
105
|
- to
|
|
104
106
|
- subject
|
|
105
107
|
- body
|
|
106
|
-
|
|
107
108
|
autonomy:
|
|
108
109
|
level: supervised
|
|
109
110
|
approval_required: false
|
|
@@ -112,7 +113,6 @@ spec:
|
|
|
112
113
|
action: notify_human
|
|
113
114
|
- condition: ticket_count > 3
|
|
114
115
|
action: escalate
|
|
115
|
-
|
|
116
116
|
memory:
|
|
117
117
|
enabled: true
|
|
118
118
|
type: conversation_buffer
|
|
@@ -121,7 +121,6 @@ spec:
|
|
|
121
121
|
enabled: true
|
|
122
122
|
backend: redis
|
|
123
123
|
ttl: 86400
|
|
124
|
-
|
|
125
124
|
safety:
|
|
126
125
|
input_filters:
|
|
127
126
|
- type: pii_detection
|
|
@@ -132,8 +131,9 @@ spec:
|
|
|
132
131
|
- type: hallucination_check
|
|
133
132
|
threshold: 0.8
|
|
134
133
|
- type: tone_analysis
|
|
135
|
-
required_sentiment:
|
|
136
|
-
|
|
134
|
+
required_sentiment:
|
|
135
|
+
- positive
|
|
136
|
+
- neutral
|
|
137
137
|
observability:
|
|
138
138
|
logging:
|
|
139
139
|
level: info
|
|
@@ -150,23 +150,16 @@ spec:
|
|
|
150
150
|
tracing:
|
|
151
151
|
enabled: true
|
|
152
152
|
provider: opentelemetry
|
|
153
|
-
|
|
154
153
|
extensions:
|
|
155
154
|
langchain:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
langchain_tool: send_email
|
|
168
|
-
tool_class: EmailTool
|
|
169
|
-
export_config:
|
|
170
|
-
format: python
|
|
171
|
-
include_dependencies: true
|
|
172
|
-
output_file: customer_support_agent.py
|
|
155
|
+
enabled: true
|
|
156
|
+
chain_type: agent
|
|
157
|
+
memory:
|
|
158
|
+
type: buffer
|
|
159
|
+
tools:
|
|
160
|
+
- name: search_docs
|
|
161
|
+
description: Search the knowledge base for relevant documentation
|
|
162
|
+
- name: create_ticket
|
|
163
|
+
description: Create a support ticket for issues requiring human attention
|
|
164
|
+
- name: send_email
|
|
165
|
+
description: Send follow-up email to customer
|