mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
feat(web): create automation via raw JSON
This commit is contained in:
parent
4625bd937e
commit
ed8d56aa16
7 changed files with 295 additions and 14 deletions
44
surfsense_web/lib/automations/default-template.ts
Normal file
44
surfsense_web/lib/automations/default-template.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Minimal valid ``AutomationCreate`` skeleton used to seed the raw-JSON
|
||||
* create form. ``search_space_id`` is omitted on purpose — the form
|
||||
* injects it from the route so users never have to know their id.
|
||||
*
|
||||
* The shape matches the Pydantic ``AutomationCreate`` model less the
|
||||
* search_space_id field; Zod validates the merged payload before submit.
|
||||
*/
|
||||
export const DEFAULT_AUTOMATION_TEMPLATE = {
|
||||
name: "My automation",
|
||||
description: null,
|
||||
definition: {
|
||||
name: "My automation",
|
||||
goal: null,
|
||||
plan: [
|
||||
{
|
||||
step_id: "step_1",
|
||||
action: "agent_task",
|
||||
params: {
|
||||
query: "Summarize new docs added to folder 12 since the last run.",
|
||||
},
|
||||
},
|
||||
],
|
||||
execution: {
|
||||
timeout_seconds: 600,
|
||||
max_retries: 2,
|
||||
retry_backoff: "exponential",
|
||||
concurrency: "drop_if_running",
|
||||
on_failure: [],
|
||||
},
|
||||
metadata: { tags: [] },
|
||||
},
|
||||
triggers: [
|
||||
{
|
||||
type: "schedule",
|
||||
params: {
|
||||
cron: "0 9 * * 1-5",
|
||||
timezone: "UTC",
|
||||
},
|
||||
static_inputs: {},
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
} as const;
|
||||
Loading…
Add table
Add a link
Reference in a new issue