-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cel): custom data transformation functions (#14) #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4f5044c
docs: add spec for data transformation CEL functions (#14)
michaelmcnees a07483a
docs: add implementation plan for data transformation CEL functions (…
michaelmcnees d1b4959
test(cel): add coverage for built-in map/filter/exists/all macros
michaelmcnees c1b7879
feat(cel): add toLower, toUpper, trim string functions
michaelmcnees a4f6744
feat(cel): add replace and split string functions
michaelmcnees 3913d47
feat(cel): add parseInt, parseFloat, toString type coercion functions
michaelmcnees 0e5d8e9
feat(cel): add obj() map construction function
michaelmcnees ccb63e5
feat(cel): add default() null coalescing and flatten() functions
michaelmcnees b0e4d64
feat(cel): add jsonEncode and jsonDecode functions
michaelmcnees a636201
feat(cel): add timestamp and formatTimestamp date/time functions
michaelmcnees 3f42c17
docs: add custom CEL functions and macros to expressions reference (#14)
michaelmcnees e735241
feat: add data transformation and AI enrichment example workflows (#14)
michaelmcnees 7085f68
docs: add data transformation patterns guide (#14)
michaelmcnees ee7f873
fix: address CodeRabbit review — null handling, date formats, docs, t…
michaelmcnees 3473d2a
fix: address PR #21 review — non-strict default, jsonDecode precision…
michaelmcnees 2d826be
fix: address PR #21 review round 3 — test coverage, trailing JSON, do…
michaelmcnees 9a70a0e
fix: address PR #21 review round 4 — EOF trailing check, docs, plan c…
michaelmcnees ed5845c
fix: address PR #21 review round 5 — precision, flatten, plan accuracy
michaelmcnees 7ca272a
fix(plan): correct test selector to TestFunc_ParseTimestamp
michaelmcnees 2fd37e9
chore: remove force-added superpowers docs from tracking
michaelmcnees c4788c3
📝 CodeRabbit Chat: Add generated unit tests
coderabbitai[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
981 changes: 0 additions & 981 deletions
981
docs/superpowers/plans/2026-03-24-init-connection-recovery.md
This file was deleted.
Oops, something went wrong.
174 changes: 0 additions & 174 deletions
174
docs/superpowers/specs/2026-03-24-init-connection-recovery-design.md
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: ai-data-enrichment | ||
| description: > | ||
| Fetches support tickets, uses an AI model to classify priority and | ||
| extract key entities, then stores the enriched data. Demonstrates | ||
| using AI for transforms that require interpretation rather than | ||
| simple structural mapping. | ||
|
|
||
| inputs: | ||
| ticket_api_url: | ||
| type: string | ||
| description: URL to fetch support tickets from | ||
|
|
||
| steps: | ||
| - name: fetch-tickets | ||
| action: http/request | ||
| timeout: "15s" | ||
| params: | ||
| method: GET | ||
| url: "{{ inputs.ticket_api_url }}" | ||
| headers: | ||
| Accept: "application/json" | ||
|
|
||
| - name: classify | ||
| action: ai/completion | ||
| credential: openai | ||
| timeout: "60s" | ||
| params: | ||
| model: gpt-4o | ||
| system_prompt: > | ||
| You are a support ticket classifier. Given a ticket, determine | ||
| the priority (critical, high, medium, low), category, and extract | ||
| any mentioned product names or error codes. | ||
| prompt: "Classify this ticket: {{ steps['fetch-tickets'].output.body }}" | ||
| output_schema: | ||
| type: object | ||
| properties: | ||
| priority: | ||
| type: string | ||
| enum: [critical, high, medium, low] | ||
| category: | ||
| type: string | ||
| products: | ||
| type: array | ||
| items: | ||
| type: string | ||
| error_codes: | ||
| type: array | ||
| items: | ||
| type: string | ||
| required: [priority, category, products, error_codes] | ||
| additionalProperties: false | ||
|
|
||
| - name: store-enriched | ||
| action: postgres/query | ||
| credential: app-db | ||
| if: "steps.classify.output.json.priority == 'critical' || steps.classify.output.json.priority == 'high'" | ||
| params: | ||
| query: > | ||
| INSERT INTO urgent_tickets (priority, category, products, raw_body) | ||
| VALUES ($1, $2, $3, $4) | ||
| args: | ||
| - "{{ steps.classify.output.json.priority }}" | ||
| - "{{ steps.classify.output.json.category }}" | ||
| - "{{ jsonEncode(steps.classify.output.json.products) }}" | ||
| - "{{ steps['fetch-tickets'].output.body }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: data-transform-api-to-db | ||
| description: > | ||
| Fetches a user from an API, transforms the record using CEL expressions | ||
| to match a database schema, and inserts the normalized data into Postgres. | ||
| Demonstrates toLower() and string functions without requiring an AI model. | ||
|
|
||
| steps: | ||
| - name: fetch-user | ||
| action: http/request | ||
| timeout: "15s" | ||
| params: | ||
| method: GET | ||
| url: "https://jsonplaceholder.typicode.com/users/1" | ||
| headers: | ||
| Accept: "application/json" | ||
|
|
||
| - name: store-user | ||
| action: postgres/query | ||
| credential: app-db | ||
| params: | ||
| query: "INSERT INTO users (username, email, city) VALUES ($1, $2, $3)" | ||
| args: | ||
| - "{{ steps['fetch-user'].output.json.username.toLower() }}" | ||
| - "{{ steps['fetch-user'].output.json.email.toLower() }}" | ||
| - "{{ steps['fetch-user'].output.json.address.city }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.