@xemahq/opencode-client 0.1.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/LICENSE +201 -0
- package/README.md +67 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/agent-registry.d.ts +3 -0
- package/dist/lib/agent-registry.d.ts.map +1 -0
- package/dist/lib/agent-registry.js +12 -0
- package/dist/lib/agent-registry.js.map +1 -0
- package/dist/lib/agents/agent-markdown-loader.d.ts +11 -0
- package/dist/lib/agents/agent-markdown-loader.d.ts.map +1 -0
- package/dist/lib/agents/agent-markdown-loader.js +194 -0
- package/dist/lib/agents/agent-markdown-loader.js.map +1 -0
- package/dist/lib/agents/index.d.ts +7 -0
- package/dist/lib/agents/index.d.ts.map +1 -0
- package/dist/lib/agents/index.js +25 -0
- package/dist/lib/agents/index.js.map +1 -0
- package/dist/lib/agents/registry.d.ts +7 -0
- package/dist/lib/agents/registry.d.ts.map +1 -0
- package/dist/lib/agents/registry.js +18 -0
- package/dist/lib/agents/registry.js.map +1 -0
- package/dist/lib/agents/types.d.ts +24 -0
- package/dist/lib/agents/types.d.ts.map +1 -0
- package/dist/lib/agents/types.js +11 -0
- package/dist/lib/agents/types.js.map +1 -0
- package/dist/lib/control-plane/agents-md-sections.d.ts +11 -0
- package/dist/lib/control-plane/agents-md-sections.d.ts.map +1 -0
- package/dist/lib/control-plane/agents-md-sections.js +367 -0
- package/dist/lib/control-plane/agents-md-sections.js.map +1 -0
- package/dist/lib/control-plane/index.d.ts +3 -0
- package/dist/lib/control-plane/index.d.ts.map +1 -0
- package/dist/lib/control-plane/index.js +6 -0
- package/dist/lib/control-plane/index.js.map +1 -0
- package/dist/lib/direct-llm-invoker.d.ts +11 -0
- package/dist/lib/direct-llm-invoker.d.ts.map +1 -0
- package/dist/lib/direct-llm-invoker.js +176 -0
- package/dist/lib/direct-llm-invoker.js.map +1 -0
- package/dist/lib/llm-registry-client.d.ts +4 -0
- package/dist/lib/llm-registry-client.d.ts.map +1 -0
- package/dist/lib/llm-registry-client.js +15 -0
- package/dist/lib/llm-registry-client.js.map +1 -0
- package/dist/lib/mcp/mcp-tool-catalog.d.ts +13 -0
- package/dist/lib/mcp/mcp-tool-catalog.d.ts.map +1 -0
- package/dist/lib/mcp/mcp-tool-catalog.js +3 -0
- package/dist/lib/mcp/mcp-tool-catalog.js.map +1 -0
- package/dist/lib/modes/direct-llm.provider.d.ts +11 -0
- package/dist/lib/modes/direct-llm.provider.d.ts.map +1 -0
- package/dist/lib/modes/direct-llm.provider.js +26 -0
- package/dist/lib/modes/direct-llm.provider.js.map +1 -0
- package/dist/lib/opencode-config.interface.d.ts +13 -0
- package/dist/lib/opencode-config.interface.d.ts.map +1 -0
- package/dist/lib/opencode-config.interface.js +5 -0
- package/dist/lib/opencode-config.interface.js.map +1 -0
- package/dist/lib/opencode-utils.d.ts +2 -0
- package/dist/lib/opencode-utils.d.ts.map +1 -0
- package/dist/lib/opencode-utils.js +10 -0
- package/dist/lib/opencode-utils.js.map +1 -0
- package/dist/lib/opencode.module.d.ts +15 -0
- package/dist/lib/opencode.module.d.ts.map +1 -0
- package/dist/lib/opencode.module.js +46 -0
- package/dist/lib/opencode.module.js.map +1 -0
- package/dist/lib/opencode.service.d.ts +11 -0
- package/dist/lib/opencode.service.d.ts.map +1 -0
- package/dist/lib/opencode.service.js +53 -0
- package/dist/lib/opencode.service.js.map +1 -0
- package/dist/lib/opencode.types.d.ts +77 -0
- package/dist/lib/opencode.types.d.ts.map +1 -0
- package/dist/lib/opencode.types.js +3 -0
- package/dist/lib/opencode.types.js.map +1 -0
- package/dist/lib/providers/anthropic.provider.d.ts +12 -0
- package/dist/lib/providers/anthropic.provider.d.ts.map +1 -0
- package/dist/lib/providers/anthropic.provider.js +187 -0
- package/dist/lib/providers/anthropic.provider.js.map +1 -0
- package/dist/lib/providers/llm-provider.interface.d.ts +71 -0
- package/dist/lib/providers/llm-provider.interface.d.ts.map +1 -0
- package/dist/lib/providers/llm-provider.interface.js +3 -0
- package/dist/lib/providers/llm-provider.interface.js.map +1 -0
- package/dist/lib/providers/openai.provider.d.ts +9 -0
- package/dist/lib/providers/openai.provider.d.ts.map +1 -0
- package/dist/lib/providers/openai.provider.js +103 -0
- package/dist/lib/providers/openai.provider.js.map +1 -0
- package/dist/lib/worker-proxy-helpers.d.ts +3 -0
- package/dist/lib/worker-proxy-helpers.d.ts.map +1 -0
- package/dist/lib/worker-proxy-helpers.js +37 -0
- package/dist/lib/worker-proxy-helpers.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
172
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
173
|
+
claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Xema
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/opencode-client">
|
|
3
|
+
<rect width="680" height="120" rx="14" fill="#0B1020"/>
|
|
4
|
+
<g transform="translate(28,34)">
|
|
5
|
+
<path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
|
|
6
|
+
<path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
|
|
7
|
+
</g>
|
|
8
|
+
<text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/opencode-client</text>
|
|
9
|
+
<text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">NestJS module for invoking OpenCode agents</text>
|
|
10
|
+
<text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
|
|
11
|
+
</svg>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://xema.dev">Website</a> ·
|
|
16
|
+
<a href="https://www.npmjs.com/package/@xemahq/opencode-client">npm</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fopencode-client?color=2563eb&label=npm">
|
|
21
|
+
<img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fopencode-client?color=10b981">
|
|
22
|
+
<img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fopencode-client?color=3178c6">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
# @xemahq/opencode-client
|
|
26
|
+
|
|
27
|
+
> NestJS module for invoking OpenCode agents
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
A NestJS module and service for direct LLM invocation through OpenCode, plus the
|
|
32
|
+
supporting agent registry and MCP tool-catalog types. It provides a typed
|
|
33
|
+
direct-LLM façade with tool execution, an in-process agent registry with a
|
|
34
|
+
markdown loader, and the catalog type names that biome content validates
|
|
35
|
+
against. Agent and catalog data live in biome content; this package supplies the
|
|
36
|
+
mechanics and contracts to consume them.
|
|
37
|
+
|
|
38
|
+
## When to use it
|
|
39
|
+
|
|
40
|
+
- Use it in a NestJS service that needs to invoke OpenCode agents directly and
|
|
41
|
+
resolve agent definitions from an in-process registry.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm add @xemahq/opencode-client
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { OpenCodeModule, OpenCodeService } from '@xemahq/opencode-client';
|
|
53
|
+
|
|
54
|
+
@Module({ imports: [OpenCodeModule.forRoot(options)] })
|
|
55
|
+
export class AppModule {}
|
|
56
|
+
|
|
57
|
+
// Then inject OpenCodeService to run a direct-LLM invocation.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Peer requirements
|
|
61
|
+
|
|
62
|
+
- `@nestjs/common` >= 11
|
|
63
|
+
- `@nestjs/config` >= 4
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
Apache-2.0 © Xema — [xema.dev](https://xema.dev)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { OpenCodeModule } from './lib/opencode.module';
|
|
2
|
+
export type { OpenCodeModuleOptions, OpenCodeModuleAsyncOptions, } from './lib/opencode.module';
|
|
3
|
+
export { OpenCodeService } from './lib/opencode.service';
|
|
4
|
+
export type { DirectLlmInput, DirectLlmResult, DirectLlmToolCall, DirectLlmToolResult, DirectLlmToolExecutor, } from './lib/opencode.types';
|
|
5
|
+
export type { OpenCodeConfig, InvocationMode, } from './lib/opencode-config.interface';
|
|
6
|
+
export { OPENCODE_CONFIG } from './lib/opencode-config.interface';
|
|
7
|
+
export { execOnWorker } from './lib/worker-proxy-helpers';
|
|
8
|
+
export { agentRegistry, registerAgentTable, listAgentsByCategory, AgentCategory, resolveAgentConfig, loadAgentMarkdown, loadRuntimeAgentsMarkdown, } from './lib/agent-registry';
|
|
9
|
+
export type { AgentConfig, AgentRegistration } from './lib/agent-registry';
|
|
10
|
+
export type { ToolGroup, CatalogTool, CatalogService, } from './lib/mcp/mcp-tool-catalog';
|
|
11
|
+
export { INSTRUCTION_SECTION_SEEDS } from './lib/control-plane/index';
|
|
12
|
+
export type { InstructionSectionSeed, InstructionMutabilityTier, } from './lib/control-plane/index';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,YAAY,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,cAAc,EACd,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK1D,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAO3E,YAAY,EACV,SAAS,EACT,WAAW,EACX,cAAc,GACf,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INSTRUCTION_SECTION_SEEDS = exports.loadRuntimeAgentsMarkdown = exports.loadAgentMarkdown = exports.resolveAgentConfig = exports.AgentCategory = exports.listAgentsByCategory = exports.registerAgentTable = exports.agentRegistry = exports.execOnWorker = exports.OPENCODE_CONFIG = exports.OpenCodeService = exports.OpenCodeModule = void 0;
|
|
4
|
+
var opencode_module_1 = require("./lib/opencode.module");
|
|
5
|
+
Object.defineProperty(exports, "OpenCodeModule", { enumerable: true, get: function () { return opencode_module_1.OpenCodeModule; } });
|
|
6
|
+
var opencode_service_1 = require("./lib/opencode.service");
|
|
7
|
+
Object.defineProperty(exports, "OpenCodeService", { enumerable: true, get: function () { return opencode_service_1.OpenCodeService; } });
|
|
8
|
+
var opencode_config_interface_1 = require("./lib/opencode-config.interface");
|
|
9
|
+
Object.defineProperty(exports, "OPENCODE_CONFIG", { enumerable: true, get: function () { return opencode_config_interface_1.OPENCODE_CONFIG; } });
|
|
10
|
+
var worker_proxy_helpers_1 = require("./lib/worker-proxy-helpers");
|
|
11
|
+
Object.defineProperty(exports, "execOnWorker", { enumerable: true, get: function () { return worker_proxy_helpers_1.execOnWorker; } });
|
|
12
|
+
var agent_registry_1 = require("./lib/agent-registry");
|
|
13
|
+
Object.defineProperty(exports, "agentRegistry", { enumerable: true, get: function () { return agent_registry_1.agentRegistry; } });
|
|
14
|
+
Object.defineProperty(exports, "registerAgentTable", { enumerable: true, get: function () { return agent_registry_1.registerAgentTable; } });
|
|
15
|
+
Object.defineProperty(exports, "listAgentsByCategory", { enumerable: true, get: function () { return agent_registry_1.listAgentsByCategory; } });
|
|
16
|
+
Object.defineProperty(exports, "AgentCategory", { enumerable: true, get: function () { return agent_registry_1.AgentCategory; } });
|
|
17
|
+
Object.defineProperty(exports, "resolveAgentConfig", { enumerable: true, get: function () { return agent_registry_1.resolveAgentConfig; } });
|
|
18
|
+
Object.defineProperty(exports, "loadAgentMarkdown", { enumerable: true, get: function () { return agent_registry_1.loadAgentMarkdown; } });
|
|
19
|
+
Object.defineProperty(exports, "loadRuntimeAgentsMarkdown", { enumerable: true, get: function () { return agent_registry_1.loadRuntimeAgentsMarkdown; } });
|
|
20
|
+
var index_1 = require("./lib/control-plane/index");
|
|
21
|
+
Object.defineProperty(exports, "INSTRUCTION_SECTION_SEEDS", { enumerable: true, get: function () { return index_1.INSTRUCTION_SECTION_SEEDS; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAQA,yDAAuD;AAA9C,iHAAA,cAAc,OAAA;AAKvB,2DAAyD;AAAhD,mHAAA,eAAe,OAAA;AAcxB,6EAAkE;AAAzD,4HAAA,eAAe,OAAA;AAGxB,mEAA0D;AAAjD,oHAAA,YAAY,OAAA;AAKrB,uDAQ8B;AAP5B,+GAAA,aAAa,OAAA;AACb,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,+GAAA,aAAa,OAAA;AACb,oHAAA,kBAAkB,OAAA;AAClB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAgB3B,mDAAsE;AAA7D,kHAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { agentRegistry, registerAgentTable, listAgentsByCategory, AgentCategory, resolveAgentConfig, loadAgentMarkdown, loadRuntimeAgentsMarkdown, } from './agents';
|
|
2
|
+
export type { AgentConfig, AgentRegistration } from './agents';
|
|
3
|
+
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../../src/lib/agent-registry.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadRuntimeAgentsMarkdown = exports.loadAgentMarkdown = exports.resolveAgentConfig = exports.AgentCategory = exports.listAgentsByCategory = exports.registerAgentTable = exports.agentRegistry = void 0;
|
|
4
|
+
var agents_1 = require("./agents");
|
|
5
|
+
Object.defineProperty(exports, "agentRegistry", { enumerable: true, get: function () { return agents_1.agentRegistry; } });
|
|
6
|
+
Object.defineProperty(exports, "registerAgentTable", { enumerable: true, get: function () { return agents_1.registerAgentTable; } });
|
|
7
|
+
Object.defineProperty(exports, "listAgentsByCategory", { enumerable: true, get: function () { return agents_1.listAgentsByCategory; } });
|
|
8
|
+
Object.defineProperty(exports, "AgentCategory", { enumerable: true, get: function () { return agents_1.AgentCategory; } });
|
|
9
|
+
Object.defineProperty(exports, "resolveAgentConfig", { enumerable: true, get: function () { return agents_1.resolveAgentConfig; } });
|
|
10
|
+
Object.defineProperty(exports, "loadAgentMarkdown", { enumerable: true, get: function () { return agents_1.loadAgentMarkdown; } });
|
|
11
|
+
Object.defineProperty(exports, "loadRuntimeAgentsMarkdown", { enumerable: true, get: function () { return agents_1.loadRuntimeAgentsMarkdown; } });
|
|
12
|
+
//# sourceMappingURL=agent-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-registry.js","sourceRoot":"","sources":["../../src/lib/agent-registry.ts"],"names":[],"mappings":";;;AAcA,mCAQkB;AAPhB,uGAAA,aAAa,OAAA;AACb,4GAAA,kBAAkB,OAAA;AAClB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AACb,4GAAA,kBAAkB,OAAA;AAClB,2GAAA,iBAAiB,OAAA;AACjB,mHAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface AgentMarkdownContent {
|
|
2
|
+
slug: string;
|
|
3
|
+
description: string | null;
|
|
4
|
+
promptTemplate: string;
|
|
5
|
+
systemPrompt: string;
|
|
6
|
+
temperature: number | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function loadAgentMarkdown(slug: string): AgentMarkdownContent;
|
|
9
|
+
export declare function loadRuntimeAgentsMarkdown(): string;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=agent-markdown-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-markdown-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/agent-markdown-loader.ts"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAsND,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAmCpE;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAQlD"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAgentMarkdown = loadAgentMarkdown;
|
|
4
|
+
exports.loadRuntimeAgentsMarkdown = loadRuntimeAgentsMarkdown;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const FRONTMATTER_REGEX = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
|
|
8
|
+
const agentMarkdownCache = new Map();
|
|
9
|
+
let runtimeAgentsMarkdownCache = null;
|
|
10
|
+
function parseFrontmatter(raw) {
|
|
11
|
+
const match = FRONTMATTER_REGEX.exec(raw);
|
|
12
|
+
if (!match?.[1]) {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
const parsed = {};
|
|
16
|
+
for (const line of match[1].split(/\r?\n/)) {
|
|
17
|
+
const separator = line.indexOf(':');
|
|
18
|
+
if (separator === -1) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const key = line.slice(0, separator).trim();
|
|
22
|
+
const value = line.slice(separator + 1).trim();
|
|
23
|
+
if (!key) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
parsed[key] = value;
|
|
27
|
+
}
|
|
28
|
+
return parsed;
|
|
29
|
+
}
|
|
30
|
+
function parseMarkdown(raw) {
|
|
31
|
+
const match = FRONTMATTER_REGEX.exec(raw);
|
|
32
|
+
if (!match) {
|
|
33
|
+
return {
|
|
34
|
+
frontmatter: {},
|
|
35
|
+
body: raw.trim(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
frontmatter: parseFrontmatter(raw),
|
|
40
|
+
body: raw.slice(match[0].length).trim(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function parseTemperature(raw) {
|
|
44
|
+
if (!raw) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
let normalized = raw.trim();
|
|
48
|
+
const isSingleQuoted = normalized.startsWith("'") && normalized.endsWith("'");
|
|
49
|
+
const isDoubleQuoted = normalized.startsWith('"') && normalized.endsWith('"');
|
|
50
|
+
if (isSingleQuoted || isDoubleQuoted) {
|
|
51
|
+
normalized = normalized.slice(1, -1).trim();
|
|
52
|
+
}
|
|
53
|
+
if (!normalized) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
const parsed = Number(normalized);
|
|
57
|
+
if (!Number.isFinite(parsed)) {
|
|
58
|
+
throw new TypeError(`Invalid frontmatter temperature value "${raw}". Expected a finite number.`);
|
|
59
|
+
}
|
|
60
|
+
return parsed;
|
|
61
|
+
}
|
|
62
|
+
function collectWorkspaceCandidates(startDir) {
|
|
63
|
+
const candidates = [];
|
|
64
|
+
let current = (0, node_path_1.resolve)(startDir);
|
|
65
|
+
while (true) {
|
|
66
|
+
candidates.push(current);
|
|
67
|
+
const parent = (0, node_path_1.dirname)(current);
|
|
68
|
+
if (parent === current) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
current = parent;
|
|
72
|
+
}
|
|
73
|
+
return candidates;
|
|
74
|
+
}
|
|
75
|
+
function resolveRuntimeAgentsMdPath() {
|
|
76
|
+
for (const tierRoot of resolvePluginTierRoots()) {
|
|
77
|
+
const path = (0, node_path_1.join)(tierRoot, 'runtime', 'opencode-runtime', 'AGENTS.md');
|
|
78
|
+
if ((0, node_fs_1.existsSync)(path)) {
|
|
79
|
+
return path;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw new Error(`Unable to locate runtime AGENTS.md — expected at ` +
|
|
83
|
+
`<kernel-tier>/runtime/opencode-runtime/AGENTS.md inside one of the ` +
|
|
84
|
+
`XEMA_BIOME_SCAN_ROOTS_SERVER tier roots.`);
|
|
85
|
+
}
|
|
86
|
+
function resolvePluginTierRoots() {
|
|
87
|
+
const envOverride = process.env.XEMA_BIOME_SCAN_ROOTS_SERVER;
|
|
88
|
+
if (envOverride && envOverride.length > 0) {
|
|
89
|
+
return envOverride
|
|
90
|
+
.split(',')
|
|
91
|
+
.map((p) => p.trim())
|
|
92
|
+
.filter((p) => p.length > 0);
|
|
93
|
+
}
|
|
94
|
+
for (const root of [process.cwd(), __dirname]) {
|
|
95
|
+
for (const candidate of collectWorkspaceCandidates(root)) {
|
|
96
|
+
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(candidate, 'plugins')) &&
|
|
97
|
+
(0, node_fs_1.existsSync)((0, node_path_1.join)(candidate, 'pnpm-workspace.yaml'))) {
|
|
98
|
+
return [
|
|
99
|
+
(0, node_path_1.join)(candidate, 'plugins', 'kernel'),
|
|
100
|
+
(0, node_path_1.join)(candidate, 'plugins', 'platform'),
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
throw new Error(`agent-markdown-loader: XEMA_BIOME_SCAN_ROOTS_SERVER is unset and no ` +
|
|
106
|
+
`monorepo workspace was found walking up from ${process.cwd()}. ` +
|
|
107
|
+
`Server processes that load agent .md files MUST declare ` +
|
|
108
|
+
`XEMA_BIOME_SCAN_ROOTS_SERVER in their Helm + docker-compose env.`);
|
|
109
|
+
}
|
|
110
|
+
function collectPluginAgentDirs() {
|
|
111
|
+
const tierRoots = resolvePluginTierRoots();
|
|
112
|
+
const seen = new Set();
|
|
113
|
+
const dirs = [];
|
|
114
|
+
for (const tierDir of tierRoots) {
|
|
115
|
+
if (!(0, node_fs_1.existsSync)(tierDir))
|
|
116
|
+
continue;
|
|
117
|
+
let entries;
|
|
118
|
+
try {
|
|
119
|
+
entries = (0, node_fs_1.readdirSync)(tierDir, { withFileTypes: true });
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const tierAgentDirs = [];
|
|
125
|
+
for (const entry of entries) {
|
|
126
|
+
if (!entry.isDirectory())
|
|
127
|
+
continue;
|
|
128
|
+
const agentDir = (0, node_path_1.resolve)((0, node_path_1.join)(tierDir, String(entry.name), 'agents'));
|
|
129
|
+
if (!(0, node_fs_1.existsSync)(agentDir))
|
|
130
|
+
continue;
|
|
131
|
+
if (seen.has(agentDir))
|
|
132
|
+
continue;
|
|
133
|
+
seen.add(agentDir);
|
|
134
|
+
tierAgentDirs.push(agentDir);
|
|
135
|
+
}
|
|
136
|
+
tierAgentDirs.sort((left, right) => left.localeCompare(right));
|
|
137
|
+
dirs.push(...tierAgentDirs);
|
|
138
|
+
}
|
|
139
|
+
return dirs;
|
|
140
|
+
}
|
|
141
|
+
function resolveAgentSearchDirs() {
|
|
142
|
+
const dirs = [];
|
|
143
|
+
const seen = new Set();
|
|
144
|
+
const pushUniqueDir = (dir) => {
|
|
145
|
+
const normalized = (0, node_path_1.resolve)(dir);
|
|
146
|
+
if (seen.has(normalized)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
seen.add(normalized);
|
|
150
|
+
dirs.push(normalized);
|
|
151
|
+
};
|
|
152
|
+
for (const agentDir of collectPluginAgentDirs()) {
|
|
153
|
+
pushUniqueDir(agentDir);
|
|
154
|
+
}
|
|
155
|
+
return dirs;
|
|
156
|
+
}
|
|
157
|
+
function loadAgentMarkdown(slug) {
|
|
158
|
+
const cached = agentMarkdownCache.get(slug);
|
|
159
|
+
if (cached) {
|
|
160
|
+
return cached;
|
|
161
|
+
}
|
|
162
|
+
const searchDirs = resolveAgentSearchDirs();
|
|
163
|
+
let resolvedPath = null;
|
|
164
|
+
for (const dir of searchDirs) {
|
|
165
|
+
const candidate = (0, node_path_1.join)(dir, `${slug}.md`);
|
|
166
|
+
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
167
|
+
resolvedPath = candidate;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (resolvedPath === null) {
|
|
172
|
+
throw new Error(`Missing agent markdown for slug "${slug}" — searched: ${searchDirs.join(', ')}`);
|
|
173
|
+
}
|
|
174
|
+
const raw = (0, node_fs_1.readFileSync)(resolvedPath, 'utf-8').trim();
|
|
175
|
+
const parsed = parseMarkdown(raw);
|
|
176
|
+
const content = {
|
|
177
|
+
slug,
|
|
178
|
+
description: parsed.frontmatter.description ?? null,
|
|
179
|
+
promptTemplate: raw,
|
|
180
|
+
systemPrompt: parsed.body,
|
|
181
|
+
temperature: parseTemperature(parsed.frontmatter.temperature),
|
|
182
|
+
};
|
|
183
|
+
agentMarkdownCache.set(slug, content);
|
|
184
|
+
return content;
|
|
185
|
+
}
|
|
186
|
+
function loadRuntimeAgentsMarkdown() {
|
|
187
|
+
if (runtimeAgentsMarkdownCache) {
|
|
188
|
+
return runtimeAgentsMarkdownCache;
|
|
189
|
+
}
|
|
190
|
+
const runtimePath = resolveRuntimeAgentsMdPath();
|
|
191
|
+
runtimeAgentsMarkdownCache = (0, node_fs_1.readFileSync)(runtimePath, 'utf-8').trim();
|
|
192
|
+
return runtimeAgentsMarkdownCache;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=agent-markdown-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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
+
export { AgentCategory } from './types';
|
|
3
|
+
export { loadAgentMarkdown, loadRuntimeAgentsMarkdown, } from './agent-markdown-loader';
|
|
4
|
+
export { agentRegistry, registerAgentTable, listAgentsByCategory, } from './registry';
|
|
5
|
+
import type { AgentConfig } from './types';
|
|
6
|
+
export declare function resolveAgentConfig(phaseKey: string): AgentConfig;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/index.ts"],"names":[],"mappings":"AAeA,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAa3C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAYhE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listAgentsByCategory = exports.registerAgentTable = exports.agentRegistry = exports.loadRuntimeAgentsMarkdown = exports.loadAgentMarkdown = exports.AgentCategory = void 0;
|
|
4
|
+
exports.resolveAgentConfig = resolveAgentConfig;
|
|
5
|
+
var types_1 = require("./types");
|
|
6
|
+
Object.defineProperty(exports, "AgentCategory", { enumerable: true, get: function () { return types_1.AgentCategory; } });
|
|
7
|
+
var agent_markdown_loader_1 = require("./agent-markdown-loader");
|
|
8
|
+
Object.defineProperty(exports, "loadAgentMarkdown", { enumerable: true, get: function () { return agent_markdown_loader_1.loadAgentMarkdown; } });
|
|
9
|
+
Object.defineProperty(exports, "loadRuntimeAgentsMarkdown", { enumerable: true, get: function () { return agent_markdown_loader_1.loadRuntimeAgentsMarkdown; } });
|
|
10
|
+
var registry_1 = require("./registry");
|
|
11
|
+
Object.defineProperty(exports, "agentRegistry", { enumerable: true, get: function () { return registry_1.agentRegistry; } });
|
|
12
|
+
Object.defineProperty(exports, "registerAgentTable", { enumerable: true, get: function () { return registry_1.registerAgentTable; } });
|
|
13
|
+
Object.defineProperty(exports, "listAgentsByCategory", { enumerable: true, get: function () { return registry_1.listAgentsByCategory; } });
|
|
14
|
+
const registry_2 = require("./registry");
|
|
15
|
+
function resolveAgentConfig(phaseKey) {
|
|
16
|
+
const entry = registry_2.agentRegistry.get(phaseKey);
|
|
17
|
+
if (!entry) {
|
|
18
|
+
const knownKeys = registry_2.agentRegistry.keys().slice().sort().join(', ');
|
|
19
|
+
throw new Error(`Unknown agent key "${phaseKey}". ` +
|
|
20
|
+
`Register it via the owning biome's agent install function. ` +
|
|
21
|
+
`Known keys: [${knownKeys}]`);
|
|
22
|
+
}
|
|
23
|
+
return { ...entry.config };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/agents/index.ts"],"names":[],"mappings":";;;AAwCA,gDAYC;AApCD,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,iEAGiC;AAF/B,0HAAA,iBAAiB,OAAA;AACjB,kIAAA,yBAAyB,OAAA;AAE3B,uCAIoB;AAHlB,yGAAA,aAAa,OAAA;AACb,8GAAA,kBAAkB,OAAA;AAClB,gHAAA,oBAAoB,OAAA;AAKtB,yCAA2C;AAW3C,SAAgB,kBAAkB,CAAC,QAAgB;IACjD,MAAM,KAAK,GAAG,wBAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,SAAS,GAAG,wBAAa,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,sBAAsB,QAAQ,KAAK;YACjC,6DAA6D;YAC7D,gBAAgB,SAAS,GAAG,CAC/B,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Registry } from '@xemahq/registry';
|
|
2
|
+
import type { AgentConfig, AgentRegistration } from './types';
|
|
3
|
+
import { AgentCategory } from './types';
|
|
4
|
+
export declare const agentRegistry: Registry<string, AgentRegistration>;
|
|
5
|
+
export declare function registerAgentTable(table: Record<string, AgentConfig>, category: AgentCategory): void;
|
|
6
|
+
export declare function listAgentsByCategory(category: AgentCategory): readonly AgentRegistration[];
|
|
7
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAcxC,eAAO,MAAM,aAAa,qCAExB,CAAC;AAMH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAClC,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAKD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,aAAa,GACtB,SAAS,iBAAiB,EAAE,CAE9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentRegistry = void 0;
|
|
4
|
+
exports.registerAgentTable = registerAgentTable;
|
|
5
|
+
exports.listAgentsByCategory = listAgentsByCategory;
|
|
6
|
+
const registry_1 = require("@xemahq/registry");
|
|
7
|
+
exports.agentRegistry = new registry_1.Registry({
|
|
8
|
+
name: 'agent',
|
|
9
|
+
});
|
|
10
|
+
function registerAgentTable(table, category) {
|
|
11
|
+
for (const [key, config] of Object.entries(table)) {
|
|
12
|
+
exports.agentRegistry.register({ key, category, config });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function listAgentsByCategory(category) {
|
|
16
|
+
return exports.agentRegistry.list().filter((r) => r.category === category);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/lib/agents/registry.ts"],"names":[],"mappings":";;;AAyBA,gDAOC;AAKD,oDAIC;AAzCD,+CAA4C;AAiB/B,QAAA,aAAa,GAAG,IAAI,mBAAQ,CAA4B;IACnE,IAAI,EAAE,OAAO;CACd,CAAC,CAAC;AAMH,SAAgB,kBAAkB,CAChC,KAAkC,EAClC,QAAuB;IAEvB,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,qBAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAKD,SAAgB,oBAAoB,CAClC,QAAuB;IAEvB,OAAO,qBAAa,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACrE,CAAC"}
|