language-operator 0.0.1 → 0.1.31
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +125 -0
- data/CHANGELOG.md +88 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +284 -0
- data/LICENSE +229 -21
- data/Makefile +82 -0
- data/README.md +3 -11
- data/Rakefile +63 -0
- data/bin/aictl +7 -0
- data/completions/_aictl +232 -0
- data/completions/aictl.bash +121 -0
- data/completions/aictl.fish +114 -0
- data/docs/architecture/agent-runtime.md +585 -0
- data/docs/dsl/SCHEMA_VERSION.md +250 -0
- data/docs/dsl/agent-reference.md +604 -0
- data/docs/dsl/best-practices.md +1078 -0
- data/docs/dsl/chat-endpoints.md +895 -0
- data/docs/dsl/constraints.md +671 -0
- data/docs/dsl/mcp-integration.md +1177 -0
- data/docs/dsl/webhooks.md +932 -0
- data/docs/dsl/workflows.md +744 -0
- data/lib/language_operator/agent/base.rb +110 -0
- data/lib/language_operator/agent/executor.rb +440 -0
- data/lib/language_operator/agent/instrumentation.rb +54 -0
- data/lib/language_operator/agent/metrics_tracker.rb +183 -0
- data/lib/language_operator/agent/safety/ast_validator.rb +272 -0
- data/lib/language_operator/agent/safety/audit_logger.rb +104 -0
- data/lib/language_operator/agent/safety/budget_tracker.rb +175 -0
- data/lib/language_operator/agent/safety/content_filter.rb +93 -0
- data/lib/language_operator/agent/safety/manager.rb +207 -0
- data/lib/language_operator/agent/safety/rate_limiter.rb +150 -0
- data/lib/language_operator/agent/safety/safe_executor.rb +127 -0
- data/lib/language_operator/agent/scheduler.rb +183 -0
- data/lib/language_operator/agent/telemetry.rb +116 -0
- data/lib/language_operator/agent/web_server.rb +610 -0
- data/lib/language_operator/agent/webhook_authenticator.rb +226 -0
- data/lib/language_operator/agent.rb +149 -0
- data/lib/language_operator/cli/commands/agent.rb +1205 -0
- data/lib/language_operator/cli/commands/cluster.rb +371 -0
- data/lib/language_operator/cli/commands/install.rb +404 -0
- data/lib/language_operator/cli/commands/model.rb +266 -0
- data/lib/language_operator/cli/commands/persona.rb +393 -0
- data/lib/language_operator/cli/commands/quickstart.rb +22 -0
- data/lib/language_operator/cli/commands/status.rb +143 -0
- data/lib/language_operator/cli/commands/system.rb +772 -0
- data/lib/language_operator/cli/commands/tool.rb +537 -0
- data/lib/language_operator/cli/commands/use.rb +47 -0
- data/lib/language_operator/cli/errors/handler.rb +180 -0
- data/lib/language_operator/cli/errors/suggestions.rb +176 -0
- data/lib/language_operator/cli/formatters/code_formatter.rb +77 -0
- data/lib/language_operator/cli/formatters/log_formatter.rb +288 -0
- data/lib/language_operator/cli/formatters/progress_formatter.rb +49 -0
- data/lib/language_operator/cli/formatters/status_formatter.rb +37 -0
- data/lib/language_operator/cli/formatters/table_formatter.rb +163 -0
- data/lib/language_operator/cli/formatters/value_formatter.rb +113 -0
- data/lib/language_operator/cli/helpers/cluster_context.rb +62 -0
- data/lib/language_operator/cli/helpers/cluster_validator.rb +101 -0
- data/lib/language_operator/cli/helpers/editor_helper.rb +58 -0
- data/lib/language_operator/cli/helpers/kubeconfig_validator.rb +167 -0
- data/lib/language_operator/cli/helpers/pastel_helper.rb +24 -0
- data/lib/language_operator/cli/helpers/resource_dependency_checker.rb +74 -0
- data/lib/language_operator/cli/helpers/schedule_builder.rb +108 -0
- data/lib/language_operator/cli/helpers/user_prompts.rb +69 -0
- data/lib/language_operator/cli/main.rb +236 -0
- data/lib/language_operator/cli/templates/tools/generic.yaml +66 -0
- data/lib/language_operator/cli/wizards/agent_wizard.rb +246 -0
- data/lib/language_operator/cli/wizards/quickstart_wizard.rb +588 -0
- data/lib/language_operator/client/base.rb +214 -0
- data/lib/language_operator/client/config.rb +136 -0
- data/lib/language_operator/client/cost_calculator.rb +37 -0
- data/lib/language_operator/client/mcp_connector.rb +123 -0
- data/lib/language_operator/client.rb +19 -0
- data/lib/language_operator/config/cluster_config.rb +101 -0
- data/lib/language_operator/config/tool_patterns.yaml +57 -0
- data/lib/language_operator/config/tool_registry.rb +96 -0
- data/lib/language_operator/config.rb +138 -0
- data/lib/language_operator/dsl/adapter.rb +124 -0
- data/lib/language_operator/dsl/agent_context.rb +90 -0
- data/lib/language_operator/dsl/agent_definition.rb +427 -0
- data/lib/language_operator/dsl/chat_endpoint_definition.rb +115 -0
- data/lib/language_operator/dsl/config.rb +119 -0
- data/lib/language_operator/dsl/context.rb +50 -0
- data/lib/language_operator/dsl/execution_context.rb +47 -0
- data/lib/language_operator/dsl/helpers.rb +109 -0
- data/lib/language_operator/dsl/http.rb +184 -0
- data/lib/language_operator/dsl/mcp_server_definition.rb +73 -0
- data/lib/language_operator/dsl/parameter_definition.rb +124 -0
- data/lib/language_operator/dsl/registry.rb +36 -0
- data/lib/language_operator/dsl/schema.rb +1102 -0
- data/lib/language_operator/dsl/shell.rb +125 -0
- data/lib/language_operator/dsl/tool_definition.rb +112 -0
- data/lib/language_operator/dsl/webhook_authentication.rb +114 -0
- data/lib/language_operator/dsl/webhook_definition.rb +106 -0
- data/lib/language_operator/dsl/workflow_definition.rb +259 -0
- data/lib/language_operator/dsl.rb +161 -0
- data/lib/language_operator/errors.rb +60 -0
- data/lib/language_operator/kubernetes/client.rb +279 -0
- data/lib/language_operator/kubernetes/resource_builder.rb +194 -0
- data/lib/language_operator/loggable.rb +47 -0
- data/lib/language_operator/logger.rb +141 -0
- data/lib/language_operator/retry.rb +123 -0
- data/lib/language_operator/retryable.rb +132 -0
- data/lib/language_operator/templates/README.md +23 -0
- data/lib/language_operator/templates/examples/agent_synthesis.tmpl +115 -0
- data/lib/language_operator/templates/examples/persona_distillation.tmpl +19 -0
- data/lib/language_operator/templates/schema/.gitkeep +0 -0
- data/lib/language_operator/templates/schema/CHANGELOG.md +93 -0
- data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +306 -0
- data/lib/language_operator/templates/schema/agent_dsl_schema.json +452 -0
- data/lib/language_operator/tool_loader.rb +242 -0
- data/lib/language_operator/validators.rb +170 -0
- data/lib/language_operator/version.rb +1 -1
- data/lib/language_operator.rb +65 -3
- data/requirements/tasks/challenge.md +9 -0
- data/requirements/tasks/iterate.md +36 -0
- data/requirements/tasks/optimize.md +21 -0
- data/requirements/tasks/tag.md +5 -0
- data/test_agent_dsl.rb +108 -0
- metadata +507 -20
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
:openapi: 3.0.3
|
|
3
|
+
:info:
|
|
4
|
+
:title: Language Operator Agent API
|
|
5
|
+
:version: 0.1.31
|
|
6
|
+
:description: HTTP API endpoints exposed by Language Operator reactive agents
|
|
7
|
+
:contact:
|
|
8
|
+
:name: Language Operator
|
|
9
|
+
:url: https://github.com/language-operator/language-operator-gem
|
|
10
|
+
:license:
|
|
11
|
+
:name: FSL-1.1-Apache-2.0
|
|
12
|
+
:url: https://github.com/language-operator/language-operator-gem/blob/main/LICENSE
|
|
13
|
+
:servers:
|
|
14
|
+
- :url: http://localhost:8080
|
|
15
|
+
:description: Local development server
|
|
16
|
+
:paths:
|
|
17
|
+
"/health":
|
|
18
|
+
:get:
|
|
19
|
+
:summary: Health check
|
|
20
|
+
:description: Returns the health status of the agent
|
|
21
|
+
:operationId: getHealth
|
|
22
|
+
:tags:
|
|
23
|
+
- Health
|
|
24
|
+
:responses:
|
|
25
|
+
:200:
|
|
26
|
+
:description: Agent is healthy
|
|
27
|
+
:content:
|
|
28
|
+
:application/json:
|
|
29
|
+
:schema:
|
|
30
|
+
:$ref: "#/components/schemas/HealthResponse"
|
|
31
|
+
"/ready":
|
|
32
|
+
:get:
|
|
33
|
+
:summary: Readiness check
|
|
34
|
+
:description: Returns whether the agent is ready to accept requests
|
|
35
|
+
:operationId: getReady
|
|
36
|
+
:tags:
|
|
37
|
+
- Health
|
|
38
|
+
:responses:
|
|
39
|
+
:200:
|
|
40
|
+
:description: Agent is ready
|
|
41
|
+
:content:
|
|
42
|
+
:application/json:
|
|
43
|
+
:schema:
|
|
44
|
+
:$ref: "#/components/schemas/HealthResponse"
|
|
45
|
+
:503:
|
|
46
|
+
:description: Agent is not ready
|
|
47
|
+
:content:
|
|
48
|
+
:application/json:
|
|
49
|
+
:schema:
|
|
50
|
+
:$ref: "#/components/schemas/ErrorResponse"
|
|
51
|
+
"/v1/chat/completions":
|
|
52
|
+
:post:
|
|
53
|
+
:summary: Create chat completion
|
|
54
|
+
:description: Creates a chat completion response (OpenAI-compatible endpoint)
|
|
55
|
+
:operationId: createChatCompletion
|
|
56
|
+
:tags:
|
|
57
|
+
- Chat
|
|
58
|
+
:requestBody:
|
|
59
|
+
:required: true
|
|
60
|
+
:content:
|
|
61
|
+
:application/json:
|
|
62
|
+
:schema:
|
|
63
|
+
:$ref: "#/components/schemas/ChatCompletionRequest"
|
|
64
|
+
:responses:
|
|
65
|
+
:200:
|
|
66
|
+
:description: Successful chat completion response
|
|
67
|
+
:content:
|
|
68
|
+
:application/json:
|
|
69
|
+
:schema:
|
|
70
|
+
:$ref: "#/components/schemas/ChatCompletionResponse"
|
|
71
|
+
:text/event-stream:
|
|
72
|
+
:description: Server-sent events stream (when stream=true)
|
|
73
|
+
:schema:
|
|
74
|
+
:type: string
|
|
75
|
+
:400:
|
|
76
|
+
:description: Invalid request
|
|
77
|
+
:content:
|
|
78
|
+
:application/json:
|
|
79
|
+
:schema:
|
|
80
|
+
:$ref: "#/components/schemas/ErrorResponse"
|
|
81
|
+
"/v1/models":
|
|
82
|
+
:get:
|
|
83
|
+
:summary: List models
|
|
84
|
+
:description: Lists available models (OpenAI-compatible endpoint)
|
|
85
|
+
:operationId: listModels
|
|
86
|
+
:tags:
|
|
87
|
+
- Models
|
|
88
|
+
:responses:
|
|
89
|
+
:200:
|
|
90
|
+
:description: List of available models
|
|
91
|
+
:content:
|
|
92
|
+
:application/json:
|
|
93
|
+
:schema:
|
|
94
|
+
:$ref: "#/components/schemas/ModelList"
|
|
95
|
+
:components:
|
|
96
|
+
:schemas:
|
|
97
|
+
:ChatCompletionRequest:
|
|
98
|
+
:type: object
|
|
99
|
+
:required:
|
|
100
|
+
- model
|
|
101
|
+
- messages
|
|
102
|
+
:properties:
|
|
103
|
+
:model:
|
|
104
|
+
:type: string
|
|
105
|
+
:description: Model name to use for completion
|
|
106
|
+
:messages:
|
|
107
|
+
:type: array
|
|
108
|
+
:description: List of messages in the conversation
|
|
109
|
+
:items:
|
|
110
|
+
:$ref: "#/components/schemas/ChatMessage"
|
|
111
|
+
:temperature:
|
|
112
|
+
:type: number
|
|
113
|
+
:description: Sampling temperature (0.0-2.0)
|
|
114
|
+
:minimum: 0.0
|
|
115
|
+
:maximum: 2.0
|
|
116
|
+
:default: 0.7
|
|
117
|
+
:max_tokens:
|
|
118
|
+
:type: integer
|
|
119
|
+
:description: Maximum tokens in response
|
|
120
|
+
:minimum: 1
|
|
121
|
+
:default: 2000
|
|
122
|
+
:stream:
|
|
123
|
+
:type: boolean
|
|
124
|
+
:description: Stream responses as server-sent events
|
|
125
|
+
:default: false
|
|
126
|
+
:top_p:
|
|
127
|
+
:type: number
|
|
128
|
+
:description: Nucleus sampling parameter
|
|
129
|
+
:minimum: 0.0
|
|
130
|
+
:maximum: 1.0
|
|
131
|
+
:default: 1.0
|
|
132
|
+
:frequency_penalty:
|
|
133
|
+
:type: number
|
|
134
|
+
:description: Frequency penalty (-2.0 to 2.0)
|
|
135
|
+
:minimum: -2.0
|
|
136
|
+
:maximum: 2.0
|
|
137
|
+
:default: 0.0
|
|
138
|
+
:presence_penalty:
|
|
139
|
+
:type: number
|
|
140
|
+
:description: Presence penalty (-2.0 to 2.0)
|
|
141
|
+
:minimum: -2.0
|
|
142
|
+
:maximum: 2.0
|
|
143
|
+
:default: 0.0
|
|
144
|
+
:stop:
|
|
145
|
+
:oneOf:
|
|
146
|
+
- :type: string
|
|
147
|
+
- :type: array
|
|
148
|
+
:items:
|
|
149
|
+
:type: string
|
|
150
|
+
:description: Stop sequences for generation
|
|
151
|
+
:ChatCompletionResponse:
|
|
152
|
+
:type: object
|
|
153
|
+
:required:
|
|
154
|
+
- id
|
|
155
|
+
- object
|
|
156
|
+
- created
|
|
157
|
+
- model
|
|
158
|
+
- choices
|
|
159
|
+
:properties:
|
|
160
|
+
:id:
|
|
161
|
+
:type: string
|
|
162
|
+
:description: Unique identifier for the completion
|
|
163
|
+
:object:
|
|
164
|
+
:type: string
|
|
165
|
+
:description: Object type (always "chat.completion")
|
|
166
|
+
:enum:
|
|
167
|
+
- chat.completion
|
|
168
|
+
:created:
|
|
169
|
+
:type: integer
|
|
170
|
+
:description: Unix timestamp of creation
|
|
171
|
+
:model:
|
|
172
|
+
:type: string
|
|
173
|
+
:description: Model used for completion
|
|
174
|
+
:choices:
|
|
175
|
+
:type: array
|
|
176
|
+
:description: List of completion choices
|
|
177
|
+
:items:
|
|
178
|
+
:$ref: "#/components/schemas/ChatChoice"
|
|
179
|
+
:usage:
|
|
180
|
+
:$ref: "#/components/schemas/ChatUsage"
|
|
181
|
+
:ChatMessage:
|
|
182
|
+
:type: object
|
|
183
|
+
:required:
|
|
184
|
+
- role
|
|
185
|
+
- content
|
|
186
|
+
:properties:
|
|
187
|
+
:role:
|
|
188
|
+
:type: string
|
|
189
|
+
:description: Message role
|
|
190
|
+
:enum:
|
|
191
|
+
- system
|
|
192
|
+
- user
|
|
193
|
+
- assistant
|
|
194
|
+
:content:
|
|
195
|
+
:type: string
|
|
196
|
+
:description: Message content
|
|
197
|
+
:name:
|
|
198
|
+
:type: string
|
|
199
|
+
:description: Optional name of the message author
|
|
200
|
+
:ChatChoice:
|
|
201
|
+
:type: object
|
|
202
|
+
:required:
|
|
203
|
+
- index
|
|
204
|
+
- message
|
|
205
|
+
- finish_reason
|
|
206
|
+
:properties:
|
|
207
|
+
:index:
|
|
208
|
+
:type: integer
|
|
209
|
+
:description: Choice index
|
|
210
|
+
:message:
|
|
211
|
+
:$ref: "#/components/schemas/ChatMessage"
|
|
212
|
+
:finish_reason:
|
|
213
|
+
:type: string
|
|
214
|
+
:description: Reason for completion finish
|
|
215
|
+
:enum:
|
|
216
|
+
- stop
|
|
217
|
+
- length
|
|
218
|
+
- content_filter
|
|
219
|
+
- 'null'
|
|
220
|
+
:ChatUsage:
|
|
221
|
+
:type: object
|
|
222
|
+
:required:
|
|
223
|
+
- prompt_tokens
|
|
224
|
+
- completion_tokens
|
|
225
|
+
- total_tokens
|
|
226
|
+
:properties:
|
|
227
|
+
:prompt_tokens:
|
|
228
|
+
:type: integer
|
|
229
|
+
:description: Tokens in the prompt
|
|
230
|
+
:completion_tokens:
|
|
231
|
+
:type: integer
|
|
232
|
+
:description: Tokens in the completion
|
|
233
|
+
:total_tokens:
|
|
234
|
+
:type: integer
|
|
235
|
+
:description: Total tokens used
|
|
236
|
+
:ModelList:
|
|
237
|
+
:type: object
|
|
238
|
+
:required:
|
|
239
|
+
- object
|
|
240
|
+
- data
|
|
241
|
+
:properties:
|
|
242
|
+
:object:
|
|
243
|
+
:type: string
|
|
244
|
+
:description: Object type (always "list")
|
|
245
|
+
:enum:
|
|
246
|
+
- list
|
|
247
|
+
:data:
|
|
248
|
+
:type: array
|
|
249
|
+
:description: List of available models
|
|
250
|
+
:items:
|
|
251
|
+
:$ref: "#/components/schemas/Model"
|
|
252
|
+
:Model:
|
|
253
|
+
:type: object
|
|
254
|
+
:required:
|
|
255
|
+
- id
|
|
256
|
+
- object
|
|
257
|
+
:properties:
|
|
258
|
+
:id:
|
|
259
|
+
:type: string
|
|
260
|
+
:description: Model identifier
|
|
261
|
+
:object:
|
|
262
|
+
:type: string
|
|
263
|
+
:description: Object type (always "model")
|
|
264
|
+
:enum:
|
|
265
|
+
- model
|
|
266
|
+
:created:
|
|
267
|
+
:type: integer
|
|
268
|
+
:description: Unix timestamp of model creation
|
|
269
|
+
:owned_by:
|
|
270
|
+
:type: string
|
|
271
|
+
:description: Organization that owns the model
|
|
272
|
+
:HealthResponse:
|
|
273
|
+
:type: object
|
|
274
|
+
:required:
|
|
275
|
+
- status
|
|
276
|
+
:properties:
|
|
277
|
+
:status:
|
|
278
|
+
:type: string
|
|
279
|
+
:description: Health status
|
|
280
|
+
:enum:
|
|
281
|
+
- ok
|
|
282
|
+
- ready
|
|
283
|
+
:timestamp:
|
|
284
|
+
:type: string
|
|
285
|
+
:format: date-time
|
|
286
|
+
:description: Timestamp of health check
|
|
287
|
+
:ErrorResponse:
|
|
288
|
+
:type: object
|
|
289
|
+
:required:
|
|
290
|
+
- error
|
|
291
|
+
:properties:
|
|
292
|
+
:error:
|
|
293
|
+
:type: object
|
|
294
|
+
:required:
|
|
295
|
+
- message
|
|
296
|
+
- type
|
|
297
|
+
:properties:
|
|
298
|
+
:message:
|
|
299
|
+
:type: string
|
|
300
|
+
:description: Error message
|
|
301
|
+
:type:
|
|
302
|
+
:type: string
|
|
303
|
+
:description: Error type
|
|
304
|
+
:code:
|
|
305
|
+
:type: string
|
|
306
|
+
:description: Error code
|