@bluefly/openstandardagents 0.3.0 → 0.3.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/CHANGELOG.md +1 -1
- package/README.md +58 -218
- package/dist/cli/commands/diff.command.d.ts +7 -0
- package/dist/cli/commands/diff.command.d.ts.map +1 -0
- package/dist/cli/commands/diff.command.js +181 -0
- package/dist/cli/commands/diff.command.js.map +1 -0
- package/dist/cli/commands/docs.command.d.ts +7 -0
- package/dist/cli/commands/docs.command.d.ts.map +1 -0
- package/dist/cli/commands/docs.command.js +274 -0
- package/dist/cli/commands/docs.command.js.map +1 -0
- package/dist/cli/commands/lint.command.d.ts +7 -0
- package/dist/cli/commands/lint.command.d.ts.map +1 -0
- package/dist/cli/commands/lint.command.js +342 -0
- package/dist/cli/commands/lint.command.js.map +1 -0
- package/dist/cli/commands/serve.command.d.ts +7 -0
- package/dist/cli/commands/serve.command.d.ts.map +1 -0
- package/dist/cli/commands/serve.command.js +232 -0
- package/dist/cli/commands/serve.command.js.map +1 -0
- package/dist/cli/index.js +4 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/di-container.d.ts.map +1 -1
- package/dist/di-container.js +3 -0
- package/dist/di-container.js.map +1 -1
- package/dist/services/git.service.d.ts +40 -0
- package/dist/services/git.service.d.ts.map +1 -0
- package/dist/services/git.service.js +122 -0
- package/dist/services/git.service.js.map +1 -0
- package/dist/spec/v0.3.1/UNIFIED-SCHEMA.md +120 -0
- package/dist/spec/v0.3.1/adapters/drupal.md +541 -0
- package/dist/spec/v0.3.1/adapters/symfony.md +659 -0
- package/dist/spec/v0.3.1/agent-test.schema.json +75 -0
- package/dist/spec/v0.3.1/examples/drupal-content-writer.ossa.yaml +110 -0
- package/dist/spec/v0.3.1/examples/drupal-moderation-assistant.ossa.yaml +96 -0
- package/dist/spec/v0.3.1/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +144 -0
- package/dist/spec/v0.3.1/extensions/drupal.md +417 -0
- package/dist/spec/v0.3.1/ossa-0.3.0.schema.json +2787 -0
- package/dist/spec/v0.3.1/ossa-0.3.1.schema.json +2806 -0
- package/dist/spec/v0.3.1/protocols/sse.md +494 -0
- package/dist/spec/v0.3.1/protocols/webrtc.md +600 -0
- package/dist/spec/v0.3.1/protocols/websocket.md +362 -0
- package/dist/spec/v0.3.1/schemas/agent-unified.yaml +165 -0
- package/dist/spec/v0.3.1/schemas/capabilities.yaml +102 -0
- package/dist/spec/v0.3.1/schemas/functions.yaml +75 -0
- package/dist/spec/v0.3.1/schemas/messaging/channel.schema.json +245 -0
- package/dist/spec/v0.3.1/schemas/messaging/delivery-receipt.schema.json +192 -0
- package/dist/spec/v0.3.1/schemas/messaging/message.schema.json +205 -0
- package/dist/spec/v0.3.1/schemas/messaging/subscription.schema.json +214 -0
- package/dist/spec/v0.3.1/schemas/runtime.yaml +102 -0
- package/dist/spec/v0.3.1/schemas/taxonomy.yaml +533 -0
- package/dist/spec/v0.3.1/schemas/unified-llm.yaml +91 -0
- package/dist/spec/v0.3.1/taxonomy.yaml +256 -0
- package/dist/testing/fixtures.d.ts.map +1 -1
- package/dist/testing/fixtures.js +3 -2
- package/dist/testing/fixtures.js.map +1 -1
- package/package.json +3 -31
- package/spec/v0.3.1/UNIFIED-SCHEMA.md +120 -0
- package/spec/v0.3.1/adapters/drupal.md +541 -0
- package/spec/v0.3.1/adapters/symfony.md +659 -0
- package/spec/v0.3.1/agent-test.schema.json +75 -0
- package/spec/v0.3.1/examples/drupal-content-writer.ossa.yaml +110 -0
- package/spec/v0.3.1/examples/drupal-moderation-assistant.ossa.yaml +96 -0
- package/spec/v0.3.1/examples/quick-wins/complete-agent-with-quick-wins.ossa.yaml +144 -0
- package/spec/v0.3.1/extensions/drupal.md +417 -0
- package/spec/v0.3.1/ossa-0.3.0.schema.json +2787 -0
- package/spec/v0.3.1/ossa-0.3.1.schema.json +2806 -0
- package/spec/v0.3.1/protocols/sse.md +494 -0
- package/spec/v0.3.1/protocols/webrtc.md +600 -0
- package/spec/v0.3.1/protocols/websocket.md +362 -0
- package/spec/v0.3.1/schemas/agent-unified.yaml +165 -0
- package/spec/v0.3.1/schemas/capabilities.yaml +102 -0
- package/spec/v0.3.1/schemas/functions.yaml +75 -0
- package/spec/v0.3.1/schemas/messaging/channel.schema.json +245 -0
- package/spec/v0.3.1/schemas/messaging/delivery-receipt.schema.json +192 -0
- package/spec/v0.3.1/schemas/messaging/message.schema.json +205 -0
- package/spec/v0.3.1/schemas/messaging/subscription.schema.json +214 -0
- package/spec/v0.3.1/schemas/runtime.yaml +102 -0
- package/spec/v0.3.1/schemas/taxonomy.yaml +533 -0
- package/spec/v0.3.1/schemas/unified-llm.yaml +91 -0
- package/spec/v0.3.1/taxonomy.yaml +256 -0
- package/dist/types/generated/ossa-0.3.0.types.d.ts +0 -316
- package/dist/types/generated/ossa-0.3.0.types.d.ts.map +0 -1
- package/dist/types/generated/ossa-0.3.0.types.js +0 -8
- package/dist/types/generated/ossa-0.3.0.types.js.map +0 -1
- package/dist/types/generated/ossa-0.3.0.zod.d.ts +0 -17
- package/dist/types/generated/ossa-0.3.0.zod.d.ts.map +0 -1
- package/dist/types/generated/ossa-0.3.0.zod.js +0 -3
- package/dist/types/generated/ossa-0.3.0.zod.js.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# OSSA v0.3.1 - Unified Agent Schema
|
|
2
|
+
|
|
3
|
+
## The Rocketship 🚀
|
|
4
|
+
|
|
5
|
+
This schema unifies OSSA, GitLab Duo, Google A2A, and MCP into a single universal agent platform.
|
|
6
|
+
|
|
7
|
+
### What Changed
|
|
8
|
+
|
|
9
|
+
**Before (v0.2.x):**
|
|
10
|
+
```yaml
|
|
11
|
+
llm:
|
|
12
|
+
provider: anthropic
|
|
13
|
+
model: claude-sonnet-4-20250514
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**After (v0.3.1):**
|
|
17
|
+
```yaml
|
|
18
|
+
llm:
|
|
19
|
+
provider: ${LLM_PROVIDER:-anthropic}
|
|
20
|
+
model: ${LLM_MODEL:-claude-sonnet}
|
|
21
|
+
profile: ${LLM_PROFILE:-balanced}
|
|
22
|
+
fallback_models:
|
|
23
|
+
- provider: ${LLM_FALLBACK_PROVIDER_1:-openai}
|
|
24
|
+
model: ${LLM_FALLBACK_MODEL_1:-gpt-4o}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Key Features
|
|
28
|
+
|
|
29
|
+
1. **Zero Hardcoded Models** - All LLM config is runtime-configurable
|
|
30
|
+
2. **Execution Profiles** - Google A2A compatible (fast/balanced/deep/safe)
|
|
31
|
+
3. **Multi-Runtime Support** - Works with Duo, A2A, OSSA, MCP
|
|
32
|
+
4. **Fallback Models** - Multi-provider resilience
|
|
33
|
+
5. **Structured Functions** - A2A/OpenAI function calling format
|
|
34
|
+
6. **Extensions** - Pluggable external behaviors
|
|
35
|
+
|
|
36
|
+
### Compatibility Matrix
|
|
37
|
+
|
|
38
|
+
| Feature | OSSA v0.2.x | Duo | A2A | v0.3.1 |
|
|
39
|
+
|---------|-------------|-----|-----|--------|
|
|
40
|
+
| Runtime-configurable models | ❌ | ❌ | ✅ | ✅ |
|
|
41
|
+
| Execution profiles | ❌ | ❌ | ✅ | ✅ |
|
|
42
|
+
| Multi-provider fallback | partial | ❌ | ✅ | ✅ |
|
|
43
|
+
| Structured functions | ❌ | partial | ✅ | ✅ |
|
|
44
|
+
| Extensions | partial | partial | ✅ | ✅ |
|
|
45
|
+
|
|
46
|
+
### Migration
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Auto-migrate all agents
|
|
50
|
+
./scripts/migrate-to-unified-llm.sh
|
|
51
|
+
|
|
52
|
+
# Generate new agent
|
|
53
|
+
./scripts/generate-agent.sh my-agent worker
|
|
54
|
+
|
|
55
|
+
# Validate
|
|
56
|
+
ossa validate examples/
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Environment Variables
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Primary LLM
|
|
63
|
+
export LLM_PROVIDER=anthropic
|
|
64
|
+
export LLM_MODEL=claude-sonnet-4
|
|
65
|
+
export LLM_PROFILE=balanced
|
|
66
|
+
|
|
67
|
+
# Fallbacks
|
|
68
|
+
export LLM_FALLBACK_PROVIDER_1=openai
|
|
69
|
+
export LLM_FALLBACK_MODEL_1=gpt-4o
|
|
70
|
+
|
|
71
|
+
# Runtime
|
|
72
|
+
export AGENT_RUNTIME=unified
|
|
73
|
+
export AGENT_SCHEDULING=fair
|
|
74
|
+
export AGENT_PRIORITY=normal
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Execution Profiles
|
|
78
|
+
|
|
79
|
+
- **fast** - Quick responses (4K tokens, temp=0.0)
|
|
80
|
+
- **balanced** - General ops (16K tokens, temp=0.1)
|
|
81
|
+
- **deep** - Analysis (32K tokens, temp=0.2, reasoning enabled)
|
|
82
|
+
- **safe** - Compliance (temp=0.0, validation required)
|
|
83
|
+
|
|
84
|
+
### CI Enforcement
|
|
85
|
+
|
|
86
|
+
Add to `.gitlab-ci.yml`:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
include:
|
|
90
|
+
- local: .gitlab/ci/validate-no-hardcoded-models.yml
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This blocks any MR with hardcoded model names.
|
|
94
|
+
|
|
95
|
+
### Example Agent
|
|
96
|
+
|
|
97
|
+
See: `examples/unified/security-scanner.ossa.yaml`
|
|
98
|
+
|
|
99
|
+
### Schema Files
|
|
100
|
+
|
|
101
|
+
- `schemas/unified-llm.yaml` - LLM configuration
|
|
102
|
+
- `schemas/runtime.yaml` - Runtime declaration
|
|
103
|
+
- `schemas/capabilities.yaml` - Capability definitions
|
|
104
|
+
- `schemas/functions.yaml` - Function declarations
|
|
105
|
+
- `schemas/agent-unified.yaml` - Complete agent schema
|
|
106
|
+
|
|
107
|
+
### Why This Matters
|
|
108
|
+
|
|
109
|
+
1. **No More Breaking Changes** - Model updates don't require code changes
|
|
110
|
+
2. **Multi-Provider** - Switch between Anthropic/OpenAI/Google/Groq instantly
|
|
111
|
+
3. **Future-Proof** - New runtimes (A2A, Duo) work without modification
|
|
112
|
+
4. **Cost Optimization** - Use cheap models for triage, expensive for analysis
|
|
113
|
+
5. **Compliance** - Audit trail of which models were used when
|
|
114
|
+
|
|
115
|
+
### Next Steps
|
|
116
|
+
|
|
117
|
+
1. Run migration: `./scripts/migrate-to-unified-llm.sh`
|
|
118
|
+
2. Update CI: Add validation rule
|
|
119
|
+
3. Test: `ossa validate examples/`
|
|
120
|
+
4. Deploy: Agents auto-detect runtime
|
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
# Drupal OSSA Runtime Adapter
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Drupal OSSA Runtime Adapter enables execution of OSSA Task, Workflow, and Agent manifests within Drupal's ecosystem. It provides a unified interface that bridges Drupal's five execution models to the OSSA standard.
|
|
6
|
+
|
|
7
|
+
## Background
|
|
8
|
+
|
|
9
|
+
From the conversation with James Abrahams:
|
|
10
|
+
|
|
11
|
+
> "Drupal has 5 execution models that can't talk to each other. If we can bring those 5 things together in Drupal, why can't it be a standard that actually would work outside of Drupal or even outside of PHP?"
|
|
12
|
+
|
|
13
|
+
This adapter answers that question by providing bidirectional mapping between Drupal's native execution engines and OSSA's portable schema.
|
|
14
|
+
|
|
15
|
+
## Execution Models Mapping
|
|
16
|
+
|
|
17
|
+
| Drupal Model | OSSA Kind | Use Case | Mapping Strategy |
|
|
18
|
+
|--------------|-----------|----------|------------------|
|
|
19
|
+
| **ECA** | Task + Workflow | Event-Condition-Action rules | ECA models → deterministic Tasks; complex rules → Workflows |
|
|
20
|
+
| **Maestro** | Workflow | Business process engine | Maestro templates → OSSA Workflow with step orchestration |
|
|
21
|
+
| **FlowDrop** | Workflow | Visual workflow builder | FlowDrop nodes → OSSA Workflow steps |
|
|
22
|
+
| **AI Agent Runner** | Agent | Agentic execution with LLM | Direct mapping to OSSA Agent kind |
|
|
23
|
+
| **Minikanban** | Task | Simple task boards | Kanban cards → individual OSSA Tasks |
|
|
24
|
+
|
|
25
|
+
## Architecture
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
29
|
+
│ Drupal Application │
|
|
30
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
31
|
+
│ ┌─────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐ ┌──────┐ │
|
|
32
|
+
│ │ ECA │ │ Maestro │ │ FlowDrop │ │AI Agent │ │ Mini │ │
|
|
33
|
+
│ │ │ │ │ │ │ │ Runner │ │Kanban│ │
|
|
34
|
+
│ └────┬────┘ └────┬────┘ └────┬─────┘ └────┬────┘ └──┬───┘ │
|
|
35
|
+
│ │ │ │ │ │ │
|
|
36
|
+
│ └────────────┴────────────┴─────────────┴──────────┘ │
|
|
37
|
+
│ │ │
|
|
38
|
+
│ ┌─────────▼─────────┐ │
|
|
39
|
+
│ │ OSSA Adapter │ │
|
|
40
|
+
│ │ --------------- │ │
|
|
41
|
+
│ │ • Manifest Parser│ │
|
|
42
|
+
│ │ • Runtime Binder │ │
|
|
43
|
+
│ │ • State Manager │ │
|
|
44
|
+
│ │ • Observability │ │
|
|
45
|
+
│ └─────────┬─────────┘ │
|
|
46
|
+
│ │ │
|
|
47
|
+
├──────────────────────────────┼──────────────────────────────────┤
|
|
48
|
+
│ ┌─────────▼─────────┐ │
|
|
49
|
+
│ │ OSSA Manifests │ │
|
|
50
|
+
│ │ (Task/Workflow/ │ │
|
|
51
|
+
│ │ Agent) │ │
|
|
52
|
+
│ └───────────────────┘ │
|
|
53
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
composer require ossa/drupal-adapter
|
|
60
|
+
drush en ossa_adapter
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
### Module Configuration (`ossa_adapter.settings.yml`)
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
ossa_adapter:
|
|
69
|
+
# Default runtime for Task execution
|
|
70
|
+
default_runtime: drupal
|
|
71
|
+
|
|
72
|
+
# Manifest discovery paths
|
|
73
|
+
manifest_paths:
|
|
74
|
+
- 'modules/custom/*/manifests'
|
|
75
|
+
- 'config/ossa'
|
|
76
|
+
|
|
77
|
+
# Execution engine preferences
|
|
78
|
+
execution:
|
|
79
|
+
task:
|
|
80
|
+
engine: queue # queue, sync, batch
|
|
81
|
+
queue_name: ossa_tasks
|
|
82
|
+
workflow:
|
|
83
|
+
engine: maestro # maestro, flowdrop, native
|
|
84
|
+
agent:
|
|
85
|
+
engine: ai_agent_runner
|
|
86
|
+
fallback: queue
|
|
87
|
+
|
|
88
|
+
# Observability
|
|
89
|
+
observability:
|
|
90
|
+
enabled: true
|
|
91
|
+
exporter: otel
|
|
92
|
+
endpoint: 'http://localhost:4317'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## ECA Integration
|
|
96
|
+
|
|
97
|
+
### Mapping ECA to OSSA Tasks
|
|
98
|
+
|
|
99
|
+
ECA (Event-Condition-Action) rules map naturally to OSSA Tasks with event triggers:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
# ECA Model → OSSA Task
|
|
103
|
+
apiVersion: ossa/v0.3.1
|
|
104
|
+
kind: Task
|
|
105
|
+
metadata:
|
|
106
|
+
name: eca-node-publish
|
|
107
|
+
annotations:
|
|
108
|
+
drupal.ossa.io/eca-model: node_publish_notify
|
|
109
|
+
|
|
110
|
+
spec:
|
|
111
|
+
execution:
|
|
112
|
+
type: deterministic
|
|
113
|
+
runtime: drupal
|
|
114
|
+
entrypoint: 'Drupal\ossa_adapter\TaskHandler\ECAHandler::execute'
|
|
115
|
+
|
|
116
|
+
# ECA Event → OSSA Trigger
|
|
117
|
+
triggers:
|
|
118
|
+
- type: event
|
|
119
|
+
source: drupal.entity
|
|
120
|
+
event: node.insert
|
|
121
|
+
filter:
|
|
122
|
+
bundle: article
|
|
123
|
+
status: 1
|
|
124
|
+
|
|
125
|
+
# ECA Conditions → OSSA Input Validation
|
|
126
|
+
input:
|
|
127
|
+
type: object
|
|
128
|
+
properties:
|
|
129
|
+
entity:
|
|
130
|
+
type: object
|
|
131
|
+
description: The Drupal entity
|
|
132
|
+
user:
|
|
133
|
+
type: object
|
|
134
|
+
description: Current user context
|
|
135
|
+
|
|
136
|
+
# ECA Actions → OSSA Capabilities
|
|
137
|
+
capabilities:
|
|
138
|
+
- send_email
|
|
139
|
+
- create_entity
|
|
140
|
+
- log_message
|
|
141
|
+
|
|
142
|
+
runtime:
|
|
143
|
+
type: drupal
|
|
144
|
+
bindings:
|
|
145
|
+
send_email:
|
|
146
|
+
plugin: 'eca_mail:send'
|
|
147
|
+
create_entity:
|
|
148
|
+
plugin: 'eca_content:create_entity'
|
|
149
|
+
log_message:
|
|
150
|
+
plugin: 'eca_log:message'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Maestro Integration
|
|
154
|
+
|
|
155
|
+
### Mapping Maestro Templates to OSSA Workflows
|
|
156
|
+
|
|
157
|
+
```yaml
|
|
158
|
+
# Maestro Template → OSSA Workflow
|
|
159
|
+
apiVersion: ossa/v0.3.1
|
|
160
|
+
kind: Workflow
|
|
161
|
+
metadata:
|
|
162
|
+
name: content-approval-workflow
|
|
163
|
+
annotations:
|
|
164
|
+
drupal.ossa.io/maestro-template: content_approval
|
|
165
|
+
|
|
166
|
+
spec:
|
|
167
|
+
triggers:
|
|
168
|
+
- type: event
|
|
169
|
+
source: drupal.entity
|
|
170
|
+
event: node.presave
|
|
171
|
+
filter:
|
|
172
|
+
moderation_state: review
|
|
173
|
+
|
|
174
|
+
steps:
|
|
175
|
+
- id: assign_reviewer
|
|
176
|
+
kind: Task
|
|
177
|
+
ref: ./tasks/assign-reviewer.yaml
|
|
178
|
+
|
|
179
|
+
- id: notify_reviewer
|
|
180
|
+
kind: Task
|
|
181
|
+
ref: ./tasks/notify-user.yaml
|
|
182
|
+
input:
|
|
183
|
+
user_id: ${{ steps.assign_reviewer.output.reviewer_id }}
|
|
184
|
+
message: "New content pending review"
|
|
185
|
+
depends_on:
|
|
186
|
+
- assign_reviewer
|
|
187
|
+
|
|
188
|
+
- id: wait_approval
|
|
189
|
+
kind: Task
|
|
190
|
+
name: Wait for human approval
|
|
191
|
+
inline:
|
|
192
|
+
execution:
|
|
193
|
+
type: human
|
|
194
|
+
timeout_hours: 72
|
|
195
|
+
input:
|
|
196
|
+
type: object
|
|
197
|
+
properties:
|
|
198
|
+
decision:
|
|
199
|
+
type: string
|
|
200
|
+
enum: [approve, reject, revise]
|
|
201
|
+
comments:
|
|
202
|
+
type: string
|
|
203
|
+
depends_on:
|
|
204
|
+
- notify_reviewer
|
|
205
|
+
|
|
206
|
+
- id: process_decision
|
|
207
|
+
kind: Task
|
|
208
|
+
ref: ./tasks/process-decision.yaml
|
|
209
|
+
input:
|
|
210
|
+
entity_id: ${{ workflow.input.entity_id }}
|
|
211
|
+
decision: ${{ steps.wait_approval.output.decision }}
|
|
212
|
+
depends_on:
|
|
213
|
+
- wait_approval
|
|
214
|
+
|
|
215
|
+
runtime:
|
|
216
|
+
type: drupal
|
|
217
|
+
bindings:
|
|
218
|
+
maestro:
|
|
219
|
+
template_id: content_approval
|
|
220
|
+
task_console: /admin/maestro
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## FlowDrop Integration
|
|
224
|
+
|
|
225
|
+
### Mapping FlowDrop to OSSA Workflows
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
# FlowDrop Diagram → OSSA Workflow
|
|
229
|
+
apiVersion: ossa/v0.3.1
|
|
230
|
+
kind: Workflow
|
|
231
|
+
metadata:
|
|
232
|
+
name: user-registration-flow
|
|
233
|
+
annotations:
|
|
234
|
+
drupal.ossa.io/flowdrop-diagram: user_registration_v2
|
|
235
|
+
|
|
236
|
+
spec:
|
|
237
|
+
triggers:
|
|
238
|
+
- type: webhook
|
|
239
|
+
path: /flowdrop/user-registration
|
|
240
|
+
|
|
241
|
+
steps:
|
|
242
|
+
- id: validate_input
|
|
243
|
+
kind: Task
|
|
244
|
+
name: Validate registration data
|
|
245
|
+
inline:
|
|
246
|
+
execution:
|
|
247
|
+
type: deterministic
|
|
248
|
+
runtime: drupal
|
|
249
|
+
entrypoint: 'Drupal\flowdrop\NodeHandler\ValidateNode::execute'
|
|
250
|
+
|
|
251
|
+
- id: check_duplicate
|
|
252
|
+
kind: Task
|
|
253
|
+
name: Check for duplicate email
|
|
254
|
+
ref: ./tasks/check-duplicate-email.yaml
|
|
255
|
+
depends_on:
|
|
256
|
+
- validate_input
|
|
257
|
+
|
|
258
|
+
- id: decision
|
|
259
|
+
kind: Task
|
|
260
|
+
name: Conditional branch
|
|
261
|
+
inline:
|
|
262
|
+
execution:
|
|
263
|
+
type: deterministic
|
|
264
|
+
output:
|
|
265
|
+
type: object
|
|
266
|
+
properties:
|
|
267
|
+
branch:
|
|
268
|
+
type: string
|
|
269
|
+
input:
|
|
270
|
+
condition: ${{ steps.check_duplicate.output.exists }}
|
|
271
|
+
depends_on:
|
|
272
|
+
- check_duplicate
|
|
273
|
+
|
|
274
|
+
- id: create_user
|
|
275
|
+
kind: Task
|
|
276
|
+
ref: ./tasks/create-user.yaml
|
|
277
|
+
condition: ${{ steps.decision.output.branch == 'new' }}
|
|
278
|
+
depends_on:
|
|
279
|
+
- decision
|
|
280
|
+
|
|
281
|
+
- id: send_error
|
|
282
|
+
kind: Task
|
|
283
|
+
ref: ./tasks/send-error-response.yaml
|
|
284
|
+
condition: ${{ steps.decision.output.branch == 'duplicate' }}
|
|
285
|
+
depends_on:
|
|
286
|
+
- decision
|
|
287
|
+
|
|
288
|
+
runtime:
|
|
289
|
+
type: drupal
|
|
290
|
+
bindings:
|
|
291
|
+
flowdrop:
|
|
292
|
+
diagram_id: user_registration_v2
|
|
293
|
+
visual_editor: /admin/flowdrop/user_registration_v2
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## AI Agent Runner Integration
|
|
297
|
+
|
|
298
|
+
### Direct OSSA Agent Mapping
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
# AI Agent Runner → OSSA Agent
|
|
302
|
+
apiVersion: ossa/v0.3.1
|
|
303
|
+
kind: Agent
|
|
304
|
+
metadata:
|
|
305
|
+
name: content-assistant
|
|
306
|
+
version: 1.0.0
|
|
307
|
+
annotations:
|
|
308
|
+
drupal.ossa.io/ai-agent-runner: content_assistant
|
|
309
|
+
|
|
310
|
+
spec:
|
|
311
|
+
model:
|
|
312
|
+
provider: openai
|
|
313
|
+
name: gpt-4
|
|
314
|
+
|
|
315
|
+
system_prompt: |
|
|
316
|
+
You are a content assistant for a Drupal website.
|
|
317
|
+
Help users create, edit, and organize content.
|
|
318
|
+
|
|
319
|
+
capabilities:
|
|
320
|
+
- create_node
|
|
321
|
+
- update_node
|
|
322
|
+
- list_content
|
|
323
|
+
- search_content
|
|
324
|
+
- manage_taxonomy
|
|
325
|
+
|
|
326
|
+
reasoning:
|
|
327
|
+
strategy: react
|
|
328
|
+
max_steps: 10
|
|
329
|
+
|
|
330
|
+
runtime:
|
|
331
|
+
type: drupal
|
|
332
|
+
bindings:
|
|
333
|
+
create_node:
|
|
334
|
+
service: '@entity_type.manager'
|
|
335
|
+
method: 'getStorage("node")->create'
|
|
336
|
+
update_node:
|
|
337
|
+
service: '@entity_type.manager'
|
|
338
|
+
method: 'getStorage("node")->save'
|
|
339
|
+
list_content:
|
|
340
|
+
plugin: 'ai_agent_runner:content_list'
|
|
341
|
+
search_content:
|
|
342
|
+
service: '@search_api.query_helper'
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Minikanban Integration
|
|
346
|
+
|
|
347
|
+
### Mapping Kanban Cards to OSSA Tasks
|
|
348
|
+
|
|
349
|
+
```yaml
|
|
350
|
+
# Minikanban Card → OSSA Task
|
|
351
|
+
apiVersion: ossa/v0.3.1
|
|
352
|
+
kind: Task
|
|
353
|
+
metadata:
|
|
354
|
+
name: kanban-task
|
|
355
|
+
annotations:
|
|
356
|
+
drupal.ossa.io/minikanban-card: card_12345
|
|
357
|
+
|
|
358
|
+
spec:
|
|
359
|
+
execution:
|
|
360
|
+
type: human
|
|
361
|
+
assignee: ${{ input.assigned_to }}
|
|
362
|
+
due_date: ${{ input.due_date }}
|
|
363
|
+
|
|
364
|
+
input:
|
|
365
|
+
type: object
|
|
366
|
+
properties:
|
|
367
|
+
title:
|
|
368
|
+
type: string
|
|
369
|
+
description:
|
|
370
|
+
type: string
|
|
371
|
+
assigned_to:
|
|
372
|
+
type: string
|
|
373
|
+
format: user_id
|
|
374
|
+
due_date:
|
|
375
|
+
type: string
|
|
376
|
+
format: date
|
|
377
|
+
priority:
|
|
378
|
+
type: string
|
|
379
|
+
enum: [low, medium, high, critical]
|
|
380
|
+
labels:
|
|
381
|
+
type: array
|
|
382
|
+
items:
|
|
383
|
+
type: string
|
|
384
|
+
|
|
385
|
+
output:
|
|
386
|
+
type: object
|
|
387
|
+
properties:
|
|
388
|
+
status:
|
|
389
|
+
type: string
|
|
390
|
+
enum: [todo, in_progress, review, done]
|
|
391
|
+
completed_at:
|
|
392
|
+
type: string
|
|
393
|
+
format: date-time
|
|
394
|
+
|
|
395
|
+
runtime:
|
|
396
|
+
type: drupal
|
|
397
|
+
bindings:
|
|
398
|
+
minikanban:
|
|
399
|
+
board_id: default
|
|
400
|
+
status_column_map:
|
|
401
|
+
todo: backlog
|
|
402
|
+
in_progress: doing
|
|
403
|
+
review: review
|
|
404
|
+
done: done
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Bidirectional Sync
|
|
408
|
+
|
|
409
|
+
The adapter supports bidirectional synchronization:
|
|
410
|
+
|
|
411
|
+
### Export: Drupal → OSSA
|
|
412
|
+
|
|
413
|
+
```php
|
|
414
|
+
use Drupal\ossa_adapter\Exporter\OSSAExporter;
|
|
415
|
+
|
|
416
|
+
$exporter = \Drupal::service('ossa_adapter.exporter');
|
|
417
|
+
|
|
418
|
+
// Export ECA model
|
|
419
|
+
$manifest = $exporter->exportECA('my_eca_model');
|
|
420
|
+
|
|
421
|
+
// Export Maestro template
|
|
422
|
+
$manifest = $exporter->exportMaestro('content_approval');
|
|
423
|
+
|
|
424
|
+
// Export all workflows
|
|
425
|
+
$manifests = $exporter->exportAll(['type' => 'workflow']);
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Import: OSSA → Drupal
|
|
429
|
+
|
|
430
|
+
```php
|
|
431
|
+
use Drupal\ossa_adapter\Importer\OSSAImporter;
|
|
432
|
+
|
|
433
|
+
$importer = \Drupal::service('ossa_adapter.importer');
|
|
434
|
+
|
|
435
|
+
// Import OSSA manifest
|
|
436
|
+
$importer->import('/path/to/manifest.yaml', [
|
|
437
|
+
'target' => 'maestro', // maestro, eca, flowdrop
|
|
438
|
+
'overwrite' => false,
|
|
439
|
+
]);
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
## CLI Commands
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
# Validate OSSA manifest
|
|
446
|
+
drush ossa:validate /path/to/manifest.yaml
|
|
447
|
+
|
|
448
|
+
# Export Drupal workflows to OSSA
|
|
449
|
+
drush ossa:export --type=workflow --output=/path/to/output
|
|
450
|
+
|
|
451
|
+
# Import OSSA manifest to Drupal
|
|
452
|
+
drush ossa:import /path/to/manifest.yaml --engine=maestro
|
|
453
|
+
|
|
454
|
+
# List all OSSA-compatible workflows
|
|
455
|
+
drush ossa:list
|
|
456
|
+
|
|
457
|
+
# Run an OSSA Task
|
|
458
|
+
drush ossa:run task my-task --input='{"key": "value"}'
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
## Observability
|
|
462
|
+
|
|
463
|
+
### OpenTelemetry Integration
|
|
464
|
+
|
|
465
|
+
The adapter exports traces using OSSA semantic conventions:
|
|
466
|
+
|
|
467
|
+
```php
|
|
468
|
+
// Automatic span creation for Task execution
|
|
469
|
+
$tracer->startSpan('ossa.task.execute', [
|
|
470
|
+
'ossa.task.name' => 'my-task',
|
|
471
|
+
'ossa.task.version' => '1.0.0',
|
|
472
|
+
'drupal.execution.engine' => 'eca',
|
|
473
|
+
]);
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Metrics
|
|
477
|
+
|
|
478
|
+
```yaml
|
|
479
|
+
# Prometheus metrics exposed at /metrics
|
|
480
|
+
ossa_task_executions_total{task="my-task", status="success"} 42
|
|
481
|
+
ossa_task_duration_seconds{task="my-task"} 0.123
|
|
482
|
+
ossa_workflow_steps_completed{workflow="content-approval"} 156
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## Error Handling
|
|
486
|
+
|
|
487
|
+
```yaml
|
|
488
|
+
spec:
|
|
489
|
+
error_handling:
|
|
490
|
+
on_error: retry
|
|
491
|
+
retry:
|
|
492
|
+
max_attempts: 3
|
|
493
|
+
backoff_strategy: exponential
|
|
494
|
+
|
|
495
|
+
# Drupal-specific error mapping
|
|
496
|
+
error_codes:
|
|
497
|
+
ENTITY_VALIDATION_FAILED:
|
|
498
|
+
drupal_exception: 'EntityStorageException'
|
|
499
|
+
retryable: false
|
|
500
|
+
PERMISSION_DENIED:
|
|
501
|
+
drupal_exception: 'AccessDeniedHttpException'
|
|
502
|
+
retryable: false
|
|
503
|
+
DATABASE_ERROR:
|
|
504
|
+
drupal_exception: 'DatabaseExceptionWrapper'
|
|
505
|
+
retryable: true
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
## Migration Guide
|
|
509
|
+
|
|
510
|
+
### From ECA to OSSA
|
|
511
|
+
|
|
512
|
+
1. Export existing ECA models: `drush ossa:export --engine=eca`
|
|
513
|
+
2. Review generated manifests
|
|
514
|
+
3. Test execution: `drush ossa:run task exported-eca-task`
|
|
515
|
+
4. Optionally disable original ECA model
|
|
516
|
+
|
|
517
|
+
### From Maestro to OSSA
|
|
518
|
+
|
|
519
|
+
1. Export Maestro template: `drush ossa:export --engine=maestro --template=my_template`
|
|
520
|
+
2. Map human tasks to OSSA `execution.type: human`
|
|
521
|
+
3. Configure queue integration
|
|
522
|
+
4. Test workflow: `drush ossa:run workflow exported-maestro-workflow`
|
|
523
|
+
|
|
524
|
+
## OSSA Compliance
|
|
525
|
+
|
|
526
|
+
This adapter implements OSSA v0.3.1 specification:
|
|
527
|
+
|
|
528
|
+
- ✅ Task execution with deterministic semantics
|
|
529
|
+
- ✅ Workflow orchestration with step dependencies
|
|
530
|
+
- ✅ Agent execution with LLM integration
|
|
531
|
+
- ✅ Capability abstraction and runtime bindings
|
|
532
|
+
- ✅ OpenTelemetry observability
|
|
533
|
+
- ✅ Error handling with retry strategies
|
|
534
|
+
- ✅ Input/output schema validation
|
|
535
|
+
|
|
536
|
+
## Related
|
|
537
|
+
|
|
538
|
+
- [OSSA Specification v0.3.1](../README.md)
|
|
539
|
+
- [Symfony Adapter](./symfony.md)
|
|
540
|
+
- [Node.js Adapter](./nodejs.md)
|
|
541
|
+
- [Capability Registry](../capability-schema.md)
|