@bluefly/openstandardagents 0.2.5-RC → 0.2.7
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/.github/ISSUE_TEMPLATE/bug_report.yml +63 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +40 -0
- package/.github/workflows/dependabot-comment.yml +34 -0
- package/.github/workflows/pr-comment.yml +33 -0
- package/.husky/pre-commit +5 -0
- package/.kiro/config.json +21 -0
- package/.kiro/settings/mcp.json +61 -0
- package/.kiro/specs/scripts-migration-api-first/design.md +883 -0
- package/.kiro/specs/scripts-migration-api-first/requirements.md +165 -0
- package/.kiro/specs/scripts-migration-api-first/tasks.md +539 -0
- package/.kiro/specs/{website-design-audit → website-brand-identity}/design.md +381 -0
- package/.kiro/specs/{website-design-audit → website-brand-identity}/requirements.md +88 -0
- package/.kiro/specs/website-brand-identity/tasks.md +981 -0
- package/CHANGELOG.md +23 -0
- package/README.md +12 -3
- package/bin/ossa-dev +42 -0
- package/bin/ossa-export +32 -0
- package/bin/ossa-generate +60 -0
- package/bin/ossa-health +40 -0
- package/bin/ossa-init +26 -0
- package/dist/repositories/schema.repository.d.ts.map +1 -1
- package/dist/repositories/schema.repository.js +15 -10
- package/dist/repositories/schema.repository.js.map +1 -1
- package/dist/services/github-sync/github-client.d.ts +14 -0
- package/dist/services/github-sync/github-client.d.ts.map +1 -0
- package/dist/services/github-sync/github-client.js +41 -0
- package/dist/services/github-sync/github-client.js.map +1 -0
- package/dist/services/github-sync/gitlab-client.d.ts +17 -0
- package/dist/services/github-sync/gitlab-client.d.ts.map +1 -0
- package/dist/services/github-sync/gitlab-client.js +42 -0
- package/dist/services/github-sync/gitlab-client.js.map +1 -0
- package/dist/services/github-sync/schemas.d.ts +46 -0
- package/dist/services/github-sync/schemas.d.ts.map +1 -0
- package/dist/services/github-sync/schemas.js +36 -0
- package/dist/services/github-sync/schemas.js.map +1 -0
- package/dist/services/github-sync/sync.service.d.ts +27 -0
- package/dist/services/github-sync/sync.service.d.ts.map +1 -0
- package/dist/services/github-sync/sync.service.js +99 -0
- package/dist/services/github-sync/sync.service.js.map +1 -0
- package/dist/services/runtime/claude/capability-mapper.d.ts +84 -0
- package/dist/services/runtime/claude/capability-mapper.d.ts.map +1 -0
- package/dist/services/runtime/claude/capability-mapper.js +245 -0
- package/dist/services/runtime/claude/capability-mapper.js.map +1 -0
- package/dist/services/runtime/claude/claude-adapter.d.ts +80 -0
- package/dist/services/runtime/claude/claude-adapter.d.ts.map +1 -0
- package/dist/services/runtime/claude/claude-adapter.js +287 -0
- package/dist/services/runtime/claude/claude-adapter.js.map +1 -0
- package/dist/services/runtime/claude/manifest-parser.d.ts +77 -0
- package/dist/services/runtime/claude/manifest-parser.d.ts.map +1 -0
- package/dist/services/runtime/claude/manifest-parser.js +169 -0
- package/dist/services/runtime/claude/manifest-parser.js.map +1 -0
- package/dist/services/runtime/claude/types.d.ts +115 -0
- package/dist/services/runtime/claude/types.d.ts.map +1 -0
- package/dist/services/runtime/claude/types.js +6 -0
- package/dist/services/runtime/claude/types.js.map +1 -0
- package/dist/services/validation.service.d.ts.map +1 -1
- package/dist/services/validation.service.js +12 -1
- package/dist/services/validation.service.js.map +1 -1
- package/dist/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
- package/dist/spec/v0.2.6/CHANGELOG.md +401 -0
- package/dist/spec/v0.2.6/README.md +72 -0
- package/dist/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/dist/spec/v0.2.6/ossa-0.2.6.schema.json +1786 -0
- package/dist/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
- package/dist/spec/v0.2.6-dev/CHANGELOG.md +164 -0
- package/dist/spec/v0.2.6-dev/README.md +75 -0
- package/dist/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/dist/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/{v0.2.4/ossa-0.2.4-dev.schema.json → v0.2.6-dev/ossa-0.2.5.schema.json} +9 -9
- package/dist/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
- package/{spec/v0.2.4/ossa-0.2.4-dev.schema.json → dist/spec/v0.2.6-dev/ossa-0.2.6-dev.schema.json} +9 -9
- package/dist/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
- package/dist/spec/v0.2.7/core/agentgraph.md +324 -0
- package/dist/spec/v0.2.7/resources/agentgraph.yaml +135 -0
- package/docs/brand-guide/01-brand-overview.md +37 -0
- package/docs/brand-guide/02-logo-usage.md +43 -0
- package/docs/brand-guide/03-color-palette.md +70 -0
- package/docs/brand-guide/04-typography.md +82 -0
- package/docs/brand-guide/05-voice-and-tone.md +108 -0
- package/docs/brand-guide/06-visual-elements.md +137 -0
- package/docs/brand-guide/07-application-examples.md +153 -0
- package/docs/brand-guide/OssaLogo/OssA_Logo.svg +21 -0
- package/docs/brand-guide/OssaLogo/brand.af +0 -0
- package/docs/brand-guide/README.md +107 -0
- package/docs/comparison.md +315 -0
- package/docs/operations/automation-roadmap.md +245 -0
- package/docs/operations/github-sync-strategy.md +357 -0
- package/examples/anthropic/claude-assistant.ossa.json +5 -4
- package/examples/autogen/multi-agent.ossa.json +6 -4
- package/examples/crewai/research-team.ossa.json +14 -5
- package/examples/cursor/code-review-agent.ossa.json +21 -6
- package/examples/langchain/chain-agent.ossa.json +21 -5
- package/examples/langflow/workflow-agent.ossa.json +2 -3
- package/examples/langgraph/state-machine-agent.ossa.json +2 -3
- package/examples/llamaindex/rag-agent.ossa.json +2 -3
- package/examples/openai/multi-tool-agent.ossa.json +32 -9
- package/examples/openai/swarm-agent.ossa.json +18 -5
- package/examples/vercel/edge-agent.ossa.json +5 -4
- package/openapi/github-sync.yaml +115 -0
- package/package.json +25 -4
- package/scripts/README.md +103 -0
- package/scripts/auto-rebase-mrs.ts +106 -0
- package/scripts/batch-dependabot.sh +57 -0
- package/scripts/configure-gitlab-branch-protection.ts +95 -0
- package/scripts/create-issue-helper.ts +238 -0
- package/scripts/create-milestone-issue.ts +73 -0
- package/scripts/fix-schema-formats.js +82 -0
- package/scripts/generate-agents-catalog.ts +77 -0
- package/scripts/generate-api-docs.ts +218 -0
- package/scripts/generate-cli-docs.ts +410 -0
- package/scripts/generate-config-docs.ts +109 -0
- package/scripts/generate-errors-docs.ts +76 -0
- package/scripts/generate-examples-docs.ts +99 -0
- package/scripts/generate-schema-docs.ts +296 -0
- package/scripts/generate-types-docs.ts +48 -0
- package/scripts/lowercase-docs.ts +43 -0
- package/scripts/manage-milestone-mrs.ts +279 -0
- package/scripts/rebase-all-mrs.sh +75 -0
- package/scripts/sync-github-pr.sh +48 -0
- package/scripts/sync-version.js +40 -0
- package/scripts/sync-wiki.sh +50 -0
- package/scripts/validate-all.js +127 -0
- package/spec/v0.2.4/ossa-0.2.4.schema.json +85 -208
- package/spec/v0.2.6/CHANGELOG.md +401 -0
- package/spec/v0.2.6/README.md +72 -0
- package/spec/v0.2.6/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.6/migrations/v0.2.5-RC-to-v0.2.6.md +65 -0
- package/spec/v0.2.6/ossa-0.2.6.schema.json +1786 -0
- package/spec/v0.2.6/ossa-0.2.6.yaml +581 -0
- package/spec/v0.2.6-dev/CHANGELOG.md +164 -0
- package/spec/v0.2.6-dev/README.md +75 -0
- package/spec/v0.2.6-dev/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/spec/v0.2.6-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/spec/v0.2.6-dev/ossa-0.2.5.schema.json +1696 -0
- package/spec/v0.2.6-dev/ossa-0.2.5.yaml +581 -0
- package/spec/v0.2.6-dev/ossa-0.2.6-dev.schema.json +1696 -0
- package/spec/v0.2.6-dev/ossa-0.2.6-dev.yaml +448 -0
- package/spec/v0.2.7/core/agentgraph.md +324 -0
- package/spec/v0.2.7/resources/agentgraph.yaml +135 -0
- package/website/DESIGN_SYSTEM_IMPLEMENTATION.md +445 -0
- package/website/app/about/page.tsx +53 -44
- package/website/app/ecosystem/page.tsx +146 -111
- package/website/app/globals.scss +256 -21
- package/website/app/page.tsx +394 -182
- package/website/app/page.tsx.bak +679 -0
- package/website/app/page.tsx.bak2 +649 -0
- package/website/app/schema/page.tsx +3 -3
- package/website/app/specification/page.tsx +1 -1
- package/website/components/layout/Header.tsx +27 -23
- package/website/components/ui/Badge.tsx +82 -0
- package/website/components/ui/Button.tsx +116 -0
- package/website/components/ui/Card.tsx +167 -0
- package/website/components/ui/Checkbox.tsx +141 -0
- package/website/components/ui/Input.tsx +169 -0
- package/website/components/ui/Radio.tsx +141 -0
- package/website/components/ui/Select.tsx +182 -0
- package/website/components/ui/Tag.tsx +158 -0
- package/website/components/ui/Textarea.tsx +195 -0
- package/website/components/ui/index.ts +11 -0
- package/website/content/docs/{00-HOME.md → 00-home.md} +1 -1
- package/website/content/docs/agents/catalog.md +28 -0
- package/website/content/docs/{AIFlow-Framework-Integration-with-OSSA.md → aiflow-framework-integration-with-ossa.md} +2 -2
- package/website/content/docs/api-reference/index.md +38 -0
- package/website/content/docs/api-reference/ossa-core-api.md +634 -0
- package/website/content/docs/api-reference/ossa-registry-api.md +515 -0
- package/website/content/docs/api-reference/unified-agent-gateway.md +599 -0
- package/website/content/docs/cli-reference/index.md +111 -0
- package/website/content/docs/cli-reference/ossa-agents.md +70 -0
- package/website/content/docs/cli-reference/ossa-export.md +56 -0
- package/website/content/docs/cli-reference/ossa-generate.md +66 -0
- package/website/content/docs/cli-reference/ossa-gitlab-agent.md +57 -0
- package/website/content/docs/cli-reference/ossa-import.md +56 -0
- package/website/content/docs/cli-reference/ossa-init.md +57 -0
- package/website/content/docs/cli-reference/ossa-migrate.md +62 -0
- package/website/content/docs/cli-reference/ossa-run.md +66 -0
- package/website/content/docs/cli-reference/ossa-schema.md +57 -0
- package/website/content/docs/cli-reference/ossa-setup.md +57 -0
- package/website/content/docs/cli-reference/ossa-validate.md +66 -0
- package/website/content/docs/configuration/index.md +97 -0
- package/website/content/docs/deployment/github-mirroring.md +924 -0
- package/website/content/docs/documentation.md +100 -0
- package/website/content/docs/ecosystem/framework-support.md +551 -9
- package/website/content/docs/errors/index.md +10 -0
- package/website/content/docs/examples/{AIFlow-Framework-Integration-with-OSSA.md → aiflow-framework-integration-with-ossa.md} +2 -2
- package/website/content/docs/examples/catalog.md +300 -0
- package/website/content/docs/for-audiences/{Students-Researchers.md → students-researchers.md} +1 -1
- package/website/content/docs/getting-started/{Installation.md → installation.md} +1 -1
- package/website/content/docs/getting-started.md +1 -1
- package/website/content/docs/integrations/aiflow.md +2 -2
- package/website/content/docs/migration-guides/anthropic-mcp-to-ossa.md +5 -5
- package/website/content/docs/migration-guides/crewai-to-ossa.md +3 -3
- package/website/content/docs/migration-guides/drupal-eca-to-ossa.md +7 -7
- package/website/content/docs/migration-guides/langchain-to-ossa.md +4 -4
- package/website/content/docs/openapi-extensions/index.md +1 -1
- package/website/content/docs/ossa-compliant-badge.md +1 -1
- package/website/content/docs/pre-release/index.md +5 -5
- package/website/content/docs/releases/v0.2.6.md +99 -0
- package/website/content/docs/schema-reference/agent-capabilities.md +50 -0
- package/website/content/docs/schema-reference/agent-id.md +52 -0
- package/website/content/docs/schema-reference/agent-name.md +50 -0
- package/website/content/docs/schema-reference/agent-role.md +54 -0
- package/website/content/docs/schema-reference/agent-version.md +50 -0
- package/website/content/docs/schema-reference/index.md +26 -157
- package/website/content/docs/types-reference/index.md +105 -0
- package/website/content/docs/versioning.md +3 -3
- package/website/dev.sh +53 -0
- package/website/docker-compose.dev.yml +36 -0
- package/website/lib/version.ts +1 -1
- package/website/lib/versions.json +45 -20
- package/website/package.json +1 -1
- package/website/styles/_spacing.scss +453 -0
- package/website/styles/_tokens.scss +245 -0
- package/website/styles/_typography.scss +361 -0
- package/website/styles/_variables.scss +270 -19
- package/website/tailwind.config.ts +113 -79
- package/.kiro/specs/agent-buildkit-templates/design.md +0 -495
- package/.kiro/specs/agent-buildkit-templates/requirements.md +0 -165
- package/.kiro/specs/kiro-ide-supercharger/README.md +0 -202
- package/.kiro/specs/kiro-ide-supercharger/design.md +0 -1005
- package/.kiro/specs/kiro-ide-supercharger/requirements.md +0 -141
- package/.kiro/specs/kiro-ide-supercharger/tasks.md +0 -507
- package/docs/issue-19-completion-summary.md +0 -648
- package/docs/issue-19-validation.md +0 -351
- package/website/content/docs/Examples.md +0 -71
- package/website/content/docs/OpenAPI-Extensions.md +0 -934
- package/website/content/docs/core-concepts/Project-Structure.md +0 -348
- package/website/content/docs/examples/Migration-Guides.md +0 -214
- package/website/content/docs/for-audiences/Architects.md +0 -224
- package/website/content/docs/for-audiences/Developers.md +0 -220
- package/website/content/docs/for-audiences/Enterprises.md +0 -256
- package/website/content/docs/getting-started/5-Minute-Overview.md +0 -85
- package/website/content/docs/getting-started/First-Agent.md +0 -196
- package/website/content/docs/getting-started/Hello-World.md +0 -184
- package/website/content/docs/migration-guides/00-INDEX.md +0 -76
- package/website/content/docs/migration-guides/README.md +0 -133
- /package/dist/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
- /package/spec/v0.2.4/{ossa-0.2.4-dev.yaml → ossa-0.2.4.yaml} +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { GitHubClient } from './github-client.js';
|
|
2
|
+
import { GitLabClient } from './gitlab-client.js';
|
|
3
|
+
import { SyncConfigSchema } from './schemas.js';
|
|
4
|
+
export class GitHubSyncService {
|
|
5
|
+
github;
|
|
6
|
+
gitlab;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
const validated = SyncConfigSchema.parse(config);
|
|
9
|
+
this.github = new GitHubClient(validated.github.token, validated.github.owner, validated.github.repo);
|
|
10
|
+
this.gitlab = new GitLabClient(validated.gitlab.token, validated.gitlab.projectId);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sync a GitHub PR to GitLab MR
|
|
14
|
+
*/
|
|
15
|
+
async syncPR(prNumber) {
|
|
16
|
+
const pr = await this.github.getPR(prNumber);
|
|
17
|
+
const branchName = `github-pr-${prNumber}`;
|
|
18
|
+
const mr = await this.gitlab.createMR({
|
|
19
|
+
title: `GitHub PR #${prNumber}: ${pr.title}`,
|
|
20
|
+
description: this.buildMRDescription(pr),
|
|
21
|
+
sourceBranch: branchName,
|
|
22
|
+
targetBranch: 'main',
|
|
23
|
+
labels: ['github-pr'],
|
|
24
|
+
});
|
|
25
|
+
await this.github.createComment(prNumber, this.buildPRComment(mr));
|
|
26
|
+
return mr;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Batch sync multiple PRs (e.g., Dependabot)
|
|
30
|
+
*/
|
|
31
|
+
async batchSyncPRs(filters) {
|
|
32
|
+
const prs = await this.github.listPRs(filters);
|
|
33
|
+
if (prs.length === 0) {
|
|
34
|
+
throw new Error('No PRs found matching filters');
|
|
35
|
+
}
|
|
36
|
+
const branchName = `batch-${filters.author || 'prs'}-${Date.now()}`;
|
|
37
|
+
const mr = await this.gitlab.createMR({
|
|
38
|
+
title: `Batch: ${prs.length} PRs from ${filters.author || 'GitHub'}`,
|
|
39
|
+
description: this.buildBatchMRDescription(prs),
|
|
40
|
+
sourceBranch: branchName,
|
|
41
|
+
targetBranch: 'main',
|
|
42
|
+
labels: ['batch-sync', filters.author || 'github'].filter(Boolean),
|
|
43
|
+
});
|
|
44
|
+
// Comment on all PRs
|
|
45
|
+
await Promise.all(prs.map(pr => this.github.createComment(pr.number, this.buildBatchPRComment(mr))));
|
|
46
|
+
return mr;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* List PRs ready for sync
|
|
50
|
+
*/
|
|
51
|
+
async listSyncablePRs(filters) {
|
|
52
|
+
return this.github.listPRs(filters);
|
|
53
|
+
}
|
|
54
|
+
buildMRDescription(pr) {
|
|
55
|
+
return `**From GitHub PR**: https://github.com/${this.github['owner']}/${this.github['repo']}/pull/${pr.number}
|
|
56
|
+
**Author**: @${pr.author.login}
|
|
57
|
+
|
|
58
|
+
${pr.body || ''}
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
*This MR was created from a GitHub pull request. Once merged, changes will sync back to GitHub.*`;
|
|
63
|
+
}
|
|
64
|
+
buildBatchMRDescription(prs) {
|
|
65
|
+
const prList = prs.map(pr => `- #${pr.number}: ${pr.title} (by @${pr.author.login})`).join('\n');
|
|
66
|
+
return `Batched ${prs.length} pull requests from GitHub:
|
|
67
|
+
|
|
68
|
+
${prList}
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
*These PRs will auto-close when this MR merges and syncs back to GitHub.*`;
|
|
73
|
+
}
|
|
74
|
+
buildPRComment(mr) {
|
|
75
|
+
return `✅ **Synced to GitLab**
|
|
76
|
+
|
|
77
|
+
This PR has been synced to our internal GitLab for review and testing.
|
|
78
|
+
|
|
79
|
+
**GitLab MR**: ${mr.web_url}
|
|
80
|
+
|
|
81
|
+
Once merged on GitLab, changes will automatically sync back here and this PR will close.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
*Development happens at [gitlab.com](${mr.web_url})*`;
|
|
85
|
+
}
|
|
86
|
+
buildBatchPRComment(mr) {
|
|
87
|
+
return `🤖 **Batched for Review**
|
|
88
|
+
|
|
89
|
+
This PR has been batched with other updates for testing on GitLab.
|
|
90
|
+
|
|
91
|
+
**GitLab MR**: ${mr.web_url}
|
|
92
|
+
|
|
93
|
+
Once merged, this PR will automatically close.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
*Development happens at [gitlab.com](${mr.web_url})*`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=sync.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.service.js","sourceRoot":"","sources":["../../../src/services/github-sync/sync.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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MAAM;eACnG,EAAE,CAAC,MAAM,CAAC,KAAK;;EAE5B,EAAE,CAAC,IAAI,IAAI,EAAE;;;;iGAIkF,CAAC;IAChG,CAAC;IAEO,uBAAuB,CAAC,GAAe;QAC7C,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAC1B,MAAM,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,MAAM,CAAC,KAAK,GAAG,CACxD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO,WAAW,GAAG,CAAC,MAAM;;EAE9B,MAAM;;;;0EAIkE,CAAC;IACzE,CAAC;IAEO,cAAc,CAAC,EAAY;QACjC,OAAO;;;;iBAIM,EAAE,CAAC,OAAO;;;;;uCAKY,EAAE,CAAC,OAAO,IAAI,CAAC;IACpD,CAAC;IAEO,mBAAmB,CAAC,EAAY;QACtC,OAAO;;;;iBAIM,EAAE,CAAC,OAAO;;;;;uCAKY,EAAE,CAAC,OAAO,IAAI,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability Mapper for Claude Adapter
|
|
3
|
+
* Maps OSSA capabilities and tools to Claude tool definitions
|
|
4
|
+
*/
|
|
5
|
+
import type { ClaudeTool, ToolDefinition } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Transport types supported by OSSA
|
|
8
|
+
*/
|
|
9
|
+
export type TransportType = 'mcp' | 'http' | 'function' | 'grpc';
|
|
10
|
+
/**
|
|
11
|
+
* OSSA tool specification
|
|
12
|
+
*/
|
|
13
|
+
export interface OssaTool {
|
|
14
|
+
type: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
server?: string;
|
|
17
|
+
namespace?: string;
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
config?: Record<string, unknown>;
|
|
21
|
+
auth?: {
|
|
22
|
+
type: string;
|
|
23
|
+
credentials?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Maps OSSA capabilities and tools to Claude tool format
|
|
28
|
+
*/
|
|
29
|
+
export declare class CapabilityMapper {
|
|
30
|
+
private tools;
|
|
31
|
+
/**
|
|
32
|
+
* Map Claude extension tools
|
|
33
|
+
*/
|
|
34
|
+
mapClaudeTools(claudeTools: ClaudeTool[]): void;
|
|
35
|
+
/**
|
|
36
|
+
* Map OSSA spec tools to Claude format
|
|
37
|
+
*/
|
|
38
|
+
mapOssaTools(ossaTools: OssaTool[]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Map MCP (Model Context Protocol) capabilities
|
|
41
|
+
*/
|
|
42
|
+
mapMcpCapabilities(capabilities: string[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Map HTTP endpoint to Claude tool
|
|
45
|
+
*/
|
|
46
|
+
mapHttpTool(tool: OssaTool): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get all mapped tools as Claude tool format
|
|
49
|
+
*/
|
|
50
|
+
getClaudeTools(): ClaudeTool[];
|
|
51
|
+
/**
|
|
52
|
+
* Get all tools with handlers
|
|
53
|
+
*/
|
|
54
|
+
getTools(): Map<string, ToolDefinition>;
|
|
55
|
+
/**
|
|
56
|
+
* Register a tool handler
|
|
57
|
+
*/
|
|
58
|
+
registerToolHandler(name: string, handler: (args: Record<string, unknown>) => Promise<string>): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a tool exists
|
|
61
|
+
*/
|
|
62
|
+
hasTool(name: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Get a specific tool
|
|
65
|
+
*/
|
|
66
|
+
getTool(name: string): ToolDefinition | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Clear all tools
|
|
69
|
+
*/
|
|
70
|
+
clear(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Generate tool name from OSSA tool spec
|
|
73
|
+
*/
|
|
74
|
+
private generateToolName;
|
|
75
|
+
/**
|
|
76
|
+
* Generate tool description from OSSA tool spec
|
|
77
|
+
*/
|
|
78
|
+
private generateToolDescription;
|
|
79
|
+
/**
|
|
80
|
+
* Generate input schema from OSSA tool spec
|
|
81
|
+
*/
|
|
82
|
+
private generateInputSchema;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=capability-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-mapper.d.ts","sourceRoot":"","sources":["../../../../src/services/runtime/claude/capability-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAA0C;IAEvD;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAY/C;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI;IAmBzC;;OAEG;IACH,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAyBhD;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAiCjC;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE;IAQ9B;;OAEG;IACH,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC;IAIvC;;OAEG;IACH,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GAC1D,OAAO;IAUV;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIjD;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmBxB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;CA8E5B"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability Mapper for Claude Adapter
|
|
3
|
+
* Maps OSSA capabilities and tools to Claude tool definitions
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Maps OSSA capabilities and tools to Claude tool format
|
|
7
|
+
*/
|
|
8
|
+
export class CapabilityMapper {
|
|
9
|
+
tools = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Map Claude extension tools
|
|
12
|
+
*/
|
|
13
|
+
mapClaudeTools(claudeTools) {
|
|
14
|
+
for (const tool of claudeTools) {
|
|
15
|
+
const toolDef = {
|
|
16
|
+
name: tool.name,
|
|
17
|
+
description: tool.description,
|
|
18
|
+
input_schema: tool.input_schema,
|
|
19
|
+
};
|
|
20
|
+
this.tools.set(tool.name, toolDef);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Map OSSA spec tools to Claude format
|
|
25
|
+
*/
|
|
26
|
+
mapOssaTools(ossaTools) {
|
|
27
|
+
for (const tool of ossaTools) {
|
|
28
|
+
// Skip if already mapped
|
|
29
|
+
if (tool.name && this.tools.has(tool.name)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const toolName = tool.name || this.generateToolName(tool);
|
|
33
|
+
const toolDef = {
|
|
34
|
+
name: toolName,
|
|
35
|
+
description: this.generateToolDescription(tool),
|
|
36
|
+
input_schema: this.generateInputSchema(tool),
|
|
37
|
+
};
|
|
38
|
+
this.tools.set(toolName, toolDef);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Map MCP (Model Context Protocol) capabilities
|
|
43
|
+
*/
|
|
44
|
+
mapMcpCapabilities(capabilities) {
|
|
45
|
+
for (const capability of capabilities) {
|
|
46
|
+
if (this.tools.has(capability)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const toolDef = {
|
|
50
|
+
name: capability,
|
|
51
|
+
description: `Execute ${capability} capability via MCP`,
|
|
52
|
+
input_schema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
input: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Input for the capability',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ['input'],
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
this.tools.set(capability, toolDef);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Map HTTP endpoint to Claude tool
|
|
68
|
+
*/
|
|
69
|
+
mapHttpTool(tool) {
|
|
70
|
+
const toolName = tool.name || this.generateToolName(tool);
|
|
71
|
+
if (this.tools.has(toolName)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const toolDef = {
|
|
75
|
+
name: toolName,
|
|
76
|
+
description: `Execute HTTP request to ${tool.endpoint || 'endpoint'}`,
|
|
77
|
+
input_schema: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
method: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'HTTP method (GET, POST, etc.)',
|
|
83
|
+
},
|
|
84
|
+
body: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
description: 'Request body',
|
|
87
|
+
},
|
|
88
|
+
headers: {
|
|
89
|
+
type: 'object',
|
|
90
|
+
description: 'Request headers',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ['method'],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
this.tools.set(toolName, toolDef);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get all mapped tools as Claude tool format
|
|
100
|
+
*/
|
|
101
|
+
getClaudeTools() {
|
|
102
|
+
return Array.from(this.tools.values()).map((tool) => ({
|
|
103
|
+
name: tool.name,
|
|
104
|
+
description: tool.description,
|
|
105
|
+
input_schema: tool.input_schema,
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get all tools with handlers
|
|
110
|
+
*/
|
|
111
|
+
getTools() {
|
|
112
|
+
return this.tools;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Register a tool handler
|
|
116
|
+
*/
|
|
117
|
+
registerToolHandler(name, handler) {
|
|
118
|
+
const tool = this.tools.get(name);
|
|
119
|
+
if (!tool) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
tool.handler = handler;
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Check if a tool exists
|
|
127
|
+
*/
|
|
128
|
+
hasTool(name) {
|
|
129
|
+
return this.tools.has(name);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get a specific tool
|
|
133
|
+
*/
|
|
134
|
+
getTool(name) {
|
|
135
|
+
return this.tools.get(name);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Clear all tools
|
|
139
|
+
*/
|
|
140
|
+
clear() {
|
|
141
|
+
this.tools.clear();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Generate tool name from OSSA tool spec
|
|
145
|
+
*/
|
|
146
|
+
generateToolName(tool) {
|
|
147
|
+
if (tool.name) {
|
|
148
|
+
return tool.name;
|
|
149
|
+
}
|
|
150
|
+
// Use type and server/namespace to create unique name
|
|
151
|
+
const parts = [tool.type];
|
|
152
|
+
if (tool.server) {
|
|
153
|
+
parts.push(tool.server);
|
|
154
|
+
}
|
|
155
|
+
if (tool.namespace) {
|
|
156
|
+
parts.push(tool.namespace);
|
|
157
|
+
}
|
|
158
|
+
return parts.join('_').replace(/[^a-zA-Z0-9_]/g, '_');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Generate tool description from OSSA tool spec
|
|
162
|
+
*/
|
|
163
|
+
generateToolDescription(tool) {
|
|
164
|
+
const parts = [];
|
|
165
|
+
parts.push(`Execute ${tool.type} tool`);
|
|
166
|
+
if (tool.server) {
|
|
167
|
+
parts.push(`from server: ${tool.server}`);
|
|
168
|
+
}
|
|
169
|
+
if (tool.namespace) {
|
|
170
|
+
parts.push(`namespace: ${tool.namespace}`);
|
|
171
|
+
}
|
|
172
|
+
if (tool.capabilities && tool.capabilities.length > 0) {
|
|
173
|
+
parts.push(`capabilities: ${tool.capabilities.join(', ')}`);
|
|
174
|
+
}
|
|
175
|
+
return parts.join(' | ');
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Generate input schema from OSSA tool spec
|
|
179
|
+
*/
|
|
180
|
+
generateInputSchema(tool) {
|
|
181
|
+
// Check if config has schema information
|
|
182
|
+
if (tool.config && typeof tool.config === 'object') {
|
|
183
|
+
if ('input_schema' in tool.config) {
|
|
184
|
+
return tool.config.input_schema;
|
|
185
|
+
}
|
|
186
|
+
// Use config as properties
|
|
187
|
+
const properties = {};
|
|
188
|
+
for (const [key, value] of Object.entries(tool.config)) {
|
|
189
|
+
properties[key] = {
|
|
190
|
+
type: typeof value === 'number' ? 'number' : 'string',
|
|
191
|
+
description: `${key} parameter`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
type: 'object',
|
|
196
|
+
properties,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
// Default schema based on transport type
|
|
200
|
+
switch (tool.type) {
|
|
201
|
+
case 'mcp':
|
|
202
|
+
return {
|
|
203
|
+
type: 'object',
|
|
204
|
+
properties: {
|
|
205
|
+
input: {
|
|
206
|
+
type: 'string',
|
|
207
|
+
description: 'Input data',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
required: ['input'],
|
|
211
|
+
};
|
|
212
|
+
case 'http':
|
|
213
|
+
return {
|
|
214
|
+
type: 'object',
|
|
215
|
+
properties: {
|
|
216
|
+
method: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
description: 'HTTP method',
|
|
219
|
+
},
|
|
220
|
+
body: {
|
|
221
|
+
type: 'object',
|
|
222
|
+
description: 'Request body',
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
required: ['method'],
|
|
226
|
+
};
|
|
227
|
+
case 'function':
|
|
228
|
+
return {
|
|
229
|
+
type: 'object',
|
|
230
|
+
properties: {
|
|
231
|
+
args: {
|
|
232
|
+
type: 'object',
|
|
233
|
+
description: 'Function arguments',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
default:
|
|
238
|
+
return {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=capability-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-mapper.js","sourceRoot":"","sources":["../../../../src/services/runtime/claude/capability-mapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACnB,KAAK,GAAgC,IAA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thropic-ai/sdk';
|
|
6
|
+
import { ManifestParser } from './manifest-parser.js';
|
|
7
|
+
import { CapabilityMapper } from './capability-mapper.js';
|
|
8
|
+
import type { OssaManifestWithAnthropic, ClaudeRunOptions, ClaudeAdapterConfig, AgentInfo, ToolHandler, ClaudeTool } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Claude adapter for executing OSSA agents
|
|
11
|
+
*/
|
|
12
|
+
export declare class ClaudeAdapter {
|
|
13
|
+
private client;
|
|
14
|
+
private parser;
|
|
15
|
+
private mapper;
|
|
16
|
+
private messages;
|
|
17
|
+
private conversationHistory;
|
|
18
|
+
constructor(config: ClaudeAdapterConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Initialize tools from manifest
|
|
21
|
+
*/
|
|
22
|
+
private initializeTools;
|
|
23
|
+
/**
|
|
24
|
+
* Register a tool handler
|
|
25
|
+
*/
|
|
26
|
+
registerToolHandler(name: string, handler: ToolHandler): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a tool call
|
|
29
|
+
*/
|
|
30
|
+
private executeTool;
|
|
31
|
+
/**
|
|
32
|
+
* Initialize the conversation
|
|
33
|
+
*/
|
|
34
|
+
initialize(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Send a message and get a response
|
|
37
|
+
*/
|
|
38
|
+
chat(userMessage: string, options?: ClaudeRunOptions): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Stream a response (for future implementation)
|
|
41
|
+
*/
|
|
42
|
+
chatStream(userMessage: string, options?: ClaudeRunOptions): Promise<AsyncIterable<string>>;
|
|
43
|
+
/**
|
|
44
|
+
* Get agent information
|
|
45
|
+
*/
|
|
46
|
+
getAgentInfo(): AgentInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Get conversation history
|
|
49
|
+
*/
|
|
50
|
+
getConversationHistory(): Anthropic.MessageParam[];
|
|
51
|
+
/**
|
|
52
|
+
* Clear conversation history
|
|
53
|
+
*/
|
|
54
|
+
clearHistory(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get available tools
|
|
57
|
+
*/
|
|
58
|
+
getTools(): ClaudeTool[];
|
|
59
|
+
/**
|
|
60
|
+
* Get the Anthropic client (for advanced usage)
|
|
61
|
+
*/
|
|
62
|
+
getClient(): Anthropic;
|
|
63
|
+
/**
|
|
64
|
+
* Get the manifest parser
|
|
65
|
+
*/
|
|
66
|
+
getParser(): ManifestParser;
|
|
67
|
+
/**
|
|
68
|
+
* Get the capability mapper
|
|
69
|
+
*/
|
|
70
|
+
getMapper(): CapabilityMapper;
|
|
71
|
+
/**
|
|
72
|
+
* Create a Claude adapter from a manifest file
|
|
73
|
+
*/
|
|
74
|
+
static fromFile(manifestPath: string, apiKey?: string): Promise<ClaudeAdapter>;
|
|
75
|
+
/**
|
|
76
|
+
* Create a Claude adapter from a manifest object
|
|
77
|
+
*/
|
|
78
|
+
static fromManifest(manifest: OssaManifestWithAnthropic, apiKey?: string): ClaudeAdapter;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=claude-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-adapter.d.ts","sourceRoot":"","sources":["../../../../src/services/runtime/claude/claude-adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EACV,yBAAyB,EAEzB,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,mBAAmB,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