language-operator 0.1.30 → 0.1.35
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 +7 -8
- data/CHANGELOG.md +49 -0
- data/CI_STATUS.md +56 -0
- data/Gemfile.lock +2 -2
- data/Makefile +28 -7
- data/Rakefile +29 -0
- data/docs/dsl/SCHEMA_VERSION.md +250 -0
- data/docs/dsl/agent-reference.md +13 -0
- data/lib/language_operator/agent/base.rb +10 -6
- data/lib/language_operator/agent/executor.rb +19 -97
- data/lib/language_operator/agent/safety/ast_validator.rb +62 -43
- data/lib/language_operator/agent/safety/safe_executor.rb +39 -2
- data/lib/language_operator/agent/scheduler.rb +60 -0
- data/lib/language_operator/agent/task_executor.rb +548 -0
- data/lib/language_operator/agent.rb +90 -27
- data/lib/language_operator/cli/base_command.rb +117 -0
- data/lib/language_operator/cli/commands/agent.rb +351 -466
- data/lib/language_operator/cli/commands/cluster.rb +276 -256
- data/lib/language_operator/cli/commands/install.rb +110 -119
- data/lib/language_operator/cli/commands/model.rb +284 -184
- data/lib/language_operator/cli/commands/persona.rb +220 -289
- data/lib/language_operator/cli/commands/quickstart.rb +4 -5
- data/lib/language_operator/cli/commands/status.rb +36 -53
- data/lib/language_operator/cli/commands/system.rb +760 -0
- data/lib/language_operator/cli/commands/tool.rb +356 -422
- data/lib/language_operator/cli/commands/use.rb +19 -22
- data/lib/language_operator/cli/formatters/code_formatter.rb +3 -7
- data/lib/language_operator/cli/formatters/log_formatter.rb +3 -5
- data/lib/language_operator/cli/formatters/progress_formatter.rb +3 -7
- data/lib/language_operator/cli/formatters/status_formatter.rb +37 -0
- data/lib/language_operator/cli/formatters/table_formatter.rb +10 -26
- data/lib/language_operator/cli/helpers/pastel_helper.rb +24 -0
- data/lib/language_operator/cli/helpers/resource_dependency_checker.rb +0 -18
- data/lib/language_operator/cli/main.rb +4 -0
- data/lib/language_operator/cli/wizards/quickstart_wizard.rb +0 -1
- data/lib/language_operator/client/config.rb +20 -21
- data/lib/language_operator/config.rb +115 -3
- data/lib/language_operator/constants.rb +54 -0
- data/lib/language_operator/dsl/agent_context.rb +7 -7
- data/lib/language_operator/dsl/agent_definition.rb +111 -26
- data/lib/language_operator/dsl/config.rb +30 -66
- data/lib/language_operator/dsl/main_definition.rb +114 -0
- data/lib/language_operator/dsl/schema.rb +1143 -0
- data/lib/language_operator/dsl/task_definition.rb +315 -0
- data/lib/language_operator/dsl.rb +1 -1
- data/lib/language_operator/instrumentation/task_tracer.rb +285 -0
- data/lib/language_operator/logger.rb +4 -4
- data/lib/language_operator/synthesis_test_harness.rb +324 -0
- data/lib/language_operator/templates/README.md +23 -0
- data/lib/language_operator/templates/examples/agent_synthesis.tmpl +133 -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 +119 -0
- data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +306 -0
- data/lib/language_operator/templates/schema/agent_dsl_schema.json +494 -0
- data/lib/language_operator/type_coercion.rb +250 -0
- data/lib/language_operator/ux/base.rb +81 -0
- data/lib/language_operator/ux/concerns/README.md +155 -0
- data/lib/language_operator/ux/concerns/headings.rb +90 -0
- data/lib/language_operator/ux/concerns/input_validation.rb +146 -0
- data/lib/language_operator/ux/concerns/provider_helpers.rb +167 -0
- data/lib/language_operator/ux/create_agent.rb +252 -0
- data/lib/language_operator/ux/create_model.rb +267 -0
- data/lib/language_operator/ux/quickstart.rb +594 -0
- data/lib/language_operator/version.rb +1 -1
- data/lib/language_operator.rb +2 -0
- data/requirements/ARCHITECTURE.md +1 -0
- data/requirements/SCRATCH.md +153 -0
- data/requirements/dsl.md +0 -0
- data/requirements/features +1 -0
- data/requirements/personas +1 -0
- data/requirements/proposals +1 -0
- data/requirements/tasks/iterate.md +14 -15
- data/requirements/tasks/optimize.md +13 -4
- data/synth/001/Makefile +90 -0
- data/synth/001/agent.rb +26 -0
- data/synth/001/agent.yaml +7 -0
- data/synth/001/output.log +44 -0
- data/synth/Makefile +39 -0
- data/synth/README.md +342 -0
- metadata +49 -18
- data/examples/README.md +0 -569
- data/examples/agent_example.rb +0 -86
- data/examples/chat_endpoint_agent.rb +0 -118
- data/examples/github_webhook_agent.rb +0 -171
- data/examples/mcp_agent.rb +0 -158
- data/examples/oauth_callback_agent.rb +0 -296
- data/examples/stripe_webhook_agent.rb +0 -219
- data/examples/webhook_agent.rb +0 -80
- data/lib/language_operator/dsl/workflow_definition.rb +0 -259
- data/test_agent_dsl.rb +0 -108
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
:openapi: 3.0.3
|
|
3
|
+
:info:
|
|
4
|
+
:title: Language Operator Agent API
|
|
5
|
+
:version: 0.1.35
|
|
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
|